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.2b4-21-gbc2d576
by noreply@mpich.org 29 Jul '15
by noreply@mpich.org 29 Jul '15
29 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 bc2d5761d6bb2b6e863cf6d3fd292e1db2c95072 (commit)
via c489333460740ed23e7ff3a6464792581157110d (commit)
from 9bdaca745b20664c33338811ab603a92c2f8416a (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/bc2d5761d6bb2b6e863cf6d3fd292e1db…
commit bc2d5761d6bb2b6e863cf6d3fd292e1db2c95072
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Wed Jul 29 15:57:33 2015 -0500
tsuite: add iterations to threaded alltoall test
Help consistently reproduce a bug related to canceling MPI_ANY_SOURCE
receives from a matching netmod.
Signed-off-by: Halim Amer <aamer(a)anl.gov>
diff --git a/test/mpi/threads/pt2pt/alltoall.c b/test/mpi/threads/pt2pt/alltoall.c
index b5c5676..bd33b29 100644
--- a/test/mpi/threads/pt2pt/alltoall.c
+++ b/test/mpi/threads/pt2pt/alltoall.c
@@ -17,6 +17,8 @@
#define DEBUG(_a)
#endif
+#define NUM_ITER 10000
+
const int REQ_TAG = 111;
const int ANS_TAG = 222;
@@ -66,7 +68,7 @@ MTEST_THREAD_RETURN_TYPE listener(void *extra)
int main(int argc, char *argv[])
{
int buf = 0;
- long int i;
+ long int i, j;
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
@@ -78,22 +80,23 @@ int main(int argc, char *argv[])
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
-#ifdef USE_BARRIER
- MPI_Barrier(MPI_COMM_WORLD);
-#endif
+ for (i = 0; i < NUM_ITER; i++) {
+ /* create listener thread */
+ MTest_Start_thread(listener, NULL);
- /* create listener thread */
- MTest_Start_thread(listener, NULL);
+ /* no more requests to send
+ * inform other in the group that we have finished */
+ buf = -1;
+ for (j = 0; j < size; ++j) {
+ MPI_Send(&buf, 1, MPI_INT, j, REQ_TAG, MPI_COMM_WORLD);
+ }
- /* no more requests to send
- * inform other in the group that we have finished */
- buf = -1;
- for (i = 0; i < size; ++i) {
- MPI_Send(&buf, 1, MPI_INT, i, REQ_TAG, MPI_COMM_WORLD);
- }
+ /* and wait for others to do the same */
+ MTest_Join_threads();
- /* and wait for others to do the same */
- MTest_Join_threads();
+ /* barrier to avoid deadlock */
+ MPI_Barrier(MPI_COMM_WORLD);
+ }
MPI_Finalize();
http://git.mpich.org/mpich.git/commitdiff/c489333460740ed23e7ff3a6464792581…
commit c489333460740ed23e7ff3a6464792581157110d
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Wed Jul 29 15:17:19 2015 -0500
tsuite: whitespace cleanup
Signed-off-by: Halim Amer <aamer(a)anl.gov>
diff --git a/test/mpi/threads/pt2pt/alltoall.c b/test/mpi/threads/pt2pt/alltoall.c
index 45200be..b5c5676 100644
--- a/test/mpi/threads/pt2pt/alltoall.c
+++ b/test/mpi/threads/pt2pt/alltoall.c
@@ -1,5 +1,5 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
+/*
* (C) 2006 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
@@ -7,7 +7,7 @@
#include "mpitest.h"
#include "mpithreadtest.h"
#ifdef HAVE_UNISTD_H
- #include <unistd.h>
+#include <unistd.h>
#endif
#include <stdio.h>
@@ -23,70 +23,73 @@ const int ANS_TAG = 222;
/* MPI environment description */
int rank, size, provided;
-MTEST_THREAD_RETURN_TYPE listener(void*);
+MTEST_THREAD_RETURN_TYPE listener(void *);
-/*
+/*
LISTENER THREAD
it waits for communication from any source (including calling thread)
messages which it receives have tag REQ_TAG
thread runs infinite loop which will stop only if every node in the
- MPI_COMM_WORLD send request containing -1
+ MPI_COMM_WORLD send request containing -1
*/
-MTEST_THREAD_RETURN_TYPE listener(void*extra) {
+MTEST_THREAD_RETURN_TYPE listener(void *extra)
+{
int req;
int source;
MPI_Status stat;
- int no_fins = 0; /* this must be equal to size to break loop below */
+ int no_fins = 0; /* this must be equal to size to break loop below */
while (1) {
- /* wait for request */
- MPI_Recv(&req, 1, MPI_INT,
- MPI_ANY_SOURCE, REQ_TAG, MPI_COMM_WORLD, &stat);
+ /* wait for request */
+ MPI_Recv(&req, 1, MPI_INT, MPI_ANY_SOURCE, REQ_TAG, MPI_COMM_WORLD, &stat);
- /* get request source */
- source = stat.MPI_SOURCE;
+ /* get request source */
+ source = stat.MPI_SOURCE;
- DEBUG(printf( "node %d got request %d from %d\n", rank, req, source ));
+ DEBUG(printf("node %d got request %d from %d\n", rank, req, source));
+
+ if (req == -1)
+ ++no_fins; /* one more node finished requesting */
+
+ /* no more requests can arrive */
+ if (no_fins == size)
+ break;
- if (req == -1) ++no_fins; /* one more node finished requesting */
-
- /* no more requests can arrive */
- if (no_fins == size) break;
-
}
- DEBUG(printf( "node %d has stopped listener\n", rank ));
+ DEBUG(printf("node %d has stopped listener\n", rank));
return MTEST_THREAD_RETVAL_IGN;
-}
+}
-int main(int argc, char* argv[]) {
+int main(int argc, char *argv[])
+{
int buf = 0;
long int i;
-
+
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
if (provided != MPI_THREAD_MULTIPLE) {
- printf( "This test requires MPI_THREAD_MULTIPLE\n" );
- MPI_Abort( MPI_COMM_WORLD, 1 );
+ printf("This test requires MPI_THREAD_MULTIPLE\n");
+ MPI_Abort(MPI_COMM_WORLD, 1);
}
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
#ifdef USE_BARRIER
- MPI_Barrier( MPI_COMM_WORLD );
+ MPI_Barrier(MPI_COMM_WORLD);
#endif
/* create listener thread */
MTest_Start_thread(listener, NULL);
/* no more requests to send
- inform other in the group that we have finished */
+ * inform other in the group that we have finished */
buf = -1;
for (i = 0; i < size; ++i) {
- MPI_Send(&buf, 1, MPI_INT, i, REQ_TAG, MPI_COMM_WORLD);
+ MPI_Send(&buf, 1, MPI_INT, i, REQ_TAG, MPI_COMM_WORLD);
}
/* and wait for others to do the same */
@@ -96,8 +99,8 @@ int main(int argc, char* argv[]) {
/* This program works if it gets here */
if (rank == 0) {
- printf( " No Errors\n" );
+ printf(" No Errors\n");
}
return 0;
-}
+}
-----------------------------------------------------------------------
Summary of changes:
test/mpi/threads/pt2pt/alltoall.c | 86 ++++++++++++++++++++-----------------
1 files changed, 46 insertions(+), 40 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b4-19-g9bdaca7
by noreply@mpich.org 29 Jul '15
by noreply@mpich.org 29 Jul '15
29 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 9bdaca745b20664c33338811ab603a92c2f8416a (commit)
from 24bb936af9c34cc7a7230bb0b41387bdd4ec99df (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/9bdaca745b20664c33338811ab603a92c…
commit 9bdaca745b20664c33338811ab603a92c2f8416a
Author: Pavan Balaji <balaji(a)anl.gov>
Date: Wed Jul 29 12:39:30 2015 -0500
Remove unused old code.
When we added the new alltoall code, we commented out the old code,
but kept it in case there were bugs in the new code. It's been
several years since we did that and haven't noticed any bugs. So it's
safe to delete the old code. It's safely stored in the version
control system anyway.
Signed-off-by: Lena Oden <loden(a)anl.gov>
diff --git a/src/mpi/coll/alltoall.c b/src/mpi/coll/alltoall.c
index f3e3c35..5a465a5 100644
--- a/src/mpi/coll/alltoall.c
+++ b/src/mpi/coll/alltoall.c
@@ -150,11 +150,6 @@ int MPIR_Alltoall_intra(
MPID_Request **reqarray;
MPI_Status *starray;
MPIU_CHKLMEM_DECL(6);
-#ifdef MPIR_OLD_SHORT_ALLTOALL_ALG
- MPI_Aint sendtype_true_extent, sendbuf_extent, sendtype_true_lb;
- int k, p, curr_cnt, dst_tree_root, my_tree_root;
- int last_recv_cnt, mask, tmp_mask, tree_root, nprocs_completed;
-#endif
if (recvcount == 0) return MPI_SUCCESS;
@@ -322,159 +317,6 @@ int MPIR_Alltoall_intra(
recvcount, recvtype);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
-
-
-#ifdef MPIR_OLD_SHORT_ALLTOALL_ALG
- /* Short message. Use recursive doubling. Each process sends all
- its data at each step along with all data it received in
- previous steps. */
-
- /* need to allocate temporary buffer of size
- sendbuf_extent*comm_size */
-
- /* get true extent of sendtype */
- MPIR_Type_get_true_extent_impl(sendtype, &sendtype_true_lb, &sendtype_true_extent);
-
- sendbuf_extent = sendcount * comm_size *
- (MPIR_MAX(sendtype_true_extent, sendtype_extent));
- MPIU_CHKLMEM_MALLOC(tmp_buf, void *, sendbuf_extent*comm_size, mpi_errno, "tmp_buf");
-
- /* adjust for potential negative lower bound in datatype */
- tmp_buf = (void *)((char*)tmp_buf - sendtype_true_lb);
-
- /* copy local sendbuf into tmp_buf at location indexed by rank */
- curr_cnt = sendcount*comm_size;
- mpi_errno = MPIR_Localcopy(sendbuf, curr_cnt, sendtype,
- ((char *)tmp_buf + rank*sendbuf_extent),
- curr_cnt, sendtype);
- if (mpi_errno) { MPIU_ERR_POP(mpi_errno);}
-
- mask = 0x1;
- i = 0;
- while (mask < comm_size) {
- dst = rank ^ mask;
-
- dst_tree_root = dst >> i;
- dst_tree_root <<= i;
-
- my_tree_root = rank >> i;
- my_tree_root <<= i;
-
- if (dst < comm_size) {
- mpi_errno = MPIC_Sendrecv(((char *)tmp_buf +
- my_tree_root*sendbuf_extent),
- curr_cnt, sendtype,
- dst, MPIR_ALLTOALL_TAG,
- ((char *)tmp_buf +
- dst_tree_root*sendbuf_extent),
- sendbuf_extent*(comm_size-dst_tree_root),
- sendtype, dst, MPIR_ALLTOALL_TAG,
- comm_ptr, &status, errflag);
- if (mpi_errno) {
- /* for communication errors, just record the error but continue */
- *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
- MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
- MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
- last_recv_cnt = 0;
- } else
- /* in case of non-power-of-two nodes, less data may be
- received than specified */
- MPIR_Get_count_impl(&status, sendtype, &last_recv_cnt);
- curr_cnt += last_recv_cnt;
- }
-
- /* if some processes in this process's subtree in this step
- did not have any destination process to communicate with
- because of non-power-of-two, we need to send them the
- result. We use a logarithmic recursive-halfing algorithm
- for this. */
-
- if (dst_tree_root + mask > comm_size) {
- nprocs_completed = comm_size - my_tree_root - mask;
- /* nprocs_completed is the number of processes in this
- subtree that have all the data. Send data to others
- in a tree fashion. First find root of current tree
- that is being divided into two. k is the number of
- least-significant bits in this process's rank that
- must be zeroed out to find the rank of the root */
- j = mask;
- k = 0;
- while (j) {
- j >>= 1;
- k++;
- }
- k--;
-
- tmp_mask = mask >> 1;
- while (tmp_mask) {
- dst = rank ^ tmp_mask;
-
- tree_root = rank >> k;
- tree_root <<= k;
-
- /* send only if this proc has data and destination
- doesn't have data. at any step, multiple processes
- can send if they have the data */
- if ((dst > rank) &&
- (rank < tree_root + nprocs_completed)
- && (dst >= tree_root + nprocs_completed)) {
- /* send the data received in this step above */
- mpi_errno = MPIC_Send(((char *)tmp_buf +
- dst_tree_root*sendbuf_extent),
- last_recv_cnt, sendtype,
- dst, MPIR_ALLTOALL_TAG,
- comm_ptr, errflag);
- if (mpi_errno) {
- /* for communication errors, just record the error but continue */
- *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
- MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
- MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
- }
- }
- /* recv only if this proc. doesn't have data and sender
- has data */
- else if ((dst < rank) &&
- (dst < tree_root + nprocs_completed) &&
- (rank >= tree_root + nprocs_completed)) {
- mpi_errno = MPIC_Recv(((char *)tmp_buf +
- dst_tree_root*sendbuf_extent),
- sendbuf_extent*(comm_size-dst_tree_root),
- sendtype,
- dst, MPIR_ALLTOALL_TAG,
- comm_ptr, &status, errflag);
- if (mpi_errno) {
- /* for communication errors, just record the error but continue */
- *errflag = MPIR_ERR_GET_CLASS(mpi_errno);
- MPIU_ERR_SET(mpi_errno, *errflag, "**fail");
- MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
- last_recv_cnt = 0;
- } else
- MPIR_Get_count_impl(&status, sendtype, &last_recv_cnt);
- curr_cnt += last_recv_cnt;
- }
- tmp_mask >>= 1;
- k--;
- }
- }
-
- mask <<= 1;
- i++;
- }
-
- /* now copy everyone's contribution from tmp_buf to recvbuf */
- for (p=0; p<comm_size; p++) {
- mpi_errno = MPIR_Localcopy(((char *)tmp_buf +
- p*sendbuf_extent +
- rank*sendcount*sendtype_extent),
- sendcount, sendtype,
- ((char*)recvbuf +
- p*recvcount*recvtype_extent),
- recvcount, recvtype);
- if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
- }
-
-#endif
-
}
else if (nbytes <= MPIR_CVAR_ALLTOALL_MEDIUM_MSG_SIZE) {
-----------------------------------------------------------------------
Summary of changes:
src/mpi/coll/alltoall.c | 158 -----------------------------------------------
1 files changed, 0 insertions(+), 158 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b4-18-g24bb936
by noreply@mpich.org 28 Jul '15
by noreply@mpich.org 28 Jul '15
28 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 24bb936af9c34cc7a7230bb0b41387bdd4ec99df (commit)
via 7b0084a18b0d168a46e2202af74dbabd39357eb1 (commit)
from 22a77dceda11da45d939e82f1c60618fd1439bea (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/24bb936af9c34cc7a7230bb0b41387bdd…
commit 24bb936af9c34cc7a7230bb0b41387bdd4ec99df
Author: Huiwei Lu <huiweilu(a)mcs.anl.gov>
Date: Tue Jul 28 14:27:24 2015 -0500
Fixes counters in multithreaded MPIR_Get_contextid_sparse_group
The counter of idup_next_seqnum of the parent communicator need to be
increased accordingly when allocating context id finishes so that the
counters for multiple runs of MPI_Comm_idup and MPI_Comm_dup are set
correctly.
Refs #2291, #2286
Signed-off-by: Lena Oden <loden(a)anl.gov>
diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c
index 8248dfc..58b0522 100644
--- a/src/mpi/comm/commutil.c
+++ b/src/mpi/comm/commutil.c
@@ -1106,7 +1106,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm *comm_ptr, MPID_Group *group_ptr,
int own_eager_mask = 0;
mpir_errflag_t errflag = MPIR_ERR_NONE;
int first_iter = 1;
- int seqnum;
+ int seqnum = 0;
MPID_MPI_STATE_DECL(MPID_STATE_MPIR_GET_CONTEXTID);
MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_GET_CONTEXTID);
@@ -1332,6 +1332,8 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm *comm_ptr, MPID_Group *group_ptr,
first_iter = 0;
}
+ if (seqnum > 0)
+ comm_ptr->idup_next_seqnum++;
fn_exit:
http://git.mpich.org/mpich.git/commitdiff/7b0084a18b0d168a46e2202af74dbabd3…
commit 7b0084a18b0d168a46e2202af74dbabd39357eb1
Author: Huiwei Lu <huiweilu(a)mcs.anl.gov>
Date: Mon Jul 27 17:18:09 2015 -0500
Fix single-threaded MPIR_Get_contextid_sparse_group
The single-threaded case of MPIR_Get_contextid_sparse_group does not
consider the mixing use of MPI_Comm_dup (and similar communicator
duplication functions) and MPI_Comm_idup, which will cause the
MPI_Comm_dup to fail.
The fix is similar to #2286. It will use a sequence number to order
different MPI_Comm_dup's and MPI_Comm_idup's when they are duplicating
from the same parent communicator.
Fixes #2291
Signed-off-by: Lena Oden <loden(a)anl.gov>
diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c
index 978e936..8248dfc 100644
--- a/src/mpi/comm/commutil.c
+++ b/src/mpi/comm/commutil.c
@@ -996,61 +996,63 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm *comm_ptr, MPID_Group *group_ptr,
int mpi_errno = MPI_SUCCESS;
uint32_t local_mask[MPIR_MAX_CONTEXT_MASK];
mpir_errflag_t errflag = MPIR_ERR_NONE;
+ int seqnum = 0;
+ if (comm_ptr->idup_count)
+ seqnum = comm_ptr->idup_curr_seqnum++;
MPID_MPI_STATE_DECL(MPID_STATE_MPIR_GET_CONTEXTID);
MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_GET_CONTEXTID);
*context_id = 0;
- if (initialize_context_mask) {
- MPIR_Init_contextid();
- }
+ while (*context_id == 0) {
+ if (initialize_context_mask) {
+ MPIR_Init_contextid();
+ }
- if (ignore_id) {
- /* We are not participating in the resulting communicator, so our
- * context ID space doesn't matter. Set the mask to "all available". */
- memset(local_mask, 0xff, MPIR_MAX_CONTEXT_MASK * sizeof(int));
- }
- else {
- MPIU_Memcpy( local_mask, context_mask, MPIR_MAX_CONTEXT_MASK * sizeof(int) );
- }
+ if (ignore_id) {
+ /* We are not participating in the resulting communicator, so our
+ * context ID space doesn't matter. Set the mask to "all available". */
+ memset(local_mask, 0xff, MPIR_MAX_CONTEXT_MASK * sizeof(int));
+ }
+ else {
+ MPIU_Memcpy(local_mask, context_mask, MPIR_MAX_CONTEXT_MASK * sizeof(int));
+ }
+ if (comm_ptr->idup_count && seqnum != comm_ptr->idup_next_seqnum) {
+ memset(local_mask, 0, MPIR_MAX_CONTEXT_MASK * sizeof(int));
+ }
- /* Note that this is the unthreaded version */
- /* Comm must be an intracommunicator */
- if (group_ptr != NULL) {
- int coll_tag = tag | MPIR_Process.tagged_coll_mask; /* Shift tag into the tagged coll space */
- mpi_errno = MPIR_Allreduce_group( MPI_IN_PLACE, local_mask, MPIR_MAX_CONTEXT_MASK,
- MPI_INT, MPI_BAND, comm_ptr, group_ptr, coll_tag, &errflag );
- } else {
- mpi_errno = MPIR_Allreduce_impl( MPI_IN_PLACE, local_mask, MPIR_MAX_CONTEXT_MASK,
- MPI_INT, MPI_BAND, comm_ptr, &errflag );
- }
+ /* Note that this is the unthreaded version */
+ /* Comm must be an intracommunicator */
+ if (group_ptr != NULL) {
+ int coll_tag = tag | MPIR_Process.tagged_coll_mask; /* Shift tag into the tagged coll space */
+ mpi_errno = MPIR_Allreduce_group(MPI_IN_PLACE, local_mask, MPIR_MAX_CONTEXT_MASK,
+ MPI_INT, MPI_BAND, comm_ptr, group_ptr, coll_tag, &errflag);
+ } else {
+ mpi_errno = MPIR_Allreduce_impl(MPI_IN_PLACE, local_mask, MPIR_MAX_CONTEXT_MASK,
+ MPI_INT, MPI_BAND, comm_ptr, &errflag);
+ }
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
- if (ignore_id) {
- *context_id = MPIR_Locate_context_bit(local_mask);
- if (*context_id == 0) {
- int nfree = -1;
- int ntotal = -1;
- MPIR_ContextMaskStats(&nfree, &ntotal);
- MPIU_ERR_SETANDJUMP3(mpi_errno, MPI_ERR_OTHER,
- "**toomanycomm", "**toomanycomm %d %d %d",
- nfree, ntotal, ignore_id);
+ if (ignore_id) {
+ *context_id = MPIR_Locate_context_bit(local_mask);
+ if (*context_id == 0) {
+ int nfree = -1;
+ int ntotal = -1;
+ MPIR_ContextMaskStats(&nfree, &ntotal);
+ MPIU_ERR_SETANDJUMP3(mpi_errno, MPI_ERR_OTHER,
+ "**toomanycomm", "**toomanycomm %d %d %d",
+ nfree, ntotal, ignore_id);
+ }
}
- }
- else {
- *context_id = MPIR_Find_and_allocate_context_id(local_mask);
- if (*context_id == 0) {
- int nfree = -1;
- int ntotal = -1;
- MPIR_ContextMaskStats(&nfree, &ntotal);
- MPIU_ERR_SETANDJUMP3(mpi_errno, MPI_ERR_OTHER,
- "**toomanycomm", "**toomanycomm %d %d %d",
- nfree, ntotal, ignore_id);
+ else {
+ *context_id = MPIR_Find_and_allocate_context_id(local_mask);
}
}
+ if (seqnum > 0)
+ comm_ptr->idup_next_seqnum++;
fn_exit:
if (ignore_id)
-----------------------------------------------------------------------
Summary of changes:
src/mpi/comm/commutil.c | 90 ++++++++++++++++++++++++----------------------
1 files changed, 47 insertions(+), 43 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b4-16-g22a77dc
by noreply@mpich.org 28 Jul '15
by noreply@mpich.org 28 Jul '15
28 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 22a77dceda11da45d939e82f1c60618fd1439bea (commit)
from bfd674b37b1fb35957e5177fed1451e0e8a67ded (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/22a77dceda11da45d939e82f1c60618fd…
commit 22a77dceda11da45d939e82f1c60618fd1439bea
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Tue Jul 28 15:30:09 2015 -0500
remove bogus double-seek from hint processing fix
No Reviewer
diff --git a/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c b/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c
index bfb16c4..a3b03be 100644
--- a/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c
+++ b/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c
@@ -147,9 +147,6 @@ void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code)
if (fd->access_mode & ADIO_APPEND)
fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
- if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND))
- fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
-
fd->fd_direct = -1;
if (fd->direct_write || fd->direct_read) {
fd->fd_direct = open(fd->filename, amode_direct, perm);
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/adio/ad_lustre/ad_lustre_open.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b4-15-gbfd674b
by noreply@mpich.org 28 Jul '15
by noreply@mpich.org 28 Jul '15
28 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 bfd674b37b1fb35957e5177fed1451e0e8a67ded (commit)
via 92f1c69f0de87f934b4fbbd52fc46b642a4714e8 (commit)
via 43cbd1e146224d44eab75bbdf1cdf9e806a31e3d (commit)
via 1a2399281630976b209073c55597f06a062d6edf (commit)
via bbf05d805ee975451bd97f3e5cbf9c2e56e49511 (commit)
from 6b41775b2056ff18b3c28aab71764e35904c00fa (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/bfd674b37b1fb35957e5177fed1451e0e…
commit bfd674b37b1fb35957e5177fed1451e0e8a67ded
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Thu Jul 23 13:46:55 2015 -0500
do not want generic hints to override this lustre hint
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c b/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c
index e30d433..0046a24 100644
--- a/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c
+++ b/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c
@@ -125,6 +125,12 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
/* set the values for collective I/O and data sieving parameters */
ADIOI_GEN_SetInfo(fd, users_info, error_code);
+ /* generic hints might step on striping_unit */
+ if (users_info != MPI_INFO_NULL) {
+ ADIOI_Info_check_and_install_int(fd, users_info, "striping_unit",
+ NULL, myname, error_code);
+ }
+
if (ADIOI_Direct_read) fd->direct_read = 1;
if (ADIOI_Direct_write) fd->direct_write = 1;
http://git.mpich.org/mpich.git/commitdiff/92f1c69f0de87f934b4fbbd52fc46b642…
commit 92f1c69f0de87f934b4fbbd52fc46b642a4714e8
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Wed Jun 3 11:37:59 2015 -0500
hint processing should not open files
move opening of files from hint processing and into open routines.
Ref: #2261
Ref: https://github.com/open-mpi/ompi/issues/158
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c b/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c
index 051cfb0..e30d433 100644
--- a/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c
+++ b/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c
@@ -20,8 +20,7 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
char *value;
int flag;
ADIO_Offset stripe_val[3], str_factor = -1, str_unit=0, start_iodev=-1;
- struct lov_user_md lum = { 0 };
- int err, myrank, fd_sys, perm, amode, old_mask;
+ int err, myrank;
static char myname[] = "ADIOI_LUSTRE_SETINFO";
value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
@@ -47,18 +46,25 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
/* striping information */
ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL,
value, &flag);
- if (flag)
+ if (flag) {
+ ADIOI_Info_set(fd->info, "striping_unit", value);
str_unit=atoll(value);
+ }
ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL,
value, &flag);
- if (flag)
+ if (flag) {
+ ADIOI_Info_set(fd->info, "striping_factor", value);
str_factor=atoll(value);
+ }
ADIOI_Info_get(users_info, "romio_lustre_start_iodevice",
MPI_MAX_INFO_VAL, value, &flag);
- if (flag)
+ if (flag) {
+ ADIOI_Info_set(fd->info, "romio_lustre_start_iodevice", value);
start_iodev=atoll(value);
+ }
+
/* direct read and write */
ADIOI_Info_get(users_info, "direct_read", MPI_MAX_INFO_VAL,
@@ -84,72 +90,20 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
}
MPI_Bcast(stripe_val, 3, MPI_OFFSET, 0, fd->comm);
+ /* do not open file in hint processing. Open file in open routines,
+ * where we can better deal with EXCL flag . Continue to check the
+ * "all processors set a value" condition holds. */
if (stripe_val[0] != str_factor
|| stripe_val[1] != str_unit
|| stripe_val[2] != start_iodev) {
- FPRINTF(stderr, "ADIOI_LUSTRE_SetInfo: All keys"
- "-striping_factor:striping_unit:start_iodevice "
- "need to be identical across all processes\n");
- MPI_Abort(MPI_COMM_WORLD, 1);
- } else if ((str_factor > 0) || (str_unit > 0) || (start_iodev >= 0)) {
- /* if user has specified striping info, process 0 tries to set it */
- if (!myrank) {
- if (fd->perm == ADIO_PERM_NULL) {
- old_mask = umask(022);
- umask(old_mask);
- perm = old_mask ^ 0666;
- }
- else perm = fd->perm;
-
- amode = 0;
- if (fd->access_mode & ADIO_CREATE)
- amode = amode | O_CREAT;
- if (fd->access_mode & ADIO_RDONLY)
- amode = amode | O_RDONLY;
- if (fd->access_mode & ADIO_WRONLY)
- amode = amode | O_WRONLY;
- if (fd->access_mode & ADIO_RDWR)
- amode = amode | O_RDWR;
- if (fd->access_mode & ADIO_EXCL)
- amode = amode | O_EXCL;
-
- /* we need to create file so ensure this is set */
- amode = amode | O_LOV_DELAY_CREATE | O_CREAT;
-
- fd_sys = open(fd->filename, amode, perm);
- if (fd_sys == -1) {
- if (errno != EEXIST)
- fprintf(stderr,
- "Failure to open file %s %d %d\n",strerror(errno), amode, perm);
- } else {
- lum.lmm_magic = LOV_USER_MAGIC;
- lum.lmm_pattern = 0;
- lum.lmm_stripe_size = str_unit;
- /* crude check for overflow of lustre internal datatypes.
- * Silently cap to large value if user provides a value
- * larger than lustre supports */
- if (lum.lmm_stripe_size != str_unit) {
- lum.lmm_stripe_size = UINT_MAX;
- }
- lum.lmm_stripe_count = str_factor;
- if ( lum.lmm_stripe_count != str_factor) {
- lum.lmm_stripe_count = USHRT_MAX;
- }
- lum.lmm_stripe_offset = start_iodev;
- if (lum.lmm_stripe_offset != start_iodev) {
- lum.lmm_stripe_offset = USHRT_MAX;
- }
-
- err = ioctl(fd_sys, LL_IOC_LOV_SETSTRIPE, &lum);
- if (err == -1 && errno != EEXIST) {
- fprintf(stderr, "Failure to set stripe info %s \n", strerror(errno));
- }
- close(fd_sys);
- }
- } /* End of striping parameters validation */
+ MPIO_ERR_CREATE_CODE_INFO_NOT_SAME("ADIOI_LUSTRE_SetInfo",
+ "str_factor or str_unit or start_iodev",
+ error_code);
+ ADIOI_Free(value);
+ return;
}
- MPI_Barrier(fd->comm);
}
+
/* get other hint */
if (users_info != MPI_INFO_NULL) {
/* CO: IO Clients/OST,
diff --git a/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c b/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c
index e06cb24..bfb16c4 100644
--- a/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c
+++ b/src/mpi/romio/adio/ad_lustre/ad_lustre_open.c
@@ -18,14 +18,17 @@
void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code)
{
int perm, old_mask, amode, amode_direct;
- int lumlen;
+ int lumlen, myrank, flag, set_layout=0, err;
struct lov_user_md *lum = NULL;
char *value;
+ ADIO_Offset str_factor = -1, str_unit=0, start_iodev=-1;
#if defined(MPICH) || !defined(PRINT_ERR_MSG)
static char myname[] = "ADIOI_LUSTRE_OPEN";
#endif
+ MPI_Comm_rank(fd->comm, &myrank);
+
if (fd->perm == ADIO_PERM_NULL) {
old_mask = umask(022);
umask(old_mask);
@@ -47,46 +50,102 @@ void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code)
amode_direct = amode | O_DIRECT;
- fd->fd_sys = open(fd->filename, amode|O_CREAT, perm);
-
- if (fd->fd_sys != -1) {
- int err;
-
- /* get file striping information and set it in info */
- /* odd malloc here because lov_user_md contains some fixed data and
- * then a list of 'lmm_objects' representing stripe */
- lumlen = sizeof(struct lov_user_md) +
- MAX_LOV_UUID_COUNT * sizeof(struct lov_user_ost_data);
- /* furthermore, Pascal Deveze reports that, even though we pass a
- * "GETSTRIPE" (read) flag to the ioctl, if some of the values of this
- * struct are uninitialzed, the call can give an error. calloc in case
- * there are other members that must be initialized and in case
- * lov_user_md struct changes in future */
- lum = (struct lov_user_md *)ADIOI_Calloc(1,lumlen);
- lum->lmm_magic = LOV_USER_MAGIC;
- err = ioctl(fd->fd_sys, LL_IOC_LOV_GETSTRIPE, (void *)lum);
- if (!err) {
- value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
-
- fd->hints->striping_unit = lum->lmm_stripe_size;
- sprintf(value, "%d", lum->lmm_stripe_size);
- ADIOI_Info_set(fd->info, "striping_unit", value);
-
- fd->hints->striping_factor = lum->lmm_stripe_count;
- sprintf(value, "%d", lum->lmm_stripe_count);
- ADIOI_Info_set(fd->info, "striping_factor", value);
-
- fd->hints->fs_hints.lustre.start_iodevice = lum->lmm_stripe_offset;
- sprintf(value, "%d", lum->lmm_stripe_offset);
- ADIOI_Info_set(fd->info, "romio_lustre_start_iodevice", value);
-
- ADIOI_Free(value);
- }
- ADIOI_Free(lum);
-
- if (fd->access_mode & ADIO_APPEND)
- fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
- }
+ /* odd length here because lov_user_md contains some fixed data and
+ * then a list of 'lmm_objects' representing stripe */
+ lumlen = sizeof(struct lov_user_md) +
+ MAX_LOV_UUID_COUNT * sizeof(struct lov_user_ost_data);
+ lum = (struct lov_user_md *)ADIOI_Calloc(1,lumlen);
+
+ value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
+ /* we already validated in LUSTRE_SetInfo that these are going to be the same */
+ if (fd->info != MPI_INFO_NULL) {
+ /* striping information */
+ ADIOI_Info_get(fd->info, "striping_unit", MPI_MAX_INFO_VAL,
+ value, &flag);
+ if (flag)
+ str_unit=atoll(value);
+
+ ADIOI_Info_get(fd->info, "striping_factor", MPI_MAX_INFO_VAL,
+ value, &flag);
+ if (flag)
+ str_factor=atoll(value);
+
+ ADIOI_Info_get(fd->info, "romio_lustre_start_iodevice",
+ MPI_MAX_INFO_VAL, value, &flag);
+ if (flag)
+ start_iodev=atoll(value);
+ }
+ if ((str_factor > 0) || (str_unit > 0) || (start_iodev >= 0))
+ set_layout = 1;
+
+ /* if hints were set, we need to delay creation of any lustre objects.
+ * However, if we open the file with O_LOV_DELAY_CREATE and don't call the
+ * follow-up ioctl, subsequent writes will fail */
+ if (myrank == 0 && set_layout)
+ amode = amode | O_LOV_DELAY_CREATE;
+
+ fd->fd_sys = open(fd->filename, amode, perm);
+ if (fd->fd_sys == -1) goto fn_exit;
+
+ /* we can only set these hints on new files */
+ /* It was strange and buggy to open the file in the hint path. Instead,
+ * we'll apply the file tunings at open time */
+ if ((amode & O_CREAT) && set_layout ) {
+ /* if user has specified striping info, process 0 tries to set it */
+ if (!myrank) {
+ lum->lmm_magic = LOV_USER_MAGIC;
+ lum->lmm_pattern = 0;
+ /* crude check for overflow of lustre internal datatypes.
+ * Silently cap to large value if user provides a value
+ * larger than lustre supports */
+ if (str_unit > UINT_MAX)
+ lum->lmm_stripe_size = UINT_MAX;
+ else
+ lum->lmm_stripe_size = str_unit;
+
+ if (str_factor > USHRT_MAX)
+ lum->lmm_stripe_count = USHRT_MAX;
+ else
+ lum->lmm_stripe_count = str_factor;
+
+ if (start_iodev > USHRT_MAX)
+ lum->lmm_stripe_offset = USHRT_MAX;
+ else
+ lum->lmm_stripe_offset = start_iodev;
+ err = ioctl(fd->fd_sys, LL_IOC_LOV_SETSTRIPE, lum);
+ if (err == -1 && errno != EEXIST) {
+ fprintf(stderr, "Failure to set stripe info %s \n", strerror(errno));
+ /* not a fatal error, but user might care to know */
+ }
+ } /* End of striping parameters validation */
+ }
+
+ /* Pascal Deveze reports that, even though we pass a
+ * "GETSTRIPE" (read) flag to the ioctl, if some of the values of this
+ * struct are uninitialzed, the call can give an error. zero it out in case
+ * there are other members that must be initialized and in case
+ * lov_user_md struct changes in future */
+ memset(lum, 0, lumlen);
+ lum->lmm_magic = LOV_USER_MAGIC;
+ err = ioctl(fd->fd_sys, LL_IOC_LOV_GETSTRIPE, (void *)lum);
+ if (!err) {
+
+ fd->hints->striping_unit = lum->lmm_stripe_size;
+ sprintf(value, "%d", lum->lmm_stripe_size);
+ ADIOI_Info_set(fd->info, "striping_unit", value);
+
+ fd->hints->striping_factor = lum->lmm_stripe_count;
+ sprintf(value, "%d", lum->lmm_stripe_count);
+ ADIOI_Info_set(fd->info, "striping_factor", value);
+
+ fd->hints->fs_hints.lustre.start_iodevice = lum->lmm_stripe_offset;
+ sprintf(value, "%d", lum->lmm_stripe_offset);
+ ADIOI_Info_set(fd->info, "romio_lustre_start_iodevice", value);
+
+ }
+
+ if (fd->access_mode & ADIO_APPEND)
+ fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
if ((fd->fd_sys != -1) && (fd->access_mode & ADIO_APPEND))
fd->fp_ind = fd->fp_sys_posn = lseek(fd->fd_sys, 0, SEEK_END);
@@ -102,6 +161,9 @@ void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code)
}
}
+fn_exit:
+ ADIOI_Free(lum);
+ ADIOI_Free(value);
/* --BEGIN ERROR HANDLING-- */
if (fd->fd_sys == -1 || ((fd->fd_direct == -1) &&
(fd->direct_write || fd->direct_read))) {
http://git.mpich.org/mpich.git/commitdiff/43cbd1e146224d44eab75bbdf1cdf9e80…
commit 43cbd1e146224d44eab75bbdf1cdf9e806a31e3d
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Thu Jul 23 12:09:26 2015 -0500
move hint dumping a bit later
if any file system sets hints in open, we won't see them unless we dump the
hints after open.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpi/romio/adio/common/ad_open.c b/src/mpi/romio/adio/common/ad_open.c
index 5c95b47..04468de 100644
--- a/src/mpi/romio/adio/common/ad_open.c
+++ b/src/mpi/romio/adio/common/ad_open.c
@@ -152,12 +152,6 @@ MPI_File ADIO_Open(MPI_Comm orig_comm,
if (*error_code != MPI_SUCCESS)
goto fn_exit;
}
- /* for debugging, it can be helpful to see the hints selected */
- p = getenv("ROMIO_PRINT_HINTS");
- if (rank == 0 && p != NULL ) {
- ADIOI_Info_print_keyvals(fd->info);
- }
-
fd->is_open = 0;
fd->my_cb_nodes_index = -2;
fd->is_agg = is_aggregator(rank, fd);
@@ -173,6 +167,13 @@ MPI_File ADIO_Open(MPI_Comm orig_comm,
ADIOI_OpenColl(fd, rank, access_mode, error_code);
+ /* for debugging, it can be helpful to see the hints selected. Some file
+ * systes set up the hints in the open call (e.g. lustre) */
+ p = getenv("ROMIO_PRINT_HINTS");
+ if (rank == 0 && p != NULL ) {
+ ADIOI_Info_print_keyvals(fd->info);
+ }
+
fn_exit:
MPI_Allreduce(error_code, &max_error_code, 1, MPI_INT, MPI_MAX, comm);
if (max_error_code != MPI_SUCCESS) {
http://git.mpich.org/mpich.git/commitdiff/1a2399281630976b209073c55597f06a0…
commit 1a2399281630976b209073c55597f06a062d6edf
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Thu Jun 4 03:54:02 2015 -0500
try to more gracefully handle out of memory conditions
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/test/mpi/io/bigtype.c b/test/mpi/io/bigtype.c
index d500714..11e3ea3 100644
--- a/test/mpi/io/bigtype.c
+++ b/test/mpi/io/bigtype.c
@@ -36,7 +36,15 @@ int main(int argc, char** argv)
k = 0;
/* create a large buffer 2*/
buf_write = malloc (NUM_X*NUM_Y*sizeof(int));
+ if (buf_write == NULL) {
+ fprintf(stderr, "not enough memory\n");
+ exit(1);
+ }
buf_read = malloc (NUM_X*NUM_Y*sizeof(int));
+ if (buf_read == NULL) {
+ fprintf(stderr, "not enough memory\n");
+ exit(1);
+ }
memset(buf_read, 0, NUM_X*NUM_Y*sizeof(int));
for (i=0; i<NUM_X ; i++) {
@@ -77,13 +85,13 @@ int main(int argc, char** argv)
if(MPI_File_open (MPI_COMM_WORLD, "testfile", MPI_MODE_RDWR | MPI_MODE_CREATE,
MPI_INFO_NULL, &fh) != 0) {
- printf("Can't open file: %s\n","testfile");
+ fprintf(stderr, "Can't open file: %s\n","testfile");
exit(1);
}
if (MPI_SUCCESS != MPI_File_set_view(fh, 2144, MPI_BYTE,
file_type, "native", MPI_INFO_NULL)) {
- printf ("ERROR SET VIEW\n");
+ fprintf (stderr, "ERROR SET VIEW\n");
exit(1);
}
@@ -95,13 +103,13 @@ int main(int argc, char** argv)
mem_type,
MPI_STATUS_IGNORE);
if (rc != MPI_SUCCESS){
- printf ("%d ERROR WRITE AT ALL\n", rc);
+ fprintf (stderr, "%d ERROR WRITE AT ALL\n", rc);
exit(1);
}
if (MPI_SUCCESS != MPI_File_set_view(fh, 2144, MPI_BYTE,
file_type, "native", MPI_INFO_NULL)) {
- printf ("ERROR SET VIEW\n");
+ fprintf (stderr, "ERROR SET VIEW\n");
exit(1);
}
@@ -113,7 +121,7 @@ int main(int argc, char** argv)
mem_type,
MPI_STATUS_IGNORE);
if (rc != MPI_SUCCESS) {
- printf ("%d ERROR READ AT ALL\n", rc);
+ fprintf (stderr, "%d ERROR READ AT ALL\n", rc);
exit(1);
}
diff --git a/test/mpi/io/i_bigtype.c b/test/mpi/io/i_bigtype.c
index a5968a9..35aa8de 100644
--- a/test/mpi/io/i_bigtype.c
+++ b/test/mpi/io/i_bigtype.c
@@ -47,6 +47,10 @@ int main(int argc, char **argv)
/* create a large buffer 2 */
buf_write = malloc(NUM_X * NUM_Y * sizeof(int));
buf_read = malloc(NUM_X * NUM_Y * sizeof(int));
+ if (buf_write == NULL || buf_read == NULL ) {
+ fprintf(stderr, "Not enough memory\n");
+ exit(1);
+ }
memset(buf_read, 0, NUM_X * NUM_Y * sizeof(int));
for (i = 0; i < NUM_X; i++) {
@@ -88,21 +92,21 @@ int main(int argc, char **argv)
rc = MPI_File_open(MPI_COMM_WORLD, "testfile",
MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh);
if (rc != MPI_SUCCESS) {
- printf("Can't open file: %s\n", "testfile");
+ fprintf(stderr, "Can't open file: %s\n", "testfile");
exit(1);
}
rc = MPI_File_set_view(fh, 2144, MPI_BYTE, file_type, "native",
MPI_INFO_NULL);
if (rc != MPI_SUCCESS) {
- printf("ERROR SET VIEW\n");
+ fprintf(stderr, "ERROR SET VIEW\n");
exit(1);
}
/* write everything */
rc = MPI_File_iwrite_at_all(fh, 0, buf_write, 1, mem_type, &request);
if (rc != MPI_SUCCESS) {
- printf("%d ERROR IWRITE AT ALL\n", rc);
+ fprintf(stderr, "%d ERROR IWRITE AT ALL\n", rc);
exit(1);
}
MPI_Wait(&request, &status);
@@ -110,14 +114,14 @@ int main(int argc, char **argv)
rc = MPI_File_set_view(fh, 2144, MPI_BYTE, file_type, "native",
MPI_INFO_NULL);
if (rc != MPI_SUCCESS) {
- printf("ERROR SET VIEW\n");
+ fprintf(stderr, "ERROR SET VIEW\n");
exit(1);
}
/* read everything */
rc = MPI_File_iread_at_all(fh, 0, buf_read, 1, mem_type, &request);
if (rc != MPI_SUCCESS) {
- printf("%d ERROR IREAD AT ALL\n", rc);
+ fprintf(stderr, "%d ERROR IREAD AT ALL\n", rc);
exit(1);
}
MPI_Wait(&request, &status);
http://git.mpich.org/mpich.git/commitdiff/bbf05d805ee975451bd97f3e5cbf9c2e5…
commit bbf05d805ee975451bd97f3e5cbf9c2e56e49511
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Wed Jun 3 11:34:31 2015 -0500
test case for "unable to create file"
This test failed on Lustre and Panaasas because the hinting code opens a
file in order to set or get layout information.
Ref #2261
Ref https://github.com/open-mpi/ompi/issues/158
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/test/mpi/io/Makefile.am b/test/mpi/io/Makefile.am
index abbfce5..e03cdb3 100644
--- a/test/mpi/io/Makefile.am
+++ b/test/mpi/io/Makefile.am
@@ -25,7 +25,9 @@ noinst_PROGRAMS = \
resized \
resized2 \
bigtype \
- hindexed_io
+ hindexed_io \
+ simple_collective
+
if BUILD_MPIX_TESTS
noinst_PROGRAMS += \
diff --git a/test/mpi/io/simple_collective.c b/test/mpi/io/simple_collective.c
new file mode 100644
index 0000000..54e32fa
--- /dev/null
+++ b/test/mpi/io/simple_collective.c
@@ -0,0 +1,163 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+
+/* this deceptively simple test uncovered a bug in the way certain file systems
+ * dealt with tuning parmeters. See
+ * https://github.com/open-mpi/ompi/issues/158 and
+ * http://trac.mpich.org/projects/mpich/ticket/2261
+ *
+ * originally uncovered in Darshan:
+ * http://lists.mcs.anl.gov/pipermail/darshan-users/2015-February/000256.html
+ *
+ * to really exercise the bug in simple_collective,
+ * we'd have to run on a Lustre or Panasas file system.
+ *
+ * I am surprised src/mpi/romio/test/create_excl.c did not uncover the bug
+ */
+
+#define _LARGEFILE64_SOURCE
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/time.h>
+#include <mpi.h>
+#include <errno.h>
+#include <getopt.h>
+
+static char *opt_file = NULL;
+static int rank = -1;
+
+static int parse_args(int argc, char **argv);
+static void usage(const char *prog);
+
+int test_write(char *file, int nprocs, int rank, MPI_Info info)
+{
+ double stime, etime, wtime, w_elapsed, w_slowest, elapsed, slowest;
+ MPI_File fh;
+ int ret;
+ char buffer[700] = { 0 };
+ MPI_Status status;
+ int verbose = 0;
+
+ MPI_Barrier(MPI_COMM_WORLD);
+ stime = MPI_Wtime();
+
+ ret = MPI_File_open(MPI_COMM_WORLD, file,
+ MPI_MODE_CREATE | MPI_MODE_WRONLY | MPI_MODE_EXCL, info, &fh);
+
+ if (ret != 0) {
+ fprintf(stderr, "Error: failed to open %s\n", file);
+ return 1;
+ }
+
+ etime = MPI_Wtime();
+
+ ret = MPI_File_write_at_all(fh, rank * 700, buffer, 700, MPI_BYTE, &status);
+ if (ret != 0) {
+ fprintf(stderr, "Error: failed to write %s\n", file);
+ return 1;
+ }
+
+ wtime = MPI_Wtime();
+
+ MPI_File_close(&fh);
+
+ elapsed = etime - stime;
+ w_elapsed = wtime - etime;
+ MPI_Reduce(&elapsed, &slowest, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD);
+ MPI_Reduce(&w_elapsed, &w_slowest, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD);
+
+ if (rank == 0) {
+ unlink(file);
+
+ slowest *= 1000.0;
+ w_slowest *= 1000.0;
+ if (verbose == 1) {
+ printf("file: %s, nprocs: %d, open_time: %f ms, write_time: %f ms\n",
+ file, nprocs, slowest, w_slowest);
+ }
+ }
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ int nprocs;
+ char file[256];
+ MPI_Info info;
+ int nr_errors = 0;
+
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
+
+ /* parse the command line arguments */
+ parse_args(argc, argv);
+
+ sprintf(file, "%s", opt_file);
+ MPI_Info_create(&info);
+ nr_errors += test_write(file, nprocs, rank, info);
+ /* acutal value does not matter. test only writes a small amount of data */
+ MPI_Info_set(info, "striping_factor", "50");
+ nr_errors += test_write(file, nprocs, rank, info);
+ MPI_Info_free(&info);
+
+ MPI_Finalize();
+ if (!rank && nr_errors == 0) {
+ printf(" No Errors\n");
+ }
+ return (-nr_errors);
+}
+
+static int parse_args(int argc, char **argv)
+{
+ int c;
+
+ while ((c = getopt(argc, argv, "e")) != EOF) {
+ switch (c) {
+ case 'h':
+ if (rank == 0)
+ usage(argv[0]);
+ exit(0);
+ case '?': /* unknown */
+ if (rank == 0)
+ usage(argv[0]);
+ exit(1);
+ default:
+ break;
+ }
+ }
+
+ if (argc - optind != 1) {
+ if (rank == 0)
+ usage(argv[0]);
+ exit(1);
+ }
+
+ opt_file = strdup(argv[optind]);
+ assert(opt_file);
+
+ return (0);
+}
+
+static void usage(const char *prog)
+{
+ printf("Usage: %s [<OPTIONS>...] <FILE NAME>\n", prog);
+ printf("\n<OPTIONS> is one or more of\n");
+ printf(" -h print this help\n");
+}
+
+/*
+ * vim: ts=8 sts=4 sw=4 noexpandtab
+ */
diff --git a/test/mpi/io/testlist.in b/test/mpi/io/testlist.in
index 2c88ede..9604d33 100644
--- a/test/mpi/io/testlist.in
+++ b/test/mpi/io/testlist.in
@@ -11,6 +11,7 @@ resized 1
resized2 1
bigtype 1
hindexed_io 1
+simple_collective 1 arg="simple_collective.testfile"
i_bigtype 1 mpiversion=3.1
i_hindexed_io 1 mpiversion=3.1
i_rdwrord 4 mpiversion=3.1
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c | 92 ++++----------
src/mpi/romio/adio/ad_lustre/ad_lustre_open.c | 144 +++++++++++++++------
src/mpi/romio/adio/common/ad_open.c | 13 +-
test/mpi/io/Makefile.am | 4 +-
test/mpi/io/bigtype.c | 18 ++-
test/mpi/io/i_bigtype.c | 14 ++-
test/mpi/io/simple_collective.c | 163 ++++++++++++++++++++++++
test/mpi/io/testlist.in | 1 +
8 files changed, 325 insertions(+), 124 deletions(-)
create mode 100644 test/mpi/io/simple_collective.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b4-10-g6b41775
by noreply@mpich.org 28 Jul '15
by noreply@mpich.org 28 Jul '15
28 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 6b41775b2056ff18b3c28aab71764e35904c00fa (commit)
from fcbe6bd1e7795b2f213db7959d20e882abecd075 (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/6b41775b2056ff18b3c28aab71764e359…
commit 6b41775b2056ff18b3c28aab71764e35904c00fa
Author: Aaron S. Knister <aknister(a)discover.nccs.nasa.gov>
Date: Mon Jul 27 15:39:20 2015 -0400
let srun know definitiviely there's no stdin
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/pm/hydra/tools/bootstrap/external/slurm_launch.c b/src/pm/hydra/tools/bootstrap/external/slurm_launch.c
index 682fa22..ad62e21 100644
--- a/src/pm/hydra/tools/bootstrap/external/slurm_launch.c
+++ b/src/pm/hydra/tools/bootstrap/external/slurm_launch.c
@@ -102,6 +102,11 @@ HYD_status HYDT_bscd_slurm_launch_procs(char **args, struct HYD_proxy *proxy_lis
targs[idx++] = HYDU_strdup("-n");
targs[idx++] = HYDU_int_to_str(num_hosts);
+ /* Force srun to ignore stdin to avoid issues with
+ * unexpected files open on fd 0 */
+ targs[idx++] = HYDU_strdup("--input");
+ targs[idx++] = HYDU_strdup("none");
+
MPL_env2str("HYDRA_LAUNCHER_EXTRA_ARGS", (const char **) &extra_arg_list);
if (extra_arg_list) {
extra_arg = strtok(extra_arg_list, " ");
-----------------------------------------------------------------------
Summary of changes:
.../hydra/tools/bootstrap/external/slurm_launch.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b4-9-gfcbe6bd
by noreply@mpich.org 28 Jul '15
by noreply@mpich.org 28 Jul '15
28 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 fcbe6bd1e7795b2f213db7959d20e882abecd075 (commit)
from 7d0d237967b9232cf8c2ad30a26d3efd2224e957 (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/fcbe6bd1e7795b2f213db7959d20e882a…
commit fcbe6bd1e7795b2f213db7959d20e882abecd075
Author: Min Si <msi(a)il.is.s.u-tokyo.ac.jp>
Date: Mon Jul 27 14:50:51 2015 -0500
Added comment to explain why -flat-namespace is necessary.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/configure.ac b/configure.ac
index c0370a2..0ac2285 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6005,6 +6005,12 @@ if test "X$enable_shared" = "Xyes" ; then
# added in linking stage for both the shared library and the final
# executable file.
+ # In Fortran programs, we implement global definitions such as MPI_BOTTOM
+ # as common symbols. We check the address of the user input and translate it
+ # to the C global definition if it is equal to the internal pre-stored address
+ # in the Fortran binding layer. Without -flat-namespace, we may get different
+ # addresses and thus treat the predefined constant as a normal buffer.
+
# Although gfortran works fine by only adding -flat-namespace, and
# ifort works by only adding -Wl,-commons,use_dylibs, we should add
# both options here as a generic solution to make sure everything safe.
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b4-8-g7d0d237
by noreply@mpich.org 27 Jul '15
by noreply@mpich.org 27 Jul '15
27 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 7d0d237967b9232cf8c2ad30a26d3efd2224e957 (commit)
via dbb7afb47e3e6f515f358986acb0a5a0d4944e42 (commit)
via e8a3c9d9178f95dc1f803e84982e56cf739d3639 (commit)
via b7066037f8b539ef9979984d2ebdbaca0322e1bf (commit)
via 67bbc9a50f61aef5bf53fd07c84775f11410a968 (commit)
via ca2c13b710254f7c84154ecd720805d673f58792 (commit)
via cf2c025a6c23120e35cf82b8b9ef3c3dd3a0d066 (commit)
via 3835f6012fce888b9ac4648f708b91ba449b0944 (commit)
from b5099d559d6c2a406d3b875b054c288c7e306bc7 (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/7d0d237967b9232cf8c2ad30a26d3efd2…
commit 7d0d237967b9232cf8c2ad30a26d3efd2224e957
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Fri Jul 24 10:21:10 2015 -0500
Rename "non_empty_slots" to "num_active_slots".
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpid_rma_oplist.h b/src/mpid/ch3/include/mpid_rma_oplist.h
index 568e222..f53469c 100644
--- a/src/mpid/ch3/include/mpid_rma_oplist.h
+++ b/src/mpid/ch3/include/mpid_rma_oplist.h
@@ -310,7 +310,7 @@ static inline int MPIDI_CH3I_Win_create_target(MPID_Win * win_ptr, int target_ra
t->target_rank = target_rank;
if (slot->target_list_head == NULL)
- win_ptr->non_empty_slots++;
+ win_ptr->num_active_slots++;
/* Enqueue target into target list. */
MPL_DL_APPEND(slot->target_list_head, t);
@@ -428,7 +428,7 @@ static inline int MPIDI_CH3I_Win_target_dequeue_and_free(MPID_Win * win_ptr, MPI
MPIU_ERR_POP(mpi_errno);
if (slot->target_list_head == NULL)
- win_ptr->non_empty_slots--;
+ win_ptr->num_active_slots--;
fn_exit:
return mpi_errno;
@@ -455,7 +455,7 @@ static inline int MPIDI_CH3I_RMA_Cleanup_targets_win(MPID_Win * win_ptr)
}
}
- MPIU_Assert(win_ptr->non_empty_slots == 0);
+ MPIU_Assert(win_ptr->num_active_slots == 0);
fn_exit:
return mpi_errno;
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 741c758..11cb6d3 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -329,7 +329,8 @@ typedef struct MPIDI_Win_basic_info {
enum MPIDI_RMA_states access_state; \
enum MPIDI_RMA_states exposure_state; \
} states; \
- int non_empty_slots; \
+ int num_active_slots; /* specify number of slots that have \
+ active targets */ \
int active_req_cnt; /* keep track of number of active requests in \
current epoch, i.e., number of issued but \
incomplete RMA operations. */ \
diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c
index 2879572..820241e 100644
--- a/src/mpid/ch3/src/ch3u_rma_progress.c
+++ b/src/mpid/ch3/src/ch3u_rma_progress.c
@@ -399,7 +399,7 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
(*made_progress) = 0;
- if (win_ptr->non_empty_slots == 0 || target == NULL || target->pending_op_list_head == NULL)
+ if (win_ptr->num_active_slots == 0 || target == NULL || target->pending_op_list_head == NULL)
goto fn_exit;
/* Issue out operations in the list. */
@@ -540,7 +540,7 @@ static inline int issue_ops_win(MPID_Win * win_ptr, int *made_progress)
(*made_progress) = 0;
- if (win_ptr->non_empty_slots == 0)
+ if (win_ptr->num_active_slots == 0)
goto fn_exit;
/* FIXME: we should optimize the issuing pattern here. */
@@ -597,7 +597,7 @@ int MPIDI_CH3I_RMA_Free_ops_before_completion(MPID_Win * win_ptr)
/* If we are in an free_ops_before_completion, the window must be holding
* up resources. If it isn't, we are in the wrong window and
* incorrectly entered this function. */
- MPIU_ERR_CHKANDJUMP(win_ptr->non_empty_slots == 0, mpi_errno, MPI_ERR_OTHER, "**rmanoop");
+ MPIU_ERR_CHKANDJUMP(win_ptr->num_active_slots == 0, mpi_errno, MPI_ERR_OTHER, "**rmanoop");
/* make nonblocking progress once */
mpi_errno = MPIDI_CH3I_RMA_Make_progress_win(win_ptr, &made_progress);
@@ -699,7 +699,7 @@ int MPIDI_CH3I_RMA_Cleanup_ops_aggressive(MPID_Win * win_ptr)
/* If we are in an aggressive cleanup, the window must be holding
* up resources. If it isn't, we are in the wrong window and
* incorrectly entered this function. */
- MPIU_ERR_CHKANDJUMP(win_ptr->non_empty_slots == 0, mpi_errno, MPI_ERR_OTHER, "**rmanoop");
+ MPIU_ERR_CHKANDJUMP(win_ptr->num_active_slots == 0, mpi_errno, MPI_ERR_OTHER, "**rmanoop");
/* find the first target that has something to issue */
for (i = 0; i < win_ptr->num_slots; i++) {
@@ -758,7 +758,7 @@ int MPIDI_CH3I_RMA_Cleanup_target_aggressive(MPID_Win * win_ptr, MPIDI_RMA_Targe
/* If we are in an aggressive cleanup, the window must be holding
* up resources. If it isn't, we are in the wrong window and
* incorrectly entered this function. */
- MPIU_ERR_CHKANDJUMP(win_ptr->non_empty_slots == 0, mpi_errno, MPI_ERR_OTHER, "**rmanotarget");
+ MPIU_ERR_CHKANDJUMP(win_ptr->num_active_slots == 0, mpi_errno, MPI_ERR_OTHER, "**rmanotarget");
if (win_ptr->states.access_state == MPIDI_RMA_LOCK_ALL_CALLED) {
/* switch to window-wide protocol */
@@ -927,7 +927,7 @@ int MPIDI_CH3I_RMA_Make_progress_win(MPID_Win * win_ptr, int *made_progress)
goto fn_exit;
}
- if (win_ptr->non_empty_slots == 0)
+ if (win_ptr->num_active_slots == 0)
goto fn_exit;
mpi_errno = issue_ops_win(win_ptr, &temp_progress);
@@ -976,7 +976,7 @@ int MPIDI_CH3I_RMA_Make_progress_global(int *made_progress)
continue;
}
- if (win_ptr->non_empty_slots == 0)
+ if (win_ptr->num_active_slots == 0)
continue;
mpi_errno = issue_ops_win(win_ptr, &temp_progress);
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index 6869571..41ed281 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -653,7 +653,7 @@ int MPID_Win_fence(int assert, MPID_Win * win_ptr)
finish_fence:
/* Make sure that all targets are freed. */
- MPIU_Assert(win_ptr->non_empty_slots == 0);
+ MPIU_Assert(win_ptr->num_active_slots == 0);
MPIU_Assert(win_ptr->active_req_cnt == 0);
@@ -967,7 +967,7 @@ int MPID_Win_complete(MPID_Win * win_ptr)
MPIU_Assert(win_ptr->start_req == NULL);
/* Make sure that all targets are freed. */
- MPIU_Assert(win_ptr->non_empty_slots == 0);
+ MPIU_Assert(win_ptr->num_active_slots == 0);
MPIU_Assert(win_ptr->active_req_cnt == 0);
@@ -1671,7 +1671,7 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr)
win_ptr->lock_all_assert = 0;
/* Make sure that all targets are freed. */
- MPIU_Assert(win_ptr->non_empty_slots == 0);
+ MPIU_Assert(win_ptr->num_active_slots == 0);
MPIU_Assert(win_ptr->active_req_cnt == 0);
diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c
index c823752..2cc7e64 100644
--- a/src/mpid/ch3/src/mpid_rma.c
+++ b/src/mpid/ch3/src/mpid_rma.c
@@ -288,7 +288,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
(*win_ptr)->shm_allocated = FALSE;
(*win_ptr)->states.access_state = MPIDI_RMA_NONE;
(*win_ptr)->states.exposure_state = MPIDI_RMA_NONE;
- (*win_ptr)->non_empty_slots = 0;
+ (*win_ptr)->num_active_slots = 0;
(*win_ptr)->active_req_cnt = 0;
(*win_ptr)->fence_sync_req = MPI_REQUEST_NULL;
(*win_ptr)->start_req = NULL;
http://git.mpich.org/mpich.git/commitdiff/dbb7afb47e3e6f515f358986acb0a5a0d…
commit dbb7afb47e3e6f515f358986acb0a5a0d4944e42
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Fri Jul 24 09:51:13 2015 -0500
Delete MPIDI_RMA_Win_list_t struct.
MPIDI_RMA_Win_list_t struct is not necessary needed, it was
created when we make the linked list of RMA windows. We can
just add prev and next pointers inside window struct and
delete this struct.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpid_rma_types.h b/src/mpid/ch3/include/mpid_rma_types.h
index 4beb3bb..820b5f8 100644
--- a/src/mpid/ch3/include/mpid_rma_types.h
+++ b/src/mpid/ch3/include/mpid_rma_types.h
@@ -105,13 +105,7 @@ typedef struct MPIDI_RMA_Slot {
struct MPIDI_RMA_Target *target_list_head;
} MPIDI_RMA_Slot_t;
-typedef struct MPIDI_RMA_Win_list {
- MPID_Win *win_ptr;
- struct MPIDI_RMA_Win_list *next;
- struct MPIDI_RMA_Win_list *prev;
-} MPIDI_RMA_Win_list_t;
-
-extern MPIDI_RMA_Win_list_t *MPIDI_RMA_Win_list_head;
+extern MPID_Win *MPIDI_RMA_Win_list_head;
typedef struct MPIDI_RMA_Target_lock_entry {
struct MPIDI_RMA_Target_lock_entry *next;
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index d4a7161..741c758 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -354,6 +354,8 @@ typedef struct MPIDI_Win_basic_info {
their completion during RMA \
epoch, but we need to clean \
them up in Win_free. */ \
+ struct MPID_Win *prev; \
+ struct MPID_Win *next; \
#ifdef MPIDI_CH3_WIN_DECL
#define MPID_DEV_WIN_DECL \
diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c
index 8272b0e..2879572 100644
--- a/src/mpid/ch3/src/ch3u_rma_progress.c
+++ b/src/mpid/ch3/src/ch3u_rma_progress.c
@@ -949,7 +949,7 @@ int MPIDI_CH3I_RMA_Make_progress_win(MPID_Win * win_ptr, int *made_progress)
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIDI_CH3I_RMA_Make_progress_global(int *made_progress)
{
- MPIDI_RMA_Win_list_t *win_elem;
+ MPID_Win *win_ptr;
int mpi_errno = MPI_SUCCESS;
(*made_progress) = 0;
@@ -957,18 +957,17 @@ int MPIDI_CH3I_RMA_Make_progress_global(int *made_progress)
if (MPIDI_CH3I_num_active_issued_win == 0 && MPIDI_CH3I_num_passive_win == 0)
goto fn_exit;
- for (win_elem = MPIDI_RMA_Win_list_head; win_elem; win_elem = win_elem->next) {
+ for (win_ptr = MPIDI_RMA_Win_list_head; win_ptr; win_ptr = win_ptr->next) {
int temp_progress = 0;
int is_able_to_issue = 0;
- if (win_elem->win_ptr->states.access_state == MPIDI_RMA_NONE ||
- win_elem->win_ptr->states.access_state == MPIDI_RMA_FENCE_GRANTED ||
- win_elem->win_ptr->states.access_state == MPIDI_RMA_PSCW_GRANTED)
+ if (win_ptr->states.access_state == MPIDI_RMA_NONE ||
+ win_ptr->states.access_state == MPIDI_RMA_FENCE_GRANTED ||
+ win_ptr->states.access_state == MPIDI_RMA_PSCW_GRANTED)
continue;
/* check and try to switch window state */
- mpi_errno =
- check_and_switch_window_state(win_elem->win_ptr, &is_able_to_issue, &temp_progress);
+ mpi_errno = check_and_switch_window_state(win_ptr, &is_able_to_issue, &temp_progress);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if (temp_progress)
@@ -977,10 +976,10 @@ int MPIDI_CH3I_RMA_Make_progress_global(int *made_progress)
continue;
}
- if (win_elem->win_ptr->non_empty_slots == 0)
+ if (win_ptr->non_empty_slots == 0)
continue;
- mpi_errno = issue_ops_win(win_elem->win_ptr, &temp_progress);
+ mpi_errno = issue_ops_win(win_ptr, &temp_progress);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if (temp_progress)
diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c
index e426c3c..c823752 100644
--- a/src/mpid/ch3/src/mpid_rma.c
+++ b/src/mpid/ch3/src/mpid_rma.c
@@ -41,7 +41,7 @@ cvars:
MPIU_THREADSAFE_INIT_DECL(initRMAoptions);
-MPIDI_RMA_Win_list_t *MPIDI_RMA_Win_list_head = NULL;
+MPID_Win *MPIDI_RMA_Win_list_head = NULL;
static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model, MPID_Info * info,
MPID_Comm * comm_ptr, MPID_Win ** win_ptr);
@@ -245,7 +245,6 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
int i;
MPID_Comm *win_comm_ptr;
int win_target_pool_size;
- MPIDI_RMA_Win_list_t *win_elem;
MPIU_CHKPMEM_DECL(5);
MPIDI_STATE_DECL(MPID_STATE_WIN_INIT);
@@ -300,6 +299,8 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
(*win_ptr)->outstanding_locks = 0;
(*win_ptr)->current_target_lock_data_bytes = 0;
(*win_ptr)->dangling_request_cnt = 0;
+ (*win_ptr)->next = NULL;
+ (*win_ptr)->prev = NULL;
/* Initialize the info flags */
(*win_ptr)->info_args.no_locks = 0;
@@ -353,17 +354,12 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
&((*win_ptr)->target_lock_entry_pool_start[i]));
}
- /* enqueue window into the global list */
- MPIU_CHKPMEM_MALLOC(win_elem, MPIDI_RMA_Win_list_t *, sizeof(MPIDI_RMA_Win_list_t), mpi_errno,
- "Window list element");
- win_elem->win_ptr = *win_ptr;
-
if (MPIDI_RMA_Win_list_head == NULL) {
mpi_errno = MPID_Progress_register_hook(MPIDI_CH3I_RMA_Make_progress_global);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
}
- MPL_DL_APPEND(MPIDI_RMA_Win_list_head, win_elem);
+ MPL_DL_APPEND(MPIDI_RMA_Win_list_head, (*win_ptr));
if (MPIDI_CH3U_Win_hooks.win_init != NULL) {
mpi_errno =
diff --git a/src/mpid/ch3/src/mpidi_rma.c b/src/mpid/ch3/src/mpidi_rma.c
index 4a01f90..7124be5 100644
--- a/src/mpid/ch3/src/mpidi_rma.c
+++ b/src/mpid/ch3/src/mpidi_rma.c
@@ -149,7 +149,6 @@ int MPID_Win_free(MPID_Win ** win_ptr)
int in_use;
MPID_Comm *comm_ptr;
mpir_errflag_t errflag = MPIR_ERR_NONE;
- MPIDI_RMA_Win_list_t *win_elem;
MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_FREE);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_FREE);
@@ -201,11 +200,7 @@ int MPID_Win_free(MPID_Win ** win_ptr)
}
/* dequeue window from the global list */
- for (win_elem = MPIDI_RMA_Win_list_head; win_elem && win_elem->win_ptr != *win_ptr;
- win_elem = win_elem->next);
- MPIU_ERR_CHKANDJUMP(win_elem == NULL, mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
- MPL_DL_DELETE(MPIDI_RMA_Win_list_head, win_elem);
- MPIU_Free(win_elem);
+ MPL_DL_DELETE(MPIDI_RMA_Win_list_head, (*win_ptr));
if (MPIDI_RMA_Win_list_head == NULL)
MPID_Progress_deregister_hook(MPIDI_CH3I_RMA_Make_progress_global);
http://git.mpich.org/mpich.git/commitdiff/e8a3c9d9178f95dc1f803e84982e56cf7…
commit e8a3c9d9178f95dc1f803e84982e56cf739d3639
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Sat Jul 18 10:44:20 2015 -0500
Add helper macros to simplify the code.
Here we add three macros to simplify RMA code:
(1) MPIDI_CH3I_RMA_PKT_IS_READ_OP: judging if the operation
is a "read" op, which means has response data from target
to origin.
(2) MPIDI_CH3I_RMA_PKT_IS_IMMED_OP: judging if the operation
is a "immed" op, which means all data fits in the packet
header.
(3) MPIDI_CH3I_RMA_Rank_to_slots_idx: provide mapping between
rank and slot index.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpid_rma_oplist.h b/src/mpid/ch3/include/mpid_rma_oplist.h
index b55949a..568e222 100644
--- a/src/mpid/ch3/include/mpid_rma_oplist.h
+++ b/src/mpid/ch3/include/mpid_rma_oplist.h
@@ -24,6 +24,8 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
#define MPIDI_CH3I_RMA_Get_issued_list_ptr(target_, op_, list_ptr_, mpi_errno_) \
do { \
MPI_Datatype target_datatype_; \
+ int is_read_; \
+ MPIDI_CH3I_RMA_PKT_IS_READ_OP((op_)->pkt, is_read_); \
MPIDI_CH3_PKT_RMA_GET_TARGET_DATATYPE((op_)->pkt, target_datatype_, mpi_errno_); \
if ((target_datatype_ != MPI_DATATYPE_NULL && \
!MPIR_DATATYPE_IS_PREDEFINED(target_datatype_)) || \
@@ -33,10 +35,7 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
!MPIR_DATATYPE_IS_PREDEFINED((op_)->result_datatype))) { \
list_ptr_ = &((target_)->issued_dt_op_list_head); \
} \
- else if ((op_)->pkt.type == MPIDI_CH3_PKT_PUT || \
- (op_)->pkt.type == MPIDI_CH3_PKT_PUT_IMMED || \
- (op_)->pkt.type == MPIDI_CH3_PKT_ACCUMULATE || \
- (op_)->pkt.type == MPIDI_CH3_PKT_ACCUMULATE_IMMED) { \
+ else if (!is_read_) { \
list_ptr_ = &((target_)->issued_write_op_list_head); \
} \
else { \
@@ -141,6 +140,14 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
\
} while (0)
+
+/* Given a rank, return slot index */
+#define MPIDI_CH3I_RMA_RANK_TO_SLOT(win_ptr_, rank_) \
+ (((win_ptr_)->num_slots < (win_ptr_)->comm_ptr->local_size) ? \
+ &(win_ptr_)->slots[(rank_) % (win_ptr_)->num_slots] : \
+ &(win_ptr_)->slots[(rank_)])
+
+
/* MPIDI_CH3I_Win_op_alloc(): get a new op element from op pool and
* initialize it. If we cannot get one, return NULL. */
#undef FUNCNAME
@@ -292,11 +299,7 @@ static inline int MPIDI_CH3I_Win_create_target(MPID_Win * win_ptr, int target_ra
MPIDI_RMA_Slot_t *slot = NULL;
MPIDI_RMA_Target_t *t = NULL;
- if (win_ptr->num_slots < win_ptr->comm_ptr->local_size)
- slot = &(win_ptr->slots[target_rank % win_ptr->num_slots]);
- else
- slot = &(win_ptr->slots[target_rank]);
-
+ slot = MPIDI_CH3I_RMA_RANK_TO_SLOT(win_ptr, target_rank);
t = MPIDI_CH3I_Win_target_alloc(win_ptr);
if (t == NULL) {
mpi_errno = MPIDI_CH3I_RMA_Cleanup_target_aggressive(win_ptr, &t);
@@ -335,10 +338,7 @@ static inline int MPIDI_CH3I_Win_find_target(MPID_Win * win_ptr, int target_rank
MPIDI_RMA_Slot_t *slot = NULL;
MPIDI_RMA_Target_t *t = NULL;
- if (win_ptr->num_slots < win_ptr->comm_ptr->local_size)
- slot = &(win_ptr->slots[target_rank % win_ptr->num_slots]);
- else
- slot = &(win_ptr->slots[target_rank]);
+ slot = MPIDI_CH3I_RMA_RANK_TO_SLOT(win_ptr, target_rank);
t = slot->target_list_head;
while (t != NULL) {
@@ -419,10 +419,7 @@ static inline int MPIDI_CH3I_Win_target_dequeue_and_free(MPID_Win * win_ptr, MPI
int target_rank = e->target_rank;
MPIDI_RMA_Slot_t *slot;
- if (win_ptr->num_slots < win_ptr->comm_ptr->local_size)
- slot = &(win_ptr->slots[target_rank % win_ptr->num_slots]);
- else
- slot = &(win_ptr->slots[target_rank]);
+ slot = MPIDI_CH3I_RMA_RANK_TO_SLOT(win_ptr, target_rank);
MPL_DL_DELETE(slot->target_list_head, e);
diff --git a/src/mpid/ch3/include/mpidpkt.h b/src/mpid/ch3/include/mpidpkt.h
index db59ad7..05780e4 100644
--- a/src/mpid/ch3/include/mpidpkt.h
+++ b/src/mpid/ch3/include/mpidpkt.h
@@ -609,6 +609,41 @@ MPIDI_CH3_PKT_DEFS
} \
}
+
+/* This macro judges if the RMA operation is a read operation,
+ * which means, it will triffer the issuing of response data from
+ * the target to the origin */
+#define MPIDI_CH3I_RMA_PKT_IS_READ_OP(pkt_, is_read_op_) \
+ do { \
+ if ((pkt_).type == MPIDI_CH3_PKT_GET_ACCUM_IMMED || \
+ (pkt_).type == MPIDI_CH3_PKT_GET_ACCUM || \
+ (pkt_).type == MPIDI_CH3_PKT_FOP_IMMED || \
+ (pkt_).type == MPIDI_CH3_PKT_FOP || \
+ (pkt_).type == MPIDI_CH3_PKT_CAS_IMMED || \
+ (pkt_).type == MPIDI_CH3_PKT_GET) { \
+ is_read_op_ = TRUE; \
+ } \
+ else { \
+ is_read_op_ = FALSE; \
+ } \
+ } while (0)
+
+
+/* This macro judges if the RMA operation is a immed operation */
+#define MPIDI_CH3I_RMA_PKT_IS_IMMED_OP(pkt_, is_immed_op_) \
+ do { \
+ if ((pkt_).type == MPIDI_CH3_PKT_GET_ACCUM_IMMED || \
+ (pkt_).type == MPIDI_CH3_PKT_FOP_IMMED || \
+ (pkt_).type == MPIDI_CH3_PKT_CAS_IMMED || \
+ (pkt_).type == MPIDI_CH3_PKT_PUT_IMMED || \
+ (pkt_).type == MPIDI_CH3_PKT_ACCUMULATE_IMMED) { \
+ is_immed_op_ = TRUE; \
+ } \
+ else { \
+ is_immed_op_ = FALSE; \
+ } \
+ } while (0)
+
typedef struct MPIDI_CH3_Pkt_put {
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 01a74c0..88a1eed 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -326,6 +326,7 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
MPIDI_CH3_Pkt_flags_t flag;
MPI_Win source_win_handle;
MPI_Request request_handle;
+ int is_immed_op = FALSE;
int lock_discarded = 0, data_discarded = 0;
int mpi_errno = MPI_SUCCESS;
@@ -342,13 +343,8 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
lock_discarded = 1;
}
- if (pkt->type == MPIDI_CH3_PKT_LOCK ||
- pkt->type == MPIDI_CH3_PKT_PUT_IMMED ||
- pkt->type == MPIDI_CH3_PKT_ACCUMULATE_IMMED ||
- pkt->type == MPIDI_CH3_PKT_GET ||
- pkt->type == MPIDI_CH3_PKT_GET_ACCUM_IMMED ||
- pkt->type == MPIDI_CH3_PKT_FOP_IMMED || pkt->type == MPIDI_CH3_PKT_CAS_IMMED) {
-
+ MPIDI_CH3I_RMA_PKT_IS_IMMED_OP((*pkt), is_immed_op);
+ if (is_immed_op || pkt->type == MPIDI_CH3_PKT_LOCK || pkt->type == MPIDI_CH3_PKT_GET) {
/* return bytes of data processed in this pkt handler */
(*buflen) = sizeof(MPIDI_CH3_Pkt_t);
@@ -429,10 +425,12 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
MPIDI_CH3_Pkt_t new_pkt;
MPIDI_CH3_Pkt_lock_t *lock_pkt = &new_pkt.lock;
MPI_Win target_win_handle;
+ int is_read_op = FALSE;
+ MPIDI_CH3I_RMA_PKT_IS_READ_OP((*pkt), is_read_op);
MPIDI_CH3_PKT_RMA_GET_TARGET_WIN_HANDLE((*pkt), target_win_handle, mpi_errno);
- if (pkt->type == MPIDI_CH3_PKT_PUT || pkt->type == MPIDI_CH3_PKT_ACCUMULATE) {
+ if (!is_read_op) {
MPIDI_CH3_PKT_RMA_GET_SOURCE_WIN_HANDLE((*pkt), source_win_handle, mpi_errno);
request_handle = MPI_REQUEST_NULL;
}
@@ -527,6 +525,8 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
MPIU_ERR_POP(mpi_errno);
}
else {
+ int is_read_op = FALSE;
+
if (lock_discarded)
flag = MPIDI_CH3_PKT_FLAG_RMA_LOCK_DISCARDED;
else if (data_discarded)
@@ -534,8 +534,8 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
else
flag = MPIDI_CH3_PKT_FLAG_RMA_LOCK_QUEUED_DATA_QUEUED;
- if (pkt->type == MPIDI_CH3_PKT_PUT || pkt->type == MPIDI_CH3_PKT_PUT_IMMED ||
- pkt->type == MPIDI_CH3_PKT_ACCUMULATE || pkt->type == MPIDI_CH3_PKT_ACCUMULATE_IMMED) {
+ MPIDI_CH3I_RMA_PKT_IS_READ_OP((*pkt), is_read_op);
+ if (!is_read_op) {
MPIDI_CH3_PKT_RMA_GET_SOURCE_WIN_HANDLE((*pkt), source_win_handle, mpi_errno);
request_handle = MPI_REQUEST_NULL;
}
diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c
index 6ab1c8f..8272b0e 100644
--- a/src/mpid/ch3/src/ch3u_rma_progress.c
+++ b/src/mpid/ch3/src/ch3u_rma_progress.c
@@ -406,6 +406,7 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
curr_op = target->next_op_to_issue;
while (curr_op != NULL) {
int op_completed = FALSE;
+ int is_read_op = FALSE;
if (target->access_state == MPIDI_RMA_LOCK_ISSUED) {
/* It is possible that the previous OP+LOCK changes
@@ -474,10 +475,8 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
(*made_progress) = 1;
- if (curr_op->pkt.type == MPIDI_CH3_PKT_PUT ||
- curr_op->pkt.type == MPIDI_CH3_PKT_PUT_IMMED ||
- curr_op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE ||
- curr_op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE_IMMED) {
+ MPIDI_CH3I_RMA_PKT_IS_READ_OP(curr_op->pkt, is_read_op);
+ if (!is_read_op) {
target->put_acc_issued = 1; /* set PUT_ACC_FLAG when sending
* PUT/ACC operation. */
}
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index cd6c415..6869571 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -903,7 +903,6 @@ int MPID_Win_complete(MPID_Win * win_ptr)
{
int mpi_errno = MPI_SUCCESS;
int i, dst, rank = win_ptr->comm_ptr->rank;
- MPID_Comm *win_comm_ptr = win_ptr->comm_ptr;
MPIDI_RMA_Target_t *curr_target;
MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_COMPLETE);
@@ -935,13 +934,9 @@ int MPID_Win_complete(MPID_Win * win_ptr)
continue;
}
- if (win_comm_ptr->local_size <= win_ptr->num_slots)
- curr_target = win_ptr->slots[dst].target_list_head;
- else {
- curr_target = win_ptr->slots[dst % win_ptr->num_slots].target_list_head;
- while (curr_target != NULL && curr_target->target_rank != dst)
- curr_target = curr_target->next;
- }
+ curr_target = MPIDI_CH3I_RMA_RANK_TO_SLOT(win_ptr, dst)->target_list_head;
+ while (curr_target != NULL && curr_target->target_rank != dst)
+ curr_target = curr_target->next;
if (curr_target != NULL) {
curr_target->win_complete_flag = 1;
@@ -1618,13 +1613,9 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr)
}
else {
for (i = 0; i < win_ptr->comm_ptr->local_size; i++) {
- if (win_ptr->comm_ptr->local_size <= win_ptr->num_slots)
- curr_target = win_ptr->slots[i].target_list_head;
- else {
- curr_target = win_ptr->slots[i % win_ptr->num_slots].target_list_head;
- while (curr_target != NULL && curr_target->target_rank != i)
- curr_target = curr_target->next;
- }
+ curr_target = MPIDI_CH3I_RMA_RANK_TO_SLOT(win_ptr, i)->target_list_head;
+ while (curr_target != NULL && curr_target->target_rank != i)
+ curr_target = curr_target->next;
if (curr_target != NULL) {
if (curr_target->sync.sync_flag < sync_flag) {
http://git.mpich.org/mpich.git/commitdiff/b7066037f8b539ef9979984d2ebdbaca0…
commit b7066037f8b539ef9979984d2ebdbaca0322e1bf
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Fri Jul 24 09:32:50 2015 -0500
Simplify RMA issuing functions.
For RMA operations that have response data back, we always
keep track of the receiving request in the operation object
and let the sending request go into the progress engine (it
will be completed by the progress engine when sending is
completed). Here we simplify this part of code.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpid_rma_issue.h b/src/mpid/ch3/include/mpid_rma_issue.h
index 3a7b6d9..d36d74a 100644
--- a/src/mpid/ch3/include/mpid_rma_issue.h
+++ b/src/mpid/ch3/include/mpid_rma_issue.h
@@ -692,16 +692,9 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
if (curr_req != NULL) {
MPID_Request_release(curr_req);
- curr_req = resp_req;
- }
- else {
- curr_req = resp_req;
}
- /* For error checking */
- resp_req = NULL;
-
- rma_op->single_req = curr_req;
+ rma_op->single_req = resp_req;
goto fn_exit;
}
@@ -814,39 +807,14 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
- /* This operation can generate two requests; one for inbound and one for
- * outbound data. */
if (curr_req != NULL) {
- /* If we have both inbound and outbound requests (i.e. GACC
- * operation), we need to ensure that the source buffer is
- * available and that the response data has been received before
- * informing the origin that this operation is complete. Because
- * the update needs to be done atomically at the target, they will
- * not send back data until it has been received. Therefore,
- * completion of the response request implies that the send request
- * has completed.
- *
- * Therefore: refs on the response request are set to two: one is
- * held by the progress engine and the other by the RMA op
- * completion code. Refs on the outbound request are set to one;
- * it will be completed by the progress engine.
- */
-
MPID_Request_release(curr_req);
- curr_req = resp_req;
- }
- else {
- curr_req = resp_req;
}
- /* For error checking */
- resp_req = NULL;
-
if (rma_op->reqs_size == 1)
- rma_op->single_req = curr_req;
+ rma_op->single_req = resp_req;
else
- rma_op->multi_reqs[j] = curr_req;
-
+ rma_op->multi_reqs[j] = resp_req;
rma_op->issued_stream_count++;
@@ -1140,35 +1108,11 @@ static int issue_fop_op(MPIDI_RMA_Op_t * rma_op,
MPIU_ERR_POP(mpi_errno);
}
- /* This operation can generate two requests; one for inbound and one for
- * outbound data. */
if (curr_req != NULL) {
- /* If we have both inbound and outbound requests (i.e. GACC
- * operation), we need to ensure that the source buffer is
- * available and that the response data has been received before
- * informing the origin that this operation is complete. Because
- * the update needs to be done atomically at the target, they will
- * not send back data until it has been received. Therefore,
- * completion of the response request implies that the send request
- * has completed.
- *
- * Therefore: refs on the response request are set to two: one is
- * held by the progress engine and the other by the RMA op
- * completion code. Refs on the outbound request are set to one;
- * it will be completed by the progress engine.
- */
-
MPID_Request_release(curr_req);
- curr_req = resp_req;
- }
- else {
- curr_req = resp_req;
}
- /* For error checking */
- resp_req = NULL;
-
- rma_op->single_req = curr_req;
+ rma_op->single_req = resp_req;
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_ISSUE_FOP_OP);
http://git.mpich.org/mpich.git/commitdiff/67bbc9a50f61aef5bf53fd07c84775f11…
commit 67bbc9a50f61aef5bf53fd07c84775f11410a968
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Fri Jul 24 09:33:19 2015 -0500
Simplify function dealing with operation piggybacked with LOCK.
The operation that is entering this function must be the operation
that piggybacked with LOCK, therefore we can simplify it by
deleting unnecessary branches.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 4f86910..01a74c0 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -622,7 +622,6 @@ static inline int adjust_op_piggybacked_with_lock(MPID_Win * win_ptr,
MPIDI_RMA_Target_t *target = NULL;
MPIDI_RMA_Op_t *op = NULL;
MPIDI_CH3_Pkt_flags_t op_flags = MPIDI_CH3_PKT_FLAG_NONE;
- int i;
int mpi_errno = MPI_SUCCESS;
mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, target_rank, &target);
@@ -630,93 +629,81 @@ static inline int adjust_op_piggybacked_with_lock(MPID_Win * win_ptr,
MPIU_ERR_POP(mpi_errno);
MPIU_Assert(target != NULL);
- op = target->pending_op_list_head;
- if (op != NULL)
- MPIDI_CH3_PKT_RMA_GET_FLAGS(op->pkt, op_flags, mpi_errno);
+ /* Here the next_op_to_issue pointer should still point to the OP piggybacked
+ * with LOCK */
+ op = target->next_op_to_issue;
+ MPIU_Assert(op != NULL);
- if (op_flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
- op_flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_EXCLUSIVE) {
- if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED ||
- flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_QUEUED_DATA_QUEUED) {
+ MPIDI_CH3_PKT_RMA_GET_FLAGS(op->pkt, op_flags, mpi_errno);
+ MPIU_Assert(op_flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
+ op_flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_EXCLUSIVE);
- if (op->ureq != NULL) {
- mpi_errno = set_user_req_after_issuing_op(op);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
- }
+ if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED ||
+ flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_QUEUED_DATA_QUEUED) {
- if (op->reqs_size == 0) {
- MPIU_Assert(op->single_req == NULL && op->multi_reqs == NULL);
- MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list_head), op);
- }
- else {
- MPI_Datatype target_datatype;
- int is_derived = FALSE;
+ if (op->reqs_size > 0) {
+ MPID_Request **req = NULL;
+ if (op->reqs_size == 1)
+ req = &(op->single_req);
+ else
+ req = &(op->multi_reqs[0]);
- MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_op_list_head), op);
+ MPIU_Assert((*req) != NULL);
+ MPID_Request_release((*req));
+ (*req) = NULL;
+ }
- MPIDI_CH3_PKT_RMA_GET_TARGET_DATATYPE(op->pkt, target_datatype, mpi_errno);
+ if ((op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE || op->pkt.type == MPIDI_CH3_PKT_GET_ACCUM)
+ && op->issued_stream_count != ALL_STREAM_UNITS_ISSUED) {
+ /* Now we successfully issue out the first stream unit,
+ * keep next_op_to_issue still stick to the current op
+ * since we need to issue the following stream units. */
+ goto fn_exit;
+ }
- if ((target_datatype != MPI_DATATYPE_NULL &&
- !MPIR_DATATYPE_IS_PREDEFINED(target_datatype)) ||
- (op->origin_datatype != MPI_DATATYPE_NULL &&
- !MPIR_DATATYPE_IS_PREDEFINED(op->origin_datatype)) ||
- (op->result_datatype != MPI_DATATYPE_NULL &&
- !MPIR_DATATYPE_IS_PREDEFINED(op->result_datatype))) {
- is_derived = TRUE;
- }
+ /* We are done with the current operation, make next_op_to_issue points to the
+ * next operation. */
+ target->next_op_to_issue = op->next;
- if (is_derived) {
- MPIDI_CH3I_RMA_Ops_append(&(target->issued_dt_op_list_head), op);
- }
- else if (op->pkt.type == MPIDI_CH3_PKT_PUT ||
- op->pkt.type == MPIDI_CH3_PKT_PUT_IMMED ||
- op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE ||
- op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE_IMMED) {
- MPIDI_CH3I_RMA_Ops_append(&(target->issued_write_op_list_head), op);
- }
- else {
- MPIDI_CH3I_RMA_Ops_append(&(target->issued_read_op_list_head), op);
- }
+ if (target->next_op_to_issue == NULL) {
+ if (op_flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH || op_flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
+ /* We are done with ending sync, unset target's sync_flag. */
+ target->sync.sync_flag = MPIDI_RMA_SYNC_NONE;
}
}
- else if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_QUEUED_DATA_DISCARDED ||
- flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_DISCARDED) {
- /* We need to re-transmit this operation, so we destroy
- * the internal request and erase all flags in current
- * operation. */
- if (op->reqs_size == 1) {
- MPIU_Assert(op->single_req != NULL);
- MPID_Request_release(op->single_req);
- op->single_req = NULL;
- win_ptr->active_req_cnt--;
- op->reqs_size = 0;
- }
- else if (op->reqs_size > 1) {
- MPIU_Assert(op->multi_reqs != NULL);
- for (i = 0; i < op->reqs_size; i++) {
- if (op->multi_reqs[i] != NULL) {
- MPID_Request_release(op->multi_reqs[i]);
- op->multi_reqs[i] = NULL;
- win_ptr->active_req_cnt--;
- }
- }
- /* free req array in this op */
- MPIU_Free(op->multi_reqs);
- op->multi_reqs = NULL;
- op->reqs_size = 0;
- }
- MPIDI_CH3_PKT_RMA_ERASE_FLAGS(op->pkt, mpi_errno);
-
- target->next_op_to_issue = op;
- op->issued_stream_count = 0;
+ if (op->ureq != NULL) {
+ /* Complete user request and release the ch3 ref */
+ mpi_errno = MPID_Request_complete(op->ureq);
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIU_ERR_POP(mpi_errno);
+ }
+ }
- if (op_flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH)
- target->sync.sync_flag = MPIDI_RMA_SYNC_FLUSH;
- else if (op_flags & MPIDI_RMA_SYNC_UNLOCK)
- target->sync.sync_flag = MPIDI_RMA_SYNC_UNLOCK;
+ MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list_head), op);
+ }
+ else if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_QUEUED_DATA_DISCARDED ||
+ flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_DISCARDED) {
+ /* We need to re-transmit this operation, so we destroy
+ * the internal request and erase all flags in current
+ * operation. */
+ if (op->reqs_size == 1) {
+ MPIU_Assert(op->single_req != NULL);
+ MPID_Request_release(op->single_req);
+ op->single_req = NULL;
+ op->reqs_size = 0;
}
+ else if (op->reqs_size > 1) {
+ MPIU_Assert(op->multi_reqs != NULL && op->multi_reqs[0] != NULL);
+ MPID_Request_release(op->multi_reqs[0]);
+ /* free req array in this op */
+ MPIU_Free(op->multi_reqs);
+ op->multi_reqs = NULL;
+ op->reqs_size = 0;
+ }
+ MPIDI_CH3_PKT_RMA_ERASE_FLAGS(op->pkt, mpi_errno);
+
+ op->issued_stream_count = 0;
}
fn_exit:
http://git.mpich.org/mpich.git/commitdiff/ca2c13b710254f7c84154ecd720805d67…
commit ca2c13b710254f7c84154ecd720805d673f58792
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Fri Jul 24 09:30:49 2015 -0500
Add bracket to protect variable name in the macro.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpid_rma_oplist.h b/src/mpid/ch3/include/mpid_rma_oplist.h
index bc9fd90..b55949a 100644
--- a/src/mpid/ch3/include/mpid_rma_oplist.h
+++ b/src/mpid/ch3/include/mpid_rma_oplist.h
@@ -50,23 +50,23 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
do { \
local_completed_ = 0; \
remote_completed_ = 0; \
- if (win_->states.access_state != MPIDI_RMA_FENCE_ISSUED && \
- win_->states.access_state != MPIDI_RMA_PSCW_ISSUED && \
- win_->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED && \
- target_->access_state != MPIDI_RMA_LOCK_CALLED && \
- target_->access_state != MPIDI_RMA_LOCK_ISSUED && \
- target_->pending_op_list_head == NULL && \
- target_->issued_read_op_list_head == NULL && \
- target_->issued_write_op_list_head == NULL && \
- target_->issued_dt_op_list_head == NULL) { \
+ if ((win_)->states.access_state != MPIDI_RMA_FENCE_ISSUED && \
+ (win_)->states.access_state != MPIDI_RMA_PSCW_ISSUED && \
+ (win_)->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED && \
+ (target_)->access_state != MPIDI_RMA_LOCK_CALLED && \
+ (target_)->access_state != MPIDI_RMA_LOCK_ISSUED && \
+ (target_)->pending_op_list_head == NULL && \
+ (target_)->issued_read_op_list_head == NULL && \
+ (target_)->issued_write_op_list_head == NULL && \
+ (target_)->issued_dt_op_list_head == NULL) { \
local_completed_ = 1; \
- if (target_->sync.sync_flag == MPIDI_RMA_SYNC_NONE && \
- target_->sync.outstanding_acks == 0) \
+ if ((target_)->sync.sync_flag == MPIDI_RMA_SYNC_NONE && \
+ (target_)->sync.outstanding_acks == 0) \
remote_completed_ = 1; \
} \
\
- if ((target_->sync.upgrade_flush_local && !remote_completed_) || \
- (!target_->sync.upgrade_flush_local && !local_completed_)) { \
+ if (((target_)->sync.upgrade_flush_local && !remote_completed_) || \
+ (!(target_)->sync.upgrade_flush_local && !local_completed_)) { \
local_completed_ = 0; \
} \
else { \
http://git.mpich.org/mpich.git/commitdiff/cf2c025a6c23120e35cf82b8b9ef3c3dd…
commit cf2c025a6c23120e35cf82b8b9ef3c3dd3a0d066
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Fri Jul 24 09:26:30 2015 -0500
Make request completion callback to delete operation and drop GC progress.
In this patch, we make the request point to the corresponding RMA
operation and delete that operation from the list in the request
completion callback, so that operation can be deleted as soon as
possible. By doing so, the garbage collection progress of RMA
operations is not needed anymore.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpid_rma_issue.h b/src/mpid/ch3/include/mpid_rma_issue.h
index c9e01a3..3a7b6d9 100644
--- a/src/mpid/ch3/include/mpid_rma_issue.h
+++ b/src/mpid/ch3/include/mpid_rma_issue.h
@@ -453,7 +453,6 @@ static int issue_put_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
rma_op->reqs_size = 1;
rma_op->single_req = curr_req;
- win_ptr->active_req_cnt++;
}
fn_exit:
@@ -512,7 +511,6 @@ static int issue_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
rma_op->reqs_size = 1;
rma_op->single_req = curr_req;
- win_ptr->active_req_cnt++;
}
goto fn_exit;
}
@@ -601,7 +599,6 @@ static int issue_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
rma_op->single_req = curr_req;
else
rma_op->multi_reqs[j] = curr_req;
- win_ptr->active_req_cnt++;
}
rma_op->issued_stream_count++;
@@ -705,7 +702,6 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
resp_req = NULL;
rma_op->single_req = curr_req;
- win_ptr->active_req_cnt++;
goto fn_exit;
}
@@ -851,7 +847,6 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
else
rma_op->multi_reqs[j] = curr_req;
- win_ptr->active_req_cnt++;
rma_op->issued_stream_count++;
@@ -1014,7 +1009,6 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
}
rma_op->single_req = curr_req;
- win_ptr->active_req_cnt++;
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_ISSUE_GET_OP);
@@ -1078,7 +1072,6 @@ static int issue_cas_op(MPIDI_RMA_Op_t * rma_op,
}
rma_op->single_req = curr_req;
- win_ptr->active_req_cnt++;
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_ISSUE_CAS_OP);
@@ -1176,7 +1169,6 @@ static int issue_fop_op(MPIDI_RMA_Op_t * rma_op,
resp_req = NULL;
rma_op->single_req = curr_req;
- win_ptr->active_req_cnt++;
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_ISSUE_FOP_OP);
@@ -1243,83 +1235,4 @@ static inline int issue_rma_op(MPIDI_RMA_Op_t * op_ptr, MPID_Win * win_ptr,
/* --END ERROR HANDLING-- */
}
-#undef FUNCNAME
-#define FUNCNAME set_user_req_after_issuing_op
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static inline int set_user_req_after_issuing_op(MPIDI_RMA_Op_t * op)
-{
- int i, incomplete_req_cnt = 0;
- int mpi_errno = MPI_SUCCESS;
- MPIDI_STATE_DECL(MPID_STATE_SET_USER_REQ_AFTER_ISSUING_OP);
-
- MPIDI_RMA_FUNC_ENTER(MPID_STATE_SET_USER_REQ_AFTER_ISSUING_OP);
-
- if (op->ureq == NULL)
- goto fn_exit;
-
- if (op->reqs_size == 0) {
- MPIU_Assert(op->single_req == NULL && op->multi_reqs == NULL);
- /* Sending is completed immediately, complete user request
- * and release ch3 ref. */
-
- /* Complete user request and release the ch3 ref */
- mpi_errno = MPID_Request_complete(op->ureq);
- if (mpi_errno != MPI_SUCCESS) {
- MPIU_ERR_POP(mpi_errno);
- }
- }
- else {
- MPID_Request **req_ptr = NULL;
-
- /* Sending is not completed immediately. */
-
- if (op->reqs_size == 1)
- req_ptr = &(op->single_req);
- else
- req_ptr = op->multi_reqs;
-
- for (i = 0; i < op->reqs_size; i++) {
- if (req_ptr[i] == NULL || MPID_Request_is_complete(req_ptr[i]))
- continue;
-
- /* Setup user request info in order to be completed following send request. */
- incomplete_req_cnt++;
- MPID_cc_set(&(op->ureq->cc), incomplete_req_cnt); /* increment CC counter */
-
- req_ptr[i]->dev.request_handle = op->ureq->handle;
-
- /* Setup user request completion handler.
- *
- * The handler is triggered when send request is completed at
- * following places:
- * - progress engine: complete PUT/ACC req.
- * - GET/GET_ACC packet handler: complete GET/GET_ACC reqs.
- *
- * TODO: implement stack for overriding functions*/
- req_ptr[i]->request_completed_cb = MPIDI_CH3_ReqHandler_ReqOpsComplete;
- } /* end of for loop */
-
- if (incomplete_req_cnt) {
- /* Increase ref for completion handler */
- MPIU_Object_add_ref(op->ureq);
- }
- else {
- /* all requests are completed */
- /* Complete user request and release ch3 ref */
- mpi_errno = MPID_Request_complete(op->ureq);
- if (mpi_errno != MPI_SUCCESS) {
- MPIU_ERR_POP(mpi_errno);
- }
- op->ureq = NULL;
- }
- }
-
- fn_exit:
- MPIDI_RMA_FUNC_EXIT(MPID_STATE_SET_USER_REQ_AFTER_ISSUING_OP);
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
-
#endif /* MPID_RMA_ISSUE_H_INCLUDED */
diff --git a/src/mpid/ch3/include/mpid_rma_oplist.h b/src/mpid/ch3/include/mpid_rma_oplist.h
index 5d84d6f..bc9fd90 100644
--- a/src/mpid/ch3/include/mpid_rma_oplist.h
+++ b/src/mpid/ch3/include/mpid_rma_oplist.h
@@ -21,6 +21,31 @@ extern MPIDI_RMA_Target_t *global_rma_target_pool_head, *global_rma_target_pool_
MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
+#define MPIDI_CH3I_RMA_Get_issued_list_ptr(target_, op_, list_ptr_, mpi_errno_) \
+ do { \
+ MPI_Datatype target_datatype_; \
+ MPIDI_CH3_PKT_RMA_GET_TARGET_DATATYPE((op_)->pkt, target_datatype_, mpi_errno_); \
+ if ((target_datatype_ != MPI_DATATYPE_NULL && \
+ !MPIR_DATATYPE_IS_PREDEFINED(target_datatype_)) || \
+ ((op_)->origin_datatype != MPI_DATATYPE_NULL && \
+ !MPIR_DATATYPE_IS_PREDEFINED((op_)->origin_datatype)) || \
+ ((op_)->result_datatype != MPI_DATATYPE_NULL && \
+ !MPIR_DATATYPE_IS_PREDEFINED((op_)->result_datatype))) { \
+ list_ptr_ = &((target_)->issued_dt_op_list_head); \
+ } \
+ else if ((op_)->pkt.type == MPIDI_CH3_PKT_PUT || \
+ (op_)->pkt.type == MPIDI_CH3_PKT_PUT_IMMED || \
+ (op_)->pkt.type == MPIDI_CH3_PKT_ACCUMULATE || \
+ (op_)->pkt.type == MPIDI_CH3_PKT_ACCUMULATE_IMMED) { \
+ list_ptr_ = &((target_)->issued_write_op_list_head); \
+ } \
+ else { \
+ list_ptr_ = &((target_)->issued_read_op_list_head); \
+ } \
+ } while (0)
+
+/* This macro returns two flags: local_completed and remote_completed,
+ * to indicate if the completion is reached on this target. */
#define MPIDI_CH3I_RMA_ops_completion(win_, target_, local_completed_, remote_completed_) \
do { \
local_completed_ = 0; \
@@ -39,6 +64,81 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
target_->sync.outstanding_acks == 0) \
remote_completed_ = 1; \
} \
+ \
+ if ((target_->sync.upgrade_flush_local && !remote_completed_) || \
+ (!target_->sync.upgrade_flush_local && !local_completed_)) { \
+ local_completed_ = 0; \
+ } \
+ else { \
+ local_completed_ = 1; \
+ } \
+ \
+ } while (0)
+
+
+/* This macro returns a flag: win_remote_completed, to indicate if
+ * the remote completion is reached on the entire window. */
+#define MPIDI_CH3I_RMA_ops_win_remote_completion(win_ptr_, win_remote_completed_) \
+ do { \
+ MPIDI_RMA_Target_t *win_target_ = NULL; \
+ int i_, num_targets_ = 0; \
+ int remote_completed_targets_ = 0; \
+ \
+ win_remote_completed_ = 0; \
+ \
+ for (i_ = 0; i_ < (win_ptr_)->num_slots; i_++) { \
+ for (win_target_ = (win_ptr_)->slots[i_].target_list_head; win_target_;) { \
+ int local_ ATTRIBUTE((unused)) = 0, remote_ = 0; \
+ \
+ num_targets_++; \
+ \
+ MPIDI_CH3I_RMA_ops_completion((win_ptr_), win_target_, local_, remote_); \
+ \
+ remote_completed_targets_ += remote_; \
+ \
+ win_target_ = win_target_->next; \
+ } \
+ } \
+ \
+ if (num_targets_ == remote_completed_targets_) \
+ win_remote_completed_ = 1; \
+ \
+ } while (0)
+
+/* This macro returns a flag: win_local_completed, to indicate if
+ * the local completion is reached on the entire window. */
+#define MPIDI_CH3I_RMA_ops_win_local_completion(win_ptr_, win_local_completed_) \
+ do { \
+ MPIDI_RMA_Target_t *win_target_ = NULL; \
+ int i_, total_remote_cnt_ = 0, total_local_cnt_ = 0; \
+ int remote_completed_targets_ = 0, local_completed_targets_ = 0; \
+ \
+ win_local_completed_ = 0; \
+ \
+ for (i_ = 0; i_ < (win_ptr_)->num_slots; i_++) { \
+ for (win_target_ = (win_ptr_)->slots[i_].target_list_head; win_target_;) { \
+ int local_ = 0, remote_ = 0; \
+ \
+ if (win_target_->sync.upgrade_flush_local) \
+ total_remote_cnt_++; \
+ else \
+ total_local_cnt_++; \
+ \
+ MPIDI_CH3I_RMA_ops_completion((win_ptr_), win_target_, local_, remote_); \
+ \
+ if (win_target_->sync.upgrade_flush_local) \
+ remote_completed_targets_ += remote_; \
+ else \
+ local_completed_targets_ += local_; \
+ \
+ win_target_ = win_target_->next; \
+ } \
+ } \
+ \
+ if (remote_completed_targets_ == total_remote_cnt_ && \
+ local_completed_targets_ == total_local_cnt_) \
+ win_local_completed_ = 1; \
+ \
} while (0)
/* MPIDI_CH3I_Win_op_alloc(): get a new op element from op pool and
@@ -75,6 +175,8 @@ static inline MPIDI_RMA_Op_t *MPIDI_CH3I_Win_op_alloc(MPID_Win * win_ptr)
e->origin_datatype = MPI_DATATYPE_NULL;
e->result_datatype = MPI_DATATYPE_NULL;
+ e->ref_cnt = 0;
+
return e;
}
@@ -88,6 +190,10 @@ static inline int MPIDI_CH3I_Win_op_free(MPID_Win * win_ptr, MPIDI_RMA_Op_t * e)
{
int mpi_errno = MPI_SUCCESS;
+ if (e->multi_reqs != NULL) {
+ MPIU_Free(e->multi_reqs);
+ }
+
/* We enqueue elements to the right pool, so when they get freed
* at window free time, they won't conflict with the global pool
* or other windows */
@@ -333,193 +439,6 @@ static inline int MPIDI_CH3I_Win_target_dequeue_and_free(MPID_Win * win_ptr, MPI
goto fn_exit;
}
-
-#undef FUNCNAME
-#define FUNCNAME MPIDI_CH3I_RMA_Cleanup_ops_target
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static inline int MPIDI_CH3I_RMA_Cleanup_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * target)
-{
- MPIDI_RMA_Op_t *curr_op = NULL;
- MPIDI_RMA_Op_t **op_list_head = NULL;
- int read_flag = 0, write_flag = 0;
- int mpi_errno = MPI_SUCCESS;
- int i;
-
- if (win_ptr->states.access_state == MPIDI_RMA_FENCE_ISSUED ||
- win_ptr->states.access_state == MPIDI_RMA_PSCW_ISSUED ||
- win_ptr->states.access_state == MPIDI_RMA_LOCK_ALL_ISSUED)
- goto fn_exit;
-
- if (target == NULL)
- goto fn_exit;
-
- if (target->access_state == MPIDI_RMA_LOCK_CALLED ||
- target->access_state == MPIDI_RMA_LOCK_ISSUED)
- goto fn_exit;
-
- if (target->pending_op_list_head == NULL &&
- target->issued_read_op_list_head == NULL && target->issued_write_op_list_head == NULL &&
- target->issued_dt_op_list_head == NULL)
- goto fn_exit;
-
- /* go over issued_read_op_list, issued_write_op_list,
- * issued_dt_op_list, start from issued_read_op_list. */
- op_list_head = &(target->issued_read_op_list_head);
- read_flag = 1;
-
- curr_op = *op_list_head;
- while (1) {
- if (curr_op != NULL) {
- int completed = 0;
-
- MPIU_Assert(curr_op->reqs_size > 0);
- if (curr_op->reqs_size == 1) {
- /* single_req is used */
-
- if (MPID_Request_is_complete(curr_op->single_req)) {
- /* If there's an error, return it */
- mpi_errno = curr_op->single_req->status.MPI_ERROR;
- MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
-
- /* No errors, free the request */
- MPID_Request_release(curr_op->single_req);
-
- curr_op->single_req = NULL;
-
- win_ptr->active_req_cnt--;
-
- completed = 1;
- }
- else
- break;
- }
- else {
- /* multi_reqs is used */
- for (i = 0; i < curr_op->reqs_size; i++) {
- if (curr_op->multi_reqs[i] == NULL)
- continue;
-
- if (MPID_Request_is_complete(curr_op->multi_reqs[i])) {
- /* If there's an error, return it */
- mpi_errno = curr_op->multi_reqs[i]->status.MPI_ERROR;
- MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
-
- /* No errors, free the request */
- MPID_Request_release(curr_op->multi_reqs[i]);
-
- curr_op->multi_reqs[i] = NULL;
-
- win_ptr->active_req_cnt--;
- }
- else
- break;
- }
-
- if (i == curr_op->reqs_size)
- completed = 1;
- }
-
- if (completed) {
- /* Release user request */
- if (curr_op->ureq) {
- /* User request must be completed by progress engine */
- MPIU_Assert(MPID_Request_is_complete(curr_op->ureq));
-
- /* Release the ch3 ref */
- MPID_Request_release(curr_op->ureq);
- }
-
- if (curr_op->reqs_size == 1) {
- curr_op->single_req = NULL;
- }
- else {
- /* free request array in op struct */
- MPIU_Free(curr_op->multi_reqs);
- curr_op->multi_reqs = NULL;
- }
- curr_op->reqs_size = 0;
-
- /* dequeue the operation and free it */
- MPL_DL_DELETE(*op_list_head, curr_op);
- MPIDI_CH3I_Win_op_free(win_ptr, curr_op);
- }
- else
- break;
- }
- else {
- /* current op ptr reaches NULL, move on to the next list */
- if (read_flag == 1) {
- read_flag = 0;
- op_list_head = &(target->issued_write_op_list_head);
- write_flag = 1;
- }
- else if (write_flag == 1) {
- write_flag = 0;
- op_list_head = &(target->issued_dt_op_list_head);
- }
- else {
- /* we reach the tail of the last operation list (dt_op_list),
- * break out. */
- break;
- }
- }
-
- /* next op */
- curr_op = *op_list_head;
- }
-
- fn_exit:
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
-
-
-#undef FUNCNAME
-#define FUNCNAME MPIDI_CH3I_RMA_Cleanup_ops_win
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static inline int MPIDI_CH3I_RMA_Cleanup_ops_win(MPID_Win * win_ptr,
- int *local_completed, int *remote_completed)
-{
- MPIDI_RMA_Target_t *target = NULL;
- int num_targets = 0, local_completed_targets = 0, remote_completed_targets = 0;
- int i, mpi_errno = MPI_SUCCESS;
-
- (*local_completed) = 0;
- (*remote_completed) = 0;
-
- for (i = 0; i < win_ptr->num_slots; i++) {
- for (target = win_ptr->slots[i].target_list_head; target;) {
- int local = 0, remote = 0;
-
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_target(win_ptr, target);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
- MPIDI_CH3I_RMA_ops_completion(win_ptr, target, local, remote);
-
- num_targets++;
- local_completed_targets += local;
- remote_completed_targets += remote;
-
- target = target->next;
- }
- }
-
- if (num_targets == local_completed_targets)
- (*local_completed) = 1;
- if (num_targets == remote_completed_targets)
- (*remote_completed) = 1;
-
- fn_exit:
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
-
-
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_RMA_Cleanup_targets_win
#undef FCNAME
@@ -554,7 +473,6 @@ static inline int MPIDI_CH3I_RMA_Cleanup_targets_win(MPID_Win * win_ptr)
static inline int MPIDI_CH3I_Win_get_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t ** e)
{
MPIDI_RMA_Op_t *new_ptr = NULL;
- int local_completed = 0, remote_completed = 0;
int mpi_errno = MPI_SUCCESS;
while (1) {
@@ -564,10 +482,6 @@ static inline int MPIDI_CH3I_Win_get_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t ** e)
if (new_ptr != NULL)
break;
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed, &remote_completed);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_alloc);
new_ptr = MPIDI_CH3I_Win_op_alloc(win_ptr);
MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_alloc);
diff --git a/src/mpid/ch3/include/mpid_rma_types.h b/src/mpid/ch3/include/mpid_rma_types.h
index ba664b1..4beb3bb 100644
--- a/src/mpid/ch3/include/mpid_rma_types.h
+++ b/src/mpid/ch3/include/mpid_rma_types.h
@@ -60,6 +60,8 @@ typedef struct MPIDI_RMA_Op {
* when < 0, it means all stream units of this operation haven been issued. */
MPID_Request *ureq;
+
+ int ref_cnt;
} MPIDI_RMA_Op_t;
typedef struct MPIDI_RMA_Target {
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index 8f6c7e3..0f7f2f4 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -1872,8 +1872,8 @@ int MPIDI_CH3_ReqHandler_CASSendComplete( MPIDI_VC_t *, MPID_Request *,
int * );
int MPIDI_CH3_ReqHandler_FOPSendComplete( MPIDI_VC_t *, MPID_Request *,
int * );
-/* Request-based operation handler */
-int MPIDI_CH3_ReqHandler_ReqOpsComplete(MPID_Request *);
+/* RMA operation request handler */
+int MPIDI_CH3_Req_handler_rma_op_complete(MPID_Request *);
/* RMA Synchronization request handler */
int MPIDI_CH3_Req_handler_rma_sync_complete(MPID_Request *);
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 2f7d3ea..d4a7161 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -451,6 +451,8 @@ typedef struct MPIDI_Request {
* and freed when release request. */
MPIDI_msg_sz_t ext_hdr_sz;
+ struct MPIDI_RMA_Op *rma_op_ptr;
+
MPIDI_REQUEST_SEQNUM
/* Occasionally, when a message cannot be sent, we need to cache the
diff --git a/src/mpid/ch3/src/ch3u_handle_op_req.c b/src/mpid/ch3/src/ch3u_handle_op_req.c
index 822cea4..4315cf8 100644
--- a/src/mpid/ch3/src/ch3u_handle_op_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_op_req.c
@@ -7,33 +7,81 @@
#include "mpidimpl.h"
#include "mpidrma.h"
-/* Note the the following function is called when request-based RMA operation
- is completed at origin side. Here we complete the user request associated
- with this request-based operation. */
+
#undef FUNCNAME
-#define FUNCNAME MPIDI_CH3_ReqHandler_ReqOpsComplete
+#define FUNCNAME MPIDI_CH3_Req_handler_rma_op_complete
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPIDI_CH3_ReqHandler_ReqOpsComplete(MPID_Request * sreq)
+int MPIDI_CH3_Req_handler_rma_op_complete(MPID_Request * sreq)
{
- int mpi_errno = MPI_SUCCESS;
+ int i, mpi_errno = MPI_SUCCESS;
MPID_Request *ureq = NULL;
+ MPIDI_RMA_Op_t *op = NULL;
+ MPID_Win *win_ptr = NULL;
+
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQ_HANDLER_RMA_OP_COMPLETE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQ_HANDLER_RMA_OP_COMPLETE);
+
+ /* get window, decrement active request cnt on window */
+ MPID_Win_get_ptr(sreq->dev.source_win_handle, win_ptr);
+ MPIU_Assert(win_ptr != NULL);
+ win_ptr->active_req_cnt--;
+
+ if (sreq->dev.request_handle != MPI_REQUEST_NULL) {
+ /* get user request */
+ MPID_Request_get_ptr(sreq->dev.request_handle, ureq);
+ mpi_errno = MPID_Request_complete(ureq);
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIU_ERR_POP(mpi_errno);
+ }
+ }
+
+ op = sreq->dev.rma_op_ptr;
+ /* Note: if rma_op_ptr is NULL, it means the operation
+ * is freed before the completion. */
+ if (op != NULL) {
+ /* Mark this request as NULL in the operation struct,
+ * so that when operation is freed before completion,
+ * the operation do not need to try to notify this
+ * request which is already completed. */
+ if (op->reqs_size == 1) {
+ MPIU_Assert(op->single_req->handle == sreq->handle);
+ op->single_req = NULL;
+ }
+ else {
+ for (i = 0; i < op->reqs_size; i++) {
+ if (op->multi_reqs[i] == NULL)
+ continue;
+ else if (op->multi_reqs[i]->handle == sreq->handle) {
+ op->multi_reqs[i] = NULL;
+ break;
+ }
+ }
+ }
+
+ op->ref_cnt--;
+ MPIU_Assert(op->ref_cnt >= 0);
+ if (op->ref_cnt == 0) {
+ MPIDI_RMA_Target_t *target = NULL;
+ MPIDI_RMA_Op_t **list_ptr = NULL;
- MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_REQOPSCOMPLETE);
- MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_REQOPSCOMPLETE);
+ mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, op->target_rank, &target);
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIU_ERR_POP(mpi_errno);
+ }
+ MPIU_Assert(target != NULL);
- MPID_Request_get_ptr(sreq->dev.request_handle, ureq);
- MPIU_Assert(ureq != NULL);
+ MPIDI_CH3I_RMA_Get_issued_list_ptr(target, op, list_ptr, mpi_errno);
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIU_ERR_POP(mpi_errno);
+ }
- /* Complete user request and release ref of completion handler.
- * Note that ch3 ref is released by later clean_up call. */
- mpi_errno = MPID_Request_complete(ureq);
- if (mpi_errno != MPI_SUCCESS) {
- MPIU_ERR_POP(mpi_errno);
+ MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, list_ptr, op);
+ }
}
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_REQHANDLER_REQOPSCOMPLETE);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_REQ_HANDLER_RMA_OP_COMPLETE);
return mpi_errno;
fn_fail:
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index db8c7f1..94dbb91 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -100,6 +100,7 @@ MPID_Request * MPID_Request_create(void)
req->dev.tmpbuf = NULL;
req->dev.ext_hdr_ptr = NULL;
req->dev.ext_hdr_sz = 0;
+ req->dev.rma_op_ptr = NULL;
req->dev.request_handle = MPI_REQUEST_NULL;
#ifdef MPIDI_CH3_REQUEST_INIT
MPIDI_CH3_REQUEST_INIT(req);
diff --git a/src/mpid/ch3/src/ch3u_rma_ops.c b/src/mpid/ch3/src/ch3u_rma_ops.c
index 2d2ea4b..65a2eb0 100644
--- a/src/mpid/ch3/src/ch3u_rma_ops.c
+++ b/src/mpid/ch3/src/ch3u_rma_ops.c
@@ -194,11 +194,6 @@ int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
- int local_completed = 0, remote_completed = 0;
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed,
- &remote_completed);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
mpi_errno = poke_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
@@ -368,11 +363,6 @@ int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
- int local_completed = 0, remote_completed = 0;
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed,
- &remote_completed);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
mpi_errno = poke_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
@@ -584,11 +574,6 @@ int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatyp
if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
- int local_completed = 0, remote_completed = 0;
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed,
- &remote_completed);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
mpi_errno = poke_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
@@ -841,11 +826,6 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
- int local_completed = 0, remote_completed = 0;
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed,
- &remote_completed);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
mpi_errno = poke_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
@@ -1093,11 +1073,6 @@ int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
- int local_completed = 0, remote_completed = 0;
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed,
- &remote_completed);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
mpi_errno = poke_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
@@ -1240,11 +1215,6 @@ int MPID_Fetch_and_op(const void *origin_addr, void *result_addr,
if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 &&
win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) {
- int local_completed = 0, remote_completed = 0;
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed,
- &remote_completed);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
mpi_errno = poke_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c
index da604d4..6ab1c8f 100644
--- a/src/mpid/ch3/src/ch3u_rma_progress.c
+++ b/src/mpid/ch3/src/ch3u_rma_progress.c
@@ -309,6 +309,84 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
#undef FUNCNAME
+#define FUNCNAME check_and_set_req_completion
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+static inline int check_and_set_req_completion(MPID_Win * win_ptr, MPIDI_RMA_Target_t * target,
+ MPIDI_RMA_Op_t * rma_op, int *op_completed)
+{
+ int i, mpi_errno = MPI_SUCCESS;
+ MPID_Request **req = NULL;
+ MPIDI_STATE_DECL(MPID_STATE_CHECK_AND_SET_REQ_COMPLETION);
+
+ MPIDI_RMA_FUNC_ENTER(MPID_STATE_CHECK_AND_SET_REQ_COMPLETION);
+
+ (*op_completed) = FALSE;
+
+ if (rma_op->reqs_size > 0) {
+ for (i = 0; i < rma_op->reqs_size; i++) {
+ if (rma_op->reqs_size == 1)
+ req = &(rma_op->single_req);
+ else
+ req = &(rma_op->multi_reqs[i]);
+
+ if ((*req) == NULL)
+ continue;
+
+ if (MPID_Request_is_complete((*req))) {
+ MPID_Request_release((*req));
+ (*req) = NULL;
+ }
+ else {
+ MPID_Request_release((*req));
+ (*req)->request_completed_cb = MPIDI_CH3_Req_handler_rma_op_complete;
+ (*req)->dev.source_win_handle = win_ptr->handle;
+ (*req)->dev.rma_op_ptr = rma_op;
+
+ rma_op->ref_cnt++;
+
+ if (rma_op->ureq != NULL) {
+ MPID_cc_set(&(rma_op->ureq->cc), rma_op->ref_cnt);
+ (*req)->dev.request_handle = rma_op->ureq->handle;
+ }
+ }
+ }
+ }
+
+ if (rma_op->ref_cnt == 0) {
+ if (rma_op->ureq != NULL) {
+ mpi_errno = MPID_Request_complete(rma_op->ureq);
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIU_ERR_POP(mpi_errno);
+ }
+ }
+ MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list_head), rma_op);
+
+ (*op_completed) = TRUE;
+ }
+ else {
+ MPIDI_RMA_Op_t **list_ptr = NULL;
+
+ MPIDI_CH3I_RMA_Get_issued_list_ptr(target, rma_op, list_ptr, mpi_errno);
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIU_ERR_POP(mpi_errno);
+ }
+
+ MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_op_list_head), rma_op);
+ MPIDI_CH3I_RMA_Ops_append(list_ptr, rma_op);
+
+ win_ptr->active_req_cnt += rma_op->ref_cnt;
+ }
+
+ fn_exit:
+ MPIDI_RMA_FUNC_EXIT(MPID_STATE_CHECK_AND_SET_REQ_COMPLETION);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+
+#undef FUNCNAME
#define FUNCNAME issue_ops_target
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
@@ -327,6 +405,7 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
/* Issue out operations in the list. */
curr_op = target->next_op_to_issue;
while (curr_op != NULL) {
+ int op_completed = FALSE;
if (target->access_state == MPIDI_RMA_LOCK_ISSUED) {
/* It is possible that the previous OP+LOCK changes
@@ -403,24 +482,6 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
* PUT/ACC operation. */
}
- if ((curr_op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE ||
- curr_op->pkt.type == MPIDI_CH3_PKT_GET_ACCUM) &&
- curr_op->issued_stream_count != ALL_STREAM_UNITS_ISSUED) {
- /* For ACC-like operations, if not all stream units
- * are issued out, we stick to the current operation,
- * otherwise we move on to the next operation. */
- target->next_op_to_issue = curr_op;
- }
- else
- target->next_op_to_issue = curr_op->next;
-
- if (target->next_op_to_issue == NULL) {
- if (flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH || flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
- /* We are done with ending sync, unset target's sync_flag. */
- target->sync.sync_flag = MPIDI_RMA_SYNC_NONE;
- }
- }
-
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_EXCLUSIVE) {
/* If this operation is piggybacked with LOCK,
@@ -430,63 +491,28 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
break;
}
- if (curr_op->ureq != NULL) {
- mpi_errno = set_user_req_after_issuing_op(curr_op);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
- }
-
- if (curr_op->reqs_size == 0) {
- MPIU_Assert(curr_op->single_req == NULL && curr_op->multi_reqs == NULL);
- /* Sending is completed immediately. */
- MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list_head), curr_op);
- }
- else {
- MPI_Datatype target_datatype;
- int is_derived = FALSE;
-
- /* Sending is not completed immediately. */
+ target->next_op_to_issue = curr_op->next;
- MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_op_list_head), curr_op);
-
- MPIDI_CH3_PKT_RMA_GET_TARGET_DATATYPE(curr_op->pkt, target_datatype, mpi_errno);
-
- if ((target_datatype != MPI_DATATYPE_NULL &&
- !MPIR_DATATYPE_IS_PREDEFINED(target_datatype)) ||
- (curr_op->origin_datatype != MPI_DATATYPE_NULL &&
- !MPIR_DATATYPE_IS_PREDEFINED(curr_op->origin_datatype)) ||
- (curr_op->result_datatype != MPI_DATATYPE_NULL &&
- !MPIR_DATATYPE_IS_PREDEFINED(curr_op->result_datatype))) {
- is_derived = TRUE;
- }
-
- if (is_derived) {
- MPIDI_CH3I_RMA_Ops_append(&(target->issued_dt_op_list_head), curr_op);
- }
- else if (curr_op->pkt.type == MPIDI_CH3_PKT_PUT ||
- curr_op->pkt.type == MPIDI_CH3_PKT_PUT_IMMED ||
- curr_op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE ||
- curr_op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE_IMMED) {
- MPIDI_CH3I_RMA_Ops_append(&(target->issued_write_op_list_head), curr_op);
- }
- else {
- MPIDI_CH3I_RMA_Ops_append(&(target->issued_read_op_list_head), curr_op);
+ if (target->next_op_to_issue == NULL) {
+ if (flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH || flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
+ /* We are done with ending sync, unset target's sync_flag. */
+ target->sync.sync_flag = MPIDI_RMA_SYNC_NONE;
}
+ }
+ mpi_errno = check_and_set_req_completion(win_ptr, target, curr_op, &op_completed);
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIU_ERR_POP(mpi_errno);
+ }
+ if (op_completed == FALSE) {
/* Poke the progress engine when next_op_to_issue is not the current OP, in
* order to make sure the issuing function is re-entrant safe. */
if (target->next_op_to_issue != curr_op &&
win_ptr->active_req_cnt > MPIR_CVAR_CH3_RMA_POKE_PROGRESS_REQ_THRESHOLD) {
- int local_completed, remote_completed;
mpi_errno = poke_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
-
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed,
- &remote_completed);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
}
}
@@ -622,27 +648,21 @@ int MPIDI_CH3I_RMA_Free_ops_before_completion(MPID_Win * win_ptr)
/* free all ops in the list since we do not need to maintain them anymore */
while (1) {
if (curr_op != NULL) {
+ /* Here we mark the operation pointer in the request
+ * as NULL, so that when request is completed, it will
+ * not try to free this operation. */
if (curr_op->reqs_size == 1) {
MPIU_Assert(curr_op->single_req != NULL);
- MPID_Request_release(curr_op->single_req);
- curr_op->single_req = NULL;
- win_ptr->active_req_cnt--;
- curr_op->reqs_size = 0;
+ curr_op->single_req->dev.rma_op_ptr = NULL;
}
- else if (curr_op->reqs_size > 1) {
+ else {
+ MPIU_Assert(curr_op->reqs_size > 1);
MPIU_Assert(curr_op->multi_reqs != NULL);
for (i = 0; i < curr_op->reqs_size; i++) {
if (curr_op->multi_reqs[i] != NULL) {
- MPID_Request_release(curr_op->multi_reqs[i]);
- curr_op->multi_reqs[i] = NULL;
- win_ptr->active_req_cnt--;
+ curr_op->multi_reqs[i]->dev.rma_op_ptr = NULL;
}
}
-
- /* free req array in this op */
- MPIU_Free(curr_op->multi_reqs);
- curr_op->multi_reqs = NULL;
- curr_op->reqs_size = 0;
}
MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, op_list_head, curr_op);
}
@@ -707,10 +727,6 @@ int MPIDI_CH3I_RMA_Cleanup_ops_aggressive(MPID_Win * win_ptr)
/* Wait for local completion. */
do {
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_target(win_ptr, curr_target);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
MPIDI_CH3I_RMA_ops_completion(win_ptr, curr_target, local_completed, remote_completed);
if (!local_completed) {
@@ -788,10 +804,6 @@ int MPIDI_CH3I_RMA_Cleanup_target_aggressive(MPID_Win * win_ptr, MPIDI_RMA_Targe
/* Wait for remote completion. */
do {
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_target(win_ptr, curr_target);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
MPIDI_CH3I_RMA_ops_completion(win_ptr, curr_target, local_completed, remote_completed);
if (!remote_completed) {
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index e124931..cd6c415 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -332,10 +332,8 @@ void MPIDI_CH3_RMA_Init_sync_pvars(void)
static inline int flush_local_all(MPID_Win * win_ptr)
{
int i, made_progress = 0;
+ int local_completed = 0;
MPIDI_RMA_Target_t *curr_target = NULL;
- int local_completed = 0, remote_completed = 0;
- int total_remote_complete_cnt = 0, total_local_complete_cnt = 0;
- int curr_remote_complete_cnt = 0, curr_local_complete_cnt = 0;
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_FLUSH_LOCAL_ALL);
@@ -349,13 +347,11 @@ static inline int flush_local_all(MPID_Win * win_ptr)
if (curr_target->sync.sync_flag < MPIDI_RMA_SYNC_FLUSH) {
curr_target->sync.sync_flag = MPIDI_RMA_SYNC_FLUSH;
}
- total_remote_complete_cnt++;
}
else {
if (curr_target->sync.sync_flag < MPIDI_RMA_SYNC_FLUSH_LOCAL) {
curr_target->sync.sync_flag = MPIDI_RMA_SYNC_FLUSH_LOCAL;
}
- total_local_complete_cnt++;
}
curr_target = curr_target->next;
@@ -370,39 +366,14 @@ static inline int flush_local_all(MPID_Win * win_ptr)
/* wait for remote completion for those targets that disable flush_local,
* and wait for local completion for other targets */
do {
- curr_local_complete_cnt = 0, curr_remote_complete_cnt = 0;
- for (i = 0; i < win_ptr->num_slots; i++) {
- curr_target = win_ptr->slots[i].target_list_head;
- while (curr_target != NULL) {
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_target(win_ptr, curr_target);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
- MPIDI_CH3I_RMA_ops_completion(win_ptr, curr_target, local_completed,
- remote_completed);
-
- if (curr_target->sync.upgrade_flush_local) {
- if (remote_completed) {
- curr_remote_complete_cnt++;
- }
- }
- else {
- if (local_completed) {
- curr_local_complete_cnt++;
- }
- }
- curr_target = curr_target->next;
- }
- }
+ MPIDI_CH3I_RMA_ops_win_local_completion(win_ptr, local_completed);
- if (curr_remote_complete_cnt < total_remote_complete_cnt ||
- curr_local_complete_cnt < total_local_complete_cnt) {
+ if (!local_completed) {
mpi_errno = wait_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
}
- } while (curr_remote_complete_cnt < total_remote_complete_cnt ||
- curr_local_complete_cnt < total_local_complete_cnt);
+ } while (!local_completed);
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_FLUSH_LOCAL_ALL);
@@ -420,7 +391,7 @@ static inline int flush_local_all(MPID_Win * win_ptr)
static inline int flush_all(MPID_Win * win_ptr)
{
int i, made_progress = 0;
- int local_completed = 0, remote_completed = 0;
+ int remote_completed = 0;
MPIDI_RMA_Target_t *curr_target = NULL;
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_FLUSH_ALL);
@@ -446,9 +417,7 @@ static inline int flush_all(MPID_Win * win_ptr)
/* Wait for remote completion. */
do {
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed, &remote_completed);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
+ MPIDI_CH3I_RMA_ops_win_remote_completion(win_ptr, remote_completed);
if (!remote_completed) {
mpi_errno = wait_progress_engine();
if (mpi_errno != MPI_SUCCESS)
@@ -1267,10 +1236,6 @@ int MPID_Win_unlock(int dest, MPID_Win * win_ptr)
/* Wait for remote completion. */
do {
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_target(win_ptr, target);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
MPIDI_CH3I_RMA_ops_completion(win_ptr, target, local_completed, remote_completed);
if (!remote_completed) {
@@ -1377,10 +1342,6 @@ int MPID_Win_flush(int dest, MPID_Win * win_ptr)
/* Wait for remote completion. */
do {
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_target(win_ptr, target);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
MPIDI_CH3I_RMA_ops_completion(win_ptr, target, local_completed, remote_completed);
if (!remote_completed) {
@@ -1426,7 +1387,7 @@ int MPID_Win_flush(int dest, MPID_Win * win_ptr)
int MPID_Win_flush_local(int dest, MPID_Win * win_ptr)
{
int made_progress = 0;
- int local_completed = 0, remote_completed = 0;
+ int local_completed = 0, remote_completed ATTRIBUTE((unused)) = 0;
int rank = win_ptr->comm_ptr->rank;
MPIDI_RMA_Target_t *target = NULL;
int mpi_errno = MPI_SUCCESS;
@@ -1483,20 +1444,14 @@ int MPID_Win_flush_local(int dest, MPID_Win * win_ptr)
/* Wait for local completion. */
do {
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_target(win_ptr, target);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
-
MPIDI_CH3I_RMA_ops_completion(win_ptr, target, local_completed, remote_completed);
- if ((target->sync.upgrade_flush_local && !remote_completed) ||
- (!target->sync.upgrade_flush_local && !local_completed)) {
+ if (!local_completed) {
mpi_errno = wait_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
}
- } while ((target->sync.upgrade_flush_local && !remote_completed) ||
- (!target->sync.upgrade_flush_local && !local_completed));
+ } while (!local_completed);
finish_flush_local:
if (target != NULL) {
@@ -1603,7 +1558,7 @@ int MPID_Win_lock_all(int assert, MPID_Win * win_ptr)
int MPID_Win_unlock_all(MPID_Win * win_ptr)
{
int i, made_progress = 0;
- int local_completed = 0, remote_completed = 0;
+ int remote_completed = 0;
int rank = win_ptr->comm_ptr->rank;
MPIDI_RMA_Target_t *curr_target = NULL;
enum MPIDI_RMA_sync_types sync_flag;
@@ -1703,9 +1658,7 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr)
/* Wait for remote completion. */
do {
- mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed, &remote_completed);
- if (mpi_errno != MPI_SUCCESS)
- MPIU_ERR_POP(mpi_errno);
+ MPIDI_CH3I_RMA_ops_win_remote_completion(win_ptr, remote_completed);
if (!remote_completed) {
mpi_errno = wait_progress_engine();
if (mpi_errno != MPI_SUCCESS)
http://git.mpich.org/mpich.git/commitdiff/3835f6012fce888b9ac4648f708b91ba4…
commit 3835f6012fce888b9ac4648f708b91ba449b0944
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Fri Jul 24 09:27:05 2015 -0500
Add initialization of request_handle in the request object.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index 53230f1..db8c7f1 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -100,6 +100,7 @@ MPID_Request * MPID_Request_create(void)
req->dev.tmpbuf = NULL;
req->dev.ext_hdr_ptr = NULL;
req->dev.ext_hdr_sz = 0;
+ req->dev.request_handle = MPI_REQUEST_NULL;
#ifdef MPIDI_CH3_REQUEST_INIT
MPIDI_CH3_REQUEST_INIT(req);
#endif
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/include/mpid_rma_issue.h | 151 +--------------
src/mpid/ch3/include/mpid_rma_oplist.h | 349 ++++++++++++--------------------
src/mpid/ch3/include/mpid_rma_types.h | 10 +-
src/mpid/ch3/include/mpidimpl.h | 4 +-
src/mpid/ch3/include/mpidpkt.h | 35 ++++
src/mpid/ch3/include/mpidpre.h | 7 +-
src/mpid/ch3/include/mpidrma.h | 159 +++++++--------
src/mpid/ch3/src/ch3u_handle_op_req.c | 80 ++++++--
src/mpid/ch3/src/ch3u_request.c | 2 +
src/mpid/ch3/src/ch3u_rma_ops.c | 30 ---
src/mpid/ch3/src/ch3u_rma_progress.c | 218 +++++++++++----------
src/mpid/ch3/src/ch3u_rma_sync.c | 96 ++-------
src/mpid/ch3/src/mpid_rma.c | 14 +-
src/mpid/ch3/src/mpidi_rma.c | 7 +-
14 files changed, 459 insertions(+), 703 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository annotated tag, v3.2b4, created. v3.2b4
by noreply@mpich.org 24 Jul '15
by noreply@mpich.org 24 Jul '15
24 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 annotated tag, v3.2b4 has been created
at 978d7ba7212d14d6399733459c982151545745c8 (tag)
tagging b5099d559d6c2a406d3b875b054c288c7e306bc7 (commit)
replaces v3.2b3
tagged by Pavan Balaji
on Fri Jul 24 23:20:25 2015 -0500
- Log -----------------------------------------------------------------
tagging 'v3.2b4'
Antonio J. Pena (3):
netmod/portals4: Enforce ordering in RMA
Moved MPIDI_QUOTE to MPIU_QUOTE
Moved MPIU_RMA_CALL to MPIR_RMA_CALL
Antonio Pena Monferrer (3):
netmod/portals4: Use persistent ME in RMA
netmod/portals4: Remove unused field in netmod req
Fix a bug in GENERIC_Q_SEARCH_REMOVE + empty queue
Charles J Archer (4):
OFI Netmod: Improve *msg functionality and fix bugs
Progress registration fixup for pamid device
OFI Netmod: Use max port name for maximum bound address length
OFI Netmod: Temporary VC fixes for spawn tests
Hajime Fujita (6):
Remove HAVE_GPID_ROUTINES macro
Cleanup: MPIDI_RMA_* prototypes must be private
Cleanup: MPIR_Rank_t should be MPIDI_Rank_t
Cleanup: Nemesis-specific symbols must begin with MPIDI
Cleanup: Move Nemesis-internal prototypes to impl.h
Remove MPID_TimerStateBegin/End functions
Halim Amer (8):
Fixed several issues related to Ibsend
Mark the failing send cancel related tests as xfail
Test send cancellation issues with unmatched sends
Added tests to stream ACC-like RMA ops
Added a code cleanup script
Marked the multithreaded commu_idup test as xfail
Promote the count argument to MPI_Aint in some send routines
Advise against using sleeping routines to implement the yield functionality
Huiwei Lu (8):
Change MPI_Comm_idup test to be more strict
Fixing multiple MPI_COMM_IDUPs in the same communicator
Remove xfail for ticket 2269
Mark comm_idup_comm as xfail
Mark threaded MPI_COMM_IDUP tests as xfail
Adds tests for threaded collective operations
Fixing testlist for threads/coll
Remove xfail for MPI_Comm_idup
Jithin Jose (2):
Handle error-event for fi_cancel
OFI-Netmod - Handle error event for truncated message
Junchao Zhang (18):
bug fix and add @WRAPPER_LDFLAGS@ to final_ldflags
Increase MAX_F90_TYPES to 64
Add a progress hook mechanism to ch3 and nemesis
Add a progress hook mechanism to sock
Add a progress hook mechanism to pamid
Fix typos in an F08 test
Move (P)MPI_Aint_add/diff up before (P)MPI_T
Add prototypes of MPI_Aint_add/diff to the F90 mpi module
Add a mechanism to remove F77 only lines in f77to90 translation
Move MPI dataypes out of array initialization
Add more cases to generate var intracommunicators
Renamed routine TestIntercomm, moved it to mtest.c
Test for multithreaded idup overlapped with nbc.
Mark idup_nb.c as xfail
Do not do testing on null communicators
Mmultithreaded test to overlap idups with comm gen-functions
Remove xfail for idup_comm_gen
Mark idup_comm_gen with xfail=ticket2286
Ken Raffenetti (15):
update CHANGES to reflect the MPI-3.1 standard
netmod/portals4: fix bug in setting count
added CHANGES note about support for OFI
answer FIXME in comment for MPIDI_CH3U_Recvq_FDU
netmod/portals4: remove unused variable
netmod/portals4: fix per target event counting
netmod/portals4: use separate EQ for flow control handling
netmod/portals4: remove packing utility functions
netmod/portals4: cleanup usage of unused variable
netmod/portals4: build on persistent GET ME design
netmod/portals4: remove unused variables
ch3: revert accidental change of context_offset type
netmod/portals4: update format specifiers
portals4: use dummy buffer for NULL send/recv
tsuite: increate epochtest timeout
Lena Oden (18):
Check if type_tag is agnostic to modifiers.
Add a isend-irecv test for multiple processors
Handling of discard connection to avoid reconnect
Close remainig conns before sockset is destroyed
remove a wrong colon
Add new comm_idup test: overlap with iallreduce
Add new test to overlab comm_idup with nb-coll.
Mark new comm_idup tests as xfail
New comm_idup test, overlap with isend/irecv
Add a test to test overlapping Comm_idup with other comm. gen functions
Fix memory leaks in test/mpi/comm/comm_idup_nb
Add test for non-blocking collectives for intercom
Bugfix for MPI_Ibarrier for inter_communicators
Bugfix for MPI_Iallgather for intercommunicators.
Remove xfail, since #2284 is fixed
Fixes test/mpi/comm/comm_idup_comm
Add initialization for own_mask.
Remove xfail for test/mpi/comm/comm_idup_comm
Masamichi Takagi (5):
Add Hatanaka version of MTR netmod files (tofu/*)
Add errnames.txt for the Tofu netmod
Implementing the Tofu netmod
Add entries in errnames.txt
Rename from match field of LLC_cmd_t to tag
Massa. Hatanaka (1):
Bug Fixes for netmod-llc
Michael Blocksome (1):
Move the PAMID GPID routines from mpidpre.h to mpidpost.h
Min Si (10):
Move outstanding_acks increment to flush sending step.
Always free issued OPs when window resource is used up.
Expose AM flush ordering and issue per OP flush if unordered.
Bugfix: free internal req object in fn_fail.
Redefined RMA extended packet header in CH3 layer.
Fixed bug in atomic read-modify-write FOP/GACC/CAS tests.
Added test to check remote completion of RMA+flush.
Rewrote MTest collective wrapper routine.
Replace @PERL@ in maint/ with "/usr/bin/env perl".
Replace hard coded perl path with @PERL@.
Norio Yamaguchi (25):
Fix update request status after receiving data
Fix the buffer address for send/recv
Add memory release operation
Time trace with rdtsc
Wait until all UNSOLICITED are done
Revert "Time trace with rdtsc"
Fix for SC14
Fix memory leak
Disable dependence on libmemcached
Implement tag matching for ANY_SOURCE and ANY_TAG
Implement iprobe and improbe in netmod-tofu
Implement issend in netmod-tofu
Override rsend and irsend
x86 don't care 8byte alignment in llctofu_poll
Modify some functions for RMA
Fix implementation when receiving a event
Delete debug code
Fix conversion from LLC rank to MPI rank
Revert "Override rsend and irsend"
Add cancel_recv function
Override rsend and irsend
Fix build warnings in netmod-tofu
Handle TARGET_PROC_FAIL event
Avoid optimization when compiling with O2
Delete incorrect decrement
Norio yamaguchi (1):
Performance : allocate a memory for a command and vectors at once
Pavan Balaji (45):
Remove xfails for some more tests.
Renamed tofu to llc.
White space cleanup.
Fix llc Makefile file inclusions.
Remove the IB netmod.
Edit CHANGES and README.vin to remove IB mentions.
White-space cleanup.
MX is deleted, not deprecated.
Prepare for the 3.2b4 release.
xfail gather_big test.
Remove unnecessary asm checks for nemesis.
Remove test/mpid.
Remove unused parameter.
Get rid of unused lrank element in lrank_to_lpid structure.
Remove redundant definitions.
Revert "Remove redundant definitions."
Remove unused finishpending functions.
Added a script to detect git conflicts.
Fix management of -g in CFLAGS.
Fix bug in the mtest.c file.
Deleted MPID_REQUEST_SET_COMPLETED macro.
Replace MPIDI_CH3U_Request_complete with MPID_Request_complete.
Change MPID_Request_set_completed to MPID_Request_complete.
Use better variable name in macro.
Avoid destroying request directly.
Initialize comm local and remote size to -1.
Remove namespacing for static functions.
Call device hooks on a communicator before its child communicators.
Move VCR-specific content to the device.
We no longer have the '--disable-smpcoll' configure option.
Added a note about the hwloc build issue with PGI.
Updated to hwloc-1.11.
Hydra-specific patches for hwloc.
Warning squash: Avoid assigning const char * to char *.
Fix for hwloc's failure with PGI 32-bit compilers.
Revert "Added a note about the hwloc build issue with PGI."
Use MPIDI_RMA_Win_list_head instead of MPIDI_RMA_Win_list.
Remove unnecessary initialization.
Remove unnecessary patch that was carried forward.
Minor correction to the git-conflicts script.
Move default PMI version to the device.
Get rid of MPIUI_Memcpy.
Remove unnecessary macro.
nb_test is incorrect, not an xfail.
Setup a configure option to disable comm_overlap tests.
Rob Latham (15):
some type promotions in RMA path
better approach for do_accumulate_op
fixes for test case
promote more types to larger versions
a "large contig" type
Update PAMI device for larger count types
hoist ROMIO init into MPI_Init
record lb and ub index in flattened
adjust flattened processing for repeated resize
mark gather_big as a 'largetest'
Increase number of finalizers
clean up 62829ab8: generate testlist properly
Revert "hoist ROMIO init into MPI_Init"
system calls return ssize_t, not int
Test case for segfault in spawn
Sangmin Seo (4):
Create htmldir before installing html files.
tsuite: add MPI version setting to runtests.
Mark ft/agree as xfail.
Fix wrong xfail usages.
Valentin Petrov (1):
OFI netmod: RCD protocol bug fix.
Wesley Bland (1):
CH3: Remove unnecessary message queue searching
Xin Zhao (91):
Issue extended packet header in OFI netmod.
Add a test for large ACC operations working with MPI_Win_flush_local.
Fix in Nemesis: assign sreq to shm_active_send when headers are sent.
Add tests of setting window info no_locks to TRUE / FALSE.
Bug-fix: fix typo error in Win_set_info.
Bug-fix: free lock entry queue when it was allocated.
Add a test to test atomic GET (GACC/FOP + MPI_NO_OP).
Delete macros that no longer needed.
Change op pointer name 'new_ptr' to 'op_ptr'.
Delete useless IF branch.
Simplify code: use MPIDI_CH3U_Request_complete to complete user request.
Simplify code: delete unncessary calculation in IMMED length.
Remove unused have_remote_incomplete_ops.
Remove "is_dt" flag from op structure.
Add "_head" to name of linked lists.
Add "issued_" prefix to read_op_list, write_op_list and dt_op_list.
Move disable_flush_local into sync struct and rename it.
Simplify code of garbage collection functions.
Delete redundant variable "len".
Change variable name of origin data_sz and target data_sz.
Fix typo error on variable names.
Add namespace for num_active_issued_win and num_passive_win.
Code-refactoring: move completion judgement code out of GC function.
Delete redundant function call.
Exit immed_copy() if src/dest address is NULL or data length is zero.
Make do_accumulate_op() perform correctly when op is MPI_NO_OP.
Delete redundant branch for MPI_REPLACE.
Add comments about MPI_NO_OP in GACC/FOP.
Bug-fix: datatype in FOP should be predefined instead of builtin
Delete code of converting GACC/FOP to GET when op is MPI_NO_OP.
Modify MPICH infrastructure to support atomic GET.
Change function name used in RMA progress.
Return a flag from check_and_switch_target/window_state() on issuing ops.
Move check_and_switch_target/window_state() into issue_ops_target/window().
Delete redundant function call.
Increase time limit of test/mpi/rma/atomic_get test to 5 min.
Use MPIDI_msg_sz_t instead of int for orig_segment_first.
Bug-fix in calculating streaming size in GetAccumulate pkt handler.
Bug-fix in Request_load_recv_iov() when initial value of segment_first is not 0.
Bug-fix on typo error.
Simplify code: using MPIDI_CH3I_RMA_Ops_free_elem to delete operation.
Code format clean up.
Bug-fix: correct local/remote completion in Win_flush_local.
Bug-fix: correct SHM memory size in Nemesis Win_gather_info().
Bug-fix on mpi/rma/manyget.c test.
Only make RMA progress when ISSUED active win or passive win exist.
Perf-tuning: overlapping issuing data and computation on target side in GACC/FOP.
Modify MPI_Win_complete to only wait for local completion.
Delete unnecessary progress in MPI_Win_fence.
Adding reduce-scatter based algorithm in MPI_Win_fence.
Delete poke_progress_engine in RMA sync calls and only keep self lock cases.
Bug-fix on setting MPIDI_CH3I_num_active_issued_win.
Perf-tuning: avoid dynamic allocation of requests in RMA.
Delete CVAR and code that control the batch issuing of RMA operations.
Delete a CVAR that is never used.
Add prefix "target_" to lock_entry related name and suffix "_head" to linked lists.
Bug-fix: always allocate target lock entry pool in win_init.
use ALL_STREAM_UNITS_ISSUED to indicate if all stream units are issued out.
Add DELAY_ISSUING_FOR_PIGGYBACKING option for RMA synchronization.
Better judgement on if it is OK to issue operations.
Add progress poking and GC progress during issuing out the ops.
Poke progress engine in RMA op/sync routines when state is not satisfied.
Set upgrade_flush_local to 0 after Win_flush/Win_flush_all.
Modify message of decrementing AT counter to send back FLUSH if necessary.
Add internal flush_local_all and flush_all.
Add an assert in Win_flush_local_all to ensure all requests are completed.
Improvement for IBARRIER when number of processes is 1.
Modify pkt/flag/function name "FLUSH_ACK" to "ACK".
Add an RMA test for issuing large ACC following by small ACCs.
Bug-fix: set kind of user request in request-based RMA operation correctly.
Increase timeLimit of test/mpi/rma/rma-contig to 12min.
Code format clean up.
Bug-fix: void function should not have return value.
Bug-fix on sock: leave IOV slot for extended packet header.
Bug-fix: store stream_offset in response request of GACC message.
Delete unused labels to remove compiler warnings.
Revert "Perf-tuning: overlapping issuing data and computation on target side in GACC/FOP."
Code format clean up.
Move win_shared_query to Win_fns table to let Nemesis override it.
Delete RMA function table and expose "MPID_" RMA functions from CH3 to MPI layer.
Code-refactoring: use MPID_Request_create routine when creating send/recv requests
Make MPID_Request_complete to return mpi_errno.
Add request completed callback functions.
Use request_completed_cb to complete user request in req-based RMA operation.
Adding a request callback function for ibarrier in Win_fence.
Rename MPI_RC to MPIDI_CH3I_NM_OFI_RC
Code format cleanup.
fix name in state decl
use double direction linked list for RMA related lists.
Add an assert to check the recursion depth of MPID_Request_complete.
Modify comments about request completion callback.
-----------------------------------------------------------------------
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-285-gb5099d5
by noreply@mpich.org 22 Jul '15
by noreply@mpich.org 22 Jul '15
22 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 b5099d559d6c2a406d3b875b054c288c7e306bc7 (commit)
from 5e791c1d151812036d15459205e87693ceac67df (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/b5099d559d6c2a406d3b875b054c288c7…
commit b5099d559d6c2a406d3b875b054c288c7e306bc7
Author: Huiwei Lu <huiweilu(a)mcs.anl.gov>
Date: Wed Jul 22 16:59:51 2015 -0500
Remove xfail for MPI_Comm_idup
Refs #2108
No reviewer
diff --git a/test/mpi/threads/coll/testlist.in b/test/mpi/threads/coll/testlist.in
index 885434c..9ea953d 100644
--- a/test/mpi/threads/coll/testlist.in
+++ b/test/mpi/threads/coll/testlist.in
@@ -1,2 +1,2 @@
-@comm_overlap@ allred 2 xfail=ticket2108
-@comm_overlap@ iallred 2 mpiversion=3.0 xfail=ticket2108
+@comm_overlap@ allred 2
+@comm_overlap@ iallred 2 mpiversion=3.0
diff --git a/test/mpi/threads/comm/testlist.in b/test/mpi/threads/comm/testlist.in
index 9378505..07d79c8 100644
--- a/test/mpi/threads/comm/testlist.in
+++ b/test/mpi/threads/comm/testlist.in
@@ -3,7 +3,7 @@ dup_leak_test 2
comm_dup_deadlock 4
comm_create_threads 4
comm_create_group_threads 4
-@comm_overlap@ comm_idup 4 mpiversion=3.0 xfail=ticket2108
-@comm_overlap@ ctxidup 4 mpiversion=3.0 xfail=ticket2108
+@comm_overlap@ comm_idup 4 mpiversion=3.0
+@comm_overlap@ ctxidup 4 mpiversion=3.0
idup_nb 4 mpiversion=3.0 xfail=ticket2283
idup_comm_gen 4 mpiversion=3.0 xfail=ticket2286
-----------------------------------------------------------------------
Summary of changes:
test/mpi/threads/coll/testlist.in | 4 ++--
test/mpi/threads/comm/testlist.in | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0