commits
Threads by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
July 2015
- 1 participants
- 77 discussions
[mpich] MPICH primary repository branch, master, updated. v3.2b3-192-g24647c3
by noreply@mpich.org 08 Jul '15
by noreply@mpich.org 08 Jul '15
08 Jul '15
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 24647c3b0b4fccb60962d61d154eb289fa776d31 (commit)
from 2e0aa863c4c8f2b4c260eb97def4f4910e31fcc3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/24647c3b0b4fccb60962d61d154eb289f…
commit 24647c3b0b4fccb60962d61d154eb289fa776d31
Author: Lena Oden <loden(a)anl.gov>
Date: Wed Jul 8 16:52:49 2015 -0500
remove a wrong colon
diff --git a/test/mpi/util/mtest.c b/test/mpi/util/mtest.c
index b77439c..a028f9d 100644
--- a/test/mpi/util/mtest.c
+++ b/test/mpi/util/mtest.c
@@ -892,7 +892,7 @@ int MTestTestIntercomm(MPI_Comm comm)
if (rbuf[0] != j) {
printf("[%d] Expected rank %d but saw %d in %s\n",
wrank, j, rbuf[0], commname);
- errs++;:
+ errs++;
}
if (rbuf[1] != rank) {
printf( "[%d] Expected target rank %d but saw %d from %d in %s\n",
-----------------------------------------------------------------------
Summary of changes:
test/mpi/util/mtest.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-191-g2e0aa86
by noreply@mpich.org 08 Jul '15
by noreply@mpich.org 08 Jul '15
08 Jul '15
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 2e0aa863c4c8f2b4c260eb97def4f4910e31fcc3 (commit)
via 51c037843be604541db9a47a856cf4c9cc9fdd4b (commit)
via 7a2cd3dc25775712e60516b24acf44d74e173ad7 (commit)
from 8519d2bb2866c72c32ce6efa202ee5c126e98716 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/2e0aa863c4c8f2b4c260eb97def4f4910…
commit 2e0aa863c4c8f2b4c260eb97def4f4910e31fcc3
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Sun Jul 5 20:24:02 2015 -0500
Test for multithreaded idup overlapped with nbc.
Add a test for idup, overlaped with non-blocking
collectives
Signed-off-by: Lena Oden <loden(a)anl.gov>
diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index 16f9ad8..b8e0b16 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -1078,6 +1078,7 @@
/threads/comm/ctxdup
/threads/comm/ctxidup
/threads/comm/dup_leak_test
+/threads/comm/idup_nb
/threads/init/initth
/threads/pt2pt/threads
/threads/spawn/multispawn
diff --git a/test/mpi/threads/comm/Makefile.am b/test/mpi/threads/comm/Makefile.am
index 0fb58ad..6a1da81 100644
--- a/test/mpi/threads/comm/Makefile.am
+++ b/test/mpi/threads/comm/Makefile.am
@@ -9,5 +9,5 @@ include $(top_srcdir)/threads/Makefile_threads.mtest
EXTRA_DIST = testlist
-noinst_PROGRAMS = ctxdup dup_leak_test comm_dup_deadlock comm_create_threads comm_create_group_threads comm_idup ctxidup
+noinst_PROGRAMS = ctxdup dup_leak_test comm_dup_deadlock comm_create_threads comm_create_group_threads comm_idup ctxidup idup_nb
diff --git a/test/mpi/threads/comm/idup_nb.c b/test/mpi/threads/comm/idup_nb.c
new file mode 100644
index 0000000..b38aeda
--- /dev/null
+++ b/test/mpi/threads/comm/idup_nb.c
@@ -0,0 +1,291 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+/* This test tests the overlapping of MPI_Comm_idup with other nonblocking calls
+ in a multithreaded setting. Each process produces a new communicator for each
+ of its threads. A thread will duplicate it again to produce child communicators.
+ When the first child communicator is ready, the thread duplicates it to produce
+ grandchild communicators. Meanwhile, the thread also issues nonblocking calls,
+ such as idup, iscan, ibcast, iallreduce, ibarrier on the communicators available.
+
+ The test tests both intracommunicators and intercommunicators
+*/
+
+#include <stdio.h>
+#include <mpi.h>
+#include "mpitest.h"
+#include "mpithreadtest.h"
+
+#define NUM_THREADS 3 /* threads to spawn per process, must >= 1 */
+#define NUM_IDUPS1 3 /* child communicators to iduplicate per thread, must >= 1*/
+#define NUM_IDUPS2 3 /* grandchild communicators to iduplicate per thread, must >= 1*/
+#define NUM_ITER 1 /* run the kernel this times */
+
+#define check(X_) \
+ do { \
+ if (!(X_)) { \
+ printf("[%s:%d] -- Assertion failed: %s\n", __FILE__, __LINE__, #X_);\
+ MPI_Abort(MPI_COMM_WORLD, 1); \
+ } \
+ } while (0)
+
+int isLeft; /* Is left group of an intercomm? */
+MPI_Comm parentcomms[NUM_THREADS];
+MPI_Comm nbrcomms[NUM_THREADS];
+int errs[NUM_THREADS] = {0};
+int verbose = 0;
+
+/* Threads idup the communicator assigned to them NUM_IDUPS1 times. The operation
+ is overlapped with other non-blocking operations on the same communicator or
+ on a different communicator.
+*/
+MTEST_THREAD_RETURN_TYPE test_intracomm(void *arg)
+{
+ int i, j;
+ int root, bcastbuf;
+ int rank, size;
+ int ans[4], expected[4];
+ MPI_Request reqs[NUM_IDUPS1 + NUM_IDUPS2 + 10] = { MPI_REQUEST_NULL }; /* Preallocate enough reqs */
+ MPI_Comm comms[NUM_IDUPS1 + NUM_IDUPS2]; /* Hold all descendant comms */
+ int cnt;
+ int tid = *(int*)arg;
+
+ MPI_Comm parentcomm = parentcomms[tid];
+ MPI_Comm nbrcomm = nbrcomms[tid];
+
+ for (i = 0; i < NUM_ITER; i++) {
+ cnt = 0;
+ if (*(int*)arg == rank) MTestSleep(1);
+
+ if (verbose) printf("%d: Thread %d - comm_idup %d start\n", rank, tid, i);
+
+ /* Idup the parent intracomm NUM_IDUPS1 times */
+ for (j = 0; j < NUM_IDUPS1; j++)
+ MPI_Comm_idup(parentcomm, &comms[j], &reqs[cnt++]);
+
+ /* Issue an iscan on parent comm to overlap with the pending idups */
+ MPI_Comm_rank(parentcomm, &rank);
+ MPI_Iscan(&rank, &ans[0], 1, MPI_INT, MPI_SUM, parentcomm, &reqs[cnt++]);
+ expected[0] = rank*(rank+1)/2;
+
+ /* Wait for the first child comm to be ready */
+ MPI_Wait(&reqs[0], MPI_STATUS_IGNORE);
+
+ /* Do Idups & iallreduce on the first child comm simultaneously */
+ for (j = 0; j < NUM_IDUPS2; j++)
+ MPI_Comm_idup(comms[0], &comms[NUM_IDUPS1+j], &reqs[cnt++]);
+
+ MPI_Comm_size(comms[0], &size);
+ MPI_Iallreduce(&rank, &ans[1], 1, MPI_INT, MPI_SUM, comms[0], &reqs[cnt++]);
+ expected[1] = (size-1)*size/2;
+
+ /* Issue an ibcast on the parent comm */
+ MPI_Comm_rank(parentcomm, &rank);
+ ans[2] = (rank == 0)? 199 : 111;
+ MPI_Ibcast(&ans[2], 1, MPI_INT, 0, parentcomm, &reqs[cnt++]);
+ expected[2] = 199;
+
+ /* Do ibarrier on the dup'ed comm */
+ MPI_Ibarrier(comms[0], &reqs[cnt++]);
+
+ /* Issue an iscan on a neighbor comm */
+ MPI_Comm_rank(nbrcomm, &rank);
+ MPI_Iscan(&rank, &ans[3], 1, MPI_INT, MPI_SUM, nbrcomm, &reqs[cnt++]);
+ expected[3] = rank*(rank+1)/2;
+
+ /* Pending operations include idup/iscan/ibcast on parentcomm
+ idup/Iallreduce/Ibarrier on comms[0], and Iscan on nbrcomm */
+
+ /* Waitall even if the first request is completed */
+ MPI_Waitall(cnt, reqs, MPI_STATUSES_IGNORE);
+
+ /* Check the answers */
+ for (j = 0; j < 4; j++) {
+ if (ans[j] != expected[j]) errs[tid]++;
+ }
+
+ for (j = 0; j < NUM_IDUPS1 + NUM_IDUPS2; j++) {
+ errs[tid] += MTestTestComm(comms[j]);
+ MPI_Comm_free(&comms[j]);
+ }
+
+ if (verbose) printf("\t%d: Thread %d - comm_idup %d finish\n", rank, tid, i);
+ }
+
+ if (verbose) printf("%d: Thread %d - Done.\n", rank, tid);
+ return (MTEST_THREAD_RETURN_TYPE)0;
+}
+
+/* Threads idup the communicator assigned to them NUM_IDUPS1 times. The operation
+ is overlapped with other non-blocking operations on the same communicator or
+ on a different communicator.
+*/
+MTEST_THREAD_RETURN_TYPE test_intercomm(void *arg)
+{
+ int rank, rsize, root;
+ int i, j;
+ int tid = *(int*)arg;
+ int ans[4], expected[4];
+ MPI_Comm parentcomm = parentcomms[tid];
+ MPI_Comm nbrcomm = nbrcomms[tid];
+
+ MPI_Request reqs[NUM_IDUPS1 + NUM_IDUPS2 + 10] = { MPI_REQUEST_NULL }; /* Preallocate enough reqs */
+ MPI_Comm comms[NUM_IDUPS1 + NUM_IDUPS2]; /* Hold all descendant comms */
+ int cnt;
+
+ for (i = 0; i < NUM_ITER; i++) {
+ cnt = 0;
+ if (*(int*)arg == rank) MTestSleep(1);
+
+ if (verbose) printf("%d: Thread %d - comm_idup %d start\n", rank, tid, i);
+
+ /* Idup the parent intracomm multiple times */
+ for (j = 0; j < NUM_IDUPS1; j++)
+ MPI_Comm_idup(parentcomm, &comms[j], &reqs[cnt++]);
+
+ /* Issue an Iallreduce on parentcomm */
+ MPI_Comm_rank(parentcomm, &rank);
+ MPI_Comm_remote_size(parentcomm, &rsize);
+ MPI_Iallreduce(&rank, &ans[0], 1, MPI_INT, MPI_SUM, parentcomm, &reqs[cnt++]);
+ expected[0] = (rsize-1)*rsize/2;
+
+ /* Wait for the first child comm to be ready */
+ MPI_Wait(&reqs[0], MPI_STATUS_IGNORE);
+
+ /* Do idup & iallreduce on the first child comm simultaneously */
+ for (j = 0; j < NUM_IDUPS2; j++)
+ MPI_Comm_idup(comms[0], &comms[NUM_IDUPS1+j], &reqs[cnt++]);
+
+ MPI_Comm_rank(comms[0], &rank);
+ MPI_Comm_remote_size(comms[0], &rsize);
+ MPI_Iallreduce(&rank, &ans[1], 1, MPI_INT, MPI_SUM, comms[0], &reqs[cnt++]);
+ expected[1] = (rsize-1)*rsize/2;
+
+ /* Issue an ibcast on parentcomm */
+ MPI_Comm_rank(parentcomm, &rank);
+ if (isLeft) {
+ if (rank == 0) {
+ root = MPI_ROOT;
+ ans[2] = 199;
+ } else {
+ root = MPI_PROC_NULL;
+ ans[2] = 199; /* not needed, just to make correctness checking easier */
+ }
+ } else {
+ root = 0;
+ ans[2] = 111; /* garbage value */
+ }
+ MPI_Ibcast(&ans[2], 1, MPI_INT, root, parentcomm, &reqs[cnt++]);
+ expected[2] = 199;
+
+ MPI_Ibarrier(comms[0], &reqs[cnt++]);
+
+ /* Do an Iscan on a neighbor comm */
+ MPI_Comm_rank(nbrcomm, &rank);
+ MPI_Comm_remote_size(nbrcomm, &rsize);
+ MPI_Iallreduce(&rank, &ans[3], 1, MPI_INT, MPI_SUM, nbrcomm, &reqs[cnt++]);
+ expected[3] = (rsize-1)*rsize/2;
+
+ /* Pending operations include idup/iallreduce/ibcast on parentcomm
+ Iallreduce/Ibarrier on comms[0], and Iallreduce on nbrcomm */
+
+ /* Waitall even if the first request is completed */
+ MPI_Waitall(cnt, reqs, MPI_STATUSES_IGNORE);
+
+ /* Check the answers */
+ for (j = 0; j < 4; j++) {
+ if (ans[j] != expected[j]) errs[tid]++;
+ }
+
+ for (j = 0; j < NUM_IDUPS1 + NUM_IDUPS2; j++) {
+ errs[tid] += MTestTestComm(comms[j]);
+ MPI_Comm_free(&comms[j]);
+ }
+
+ if (verbose) printf("\t%d: Thread %d - comm_idup %d finish\n", rank, tid, i);
+ }
+
+ if (verbose) printf("%d: Thread %d - Done.\n", rank, tid);
+ return (MTEST_THREAD_RETURN_TYPE)0;
+}
+
+
+int main(int argc, char **argv)
+{
+ int thread_args[NUM_THREADS];
+ MPI_Request requests[NUM_THREADS*2];
+ int i, provided;
+ MPI_Comm newcomm;
+ int toterrs = 0;
+
+ MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
+
+ check(provided == MPI_THREAD_MULTIPLE);
+ check(NUM_IDUPS1 >= 1 && NUM_IDUPS2 >= 1);
+
+ /* In each iteration, the process generates a new kind of intracommunicator, then
+ uses idup to duplicate the communicator for NUM_THREADS threads.
+ */
+ while (MTestGetIntracommGeneral(&newcomm, 1, 1)) {
+ if (newcomm == MPI_COMM_NULL) continue;
+
+ for (i = 0; i < NUM_THREADS; i++) {
+ MPI_Comm_idup(newcomm, &parentcomms[i], &requests[2*i]);
+ MPI_Comm_idup(newcomm, &nbrcomms[i], &requests[2*i+1]);
+ }
+
+ MPI_Waitall(NUM_THREADS*2, requests, MPI_STATUSES_IGNORE);
+
+ for (i = 0; i < NUM_THREADS; i++) {
+ thread_args[i] = i;
+ MTest_Start_thread(test_intracomm, (void *)&thread_args[i] );
+ }
+
+ MTest_Join_threads();
+
+ for (i = 0; i < NUM_THREADS; i++) {
+ toterrs += errs[i];
+ MPI_Comm_free(&parentcomms[i]);
+ MPI_Comm_free(&nbrcomms[i]);
+ }
+
+ MTestFreeComm(&newcomm);
+ }
+
+ /* In each iteration, the process generates a new kind of intercommunicator, then
+ uses idup to duplicate the communicator for NUM_THREADS threads.
+ */
+ while (MTestGetIntercomm(&newcomm, &isLeft, 1)) {
+ if (newcomm == MPI_COMM_NULL) continue;
+
+ for (i = 0; i < NUM_THREADS; i++) {
+ MPI_Comm_idup(newcomm, &parentcomms[i], &requests[2*i]);
+ MPI_Comm_idup(newcomm, &nbrcomms[i], &requests[2*i+1]);
+ }
+
+ MPI_Waitall(NUM_THREADS*2, requests, MPI_STATUSES_IGNORE);
+
+ for (i = 0; i < NUM_THREADS; i++) {
+ thread_args[i] = i;
+ MTest_Start_thread(test_intercomm, (void *)&thread_args[i] );
+ }
+
+ MTest_Join_threads();
+
+ for (i = 0; i < NUM_THREADS; i++) {
+ toterrs += errs[i];
+ MPI_Comm_free(&parentcomms[i]);
+ MPI_Comm_free(&nbrcomms[i]);
+ }
+
+ MTestFreeComm(&newcomm);
+ }
+
+ MTest_Finalize(toterrs);
+ MPI_Finalize();
+ return 0;
+}
+
diff --git a/test/mpi/threads/comm/testlist b/test/mpi/threads/comm/testlist
index 06764d8..50b841d 100644
--- a/test/mpi/threads/comm/testlist
+++ b/test/mpi/threads/comm/testlist
@@ -5,3 +5,4 @@ comm_create_threads 4
comm_create_group_threads 4
comm_idup 4 mpiversion=3.0 xfail=ticket2269
ctxidup 4 mpiversion=3.0
+idup_nb 4 mpiversion=3.0
http://git.mpich.org/mpich.git/commitdiff/51c037843be604541db9a47a856cf4c9c…
commit 51c037843be604541db9a47a856cf4c9cc9fdd4b
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Mon Jul 6 13:43:18 2015 -0500
Renamed routine TestIntercomm, moved it to mtest.c
To provide MTestTestIntracomm, MTestTestIntercomm,
MTestTestComm as a common service
for all tests.
Signed-off-by: Lena Oden <loden(a)anl.gov>
diff --git a/test/mpi/comm/iccreate.c b/test/mpi/comm/iccreate.c
index 4b3cedd..b2dc85e 100644
--- a/test/mpi/comm/iccreate.c
+++ b/test/mpi/comm/iccreate.c
@@ -13,9 +13,6 @@
* This program tests that MPI_Comm_create applies to intercommunicators;
* this is an extension added in MPI-2
*/
-
-int TestIntercomm( MPI_Comm );
-
int main( int argc, char *argv[] )
{
int errs = 0;
@@ -74,7 +71,7 @@ int main( int argc, char *argv[] )
}
/* ... more to do */
if (commok) {
- errs += TestIntercomm( newcomm );
+ errs += MTestTestComm(newcomm);
}
}
MPI_Group_free( &newgroup );
@@ -104,7 +101,7 @@ int main( int argc, char *argv[] )
}
else {
/* Try to communication between each member of intercomm */
- errs += TestIntercomm( newcomm );
+ errs += MTestTestComm(newcomm);
}
if (newcomm != MPI_COMM_NULL) {
@@ -138,79 +135,3 @@ int main( int argc, char *argv[] )
return 0;
}
-
-int TestIntercomm( MPI_Comm comm )
-{
- int local_size, remote_size, rank, **bufs, *bufmem, rbuf[2], j;
- int errs = 0, wrank, nsize;
- char commname[MPI_MAX_OBJECT_NAME+1];
- MPI_Request *reqs;
-
- MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
- MPI_Comm_size( comm, &local_size );
- MPI_Comm_remote_size( comm, &remote_size );
- MPI_Comm_rank( comm, &rank );
- MPI_Comm_get_name( comm, commname, &nsize );
-
- MTestPrintfMsg( 1, "Testing communication on intercomm '%s', remote_size=%d\n",
- commname, remote_size );
-
- reqs = (MPI_Request *)malloc( remote_size * sizeof(MPI_Request) );
- if (!reqs) {
- printf( "[%d] Unable to allocated %d requests for testing intercomm %s\n",
- wrank, remote_size, commname );
- errs++;
- return errs;
- }
- bufs = (int **) malloc( remote_size * sizeof(int *) );
- if (!bufs) {
- printf( "[%d] Unable to allocated %d int pointers for testing intercomm %s\n",
- wrank, remote_size, commname );
- errs++;
- return errs;
- }
- bufmem = (int *) malloc( remote_size * 2 * sizeof(int) );
- if (!bufmem) {
- printf( "[%d] Unable to allocated %d int data for testing intercomm %s\n",
- wrank, 2*remote_size, commname );
- errs++;
- return errs;
- }
-
- /* Each process sends a message containing its own rank and the
- rank of the destination with a nonblocking send. Because we're using
- nonblocking sends, we need to use different buffers for each isend */
- /* NOTE: the send buffer access restriction was relaxed in MPI-2.2, although
- it doesn't really hurt to keep separate buffers for our purposes */
- for (j=0; j<remote_size; j++) {
- bufs[j] = &bufmem[2*j];
- bufs[j][0] = rank;
- bufs[j][1] = j;
- MPI_Isend( bufs[j], 2, MPI_INT, j, 0, comm, &reqs[j] );
- }
- MTestPrintfMsg( 2, "isends posted, about to recv\n" );
-
- for (j=0; j<remote_size; j++) {
- MPI_Recv( rbuf, 2, MPI_INT, j, 0, comm, MPI_STATUS_IGNORE );
- if (rbuf[0] != j) {
- printf( "[%d] Expected rank %d but saw %d in %s\n",
- wrank, j, rbuf[0], commname );
- errs++;
- }
- if (rbuf[1] != rank) {
- printf( "[%d] Expected target rank %d but saw %d from %d in %s\n",
- wrank, rank, rbuf[1], j, commname );
- errs++;
- }
- }
- if (errs)
- fflush(stdout);
- MTestPrintfMsg( 2, "my recvs completed, about to waitall\n" );
- MPI_Waitall( remote_size, reqs, MPI_STATUSES_IGNORE );
-
- free( reqs );
- free( bufs );
- free( bufmem );
-
- return errs;
-}
diff --git a/test/mpi/comm/icsplit.c b/test/mpi/comm/icsplit.c
index 9ad2d51..177c945 100644
--- a/test/mpi/comm/icsplit.c
+++ b/test/mpi/comm/icsplit.c
@@ -13,9 +13,6 @@
* This program tests that MPI_Comm_split applies to intercommunicators;
* this is an extension added in MPI-2
*/
-
-int TestIntercomm( MPI_Comm );
-
int main( int argc, char *argv[] )
{
int errs = 0;
@@ -90,7 +87,7 @@ int main( int argc, char *argv[] )
}
/* ... more to do */
if (commok) {
- errs += TestIntercomm( newcomm );
+ errs += MTestTestComm(newcomm);
}
}
else {
@@ -118,75 +115,3 @@ int main( int argc, char *argv[] )
return 0;
}
-
-/* FIXME: This is copied from iccreate. It should be in one place */
-int TestIntercomm( MPI_Comm comm )
-{
- int local_size, remote_size, rank, **bufs, *bufmem, rbuf[2], j;
- int errs = 0, wrank, nsize;
- char commname[MPI_MAX_OBJECT_NAME+1];
- MPI_Request *reqs;
-
- MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
- MPI_Comm_size( comm, &local_size );
- MPI_Comm_remote_size( comm, &remote_size );
- MPI_Comm_rank( comm, &rank );
- MPI_Comm_get_name( comm, commname, &nsize );
-
- MTestPrintfMsg( 1, "Testing communication on intercomm %s\n", commname );
-
- reqs = (MPI_Request *)malloc( remote_size * sizeof(MPI_Request) );
- if (!reqs) {
- printf( "[%d] Unable to allocated %d requests for testing intercomm %s\n",
- wrank, remote_size, commname );
- errs++;
- return errs;
- }
- bufs = (int **) malloc( remote_size * sizeof(int *) );
- if (!bufs) {
- printf( "[%d] Unable to allocated %d int pointers for testing intercomm %s\n",
- wrank, remote_size, commname );
- errs++;
- return errs;
- }
- bufmem = (int *) malloc( remote_size * 2 * sizeof(int) );
- if (!bufmem) {
- printf( "[%d] Unable to allocated %d int data for testing intercomm %s\n",
- wrank, 2*remote_size, commname );
- errs++;
- return errs;
- }
-
- /* Each process sends a message containing its own rank and the
- rank of the destination with a nonblocking send. Because we're using
- nonblocking sends, we need to use different buffers for each isend */
- for (j=0; j<remote_size; j++) {
- bufs[j] = &bufmem[2*j];
- bufs[j][0] = rank;
- bufs[j][1] = j;
- MPI_Isend( bufs[j], 2, MPI_INT, j, 0, comm, &reqs[j] );
- }
-
- for (j=0; j<remote_size; j++) {
- MPI_Recv( rbuf, 2, MPI_INT, j, 0, comm, MPI_STATUS_IGNORE );
- if (rbuf[0] != j) {
- printf( "[%d] Expected rank %d but saw %d in %s\n",
- wrank, j, rbuf[0], commname );
- errs++;
- }
- if (rbuf[1] != rank) {
- printf( "[%d] Expected target rank %d but saw %d from %d in %s\n",
- wrank, rank, rbuf[1], j, commname );
- errs++;
- }
- }
- if (errs)
- fflush(stdout);
- MPI_Waitall( remote_size, reqs, MPI_STATUSES_IGNORE );
-
- free( reqs );
- free( bufs );
- free( bufmem );
-
- return errs;
-}
diff --git a/test/mpi/include/mpitest.h b/test/mpi/include/mpitest.h
index f20eb76..594f58e 100644
--- a/test/mpi/include/mpitest.h
+++ b/test/mpi/include/mpitest.h
@@ -82,6 +82,9 @@ int MTestGetIntracomm( MPI_Comm *, int );
int MTestGetIntracommGeneral( MPI_Comm *, int, int );
int MTestGetIntercomm( MPI_Comm *, int *, int );
int MTestGetComm( MPI_Comm *, int );
+int MTestTestIntercomm(MPI_Comm intercomm);
+int MTestTestIntracomm(MPI_Comm intracomm);
+int MTestTestComm(MPI_Comm comm);
const char *MTestGetIntracommName( void );
const char *MTestGetIntercommName( void );
void MTestFreeComm( MPI_Comm * );
diff --git a/test/mpi/util/mtest.c b/test/mpi/util/mtest.c
index c4f0c4d..b77439c 100644
--- a/test/mpi/util/mtest.c
+++ b/test/mpi/util/mtest.c
@@ -406,7 +406,7 @@ int MTestGetIntracommGeneral( MPI_Comm *comm, int min_size, int allowSmaller )
ranges[0][2] = 1;
if (allowSmaller && (size+1)/2 >= min_size) {
- MPI_Comm_group( MPI_COMM_WORLD, &world_group);
+ MPI_Comm_group(MPI_COMM_WORLD, &world_group);
merr = MPI_Group_range_incl(world_group, 1, ranges, &high_group);
if (merr) MTestPrintError(merr);
merr = MPI_Comm_create(MPI_COMM_WORLD, high_group, comm);
@@ -835,6 +835,117 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
return interCommIdx;
}
+
+int MTestTestIntercomm(MPI_Comm comm)
+{
+ int local_size, remote_size, rank, **bufs, *bufmem, rbuf[2], j;
+ int errs = 0, wrank, nsize;
+ char commname[MPI_MAX_OBJECT_NAME+1];
+ MPI_Request *reqs;
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
+ MPI_Comm_size(comm, &local_size);
+ MPI_Comm_remote_size(comm, &remote_size);
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_get_name(comm, commname, &nsize);
+
+ MTestPrintfMsg(1, "Testing communication on intercomm '%s', remote_size=%d\n",
+ commname, remote_size);
+
+ reqs = (MPI_Request *)malloc(remote_size * sizeof(MPI_Request));
+ if (!reqs) {
+ printf("[%d] Unable to allocated %d requests for testing intercomm %s\n",
+ wrank, remote_size, commname);
+ errs++;
+ return errs;
+ }
+ bufs = (int **) malloc(remote_size * sizeof(int *));
+ if (!bufs) {
+ printf("[%d] Unable to allocated %d int pointers for testing intercomm %s\n",
+ wrank, remote_size, commname);
+ errs++;
+ return errs;
+ }
+ bufmem = (int *) malloc(remote_size * 2 * sizeof(int));
+ if (!bufmem) {
+ printf("[%d] Unable to allocated %d int data for testing intercomm %s\n",
+ wrank, 2*remote_size, commname);
+ errs++;
+ return errs;
+ }
+
+ /* Each process sends a message containing its own rank and the
+ rank of the destination with a nonblocking send. Because we're using
+ nonblocking sends, we need to use different buffers for each isend */
+ /* NOTE: the send buffer access restriction was relaxed in MPI-2.2, although
+ it doesn't really hurt to keep separate buffers for our purposes */
+ for (j=0; j<remote_size; j++) {
+ bufs[j] = &bufmem[2*j];
+ bufs[j][0] = rank;
+ bufs[j][1] = j;
+ MPI_Isend(bufs[j], 2, MPI_INT, j, 0, comm, &reqs[j]);
+ }
+ MTestPrintfMsg(2, "isends posted, about to recv\n");
+
+ for (j=0; j<remote_size; j++) {
+ MPI_Recv(rbuf, 2, MPI_INT, j, 0, comm, MPI_STATUS_IGNORE);
+ if (rbuf[0] != j) {
+ printf("[%d] Expected rank %d but saw %d in %s\n",
+ wrank, j, rbuf[0], commname);
+ errs++;:
+ }
+ if (rbuf[1] != rank) {
+ printf( "[%d] Expected target rank %d but saw %d from %d in %s\n",
+ wrank, rank, rbuf[1], j, commname );
+ errs++;
+ }
+ }
+ if (errs) fflush(stdout);
+
+ MTestPrintfMsg(2, "my recvs completed, about to waitall\n");
+ MPI_Waitall(remote_size, reqs, MPI_STATUSES_IGNORE);
+
+ free(reqs);
+ free(bufs);
+ free(bufmem);
+
+ return errs;
+}
+
+int MTestTestIntracomm(MPI_Comm comm)
+{
+ int i, errs = 0;
+ int size;
+ int in[16], out[16], sol[16];
+
+ MPI_Comm_size(comm, &size);
+
+ /* Set input, output and sol-values */
+ for(i = 0; i<16; i++) {
+ in[i] = i;
+ out[i] = 0;
+ sol[i] = i*size;
+ }
+ MPI_Allreduce(in, out, 16, MPI_INT, MPI_SUM, comm);
+
+ /* Test results */
+ for(i = 0; i<16; i++) {
+ if(sol[i] != out[i]) errs++;
+ }
+
+ return errs;
+}
+
+int MTestTestComm(MPI_Comm comm)
+{
+ int is_inter;
+ MPI_Comm_test_inter(comm, &is_inter);
+ if (is_inter)
+ return MTestTestIntercomm(comm);
+ else
+ return MTestTestIntracomm(comm);
+}
+
/* Return the name of an intercommunicator */
const char *MTestGetIntercommName( void )
{
http://git.mpich.org/mpich.git/commitdiff/7a2cd3dc25775712e60516b24acf44d74…
commit 7a2cd3dc25775712e60516b24acf44d74e173ad7
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Mon Jul 6 13:40:07 2015 -0500
Add more cases to generate var intracommunicators
Such as MPI_Comm_create, MPI_Comm_create_group,
MPI_Intercomm_merge.
Signed-off-by: Lena Oden <loden(a)anl.gov>
diff --git a/test/mpi/util/mtest.c b/test/mpi/util/mtest.c
index ea309c0..c4f0c4d 100644
--- a/test/mpi/util/mtest.c
+++ b/test/mpi/util/mtest.c
@@ -331,18 +331,105 @@ int MTestGetIntracommGeneral( MPI_Comm *comm, int min_size, int allowSmaller )
isBasic = 1;
intraCommName = "MPI_COMM_SELF";
break;
+ case 5:
+ {
+ /* Dup of the world using MPI_Intercomm_merge */
+ int rleader, isLeft;
+ MPI_Comm local_comm, inter_comm;
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ if (size > 1) {
+ merr = MPI_Comm_split( MPI_COMM_WORLD, (rank < size/2), rank, &local_comm);
+ if (merr) MTestPrintError( merr );
+ if (rank == 0) { rleader = size/2; }
+ else if (rank == size/2) { rleader = 0; }
+ else { rleader = -1; }
+ isLeft = rank < size/2;
+ merr = MPI_Intercomm_create(local_comm, 0, MPI_COMM_WORLD, rleader, 99, &inter_comm);
+ if (merr) MTestPrintError(merr);
+ merr = MPI_Intercomm_merge(inter_comm, isLeft, comm);
+ if (merr) MTestPrintError(merr);
+ MPI_Comm_free(&inter_comm);
+ MPI_Comm_free(&local_comm);
+ intraCommName = "Dup of WORLD created by MPI_Intercomm_merge";
+ } else {
+ *comm = MPI_COMM_NULL;
+ }
+ }
+ break;
+ case 6:
+ {
+#if MTEST_HAVE_MIN_MPI_VERSION(3,0)
+ /* Even of the world using MPI_Comm_create_group */
+ int i;
+ MPI_Group world_group, even_group;
+ int *excl = NULL;
+
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ if (allowSmaller && (size+1)/2 >= min_size) {
+ /* exclude the odd ranks */
+ excl = malloc((size/2) * sizeof(int));
+ for (i = 0; i < size / 2; i++) excl[i] = (2 * i) + 1;
+
+ MPI_Comm_group(MPI_COMM_WORLD, &world_group);
+ MPI_Group_excl(world_group, size / 2, excl, &even_group);
+ MPI_Group_free(&world_group);
+ free(excl);
+
+ if (rank % 2 == 0) {
+ /* Even processes create a comm. for themselves */
+ MPI_Comm_create_group(MPI_COMM_WORLD, even_group, 0, comm);
+ intraCommName = "Even of WORLD created by MPI_Comm_create_group";
+ } else {
+ *comm = MPI_COMM_NULL;
+ }
+ MPI_Group_free(&even_group);
+ } else {
+ *comm = MPI_COMM_NULL;
+ }
+#else
+ *comm = MPI_COMM_NULL;
+#endif
+ }
+ break;
+ case 7:
+ {
+ /* High half of the world using MPI_Comm_create */
+ int ranges[1][3];
+ MPI_Group world_group, high_group;
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ ranges[0][0] = size/2;
+ ranges[0][1] = size-1;
+ ranges[0][2] = 1;
+
+ if (allowSmaller && (size+1)/2 >= min_size) {
+ MPI_Comm_group( MPI_COMM_WORLD, &world_group);
+ merr = MPI_Group_range_incl(world_group, 1, ranges, &high_group);
+ if (merr) MTestPrintError(merr);
+ merr = MPI_Comm_create(MPI_COMM_WORLD, high_group, comm);
+ if (merr) MTestPrintError(merr);
+ MPI_Group_free(&world_group);
+ MPI_Group_free(&high_group);
+ intraCommName = "High half of WORLD created by MPI_Comm_create";
+ } else {
+ *comm = MPI_COMM_NULL;
+ }
+ }
+ break;
/* These next cases are communicators that include some
but not all of the processes */
- case 5:
- case 6:
- case 7:
case 8:
+ case 9:
+ case 10:
+ case 11:
{
int newsize;
merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
if (merr) MTestPrintError( merr );
- newsize = size - (intraCommIdx - 4);
+ newsize = size - (intraCommIdx - 7);
if (allowSmaller && newsize >= min_size) {
merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-----------------------------------------------------------------------
Summary of changes:
test/mpi/.gitignore | 1 +
test/mpi/comm/iccreate.c | 83 +----------
test/mpi/comm/icsplit.c | 77 +----------
test/mpi/include/mpitest.h | 3 +
test/mpi/threads/comm/Makefile.am | 2 +-
test/mpi/threads/comm/idup_nb.c | 291 +++++++++++++++++++++++++++++++++++++
test/mpi/threads/comm/testlist | 1 +
test/mpi/util/mtest.c | 206 +++++++++++++++++++++++++-
8 files changed, 502 insertions(+), 162 deletions(-)
create mode 100644 test/mpi/threads/comm/idup_nb.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-188-g8519d2b
by noreply@mpich.org 08 Jul '15
by noreply@mpich.org 08 Jul '15
08 Jul '15
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 8519d2bb2866c72c32ce6efa202ee5c126e98716 (commit)
via f3d18ad548449d7d8104414a649f89c2fc475b23 (commit)
from cf631e1e71e8e1c6ea3aa1499331ddcdac78dd88 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/8519d2bb2866c72c32ce6efa202ee5c12…
commit 8519d2bb2866c72c32ce6efa202ee5c126e98716
Author: Michael Blocksome <blocksom(a)us.ibm.com>
Date: Tue Jul 7 20:57:08 2015 +0000
Move the PAMID GPID routines from mpidpre.h to mpidpost.h
The 'MPID_Comm' struct, which is used by the PAMID GPID
routines, is not yet defined when mpidpre.h is included.
Signed-off-by: Antonio J. Pena <apenya(a)mcs.anl.gov>
diff --git a/src/mpid/pamid/include/mpidpost.h b/src/mpid/pamid/include/mpidpost.h
index 5d238fb..b0fdbfe 100644
--- a/src/mpid/pamid/include/mpidpost.h
+++ b/src/mpid/pamid/include/mpidpost.h
@@ -40,6 +40,65 @@
#ifdef DYNAMIC_TASKING
#define MPID_ICCREATE_REMOTECOMM_HOOK(_p,_c,_np,_gp,_r) \
MPID_PG_ForwardPGInfo(_p,_c,_np,_gp,_r)
-#endif
+#else /* ! DYNAMIC_TASKING */
+/* If DYNAMIC_TASKING is not defined, PAMID does not provide its own GPID routines,
+ so provide one here. **/
+
+/* FIXME: A temporary version for lpids within my comm world */
+static inline int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
+ int local_gpids[], int *singlePG )
+{
+ int i;
+ int *gpid = local_gpids;
+
+ for (i=0; i<comm_ptr->local_size; i++) {
+ *gpid++ = 0;
+ (void)MPID_VCR_Get_lpid( comm_ptr->vcr[i], gpid );
+ gpid++;
+ }
+ *singlePG = 1;
+ return 0;
+}
+
+/* FIXME: A temp for lpids within my comm world */
+static inline int MPID_GPID_ToLpidArray( int size, int gpid[], int lpid[] )
+{
+ int i;
+
+ for (i=0; i<size; i++) {
+ lpid[i] = *++gpid; gpid++;
+ }
+ return 0;
+}
+/* FIXME: for MPI1, all process ids are relative to MPI_COMM_WORLD.
+ For MPI2, we'll need to do something more complex */
+static inline int MPID_VCR_CommFromLpids( MPID_Comm *newcomm_ptr,
+ int size, const int lpids[] )
+{
+ MPID_Comm *commworld_ptr;
+ int i;
+ commworld_ptr = MPIR_Process.comm_world;
+ /* Setup the communicator's vc table: remote group */
+ MPID_VCRT_Create( size, &newcomm_ptr->vcrt );
+ MPID_VCRT_Get_ptr( newcomm_ptr->vcrt, &newcomm_ptr->vcr );
+ for (i=0; i<size; i++) {
+ /* For rank i in the new communicator, find the corresponding
+ rank in the comm world (FIXME FOR MPI2) */
+ /* printf( "[%d] Remote rank %d has lpid %d\n",
+ MPIR_Process.comm_world->rank, i, lpids[i] ); */
+ if (lpids[i] < commworld_ptr->remote_size) {
+ MPID_VCR_Dup( commworld_ptr->vcr[lpids[i]],
+ &newcomm_ptr->vcr[i] );
+ }
+ else {
+ /* We must find the corresponding vcr for a given lpid */
+ /* FIXME: Error */
+ return 1;
+ /* MPID_VCR_Dup( ???, &newcomm_ptr->vcr[i] ); */
+ }
+ }
+ return 0;
+}
+#endif /* DYNAMIC_TASKING */
#endif
diff --git a/src/mpid/pamid/include/mpidpre.h b/src/mpid/pamid/include/mpidpre.h
index 687dca8..25e1bab 100644
--- a/src/mpid/pamid/include/mpidpre.h
+++ b/src/mpid/pamid/include/mpidpre.h
@@ -33,6 +33,7 @@
#include <pthread.h>
#include <unistd.h>
+#include "mpiimpl.h"
#include "mpid_dataloop.h"
#include <pami.h>
@@ -59,68 +60,6 @@
#include "mpidi_thread.h"
#include "mpidi_util.h"
-#ifndef DYNAMIC_TASKING
-/* If DYNAMIC_TASKING is not defined, PAMID does not provide its own GPID routines,
- so provide one here. **/
-
-/* FIXME: A temporary version for lpids within my comm world */
-static inline int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
- int local_gpids[], int *singlePG )
-{
- int i;
- int *gpid = local_gpids;
-
- for (i=0; i<comm_ptr->local_size; i++) {
- *gpid++ = 0;
- (void)MPID_VCR_Get_lpid( comm_ptr->vcr[i], gpid );
- gpid++;
- }
- *singlePG = 1;
- return 0;
-}
-
-/* FIXME: A temp for lpids within my comm world */
-static inline int MPID_GPID_ToLpidArray( int size, int gpid[], int lpid[] )
-{
- int i;
-
- for (i=0; i<size; i++) {
- lpid[i] = *++gpid; gpid++;
- }
- return 0;
-}
-/* FIXME: for MPI1, all process ids are relative to MPI_COMM_WORLD.
- For MPI2, we'll need to do something more complex */
-static inline int MPID_VCR_CommFromLpids( MPID_Comm *newcomm_ptr,
- int size, const int lpids[] )
-{
- MPID_Comm *commworld_ptr;
- int i;
-
- commworld_ptr = MPIR_Process.comm_world;
- /* Setup the communicator's vc table: remote group */
- MPID_VCRT_Create( size, &newcomm_ptr->vcrt );
- MPID_VCRT_Get_ptr( newcomm_ptr->vcrt, &newcomm_ptr->vcr );
- for (i=0; i<size; i++) {
- /* For rank i in the new communicator, find the corresponding
- rank in the comm world (FIXME FOR MPI2) */
- /* printf( "[%d] Remote rank %d has lpid %d\n",
- MPIR_Process.comm_world->rank, i, lpids[i] ); */
- if (lpids[i] < commworld_ptr->remote_size) {
- MPID_VCR_Dup( commworld_ptr->vcr[lpids[i]],
- &newcomm_ptr->vcr[i] );
- }
- else {
- /* We must find the corresponding vcr for a given lpid */
- /* FIXME: Error */
- return 1;
- /* MPID_VCR_Dup( ???, &newcomm_ptr->vcr[i] ); */
- }
- }
- return 0;
-}
-#endif /* DYNAMIC_TASKING */
-
#ifdef __BGQ__
#define MPID_HANDLE_NUM_INDICES 256
#endif /* __BGQ__ */
http://git.mpich.org/mpich.git/commitdiff/f3d18ad548449d7d8104414a649f89c2f…
commit f3d18ad548449d7d8104414a649f89c2fc475b23
Author: Hajime Fujita <hajime.fujita(a)intel.com>
Date: Tue Jul 7 10:51:27 2015 -0500
Remove HAVE_GPID_ROUTINES macro
This patch removes HAVE_GPID_ROUTINES, as it seems to be defined
most of the cases. Only PAMID lacks the GPID routines in some case,
so moved the default routines into the PAMID header file.
Signed-off-by: Antonio J. Pena <apenya(a)mcs.anl.gov>
diff --git a/src/mpi/comm/intercomm_create.c b/src/mpi/comm/intercomm_create.c
index 69ba0c4..b832624 100644
--- a/src/mpi/comm/intercomm_create.c
+++ b/src/mpi/comm/intercomm_create.c
@@ -102,66 +102,6 @@ PMPI_LOCAL int MPIR_CheckDisjointLpids( int lpids1[], int n1,
}
#endif /* HAVE_ERROR_CHECKING */
-#ifndef HAVE_GPID_ROUTINES
-/* FIXME: A temporary version for lpids within my comm world */
-PMPI_LOCAL int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
- int local_gpids[], int *singlePG )
-{
- int i;
- int *gpid = local_gpids;
-
- for (i=0; i<comm_ptr->local_size; i++) {
- *gpid++ = 0;
- (void)MPID_VCR_Get_lpid( comm_ptr->vcr[i], gpid );
- gpid++;
- }
- *singlePG = 1;
- return 0;
-}
-
-/* FIXME: A temp for lpids within my comm world */
-PMPI_LOCAL int MPID_GPID_ToLpidArray( int size, int gpid[], int lpid[] )
-{
- int i;
-
- for (i=0; i<size; i++) {
- lpid[i] = *++gpid; gpid++;
- }
- return 0;
-}
-/* FIXME: for MPI1, all process ids are relative to MPI_COMM_WORLD.
- For MPI2, we'll need to do something more complex */
-PMPI_LOCAL int MPID_VCR_CommFromLpids( MPID_Comm *newcomm_ptr,
- int size, const int lpids[] )
-{
- MPID_Comm *commworld_ptr;
- int i;
-
- commworld_ptr = MPIR_Process.comm_world;
- /* Setup the communicator's vc table: remote group */
- MPID_VCRT_Create( size, &newcomm_ptr->vcrt );
- MPID_VCRT_Get_ptr( newcomm_ptr->vcrt, &newcomm_ptr->vcr );
- for (i=0; i<size; i++) {
- /* For rank i in the new communicator, find the corresponding
- rank in the comm world (FIXME FOR MPI2) */
- /* printf( "[%d] Remote rank %d has lpid %d\n",
- MPIR_Process.comm_world->rank, i, lpids[i] ); */
- if (lpids[i] < commworld_ptr->remote_size) {
- MPID_VCR_Dup( commworld_ptr->vcr[lpids[i]],
- &newcomm_ptr->vcr[i] );
- }
- else {
- /* We must find the corresponding vcr for a given lpid */
- /* FIXME: Error */
- return 1;
- /* MPID_VCR_Dup( ???, &newcomm_ptr->vcr[i] ); */
- }
- }
- return 0;
-}
-
-#endif /* HAVE_GPID_ROUTINES */
-
PMPI_LOCAL int MPID_LPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
int local_lpids[] )
{
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 7838e20..6dd0481 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -482,11 +482,6 @@ MPID_REQUEST_DECL
#endif
#endif
-
-/* Tell Intercomm create and friends that the GPID routines have been
- implemented */
-#define HAVE_GPID_ROUTINES
-
/* Tell initthread to prepare a private comm_world */
#define MPID_NEEDS_ICOMM_WORLD
diff --git a/src/mpid/pamid/include/mpidpre.h b/src/mpid/pamid/include/mpidpre.h
index a10e1ea..687dca8 100644
--- a/src/mpid/pamid/include/mpidpre.h
+++ b/src/mpid/pamid/include/mpidpre.h
@@ -59,9 +59,67 @@
#include "mpidi_thread.h"
#include "mpidi_util.h"
-#ifdef DYNAMIC_TASKING
-#define HAVE_GPID_ROUTINES
-#endif
+#ifndef DYNAMIC_TASKING
+/* If DYNAMIC_TASKING is not defined, PAMID does not provide its own GPID routines,
+ so provide one here. **/
+
+/* FIXME: A temporary version for lpids within my comm world */
+static inline int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size,
+ int local_gpids[], int *singlePG )
+{
+ int i;
+ int *gpid = local_gpids;
+
+ for (i=0; i<comm_ptr->local_size; i++) {
+ *gpid++ = 0;
+ (void)MPID_VCR_Get_lpid( comm_ptr->vcr[i], gpid );
+ gpid++;
+ }
+ *singlePG = 1;
+ return 0;
+}
+
+/* FIXME: A temp for lpids within my comm world */
+static inline int MPID_GPID_ToLpidArray( int size, int gpid[], int lpid[] )
+{
+ int i;
+
+ for (i=0; i<size; i++) {
+ lpid[i] = *++gpid; gpid++;
+ }
+ return 0;
+}
+/* FIXME: for MPI1, all process ids are relative to MPI_COMM_WORLD.
+ For MPI2, we'll need to do something more complex */
+static inline int MPID_VCR_CommFromLpids( MPID_Comm *newcomm_ptr,
+ int size, const int lpids[] )
+{
+ MPID_Comm *commworld_ptr;
+ int i;
+
+ commworld_ptr = MPIR_Process.comm_world;
+ /* Setup the communicator's vc table: remote group */
+ MPID_VCRT_Create( size, &newcomm_ptr->vcrt );
+ MPID_VCRT_Get_ptr( newcomm_ptr->vcrt, &newcomm_ptr->vcr );
+ for (i=0; i<size; i++) {
+ /* For rank i in the new communicator, find the corresponding
+ rank in the comm world (FIXME FOR MPI2) */
+ /* printf( "[%d] Remote rank %d has lpid %d\n",
+ MPIR_Process.comm_world->rank, i, lpids[i] ); */
+ if (lpids[i] < commworld_ptr->remote_size) {
+ MPID_VCR_Dup( commworld_ptr->vcr[lpids[i]],
+ &newcomm_ptr->vcr[i] );
+ }
+ else {
+ /* We must find the corresponding vcr for a given lpid */
+ /* FIXME: Error */
+ return 1;
+ /* MPID_VCR_Dup( ???, &newcomm_ptr->vcr[i] ); */
+ }
+ }
+ return 0;
+}
+#endif /* DYNAMIC_TASKING */
#ifdef __BGQ__
#define MPID_HANDLE_NUM_INDICES 256
-----------------------------------------------------------------------
Summary of changes:
src/mpi/comm/intercomm_create.c | 60 ------------------------------------
src/mpid/ch3/include/mpidpre.h | 5 ---
src/mpid/pamid/include/mpidpost.h | 61 ++++++++++++++++++++++++++++++++++++-
src/mpid/pamid/include/mpidpre.h | 5 +--
4 files changed, 61 insertions(+), 70 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-186-gcf631e1
by noreply@mpich.org 08 Jul '15
by noreply@mpich.org 08 Jul '15
08 Jul '15
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via cf631e1e71e8e1c6ea3aa1499331ddcdac78dd88 (commit)
via d0960b7439b800759df136e989bc5bc4165c24cb (commit)
from c5ee3a08c8458509849094a0c27a558b323e8ba4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/cf631e1e71e8e1c6ea3aa1499331ddcda…
commit cf631e1e71e8e1c6ea3aa1499331ddcdac78dd88
Author: Pavan Balaji <balaji(a)anl.gov>
Date: Mon Jul 6 23:17:20 2015 -0500
Get rid of unused lrank element in lrank_to_lpid structure.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 01cbe31..d3b491d 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -1030,7 +1030,6 @@ typedef struct MPID_Attribute {
/* This structure is used to implement the group operations such as
MPI_Group_translate_ranks */
typedef struct MPID_Group_pmap_t {
- int lrank; /* Local rank in group (between 0 and size-1) */
int lpid; /* local process id, from VCONN */
int next_lpid; /* Index of next lpid (in lpid order) */
int flag; /* marker, used to implement group operations */
diff --git a/src/mpi/comm/comm_group.c b/src/mpi/comm/comm_group.c
index 075e734..61b37f4 100644
--- a/src/mpi/comm/comm_group.c
+++ b/src/mpi/comm/comm_group.c
@@ -56,7 +56,6 @@ int MPIR_Comm_group_impl(MPID_Comm *comm_ptr, MPID_Group **group_ptr)
(*group_ptr)->is_local_dense_monotonic = TRUE;
for (i=0; i<n; i++) {
(void) MPID_VCR_Get_lpid( local_vcr[i], &lpid );
- (*group_ptr)->lrank_to_lpid[i].lrank = i;
(*group_ptr)->lrank_to_lpid[i].lpid = lpid;
if (lpid > comm_world_size ||
(i > 0 && (*group_ptr)->lrank_to_lpid[i-1].lpid != (lpid-1)))
diff --git a/src/mpi/comm/comm_remote_group.c b/src/mpi/comm/comm_remote_group.c
index c71e11c..86544a5 100644
--- a/src/mpi/comm/comm_remote_group.c
+++ b/src/mpi/comm/comm_remote_group.c
@@ -44,7 +44,6 @@ int MPIR_Comm_remote_group_impl(MPID_Comm *comm_ptr, MPID_Group **group_ptr)
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
for (i=0; i<n; i++) {
- (*group_ptr)->lrank_to_lpid[i].lrank = i;
(void) MPID_VCR_Get_lpid( comm_ptr->vcr[i], &lpid );
(*group_ptr)->lrank_to_lpid[i].lpid = lpid;
/* TODO calculate is_local_dense_monotonic */
diff --git a/src/mpi/group/group_difference.c b/src/mpi/group/group_difference.c
index 2232eea..7e8ccec 100644
--- a/src/mpi/group/group_difference.c
+++ b/src/mpi/group/group_difference.c
@@ -86,7 +86,6 @@ int MPIR_Group_difference_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, M
k = 0;
for (i=0; i<size1; i++) {
if (!group_ptr1->lrank_to_lpid[i].flag) {
- (*new_group_ptr)->lrank_to_lpid[k].lrank = k;
(*new_group_ptr)->lrank_to_lpid[k].lpid = group_ptr1->lrank_to_lpid[i].lpid;
if (i == group_ptr1->rank)
(*new_group_ptr)->rank = k;
diff --git a/src/mpi/group/group_excl.c b/src/mpi/group/group_excl.c
index c81cbd9..bf33ae1 100644
--- a/src/mpi/group/group_excl.c
+++ b/src/mpi/group/group_excl.c
@@ -57,7 +57,6 @@ int MPIR_Group_excl_impl(MPID_Group *group_ptr, int n, const int ranks[], MPID_G
newi = 0;
for (i = 0; i < size; i++) {
if (group_ptr->lrank_to_lpid[i].flag == 0) {
- (*new_group_ptr)->lrank_to_lpid[newi].lrank = newi;
(*new_group_ptr)->lrank_to_lpid[newi].lpid = group_ptr->lrank_to_lpid[i].lpid;
if (group_ptr->rank == i)
(*new_group_ptr)->rank = newi;
diff --git a/src/mpi/group/group_incl.c b/src/mpi/group/group_incl.c
index 913dc27..4ed64d9 100644
--- a/src/mpi/group/group_incl.c
+++ b/src/mpi/group/group_incl.c
@@ -49,7 +49,6 @@ int MPIR_Group_incl_impl(MPID_Group *group_ptr, int n, const int ranks[], MPID_G
(*new_group_ptr)->rank = MPI_UNDEFINED;
for (i = 0; i < n; i++) {
- (*new_group_ptr)->lrank_to_lpid[i].lrank = i;
(*new_group_ptr)->lrank_to_lpid[i].lpid = group_ptr->lrank_to_lpid[ranks[i]].lpid;
if (ranks[i] == group_ptr->rank)
(*new_group_ptr)->rank = i;
diff --git a/src/mpi/group/group_intersection.c b/src/mpi/group/group_intersection.c
index 7f662d7..0deea2a 100644
--- a/src/mpi/group/group_intersection.c
+++ b/src/mpi/group/group_intersection.c
@@ -82,7 +82,6 @@ int MPIR_Group_intersection_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2,
for (i = 0; i < size1; i++) {
if (group_ptr1->lrank_to_lpid[i].flag) {
int lpid = group_ptr1->lrank_to_lpid[i].lpid;
- (*new_group_ptr)->lrank_to_lpid[k].lrank = k;
(*new_group_ptr)->lrank_to_lpid[k].lpid = lpid;
if (i == group_ptr1->rank)
(*new_group_ptr)->rank = k;
diff --git a/src/mpi/group/group_range_excl.c b/src/mpi/group/group_range_excl.c
index 9950217..0de4457 100644
--- a/src/mpi/group/group_range_excl.c
+++ b/src/mpi/group/group_range_excl.c
@@ -91,7 +91,6 @@ int MPIR_Group_range_excl_impl(MPID_Group *group_ptr, int n, int ranges[][3], MP
k = 0;
for (i = 0; i < size; i++) {
if (!group_ptr->lrank_to_lpid[i].flag) {
- (*new_group_ptr)->lrank_to_lpid[k].lrank = k;
(*new_group_ptr)->lrank_to_lpid[k].lpid = group_ptr->lrank_to_lpid[i].lpid;
if (group_ptr->rank == i) {
(*new_group_ptr)->rank = k;
diff --git a/src/mpi/group/group_range_incl.c b/src/mpi/group/group_range_incl.c
index 9cace13..f230c4f 100644
--- a/src/mpi/group/group_range_incl.c
+++ b/src/mpi/group/group_range_incl.c
@@ -65,7 +65,6 @@ int MPIR_Group_range_incl_impl(MPID_Group *group_ptr, int n, int ranges[][3], MP
first = ranges[i][0]; last = ranges[i][1]; stride = ranges[i][2];
if (stride > 0) {
for (j=first; j<=last; j += stride) {
- (*new_group_ptr)->lrank_to_lpid[k].lrank = k;
(*new_group_ptr)->lrank_to_lpid[k].lpid =
group_ptr->lrank_to_lpid[j].lpid;
if (j == group_ptr->rank)
@@ -75,7 +74,6 @@ int MPIR_Group_range_incl_impl(MPID_Group *group_ptr, int n, int ranges[][3], MP
}
else {
for (j=first; j>=last; j += stride) {
- (*new_group_ptr)->lrank_to_lpid[k].lrank = k;
(*new_group_ptr)->lrank_to_lpid[k].lpid =
group_ptr->lrank_to_lpid[j].lpid;
if (j == group_ptr->rank)
diff --git a/src/mpi/group/group_translate_ranks.c b/src/mpi/group/group_translate_ranks.c
index d0f9e3f..6e794c3 100644
--- a/src/mpi/group/group_translate_ranks.c
+++ b/src/mpi/group/group_translate_ranks.c
@@ -96,7 +96,7 @@ int MPIR_Group_translate_ranks_impl(MPID_Group *gp1, int n, const int ranks1[],
l2_pid = -1;
}
if (l1_pid == l2_pid)
- ranks2[i] = gp2->lrank_to_lpid[g2_idx].lrank;
+ ranks2[i] = g2_idx;
}
}
}
diff --git a/src/mpi/group/group_union.c b/src/mpi/group/group_union.c
index bf655ad..97e9554 100644
--- a/src/mpi/group/group_union.c
+++ b/src/mpi/group/group_union.c
@@ -106,7 +106,6 @@ int MPIR_Group_union_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, MPID_G
/* Add group1 */
size1 = group_ptr1->size;
for (i = 0; i < size1; i++) {
- (*new_group_ptr)->lrank_to_lpid[i].lrank = i;
(*new_group_ptr)->lrank_to_lpid[i].lpid =
group_ptr1->lrank_to_lpid[i].lpid;
}
@@ -123,7 +122,6 @@ int MPIR_Group_union_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, MPID_G
k = size1;
for (i = 0; i < size2; i++) {
if (group_ptr2->lrank_to_lpid[i].flag) {
- (*new_group_ptr)->lrank_to_lpid[k].lrank = k;
(*new_group_ptr)->lrank_to_lpid[k].lpid = group_ptr2->lrank_to_lpid[i].lpid;
if ((*new_group_ptr)->rank == MPI_UNDEFINED &&
group_ptr2->lrank_to_lpid[i].lpid == mylpid)
diff --git a/src/mpi/group/grouputil.c b/src/mpi/group/grouputil.c
index bd452ea..ff2ce39 100644
--- a/src/mpi/group/grouputil.c
+++ b/src/mpi/group/grouputil.c
@@ -390,7 +390,6 @@ int MPIR_GroupCheckVCRSubset( MPID_Group *group_ptr, int vsize, MPID_VCR *vcr )
/* Initialize the vmap */
for (i=0; i<vsize; i++) {
MPID_VCR_Get_lpid( vcr[i], &vmap[i].lpid );
- vmap[i].lrank = i;
vmap[i].next_lpid = 0;
vmap[i].flag = 0;
}
http://git.mpich.org/mpich.git/commitdiff/d0960b7439b800759df136e989bc5bc41…
commit d0960b7439b800759df136e989bc5bc4165c24cb
Author: Pavan Balaji <balaji(a)anl.gov>
Date: Mon Jul 6 17:58:09 2015 -0500
Remove unused parameter.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index a6cf10d..01cbe31 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -1114,7 +1114,7 @@ extern MPID_Group * const MPID_Group_empty;
do { MPIU_Object_release_ref( _group, _inuse ); } while (0)
void MPIR_Group_setup_lpid_list( MPID_Group * );
-int MPIR_GroupCheckVCRSubset( MPID_Group *group_ptr, int vsize, MPID_VCR *vcr, int *idx );
+int MPIR_GroupCheckVCRSubset( MPID_Group *group_ptr, int vsize, MPID_VCR *vcr );
/* ------------------------------------------------------------------------- */
diff --git a/src/mpi/comm/comm_create.c b/src/mpi/comm/comm_create.c
index 9d9f100..87f31c9 100644
--- a/src/mpi/comm/comm_create.c
+++ b/src/mpi/comm/comm_create.c
@@ -125,8 +125,7 @@ int MPIR_Comm_create_calculate_mapping(MPID_Group *group_ptr,
{
MPID_BEGIN_ERROR_CHECKS;
{
- int idx;
- mpi_errno = MPIR_GroupCheckVCRSubset( group_ptr, vcr_size, vcr, &idx );
+ mpi_errno = MPIR_GroupCheckVCRSubset( group_ptr, vcr_size, vcr );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
MPID_END_ERROR_CHECKS;
diff --git a/src/mpi/group/grouputil.c b/src/mpi/group/grouputil.c
index da427ee..bd452ea 100644
--- a/src/mpi/group/grouputil.c
+++ b/src/mpi/group/grouputil.c
@@ -375,8 +375,7 @@ int MPIR_Group_check_valid_ranges( MPID_Group *group_ptr,
We sort the lpids for the group and the vcr. If the group has an
lpid that is not in the vcr, then report an error.
*/
-int MPIR_GroupCheckVCRSubset( MPID_Group *group_ptr, int vsize, MPID_VCR *vcr,
- int *idx )
+int MPIR_GroupCheckVCRSubset( MPID_Group *group_ptr, int vsize, MPID_VCR *vcr )
{
int mpi_errno = MPI_SUCCESS;
int g1_idx, g2_idx, l1_pid, l2_pid, i;
-----------------------------------------------------------------------
Summary of changes:
src/include/mpiimpl.h | 3 +--
src/mpi/comm/comm_create.c | 3 +--
src/mpi/comm/comm_group.c | 1 -
src/mpi/comm/comm_remote_group.c | 1 -
src/mpi/group/group_difference.c | 1 -
src/mpi/group/group_excl.c | 1 -
src/mpi/group/group_incl.c | 1 -
src/mpi/group/group_intersection.c | 1 -
src/mpi/group/group_range_excl.c | 1 -
src/mpi/group/group_range_incl.c | 2 --
src/mpi/group/group_translate_ranks.c | 2 +-
src/mpi/group/group_union.c | 2 --
src/mpi/group/grouputil.c | 4 +---
13 files changed, 4 insertions(+), 19 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-184-gc5ee3a0
by noreply@mpich.org 05 Jul '15
by noreply@mpich.org 05 Jul '15
05 Jul '15
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via c5ee3a08c8458509849094a0c27a558b323e8ba4 (commit)
via f0a66babd3ffccdc976ace6f4e7cf7631bce4ce6 (commit)
from 9289c6e6a4c582f5707aaac92a2359d492832c58 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/c5ee3a08c8458509849094a0c27a558b3…
commit c5ee3a08c8458509849094a0c27a558b323e8ba4
Author: Min Si <msi(a)il.is.s.u-tokyo.ac.jp>
Date: Tue Jun 30 22:49:02 2015 -0500
Added test to check remote completion of RMA+flush.
This patch adds two tests to check the remote completion of flush with
RMA write-like operations (PUT, ACC, GET_ACC, FOP, CAS). One test
confirms the result by shm load, and the other one confirms result by
GET issued from another process.
Signed-off-by: Xin Zhao <xinzhao3(a)illinois.edu>
Signed-off-by: Halim Amer <aamer(a)anl.gov>
diff --git a/test/mpi/rma/Makefile.am b/test/mpi/rma/Makefile.am
index 6a7350f..c48a59b 100644
--- a/test/mpi/rma/Makefile.am
+++ b/test/mpi/rma/Makefile.am
@@ -158,7 +158,17 @@ noinst_PROGRAMS = \
manyget \
derived-acc-flush_local\
large-acc-flush_local \
- large-small-acc
+ large-small-acc \
+ put_flush_get \
+ acc_flush_get \
+ gacc_flush_get \
+ fop_flush_get \
+ cas_flush_get \
+ win_shared_put_flush_load \
+ win_shared_acc_flush_load \
+ win_shared_gacc_flush_load \
+ win_shared_fop_flush_load \
+ win_shared_cas_flush_load
if BUILD_MPIX_TESTS
noinst_PROGRAMS += aint
@@ -242,3 +252,27 @@ linked_list_bench_lock_shr_nocheck_CPPFLAGS = -DUSE_MODE_NOCHECK $(AM_CPPFLAGS)
win_shared_create_allocshm_SOURCES = win_shared_create.c
win_shared_create_no_allocshm_SOURCES = win_shared_create.c
win_shared_create_allocshm_CPPFLAGS = -DUSE_INFO_ALLOC_SHM $(AM_CPPFLAGS)
+
+put_flush_get_SOURCES = wrma_flush_get.c
+acc_flush_get_SOURCES = wrma_flush_get.c
+gacc_flush_get_SOURCES = wrma_flush_get.c
+fop_flush_get_SOURCES = wrma_flush_get.c
+cas_flush_get_SOURCES = wrma_flush_get.c
+
+put_flush_get_CPPFLAGS = -DTEST_PUT $(AM_CPPFLAGS)
+acc_flush_get_CPPFLAGS = -DTEST_ACC $(AM_CPPFLAGS)
+gacc_flush_get_CPPFLAGS = -DTEST_GACC $(AM_CPPFLAGS)
+fop_flush_get_CPPFLAGS = -DTEST_FOP $(AM_CPPFLAGS)
+cas_flush_get_CPPFLAGS = -DTEST_CAS $(AM_CPPFLAGS)
+
+win_shared_put_flush_load_SOURCES = win_shared_rma_flush_load.c
+win_shared_acc_flush_load_SOURCES = win_shared_rma_flush_load.c
+win_shared_gacc_flush_load_SOURCES = win_shared_rma_flush_load.c
+win_shared_fop_flush_load_SOURCES = win_shared_rma_flush_load.c
+win_shared_cas_flush_load_SOURCES = win_shared_rma_flush_load.c
+
+win_shared_put_flush_load_CPPFLAGS = -DTEST_PUT $(AM_CPPFLAGS)
+win_shared_acc_flush_load_CPPFLAGS = -DTEST_ACC $(AM_CPPFLAGS)
+win_shared_gacc_flush_load_CPPFLAGS = -DTEST_GACC $(AM_CPPFLAGS)
+win_shared_fop_flush_load_CPPFLAGS = -DTEST_FOP $(AM_CPPFLAGS)
+win_shared_cas_flush_load_CPPFLAGS = -DTEST_CAS $(AM_CPPFLAGS)
\ No newline at end of file
diff --git a/test/mpi/rma/testlist.in b/test/mpi/rma/testlist.in
index 42766cc..e2e3a4a 100644
--- a/test/mpi/rma/testlist.in
+++ b/test/mpi/rma/testlist.in
@@ -147,6 +147,16 @@ manyget 2
derived-acc-flush_local 3 mpiversion=3.0
large-acc-flush_local 3 mpiversion=3.0
large-small-acc 2
+win_shared_put_flush_load 3 mpiversion=3.0
+win_shared_acc_flush_load 3 mpiversion=3.0
+win_shared_gacc_flush_load 3 mpiversion=3.0
+win_shared_fop_flush_load 3 mpiversion=3.0
+win_shared_cas_flush_load 3 mpiversion=3.0
+put_flush_get 3 mpiversion=3.0
+acc_flush_get 3 mpiversion=3.0
+gacc_flush_get 3 mpiversion=3.0
+fop_flush_get 3 mpiversion=3.0
+cas_flush_get 3 mpiversion=3.0
## This test is not strictly correct. This was meant to test out the
## case when MPI_Test is not nonblocking. However, we ended up
diff --git a/test/mpi/rma/win_shared_rma_flush_load.c b/test/mpi/rma/win_shared_rma_flush_load.c
new file mode 100644
index 0000000..9edf270
--- /dev/null
+++ b/test/mpi/rma/win_shared_rma_flush_load.c
@@ -0,0 +1,296 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <mpi.h>
+#include "mpitest.h"
+
+#define ITER 10000
+#define BUF_CNT 1
+int local_buf[BUF_CNT], result_addr[BUF_CNT];
+
+const int verbose = 0;
+
+/* This test checks the remote completion of flush with RMA write-like operations
+ * (PUT, ACC, GET_ACC, FOP, CAS), and confirms result by shm load.
+ * 1. P(target) and P(checker) allocate a shared window, and
+ * then create a global window with P(origin) by using the shared window buffer.
+ * 2. P(origin) issues RMA operations and flush to P(target) through the global
+ * window and then call send-recv to synchronize with P(checker).
+ * 3. P(checker) then checks the result through shm window by local load. */
+
+int rank = -1, nproc = 0;
+int origin = -1, target = -1, checker = -1;
+MPI_Win win = MPI_WIN_NULL, shm_win = MPI_WIN_NULL;
+int *shm_target_base = NULL, *my_base = NULL;
+
+/* Define operation name for error message */
+#ifdef TEST_PUT
+const char *rma_name = "Put";
+#elif defined(TEST_ACC)
+const char *rma_name = "Accumulate";
+#elif defined(TEST_GACC)
+const char *rma_name = "Get_accumulate";
+#elif defined(TEST_FOP)
+const char *rma_name = "Fetch_and_op";
+#elif defined(TEST_CAS)
+const char *rma_name = "Compare_and_swap";
+#else
+const char *rma_name = "None";
+#endif
+
+/* Issue functions for different RMA operations */
+#ifdef TEST_PUT
+static inline void issue_rma_op(int i)
+{
+ MPI_Put(&local_buf[i], 1, MPI_INT, target, i, 1, MPI_INT, win);
+}
+#elif defined(TEST_ACC)
+static inline void issue_rma_op(int i)
+{
+ MPI_Accumulate(&local_buf[i], 1, MPI_INT, target, i, 1, MPI_INT, MPI_REPLACE, win);
+}
+#elif defined(TEST_GACC)
+static inline void issue_rma_op(int i)
+{
+ MPI_Get_accumulate(&local_buf[i], 1, MPI_INT, &result_addr[i], 1, MPI_INT, target, i,
+ 1, MPI_INT, MPI_REPLACE, win);
+}
+#elif defined(TEST_FOP)
+static inline void issue_rma_op(int i)
+{
+ MPI_Fetch_and_op(&local_buf[i], &result_addr[i], MPI_INT, target, i, MPI_REPLACE, win);
+}
+#elif defined(TEST_CAS)
+static inline void issue_rma_op(int i)
+{
+ int compare_val = i; /* always equal to window value, thus swap happens */
+ MPI_Compare_and_swap(&local_buf[i], &compare_val, &result_addr[i], MPI_INT, target, i, win);
+}
+#endif
+
+
+/* Local check function for GET-like operations */
+#if defined(TEST_GACC) || defined(TEST_FOP) || defined(TEST_CAS)
+
+/* Check local result buffer for GET-like operations */
+static int check_local_result(int iter)
+{
+ int i = 0;
+ int errors = 0;
+
+ for (i = 0; i < BUF_CNT; i++) {
+ if (result_addr[i] != i) {
+ printf("rank %d (iter %d) - check %s, got result_addr[%d] = %d, expected %d\n",
+ rank, iter, rma_name, i, result_addr[i], i);
+ errors++;
+ }
+ }
+ return errors;
+}
+
+#else
+#define check_local_result(iter) (0)
+#endif
+
+static int run_test()
+{
+ int i = 0, x = 0;
+ int errors = 0;
+ int sbuf = 0, rbuf = 0;
+ MPI_Status stat;
+
+ for (x = 0; x < ITER; x++) {
+ /* 1. Target resets window data */
+ if (rank == target) {
+ for (i = 0; i < BUF_CNT; i++)
+ my_base[i] = i;
+ MPI_Win_sync(shm_win); /* write is done on shm window */
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ /* 2. Every one resets local data */
+ for (i = 0; i < BUF_CNT; i++) {
+ local_buf[i] = BUF_CNT + x * BUF_CNT + i;
+ result_addr[i] = 0;
+ }
+
+ /* 3. Origin issues RMA operation to target */
+ if (rank == origin) {
+ /* 3-1. Issue RMA. */
+ for (i = 0; i < BUF_CNT; i++) {
+ issue_rma_op(i);
+ }
+ MPI_Win_flush(target, win);
+
+ /* 3-2. Check local result buffer. */
+ errors += check_local_result(x);
+
+ /* sync with checker */
+ MPI_Send(&sbuf, 1, MPI_INT, checker, 999, MPI_COMM_WORLD);
+ }
+
+ /* 4. Checker confirms result on target */
+ if (rank == checker) {
+ /* sync with origin */
+ MPI_Recv(&rbuf, 1, MPI_INT, origin, 999, MPI_COMM_WORLD, &stat);
+
+ MPI_Win_sync(shm_win);
+
+ for (i = 0; i < BUF_CNT; i++) {
+ if (shm_target_base[i] != local_buf[i]) {
+ printf("rank %d (iter %d) - check %s, got shm_target_base[%d] = %d, "
+ "expected %d\n", rank, x, rma_name, i, shm_target_base[i], local_buf[i]);
+ errors++;
+ }
+ }
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+ }
+
+ return errors;
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+ int errors = 0, all_errors = 0;
+ MPI_Comm shm_comm = MPI_COMM_NULL;
+ int shm_rank;
+ int *shm_ranks = NULL, *shm_root_ranks = NULL;
+ int win_size = sizeof(int) * BUF_CNT;
+ int win_unit = sizeof(int);
+ int shm_root_rank = -1, shm_target = -1, target_shm_root = -1;
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &nproc);
+
+ if (nproc != 3) {
+ if (rank == 0)
+ printf("Error: must be run with three processes\n");
+ MPI_Barrier(MPI_COMM_WORLD);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+#if !defined(TEST_PUT) && !defined(TEST_ACC) && !defined(TEST_GACC) && !defined(TEST_FOP) && !defined(TEST_CAS)
+ if (rank == 0)
+ printf("Error: must specify operation type at compile time\n");
+ MPI_Barrier(MPI_COMM_WORLD);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+#endif
+
+ MPI_Comm_split_type(MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED, rank, MPI_INFO_NULL, &shm_comm);
+ MPI_Comm_rank(shm_comm, &shm_rank);
+
+ shm_ranks = (int *) calloc(nproc, sizeof(int));
+ shm_root_ranks = (int *) calloc(nproc, sizeof(int));
+
+ /* Identify node id */
+ if (shm_rank == 0)
+ shm_root_rank = rank;
+ MPI_Bcast(&shm_root_rank, 1, MPI_INT, 0, shm_comm);
+
+ /* Exchange local root rank and local rank */
+ shm_ranks[rank] = shm_rank;
+ shm_root_ranks[rank] = shm_root_rank;
+
+ MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, shm_ranks, 1, MPI_INT, MPI_COMM_WORLD);
+ MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, shm_root_ranks, 1, MPI_INT, MPI_COMM_WORLD);
+
+ /* Check if there are at least two processes in shared memory. */
+ for (i = 0; i < nproc; i++) {
+ if (shm_ranks[i] != 0) {
+ target_shm_root = shm_root_ranks[i];
+ break;
+ }
+ }
+
+ /* Every process is in separate memory, we cannot create shared window. Just return. */
+ if (target_shm_root < 0)
+ goto exit;
+
+ /* Identify origin, target and checker ranks.
+ * the first process in shared memory is target, and the second one is checker;
+ * the last process is origin.*/
+ shm_target = 0;
+ for (i = 0; i < nproc; i++) {
+ if (shm_root_ranks[i] == target_shm_root) {
+ if (shm_ranks[i] == 0) {
+ target = i;
+ }
+ else if (shm_ranks[i] == 1) {
+ checker = i;
+ }
+ else {
+ /* all three processes are in shared memory, origin is the third one. */
+ origin = i;
+ }
+ }
+ else {
+ /* origin is in separate memory. */
+ origin = i;
+ }
+ }
+
+ if (verbose) {
+ printf("---- rank %d: origin = %d, checker = %d, target = %d, test %s\n",
+ rank, origin, checker, target, rma_name);
+ }
+
+ /* Allocate shared memory among local processes, then create a global window
+ * with the shared window buffers. */
+ MPI_Win_allocate_shared(win_size, win_unit, MPI_INFO_NULL, shm_comm, &my_base, &shm_win);
+ MPI_Win_create(my_base, win_size, win_unit, MPI_INFO_NULL, MPI_COMM_WORLD, &win);
+
+ /* Get address of target window on checker process. */
+ if (rank == checker) {
+ MPI_Aint size;
+ int disp_unit;
+ MPI_Win_shared_query(shm_win, shm_target, &size, &disp_unit, &shm_target_base);
+ if (verbose) {
+ printf("---- I am checker = %d, shm_target_base=%p\n", checker, shm_target_base);
+ }
+ }
+
+ /* Start checking. */
+ MPI_Win_lock_all(0, win);
+ MPI_Win_lock_all(0, shm_win);
+
+ errors = run_test();
+
+ MPI_Win_unlock_all(shm_win);
+ MPI_Win_unlock_all(win);
+
+ MPI_Reduce(&errors, &all_errors, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
+
+ exit:
+
+ if (rank == 0 && all_errors == 0)
+ printf(" No Errors\n");
+
+ if (shm_ranks)
+ free(shm_ranks);
+ if (shm_root_ranks)
+ free(shm_root_ranks);
+
+ if (shm_win != MPI_WIN_NULL)
+ MPI_Win_free(&shm_win);
+
+ if (win != MPI_WIN_NULL)
+ MPI_Win_free(&win);
+
+ if (shm_comm != MPI_COMM_NULL)
+ MPI_Comm_free(&shm_comm);
+
+ MPI_Finalize();
+
+ return 0;
+}
diff --git a/test/mpi/rma/wrma_flush_get.c b/test/mpi/rma/wrma_flush_get.c
new file mode 100644
index 0000000..c0b0fc2
--- /dev/null
+++ b/test/mpi/rma/wrma_flush_get.c
@@ -0,0 +1,212 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <mpi.h>
+#include "mpitest.h"
+
+#define ITER 10000
+#define BUF_CNT 1
+int local_buf[BUF_CNT], result_addr[BUF_CNT], check_addr[BUF_CNT];
+
+const int verbose = 0;
+
+/* This test checks the remote completion of flush with RMA write-like operations
+ * (PUT, ACC, GET_ACC, FOP, CAS), and confirms result by GET issued from another
+ * process.
+ * 1. Three processes create window by Win_allocate.
+ * 2. P(origin) issues RMA operations and flush to P(target), then call
+ * send-recv to synchronize with P(checker).
+ * 3. P(checker) then issues get to P(target) to check the results.
+ */
+
+int rank = -1, nproc = 0;
+int origin = -1, target = -1, checker = -1;
+MPI_Win win = MPI_WIN_NULL;
+int *my_base = NULL;
+
+/* Define operation name for error message */
+#ifdef TEST_PUT
+const char *rma_name = "Put";
+#elif defined(TEST_ACC)
+const char *rma_name = "Accumulate";
+#elif defined(TEST_GACC)
+const char *rma_name = "Get_accumulate";
+#elif defined(TEST_FOP)
+const char *rma_name = "Fetch_and_op";
+#elif defined(TEST_CAS)
+const char *rma_name = "Compare_and_swap";
+#else
+const char *rma_name = "None";
+#endif
+
+/* Issue functions for different RMA operations */
+#ifdef TEST_PUT
+static inline void issue_rma_op(int i)
+{
+ MPI_Put(&local_buf[i], 1, MPI_INT, target, i, 1, MPI_INT, win);
+}
+#elif defined(TEST_ACC)
+static inline void issue_rma_op(int i)
+{
+ MPI_Accumulate(&local_buf[i], 1, MPI_INT, target, i, 1, MPI_INT, MPI_REPLACE, win);
+}
+#elif defined(TEST_GACC)
+static inline void issue_rma_op(int i)
+{
+ MPI_Get_accumulate(&local_buf[i], 1, MPI_INT, &result_addr[i], 1, MPI_INT, target, i,
+ 1, MPI_INT, MPI_REPLACE, win);
+}
+#elif defined(TEST_FOP)
+static inline void issue_rma_op(int i)
+{
+ MPI_Fetch_and_op(&local_buf[i], &result_addr[i], MPI_INT, target, i, MPI_REPLACE, win);
+}
+#elif defined(TEST_CAS)
+static inline void issue_rma_op(int i)
+{
+ int compare_val = i; /* always equal to window value, thus swap happens */
+ MPI_Compare_and_swap(&local_buf[i], &compare_val, &result_addr[i], MPI_INT, target, i, win);
+}
+#endif
+
+
+/* Local check function for GET-like operations */
+#if defined(TEST_GACC) || defined(TEST_FOP) || defined(TEST_CAS)
+
+/* Check local result buffer for GET-like operations */
+static int check_local_result(int iter)
+{
+ int i = 0;
+ int errors = 0;
+
+ for (i = 0; i < BUF_CNT; i++) {
+ if (result_addr[i] != i) {
+ printf("rank %d (iter %d) - check %s, got result_addr[%d] = %d, expected %d\n",
+ rank, iter, rma_name, i, result_addr[i], i);
+ errors++;
+ }
+ }
+ return errors;
+}
+
+#else
+#define check_local_result(iter) (0)
+#endif
+
+static int run_test()
+{
+ int i = 0, x = 0;
+ int errors = 0;
+ int sbuf = 0, rbuf = 0;
+ MPI_Status stat;
+
+ for (x = 0; x < ITER; x++) {
+ /* 1. Target resets window data */
+ if (rank == target) {
+ for (i = 0; i < BUF_CNT; i++)
+ my_base[i] = i;
+ MPI_Win_sync(win); /* write is done on window */
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ /* 2. Every one resets local data */
+ for (i = 0; i < BUF_CNT; i++) {
+ local_buf[i] = BUF_CNT + x * BUF_CNT + i;
+ result_addr[i] = 0;
+ }
+
+ /* 3. Origin issues RMA operation to target */
+ if (rank == origin) {
+ /* 3-1. Issue RMA. */
+ for (i = 0; i < BUF_CNT; i++) {
+ issue_rma_op(i);
+ }
+ MPI_Win_flush(target, win);
+
+ /* 3-2. Sync with checker */
+ MPI_Send(&sbuf, 1, MPI_INT, checker, 999, MPI_COMM_WORLD);
+
+ /* 3-3. Check local result buffer */
+ errors += check_local_result(x);
+ }
+
+ /* 4. Checker issues GET to target and checks result */
+ if (rank == checker) {
+ /* 4-1. Sync with origin */
+ MPI_Recv(&rbuf, 1, MPI_INT, origin, 999, MPI_COMM_WORLD, &stat);
+
+ /* 4-2. Get result and check */
+ MPI_Get(check_addr, BUF_CNT, MPI_INT, target, 0, BUF_CNT, MPI_INT, win);
+ MPI_Win_flush(target, win);
+
+ for (i = 0; i < BUF_CNT; i++) {
+ if (check_addr[i] != local_buf[i]) {
+ printf("rank %d (iter %d) - check %s, got check_addr[%d] = %d, expected %d\n",
+ rank, x, rma_name, i, check_addr[i], local_buf[i]);
+ errors++;
+ }
+ }
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+ }
+
+ return errors;
+}
+
+int main(int argc, char *argv[])
+{
+ int errors = 0, all_errors = 0;
+ int win_size = sizeof(int) * BUF_CNT;
+ int win_unit = sizeof(int);
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &nproc);
+
+ if (nproc != 3) {
+ if (rank == 0)
+ printf("Error: must be run with three processes\n");
+ MPI_Barrier(MPI_COMM_WORLD);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+#if !defined(TEST_PUT) && !defined(TEST_ACC) && !defined(TEST_GACC) && !defined(TEST_FOP) && !defined(TEST_CAS)
+ if (rank == 0)
+ printf("Error: must specify operation type at compile time\n");
+ MPI_Barrier(MPI_COMM_WORLD);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+#endif
+
+ /* Identify origin, target and checker ranks. */
+ target = 0;
+ checker = 2;
+ origin = 1;
+
+ MPI_Win_allocate(win_size, win_unit, MPI_INFO_NULL, MPI_COMM_WORLD, &my_base, &win);
+
+ /* Start checking. */
+ MPI_Win_lock_all(0, win);
+
+ errors = run_test();
+
+ MPI_Win_unlock_all(win);
+
+ MPI_Reduce(&errors, &all_errors, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
+ if (rank == 0 && all_errors == 0)
+ printf(" No Errors\n");
+
+ if (win != MPI_WIN_NULL)
+ MPI_Win_free(&win);
+
+ MPI_Finalize();
+
+ return 0;
+}
http://git.mpich.org/mpich.git/commitdiff/f0a66babd3ffccdc976ace6f4e7cf7631…
commit f0a66babd3ffccdc976ace6f4e7cf7631bce4ce6
Author: Min Si <msi(a)il.is.s.u-tokyo.ac.jp>
Date: Tue Jun 30 14:24:39 2015 -0500
Fixed bug in atomic read-modify-write FOP/GACC/CAS tests.
These tests did not open access epoch when checking window result, this
patch fixed it.
Signed-off-by: Xin Zhao <xinzhao3(a)illinois.edu>
diff --git a/test/mpi/rma/atomic_rmw_cas.c b/test/mpi/rma/atomic_rmw_cas.c
index 7db1b53..31968ae 100644
--- a/test/mpi/rma/atomic_rmw_cas.c
+++ b/test/mpi/rma/atomic_rmw_cas.c
@@ -32,6 +32,7 @@ int main(int argc, char *argv[])
int origin_shm, origin_am, dest;
int *orig_buf = NULL, *result_buf = NULL, *compare_buf = NULL,
*target_buf = NULL, *check_buf = NULL;
+ int target_value = 0;
MPI_Win win;
MPI_Status status;
@@ -93,8 +94,12 @@ int main(int argc, char *argv[])
MPI_Gather(result_buf, 1, MPI_INT, check_buf, 1, MPI_INT, dest, MPI_COMM_WORLD);
}
else {
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ target_value = target_buf[0];
+ MPI_Win_unlock(rank, win);
+
MPI_Alloc_mem(sizeof(int) * 3, MPI_INFO_NULL, &check_buf);
- MPI_Gather(target_buf, 1, MPI_INT, check_buf, 1, MPI_INT, dest, MPI_COMM_WORLD);
+ MPI_Gather(&target_value, 1, MPI_INT, check_buf, 1, MPI_INT, dest, MPI_COMM_WORLD);
if (!(check_buf[dest] == 0 && check_buf[origin_shm] == 0 && check_buf[origin_am] == 1)
&& !(check_buf[dest] == 1 && check_buf[origin_shm] == 0 &&
diff --git a/test/mpi/rma/atomic_rmw_fop.c b/test/mpi/rma/atomic_rmw_fop.c
index f30318c..42875f6 100644
--- a/test/mpi/rma/atomic_rmw_fop.c
+++ b/test/mpi/rma/atomic_rmw_fop.c
@@ -114,12 +114,14 @@ int main(int argc, char *argv[])
}
}
else {
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
/* check results on P1 */
if (target_buf[0] != AM_BUF_SIZE + SHM_BUF_SIZE) {
printf("LOOP=%d, rank=%d, FOP, target_buf[0] = %d, expected %d. \n",
k, rank, target_buf[0], AM_BUF_SIZE + SHM_BUF_SIZE);
errors++;
}
+ MPI_Win_unlock(rank, win);
}
}
diff --git a/test/mpi/rma/atomic_rmw_gacc.c b/test/mpi/rma/atomic_rmw_gacc.c
index 5a59ec2..87f5c35 100644
--- a/test/mpi/rma/atomic_rmw_gacc.c
+++ b/test/mpi/rma/atomic_rmw_gacc.c
@@ -30,6 +30,7 @@
int rank, size;
int dest, origin_shm, origin_am;
int *orig_buf = NULL, *result_buf = NULL, *target_buf = NULL, *check_buf = NULL;
+MPI_Win win;
void checkResults(int loop_k, int *errors)
{
@@ -63,6 +64,7 @@ void checkResults(int loop_k, int *errors)
}
}
else {
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
/* check results on P1 */
for (i = 0; i < OP_COUNT; i++) {
if (target_buf[i] != AM_BUF_NUM + SHM_BUF_NUM) {
@@ -71,6 +73,7 @@ void checkResults(int loop_k, int *errors)
(*errors)++;
}
}
+ MPI_Win_unlock(rank, win);
}
}
@@ -79,7 +82,6 @@ int main(int argc, char *argv[])
int i, j, k;
int errors = 0, all_errors = 0;
int my_buf_num;
- MPI_Win win;
MPI_Datatype origin_dtp, target_dtp;
MPI_Init(&argc, &argv);
-----------------------------------------------------------------------
Summary of changes:
test/mpi/rma/Makefile.am | 36 ++++-
test/mpi/rma/atomic_rmw_cas.c | 7 +-
test/mpi/rma/atomic_rmw_fop.c | 2 +
test/mpi/rma/atomic_rmw_gacc.c | 4 +-
test/mpi/rma/testlist.in | 10 +
test/mpi/rma/win_shared_rma_flush_load.c | 296 ++++++++++++++++++++++++++++++
test/mpi/rma/wrma_flush_get.c | 212 +++++++++++++++++++++
7 files changed, 564 insertions(+), 3 deletions(-)
create mode 100644 test/mpi/rma/win_shared_rma_flush_load.c
create mode 100644 test/mpi/rma/wrma_flush_get.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-182-g9289c6e
by noreply@mpich.org 03 Jul '15
by noreply@mpich.org 03 Jul '15
03 Jul '15
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 9289c6e6a4c582f5707aaac92a2359d492832c58 (commit)
from 0c54cef778aa8a4849fedf92d96c03f4a38caa3d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/9289c6e6a4c582f5707aaac92a2359d49…
commit 9289c6e6a4c582f5707aaac92a2359d492832c58
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Wed Jul 1 21:10:27 2015 -0500
Revert "Perf-tuning: overlapping issuing data and computation on target side in GACC/FOP."
This reverts commit 06dbf44b8fe8cc313b5bab53e2cfd59b8085f718.
In commit 06dbf44b8fe8cc313b5bab53e2cfd59b8085f718, for GACC/FOP/CAS,
the target side first starts sending back data, then performs computation,
in order to overlap data transmission and computation. This is not
correct when this operation needs to be piggybacked with a FLUSH flag,
or a Win_flush call is called after this operation, because the
completion of computation on the target side is not guaranteed.
Here we revert this patch so that data is sent back after computation
is done on the target side.
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_req.c b/src/mpid/ch3/src/ch3u_handle_recv_req.c
index 6bc7d87..7d0c8c1 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_req.c
@@ -332,6 +332,18 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq
MPID_Segment_free(seg);
}
+ /* accumulate data from tmp_buf into user_buf */
+ MPIU_Assert(predef_count == (int) predef_count);
+ mpi_errno = do_accumulate_op(rreq->dev.user_buf, (int) predef_count, basic_type,
+ rreq->dev.real_user_buf, rreq->dev.user_count, rreq->dev.datatype,
+ stream_offset, rreq->dev.op);
+
+ if (win_ptr->shm_allocated == TRUE)
+ MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+
+ if (mpi_errno)
+ MPIU_ERR_POP(mpi_errno);
+
resp_req->dev.OnFinal = MPIDI_CH3_ReqHandler_GaccumSendComplete;
resp_req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GaccumSendComplete;
resp_req->dev.target_win_handle = rreq->dev.target_win_handle;
@@ -353,18 +365,6 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq
MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
- /* accumulate data from tmp_buf into user_buf */
- MPIU_Assert(predef_count == (int) predef_count);
- mpi_errno = do_accumulate_op(rreq->dev.user_buf, (int) predef_count, basic_type,
- rreq->dev.real_user_buf, rreq->dev.user_count, rreq->dev.datatype,
- stream_offset, rreq->dev.op);
-
- if (win_ptr->shm_allocated == TRUE)
- MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-
- if (mpi_errno)
- MPIU_ERR_POP(mpi_errno);
-
/* Mark get portion as handled */
rreq->dev.resp_request_handle = MPI_REQUEST_NULL;
@@ -467,6 +467,16 @@ int MPIDI_CH3_ReqHandler_FOPRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
MPID_Segment_free(seg);
}
+ /* Perform accumulate computation */
+ mpi_errno = do_accumulate_op(rreq->dev.user_buf, 1, rreq->dev.datatype,
+ rreq->dev.real_user_buf, 1, rreq->dev.datatype, 0, rreq->dev.op);
+
+ if (win_ptr->shm_allocated == TRUE)
+ MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+
+ if (mpi_errno)
+ MPIU_ERR_POP(mpi_errno);
+
/* Send back data */
MPIDI_Pkt_init(fop_resp_pkt, MPIDI_CH3_PKT_FOP_RESP);
fop_resp_pkt->request_handle = rreq->dev.resp_request_handle;
@@ -491,16 +501,6 @@ int MPIDI_CH3_ReqHandler_FOPRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq, i
MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
- /* Perform accumulate computation */
- mpi_errno = do_accumulate_op(rreq->dev.user_buf, 1, rreq->dev.datatype,
- rreq->dev.real_user_buf, 1, rreq->dev.datatype, 0, rreq->dev.op);
-
- if (win_ptr->shm_allocated == TRUE)
- MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-
- if (mpi_errno)
- MPIU_ERR_POP(mpi_errno);
-
if (is_empty_origin == FALSE) {
/* free the temporary buffer.
* When origin data is zero, there
@@ -1372,6 +1372,20 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
MPIU_ERR_POP(mpi_errno);
}
+ /* Perform ACCUMULATE OP */
+
+ /* All data fits in packet header */
+ mpi_errno =
+ do_accumulate_op(get_accum_pkt->info.data, get_accum_pkt->count,
+ get_accum_pkt->datatype, get_accum_pkt->addr, get_accum_pkt->count,
+ get_accum_pkt->datatype, 0, get_accum_pkt->op);
+
+ if (win_ptr->shm_allocated == TRUE)
+ MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+
+ if (mpi_errno != MPI_SUCCESS)
+ MPIU_ERR_POP(mpi_errno);
+
/* here we increment the Active Target counter to guarantee the GET-like
* operation are completed when counter reaches zero. */
win_ptr->at_completion_counter++;
@@ -1387,20 +1401,6 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
}
- /* Perform ACCUMULATE OP */
-
- /* All data fits in packet header */
- mpi_errno =
- do_accumulate_op(get_accum_pkt->info.data, get_accum_pkt->count,
- get_accum_pkt->datatype, get_accum_pkt->addr, get_accum_pkt->count,
- get_accum_pkt->datatype, 0, get_accum_pkt->op);
-
- if (win_ptr->shm_allocated == TRUE)
- MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
goto fn_exit;
}
@@ -1446,6 +1446,19 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
MPID_Segment_free(seg);
}
+ /* Perform ACCUMULATE OP */
+
+ MPIU_Assert(recv_count == (int) recv_count);
+ mpi_errno = do_accumulate_op(target_lock_entry->data, (int) recv_count, get_accum_pkt->datatype,
+ get_accum_pkt->addr, get_accum_pkt->count, get_accum_pkt->datatype,
+ 0, get_accum_pkt->op);
+
+ if (win_ptr->shm_allocated == TRUE)
+ MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+
+ if (mpi_errno != MPI_SUCCESS)
+ MPIU_ERR_POP(mpi_errno);
+
/* here we increment the Active Target counter to guarantee the GET-like
* operation are completed when counter reaches zero. */
win_ptr->at_completion_counter++;
@@ -1473,19 +1486,6 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
}
- /* Perform ACCUMULATE OP */
-
- MPIU_Assert(recv_count == (int) recv_count);
- mpi_errno = do_accumulate_op(target_lock_entry->data, (int) recv_count, get_accum_pkt->datatype,
- get_accum_pkt->addr, get_accum_pkt->count, get_accum_pkt->datatype,
- 0, get_accum_pkt->op);
-
- if (win_ptr->shm_allocated == TRUE)
- MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
fn_exit:
return mpi_errno;
fn_fail:
@@ -1591,6 +1591,22 @@ static inline int perform_fop_in_lock_queue(MPID_Win * win_ptr,
MPID_Segment_free(seg);
}
+ /* Apply the op */
+ if (fop_pkt->type == MPIDI_CH3_PKT_FOP_IMMED) {
+ mpi_errno = do_accumulate_op(fop_pkt->info.data, 1, fop_pkt->datatype,
+ fop_pkt->addr, 1, fop_pkt->datatype, 0, fop_pkt->op);
+ }
+ else {
+ mpi_errno = do_accumulate_op(target_lock_entry->data, 1, fop_pkt->datatype,
+ fop_pkt->addr, 1, fop_pkt->datatype, 0, fop_pkt->op);
+ }
+
+ if (win_ptr->shm_allocated == TRUE)
+ MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+
+ if (mpi_errno != MPI_SUCCESS)
+ MPIU_ERR_POP(mpi_errno);
+
if (fop_pkt->type == MPIDI_CH3_PKT_FOP_IMMED) {
/* send back the original data */
MPIU_THREAD_CS_ENTER(CH3COMM, target_lock_entry->vc);
@@ -1635,22 +1651,6 @@ static inline int perform_fop_in_lock_queue(MPID_Win * win_ptr,
goto fn_exit;
}
- /* Apply the op */
- if (fop_pkt->type == MPIDI_CH3_PKT_FOP_IMMED) {
- mpi_errno = do_accumulate_op(fop_pkt->info.data, 1, fop_pkt->datatype,
- fop_pkt->addr, 1, fop_pkt->datatype, 0, fop_pkt->op);
- }
- else {
- mpi_errno = do_accumulate_op(target_lock_entry->data, 1, fop_pkt->datatype,
- fop_pkt->addr, 1, fop_pkt->datatype, 0, fop_pkt->op);
- }
-
- if (win_ptr->shm_allocated == TRUE)
- MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
/* do final action */
mpi_errno = finish_op_on_target(win_ptr, target_lock_entry->vc, TRUE /* has response data */ ,
fop_pkt->flags, MPI_WIN_NULL);
@@ -1700,14 +1700,6 @@ static inline int perform_cas_in_lock_queue(MPID_Win * win_ptr,
MPIU_Memcpy((void *) &cas_resp_pkt->info.data, cas_pkt->addr, len);
- /* Send the response packet */
- MPIU_THREAD_CS_ENTER(CH3COMM, target_lock_entry->vc);
- mpi_errno =
- MPIDI_CH3_iStartMsg(target_lock_entry->vc, cas_resp_pkt, sizeof(*cas_resp_pkt), &send_req);
- MPIU_THREAD_CS_EXIT(CH3COMM, target_lock_entry->vc);
-
- MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
-
/* Compare and replace if equal */
if (MPIR_Compare_equal(&cas_pkt->compare_data, cas_pkt->addr, cas_pkt->datatype)) {
MPIU_Memcpy(cas_pkt->addr, &cas_pkt->origin_data, len);
@@ -1716,6 +1708,13 @@ static inline int perform_cas_in_lock_queue(MPID_Win * win_ptr,
if (win_ptr->shm_allocated == TRUE)
MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+ /* Send the response packet */
+ MPIU_THREAD_CS_ENTER(CH3COMM, target_lock_entry->vc);
+ mpi_errno = MPIDI_CH3_iStartMsg(target_lock_entry->vc, cas_resp_pkt, sizeof(*cas_resp_pkt), &send_req);
+ MPIU_THREAD_CS_EXIT(CH3COMM, target_lock_entry->vc);
+
+ MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+
if (send_req != NULL) {
if (!MPID_Request_is_complete(send_req)) {
/* sending process is not completed, set proper OnDataAvail
diff --git a/src/mpid/ch3/src/ch3u_rma_pkthandler.c b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
index a1b7dd9..84231c9 100644
--- a/src/mpid/ch3/src/ch3u_rma_pkthandler.c
+++ b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
@@ -949,6 +949,18 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPIU_ERR_POP(mpi_errno);
}
+ /* perform accumulate operation. */
+ mpi_errno =
+ do_accumulate_op(get_accum_pkt->info.data, get_accum_pkt->count,
+ get_accum_pkt->datatype, get_accum_pkt->addr, get_accum_pkt->count,
+ get_accum_pkt->datatype, 0, get_accum_pkt->op);
+
+ if (win_ptr->shm_allocated == TRUE)
+ MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+
+ if (mpi_errno)
+ MPIU_ERR_POP(mpi_errno);
+
iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) get_accum_resp_pkt;
iov[0].MPID_IOV_LEN = sizeof(*get_accum_resp_pkt);
iovcnt = 1;
@@ -963,18 +975,6 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
}
/* --END ERROR HANDLING-- */
-
- /* perform accumulate operation. */
- mpi_errno =
- do_accumulate_op(get_accum_pkt->info.data, get_accum_pkt->count,
- get_accum_pkt->datatype, get_accum_pkt->addr, get_accum_pkt->count,
- get_accum_pkt->datatype, 0, get_accum_pkt->op);
-
- if (win_ptr->shm_allocated == TRUE)
- MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-
- if (mpi_errno)
- MPIU_ERR_POP(mpi_errno);
}
else {
int is_derived_dt = 0;
@@ -1206,13 +1206,6 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPIU_Memcpy((void *) &cas_resp_pkt->info.data, cas_pkt->addr, len);
- /* Send the response packet */
- MPIU_THREAD_CS_ENTER(CH3COMM, vc);
- mpi_errno = MPIDI_CH3_iStartMsg(vc, cas_resp_pkt, sizeof(*cas_resp_pkt), &req);
- MPIU_THREAD_CS_EXIT(CH3COMM, vc);
-
- MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
-
/* Compare and replace if equal */
if (MPIR_Compare_equal(&cas_pkt->compare_data, cas_pkt->addr, cas_pkt->datatype)) {
MPIU_Memcpy(cas_pkt->addr, &cas_pkt->origin_data, len);
@@ -1221,6 +1214,13 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
if (win_ptr->shm_allocated == TRUE)
MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+ /* Send the response packet */
+ MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+ mpi_errno = MPIDI_CH3_iStartMsg(vc, cas_resp_pkt, sizeof(*cas_resp_pkt), &req);
+ MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+
+ MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+
if (req != NULL) {
if (!MPID_Request_is_complete(req)) {
/* sending process is not completed, set proper OnDataAvail
@@ -1380,12 +1380,6 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPIU_ERR_POP(mpi_errno);
}
- /* send back the original data */
- MPIU_THREAD_CS_ENTER(CH3COMM, vc);
- mpi_errno = MPIDI_CH3_iStartMsg(vc, fop_resp_pkt, sizeof(*fop_resp_pkt), &resp_req);
- MPIU_THREAD_CS_EXIT(CH3COMM, vc);
- MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
-
/* Apply the op */
mpi_errno = do_accumulate_op(fop_pkt->info.data, 1, fop_pkt->datatype,
fop_pkt->addr, 1, fop_pkt->datatype, 0, fop_pkt->op);
@@ -1396,6 +1390,12 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
+ /* send back the original data */
+ MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+ mpi_errno = MPIDI_CH3_iStartMsg(vc, fop_resp_pkt, sizeof(*fop_resp_pkt), &resp_req);
+ MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+ MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+
if (resp_req != NULL) {
if (!MPID_Request_is_complete(resp_req)) {
/* sending process is not completed, set proper OnDataAvail
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/src/ch3u_handle_recv_req.c | 145 +++++++++++++++----------------
src/mpid/ch3/src/ch3u_rma_pkthandler.c | 50 ++++++------
2 files changed, 97 insertions(+), 98 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-181-g0c54cef
by noreply@mpich.org 01 Jul '15
by noreply@mpich.org 01 Jul '15
01 Jul '15
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 0c54cef778aa8a4849fedf92d96c03f4a38caa3d (commit)
via c0141dcb5a6fcc956d31dfc7ccdc01fe9e846940 (commit)
from 1629ff5d74ffcf2e319e665e2b613acd48ed01b0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/0c54cef778aa8a4849fedf92d96c03f4a…
commit 0c54cef778aa8a4849fedf92d96c03f4a38caa3d
Author: Pavan Balaji <balaji(a)anl.gov>
Date: Wed Jul 1 16:53:26 2015 -0500
Remove test/mpid.
Unused/untested directory.
Signed-off-by: Halim Amer <aamer(a)anl.gov>
diff --git a/test/Makefile.am b/test/Makefile.am
index b92ca41..e08a285 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -7,7 +7,7 @@
## FIXME: commented out temporarily, really just want "mpi" to be dealt with at
## distclean time for now
-##SUBDIRS = mpi mpid util basic commands .
+##SUBDIRS = mpi util basic commands .
SUBDIRS = mpi commands .
# Test both the MPI routines and the MPICH command scripts
diff --git a/test/mpid/atomic.c b/test/mpid/atomic.c
deleted file mode 100644
index 16e3b69..0000000
--- a/test/mpid/atomic.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * (C) 2002 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-/*
- * Test performance of atomic access operations.
- * This is a *very* simple test.
- */
-
-#include "mpiimpl.h"
-
-/* FIXME: MPICH_SINGLE_THREADED is obsolete and no longer defined */
-#if defined(MPICH_SINGLE_THREADED) || !defined(USE_ATOMIC_UPDATES)
-#define MPID_Atomic_incr( count_ptr ) \
- __asm__ __volatile__ ( "lock; incl %0" \
- : "=m" (*count_ptr) :: "memory", "cc" )
-
-#define MPID_Atomic_decr_flag( count_ptr, nzflag ) \
- __asm__ __volatile__ ( "xor %%ax,%%ax; lock; decl %0 ; setnz %%al" \
- : "=m" (*count_ptr) , "=a" (nzflag) :: "memory", "cc" )
-#endif
-
-int main( int argc, char **argv )
-{
- int i, n;
- MPID_Thread_lock_t mutex;
- MPID_Time_t start_t, end_t;
- double time_lock, time_incr, time_single;
- int count;
- int nzflag;
-
- /* Set values */
- n = 10000000;
-
- /* Warm up */
- count = 0;
- MPID_Wtime( &start_t );
- for (i=0; i<1000; i++) {
- count ++;
- }
- MPID_Wtime( &end_t );
-
- /* Test nonatomic increment */
- count = 0;
- MPID_Wtime( &start_t );
- for (i=0; i<n; i++) {
- count ++;
- }
- MPID_Wtime( &end_t );
- MPID_Wtime_diff( &start_t, &end_t, &time_single );
- time_single /= n;
- if (count != n) {
- printf( "Error in nonatomic update\n" );
- }
-
- /* Test atomic increment using lock/unlock */
- count = 0;
- MPID_Thread_lock_init( &mutex );
- MPID_Wtime( &start_t );
- for (i=0; i<n; i++) {
- MPID_Thread_lock( &mutex );
- count ++;
- MPID_Thread_unlock( &mutex );
- }
- MPID_Wtime( &end_t );
- MPID_Wtime_diff( &start_t, &end_t, &time_lock );
- time_lock /= n;
- if (count != n) {
- printf( "Error in thread-locked atomic update\n" );
- }
-
- /* Test atomic increment using special instructions */
- count = 0;
- MPID_Wtime( &start_t );
- for (i=0; i<n; i++) {
- MPID_Atomic_incr( &count );
- }
- MPID_Wtime( &end_t );
- MPID_Wtime_diff( &start_t, &end_t, &time_incr );
-
- time_incr /= n;
- if (count != n) {
- printf( "Error in native atomic update (%d != %d)\n", count, n );
- }
- /* Check for dec sets zero flag */
- for (i=0; i<n-1; i++) {
- MPID_Atomic_decr_flag( &count, nzflag );
- if (!nzflag) {
- printf( "flag not set on iteration %d\n", i );
- break;
- }
- }
- MPID_Atomic_decr_flag( &count, nzflag );
- if (!nzflag) {
- printf( "Flag still set on final decrement\n" );
- }
-
- /* convert times to microseconds */
- time_single *= 1.0e6;
- time_lock *= 1.0e6;
- time_incr *= 1.0e6;
- printf ("Regular \t%f\nLock time \t%f\nAtomic time\t%f\n",
- time_single, time_lock, time_incr );
-
- {
- unsigned int low=0, high=0;
- __asm__ __volatile__ ( "rdtsc ; movl %%edx,%0 ; movl %%eax,%1"
- : "=r" (high), "=r" (low) ::
- "eax", "edx" );
-
- printf ( "time stamp %u %u\n", high, low );
- }
- return 0;
-}
diff --git a/test/mpid/atomic_fai.c b/test/mpid/atomic_fai.c
deleted file mode 100644
index 63388dd..0000000
--- a/test/mpid/atomic_fai.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * (C) 2002 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-/*
- * Test performance of atomic access operations.
- * This is a *very* simple test.
- */
-
-#include "stdio.h"
-#include "unistd.h"
-
-#define MPID_Atomic_fetch_and_incr(count_ptr_, count_old_) do { \
- (count_old_) = 1; \
- __asm__ __volatile__ ("lock ; xaddl %0,%1" \
- : "=r" (count_old_), "=m" (*count_ptr_) \
- : "0" (count_old_), "m" (*count_ptr_)); \
- } while (0)
-
-int main( int argc, char **argv )
-{
- volatile int count = 0;
- int count_old;
- int failures = 0;
- int i;
-
- for (i = 0; i < 1000; i++)
- {
- MPID_Atomic_fetch_and_inc(&count, count_old);
- if (count_old != i )
- {
- fprintf(stderr, "count_old=%d, should be %d\n", count_old, i);
- failures++;
- }
- if (count != i + 1 )
- {
- fprintf(stderr, "count=%d, should be %d\n", count, i + 1);
- failures++;
- }
- }
-
- MPID_Atomic_fetch_and_inc(&count, count_old);
-
- if (failures == 0)
- {
- printf("No Errors\n");
- }
- else
- {
- printf("%d errors encountered\n", failures);
- }
-
- exit(0);
-}
diff --git a/test/mpid/ch3/reorder.c b/test/mpid/ch3/reorder.c
deleted file mode 100644
index 675d4d2..0000000
--- a/test/mpid/ch3/reorder.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * (C) 2001 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-#include <stdio.h>
-
-#include "mpidimpl.h"
-
-#define ITERS 10
-
-int main(int argc, char * argv[])
-{
-#if defined(MPIDI_CH3_MSGS_UNORDERED)
- {
- int rc;
- int size;
- int rank;
- int buf[ITERS];
- int i;
-
- rc = MPI_Init(&argc, &argv);
- assert(rc == MPI_SUCCESS);
-
- rc = MPI_Comm_size(MPI_COMM_WORLD, &size);
- assert(rc == MPI_SUCCESS);
- rc = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- assert(rc == MPI_SUCCESS);
-
- if (size < 2)
- {
- fprintf(stderr, "ERROR: at least 2 processes are required\n");
- fflush(stderr);
- return 1;
- }
-
- if (rank == 0)
- {
- MPI_Request request;
- MPID_Request * req;
- MPI_Status status;
- MPID_Comm * comm;
- MPIDI_VC_t * vc;
-
- MPID_Comm_get_ptr(MPI_COMM_WORLD, comm);
- vc = comm->vcr[1];
-
- for (i = 0; i < ITERS; i++)
- {
- MPID_Seqnum_t seqnum = (i * 7) % ITERS;
- MPIDI_CH3_Pkt_eager_send_t pkt;
-
- pkt.type = MPIDI_CH3_PKT_EAGER_SEND;
- pkt.match.rank = 0;
- pkt.match.tag = i;
- pkt.match.context_id = comm->context_id + MPID_CONTEXT_INTRA_PT2PT;
- pkt.sender_req_id = MPI_REQUEST_NULL;
-# if defined(SEND_DATA)
- {
- pkt.data_sz = seqnum * sizeof(int);
- }
-# else
- {
- pkt.data_sz = 0;
- }
-# endif
- /* MPIDI_CH3U_VC_FAI_send_seqnum(vc, seqnum); */
- MPIDI_CH3U_Pkt_set_seqnum(&pkt, seqnum);
-
- printf("Sending msg %lu, tag=%d\n", seqnum, pkt.match.tag);
- fflush(stdout);
-
- if (pkt.data_sz > 0)
- {
- int j;
- MPID_IOV iov[2];
-
- for(j = 0; j < seqnum; j++)
- {
- buf[j] = seqnum;
- }
-
- iov[0].MPID_IOV_BUF = &pkt;
- iov[0].MPID_IOV_LEN = sizeof(pkt);
- iov[1].MPID_IOV_BUF = buf;
- iov[1].MPID_IOV_LEN = pkt.data_sz;
- req = MPIDI_CH3_iStartMsgv(vc, iov, 2);
- }
- else
- {
- req = MPIDI_CH3_iStartMsg(vc, &pkt, sizeof(pkt));
- }
-
- if (req != NULL)
- {
- MPIDI_CH3U_Request_set_seqnum(req, seqnum);
- MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_SEND);
- req->comm = comm;
- request = req->handle;
- }
- else
- {
- request = MPI_REQUEST_NULL;
- }
-
- rc = MPI_Wait(&request, &status);
- assert(rc == MPI_SUCCESS);
- }
-
- vc->seqnum_send += ITERS;
- }
- else if (rank == 1)
- {
- int errs = 0;
-
- for (i = 0; i < ITERS; i++)
- {
- MPI_Status status;
- int j;
-
- rc = MPI_Recv(buf, ITERS, MPI_INT, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
- assert(rc == MPI_SUCCESS);
-
- rc = MPI_Get_count(&status, MPI_INT, &j);
- assert(rc == MPI_SUCCESS);
-
- printf("Recevied msg rank=%d tag=%d count=%d error=%d\n", status.MPI_SOURCE, status.MPI_TAG, j, status.MPI_ERROR);
- fflush(stdout);
-
-# if defined(SEND_DATA)
- {
- if (j != i)
- {
- errs++;
- printf("ERROR: expected count=%d, got count=%d\n", i, j);
- fflush(stdout);
- continue;
- }
-
- for (j = 0; j < i; j++)
- {
- if (buf[j] != i)
- {
- errs++;
- printf("ERROR: expected buf[%d]=%d, got buf[%d]=%d\n", j, i, j, buf[j]);
- fflush(stdout);
- }
- }
- }
-# endif
- }
-
- if (errs == 0)
- {
- printf("No Errors\n");
- }
- else
- {
- printf("%d Errors\n", errs);
- }
- fflush(stdout);
- }
-
- rc = MPI_Finalize();
- assert(rc == MPI_SUCCESS);
- }
-# else
- {
- fprintf(stderr, "Test disabled.\n");
- fflush(stderr);
- }
-# endif
- return 0;
-}
-
diff --git a/test/mpid/dltest.c b/test/mpid/dltest.c
deleted file mode 100644
index 44cd768..0000000
--- a/test/mpid/dltest.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-/* This provides a simple test of dynamically loading a library. If
- NO_UPCALL is defined, this library only provides routines; otherwise,
- it will make use of the routine upcall provided in the program that is
- loading this library */
-#ifndef NO_UPCALL
-extern int upcall( int );
-#endif
-
-int counter = 1;
-
-int init(void) {
- int a = counter;
- counter++;
-#ifndef NO_UPCALL
- a = upcall( a );
- if (a != counter) {
- counter --;
- }
-#endif
-}
-int finalize( int offset )
-{
- int rc = 1;
- if (counter != offset) {
- rc = 0;
- }
- return rc;
-}
diff --git a/test/mpid/dluse.c b/test/mpid/dluse.c
deleted file mode 100644
index b59a257..0000000
--- a/test/mpid/dluse.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-/*
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <dlfcn.h>
-
-int main( int argc, char *argv[] )
-{
- void *handle;
- int (*init)(void);
- int (*finalize)(int);
- int *counter;
- int errs = 0, rc;
-
- /* We allow different extensions for the shared libraries here,
- as OSX uses .dylib and Cygwin may use .dll . */
- handle = dlopen( "./libconftest."## #SHLIBEXT, RTLD_LAZY );
- if (!handle) {
- fprintf( stderr, "Could not open test library: %s\n", dlerror() );
- exit(1);
- }
-
- init = (int (*)(void))dlsym( handle, "init" );
- counter = (int *)dlsym( handle, "counter" );
- finalize = (int (*)(int))dlsym( handle, "finalize" );
- if (!init || !counter || !finalize) {
- errs++;
- fprintf( stderr, "Could not load a function or variable\n" );
- exit(1);
- }
-
- if (*counter != 1) {
- errs++;
- fprintf( stderr, "counter value is %d, expected 1\n" );
- }
- (*init)();
- if (*counter != 2) {
- errs++;
- fprintf( stderr, "counter value is %d, expected 2\n" );
- }
- rc = (*finalize)(2);
- if (rc != 1) {
- errs++;
- fprintf( stderr, "finalize returned failure\n" );
- }
- dlclose( handle );
-
- printf( "Found %d errors\n", errs );
- return 0;
-}
-
-int upcall( int a )
-{
- return a + 1;
-}
http://git.mpich.org/mpich.git/commitdiff/c0141dcb5a6fcc956d31dfc7ccdc01fe9…
commit c0141dcb5a6fcc956d31dfc7ccdc01fe9e846940
Author: Pavan Balaji <balaji(a)anl.gov>
Date: Wed Jul 1 16:14:34 2015 -0500
Remove unnecessary asm checks for nemesis.
We were testing to see if we were on an x86 32-bit platform that
accepts some assembly code to optimize 32-bit architectures. This is
only for 32-bit systems and seems to be not comprehensive enough to
avoid failures with some compilers (e.g., icc-13.1). Since such
performance optimization on 32-bit platforms is not really a priority
for us, it's cleaner to just remove this.
Signed-off-by: Halim Amer <aamer(a)anl.gov>
diff --git a/configure.ac b/configure.ac
index 44e7c97..47caa1b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4540,102 +4540,7 @@ int main(int argc, char **argv )
AC_DEFINE(HAVE_ANY_INT32_T_ALIGNMENT,1,[Define if int32_t works with any alignment])
fi
fi
-# Check for special compile characteristics
-# If we are either gcc or icc, see if we can use __asm__
-# We test on prog_gcc to allow gcc by any name; if we are using
-# icc, the value of CC must be icc for this test to pass
-if test "$ac_cv_prog_gcc" = "yes" -o "$ac_cv_prog_CC" = "icc" ; then
-AC_MSG_CHECKING([for gcc __asm__ and pentium cmpxchgl instruction])
-AC_TRY_RUN([
-int main(int argc, char *argv[])
-{
-long int compval = 10;
-volatile long int *p = &compval;
-long int oldval = 10;
-long int newval = 20;
-char ret;
-long int readval;
-__asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0"
- : "=q" (ret), "=m" (*p), "=a" (readval)
- : "r" (newval), "m" (*p), "a" (oldval) : "memory");
-return (compval == 20) ? 0 : -1;
-}
-], AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GCC_AND_PENTIUM_ASM, 1,[Define if using gcc on a system with an Intel Pentium class chip])
- lac_cv_use_atomic_updates="yes",
-AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
-fi
-if test "$lac_cv_use_atomic_updates" = "yes" ; then
- AC_DEFINE(USE_ATOMIC_UPDATES,, [Define if assembly language atomic update macros should be used (if available)])
-fi
-# check for x86_64
-if test "$ac_cv_prog_gcc" = "yes" ; then
-AC_MSG_CHECKING([for gcc __asm__ and AMD x86_64 cmpxchgq instruction])
-AC_TRY_RUN([
-int main(int argc, char *argv[])
-{
-long int compval = 10;
-volatile long int *p = &compval;
-long int oldval = 10;
-long int newval = 20;
-char ret;
-long int readval;
-__asm__ __volatile__ ("lock; cmpxchgq %3, %1; sete %0"
- : "=q" (ret), "=m" (*p), "=a" (readval)
- : "r" (newval), "m" (*p), "a" (oldval) : "memory");
-return (compval == 20) ? 0 : -1;
-}
-], AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GCC_AND_X86_64_ASM, 1,[Define if using gcc on a system with an AMD x86_64 class chip]),
-AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
-fi
-dnl
-dnl check for asm() format
-dnl
-dnl AC_MSG_CHECKING([for asm() and pentium cmpxchgl instruction])
-dnl AC_TRY_RUN([
-dnl int main(int argc, char *argv[])
-dnl {
-dnl long int compval = 10;
-dnl volatile long int *p = &compval;
-dnl long int oldval = 10;
-dnl long int newval = 20;
-dnl char ret;
-dnl long int readval;
-dnl asm("lock; cmpxchgl %3, %1; sete %0"
-dnl : "=q" (ret), "=m" (*p), "=a" (readval)
-dnl : "r" (newval), "m" (*p), "a" (oldval) : "memory");
-dnl return (compval == 20) ? 0 : -1;
-dnl }
-dnl ], AC_MSG_RESULT(yes)
-dnl AC_DEFINE(HAVE_PENTIUM_ASM, 1,[Define if using asm() on a system with an Intel Pentium class chip]),
-dnl AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
-dnl
-dnl
-dnl check for IA64
-dnl
-if test "$ac_cv_prog_gcc" = "yes" ; then
-AC_MSG_CHECKING([for gcc __asm__ and IA64 xchg4 instruction])
-AC_TRY_RUN([
-unsigned long _InterlockedExchange(volatile void *ptr, unsigned long x)
-{
- unsigned long result;
- __asm__ __volatile ("xchg4 %0=[%1],%2" : "=r" (result)
- : "r" (ptr), "r" (x) : "memory");
- return result;
-}
-int main(int argc, char *argv[])
-{
-long val = 1;
-volatile long *p = &val;
-long oldval = _InterlockedExchange(p, (unsigned long)2);
-return (oldval == 1 && val == 2) ? 0 : -1;
-}
-], AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GCC_AND_IA64_ASM, 1,[Define if using gcc on a system with an IA64 class chip]),
-AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
-fi
# -----------------------------------------------------------------------------
# Check for support of enable-coverage. Put this near the end of the tests
# because the coverage options may affect the other tests.
diff --git a/src/mpid/ch3/channels/nemesis/Makefile.mk b/src/mpid/ch3/channels/nemesis/Makefile.mk
index c27ba57..8078ba5 100644
--- a/src/mpid/ch3/channels/nemesis/Makefile.mk
+++ b/src/mpid/ch3/channels/nemesis/Makefile.mk
@@ -23,7 +23,6 @@ noinst_HEADERS += \
src/mpid/ch3/channels/nemesis/include/mpid_nem_generic_queue.h \
src/mpid/ch3/channels/nemesis/include/mpid_nem_impl.h \
src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h \
- src/mpid/ch3/channels/nemesis/include/mpid_nem_memdefs.h \
src/mpid/ch3/channels/nemesis/include/mpid_nem_nets.h \
src/mpid/ch3/channels/nemesis/include/mpid_nem_post.h \
src/mpid/ch3/channels/nemesis/include/mpid_nem_pre.h \
diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_memdefs.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_memdefs.h
deleted file mode 100644
index 9e8ee39..0000000
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_memdefs.h
+++ /dev/null
@@ -1,278 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * (C) 2006 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-#ifndef MPID_MEMDEFS_H
-#define MPID_MEMDEFS_H
-#include <mpichconf.h>
-#include <mpimem.h>
-
-#if defined(HAVE_GCC_AND_PENTIUM_ASM)
-#define asm_memcpy(dst, src, n) do { \
- const char *_p = (char *)(src); \
- char *_q = (char *)(dst); \
- size_t _nl = (size_t)(n) >> 2; \
- __asm__ __volatile__ ("cld ; rep ; movsl ; movl %3,%0 ; rep ; movsb" \
- : "+c" (_nl), "+S" (_p), "+D" (_q) \
- : "r" ((n) & 3) : "memory" ); \
- } while (0)
-
-/*
- nt_memcpy (dst, src, len)
- This performs a memcopy using non-temporal stores. It's optimized
- for ia_32 machines.
-
- The general idea is to prefetch a block of the source data into the
- cache, then read the data from the source buffer into 64-bit mmx
- registers so that the data can be written to the destination buffer
- using non-temporal move instructions.
-
- This is done in three steps: copy 8K or larger chunks, copy (8K,
- 128B] chunks, and copy the rest.
-
- In the first step, the main loop prefetches an 8K chunk, by reading
- one element from each cacheline. Then we copy that 8K chunk, 64
- bytes at a time (8bytes per mmx reg * 8 mmx regs) using
- non-temporal stores. Rinse and repeat.
-
- The second step is essentially the same as the first, except that
- the amount of data to be copied in that step is less than 8K, so we
- prefetch all of the data. These two steps could have been combined
- but I think I saved some time by simplifying the main loop in step
- one by not checking if we have to prefetch less than 8K.
-
- The last step just copies whatever's left.
-
- */
-
-static inline void nt_memcpy (volatile void *dst, volatile const void *src, size_t len)
-{
- void *dummy_dst;
- void *dummy_src;
-
- int n;
-
- /* copy in 8K chunks */
- n = len & (-8*1024);
- if (n)
- {
-
- __asm__ __volatile__ ("mov %4, %%ecx\n"
- ".set PREFETCHBLOCK, 1024\n" /* prefetch PREFETCHBLOCK number of 8-byte words */
- "lea (%%esi, %%ecx, 8), %%esi\n"
- "lea (%%edi, %%ecx, 8), %%edi\n"
-
- "neg %%ecx\n"
- "emms\n"
-
- "1:\n" /* main loop */
-
- /* eax is the prefetch loop iteration counter */
- "mov $PREFETCHBLOCK/16, %%eax\n" /* only need to touch one element per cacheline, and we're doing two at once */
-
- /* prefetch 2 cachelines at a time (128 bytes) */
- "2:\n" /* prefetch loop */
- "mov (%%esi, %%ecx, 8), %%edx\n"
- "mov 64(%%esi, %%ecx, 8), %%edx\n"
- "add $16, %%ecx\n"
-
- "dec %%eax\n"
- "jnz 2b\n"
- "sub $PREFETCHBLOCK, %%ecx\n"
-
- /* eax is the copy loop iteration counter */
- "mov $PREFETCHBLOCK/8, %%eax\n"
-
- /* copy data 64 bytes at a time */
- "3:\n" /* copy loop */
- "movq (%%esi, %%ecx, 8), %%mm0\n"
- "movq 8(%%esi, %%ecx, 8), %%mm1\n"
- "movq 16(%%esi, %%ecx, 8), %%mm2\n"
- "movq 24(%%esi, %%ecx, 8), %%mm3\n"
- "movq 32(%%esi, %%ecx, 8), %%mm4\n"
- "movq 40(%%esi, %%ecx, 8), %%mm5\n"
- "movq 48(%%esi, %%ecx, 8), %%mm6\n"
- "movq 56(%%esi, %%ecx, 8), %%mm7\n"
-
- "movntq %%mm0, (%%edi, %%ecx, 8)\n"
- "movntq %%mm1, 8(%%edi, %%ecx, 8)\n"
- "movntq %%mm2, 16(%%edi, %%ecx, 8)\n"
- "movntq %%mm3, 24(%%edi, %%ecx, 8)\n"
- "movntq %%mm4, 32(%%edi, %%ecx, 8)\n"
- "movntq %%mm5, 40(%%edi, %%ecx, 8)\n"
- "movntq %%mm6, 48(%%edi, %%ecx, 8)\n"
- "movntq %%mm7, 56(%%edi, %%ecx, 8)\n"
-
- "add $8, %%ecx\n"
- "dec %%eax\n"
- "jnz 3b\n"
-
- "or %%ecx, %%ecx\n"
- "jnz 1b\n"
-
- "sfence\n"
- "emms\n"
- : "=D" (dummy_dst), "=S" (dummy_src)
- : "0" (dst), "1" (src), "g" (n >> 3)
- : "eax", "edx", "ecx", "memory" );
-
- src = (char *)src + n;
- dst = (char *)dst + n;
- }
-
- /* copy in 128byte chunks */
- n = len & (8*1024 - 1) & -128;
- if (n)
- {
-
- __asm__ __volatile__ ("mov %4, %%ecx\n"
- "lea (%%esi, %%ecx, 8), %%esi\n"
- "lea (%%edi, %%ecx, 8), %%edi\n"
-
- "push %%ecx\n" /* save n */
-
- "mov %%ecx, %%eax\n" /* prefetch loopctr = n/128 */
- "shr $4, %%eax\n"
-
- "neg %%ecx\n"
- "emms\n"
-
- /* prefetch all data to be copied 2 cachelines at a time (128 bytes)*/
- "1:\n" /* prefetch loop */
- "mov (%%esi, %%ecx, 8), %%edx\n"
- "mov 64(%%esi, %%ecx, 8), %%edx\n"
- "add $16, %%ecx\n"
-
- "dec %%eax\n"
- "jnz 1b\n"
-
- "pop %%ecx\n" /* restore n */
-
- "mov %%ecx, %%eax\n" /* write loopctr = n/64 */
- "shr $3, %%eax\n"
- "neg %%ecx\n"
-
- /* copy data 64 bytes at a time */
- "2:\n" /* copy loop */
- "movq (%%esi, %%ecx, 8), %%mm0\n"
- "movq 8(%%esi, %%ecx, 8), %%mm1\n"
- "movq 16(%%esi, %%ecx, 8), %%mm2\n"
- "movq 24(%%esi, %%ecx, 8), %%mm3\n"
- "movq 32(%%esi, %%ecx, 8), %%mm4\n"
- "movq 40(%%esi, %%ecx, 8), %%mm5\n"
- "movq 48(%%esi, %%ecx, 8), %%mm6\n"
- "movq 56(%%esi, %%ecx, 8), %%mm7\n"
-
- "movntq %%mm0, (%%edi, %%ecx, 8)\n"
- "movntq %%mm1, 8(%%edi, %%ecx, 8)\n"
- "movntq %%mm2, 16(%%edi, %%ecx, 8)\n"
- "movntq %%mm3, 24(%%edi, %%ecx, 8)\n"
- "movntq %%mm4, 32(%%edi, %%ecx, 8)\n"
- "movntq %%mm5, 40(%%edi, %%ecx, 8)\n"
- "movntq %%mm6, 48(%%edi, %%ecx, 8)\n"
- "movntq %%mm7, 56(%%edi, %%ecx, 8)\n"
-
- "add $8, %%ecx\n"
- "dec %%eax\n"
- "jnz 2b\n"
-
- "sfence\n"
- "emms\n"
- : "=D" (dummy_dst), "=S" (dummy_src)
- : "0" (dst), "1" (src), "g" (n >> 3)
- : "eax", "edx", "ecx", "memory" );
- src = (char *)src + n;
- dst = (char *)dst + n;
- }
-
- /* copy leftover */
- n = len & (128 - 1);
- if (n)
- asm_memcpy (dst, src, n);
-}
-
-#define MPID_NEM_MEMCPY_CROSSOVER (63*1024)
-
-#define MPIU_Memcpy(a,b,c) do { \
- MPIU_MEM_CHECK_MEMCPY((a),(b),(c)); \
- if (((c)) >= MPID_NEM_MEMCPY_CROSSOVER) \
- nt_memcpy (a, b, c); \
- else \
- asm_memcpy (a, b, c); \
- } while (0)
-
-#elif 0 && defined(HAVE_GCC_AND_X86_64_ASM)
-
-#define asm_memcpy(dst, src, n) do { \
- const char *_p = (char *)(src); \
- char *_q = (char *)(dst); \
- size_t _nq = n >> 3; \
- __asm__ __volatile__ ("cld ; rep ; movsq ; movl %3,%%ecx ; rep ; movsb" \
- : "+c" (_nq), "+S" (_p), "+D" (_q) \
- : "r" ((uint32_t)((n) & 7)) : "memory" ); \
- } while (0)
-
-static inline void amd64_cpy_nt (volatile void *dst, const volatile void *src, size_t n)
-{
- size_t n32 = (n) >> 5;
- size_t nleft = (n) & (32-1);
-
- if (n32)
- {
- __asm__ __volatile__ (".align 16 \n"
- "1: \n"
- "mov (%1), %%r8 \n"
- "mov 8(%1), %%r9 \n"
- "add $32, %1 \n"
- "movnti %%r8, (%2) \n"
- "movnti %%r9, 8(%2) \n"
- "add $32, %2 \n"
- "mov -16(%1), %%r8 \n"
- "mov -8(%1), %%r9 \n"
- "dec %0 \n"
- "movnti %%r8, -16(%2) \n"
- "movnti %%r9, -8(%2) \n"
- "jnz 1b \n"
- "sfence \n"
- "mfence \n"
- : "+a" (n32), "+S" (src), "+D" (dst)
- : : "r8", "r9", "memory" );
- }
-
- if (nleft)
- {
- memcpy ((void *)dst, (void *)src, nleft);
- }
-}
-
-static inline
-void volatile_memcpy (volatile void *restrict dst, volatile const void *restrict src, size_t n)
-{
- MPIUI_Memcpy ((void *)dst, (const void *)src, n);
-}
-
-#define MPID_NEM_MEMCPY_CROSSOVER (32*1024)
-#define MPIU_Memcpy(a,b,c) do { \
- MPIU_MEM_CHECK_MEMCPY((a),(b),(c)); \
- if ((c) >= MPID_NEM_MEMCPY_CROSSOVER) \
- amd64_cpy_nt(a, b, c); \
- else \
- volatile_memcpy(a, b, c); \
- } while (0)
-/* #define MPID_NEM_MEMCPY(a,b,c) (((c) < MPID_NEM_MEMCPY_CROSSOVER) ? memcpy(a, b, c) : amd64_cpy_nt(a, b, c)) */
-/* #define MPID_NEM_MEMCPY(a,b,c) amd64_cpy_nt(a, b, c) */
-/* #define MPID_NEM_MEMCPY(a,b,c) memcpy (a, b, c) */
-
-#else
-/* #define MPIU_Memcpy(dst, src, n) do { volatile void * restrict d = (dst); volatile const void *restrict s = (src); MPIUI_Memcpy((void *)d, (const void *)s, n); }while (0) */
-#define MPIU_Memcpy(dst, src, n) \
- do { \
- MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "memcpy(%p, %p, %lu)", dst, src, (size_t)n)); \
- MPIU_MEM_CHECK_MEMCPY((dst),(src),(n)); \
- MPIUI_Memcpy(dst, src, n); \
- } while (0)
-#endif
-
-#endif /* MPID_MEMDEFS_H */
diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_pre.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_pre.h
index ca0a4b2..1aaa4ce 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_pre.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_pre.h
@@ -9,7 +9,6 @@
#include "mpid_nem_net_module_defs.h"
#include "mpid_nem_defs.h"
-#include "mpid_nem_memdefs.h"
#if defined(HAVE_PTHREAD_H)
#include <pthread.h>
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 95 -------
src/mpid/ch3/channels/nemesis/Makefile.mk | 1 -
.../channels/nemesis/include/mpid_nem_memdefs.h | 278 --------------------
.../ch3/channels/nemesis/include/mpid_nem_pre.h | 1 -
test/Makefile.am | 2 +-
test/mpid/atomic.c | 115 --------
test/mpid/atomic_fai.c | 55 ----
test/mpid/ch3/reorder.c | 176 -------------
test/mpid/dltest.c | 34 ---
test/mpid/dluse.c | 60 -----
10 files changed, 1 insertions(+), 816 deletions(-)
delete mode 100644 src/mpid/ch3/channels/nemesis/include/mpid_nem_memdefs.h
delete mode 100644 test/mpid/atomic.c
delete mode 100644 test/mpid/atomic_fai.c
delete mode 100644 test/mpid/ch3/reorder.c
delete mode 100644 test/mpid/dltest.c
delete mode 100644 test/mpid/dluse.c
hooks/post-receive
--
MPICH primary repository
1
0