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 2014
- 1 participants
- 63 discussions
[mpich] MPICH primary repository branch, master, updated. v3.1.2-58-g004a507
by noreply@mpich.org 31 Jul '14
by noreply@mpich.org 31 Jul '14
31 Jul '14
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 004a5078374078d160e93b9024a46a4b463340b5 (commit)
from 6b4405ef1d44d766299594d8a5e92332735252af (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/004a5078374078d160e93b9024a46a4b4…
commit 004a5078374078d160e93b9024a46a4b463340b5
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Thu Jul 24 17:30:32 2014 -0500
Changed comments from fixed form C to free form !
Usually, Fortran compilers treat .f files as fixed-form F77 code. An exception in IBM XLF.
Using xlf90 to compile setbotf.f with "C ..." style comments will give errors.
This patch replaces C with !, which makes setbotf.f both fixed-form and free-form compatible.
Tests showed ! in fixed-form is accepted by all compilers of interest. So xlf90 can still think
setbotf.f be free-formed.
Fixes #2109.
Signed-off-by: Antonio J. Pena <apenya(a)mcs.anl.gov>
diff --git a/src/binding/fortran/mpif_h/setbotf.f.in b/src/binding/fortran/mpif_h/setbotf.f.in
index 893c5a4..706aebf 100644
--- a/src/binding/fortran/mpif_h/setbotf.f.in
+++ b/src/binding/fortran/mpif_h/setbotf.f.in
@@ -1,16 +1,16 @@
-C -*- Mode: Fortran; -*-
-C
-C (C) 2001 by Argonne National Laboratory.
-C See COPYRIGHT in top-level directory.
-C
+! -*- Mode: Fortran; -*-
+!
+! (C) 2001 by Argonne National Laboratory.
+! See COPYRIGHT in top-level directory.
+!
subroutine mpirinitf( )
integer mpi_status_size
parameter (mpi_status_size=@MPI_STATUS_SIZE@)
-C STATUS_IGNORE, STATUSES_IGNORE
+! STATUS_IGNORE, STATUSES_IGNORE
integer si(mpi_status_size), ssi(mpi_status_size,1)
-C BOTTOM, IN_PLACE, UNWEIGHTED, ERRCODES_IGNORE
+! BOTTOM, IN_PLACE, UNWEIGHTED, ERRCODES_IGNORE
integer bt, ip, uw, ecsi(1)
-C ARGVS_NULL, ARGV_NULL
+! ARGVS_NULL, ARGV_NULL
character*1 asn(1,1), an(1)
common /MPIFCMB5/ uw
common /MPIFCMB9/ we
@@ -21,8 +21,8 @@ C ARGVS_NULL, ARGV_NULL
save /MPIFCMB9/
save /MPIPRIV1/, /MPIPRIV2/
save /MPIPRIVC/
-C MPI_ARGVS_NULL
-C (Fortran requires character data in a separate common block)
+! MPI_ARGVS_NULL
+! (Fortran requires character data in a separate common block)
call mpirinitc(si, ssi, bt, ip, uw, ecsi, asn, we)
call mpirinitc2(an)
return
-----------------------------------------------------------------------
Summary of changes:
src/binding/fortran/mpif_h/setbotf.f.in | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.2-57-g6b4405e
by noreply@mpich.org 31 Jul '14
by noreply@mpich.org 31 Jul '14
31 Jul '14
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 6b4405ef1d44d766299594d8a5e92332735252af (commit)
from 0631718f8dc25304c62f0ac755e46f38256eb880 (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/6b4405ef1d44d766299594d8a5e923327…
commit 6b4405ef1d44d766299594d8a5e92332735252af
Author: artem.v.yalozo <artem.v.yalozo(a)intel.com>
Date: Mon May 5 18:33:39 2014 +0400
Hydra Windows Compilation: Distinguish struct and variable names
* Fix compilation errors with the Windows compiler
* Allow correct debugging of data structures
Signed-off-by: Huiwei Lu <huiweilu(a)mcs.anl.gov>
diff --git a/src/pm/hydra/include/hydra_server.h b/src/pm/hydra/include/hydra_server.h
index 806896c..2299d2b 100644
--- a/src/pm/hydra/include/hydra_server.h
+++ b/src/pm/hydra/include/hydra_server.h
@@ -20,7 +20,7 @@ struct HYD_cmd {
int signum;
};
-struct HYD_server_info {
+struct HYD_server_info_s {
struct HYD_user_global user_global;
char *base_path;
@@ -47,6 +47,6 @@ struct HYD_server_info {
#endif /* ENABLE_PROFILING */
};
-extern struct HYD_server_info HYD_server_info;
+extern struct HYD_server_info_s HYD_server_info;
#endif /* HYDRA_SERVER_H_INCLUDED */
diff --git a/src/pm/hydra/pm/pmiserv/pmip.c b/src/pm/hydra/pm/pmiserv/pmip.c
index 9c90f7c..32c15e4 100644
--- a/src/pm/hydra/pm/pmiserv/pmip.c
+++ b/src/pm/hydra/pm/pmiserv/pmip.c
@@ -11,7 +11,7 @@
#include "topo.h"
#include "hydt_ftb.h"
-struct HYD_pmcd_pmip HYD_pmcd_pmip;
+struct HYD_pmcd_pmip_s HYD_pmcd_pmip;
static HYD_status init_params(void)
{
diff --git a/src/pm/hydra/pm/pmiserv/pmip.h b/src/pm/hydra/pm/pmiserv/pmip.h
index 977f5f8..e0e2536 100644
--- a/src/pm/hydra/pm/pmiserv/pmip.h
+++ b/src/pm/hydra/pm/pmiserv/pmip.h
@@ -17,7 +17,7 @@ struct HYD_pmcd_pmip_map {
int total;
};
-struct HYD_pmcd_pmip {
+struct HYD_pmcd_pmip_s {
struct HYD_user_global user_global;
struct {
@@ -86,7 +86,7 @@ struct HYD_pmcd_pmip {
struct HYD_exec *exec_list;
};
-extern struct HYD_pmcd_pmip HYD_pmcd_pmip;
+extern struct HYD_pmcd_pmip_s HYD_pmcd_pmip;
extern struct HYD_arg_match_table HYD_pmcd_pmip_match_table[];
HYD_status HYD_pmcd_pmip_get_params(char **t_argv);
diff --git a/src/pm/hydra/tools/bootstrap/external/pbs.h b/src/pm/hydra/tools/bootstrap/external/pbs.h
index f5c0be0..bf846ab 100644
--- a/src/pm/hydra/tools/bootstrap/external/pbs.h
+++ b/src/pm/hydra/tools/bootstrap/external/pbs.h
@@ -12,13 +12,13 @@
#if defined(HAVE_TM_H)
#include "tm.h"
-struct HYDT_bscd_pbs_sys {
+struct HYDT_bscd_pbs_sys_s {
int spawn_count;
tm_event_t *spawn_events;
tm_task_id *task_id; /* Array of TM task(process) IDs */
};
-extern struct HYDT_bscd_pbs_sys *HYDT_bscd_pbs_sys;
+extern struct HYDT_bscd_pbs_sys_s *HYDT_bscd_pbs_sys;
HYD_status HYDT_bscd_pbs_launch_procs(char **args, struct HYD_proxy *proxy_list, int *control_fd);
HYD_status HYDT_bscd_pbs_query_env_inherit(const char *env_name, int *ret);
diff --git a/src/pm/hydra/tools/bootstrap/external/pbs_init.c b/src/pm/hydra/tools/bootstrap/external/pbs_init.c
index 9a92e76..4bbbc0b 100644
--- a/src/pm/hydra/tools/bootstrap/external/pbs_init.c
+++ b/src/pm/hydra/tools/bootstrap/external/pbs_init.c
@@ -9,7 +9,7 @@
#include "pbs.h"
#if defined(HAVE_TM_H)
-struct HYDT_bscd_pbs_sys *HYDT_bscd_pbs_sys;
+struct HYDT_bscd_pbs_sys_s *HYDT_bscd_pbs_sys;
HYD_status HYDT_bsci_launcher_pbs_init(void)
{
@@ -24,8 +24,8 @@ HYD_status HYDT_bsci_launcher_pbs_init(void)
HYDT_bsci_fns.wait_for_completion = HYDT_bscd_pbs_wait_for_completion;
HYDT_bsci_fns.launcher_finalize = HYDT_bscd_pbs_launcher_finalize;
- HYDU_MALLOC(HYDT_bscd_pbs_sys, struct HYDT_bscd_pbs_sys *,
- sizeof(struct HYDT_bscd_pbs_sys), status);
+ HYDU_MALLOC(HYDT_bscd_pbs_sys, struct HYDT_bscd_pbs_sys_s *,
+ sizeof(struct HYDT_bscd_pbs_sys_s), status);
/* Initialize TM and Hydra's PBS data structure */
err = tm_init(NULL, &tm_root);
diff --git a/src/pm/hydra/tools/bootstrap/persist/persist_server.c b/src/pm/hydra/tools/bootstrap/persist/persist_server.c
index ea71198..1a12121 100644
--- a/src/pm/hydra/tools/bootstrap/persist/persist_server.c
+++ b/src/pm/hydra/tools/bootstrap/persist/persist_server.c
@@ -8,7 +8,7 @@
#include "topo.h"
#include "persist_server.h"
-struct HYDT_persist_handle HYDT_persist_handle;
+struct HYDT_persist_handle_s HYDT_persist_handle;
static struct {
enum {
MASTER,
diff --git a/src/pm/hydra/tools/bootstrap/persist/persist_server.h b/src/pm/hydra/tools/bootstrap/persist/persist_server.h
index 95e98cc..03c54a5 100644
--- a/src/pm/hydra/tools/bootstrap/persist/persist_server.h
+++ b/src/pm/hydra/tools/bootstrap/persist/persist_server.h
@@ -11,11 +11,11 @@
#include "demux.h"
#include "persist.h"
-struct HYDT_persist_handle {
+struct HYDT_persist_handle_s {
int port; /* port to listen on */
int debug; /* Run in debug mode */
};
-extern struct HYDT_persist_handle HYDT_persist_handle;
+extern struct HYDT_persist_handle_s HYDT_persist_handle;
#endif /* PERSIST_SERVER_H_INCLUDED */
diff --git a/src/pm/hydra/tools/ckpoint/ckpoint.c b/src/pm/hydra/tools/ckpoint/ckpoint.c
index 8f8d253..82da0a3 100644
--- a/src/pm/hydra/tools/ckpoint/ckpoint.c
+++ b/src/pm/hydra/tools/ckpoint/ckpoint.c
@@ -19,7 +19,7 @@
static pthread_t thread;
#endif
static enum { HYDT_CKPOINT_NONE, HYDT_CKPOINT_RUNNING, HYDT_CKPOINT_FINISHED } in_ckpt;
-struct HYDT_ckpoint_info HYDT_ckpoint_info;
+struct HYDT_ckpoint_info_s HYDT_ckpoint_info;
HYD_status HYDT_ckpoint_init(const char *user_ckpointlib, int user_ckpoint_num)
{
diff --git a/src/pm/hydra/tools/ckpoint/ckpoint.h b/src/pm/hydra/tools/ckpoint/ckpoint.h
index 55d3af6..bb99bf4 100644
--- a/src/pm/hydra/tools/ckpoint/ckpoint.h
+++ b/src/pm/hydra/tools/ckpoint/ckpoint.h
@@ -21,7 +21,7 @@
* Contains private persistent information stored by the checkpointing
* library.
*/
-struct HYDT_ckpoint_info {
+struct HYDT_ckpoint_info_s {
/** \brief Checkpointing library to use */
const char *ckpointlib;
const char *prefix;
@@ -32,7 +32,7 @@ struct HYDT_ckpoint_info {
};
/** \cond */
-extern struct HYDT_ckpoint_info HYDT_ckpoint_info;
+extern struct HYDT_ckpoint_info_s HYDT_ckpoint_info;
/** \endcond */
/**
diff --git a/src/pm/hydra/ui/include/ui.h b/src/pm/hydra/ui/include/ui.h
index 91f2401..a5e79c2 100644
--- a/src/pm/hydra/ui/include/ui.h
+++ b/src/pm/hydra/ui/include/ui.h
@@ -7,12 +7,12 @@
#ifndef UI_H_INCLUDED
#define UI_H_INCLUDED
-struct HYD_ui_info {
+struct HYD_ui_info_s {
char *prepend_pattern;
char *outfile_pattern;
char *errfile_pattern;
};
-extern struct HYD_ui_info HYD_ui_info;
+extern struct HYD_ui_info_s HYD_ui_info;
#endif /* UI_H_INCLUDED */
diff --git a/src/pm/hydra/ui/mpich/mpiexec.c b/src/pm/hydra/ui/mpich/mpiexec.c
index 39586b4..c07542f 100644
--- a/src/pm/hydra/ui/mpich/mpiexec.c
+++ b/src/pm/hydra/ui/mpich/mpiexec.c
@@ -14,11 +14,11 @@
#include "ui.h"
#include "uiu.h"
-struct HYD_server_info HYD_server_info = { {0} };
+struct HYD_server_info_s HYD_server_info = { {0} };
struct HYD_exec *HYD_uii_mpx_exec_list = NULL;
-struct HYD_ui_info HYD_ui_info;
-struct HYD_ui_mpich_info HYD_ui_mpich_info;
+struct HYD_ui_info_s HYD_ui_info;
+struct HYD_ui_mpich_info_s HYD_ui_mpich_info;
static void signal_cb(int signum)
{
diff --git a/src/pm/hydra/ui/mpich/mpiexec.h b/src/pm/hydra/ui/mpich/mpiexec.h
index 4127ce8..b761d92 100644
--- a/src/pm/hydra/ui/mpich/mpiexec.h
+++ b/src/pm/hydra/ui/mpich/mpiexec.h
@@ -9,7 +9,7 @@
#include "hydra_server.h"
-struct HYD_ui_mpich_info {
+struct HYD_ui_mpich_info_s {
int ppn;
int ckpoint_int;
int print_all_exitcodes;
@@ -21,7 +21,7 @@ struct HYD_ui_mpich_info {
} sort_order;
};
-extern struct HYD_ui_mpich_info HYD_ui_mpich_info;
+extern struct HYD_ui_mpich_info_s HYD_ui_mpich_info;
HYD_status HYD_uii_mpx_get_parameters(char **t_argv);
-----------------------------------------------------------------------
Summary of changes:
src/pm/hydra/include/hydra_server.h | 4 ++--
src/pm/hydra/pm/pmiserv/pmip.c | 2 +-
src/pm/hydra/pm/pmiserv/pmip.h | 4 ++--
src/pm/hydra/tools/bootstrap/external/pbs.h | 4 ++--
src/pm/hydra/tools/bootstrap/external/pbs_init.c | 6 +++---
.../hydra/tools/bootstrap/persist/persist_server.c | 2 +-
.../hydra/tools/bootstrap/persist/persist_server.h | 4 ++--
src/pm/hydra/tools/ckpoint/ckpoint.c | 2 +-
src/pm/hydra/tools/ckpoint/ckpoint.h | 4 ++--
src/pm/hydra/ui/include/ui.h | 4 ++--
src/pm/hydra/ui/mpich/mpiexec.c | 6 +++---
src/pm/hydra/ui/mpich/mpiexec.h | 4 ++--
12 files changed, 23 insertions(+), 23 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.2-56-g0631718
by noreply@mpich.org 31 Jul '14
by noreply@mpich.org 31 Jul '14
31 Jul '14
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 0631718f8dc25304c62f0ac755e46f38256eb880 (commit)
via b52300e549e56e148b8c1abefd2bd2f7122958ed (commit)
via 9db2bb04dab3864143848c66b94ef358fcc27eee (commit)
from 29d4c54f7a0adba04464f3cfc2ba917a3dc3f8b5 (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/0631718f8dc25304c62f0ac755e46f382…
commit 0631718f8dc25304c62f0ac755e46f38256eb880
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Wed Jul 30 20:38:36 2014 -0500
portals4: implement cancel_recv and anysource_matched
These functions share similar functionality. The end goal is being
able to remove a posted matching list entry from portals4. E.g. if
a recv request is cancelled, or if an anysource recv was matched in
shared memory and the netmod portion should be removed.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
index 712e006..57e5dc3 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
@@ -23,6 +23,10 @@ static void dequeue_req(const ptl_event_t *e)
rreq->status.MPI_SOURCE = NPTL_MATCH_GET_RANK(e->match_bits);
rreq->status.MPI_TAG = NPTL_MATCH_GET_TAG(e->match_bits);
+ /* At this point we know the ME is unlinked. Invalidate the handle to
+ prevent further accesses, e.g. an attempted cancel. */
+ REQ_PTL(rreq)->me = PTL_INVALID_HANDLE;
+
MPID_Datatype_get_size_macro(rreq->dev.datatype, r_len);
r_len *= rreq->dev.user_count;
@@ -515,11 +519,23 @@ void MPID_nem_ptl_anysource_posted(MPID_Request *rreq)
static int cancel_recv(MPID_Request *rreq, int *cancelled)
{
int mpi_errno = MPI_SUCCESS;
+ int ptl_err = PTL_OK;
MPIDI_STATE_DECL(MPID_STATE_CANCEL_RECV);
MPIDI_FUNC_ENTER(MPID_STATE_CANCEL_RECV);
- MPIU_Assert(0 && "FIXME: Need to implement cancel_recv");
+ *cancelled = FALSE;
+
+ /* An invalid handle indicates the operation has been completed
+ and the matching list entry unlinked. At that point, the operation
+ cannot be cancelled. */
+ if (REQ_PTL(rreq)->me != PTL_INVALID_HANDLE) {
+ ptl_err = PtlMEUnlink(REQ_PTL(rreq)->me);
+ if (ptl_err == PTL_OK)
+ *cancelled = TRUE;
+ else if (ptl_err != PTL_IN_USE)
+ mpi_errno = MPI_ERR_INTERN;
+ }
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_CANCEL_RECV);
@@ -535,8 +551,8 @@ static int cancel_recv(MPID_Request *rreq, int *cancelled)
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_ptl_anysource_matched(MPID_Request *rreq)
{
- int mpi_errno = MPI_SUCCESS;
- int cancelled = 0;
+ int mpi_errno, cancelled;
+
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_ANYSOURCE_MATCHED);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_ANYSOURCE_MATCHED);
@@ -547,9 +563,11 @@ int MPID_nem_ptl_anysource_matched(MPID_Request *rreq)
code. */
MPIU_Assertp(mpi_errno == MPI_SUCCESS);
- return !cancelled;
-
+ fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_ANYSOURCE_MATCHED);
+ return !cancelled;
+ fn_fail:
+ goto fn_exit;
}
@@ -560,16 +578,21 @@ int MPID_nem_ptl_anysource_matched(MPID_Request *rreq)
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_ptl_cancel_recv(MPIDI_VC_t *vc, MPID_Request *rreq)
{
- int mpi_errno = MPI_SUCCESS;
+ int mpi_errno, cancelled;
+
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_CANCEL_RECV);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_CANCEL_RECV);
- MPIU_Assert(0 && "implement me");
+ mpi_errno = cancel_recv(rreq, &cancelled);
+ /* FIXME: This function is does not return an error because the queue
+ functions (where the posted_recv hooks are called) return no error
+ code. */
+ MPIU_Assertp(mpi_errno == MPI_SUCCESS);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_CANCEL_RECV);
- return mpi_errno;
+ return !cancelled;
fn_fail:
goto fn_exit;
}
http://git.mpich.org/mpich.git/commitdiff/b52300e549e56e148b8c1abefd2bd2f71…
commit b52300e549e56e148b8c1abefd2bd2f7122958ed
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Fri Jul 25 16:44:15 2014 -0500
portals4: set destination in send request object
Portals4 encodes the destination rank into its own matching information,
but the upper layers do not have access to it. In the case of a cancel
operation, it is still necessary to have this information available.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
index a642fbd..88ff54e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -192,6 +192,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
MPIDI_FUNC_ENTER(MPID_STATE_SEND_MSG);
MPID_nem_ptl_request_create_sreq(sreq, mpi_errno, comm);
+ sreq->dev.match.parts.rank = dest;
if (!vc_ptl->id_initialized) {
mpi_errno = MPID_nem_ptl_init_id(vc);
http://git.mpich.org/mpich.git/commitdiff/9db2bb04dab3864143848c66b94ef358f…
commit 9db2bb04dab3864143848c66b94ef358fcc27eee
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Wed Jul 30 19:31:09 2014 -0500
ch3: Call netmod cancel functions
Previously, the netmod cancel_recv and cancel_send functions were
not called. Calling them ensures that the request cancelled status
is accurate and that any necessary cleanup has been done.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/src/mpid_cancel_recv.c b/src/mpid/ch3/src/mpid_cancel_recv.c
index 24a04f6..d1d3902 100644
--- a/src/mpid/ch3/src/mpid_cancel_recv.c
+++ b/src/mpid/ch3/src/mpid_cancel_recv.c
@@ -12,13 +12,28 @@
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_Cancel_recv(MPID_Request * rreq)
{
+ int netmod_cancelled = TRUE;
+
MPIDI_STATE_DECL(MPID_STATE_MPID_CANCEL_RECV);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_CANCEL_RECV);
MPIU_Assert(rreq->kind == MPID_REQUEST_RECV);
- if (MPIDI_CH3U_Recvq_DP(rreq))
+ /* If the netmod has its own cancel_recv function, we need to call
+ it here. ANYSOURCE cancels (netmod and otherwise) are handled by
+ MPIDI_CH3U_Recvq_DP below. */
+#ifdef ENABLE_COMM_OVERRIDES
+ if (rreq->dev.match.parts.rank != MPI_ANY_SOURCE)
+ {
+ MPIDI_VC_t *vc;
+ MPIDI_Comm_get_vc_set_active(rreq->comm, rreq->dev.match.parts.rank, &vc);
+ if (vc->comm_ops && vc->comm_ops->cancel_recv)
+ netmod_cancelled = !vc->comm_ops->cancel_recv(NULL, rreq);
+ }
+#endif
+
+ if (netmod_cancelled && MPIDI_CH3U_Recvq_DP(rreq))
{
MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
"request 0x%08x cancelled", rreq->handle);
diff --git a/src/mpid/ch3/src/mpid_cancel_send.c b/src/mpid/ch3/src/mpid_cancel_send.c
index 4772c8c..302d793 100644
--- a/src/mpid/ch3/src/mpid_cancel_send.c
+++ b/src/mpid/ch3/src/mpid_cancel_send.c
@@ -90,6 +90,16 @@ int MPID_Cancel_send(MPID_Request * sreq)
goto fn_exit;
}
+ /* If the message went over a netmod and it provides a cancel_send
+ function, call it here. */
+#ifdef ENABLE_COMM_OVERRIDES
+ if (vc->comm_ops && vc->comm_ops->cancel_send)
+ {
+ mpi_errno = vc->comm_ops->cancel_send(vc, sreq);
+ goto fn_exit;
+ }
+#endif
+
/* Check to see if the send is still in the send queue. If so, remove it,
mark the request and cancelled and complete, and
release the device's reference to the request object.
-----------------------------------------------------------------------
Summary of changes:
.../channels/nemesis/netmod/portals4/ptl_recv.c | 39 ++++++++++++++++----
.../channels/nemesis/netmod/portals4/ptl_send.c | 1 +
src/mpid/ch3/src/mpid_cancel_recv.c | 17 ++++++++-
src/mpid/ch3/src/mpid_cancel_send.c | 10 +++++
4 files changed, 58 insertions(+), 9 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.2-53-g29d4c54
by noreply@mpich.org 31 Jul '14
by noreply@mpich.org 31 Jul '14
31 Jul '14
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 29d4c54f7a0adba04464f3cfc2ba917a3dc3f8b5 (commit)
via 8aed7f12d7e5bbb679638f09f9722a7a14479cd8 (commit)
via 2bdc3116b520f75856606033661fe4bece971e75 (commit)
via 6b8cee7071209d8aacb6a88e797ac3afad234322 (commit)
via 05cb62bdca14de1fff9b3599e901efffd8c31088 (commit)
via 1f0ee13674dff8ad44c647c4748e677c7fcfb756 (commit)
via 5be10ce97cdf586ccaa5ab86f29d3827bb215056 (commit)
via ee5173e396f43adb3dd0660e59e7b2e19cb856c5 (commit)
via 57f6ee88801fd9d2959cc133fe4bb10b25848f4f (commit)
via 628d2daf99811e7a426c08f3726ec8072d927178 (commit)
via 5c71c3a8bf633063445cdc29b19f1c1104527bb9 (commit)
via 39b958059fbd50f05d92190ce8eb507437a4878e (commit)
via 8652e0ade03c6b5a8dcc8205a1d978413471f130 (commit)
via 665ced285ab9e2f655852c901b9a819f6390474e (commit)
via 782d036c4f898f786bb3a4f90b02f5d99971d9c6 (commit)
via 3325b6f7b416647a7c66878a71cac19708096c8a (commit)
via ed98c9834b6b827eaea970616590e8095d0ef418 (commit)
via 6ce715477e725d550af675fbd10cc3b2ff0c615c (commit)
via c83eddd9138b21558a618457910583cf7c1ba321 (commit)
via b68657dcaff19cd0a164f75f31eace6ef64d324b (commit)
from edd6daa5c47dfa19acf5836f2781d1c564116e37 (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/29d4c54f7a0adba04464f3cfc2ba917a3…
commit 29d4c54f7a0adba04464f3cfc2ba917a3dc3f8b5
Author: Wesley Bland <wbland(a)anl.gov>
Date: Wed Jul 30 16:11:31 2014 -0500
Mark new tests as xfail
The new tests don't pass yet due to some corner cases. However, we need to go
ahead and push this into master, so they'll be xfail for now. This will get
picked up as part of #1945.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/test/mpi/ft/testlist b/test/mpi/ft/testlist
index 5e8b54b..cdc0168 100644
--- a/test/mpi/ft/testlist
+++ b/test/mpi/ft/testlist
@@ -11,7 +11,7 @@ gather 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=f
reduce 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
bcast 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
scatter 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
-anysource 3 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
-revoke_nofail 4 mpiexecarg=-disable-auto-cleanup resultsTest=TestStatusNoErrors strict=false timelimit=10
-shrink 8 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
-agree 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
+anysource 3 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
+revoke_nofail 4 mpiexecarg=-disable-auto-cleanup resultsTest=TestStatusNoErrors strict=false timelimit=10 xfail=ticket1945
+shrink 8 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
+agree 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
http://git.mpich.org/mpich.git/commitdiff/8aed7f12d7e5bbb679638f09f9722a7a1…
commit 8aed7f12d7e5bbb679638f09f9722a7a14479cd8
Author: Wesley Bland <wbland(a)anl.gov>
Date: Wed Jul 23 10:10:37 2014 -0500
CH3_ISENDV must correctly set mpi_errno
Previously, CH3_ISENDV was only setting the error value in the send request.
This isn't enough because upper level functions don't check that. They only
check the return value which wasn't set at all.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
index d5fe393..15ac7c8 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
@@ -31,6 +31,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPID_IOV *iov, int n_i
if (vc->state == MPIDI_VC_STATE_MORIBUND) {
sreq->status.MPI_ERROR = MPI_SUCCESS;
MPIU_ERR_SET1(sreq->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
MPIDI_CH3U_Request_complete(sreq);
goto fn_fail;
}
http://git.mpich.org/mpich.git/commitdiff/2bdc3116b520f75856606033661fe4bec…
commit 2bdc3116b520f75856606033661fe4bece971e75
Author: Wesley Bland <wbland(a)anl.gov>
Date: Fri Jul 18 10:45:40 2014 -0500
Add some basic resilience to allred_group
If a process is dead, collectives still do all of the communictaions to
prevent a deadlock. However, if we just skip the part where the data is
updated in the allreduce_group function, we can let it be slightly more
resilient to failures and possibly even produce a correct answer in the
presence of a failure.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/mpi/coll/allred_group.c b/src/mpi/coll/allred_group.c
index 396fb76..5db6b6a 100644
--- a/src/mpi/coll/allred_group.c
+++ b/src/mpi/coll/allred_group.c
@@ -165,25 +165,26 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
- }
-
- /* tmp_buf contains data received in this step.
- recvbuf contains data accumulated so far */
-
- if (is_commutative || (dst < group_rank)) {
- /* op is commutative OR the order is already right */
- mpi_errno = MPIR_Reduce_local_impl(tmp_buf, recvbuf, count, datatype, op);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- }
- else {
- /* op is noncommutative and the order is not right */
- mpi_errno = MPIR_Reduce_local_impl(recvbuf, tmp_buf, count, datatype, op);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- /* copy result back into recvbuf */
- mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype,
- recvbuf, count, datatype);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ } else {
+
+ /* tmp_buf contains data received in this step.
+ recvbuf contains data accumulated so far */
+
+ if (is_commutative || (dst < group_rank)) {
+ /* op is commutative OR the order is already right */
+ mpi_errno = MPIR_Reduce_local_impl(tmp_buf, recvbuf, count, datatype, op);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ }
+ else {
+ /* op is noncommutative and the order is not right */
+ mpi_errno = MPIR_Reduce_local_impl(recvbuf, tmp_buf, count, datatype, op);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ /* copy result back into recvbuf */
+ mpi_errno = MPIR_Localcopy(tmp_buf, count, datatype,
+ recvbuf, count, datatype);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ }
}
mask <<= 1;
}
http://git.mpich.org/mpich.git/commitdiff/6b8cee7071209d8aacb6a88e797ac3afa…
commit 6b8cee7071209d8aacb6a88e797ac3afad234322
Author: Wesley Bland <wbland(a)anl.gov>
Date: Sat May 10 14:39:26 2014 -0500
Don't check the tag if the coll op completed with error
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index cf10a9e..1ee252c 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -367,7 +367,7 @@ int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
if (MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
*errflag = TRUE;
MPIR_TAG_CLEAR_ERROR_BIT(status->MPI_TAG);
- } else {
+ } else if (MPIX_ERR_REVOKED != MPIR_ERR_GET_CLASS(status->MPI_ERROR)) {
MPIU_Assert(status->MPI_TAG == tag);
}
}
@@ -486,11 +486,11 @@ int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
if (MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
*errflag = TRUE;
MPIR_TAG_CLEAR_ERROR_BIT(status->MPI_TAG);
- } else {
+ } else if (MPIX_ERR_REVOKED != MPIR_ERR_GET_CLASS(status->MPI_ERROR)) {
MPIU_Assert(status->MPI_TAG == recvtag);
}
}
-
+
fn_exit:
MPIU_DBG_MSG_S(PT2PT, TYPICAL, "OUT: errflag = %s", *errflag?"TRUE":"FALSE");
@@ -602,7 +602,7 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
if (MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
*errflag = TRUE;
MPIR_TAG_CLEAR_ERROR_BIT(status->MPI_TAG);
- } else {
+ } else if (MPIX_ERR_REVOKED != MPIR_ERR_GET_CLASS(status->MPI_ERROR)) {
MPIU_Assert(status->MPI_TAG == recvtag);
}
}
http://git.mpich.org/mpich.git/commitdiff/05cb62bdca14de1fff9b3599e901efffd…
commit 05cb62bdca14de1fff9b3599e901efffd8c31088
Author: Wesley Bland <wbland(a)anl.gov>
Date: Fri May 2 10:17:34 2014 -0500
Change MPID_Comm_valid_ptr to optionally ignore revoke
Adds a parameter to MPID_Comm_valid_ptr to take a second parameter that will
either cause the macro to ignore the revoke flag or not.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 79a0bc8..882e366 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -494,14 +494,13 @@ int MPIU_Handle_free( void *((*)[]), int );
for now */
/* ticket #1441: check (refcount<=0) to cover the case of 0, an "over-free" of
* -1 or similar, and the 0xecec... case when --enable-g=mem is used */
-#define MPID_Comm_valid_ptr(ptr,err) { \
+#define MPID_Comm_valid_ptr(ptr,err,ignore_rev) { \
MPID_Valid_ptr_class(Comm,ptr,MPI_ERR_COMM,err); \
if ((ptr) && MPIU_Object_get_ref(ptr) <= 0) { \
MPIU_ERR_SET(err,MPI_ERR_COMM,"**comm"); \
ptr = 0; \
- } else if (ptr->revoked) { \
+ } else if (ptr->revoked && !ignore_rev) { \
MPIU_ERR_SET(err,MPIX_ERR_REVOKED,"**comm"); \
- ptr = 0; \
} \
}
#define MPID_Group_valid_ptr(ptr,err) MPID_Valid_ptr_class(Group,ptr,MPI_ERR_GROUP,err)
diff --git a/src/mpi/attr/attr_delete.c b/src/mpi/attr/attr_delete.c
index 7594dcc..1e624f9 100644
--- a/src/mpi/attr/attr_delete.c
+++ b/src/mpi/attr/attr_delete.c
@@ -86,7 +86,7 @@ int MPI_Attr_delete(MPI_Comm comm, int keyval)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
/* Validate keyval_ptr */
MPID_Keyval_valid_ptr( keyval_ptr, mpi_errno );
diff --git a/src/mpi/attr/attr_get.c b/src/mpi/attr/attr_get.c
index f02ac02..eee5394 100644
--- a/src/mpi/attr/attr_get.c
+++ b/src/mpi/attr/attr_get.c
@@ -112,7 +112,7 @@ int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(attribute_val, "attribute_val", mpi_errno);
MPIR_ERRTEST_ARGNULL(flag, "flag", mpi_errno);
diff --git a/src/mpi/attr/attr_put.c b/src/mpi/attr/attr_put.c
index 91b74fb..89987fd 100644
--- a/src/mpi/attr/attr_put.c
+++ b/src/mpi/attr/attr_put.c
@@ -104,7 +104,7 @@ int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
diff --git a/src/mpi/attr/comm_delete_attr.c b/src/mpi/attr/comm_delete_attr.c
index 683960e..c184d43 100644
--- a/src/mpi/attr/comm_delete_attr.c
+++ b/src/mpi/attr/comm_delete_attr.c
@@ -140,7 +140,7 @@ int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
/* Validate keyval_ptr */
MPID_Keyval_valid_ptr( keyval_ptr, mpi_errno );
diff --git a/src/mpi/attr/comm_get_attr.c b/src/mpi/attr/comm_get_attr.c
index 0cc2c56..28a8e19 100644
--- a/src/mpi/attr/comm_get_attr.c
+++ b/src/mpi/attr/comm_get_attr.c
@@ -81,7 +81,7 @@ int MPIR_CommGetAttr( MPI_Comm comm, int comm_keyval, void *attribute_val,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(attribute_val, "attr_val", mpi_errno);
MPIR_ERRTEST_ARGNULL(flag, "flag", mpi_errno);
diff --git a/src/mpi/attr/comm_set_attr.c b/src/mpi/attr/comm_set_attr.c
index 71b4e6b..2aa9457 100644
--- a/src/mpi/attr/comm_set_attr.c
+++ b/src/mpi/attr/comm_set_attr.c
@@ -142,7 +142,7 @@ int MPIR_CommSetAttr( MPI_Comm comm, int comm_keyval, void *attribute_val,
MPID_Keyval *keyval_ptr = NULL;
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
/* Validate keyval_ptr */
MPID_Keyval_get_ptr( comm_keyval, keyval_ptr );
@@ -249,7 +249,7 @@ int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val)
MPID_Keyval *keyval_ptr = NULL;
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
/* Validate keyval_ptr */
MPID_Keyval_get_ptr( comm_keyval, keyval_ptr );
diff --git a/src/mpi/coll/allgather.c b/src/mpi/coll/allgather.c
index 216e601..31df564 100644
--- a/src/mpi/coll/allgather.c
+++ b/src/mpi/coll/allgather.c
@@ -933,7 +933,7 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
MPID_Datatype *recvtype_ptr=NULL, *sendtype_ptr=NULL;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTERCOMM) {
diff --git a/src/mpi/coll/allgatherv.c b/src/mpi/coll/allgatherv.c
index fe12f92..674ba31 100644
--- a/src/mpi/coll/allgatherv.c
+++ b/src/mpi/coll/allgatherv.c
@@ -1045,7 +1045,7 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPID_Datatype *recvtype_ptr=NULL, *sendtype_ptr=NULL;
int i, comm_size;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTERCOMM)
diff --git a/src/mpi/coll/allreduce.c b/src/mpi/coll/allreduce.c
index bc55aaf..2d6dee5 100644
--- a/src/mpi/coll/allreduce.c
+++ b/src/mpi/coll/allreduce.c
@@ -851,7 +851,7 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
MPID_Datatype *datatype_ptr = NULL;
MPID_Op *op_ptr = NULL;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
MPIR_ERRTEST_DATATYPE(datatype, "datatype", mpi_errno);
diff --git a/src/mpi/coll/alltoall.c b/src/mpi/coll/alltoall.c
index 3c6ed8b..0cae194 100644
--- a/src/mpi/coll/alltoall.c
+++ b/src/mpi/coll/alltoall.c
@@ -836,7 +836,7 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
MPID_Datatype *sendtype_ptr=NULL, *recvtype_ptr=NULL;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (sendbuf != MPI_IN_PLACE) {
diff --git a/src/mpi/coll/alltoallv.c b/src/mpi/coll/alltoallv.c
index edfe401..713b944 100644
--- a/src/mpi/coll/alltoallv.c
+++ b/src/mpi/coll/alltoallv.c
@@ -471,7 +471,7 @@ int MPI_Alltoallv(const void *sendbuf, const int *sendcounts,
int i, comm_size;
int check_send = (comm_ptr->comm_kind == MPID_INTRACOMM && sendbuf != MPI_IN_PLACE);
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
diff --git a/src/mpi/coll/alltoallw.c b/src/mpi/coll/alltoallw.c
index 11758bb..31e7a1e 100644
--- a/src/mpi/coll/alltoallw.c
+++ b/src/mpi/coll/alltoallw.c
@@ -466,7 +466,7 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[],
int i, comm_size;
int check_send;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
check_send = (comm_ptr->comm_kind == MPID_INTRACOMM && sendbuf != MPI_IN_PLACE);
diff --git a/src/mpi/coll/barrier.c b/src/mpi/coll/barrier.c
index 0e1ff06..96813d8 100644
--- a/src/mpi/coll/barrier.c
+++ b/src/mpi/coll/barrier.c
@@ -403,7 +403,7 @@ int MPI_Barrier( MPI_Comm comm )
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate communicator */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
diff --git a/src/mpi/coll/bcast.c b/src/mpi/coll/bcast.c
index 38f3757..836dd4d 100644
--- a/src/mpi/coll/bcast.c
+++ b/src/mpi/coll/bcast.c
@@ -1564,7 +1564,7 @@ int MPI_Bcast( void *buffer, int count, MPI_Datatype datatype, int root,
{
MPID_Datatype *datatype_ptr = NULL;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
MPIR_ERRTEST_DATATYPE(datatype, "datatype", mpi_errno);
diff --git a/src/mpi/coll/exscan.c b/src/mpi/coll/exscan.c
index 573770f..a83a543 100644
--- a/src/mpi/coll/exscan.c
+++ b/src/mpi/coll/exscan.c
@@ -338,7 +338,7 @@ int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
MPID_Op *op_ptr = NULL;
int rank;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_COMM_INTRA(comm_ptr, mpi_errno);
diff --git a/src/mpi/coll/gather.c b/src/mpi/coll/gather.c
index d31af10..cb87ef2 100644
--- a/src/mpi/coll/gather.c
+++ b/src/mpi/coll/gather.c
@@ -794,7 +794,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPID_Datatype *sendtype_ptr=NULL, *recvtype_ptr=NULL;
int rank;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
diff --git a/src/mpi/coll/gatherv.c b/src/mpi/coll/gatherv.c
index 7134af3..48a265c 100644
--- a/src/mpi/coll/gatherv.c
+++ b/src/mpi/coll/gatherv.c
@@ -319,7 +319,7 @@ int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPID_Datatype *sendtype_ptr=NULL, *recvtype_ptr=NULL;
int i, rank, comm_size;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
diff --git a/src/mpi/coll/iallgather.c b/src/mpi/coll/iallgather.c
index 38c9b32..18d798c 100644
--- a/src/mpi/coll/iallgather.c
+++ b/src/mpi/coll/iallgather.c
@@ -695,7 +695,7 @@ int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (sendbuf != MPI_IN_PLACE && HANDLE_GET_KIND(sendtype) != HANDLE_KIND_BUILTIN) {
MPID_Datatype *sendtype_ptr = NULL;
MPID_Datatype_get_ptr(sendtype, sendtype_ptr);
diff --git a/src/mpi/coll/iallgatherv.c b/src/mpi/coll/iallgatherv.c
index 8fd90a2..5d5fd15 100644
--- a/src/mpi/coll/iallgatherv.c
+++ b/src/mpi/coll/iallgatherv.c
@@ -798,7 +798,7 @@ int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, v
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (sendbuf != MPI_IN_PLACE) {
diff --git a/src/mpi/coll/iallreduce.c b/src/mpi/coll/iallreduce.c
index e2b2e8b..3ff69f4 100644
--- a/src/mpi/coll/iallreduce.c
+++ b/src/mpi/coll/iallreduce.c
@@ -750,7 +750,7 @@ int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count,
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN) {
MPID_Datatype *datatype_ptr = NULL;
MPID_Datatype_get_ptr(datatype, datatype_ptr);
diff --git a/src/mpi/coll/ialltoall.c b/src/mpi/coll/ialltoall.c
index a8ef91c..6b18b47 100644
--- a/src/mpi/coll/ialltoall.c
+++ b/src/mpi/coll/ialltoall.c
@@ -626,7 +626,7 @@ int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (sendbuf != MPI_IN_PLACE && HANDLE_GET_KIND(sendtype) != HANDLE_KIND_BUILTIN) {
diff --git a/src/mpi/coll/ialltoallv.c b/src/mpi/coll/ialltoallv.c
index 595fd79..93b1f63 100644
--- a/src/mpi/coll/ialltoallv.c
+++ b/src/mpi/coll/ialltoallv.c
@@ -356,7 +356,7 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (sendbuf != MPI_IN_PLACE) {
diff --git a/src/mpi/coll/ialltoallw.c b/src/mpi/coll/ialltoallw.c
index a6727a2..9651b19 100644
--- a/src/mpi/coll/ialltoallw.c
+++ b/src/mpi/coll/ialltoallw.c
@@ -358,7 +358,7 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (sendbuf != MPI_IN_PLACE) {
diff --git a/src/mpi/coll/ibarrier.c b/src/mpi/coll/ibarrier.c
index 7b558c7..6b36160 100644
--- a/src/mpi/coll/ibarrier.c
+++ b/src/mpi/coll/ibarrier.c
@@ -272,7 +272,7 @@ int MPI_Ibarrier(MPI_Comm comm, MPI_Request *request)
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_ARGNULL(request,"request", mpi_errno);
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
diff --git a/src/mpi/coll/ibcast.c b/src/mpi/coll/ibcast.c
index 812cfd1..a35bcd5 100644
--- a/src/mpi/coll/ibcast.c
+++ b/src/mpi/coll/ibcast.c
@@ -958,7 +958,7 @@ int MPI_Ibcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Com
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN) {
diff --git a/src/mpi/coll/iexscan.c b/src/mpi/coll/iexscan.c
index a1f706e..d5dbb3f 100644
--- a/src/mpi/coll/iexscan.c
+++ b/src/mpi/coll/iexscan.c
@@ -287,7 +287,7 @@ int MPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
MPIR_ERRTEST_COMM_INTRA(comm_ptr, mpi_errno);
if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN) {
MPID_Datatype *datatype_ptr = NULL;
diff --git a/src/mpi/coll/igather.c b/src/mpi/coll/igather.c
index f17238c..5fa603a 100644
--- a/src/mpi/coll/igather.c
+++ b/src/mpi/coll/igather.c
@@ -626,7 +626,7 @@ int MPI_Igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPID_Datatype *sendtype_ptr=NULL, *recvtype_ptr=NULL;
int rank;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
diff --git a/src/mpi/coll/igatherv.c b/src/mpi/coll/igatherv.c
index 1c492b4..c5d7426 100644
--- a/src/mpi/coll/igatherv.c
+++ b/src/mpi/coll/igatherv.c
@@ -220,7 +220,7 @@ int MPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void
MPID_Datatype *sendtype_ptr=NULL, *recvtype_ptr=NULL;
int i, rank, comm_size;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
diff --git a/src/mpi/coll/ired_scat.c b/src/mpi/coll/ired_scat.c
index bc74aac..884c8da 100644
--- a/src/mpi/coll/ired_scat.c
+++ b/src/mpi/coll/ired_scat.c
@@ -1114,7 +1114,7 @@ int MPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_ARGNULL(recvcounts,"recvcounts", mpi_errno);
diff --git a/src/mpi/coll/ired_scat_block.c b/src/mpi/coll/ired_scat_block.c
index 04fa432..3368ea4 100644
--- a/src/mpi/coll/ired_scat_block.c
+++ b/src/mpi/coll/ired_scat_block.c
@@ -1018,7 +1018,7 @@ int MPI_Ireduce_scatter_block(const void *sendbuf, void *recvbuf,
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN) {
MPID_Datatype *datatype_ptr = NULL;
MPID_Datatype_get_ptr(datatype, datatype_ptr);
diff --git a/src/mpi/coll/ireduce.c b/src/mpi/coll/ireduce.c
index 5f31903..e5736ce 100644
--- a/src/mpi/coll/ireduce.c
+++ b/src/mpi/coll/ireduce.c
@@ -869,7 +869,7 @@ int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype data
{
int rank;
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN) {
MPID_Datatype *datatype_ptr = NULL;
MPID_Datatype_get_ptr(datatype, datatype_ptr);
diff --git a/src/mpi/coll/iscan.c b/src/mpi/coll/iscan.c
index c8fa41e..ff7f6b2 100644
--- a/src/mpi/coll/iscan.c
+++ b/src/mpi/coll/iscan.c
@@ -422,7 +422,7 @@ int MPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_COMM_INTRA(comm_ptr, mpi_errno);
diff --git a/src/mpi/coll/iscatter.c b/src/mpi/coll/iscatter.c
index 8c51ed4..0f7beed 100644
--- a/src/mpi/coll/iscatter.c
+++ b/src/mpi/coll/iscatter.c
@@ -652,7 +652,7 @@ int MPI_Iscatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPID_BEGIN_ERROR_CHECKS
{
MPID_Datatype *sendtype_ptr, *recvtype_ptr;
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
MPIR_ERRTEST_INTRA_ROOT(comm_ptr, root, mpi_errno);
diff --git a/src/mpi/coll/iscatterv.c b/src/mpi/coll/iscatterv.c
index eca8081..56257b4 100644
--- a/src/mpi/coll/iscatterv.c
+++ b/src/mpi/coll/iscatterv.c
@@ -229,7 +229,7 @@ int MPI_Iscatterv(const void *sendbuf, const int sendcounts[], const int displs[
MPID_Datatype *sendtype_ptr=NULL, *recvtype_ptr=NULL;
int i, comm_size, rank;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
diff --git a/src/mpi/coll/red_scat.c b/src/mpi/coll/red_scat.c
index ebf63e8..46949f6 100644
--- a/src/mpi/coll/red_scat.c
+++ b/src/mpi/coll/red_scat.c
@@ -1154,7 +1154,7 @@ int MPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[
MPID_Op *op_ptr = NULL;
int i, size, sum;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
size = comm_ptr->local_size;
diff --git a/src/mpi/coll/red_scat_block.c b/src/mpi/coll/red_scat_block.c
index 2cd929e..45b6b30 100644
--- a/src/mpi/coll/red_scat_block.c
+++ b/src/mpi/coll/red_scat_block.c
@@ -1125,7 +1125,7 @@ int MPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf,
MPID_Datatype *datatype_ptr = NULL;
MPID_Op *op_ptr = NULL;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_COUNT(recvcount,mpi_errno);
diff --git a/src/mpi/coll/reduce.c b/src/mpi/coll/reduce.c
index 41acffc..ff482f2 100644
--- a/src/mpi/coll/reduce.c
+++ b/src/mpi/coll/reduce.c
@@ -1163,7 +1163,7 @@ int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
MPID_Op *op_ptr = NULL;
int rank;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
diff --git a/src/mpi/coll/scan.c b/src/mpi/coll/scan.c
index 8a6557b..c9965e2 100644
--- a/src/mpi/coll/scan.c
+++ b/src/mpi/coll/scan.c
@@ -522,7 +522,7 @@ int MPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
MPID_Datatype *datatype_ptr = NULL;
MPID_Op *op_ptr = NULL;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_COMM_INTRA(comm_ptr, mpi_errno);
diff --git a/src/mpi/coll/scatter.c b/src/mpi/coll/scatter.c
index f3029ad..852861f 100644
--- a/src/mpi/coll/scatter.c
+++ b/src/mpi/coll/scatter.c
@@ -707,7 +707,7 @@ int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPID_Datatype *sendtype_ptr=NULL, *recvtype_ptr=NULL;
int rank;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
diff --git a/src/mpi/coll/scatterv.c b/src/mpi/coll/scatterv.c
index ce4b29e..485fde8 100644
--- a/src/mpi/coll/scatterv.c
+++ b/src/mpi/coll/scatterv.c
@@ -266,7 +266,7 @@ int MPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
MPID_Datatype *sendtype_ptr=NULL, *recvtype_ptr=NULL;
int i, comm_size, rank;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
diff --git a/src/mpi/comm/comm_agree.c b/src/mpi/comm/comm_agree.c
index 3ee995e..870f43d 100644
--- a/src/mpi/comm/comm_agree.c
+++ b/src/mpi/comm/comm_agree.c
@@ -150,9 +150,8 @@ int MPIX_Comm_agree(MPI_Comm comm, int *flag)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
- if (MPIX_ERR_REVOKED != MPIR_ERR_GET_CLASS(mpi_errno) && mpi_errno)
- goto fn_fail;
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
+ if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
}
diff --git a/src/mpi/comm/comm_compare.c b/src/mpi/comm/comm_compare.c
index 37d5a5d..42ee9e1 100644
--- a/src/mpi/comm/comm_compare.c
+++ b/src/mpi/comm/comm_compare.c
@@ -101,9 +101,9 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr1, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr1, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
- MPID_Comm_valid_ptr( comm_ptr2, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr2, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_ARGNULL( result, "result", mpi_errno );
}
diff --git a/src/mpi/comm/comm_create.c b/src/mpi/comm/comm_create.c
index 4bb63bb..3825f6f 100644
--- a/src/mpi/comm/comm_create.c
+++ b/src/mpi/comm/comm_create.c
@@ -543,7 +543,7 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* If comm_ptr is not valid, it will be reset to null */
/* only test for MPI_GROUP_NULL after attempting to convert the comm
diff --git a/src/mpi/comm/comm_create_group.c b/src/mpi/comm/comm_create_group.c
index 2ce1419..7be2949 100644
--- a/src/mpi/comm/comm_create_group.c
+++ b/src/mpi/comm/comm_create_group.c
@@ -175,7 +175,7 @@ int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm * ne
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_COMM_INTRA(comm_ptr, mpi_errno);
diff --git a/src/mpi/comm/comm_dup.c b/src/mpi/comm/comm_dup.c
index aadba80..0137833 100644
--- a/src/mpi/comm/comm_dup.c
+++ b/src/mpi/comm/comm_dup.c
@@ -147,7 +147,7 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(newcomm, "newcomm", mpi_errno);
diff --git a/src/mpi/comm/comm_dup_with_info.c b/src/mpi/comm/comm_dup_with_info.c
index 476a9fa..dc82c4d 100644
--- a/src/mpi/comm/comm_dup_with_info.c
+++ b/src/mpi/comm/comm_dup_with_info.c
@@ -118,9 +118,8 @@ int MPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
- if (mpi_errno)
- goto fn_fail;
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
+ if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(newcomm, "newcomm", mpi_errno);
}
diff --git a/src/mpi/comm/comm_failure_ack.c b/src/mpi/comm/comm_failure_ack.c
index 7f2dab8..4337eb3 100644
--- a/src/mpi/comm/comm_failure_ack.c
+++ b/src/mpi/comm/comm_failure_ack.c
@@ -79,7 +79,7 @@ int MPIX_Comm_failure_ack( MPI_Comm comm )
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
diff --git a/src/mpi/comm/comm_failure_get_acked.c b/src/mpi/comm/comm_failure_get_acked.c
index 83d9eda..aac0c95 100644
--- a/src/mpi/comm/comm_failure_get_acked.c
+++ b/src/mpi/comm/comm_failure_get_acked.c
@@ -83,7 +83,7 @@ int MPIX_Comm_failure_get_acked( MPI_Comm comm, MPI_Group *failedgrp )
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
diff --git a/src/mpi/comm/comm_free.c b/src/mpi/comm/comm_free.c
index 7e4eb9e..9046745 100644
--- a/src/mpi/comm/comm_free.c
+++ b/src/mpi/comm/comm_free.c
@@ -105,7 +105,7 @@ int MPI_Comm_free(MPI_Comm *comm)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
/* Cannot free the predefined communicators */
diff --git a/src/mpi/comm/comm_get_info.c b/src/mpi/comm/comm_get_info.c
index f3bc876..75d99c4 100644
--- a/src/mpi/comm/comm_get_info.c
+++ b/src/mpi/comm/comm_get_info.c
@@ -107,9 +107,8 @@ int MPI_Comm_get_info(MPI_Comm comm, MPI_Info * info_used)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate pointers */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
- if (mpi_errno)
- goto fn_fail;
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
+ if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
}
diff --git a/src/mpi/comm/comm_get_name.c b/src/mpi/comm/comm_get_name.c
index 574f1dd..0d05f5a 100644
--- a/src/mpi/comm/comm_get_name.c
+++ b/src/mpi/comm/comm_get_name.c
@@ -92,7 +92,7 @@ int MPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen)
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
diff --git a/src/mpi/comm/comm_group.c b/src/mpi/comm/comm_group.c
index ba758e5..075e734 100644
--- a/src/mpi/comm/comm_group.c
+++ b/src/mpi/comm/comm_group.c
@@ -148,8 +148,8 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
- /* If comm_ptr is not valid, it will be reset to null */
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
+ /* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
diff --git a/src/mpi/comm/comm_idup.c b/src/mpi/comm/comm_idup.c
index 5ceecc1..d434761 100644
--- a/src/mpi/comm/comm_idup.c
+++ b/src/mpi/comm/comm_idup.c
@@ -123,7 +123,7 @@ int MPI_Comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request)
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_ARGNULL(request, "request", mpi_errno);
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
diff --git a/src/mpi/comm/comm_rank.c b/src/mpi/comm/comm_rank.c
index 4694319..89ece48 100644
--- a/src/mpi/comm/comm_rank.c
+++ b/src/mpi/comm/comm_rank.c
@@ -81,8 +81,8 @@ int MPI_Comm_rank( MPI_Comm comm, int *rank )
{
MPIR_ERRTEST_ARGNULL(rank,"rank",mpi_errno);
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
- /* If comm_ptr is not value, it will be reset to null */
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
+ /* If comm_ptr is not value, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
diff --git a/src/mpi/comm/comm_remote_group.c b/src/mpi/comm/comm_remote_group.c
index 1a97702..c71e11c 100644
--- a/src/mpi/comm/comm_remote_group.c
+++ b/src/mpi/comm/comm_remote_group.c
@@ -129,7 +129,7 @@ int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (comm_ptr && comm_ptr->comm_kind != MPID_INTERCOMM) {
mpi_errno = MPIR_Err_create_code( MPI_SUCCESS,
diff --git a/src/mpi/comm/comm_remote_size.c b/src/mpi/comm/comm_remote_size.c
index 72e73e4..853d7b3 100644
--- a/src/mpi/comm/comm_remote_size.c
+++ b/src/mpi/comm/comm_remote_size.c
@@ -82,7 +82,7 @@ int MPI_Comm_remote_size(MPI_Comm comm, int *size)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (comm_ptr && comm_ptr->comm_kind != MPID_INTERCOMM) {
mpi_errno = MPIR_Err_create_code( MPI_SUCCESS,
diff --git a/src/mpi/comm/comm_set_info.c b/src/mpi/comm/comm_set_info.c
index 2bf3c8f..e6940a8 100644
--- a/src/mpi/comm/comm_set_info.c
+++ b/src/mpi/comm/comm_set_info.c
@@ -127,9 +127,8 @@ int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate pointers */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
- if (mpi_errno)
- goto fn_fail;
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
+ if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
}
diff --git a/src/mpi/comm/comm_set_name.c b/src/mpi/comm/comm_set_name.c
index 75aa49a..3196b4f 100644
--- a/src/mpi/comm/comm_set_name.c
+++ b/src/mpi/comm/comm_set_name.c
@@ -77,7 +77,7 @@ int MPI_Comm_set_name(MPI_Comm comm, const char *comm_name)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_ARGNULL( comm_name, "comm_name", mpi_errno );
/* If comm_ptr is not valid, it will be reset to null */
diff --git a/src/mpi/comm/comm_shrink.c b/src/mpi/comm/comm_shrink.c
index 7eaba35..24560e7 100644
--- a/src/mpi/comm/comm_shrink.c
+++ b/src/mpi/comm/comm_shrink.c
@@ -138,9 +138,8 @@ int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
- if (MPIX_ERR_REVOKED != MPIR_ERR_GET_CLASS(mpi_errno) && mpi_errno)
- goto fn_fail;
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
+ if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
}
diff --git a/src/mpi/comm/comm_size.c b/src/mpi/comm/comm_size.c
index 7fc6276..412c5ff 100644
--- a/src/mpi/comm/comm_size.c
+++ b/src/mpi/comm/comm_size.c
@@ -84,7 +84,7 @@ int MPI_Comm_size( MPI_Comm comm, int *size )
{
MPIR_ERRTEST_ARGNULL(size,"size",mpi_errno);
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
diff --git a/src/mpi/comm/comm_split.c b/src/mpi/comm/comm_split.c
index 02a8276..6a60d28 100644
--- a/src/mpi/comm/comm_split.c
+++ b/src/mpi/comm/comm_split.c
@@ -465,7 +465,7 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
diff --git a/src/mpi/comm/comm_split_type.c b/src/mpi/comm/comm_split_type.c
index 5e5d685..829e352 100644
--- a/src/mpi/comm/comm_split_type.c
+++ b/src/mpi/comm/comm_split_type.c
@@ -127,7 +127,7 @@ int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno)
goto fn_fail;
diff --git a/src/mpi/comm/comm_test_inter.c b/src/mpi/comm/comm_test_inter.c
index 4297c2c..46878af 100644
--- a/src/mpi/comm/comm_test_inter.c
+++ b/src/mpi/comm/comm_test_inter.c
@@ -81,7 +81,7 @@ int MPI_Comm_test_inter(MPI_Comm comm, int *flag)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(flag,"flag",mpi_errno);
diff --git a/src/mpi/comm/intercomm_create.c b/src/mpi/comm/intercomm_create.c
index d38d61a..b0a9c6e 100644
--- a/src/mpi/comm/intercomm_create.c
+++ b/src/mpi/comm/intercomm_create.c
@@ -516,7 +516,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate local_comm_ptr */
- MPID_Comm_valid_ptr( local_comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( local_comm_ptr, mpi_errno, FALSE );
if (local_comm_ptr) {
/* Only check if local_comm_ptr valid */
MPIR_ERRTEST_COMM_INTRA(local_comm_ptr, mpi_errno );
@@ -544,7 +544,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( peer_comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( peer_comm_ptr, mpi_errno, FALSE );
/* Note: In MPI 1.0, peer_comm was restricted to
intracommunicators. In 1.1, it may be any communicator */
diff --git a/src/mpi/comm/intercomm_merge.c b/src/mpi/comm/intercomm_merge.c
index 10b662a..90b7c15 100644
--- a/src/mpi/comm/intercomm_merge.c
+++ b/src/mpi/comm/intercomm_merge.c
@@ -258,7 +258,7 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* If comm_ptr is not valid, it will be reset to null */
if (comm_ptr && comm_ptr->comm_kind != MPID_INTERCOMM) {
mpi_errno = MPIR_Err_create_code( MPI_SUCCESS,
diff --git a/src/mpi/datatype/pack.c b/src/mpi/datatype/pack.c
index 21e00f7..01b007d 100644
--- a/src/mpi/datatype/pack.c
+++ b/src/mpi/datatype/pack.c
@@ -191,7 +191,7 @@ int MPI_Pack(const void *inbuf,
MPIR_ERRTEST_ARGNULL(position, "position", mpi_errno);
/* Validate comm_ptr */
/* If comm_ptr is not valid, it will be reset to null */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_DATATYPE(datatype, "datatype", mpi_errno);
diff --git a/src/mpi/datatype/pack_size.c b/src/mpi/datatype/pack_size.c
index aa48a5b..49b1cdf 100644
--- a/src/mpi/datatype/pack_size.c
+++ b/src/mpi/datatype/pack_size.c
@@ -110,7 +110,7 @@ int MPI_Pack_size(int incount,
MPIR_ERRTEST_COUNT(incount, mpi_errno);
MPIR_ERRTEST_ARGNULL(size, "size", mpi_errno);
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_DATATYPE(datatype, "datatype", mpi_errno);
diff --git a/src/mpi/datatype/unpack.c b/src/mpi/datatype/unpack.c
index 997c811..f5594ea 100644
--- a/src/mpi/datatype/unpack.c
+++ b/src/mpi/datatype/unpack.c
@@ -175,7 +175,7 @@ int MPI_Unpack(const void *inbuf, int insize, int *position,
MPIR_ERRTEST_COUNT(outcount, mpi_errno);
/* Validate comm_ptr */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
diff --git a/src/mpi/errhan/comm_call_errhandler.c b/src/mpi/errhan/comm_call_errhandler.c
index 36144f6..2f780eb 100644
--- a/src/mpi/errhan/comm_call_errhandler.c
+++ b/src/mpi/errhan/comm_call_errhandler.c
@@ -87,7 +87,7 @@ int MPI_Comm_call_errhandler(MPI_Comm comm, int errorcode)
{
/* Validate comm_ptr; if comm_ptr is not value, it will be reset
to null */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (comm_ptr->errhandler) {
diff --git a/src/mpi/errhan/comm_get_errhandler.c b/src/mpi/errhan/comm_get_errhandler.c
index c57fdf0..e705cf2 100644
--- a/src/mpi/errhan/comm_get_errhandler.c
+++ b/src/mpi/errhan/comm_get_errhandler.c
@@ -97,7 +97,7 @@ int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr; if comm_ptr is not valid, it will be reset to null */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_ARGNULL(errhandler,"errhandler",mpi_errno);
}
diff --git a/src/mpi/errhan/comm_set_errhandler.c b/src/mpi/errhan/comm_set_errhandler.c
index 65812e4..872de46 100644
--- a/src/mpi/errhan/comm_set_errhandler.c
+++ b/src/mpi/errhan/comm_set_errhandler.c
@@ -110,7 +110,7 @@ int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr; if comm_ptr is not valid, it will be reset to null */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (HANDLE_GET_KIND(errhandler) != HANDLE_KIND_BUILTIN) {
MPID_Errhandler_valid_ptr( errhan_ptr, mpi_errno );
diff --git a/src/mpi/errhan/errhandler_get.c b/src/mpi/errhan/errhandler_get.c
index bbbe345..9d58d6b 100644
--- a/src/mpi/errhan/errhandler_get.c
+++ b/src/mpi/errhan/errhandler_get.c
@@ -93,7 +93,7 @@ int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr; if comm_ptr is not value, it will be reset to null */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_ARGNULL(errhandler, "errhandler", mpi_errno);
}
diff --git a/src/mpi/errhan/errhandler_set.c b/src/mpi/errhan/errhandler_set.c
index 63c85c8..1b95e2c 100644
--- a/src/mpi/errhan/errhandler_set.c
+++ b/src/mpi/errhan/errhandler_set.c
@@ -85,7 +85,7 @@ int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr; if comm_ptr is not value, it will be reset to null */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_ERRHANDLER(errhandler, mpi_errno);
diff --git a/src/mpi/init/abort.c b/src/mpi/init/abort.c
index fabc013..be2ce16 100644
--- a/src/mpi/init/abort.c
+++ b/src/mpi/init/abort.c
@@ -109,7 +109,7 @@ int MPI_Abort(MPI_Comm comm, int errorcode)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
diff --git a/src/mpi/pt2pt/bsend.c b/src/mpi/pt2pt/bsend.c
index 7049ced..d4d3088 100644
--- a/src/mpi/pt2pt/bsend.c
+++ b/src/mpi/pt2pt/bsend.c
@@ -121,7 +121,7 @@ int MPI_Bsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
{
MPIR_ERRTEST_COUNT(count,mpi_errno);
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
if (comm_ptr) {
diff --git a/src/mpi/pt2pt/bsend_init.c b/src/mpi/pt2pt/bsend_init.c
index b6e6e63..b495e5f 100644
--- a/src/mpi/pt2pt/bsend_init.c
+++ b/src/mpi/pt2pt/bsend_init.c
@@ -92,7 +92,7 @@ int MPI_Bsend_init(const void *buf, int count, MPI_Datatype datatype,
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/ibsend.c b/src/mpi/pt2pt/ibsend.c
index 9fc7560..af2b5cc 100644
--- a/src/mpi/pt2pt/ibsend.c
+++ b/src/mpi/pt2pt/ibsend.c
@@ -198,7 +198,7 @@ int MPI_Ibsend(const void *buf, int count, MPI_Datatype datatype, int dest, int
{
MPIR_ERRTEST_COUNT(count,mpi_errno);
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
if (comm_ptr) {
diff --git a/src/mpi/pt2pt/improbe.c b/src/mpi/pt2pt/improbe.c
index 80cd187..400f2df 100644
--- a/src/mpi/pt2pt/improbe.c
+++ b/src/mpi/pt2pt/improbe.c
@@ -83,7 +83,7 @@ int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *mess
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_ARGNULL(flag, "flag", mpi_errno);
diff --git a/src/mpi/pt2pt/iprobe.c b/src/mpi/pt2pt/iprobe.c
index 7bfc17c..96f74d3 100644
--- a/src/mpi/pt2pt/iprobe.c
+++ b/src/mpi/pt2pt/iprobe.c
@@ -87,7 +87,7 @@ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate communicator */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_ARGNULL( flag, "flag", mpi_errno );
diff --git a/src/mpi/pt2pt/irecv.c b/src/mpi/pt2pt/irecv.c
index c9b832b..ee9aa85 100644
--- a/src/mpi/pt2pt/irecv.c
+++ b/src/mpi/pt2pt/irecv.c
@@ -91,7 +91,7 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/irsend.c b/src/mpi/pt2pt/irsend.c
index 3035910..e2c6f5e 100644
--- a/src/mpi/pt2pt/irsend.c
+++ b/src/mpi/pt2pt/irsend.c
@@ -92,7 +92,7 @@ int MPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest, int
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/isend.c b/src/mpi/pt2pt/isend.c
index dc37463..cbb6324 100644
--- a/src/mpi/pt2pt/isend.c
+++ b/src/mpi/pt2pt/isend.c
@@ -90,7 +90,7 @@ int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/issend.c b/src/mpi/pt2pt/issend.c
index 4924583..642082c 100644
--- a/src/mpi/pt2pt/issend.c
+++ b/src/mpi/pt2pt/issend.c
@@ -91,7 +91,7 @@ int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/mprobe.c b/src/mpi/pt2pt/mprobe.c
index ec88688..e791ef5 100644
--- a/src/mpi/pt2pt/mprobe.c
+++ b/src/mpi/pt2pt/mprobe.c
@@ -81,7 +81,7 @@ int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Sta
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
diff --git a/src/mpi/pt2pt/probe.c b/src/mpi/pt2pt/probe.c
index 840258d..00eaa20 100644
--- a/src/mpi/pt2pt/probe.c
+++ b/src/mpi/pt2pt/probe.c
@@ -83,7 +83,7 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate communicator */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_RECV_TAG(tag,mpi_errno);
diff --git a/src/mpi/pt2pt/recv.c b/src/mpi/pt2pt/recv.c
index bede1e0..41eeff8 100644
--- a/src/mpi/pt2pt/recv.c
+++ b/src/mpi/pt2pt/recv.c
@@ -100,7 +100,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/recv_init.c b/src/mpi/pt2pt/recv_init.c
index 23556ce..3f16c60 100644
--- a/src/mpi/pt2pt/recv_init.c
+++ b/src/mpi/pt2pt/recv_init.c
@@ -93,7 +93,7 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source,
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/rsend.c b/src/mpi/pt2pt/rsend.c
index 82394f1..eaf6f09 100644
--- a/src/mpi/pt2pt/rsend.c
+++ b/src/mpi/pt2pt/rsend.c
@@ -88,7 +88,7 @@ int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/rsend_init.c b/src/mpi/pt2pt/rsend_init.c
index 3061168..f39284d 100644
--- a/src/mpi/pt2pt/rsend_init.c
+++ b/src/mpi/pt2pt/rsend_init.c
@@ -93,7 +93,7 @@ int MPI_Rsend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/send.c b/src/mpi/pt2pt/send.c
index 4671235..77dc0fe 100644
--- a/src/mpi/pt2pt/send.c
+++ b/src/mpi/pt2pt/send.c
@@ -93,7 +93,7 @@ int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int ta
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/send_init.c b/src/mpi/pt2pt/send_init.c
index 3002fa9..c20b136 100644
--- a/src/mpi/pt2pt/send_init.c
+++ b/src/mpi/pt2pt/send_init.c
@@ -93,7 +93,7 @@ int MPI_Send_init(const void *buf, int count, MPI_Datatype datatype, int dest,
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/sendrecv.c b/src/mpi/pt2pt/sendrecv.c
index e8a1b9f..bc9c374 100644
--- a/src/mpi/pt2pt/sendrecv.c
+++ b/src/mpi/pt2pt/sendrecv.c
@@ -104,7 +104,7 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate communicator */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
/* Validate count */
diff --git a/src/mpi/pt2pt/sendrecv_rep.c b/src/mpi/pt2pt/sendrecv_rep.c
index c928bec..3c48c9d 100644
--- a/src/mpi/pt2pt/sendrecv_rep.c
+++ b/src/mpi/pt2pt/sendrecv_rep.c
@@ -92,7 +92,7 @@ int MPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate communicator */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
/* Validate count */
diff --git a/src/mpi/pt2pt/ssend.c b/src/mpi/pt2pt/ssend.c
index 197a4fd..60dd92e 100644
--- a/src/mpi/pt2pt/ssend.c
+++ b/src/mpi/pt2pt/ssend.c
@@ -87,7 +87,7 @@ int MPI_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/pt2pt/ssend_init.c b/src/mpi/pt2pt/ssend_init.c
index 92470a6..2b30a47 100644
--- a/src/mpi/pt2pt/ssend_init.c
+++ b/src/mpi/pt2pt/ssend_init.c
@@ -90,7 +90,7 @@ int MPI_Ssend_init(const void *buf, int count, MPI_Datatype datatype, int dest,
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_COUNT(count, mpi_errno);
diff --git a/src/mpi/rma/win_allocate.c b/src/mpi/rma/win_allocate.c
index 47c797a..82348f5 100644
--- a/src/mpi/rma/win_allocate.c
+++ b/src/mpi/rma/win_allocate.c
@@ -106,7 +106,7 @@ int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate pointers */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (size < 0)
mpi_errno = MPIR_Err_create_code( MPI_SUCCESS,
diff --git a/src/mpi/rma/win_allocate_shared.c b/src/mpi/rma/win_allocate_shared.c
index fac911f..8da1b5d 100644
--- a/src/mpi/rma/win_allocate_shared.c
+++ b/src/mpi/rma/win_allocate_shared.c
@@ -116,7 +116,7 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Com
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate pointers */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIU_ERR_CHKANDJUMP1(disp_unit <= 0, mpi_errno, MPI_ERR_ARG,
diff --git a/src/mpi/rma/win_create.c b/src/mpi/rma/win_create.c
index 5cb8d73..96e84b9 100644
--- a/src/mpi/rma/win_create.c
+++ b/src/mpi/rma/win_create.c
@@ -134,7 +134,7 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate pointers */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (size < 0)
mpi_errno = MPIR_Err_create_code( MPI_SUCCESS,
diff --git a/src/mpi/rma/win_create_dynamic.c b/src/mpi/rma/win_create_dynamic.c
index a0d9ba3..2acf081 100644
--- a/src/mpi/rma/win_create_dynamic.c
+++ b/src/mpi/rma/win_create_dynamic.c
@@ -122,7 +122,7 @@ int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate pointers */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
diff --git a/src/mpi/spawn/comm_accept.c b/src/mpi/spawn/comm_accept.c
index dccf247..d1ab223 100644
--- a/src/mpi/spawn/comm_accept.c
+++ b/src/mpi/spawn/comm_accept.c
@@ -100,7 +100,7 @@ int MPI_Comm_accept(const char *port_name, MPI_Info info, int root, MPI_Comm com
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
diff --git a/src/mpi/spawn/comm_connect.c b/src/mpi/spawn/comm_connect.c
index 141f3b4..6d16e46 100644
--- a/src/mpi/spawn/comm_connect.c
+++ b/src/mpi/spawn/comm_connect.c
@@ -99,7 +99,7 @@ int MPI_Comm_connect(const char *port_name, MPI_Info info, int root, MPI_Comm co
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
diff --git a/src/mpi/spawn/comm_disconnect.c b/src/mpi/spawn/comm_disconnect.c
index 8a50774..5812a25 100644
--- a/src/mpi/spawn/comm_disconnect.c
+++ b/src/mpi/spawn/comm_disconnect.c
@@ -82,7 +82,7 @@ int MPI_Comm_disconnect(MPI_Comm * comm)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno)
{
diff --git a/src/mpi/spawn/comm_spawn.c b/src/mpi/spawn/comm_spawn.c
index 49c307d..7749ab2 100644
--- a/src/mpi/spawn/comm_spawn.c
+++ b/src/mpi/spawn/comm_spawn.c
@@ -95,7 +95,7 @@ int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info inf
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
diff --git a/src/mpi/spawn/comm_spawn_multiple.c b/src/mpi/spawn/comm_spawn_multiple.c
index 4d22ee4..845ef62 100644
--- a/src/mpi/spawn/comm_spawn_multiple.c
+++ b/src/mpi/spawn/comm_spawn_multiple.c
@@ -101,7 +101,7 @@ int MPI_Comm_spawn_multiple(int count, char *array_of_commands[],
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
diff --git a/src/mpi/topo/cart_coords.c b/src/mpi/topo/cart_coords.c
index 6b3a3c5..67f3681 100644
--- a/src/mpi/topo/cart_coords.c
+++ b/src/mpi/topo/cart_coords.c
@@ -88,7 +88,7 @@ int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int coords[])
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
diff --git a/src/mpi/topo/cart_create.c b/src/mpi/topo/cart_create.c
index 494557a..ff26d5f 100644
--- a/src/mpi/topo/cart_create.c
+++ b/src/mpi/topo/cart_create.c
@@ -268,7 +268,7 @@ int MPI_Cart_create(MPI_Comm comm_old, int ndims, const int dims[],
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
if (comm_ptr) {
diff --git a/src/mpi/topo/cart_get.c b/src/mpi/topo/cart_get.c
index 8b0c95b..2789010 100644
--- a/src/mpi/topo/cart_get.c
+++ b/src/mpi/topo/cart_get.c
@@ -92,7 +92,7 @@ int MPI_Cart_get(MPI_Comm comm, int maxdims, int dims[], int periods[],
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
diff --git a/src/mpi/topo/cart_map.c b/src/mpi/topo/cart_map.c
index 000df13..2bd4c81 100644
--- a/src/mpi/topo/cart_map.c
+++ b/src/mpi/topo/cart_map.c
@@ -158,7 +158,7 @@ int MPI_Cart_map(MPI_Comm comm, int ndims, const int dims[], const int periods[]
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(newrank,"newrank",mpi_errno);
diff --git a/src/mpi/topo/cart_rank.c b/src/mpi/topo/cart_rank.c
index c730bb2..9b1963e 100644
--- a/src/mpi/topo/cart_rank.c
+++ b/src/mpi/topo/cart_rank.c
@@ -117,7 +117,7 @@ int MPI_Cart_rank(MPI_Comm comm, const int coords[], int *rank)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(rank,"rank",mpi_errno);
diff --git a/src/mpi/topo/cart_shift.c b/src/mpi/topo/cart_shift.c
index 66d4007..626527c 100644
--- a/src/mpi/topo/cart_shift.c
+++ b/src/mpi/topo/cart_shift.c
@@ -150,7 +150,7 @@ int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
diff --git a/src/mpi/topo/cart_sub.c b/src/mpi/topo/cart_sub.c
index 551ed89..7a7527c 100644
--- a/src/mpi/topo/cart_sub.c
+++ b/src/mpi/topo/cart_sub.c
@@ -91,7 +91,7 @@ int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
diff --git a/src/mpi/topo/cartdim_get.c b/src/mpi/topo/cartdim_get.c
index 7f28efb..0fffc29 100644
--- a/src/mpi/topo/cartdim_get.c
+++ b/src/mpi/topo/cartdim_get.c
@@ -84,7 +84,7 @@ int MPI_Cartdim_get(MPI_Comm comm, int *ndims)
{
MPIR_ERRTEST_ARGNULL(ndims,"ndims",mpi_errno);
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
/* If comm_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
diff --git a/src/mpi/topo/dist_gr_create.c b/src/mpi/topo/dist_gr_create.c
index 1252087..e8ec351 100644
--- a/src/mpi/topo/dist_gr_create.c
+++ b/src/mpi/topo/dist_gr_create.c
@@ -124,7 +124,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* If comm_ptr is not valid, it will be reset to null */
if (comm_ptr) {
MPIR_ERRTEST_COMM_INTRA(comm_ptr, mpi_errno);
diff --git a/src/mpi/topo/dist_gr_create_adj.c b/src/mpi/topo/dist_gr_create_adj.c
index 215c18a..ddeed10 100644
--- a/src/mpi/topo/dist_gr_create_adj.c
+++ b/src/mpi/topo/dist_gr_create_adj.c
@@ -108,7 +108,7 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
if (comm_ptr) {
diff --git a/src/mpi/topo/dist_gr_neighb_count.c b/src/mpi/topo/dist_gr_neighb_count.c
index b0da3af..39598d4 100644
--- a/src/mpi/topo/dist_gr_neighb_count.c
+++ b/src/mpi/topo/dist_gr_neighb_count.c
@@ -104,7 +104,7 @@ int MPI_Dist_graph_neighbors_count(MPI_Comm comm, int *indegree, int *outdegree,
{
MPID_BEGIN_ERROR_CHECKS;
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_ARGNULL(indegree, "indegree", mpi_errno);
diff --git a/src/mpi/topo/graph_get.c b/src/mpi/topo/graph_get.c
index 7b8d97a..74d8590 100644
--- a/src/mpi/topo/graph_get.c
+++ b/src/mpi/topo/graph_get.c
@@ -89,7 +89,7 @@ int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
diff --git a/src/mpi/topo/graph_map.c b/src/mpi/topo/graph_map.c
index a518e17..475676b 100644
--- a/src/mpi/topo/graph_map.c
+++ b/src/mpi/topo/graph_map.c
@@ -132,7 +132,7 @@ int MPI_Graph_map(MPI_Comm comm, int nnodes, const int indx[], const int edges[]
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(newrank,"newrank",mpi_errno);
diff --git a/src/mpi/topo/graph_nbr.c b/src/mpi/topo/graph_nbr.c
index 2b0aaa1..51c1e0d 100644
--- a/src/mpi/topo/graph_nbr.c
+++ b/src/mpi/topo/graph_nbr.c
@@ -120,7 +120,7 @@ int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors,
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(neighbors,"neighbors",mpi_errno);
diff --git a/src/mpi/topo/graphcreate.c b/src/mpi/topo/graphcreate.c
index 4cb4ff5..e13b073 100644
--- a/src/mpi/topo/graphcreate.c
+++ b/src/mpi/topo/graphcreate.c
@@ -200,7 +200,7 @@ int MPI_Graph_create(MPI_Comm comm_old, int nnodes, const int indx[],
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
if (comm_ptr) {
diff --git a/src/mpi/topo/graphdimsget.c b/src/mpi/topo/graphdimsget.c
index cdf7e00..ff13528 100644
--- a/src/mpi/topo/graphdimsget.c
+++ b/src/mpi/topo/graphdimsget.c
@@ -85,7 +85,7 @@ int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(nnodes, "nnodes", mpi_errno );
diff --git a/src/mpi/topo/graphnbrcnt.c b/src/mpi/topo/graphnbrcnt.c
index c601520..cf0faab 100644
--- a/src/mpi/topo/graphnbrcnt.c
+++ b/src/mpi/topo/graphnbrcnt.c
@@ -112,7 +112,7 @@ int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
MPIR_ERRTEST_ARGNULL(nneighbors, "nneighbors", mpi_errno);
/* If comm_ptr is not value, it will be reset to null */
diff --git a/src/mpi/topo/inhb_allgather.c b/src/mpi/topo/inhb_allgather.c
index 8729486..b310890 100644
--- a/src/mpi/topo/inhb_allgather.c
+++ b/src/mpi/topo/inhb_allgather.c
@@ -190,7 +190,7 @@ int MPI_Ineighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype sen
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_ARGNULL(request, "request", mpi_errno);
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
diff --git a/src/mpi/topo/inhb_allgatherv.c b/src/mpi/topo/inhb_allgatherv.c
index 5ea2111..7513582 100644
--- a/src/mpi/topo/inhb_allgatherv.c
+++ b/src/mpi/topo/inhb_allgatherv.c
@@ -195,7 +195,7 @@ int MPI_Ineighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype se
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_ARGNULL(request, "request", mpi_errno);
diff --git a/src/mpi/topo/inhb_alltoall.c b/src/mpi/topo/inhb_alltoall.c
index 9d94772..5539a32 100644
--- a/src/mpi/topo/inhb_alltoall.c
+++ b/src/mpi/topo/inhb_alltoall.c
@@ -196,7 +196,7 @@ int MPI_Ineighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype send
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_ERRTEST_ARGNULL(request, "request", mpi_errno);
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
diff --git a/src/mpi/topo/inhb_alltoallv.c b/src/mpi/topo/inhb_alltoallv.c
index 330fdf4..2874522 100644
--- a/src/mpi/topo/inhb_alltoallv.c
+++ b/src/mpi/topo/inhb_alltoallv.c
@@ -201,7 +201,7 @@ int MPI_Ineighbor_alltoallv(const void *sendbuf, const int sendcounts[], const i
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
MPIR_ERRTEST_ARGNULL(request, "request", mpi_errno);
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
}
diff --git a/src/mpi/topo/inhb_alltoallw.c b/src/mpi/topo/inhb_alltoallw.c
index 1d0dc2f..46b9db2 100644
--- a/src/mpi/topo/inhb_alltoallw.c
+++ b/src/mpi/topo/inhb_alltoallw.c
@@ -173,7 +173,7 @@ int MPI_Ineighbor_alltoallw(const void *sendbuf, const int sendcounts[], const M
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
MPIR_ERRTEST_ARGNULL(request, "request", mpi_errno);
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
diff --git a/src/mpi/topo/nhb_allgather.c b/src/mpi/topo/nhb_allgather.c
index 2d0c91d..f8823cc 100644
--- a/src/mpi/topo/nhb_allgather.c
+++ b/src/mpi/topo/nhb_allgather.c
@@ -146,7 +146,7 @@ int MPI_Neighbor_allgather(const void *sendbuf, int sendcount, MPI_Datatype send
MPID_Datatype_committed_ptr(recvtype_ptr, mpi_errno);
}
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
diff --git a/src/mpi/topo/nhb_allgatherv.c b/src/mpi/topo/nhb_allgatherv.c
index 2b91abb..22d9171 100644
--- a/src/mpi/topo/nhb_allgatherv.c
+++ b/src/mpi/topo/nhb_allgatherv.c
@@ -147,7 +147,7 @@ int MPI_Neighbor_allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sen
MPID_Datatype_committed_ptr(recvtype_ptr, mpi_errno);
}
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
diff --git a/src/mpi/topo/nhb_alltoall.c b/src/mpi/topo/nhb_alltoall.c
index b5c9520..2f4d4fc 100644
--- a/src/mpi/topo/nhb_alltoall.c
+++ b/src/mpi/topo/nhb_alltoall.c
@@ -150,7 +150,7 @@ int MPI_Neighbor_alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendt
MPID_Datatype_committed_ptr(recvtype_ptr, mpi_errno);
}
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
diff --git a/src/mpi/topo/nhb_alltoallv.c b/src/mpi/topo/nhb_alltoallv.c
index 9451ba1..1a67fe7 100644
--- a/src/mpi/topo/nhb_alltoallv.c
+++ b/src/mpi/topo/nhb_alltoallv.c
@@ -145,7 +145,7 @@ int MPI_Neighbor_alltoallv(const void *sendbuf, const int sendcounts[], const in
MPID_Datatype_committed_ptr(recvtype_ptr, mpi_errno);
}
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
diff --git a/src/mpi/topo/nhb_alltoallw.c b/src/mpi/topo/nhb_alltoallw.c
index 9ebe2ce..8be4077 100644
--- a/src/mpi/topo/nhb_alltoallw.c
+++ b/src/mpi/topo/nhb_alltoallw.c
@@ -130,7 +130,7 @@ int MPI_Neighbor_alltoallw(const void *sendbuf, const int sendcounts[], const MP
{
MPID_BEGIN_ERROR_CHECKS
{
- MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, FALSE );
/* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
diff --git a/src/mpi/topo/topo_test.c b/src/mpi/topo/topo_test.c
index e9f1a6c..62dbb5d 100644
--- a/src/mpi/topo/topo_test.c
+++ b/src/mpi/topo/topo_test.c
@@ -88,7 +88,7 @@ int MPI_Topo_test(MPI_Comm comm, int *status)
MPID_BEGIN_ERROR_CHECKS;
{
/* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
if (mpi_errno) goto fn_fail;
/* If comm_ptr is not valid, it will be reset to null */
MPIR_ERRTEST_ARGNULL(status, "status", mpi_errno);
diff --git a/src/util/procmap/local_proc.c b/src/util/procmap/local_proc.c
index 471b56b..2e9f016 100644
--- a/src/util/procmap/local_proc.c
+++ b/src/util/procmap/local_proc.c
@@ -232,7 +232,7 @@ fn_fail:
int MPIU_Get_internode_rank(MPID_Comm *comm_ptr, int r)
{
int mpi_errno = MPI_SUCCESS;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
MPIU_Assert(mpi_errno == MPI_SUCCESS);
MPIU_Assert(r < comm_ptr->remote_size);
MPIU_Assert(comm_ptr->comm_kind == MPID_INTRACOMM);
@@ -253,7 +253,7 @@ int MPIU_Get_internode_rank(MPID_Comm *comm_ptr, int r)
int MPIU_Get_intranode_rank(MPID_Comm *comm_ptr, int r)
{
int mpi_errno = MPI_SUCCESS;
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
MPIU_Assert(mpi_errno == MPI_SUCCESS);
MPIU_Assert(r < comm_ptr->remote_size);
MPIU_Assert(comm_ptr->comm_kind == MPID_INTRACOMM);
http://git.mpich.org/mpich.git/commitdiff/1f0ee13674dff8ad44c647c4748e677c7…
commit 1f0ee13674dff8ad44c647c4748e677c7fcfb756
Author: Wesley Bland <wbland(a)anl.gov>
Date: Tue Apr 29 21:40:19 2014 -0500
Add MPIX_Comm_agree
Adds function implementing an agreement algorithm for the user. This function
lets the user manually perform an agreement as well as detect unacknowledged
failures.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index 25fa149..33e1181 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -1539,6 +1539,7 @@ int MPIX_Comm_failure_ack(MPI_Comm comm);
int MPIX_Comm_failure_get_acked(MPI_Comm comm, MPI_Group *failedgrp);
int MPIX_Comm_revoke(MPI_Comm comm);
int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm);
+int MPIX_Comm_agree(MPI_Comm comm, int *flag);
/* End Prototypes */
@@ -2178,6 +2179,7 @@ int PMPIX_Comm_failure_ack(MPI_Comm comm);
int PMPIX_Comm_failure_get_acked(MPI_Comm comm, MPI_Group *failedgrp);
int PMPIX_Comm_revoke(MPI_Comm comm);
int PMPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm);
+int PMPIX_Comm_agree(MPI_Comm comm, int *flag);
#endif /* MPI_BUILD_PROFILING */
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 8496922..79a0bc8 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -2827,6 +2827,23 @@ int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_grou
int MPID_Comm_revoke(MPID_Comm *comm, int is_remote);
/*@
+ MPID_Comm_agree - MPID implementation of the last phase of the agreement
+
+ Input Parameters:
+. comm - communicator
+. bitarray - Bit array of all of the failures that have been discovered in comm
+. flag - flag input for agree from MPIX_Comm_agree
+. new_fail - If there is a new failure that we need to propagate, this should be true
+
+ Output Parameters:
+. flag - Bitwise AND of all of the flag input values
+
+ Return Value:
+ 'MPI_SUCCESS' or a valid MPI error code.
+@*/
+int MPID_Comm_agree(MPID_Comm *comm, uint32_t *bitarray, int *flag, int new_fail);
+
+/*@
MPID_Send - MPID entry point for MPI_Send
Notes:
@@ -3812,7 +3829,8 @@ int MPID_VCR_Get_lpid(MPID_VCR vcr, int * lpid_ptr);
#define MPIR_TOPO_B_TAG 27
#define MPIR_REDUCE_SCATTER_BLOCK_TAG 28
#define MPIR_SHRINK_TAG 29
-#define MPIR_FIRST_NBC_TAG 30
+#define MPIR_AGREE_TAG 30
+#define MPIR_FIRST_NBC_TAG 31
/* These macros must be used carefully. These macros will not work with
* negative tags. By definition, users are not to use negative tags and the
@@ -4116,6 +4134,7 @@ void MPIR_Free_err_dyncodes( void );
int MPIR_Comm_idup_impl(MPID_Comm *comm_ptr, MPID_Comm **newcomm, MPID_Request **reqp);
int MPIR_Comm_shrink(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr);
+int MPIR_Comm_agree(MPID_Comm *comm_ptr, int *flag);
int MPIR_Allreduce_group(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
diff --git a/src/mpi/comm/Makefile.mk b/src/mpi/comm/Makefile.mk
index c133981..cb32747 100644
--- a/src/mpi/comm/Makefile.mk
+++ b/src/mpi/comm/Makefile.mk
@@ -30,7 +30,8 @@ mpi_sources += \
src/mpi/comm/comm_failure_ack.c \
src/mpi/comm/comm_failure_get_acked.c \
src/mpi/comm/comm_revoke.c \
- src/mpi/comm/comm_shrink.c
+ src/mpi/comm/comm_shrink.c \
+ src/mpi/comm/comm_agree.c
mpi_core_sources += \
src/mpi/comm/commutil.c
diff --git a/src/mpi/comm/comm_agree.c b/src/mpi/comm/comm_agree.c
new file mode 100644
index 0000000..3ee995e
--- /dev/null
+++ b/src/mpi/comm/comm_agree.c
@@ -0,0 +1,189 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mpiimpl.h"
+#include "mpicomm.h"
+#include <stdint.h>
+
+/* -- Begin Profiling Symbol Block for routine MPIX_Comm_agree */
+#if defined(HAVE_PRAGMA_WEAK)
+#pragma weak MPIX_Comm_agree = PMPIX_Comm_agree
+#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
+#pragma _HP_SECONDARY_DEF PMPIX_Comm_agree MPIX_Comm_agree
+#elif defined(HAVE_PRAGMA_CRI_DUP)
+#pragma _CRI duplicate MPIX_Comm_agree as PMPIX_Comm_agree
+#endif
+/* -- End Profiling Symbol Block */
+
+/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
+ the MPI routines */
+#ifndef MPICH_MPI_FROM_PMPI
+#undef MPIX_Comm_agree
+#define MPIX_Comm_agree PMPIX_Comm_agree
+#endif
+
+#undef FUNCNAME
+#define FUNCNAME MPIR_Comm_agree
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPIR_Comm_agree(MPID_Comm *comm_ptr, int *flag)
+{
+ int mpi_errno = MPI_SUCCESS, mpi_errno_tmp = MPI_SUCCESS;
+ MPID_Group *comm_grp, *failed_grp, *new_group_ptr, *global_failed;
+ int result, success = 1;
+ int errflag = 0;
+ int values[2];
+
+ MPID_MPI_STATE_DECL(MPID_STATE_MPIR_COMM_AGREE);
+ MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_COMM_AGREE);
+
+ MPIR_Comm_group_impl(comm_ptr, &comm_grp);
+
+ /* Get the locally known (not acknowledged) group of failed procs */
+ mpi_errno = MPID_Comm_failure_get_acked(comm_ptr, &failed_grp);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ /* First decide on the group of failed procs. */
+ mpi_errno = MPID_Comm_get_all_failed_procs(comm_ptr, &global_failed, MPIR_AGREE_TAG);
+ if (mpi_errno) errflag = 1;
+
+ mpi_errno = MPIR_Group_compare_impl(failed_grp, global_failed, &result);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ /* Create a subgroup without the failed procs */
+ mpi_errno = MPIR_Group_difference_impl(comm_grp, global_failed, &new_group_ptr);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ /* If that group isn't the same as what we think is failed locally, then
+ * mark it as such. */
+ if (result == MPI_UNEQUAL || errflag)
+ success = 0;
+
+ /* Do an allreduce to decide whether or not anyone thinks the group
+ * has changed */
+ mpi_errno_tmp = MPIR_Allreduce_group(MPI_IN_PLACE, &success, 1, MPI_INT, MPI_MIN, comm_ptr,
+ new_group_ptr, MPIR_AGREE_TAG, &errflag);
+ if (!success || errflag || mpi_errno_tmp)
+ success = 0;
+
+ values[0] = success;
+ values[1] = *flag;
+
+ /* Determine both the result of this function (mpi_errno) and the result
+ * of flag that will be returned to the user. */
+ MPIR_Allreduce_group(MPI_IN_PLACE, values, 2, MPI_INT, MPI_BAND, comm_ptr,
+ new_group_ptr, MPIR_AGREE_TAG, &errflag);
+ /* Ignore the result of the operation this time. Everyone will either
+ * return a failure because of !success earlier or they will return
+ * something useful for flag because of this operation. If there was a new
+ * failure in between the first allreduce and the second one, it's ignored
+ * here. */
+
+ if (failed_grp != MPID_Group_empty)
+ MPIR_Group_release(failed_grp);
+ MPIR_Group_release(new_group_ptr);
+ MPIR_Group_release(comm_grp);
+ if (global_failed != MPID_Group_empty)
+ MPIR_Group_release(global_failed);
+
+ success = values[0];
+ *flag = values[1];
+
+ if (!success) {
+ MPIU_ERR_SET(mpi_errno_tmp, MPIX_ERR_PROC_FAILED, "**mpix_comm_agree");
+ MPIU_ERR_ADD(mpi_errno, mpi_errno_tmp);
+ }
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIX_Comm_agree
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+/*@
+MPIX_Comm_agree - Performs agreement operation on comm
+
+Input Parameters:
++ comm - communicator (handle)
+
+Output Parameters:
+. newcomm - new communicator (handle)
+
+.N Threadsafe
+
+.N Fortran
+
+.N Errors
+.N MPI_SUCCESS
+.N MPI_ERR_COMM
+
+@*/
+int MPIX_Comm_agree(MPI_Comm comm, int *flag)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPID_Comm *comm_ptr = NULL;
+ MPID_MPI_STATE_DECL(MPID_STATE_MPIX_COMM_AGREE);
+
+ MPIR_ERRTEST_INITIALIZED_ORDIE();
+
+ MPIU_THREAD_CS_ENTER(ALLFUNC,);
+ MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_AGREE);
+
+ /* Validate parameters, and convert MPI object handles to object pointers */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ MPIR_ERRTEST_COMM(comm, mpi_errno);
+ }
+ MPID_END_ERROR_CHECKS;
+
+ MPID_Comm_get_ptr( comm, comm_ptr );
+
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ /* Validate comm_ptr */
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ if (MPIX_ERR_REVOKED != MPIR_ERR_GET_CLASS(mpi_errno) && mpi_errno)
+ goto fn_fail;
+ }
+ MPID_END_ERROR_CHECKS;
+ }
+#else
+ {
+ MPID_Comm_get_ptr( comm, comm_ptr );
+ }
+#endif
+
+ /* ... body of routine ... */
+ mpi_errno = MPIR_Comm_agree(comm_ptr, flag);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ /* ... end of body of routine ... */
+
+ fn_exit:
+ MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_AGREE);
+ MPIU_THREAD_CS_EXIT(ALLFUNC,);
+ return mpi_errno;
+
+ fn_fail:
+ /* --BEGIN ERROR HANDLING-- */
+#ifdef HAVE_ERROR_CHECKING
+ {
+ mpi_errno =
+ MPIR_Err_create_code(mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
+ MPI_ERR_OTHER, "**mpix_comm_agree",
+ "**mpix_comm_agree %C", comm);
+ }
+#endif
+ mpi_errno = MPIR_Err_return_comm(comm_ptr, FCNAME, mpi_errno);
+ goto fn_exit;
+ /* --END ERROR HANDLING-- */
+}
diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt
index 35551d0..060b3b4 100644
--- a/src/mpi/errhan/errnames.txt
+++ b/src/mpi/errhan/errnames.txt
@@ -1105,6 +1105,8 @@ is too big (> MPIU_SHMW_GHND_SZ)
**mpix_comm_revoke %C:MPIX_Comm_revoke(%C) failed
**mpix_comm_shrink:MPIX_Comm_shrink failed
**mpix_comm_shrink %C %p:MPIX_Comm_shrink(%C, new_comm=%p) failed
+**mpix_comm_agree:MPIX_Comm_agree failed
+**mpix_comm_agree %C:MPIX_Comm_agree(%C) failed
**mpi_intercomm_create:MPI_Intercomm_create failed
**mpi_intercomm_create %C %d %C %d %d %p:MPI_Intercomm_create(%C, local_leader=%d, %C, remote_leader=%d, tag=%d, newintercomm=%p) failed
**mpi_intercomm_merge:MPI_Intercomm_merge failed
diff --git a/src/mpid/ch3/src/Makefile.mk b/src/mpid/ch3/src/Makefile.mk
index 30c64bd..4272c26 100644
--- a/src/mpid/ch3/src/Makefile.mk
+++ b/src/mpid/ch3/src/Makefile.mk
@@ -33,6 +33,7 @@ mpi_core_sources += \
src/mpid/ch3/src/mpid_comm_failure_ack.c \
src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c \
src/mpid/ch3/src/mpid_comm_revoke.c \
+ src/mpid/ch3/src/mpid_comm_agree.c \
src/mpid/ch3/src/mpid_finalize.c \
src/mpid/ch3/src/mpid_get_universe_size.c \
src/mpid/ch3/src/mpid_getpname.c \
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index c8dbde6..ea8bf34 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -941,7 +941,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_COLL;
if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
- if (rreq->dev.match.parts.tag != MPIR_SHRINK_TAG) {
+ if (rreq->dev.match.parts.tag != MPIR_AGREE_TAG && rreq->dev.match.parts.tag != MPIR_SHRINK_TAG) {
MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
"cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
@@ -973,7 +973,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_COLL;
if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
- if (rreq->dev.match.parts.tag != MPIR_SHRINK_TAG) {
+ if (rreq->dev.match.parts.tag != MPIR_AGREE_TAG && rreq->dev.match.parts.tag != MPIR_SHRINK_TAG) {
MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
"cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
diff --git a/src/mpid/ch3/src/mpid_comm_agree.c b/src/mpid/ch3/src/mpid_comm_agree.c
new file mode 100644
index 0000000..6377397
--- /dev/null
+++ b/src/mpid/ch3/src/mpid_comm_agree.c
@@ -0,0 +1,119 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2011 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mpidimpl.h"
+
+static int get_parent(int rank, uint32_t *bitarray)
+{
+ int parent = -1;
+ int failed = 1;
+ uint32_t mask;
+
+ while (failed) {
+ mask = 0x80000000;
+ parent = rank == 0 ? -1: (rank - 1) / 2;
+
+ /* Check whether the process is in the failed group */
+ if (parent != -1) {
+ mask >>= parent % (sizeof(uint32_t) * 8);
+ failed = bitarray[parent / (sizeof(uint32_t) * 8)] & mask;
+ if (failed) {
+ rank = parent;
+ }
+ } else failed = 0;
+ }
+
+ return parent;
+}
+
+static void get_children(int rank, int size, uint32_t *bitarray, int *children, int *nchildren)
+{
+ int i;
+ int child;
+
+ for (i = 1; i <= 2; i++) {
+ /* Calculate the child */
+ child = 2 * rank + i;
+ if (child >= size) child = -1;
+
+ /* Check if the child is alive. If not, call get_children on the child
+ * to inherit its children */
+ if (child != -1) {
+ if (bitarray[child / (sizeof(uint32_t) * 8)] & (0x80000000 >> (child % (sizeof(uint32_t) * 8)))) {
+ get_children(child, size, bitarray, children, nchildren);
+ } else {
+ children[*nchildren] = child;
+ (*nchildren)++;
+ }
+ }
+ }
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_Comm_agree
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_Comm_agree(MPID_Comm *comm_ptr, uint32_t *bitarray, int *flag, int new_fail)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int *children, nchildren = 0, parent;
+ int i;
+ int errflag = new_fail;
+ int tmp_flag;
+
+ MPID_MPI_STATE_DECL(MPID_STATE_MPID_COMM_AGREE);
+ MPID_MPI_FUNC_ENTER(MPID_STATE_MPID_COMM_AGREE);
+
+ children = (int *) MPIU_Malloc(sizeof(int) * ((comm_ptr->local_size) / 2));
+
+ /* Calculate my parent and children */
+ parent = get_parent(comm_ptr->rank, bitarray);
+ get_children(comm_ptr->rank, comm_ptr->local_size, bitarray, children, &nchildren);
+
+ /* Get a flag value from each of my children */
+ for (i = 0; i < nchildren; i++) {
+ if (children[i] == -1) continue;
+ mpi_errno = MPIC_Recv(&tmp_flag, 1, MPI_INT, children[i], MPIR_AGREE_TAG,
+ comm_ptr->handle, MPI_STATUS_IGNORE, &errflag);
+ if (mpi_errno) return mpi_errno;
+ if (errflag) new_fail = 1;
+
+ *flag &= tmp_flag;
+ }
+
+ /* If I'm not the root */
+ if (-1 != parent) {
+ /* Send my message to my parent */
+ mpi_errno = MPIC_Send(flag, 1, MPI_INT, parent, MPIR_AGREE_TAG,
+ comm_ptr->handle, &errflag);
+ if (mpi_errno) return mpi_errno;
+
+ /* Receive the result from my parent */
+ mpi_errno = MPIC_Recv(flag, 1, MPI_INT, parent, MPIR_AGREE_TAG,
+ comm_ptr->handle, MPI_STATUS_IGNORE, &errflag);
+ if (mpi_errno) return mpi_errno;
+ if (errflag) new_fail = 1;
+ }
+
+ /* Send my flag value to my children */
+ for (i = 0; i < nchildren; i++) {
+ if (children[i] == -1) continue;
+ mpi_errno = MPIC_Send(flag, 1, MPI_INT, children[i], MPIR_AGREE_TAG,
+ comm_ptr->handle, &errflag);
+ if (mpi_errno) return mpi_errno;
+ }
+
+ MPIU_DBG_MSG_D(CH3_OTHER, VERBOSE, "New failure: %d", new_fail);
+
+ MPIU_ERR_CHKANDJUMP1(new_fail, mpi_errno, MPIX_ERR_PROC_FAILED, "**mpix_comm_agree", "**mpix_comm_agree %C", comm_ptr);
+
+ MPIU_Free(children);
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/ch3/src/mpid_iprobe.c b/src/mpid/ch3/src/mpid_iprobe.c
index ab8dea6..fa32028 100644
--- a/src/mpid/ch3/src/mpid_iprobe.c
+++ b/src/mpid/ch3/src/mpid_iprobe.c
@@ -34,6 +34,7 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
/* Check to make sure the communicator hasn't already been revoked */
if (comm->revoked &&
+ MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask) &&
MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_irecv.c b/src/mpid/ch3/src/mpid_irecv.c
index a6732c5..1c75d20 100644
--- a/src/mpid/ch3/src/mpid_irecv.c
+++ b/src/mpid/ch3/src/mpid_irecv.c
@@ -33,6 +33,7 @@ int MPID_Irecv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
/* Check to make sure the communicator hasn't already been revoked */
if (comm->revoked &&
+ MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask) &&
MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Comm has been revoked. Returning from MPID_IRECV.");
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
diff --git a/src/mpid/ch3/src/mpid_irsend.c b/src/mpid/ch3/src/mpid_irsend.c
index 7d6dd52..d8a0c0a 100644
--- a/src/mpid/ch3/src/mpid_irsend.c
+++ b/src/mpid/ch3/src/mpid_irsend.c
@@ -40,6 +40,7 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
/* Check to make sure the communicator hasn't already been revoked */
if (comm->revoked &&
+ MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask) &&
MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_isend.c b/src/mpid/ch3/src/mpid_isend.c
index 94152dc..168608d 100644
--- a/src/mpid/ch3/src/mpid_isend.c
+++ b/src/mpid/ch3/src/mpid_isend.c
@@ -52,6 +52,7 @@ int MPID_Isend(const void * buf, int count, MPI_Datatype datatype, int rank,
/* Check to make sure the communicator hasn't already been revoked */
if (comm->revoked &&
+ MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask) &&
MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Communicator revoked. MPID_ISEND returning");
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
diff --git a/src/mpid/ch3/src/mpid_issend.c b/src/mpid/ch3/src/mpid_issend.c
index 2467c55..91e484a 100644
--- a/src/mpid/ch3/src/mpid_issend.c
+++ b/src/mpid/ch3/src/mpid_issend.c
@@ -39,6 +39,7 @@ int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, in
/* Check to make sure the communicator hasn't already been revoked */
if (comm->revoked &&
+ MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask) &&
MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_probe.c b/src/mpid/ch3/src/mpid_probe.c
index 52fe729..9a238e7 100644
--- a/src/mpid/ch3/src/mpid_probe.c
+++ b/src/mpid/ch3/src/mpid_probe.c
@@ -28,6 +28,7 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
/* Check to make sure the communicator hasn't already been revoked */
if (comm->revoked &&
+ MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask) &&
MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_recv.c b/src/mpid/ch3/src/mpid_recv.c
index e3af111..a042864 100644
--- a/src/mpid/ch3/src/mpid_recv.c
+++ b/src/mpid/ch3/src/mpid_recv.c
@@ -41,6 +41,7 @@ int MPID_Recv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
/* Check to make sure the communicator hasn't already been revoked */
if (comm->revoked &&
+ MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask) &&
MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_rsend.c b/src/mpid/ch3/src/mpid_rsend.c
index 20b8bcb..92990e6 100644
--- a/src/mpid/ch3/src/mpid_rsend.c
+++ b/src/mpid/ch3/src/mpid_rsend.c
@@ -42,6 +42,7 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
/* Check to make sure the communicator hasn't already been revoked */
if (comm->revoked &&
+ MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask) &&
MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_send.c b/src/mpid/ch3/src/mpid_send.c
index b4ca110..b008b68 100644
--- a/src/mpid/ch3/src/mpid_send.c
+++ b/src/mpid/ch3/src/mpid_send.c
@@ -40,6 +40,7 @@ int MPID_Send(const void * buf, int count, MPI_Datatype datatype, int rank,
/* Check to make sure the communicator hasn't already been revoked */
if (comm->revoked &&
+ MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask) &&
MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_ssend.c b/src/mpid/ch3/src/mpid_ssend.c
index f17b4e7..07c2087 100644
--- a/src/mpid/ch3/src/mpid_ssend.c
+++ b/src/mpid/ch3/src/mpid_ssend.c
@@ -39,6 +39,7 @@ int MPID_Ssend(const void * buf, int count, MPI_Datatype datatype, int rank, int
/* Check to make sure the communicator hasn't already been revoked */
if (comm->revoked &&
+ MPIR_AGREE_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask) &&
MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/pamid/src/misc/mpid_unimpl.c b/src/mpid/pamid/src/misc/mpid_unimpl.c
index 8b92417..7f00d95 100644
--- a/src/mpid/pamid/src/misc/mpid_unimpl.c
+++ b/src/mpid/pamid/src/misc/mpid_unimpl.c
@@ -83,3 +83,9 @@ int MPID_Comm_failure_get_acked(MPID_Comm *comm_ptr, MPID_Group **failed_group_p
MPID_abort();
return 0;
}
+
+int MPID_Comm_agree(MPID_Comm *comm_ptr, uint32_t *bitarray, int *flag, int new_fail)
+{
+ MPID_abort();
+ return 0;
+}
diff --git a/test/mpi/ft/Makefile.am b/test/mpi/ft/Makefile.am
index efcc162..8981bae 100644
--- a/test/mpi/ft/Makefile.am
+++ b/test/mpi/ft/Makefile.am
@@ -10,4 +10,4 @@ include $(top_srcdir)/Makefile.mtest
## for all programs that are just built from the single corresponding source
## file, we don't need per-target _SOURCES rules, automake will infer them
## correctly
-noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter failure_ack anysource revoke_nofail shrink
+noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter failure_ack anysource revoke_nofail shrink agree
diff --git a/test/mpi/ft/agree.c b/test/mpi/ft/agree.c
new file mode 100644
index 0000000..8ef003f
--- /dev/null
+++ b/test/mpi/ft/agree.c
@@ -0,0 +1,68 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+int main(int argc, char **argv)
+{
+ int rank, size, rc, errclass, errs = 0;
+ int flag = 1;
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+ if (size < 4) {
+ fprintf(stderr, "Must run with at least 4 processes\n");
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ if (2 == rank) exit(EXIT_FAILURE);
+
+ if (0 == rank) flag = 0;
+
+ rc = MPIX_Comm_agree(MPI_COMM_WORLD, &flag);
+ MPI_Error_class(rc, &errclass);
+ if (errclass != MPIX_ERR_PROC_FAILED) {
+ fprintf(stderr, "[%d] Expected MPIX_ERR_PROC_FAILED after agree. Received: %d\n", rank, errclass);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ errs++;
+ } else if (0 != flag) {
+ fprintf(stderr, "[%d] Expected flag to be 0. Received: %d\n", rank, flag);
+ errs++;
+ }
+
+ MPIX_Comm_failure_ack(MPI_COMM_WORLD);
+
+ if (0 == rank) flag = 0;
+ else flag = 1;
+ rc = MPIX_Comm_agree(MPI_COMM_WORLD, &flag);
+ MPI_Error_class(rc, &errclass);
+ if (MPI_SUCCESS != rc) {
+ fprintf(stderr, "[%d] Expected MPI_SUCCESS after agree. Received: %d\n", rank, errclass);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ errs++;
+ } else if (0 != flag) {
+ fprintf(stderr, "[%d] Expected flag to be 0. Received: %d\n", rank, flag);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ errs++;
+ }
+
+ MPI_Finalize();
+
+ if (0 == rank) {
+ if (errs == 0)
+ fprintf(stdout, " No Errors\n");
+ else
+ fprintf(stdout, " Found %d errors\n", errs);
+ }
+
+ return errs;
+}
diff --git a/test/mpi/ft/testlist b/test/mpi/ft/testlist
index 4598cde..5e8b54b 100644
--- a/test/mpi/ft/testlist
+++ b/test/mpi/ft/testlist
@@ -14,3 +14,4 @@ scatter 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=
anysource 3 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
revoke_nofail 4 mpiexecarg=-disable-auto-cleanup resultsTest=TestStatusNoErrors strict=false timelimit=10
shrink 8 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
+agree 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
http://git.mpich.org/mpich.git/commitdiff/5be10ce97cdf586ccaa5ab86f29d3827b…
commit 5be10ce97cdf586ccaa5ab86f29d3827bb215056
Author: Wesley Bland <wbland(a)anl.gov>
Date: Thu Apr 24 16:38:13 2014 -0500
Add MPIX_Comm_shrink functionality
This adds a new function MPIX_COMM_SHRINK. This is a communicator creation
function that creates a new communicator based on a previous communicator, but
excluding any failed processes.
As part of the operation, the shrink call needs to perform an agreement to
determine the group of failed processes. This is done using the algorithm
published by Hursey et al. in his EuroMPI '12 paper.
The list of failed processes is collected using a bit array. This happens via
a few new functions in the CH3 layer to create and send a bitarry to the
master process and receive an updated bitarray. Obviously, this is not a very
scalable implementation yet, but something better can easily be plugged in
here to replace the naïve implementation. This is also a use case for an
MPI_Recv_reduce for future reference.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index 799598e..25fa149 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -1538,6 +1538,7 @@ int MPI_T_category_changed(int *stamp);
int MPIX_Comm_failure_ack(MPI_Comm comm);
int MPIX_Comm_failure_get_acked(MPI_Comm comm, MPI_Group *failedgrp);
int MPIX_Comm_revoke(MPI_Comm comm);
+int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm);
/* End Prototypes */
@@ -2176,6 +2177,7 @@ int PMPI_T_category_changed(int *stamp);
int PMPIX_Comm_failure_ack(MPI_Comm comm);
int PMPIX_Comm_failure_get_acked(MPI_Comm comm, MPI_Group *failedgrp);
int PMPIX_Comm_revoke(MPI_Comm comm);
+int PMPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm);
#endif /* MPI_BUILD_PROFILING */
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 3c7aa29..8496922 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -2785,6 +2785,36 @@ int MPID_Comm_failure_ack(MPID_Comm *comm);
int MPID_Comm_failure_get_acked(MPID_Comm *comm, MPID_Group **failed_group_ptr);
/*@
+ MPID_Comm_failed_bitarray - MPID function to get the bitarray including all of the failed processes
+
+ Input Parameters:
+. comm - communicator
+. acked - true if bitarray should contain only acked procs
+
+ Output Parameter:
+. bitarray - Bit array containing all of the failed processes in comm
+
+ Return Value:
+ 'MPI_SUCCESS' or a valid MPI error code.
+@*/
+int MPID_Comm_failed_bitarray(MPID_Comm *comm, uint32_t **bitarray, int acked);
+
+/*@
+ MPID_Comm_get_all_failed_procs - Constructs a group of failed processes that it uniform over a communicator
+
+ Input Parameters:
+. comm - communicator
+. tag - Tag used to do communciation
+
+ Output Parameters:
+. failed_grp - group of all failed processes
+
+ Return Value:
+ 'MPI_SUCCESS' or a valid MPI error code.
+@*/
+int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_group, int tag);
+
+/*@
MPID_Comm_revoke - MPID entry point for MPI_Comm_revoke
Input Parameters:
@@ -3781,7 +3811,8 @@ int MPID_VCR_Get_lpid(MPID_VCR vcr, int * lpid_ptr);
#define MPIR_TOPO_A_TAG 26
#define MPIR_TOPO_B_TAG 27
#define MPIR_REDUCE_SCATTER_BLOCK_TAG 28
-#define MPIR_FIRST_NBC_TAG 29
+#define MPIR_SHRINK_TAG 29
+#define MPIR_FIRST_NBC_TAG 30
/* These macros must be used carefully. These macros will not work with
* negative tags. By definition, users are not to use negative tags and the
@@ -4084,6 +4115,8 @@ void MPIR_Free_err_dyncodes( void );
int MPIR_Comm_idup_impl(MPID_Comm *comm_ptr, MPID_Comm **newcomm, MPID_Request **reqp);
+int MPIR_Comm_shrink(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr);
+
int MPIR_Allreduce_group(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
MPID_Group *group_ptr, int tag, int *errflag);
diff --git a/src/mpi/comm/Makefile.mk b/src/mpi/comm/Makefile.mk
index 2197991..c133981 100644
--- a/src/mpi/comm/Makefile.mk
+++ b/src/mpi/comm/Makefile.mk
@@ -29,7 +29,8 @@ mpi_sources += \
src/mpi/comm/comm_split_type.c \
src/mpi/comm/comm_failure_ack.c \
src/mpi/comm/comm_failure_get_acked.c \
- src/mpi/comm/comm_revoke.c
+ src/mpi/comm/comm_revoke.c \
+ src/mpi/comm/comm_shrink.c
mpi_core_sources += \
src/mpi/comm/commutil.c
diff --git a/src/mpi/comm/comm_shrink.c b/src/mpi/comm/comm_shrink.c
new file mode 100644
index 0000000..7eaba35
--- /dev/null
+++ b/src/mpi/comm/comm_shrink.c
@@ -0,0 +1,181 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mpiimpl.h"
+#include "mpicomm.h"
+#include <stdint.h>
+
+/* This function has multiple phases.
+ *
+ * In the first phase, all alive processes must collectively decide which
+ * processes are dead. This happens via a fault-tolerant all-reduce style
+ * algorithm. This is implemented via the recursive-doubling algorithm as a
+ * first pass for simplicity.
+ *
+ * In the second phase, the remaining processes must create a new communicator
+ * based on the group determined in the first phase. This phase simply uses
+ * the existing implementation of MPI_Comm_create_group. If the call to
+ * MPI_Comm_create_group fails, then the algorithm is restarted in phase one
+ * and a new group is determined.
+ */
+
+/* -- Begin Profiling Symbol Block for routine MPIX_Comm_shrink */
+#if defined(HAVE_PRAGMA_WEAK)
+#pragma weak MPIX_Comm_shrink = PMPIX_Comm_shrink
+#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
+#pragma _HP_SECONDARY_DEF PMPIX_Comm_shrink MPIX_Comm_shrink
+#elif defined(HAVE_PRAGMA_CRI_DUP)
+#pragma _CRI duplicate MPIX_Comm_shrink as PMPIX_Comm_shrink
+#endif
+/* -- End Profiling Symbol Block */
+
+/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
+ the MPI routines */
+#ifndef MPICH_MPI_FROM_PMPI
+#undef MPIX_Comm_shrink
+#define MPIX_Comm_shrink PMPIX_Comm_shrink
+#endif
+
+#undef FUNCNAME
+#define FUNCNAME MPIR_Comm_shrink
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+/* comm shrink impl; assumes that standard error checking has already taken
+ * place in the calling function */
+int MPIR_Comm_shrink(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPID_Group *global_failed, *comm_grp, *new_group_ptr;
+ int attempts = 0;
+ int errflag = 0, tmp_errflag = 0;
+
+ MPID_MPI_STATE_DECL(MPID_STATE_MPIR_COMM_SHRINK);
+ MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_COMM_SHRINK);
+
+ /* TODO - Implement this function for intercommunicators */
+ MPIR_Comm_group_impl(comm_ptr, &comm_grp);
+
+ do {
+ mpi_errno = MPID_Comm_get_all_failed_procs(comm_ptr, &global_failed, MPIR_SHRINK_TAG);
+ /* Ignore the mpi_errno value here as it will definitely communicate
+ * with failed procs */
+
+ mpi_errno = MPIR_Group_difference_impl(comm_grp, global_failed, &new_group_ptr);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ if (MPID_Group_empty != global_failed) MPIR_Group_release(global_failed);
+
+ mpi_errno = MPIR_Comm_create_group(comm_ptr, new_group_ptr, MPIR_SHRINK_TAG, newcomm_ptr);
+ errflag = mpi_errno || *newcomm_ptr == NULL;
+
+ mpi_errno = MPIR_Allreduce_group(MPI_IN_PLACE, &errflag, 1, MPI_INT, MPI_MAX, comm_ptr,
+ new_group_ptr, MPIR_SHRINK_TAG, &tmp_errflag);
+ MPIR_Group_release(new_group_ptr);
+
+ if (errflag) MPIU_Object_set_ref(new_group_ptr, 0);
+ } while (errflag && ++attempts < 5);
+
+ if (errflag && attempts >= 5) goto fn_fail;
+ else mpi_errno = MPI_SUCCESS;
+
+ fn_exit:
+ MPIR_Group_release(comm_grp);
+ return mpi_errno;
+ fn_fail:
+ if (*newcomm_ptr) MPIU_Object_set_ref(*newcomm_ptr, 0);
+ MPIU_Object_set_ref(global_failed, 0);
+ MPIU_Object_set_ref(new_group_ptr, 0);
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIX_Comm_shrink
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+/*@
+MPIX_Comm_shrink - Creates a new communitor from an existing communicator while
+ excluding failed processes
+
+Input Parameters:
++ comm - communicator (handle)
+
+Output Parameters:
+. newcomm - new communicator (handle)
+
+.N Threadsafe
+
+.N Fortran
+
+.N Errors
+.N MPI_SUCCESS
+.N MPI_ERR_COMM
+
+@*/
+int MPIX_Comm_shrink(MPI_Comm comm, MPI_Comm *newcomm)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPID_Comm *comm_ptr = NULL, *newcomm_ptr;
+ MPID_MPI_STATE_DECL(MPID_STATE_MPIX_COMM_SHRINK);
+
+ MPIR_ERRTEST_INITIALIZED_ORDIE();
+
+ MPIU_THREAD_CS_ENTER(ALLFUNC,);
+ MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_SHRINK);
+
+ /* Validate parameters, and convert MPI object handles to object pointers */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ MPIR_ERRTEST_COMM(comm, mpi_errno);
+ }
+ MPID_END_ERROR_CHECKS;
+
+ MPID_Comm_get_ptr( comm, comm_ptr );
+
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ /* Validate comm_ptr */
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
+ if (MPIX_ERR_REVOKED != MPIR_ERR_GET_CLASS(mpi_errno) && mpi_errno)
+ goto fn_fail;
+ }
+ MPID_END_ERROR_CHECKS;
+ }
+#else
+ {
+ MPID_Comm_get_ptr( comm, comm_ptr );
+ }
+#endif
+
+ /* ... body of routine ... */
+ mpi_errno = MPIR_Comm_shrink(comm_ptr, &newcomm_ptr);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ if (newcomm_ptr)
+ MPIU_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
+ else
+ *newcomm = MPI_COMM_NULL;
+ /* ... end of body of routine ... */
+
+ fn_exit:
+ MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_SHRINK);
+ MPIU_THREAD_CS_EXIT(ALLFUNC,);
+ return mpi_errno;
+
+ fn_fail:
+ /* --BEGIN ERROR HANDLING-- */
+#ifdef HAVE_ERROR_CHECKING
+ {
+ mpi_errno =
+ MPIR_Err_create_code(mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
+ MPI_ERR_OTHER, "**mpix_comm_shrink",
+ "**mpix_comm_shrink %C %p", comm, newcomm);
+ }
+#endif
+ mpi_errno = MPIR_Err_return_comm(comm_ptr, FCNAME, mpi_errno);
+ goto fn_exit;
+ /* --END ERROR HANDLING-- */
+}
diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt
index 8bd6810..35551d0 100644
--- a/src/mpi/errhan/errnames.txt
+++ b/src/mpi/errhan/errnames.txt
@@ -1103,6 +1103,8 @@ is too big (> MPIU_SHMW_GHND_SZ)
**mpix_comm_failure_get_acked %C %p:MPIX_Comm_failure_get_acked(%C, group=%p) failed
**mpix_comm_revoke:MPIX_Comm_revoke failed
**mpix_comm_revoke %C:MPIX_Comm_revoke(%C) failed
+**mpix_comm_shrink:MPIX_Comm_shrink failed
+**mpix_comm_shrink %C %p:MPIX_Comm_shrink(%C, new_comm=%p) failed
**mpi_intercomm_create:MPI_Intercomm_create failed
**mpi_intercomm_create %C %d %C %d %d %p:MPI_Intercomm_create(%C, local_leader=%d, %C, remote_leader=%d, tag=%d, newintercomm=%p) failed
**mpi_intercomm_merge:MPI_Intercomm_merge failed
diff --git a/src/mpid/ch3/src/Makefile.mk b/src/mpid/ch3/src/Makefile.mk
index 091613d..30c64bd 100644
--- a/src/mpid/ch3/src/Makefile.mk
+++ b/src/mpid/ch3/src/Makefile.mk
@@ -31,6 +31,7 @@ mpi_core_sources += \
src/mpid/ch3/src/mpid_comm_disconnect.c \
src/mpid/ch3/src/mpid_comm_spawn_multiple.c \
src/mpid/ch3/src/mpid_comm_failure_ack.c \
+ src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c \
src/mpid/ch3/src/mpid_comm_revoke.c \
src/mpid/ch3/src/mpid_finalize.c \
src/mpid/ch3/src/mpid_get_universe_size.c \
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index d84d54d..c8dbde6 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -941,11 +941,13 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_COLL;
if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
- MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
- "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
- rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
- dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
- continue;
+ if (rreq->dev.match.parts.tag != MPIR_SHRINK_TAG) {
+ MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+ "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
+ rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
+ dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
+ continue;
+ }
}
prev_rreq = rreq;
@@ -971,11 +973,13 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_COLL;
if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
- MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
- "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
- rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
- dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
- continue;
+ if (rreq->dev.match.parts.tag != MPIR_SHRINK_TAG) {
+ MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+ "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
+ rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
+ dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
+ continue;
+ }
}
prev_rreq = rreq;
diff --git a/src/mpid/ch3/src/mpid_comm_failure_ack.c b/src/mpid/ch3/src/mpid_comm_failure_ack.c
index be64340..d01b99b 100644
--- a/src/mpid/ch3/src/mpid_comm_failure_ack.c
+++ b/src/mpid/ch3/src/mpid_comm_failure_ack.c
@@ -69,3 +69,77 @@ fn_exit:
fn_fail:
goto fn_exit;
}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_Comm_failed_bitarray
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_Comm_failed_bitarray(MPID_Comm *comm_ptr, uint32_t **bitarray, int acked)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int size, i;
+ uint32_t bit;
+ int *failed_procs, *group_procs;
+ MPID_Group *failed_group, *comm_group;
+ MPIDI_STATE_DECL(MPID_STATE_COMM_FAILED_BITARRAY);
+ MPIU_CHKLMEM_DECL(2);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_COMM_FAILED_BITARRAY);
+
+ /* TODO - Fix this for intercommunicators */
+ size = comm_ptr->local_size;
+
+ /* We can fit sizeof(uint32_t) * 8 ranks in one uint64_t so divide the
+ * size by that */
+ /* This buffer will be handed back to the calling function so we use a
+ * "real" malloc here and expect the caller to free the buffer later. The
+ * other buffers in this function are temporary and will be automatically
+ * cleaned up at the end of the function. */
+ *bitarray = (uint32_t *) MPIU_Malloc(sizeof(uint32_t) * (size / (sizeof(uint32_t) * 8)+1));
+ if (!(*bitarray)) {
+ fprintf(stderr, "Could not allocate space for bitarray\n");
+ PMPI_Abort(MPI_COMM_WORLD, 1);
+ }
+ for (i = 0; i <= size/(sizeof(uint32_t)*8); i++) *bitarray[i] = 0;
+
+ mpi_errno = MPIDI_CH3U_Check_for_failed_procs();
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ if (acked)
+ MPIDI_CH3U_Get_failed_group(comm_ptr->ch.last_ack_rank, &failed_group);
+ else
+ MPIDI_CH3U_Get_failed_group(-2, &failed_group);
+
+ if (failed_group == MPID_Group_empty) goto fn_exit;
+
+
+ MPIU_CHKLMEM_MALLOC(group_procs, int *, sizeof(int)*failed_group->size, mpi_errno, "group_procs");
+ for (i = 0; i < failed_group->size; i++) group_procs[i] = i;
+ MPIU_CHKLMEM_MALLOC(failed_procs, int *, sizeof(int)*failed_group->size, mpi_errno, "failed_procs");
+
+ MPIR_Comm_group_impl(comm_ptr, &comm_group);
+
+ MPIR_Group_translate_ranks_impl(failed_group, failed_group->size, group_procs, comm_group, failed_procs);
+
+ /* The bits will actually be ordered in decending order rather than
+ * ascending. This is purely for readability since it makes no practical
+ * difference. So if the bits look like this:
+ *
+ * 10001100 01001000 00000000 00000001
+ *
+ * Then processes 1, 5, 6, 9, 12, and 32 have failed. */
+ for (i = 0; i < failed_group->size; i++) {
+ bit = 0x80000000;
+ bit >>= failed_procs[i] % (sizeof(uint32_t) * 8);
+
+ *bitarray[failed_procs[i] / (sizeof(uint32_t) * 8)] |= bit;
+ }
+
+ MPIR_Group_free_impl(comm_group);
+
+ fn_exit:
+ MPIU_CHKLMEM_FREEALL();
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c b/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
new file mode 100644
index 0000000..882f30a
--- /dev/null
+++ b/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
@@ -0,0 +1,156 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2011 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mpidimpl.h"
+#ifdef USE_PMI2_API
+#include "pmi2.h"
+#else
+#include "pmi.h"
+#endif
+
+/* Generates a bitarray based on orig_comm where all procs in group are marked with 1 */
+static int *group_to_bitarray(MPID_Group *group, MPID_Comm *orig_comm) {
+ uint32_t *bitarray, mask;
+ int bitarray_size = orig_comm->local_size / 8 + orig_comm->local_size % 8 ? 1 : 0;
+ int *group_ranks, *comm_ranks, i, index;
+
+ bitarray = (int *) MPIU_Malloc(sizeof(int) * bitarray_size);
+
+ if (group == MPID_Group_empty) {
+ for (i = 0; i < bitarray_size; i++) bitarray[i] = 0;
+ return bitarray;
+ }
+
+ group_ranks = (int *) MPIU_Malloc(sizeof(int) * group->size);
+ comm_ranks = (int *) MPIU_Malloc(sizeof(int) * group->size);
+
+ for (i = 0; i < group->size; i++) group_ranks[i] = i;
+ for (i = 0; i < bitarray_size; i++) bitarray[i] = 0;
+
+ MPIR_Group_translate_ranks_impl(group, group->size, group_ranks,
+ orig_comm->local_group, comm_ranks);
+
+ for (i = 0; i < group->size && comm_ranks[i] != MPI_UNDEFINED; i++) {
+ index = comm_ranks[i] / 32;
+ mask = 0x80000000 >> comm_ranks[i] % 32;
+ bitarray[index] |= mask;
+ }
+
+ MPIU_Free(group_ranks);
+ MPIU_Free(comm_ranks);
+
+ return bitarray;
+}
+
+/* Generates an MPID_Group from a bitarray */
+static MPID_Group *bitarray_to_group(MPID_Comm *comm_ptr, int *bitarray)
+{
+ MPID_Group *ret_group;
+ MPID_Group *comm_group;
+ UT_array *ranks_array;
+ int i, found = 0;
+
+ utarray_new(ranks_array, &ut_int_icd);
+
+ MPIR_Comm_group_impl(comm_ptr, &comm_group);
+
+ /* Converts the bitarray into a utarray */
+ for (i = 0; i < comm_ptr->local_size; i++) {
+ if (bitarray[i/32] & (0x80000000 >> i % 32)) {
+ utarray_push_back(ranks_array, &i);
+ found++;
+ }
+ }
+
+ if (found)
+ /* Converts the utarray into a group */
+ MPIR_Group_incl_impl(comm_group, found, ut_int_array(ranks_array), &ret_group);
+ else
+ ret_group = MPID_Group_empty;
+
+ utarray_free(ranks_array);
+ MPIR_Group_release(comm_group);
+
+ return ret_group;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_Comm_get_all_failed_procs
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_group, int tag)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int errflag = 0;
+ int i, j;
+ int *bitarray, *remote_bitarray, bitarray_size;
+ MPID_Group *local_fail;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_COMM_GET_ALL_FAILED_PROCS);
+
+ MPID_MPI_FUNC_ENTER(MPID_STATE_MPID_COMM_GET_ALL_FAILED_PROCS);
+
+ /* Kick the progress engine in case it's been a while so we get all the
+ * latest updates about failures */
+ MPIDI_CH3I_Progress(NULL, false);
+
+ /* Generate the list of failed processes */
+ MPIDI_CH3U_Check_for_failed_procs();
+
+ mpi_errno = MPIDI_CH3U_Get_failed_group(-2, &local_fail);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ /* Generate a bitarray based on the list of failed procs */
+ bitarray = group_to_bitarray(local_fail, comm_ptr);
+ bitarray_size = comm_ptr->local_size / 8 + comm_ptr->local_size % 8 ? 1 : 0;
+ remote_bitarray = MPIU_Malloc(sizeof(int) * bitarray_size);
+
+ /* For now, this will be implemented as a star with rank 0 serving as
+ * the source */
+ if (comm_ptr->rank == 0) {
+ for (i = 1; i < comm_ptr->local_size; i++) {
+ /* Get everyone's list of failed processes to aggregate */
+ mpi_errno = MPIC_Recv(remote_bitarray, bitarray_size, MPI_INT,
+ i, tag, comm_ptr->handle, MPI_STATUS_IGNORE, &errflag);
+ if (mpi_errno) continue;
+
+ /* Combine the received bitarray with my own */
+ for (j = 0; j < bitarray_size; j++)
+ bitarray[j] |= remote_bitarray[j];
+ }
+
+ for (i = 1; i < comm_ptr->local_size; i++) {
+ /* Send the list to each rank to be processed locally */
+ mpi_errno = MPIC_Ssend(bitarray, bitarray_size, MPI_INT, i,
+ tag, comm_ptr->handle, &errflag);
+ if (mpi_errno) errflag = 1;
+ }
+
+ /* Convert the bitarray into a group */
+ *failed_group = bitarray_to_group(comm_ptr, bitarray);
+ } else {
+ /* Send my bitarray to rank 0 */
+ mpi_errno = MPIC_Ssend(bitarray, bitarray_size, MPI_INT, 0,
+ tag, comm_ptr->handle, &errflag);
+ if (mpi_errno) errflag = 1;
+
+ /* Get the resulting bitarray back from rank 0 */
+ mpi_errno = MPIC_Recv(remote_bitarray, bitarray_size, MPI_INT, 0,
+ tag, comm_ptr->handle, MPI_STATUS_IGNORE, &errflag);
+ if (mpi_errno) errflag = 1;
+
+ /* Convert the bitarray into a group */
+ *failed_group = bitarray_to_group(comm_ptr, remote_bitarray);
+ }
+
+ MPIU_Free(bitarray);
+ MPIU_Free(remote_bitarray);
+
+ fn_exit:
+ MPID_MPI_FUNC_EXIT(MPID_STATE_MPID_COMM_GET_ALL_FAILED_PROCS);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/ch3/src/mpid_iprobe.c b/src/mpid/ch3/src/mpid_iprobe.c
index 07e1205..ab8dea6 100644
--- a/src/mpid/ch3/src/mpid_iprobe.c
+++ b/src/mpid/ch3/src/mpid_iprobe.c
@@ -33,7 +33,8 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
}
/* Check to make sure the communicator hasn't already been revoked */
- if (comm->revoked) {
+ if (comm->revoked &&
+ MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_irecv.c b/src/mpid/ch3/src/mpid_irecv.c
index 28e7b66..a6732c5 100644
--- a/src/mpid/ch3/src/mpid_irecv.c
+++ b/src/mpid/ch3/src/mpid_irecv.c
@@ -32,7 +32,8 @@ int MPID_Irecv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
}
/* Check to make sure the communicator hasn't already been revoked */
- if (comm->revoked) {
+ if (comm->revoked &&
+ MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Comm has been revoked. Returning from MPID_IRECV.");
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_irsend.c b/src/mpid/ch3/src/mpid_irsend.c
index d1ce07f..7d6dd52 100644
--- a/src/mpid/ch3/src/mpid_irsend.c
+++ b/src/mpid/ch3/src/mpid_irsend.c
@@ -39,7 +39,8 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
rank, tag, comm->context_id + context_offset));
/* Check to make sure the communicator hasn't already been revoked */
- if (comm->revoked) {
+ if (comm->revoked &&
+ MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_isend.c b/src/mpid/ch3/src/mpid_isend.c
index 086dc6f..94152dc 100644
--- a/src/mpid/ch3/src/mpid_isend.c
+++ b/src/mpid/ch3/src/mpid_isend.c
@@ -51,7 +51,8 @@ int MPID_Isend(const void * buf, int count, MPI_Datatype datatype, int rank,
rank, tag, comm->context_id + context_offset));
/* Check to make sure the communicator hasn't already been revoked */
- if (comm->revoked) {
+ if (comm->revoked &&
+ MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Communicator revoked. MPID_ISEND returning");
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_issend.c b/src/mpid/ch3/src/mpid_issend.c
index ce672fb..2467c55 100644
--- a/src/mpid/ch3/src/mpid_issend.c
+++ b/src/mpid/ch3/src/mpid_issend.c
@@ -38,7 +38,8 @@ int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, in
rank, tag, comm->context_id + context_offset));
/* Check to make sure the communicator hasn't already been revoked */
- if (comm->revoked) {
+ if (comm->revoked &&
+ MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_probe.c b/src/mpid/ch3/src/mpid_probe.c
index 3b91941..52fe729 100644
--- a/src/mpid/ch3/src/mpid_probe.c
+++ b/src/mpid/ch3/src/mpid_probe.c
@@ -27,7 +27,8 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
}
/* Check to make sure the communicator hasn't already been revoked */
- if (comm->revoked) {
+ if (comm->revoked &&
+ MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_recv.c b/src/mpid/ch3/src/mpid_recv.c
index 45f1580..e3af111 100644
--- a/src/mpid/ch3/src/mpid_recv.c
+++ b/src/mpid/ch3/src/mpid_recv.c
@@ -40,7 +40,8 @@ int MPID_Recv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
}
/* Check to make sure the communicator hasn't already been revoked */
- if (comm->revoked) {
+ if (comm->revoked &&
+ MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_rsend.c b/src/mpid/ch3/src/mpid_rsend.c
index 4561804..20b8bcb 100644
--- a/src/mpid/ch3/src/mpid_rsend.c
+++ b/src/mpid/ch3/src/mpid_rsend.c
@@ -41,7 +41,8 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
rank, tag, comm->context_id + context_offset));
/* Check to make sure the communicator hasn't already been revoked */
- if (comm->revoked) {
+ if (comm->revoked &&
+ MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_send.c b/src/mpid/ch3/src/mpid_send.c
index d96cf14..b4ca110 100644
--- a/src/mpid/ch3/src/mpid_send.c
+++ b/src/mpid/ch3/src/mpid_send.c
@@ -39,7 +39,8 @@ int MPID_Send(const void * buf, int count, MPI_Datatype datatype, int rank,
rank, tag, comm->context_id + context_offset));
/* Check to make sure the communicator hasn't already been revoked */
- if (comm->revoked) {
+ if (comm->revoked &&
+ MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/src/mpid/ch3/src/mpid_ssend.c b/src/mpid/ch3/src/mpid_ssend.c
index e4ed3dc..f17b4e7 100644
--- a/src/mpid/ch3/src/mpid_ssend.c
+++ b/src/mpid/ch3/src/mpid_ssend.c
@@ -38,7 +38,8 @@ int MPID_Ssend(const void * buf, int count, MPI_Datatype datatype, int rank, int
rank, tag, comm->context_id + context_offset));
/* Check to make sure the communicator hasn't already been revoked */
- if (comm->revoked) {
+ if (comm->revoked &&
+ MPIR_SHRINK_TAG != MPIR_TAG_MASK_ERROR_BIT(tag & ~MPIR_Process.tagged_coll_mask)) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
}
diff --git a/test/mpi/ft/Makefile.am b/test/mpi/ft/Makefile.am
index 90fa619..efcc162 100644
--- a/test/mpi/ft/Makefile.am
+++ b/test/mpi/ft/Makefile.am
@@ -10,4 +10,4 @@ include $(top_srcdir)/Makefile.mtest
## for all programs that are just built from the single corresponding source
## file, we don't need per-target _SOURCES rules, automake will infer them
## correctly
-noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter failure_ack anysource revoke_nofail
+noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter failure_ack anysource revoke_nofail shrink
diff --git a/test/mpi/ft/shrink.c b/test/mpi/ft/shrink.c
new file mode 100644
index 0000000..6c5742c
--- /dev/null
+++ b/test/mpi/ft/shrink.c
@@ -0,0 +1,62 @@
+
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2003 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+ * This test ensures that shrink works correctly
+ */
+int main(int argc, char **argv)
+{
+ int rank, size, newsize, rc, errclass, errs = 0;
+ MPI_Comm newcomm;
+ int sendbuf = 0;
+ int recvbuf = 0;
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+ if (size < 4) {
+ fprintf(stderr, "Must run with at least 4 processes\n");
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ if (2 == rank) exit(EXIT_FAILURE);
+
+ rc = MPIX_Comm_shrink(MPI_COMM_WORLD, &newcomm);
+ if (rc) {
+ MPI_Error_class(rc, &errclass);
+ fprintf(stderr, "Expected MPI_SUCCESS from MPIX_Comm_shrink. Received: %d\n", errclass);
+ errs++;
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ MPI_Comm_size(newcomm, &newsize);
+ if (newsize != size-1)
+ errs++;
+
+ rc = MPI_Barrier(newcomm);
+ if (rc) {
+ MPI_Error_class(rc, &errclass);
+ fprintf(stderr, "Expected MPI_SUCCESS from MPI_BARRIER. Received: %d\n", errclass);
+ errs++;
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ MPI_Comm_free(&newcomm);
+
+ if (0 == rank) fprintf(stdout, " No Errors\n");
+
+ MPI_Finalize();
+
+ return 0;
+}
diff --git a/test/mpi/ft/testlist b/test/mpi/ft/testlist
index a7317eb..4598cde 100644
--- a/test/mpi/ft/testlist
+++ b/test/mpi/ft/testlist
@@ -13,3 +13,4 @@ bcast 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=fa
scatter 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
anysource 3 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
revoke_nofail 4 mpiexecarg=-disable-auto-cleanup resultsTest=TestStatusNoErrors strict=false timelimit=10
+shrink 8 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
diff --git a/test/mpid/ch3/failed_bitmask.c b/test/mpid/ch3/failed_bitmask.c
new file mode 100644
index 0000000..51518f8
--- /dev/null
+++ b/test/mpid/ch3/failed_bitmask.c
@@ -0,0 +1,59 @@
+
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+
+#include "mpidimpl.h"
+
+int main(int argc, char **argv)
+{
+ int rc, size, rank, ec;
+ MPID_Comm *comm_ptr;
+ uint32_t *mask;
+
+ MPI_Init(&argc, &argv);
+
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+ MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+ if (size != 16) {
+ fprintf(stderr, "Requires 16 ranks\n");
+ exit(1);
+ }
+
+ if (rank == 1 ||
+ rank == 5 ||
+ rank == 6 ||
+ rank == 9 ||
+ rank == 12)
+ exit(1);
+
+ rc = MPI_Barrier(MPI_COMM_WORLD);
+ ec = MPI_Error_class(rc, &ec);
+ if (MPI_SUCCESS == rc) {
+ fprintf(stderr, "[%d] ERROR CLASS: %d\n", rank, rc);
+ }
+
+ MPID_Comm_get_ptr(MPI_COMM_WORLD, comm_ptr);
+
+ MPID_Comm_failed_bitarray(comm_ptr, &mask, 0);
+
+ if (mask[0] != (uint32_t) 0x46480000) {
+ fprintf(stderr, "[%d] Unexpected failure bitmask: 0x%x\n", rank, mask[0]);
+ exit(1);
+ } else {
+ fprintf(stdout, " No errors\n");
+ }
+
+ MPIU_Free(mask);
+
+ MPI_Finalize();
+
+ return 0;
+}
http://git.mpich.org/mpich.git/commitdiff/ee5173e396f43adb3dd0660e59e7b2e19…
commit ee5173e396f43adb3dd0660e59e7b2e19cb856c5
Author: Wesley Bland <wbland(a)anl.gov>
Date: Fri Apr 11 11:25:16 2014 -0500
Add check for revoked communicator
Piggybacking on the MPID_Comm_valid_ptr check in the HAVE_ERROR_CHECKING
block, this checks to see if the communicator has been revoked and
returns MPIX_ERR_REVOKED if so.
This probably should move out of the HAVE_ERROR_CHECKING section since it
requires the user to have this turned on. If the user leaves it off, they'll
never be notified. However, if this moves out of the HAVE_ERROR_CHECKING
section, it will probably have performance implications.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 8d3f2e8..3c7aa29 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -499,6 +499,9 @@ int MPIU_Handle_free( void *((*)[]), int );
if ((ptr) && MPIU_Object_get_ref(ptr) <= 0) { \
MPIU_ERR_SET(err,MPI_ERR_COMM,"**comm"); \
ptr = 0; \
+ } else if (ptr->revoked) { \
+ MPIU_ERR_SET(err,MPIX_ERR_REVOKED,"**comm"); \
+ ptr = 0; \
} \
}
#define MPID_Group_valid_ptr(ptr,err) MPID_Valid_ptr_class(Group,ptr,MPI_ERR_GROUP,err)
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index 0ad6d64..d84d54d 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -872,16 +872,16 @@ static inline void dequeue_and_set_error(MPID_Request **req, MPID_Request *prev
}
/* remove from queue */
- if (*head == *req)
+ if (*head == *req) {
+ if (*head == recvq_posted_head) MPIR_T_PVAR_LEVEL_DEC(RECVQ, posted_recvq_length, 1);
+
*head = (*req)->dev.next;
- else
+ } else
prev_req->dev.next = (*req)->dev.next;
+
if (*tail == *req)
*tail = prev_req;
- if (*head == recvq_posted_head)
- MPIR_T_PVAR_LEVEL_DEC(RECVQ, posted_recvq_length, 1);
-
/* set error and complete */
(*req)->status.MPI_ERROR = *error;
MPIDI_CH3U_Request_complete(*req);
@@ -978,6 +978,7 @@ int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
continue;
}
+ prev_rreq = rreq;
rreq = rreq->dev.next;
}
http://git.mpich.org/mpich.git/commitdiff/57f6ee88801fd9d2959cc133fe4bb10b2…
commit 57f6ee88801fd9d2959cc133fe4bb10b25848f4f
Author: Wesley Bland <wbland(a)anl.gov>
Date: Wed Jul 30 10:15:47 2014 -0500
Add MPI_Comm_revoke
MPI_Comm_revoke is a special function because it does not have a matching call
on the "receiving side". This is because it has to act as an out-of-band,
resilient broadcast algorithm. Because of this, in this commit, in addition to
the usual functions to implement MPI communication calls (MPI/MPID/CH3/etc.),
we add a new CH3 packet type that will handle revoking a communicator without
involving a matching call from the MPI layer (similar to how RMA is currently
implemented).
The thing that must be handled most carefully when revoking a communicator is
to ensure that a previously used context ID will eventually be returned to the
pool of available context IDs and that after this occurs, no old messages will
match the new usage of the context ID (for instance, if some messages are very
slow and show up late). To accomplish this, revoke is implemented as an
all-to-all algorithm. When one process calls revoke, it will send a message to
all other processes in the communicator, which will trigger that process to
send a message to all other processes, and so on. Once a process has already
revoked its communicator locally, it won't send out another wave of messages.
As each process receives the revoke messages from the other processes, it will
track how many messages have been received. Once it has either received a
revoke message or a message about a process failure for each other process, it
will release its refcount on the communicator object. After the application
has freed all of its references to the communicator (and all requests, files,
etc. associated with it), the context ID will be returned to the available
pool.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index c2afed9..799598e 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -881,8 +881,9 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
#define MPIX_ERR_PROC_FAILED MPICH_ERR_FIRST_MPIX+1 /* Process failure */
#define MPIX_ERR_PROC_FAILED_PENDING MPICH_ERR_FIRST_MPIX+2 /* A failure has caused this request
* to be pending */
+#define MPIX_ERR_REVOKED MPICH_ERR_FIRST_MPIX+3 /* The communciation object has been revoked */
-#define MPICH_ERR_LAST_MPIX MPICH_ERR_FIRST_MPIX+2
+#define MPICH_ERR_LAST_MPIX MPICH_ERR_FIRST_MPIX+3
/* End of MPI's error classes */
@@ -891,7 +892,7 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, int,
void *, MPI_Offset, void *);
typedef int (MPI_Datarep_extent_function)(MPI_Datatype datatype, MPI_Aint *,
- void *);
+ void *);
#define MPI_CONVERSION_FN_NULL ((MPI_Datarep_conversion_function *)0)
/*
@@ -1536,6 +1537,7 @@ int MPI_T_category_changed(int *stamp);
/* Fault Tolerance Extensions */
int MPIX_Comm_failure_ack(MPI_Comm comm);
int MPIX_Comm_failure_get_acked(MPI_Comm comm, MPI_Group *failedgrp);
+int MPIX_Comm_revoke(MPI_Comm comm);
/* End Prototypes */
@@ -2173,6 +2175,7 @@ int PMPI_T_category_changed(int *stamp);
/* Fault Tolerance Extensions */
int PMPIX_Comm_failure_ack(MPI_Comm comm);
int PMPIX_Comm_failure_get_acked(MPI_Comm comm, MPI_Group *failedgrp);
+int PMPIX_Comm_revoke(MPI_Comm comm);
#endif /* MPI_BUILD_PROFILING */
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index cc711df..8d3f2e8 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -1240,6 +1240,9 @@ typedef struct MPID_Comm {
implementting the topology routines */
int next_sched_tag; /* used by the NBC schedule code to allocate tags */
+ int revoked; /* Flag to track whether the communicator
+ * has been revoked */
+
MPID_Info *info; /* Hints to the communicator */
#ifdef MPID_HAS_HETERO
@@ -2779,6 +2782,18 @@ int MPID_Comm_failure_ack(MPID_Comm *comm);
int MPID_Comm_failure_get_acked(MPID_Comm *comm, MPID_Group **failed_group_ptr);
/*@
+ MPID_Comm_revoke - MPID entry point for MPI_Comm_revoke
+
+ Input Parameters:
+ comm - communicator
+ remote - True if we received the revoke message from a remote process
+
+ Return Value:
+ 'MPI_SUCCESS' or a valid MPI error code.
+@*/
+int MPID_Comm_revoke(MPID_Comm *comm, int is_remote);
+
+/*@
MPID_Send - MPID entry point for MPI_Send
Notes:
diff --git a/src/mpi/comm/Makefile.mk b/src/mpi/comm/Makefile.mk
index 5dd2743..2197991 100644
--- a/src/mpi/comm/Makefile.mk
+++ b/src/mpi/comm/Makefile.mk
@@ -28,7 +28,8 @@ mpi_sources += \
src/mpi/comm/intercomm_merge.c \
src/mpi/comm/comm_split_type.c \
src/mpi/comm/comm_failure_ack.c \
- src/mpi/comm/comm_failure_get_acked.c
+ src/mpi/comm/comm_failure_get_acked.c \
+ src/mpi/comm/comm_revoke.c
mpi_core_sources += \
src/mpi/comm/commutil.c
diff --git a/src/mpi/comm/comm_revoke.c b/src/mpi/comm/comm_revoke.c
new file mode 100644
index 0000000..7a5154f
--- /dev/null
+++ b/src/mpi/comm/comm_revoke.c
@@ -0,0 +1,112 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mpiimpl.h"
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+/* -- Begin Profiling Symbol Block for routine MPIX_Comm_revoke */
+#if defined(HAVE_PRAGMA_WEAK)
+#pragma weak MPIX_Comm_revoke = PMPIX_Comm_revoke
+#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
+#pragma _HP_SECONDARY_DEF PMPIX_Comm_revoke MPIX_Comm_revoke
+#elif defined(HAVE_PRAGMA_CRI_DUP)
+#pragma _CRI duplicate MPIX_Comm_revoke as PMPIX_Comm_revoke
+#endif
+/* -- End Profiling Symbol Block */
+
+/* Define MPICH_MPIX_FROM_PMPI if weak symbols are not supported to build
+ the MPI routines */
+#ifndef MPICH_MPI_FROM_PMPI
+#undef MPIX_Comm_revoke
+#define MPIX_Comm_revoke PMPIX_Comm_revoke
+
+#endif
+
+#undef FUNCNAME
+#define FUNCNAME MPIX_Comm_revoke
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+/*@
+ MPIX_Comm_revoke - Prevent a communicator from being used in the future
+
+Input Parameters:
++ comm - communicator to revoke
+
+Notes:
+Asynchronously notifies all MPI processes associated with the communicator 'comm'.
+This will be manifest by returning the MPIX_ERR_REVOKED during a subsequent MPI
+call.
+
+.N Fortran
+
+.N Errors
+.N MPIX_SUCCESS
+@*/
+int MPIX_Comm_revoke(MPI_Comm comm)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPID_Comm *comm_ptr = NULL;
+ MPID_MPI_STATE_DECL(MPID_STATE_MPIX_COMM_REVOKE);
+
+ MPIR_ERRTEST_INITIALIZED_ORDIE();
+
+ MPIU_THREAD_CS_ENTER(ALLFUNC,);
+ MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_REVOKE);
+
+ /* Validate parameters, especially handles needing to be converted */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ MPIR_ERRTEST_COMM(comm, mpi_errno);
+ }
+ MPID_END_ERROR_CHECKS;
+ }
+# endif
+
+ /* Convert MPI object handles to object pointers */
+ MPID_Comm_get_ptr( comm, comm_ptr );
+
+ /* Validate parameters and objects (post conversion) */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ /* Validate comm_ptr */
+ MPID_Comm_valid_ptr( comm_ptr, mpi_errno, TRUE );
+ if (mpi_errno) goto fn_fail;
+ }
+ MPID_END_ERROR_CHECKS;
+ }
+# endif
+
+ /* ... body of routine ... */
+
+ mpi_errno = MPID_Comm_revoke(comm_ptr, 0);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ /* ... end of body of routine ... */
+
+ fn_exit:
+ MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_REVOKE);
+ MPIU_THREAD_CS_EXIT(ALLFUNC,);
+ return mpi_errno;
+ fn_fail:
+ /* --BEGIN ERROR HANDLING-- */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ mpi_errno = MPIR_Err_create_code(
+ mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpix_comm_revoke",
+ "**mpix_comm_revoke %C", comm);
+ }
+# endif
+ mpi_errno = MPIR_Err_return_comm( comm_ptr, FCNAME, mpi_errno );
+ goto fn_exit;
+ /* --END ERROR HANDLING-- */
+}
diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c
index dbe81fd..cae702f 100644
--- a/src/mpi/comm/commutil.c
+++ b/src/mpi/comm/commutil.c
@@ -135,6 +135,9 @@ int MPIR_Comm_init(MPID_Comm *comm_p)
/* abstractions bleed a bit here... :( */
comm_p->next_sched_tag = MPIR_FIRST_NBC_TAG;
+ /* Initialize the revoked flag as false */
+ comm_p->revoked = 0;
+
/* Fields not set include context_id, remote and local size, and
kind, since different communicator construction routines need
different values */
diff --git a/src/mpi/errhan/baseerrnames.txt b/src/mpi/errhan/baseerrnames.txt
index 8f07168..cc71016 100644
--- a/src/mpi/errhan/baseerrnames.txt
+++ b/src/mpi/errhan/baseerrnames.txt
@@ -79,3 +79,4 @@ MPI_ERR_RMA_RANGE 55 **rmarange
MPI_ERR_RMA_ATTACH 56 **rmaattach
MPI_ERR_RMA_SHARED 57 **rmashared
MPI_ERR_RMA_FLAVOR 58 **rmaflavor
+MPIX_ERR_REVOKED 59 **revoked
diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt
index 36eaa2c..8bd6810 100644
--- a/src/mpi/errhan/errnames.txt
+++ b/src/mpi/errhan/errnames.txt
@@ -423,6 +423,7 @@ unexpected messages queued.
**node_root_rank:Unable to get the node root rank
**proc_failed:Process failed
**failure_pending:Request pending due to failure
+**revoked:Communication object revoked
# Duplicates?
#**argnull:Invalid null parameter
#**argnull %s:Invalid null parameter %s
@@ -1100,6 +1101,8 @@ is too big (> MPIU_SHMW_GHND_SZ)
**mpix_comm_failure_ack %C:MPIX_Comm_failure_ack(%C) failed
**mpix_comm_failure_get_acked:MPIX_Comm_failure_get_acked failed
**mpix_comm_failure_get_acked %C %p:MPIX_Comm_failure_get_acked(%C, group=%p) failed
+**mpix_comm_revoke:MPIX_Comm_revoke failed
+**mpix_comm_revoke %C:MPIX_Comm_revoke(%C) failed
**mpi_intercomm_create:MPI_Intercomm_create failed
**mpi_intercomm_create %C %d %C %d %d %p:MPI_Intercomm_create(%C, local_leader=%d, %C, remote_leader=%d, tag=%d, newintercomm=%p) failed
**mpi_intercomm_merge:MPI_Intercomm_merge failed
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index fe8e7ed..5e3f82f 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -1504,6 +1504,7 @@ MPID_Request * MPIDI_CH3U_Recvq_FDP_or_AEU(MPIDI_Message_match * match,
int MPIDI_CH3U_Recvq_count_unexp(void);
int MPIDI_CH3U_Complete_posted_with_error(MPIDI_VC_t *vc);
int MPIDI_CH3U_Complete_disabled_anysources(void);
+int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr);
int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq,
@@ -1526,6 +1527,7 @@ int MPIDI_CH3U_Receive_data_unexpected(MPID_Request * rreq, char *buf, MPIDI_msg
int MPIDI_CH3I_Comm_init(void);
int MPIDI_CH3I_Comm_handle_failed_procs(MPID_Group *new_failed_procs);
+void MPIDI_CH3I_Comm_find(MPIR_Context_id_t context_id, MPID_Comm **comm);
/* The functions below allow channels to register functions to be
called immediately after a communicator has been created, and
@@ -1820,7 +1822,8 @@ int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_EndCH3( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
-
+int MPIDI_CH3_PktHandler_Revoke(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
+ MPIDI_msg_sz_t *buflen, MPID_Request **rreqp);
int MPIDI_CH3_PktHandler_Init( MPIDI_CH3_PktHandler_Fcn *[], int );
#ifdef MPICH_DBG_OUTPUT
diff --git a/src/mpid/ch3/include/mpidpkt.h b/src/mpid/ch3/include/mpidpkt.h
index 98c5fce..570cd56 100644
--- a/src/mpid/ch3/include/mpidpkt.h
+++ b/src/mpid/ch3/include/mpidpkt.h
@@ -100,6 +100,7 @@ typedef enum
MPIDI_CH3_PKT_GET_ACCUM_RESP,
MPIDI_CH3_PKT_FLOW_CNTL_UPDATE, /* FIXME: Unused */
MPIDI_CH3_PKT_CLOSE,
+ MPIDI_CH3_PKT_REVOKE,
MPIDI_CH3_PKT_END_CH3,
/* The channel can define additional types by defining the value
MPIDI_CH3_PKT_ENUM */
@@ -411,6 +412,13 @@ typedef struct MPIDI_CH3_Pkt_close
}
MPIDI_CH3_Pkt_close_t;
+typedef struct MPIDI_CH3_Pkt_revoke
+{
+ MPIDI_CH3_Pkt_type_t type;
+ MPIR_Context_id_t revoked_comm;
+}
+MPIDI_CH3_Pkt_revoke_t;
+
typedef union MPIDI_CH3_Pkt
{
MPIDI_CH3_Pkt_type_t type;
@@ -445,6 +453,7 @@ typedef union MPIDI_CH3_Pkt
MPIDI_CH3_Pkt_fop_t fop;
MPIDI_CH3_Pkt_fop_resp_t fop_resp;
MPIDI_CH3_Pkt_get_accum_resp_t get_accum_resp;
+ MPIDI_CH3_Pkt_revoke_t revoke;
# if defined(MPIDI_CH3_PKT_DECL)
MPIDI_CH3_PKT_DECL
# endif
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 75e0214..13d9544 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -173,6 +173,9 @@ typedef struct MPIDI_CH3I_comm
int eager_max_msg_sz; /* comm-wide eager/rendezvous message threshold */
int anysource_enabled; /* TRUE iff this anysource recvs can be posted on this communicator */
int last_ack_rank; /* The rank of the last acknowledged failure */
+ int waiting_for_revoke; /* The number of other processes from which we are
+ * waiting for a revoke message before we can release
+ * the context id */
struct MPID_nem_barrier_vars *barrier_vars; /* shared memory variables used in barrier */
struct MPID_Comm *next; /* next pointer for list of communicators */
struct MPID_Comm *prev; /* prev pointer for list of communicators */
diff --git a/src/mpid/ch3/src/Makefile.mk b/src/mpid/ch3/src/Makefile.mk
index 5160b5b..091613d 100644
--- a/src/mpid/ch3/src/Makefile.mk
+++ b/src/mpid/ch3/src/Makefile.mk
@@ -12,6 +12,7 @@ mpi_core_sources += \
src/mpid/ch3/src/ch3u_handle_connection.c \
src/mpid/ch3/src/ch3u_handle_recv_pkt.c \
src/mpid/ch3/src/ch3u_handle_recv_req.c \
+ src/mpid/ch3/src/ch3u_handle_revoke_pkt.c \
src/mpid/ch3/src/ch3u_handle_send_req.c \
src/mpid/ch3/src/ch3u_port.c \
src/mpid/ch3/src/ch3u_recvq.c \
@@ -30,6 +31,7 @@ mpi_core_sources += \
src/mpid/ch3/src/mpid_comm_disconnect.c \
src/mpid/ch3/src/mpid_comm_spawn_multiple.c \
src/mpid/ch3/src/mpid_comm_failure_ack.c \
+ src/mpid/ch3/src/mpid_comm_revoke.c \
src/mpid/ch3/src/mpid_finalize.c \
src/mpid/ch3/src/mpid_get_universe_size.c \
src/mpid/ch3/src/mpid_getpname.c \
diff --git a/src/mpid/ch3/src/ch3u_comm.c b/src/mpid/ch3/src/ch3u_comm.c
index 89662b5..e39cd89 100644
--- a/src/mpid/ch3/src/ch3u_comm.c
+++ b/src/mpid/ch3/src/ch3u_comm.c
@@ -333,3 +333,18 @@ int MPIDI_CH3I_Comm_handle_failed_procs(MPID_Group *new_failed_procs)
fn_fail:
goto fn_exit;
}
+
+void MPIDI_CH3I_Comm_find(MPIR_Context_id_t context_id, MPID_Comm **comm)
+{
+ MPIDI_STATE_DECL(MPIDI_STATE_MPIDI_CH3I_COMM_FIND);
+ MPIDI_FUNC_ENTER(MPIDI_STATE_MPIDI_CH3I_COMM_FIND);
+
+ COMM_FOREACH((*comm)) {
+ if ((*comm)->context_id == context_id) {
+ MPIU_DBG_MSG_D(CH3_OTHER,VERBOSE,"Found matching context id: %d", context_id);
+ break;
+ }
+ }
+
+ MPIDI_FUNC_EXIT(MPIDI_STATE_MPIDI_CH3I_COMM_FIND);
+}
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
index 92d3e6b..f60ba73 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
@@ -610,6 +610,10 @@ int MPIDI_CH3_PktHandler_Init( MPIDI_CH3_PktHandler_Fcn *pktArray[],
MPIDI_CH3_PktHandler_Get_AccumResp;
/* End of default RMA operations */
+ /* Fault tolerance */
+ pktArray[MPIDI_CH3_PKT_REVOKE] =
+ MPIDI_CH3_PktHandler_Revoke;
+
fn_fail:
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_INIT);
return mpi_errno;
diff --git a/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c b/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
new file mode 100644
index 0000000..29b19e1
--- /dev/null
+++ b/src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
@@ -0,0 +1,38 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mpidimpl.h"
+
+#undef FUNCNAME
+#define FUNCNAME MPIDI_CH3_PktHandler_Revoke
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPIDI_CH3_PktHandler_Revoke(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
+ MPIDI_msg_sz_t *buflen, MPID_Request **rreqp)
+{
+ MPIDI_CH3_Pkt_revoke_t *revoke_pkt = &pkt->revoke;
+ int mpi_errno = MPI_SUCCESS;
+ MPID_Comm *comm_ptr = NULL;
+
+ MPIU_DBG_MSG_D(CH3_OTHER, VERBOSE, "Received revoke pkt from %d", vc->pg_rank);
+
+ /* Search through all of the communicators to find the right context_id */
+ MPIDI_CH3I_Comm_find(revoke_pkt->revoked_comm, &comm_ptr);
+ if (comm_ptr == NULL)
+ MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+ "**ch3|postrecv %s", "MPIDI_CH3_PKT_REVOKE");
+
+ mpi_errno = MPID_Comm_revoke(comm_ptr, 1);
+ if (mpi_errno != MPI_SUCCESS)
+ MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+ "**ch3|postrecv %s", "MPIDI_CH3_PKT_REVOKE");
+
+ /* There is no request associated with a revoke packet */
+ *rreqp = NULL;
+
+fn_fail:
+ return mpi_errno;
+}
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index 67faec6..0ad6d64 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -860,7 +860,7 @@ static inline int req_uses_vc(const MPID_Request* req, const MPIDI_VC_t *vc)
#define FCNAME MPIU_QUOTE(FUNCNAME)
/* This dequeues req from the posted recv queue, set req's error code to comm_fail, and updates the req pointer.
Note that this creates a new error code if one hasn't already been created (i.e., if *error is MPI_SUCCESS). */
-static inline void dequeue_and_set_error(MPID_Request **req, MPID_Request *prev_req, int *error, int rank)
+static inline void dequeue_and_set_error(MPID_Request **req, MPID_Request *prev_req, MPID_Request **head, MPID_Request **tail, int *error, int rank)
{
MPID_Request *next = (*req)->dev.next;
@@ -872,14 +872,15 @@ static inline void dequeue_and_set_error(MPID_Request **req, MPID_Request *prev
}
/* remove from queue */
- if (recvq_posted_head == *req)
- recvq_posted_head = (*req)->dev.next;
+ if (*head == *req)
+ *head = (*req)->dev.next;
else
prev_req->dev.next = (*req)->dev.next;
- if (recvq_posted_tail == *req)
- recvq_posted_tail = prev_req;
+ if (*tail == *req)
+ *tail = prev_req;
- MPIR_T_PVAR_LEVEL_DEC(RECVQ, posted_recvq_length, 1);
+ if (*head == recvq_posted_head)
+ MPIR_T_PVAR_LEVEL_DEC(RECVQ, posted_recvq_length, 1);
/* set error and complete */
(*req)->status.MPI_ERROR = *error;
@@ -890,6 +891,101 @@ static inline void dequeue_and_set_error(MPID_Request **req, MPID_Request *prev
*req = next;
}
+/*
+ * MPIDI_CH3U_Clean_recvq()
+ *
+ * Looks through the entire unexpected recv queue and the posted recv queues.
+ * If a request is found that involved the provided communicator (comm_ptr),
+ * it is dequeed and marked as failed via MPIX_ERR_REVOKED.
+ *
+ * Multithread - This routine must be called from within a MSGQUEUE
+ * critical section. If a request is allocated, it must not release
+ * the MSGQUEUE until the request is completely valid, as another thread
+ * may then find it and dequeue it.
+ *
+ */
+int MPIDI_CH3U_Clean_recvq(MPID_Comm *comm_ptr)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int error = MPIX_ERR_REVOKED;
+ MPID_Request *rreq, *prev_rreq = NULL;
+ MPIDI_Message_match match;
+ MPIDI_Message_match mask;
+ MPIDI_STATE_DECL(MPIDI_CH3U_CLEAN_RECVQ);
+
+ MPIDI_FUNC_ENTER(MPIDI_CH3U_CLEAN_RECVQ);
+
+ MPIU_THREAD_CS_ASSERT_HELD(MSGQUEUE);
+
+ rreq = recvq_unexpected_head;
+ mask.parts.context_id = ~0;
+ mask.parts.rank = mask.parts.tag = 0;
+
+ /* Clear the error bit in the tag since we don't care about whether or
+ * not we're trying to report an error anymore. */
+ MPIR_TAG_CLEAR_ERROR_BIT(mask.parts.tag);
+
+ while (NULL != rreq) {
+ /* We'll have to do this matching twice. Once for the pt2pt context id
+ * and once for the collective context id */
+ match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_PT2PT;
+
+ if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
+ MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+ "cleaning up unexpected pt2pt pkt rank=%d tag=%d contextid=%d",
+ rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
+ dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
+ continue;
+ }
+
+ match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_COLL;
+
+ if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
+ MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+ "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
+ rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
+ dequeue_and_set_error(&rreq, prev_rreq, &recvq_unexpected_head, &recvq_unexpected_tail, &error, MPI_PROC_NULL);
+ continue;
+ }
+
+ prev_rreq = rreq;
+ rreq = rreq->dev.next;
+ }
+
+ rreq = recvq_posted_head;
+ prev_rreq = NULL;
+
+ while (NULL != rreq) {
+ /* We'll have to do this matching twice. Once for the pt2pt context id
+ * and once for the collective context id */
+ match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_PT2PT;
+
+ if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
+ MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+ "cleaning up unexpected pt2pt pkt rank=%d tag=%d contextid=%d",
+ rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
+ dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
+ continue;
+ }
+
+ match.parts.context_id = comm_ptr->recvcontext_id + MPID_CONTEXT_INTRA_COLL;
+
+ if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, match, mask)) {
+ MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
+ "cleaning up unexpected collective pkt rank=%d tag=%d contextid=%d",
+ rreq->dev.match.parts.rank, rreq->dev.match.parts.tag, rreq->dev.match.parts.context_id));
+ dequeue_and_set_error(&rreq, prev_rreq, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
+ continue;
+ }
+
+ rreq = rreq->dev.next;
+ }
+
+ MPIDI_FUNC_EXIT(MPIDI_CH3U_CLEAN_RECVQ);
+
+ return mpi_errno;
+}
+
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3U_Complete_disabled_anysources
#undef FCNAME
@@ -911,7 +1007,7 @@ int MPIDI_CH3U_Complete_disabled_anysources(void)
prev_req = NULL;
while (req) {
if (req->dev.match.parts.rank == MPI_ANY_SOURCE && !MPIDI_CH3I_Comm_AS_enabled(req->comm)) {
- dequeue_and_set_error(&req, prev_req, &error, MPI_PROC_NULL); /* we don't know the rank of the failed proc */
+ dequeue_and_set_error(&req, prev_req, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL); /* we don't know the rank of the failed proc */
} else {
prev_req = req;
req = req->dev.next;
@@ -949,7 +1045,7 @@ int MPIDI_CH3U_Complete_posted_with_error(MPIDI_VC_t *vc)
prev_req = NULL;
while (req) {
if (req->dev.match.parts.rank != MPI_ANY_SOURCE && req_uses_vc(req, vc)) {
- dequeue_and_set_error(&req, prev_req, &error, vc->pg_rank);
+ dequeue_and_set_error(&req, prev_req, &recvq_posted_head, &recvq_posted_tail, &error, MPI_PROC_NULL);
} else {
prev_req = req;
req = req->dev.next;
diff --git a/src/mpid/ch3/src/mpid_comm_disconnect.c b/src/mpid/ch3/src/mpid_comm_disconnect.c
index 67681ac..a115c6e 100644
--- a/src/mpid/ch3/src/mpid_comm_disconnect.c
+++ b/src/mpid/ch3/src/mpid_comm_disconnect.c
@@ -24,11 +24,16 @@
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_Comm_disconnect(MPID_Comm *comm_ptr)
{
- int mpi_errno;
+ int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_COMM_DISCONNECT);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_COMM_DISCONNECT);
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm_ptr->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
/* Before releasing the communicator, we need to ensure that all VCs are
in a stable state. In particular, if a VC is still in the process of
connecting, complete the connection before tearing it down */
diff --git a/src/mpid/ch3/src/mpid_comm_revoke.c b/src/mpid/ch3/src/mpid_comm_revoke.c
new file mode 100644
index 0000000..7a10b7d
--- /dev/null
+++ b/src/mpid/ch3/src/mpid_comm_revoke.c
@@ -0,0 +1,108 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mpidimpl.h"
+
+/*
+ * This function does all of the work or either revoking the communciator for
+ * the first time or keeping track of an ongoing revocation.
+ *
+ * comm_ptr - The communicator being revoked
+ * is_remote - If we received the revocation from a remote process, this should
+ * be set to true. This way we'll know to decrement the counter twice
+ * (once for our local revocation and once for the remote).
+ */
+#undef FUNCNAME
+#define FUNCNAME MPID_Comm_revoke
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_Comm_revoke(MPID_Comm *comm_ptr, int is_remote)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPIDI_CH3_Pkt_t upkt;
+ MPIDI_CH3_Pkt_revoke_t *revoke_pkt = &upkt.revoke;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_COMM_REVOKE);
+ MPIDI_VC_t *vc;
+ MPID_IOV iov[MPID_IOV_LIMIT];
+ int i, size, my_rank, failed = 0;
+ MPID_Request *request;
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_COMM_REVOKE);
+
+ if (0 == comm_ptr->revoked) {
+ /* Mark the communicator as revoked locally */
+ comm_ptr->revoked = 1;
+
+ /* Keep a reference to this comm so it doesn't get destroyed while
+ * it's being revoked */
+ MPIR_Comm_add_ref(comm_ptr);
+
+ /* Send out the revoke message */
+ MPIDI_Pkt_init(revoke_pkt, MPIDI_CH3_PKT_REVOKE);
+ revoke_pkt->revoked_comm = comm_ptr->context_id;
+
+ size = comm_ptr->remote_size;
+ my_rank = comm_ptr->rank;
+ for (i = 0; i < size; i++) {
+ if (i == my_rank) continue;
+ request = NULL;
+
+ MPIDI_Comm_get_vc_set_active(comm_ptr, i, &vc);
+
+ iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) revoke_pkt;
+ iov[0].MPID_IOV_LEN = sizeof(*revoke_pkt);
+
+ MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+ mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, 1, &request);
+ MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+ if (mpi_errno) failed++;
+ if (NULL != request)
+ /* We don't need to keep a reference to this request. The
+ * progress engine will keep a reference until it completes
+ * later */
+ MPID_Request_release(request);
+ }
+
+ /* Start a counter to track how many revoke messages we've received from
+ * other ranks */
+ comm_ptr->ch.waiting_for_revoke = comm_ptr->local_size - 1 - is_remote - failed; /* Subtract the processes who already know about the revoke */
+ MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE, (MPIU_DBG_FDEST, "Comm %08x waiting_for_revoke: %d", comm_ptr->handle, comm_ptr->ch.waiting_for_revoke));
+
+ /* Check to see if we are done revoking */
+ if (comm_ptr->ch.waiting_for_revoke == 0) {
+ MPIR_Comm_release(comm_ptr, 0);
+ }
+
+ /* Go clean up all of the existing operations involving this
+ * communicator. This includes completing existing MPI requests, MPID
+ * requests, and cleaning up the unexpected queue to make sure there
+ * aren't any unexpected messages hanging around. */
+
+ /* Clean up the receive and unexpected queues */
+ MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+ MPIDI_CH3U_Clean_recvq(comm_ptr);
+ MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+ } else if (is_remote) { /* If this is local, we've already revoked and don't need to do it again. */
+ /* Decrement the revoke counter */
+ comm_ptr->ch.waiting_for_revoke--;
+ MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE, (MPIU_DBG_FDEST, "Comm %08x waiting_for_revoke: %d", comm_ptr->handle, comm_ptr->ch.waiting_for_revoke));
+
+ /* Check to see if we are done revoking */
+ if (comm_ptr->ch.waiting_for_revoke == 0) {
+ MPIR_Comm_release(comm_ptr, 0);
+ }
+ }
+
+fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_COMM_REVOKE);
+ return MPI_SUCCESS;
+fn_fail:
+ if (request) {
+ MPIU_Object_set_ref(request, 0);
+ MPIDI_CH3_Request_destroy(request);
+ }
+ goto fn_exit;
+}
diff --git a/src/mpid/ch3/src/mpid_comm_spawn_multiple.c b/src/mpid/ch3/src/mpid_comm_spawn_multiple.c
index 975c040..12cd32b 100644
--- a/src/mpid/ch3/src/mpid_comm_spawn_multiple.c
+++ b/src/mpid/ch3/src/mpid_comm_spawn_multiple.c
@@ -43,6 +43,11 @@ int MPID_Comm_spawn_multiple(int count, char *array_of_commands[],
MPIDI_FUNC_ENTER(MPID_STATE_MPID_COMM_SPAWN_MULTIPLE);
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm_ptr->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
/* We allow an empty implementation of this function to
simplify building MPICH on systems that have difficulty
supporing process creation */
@@ -57,6 +62,8 @@ int MPID_Comm_spawn_multiple(int count, char *array_of_commands[],
"**notimpl %s", FCNAME);
# endif
+fn_fail:
+fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_COMM_SPAWN_MULTIPLE);
return mpi_errno;
}
diff --git a/src/mpid/ch3/src/mpid_improbe.c b/src/mpid/ch3/src/mpid_improbe.c
index 5dd7b5f..4f2dfd7 100644
--- a/src/mpid/ch3/src/mpid_improbe.c
+++ b/src/mpid/ch3/src/mpid_improbe.c
@@ -30,6 +30,11 @@ int MPID_Improbe(int source, int tag, MPID_Comm *comm, int context_offset,
goto fn_exit;
}
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
#ifdef ENABLE_COMM_OVERRIDES
if (MPIDI_Anysource_improbe_fn) {
if (source == MPI_ANY_SOURCE) {
diff --git a/src/mpid/ch3/src/mpid_iprobe.c b/src/mpid/ch3/src/mpid_iprobe.c
index 601f27b..07e1205 100644
--- a/src/mpid/ch3/src/mpid_iprobe.c
+++ b/src/mpid/ch3/src/mpid_iprobe.c
@@ -32,6 +32,11 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
goto fn_exit;
}
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
#ifdef ENABLE_COMM_OVERRIDES
if (MPIDI_Anysource_iprobe_fn) {
if (source == MPI_ANY_SOURCE) {
diff --git a/src/mpid/ch3/src/mpid_irecv.c b/src/mpid/ch3/src/mpid_irecv.c
index 103a352..28e7b66 100644
--- a/src/mpid/ch3/src/mpid_irecv.c
+++ b/src/mpid/ch3/src/mpid_irecv.c
@@ -31,6 +31,12 @@ int MPID_Irecv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
goto fn_exit;
}
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Comm has been revoked. Returning from MPID_IRECV.");
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
MPIU_THREAD_CS_ENTER(MSGQUEUE,);
rreq = MPIDI_CH3U_Recvq_FDU_or_AEP(rank, tag,
comm->recvcontext_id + context_offset,
@@ -161,6 +167,8 @@ int MPID_Irecv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
rreq->handle);
fn_fail:
+ MPIU_DBG_MSG_D(CH3_OTHER,VERBOSE,"IRECV errno: 0x%08x", mpi_errno);
+ MPIU_DBG_MSG_D(CH3_OTHER,VERBOSE,"(class: %d)", MPIR_ERR_GET_CLASS(mpi_errno));
MPIDI_FUNC_EXIT(MPID_STATE_MPID_IRECV);
return mpi_errno;
}
diff --git a/src/mpid/ch3/src/mpid_irsend.c b/src/mpid/ch3/src/mpid_irsend.c
index 5477ea0..d1ce07f 100644
--- a/src/mpid/ch3/src/mpid_irsend.c
+++ b/src/mpid/ch3/src/mpid_irsend.c
@@ -37,6 +37,11 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
"rank=%d, tag=%d, context=%d",
rank, tag, comm->context_id + context_offset));
+
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
{
@@ -145,6 +150,7 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
}
);
+ fn_fail:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_IRSEND);
return mpi_errno;
}
diff --git a/src/mpid/ch3/src/mpid_isend.c b/src/mpid/ch3/src/mpid_isend.c
index f110316..086dc6f 100644
--- a/src/mpid/ch3/src/mpid_isend.c
+++ b/src/mpid/ch3/src/mpid_isend.c
@@ -49,6 +49,12 @@ int MPID_Isend(const void * buf, int count, MPI_Datatype datatype, int rank,
MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
"rank=%d, tag=%d, context=%d",
rank, tag, comm->context_id + context_offset));
+
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Communicator revoked. MPID_ISEND returning");
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
{
@@ -179,6 +185,7 @@ int MPID_Isend(const void * buf, int count, MPI_Datatype datatype, int rank,
}
);
+ fn_fail:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_ISEND);
return mpi_errno;
}
diff --git a/src/mpid/ch3/src/mpid_issend.c b/src/mpid/ch3/src/mpid_issend.c
index 189907b..ce672fb 100644
--- a/src/mpid/ch3/src/mpid_issend.c
+++ b/src/mpid/ch3/src/mpid_issend.c
@@ -36,6 +36,11 @@ int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, in
MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
"rank=%d, tag=%d, context=%d",
rank, tag, comm->context_id + context_offset));
+
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
{
@@ -124,6 +129,7 @@ int MPID_Issend(const void * buf, int count, MPI_Datatype datatype, int rank, in
}
)
+ fn_fail:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_ISSEND);
return mpi_errno;
}
diff --git a/src/mpid/ch3/src/mpid_mprobe.c b/src/mpid/ch3/src/mpid_mprobe.c
index bc4aed4..550a832 100644
--- a/src/mpid/ch3/src/mpid_mprobe.c
+++ b/src/mpid/ch3/src/mpid_mprobe.c
@@ -28,6 +28,11 @@ int MPID_Mprobe(int source, int tag, MPID_Comm *comm, int context_offset,
goto fn_exit;
}
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
#ifdef ENABLE_COMM_OVERRIDES
if (MPIDI_Anysource_improbe_fn) {
if (source == MPI_ANY_SOURCE) {
diff --git a/src/mpid/ch3/src/mpid_probe.c b/src/mpid/ch3/src/mpid_probe.c
index 6d2f41b..3b91941 100644
--- a/src/mpid/ch3/src/mpid_probe.c
+++ b/src/mpid/ch3/src/mpid_probe.c
@@ -26,6 +26,11 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
goto fn_exit;
}
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
#ifdef ENABLE_COMM_OVERRIDES
if (MPIDI_Anysource_iprobe_fn) {
if (source == MPI_ANY_SOURCE) {
diff --git a/src/mpid/ch3/src/mpid_recv.c b/src/mpid/ch3/src/mpid_recv.c
index 76d782e..45f1580 100644
--- a/src/mpid/ch3/src/mpid_recv.c
+++ b/src/mpid/ch3/src/mpid_recv.c
@@ -39,6 +39,11 @@ int MPID_Recv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
goto fn_exit;
}
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
MPIU_THREAD_CS_ENTER(MSGQUEUE,);
rreq = MPIDI_CH3U_Recvq_FDU_or_AEP(rank, tag,
comm->recvcontext_id + context_offset,
diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c
index caaebe6..c112db0 100644
--- a/src/mpid/ch3/src/mpid_rma.c
+++ b/src/mpid/ch3/src/mpid_rma.c
@@ -77,6 +77,11 @@ int MPID_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info *info,
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_CREATE);
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm_ptr->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
mpi_errno = win_init(size, disp_unit, MPI_WIN_FLAVOR_CREATE, MPI_WIN_UNIFIED, comm_ptr, win_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
diff --git a/src/mpid/ch3/src/mpid_rsend.c b/src/mpid/ch3/src/mpid_rsend.c
index 7cacea0..4561804 100644
--- a/src/mpid/ch3/src/mpid_rsend.c
+++ b/src/mpid/ch3/src/mpid_rsend.c
@@ -39,6 +39,11 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
"rank=%d, tag=%d, context=%d",
rank, tag, comm->context_id + context_offset));
+
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
{
@@ -151,6 +156,7 @@ int MPID_Rsend(const void * buf, int count, MPI_Datatype datatype, int rank, int
}
);
+ fn_fail:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_RSEND);
return mpi_errno;
}
diff --git a/src/mpid/ch3/src/mpid_send.c b/src/mpid/ch3/src/mpid_send.c
index 0328b0c..d96cf14 100644
--- a/src/mpid/ch3/src/mpid_send.c
+++ b/src/mpid/ch3/src/mpid_send.c
@@ -38,6 +38,11 @@ int MPID_Send(const void * buf, int count, MPI_Datatype datatype, int rank,
"rank=%d, tag=%d, context=%d",
rank, tag, comm->context_id + context_offset));
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
{
mpi_errno = MPIDI_Isend_self(buf, count, datatype, rank, tag, comm,
diff --git a/src/mpid/ch3/src/mpid_ssend.c b/src/mpid/ch3/src/mpid_ssend.c
index 6127d09..e4ed3dc 100644
--- a/src/mpid/ch3/src/mpid_ssend.c
+++ b/src/mpid/ch3/src/mpid_ssend.c
@@ -37,6 +37,11 @@ int MPID_Ssend(const void * buf, int count, MPI_Datatype datatype, int rank, int
"rank=%d, tag=%d, context=%d",
rank, tag, comm->context_id + context_offset));
+ /* Check to make sure the communicator hasn't already been revoked */
+ if (comm->revoked) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+ }
+
if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
{
mpi_errno = MPIDI_Isend_self(buf, count, datatype, rank, tag, comm,
@@ -109,6 +114,7 @@ int MPID_Ssend(const void * buf, int count, MPI_Datatype datatype, int rank, int
must wait until sreq completes */
}
+ fn_fail:
fn_exit:
*request = sreq;
diff --git a/test/mpi/ft/Makefile.am b/test/mpi/ft/Makefile.am
index 01f5a96..90fa619 100644
--- a/test/mpi/ft/Makefile.am
+++ b/test/mpi/ft/Makefile.am
@@ -10,4 +10,4 @@ include $(top_srcdir)/Makefile.mtest
## for all programs that are just built from the single corresponding source
## file, we don't need per-target _SOURCES rules, automake will infer them
## correctly
-noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter failure_ack anysource
+noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter failure_ack anysource revoke_nofail
http://git.mpich.org/mpich.git/commitdiff/628d2daf99811e7a426c08f3726ec8072…
commit 628d2daf99811e7a426c08f3726ec8072d927178
Author: Wesley Bland <wbland(a)anl.gov>
Date: Fri Mar 28 14:03:20 2014 -0500
Add test for anysource handling
This test ensures that MPI_ANY_SOURCE receives are handles correctly after a
failure occurs. It tests both that failures are returned when they should be
(unacknowledged failures) and not returned when they shouldn't (acknowledged
failures).
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/test/mpi/ft/Makefile.am b/test/mpi/ft/Makefile.am
index 98b8123..01f5a96 100644
--- a/test/mpi/ft/Makefile.am
+++ b/test/mpi/ft/Makefile.am
@@ -10,4 +10,4 @@ include $(top_srcdir)/Makefile.mtest
## for all programs that are just built from the single corresponding source
## file, we don't need per-target _SOURCES rules, automake will infer them
## correctly
-noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter failure_ack
+noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter failure_ack anysource
diff --git a/test/mpi/ft/anysource.c b/test/mpi/ft/anysource.c
new file mode 100644
index 0000000..31459f6
--- /dev/null
+++ b/test/mpi/ft/anysource.c
@@ -0,0 +1,78 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include <mpi.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+/*
+ * This test makes sure the MPI_ANY_SOURCE receive operations are handled
+ * correctly. */
+int main(int argc, char **argv)
+{
+ int rank, size, err, ec;
+ char buf[10] = " No errors";
+ char error[MPI_MAX_ERROR_STRING];
+ MPI_Request request;
+ MPI_Status status;
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ if (size < 3) {
+ fprintf(stderr, "Must run with at least 3 processes\n");
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+ if (rank == 1) {
+ exit(EXIT_FAILURE);
+ }
+
+ /* Make sure ANY_SOURCE returns correctly after a failure */
+ if (rank == 0) {
+ err = MPI_Recv(buf, 10, MPI_CHAR, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+ if (MPI_SUCCESS == err) {
+ fprintf(stderr, "Expected a failure for receive from ANY_SOURCE\n");
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ /* Make sure that new ANY_SOURCE operations don't work yet */
+ MPI_Irecv(buf, 10, MPI_CHAR, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &request);
+ err = MPI_Wait(&request, &status);
+ if (MPI_SUCCESS == err) {
+ fprintf(stderr, "Expected a failure for receive from ANY_SOURCE\n");
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ /* Make sure that ANY_SOURCE works after failures are acknowledged */
+ MPIX_Comm_failure_ack(MPI_COMM_WORLD);
+ err = MPI_Wait(&request, &status);
+ if (MPI_SUCCESS != err) {
+ MPI_Error_class(err, &ec);
+ MPI_Error_string(err, error, &size);
+ fprintf(stderr, "Unexpected failure after acknowledged failure (%d)\n%s", ec, error);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ fprintf(stdout, "%s\n", buf);
+ } else if (rank == 2) {
+ /* Make sure we don't send our first message too early */
+ sleep(2);
+
+ err = MPI_Send(buf, 10, MPI_CHAR, 0, 0, MPI_COMM_WORLD);
+ if (MPI_SUCCESS != err) {
+ MPI_Error_class(err, &ec);
+ MPI_Error_string(err, error, &size);
+ fprintf(stderr, "Unexpected failure from MPI_Send (%d)\n%s", ec, error);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+ }
+
+ MPI_Finalize();
+}
diff --git a/test/mpi/ft/revoke_nofail.c b/test/mpi/ft/revoke_nofail.c
new file mode 100644
index 0000000..9e48712
--- /dev/null
+++ b/test/mpi/ft/revoke_nofail.c
@@ -0,0 +1,66 @@
+
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include <mpi.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+ * This test ensures that MPI_Comm_revoke works when a process failure has not
+ * occurred yet.
+ */
+int main(int argc, char **argv)
+{
+ int rank, size;
+ int rc, ec;
+ char error[MPI_MAX_ERROR_STRING];
+ MPI_Comm world_dup, world_dup2;
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ if (size < 4) {
+ fprintf( stderr, "Must run with at least 4 processes\n" );
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+ MPI_Comm_dup(MPI_COMM_WORLD, &world_dup);
+ MPI_Comm_dup(MPI_COMM_WORLD, &world_dup2);
+
+ if (rank == 3)
+ MPIX_Comm_revoke(world_dup);
+
+ rc = MPI_Barrier(world_dup);
+ MPI_Error_class(rc, &ec);
+ if (ec != MPIX_ERR_REVOKED) {
+ MPI_Error_string(ec, error, &size);
+ fprintf(stderr, "[%d] MPI_Barrier should have returned MPIX_ERR_REVOKED (%d), but it actually returned: %d\n%s\n",
+ rank, MPIX_ERR_REVOKED, ec, error);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ rc = MPI_Barrier(world_dup2);
+ MPI_Error_class(rc, &ec);
+ if (ec != MPI_SUCCESS) {
+ MPI_Error_string(ec, error, &size);
+ fprintf(stderr, "[%d] MPI_Barrier should have returned MPI_SUCCESS, but it actually returned: %d\n%s\n",
+ rank, ec, error);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ MPI_Comm_free(&world_dup);
+ MPI_Comm_free(&world_dup2);
+
+ if (rank == 0)
+ fprintf(stdout, " No errors\n");
+
+ MPI_Finalize();
+
+ return 0;
+}
diff --git a/test/mpi/ft/testlist b/test/mpi/ft/testlist
index 275b1fc..a7317eb 100644
--- a/test/mpi/ft/testlist
+++ b/test/mpi/ft/testlist
@@ -11,3 +11,5 @@ gather 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=f
reduce 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
bcast 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
scatter 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
+anysource 3 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
+revoke_nofail 4 mpiexecarg=-disable-auto-cleanup resultsTest=TestStatusNoErrors strict=false timelimit=10
http://git.mpich.org/mpich.git/commitdiff/5c71c3a8bf633063445cdc29b19f1c110…
commit 5c71c3a8bf633063445cdc29b19f1c1104527bb9
Author: Wesley Bland <wbland(a)anl.gov>
Date: Fri Mar 28 13:08:26 2014 -0500
Remove coll_active field in MPIDI_Comm
The collectively active field wasn't doing anything anymore so it's been
removed. This was a remnant from a previous FT proposal.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 48769aa..75e0214 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -171,7 +171,6 @@ typedef union {
typedef struct MPIDI_CH3I_comm
{
int eager_max_msg_sz; /* comm-wide eager/rendezvous message threshold */
- int coll_active; /* TRUE iff this communicator is collectively active */
int anysource_enabled; /* TRUE iff this anysource recvs can be posted on this communicator */
int last_ack_rank; /* The rank of the last acknowledged failure */
struct MPID_nem_barrier_vars *barrier_vars; /* shared memory variables used in barrier */
diff --git a/src/mpid/ch3/src/ch3u_comm.c b/src/mpid/ch3/src/ch3u_comm.c
index 4be2c02..89662b5 100644
--- a/src/mpid/ch3/src/ch3u_comm.c
+++ b/src/mpid/ch3/src/ch3u_comm.c
@@ -203,7 +203,6 @@ int comm_created(MPID_Comm *comm, void *param)
MPIDI_FUNC_ENTER(MPID_STATE_COMM_CREATED);
- comm->ch.coll_active = TRUE;
comm->ch.anysource_enabled = TRUE;
/* Use the VC's eager threshold by default. */
@@ -308,7 +307,7 @@ int MPIDI_CH3I_Comm_handle_failed_procs(MPID_Group *new_failed_procs)
COMM_FOREACH(comm) {
/* if this comm is already collectively inactive and
anysources are disabled, there's no need to check */
- if (!comm->ch.coll_active && !comm->ch.anysource_enabled)
+ if (!comm->ch.anysource_enabled)
continue;
mpi_errno = nonempty_intersection(comm, new_failed_procs, &flag);
@@ -316,9 +315,8 @@ int MPIDI_CH3I_Comm_handle_failed_procs(MPID_Group *new_failed_procs)
if (flag) {
MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE,
- (MPIU_DBG_FDEST, "disabling AS and coll on communicator %p (%#08x)",
+ (MPIU_DBG_FDEST, "disabling AS on communicator %p (%#08x)",
comm, comm->handle));
- comm->ch.coll_active = FALSE;
comm->ch.anysource_enabled = FALSE;
}
}
http://git.mpich.org/mpich.git/commitdiff/39b958059fbd50f05d92190ce8eb50743…
commit 39b958059fbd50f05d92190ce8eb507437a4878e
Author: Wesley Bland <wbland(a)anl.gov>
Date: Fri Mar 28 11:16:49 2014 -0500
Fix bug where ANY_SOURCE recv could complete when it shouldn't
There was a case where an MPI_ANY_SOURCE recv call could complete successfully
if there was already a message waiting in the unexpected receive queue when
the call to a receive function was processed, even if any_source operations
had already been disabled on the communicator because of an unacknowledged
failure.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index 8ec9057..67faec6 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -494,7 +494,8 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
int context_id, MPID_Comm *comm, void *user_buf,
int user_count, MPI_Datatype datatype, int * foundp)
{
- int found;
+ int mpi_errno = MPI_SUCCESS;
+ int found = FALSE;
MPID_Request *rreq, *prev_rreq;
MPIDI_Message_match match;
MPIDI_Message_match mask;
@@ -556,8 +557,15 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
else {
if (tag == MPI_ANY_TAG)
match.parts.tag = mask.parts.tag = 0;
- if (source == MPI_ANY_SOURCE)
- match.parts.rank = mask.parts.rank = 0;
+ if (source == MPI_ANY_SOURCE) {
+ if (!MPIDI_CH3I_Comm_AS_enabled(comm)) {
+ MPIU_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail");
+ rreq->status.MPI_ERROR = mpi_errno;
+ MPIDI_CH3U_Request_complete(rreq);
+ goto lock_exit;
+ }
+ match.parts.rank = mask.parts.rank = 0;
+ }
do {
MPIR_T_PVAR_COUNTER_INC(RECVQ, unexpected_recvq_match_attempts, 1);
@@ -594,8 +602,6 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
/* A matching request was not found in the unexpected queue, so we
need to allocate a new request and add it to the posted queue */
{
- int mpi_errno = MPI_SUCCESS;
-
found = FALSE;
MPIDI_Request_create_rreq( rreq, mpi_errno, goto lock_exit );
http://git.mpich.org/mpich.git/commitdiff/8652e0ade03c6b5a8dcc8205a1d978413…
commit 8652e0ade03c6b5a8dcc8205a1d978413471f130
Author: Wesley Bland <wbland(a)anl.gov>
Date: Mon Mar 24 16:44:08 2014 -0500
Add MPIX_Comm_failure_ack/get_acked
This commit adds the new functions MPI(X)_COMM_FAILURE_ACK and
MPI(X)_COMM_FAILURE_GET_ACKED. These two functions together allow the user to
get the group of failed processes.
Most of the implementation for this is pushed into the MPID layer since some
systems won't support this (PAMI). The existing function
MPIDI_CH3U_Check_for_failed_procs has been modified to give back the group of
acknowledged failed processes. There is an inefficiency here in that the list
of failed processes is retrieved from PMI and parsed every time the user calls
both failure_ack and get_acked, but this means we don't have to try to cache
the list that comes back from PMI (which could potentially be expensive, but
would have some cost even in the failure-free case).
This commit adds a failed to the MPID_Comm structure. There is now a field
called last_ack_rank. This is a single integer that stores the last
acknowledged failure for this communicator which is used to determine when to
stop parsing when getting back the list of acknowledged failed processes.
Lastly, this commit includes a test to make sure that all of the above works
(test/mpi/ft/failure_ack). This tests that a failure is appropriately included
in the failed group and excluded if the failure was not previously
acknowledged.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index d1925f2..c2afed9 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -1534,6 +1534,8 @@ int MPI_T_category_changed(int *stamp);
/* Non-standard but public extensions to MPI */
/* Fault Tolerance Extensions */
+int MPIX_Comm_failure_ack(MPI_Comm comm);
+int MPIX_Comm_failure_get_acked(MPI_Comm comm, MPI_Group *failedgrp);
/* End Prototypes */
@@ -2169,6 +2171,8 @@ int PMPI_T_category_changed(int *stamp);
/* Non-standard but public extensions to MPI */
/* Fault Tolerance Extensions */
+int PMPIX_Comm_failure_ack(MPI_Comm comm);
+int PMPIX_Comm_failure_get_acked(MPI_Comm comm, MPI_Group *failedgrp);
#endif /* MPI_BUILD_PROFILING */
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 105d7b3..cc711df 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -2754,6 +2754,31 @@ int MPID_Comm_spawn_multiple(int, char *[], char **[], const int [], MPID_Info*
int, MPID_Comm *, MPID_Comm **, int []);
/*@
+ MPID_Comm_failure_ack - MPID entry point for MPI_Comm_failure_ack
+
+ Input Parameters:
+. comm - communicator
+
+ Return Value:
+ 'MPI_SUCCESS' or a valid MPI error code.
+@*/
+int MPID_Comm_failure_ack(MPID_Comm *comm);
+
+/*@
+ MPID_Comm_failure_get_acked - MPID entry point for MPI_Comm_failure_get_acked
+
+ Input Parameters:
+. comm - communicator
+
+ Output Parameters
+. failed_group_ptr - group of failed processes
+
+ Return Value:
+ 'MPI_SUCCESS' or a valid MPI error code.
+@*/
+int MPID_Comm_failure_get_acked(MPID_Comm *comm, MPID_Group **failed_group_ptr);
+
+/*@
MPID_Send - MPID entry point for MPI_Send
Notes:
diff --git a/src/mpi/comm/Makefile.mk b/src/mpi/comm/Makefile.mk
index a14b695..5dd2743 100644
--- a/src/mpi/comm/Makefile.mk
+++ b/src/mpi/comm/Makefile.mk
@@ -26,7 +26,9 @@ mpi_sources += \
src/mpi/comm/comm_test_inter.c \
src/mpi/comm/intercomm_create.c \
src/mpi/comm/intercomm_merge.c \
- src/mpi/comm/comm_split_type.c
+ src/mpi/comm/comm_split_type.c \
+ src/mpi/comm/comm_failure_ack.c \
+ src/mpi/comm/comm_failure_get_acked.c
mpi_core_sources += \
src/mpi/comm/commutil.c
diff --git a/src/mpi/comm/comm_failure_ack.c b/src/mpi/comm/comm_failure_ack.c
new file mode 100644
index 0000000..7f2dab8
--- /dev/null
+++ b/src/mpi/comm/comm_failure_ack.c
@@ -0,0 +1,114 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mpiimpl.h"
+#include "mpicomm.h"
+
+/* -- Begin Profiling Symbol Block for routine MPIX_Comm_failure_ack */
+#if defined(HAVE_PRAGMA_WEAK)
+#pragma weak MPIX_Comm_failure_ack = PMPIX_Comm_failure_ack
+#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
+#pragma _HP_SECONDARY_DEF PMPIX_Comm_failure_ack MPIX_Comm_failure_ack
+#elif defined(HAVE_PRAGMA_CRI_DUP)
+#pragma _CRI duplicate MPIX_Comm_failure_ack as PMPIX_Comm_failure_ack
+#endif
+/* -- End Profiling Symbol Block */
+
+/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
+ the MPI routines */
+#ifndef MPICH_MPI_FROM_PMPI
+#undef MPIX_Comm_failure_ack
+#define MPIX_Comm_failure_ack PMPIX_Comm_failure_ack
+
+#endif
+
+#undef FUNCNAME
+#define FUNCNAME MPIX_Comm_failure_ack
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+/*@
+
+MPIX_Comm_failure_ack - Acknowledge the current group of failed processes
+
+Input Parameters:
+. comm - Communicator (handle)
+
+Notes:
+.N COMMNULL
+
+.N ThreadSafe
+
+.N Fortran
+
+.N Errors
+.N MPI_SUCCESS
+.N MPI_ERR_COMM
+@*/
+int MPIX_Comm_failure_ack( MPI_Comm comm )
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPID_Comm *comm_ptr = NULL;
+ MPID_MPI_STATE_DECL(MPID_STATE_MPIX_COMM_FAILURE_ACK);
+
+ MPIR_ERRTEST_INITIALIZED_ORDIE();
+
+ MPIU_THREAD_CS_ENTER(ALLFUNC,);
+ MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_FAILURE_ACK);
+
+ /* Validate parameters, especially handles needing to be converted */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ MPIR_ERRTEST_COMM(comm, mpi_errno);
+ }
+ MPID_END_ERROR_CHECKS;
+ }
+# endif /* HAVE_ERROR_CHECKING */
+
+ /* Convert MPI object handles to object pointers */
+ MPID_Comm_get_ptr(comm, comm_ptr);
+
+ /* Validate parameters and objects(post conversion */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ /* Validate comm_ptr */
+ MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ /* If comm_ptr is not valid, it will be reset to null */
+ if (mpi_errno) goto fn_fail;
+ }
+ MPID_END_ERROR_CHECKS;
+ }
+# endif /* HAVE_ERROR_CHECKING */
+
+ /* ... body of routine ... */
+
+ mpi_errno = MPID_Comm_failure_ack(comm_ptr);
+ if (mpi_errno) goto fn_fail;
+
+ /* ... end of body of routine ... */
+
+fn_exit:
+ MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_FAILURE_ACK);
+ MPIU_THREAD_CS_EXIT(ALLFUNC,);
+ return mpi_errno;
+
+fn_fail:
+ /* --BEGIN ERROR HANDLING-- */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ mpi_errno = MPIR_Err_create_code(
+ mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpix_comm_failure_ack",
+ "**mpix_comm_failure_ack %C", comm);
+ }
+# endif
+ mpi_errno = MPIR_Err_return_comm( comm_ptr, FCNAME, mpi_errno );
+ goto fn_exit;
+ /* --END ERROR HANDLING-- */
+}
diff --git a/src/mpi/comm/comm_failure_get_acked.c b/src/mpi/comm/comm_failure_get_acked.c
new file mode 100644
index 0000000..83d9eda
--- /dev/null
+++ b/src/mpi/comm/comm_failure_get_acked.c
@@ -0,0 +1,118 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mpiimpl.h"
+#include "mpicomm.h"
+
+/* -- Begin Profiling Symbol Block for routine MPIX_Comm_get_acked */
+#if defined(HAVE_PRAGMA_WEAK)
+#pragma weak MPIX_Comm_failure_get_acked = PMPIX_Comm_failure_get_acked
+#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
+#pragma _HP_SECONDARY_DEF PMPIX_Comm_failure_get_acked MPIX_Comm_failure_get_acked
+#elif defined(HAVE_PRAGMA_CRI_DUP)
+#pragma _CRI duplicate MPIX_Comm_failure_get_acked as PMPIX_Comm_failure_get_acked
+#endif
+/* -- End Profiling Symbol Block */
+
+/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
+ the MPI routines */
+#ifndef MPICH_MPI_FROM_PMPI
+#undef MPIX_Comm_failure_get_acked
+#define MPIX_Comm_failure_get_acked PMPIX_Comm_failure_get_acked
+
+#endif
+
+#undef FUNCNAME
+#define FUNCNAME MPIX_Comm_failure_get_acked
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+/*@
+
+MPIX_Comm_failure_get_acked - Get the group of acknowledged failures.
+
+Input Parameters:
+. comm - Communicator (handle)
+
+Output Parameters:
+. failed_group - Group (handle)
+
+Notes:
+.N COMMNULL
+
+.N ThreadSafe
+
+.N Fortran
+
+.N Errors
+.N MPI_SUCCESS
+.N MPI_ERR_COMM
+@*/
+int MPIX_Comm_failure_get_acked( MPI_Comm comm, MPI_Group *failedgrp )
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPID_Comm *comm_ptr = NULL;
+ MPID_Group *group_ptr;
+ MPID_MPI_STATE_DECL(MPID_STATE_MPIX_COMM_FAILURE_GET_ACKED);
+
+ MPIR_ERRTEST_INITIALIZED_ORDIE();
+
+ MPIU_THREAD_CS_ENTER(ALLFUNC,);
+ MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_FAILURE_GET_ACKED);
+
+ /* Validate parameters, especially handles needing to be converted */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ MPIR_ERRTEST_COMM(comm, mpi_errno);
+ }
+ MPID_END_ERROR_CHECKS;
+ }
+# endif /* HAVE_ERROR_CHECKING */
+
+ /* Convert MPI object handles to object pointers */
+ MPID_Comm_get_ptr(comm, comm_ptr);
+
+ /* Validate parameters and objects(post conversion */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ /* Validate comm_ptr */
+ MPID_Comm_valid_ptr(comm_ptr, mpi_errno);
+ /* If comm_ptr is not valid, it will be reset to null */
+ if (mpi_errno) goto fn_fail;
+ }
+ MPID_END_ERROR_CHECKS;
+ }
+# endif /* HAVE_ERROR_CHECKING */
+
+ /* ... body of routine ... */
+
+ mpi_errno = MPID_Comm_failure_get_acked(comm_ptr, &group_ptr);
+ if (mpi_errno) goto fn_fail;
+ *failedgrp = group_ptr->handle;
+ /* ... end of body of routine ... */
+
+fn_exit:
+ MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_FAILURE_GET_ACKED);
+ MPIU_THREAD_CS_EXIT(ALLFUNC,);
+ return mpi_errno;
+
+fn_fail:
+ /* --BEGIN ERROR HANDLING-- */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ mpi_errno = MPIR_Err_create_code(
+ mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpix_comm_failure_get_acked",
+ "**mpix_comm_failure_get_acked %C %p", comm, failedgrp);
+ }
+# endif
+ mpi_errno = MPIR_Err_return_comm( comm_ptr, FCNAME, mpi_errno );
+ goto fn_exit;
+ /* --END ERROR HANDLING-- */
+}
diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt
index 82cf107..36eaa2c 100644
--- a/src/mpi/errhan/errnames.txt
+++ b/src/mpi/errhan/errnames.txt
@@ -1096,6 +1096,10 @@ is too big (> MPIU_SHMW_GHND_SZ)
**mpi_comm_remote_size %C %p:MPI_Comm_remote_size(%C, size=%p) failed
**mpi_comm_remote_group:MPI_Comm_remote_group failed
**mpi_comm_remote_group %C %p:MPI_Comm_remote_group(%C, group=%p) failed
+**mpix_comm_failure_ack:MPIX_Comm_failure_ack failed
+**mpix_comm_failure_ack %C:MPIX_Comm_failure_ack(%C) failed
+**mpix_comm_failure_get_acked:MPIX_Comm_failure_get_acked failed
+**mpix_comm_failure_get_acked %C %p:MPIX_Comm_failure_get_acked(%C, group=%p) failed
**mpi_intercomm_create:MPI_Intercomm_create failed
**mpi_intercomm_create %C %d %C %d %d %p:MPI_Intercomm_create(%C, local_leader=%d, %C, remote_leader=%d, tag=%d, newintercomm=%p) failed
**mpi_intercomm_merge:MPI_Intercomm_merge failed
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 8c3a68e..48769aa 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -173,6 +173,7 @@ typedef struct MPIDI_CH3I_comm
int eager_max_msg_sz; /* comm-wide eager/rendezvous message threshold */
int coll_active; /* TRUE iff this communicator is collectively active */
int anysource_enabled; /* TRUE iff this anysource recvs can be posted on this communicator */
+ int last_ack_rank; /* The rank of the last acknowledged failure */
struct MPID_nem_barrier_vars *barrier_vars; /* shared memory variables used in barrier */
struct MPID_Comm *next; /* next pointer for list of communicators */
struct MPID_Comm *prev; /* prev pointer for list of communicators */
diff --git a/src/mpid/ch3/src/Makefile.mk b/src/mpid/ch3/src/Makefile.mk
index a69106a..5160b5b 100644
--- a/src/mpid/ch3/src/Makefile.mk
+++ b/src/mpid/ch3/src/Makefile.mk
@@ -29,6 +29,7 @@ mpi_core_sources += \
src/mpid/ch3/src/mpid_cancel_send.c \
src/mpid/ch3/src/mpid_comm_disconnect.c \
src/mpid/ch3/src/mpid_comm_spawn_multiple.c \
+ src/mpid/ch3/src/mpid_comm_failure_ack.c \
src/mpid/ch3/src/mpid_finalize.c \
src/mpid/ch3/src/mpid_get_universe_size.c \
src/mpid/ch3/src/mpid_getpname.c \
diff --git a/src/mpid/ch3/src/ch3u_comm.c b/src/mpid/ch3/src/ch3u_comm.c
index 0fc766b..4be2c02 100644
--- a/src/mpid/ch3/src/ch3u_comm.c
+++ b/src/mpid/ch3/src/ch3u_comm.c
@@ -209,6 +209,9 @@ int comm_created(MPID_Comm *comm, void *param)
/* Use the VC's eager threshold by default. */
comm->ch.eager_max_msg_sz = -1;
+ /* Initialize the last acked failure to -1 */
+ comm->ch.last_ack_rank = -1;
+
COMM_ADD(comm);
fn_exit:
diff --git a/src/mpid/ch3/src/mpid_comm_failure_ack.c b/src/mpid/ch3/src/mpid_comm_failure_ack.c
new file mode 100644
index 0000000..be64340
--- /dev/null
+++ b/src/mpid/ch3/src/mpid_comm_failure_ack.c
@@ -0,0 +1,71 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mpidimpl.h"
+
+#undef FUNCNAME
+#define FUNCNAME MPID_Comm_failure_ack
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_Comm_failure_ack(MPID_Comm *comm_ptr)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_COMM_FAILURE_ACK);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_COMM_FAILURE_ACK);
+
+ /* Update the list of failed processes that we know about locally.
+ * This part could technically be turned off and be a correct
+ * implementation, but it would be slower about propagating failure
+ * information. Also, this is the failure case so speed isn't as
+ * important. */
+ MPIDI_CH3U_Check_for_failed_procs();
+
+ /* Update the marker for the last known failed process in this
+ * communciator. */
+ comm_ptr->ch.last_ack_rank = MPIDI_last_known_failed;
+
+fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_COMM_FAILURE_ACK);
+ return mpi_errno;
+fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_Comm_failure_get_acked
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_Comm_failure_get_acked(MPID_Comm *comm_ptr, MPID_Group **group_ptr)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPID_Group *failed_group, *comm_group;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_COMM_FAILURE_GET_ACKED);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_COMM_FAILURE_GET_ACKED);
+
+ /* Get the group of all failed processes */
+ MPIDI_CH3U_Check_for_failed_procs();
+ MPIDI_CH3U_Get_failed_group(comm_ptr->ch.last_ack_rank, &failed_group);
+ if (failed_group == MPID_Group_empty) {
+ *group_ptr = MPID_Group_empty;
+ goto fn_exit;
+ }
+
+ MPIR_Comm_group_impl(comm_ptr, &comm_group);
+
+ /* Get the intersection of all falied processes in this communicator */
+ MPIR_Group_intersection_impl(failed_group, comm_group, group_ptr);
+
+ MPIR_Group_release(comm_group);
+ MPIR_Group_release(failed_group);
+
+fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_COMM_FAILURE_GET_ACKED);
+ return mpi_errno;
+fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/pamid/src/misc/mpid_unimpl.c b/src/mpid/pamid/src/misc/mpid_unimpl.c
index ff52890..8b92417 100644
--- a/src/mpid/pamid/src/misc/mpid_unimpl.c
+++ b/src/mpid/pamid/src/misc/mpid_unimpl.c
@@ -71,3 +71,15 @@ int MPID_Comm_spawn_multiple(int count,
return 0;
}
#endif
+
+int MPID_Comm_failure_ack(MPID_Comm *comm_ptr)
+{
+ MPID_abort();
+ return 0;
+}
+
+int MPID_Comm_failure_get_acked(MPID_Comm *comm_ptr, MPID_Group **failed_group_ptr)
+{
+ MPID_abort();
+ return 0;
+}
diff --git a/test/mpi/ft/Makefile.am b/test/mpi/ft/Makefile.am
index b01f80a..98b8123 100644
--- a/test/mpi/ft/Makefile.am
+++ b/test/mpi/ft/Makefile.am
@@ -10,4 +10,4 @@ include $(top_srcdir)/Makefile.mtest
## for all programs that are just built from the single corresponding source
## file, we don't need per-target _SOURCES rules, automake will infer them
## correctly
-noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter
+noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter failure_ack
diff --git a/test/mpi/ft/failure_ack.c b/test/mpi/ft/failure_ack.c
new file mode 100644
index 0000000..e5acc41
--- /dev/null
+++ b/test/mpi/ft/failure_ack.c
@@ -0,0 +1,117 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include <mpi.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+ * This test makes sure that after a failure, the correct group of failed
+ * processes is returned from MPIX_Comm_failure_ack/get_acked.
+ */
+int main(int argc, char **argv)
+{
+ int rank, size, err, result, i;
+ char buf[10] = " No errors";
+ char error[MPI_MAX_ERROR_STRING];
+ MPI_Group failed_grp, one_grp, world_grp;
+ int one[] = {1};
+ int world_ranks[] = {0,1,2};
+ int failed_ranks[3];
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ if (size < 3) {
+ fprintf( stderr, "Must run with at least 3 processes\n" );
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+ if (rank == 1) {
+ exit(EXIT_FAILURE);
+ }
+
+ if (rank == 0) {
+ err = MPI_Recv(buf, 10, MPI_CHAR, 1, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+ if (MPI_SUCCESS == err) {
+ fprintf(stderr, "Expected a failure for receive from rank 1\n");
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ err = MPIX_Comm_failure_ack(MPI_COMM_WORLD);
+ if (MPI_SUCCESS != err) {
+ int ec;
+ MPI_Error_class(err, &ec);
+ MPI_Error_string(err, error, &size);
+ fprintf(stderr, "MPIX_Comm_failure_ack returned an error: %d\n%s", ec, error);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+ err = MPIX_Comm_failure_get_acked(MPI_COMM_WORLD, &failed_grp);
+ if (MPI_SUCCESS != err) {
+ int ec;
+ MPI_Error_class(err, &ec);
+ MPI_Error_string(err, error, &size);
+ fprintf(stderr, "MPIX_Comm_failure_get_acked returned an error: %d\n%s", ec, error);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ MPI_Comm_group(MPI_COMM_WORLD, &world_grp);
+ MPI_Group_incl(world_grp, 1, one, &one_grp);
+ MPI_Group_compare(one_grp, failed_grp, &result);
+ if (MPI_IDENT != result) {
+ fprintf(stderr, "First failed group contains incorrect processes\n");
+ MPI_Group_size(failed_grp, &size);
+ MPI_Group_translate_ranks(failed_grp, size, world_ranks, world_grp, failed_ranks);
+ for (i = 0; i < size; i++)
+ fprintf(stderr, "DEAD: %d\n", failed_ranks[i]);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+ MPI_Group_free(&failed_grp);
+
+ err = MPI_Recv(buf, 10, MPI_CHAR, 2, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+ if (MPI_SUCCESS != err) {
+ fprintf(stderr, "First receive failed\n");
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+ err = MPI_Recv(buf, 10, MPI_CHAR, 2, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+ if (MPI_SUCCESS == err) {
+ fprintf(stderr, "Expected a failure for receive from rank 2\n");
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ err = MPIX_Comm_failure_get_acked(MPI_COMM_WORLD, &failed_grp);
+ if (MPI_SUCCESS != err) {
+ int ec;
+ MPI_Error_class(err, &ec);
+ MPI_Error_string(err, error, &size);
+ fprintf(stderr, "MPIX_Comm_failure_get_acked returned an error: %d\n%s", ec, error);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ MPI_Group_compare(one_grp, failed_grp, &result);
+ if (MPI_IDENT != result) {
+ fprintf(stderr, "Second failed group contains incorrect processes\n");
+ MPI_Group_size(failed_grp, &size);
+ MPI_Group_translate_ranks(failed_grp, size, world_ranks, world_grp, failed_ranks);
+ for (i = 0; i < size; i++)
+ fprintf(stderr, "DEAD: %d\n", failed_ranks[i]);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ fprintf(stdout, " No errors\n");
+ } else if (rank == 2) {
+ MPI_Ssend(buf, 10, MPI_CHAR, 0, 0, MPI_COMM_WORLD);
+
+ exit(EXIT_FAILURE);
+ }
+
+ MPI_Group_free(&failed_grp);
+ MPI_Group_free(&one_grp);
+ MPI_Group_free(&world_grp);
+ MPI_Finalize();
+}
http://git.mpich.org/mpich.git/commitdiff/665ced285ab9e2f655852c901b9a819f6…
commit 665ced285ab9e2f655852c901b9a819f6390474e
Author: Wesley Bland <wbland(a)anl.gov>
Date: Mon Mar 24 10:54:37 2014 -0500
Add MPIDI_CH3U_Get_failed_group
This function will take a last_failed value and generate an MPID_Group. If the
value is MPI_PROC_NULL, then it will parse the entire list. This function is
exposed by MPID so this can be used by any functions that need the list of
failed processes.
This change necessitated changing the way the list of failed processes is
retreived from PMI. Rather than allocating a char array on demand every time
we get the list from PMI, this string is allocated at init time and freed at
finalize time now. This means that we can cache the value to be used later for
things like just querying the list of processes that we already know have
failed, rather than also getting the new list (which is important for the
failure_ack/get_acked semantics).
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index 099e76d..fe8e7ed 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -48,6 +48,8 @@ int gethostname(char *name, size_t len);
/* group of processes detected to have failed. This is a subset of
comm_world group. */
extern MPID_Group *MPIDI_Failed_procs_group;
+extern int MPIDI_last_known_failed;
+extern char *MPIDI_failed_procs_string;
extern int MPIDI_Use_pmi2_api;
@@ -1657,6 +1659,10 @@ int MPIDI_CH3_Channel_close( void );
#else
#define MPIDI_CH3_Channel_close( ) MPI_SUCCESS
#endif
+
+/* MPIDI_CH3U_Get_failed_group() generates a group of failed processes based
+ * on the last list generated during MPIDI_CH3U_Check_for_failed_procs */
+int MPIDI_CH3U_Get_failed_group(int last_rank, MPID_Group **failed_group);
/* MPIDI_CH3U_Check_for_failed_procs() reads PMI_dead_processes key
and marks VCs to those processes as failed */
int MPIDI_CH3U_Check_for_failed_procs(void);
diff --git a/src/mpid/ch3/src/ch3u_handle_connection.c b/src/mpid/ch3/src/ch3u_handle_connection.c
index 00bdb8e..352fc07 100644
--- a/src/mpid/ch3/src/ch3u_handle_connection.c
+++ b/src/mpid/ch3/src/ch3u_handle_connection.c
@@ -19,6 +19,8 @@ static volatile int MPIDI_Outstanding_close_ops = 0;
int MPIDI_Failed_vc_count = 0;
MPID_Group *MPIDI_Failed_procs_group = NULL;
+int MPIDI_last_known_failed = MPI_PROC_NULL;
+char *MPIDI_failed_procs_string = NULL;
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3U_Handle_connection
@@ -430,6 +432,81 @@ static int terminate_failed_VCs(MPID_Group *new_failed_group)
++c; \
} while (0)
+/* There are three possible input values for `last_rank:
+ *
+ * < -1 = All failures regardless of acknowledgement
+ * -1 (MPI_PROC_NULL) = No failures have been acknowledged yet (return MPID_Group_empty)
+ * >= 0 = The last failure acknowledged. All failures returned will have
+ * been acknowledged previously.
+ */
+#undef FUNCNAME
+#define FUNCNAME MPIDI_CH3U_Get_failed_group
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPIDI_CH3U_Get_failed_group(int last_rank, MPID_Group **failed_group)
+{
+ char *c;
+ int i, mpi_errno = MPI_SUCCESS, rank;
+ UT_array *failed_procs = NULL;
+ MPID_Group *world_group;
+ MPIDI_STATE_DECL(MPID_STATE_GET_FAILED_GROUP);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_GET_FAILED_GROUP);
+
+ MPIU_DBG_MSG_D(CH3_OTHER, VERBOSE, "Getting failed group with %d as last acknowledged\n", last_rank);
+
+ if (-1 == last_rank) {
+ MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "No failure acknowledged");
+ *failed_group = MPID_Group_empty;
+ goto fn_exit;
+ }
+
+ if (*MPIDI_failed_procs_string == '\0') {
+ MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "Found no failed ranks");
+ *failed_group = MPID_Group_empty;
+ goto fn_exit;
+ }
+
+ utarray_new(failed_procs, &ut_int_icd);
+
+ /* parse list of failed processes. This is a comma separated list
+ of ranks or ranges of ranks (e.g., "1, 3-5, 11") */
+ i = 0;
+ c = MPIDI_failed_procs_string;
+ while(1) {
+ parse_rank(&rank);
+ ++i;
+ MPIU_DBG_MSG_D(CH3_OTHER, VERBOSE, "Found failed rank: %d", rank);
+ utarray_push_back(failed_procs, &rank);
+ MPIDI_last_known_failed = rank;
+ MPIU_ERR_CHKINTERNAL(*c != ',' && *c != '\0', mpi_errno, "error parsing failed process list");
+ if (*c == '\0' || last_rank == rank)
+ break;
+ ++c; /* skip ',' */
+ }
+
+ /* Create group of failed processes for comm_world. Failed groups for other
+ communicators can be created from this one using group_intersection. */
+ mpi_errno = MPIR_Comm_group_impl(MPIR_Process.comm_world, &world_group);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ mpi_errno = MPIR_Group_incl_impl(world_group, i, ut_int_array(failed_procs), failed_group);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ mpi_errno = MPIR_Group_release(world_group);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_GET_FAILED_GROUP);
+ if (failed_procs)
+ utarray_free(failed_procs);
+ return mpi_errno;
+fn_oom:
+ MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "utarray");
+fn_fail:
+ goto fn_exit;
+}
+
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3U_Check_for_failed_procs
#undef FCNAME
@@ -438,15 +515,9 @@ int MPIDI_CH3U_Check_for_failed_procs(void)
{
int mpi_errno = MPI_SUCCESS;
int pmi_errno;
- char *val;
- char *c;
int len;
char *kvsname;
- int rank, rank_hi;
- int i;
- UT_array *failed_procs = NULL;
- MPID_Group *world_group, *prev_failed_group, *new_failed_group;
- MPIU_CHKLMEM_DECL(1);
+ MPID_Group *prev_failed_group, *new_failed_group;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3U_CHECK_FOR_FAILED_PROCS);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_CHECK_FOR_FAILED_PROCS);
@@ -460,87 +531,52 @@ int MPIDI_CH3U_Check_for_failed_procs(void)
#ifdef USE_PMI2_API
{
int vallen = 0;
- MPIU_CHKLMEM_MALLOC(val, char *, PMI2_MAX_VALLEN, mpi_errno, "val");
- pmi_errno = PMI2_KVS_Get(kvsname, PMI2_ID_NULL, "PMI_dead_processes", val, PMI2_MAX_VALLEN, &vallen);
+ pmi_errno = PMI2_KVS_Get(kvsname, PMI2_ID_NULL, "PMI_dead_processes", MPIDI_failed_procs_string, PMI2_MAX_VALLEN, &vallen);
MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get");
}
#else
pmi_errno = PMI_KVS_Get_value_length_max(&len);
MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get_value_length_max");
- MPIU_CHKLMEM_MALLOC(val, char *, len, mpi_errno, "val");
- pmi_errno = PMI_KVS_Get(kvsname, "PMI_dead_processes", val, len);
+ pmi_errno = PMI_KVS_Get(kvsname, "PMI_dead_processes", MPIDI_failed_procs_string, len);
MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get");
#endif
-
- MPIU_DBG_MSG_S(CH3_DISCONNECT, TYPICAL, "Received proc fail notification: %s", val);
-
- if (*val == '\0') {
+
+ if (*MPIDI_failed_procs_string == '\0') {
/* there are no failed processes */
MPIDI_Failed_procs_group = MPID_Group_empty;
goto fn_exit;
}
- utarray_new(failed_procs, &ut_int_icd);
-
- /* parse list of failed processes. This is a comma separated list
- of ranks or ranges of ranks (e.g., "1, 3-5, 11") */
- i = 0;
- c = val;
- while(1) {
- parse_rank(&rank);
- if (*c == '-') {
- ++c; /* skip '-' */
- parse_rank(&rank_hi);
- } else
- rank_hi = rank;
- while (rank <= rank_hi) {
- utarray_push_back(failed_procs, &rank);
- ++i;
- ++rank;
- }
- MPIU_ERR_CHKINTERNAL(*c != ',' && *c != '\0', mpi_errno, "error parsing failed process list");
- if (*c == '\0')
- break;
- ++c; /* skip ',' */
- }
+ MPIU_DBG_MSG_S(CH3_OTHER, TYPICAL, "Received proc fail notification: %s", MPIDI_failed_procs_string);
/* save reference to previous group so we can identify new failures */
prev_failed_group = MPIDI_Failed_procs_group;
- /* Create group of failed processes for comm_world. Failed groups for other
- communicators can be created from this one using group_intersection. */
- mpi_errno = MPIR_Comm_group_impl(MPIR_Process.comm_world, &world_group);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- mpi_errno = MPIR_Group_incl_impl(world_group, i, ut_int_array(failed_procs), &MPIDI_Failed_procs_group);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- mpi_errno = MPIR_Group_free_impl(world_group);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ /* Parse the list of failed processes */
+ MPIDI_CH3U_Get_failed_group(-2, &MPIDI_Failed_procs_group);
/* get group of newly failed processes */
mpi_errno = MPIR_Group_difference_impl(MPIDI_Failed_procs_group, prev_failed_group, &new_failed_group);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- mpi_errno = MPIDI_CH3I_Comm_handle_failed_procs(new_failed_group);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ if (new_failed_group != MPID_Group_empty) {
+ mpi_errno = MPIDI_CH3I_Comm_handle_failed_procs(new_failed_group);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- mpi_errno = terminate_failed_VCs(new_failed_group);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- mpi_errno = MPIR_Group_free_impl(new_failed_group);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ mpi_errno = terminate_failed_VCs(new_failed_group);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ mpi_errno = MPIR_Group_release(new_failed_group);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ }
/* free prev group */
if (prev_failed_group != MPID_Group_empty) {
- mpi_errno = MPIR_Group_free_impl(prev_failed_group);
+ mpi_errno = MPIR_Group_release(prev_failed_group);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
fn_exit:
- MPIU_CHKLMEM_FREEALL();
- if (failed_procs)
- utarray_free(failed_procs);
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3U_CHECK_FOR_FAILED_PROCS);
return mpi_errno;
diff --git a/src/mpid/ch3/src/mpid_finalize.c b/src/mpid/ch3/src/mpid_finalize.c
index 4ff6a17..5048ee7 100644
--- a/src/mpid/ch3/src/mpid_finalize.c
+++ b/src/mpid/ch3/src/mpid_finalize.c
@@ -145,6 +145,8 @@ int MPID_Finalize(void)
}
}
+ MPIU_Free(MPIDI_failed_procs_string);
+
MPIDU_Ftb_finalize();
fn_exit:
diff --git a/src/mpid/ch3/src/mpid_init.c b/src/mpid/ch3/src/mpid_init.c
index 43206bb..16c425e 100644
--- a/src/mpid/ch3/src/mpid_init.c
+++ b/src/mpid/ch3/src/mpid_init.c
@@ -99,6 +99,7 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
MPID_Comm * comm;
int p;
MPIDI_STATE_DECL(MPID_STATE_MPID_INIT);
+ int val;
MPIDI_FUNC_ENTER(MPID_STATE_MPID_INIT);
@@ -117,13 +118,22 @@ int MPID_Init(int *argc, char ***argv, int requested, int *provided,
MPIDI_Use_pmi2_api = TRUE;
#else
{
- int ret, val;
+ int ret;
ret = MPL_env2bool("MPICH_USE_PMI2_API", &val);
if (ret == 1 && val)
MPIDI_Use_pmi2_api = TRUE;
}
#endif
-
+
+ /* Create the string that will cache the last group of failed processes
+ * we received from PMI */
+#ifdef USE_PMI2_API
+ MPIDI_failed_procs_string = MPIU_Malloc(sizeof(char) * PMI2_MAX_VALLEN);
+#else
+ PMI_KVS_Get_value_length_max(&val);
+ MPIDI_failed_procs_string = MPIU_Malloc(sizeof(char) * (val+1));
+#endif
+
/*
* Set global process attributes. These can be overridden by the channel
* if necessary.
http://git.mpich.org/mpich.git/commitdiff/782d036c4f898f786bb3a4f90b02f5d99…
commit 782d036c4f898f786bb3a4f90b02f5d99971d9c6
Author: Wesley Bland <wbland(a)anl.gov>
Date: Thu Mar 20 12:51:44 2014 -0500
Don't compress and order list of failed procs in PMI
Previously, PMI provided a list of failed processes as a sorted list via a
string. This meant the list could look something like this:
1,3-5,7,10
However, in the new fault tolerance specification, the function
MPI_COMM_FAILURE_ACK needs to be able to determine the local order of the
failures to more efficiently acknowledge them without creating a list per
communciator. This requires that PMI not sort or compress the failure
notification. So now, the previous string could look like this:
3,1,4,5,10,7
Obviously, this is less efficient if there are lots of failures. Hopefully,
this is something that can be fixed in future versions of PMI.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_cb.c b/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
index 364294a..28007fa 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
@@ -339,100 +339,38 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
/* FIXME: If the list of dead processes does not fit
* inside a single value length, set it as a
* multi-line value. */
- struct proc_list {
- char *segment;
- int start;
- int end;
- struct proc_list *next;
- } *list = NULL, *e, *tmp;
- char *segment, *start, *end, *current_list, *str, *run;
- int included = 0;
+ /* FIXME: This was changed from a sorted list where sequential
+ * numbers could be compacted to an expanded list where they
+ * couldn't. Obviously, this isn't sustainable on the PMI
+ * side, but on the MPI side, it's necessary (see the
+ * definition of MPI_COMM_FAILURE_ACK). In a future version of
+ * PMI where we can pass around things other than strings,
+ * this should improve. */
+ char *segment, *current_list, *str;
+ int included = 0, value;
/* Create a sorted list of processes */
current_list = HYDU_strdup(pg_scratch->dead_processes);
+ /* Search to see if this process is already in the list */
+ included = 0;
segment = strtok(current_list, ",");
do {
- HYDU_MALLOC(e, struct proc_list *, sizeof(struct proc_list), status);
- e->segment = HYDU_strdup(segment);
- e->next = NULL;
-
- if (list == NULL)
- list = e;
- else {
- for (tmp = list; tmp->next; tmp = tmp->next);
- tmp->next = e;
- }
-
- segment = strtok(NULL, ",");
- } while (segment);
-
- for (e = list; e; e = e->next) {
- start = strtok(e->segment, "-");
- end = strtok(NULL, "-");
-
- e->start = atoi(start);
- if (end)
- e->end = atoi(end);
- else
- e->end = atoi(start);
-
- if (hdr.pid == e->start - 1) {
- e->start = hdr.pid;
- included = 1;
- }
- else if (hdr.pid == e->end + 1) {
- e->end = hdr.pid;
+ value = strtol(segment, NULL, 10);
+ if (value == hdr.pid) {
included = 1;
+ break;
}
- }
+ segment = strtok(NULL, ",");
+ } while (segment != NULL);
+ /* Add this process to the end of the list */
if (!included) {
- HYDU_MALLOC(e, struct proc_list *, sizeof(struct proc_list), status);
- e->start = hdr.pid;
- e->end = hdr.pid;
- e->next = NULL;
-
- if (hdr.pid < list->start) {
- e->next = list;
- list = e;
- }
- else {
- for (tmp = list; tmp->next && tmp->next->start < hdr.pid; tmp = tmp->next);
- e->next = tmp->next;
- tmp->next = e;
- }
- }
+ HYDU_MALLOC(str, char *, PMI_MAXVALLEN, status);
- for (e = list; e->next;) {
- if (e->end == e->next->start) {
- e->end = e->next->end;
- tmp = e->next;
- e->next = e->next->next;
- HYDU_FREE(tmp);
- }
- else
- e = e->next;
- }
-
- str = NULL;
- for (e = list; e; e = e->next) {
- HYDU_MALLOC(run, char *, PMI_MAXVALLEN, status);
- if (str) {
- if (e->start == e->end)
- HYDU_snprintf(run, PMI_MAXVALLEN, "%s,%d", str, e->start);
- else
- HYDU_snprintf(run, PMI_MAXVALLEN, "%s,%d-%d", str, e->start, e->end);
- }
- else {
- if (e->start == e->end)
- HYDU_snprintf(run, PMI_MAXVALLEN, "%d", e->start);
- else
- HYDU_snprintf(run, PMI_MAXVALLEN, "%d-%d", e->start, e->end);
- }
- if (str)
- HYDU_FREE(str);
- str = run;
+ HYDU_snprintf(str, PMI_MAXVALLEN, "%s,%d", pg_scratch->dead_processes, hdr.pid);
+ } else {
+ str = current_list;
}
pg_scratch->dead_processes = str;
}
http://git.mpich.org/mpich.git/commitdiff/3325b6f7b416647a7c66878a71cac1970…
commit 3325b6f7b416647a7c66878a71cac19708096c8a
Author: Wesley Bland <wbland(a)anl.gov>
Date: Wed Mar 19 15:52:55 2014 -0500
Return MPIX_ERR_PROC_FAILED_PENDING when appropriate
The MPI_Waitall and MPI_Testall functions should return
MPIX_ERR_PROC_FAILED_PENDING when a process failure prevents the operations
from completing.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/mpi/pt2pt/testall.c b/src/mpi/pt2pt/testall.c
index 8bd65fe..fd6a41e 100644
--- a/src/mpi/pt2pt/testall.c
+++ b/src/mpi/pt2pt/testall.c
@@ -87,6 +87,7 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
int n_completed;
int active_flag;
int rc;
+ int proc_failure = 0;
int mpi_errno = MPI_SUCCESS;
MPIU_CHKLMEM_DECL(1);
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TESTALL);
@@ -168,10 +169,13 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
if (request_ptrs[i] != NULL && MPID_Request_is_complete(request_ptrs[i]))
{
n_completed++;
- if (MPIR_Request_get_error(request_ptrs[i]) != MPI_SUCCESS)
- {
- mpi_errno = MPI_ERR_IN_STATUS;
- }
+ rc = MPIR_Request_get_error(request_ptrs[i]);
+ if (rc != MPI_SUCCESS)
+ {
+ if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(rc))
+ proc_failure = 1;
+ mpi_errno = MPI_ERR_IN_STATUS;
+ }
}
}
@@ -203,7 +207,10 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
{
if (mpi_errno == MPI_ERR_IN_STATUS && array_of_statuses != MPI_STATUSES_IGNORE)
{
- array_of_statuses[i].MPI_ERROR = MPI_ERR_PENDING;
+ if (!proc_failure)
+ array_of_statuses[i].MPI_ERROR = MPI_ERR_PENDING;
+ else
+ array_of_statuses[i].MPI_ERROR = MPIX_ERR_PROC_FAILED_PENDING;
}
}
}
diff --git a/src/mpi/pt2pt/waitall.c b/src/mpi/pt2pt/waitall.c
index ccdd329..b3a87fc 100644
--- a/src/mpi/pt2pt/waitall.c
+++ b/src/mpi/pt2pt/waitall.c
@@ -47,6 +47,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
int active_flag;
int rc;
int n_greqs;
+ int proc_failure = 0;
const int ignoring_statuses = (array_of_statuses == MPI_STATUSES_IGNORE);
int optimize = ignoring_statuses; /* see NOTE-O1 */
MPIU_CHKLMEM_DECL(1);
@@ -180,6 +181,12 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
{
/* req completed with an error */
mpi_errno = MPI_ERR_IN_STATUS;
+
+ if (!proc_failure) {
+ if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(rc))
+ proc_failure = 1;
+ }
+
if (!ignoring_statuses)
{
/* set the error code for this request */
@@ -197,7 +204,10 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
}
else
{
- array_of_statuses[j].MPI_ERROR = MPI_ERR_PENDING;
+ if (!proc_failure)
+ array_of_statuses[j].MPI_ERROR = MPI_ERR_PENDING;
+ else
+ array_of_statuses[j].MPI_ERROR = MPIX_ERR_PROC_FAILED_PENDING;
}
}
}
http://git.mpich.org/mpich.git/commitdiff/ed98c9834b6b827eaea970616590e8095…
commit ed98c9834b6b827eaea970616590e8095d0ef418
Author: Wesley Bland <wbland(a)anl.gov>
Date: Wed Mar 19 15:39:06 2014 -0500
Add MPIX_ERR_PROC_FAILED_PENDING
This is a new error code required by the ULFM proposal. This code replaces
MPI_ERR_PENDING in cases where the failure that would have otherwise cause
MPI_ERR_PENDING is related to process failure (MPIX_ERR_PROC_FAILED). In that
case, we return MPIX_ERR_PROC_FAILED_PENDING instead.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index c018671..d1925f2 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -797,9 +797,9 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
#define MPI_ERR_UNKNOWN 13 /* Unknown error */
#define MPI_ERR_INTERN 16 /* Internal error code */
-/* Multiple completion has two special error classes */
-#define MPI_ERR_IN_STATUS 17 /* Look in status for error value */
-#define MPI_ERR_PENDING 18 /* Pending request */
+/* Multiple completion has three special error classes */
+#define MPI_ERR_IN_STATUS 17 /* Look in status for error value */
+#define MPI_ERR_PENDING 18 /* Pending request */
/* New MPI-2 Error classes */
#define MPI_ERR_ACCESS 20 /* */
@@ -866,6 +866,7 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
#define MPI_T_ERR_PVAR_NO_WRITE 71 /* Pvar can't be written or reset */
#define MPI_T_ERR_PVAR_NO_ATOMIC 72 /* Pvar can't be R/W atomically */
+
#define MPI_ERR_LASTCODE 0x3fffffff /* Last valid error code for a
predefined error class */
/* WARNING: this is also defined in mpishared.h. Update both locations */
@@ -877,9 +878,11 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
* range. All MPIX error codes will be
* above this value to be ABI complaint. */
-#define MPIX_ERR_PROC_FAILED MPICH_ERR_FIRST_MPIX+1 /* Process failure */
+#define MPIX_ERR_PROC_FAILED MPICH_ERR_FIRST_MPIX+1 /* Process failure */
+#define MPIX_ERR_PROC_FAILED_PENDING MPICH_ERR_FIRST_MPIX+2 /* A failure has caused this request
+ * to be pending */
-#define MPICH_ERR_LAST_MPIX MPICH_ERR_FIRST_MPIX+1
+#define MPICH_ERR_LAST_MPIX MPICH_ERR_FIRST_MPIX+2
/* End of MPI's error classes */
diff --git a/src/mpi/errhan/baseerrnames.txt b/src/mpi/errhan/baseerrnames.txt
index 5c7dc93..8f07168 100644
--- a/src/mpi/errhan/baseerrnames.txt
+++ b/src/mpi/errhan/baseerrnames.txt
@@ -36,6 +36,7 @@ MPI_ERR_INTERN 16 **intern
# Multiple completion has two special error classes
MPI_ERR_IN_STATUS 17 **instatus
MPI_ERR_PENDING 18 **inpending
+MPIX_ERR_PROC_FAILED_PENDING 19 **failure_pending
# New MPI-2 Error classes
MPI_ERR_FILE 27 **file
MPI_ERR_ACCESS 20 **fileaccess
diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt
index 2800002..82cf107 100644
--- a/src/mpi/errhan/errnames.txt
+++ b/src/mpi/errhan/errnames.txt
@@ -422,6 +422,7 @@ unexpected messages queued.
**badcase %d:INTERNAL ERROR: unexpected value in case statement (value=%d)
**node_root_rank:Unable to get the node root rank
**proc_failed:Process failed
+**failure_pending:Request pending due to failure
# Duplicates?
#**argnull:Invalid null parameter
#**argnull %s:Invalid null parameter %s
http://git.mpich.org/mpich.git/commitdiff/6ce715477e725d550af675fbd10cc3b2f…
commit 6ce715477e725d550af675fbd10cc3b2ff0c615c
Author: Wesley Bland <wbland(a)anl.gov>
Date: Mon Jul 28 17:04:38 2014 -0500
Rename error code to MPIX_ERR_PROC_FAILED
Previously, MPICH was using MPIX_ERR_FAIL_STOP as the generic error code for
process failures. The ULFM document specifies the error code to be
MPIX_ERR_PROC_FAILED.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index 393c7d8..c018671 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -877,7 +877,7 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
* range. All MPIX error codes will be
* above this value to be ABI complaint. */
-#define MPIX_ERR_PROC_FAIL_STOP MPICH_ERR_FIRST_MPIX+1 /* Process failure */
+#define MPIX_ERR_PROC_FAILED MPICH_ERR_FIRST_MPIX+1 /* Process failure */
#define MPICH_ERR_LAST_MPIX MPICH_ERR_FIRST_MPIX+1
diff --git a/src/mpi/errhan/baseerrnames.txt b/src/mpi/errhan/baseerrnames.txt
index c66c7fe..5c7dc93 100644
--- a/src/mpi/errhan/baseerrnames.txt
+++ b/src/mpi/errhan/baseerrnames.txt
@@ -73,7 +73,7 @@ MPI_ERR_RMA_SYNC 50 **rmasync
MPI_ERR_SIZE 51 **rmasize
MPI_ERR_DISP 52 **rmadisp
MPI_ERR_ASSERT 53 **assert
-MPIX_ERR_PROC_FAIL_STOP 54 **proc_fail_stop
+MPIX_ERR_PROC_FAILED 54 **proc_failed
MPI_ERR_RMA_RANGE 55 **rmarange
MPI_ERR_RMA_ATTACH 56 **rmaattach
MPI_ERR_RMA_SHARED 57 **rmashared
diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt
index 0cbe441..2800002 100644
--- a/src/mpi/errhan/errnames.txt
+++ b/src/mpi/errhan/errnames.txt
@@ -421,7 +421,7 @@ unexpected messages queued.
**badcase:INTERNAL ERROR: unexpected value in case statement
**badcase %d:INTERNAL ERROR: unexpected value in case statement (value=%d)
**node_root_rank:Unable to get the node root rank
-**proc_fail_stop:A process has failed
+**proc_failed:Process failed
# Duplicates?
#**argnull:Invalid null parameter
#**argnull %s:Invalid null parameter %s
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
index a77e9e3..9496048 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
@@ -359,7 +359,7 @@ int vc_terminate(MPIDI_VC_t *vc)
/* VC is terminated as a result of a fault. Complete
outstanding sends with an error and terminate
connection immediately. */
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_ptl_sendq_complete_with_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_nem_ptl_vc_terminated(vc);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
index 7e8ce8f..3aad34a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
@@ -1648,7 +1648,7 @@ fn_exit:
fn_fail: /* comm related failures jump here */
{
- MPIU_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", sc_vc->pg_rank);
+ MPIU_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", sc_vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(sc_vc, mpi_errno);
if (mpi_errno) {
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
@@ -1829,11 +1829,11 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "error polling fd, closing sc");
if (it_sc->vc) {
- MPIU_ERR_SET2(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d %s", it_sc->vc->pg_rank, err_str);
+ MPIU_ERR_SET2(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d %s", it_sc->vc->pg_rank, err_str);
mpi_errno = MPID_nem_tcp_cleanup_on_error(it_sc->vc, req_errno);
MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
} else {
- MPIU_ERR_SET2(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail_conn", "**comm_fail_conn %s %s", CONN_STATE_STR[it_sc->state.cstate], err_str);
+ MPIU_ERR_SET2(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail_conn", "**comm_fail_conn %s %s", CONN_STATE_STR[it_sc->state.cstate], err_str);
mpi_errno = close_cleanup_and_free_sc_plfd(it_sc);
MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
index 26ca89c..14ba19a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_init.c
@@ -671,7 +671,7 @@ int MPID_nem_tcp_vc_terminate(MPIDI_VC_t *vc)
/* VC is terminated as a result of a fault. Complete
outstanding sends with an error and terminate
connection immediately. */
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_error_out_send_queue(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_nem_tcp_vc_terminated(vc);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
index d250ef6..80c503d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_send.c
@@ -97,7 +97,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
int req_errno = MPI_SUCCESS;
MPIU_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
goto fn_exit; /* this vc is closed now, just bail out */
@@ -112,7 +112,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
} else {
int req_errno = MPI_SUCCESS;
MPIU_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
goto fn_exit; /* this vc is closed now, just bail out */
@@ -262,7 +262,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
int req_errno = MPI_SUCCESS;
MPIU_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
goto fn_fail;
@@ -274,7 +274,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
else {
int req_errno = MPI_SUCCESS;
MPIU_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
goto fn_fail;
@@ -401,7 +401,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
int req_errno = MPI_SUCCESS;
MPIU_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
goto fn_fail;
@@ -413,7 +413,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
else {
int req_errno = MPI_SUCCESS;
MPIU_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
@@ -536,7 +536,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
int req_errno = MPI_SUCCESS;
MPIU_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
goto fn_fail;
@@ -548,7 +548,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
else {
int req_errno = MPI_SUCCESS;
MPIU_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
goto fn_fail;
@@ -695,7 +695,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
int req_errno = MPI_SUCCESS;
MPIU_ERR_SET(req_errno, MPI_ERR_OTHER, "**sock_closed");
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
goto fn_fail;
@@ -707,7 +707,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
else {
int req_errno = MPI_SUCCESS;
MPIU_ERR_SET1(req_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror(errno));
- MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_tcp_cleanup_on_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
goto fn_fail;
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
index da5141a..234fc4d 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
@@ -26,7 +26,7 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
if (vc->state == MPIDI_VC_STATE_MORIBUND) {
sreq->status.MPI_ERROR = MPI_SUCCESS;
- MPIU_ERR_SET1(sreq->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(sreq->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
MPIDI_CH3U_Request_complete(sreq);
goto fn_fail;
}
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
index bcceb2d..d5fe393 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isendv.c
@@ -30,7 +30,7 @@ int MPIDI_CH3_iSendv (MPIDI_VC_t *vc, MPID_Request *sreq, MPID_IOV *iov, int n_i
if (vc->state == MPIDI_VC_STATE_MORIBUND) {
sreq->status.MPI_ERROR = MPI_SUCCESS;
- MPIU_ERR_SET1(sreq->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(sreq->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
MPIDI_CH3U_Request_complete(sreq);
goto fn_fail;
}
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
index 4e97a0a..db1df84 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
@@ -33,7 +33,7 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_ISTARTMSG);
- MPIU_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
if (vc->ch.iStartContigMsg)
{
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
index 2d26c18..02d7cb3 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c
@@ -41,7 +41,7 @@ int MPIDI_CH3_iStartMsgv (MPIDI_VC_t *vc, MPID_IOV *iov, int n_iov, MPID_Request
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_ISTARTMSGV);
- MPIU_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_CHKANDJUMP1(vc->state == MPIDI_VC_STATE_MORIBUND, mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
if (vc->ch.iStartContigMsg)
{
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index 2b58bfe..7232361 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -1023,7 +1023,7 @@ int MPIDI_CH3I_Complete_sendq_with_error(MPIDI_VC_t * vc)
MPIDI_CH3I_shm_sendq.tail = prev;
req->status.MPI_ERROR = MPI_SUCCESS;
- MPIU_ERR_SET1(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(req->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
MPID_Request_release(req); /* ref count was incremented when added to queue */
MPIDI_CH3U_Request_complete(req);
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index f4f9000..8ec9057 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -627,13 +627,13 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
MPIDI_VC_t *vc;
MPIDI_Comm_get_vc(comm, source, &vc);
if (vc->state == MPIDI_VC_STATE_MORIBUND) {
- MPIU_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
+ MPIU_ERR_SET1(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", vc->pg_rank);
rreq->status.MPI_ERROR = mpi_errno;
MPIDI_CH3U_Request_complete(rreq);
goto lock_exit;
}
} else if (!MPIDI_CH3I_Comm_AS_enabled(comm)) {
- MPIU_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+ MPIU_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED, "**comm_fail");
rreq->status.MPI_ERROR = mpi_errno;
MPIDI_CH3U_Request_complete(rreq);
goto lock_exit;
@@ -860,9 +860,9 @@ static inline void dequeue_and_set_error(MPID_Request **req, MPID_Request *prev
if (*error == MPI_SUCCESS) {
if (rank == MPI_PROC_NULL)
- MPIU_ERR_SET(*error, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+ MPIU_ERR_SET(*error, MPIX_ERR_PROC_FAILED, "**comm_fail");
else
- MPIU_ERR_SET1(*error, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", rank);
+ MPIU_ERR_SET1(*error, MPIX_ERR_PROC_FAILED, "**comm_fail", "**comm_fail %d", rank);
}
/* remove from queue */
diff --git a/test/mpi/ft/barrier.c b/test/mpi/ft/barrier.c
index 2072698..6e33f11 100644
--- a/test/mpi/ft/barrier.c
+++ b/test/mpi/ft/barrier.c
@@ -37,11 +37,11 @@ int main(int argc, char **argv)
if (rank == 0) {
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(err, &errclass);
- if (errclass == MPIX_ERR_PROC_FAIL_STOP) {
+ if (errclass == MPIX_ERR_PROC_FAILED) {
printf(" No Errors\n");
fflush(stdout);
} else {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
}
#else
if (err) {
diff --git a/test/mpi/ft/bcast.c b/test/mpi/ft/bcast.c
index 0bdae30..06cfeff 100644
--- a/test/mpi/ft/bcast.c
+++ b/test/mpi/ft/bcast.c
@@ -45,8 +45,8 @@ int main(int argc, char **argv)
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(rc, &errclass);
- if ((rc) && (errclass != MPIX_ERR_PROC_FAIL_STOP)) {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ if ((rc) && (errclass != MPIX_ERR_PROC_FAILED)) {
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
errs++;
}
#endif
@@ -60,8 +60,8 @@ int main(int argc, char **argv)
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(rc, &errclass);
- if ((rc) && (errclass != MPIX_ERR_PROC_FAIL_STOP)) {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ if ((rc) && (errclass != MPIX_ERR_PROC_FAILED)) {
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
errs++;
}
#endif
diff --git a/test/mpi/ft/gather.c b/test/mpi/ft/gather.c
index 6ac2a6e..997d58b 100644
--- a/test/mpi/ft/gather.c
+++ b/test/mpi/ft/gather.c
@@ -40,11 +40,11 @@ int main(int argc, char **argv)
if (rank == 0) {
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(err, &errclass);
- if (errclass == MPIX_ERR_PROC_FAIL_STOP) {
+ if (errclass == MPIX_ERR_PROC_FAILED) {
printf(" No Errors\n");
fflush(stdout);
} else {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
}
#else
if (err) {
diff --git a/test/mpi/ft/irecvdead.c b/test/mpi/ft/irecvdead.c
index bf20dc1..f97c6f5 100644
--- a/test/mpi/ft/irecvdead.c
+++ b/test/mpi/ft/irecvdead.c
@@ -11,7 +11,7 @@
/*
* This test attempts MPI_Irecv with the source being a dead process. It should fail
* and return an error at completion. If we are testing sufficiently new MPICH, we
- * look for the MPIX_ERR_PROC_FAIL_STOP error code. These should be converted to look
+ * look for the MPIX_ERR_PROC_FAILED error code. These should be converted to look
* for the standarized error code once it is finalized.
*/
int main(int argc, char **argv)
@@ -41,11 +41,11 @@ int main(int argc, char **argv)
err = MPI_Wait(&request, MPI_STATUS_IGNORE);
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(err, &errclass);
- if (errclass == MPIX_ERR_PROC_FAIL_STOP) {
+ if (errclass == MPIX_ERR_PROC_FAILED) {
printf(" No Errors\n");
fflush(stdout);
} else {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
}
#else
if (err) {
diff --git a/test/mpi/ft/isenddead.c b/test/mpi/ft/isenddead.c
index 3440b57..a915c3e 100644
--- a/test/mpi/ft/isenddead.c
+++ b/test/mpi/ft/isenddead.c
@@ -40,8 +40,8 @@ int main(int argc, char **argv)
err = MPI_Wait(&request, MPI_STATUS_IGNORE);
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(err, &errclass);
- if ((err) && (errclass != MPIX_ERR_PROC_FAIL_STOP)) {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ if ((err) && (errclass != MPIX_ERR_PROC_FAILED)) {
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
} else {
printf(" No Errors\n");
fflush(stdout);
diff --git a/test/mpi/ft/recvdead.c b/test/mpi/ft/recvdead.c
index 5b194ca..931afdf 100644
--- a/test/mpi/ft/recvdead.c
+++ b/test/mpi/ft/recvdead.c
@@ -11,7 +11,7 @@
/*
* This test attempts MPI_Recv with the source being a dead process. It should fail
* and return an error. If we are testing sufficiently new MPICH, we look for the
- * MPIX_ERR_PROC_FAIL_STOP error code. These should be converted to look for the
+ * MPIX_ERR_PROC_FAILED error code. These should be converted to look for the
* standarized error code once it is finalized.
*/
int main(int argc, char **argv)
@@ -36,11 +36,11 @@ int main(int argc, char **argv)
err = MPI_Recv(buf, 1, MPI_CHAR, 1, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(err, &errclass);
- if (errclass == MPIX_ERR_PROC_FAIL_STOP) {
+ if (errclass == MPIX_ERR_PROC_FAILED) {
printf(" No Errors\n");
fflush(stdout);
} else {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
}
#else
if (err) {
diff --git a/test/mpi/ft/reduce.c b/test/mpi/ft/reduce.c
index 30664b5..993fe07 100644
--- a/test/mpi/ft/reduce.c
+++ b/test/mpi/ft/reduce.c
@@ -38,11 +38,11 @@ int main(int argc, char **argv)
if (rank == 0) {
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(err, &errclass);
- if (errclass == MPIX_ERR_PROC_FAIL_STOP) {
+ if (errclass == MPIX_ERR_PROC_FAILED) {
printf(" No Errors\n");
fflush(stdout);
} else {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
}
#else
if (err) {
diff --git a/test/mpi/ft/scatter.c b/test/mpi/ft/scatter.c
index 93f7b86..d47dfc7 100644
--- a/test/mpi/ft/scatter.c
+++ b/test/mpi/ft/scatter.c
@@ -49,8 +49,8 @@ int main(int argc, char **argv)
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(rc, &errclass);
- if ((rc) && (errclass != MPIX_ERR_PROC_FAIL_STOP)) {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ if ((rc) && (errclass != MPIX_ERR_PROC_FAILED)) {
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
errs++;
}
#endif
@@ -70,8 +70,8 @@ int main(int argc, char **argv)
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(rc, &errclass);
- if ((rc) && (errclass != MPIX_ERR_PROC_FAIL_STOP)) {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ if ((rc) && (errclass != MPIX_ERR_PROC_FAILED)) {
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
errs++;
}
#endif
diff --git a/test/mpi/ft/senddead.c b/test/mpi/ft/senddead.c
index 6df36f1..9524789 100644
--- a/test/mpi/ft/senddead.c
+++ b/test/mpi/ft/senddead.c
@@ -35,8 +35,8 @@ int main(int argc, char **argv)
err = MPI_Send(buf, 100000, MPI_CHAR, 1, 0, MPI_COMM_WORLD);
#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
MPI_Error_class(err, &errclass);
- if ((err) && (errclass != MPIX_ERR_PROC_FAIL_STOP)) {
- fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+ if ((err) && (errclass != MPIX_ERR_PROC_FAILED)) {
+ fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAILED\n", errclass);
} else {
printf(" No Errors\n");
fflush(stdout);
http://git.mpich.org/mpich.git/commitdiff/c83eddd9138b21558a618457910583cf7…
commit c83eddd9138b21558a618457910583cf7c1ba321
Author: Wesley Bland <wbland(a)anl.gov>
Date: Mon Jul 28 11:27:19 2014 -0500
Destroy request object before setting it to NULL.
When an isendv fails in MPIDI_CH3_EagerSyncNoncontigSend, the request is set
to NULL before returning it back to the caller. Unfortunately, the request is
not allocated inside this function so if we pass back NULL, we lose the handle
on the request. If we're going to return NULL, we need to make sure the
request is destroyed before giving it back.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/src/ch3u_eagersync.c b/src/mpid/ch3/src/ch3u_eagersync.c
index a85dc22..f88501c 100644
--- a/src/mpid/ch3/src/ch3u_eagersync.c
+++ b/src/mpid/ch3/src/ch3u_eagersync.c
@@ -79,7 +79,10 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **sreq_p,
/* --BEGIN ERROR HANDLING-- */
if (mpi_errno != MPI_SUCCESS)
{
- MPID_Request_release(sreq);
+ /* Make sure to destroy the request before setting the pointer to
+ * NULL, otherwise we lose the handle on the request */
+ MPIU_Object_set_ref(sreq, 0);
+ MPIDI_CH3_Request_destroy(sreq);
*sreq_p = NULL;
MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|eagermsg");
}
http://git.mpich.org/mpich.git/commitdiff/b68657dcaff19cd0a164f75f31eace6ef…
commit b68657dcaff19cd0a164f75f31eace6ef64d324b
Author: Wesley Bland <wbland(a)anl.gov>
Date: Wed Jul 30 09:54:11 2014 -0500
Introduce MPICH_ERR_LAST_MPIX
There were a few places in MPICH where the error class was being checked
against MPICH_ERR_LAST_CLASS and being flagged as invalid if it was too large.
This is incorrect now that we have a new space for MPIX error codes. Add
MPICH_ERR_LAST_MPIX as a way of keeping track of what the actual last valid
error class is.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index c12e38c..393c7d8 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -877,7 +877,10 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
* range. All MPIX error codes will be
* above this value to be ABI complaint. */
-#define MPIX_ERR_PROC_FAIL_STOP MPICH_ERR_FIRST_MPIX+1 /* Process failure */
+#define MPIX_ERR_PROC_FAIL_STOP MPICH_ERR_FIRST_MPIX+1 /* Process failure */
+
+#define MPICH_ERR_LAST_MPIX MPICH_ERR_FIRST_MPIX+1
+
/* End of MPI's error classes */
diff --git a/src/mpi/errhan/errutil.c b/src/mpi/errhan/errutil.c
index 84555e3..633697d 100644
--- a/src/mpi/errhan/errutil.c
+++ b/src/mpi/errhan/errutil.c
@@ -473,7 +473,7 @@ static int checkValidErrcode( int error_class, const char fcname[],
int errcode = *errcode_p;
int rc = 0;
- if (error_class > MPICH_ERR_LAST_CLASS)
+ if (error_class > MPICH_ERR_LAST_MPIX)
{
/* --BEGIN ERROR HANDLING-- */
if (errcode & ~ERROR_CLASS_MASK)
@@ -525,7 +525,7 @@ int MPIR_Err_combine_codes(int error1, int error2)
error2_class = MPIR_ERR_GET_CLASS(error2_code);
if (MPIR_ERR_GET_CLASS(error2_class) < MPI_SUCCESS ||
- MPIR_ERR_GET_CLASS(error2_class) > MPICH_ERR_LAST_CLASS)
+ MPIR_ERR_GET_CLASS(error2_class) > MPICH_ERR_LAST_MPIX)
{
error2_class = MPI_ERR_OTHER;
}
@@ -908,7 +908,7 @@ int MPIR_Err_create_code_valist( int lastcode, int fatal, const char fcname[],
if (error_class == MPI_ERR_OTHER)
{
if (MPIR_ERR_GET_CLASS(lastcode) > MPI_SUCCESS &&
- MPIR_ERR_GET_CLASS(lastcode) <= MPICH_ERR_LAST_CLASS)
+ MPIR_ERR_GET_CLASS(lastcode) <= MPICH_ERR_LAST_MPIX)
{
/* If the last class is more specific (and is valid), then pass it
through */
@@ -1274,7 +1274,7 @@ static void MPIR_Err_print_stack_string(int errcode, char *str, int maxlen )
error_class = ERROR_GET_CLASS(errcode);
- if (error_class <= MPICH_ERR_LAST_CLASS)
+ if (error_class <= MPICH_ERR_LAST_MPIX)
{
MPIU_Snprintf(str, maxlen, "(unknown)(): %s\n",
get_class_msg(ERROR_GET_CLASS(errcode)));
-----------------------------------------------------------------------
Summary of changes:
src/include/mpi.h.in | 27 +++-
src/include/mpiimpl.h | 98 ++++++++++-
src/mpi/attr/attr_delete.c | 2 +-
src/mpi/attr/attr_get.c | 2 +-
src/mpi/attr/attr_put.c | 2 +-
src/mpi/attr/comm_delete_attr.c | 2 +-
src/mpi/attr/comm_get_attr.c | 2 +-
src/mpi/attr/comm_set_attr.c | 4 +-
src/mpi/coll/allgather.c | 2 +-
src/mpi/coll/allgatherv.c | 2 +-
src/mpi/coll/allred_group.c | 39 ++--
src/mpi/coll/allreduce.c | 2 +-
src/mpi/coll/alltoall.c | 2 +-
src/mpi/coll/alltoallv.c | 2 +-
src/mpi/coll/alltoallw.c | 2 +-
src/mpi/coll/barrier.c | 2 +-
src/mpi/coll/bcast.c | 2 +-
src/mpi/coll/exscan.c | 2 +-
src/mpi/coll/gather.c | 2 +-
src/mpi/coll/gatherv.c | 2 +-
src/mpi/coll/helper_fns.c | 8 +-
src/mpi/coll/iallgather.c | 2 +-
src/mpi/coll/iallgatherv.c | 2 +-
src/mpi/coll/iallreduce.c | 2 +-
src/mpi/coll/ialltoall.c | 2 +-
src/mpi/coll/ialltoallv.c | 2 +-
src/mpi/coll/ialltoallw.c | 2 +-
src/mpi/coll/ibarrier.c | 2 +-
src/mpi/coll/ibcast.c | 2 +-
src/mpi/coll/iexscan.c | 2 +-
src/mpi/coll/igather.c | 2 +-
src/mpi/coll/igatherv.c | 2 +-
src/mpi/coll/ired_scat.c | 2 +-
src/mpi/coll/ired_scat_block.c | 2 +-
src/mpi/coll/ireduce.c | 2 +-
src/mpi/coll/iscan.c | 2 +-
src/mpi/coll/iscatter.c | 2 +-
src/mpi/coll/iscatterv.c | 2 +-
src/mpi/coll/red_scat.c | 2 +-
src/mpi/coll/red_scat_block.c | 2 +-
src/mpi/coll/reduce.c | 2 +-
src/mpi/coll/scan.c | 2 +-
src/mpi/coll/scatter.c | 2 +-
src/mpi/coll/scatterv.c | 2 +-
src/mpi/comm/Makefile.mk | 7 +-
src/mpi/comm/comm_agree.c | 188 ++++++++++++++++++++
src/mpi/comm/comm_compare.c | 4 +-
src/mpi/comm/comm_create.c | 2 +-
src/mpi/comm/comm_create_group.c | 2 +-
src/mpi/comm/comm_dup.c | 2 +-
src/mpi/comm/comm_dup_with_info.c | 5 +-
src/mpi/comm/comm_failure_ack.c | 114 ++++++++++++
src/mpi/comm/comm_failure_get_acked.c | 118 ++++++++++++
src/mpi/comm/comm_free.c | 2 +-
src/mpi/comm/comm_get_info.c | 5 +-
src/mpi/comm/comm_get_name.c | 2 +-
src/mpi/comm/comm_group.c | 4 +-
src/mpi/comm/comm_idup.c | 2 +-
src/mpi/comm/comm_rank.c | 4 +-
src/mpi/comm/comm_remote_group.c | 2 +-
src/mpi/comm/comm_remote_size.c | 2 +-
src/mpi/comm/comm_revoke.c | 112 ++++++++++++
src/mpi/comm/comm_set_info.c | 5 +-
src/mpi/comm/comm_set_name.c | 2 +-
src/mpi/comm/comm_shrink.c | 180 +++++++++++++++++++
src/mpi/comm/comm_size.c | 2 +-
src/mpi/comm/comm_split.c | 2 +-
src/mpi/comm/comm_split_type.c | 2 +-
src/mpi/comm/comm_test_inter.c | 2 +-
src/mpi/comm/commutil.c | 3 +
src/mpi/comm/intercomm_create.c | 4 +-
src/mpi/comm/intercomm_merge.c | 2 +-
src/mpi/datatype/pack.c | 2 +-
src/mpi/datatype/pack_size.c | 2 +-
src/mpi/datatype/unpack.c | 2 +-
src/mpi/errhan/baseerrnames.txt | 4 +-
src/mpi/errhan/comm_call_errhandler.c | 2 +-
src/mpi/errhan/comm_get_errhandler.c | 2 +-
src/mpi/errhan/comm_set_errhandler.c | 2 +-
src/mpi/errhan/errhandler_get.c | 2 +-
src/mpi/errhan/errhandler_set.c | 2 +-
src/mpi/errhan/errnames.txt | 14 ++-
src/mpi/errhan/errutil.c | 8 +-
src/mpi/init/abort.c | 2 +-
src/mpi/pt2pt/bsend.c | 2 +-
src/mpi/pt2pt/bsend_init.c | 2 +-
src/mpi/pt2pt/ibsend.c | 2 +-
src/mpi/pt2pt/improbe.c | 2 +-
src/mpi/pt2pt/iprobe.c | 2 +-
src/mpi/pt2pt/irecv.c | 2 +-
src/mpi/pt2pt/irsend.c | 2 +-
src/mpi/pt2pt/isend.c | 2 +-
src/mpi/pt2pt/issend.c | 2 +-
src/mpi/pt2pt/mprobe.c | 2 +-
src/mpi/pt2pt/probe.c | 2 +-
src/mpi/pt2pt/recv.c | 2 +-
src/mpi/pt2pt/recv_init.c | 2 +-
src/mpi/pt2pt/rsend.c | 2 +-
src/mpi/pt2pt/rsend_init.c | 2 +-
src/mpi/pt2pt/send.c | 2 +-
src/mpi/pt2pt/send_init.c | 2 +-
src/mpi/pt2pt/sendrecv.c | 2 +-
src/mpi/pt2pt/sendrecv_rep.c | 2 +-
src/mpi/pt2pt/ssend.c | 2 +-
src/mpi/pt2pt/ssend_init.c | 2 +-
src/mpi/pt2pt/testall.c | 17 ++-
src/mpi/pt2pt/waitall.c | 12 ++-
src/mpi/rma/win_allocate.c | 2 +-
src/mpi/rma/win_allocate_shared.c | 2 +-
src/mpi/rma/win_create.c | 2 +-
src/mpi/rma/win_create_dynamic.c | 2 +-
src/mpi/spawn/comm_accept.c | 2 +-
src/mpi/spawn/comm_connect.c | 2 +-
src/mpi/spawn/comm_disconnect.c | 2 +-
src/mpi/spawn/comm_spawn.c | 2 +-
src/mpi/spawn/comm_spawn_multiple.c | 2 +-
src/mpi/topo/cart_coords.c | 2 +-
src/mpi/topo/cart_create.c | 2 +-
src/mpi/topo/cart_get.c | 2 +-
src/mpi/topo/cart_map.c | 2 +-
src/mpi/topo/cart_rank.c | 2 +-
src/mpi/topo/cart_shift.c | 2 +-
src/mpi/topo/cart_sub.c | 2 +-
src/mpi/topo/cartdim_get.c | 2 +-
src/mpi/topo/dist_gr_create.c | 2 +-
src/mpi/topo/dist_gr_create_adj.c | 2 +-
src/mpi/topo/dist_gr_neighb_count.c | 2 +-
src/mpi/topo/graph_get.c | 2 +-
src/mpi/topo/graph_map.c | 2 +-
src/mpi/topo/graph_nbr.c | 2 +-
src/mpi/topo/graphcreate.c | 2 +-
src/mpi/topo/graphdimsget.c | 2 +-
src/mpi/topo/graphnbrcnt.c | 2 +-
src/mpi/topo/inhb_allgather.c | 2 +-
src/mpi/topo/inhb_allgatherv.c | 2 +-
src/mpi/topo/inhb_alltoall.c | 2 +-
src/mpi/topo/inhb_alltoallv.c | 2 +-
src/mpi/topo/inhb_alltoallw.c | 2 +-
src/mpi/topo/nhb_allgather.c | 2 +-
src/mpi/topo/nhb_allgatherv.c | 2 +-
src/mpi/topo/nhb_alltoall.c | 2 +-
src/mpi/topo/nhb_alltoallv.c | 2 +-
src/mpi/topo/nhb_alltoallw.c | 2 +-
src/mpi/topo/topo_test.c | 2 +-
.../channels/nemesis/netmod/portals4/ptl_init.c | 2 +-
src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c | 6 +-
.../ch3/channels/nemesis/netmod/tcp/tcp_init.c | 2 +-
.../ch3/channels/nemesis/netmod/tcp/tcp_send.c | 20 +-
src/mpid/ch3/channels/nemesis/src/ch3_isend.c | 2 +-
src/mpid/ch3/channels/nemesis/src/ch3_isendv.c | 3 +-
src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c | 2 +-
src/mpid/ch3/channels/nemesis/src/ch3_istartmsgv.c | 2 +-
src/mpid/ch3/channels/nemesis/src/ch3_progress.c | 2 +-
src/mpid/ch3/include/mpidimpl.h | 11 +-
src/mpid/ch3/include/mpidpkt.h | 9 +
src/mpid/ch3/include/mpidpre.h | 5 +-
src/mpid/ch3/src/Makefile.mk | 5 +
src/mpid/ch3/src/ch3u_comm.c | 24 ++-
src/mpid/ch3/src/ch3u_eagersync.c | 5 +-
src/mpid/ch3/src/ch3u_handle_connection.c | 154 ++++++++++------
src/mpid/ch3/src/ch3u_handle_recv_pkt.c | 4 +
src/mpid/ch3/src/ch3u_handle_revoke_pkt.c | 38 ++++
src/mpid/ch3/src/ch3u_recvq.c | 143 +++++++++++++--
src/mpid/ch3/src/mpid_comm_agree.c | 119 ++++++++++++
src/mpid/ch3/src/mpid_comm_disconnect.c | 7 +-
src/mpid/ch3/src/mpid_comm_failure_ack.c | 145 +++++++++++++++
src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c | 156 ++++++++++++++++
src/mpid/ch3/src/mpid_comm_revoke.c | 108 +++++++++++
src/mpid/ch3/src/mpid_comm_spawn_multiple.c | 7 +
src/mpid/ch3/src/mpid_finalize.c | 2 +
src/mpid/ch3/src/mpid_improbe.c | 5 +
src/mpid/ch3/src/mpid_init.c | 14 ++-
src/mpid/ch3/src/mpid_iprobe.c | 7 +
src/mpid/ch3/src/mpid_irecv.c | 10 +
src/mpid/ch3/src/mpid_irsend.c | 8 +
src/mpid/ch3/src/mpid_isend.c | 9 +
src/mpid/ch3/src/mpid_issend.c | 8 +
src/mpid/ch3/src/mpid_mprobe.c | 5 +
src/mpid/ch3/src/mpid_probe.c | 7 +
src/mpid/ch3/src/mpid_recv.c | 7 +
src/mpid/ch3/src/mpid_rma.c | 5 +
src/mpid/ch3/src/mpid_rsend.c | 8 +
src/mpid/ch3/src/mpid_send.c | 7 +
src/mpid/ch3/src/mpid_ssend.c | 8 +
src/mpid/pamid/src/misc/mpid_unimpl.c | 18 ++
src/pm/hydra/pm/pmiserv/pmiserv_cb.c | 104 +++---------
src/util/procmap/local_proc.c | 4 +-
test/mpi/ft/Makefile.am | 2 +-
test/mpi/ft/agree.c | 68 +++++++
test/mpi/ft/anysource.c | 78 ++++++++
test/mpi/ft/barrier.c | 4 +-
test/mpi/ft/bcast.c | 8 +-
test/mpi/ft/failure_ack.c | 117 ++++++++++++
test/mpi/ft/gather.c | 4 +-
test/mpi/ft/irecvdead.c | 6 +-
test/mpi/ft/isenddead.c | 4 +-
test/mpi/ft/recvdead.c | 6 +-
test/mpi/ft/reduce.c | 4 +-
test/mpi/ft/revoke_nofail.c | 66 +++++++
test/mpi/ft/scatter.c | 8 +-
test/mpi/ft/senddead.c | 4 +-
test/mpi/ft/shrink.c | 62 +++++++
test/mpi/ft/testlist | 4 +
test/mpid/ch3/failed_bitmask.c | 59 ++++++
204 files changed, 2546 insertions(+), 399 deletions(-)
create mode 100644 src/mpi/comm/comm_agree.c
create mode 100644 src/mpi/comm/comm_failure_ack.c
create mode 100644 src/mpi/comm/comm_failure_get_acked.c
create mode 100644 src/mpi/comm/comm_revoke.c
create mode 100644 src/mpi/comm/comm_shrink.c
create mode 100644 src/mpid/ch3/src/ch3u_handle_revoke_pkt.c
create mode 100644 src/mpid/ch3/src/mpid_comm_agree.c
create mode 100644 src/mpid/ch3/src/mpid_comm_failure_ack.c
create mode 100644 src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
create mode 100644 src/mpid/ch3/src/mpid_comm_revoke.c
create mode 100644 test/mpi/ft/agree.c
create mode 100644 test/mpi/ft/anysource.c
create mode 100644 test/mpi/ft/failure_ack.c
create mode 100644 test/mpi/ft/revoke_nofail.c
create mode 100644 test/mpi/ft/shrink.c
create mode 100644 test/mpid/ch3/failed_bitmask.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.2-33-gedd6daa
by noreply@mpich.org 31 Jul '14
by noreply@mpich.org 31 Jul '14
31 Jul '14
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 edd6daa5c47dfa19acf5836f2781d1c564116e37 (commit)
from ed4140325102d2654e902ba70a08eb8ceb8daf16 (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/edd6daa5c47dfa19acf5836f2781d1c56…
commit edd6daa5c47dfa19acf5836f2781d1c564116e37
Author: Masamichi Takagi <masamichi.takagi(a)riken.jp>
Date: Thu Jul 31 21:54:45 2014 +0900
Increase number of connection command buffer
Increase the number of connection command buffer to 64 to avoid
dead-lock in command buffer allocation. This is a temporary
work-around.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
index 1ab2502..56c917e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
@@ -241,7 +241,7 @@ typedef struct MPID_nem_ib_cm_notify_send_req {
#define MPID_NEM_IB_CM_RELEASED ((uint64_t)(-1))
#define MPID_NEM_IB_CM_OFF_SYN (256) /* Align for 256-byte-write PCI command */
#define MPID_NEM_IB_CM_OFF_CMD (256*2) /* Align for 256-byte-write PCI command */
-#define MPID_NEM_IB_CM_NSEG 16 /* number of slots to which responder writes its response */
+#define MPID_NEM_IB_CM_NSEG 64 /* number of slots to which responder writes its response */
typedef GENERIC_Q_DECL(MPID_nem_ib_cm_req_t) MPID_nem_ib_cm_sendq_t;
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.2-32-ged41403
by noreply@mpich.org 31 Jul '14
by noreply@mpich.org 31 Jul '14
31 Jul '14
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 ed4140325102d2654e902ba70a08eb8ceb8daf16 (commit)
via 19c00389e4915c68fef68d3e61b50bbded1ad46b (commit)
via 76e70960dfa6962fcf04bdf187647061c4e499ee (commit)
via 51f6709f5422b015910b26bebe651ed835a77f9b (commit)
via 56a0b44574d7e609bed94047ecfb435b0a9e55b3 (commit)
via a499ad05e4208b4a76843b79eb726f80862ec97c (commit)
via fded59aee40a99eda9e5a96955751b5149c0d1bc (commit)
via 3690597fbbf8cf8289530eaa5483967eebce2d31 (commit)
via 586e7122784d8f45ea2d6c5fa7df2de2f53dfe2a (commit)
via df39ada6f58aecea6eb36c21521e1ab557e365a4 (commit)
via 2f25f42745d009e86a0eb0c4fe21f04d76d7121a (commit)
via d5c2a5dab82547764974b27bdb695901f59801f7 (commit)
via 5bfff7d3bccfff88d89e4e56565184a8ebf077b0 (commit)
from 522c26881144def06dec5b52bde6f583073df0a9 (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/ed4140325102d2654e902ba70a08eb8ce…
commit ed4140325102d2654e902ba70a08eb8ceb8daf16
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Wed Jul 16 15:35:36 2014 +0900
Fix build warnings in netmod-IB
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_finalize.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_finalize.c
index 3dd2881..c34a392 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_finalize.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_finalize.c
@@ -24,8 +24,10 @@
int MPID_nem_ib_finalize(void)
{
int mpi_errno = MPI_SUCCESS;
+#if 0
int ibcom_errno;
int i;
+#endif
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_FINALIZE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_FINALIZE);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
index 99ba26b..5f4ec31 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
@@ -13,8 +13,8 @@
* be deallocated. Look at all functions.
*/
#include "ib_ibcom.h"
-#include <sys/ipc.h>
-#include <sys/shm.h>
+//#include <sys/ipc.h>
+//#include <sys/shm.h>
#include <sys/types.h>
#include <assert.h>
#include <linux/mman.h> /* make it define MAP_ANONYMOUS */
@@ -30,7 +30,6 @@
#define dprintf(...)
#endif
-static int sendwr_id = 10;
static MPID_nem_ib_com_t contab[MPID_NEM_IB_COM_SIZE];
static int ib_initialized = 0;
static int maxcon;
@@ -506,8 +505,6 @@ int MPID_nem_ib_com_open(int ib_port, int open_flag, int *condesc)
MPID_nem_ib_com_t *conp;
struct ibv_qp_init_attr qp_init_attr;
struct ibv_sge *sge;
- struct ibv_send_wr *sr;
- struct ibv_recv_wr *rr, *bad_wr;
int mr_flags;
int i;
@@ -1201,7 +1198,9 @@ int MPID_nem_ib_com_alloc(int condesc, int sz)
{
MPID_nem_ib_com_t *conp;
int ibcom_errno = 0;
+#ifdef MPID_NEM_IB_DEBUG_IBCOM
int mr_flags = IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_READ | IBV_ACCESS_REMOTE_WRITE;
+#endif
MPID_NEM_IB_RANGE_CHECK_WITH_ERROR(condesc, conp);
@@ -2559,7 +2558,6 @@ int MPID_nem_ib_com_connect_ringbuf(int condesc,
{
int ibcom_errno = 0;
MPID_nem_ib_com_t *conp;
- int i;
MPID_NEM_IB_RANGE_CHECK_WITH_ERROR(condesc, conp);
@@ -2589,7 +2587,7 @@ int MPID_nem_ib_com_connect_ringbuf(int condesc,
conp->icom_sr[MPID_NEM_IB_COM_SMT_NOINLINE].wr.rdma.rkey = rkey;
}
dprintf
- ("connect_ringbuf,ringbuf_type=%d,rkey=%08x,start=%p,nslot=%d,sseq_num=%d,lsr_seq_num_tail=%d,remote_vc=%lx,alloc_new_mr=%d\n",
+ ("connect_ringbuf,ringbuf_type=%d,rkey=%08x,start=%p,nslot=%d,sseq_num=%d,lsr_seq_num_tail=%d,remote_vc=%p,alloc_new_mr=%d\n",
conp->local_ringbuf_type, conp->local_ringbuf_rkey, conp->local_ringbuf_start,
conp->local_ringbuf_nslot, conp->sseq_num, conp->lsr_seq_num_tail, conp->remote_vc,
alloc_new_mr);
@@ -2818,6 +2816,7 @@ int MPID_nem_ib_com_obtain_pointer(int condesc, MPID_nem_ib_com_t ** MPID_nem_ib
goto fn_exit;
}
+#if 0
static void MPID_nem_ib_comShow(int condesc)
{
MPID_nem_ib_com_t *conp;
@@ -2838,24 +2837,25 @@ static void MPID_nem_ib_comShow(int condesc)
}
fprintf(stdout, "\n");
}
+#endif
-static char *strerror_tbl[] = {
+static const char *strerror_tbl[] = {
[0] = "zero",
[1] = "one",
[2] = "two",
[3] = "three",
};
-char *MPID_nem_ib_com_strerror(int errno)
+char *MPID_nem_ib_com_strerror(int err)
{
char *r;
- if (-errno > 3) {
+ if (-err > 3) {
r = MPIU_Malloc(256);
- sprintf(r, "%d", -errno);
+ sprintf(r, "%d", -err);
goto fn_exit;
}
else {
- r = strerror_tbl[-errno];
+ r = (char *)strerror_tbl[-err];
}
fn_exit:
return r;
@@ -2891,7 +2891,6 @@ int MPID_nem_ib_com_reg_mr(void *addr, long len, struct ibv_mr **mr,
int MPID_nem_ib_com_dereg_mr(struct ibv_mr *mr)
{
- int i;
int ib_errno;
int ibcom_errno = 0;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
index 75e3757..180a1fc 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
@@ -559,7 +559,7 @@ extern int MPID_nem_ib_com_rdmabuf_occupancy_notify_rate_get(int condesc, int *n
extern int MPID_nem_ib_com_rdmabuf_occupancy_notify_rstate_get(int condesc, int **rstate);
extern int MPID_nem_ib_com_rdmabuf_occupancy_notify_lstate_get(int condesc, int **lstate);
-extern char *MPID_nem_ib_com_strerror(int errno);
+extern char *MPID_nem_ib_com_strerror(int err);
extern int MPID_nem_ib_com_mem_rdmawr_from(int condesc, void **out);
//extern int MPID_nem_ib_com_mem_rdmawr_to(int condesc, int seq_num, void **out);
@@ -675,7 +675,7 @@ static inline void *MPID_nem_ib_rdmawr_from_alloc(uint32_t _sz)
return p;
}
else {
- char *q, r;
+ char *q;
if (MPID_nem_ib_rdmawr_from_alloc_arena_free_list[clz]) {
q = MPID_nem_ib_rdmawr_from_alloc_arena_free_list[clz];
MPID_nem_ib_rdmawr_from_alloc_arena_free_list[clz] =
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
index 37f6bdc..1ab2502 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
@@ -472,8 +472,8 @@ static inline int MPID_nem_ib_cbf_hash1(uint64_t addr)
return
(((addr >> (MPID_nem_ib_cbf_lognslot * 0)) & (MPID_nem_ib_cbf_nslot - 1)) ^
((addr >> (MPID_nem_ib_cbf_lognslot * 3)) & (MPID_nem_ib_cbf_nslot - 1)) ^
- ((addr >> (MPID_nem_ib_cbf_lognslot * 6)) & (MPID_nem_ib_cbf_nslot - 1))
- + 1) & (MPID_nem_ib_cbf_nslot - 1);
+ (((addr >> (MPID_nem_ib_cbf_lognslot * 6)) & (MPID_nem_ib_cbf_nslot - 1))
+ + 1)) & (MPID_nem_ib_cbf_nslot - 1);
}
static inline int MPID_nem_ib_cbf_hash2(uint64_t addr)
@@ -482,8 +482,8 @@ static inline int MPID_nem_ib_cbf_hash2(uint64_t addr)
return
(((addr >> (MPID_nem_ib_cbf_lognslot * 1)) & (MPID_nem_ib_cbf_nslot - 1)) ^
((addr >> (MPID_nem_ib_cbf_lognslot * 4)) & (MPID_nem_ib_cbf_nslot - 1)) ^
- ((addr >> (MPID_nem_ib_cbf_lognslot * 7)) & (MPID_nem_ib_cbf_nslot - 1))
- + 1) & (MPID_nem_ib_cbf_nslot - 1);
+ (((addr >> (MPID_nem_ib_cbf_lognslot * 7)) & (MPID_nem_ib_cbf_nslot - 1))
+ + 1)) & (MPID_nem_ib_cbf_nslot - 1);
}
static inline int MPID_nem_ib_cbf_hash3(uint64_t addr)
@@ -492,8 +492,8 @@ static inline int MPID_nem_ib_cbf_hash3(uint64_t addr)
return
(((addr >> (MPID_nem_ib_cbf_lognslot * 2)) & (MPID_nem_ib_cbf_nslot - 1)) ^
((addr >> (MPID_nem_ib_cbf_lognslot * 5)) & (MPID_nem_ib_cbf_nslot - 1)) ^
- ((addr >> (MPID_nem_ib_cbf_lognslot * 8)) & (MPID_nem_ib_cbf_nslot - 1))
- + 2) & (MPID_nem_ib_cbf_nslot - 1);
+ (((addr >> (MPID_nem_ib_cbf_lognslot * 8)) & (MPID_nem_ib_cbf_nslot - 1))
+ + 2)) & (MPID_nem_ib_cbf_nslot - 1);
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
index 3a3d21a..35b2ab2 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
@@ -103,8 +103,6 @@ uint8_t MPID_nem_ib_lmt_tail_addr_cbf[MPID_nem_ib_cbf_nslot * MPID_nem_ib_cbf_bi
8] = { 0 };
static uint32_t MPID_nem_ib_rand_next = 1;
MPID_nem_ib_vc_area *MPID_nem_ib_debug_current_vc_ib;
-static int listen_fd;
-static int listen_port;
uint64_t MPID_nem_ib_ringbuf_acquired[(MPID_NEM_IB_NRINGBUF + 63) / 64];
uint64_t MPID_nem_ib_ringbuf_allocated[(MPID_NEM_IB_NRINGBUF + 63) / 64];
MPID_nem_ib_ringbuf_t *MPID_nem_ib_ringbuf;
@@ -201,7 +199,9 @@ static int MPID_nem_ib_kvs_get_binary(int from, const char *postfix, char *buf,
goto fn_exit;
}
+#ifndef MPID_NEM_IB_ONDEMAND
static int MPID_nem_ib_announce_network_addr(int my_rank, char **bc_val_p, int *val_max_sz_p);
+#endif
#undef FUNCNAME
#define FUNCNAME MPID_nem_ib_init
@@ -211,7 +211,6 @@ int MPID_nem_ib_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_m
{
int mpi_errno = MPI_SUCCESS;
int ibcom_errno = 0, pmi_errno;
- int ret;
int i, j, k;
int ib_port = 1;
@@ -626,7 +625,6 @@ int MPID_nem_ib_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_m
int MPID_nem_ib_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
{
int mpi_errno = MPI_SUCCESS;
- int str_errno = MPIU_STR_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_GET_BUSINESS_CARD);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_GET_BUSINESS_CARD);
dprintf("MPID_nem_ib_get_business_card,enter\n");
@@ -634,6 +632,7 @@ int MPID_nem_ib_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_
return mpi_errno;
}
+#ifndef MPID_NEM_IB_ONDEMAND
#undef FUNCNAME
#define FUNCNAME MPID_nem_ib_announce_network_addr
#undef FCNAME
@@ -641,7 +640,6 @@ int MPID_nem_ib_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_
static int MPID_nem_ib_announce_network_addr(int my_rank, char **bc_val_p, int *val_max_sz_p)
{
int mpi_errno = MPI_SUCCESS;
- int str_errno = MPIU_STR_SUCCESS;
int ibcom_errno;
int i, j, nranks;
@@ -772,6 +770,7 @@ static int MPID_nem_ib_announce_network_addr(int my_rank, char **bc_val_p, int *
MPIU_CHKLMEM_FREEALL();
goto fn_exit;
}
+#endif
#undef FUNCNAME
#define FUNCNAME MPID_nem_ib_connect_to_root
@@ -830,18 +829,6 @@ int MPID_nem_ib_vc_init(MPIDI_VC_t * vc)
int mpi_errno = MPI_SUCCESS;
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
- int ibcom_errno;
- size_t s;
- MPID_nem_ib_conn_t *sc;
- off_t offset;
-
- int remote_qpnum;
- uint16_t remote_lid;
- union ibv_gid remote_gid;
- void *remote_rmem;
- int remote_rkey;
-
- char key_str[256], remote_rank_str[256];
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_VC_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_VC_INIT);
@@ -1006,8 +993,6 @@ int MPID_nem_ib_vc_terminate(MPIDI_VC_t * vc)
dprintf("ib_vc_terminate,pg_rank=%d\n", vc->pg_rank);
int mpi_errno = MPI_SUCCESS;
int ibcom_errno;
- int req_errno = MPI_SUCCESS;
- int i;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_VC_TERMINATE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_VC_TERMINATE);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
index cd2980c..ed40e64 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
@@ -30,8 +30,9 @@ int MPID_nem_ib_lmt_initiate_lmt(struct MPIDI_VC *vc, union MPIDI_CH3_Pkt *rts_p
MPIDI_msg_sz_t data_sz;
MPID_Datatype *dt_ptr;
MPI_Aint dt_true_lb;
- MPIDI_CH3I_VC *vc_ch = VC_CH(vc);
+#if 0
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
+#endif
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_LMT_INITIATE_LMT);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_LMT_INITIATE_LMT);
@@ -89,7 +90,7 @@ int MPID_nem_ib_lmt_initiate_lmt(struct MPIDI_VC *vc, union MPIDI_CH3_Pkt *rts_p
#endif
/* put sz, see MPID_nem_lmt_RndvSend (in src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c) */
/* TODO remove sz field
- * /* pkt_RTS_handler (in src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c)
+ * pkt_RTS_handler (in src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c)
* rreq->ch.lmt_data_sz = rts_pkt->data_sz; */
//s_cookie_buf->sz = (uint32_t)((MPID_nem_pkt_lmt_rts_t*)rts_pkt)->data_sz;
@@ -208,12 +209,10 @@ int MPID_nem_ib_lmt_start_recv_core(struct MPID_Request *req, void *raddr, uint3
int MPID_nem_ib_lmt_start_recv(struct MPIDI_VC *vc, struct MPID_Request *req, MPID_IOV s_cookie)
{
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
int dt_contig;
MPIDI_msg_sz_t data_sz;
MPID_Datatype *dt_ptr;
MPI_Aint dt_true_lb;
- MPIDI_CH3I_VC *vc_ch = VC_CH(vc);
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_LMT_START_RECV);
@@ -384,7 +383,9 @@ int MPID_nem_ib_lmt_switch_send(struct MPIDI_VC *vc, struct MPID_Request *req)
REQ_FIELD(req, lmt_sender_tail) = *tailp;
dprintf("lmt_switch_send,tail on sender=%02x,tail onreceiver=%02x,req=%p\n", *tailp,
r_cookie_buf->tail, req);
+#ifdef MPID_NEM_IB_DEBUG_LMT
uint8_t *tail_wordp = (uint8_t *) ((uint8_t *) write_from_buf + data_sz - sizeof(uint32_t) * 2);
+#endif
dprintf("lmt_switch_send,tail on sender=%d\n", *tail_wordp);
fflush(stdout);
#endif
@@ -426,7 +427,6 @@ int MPID_nem_ib_lmt_handle_cookie(struct MPIDI_VC *vc, struct MPID_Request *req,
int MPID_nem_ib_lmt_done_send(struct MPIDI_VC *vc, struct MPID_Request *req)
{
int mpi_errno = MPI_SUCCESS;
- MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_LMT_DONE_SEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_LMT_DONE_SEND);
@@ -476,7 +476,6 @@ int MPID_nem_ib_lmt_done_send(struct MPIDI_VC *vc, struct MPID_Request *req)
int MPID_nem_ib_lmt_done_recv(struct MPIDI_VC *vc, struct MPID_Request *rreq)
{
int mpi_errno = MPI_SUCCESS;
- MPIDI_CH3I_VC *vc_ch = VC_CH(vc);
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_LMT_DONE_RECV);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_LMT_DONE_RECV);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_malloc.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_malloc.c
index ebbfd26..5cf81a4 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_malloc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_malloc.c
@@ -22,6 +22,10 @@
#endif
static void _local_malloc_initialize_hook(void);
+void *malloc(size_t size);
+void free(void *addr);
+void *realloc(void *addr, size_t size);
+void *calloc(size_t nmemb, size_t size);
void (*__malloc_initialize_hook) (void) = _local_malloc_initialize_hook;
@@ -320,10 +324,10 @@ void *malloc(size_t size)
}
/* use head elem */
- struct free_list *info = (struct free_list *) (arena_flist[pow].next);
- ptr = (char *) info + CHUNK;
+ struct free_list *head = (struct free_list *) (arena_flist[pow].next);
+ ptr = (char *) head + CHUNK;
dprintf("malloc(%lu) [2^%d] ==> USE pool %p\n", size, pow, ptr);
- list_del(info);
+ list_del(head);
}
else {
__init_pool_header(info, pow, alloc_sz);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
index d087a5a..4195152 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
@@ -33,14 +33,16 @@ static int entered_drain_scq = 0;
MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_poll_eager"); \
} \
}
-// int n; \
-// for(n = 0; n < MPID_nem_ib_npollingset; n++) { \
-// MPIDI_VC_t *vc_n = MPID_nem_ib_pollingset[n]; \
-// /*MPID_nem_ib_debug_current_vc_ib = vc_ib;*/ \
-// MPID_nem_ib_send_progress(vc_n); \
-// } \
+#if 0
+ int n; \
+ for(n = 0; n < MPID_nem_ib_npollingset; n++) { \
+ MPIDI_VC_t *vc_n = MPID_nem_ib_pollingset[n]; \
+ /*MPID_nem_ib_debug_current_vc_ib = vc_ib;*/ \
+ MPID_nem_ib_send_progress(vc_n); \
+ } \
#endif
+#endif
#if 1
#define MPID_NEM_IB_CHECK_AND_SEND_PROGRESS \
if (!MPID_nem_ib_sendq_empty(vc_ib->sendq) && MPID_nem_ib_sendq_ready_to_send_head(vc_ib)) { \
@@ -112,7 +114,6 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
dprintf("drain_scq,req=%p,req->ref_count=%d,cc_ptr=%d\n", req, req->ref_count,
*req->cc_ptr);
if (req->ref_count <= 0) {
- MPID_nem_ib_vc_area *vc_ib = VC_IB(req->ch.vc);
printf("%d\n", *(int *) 0);
}
@@ -768,9 +769,9 @@ int MPID_nem_ib_poll_eager(MPID_nem_ib_ringbuf_t * ringbuf)
int ibcom_errno;
struct MPIDI_VC *vc;
MPID_nem_ib_vc_area *vc_ib;
- int result;
- struct ibv_wc cqe[MPID_NEM_IB_COM_MAX_CQ_HEIGHT_DRAIN];
- uint64_t tscs, tsce;
+ //int result;
+ //struct ibv_wc cqe[MPID_NEM_IB_COM_MAX_CQ_HEIGHT_DRAIN];
+ //uint64_t tscs, tsce;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_POLL_EAGER);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_POLL_EAGER);
@@ -814,7 +815,7 @@ int MPID_nem_ib_poll_eager(MPID_nem_ib_ringbuf_t * ringbuf)
(MPID_nem_ib_netmod_trailer_t *) ((uint8_t *) buf + off_pow2_aligned);
dprintf("poll,off_pow2_aligned=%d,netmod_trailer=%p,sz=%d\n", off_pow2_aligned, netmod_trailer,
MPID_NEM_IB_NETMOD_HDR_SZ_GET(buf));
- int k = 0;
+ //int k = 0;
//tsce = MPID_nem_ib_rdtsc(); printf("9,%ld\n", tsce - tscs); // 55 for 512-byte
//tscs = MPID_nem_ib_rdtsc();
//#define MPID_NEM_IB_TLBPREF_POLL 20
@@ -913,12 +914,13 @@ int MPID_nem_ib_poll_eager(MPID_nem_ib_ringbuf_t * ringbuf)
/* responder releases resource and then embed largest sequence number into MPI message bound to initiator */
#if 1
if ((vc->state != MPIDI_VC_STATE_INACTIVE) ||
- (vc->state == MPIDI_VC_STATE_INACTIVE && vc_ib->vc_terminate_buf == buf))
+ (vc->state == MPIDI_VC_STATE_INACTIVE && vc_ib->vc_terminate_buf == buf)) {
dprintf
("handle_pkt,after,%d<-%d,id=%d,pkt->type=%d,eagershort=%d,close=%d,rts=%d,piggy-backed-eagersend=%d\n",
MPID_nem_ib_myrank, vc->pg_rank, *remote_poll, pkt->type,
MPIDI_CH3_PKT_EAGERSHORT_SEND, MPIDI_CH3_PKT_CLOSE, MPIDI_NEM_PKT_LMT_RTS,
MPIDI_NEM_IB_PKT_EAGER_SEND);
+ }
int notify_rate;
if ((vc->state != MPIDI_VC_STATE_INACTIVE) ||
@@ -952,14 +954,13 @@ int MPID_nem_ib_poll_eager(MPID_nem_ib_ringbuf_t * ringbuf)
* because rreq->dev.tmpbuf is set to zero in ch3_eager.c
*/
if ((vc->state != MPIDI_VC_STATE_INACTIVE) ||
- (vc->state == MPIDI_VC_STATE_INACTIVE && vc_ib->vc_terminate_buf == buf))
+ (vc->state == MPIDI_VC_STATE_INACTIVE && vc_ib->vc_terminate_buf == buf)) {
dprintf("poll_eager,released,type=%d,MPIDI_NEM_IB_PKT_REPLY_SEQ_NUM=%d\n", pkt->type,
MPIDI_NEM_IB_PKT_REPLY_SEQ_NUM);
- if ((vc->state != MPIDI_VC_STATE_INACTIVE) ||
- (vc->state == MPIDI_VC_STATE_INACTIVE && vc_ib->vc_terminate_buf == buf))
MPID_nem_ib_recv_buf_released(vc,
(void *) ((uint8_t *) buf +
sz_pkt + sizeof(MPIDI_CH3_Pkt_t)));
+ }
}
else {
if (MPID_NEM_IB_NETMOD_HDR_SZ_GET(buf) == sz_pkt + sizeof(MPIDI_CH3_Pkt_t)) {
@@ -977,16 +978,15 @@ int MPID_nem_ib_poll_eager(MPID_nem_ib_ringbuf_t * ringbuf)
#endif
if ((vc->state != MPIDI_VC_STATE_INACTIVE) ||
- (vc->state == MPIDI_VC_STATE_INACTIVE && vc_ib->vc_terminate_buf == buf))
+ (vc->state == MPIDI_VC_STATE_INACTIVE && vc_ib->vc_terminate_buf == buf)) {
dprintf("ib_poll,hdr_ringbuf_type=%d\n", MPID_NEM_IB_NETMOD_HDR_RINGBUF_TYPE_GET(buf));
- if ((vc->state != MPIDI_VC_STATE_INACTIVE) ||
- (vc->state == MPIDI_VC_STATE_INACTIVE && vc_ib->vc_terminate_buf == buf))
if (MPID_NEM_IB_NETMOD_HDR_RINGBUF_TYPE_GET(buf) & MPID_NEM_IB_RINGBUF_RELINDEX) {
vc_ib->ibcom->lsr_seq_num_tail = MPID_NEM_IB_NETMOD_HDR_RELINDEX_GET(buf);
dprintf("ib_poll,local_tail is updated to %d\n",
MPID_NEM_IB_NETMOD_HDR_RELINDEX_GET(buf));
}
+ }
/* Clear flag */
if ((vc->state != MPIDI_VC_STATE_INACTIVE) ||
@@ -1108,7 +1108,6 @@ int MPID_nem_ib_poll(int in_blocking_poll)
(uint8_t *) ((uint8_t *) write_to_buf /*+ REQ_FIELD(rreq, lmt_dt_true_lb) */ +
rreq->ch.lmt_data_sz - sizeof(uint8_t));
- uint8_t lmt_tail = REQ_FIELD(rreq, lmt_tail);
if (*tailmagic != REQ_FIELD(rreq, lmt_tail)) {
goto next;
}
@@ -1158,7 +1157,9 @@ int MPID_nem_ib_poll(int in_blocking_poll)
}
/* send done to sender. vc is stashed in MPID_nem_ib_lmt_start_recv (in ib_lmt.c) */
+#ifdef MPID_NEM_IB_DEBUG_POLL
MPID_nem_ib_vc_area *vc_ib = VC_IB(rreq->ch.vc);
+#endif
dprintf("ib_poll,GET,lmt_send_GET_DONE,rsr_seq_num_tail=%d\n",
vc_ib->ibcom->rsr_seq_num_tail);
MPID_nem_ib_lmt_send_GET_DONE(rreq->ch.vc, rreq);
@@ -1638,13 +1639,7 @@ int MPID_nem_ib_PktHandler_EagerSend(MPIDI_VC_t * vc,
MPID_nem_ib_pkt_prefix_t *netmod_pkt = (MPID_nem_ib_pkt_prefix_t *) pkt;
MPIDI_CH3_Pkt_eager_send_t *ch3_pkt =
(MPIDI_CH3_Pkt_eager_send_t *) ((uint8_t *) pkt + sizeof(MPID_nem_ib_pkt_prefix_t));
- MPID_Request *rreq;
- int found;
- int complete;
- char *data_buf;
- MPIDI_msg_sz_t data_len;
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_PKTHANDLER_EAGERSEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_PKTHANDLER_EAGERSEND);
dprintf("ib_pkthandler_eagersend,tag=%d\n", ch3_pkt->match.parts.tag);
@@ -1785,10 +1780,8 @@ int MPID_nem_ib_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPIDI_msg_sz_t * buflen /* out */ ,
MPID_Request ** rreqp /* out */)
{
- MPID_nem_ib_pkt_prefix_t *netmod_pkt = (MPID_nem_ib_pkt_prefix_t *) pkt;
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPID_Request *req = NULL;
MPIDI_CH3_Pkt_put_t *put_pkt =
(MPIDI_CH3_Pkt_put_t *) ((uint8_t *) pkt + sizeof(MPIDI_CH3_Pkt_t));
@@ -1904,10 +1897,8 @@ int MPID_nem_ib_PktHandler_Accumulate(MPIDI_VC_t * vc,
MPIDI_CH3_Pkt_t * pkt, MPIDI_msg_sz_t * buflen /* out */ ,
MPID_Request ** rreqp /* out */)
{
- MPID_nem_ib_pkt_prefix_t *netmod_pkt = (MPID_nem_ib_pkt_prefix_t *) pkt;
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPID_Request *req = NULL;
MPIDI_CH3_Pkt_accum_t *accum_pkt =
(MPIDI_CH3_Pkt_accum_t *) ((uint8_t *) pkt + sizeof(MPIDI_CH3_Pkt_t));
@@ -1917,9 +1908,6 @@ int MPID_nem_ib_PktHandler_Accumulate(MPIDI_VC_t * vc,
/* ref. MPIDI_CH3_PktHandler_Accumulate */
MPI_Aint true_lb, true_extent, extent;
- int complete = 0;
- char *data_buf = NULL;
- MPIDI_msg_sz_t data_len;
MPI_Aint type_size;
MPID_Win *win_ptr;
@@ -2044,13 +2032,7 @@ int MPID_nem_ib_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPID_nem_ib_pkt_prefix_t *netmod_pkt = (MPID_nem_ib_pkt_prefix_t *) pkt;
MPIDI_CH3_Pkt_get_t *ch3_pkt =
(MPIDI_CH3_Pkt_get_t *) ((uint8_t *) pkt + sizeof(MPID_nem_ib_pkt_prefix_t));
- MPID_Request *rreq;
- int found;
- int complete;
- char *data_buf;
- MPIDI_msg_sz_t data_len;
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_PKTHANDLER_GET);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_PKTHANDLER_GET);
/* Update occupation status of local SR (send request) queue */
@@ -2103,10 +2085,8 @@ int MPID_nem_ib_PktHandler_GetResp(MPIDI_VC_t * vc,
MPIDI_CH3_Pkt_t * pkt, MPIDI_msg_sz_t * buflen /* out */ ,
MPID_Request ** rreqp /* out */)
{
- MPID_nem_ib_pkt_prefix_t *netmod_pkt = (MPID_nem_ib_pkt_prefix_t *) pkt;
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPID_Request *req = NULL;
MPIDI_CH3_Pkt_get_resp_t *get_resp_pkt =
(MPIDI_CH3_Pkt_get_resp_t *) ((uint8_t *) pkt + sizeof(MPIDI_CH3_Pkt_t));
@@ -2178,7 +2158,6 @@ int MPID_nem_ib_pkt_GET_DONE_handler(MPIDI_VC_t * vc,
MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
{
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPID_nem_ib_pkt_lmt_get_done_t *const done_pkt = (MPID_nem_ib_pkt_lmt_get_done_t *) pkt;
MPID_Request *req;
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
@@ -2254,9 +2233,7 @@ int MPID_nem_ib_PktHandler_req_seq_num(MPIDI_VC_t * vc,
MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
{
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPID_nem_ib_pkt_req_seq_num_t *const req_pkt = (MPID_nem_ib_pkt_req_seq_num_t *) pkt;
- MPID_Request *req;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_PKTHANDLER_REQ_SEQ_NUM);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_PKTHANDLER_REQ_SEQ_NUM);
/* mark as all of the message is read */
@@ -2294,9 +2271,7 @@ int MPID_nem_ib_PktHandler_reply_seq_num(MPIDI_VC_t * vc,
MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
{
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPID_nem_ib_pkt_reply_seq_num_t *const reply_pkt = (MPID_nem_ib_pkt_reply_seq_num_t *) pkt;
- MPID_Request *req;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_PKTHANDLER_REPLY_SEQ_NUM);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_PKTHANDLER_REPLY_SEQ_NUM);
/* mark as all of the message is consumed */
@@ -2337,7 +2312,6 @@ int MPID_nem_ib_PktHandler_change_rdmabuf_occupancy_notify_state
int ibcom_errno;
MPID_nem_ib_pkt_change_rdmabuf_occupancy_notify_state_t *const reply_pkt =
(MPID_nem_ib_pkt_change_rdmabuf_occupancy_notify_state_t *) pkt;
- MPID_Request *req;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_PKTHANDLER_CHANGE_RDMABUF_OCCUPANCY_NOTIFY_STATE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_PKTHANDLER_CHANGE_RDMABUF_OCCUPANCY_NOTIFY_STATE);
/* mark as all of the message is read */
@@ -2373,7 +2347,6 @@ int MPID_nem_ib_pkt_rma_lmt_getdone(MPIDI_VC_t * vc,
MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
{
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPID_nem_ib_pkt_lmt_get_done_t *const done_pkt = (MPID_nem_ib_pkt_lmt_get_done_t *) pkt;
MPID_Request *req;
int req_type;
@@ -2885,7 +2858,6 @@ int MPID_nem_ib_cm_poll_syn()
int mpi_errno = MPI_SUCCESS;
int ibcom_errno;
int ib_port = 1;
- int i;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_CM_POLL_SYN);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_CM_POLL_SYN);
/* scratch pad is freed after receiving CLOSE */
@@ -2986,7 +2958,7 @@ int MPID_nem_ib_cm_poll_syn()
if (is_synack) {
MPID_NEM_IB_CM_COMPOSE_SYNACK(cmd, req, syn->initiator_req);
dprintf
- ("cm_poll_syn,composing synack,responder_req=%p,cmd->rmem=%lx,rkey=%08x,ringbuf_nslot=%d,remote_vc=%lx\n",
+ ("cm_poll_syn,composing synack,responder_req=%p,cmd->rmem=%p,rkey=%08x,ringbuf_nslot=%d,remote_vc=%p\n",
cmd->responder_req, cmd->rmem, cmd->rkey, cmd->ringbuf_nslot,
cmd->remote_vc);
cmd->initiator_ringbuf_index = req->initiator_ringbuf_index =
@@ -3197,7 +3169,7 @@ int MPID_nem_ib_cm_poll()
icom_mem[MPID_NEM_IB_COM_SCRATCH_PAD_FROM];
MPID_NEM_IB_CM_COMPOSE_ACK1(cmd, req, synack->responder_req);
dprintf
- ("cm_poll,composing ack1,cmd->responder_req=%p,cmd->rmem=%lx,rkey=%08x,ringbuf_nslot=%d,remote_vc=%lx\n",
+ ("cm_poll,composing ack1,cmd->responder_req=%p,cmd->rmem=%p,rkey=%08x,ringbuf_nslot=%d,remote_vc=%p\n",
cmd->responder_req, cmd->rmem, cmd->rkey, cmd->ringbuf_nslot,
cmd->remote_vc);
MPID_nem_ib_cm_cmd_shadow_t *shadow = (MPID_nem_ib_cm_cmd_shadow_t *)
@@ -3237,6 +3209,7 @@ int MPID_nem_ib_cm_poll()
MPID_nem_ib_cm_req_t *req = (MPID_nem_ib_cm_req_t *) synack->initiator_req;
dprintf
("cm_poll,synack detected!,responder_req=%p,responder_rank=%d,ringbuf_index=%d,tx=%d\n",
+ synack->responder_req, req->responder_rank, synack->initiator_ringbuf_index,
req->ibcom->outstanding_connection_tx);
/* These mean the end of CM-op, so decrement here. */
req->ibcom->outstanding_connection_tx -= 1;
@@ -3439,7 +3412,6 @@ int MPID_nem_ib_cm_poll()
int MPID_nem_ib_ringbuf_alloc(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
int i;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_RINGBUF_ALLOC);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_RINGBUF_ALLOC);
@@ -3517,7 +3489,6 @@ int MPID_nem_ib_ringbuf_alloc(MPIDI_VC_t * vc)
int MPID_nem_ib_ringbuf_free(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
int i;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_RINGBUF_FREE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_RINGBUF_FREE);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c
index 7eeabee..bbabe11 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c
@@ -34,8 +34,10 @@ static int ref_count;
typedef struct {
char *next;
} free_list_t;
+#if 0
static char *free_list_front[MPID_NEM_IB_NIALLOCID] = { 0 };
static char *arena_flist[MPID_NEM_IB_NIALLOCID] = { 0 };
+#endif
#define MPID_NEM_IB_SZARENA 4096
#define MPID_NEM_IB_CLUSTER_SIZE (MPID_NEM_IB_SZARENA/sz)
@@ -157,7 +159,7 @@ static inline void __lru_queue_display()
p != (struct MPID_nem_ib_com_reg_mr_cache_entry_t *) &MPID_nem_ib_com_reg_mr_cache[i];
p = (struct MPID_nem_ib_com_reg_mr_cache_entry_t *) p->lru_next) {
if (p && p->addr) {
- dprintf("-------- p=%p,addr=%p,len=%d,refc=%d,lru_next=%p\n", p, p->addr, p->len,
+ dprintf("-------- p=%p,addr=%p,len=%ld,refc=%d,lru_next=%p\n", p, p->addr, p->len,
p->refc, p->lru_next);
}
else {
@@ -201,7 +203,7 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
#endif
key = MPID_nem_ib_com_hash_func(addr);
- dprintf("[MrCache] addr=%p, len=%d\n", addr, len);
+ dprintf("[MrCache] addr=%p, len=%ld\n", addr, len);
dprintf("[MrCache] aligned addr=%p, len=%ld\n", addr_aligned, len_aligned);
//__lru_queue_display();
@@ -342,6 +344,7 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
#endif
}
+#if 0
static void MPID_nem_ib_com_reg_mr_dereg(struct ibv_mr *mr)
{
@@ -354,6 +357,7 @@ static void MPID_nem_ib_com_reg_mr_dereg(struct ibv_mr *mr)
//dprintf("MPID_nem_ib_com_reg_mr_dereg,entry=%p,mr=%p,addr=%p,refc=%d,offset=%lx\n", e, mr, e->mr->addr,
//e->refc, offset);
}
+#endif
int MPID_nem_ib_com_register_cache_init()
{
@@ -406,7 +410,7 @@ int MPID_nem_ib_com_register_cache_release()
MPID_nem_ib_com_reg_mr_cache[i].lru_next;
p !=
(struct MPID_nem_ib_com_reg_mr_cache_entry_t *) &MPID_nem_ib_com_reg_mr_cache[i];) {
- if (p && p->addr > 0) {
+ if (p && p->addr) {
ib_errno = MPID_nem_ib_com_dereg_mr(p->mr);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(ib_errno, -1, printf("MPID_nem_ib_com_dereg_mr"));
struct MPID_nem_ib_com_reg_mr_cache_entry_t *p_old = p;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
index 50b21eb..66ef497 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
@@ -171,7 +171,9 @@ static int MPID_nem_ib_iSendContig_core(MPIDI_VC_t * vc, MPID_Request * sreq, vo
/* send RDMA-write-to buffer occupancy information */
/* embed SR occupancy information and remember the last one sent */
+#if 0
MPIDI_CH3_Pkt_t *ch3_hdr = (MPIDI_CH3_Pkt_t *) hdr;
+#endif
if (MPID_nem_ib_diff16(vc_ib->ibcom->rsr_seq_num_tail, vc_ib->ibcom->rsr_seq_num_tail_last_sent)
> notify_rate) {
#if 0 /* debug, disabling piggy-back */
@@ -295,7 +297,9 @@ static int MPID_nem_ib_iSendContig_core(MPIDI_VC_t * vc, MPID_Request * sreq, vo
dprintf("isendcontig_core,MPIDI_CH3_PKT_ACCUMULATE,ref_count=%d\n", sreq->ref_count);
}
+#ifdef MPID_NEM_IB_DEBUG_SEND
int msg_type = MPIDI_Request_get_msg_type(sreq);
+#endif
dprintf
("isendcontig_core,sreq=%p,prefix=%p,sz_prefix=%d,hdr=%p,sz_hdr=%ld,data=%p,sz_data=%d,remote_ringbuf->type=%d\n",
@@ -441,7 +445,9 @@ int MPID_nem_ib_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz)
{
int mpi_errno = MPI_SUCCESS;
+#if 0
int ibcom_errno;
+#endif
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_ISENDCONTIG);
@@ -675,9 +681,11 @@ int MPID_nem_ib_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_s
{
MPID_Request *sreq = NULL;
int mpi_errno = MPI_SUCCESS;
+#if 0
int ibcom_errno;
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
int sseq_num;
+#endif
//uint64_t tscs, tsce;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_ISTARTCONTIGMSG);
@@ -935,8 +943,10 @@ int MPID_nem_ib_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
MPIDI_msg_sz_t hdr_sz)
{
int mpi_errno = MPI_SUCCESS;
+#if 0
int ibcom_errno;
MPIDI_msg_sz_t last;
+#endif
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_SENDNONCONTIG);
@@ -1047,12 +1057,11 @@ int MPID_nem_ib_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
int MPID_nem_ib_send_progress(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
+#if 0
int ibcom_errno;
+#endif
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
- MPID_IOV *iov;
- int n_iov;
MPID_Request *sreq, *prev_sreq;
- int again = 0;
int req_type, msg_type;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_SEND_PROGRESS);
@@ -1208,8 +1217,10 @@ int MPID_nem_ib_send_progress(MPIDI_VC_t * vc)
/* send current rsr_seq_num_tail because message from target to initiator
* might have happened while being queued */
case MPIDI_NEM_PKT_LMT_RTS:{
+#if 0
MPID_nem_ib_lmt_cookie_t *s_cookie_buf =
(MPID_nem_ib_lmt_cookie_t *) sreq->dev.iov[1].MPID_IOV_BUF;
+#endif
dprintf("send_progress,MPIDI_NEM_PKT_LMT_RTS,rsr_seq_num_tail=%d\n",
vc_ib->ibcom->rsr_seq_num_tail);
#if 0 /* moving to packet header */
@@ -1223,8 +1234,10 @@ int MPID_nem_ib_send_progress(MPIDI_VC_t * vc)
}
case MPIDI_NEM_PKT_LMT_CTS:{
+#if 0
MPID_nem_ib_lmt_cookie_t *s_cookie_buf =
(MPID_nem_ib_lmt_cookie_t *) sreq->dev.iov[1].MPID_IOV_BUF;
+#endif
dprintf("send_progress,MPIDI_NEM_PKT_LMT_CTS,rsr_seq_num_tail=%d\n",
vc_ib->ibcom->rsr_seq_num_tail);
#if 0 /* moving to packet header */
@@ -1335,7 +1348,7 @@ int MPID_nem_ib_send_progress(MPIDI_VC_t * vc)
}
/* save sreq->dev.next (and sreq) because decrementing reference-counter might free sreq */
- MPID_Request *tmp_sreq = sreq;
+ //MPID_Request *tmp_sreq = sreq;
sreq = MPID_nem_ib_sendq_next(sreq);
goto next_unlinked;
//next:
@@ -1366,7 +1379,6 @@ int MPID_nem_ib_send_progress(MPIDI_VC_t * vc)
int MPID_nem_ib_cm_progress()
{
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPID_nem_ib_cm_req_t *sreq, *prev_sreq;
MPID_nem_ib_cm_cmd_shadow_t *shadow;
int is_established = 0;
@@ -1619,7 +1631,6 @@ int MPID_nem_ib_cm_cas_core(int rank, MPID_nem_ib_cm_cmd_shadow_t * shadow)
{
int mpi_errno = MPI_SUCCESS;
int ibcom_errno;
- int val;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_CM_CAS_CORE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_CM_CAS_CORE);
@@ -1655,7 +1666,6 @@ int MPID_nem_ib_cm_cas(MPIDI_VC_t * vc, uint32_t ask_on_connect)
{
int mpi_errno = MPI_SUCCESS;
int ibcom_errno;
- int val;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_CM_CAS);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_CM_CAS);
@@ -1718,8 +1728,6 @@ int MPID_nem_ib_cm_cmd_core(int rank, MPID_nem_ib_cm_cmd_shadow_t * shadow, void
{
int mpi_errno = MPI_SUCCESS;
int ibcom_errno;
- int val;
- MPID_nem_ib_cm_cmd_t cmd;
int ib_port = 1;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_CM_CMD_CORE);
@@ -1905,7 +1913,6 @@ int MPID_nem_ib_ringbuf_ask_fetch(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
int ibcom_errno;
- int val;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_RINGBUF_ASK_FETCH);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_RINGBUF_ASK_FETCH);
@@ -1971,7 +1978,6 @@ int MPID_nem_ib_ringbuf_ask_cas_core(MPIDI_VC_t * vc, MPID_nem_ib_ringbuf_cmd_sh
{
int mpi_errno = MPI_SUCCESS;
int ibcom_errno;
- int val;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_RINGBUF_ASK_CAS_CORE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_RINGBUF_ASK_CAS_CORE);
@@ -2010,8 +2016,6 @@ int MPID_nem_ib_ringbuf_ask_cas_core(MPIDI_VC_t * vc, MPID_nem_ib_ringbuf_cmd_sh
int MPID_nem_ib_ringbuf_ask_cas(MPIDI_VC_t * vc, MPID_nem_ib_ringbuf_req_t * req)
{
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
- int val;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_RINGBUF_ASK_CAS);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_RINGBUF_ASK_CAS);
@@ -2081,7 +2085,6 @@ int MPID_nem_ib_ringbuf_ask_cas(MPIDI_VC_t * vc, MPID_nem_ib_ringbuf_req_t * req
int MPID_nem_ib_ringbuf_progress()
{
int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
MPID_nem_ib_ringbuf_req_t *sreq, *prev_sreq;
MPID_nem_ib_ringbuf_cmd_shadow_t *shadow;
@@ -2164,7 +2167,7 @@ int MPID_nem_ib_ringbuf_progress()
}
/* save sreq->dev.next (and sreq) because decrementing reference-counter might free sreq */
- MPID_nem_ib_ringbuf_req_t *tmp_sreq = sreq;
+ //MPID_nem_ib_ringbuf_req_t *tmp_sreq = sreq;
sreq = MPID_nem_ib_ringbuf_sendq_next(sreq);
goto next_unlinked;
http://git.mpich.org/mpich.git/commitdiff/19c00389e4915c68fef68d3e61b50bbde…
commit 19c00389e4915c68fef68d3e61b50bbded1ad46b
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Wed Jul 2 15:56:04 2014 +0900
Fix netmod-IB to pass RMA-test
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt b/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt
index 9154e1e..82f58f8 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt
@@ -35,6 +35,7 @@
**MPID_nem_ib_com_wr_scratch_pad:MPID_nem_ib_com_wr_scratch_pad failed
**MPID_nem_ib_drain_scq:MPID_nem_ib_drain_scq failed
**MPID_nem_ib_drain_scq_scratch_pad:MPID_nem_ib_drain_scq_scratch_pad failed
+**MPID_nem_ib_handle_pkt_bh:MPID_nem_ib_handle_pkt_bh failed
**MPID_nem_ib_kvs_put_binary:MPID_nem_ib_kvs_put_binary failed
**MPID_nem_ib_lmt_done_recv:MPID_nem_ib_lmt_done_recv failed
**MPID_nem_ib_lmt_done_send:MPID_nem_ib_lmt_done_send failed
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
index 3be6a44..37f6bdc 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
@@ -553,6 +553,8 @@ int MPID_nem_ib_drain_scq_scratch_pad(void);
int MPID_nem_ib_poll(int in_blocking_poll);
int MPID_nem_ib_poll_eager(MPID_nem_ib_ringbuf_t * ringbuf);
int MPID_nem_ib_ring_alloc(MPIDI_VC_t * vc);
+int MPID_nem_ib_handle_pkt_bh(MPIDI_VC_t * vc, MPID_Request * req, char *buf,
+ MPIDI_msg_sz_t buflen);
int MPID_nem_ib_cm_drain_scq(void);
int MPID_nem_ib_cm_drain_rcq(void);
@@ -689,6 +691,14 @@ typedef struct {
uint8_t tail; /* last word of payload */
} MPID_nem_ib_lmt_cookie_t;
+typedef struct {
+ void *addr;
+ uint32_t rkey;
+ uint8_t tail; /* last word of payload */
+ int len;
+ MPI_Request sender_req_id; /* request id of sender side */
+} MPID_nem_ib_rma_lmt_cookie_t;
+
typedef enum MPID_nem_ib_pkt_subtype {
MPIDI_NEM_IB_PKT_EAGER_SEND,
#if 0 /* modification of mpid_nem_lmt.c is required */
@@ -702,6 +712,7 @@ typedef enum MPID_nem_ib_pkt_subtype {
MPIDI_NEM_IB_PKT_REQ_SEQ_NUM,
MPIDI_NEM_IB_PKT_REPLY_SEQ_NUM,
MPIDI_NEM_IB_PKT_CHG_RDMABUF_OCC_NOTIFY_STATE,
+ MPIDI_NEM_IB_PKT_RMA_LMT_GET_DONE,
MPIDI_NEM_IB_PKT_NUM_PKT_HANDLERS
} MPID_nem_ib_pkt_subtype_t;
@@ -778,6 +789,9 @@ int MPID_nem_ib_PktHandler_change_rdmabuf_occupancy_notify_state(MPIDI_VC_t * vc
MPIDI_CH3_Pkt_t * pkt,
MPIDI_msg_sz_t * buflen,
MPID_Request ** rreqp);
+int MPID_nem_ib_pkt_rma_lmt_getdone(MPIDI_VC_t * vc,
+ MPIDI_CH3_Pkt_t * pkt,
+ MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp);
/* MPID_nem_ib_PktHandler_lmt_done is a wrapper of pkt_DONE_handler and calls it */
/* pkt_DONE_handler (in src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c) is not exported */
@@ -885,6 +899,30 @@ int pkt_DONE_handler(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt, MPIDI_msg_sz_t * bu
} \
} while (0)
+#define MPID_nem_ib_lmt_send_PKT_LMT_DONE(vc, rreq) do { \
+ MPID_PKT_DECL_CAST(_upkt, MPID_nem_ib_pkt_lmt_get_done_t, _done_pkt); \
+ MPID_Request *_done_req; \
+ \
+ MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending rndv DONE packet"); \
+ MPIDI_Pkt_init(_done_pkt, MPIDI_NEM_PKT_NETMOD); \
+ _done_pkt->subtype = MPIDI_NEM_IB_PKT_RMA_LMT_GET_DONE;\
+ _done_pkt->req_id = (rreq)->ch.lmt_req_id; \
+ /* embed SR occupancy information */ \
+ _done_pkt->seq_num_tail = VC_FIELD(vc, ibcom->rsr_seq_num_tail); \
+ \
+ /* remember the last one sent */ \
+ VC_FIELD(vc, ibcom->rsr_seq_num_tail_last_sent) = VC_FIELD(vc, ibcom->rsr_seq_num_tail); \
+ \
+ mpi_errno = MPIDI_CH3_iStartMsg((vc), _done_pkt, sizeof(*_done_pkt), &_done_req); \
+ MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_lmt_send_GET_DONE"); \
+ if (_done_req != NULL) \
+ { \
+ MPIU_ERR_CHKANDJUMP(_done_req->status.MPI_ERROR, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_lmt_send_GET_DONE"); \
+ MPID_Request_release(_done_req); \
+ dprintf("send_get_done,release,req=%p\n", _done_req); \
+ } \
+ } while (0)
+
/* Allocator for packing buffer for non-contiguous data
- Allocate performs dequeue
- Slow to "malloc" (two load and one store instructions)
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
index 1d9fa9d..3a3d21a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
@@ -960,6 +960,7 @@ int MPID_nem_ib_vc_init(MPIDI_VC_t * vc)
MPID_nem_ib_pkt_handler[MPIDI_NEM_IB_PKT_REPLY_SEQ_NUM] = MPID_nem_ib_PktHandler_reply_seq_num;
MPID_nem_ib_pkt_handler[MPIDI_NEM_IB_PKT_CHG_RDMABUF_OCC_NOTIFY_STATE] =
MPID_nem_ib_PktHandler_change_rdmabuf_occupancy_notify_state;
+ MPID_nem_ib_pkt_handler[MPIDI_NEM_IB_PKT_RMA_LMT_GET_DONE] = MPID_nem_ib_pkt_rma_lmt_getdone;
/* register CH3 send/recv functions */
vc_ch->iStartContigMsg = MPID_nem_ib_iStartContigMsg;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
index 4d931e6..d087a5a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
@@ -6,6 +6,7 @@
*/
#include "ib_impl.h"
+#include "mpidrma.h"
//#define MPID_NEM_IB_DEBUG_POLL
#ifdef dprintf /* avoid redefinition with src/mpid/ch3/include/mpidimpl.h */
@@ -168,6 +169,16 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
}
}
+ /* As for request by PKT_PUT, both req->type and req->comm are not set.
+ * If receiver's data type is derived-type, req->dev.datatype_ptr is set.
+ */
+ if ((*req->cc_ptr == 1) && (req_type == 0) && !req->comm) {
+ if (req->dev.datatype_ptr && (req->dev.segment_size > 0) &&
+ REQ_FIELD(req, lmt_pack_buf)) {
+ MPIU_Free(REQ_FIELD(req, lmt_pack_buf));
+ }
+ }
+
/* decrement the number of entries in IB command queue */
vc_ib->ibcom->ncom -= 1;
MPID_nem_ib_ncqe -= 1;
@@ -260,6 +271,12 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
MPID_nem_ib_ncqe -= 1;
MPID_nem_ib_rdmawr_from_free(REQ_FIELD(req, buf_from), REQ_FIELD(req, buf_from_sz));
+ /* this request may be from Noncontig */
+ if ((*req->cc_ptr == 1) && req->dev.datatype_ptr && (req->dev.segment_size > 0) &&
+ REQ_FIELD(req, lmt_pack_buf)) {
+ MPIU_Free(REQ_FIELD(req, lmt_pack_buf));
+ }
+
dprintf("drain_scq,GET_RESP,ncqe=%d\n", MPID_nem_ib_ncqe);
MPIU_Assert(req->ref_count == 1 || req->ref_count == 2);
@@ -415,6 +432,183 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
//MPID_NEM_IB_SEND_PROGRESS_POLLINGSET
//}
}
+ else if (req_type == 13 && cqe[i].opcode == IBV_WC_RDMA_READ) {
+ MPID_nem_ib_vc_area *vc_ib = VC_IB(req->ch.vc);
+
+ /* end of packet */
+ if (req_wrap->mf == 0) {
+ MPIDI_msg_sz_t data_len = req->ch.lmt_data_sz;
+ MPI_Aint type_size;
+
+ MPID_Datatype_get_size_macro(req->dev.datatype, type_size);
+ req->dev.recv_data_sz = type_size * req->dev.user_count;
+
+ int complete = 0;
+ mpi_errno =
+ MPIDI_CH3U_Receive_data_found(req, REQ_FIELD(req, lmt_pack_buf), &data_len,
+ &complete);
+
+ /* Data receive must be completed */
+ MPIU_Assert(complete == TRUE);
+
+ MPIU_Free(REQ_FIELD(req, lmt_pack_buf));
+
+ MPID_nem_ib_lmt_send_PKT_LMT_DONE(req->ch.vc, req);
+ MPIDI_CH3U_Request_complete(req);
+ }
+
+ /* decrement the number of entries in IB command queue */
+ vc_ib->ibcom->ncom -= 1;
+ MPID_nem_ib_ncqe -= 1;
+
+ MPIU_Free(req_wrap);
+ }
+ else if (req_type == MPIDI_REQUEST_TYPE_PUT_RESP && cqe[i].opcode == IBV_WC_RDMA_READ) {
+ MPID_nem_ib_vc_area *vc_ib = VC_IB(req->ch.vc);
+
+ /* end of packet */
+ if (req_wrap->mf == 0) {
+ MPIDI_msg_sz_t data_len = req->ch.lmt_data_sz;
+ int complete = 0;
+ mpi_errno =
+ MPIDI_CH3U_Receive_data_found(req, REQ_FIELD(req, lmt_pack_buf), &data_len,
+ &complete);
+
+ /* Data receive must be completed */
+ MPIU_Assert(complete == TRUE);
+
+ MPIU_Free(REQ_FIELD(req, lmt_pack_buf));
+
+ complete = 0;
+ mpi_errno = MPIDI_CH3_ReqHandler_PutAccumRespComplete(req->ch.vc, req, &complete); // call MPIDI_CH3U_Request_complete()
+ if (mpi_errno)
+ MPIU_ERR_POP(mpi_errno);
+ MPIU_Assert(complete == TRUE);
+
+ MPID_nem_ib_lmt_send_PKT_LMT_DONE(req->ch.vc, req);
+ MPIDI_CH3U_Request_complete(req);
+ }
+
+ /* decrement the number of entries in IB command queue */
+ vc_ib->ibcom->ncom -= 1;
+ MPID_nem_ib_ncqe -= 1;
+
+ MPIU_Free(req_wrap);
+ }
+ else if (req_type == MPIDI_REQUEST_TYPE_PUT_RESP_DERIVED_DT &&
+ cqe[i].opcode == IBV_WC_RDMA_READ) {
+ MPID_nem_ib_vc_area *vc_ib = VC_IB(req->ch.vc);
+ /* end of packet */
+ if (req_wrap->mf == 0) {
+ MPIDI_msg_sz_t buflen = req->ch.lmt_data_sz;
+ char *buf = (char *) REQ_FIELD(req, lmt_pack_buf);
+ int complete = 0;
+ int dataloop_size = *(int *) req->dev.dtype_info; /* copy from temp store area */
+
+ /* copy all of dtype_info and dataloop */
+ MPIU_Memcpy(req->dev.dtype_info, buf, sizeof(MPIDI_RMA_dtype_info));
+ MPIU_Memcpy(req->dev.dataloop, buf + sizeof(MPIDI_RMA_dtype_info), dataloop_size);
+
+
+ /* All dtype data has been received, call req handler */
+ mpi_errno =
+ MPIDI_CH3_ReqHandler_PutRespDerivedDTComplete(req->ch.vc, req, &complete);
+ MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+ "**ch3|postrecv %s", "MPIDI_CH3_PKT_PUT");
+ /* return 'complete == FALSE' */
+
+ buflen -= (sizeof(MPIDI_RMA_dtype_info) + dataloop_size);
+ buf += (sizeof(MPIDI_RMA_dtype_info) + dataloop_size);
+
+ mpi_errno = MPID_nem_ib_handle_pkt_bh(req->ch.vc, req, buf, buflen);
+ MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER,
+ "**MPID_nem_ib_handle_pkt_bh");
+
+ MPID_nem_ib_lmt_send_PKT_LMT_DONE(req->ch.vc, req);
+
+ MPIU_Free(REQ_FIELD(req, lmt_pack_buf));
+ MPIDI_CH3U_Request_complete(req);
+ }
+
+ /* decrement the number of entries in IB command queue */
+ vc_ib->ibcom->ncom -= 1;
+ MPID_nem_ib_ncqe -= 1;
+
+ MPIU_Free(req_wrap);
+ }
+ else if (req_type == MPIDI_REQUEST_TYPE_ACCUM_RESP && cqe[i].opcode == IBV_WC_RDMA_READ) {
+ MPID_nem_ib_vc_area *vc_ib = VC_IB(req->ch.vc);
+
+ /* end of packet */
+ if (req_wrap->mf == 0) {
+ MPIDI_msg_sz_t data_len = req->ch.lmt_data_sz;
+ int complete = 0;
+ mpi_errno =
+ MPIDI_CH3U_Receive_data_found(req, REQ_FIELD(req, lmt_pack_buf), &data_len,
+ &complete);
+
+ /* Data receive must be completed */
+ MPIU_Assert(complete == TRUE);
+
+ MPIU_Free(REQ_FIELD(req, lmt_pack_buf));
+
+ complete = 0;
+ mpi_errno = MPIDI_CH3_ReqHandler_PutAccumRespComplete(req->ch.vc, req, &complete); // call MPIDI_CH3U_Request_complete()
+ if (mpi_errno)
+ MPIU_ERR_POP(mpi_errno);
+ MPIU_Assert(complete == TRUE);
+
+ MPID_nem_ib_lmt_send_PKT_LMT_DONE(req->ch.vc, req);
+ MPIDI_CH3U_Request_complete(req);
+ }
+
+ /* decrement the number of entries in IB command queue */
+ vc_ib->ibcom->ncom -= 1;
+ MPID_nem_ib_ncqe -= 1;
+
+ MPIU_Free(req_wrap);
+ }
+ else if (req_type == MPIDI_REQUEST_TYPE_ACCUM_RESP_DERIVED_DT &&
+ cqe[i].opcode == IBV_WC_RDMA_READ) {
+ MPID_nem_ib_vc_area *vc_ib = VC_IB(req->ch.vc);
+ /* end of packet */
+ if (req_wrap->mf == 0) {
+ MPIDI_msg_sz_t buflen = req->ch.lmt_data_sz;
+ char *buf = (char *) REQ_FIELD(req, lmt_pack_buf);
+ int complete = 0;
+ int dataloop_size = *(int *) req->dev.dtype_info; /* copy from temp store area */
+
+ /* copy all of dtype_info and dataloop */
+ MPIU_Memcpy(req->dev.dtype_info, buf, sizeof(MPIDI_RMA_dtype_info));
+ MPIU_Memcpy(req->dev.dataloop, buf + sizeof(MPIDI_RMA_dtype_info), dataloop_size);
+
+
+ /* All dtype data has been received, call req handler */
+ mpi_errno =
+ MPIDI_CH3_ReqHandler_AccumRespDerivedDTComplete(req->ch.vc, req, &complete);
+ MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+ "**ch3|postrecv %s", "MPIDI_CH3_ACCUMULATE");
+ /* return 'complete == FALSE' */
+
+ buflen -= (sizeof(MPIDI_RMA_dtype_info) + dataloop_size);
+ buf += (sizeof(MPIDI_RMA_dtype_info) + dataloop_size);
+
+ mpi_errno = MPID_nem_ib_handle_pkt_bh(req->ch.vc, req, buf, buflen);
+ MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER,
+ "**MPID_nem_ib_handle_pkt_bh");
+
+ MPID_nem_ib_lmt_send_PKT_LMT_DONE(req->ch.vc, req);
+
+ MPIU_Free(REQ_FIELD(req, lmt_pack_buf));
+ MPIDI_CH3U_Request_complete(req);
+ }
+
+ /* decrement the number of entries in IB command queue */
+ vc_ib->ibcom->ncom -= 1;
+ MPID_nem_ib_ncqe -= 1;
+
+ MPIU_Free(req_wrap);
+ }
else {
printf("drain_scq,unknown kind=%d,req_type=%d,msg_type=%d\n", kind, req_type, msg_type);
assert(0);
@@ -437,6 +631,71 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
goto fn_exit;
}
+/* bottom part of MPID_nem_handle_pkt() */
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_ib_handle_pkt_bh
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_ib_handle_pkt_bh(MPIDI_VC_t * vc, MPID_Request * req, char *buf, MPIDI_msg_sz_t buflen)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int complete = 0;
+
+ while (buflen && !complete) {
+ MPID_IOV *iov;
+ int n_iov;
+ iov = &req->dev.iov[req->dev.iov_offset];
+ n_iov = req->dev.iov_count;
+
+ while (n_iov && buflen >= iov->MPID_IOV_LEN) {
+ size_t iov_len = iov->MPID_IOV_LEN;
+ MPIU_Memcpy(iov->MPID_IOV_BUF, buf, iov_len);
+
+ buflen -= iov_len;
+ buf += iov_len;
+ --n_iov;
+ ++iov;
+ }
+
+ if (n_iov) {
+ if (buflen > 0) {
+ MPIU_Memcpy(iov->MPID_IOV_BUF, buf, buflen);
+ iov->MPID_IOV_BUF = (void *) ((char *) iov->MPID_IOV_BUF + buflen);
+ iov->MPID_IOV_LEN -= buflen;
+ buflen = 0;
+ }
+
+ req->dev.iov_offset = iov - req->dev.iov;
+ req->dev.iov_count = n_iov;
+ }
+ else {
+ int (*reqFn) (MPIDI_VC_t *, MPID_Request *, int *);
+
+ reqFn = req->dev.OnDataAvail;
+ if (!reqFn) {
+ MPIDI_CH3U_Request_complete(req);
+ complete = TRUE;
+ }
+ else {
+ mpi_errno = reqFn(vc, req, &complete);
+ if (mpi_errno)
+ MPIU_ERR_POP(mpi_errno);
+ }
+
+ if (!complete) {
+ req->dev.iov_offset = 0;
+ MPIU_Assert(req->dev.iov_count > 0 &&
+ req->dev.iov[req->dev.iov_offset].MPID_IOV_LEN > 0);
+ }
+ }
+ }
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_IB_DRAIN_SCQ);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
#undef FUNCNAME
#define FUNCNAME MPID_nem_ib_drain_scq_scratch_pad
#undef FCNAME
@@ -1527,50 +1786,106 @@ int MPID_nem_ib_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPID_Request ** rreqp /* out */)
{
MPID_nem_ib_pkt_prefix_t *netmod_pkt = (MPID_nem_ib_pkt_prefix_t *) pkt;
- MPIDI_CH3_Pkt_put_t *ch3_pkt =
- (MPIDI_CH3_Pkt_put_t *) ((uint8_t *) pkt + sizeof(MPID_nem_ib_pkt_prefix_t));
- MPID_Request *rreq;
- int found;
- int complete;
- char *data_buf;
- MPIDI_msg_sz_t data_len;
+ MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
int mpi_errno = MPI_SUCCESS;
int ibcom_errno;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_PKTHANDLER_PUT);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_PKTHANDLER_PUT);
- /* Update occupation status of local SR (send request) queue */
- MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
- dprintf
- ("MPID_nem_ib_Pkthandler_Put,lsr_seq_num_tail=%d,put_pkt->seq_num_tail=%d\n",
- vc_ib->ibcom->lsr_seq_num_tail, netmod_pkt->seq_num_tail);
- vc_ib->ibcom->lsr_seq_num_tail = netmod_pkt->seq_num_tail;
- dprintf("MPID_nem_ib_Pkthandler_Put,lsr_seq_num_tail updated to %d\n",
- vc_ib->ibcom->lsr_seq_num_tail);
-#ifndef MPID_NEM_IB_DISABLE_VAR_OCC_NOTIFY_RATE
- /* change remote notification policy of RDMA-write-to buf */
- dprintf("pkthandler,put,old rstate=%d\n", vc_ib->ibcom->rdmabuf_occupancy_notify_rstate);
- MPID_nem_ib_change_rdmabuf_occupancy_notify_policy_lw(vc_ib, &vc_ib->ibcom->lsr_seq_num_tail);
- dprintf("pkthandler,put,new rstate=%d\n", vc_ib->ibcom->rdmabuf_occupancy_notify_rstate);
-#endif
- dprintf("pkthandler,put,sendq_empty=%d,ncom=%d,rdmabuf_occ=%d\n",
- MPID_nem_ib_sendq_empty(vc_ib->sendq), vc_ib->ibcom->ncom,
- MPID_nem_ib_diff16(vc_ib->ibcom->sseq_num, vc_ib->ibcom->lsr_seq_num_tail));
- /* try to send from sendq because at least one RDMA-write-to buffer has been released */
- dprintf("pkthandler,put,send_progress\n");
- fflush(stdout);
- MPID_NEM_IB_CHECK_AND_SEND_PROGRESS;
- /* fall back to the original handler */
- /* we don't need to worry about the difference caused by embedding seq_num
- * because size of MPI-header of MPIDI_CH3_PKT_PUT equals to sizeof(MPIDI_CH3_Pkt_t)
- * see MPID_nem_ib_iSendContig
- */
- MPIDI_msg_sz_t ch3_buflen = *buflen - sizeof(MPID_nem_ib_pkt_prefix_t);
- mpi_errno = MPIDI_CH3_PktHandler_Put(vc, (MPIDI_CH3_Pkt_t *) ch3_pkt, &ch3_buflen, rreqp);
- *buflen = ch3_buflen + sizeof(MPID_nem_ib_pkt_prefix_t);
- if (mpi_errno) {
- MPIU_ERR_POP(mpi_errno);
+ MPID_Request *req = NULL;
+ MPIDI_CH3_Pkt_put_t *put_pkt =
+ (MPIDI_CH3_Pkt_put_t *) ((uint8_t *) pkt + sizeof(MPIDI_CH3_Pkt_t));
+ MPID_nem_ib_rma_lmt_cookie_t *s_cookie_buf =
+ (MPID_nem_ib_rma_lmt_cookie_t *) ((uint8_t *) pkt + sizeof(MPIDI_CH3_Pkt_t) +
+ sizeof(MPIDI_CH3_Pkt_t));
+
+ /* ref. MPIDI_CH3_PktHandler_Put (= pktArray[MPIDI_CH3_PKT_PUT]) */
+ MPI_Aint type_size;
+
+ MPID_Win *win_ptr;
+
+ MPIU_Assert(put_pkt->target_win_handle != MPI_WIN_NULL);
+ MPID_Win_get_ptr(put_pkt->target_win_handle, win_ptr);
+ mpi_errno = MPIDI_CH3_Start_rma_op_target(win_ptr, put_pkt->flags);
+
+ req = MPID_Request_create();
+ MPIU_Object_set_ref(req, 1); /* decrement only in drain_scq ? */
+ int incomplete;
+ MPIDI_CH3U_Request_increment_cc(req, &incomplete); // decrement in drain_scq
+
+ req->dev.user_buf = put_pkt->addr;
+ req->dev.user_count = put_pkt->count;
+ req->dev.target_win_handle = put_pkt->target_win_handle;
+ req->dev.source_win_handle = put_pkt->source_win_handle;
+ req->dev.flags = put_pkt->flags;
+
+ if (MPIR_DATATYPE_IS_PREDEFINED(put_pkt->datatype)) {
+ MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_PUT_RESP);
+ req->dev.datatype = put_pkt->datatype;
+
+ MPID_Datatype_get_size_macro(put_pkt->datatype, type_size);
+ req->dev.recv_data_sz = type_size * put_pkt->count;
+ }
+ else {
+ /* derived datatype */
+ MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_PUT_RESP_DERIVED_DT);
+ req->dev.datatype = MPI_DATATYPE_NULL;
+
+ req->dev.dtype_info = (MPIDI_RMA_dtype_info *) MPIU_Malloc(sizeof(MPIDI_RMA_dtype_info));
+ req->dev.dataloop = MPIU_Malloc(put_pkt->dataloop_size);
+
+ /* We have to store the value of 'put_pkt->dataloop_size' which we use in drain_scq.
+ * Temporarily, put it in req->dev.dtype_info.
+ */
+ *(int *) req->dev.dtype_info = put_pkt->dataloop_size;
+ }
+
+ /* ref. pkt_RTS_handler (= pktArray[MPIDI_NEM_PKT_LMT_RTS]) */
+
+ void *write_to_buf;
+
+ req->ch.lmt_data_sz = s_cookie_buf->len;
+ req->ch.lmt_req_id = s_cookie_buf->sender_req_id;
+
+ REQ_FIELD(req, lmt_pack_buf) = MPIU_Malloc((size_t) req->ch.lmt_data_sz);
+ write_to_buf = REQ_FIELD(req, lmt_pack_buf);
+
+ /* stash vc for ib_poll */
+ req->ch.vc = vc;
+
+ REQ_FIELD(req, lmt_tail) = s_cookie_buf->tail;
+
+ /* try to issue RDMA-read command */
+ int slack = 1; /* slack for control packet bringing sequence number */
+ if (MPID_nem_ib_sendq_empty(vc_ib->sendq) &&
+ vc_ib->ibcom->ncom < MPID_NEM_IB_COM_MAX_SQ_CAPACITY - slack &&
+ MPID_nem_ib_ncqe < MPID_NEM_IB_COM_MAX_CQ_CAPACITY - slack) {
+ mpi_errno = MPID_nem_ib_lmt_start_recv_core(req, s_cookie_buf->addr, s_cookie_buf->rkey, write_to_buf); /* fast path not storing raddr and rkey */
+ if (mpi_errno) {
+ MPIU_ERR_POP(mpi_errno);
+ }
+ }
+ else {
+ /* enqueue command into send_queue */
+ dprintf("lmt_start_recv, enqueuing,sendq_empty=%d,ncom=%d,ncqe=%d\n",
+ MPID_nem_ib_sendq_empty(vc_ib->sendq),
+ vc_ib->ibcom->ncom < MPID_NEM_IB_COM_MAX_SQ_CAPACITY,
+ MPID_nem_ib_ncqe < MPID_NEM_IB_COM_MAX_CQ_CAPACITY);
+
+ /* make raddr, (sz is in rreq->ch.lmt_data_sz), rkey, (user_buf is in req->dev.user_buf) survive enqueue, free cookie, dequeue */
+ REQ_FIELD(req, lmt_raddr) = s_cookie_buf->addr;
+ REQ_FIELD(req, lmt_rkey) = s_cookie_buf->rkey;
+ REQ_FIELD(req, lmt_write_to_buf) = write_to_buf;
+
+ /* set for send_progress */
+ MPIDI_Request_set_msg_type(req, MPIDI_REQUEST_RNDV_MSG);
+ req->kind = MPID_REQUEST_RECV;
+
+ MPID_nem_ib_sendq_enqueue(&vc_ib->sendq, req);
}
+ /* prefix + header + data */
+ *buflen =
+ sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPID_nem_ib_rma_lmt_cookie_t);
+ *rreqp = NULL;
+
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_IB_PKTHANDLER_PUT);
return mpi_errno;
@@ -1590,51 +1905,124 @@ int MPID_nem_ib_PktHandler_Accumulate(MPIDI_VC_t * vc,
MPID_Request ** rreqp /* out */)
{
MPID_nem_ib_pkt_prefix_t *netmod_pkt = (MPID_nem_ib_pkt_prefix_t *) pkt;
- MPIDI_CH3_Pkt_accum_t *ch3_pkt =
- (MPIDI_CH3_Pkt_accum_t *) ((uint8_t *) pkt + sizeof(MPID_nem_ib_pkt_prefix_t));
- MPID_Request *rreq;
- int found;
- int complete;
- char *data_buf;
- MPIDI_msg_sz_t data_len;
+ MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
int mpi_errno = MPI_SUCCESS;
int ibcom_errno;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_PKTHANDLER_ACCUMULATE);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_PKTHANDLER_ACCUMULATE);
- /* Update occupation status of local SR (send request) queue */
- MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
- dprintf
- ("MPID_nem_ib_Pkthandler_Accumulate,lsr_seq_num_tail=%d,accum_pkt->seq_num_tail=%d\n",
- vc_ib->ibcom->lsr_seq_num_tail, netmod_pkt->seq_num_tail);
- vc_ib->ibcom->lsr_seq_num_tail = netmod_pkt->seq_num_tail;
- dprintf
- ("MPID_nem_ib_Pkthandler_Accumulate,lsr_seq_num_tail updated to %d\n",
- vc_ib->ibcom->lsr_seq_num_tail);
-#ifndef MPID_NEM_IB_DISABLE_VAR_OCC_NOTIFY_RATE
- /* change remote notification policy of RDMA-write-to buf */
- dprintf("pkthandler,put,old rstate=%d\n", vc_ib->ibcom->rdmabuf_occupancy_notify_rstate);
- MPID_nem_ib_change_rdmabuf_occupancy_notify_policy_lw(vc_ib, &vc_ib->ibcom->lsr_seq_num_tail);
- dprintf("pkthandler,put,new rstate=%d\n", vc_ib->ibcom->rdmabuf_occupancy_notify_rstate);
-#endif
- dprintf("pkthandler,put,sendq_empty=%d,ncom=%d,rdmabuf_occ=%d\n",
- MPID_nem_ib_sendq_empty(vc_ib->sendq), vc_ib->ibcom->ncom,
- MPID_nem_ib_diff16(vc_ib->ibcom->sseq_num, vc_ib->ibcom->lsr_seq_num_tail));
- /* try to send from sendq because at least one RDMA-write-to buffer has been released */
- dprintf("pkthandler,put,send_progress\n");
- fflush(stdout);
- MPID_NEM_IB_CHECK_AND_SEND_PROGRESS
- /* fall back to the original handler */
- /* we don't need to worry about the difference caused by embedding seq_num
- * because size of MPI-header of MPIDI_CH3_PKT_PUT equals to sizeof(MPIDI_CH3_Pkt_t)
- * see MPID_nem_ib_iSendContig
+ MPID_Request *req = NULL;
+ MPIDI_CH3_Pkt_accum_t *accum_pkt =
+ (MPIDI_CH3_Pkt_accum_t *) ((uint8_t *) pkt + sizeof(MPIDI_CH3_Pkt_t));
+ MPID_nem_ib_rma_lmt_cookie_t *s_cookie_buf =
+ (MPID_nem_ib_rma_lmt_cookie_t *) ((uint8_t *) pkt + sizeof(MPIDI_CH3_Pkt_t) +
+ sizeof(MPIDI_CH3_Pkt_t));
+
+ /* ref. MPIDI_CH3_PktHandler_Accumulate */
+ MPI_Aint true_lb, true_extent, extent;
+ int complete = 0;
+ char *data_buf = NULL;
+ MPIDI_msg_sz_t data_len;
+ MPI_Aint type_size;
+ MPID_Win *win_ptr;
+
+ MPIU_Assert(accum_pkt->target_win_handle != MPI_WIN_NULL);
+ MPID_Win_get_ptr(accum_pkt->target_win_handle, win_ptr);
+ mpi_errno = MPIDI_CH3_Start_rma_op_target(win_ptr, accum_pkt->flags);
+
+ req = MPID_Request_create();
+ MPIU_Object_set_ref(req, 1);
+
+ int incomplete;
+ MPIDI_CH3U_Request_increment_cc(req, &incomplete); // decrement in drain_scq
+
+ req->dev.user_count = accum_pkt->count;
+ req->dev.op = accum_pkt->op;
+ req->dev.real_user_buf = accum_pkt->addr;
+ req->dev.target_win_handle = accum_pkt->target_win_handle;
+ req->dev.source_win_handle = accum_pkt->source_win_handle;
+ req->dev.flags = accum_pkt->flags;
+
+ if (accum_pkt->type == MPIDI_CH3_PKT_GET_ACCUM) {
+ req->dev.resp_request_handle = accum_pkt->request_handle;
+ }
+ else {
+ req->dev.resp_request_handle = MPI_REQUEST_NULL;
+ }
+
+ if (MPIR_DATATYPE_IS_PREDEFINED(accum_pkt->datatype)) {
+ MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_ACCUM_RESP);
+ req->dev.datatype = accum_pkt->datatype;
+
+ MPIR_Type_get_true_extent_impl(accum_pkt->datatype, &true_lb, &true_extent);
+ MPID_Datatype_get_extent_macro(accum_pkt->datatype, extent);
+
+ /* Predefined types should always have zero lb */
+ MPIU_Assert(true_lb == 0);
+
+ req->dev.user_buf = MPIU_Malloc(accum_pkt->count * (MPIR_MAX(extent, true_extent)));
+
+ MPID_Datatype_get_size_macro(accum_pkt->datatype, type_size);
+ req->dev.recv_data_sz = type_size * accum_pkt->count;
+ }
+ else {
+ MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_ACCUM_RESP_DERIVED_DT);
+ req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_AccumRespDerivedDTComplete;
+ req->dev.datatype = MPI_DATATYPE_NULL;
+
+ req->dev.dtype_info = (MPIDI_RMA_dtype_info *) MPIU_Malloc(sizeof(MPIDI_RMA_dtype_info));
+ req->dev.dataloop = MPIU_Malloc(accum_pkt->dataloop_size);
+
+ /* We have to store the value of 'put_pkt->dataloop_size' which we use in drain_scq.
+ * Temporarily, put it in req->dev.dtype_info.
*/
- MPIDI_msg_sz_t ch3_buflen = *buflen - sizeof(MPID_nem_ib_pkt_prefix_t);
- mpi_errno =
- MPIDI_CH3_PktHandler_Accumulate(vc, (MPIDI_CH3_Pkt_t *) ch3_pkt, &ch3_buflen, rreqp);
- *buflen = ch3_buflen + sizeof(MPID_nem_ib_pkt_prefix_t);
- if (mpi_errno) {
- MPIU_ERR_POP(mpi_errno);
+ *(int *) req->dev.dtype_info = accum_pkt->dataloop_size;
+ }
+
+ /* ref. pkt_RTS_handler (= pktArray[MPIDI_NEM_PKT_LMT_RTS]) */
+ void *write_to_buf;
+
+ req->ch.lmt_data_sz = s_cookie_buf->len;
+ req->ch.lmt_req_id = s_cookie_buf->sender_req_id;
+
+ REQ_FIELD(req, lmt_pack_buf) = MPIU_Malloc((size_t) req->ch.lmt_data_sz);
+ write_to_buf = REQ_FIELD(req, lmt_pack_buf);
+
+ /* stash vc for ib_poll */
+ req->ch.vc = vc;
+
+ REQ_FIELD(req, lmt_tail) = s_cookie_buf->tail;
+
+ /* try to issue RDMA-read command */
+ int slack = 1; /* slack for control packet bringing sequence number */
+ if (MPID_nem_ib_sendq_empty(vc_ib->sendq) &&
+ vc_ib->ibcom->ncom < MPID_NEM_IB_COM_MAX_SQ_CAPACITY - slack &&
+ MPID_nem_ib_ncqe < MPID_NEM_IB_COM_MAX_CQ_CAPACITY - slack) {
+ mpi_errno = MPID_nem_ib_lmt_start_recv_core(req, s_cookie_buf->addr, s_cookie_buf->rkey, write_to_buf); /* fast path not storing raddr and rkey */
+ if (mpi_errno) {
+ MPIU_ERR_POP(mpi_errno);
+ }
}
+ else {
+ /* enqueue command into send_queue */
+ dprintf("lmt_start_recv, enqueuing,sendq_empty=%d,ncom=%d,ncqe=%d\n",
+ MPID_nem_ib_sendq_empty(vc_ib->sendq),
+ vc_ib->ibcom->ncom < MPID_NEM_IB_COM_MAX_SQ_CAPACITY,
+ MPID_nem_ib_ncqe < MPID_NEM_IB_COM_MAX_CQ_CAPACITY);
+
+ /* make raddr, (sz is in rreq->ch.lmt_data_sz), rkey, (user_buf is in req->dev.user_buf) survive enqueue, free cookie, dequeue */
+ REQ_FIELD(req, lmt_raddr) = s_cookie_buf->addr;
+ REQ_FIELD(req, lmt_rkey) = s_cookie_buf->rkey;
+ REQ_FIELD(req, lmt_write_to_buf) = write_to_buf;
+
+ /* set for send_progress */
+ MPIDI_Request_set_msg_type(req, MPIDI_REQUEST_RNDV_MSG);
+ req->kind = MPID_REQUEST_RECV;
+
+ MPID_nem_ib_sendq_enqueue(&vc_ib->sendq, req);
+ }
+
+ /* prefix + header + data */
+ *buflen =
+ sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPID_nem_ib_rma_lmt_cookie_t);
+ *rreqp = NULL;
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_IB_PKTHANDLER_ACCUMULATE);
@@ -1716,50 +2104,62 @@ int MPID_nem_ib_PktHandler_GetResp(MPIDI_VC_t * vc,
MPID_Request ** rreqp /* out */)
{
MPID_nem_ib_pkt_prefix_t *netmod_pkt = (MPID_nem_ib_pkt_prefix_t *) pkt;
- MPIDI_CH3_Pkt_get_t *ch3_pkt =
- (MPIDI_CH3_Pkt_get_t *) ((uint8_t *) pkt + sizeof(MPID_nem_ib_pkt_prefix_t));
- MPID_Request *rreq;
- int found;
- int complete;
- char *data_buf;
- MPIDI_msg_sz_t data_len;
+ MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
int mpi_errno = MPI_SUCCESS;
int ibcom_errno;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_PKTHANDLER_GETRESP);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_PKTHANDLER_GETRESP);
- /* Update occupation status of local SR (send request) queue */
- MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
- dprintf
- ("MPID_nem_ib_Pkthandler_GetResp,lsr_seq_num_tail=%d,get_pkt->seq_num_tail=%d\n",
- vc_ib->ibcom->lsr_seq_num_tail, netmod_pkt->seq_num_tail);
- vc_ib->ibcom->lsr_seq_num_tail = netmod_pkt->seq_num_tail;
- dprintf
- ("MPID_nem_ib_Pkthandler_GetResp,lsr_seq_num_tail updated to %d\n",
- vc_ib->ibcom->lsr_seq_num_tail);
-#ifndef MPID_NEM_IB_DISABLE_VAR_OCC_NOTIFY_RATE
- /* change remote notification policy of RDMA-write-to buf */
- dprintf("pkthandler,put,old rstate=%d\n", vc_ib->ibcom->rdmabuf_occupancy_notify_rstate);
- MPID_nem_ib_change_rdmabuf_occupancy_notify_policy_lw(vc_ib, &vc_ib->ibcom->lsr_seq_num_tail);
- dprintf("pkthandler,put,new rstate=%d\n", vc_ib->ibcom->rdmabuf_occupancy_notify_rstate);
-#endif
- dprintf("pkthandler,put,sendq_empty=%d,ncom=%d,rdmabuf_occ=%d\n",
- MPID_nem_ib_sendq_empty(vc_ib->sendq), vc_ib->ibcom->ncom,
- MPID_nem_ib_diff16(vc_ib->ibcom->sseq_num, vc_ib->ibcom->lsr_seq_num_tail));
- /* try to send from sendq because at least one RDMA-write-to buffer has been released */
- dprintf("pkthandler,get,send_progress\n");
- fflush(stdout);
- MPID_NEM_IB_SEND_PROGRESS_POLLINGSET
- /* fall back to the original handler */
- /* we don't need to worry about the difference caused by embedding seq_num
- * because size of MPI-header of MPIDI_CH3_PKT_PUT equals to sizeof(MPIDI_CH3_Pkt_t)
- * see MPID_nem_ib_iSendContig
- */
- MPIDI_msg_sz_t ch3_buflen = *buflen - sizeof(MPID_nem_ib_pkt_prefix_t);
- mpi_errno = MPIDI_CH3_PktHandler_GetResp(vc, (MPIDI_CH3_Pkt_t *) ch3_pkt, &ch3_buflen, rreqp);
- *buflen = ch3_buflen + sizeof(MPID_nem_ib_pkt_prefix_t);
- if (mpi_errno) {
- MPIU_ERR_POP(mpi_errno);
+ MPID_Request *req = NULL;
+ MPIDI_CH3_Pkt_get_resp_t *get_resp_pkt =
+ (MPIDI_CH3_Pkt_get_resp_t *) ((uint8_t *) pkt + sizeof(MPIDI_CH3_Pkt_t));
+ MPID_nem_ib_rma_lmt_cookie_t *s_cookie_buf =
+ (MPID_nem_ib_rma_lmt_cookie_t *) ((uint8_t *) pkt + sizeof(MPIDI_CH3_Pkt_t) +
+ sizeof(MPIDI_CH3_Pkt_t));
+ MPID_Request_get_ptr(get_resp_pkt->request_handle, req);
+
+ void *write_to_buf;
+
+ req->ch.lmt_data_sz = s_cookie_buf->len;
+ req->ch.lmt_req_id = s_cookie_buf->sender_req_id;
+
+ REQ_FIELD(req, lmt_pack_buf) = MPIU_Malloc((size_t) req->ch.lmt_data_sz);
+ write_to_buf = REQ_FIELD(req, lmt_pack_buf);
+
+ /* This is magic number to pick up request in drain_scq */
+ MPIDI_Request_set_type(req, 13); // currently Request-type is defined from 1 to 12.
+
+ /* stash vc for ib_poll */
+ req->ch.vc = vc;
+
+ REQ_FIELD(req, lmt_tail) = s_cookie_buf->tail;
+
+ /* try to issue RDMA-read command */
+ int slack = 1; /* slack for control packet bringing sequence number */
+ if (MPID_nem_ib_sendq_empty(vc_ib->sendq) &&
+ vc_ib->ibcom->ncom < MPID_NEM_IB_COM_MAX_SQ_CAPACITY - slack &&
+ MPID_nem_ib_ncqe < MPID_NEM_IB_COM_MAX_CQ_CAPACITY - slack) {
+ mpi_errno = MPID_nem_ib_lmt_start_recv_core(req, s_cookie_buf->addr, s_cookie_buf->rkey, write_to_buf); /* fast path not storing raddr and rkey */
+ if (mpi_errno) {
+ MPIU_ERR_POP(mpi_errno);
+ }
}
+ else {
+ /* enqueue command into send_queue */
+ dprintf("lmt_start_recv, enqueuing,sendq_empty=%d,ncom=%d,ncqe=%d\n",
+ MPID_nem_ib_sendq_empty(vc_ib->sendq),
+ vc_ib->ibcom->ncom < MPID_NEM_IB_COM_MAX_SQ_CAPACITY,
+ MPID_nem_ib_ncqe < MPID_NEM_IB_COM_MAX_CQ_CAPACITY);
+
+ /* make raddr, (sz is in rreq->ch.lmt_data_sz), rkey, (user_buf is in req->dev.user_buf) survive enqueue, free cookie, dequeue */
+ REQ_FIELD(req, lmt_raddr) = s_cookie_buf->addr;
+ REQ_FIELD(req, lmt_rkey) = s_cookie_buf->rkey;
+ REQ_FIELD(req, lmt_write_to_buf) = write_to_buf;
+
+ MPID_nem_ib_sendq_enqueue(&vc_ib->sendq, req);
+ }
+
+ /* prefix + header + data */
+ *buflen =
+ sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPID_nem_ib_rma_lmt_cookie_t);
+ *rreqp = NULL;
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_IB_PKTHANDLER_GETRESP);
@@ -1964,6 +2364,48 @@ int MPID_nem_ib_PktHandler_change_rdmabuf_occupancy_notify_state
goto fn_exit;
}
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_ib_pkt_rma_lmt_getdone
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_ib_pkt_rma_lmt_getdone(MPIDI_VC_t * vc,
+ MPIDI_CH3_Pkt_t * pkt,
+ MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int ibcom_errno;
+ MPID_nem_ib_pkt_lmt_get_done_t *const done_pkt = (MPID_nem_ib_pkt_lmt_get_done_t *) pkt;
+ MPID_Request *req;
+ int req_type;
+
+ *buflen = sizeof(MPIDI_CH3_Pkt_t);
+ MPID_Request_get_ptr(done_pkt->req_id, req);
+
+ MPIU_THREAD_CS_ENTER(LMT,);
+
+ req_type = MPIDI_Request_get_type(req);
+ /* free memory area for cookie */
+ if (!req->ch.s_cookie) {
+ dprintf("lmt_done_send,enter,req->ch.s_cookie is zero");
+ }
+ MPIU_Free(req->ch.s_cookie);
+
+ if ((req_type == 0 && !req->comm) || (req_type == MPIDI_REQUEST_TYPE_GET_RESP)) {
+ if ((*req->cc_ptr == 1) && req->dev.datatype_ptr && (req->dev.segment_size > 0) &&
+ REQ_FIELD(req, lmt_pack_buf)) {
+ MPIU_Free(REQ_FIELD(req, lmt_pack_buf));
+ }
+ }
+ MPIDI_CH3U_Request_complete(req);
+
+ *rreqp = NULL;
+ fn_exit:
+ MPIU_THREAD_CS_EXIT(LMT,);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
#ifdef MPID_NEM_IB_ONDEMAND
#undef FUNCNAME
#define FUNCNAME MPID_nem_ib_cm_drain_scq
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
index 28d9608..50b21eb 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
@@ -154,6 +154,8 @@ static int MPID_nem_ib_iSendContig_core(MPIDI_VC_t * vc, MPID_Request * sreq, vo
MPID_nem_ib_pkt_prefix_t pkt_netmod;
void *prefix;
int sz_prefix;
+ void *s_data;
+ int s_data_sz;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_ISENDCONTIG_CORE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_ISENDCONTIG_CORE);
@@ -215,6 +217,58 @@ static int MPID_nem_ib_iSendContig_core(MPIDI_VC_t * vc, MPID_Request * sreq, vo
sz_prefix = 0;
}
+ s_data = data;
+ s_data_sz = data_sz;
+
+ if (hdr &&
+ ((((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_PUT)
+ || (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_GET_RESP)
+ || (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_ACCUMULATE))) {
+ /* If request length is too long, create LMT packet */
+ if (MPID_NEM_IB_NETMOD_HDR_SIZEOF(vc_ib->ibcom->local_ringbuf_type)
+ + sizeof(MPIDI_CH3_Pkt_t) + data_sz
+ > MPID_NEM_IB_COM_RDMABUF_SZSEG - sizeof(MPID_nem_ib_netmod_trailer_t)) {
+ pkt_netmod.type = MPIDI_NEM_PKT_NETMOD;
+
+ if (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_PUT)
+ pkt_netmod.subtype = MPIDI_NEM_IB_PKT_PUT;
+ else if (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_GET_RESP)
+ pkt_netmod.subtype = MPIDI_NEM_IB_PKT_GET_RESP;
+ else if (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_ACCUMULATE)
+ pkt_netmod.subtype = MPIDI_NEM_IB_PKT_ACCUMULATE;
+
+ void *write_from_buf = data;
+
+ MPID_nem_ib_rma_lmt_cookie_t *s_cookie_buf = (MPID_nem_ib_rma_lmt_cookie_t *) MPIU_Malloc(sizeof(MPID_nem_ib_rma_lmt_cookie_t));
+
+ sreq->ch.s_cookie = s_cookie_buf;
+
+ s_cookie_buf->tail = *((uint8_t *) ((uint8_t *) write_from_buf + data_sz - sizeof(uint8_t)));
+ /* put IB rkey */
+ struct ibv_mr *mr =
+ MPID_nem_ib_com_reg_mr_fetch(write_from_buf, data_sz, 0, MPID_NEM_IB_COM_REG_MR_GLOBAL);
+ MPIU_ERR_CHKANDJUMP(!mr, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_com_reg_mr_fetch");
+#ifdef HAVE_LIBDCFA
+ s_cookie_buf->addr = (void *) mr->host_addr;
+#else
+ s_cookie_buf->addr = write_from_buf;
+#endif
+ s_cookie_buf->rkey = mr->rkey;
+ s_cookie_buf->len = data_sz;
+ s_cookie_buf->sender_req_id = sreq->handle;
+
+ /* set for ib_com_isend */
+ prefix = (void *)&pkt_netmod;
+ sz_prefix = sizeof(MPIDI_CH3_Pkt_t);
+ s_data = (void *)s_cookie_buf;
+ s_data_sz = sizeof(MPID_nem_ib_rma_lmt_cookie_t);
+
+ /* Release Request, when sender receives DONE packet. */
+ int incomplete;
+ MPIDI_CH3U_Request_increment_cc(sreq, &incomplete); // decrement in drain_scq and pkt_rma_lmt_getdone
+ }
+ }
+
/* packet handlers including MPIDI_CH3_PktHandler_EagerSend and MPID_nem_handle_pkt assume this */
hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
@@ -259,7 +313,7 @@ static int MPID_nem_ib_iSendContig_core(MPIDI_VC_t * vc, MPID_Request * sreq, vo
(uint64_t) sreq,
prefix, sz_prefix,
hdr, hdr_sz,
- data, (int) data_sz,
+ s_data, (int) s_data_sz,
&copied,
vc_ib->ibcom->local_ringbuf_type, vc_ib->ibcom->remote_ringbuf->type,
&REQ_FIELD(sreq, buf_from), &REQ_FIELD(sreq, buf_from_sz));
@@ -689,6 +743,15 @@ static int MPID_nem_ib_SendNoncontig_core(MPIDI_VC_t * vc, MPID_Request * sreq,
MPIDI_msg_sz_t last;
MPID_nem_ib_vc_area *vc_ib = VC_IB(vc);
+ void *prefix;
+ int prefix_sz;
+ void *data;
+ int data_sz;
+ MPID_nem_ib_pkt_prefix_t pkt_netmod;
+
+ prefix = NULL;
+ prefix_sz = 0;
+
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_SENDNONCONTIG_CORE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_SENDNONCONTIG_CORE);
@@ -703,6 +766,58 @@ static int MPID_nem_ib_SendNoncontig_core(MPIDI_VC_t * vc, MPID_Request * sreq,
MPIU_Assert(last == sreq->dev.segment_size);
}
+ data = (void *)REQ_FIELD(sreq, lmt_pack_buf);
+ data_sz = last;
+
+ if (hdr &&
+ ((((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_PUT)
+ || (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_GET_RESP)
+ || (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_ACCUMULATE))) {
+ /* If request length is too long, create LMT packet */
+ if ( MPID_NEM_IB_NETMOD_HDR_SIZEOF(vc_ib->ibcom->local_ringbuf_type)
+ + sizeof(MPIDI_CH3_Pkt_t) + sreq->dev.segment_size
+ > MPID_NEM_IB_COM_RDMABUF_SZSEG - sizeof(MPID_nem_ib_netmod_trailer_t)) {
+ pkt_netmod.type = MPIDI_NEM_PKT_NETMOD;
+
+ if (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_PUT)
+ pkt_netmod.subtype = MPIDI_NEM_IB_PKT_PUT;
+ else if (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_GET_RESP)
+ pkt_netmod.subtype = MPIDI_NEM_IB_PKT_GET_RESP;
+ else if (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_ACCUMULATE)
+ pkt_netmod.subtype = MPIDI_NEM_IB_PKT_ACCUMULATE;
+
+ void *write_from_buf = REQ_FIELD(sreq, lmt_pack_buf);
+
+ MPID_nem_ib_rma_lmt_cookie_t *s_cookie_buf = (MPID_nem_ib_rma_lmt_cookie_t *) MPIU_Malloc(sizeof(MPID_nem_ib_rma_lmt_cookie_t));
+
+ sreq->ch.s_cookie = s_cookie_buf;
+
+ s_cookie_buf->tail = *((uint8_t *) ((uint8_t *) write_from_buf + last - sizeof(uint8_t)));
+ /* put IB rkey */
+ struct ibv_mr *mr =
+ MPID_nem_ib_com_reg_mr_fetch(write_from_buf, last, 0, MPID_NEM_IB_COM_REG_MR_GLOBAL);
+ MPIU_ERR_CHKANDJUMP(!mr, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_com_reg_mr_fetch");
+#ifdef HAVE_LIBDCFA
+ s_cookie_buf->addr = (void *) mr->host_addr;
+#else
+ s_cookie_buf->addr = write_from_buf;
+#endif
+ s_cookie_buf->rkey = mr->rkey;
+ s_cookie_buf->len = last;
+ s_cookie_buf->sender_req_id = sreq->handle;
+
+ /* set for ib_com_isend */
+ prefix = (void *)&pkt_netmod;
+ prefix_sz = sizeof(MPIDI_CH3_Pkt_t);
+ data = (void *)s_cookie_buf;
+ data_sz = sizeof(MPID_nem_ib_rma_lmt_cookie_t);
+
+ /* Release Request, when sender receives DONE packet. */
+ int incomplete;
+ MPIDI_CH3U_Request_increment_cc(sreq, &incomplete); // decrement in drain_scq and pkt_rma_lmt_getdone
+ }
+ }
+
/* packet handlers assume this */
hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
@@ -724,9 +839,9 @@ static int MPID_nem_ib_SendNoncontig_core(MPIDI_VC_t * vc, MPID_Request * sreq,
ibcom_errno =
MPID_nem_ib_com_isend(vc_ib->sc->fd,
(uint64_t) sreq,
- NULL, 0,
+ prefix, prefix_sz,
hdr, hdr_sz,
- (void *) REQ_FIELD(sreq, lmt_pack_buf), (int) last,
+ data, data_sz,
&copied,
vc_ib->ibcom->local_ringbuf_type, vc_ib->ibcom->remote_ringbuf->type,
&REQ_FIELD(sreq, buf_from), &REQ_FIELD(sreq, buf_from_sz));
http://git.mpich.org/mpich.git/commitdiff/76e70960dfa6962fcf04bdf187647061c…
commit 76e70960dfa6962fcf04bdf187647061c4e499ee
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Mon Jun 23 10:56:33 2014 +0900
Fix the managment of memory area for small size
In stead of reusing a memory pool when all elements of pool are freed,
reuse a element when it is freed.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_malloc.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_malloc.c
index 9458cb2..ebbfd26 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_malloc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_malloc.c
@@ -48,6 +48,8 @@ struct free_list {
struct free_list *prev;
};
+#define CHUNK (sizeof(struct free_list))
+
static inline void list_init(struct free_list *head)
{
head->next = head;
@@ -192,7 +194,7 @@ static void __init_pool_header(struct pool_info *info, int i, int size)
static void _local_malloc_initialize_hook(void)
{
- int i;
+ int i, j;
char *aligned;
size_t size;
int count;
@@ -229,13 +231,24 @@ static void _local_malloc_initialize_hook(void)
info = (struct pool_info *) aligned;
- if (i <= MMAPED_OFFSET_POW)
+ if (i <= MMAPED_OFFSET_POW) {
__init_pool_header_with_hole(info, i, size);
- else
- __init_pool_header(info, i, size);
- /* add list tail */
- list_add_tail(&(info->list), &arena_flist[i]);
+ int elem = (DEFAULT_POOL_SIZE - (info->hole_num * info->size)) / (CHUNK + info->size);
+ struct free_list *block_head = (struct free_list *) info->next_pos;
+ for (j = 0; j < elem; j++) {
+ if (((size_t) ((char *) block_head + CHUNK) & ((size_t) PAGE_SIZE - 1)) !=
+ MMAPED_OFFSET) {
+ list_add_tail(block_head, &arena_flist[i]);
+ }
+ block_head = (struct free_list *) ((char *) block_head + CHUNK + info->size);
+ }
+ }
+ else {
+ __init_pool_header(info, i, size);
+ /* add list tail */
+ list_add_tail(&(info->list), &arena_flist[i]);
+ }
aligned += size;
}
@@ -245,6 +258,7 @@ static void _local_malloc_initialize_hook(void)
void *malloc(size_t size)
{
+ int i;
int pow;
char *ptr = NULL;
@@ -291,21 +305,39 @@ void *malloc(size_t size)
info = (struct pool_info *) tmp;
- if (pow <= MMAPED_OFFSET_POW)
+ if (pow <= MMAPED_OFFSET_POW) {
__init_pool_header_with_hole(info, pow, alloc_sz);
- else
- __init_pool_header(info, pow, alloc_sz);
- list_add_tail(&(info->list), &arena_flist[pow]);
+ int elem =
+ (DEFAULT_POOL_SIZE - (info->hole_num * info->size)) / (CHUNK + info->size);
+ struct free_list *block_head = (struct free_list *) info->next_pos;
+ for (i = 0; i < elem; i++) {
+ if (((size_t) ((char *) block_head + CHUNK) & ((size_t) PAGE_SIZE - 1)) !=
+ MMAPED_OFFSET) {
+ list_add_tail(block_head, &arena_flist[pow]);
+ }
+ block_head = (struct free_list *) ((char *) block_head + CHUNK + info->size);
+ }
- ptr = info->next_pos;
- info->next_pos += info->size;
+ /* use head elem */
+ struct free_list *info = (struct free_list *) (arena_flist[pow].next);
+ ptr = (char *) info + CHUNK;
+ dprintf("malloc(%lu) [2^%d] ==> USE pool %p\n", size, pow, ptr);
+ list_del(info);
+ }
+ else {
+ __init_pool_header(info, pow, alloc_sz);
+ list_add_tail(&(info->list), &arena_flist[pow]);
- if (pow <= MMAPED_OFFSET_POW)
- info->count++;
+ ptr = info->next_pos;
+ info->next_pos += info->size;
- dprintf("malloc(%lu) [2^%d] ==> CREATE pool %p use = %lu\n", size, pow, ptr,
- NUM_USED(info->next_pos, POOL_ALIGN_SIZE, info->size));
+ if (pow <= MMAPED_OFFSET_POW)
+ info->count++;
+
+ dprintf("malloc(%lu) [2^%d] ==> CREATE pool %p use = %lu\n", size, pow, ptr,
+ NUM_USED(info->next_pos, POOL_ALIGN_SIZE, info->size));
+ }
}
}
else {
@@ -319,7 +351,7 @@ void *malloc(size_t size)
dprintf("malloc(%lu) [2^%d] ==> USE mmaped %p\n", size, pow, ptr);
}
- else {
+ else if (pow > MMAPED_OFFSET_POW) {
struct pool_info *info = (struct pool_info *) (arena_flist[pow].next);
ptr = info->next_pos;
@@ -332,15 +364,12 @@ void *malloc(size_t size)
if (((size_t) info->next_pos & ~(POOL_ALIGN_SIZE - 1)) == (size_t) info->next_pos) {
list_del(&(info->list));
}
- else if (info->pow <= MMAPED_OFFSET_POW) {
- info->count++;
-
- if (info->count == info->num_per_page) {
- info->next_pos += (info->size * info->hole_num);
- info->count = info->hole_num;
- info->free_num += info->hole_num;
- }
- }
+ }
+ else {
+ char *info = (char *) (arena_flist[pow].next);
+ ptr = (char *) info + CHUNK;
+ dprintf("malloc(%lu) [2^%d] ==> USE pool %p\n", size, pow, ptr);
+ list_del((struct free_list *) info);
}
}
@@ -364,28 +393,28 @@ static inline void free_core(void *addr)
struct pool_info *info =
(struct pool_info *) ((size_t) addr & ~((size_t) POOL_ALIGN_SIZE - 1));
- dprintf("free(%p) --> free POOL [2^%d] %lu / %u / %u (use / free / max)\n",
- addr, info->pow,
- NUM_USED(info->next_pos, POOL_ALIGN_SIZE, info->size),
- info->free_num + 1, info->num);
-
- info->free_num++;
- if (info->free_num == info->num) {
- /* intialize for reuse */
- if (info->pow <= MMAPED_OFFSET_POW) {
- info->count = info->hole_num;
- info->free_num = info->hole_num;
- info->next_pos = (char *) info + (info->size * info->hole_num);
- }
- else {
+ if (info->pow <= MMAPED_OFFSET_POW) {
+ struct free_list *block_head = (struct free_list *) ((size_t) addr - CHUNK);
+ list_add_head(block_head, &arena_flist[info->pow]);
+ dprintf("free(%p) --> free BLOCK [2^%d]\n", addr, info->pow);
+ }
+ else {
+ dprintf("free(%p) --> free POOL [2^%d] %lu / %u / %u (use / free / max)\n",
+ addr, info->pow,
+ NUM_USED(info->next_pos, POOL_ALIGN_SIZE, info->size),
+ info->free_num + 1, info->num);
+
+ info->free_num++;
+ if (info->free_num == info->num) {
+ /* intialize for reuse */
info->free_num = 1;
info->next_pos = (char *) info + info->size;
- }
- list_add_tail(&(info->list), &arena_flist[info->pow]);
+ list_add_tail(&(info->list), &arena_flist[info->pow]);
- dprintf(" POOL [2^%d] ALL FREED -> add list [%p]\n", info->pow,
- &arena_flist[info->pow]);
+ dprintf(" POOL [2^%d] ALL FREED -> add list [%p]\n", info->pow,
+ &arena_flist[info->pow]);
+ }
}
}
http://git.mpich.org/mpich.git/commitdiff/51f6709f5422b015910b26bebe651ed83…
commit 51f6709f5422b015910b26bebe651ed835a77f9b
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Thu Jun 19 13:12:04 2014 +0900
Add queue to store outstanding_tx_empty command
When the value of outstanding_connection_tx is not 0, it may not be able
to send a command for reporting outstanding_tx_empty. Therefore, create
a queue and enqueue it, and send it later.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt b/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt
index 210c2a5..9154e1e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt
@@ -8,6 +8,7 @@
**MPID_nem_ib_cm_poll_syn:MPID_nem_ib_cm_poll_syn failed
**MPID_nem_ib_cm_progress:MPID_nem_ib_cm_progress failed
**MPID_nem_ib_cm_send_core:MPID_nem_ib_cm_send_core failed
+**MPID_nem_ib_cm_notify_send:MPID_nem_ib_cm_notify_send failed
**MPID_nem_ib_com_alloc:MPID_nem_ib_com_alloc failed
**MPID_nem_ib_com_cas_scratch_pad:MPID_nem_ib_com_cas_scratch_pad failed
**MPID_nem_ib_com_close:MPID_nem_ib_com_close failed
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
index 74bc2d2..3be6a44 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
@@ -229,7 +229,14 @@ typedef struct {
typedef struct {
MPID_nem_ib_cm_cmd_type_t type;
int initiator_rank;
-} MPID_nem_ib_cm_wr_send_t;
+} MPID_nem_ib_cm_notify_send_t;
+
+typedef struct MPID_nem_ib_cm_notify_send_req {
+ MPID_nem_ib_com_t *ibcom;
+ int my_rank;
+ int pg_rank;
+ struct MPID_nem_ib_cm_notify_send_req *sendq_next;
+} MPID_nem_ib_cm_notify_send_req_t;
#define MPID_NEM_IB_CM_RELEASED ((uint64_t)(-1))
#define MPID_NEM_IB_CM_OFF_SYN (256) /* Align for 256-byte-write PCI command */
@@ -244,6 +251,14 @@ typedef GENERIC_Q_DECL(MPID_nem_ib_cm_req_t) MPID_nem_ib_cm_sendq_t;
#define MPID_nem_ib_cm_sendq_next(ep) ((ep)->sendq_next)
#define MPID_nem_ib_cm_sendq_enqueue(qp, ep) GENERICM_Q_ENQUEUE (qp, ep, MPID_nem_ib_cm_sendq_next_field, sendq_next);
+typedef GENERIC_Q_DECL(MPID_nem_ib_cm_notify_send_req_t) MPID_nem_ib_cm_notify_sendq_t;
+
+#define MPID_nem_ib_cm_notify_sendq_empty(q) GENERICM_Q_EMPTY (q)
+#define MPID_nem_ib_cm_notify_sendq_head(q) GENERICM_Q_HEAD (q)
+#define MPID_nem_ib_cm_notify_sendq_next_field(ep, next_field) ((ep)->next_field)
+#define MPID_nem_ib_cm_notify_sendq_next(ep) ((ep)->sendq_next)
+#define MPID_nem_ib_cm_notify_sendq_enqueue(qp, ep) GENERICM_Q_ENQUEUE (qp, ep, MPID_nem_ib_cm_notify_sendq_next_field, sendq_next);
+
#ifdef HAVE_LIBDCFA
#define MPID_NEM_IB_CM_COMPOSE_NETWORK_INFO_MR_ADDR host_adddr
#else
@@ -336,6 +351,9 @@ static inline void MPID_nem_ib_cm_request_release(MPID_nem_ib_cm_req_t * req)
int MPID_nem_ib_cm_progress(void);
int MPID_nem_ib_cm_release(uint16_t index);
+
+int MPID_nem_ib_cm_notify_send(int pg_rank, int myrank);
+int MPID_nem_ib_cm_notify_progress(void);
#endif
/* Ring buffer protocol
@@ -569,7 +587,6 @@ int MPID_nem_ib_ringbuf_ask_fetch(MPIDI_VC_t * vc);
int MPID_nem_ib_ringbuf_ask_cas_core(MPIDI_VC_t * vc, MPID_nem_ib_ringbuf_cmd_shadow_t * shadow,
uint64_t head);
int MPID_nem_ib_ringbuf_progress(void);
-int MPID_nem_ib_cm_wr_send(int pg_rank, int myrank);
int MPID_nem_ib_ringbuf_alloc(MPIDI_VC_t * vc);
int MPID_nem_ib_ringbuf_free(MPIDI_VC_t * vc);
@@ -630,6 +647,7 @@ extern uint64_t MPID_nem_ib_cm_ringbuf_released[(MPID_NEM_IB_CM_NSEG + 63) / 64]
/* overflow queue when no more slots for responder to write on are available */
extern MPID_nem_ib_cm_sendq_t MPID_nem_ib_cm_sendq;
+extern MPID_nem_ib_cm_notify_sendq_t MPID_nem_ib_cm_notify_sendq;
extern MPID_nem_ib_ringbuf_sendq_t MPID_nem_ib_ringbuf_sendq;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
index 21bd140..1d9fa9d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
@@ -87,11 +87,13 @@ uint16_t MPID_nem_ib_cm_ringbuf_head;
uint16_t MPID_nem_ib_cm_ringbuf_tail;
uint64_t MPID_nem_ib_cm_ringbuf_released[(MPID_NEM_IB_CM_NSEG + 63) / 64];
MPID_nem_ib_cm_sendq_t MPID_nem_ib_cm_sendq = { NULL, NULL };
+MPID_nem_ib_cm_notify_sendq_t MPID_nem_ib_cm_notify_sendq = { NULL, NULL };
int MPID_nem_ib_ncqe_scratch_pad_to_drain;
#endif
MPID_nem_ib_ringbuf_sendq_t MPID_nem_ib_ringbuf_sendq = { NULL, NULL };
+
int MPID_nem_ib_ncqe_scratch_pad;
int MPID_nem_ib_ncqe_to_drain;
int MPID_nem_ib_ncqe_nces;
@@ -493,7 +495,7 @@ int MPID_nem_ib_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_m
for (i = 0; i < MPID_nem_ib_nranks; i++) {
if (i != MPID_nem_ib_myrank) {
for (j = 0; j < MPID_NEM_IB_COM_MAX_RQ_CAPACITY; j++) {
- MPID_nem_ib_com_scratch_pad_recv(MPID_nem_ib_scratch_pad_fds[i], sizeof(MPID_nem_ib_cm_wr_send_t));
+ MPID_nem_ib_com_scratch_pad_recv(MPID_nem_ib_scratch_pad_fds[i], sizeof(MPID_nem_ib_cm_notify_send_t));
}
}
}
@@ -1005,7 +1007,6 @@ int MPID_nem_ib_vc_terminate(MPIDI_VC_t * vc)
int ibcom_errno;
int req_errno = MPI_SUCCESS;
int i;
- int send_empty = 0;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_VC_TERMINATE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_VC_TERMINATE);
@@ -1063,15 +1064,22 @@ int MPID_nem_ib_vc_terminate(MPIDI_VC_t * vc)
}
#endif
-#if 1
- /* Wait until transmission and reception of NOTIFY_OUTSTANDING_TX_COMP are completed. */
- while (1) {
-#else
+#ifdef MPID_NEM_IB_ONDEMAND
+ MPID_nem_ib_cm_notify_send_req_t *req = MPIU_Malloc(sizeof(MPID_nem_ib_cm_notify_send_req_t));
+ req->ibcom = MPID_nem_ib_scratch_pad_ibcoms[vc->pg_rank];
+ req->my_rank = MPID_nem_ib_myrank;
+ req->pg_rank = vc->pg_rank;
+ MPID_nem_ib_cm_notify_sendq_enqueue(&MPID_nem_ib_cm_notify_sendq, req);
+#endif
+
/* Empty sendq */
while (!MPID_nem_ib_sendq_empty(vc_ib->sendq) ||
VC_FIELD(vc, pending_sends) > 0 ||
- MPID_nem_ib_scratch_pad_ibcoms[vc->pg_rank]->outstanding_connection_tx > 0 ||
- MPID_nem_ib_scratch_pad_ibcoms[vc->pg_rank]->incoming_connection_tx > 0) {
+ (MPID_nem_ib_scratch_pad_ibcoms[vc->pg_rank]->notify_outstanding_tx_empty !=
+ NOTIFY_OUTSTANDING_TX_COMP)) {
+#ifdef MPID_NEM_IB_ONDEMAND
+ MPID_nem_ib_cm_notify_progress(); /* progress cm_notify_sendq */
+ MPID_nem_ib_cm_drain_rcq();
#endif
/* mimic ib_poll because vc_terminate might be called from ib_poll_eager */
mpi_errno = MPID_nem_ib_send_progress(vc);
@@ -1087,19 +1095,6 @@ int MPID_nem_ib_vc_terminate(MPIDI_VC_t * vc)
MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_cm_progress");
ibcom_errno = MPID_nem_ib_cm_drain_scq();
MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_cm_drain_scq");
-
- if ((send_empty == 0) &&
- (MPID_nem_ib_scratch_pad_ibcoms[vc->pg_rank]->outstanding_connection_tx == 0)) {
- MPID_nem_ib_cm_wr_send(vc->pg_rank, MPID_nem_ib_myrank);
-
- send_empty = 1;
- }
- MPID_nem_ib_cm_drain_rcq();
-
- if (MPID_nem_ib_scratch_pad_ibcoms[vc->pg_rank]->notify_outstanding_tx_empty ==
- NOTIFY_OUTSTANDING_TX_COMP) {
- break;
- }
#endif
ibcom_errno = MPID_nem_ib_ringbuf_progress();
MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER,
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
index 6cd823c..4d931e6 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
@@ -2369,7 +2369,7 @@ int MPID_nem_ib_cm_drain_rcq(void)
int result;
int i;
struct ibv_wc cqe[MPID_NEM_IB_COM_MAX_CQ_HEIGHT_DRAIN];
- MPID_nem_ib_cm_wr_send_t *shadow_cm;
+ MPID_nem_ib_cm_notify_send_t *shadow_cm;
if (!MPID_nem_ib_rc_shared_rcq_scratch_pad) {
dprintf("cm_drain_rcq,CQ is null\n");
@@ -2410,15 +2410,15 @@ int MPID_nem_ib_cm_drain_rcq(void)
MPID_nem_ib_com_t *ibcom;
dprintf("cm_drain_rcq,notify_outstanding_tx_empty\n");
- shadow_cm = (MPID_nem_ib_cm_wr_send_t *) cqe[i].wr_id;
+ shadow_cm = (MPID_nem_ib_cm_notify_send_t *) cqe[i].wr_id;
initiator_rank = shadow_cm->initiator_rank;
- MPID_nem_ib_rdmawr_from_free(shadow_cm, sizeof(MPID_nem_ib_cm_wr_send_t));
+ MPID_nem_ib_rdmawr_from_free(shadow_cm, sizeof(MPID_nem_ib_cm_notify_send_t));
MPID_nem_ib_com_obtain_pointer(MPID_nem_ib_scratch_pad_fds[initiator_rank], &ibcom);
ibcom->notify_outstanding_tx_empty |= NOTIFY_OUTSTANDING_TX_RCQ;
MPID_nem_ib_com_scratch_pad_recv(MPID_nem_ib_scratch_pad_fds[initiator_rank],
- sizeof(MPID_nem_ib_cm_wr_send_t));
+ sizeof(MPID_nem_ib_cm_notify_send_t));
}
break;
default:
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
index c1b766d..28d9608 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
@@ -1656,6 +1656,95 @@ int MPID_nem_ib_cm_cmd_core(int rank, MPID_nem_ib_cm_cmd_shadow_t * shadow, void
fn_fail:
goto fn_exit;
}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_ib_cm_notify_send
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_ib_cm_notify_send(int pg_rank, int myrank)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int ibcom_errno;
+
+ MPID_nem_ib_cm_cmd_shadow_t *shadow =
+ (MPID_nem_ib_cm_cmd_shadow_t *) MPIU_Malloc(sizeof(MPID_nem_ib_cm_cmd_shadow_t));
+ MPID_nem_ib_cm_notify_send_t *buf_from = (MPID_nem_ib_cm_notify_send_t *)
+ MPID_nem_ib_rdmawr_from_alloc(sizeof(MPID_nem_ib_cm_notify_send_t));
+ MPID_nem_ib_cm_req_t *req = MPIU_Malloc(sizeof(MPID_nem_ib_cm_req_t));
+
+ shadow->type = MPID_NEM_IB_NOTIFY_OUTSTANDING_TX_EMPTY;
+
+ buf_from->type = MPID_NEM_IB_NOTIFY_OUTSTANDING_TX_EMPTY;
+ buf_from->initiator_rank = myrank;
+ shadow->req = req;
+ shadow->buf_from = (void *) buf_from;
+ shadow->buf_from_sz = sizeof(MPID_nem_ib_cm_notify_send_t);
+
+ shadow->req->ibcom = MPID_nem_ib_scratch_pad_ibcoms[pg_rank];
+
+ ibcom_errno =
+ MPID_nem_ib_com_wr_scratch_pad(MPID_nem_ib_scratch_pad_fds[pg_rank],
+ (uint64_t) shadow, shadow->buf_from, shadow->buf_from_sz);
+
+ MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_com_wr_scratch_pad");
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_ib_cm_notify_progress
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_ib_cm_notify_progress(void)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int ibcom_errno;
+ MPID_nem_ib_cm_notify_send_req_t *sreq, *prev_sreq;
+
+ sreq = MPID_nem_ib_cm_notify_sendq_head(MPID_nem_ib_cm_notify_sendq);
+ if (sreq) {
+ prev_sreq = NULL;
+ do {
+ if (sreq->ibcom->outstanding_connection_tx != 0) {
+ goto next;
+ }
+
+ ibcom_errno = MPID_nem_ib_cm_notify_send(sreq->pg_rank, sreq->my_rank);
+ MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_cm_notify_send");
+
+ /* unlink sreq */
+ if (prev_sreq != NULL) {
+ MPID_nem_ib_cm_notify_sendq_next(prev_sreq) = MPID_nem_ib_cm_notify_sendq_next(sreq);
+ }
+ else {
+ MPID_nem_ib_cm_notify_sendq_head(MPID_nem_ib_cm_notify_sendq) =
+ MPID_nem_ib_cm_notify_sendq_next(sreq);
+ }
+ if (MPID_nem_ib_cm_notify_sendq_next(sreq) == NULL) {
+ MPID_nem_ib_cm_notify_sendq.tail = prev_sreq;
+ }
+
+ MPID_nem_ib_cm_notify_send_req_t *tmp_sreq = sreq;
+ sreq = MPID_nem_ib_cm_notify_sendq_next(sreq);
+
+ MPIU_Free(tmp_sreq);
+
+ goto next_unlinked;
+ next:
+ prev_sreq = sreq;
+ sreq = MPID_nem_ib_cm_notify_sendq_next(sreq);
+ next_unlinked:;
+ } while (sreq);
+ }
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
#endif /* MPID_NEM_ONDEMAND */
/* RDMA-read the head pointer of the shared ring buffer */
@@ -1978,40 +2067,3 @@ int MPID_nem_ib_ringbuf_progress()
fn_fail:
goto fn_exit;
}
-
-#undef FUNCNAME
-#define FUNCNAME MPID_nem_ib_cm_wr_send
-#undef FCNAME
-#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_ib_cm_wr_send(int pg_rank, int myrank)
-{
- int mpi_errno = MPI_SUCCESS;
- int ibcom_errno;
-
- MPID_nem_ib_cm_cmd_shadow_t *shadow =
- (MPID_nem_ib_cm_cmd_shadow_t *) MPIU_Malloc(sizeof(MPID_nem_ib_cm_cmd_shadow_t));
- MPID_nem_ib_cm_wr_send_t *buf_from = (MPID_nem_ib_cm_wr_send_t *)
- MPID_nem_ib_rdmawr_from_alloc(sizeof(MPID_nem_ib_cm_wr_send_t));
- MPID_nem_ib_cm_req_t *req = MPIU_Malloc(sizeof(MPID_nem_ib_cm_req_t));
-
- shadow->type = MPID_NEM_IB_NOTIFY_OUTSTANDING_TX_EMPTY;
-
- buf_from->type = MPID_NEM_IB_NOTIFY_OUTSTANDING_TX_EMPTY;
- buf_from->initiator_rank = myrank;
- shadow->req = req;
- shadow->buf_from = (void *) buf_from;
- shadow->buf_from_sz = sizeof(MPID_nem_ib_cm_wr_send_t);
-
- shadow->req->ibcom = MPID_nem_ib_scratch_pad_ibcoms[pg_rank];
-
- ibcom_errno =
- MPID_nem_ib_com_wr_scratch_pad(MPID_nem_ib_scratch_pad_fds[pg_rank],
- (uint64_t) shadow, shadow->buf_from, shadow->buf_from_sz);
-
- MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_com_wr_scratch_pad");
-
- fn_exit:
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
http://git.mpich.org/mpich.git/commitdiff/56a0b44574d7e609bed94047ecfb435b0…
commit 56a0b44574d7e609bed94047ecfb435b0a9e55b3
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Wed Jun 18 11:57:30 2014 +0900
Improve the method of IB-dereg_mr
Create a queue to store memory regions which are possibility of
deregistration. When ibv_post_send fails with ENOMEM, dequeue some
regions from the queu and release release them.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
index a06a8ba..99ba26b 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
@@ -102,7 +102,8 @@ static int MPID_nem_ib_rdmawr_to_init(uint64_t sz)
memset(start, 0, sz);
- MPID_nem_ib_rdmawr_to_alloc_mr = MPID_nem_ib_com_reg_mr_fetch(start, sz, 0);
+ MPID_nem_ib_rdmawr_to_alloc_mr =
+ MPID_nem_ib_com_reg_mr_fetch(start, sz, 0, MPID_NEM_IB_COM_REG_MR_STICKY);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!MPID_nem_ib_rdmawr_to_alloc_mr, -1,
printf("MPID_nem_ib_com_reg_mr_fetchibv_reg_mr failed\n"));
dprintf("rdmawr_to_init,rkey=%08x\n", MPID_nem_ib_rdmawr_to_alloc_mr->rkey);
@@ -808,7 +809,8 @@ int MPID_nem_ib_com_open(int ib_port, int open_flag, int *condesc)
conp->icom_mrlist[MPID_NEM_IB_COM_SCRATCH_PAD_FROM] =
MPID_nem_ib_com_reg_mr_fetch(conp->icom_mem[MPID_NEM_IB_COM_SCRATCH_PAD_FROM],
- conp->icom_msize[MPID_NEM_IB_COM_SCRATCH_PAD_FROM], 0);
+ conp->icom_msize[MPID_NEM_IB_COM_SCRATCH_PAD_FROM], 0,
+ MPID_NEM_IB_COM_REG_MR_STICKY);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!conp->icom_mrlist[MPID_NEM_IB_COM_SCRATCH_PAD_FROM], -1,
printf("ibv_reg_mr failed\n"));
@@ -854,7 +856,8 @@ int MPID_nem_ib_com_open(int ib_port, int open_flag, int *condesc)
conp->icom_mrlist[MPID_NEM_IB_COM_UDWR_FROM] =
MPID_nem_ib_com_reg_mr_fetch(conp->icom_mem[MPID_NEM_IB_COM_UDWR_FROM],
- conp->icom_msize[MPID_NEM_IB_COM_UDWR_FROM], 0);
+ conp->icom_msize[MPID_NEM_IB_COM_UDWR_FROM], 0,
+ MPID_NEM_IB_COM_REG_MR_STICKY);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!conp->icom_mrlist[MPID_NEM_IB_COM_UDWR_FROM], -1,
dprintf("ibv_reg_mr failed with mr_flags=0x%x\n", mr_flags));
@@ -875,7 +878,8 @@ int MPID_nem_ib_com_open(int ib_port, int open_flag, int *condesc)
conp->icom_mrlist[MPID_NEM_IB_COM_UDWR_TO] =
MPID_nem_ib_com_reg_mr_fetch(conp->icom_mem[MPID_NEM_IB_COM_UDWR_TO],
- conp->icom_msize[MPID_NEM_IB_COM_UDWR_TO], 0);
+ conp->icom_msize[MPID_NEM_IB_COM_UDWR_TO], 0,
+ MPID_NEM_IB_COM_REG_MR_STICKY);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!conp->icom_mrlist[MPID_NEM_IB_COM_UDWR_TO], -1,
dprintf("ibv_reg_mr failed with mr_flags=0x%x\n", mr_flags));
@@ -1221,7 +1225,7 @@ int MPID_nem_ib_com_alloc(int condesc, int sz)
conp->icom_mrlist[MPID_NEM_IB_COM_SCRATCH_PAD_TO] =
MPID_nem_ib_com_reg_mr_fetch(conp->icom_mem[MPID_NEM_IB_COM_SCRATCH_PAD_TO],
conp->icom_msize[MPID_NEM_IB_COM_SCRATCH_PAD_TO],
- IBV_ACCESS_REMOTE_ATOMIC);
+ IBV_ACCESS_REMOTE_ATOMIC, MPID_NEM_IB_COM_REG_MR_STICKY);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!conp->icom_mrlist[MPID_NEM_IB_COM_SCRATCH_PAD_TO], -1,
dprintf("ibv_reg_mr failed with mr_flags=0x%x\n", mr_flags));
@@ -1474,7 +1478,8 @@ int MPID_nem_ib_com_isend(int condesc,
if (sz_data) {
//dprintf("MPID_nem_ib_com_isend,data=%p,sz_data=%d\n", data, sz_data);
- struct ibv_mr *mr_data = MPID_nem_ib_com_reg_mr_fetch(data, sz_data, 0);
+ struct ibv_mr *mr_data =
+ MPID_nem_ib_com_reg_mr_fetch(data, sz_data, 0, MPID_NEM_IB_COM_REG_MR_GLOBAL);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!mr_data, -1,
printf("MPID_nem_ib_com_isend,ibv_reg_mr_fetch failed\n"));
#ifdef HAVE_LIBDCFA
@@ -1961,7 +1966,8 @@ int MPID_nem_ib_com_lrecv(int condesc, uint64_t wr_id, void *raddr, long sz_data
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!sz_data, -1, dprintf("MPID_nem_ib_com_lrecv,sz_data==0\n"));
/* register memory area containing data */
- struct ibv_mr *mr_data = MPID_nem_ib_com_reg_mr_fetch(laddr, sz_data, 0);
+ struct ibv_mr *mr_data =
+ MPID_nem_ib_com_reg_mr_fetch(laddr, sz_data, 0, MPID_NEM_IB_COM_REG_MR_GLOBAL);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!mr_data, -1,
dprintf("MPID_nem_ib_com_lrecv,ibv_reg_mr_fetch failed\n"));
@@ -2103,7 +2109,8 @@ int MPID_nem_ib_com_put_lmt(int condesc, uint64_t wr_id, void *raddr, int sz_dat
num_sge = 0;
/* register memory area containing data */
- struct ibv_mr *mr_data = MPID_nem_ib_com_reg_mr_fetch(laddr, sz_data, 0);
+ struct ibv_mr *mr_data =
+ MPID_nem_ib_com_reg_mr_fetch(laddr, sz_data, 0, MPID_NEM_IB_COM_REG_MR_GLOBAL);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!mr_data, -1,
dprintf("MPID_nem_ib_com_put_lmt,ibv_reg_mr_fetch failed\n"));
@@ -2860,6 +2867,7 @@ int MPID_nem_ib_com_reg_mr(void *addr, long len, struct ibv_mr **mr,
enum ibv_access_flags additional_flags)
{
int ibcom_errno = 0;
+ int err = -1;
dprintf("MPID_nem_ib_com_reg_mr,addr=%p,len=%ld,mr=%p\n", addr, len, mr);
*mr =
@@ -2867,7 +2875,12 @@ int MPID_nem_ib_com_reg_mr(void *addr, long len, struct ibv_mr **mr,
IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE |
IBV_ACCESS_REMOTE_READ | additional_flags);
- MPID_NEM_IB_COM_ERR_CHKANDJUMP(*mr == 0, -1,
+ if (*mr == 0) {
+ err = errno; /* copy errno of ibv_reg_mr */
+ }
+
+ /* return the errno of ibv_reg_mr when error occurs */
+ MPID_NEM_IB_COM_ERR_CHKANDJUMP(*mr == 0, err,
dprintf("MPID_nem_ib_com_reg_mr,cannot register memory\n"));
fn_exit:
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
index f7c7ffd..75e3757 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
@@ -570,7 +570,13 @@ extern int MPID_nem_ib_com_mem_udwr_to(int condesc, void **out);
extern int MPID_nem_ib_com_register_cache_init(void);
extern int MPID_nem_ib_com_register_cache_release(void);
extern struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
- enum ibv_access_flags additional_flags);
+ enum ibv_access_flags additional_flags,
+ int mode);
+#define MPID_NEM_IB_COM_REG_MR_GLOBAL (0)
+#define MPID_NEM_IB_COM_REG_MR_STICKY (1)
+
+#define list_entry(ptr, type, member) \
+ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
extern int MPID_nem_ib_com_udbuf_init(void *q);
@@ -703,7 +709,8 @@ static inline void *MPID_nem_ib_rdmawr_from_alloc(uint32_t _sz)
}
((MPID_nem_ib_rdmawr_from_alloc_hdr_t *) q)->mr =
- MPID_nem_ib_com_reg_mr_fetch(q, MPID_NEM_IB_RDMAWR_FROM_ALLOC_SZARENA, 0);
+ MPID_nem_ib_com_reg_mr_fetch(q, MPID_NEM_IB_RDMAWR_FROM_ALLOC_SZARENA, 0,
+ MPID_NEM_IB_COM_REG_MR_STICKY);
if (!((MPID_nem_ib_rdmawr_from_alloc_hdr_t *) q)->mr) {
printf("ibv_reg_mr failed\n");
MPID_nem_ib_segv;
@@ -718,7 +725,8 @@ static inline void *MPID_nem_ib_rdmawr_from_alloc(uint32_t _sz)
1) * MPID_NEM_IB_RDMAWR_FROM_ALLOC_SZARENA;
p += MPID_NEM_IB_RDMAWR_FROM_ALLOC_SZARENA) {
((MPID_nem_ib_rdmawr_from_alloc_hdr_t *) p)->mr =
- MPID_nem_ib_com_reg_mr_fetch(q, MPID_NEM_IB_RDMAWR_FROM_ALLOC_SZARENA, 0);
+ MPID_nem_ib_com_reg_mr_fetch(q, MPID_NEM_IB_RDMAWR_FROM_ALLOC_SZARENA, 0,
+ MPID_NEM_IB_COM_REG_MR_STICKY);
if (!((MPID_nem_ib_rdmawr_from_alloc_hdr_t *) p)->mr) {
printf("ibv_reg_mr failed\n");
MPID_nem_ib_segv;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
index 8c4cbda..cd2980c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
@@ -110,7 +110,8 @@ int MPID_nem_ib_lmt_initiate_lmt(struct MPIDI_VC *vc, union MPIDI_CH3_Pkt *rts_p
#endif
/* put IB rkey */
- struct ibv_mr *mr = MPID_nem_ib_com_reg_mr_fetch(write_from_buf, data_sz, 0);
+ struct ibv_mr *mr =
+ MPID_nem_ib_com_reg_mr_fetch(write_from_buf, data_sz, 0, MPID_NEM_IB_COM_REG_MR_GLOBAL);
MPIU_ERR_CHKANDJUMP(!mr, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_com_reg_mr_fetch");
#ifdef HAVE_LIBDCFA
s_cookie_buf->addr = (void *) mr->host_addr;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c
index f4a930d..7eeabee 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c
@@ -103,6 +103,7 @@ struct MPID_nem_ib_com_reg_mr_cache_entry_t {
/* : public MPID_nem_ib_com_reg_mr_listnode_t */
struct MPID_nem_ib_com_reg_mr_listnode_t *lru_next;
struct MPID_nem_ib_com_reg_mr_listnode_t *lru_prev;
+ struct MPID_nem_ib_com_reg_mr_listnode_t g_lru;
struct ibv_mr *mr;
void *addr;
@@ -110,6 +111,7 @@ struct MPID_nem_ib_com_reg_mr_cache_entry_t {
int refc;
};
+static struct MPID_nem_ib_com_reg_mr_listnode_t MPID_nem_ib_com_reg_mr_global_cache;
static struct MPID_nem_ib_com_reg_mr_listnode_t
MPID_nem_ib_com_reg_mr_cache[MPID_NEM_IB_COM_REG_MR_NLINE];
@@ -166,7 +168,7 @@ static inline void __lru_queue_display()
}
struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
- enum ibv_access_flags additional_flags)
+ enum ibv_access_flags additional_flags, int mode)
{
#if 0 /* debug */
struct ibv_mr *mr;
@@ -184,6 +186,7 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
int ibcom_errno;
int key;
struct MPID_nem_ib_com_reg_mr_cache_entry_t *e;
+ static unsigned long long num_global_cache = 0ULL;
#if 1 /*def HAVE_LIBDCFA */
/* we can't change addr because ibv_post_send assumes mr->host_addr (output of this function)
@@ -220,6 +223,7 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
// miss
+#if 0
// evict an entry and de-register its MR when the cache-set is full
if (way > MPID_NEM_IB_COM_REG_MR_NWAY) {
struct MPID_nem_ib_com_reg_mr_cache_entry_t *victim =
@@ -235,6 +239,7 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
}
afree(victim, MPID_NEM_IB_COM_AALLOC_ID_MRCACHE);
}
+#endif
e = aalloc(sizeof(struct MPID_nem_ib_com_reg_mr_cache_entry_t),
MPID_NEM_IB_COM_AALLOC_ID_MRCACHE);
@@ -245,8 +250,47 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
/* register memory */
ibcom_errno = MPID_nem_ib_com_reg_mr(addr_aligned, len_aligned, &e->mr, additional_flags);
if (ibcom_errno != 0) {
- fprintf(stderr, "mrcache,MPID_nem_ib_com_reg_mr\n");
- goto fn_fail;
+ /* ib_com_reg_mr returns the errno of ibv_reg_mr */
+ if (ibcom_errno == ENOMEM) {
+ /* deregister memory region. The value of 'num_global_cache' means the number of global-cached.
+ * delete 5 percents of global-cached */
+ int i;
+ int del_num = num_global_cache / 20;
+ struct MPID_nem_ib_com_reg_mr_cache_entry_t *victim;
+
+ dprintf("mrcache,MPID_nem_ib_com_reg_mr,ENOMEM,del_num(%d)\n", del_num);
+
+ for (i = 0; i < del_num; i++) {
+ /* get LRU data from MPID_nem_ib_com_reg_mr_global_cache */
+ victim = list_entry(MPID_nem_ib_com_reg_mr_global_cache.lru_prev, struct MPID_nem_ib_com_reg_mr_cache_entry_t, g_lru);
+
+ MPID_nem_ib_com_reg_mr_unlink((struct MPID_nem_ib_com_reg_mr_listnode_t *)victim);
+ MPID_nem_ib_com_reg_mr_unlink(&(victim->g_lru));
+
+ ibcom_errno = MPID_nem_ib_com_dereg_mr(victim->mr);
+ if (ibcom_errno) {
+ printf("mrcache,MPID_nem_ib_com_dereg_mr\n");
+ afree(e, MPID_NEM_IB_COM_AALLOC_ID_MRCACHE);
+ goto fn_fail;
+ }
+ afree(victim, MPID_NEM_IB_COM_AALLOC_ID_MRCACHE);
+ num_global_cache--;
+ }
+
+ /* re-registraion */
+ ibcom_errno = MPID_nem_ib_com_reg_mr(addr_aligned, len_aligned, &e->mr, additional_flags);
+ if (ibcom_errno != 0) {
+ fprintf(stderr, "mrcache,MPID_nem_ib_com_reg_mr,retry,errno=%d\n", ibcom_errno);
+ afree(e, MPID_NEM_IB_COM_AALLOC_ID_MRCACHE);
+ goto fn_fail;
+ }
+ }
+ else {
+ /* errno is not ENOMEM */
+ fprintf(stderr, "mrcache,MPID_nem_ib_com_reg_mr,errno=%d\n", ibcom_errno);
+ afree(e, MPID_NEM_IB_COM_AALLOC_ID_MRCACHE);
+ goto fn_fail;
+ }
}
e->addr = addr_aligned;
e->len = len_aligned;
@@ -257,6 +301,11 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
/* register to cache */
MPID_nem_ib_com_reg_mr_insert(&MPID_nem_ib_com_reg_mr_cache[key],
(struct MPID_nem_ib_com_reg_mr_listnode_t *) e);
+ if (mode != MPID_NEM_IB_COM_REG_MR_STICKY) {
+ /* register to global-cache */
+ num_global_cache++;
+ MPID_nem_ib_com_reg_mr_insert(&MPID_nem_ib_com_reg_mr_global_cache, &(e->g_lru));
+ }
//__lru_queue_display();
@@ -266,7 +315,7 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
/* reference counter is used when evicting entry */
e->refc++;
-#if 0 /* disable for debug */
+#if 1
/* move to head of the list */
if (e !=
(struct MPID_nem_ib_com_reg_mr_cache_entry_t *) MPID_nem_ib_com_reg_mr_cache[key].lru_next)
@@ -276,6 +325,11 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
(struct MPID_nem_ib_com_reg_mr_listnode_t *) e);
}
#endif
+ if (mode != MPID_NEM_IB_COM_REG_MR_STICKY) {
+ /* move to head of the list in global-cache */
+ MPID_nem_ib_com_reg_mr_unlink(&(e->g_lru));
+ MPID_nem_ib_com_reg_mr_insert(&MPID_nem_ib_com_reg_mr_global_cache, &(e->g_lru));
+ }
//dprintf("[MrCache] reuse e=%p,key=%d,mr=%p,refc=%d,addr=%p,len=%ld,lkey=%08x,rkey=%08x\n", e,
//key, e->mr, e->refc, e->mr->addr, e->mr->length, e->mr->lkey, e->mr->rkey);
@@ -318,6 +372,10 @@ int MPID_nem_ib_com_register_cache_init()
MPID_nem_ib_com_reg_mr_cache[i].lru_prev =
(struct MPID_nem_ib_com_reg_mr_listnode_t *) &MPID_nem_ib_com_reg_mr_cache[i];
}
+ MPID_nem_ib_com_reg_mr_global_cache.lru_next =
+ (struct MPID_nem_ib_com_reg_mr_listnode_t *) &MPID_nem_ib_com_reg_mr_global_cache;
+ MPID_nem_ib_com_reg_mr_global_cache.lru_prev =
+ (struct MPID_nem_ib_com_reg_mr_listnode_t *) &MPID_nem_ib_com_reg_mr_global_cache;
dprintf("[MrCache] cache initializes %d entries\n", MPID_NEM_IB_COM_REG_MR_NLINE);
}
http://git.mpich.org/mpich.git/commitdiff/a499ad05e4208b4a76843b79eb726f808…
commit a499ad05e4208b4a76843b79eb726f80862ec97c
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Wed Jun 4 16:50:16 2014 +0900
Fix wrong type casting
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
index 32f46fa..a06a8ba 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
@@ -1969,8 +1969,8 @@ int MPID_nem_ib_com_lrecv(int condesc, uint64_t wr_id, void *raddr, long sz_data
*post_num = 1;
/* Type of max_msg_sz is uint32_t. */
- if ((uint32_t) (sz_data) > conp->icom_pattr.max_msg_sz) {
- *post_num += (uint32_t) (sz_data) / conp->icom_pattr.max_msg_sz;
+ if (sz_data > (long) conp->icom_pattr.max_msg_sz) {
+ *post_num += sz_data / (long)conp->icom_pattr.max_msg_sz;
}
for (i = 0; i < *post_num; i++) {
@@ -1996,10 +1996,10 @@ int MPID_nem_ib_com_lrecv(int condesc, uint64_t wr_id, void *raddr, long sz_data
conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].sg_list[num_sge].addr =
(uint64_t) laddr + (i * conp->icom_pattr.max_msg_sz);
#endif
- if ((uint32_t) sz_data > conp->icom_pattr.max_msg_sz) {
+ if (sz_data > (long) conp->icom_pattr.max_msg_sz) {
if (i == *post_num - 1) {
conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].sg_list[num_sge].length =
- (uint32_t) sz_data - i * conp->icom_pattr.max_msg_sz;
+ (uint32_t) (sz_data - (long) conp->icom_pattr.max_msg_sz * i);
}
else {
conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].sg_list[num_sge].length =
http://git.mpich.org/mpich.git/commitdiff/fded59aee40a99eda9e5a96955751b514…
commit fded59aee40a99eda9e5a96955751b5149c0d1bc
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Tue Jun 3 14:48:04 2014 +0900
Fix the buffer address for send/recv
The data format to transmit or receive may be contiguous and
have the nonzero lower bound.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
index c4e426c..8c4cbda 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
@@ -55,7 +55,7 @@ int MPID_nem_ib_lmt_initiate_lmt(struct MPIDI_VC *vc, union MPIDI_CH3_Pkt *rts_p
//assert(dt_true_lb == 0);
void *write_from_buf;
if (dt_contig) {
- write_from_buf = req->dev.user_buf;
+ write_from_buf = (void *) ((char *) req->dev.user_buf + dt_true_lb);
}
else {
/* see MPIDI_CH3_EagerNoncontigSend (in ch3u_eager.c) */
@@ -232,7 +232,7 @@ int MPID_nem_ib_lmt_start_recv(struct MPIDI_VC *vc, struct MPID_Request *req, MP
void *write_to_buf;
if (dt_contig) {
- write_to_buf = (void *) ((char *) req->dev.user_buf /*+ REQ_FIELD(req, lmt_dt_true_lb) */);
+ write_to_buf = (void *) ((char *) req->dev.user_buf + dt_true_lb);
}
else {
//REQ_FIELD(req, lmt_pack_buf) = MPIU_Malloc((size_t)req->ch.lmt_data_sz);
http://git.mpich.org/mpich.git/commitdiff/3690597fbbf8cf8289530eaa5483967ee…
commit 3690597fbbf8cf8289530eaa5483967eebce2d31
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Tue Jun 3 08:50:38 2014 +0900
Fix data size in a header
It's not necessary to include the size of ib_netmod_trailer_t in data size.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
index c4268bd..32f46fa 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
@@ -1439,8 +1439,7 @@ int MPID_nem_ib_com_isend(int condesc,
uint32_t hdr_ringbuf_type = local_ringbuf_type;
MPID_NEM_IB_NETMOD_HDR_SZ_SET(buf_from,
MPID_NEM_IB_NETMOD_HDR_SIZEOF(local_ringbuf_type) +
- sz_prefix + sz_hdr + sz_data +
- sizeof(MPID_nem_ib_netmod_trailer_t));
+ sz_prefix + sz_hdr + sz_data);
if (remote_ringbuf_type == MPID_NEM_IB_RINGBUF_EXCLUSIVE) {
hdr_ringbuf_type |= MPID_NEM_IB_RINGBUF_RELINDEX;
MPID_NEM_IB_NETMOD_HDR_RELINDEX_SET(buf_from, conp->rsr_seq_num_tail);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
index 1fa2525..6cd823c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
@@ -633,8 +633,7 @@ int MPID_nem_ib_poll_eager(MPID_nem_ib_ringbuf_t * ringbuf)
ssize_t sz_pkt = MPID_NEM_IB_NETMOD_HDR_SIZEOF_GET(buf);
MPIDI_CH3_Pkt_eager_send_t *pkt = (MPIDI_CH3_Pkt_eager_send_t *) ((uint8_t *) buf + sz_pkt);
dprintf("pkt=%p,sizeof=%ld\n", pkt, sz_pkt);
- MPIU_Assert(MPID_NEM_IB_NETMOD_HDR_SZ_GET(buf) >=
- sz_pkt + sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPID_nem_ib_netmod_trailer_t));
+ MPIU_Assert(MPID_NEM_IB_NETMOD_HDR_SZ_GET(buf) >= sz_pkt + sizeof(MPIDI_CH3_Pkt_t));
dprintf
("handle_pkt,before,%d<-%d,id=%d,pkt->type=%d,pcc=%d,MPIDI_CH3_PKT_END_ALL=%d,pkt=%p,subtype=%d\n",
MPID_nem_ib_myrank, vc->pg_rank, *remote_poll, pkt->type,
@@ -643,8 +642,7 @@ int MPID_nem_ib_poll_eager(MPID_nem_ib_ringbuf_t * ringbuf)
/* see MPIDI_CH3_PktHandler_EagerSend (in src/mpid/ch3/src/ch3u_eager.c) */
mpi_errno =
MPID_nem_handle_pkt(vc, (char *) ((uint8_t *) buf + sz_pkt),
- (MPIDI_msg_sz_t) (MPID_NEM_IB_NETMOD_HDR_SZ_GET(buf) -
- sz_pkt - sizeof(MPID_nem_ib_netmod_trailer_t)));
+ (MPIDI_msg_sz_t) (MPID_NEM_IB_NETMOD_HDR_SZ_GET(buf) - sz_pkt));
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
}
@@ -705,8 +703,7 @@ int MPID_nem_ib_poll_eager(MPID_nem_ib_ringbuf_t * ringbuf)
sz_pkt + sizeof(MPIDI_CH3_Pkt_t)));
}
else {
- if (MPID_NEM_IB_NETMOD_HDR_SZ_GET(buf) ==
- sz_pkt + sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPID_nem_ib_netmod_trailer_t)) {
+ if (MPID_NEM_IB_NETMOD_HDR_SZ_GET(buf) == sz_pkt + sizeof(MPIDI_CH3_Pkt_t)) {
if (pkt->type == MPIDI_CH3_PKT_EAGERSHORT_SEND
//|| pkt->type == MPIDI_CH3_PKT_GET
) {
http://git.mpich.org/mpich.git/commitdiff/586e7122784d8f45ea2d6c5fa7df2de2f…
commit 586e7122784d8f45ea2d6c5fa7df2de2f53dfe2a
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Mon Jun 2 10:38:44 2014 +0900
Fix clz after calculating power of two
The value of clz has to be decremented after calculating power of two.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
index 5d988f5..f7c7ffd 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
@@ -648,7 +648,12 @@ typedef struct {
} else { \
clz = __builtin_clz(_sz); \
int ctz = __builtin_ctz(_sz); \
- sz = (clz + ctz == 31) ? _sz : (1ULL << (32 - clz)); \
+ if (clz + ctz == 31) { \
+ sz = _sz; \
+ } else { \
+ sz = (1ULL << (32 - clz)); \
+ clz = clz - 1; \
+ } \
}
static inline void *MPID_nem_ib_rdmawr_from_alloc(uint32_t _sz)
http://git.mpich.org/mpich.git/commitdiff/df39ada6f58aecea6eb36c21521e1ab55…
commit df39ada6f58aecea6eb36c21521e1ab557e365a4
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Fri May 30 17:51:27 2014 +0900
Fix transmission processing of large-message
IB can transmit the size of 'max_msg_sz' at one time. Fragmentation is
required when transmitting a message which exceeds the size of it.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
index 0e4effe..c4268bd 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
@@ -1517,7 +1517,15 @@ int MPID_nem_ib_com_isend(int condesc,
off_pow2_aligned, sz_pad, num_sge);
conp->icom_sr[MPID_NEM_IB_COM_SMT_NOINLINE].num_sge = num_sge;
+#if 1
+ MPID_nem_ib_rc_send_request *wrap_wr_id = MPIU_Malloc(sizeof(MPID_nem_ib_rc_send_request));
+ wrap_wr_id->wr_id = wr_id;
+ wrap_wr_id->mf = 0;
+
+ conp->icom_sr[MPID_NEM_IB_COM_SMT_NOINLINE].wr_id = (uint64_t) wrap_wr_id;
+#else
conp->icom_sr[MPID_NEM_IB_COM_SMT_NOINLINE].wr_id = wr_id;
+#endif
conp->icom_sr[MPID_NEM_IB_COM_SMT_NOINLINE].wr.rdma.remote_addr =
(uint64_t) conp->local_ringbuf_start +
MPID_NEM_IB_COM_RDMABUF_SZSEG * ((uint16_t) (conp->sseq_num % conp->local_ringbuf_nslot));
@@ -1936,29 +1944,101 @@ int MPID_nem_ib_com_udrecv(int condesc)
goto fn_exit;
}
-int MPID_nem_ib_com_lrecv(int condesc, uint64_t wr_id, void *raddr, int sz_data, uint32_t rkey,
- void *laddr)
+int MPID_nem_ib_com_lrecv(int condesc, uint64_t wr_id, void *raddr, long sz_data, uint32_t rkey,
+ void *laddr, int *post_num)
{
MPID_nem_ib_com_t *conp;
int ibcom_errno = 0;
struct ibv_send_wr *bad_wr;
int ib_errno;
- int num_sge;
+ int num_sge = 0;
+ int i;
- dprintf("MPID_nem_ib_com_lrecv,enter,raddr=%p,sz_data=%d,laddr=%p\n", raddr, sz_data, laddr);
+ dprintf("MPID_nem_ib_com_lrecv,enter,raddr=%p,sz_data=%ld,laddr=%p\n", raddr, sz_data, laddr);
MPID_NEM_IB_RANGE_CHECK_WITH_ERROR(condesc, conp);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!conp->icom_connected, -1,
dprintf("MPID_nem_ib_com_lrecv,not connected\n"));
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!sz_data, -1, dprintf("MPID_nem_ib_com_lrecv,sz_data==0\n"));
- num_sge = 0;
-
/* register memory area containing data */
struct ibv_mr *mr_data = MPID_nem_ib_com_reg_mr_fetch(laddr, sz_data, 0);
MPID_NEM_IB_COM_ERR_CHKANDJUMP(!mr_data, -1,
dprintf("MPID_nem_ib_com_lrecv,ibv_reg_mr_fetch failed\n"));
+#if 1
+ *post_num = 1;
+
+ /* Type of max_msg_sz is uint32_t. */
+ if ((uint32_t) (sz_data) > conp->icom_pattr.max_msg_sz) {
+ *post_num += (uint32_t) (sz_data) / conp->icom_pattr.max_msg_sz;
+ }
+
+ for (i = 0; i < *post_num; i++) {
+ MPID_nem_ib_rc_send_request *wrap_wr_id = MPIU_Malloc(sizeof(MPID_nem_ib_rc_send_request));
+ wrap_wr_id->wr_id = wr_id;
+
+ if (i == *post_num - 1)
+ wrap_wr_id->mf = 0; /* end of packet */
+ else
+ wrap_wr_id->mf = 1;
+
+ dprintf("MPID_nem_ib_com_lrecv,mf=%d,post=%d/%d\n", wrap_wr_id->mf, i + 1, *post_num);
+
+ num_sge = 0;
+
+#ifdef HAVE_LIBDCFA
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].sg_list[num_sge].mic_addr =
+ (uint64_t) laddr + (i * conp->icom_pattr.max_msg_sz);
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].sg_list[num_sge].addr =
+ mr_data->host_addr + (i * conp->icom_pattr.max_msg_sz) + ((uint64_t) laddr -
+ (uint64_t) laddr);
+#else
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].sg_list[num_sge].addr =
+ (uint64_t) laddr + (i * conp->icom_pattr.max_msg_sz);
+#endif
+ if ((uint32_t) sz_data > conp->icom_pattr.max_msg_sz) {
+ if (i == *post_num - 1) {
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].sg_list[num_sge].length =
+ (uint32_t) sz_data - i * conp->icom_pattr.max_msg_sz;
+ }
+ else {
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].sg_list[num_sge].length =
+ conp->icom_pattr.max_msg_sz;
+ }
+ }
+ else {
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].sg_list[num_sge].length = sz_data;
+ }
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].sg_list[num_sge].lkey = mr_data->lkey;
+ num_sge += 1;
+
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].num_sge = num_sge;
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].wr_id = (uint64_t) wrap_wr_id;
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].wr.rdma.remote_addr =
+ (uint64_t) raddr + (i * conp->icom_pattr.max_msg_sz);
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR].wr.rdma.rkey = rkey;
+
+#ifdef HAVE_LIBDCFA
+ ib_errno = ibv_post_send(conp->icom_qp, &conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR]);
+ MPID_NEM_IB_COM_ERR_CHKANDJUMP(ib_errno, -1,
+ dprintf("MPID_nem_ib_com_lrecv, ibv_post_send, rc=%d\n",
+ ib_errno));
+#else
+ ib_errno =
+ ibv_post_send(conp->icom_qp, &conp->icom_sr[MPID_NEM_IB_COM_LMT_INITIATOR], &bad_wr);
+ MPID_NEM_IB_COM_ERR_CHKANDJUMP(ib_errno, -1,
+ printf
+ ("MPID_nem_ib_com_lrecv, ibv_post_send, rc=%d, bad_wr=%p\n",
+ ib_errno, bad_wr));
+#endif
+
+ /* other commands can be executed before RDMA-rd command */
+ /* see the "Ordering and the Fence Indicator" section in "InfiniBand Architecture" by William T. Futral */
+
+ conp->ncom += 1;
+ }
+#else
/* Erase magic, super bug!! */
//((MPID_nem_ib_netmod_trailer_t*)(laddr + sz_data - sizeof(MPID_nem_ib_netmod_trailer_t)))->magic = 0;
#ifdef HAVE_LIBDCFA
@@ -1996,6 +2076,7 @@ int MPID_nem_ib_com_lrecv(int condesc, uint64_t wr_id, void *raddr, int sz_data,
conp->after_rdma_rd = 1;
#endif
conp->ncom += 1;
+#endif
fn_exit:
return ibcom_errno;
@@ -2039,7 +2120,15 @@ int MPID_nem_ib_com_put_lmt(int condesc, uint64_t wr_id, void *raddr, int sz_dat
num_sge += 1;
conp->icom_sr[MPID_NEM_IB_COM_LMT_PUT].num_sge = num_sge;
+#if 1
+ MPID_nem_ib_rc_send_request *wrap_wr_id = MPIU_Malloc(sizeof(MPID_nem_ib_rc_send_request));
+ wrap_wr_id->wr_id = wr_id;
+ wrap_wr_id->mf = 0;
+
+ conp->icom_sr[MPID_NEM_IB_COM_LMT_PUT].wr_id = (uint64_t) wrap_wr_id;
+#else
conp->icom_sr[MPID_NEM_IB_COM_LMT_PUT].wr_id = wr_id;
+#endif
conp->icom_sr[MPID_NEM_IB_COM_LMT_PUT].wr.rdma.remote_addr = (uint64_t) raddr;
conp->icom_sr[MPID_NEM_IB_COM_LMT_PUT].wr.rdma.rkey = rkey;
@@ -2768,11 +2857,11 @@ char *MPID_nem_ib_com_strerror(int errno)
goto fn_exit;
}
-int MPID_nem_ib_com_reg_mr(void *addr, int len, struct ibv_mr **mr,
+int MPID_nem_ib_com_reg_mr(void *addr, long len, struct ibv_mr **mr,
enum ibv_access_flags additional_flags)
{
int ibcom_errno = 0;
- dprintf("MPID_nem_ib_com_reg_mr,addr=%p,len=%d,mr=%p\n", addr, len, mr);
+ dprintf("MPID_nem_ib_com_reg_mr,addr=%p,len=%ld,mr=%p\n", addr, len, mr);
*mr =
ibv_reg_mr(ib_pd, addr, len,
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
index 182d39e..5d988f5 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
@@ -353,6 +353,11 @@ typedef struct {
}
MPID_nem_ib_rdmawr_to_alloc_hdr_t;
+typedef struct {
+ uint64_t wr_id; /* address of MPID_Request */
+ int mf; /* more fragment (0 means the end of packet) */
+} MPID_nem_ib_rc_send_request;
+
/* Ring-buffer to which a remote note RDMA-writes */
#define MPID_NEM_IB_NRINGBUF 64
#define MPID_NEM_IB_RINGBUF_NSLOT 16
@@ -533,8 +538,8 @@ extern int MPID_nem_ib_com_irecv(int condesc, uint64_t wr_id);
extern int MPID_nem_ib_com_udsend(int condesc, union ibv_gid *remote_gid, uint16_t remote_lid,
uint32_t remote_qpn, uint32_t imm_data, uint64_t wr_id);
extern int MPID_nem_ib_com_udrecv(int condesc);
-extern int MPID_nem_ib_com_lrecv(int condesc, uint64_t wr_id, void *raddr, int sz_data,
- uint32_t rkey, void *laddr);
+extern int MPID_nem_ib_com_lrecv(int condesc, uint64_t wr_id, void *raddr, long sz_data,
+ uint32_t rkey, void *laddr, int *post_num);
extern int MPID_nem_ib_com_put_lmt(int condesc, uint64_t wr_id, void *raddr, int sz_data,
uint32_t rkey, void *laddr);
extern int MPID_nem_ib_com_scratch_pad_recv(int condesc, int sz_data);
@@ -543,7 +548,7 @@ extern int MPID_nem_ib_com_poll_cq(int which_cq, struct ibv_wc *wc, int *result)
extern int MPID_nem_ib_com_obtain_pointer(int condesc, MPID_nem_ib_com_t ** MPID_nem_ib_com);
/* for ib_reg_mr.c */
-extern int MPID_nem_ib_com_reg_mr(void *addr, int len, struct ibv_mr **mr,
+extern int MPID_nem_ib_com_reg_mr(void *addr, long len, struct ibv_mr **mr,
enum ibv_access_flags additional_flags);
extern int MPID_nem_ib_com_dereg_mr(struct ibv_mr *mr);
@@ -564,7 +569,7 @@ extern int MPID_nem_ib_com_mem_udwr_to(int condesc, void **out);
/* ib_reg_mr.c */
extern int MPID_nem_ib_com_register_cache_init(void);
extern int MPID_nem_ib_com_register_cache_release(void);
-extern struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, int len,
+extern struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
enum ibv_access_flags additional_flags);
extern int MPID_nem_ib_com_udbuf_init(void *q);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
index 123dde4..c4e426c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c
@@ -148,10 +148,19 @@ int MPID_nem_ib_lmt_start_recv_core(struct MPID_Request *req, void *raddr, uint3
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_LMT_START_RECV_CORE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_LMT_START_RECV_CORE);
+#if 1
+ int post_num = 1;
+
+ ibcom_errno =
+ MPID_nem_ib_com_lrecv(vc_ib->sc->fd, (uint64_t) req, raddr, req->ch.lmt_data_sz, rkey,
+ write_to_buf, &post_num);
+ MPID_nem_ib_ncqe += post_num;
+#else
ibcom_errno =
MPID_nem_ib_com_lrecv(vc_ib->sc->fd, (uint64_t) req, raddr, req->ch.lmt_data_sz, rkey,
write_to_buf);
MPID_nem_ib_ncqe += 1;
+#endif
//dprintf("start_recv,ncqe=%d\n", MPID_nem_ib_ncqe);
MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_com_lrecv");
dprintf("lmt_start_recv_core,MPID_nem_ib_ncqe=%d\n", MPID_nem_ib_ncqe);
@@ -163,7 +172,11 @@ int MPID_nem_ib_lmt_start_recv_core(struct MPID_Request *req, void *raddr, uint3
//fflush(stdout);
#ifdef MPID_NEM_IB_LMT_GET_CQE
+#if 1
+ MPID_nem_ib_ncqe_to_drain += post_num; /* use CQE instead of polling */
+#else
MPID_nem_ib_ncqe_to_drain += 1; /* use CQE instead of polling */
+#endif
#else
/* drain_scq and ib_poll is not ordered, so both can decrement ref_count */
MPIR_Request_add_ref(req);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
index fb3141b..1fa2525 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
@@ -100,7 +100,9 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
int req_type, msg_type;
/* Obtain sreq */
- req = (MPID_Request *) cqe[i].wr_id;
+ //req = (MPID_Request *) cqe[i].wr_id;
+ MPID_nem_ib_rc_send_request *req_wrap = (MPID_nem_ib_rc_send_request *) cqe[i].wr_id;
+ req = (MPID_Request *) req_wrap->wr_id;
kind = req->kind;
req_type = MPIDI_Request_get_type(req);
@@ -244,6 +246,7 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
dprintf("drain_scq,eager-send,next\n");
+ MPIU_Free(req_wrap);
}
else if (req_type == MPIDI_REQUEST_TYPE_GET_RESP && msg_type == MPIDI_REQUEST_EAGER_MSG) {
dprintf("drain_scq,GET_RESP,eager,req_type=%d,,comm=%p,opcode=%d\n", req_type,
@@ -294,6 +297,7 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
dprintf("drain_scq,GET_RESP,next\n");
+ MPIU_Free(req_wrap);
}
else if (req_type == MPIDI_REQUEST_TYPE_RECV && msg_type == MPIDI_REQUEST_RNDV_MSG &&
cqe[i].opcode == IBV_WC_RDMA_READ) {
@@ -309,42 +313,45 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
MPID_nem_ib_vc_area *vc_ib = VC_IB(req->ch.vc);
#if defined(MPID_NEM_IB_LMT_GET_CQE)
- /* unpack non-contiguous dt */
- int is_contig;
- MPID_Datatype_is_contig(req->dev.datatype, &is_contig);
- if (!is_contig) {
- dprintf("drain_scq,lmt,GET_CQE,unpack noncontiguous data to user buffer\n");
-
- /* see MPIDI_CH3U_Request_unpack_uebuf (in /src/mpid/ch3/src/ch3u_request.c) */
- /* or MPIDI_CH3U_Receive_data_found (in src/mpid/ch3/src/ch3u_handle_recv_pkt.c) */
- MPIDI_msg_sz_t unpack_sz = req->ch.lmt_data_sz;
- MPID_Segment seg;
- MPI_Aint last;
-
- MPID_Segment_init(req->dev.user_buf, req->dev.user_count, req->dev.datatype, &seg,
- 0);
- last = unpack_sz;
- MPID_Segment_unpack(&seg, 0, &last, REQ_FIELD(req, lmt_pack_buf));
- if (last != unpack_sz) {
- /* --BEGIN ERROR HANDLING-- */
- /* received data was not entirely consumed by unpack()
- * because too few bytes remained to fill the next basic
- * datatype */
- MPIR_STATUS_SET_COUNT(req->status, last);
- req->status.MPI_ERROR =
- MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
- MPI_ERR_TYPE, "**MPID_nem_ib_poll", 0);
- /* --END ERROR HANDLING-- */
+ /* end of packet */
+ if (req_wrap->mf == 0) {
+ /* unpack non-contiguous dt */
+ int is_contig;
+ MPID_Datatype_is_contig(req->dev.datatype, &is_contig);
+ if (!is_contig) {
+ dprintf("drain_scq,lmt,GET_CQE,unpack noncontiguous data to user buffer\n");
+
+ /* see MPIDI_CH3U_Request_unpack_uebuf (in /src/mpid/ch3/src/ch3u_request.c) */
+ /* or MPIDI_CH3U_Receive_data_found (in src/mpid/ch3/src/ch3u_handle_recv_pkt.c) */
+ MPIDI_msg_sz_t unpack_sz = req->ch.lmt_data_sz;
+ MPID_Segment seg;
+ MPI_Aint last;
+
+ MPID_Segment_init(req->dev.user_buf, req->dev.user_count, req->dev.datatype,
+ &seg, 0);
+ last = unpack_sz;
+ MPID_Segment_unpack(&seg, 0, &last, REQ_FIELD(req, lmt_pack_buf));
+ if (last != unpack_sz) {
+ /* --BEGIN ERROR HANDLING-- */
+ /* received data was not entirely consumed by unpack()
+ * because too few bytes remained to fill the next basic
+ * datatype */
+ MPIR_STATUS_SET_COUNT(req->status, last);
+ req->status.MPI_ERROR =
+ MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME,
+ __LINE__, MPI_ERR_TYPE, "**MPID_nem_ib_poll", 0);
+ /* --END ERROR HANDLING-- */
+ }
+ dprintf("drain_scq,lmt,GET_CQE,ref_count=%d,lmt_pack_buf=%p\n", req->ref_count,
+ REQ_FIELD(req, lmt_pack_buf));
+ MPID_nem_ib_stfree(REQ_FIELD(req, lmt_pack_buf), (size_t) req->ch.lmt_data_sz);
}
- dprintf("drain_scq,lmt,GET_CQE,ref_count=%d,lmt_pack_buf=%p\n", req->ref_count,
- REQ_FIELD(req, lmt_pack_buf));
- MPID_nem_ib_stfree(REQ_FIELD(req, lmt_pack_buf), (size_t) req->ch.lmt_data_sz);
- }
- dprintf("drain_scq,lmt,GET_CQE,lmt_send_GET_DONE,rsr_seq_num_tail=%d\n",
- vc_ib->ibcom->rsr_seq_num_tail);
+ dprintf("drain_scq,lmt,GET_CQE,lmt_send_GET_DONE,rsr_seq_num_tail=%d\n",
+ vc_ib->ibcom->rsr_seq_num_tail);
- /* send done to sender. vc is stashed in MPID_nem_ib_lmt_start_recv (in ib_lmt.c) */
- MPID_nem_ib_lmt_send_GET_DONE(req->ch.vc, req);
+ /* send done to sender. vc is stashed in MPID_nem_ib_lmt_start_recv (in ib_lmt.c) */
+ MPID_nem_ib_lmt_send_GET_DONE(req->ch.vc, req);
+ }
#endif
/* unmark "lmt is going on" */
@@ -356,10 +363,12 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
dprintf("drain_scq,rdma-read,ncqe=%d\n", MPID_nem_ib_ncqe);
#ifdef MPID_NEM_IB_LMT_GET_CQE
- dprintf("drain_scq,GET_CQE,Request_complete\n");
- /* mark completion on rreq */
- MPIDI_CH3U_Request_complete(req);
- dprintf("drain_scq,complete,req=%p\n", req);
+ if (req_wrap->mf == 0) {
+ dprintf("drain_scq,GET_CQE,Request_complete\n");
+ /* mark completion on rreq */
+ MPIDI_CH3U_Request_complete(req);
+ dprintf("drain_scq,complete,req=%p\n", req);
+ }
#else /* GET, and !GET_CQE */
int is_contig;
@@ -382,6 +391,8 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
MPID_Request_release(req);
dprintf("drain_scq,relese,req=%p\n", req);
#endif
+ MPIU_Free(req_wrap);
+
/* try to send from sendq */
if (!MPID_nem_ib_sendq_empty(vc_ib->sendq)) {
dprintf("drain_scq,GET,ncom=%d,ncqe=%d,diff=%d\n",
@@ -412,6 +423,7 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
#else
//printf("kind=%d\n", kind);
#endif
+ MPIU_Free(req_wrap);
}
}
if (!dont_call_progress) {
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c
index 61792c1..f4a930d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_reg_mr.c
@@ -106,7 +106,7 @@ struct MPID_nem_ib_com_reg_mr_cache_entry_t {
struct ibv_mr *mr;
void *addr;
- int len;
+ long len;
int refc;
};
@@ -165,7 +165,7 @@ static inline void __lru_queue_display()
}
}
-struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, int len,
+struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, long len,
enum ibv_access_flags additional_flags)
{
#if 0 /* debug */
@@ -189,17 +189,17 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, int len,
/* we can't change addr because ibv_post_send assumes mr->host_addr (output of this function)
* must have an exact mirror value of addr (input of this function) */
void *addr_aligned = addr;
- int len_aligned = len;
+ long len_aligned = len;
#else
void *addr_aligned = (void *) ((unsigned long) addr & ~(MPID_NEM_IB_COM_REG_MR_SZPAGE - 1));
- int len_aligned =
+ long len_aligned =
((((unsigned long) addr + len) - (unsigned long) addr_aligned +
MPID_NEM_IB_COM_REG_MR_SZPAGE - 1) & ~(MPID_NEM_IB_COM_REG_MR_SZPAGE - 1));
#endif
key = MPID_nem_ib_com_hash_func(addr);
dprintf("[MrCache] addr=%p, len=%d\n", addr, len);
- dprintf("[MrCache] aligned addr=%p, len=%d\n", addr_aligned, len_aligned);
+ dprintf("[MrCache] aligned addr=%p, len=%ld\n", addr_aligned, len_aligned);
//__lru_queue_display();
int way = 0;
@@ -241,7 +241,7 @@ struct ibv_mr *MPID_nem_ib_com_reg_mr_fetch(void *addr, int len,
/* reference counter is used when evicting entry */
e->refc = 1;
- dprintf("MPID_nem_ib_com_reg_mr_fetch,miss,addr=%p,len=%d\n", addr_aligned, len_aligned);
+ dprintf("MPID_nem_ib_com_reg_mr_fetch,miss,addr=%p,len=%ld\n", addr_aligned, len_aligned);
/* register memory */
ibcom_errno = MPID_nem_ib_com_reg_mr(addr_aligned, len_aligned, &e->mr, additional_flags);
if (ibcom_errno != 0) {
http://git.mpich.org/mpich.git/commitdiff/2f25f42745d009e86a0eb0c4fe21f04d7…
commit 2f25f42745d009e86a0eb0c4fe21f04d76d7121a
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Fri May 30 09:44:07 2014 +0900
Fix some conditional judgments in ib_drain_scq
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
index ad297aa..fb3141b 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
@@ -135,7 +135,7 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
*/
if (
//req_type == MPIDI_REQUEST_TYPE_SEND
- (req_type == MPIDI_REQUEST_TYPE_SEND ||
+ (req_type == MPIDI_REQUEST_TYPE_SEND || req_type == MPIDI_REQUEST_TYPE_RSEND ||
req_type == MPIDI_REQUEST_TYPE_RECV || req_type == MPIDI_REQUEST_TYPE_SSEND)
&& msg_type == MPIDI_REQUEST_EAGER_MSG) {
dprintf("drain_scq,send/recv,eager,req_type=%d,,comm=%p,opcode=%d\n", req_type,
@@ -174,7 +174,7 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
REQ_FIELD(req, buf_from_sz));
dprintf("drain_scq,eager-send,ncqe=%d\n", MPID_nem_ib_ncqe);
- MPIU_Assert(req->ref_count == 1 || req->ref_count == 2);
+ MPIU_Assert(req->ref_count >= 1 && req->ref_count <= 3);
/* ref_count is decremented in drain_scq and wait */
if (*req->cc_ptr > 0) {
http://git.mpich.org/mpich.git/commitdiff/d5c2a5dab82547764974b27bdb695901f…
commit d5c2a5dab82547764974b27bdb695901f59801f7
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Thu May 29 16:17:14 2014 +0900
Delete some unnecessary increments
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
index 0904b97..c1b766d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
@@ -229,7 +229,7 @@ static int MPID_nem_ib_iSendContig_core(MPIDI_VC_t * vc, MPID_Request * sreq, vo
/* increment cc because PktHandler_EagerSyncAck, ssend.c, drain_scq decrement it */
if (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_EAGER_SYNC_SEND) {
- MPIR_Request_add_ref(sreq);
+ //MPIR_Request_add_ref(sreq);
}
if (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_GET) {
//printf("isendcontig_core,MPIDI_CH3_PKT_GET,ref_count=%d\n", sreq->ref_count);
@@ -708,7 +708,7 @@ static int MPID_nem_ib_SendNoncontig_core(MPIDI_VC_t * vc, MPID_Request * sreq,
/* increment cc because PktHandler_EagerSyncAck, ssend.c, drain_scq decrement it */
if (((MPIDI_CH3_Pkt_t *) hdr)->type == MPIDI_CH3_PKT_EAGER_SYNC_SEND) {
- MPIR_Request_add_ref(sreq);
+ //MPIR_Request_add_ref(sreq);
}
if (sizeof(MPIDI_CH3_Pkt_t) != hdr_sz) {
http://git.mpich.org/mpich.git/commitdiff/5bfff7d3bccfff88d89e4e56565184a8e…
commit 5bfff7d3bccfff88d89e4e56565184a8ebf077b0
Author: Norio Yamaguchi <norio.yamaguchi(a)riken.jp>
Date: Wed May 28 13:49:47 2014 +0900
Add a command to notify of outstanding_tx_empty
Add a command for reporting outstanding_tx is empty. And confirm that
mutual outstanding_tx is empty, before closing a connection.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt b/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt
index 0bfa8ce..210c2a5 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/errnames.txt
@@ -2,6 +2,7 @@
**MPIDI_PG_GetConnKVSname:MPIDI_PG_GetConnKVSname failed
**MPID_nem_ib_cm_cas:MPID_nem_ib_cm_cas failed
**MPID_nem_ib_cm_connect_cas_core:MPID_nem_ib_cm_connect_cas_core failed
+**MPID_nem_ib_cm_drain_rcq:MPID_nem_ib_cm_drain_rcq failed
**MPID_nem_ib_cm_drain_scq:MPID_nem_ib_cm_drain_scq failed
**MPID_nem_ib_cm_poll:MPID_nem_ib_cm_poll failed
**MPID_nem_ib_cm_poll_syn:MPID_nem_ib_cm_poll_syn failed
@@ -30,6 +31,7 @@
**MPID_nem_ib_com_reg_mr_fetch:MPID_nem_ib_com_reg_mr_fetch failed
**MPID_nem_ib_com_rts:MPID_nem_ib_com_rts failed
**MPID_nem_ib_com_sq_occupancy_notify_rate_get:MPID_nem_ib_com_sq_occupancy_notify_rate_get failed
+**MPID_nem_ib_com_wr_scratch_pad:MPID_nem_ib_com_wr_scratch_pad failed
**MPID_nem_ib_drain_scq:MPID_nem_ib_drain_scq failed
**MPID_nem_ib_drain_scq_scratch_pad:MPID_nem_ib_drain_scq_scratch_pad failed
**MPID_nem_ib_kvs_put_binary:MPID_nem_ib_kvs_put_binary failed
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
index 8ff798b..0e4effe 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c
@@ -47,7 +47,7 @@ static struct ibv_cq *MPID_nem_ib_ud_shared_scq;
static int MPID_nem_ib_ud_shared_scq_ref_count;
static struct ibv_cq *MPID_nem_ib_rc_shared_rcq;
static int MPID_nem_ib_rc_shared_rcq_ref_count;
-static struct ibv_cq *MPID_nem_ib_rc_shared_rcq_scratch_pad;
+struct ibv_cq *MPID_nem_ib_rc_shared_rcq_scratch_pad;
static int MPID_nem_ib_rc_shared_rcq_scratch_pad_ref_count;
struct ibv_cq *MPID_nem_ib_ud_shared_rcq;
static int MPID_nem_ib_ud_shared_rcq_ref_count;
@@ -449,8 +449,13 @@ static int MPID_nem_ib_com_clean(MPID_nem_ib_com_t * conp)
MPIU_Free(conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_INITIATOR].sg_list);
MPIU_Free(conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_GET].sg_list);
MPIU_Free(conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_CAS].sg_list);
+ MPIU_Free(conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].sg_list);
#endif
MPIU_Free(conp->icom_sr);
+#ifndef HAVE_LIBDCFA
+ MPIU_Free(conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].sg_list);
+#endif
+ MPIU_Free(conp->icom_rr);
break;
case MPID_NEM_IB_COM_OPEN_UD:
MPIU_Assert(MPID_nem_ib_ud_shared_scq_ref_count > 0);
@@ -1060,6 +1065,44 @@ int MPID_nem_ib_com_open(int ib_port, int open_flag, int *condesc)
conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_CAS].num_sge = 1;
conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_CAS].opcode = IBV_WR_ATOMIC_CMP_AND_SWP;
conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_CAS].send_flags = IBV_SEND_SIGNALED;
+
+#ifdef HAVE_LIBDCFA
+ memset(&(conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].sg_list[0]),
+ 0, sizeof(struct ibv_sge) * WR_SG_NUM);
+#else
+ sge = (struct ibv_sge *) MPIU_Malloc(sizeof(struct ibv_sge));
+ memset(sge, 0, sizeof(struct ibv_sge));
+#endif
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].next = NULL;
+#ifdef HAVE_LIBDCFA
+#else
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].sg_list = sge;
+#endif
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].num_sge = 1;
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].opcode = IBV_WR_SEND;
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].send_flags = IBV_SEND_SIGNALED;
+
+ /* RR (receive request) template */
+ conp->icom_rr =
+ (struct ibv_recv_wr *) MPIU_Malloc(sizeof(struct ibv_recv_wr) *
+ MPID_NEM_IB_COM_SCRATCH_PAD_RR_NTEMPLATE);
+ memset(conp->icom_rr, 0,
+ sizeof(struct ibv_recv_wr) * MPID_NEM_IB_COM_SCRATCH_PAD_RR_NTEMPLATE);
+
+ /* RR (receive request) template for MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER */
+#ifdef HAVE_LIBDCFA
+ memset(&(conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].sg_list[0]), 0,
+ sizeof(struct ibv_sge) * WR_SG_NUM);
+#else
+ sge = (struct ibv_sge *) MPIU_Malloc(sizeof(struct ibv_sge));
+ memset(sge, 0, sizeof(struct ibv_sge));
+#endif
+ conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].next = NULL;
+#ifdef HAVE_LIBDCFA
+#else
+ conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].sg_list = sge;
+#endif
+ conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].num_sge = 1;
break;
}
@@ -2022,6 +2065,49 @@ int MPID_nem_ib_com_put_lmt(int condesc, uint64_t wr_id, void *raddr, int sz_dat
goto fn_exit;
}
+int MPID_nem_ib_com_scratch_pad_recv(int condesc, int sz_data)
+{
+ MPID_nem_ib_com_t *conp;
+ struct ibv_recv_wr *bad_wr;
+ int ibcom_errno = 0, ib_errno;
+
+ MPID_NEM_IB_RANGE_CHECK_WITH_ERROR(condesc, conp);
+
+ void *buf_to = MPID_nem_ib_rdmawr_from_alloc(sz_data);
+ struct ibv_mr *mr_buf_to = MPID_NEM_IB_RDMAWR_FROM_ALLOC_ARENA_MR(buf_to);
+
+ /* Create RR */
+
+#ifdef HAVE_LIBDCFA
+ conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].sg_list[0].mic_addr = (uint64_t) buf_to;
+ conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].sg_list[0].addr =
+ mr_buf_to->host_addr + ((uint64_t) buf_to -
+ (uint64_t) MPID_NEM_IB_RDMAWR_FROM_ALLOC_ARENA_START(buf_to));
+#else
+ conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].sg_list[0].addr = (uint64_t) buf_to;
+#endif
+
+ conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].sg_list[0].length = sz_data;
+ conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].sg_list[0].lkey = mr_buf_to->lkey;
+
+ conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER].wr_id = (uint64_t) buf_to;
+
+ /* Post RR to RQ */
+#ifdef HAVE_LIBDCFA
+ ib_errno = ibv_post_recv(conp->icom_qp, &conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER]);
+#else
+ ib_errno =
+ ibv_post_recv(conp->icom_qp, &conp->icom_rr[MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER],
+ &bad_wr);
+#endif
+ MPID_NEM_IB_COM_ERR_CHKANDJUMP(ib_errno, -1, dprintf("ibv_post_recv ib_errno=%d\n", ib_errno));
+
+ fn_exit:
+ return ibcom_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
int MPID_nem_ib_com_put_scratch_pad(int condesc, uint64_t wr_id, uint64_t offset, int sz,
void *laddr, void **buf_from_out, uint32_t * buf_from_sz_out)
{
@@ -2236,6 +2322,60 @@ int MPID_nem_ib_com_cas_scratch_pad(int condesc,
goto fn_exit;
}
+int MPID_nem_ib_com_wr_scratch_pad(int condesc, uint64_t wr_id,
+ void *buf_from, uint32_t buf_from_sz)
+{
+ MPID_nem_ib_com_t *conp;
+ int ibcom_errno = 0;
+ struct ibv_send_wr *bad_wr;
+ int ib_errno;
+
+ dprintf("MPID_nem_ib_com_wr_scratch_pad,enter,wr_id=%llx,buf=%llx,sz=%d\n",
+ (unsigned long long) wr_id, (unsigned long long) buf_from, buf_from_sz);
+
+ MPID_NEM_IB_RANGE_CHECK_WITH_ERROR(condesc, conp);
+
+ struct ibv_mr *mr_rdmawr_from = MPID_NEM_IB_RDMAWR_FROM_ALLOC_ARENA_MR(buf_from);
+
+#ifdef HAVE_LIBDCFA
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].sg_list[0].mic_addr = (uint64_t) buf_from;
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].sg_list[0].addr =
+ mr_rdmawr_from->host_addr + ((uint64_t) buf_from - (uint64_t) buf_from);
+#else
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].sg_list[0].addr = (uint64_t) buf_from;
+#endif
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].sg_list[0].length = buf_from_sz;
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].sg_list[0].lkey = mr_rdmawr_from->lkey;
+
+ /* num_sge is defined in MPID_nem_ib_com_open */
+ conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].wr_id = wr_id;
+
+ dprintf("MPID_nem_ib_com_wr_scratch_pad,wr.rdma.remote_addr=%llx\n",
+ (unsigned long long) conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR].wr.rdma.remote_addr);
+
+#ifdef HAVE_LIBDCFA
+ ib_errno = ibv_post_send(conp->icom_qp, &conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR]);
+ MPID_NEM_IB_COM_ERR_CHKANDJUMP(ib_errno, -1,
+ dprintf
+ ("MPID_nem_ib_com_wr_scratch_pad, ibv_post_send, rc=%d\n",
+ ib_errno));
+#else
+ ib_errno =
+ ibv_post_send(conp->icom_qp, &conp->icom_sr[MPID_NEM_IB_COM_SCRATCH_PAD_WR], &bad_wr);
+ MPID_NEM_IB_COM_ERR_CHKANDJUMP(ib_errno, -1,
+ dprintf
+ ("MPID_nem_ib_com_wr_scratch_pad, ibv_post_send, rc=%d, bad_wr=%p\n",
+ ib_errno, bad_wr));
+#endif
+
+ conp->ncom_scratch_pad += 1;
+
+ fn_exit:
+ return ibcom_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
/* poll completion queue */
int MPID_nem_ib_com_poll_cq(int which_cq, struct ibv_wc *wc, int *result)
{
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
index ada7053..182d39e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h
@@ -174,6 +174,7 @@ static inline unsigned long long MPID_nem_ib_rdtsc_cpuid(void)
extern struct ibv_cq *MPID_nem_ib_rc_shared_scq;
extern struct ibv_cq *MPID_nem_ib_rc_shared_scq_scratch_pad;
+extern struct ibv_cq *MPID_nem_ib_rc_shared_rcq_scratch_pad;
extern struct ibv_cq *MPID_nem_ib_ud_shared_rcq;
extern uint8_t *MPID_nem_ib_scratch_pad;
extern int MPID_nem_ib_scratch_pad_ref_count;
@@ -270,11 +271,12 @@ extern uint8_t *MPID_nem_ib_rdmawr_to_alloc_free_list;
#define MPID_NEM_IB_COM_UD_INITIATOR 0 /* index to send request template */
#define MPID_NEM_IB_COM_UD_RESPONDER 0 /* index to recv request template */
-#define MPID_NEM_IB_COM_SCRATCH_PAD_SR_NTEMPLATE 3
+#define MPID_NEM_IB_COM_SCRATCH_PAD_SR_NTEMPLATE 4
#define MPID_NEM_IB_COM_SCRATCH_PAD_RR_NTEMPLATE 1
#define MPID_NEM_IB_COM_SCRATCH_PAD_INITIATOR 0 /* index to send request template */
#define MPID_NEM_IB_COM_SCRATCH_PAD_CAS 1
#define MPID_NEM_IB_COM_SCRATCH_PAD_GET 2
+#define MPID_NEM_IB_COM_SCRATCH_PAD_WR 3
#define MPID_NEM_IB_COM_SCRATCH_PAD_RESPONDER 0 /* index to recv request template */
/* Header prepended to the MPI packet */
@@ -485,6 +487,7 @@ typedef struct MPID_nem_ib_com {
* freeing scratch-pad QP. */
int outstanding_connection_tx;
int incoming_connection_tx;
+ int notify_outstanding_tx_empty;
} MPID_nem_ib_com_t;
@@ -522,6 +525,8 @@ extern int MPID_nem_ib_com_get_scratch_pad(int condesc, uint64_t wr_id, uint64_t
extern int MPID_nem_ib_com_cas_scratch_pad(int condesc, uint64_t wr_id, uint64_t offset,
uint64_t compare, uint64_t swap, void **buf_from_out,
uint32_t * buf_from_sz_out);
+extern int MPID_nem_ib_com_wr_scratch_pad(int condesc, uint64_t wr_id,
+ void *buf_from, uint32_t buf_from_sz);
//extern int MPID_nem_ib_com_isend(int condesc, uint64_t wr_id, void* hdr, int sz_hdr, void* data, int sz_data);
extern int MPID_nem_ib_com_irecv(int condesc, uint64_t wr_id);
@@ -532,6 +537,7 @@ extern int MPID_nem_ib_com_lrecv(int condesc, uint64_t wr_id, void *raddr, int s
uint32_t rkey, void *laddr);
extern int MPID_nem_ib_com_put_lmt(int condesc, uint64_t wr_id, void *raddr, int sz_data,
uint32_t rkey, void *laddr);
+extern int MPID_nem_ib_com_scratch_pad_recv(int condesc, int sz_data);
extern int MPID_nem_ib_com_poll_cq(int which_cq, struct ibv_wc *wc, int *result);
extern int MPID_nem_ib_com_obtain_pointer(int condesc, MPID_nem_ib_com_t ** MPID_nem_ib_com);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
index a42df5d..74bc2d2 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h
@@ -126,9 +126,14 @@ enum MPID_nem_ib_cm_cmd_types {
MPID_NEM_IB_RINGBUF_ASK_CAS,
MPID_NEM_IB_CM_CAS_RELEASE,
MPID_NEM_IB_CM_ALREADY_ESTABLISHED,
- MPID_NEM_IB_CM_RESPONDER_IS_CONNECTING
+ MPID_NEM_IB_CM_RESPONDER_IS_CONNECTING,
+ MPID_NEM_IB_NOTIFY_OUTSTANDING_TX_EMPTY
};
+#define NOTIFY_OUTSTANDING_TX_SCQ (1 << 0)
+#define NOTIFY_OUTSTANDING_TX_RCQ (1 << 1)
+#define NOTIFY_OUTSTANDING_TX_COMP (NOTIFY_OUTSTANDING_TX_SCQ | NOTIFY_OUTSTANDING_TX_RCQ)
+
/* Packet types of connection protocol */
struct MPID_nem_ib_cm_req;
@@ -221,6 +226,11 @@ typedef struct {
uint32_t buf_from_sz;
} MPID_nem_ib_cm_cmd_shadow_t;
+typedef struct {
+ MPID_nem_ib_cm_cmd_type_t type;
+ int initiator_rank;
+} MPID_nem_ib_cm_wr_send_t;
+
#define MPID_NEM_IB_CM_RELEASED ((uint64_t)(-1))
#define MPID_NEM_IB_CM_OFF_SYN (256) /* Align for 256-byte-write PCI command */
#define MPID_NEM_IB_CM_OFF_CMD (256*2) /* Align for 256-byte-write PCI command */
@@ -527,6 +537,7 @@ int MPID_nem_ib_poll_eager(MPID_nem_ib_ringbuf_t * ringbuf);
int MPID_nem_ib_ring_alloc(MPIDI_VC_t * vc);
int MPID_nem_ib_cm_drain_scq(void);
+int MPID_nem_ib_cm_drain_rcq(void);
int MPID_nem_ib_cm_poll_syn(void);
int MPID_nem_ib_cm_poll(void);
@@ -558,6 +569,7 @@ int MPID_nem_ib_ringbuf_ask_fetch(MPIDI_VC_t * vc);
int MPID_nem_ib_ringbuf_ask_cas_core(MPIDI_VC_t * vc, MPID_nem_ib_ringbuf_cmd_shadow_t * shadow,
uint64_t head);
int MPID_nem_ib_ringbuf_progress(void);
+int MPID_nem_ib_cm_wr_send(int pg_rank, int myrank);
int MPID_nem_ib_ringbuf_alloc(MPIDI_VC_t * vc);
int MPID_nem_ib_ringbuf_free(MPIDI_VC_t * vc);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
index cc64921..21bd140 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c
@@ -488,6 +488,16 @@ int MPID_nem_ib_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_m
MPID_nem_ib_nranks * sizeof(MPID_nem_ib_conn_t), mpi_errno,
"connection table");
memset(MPID_nem_ib_conns, 0, MPID_nem_ib_nranks * sizeof(MPID_nem_ib_conn_t));
+
+ /* post receive request */
+ for (i = 0; i < MPID_nem_ib_nranks; i++) {
+ if (i != MPID_nem_ib_myrank) {
+ for (j = 0; j < MPID_NEM_IB_COM_MAX_RQ_CAPACITY; j++) {
+ MPID_nem_ib_com_scratch_pad_recv(MPID_nem_ib_scratch_pad_fds[i], sizeof(MPID_nem_ib_cm_wr_send_t));
+ }
+ }
+ }
+
#if 0
MPIU_CHKPMEM_MALLOC(MPID_nem_ib_pollingset, MPIDI_VC_t **,
MPID_NEM_IB_MAX_POLLINGSET * sizeof(MPIDI_VC_t *), mpi_errno,
@@ -995,6 +1005,7 @@ int MPID_nem_ib_vc_terminate(MPIDI_VC_t * vc)
int ibcom_errno;
int req_errno = MPI_SUCCESS;
int i;
+ int send_empty = 0;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_IB_VC_TERMINATE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_IB_VC_TERMINATE);
@@ -1052,11 +1063,16 @@ int MPID_nem_ib_vc_terminate(MPIDI_VC_t * vc)
}
#endif
+#if 1
+ /* Wait until transmission and reception of NOTIFY_OUTSTANDING_TX_COMP are completed. */
+ while (1) {
+#else
/* Empty sendq */
while (!MPID_nem_ib_sendq_empty(vc_ib->sendq) ||
VC_FIELD(vc, pending_sends) > 0 ||
MPID_nem_ib_scratch_pad_ibcoms[vc->pg_rank]->outstanding_connection_tx > 0 ||
MPID_nem_ib_scratch_pad_ibcoms[vc->pg_rank]->incoming_connection_tx > 0) {
+#endif
/* mimic ib_poll because vc_terminate might be called from ib_poll_eager */
mpi_errno = MPID_nem_ib_send_progress(vc);
MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_send_progress");
@@ -1071,6 +1087,19 @@ int MPID_nem_ib_vc_terminate(MPIDI_VC_t * vc)
MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_cm_progress");
ibcom_errno = MPID_nem_ib_cm_drain_scq();
MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_cm_drain_scq");
+
+ if ((send_empty == 0) &&
+ (MPID_nem_ib_scratch_pad_ibcoms[vc->pg_rank]->outstanding_connection_tx == 0)) {
+ MPID_nem_ib_cm_wr_send(vc->pg_rank, MPID_nem_ib_myrank);
+
+ send_empty = 1;
+ }
+ MPID_nem_ib_cm_drain_rcq();
+
+ if (MPID_nem_ib_scratch_pad_ibcoms[vc->pg_rank]->notify_outstanding_tx_empty ==
+ NOTIFY_OUTSTANDING_TX_COMP) {
+ break;
+ }
#endif
ibcom_errno = MPID_nem_ib_ringbuf_progress();
MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER,
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
index a7858d7..ad297aa 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c
@@ -2327,6 +2327,13 @@ int MPID_nem_ib_cm_drain_scq()
MPIU_Free(shadow_ringbuf);
break;
}
+ case MPID_NEM_IB_NOTIFY_OUTSTANDING_TX_EMPTY:
+ shadow_cm = (MPID_nem_ib_cm_cmd_shadow_t *) cqe[i].wr_id;
+ shadow_cm->req->ibcom->notify_outstanding_tx_empty |= NOTIFY_OUTSTANDING_TX_SCQ;
+ MPID_nem_ib_rdmawr_from_free(shadow_cm->buf_from, shadow_cm->buf_from_sz);
+ MPIU_Free(shadow_cm->req);
+ MPIU_Free(shadow_cm);
+ break;
default:
printf("unknown type=%d\n", *type);
MPIU_ERR_CHKANDJUMP(1, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_cm_drain_scq");
@@ -2347,6 +2354,77 @@ int MPID_nem_ib_cm_drain_scq()
goto fn_exit;
}
+int MPID_nem_ib_cm_drain_rcq(void)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int result;
+ int i;
+ struct ibv_wc cqe[MPID_NEM_IB_COM_MAX_CQ_HEIGHT_DRAIN];
+ MPID_nem_ib_cm_wr_send_t *shadow_cm;
+
+ if (!MPID_nem_ib_rc_shared_rcq_scratch_pad) {
+ dprintf("cm_drain_rcq,CQ is null\n");
+ goto fn_exit;
+ }
+
+ result =
+ ibv_poll_cq(MPID_nem_ib_rc_shared_rcq_scratch_pad, MPID_NEM_IB_COM_MAX_CQ_HEIGHT_DRAIN,
+ &cqe[0]);
+ MPIU_ERR_CHKANDJUMP(result < 0, mpi_errno, MPI_ERR_OTHER, "**netmod,ib,ibv_poll_cq");
+
+ if (result > 0) {
+ dprintf("cm_drain_rcq,found,result=%d\n", result);
+ }
+ for (i = 0; i < result; i++) {
+
+ dprintf("cm_drain_rcq,wr_id=%p\n", (void *) cqe[i].wr_id);
+
+#ifdef HAVE_LIBDCFA
+ if (cqe[i].status != IBV_WC_SUCCESS) {
+ dprintf("cm_drain_rcq,status=%08x\n", cqe[i].status);
+ MPID_nem_ib_segv;
+ }
+#else
+ if (cqe[i].status != IBV_WC_SUCCESS) {
+ dprintf("cm_drain_rcq,status=%08x,%s\n", cqe[i].status,
+ ibv_wc_status_str(cqe[i].status));
+ MPID_nem_ib_segv;
+ }
+#endif
+ MPIU_ERR_CHKANDJUMP(cqe[i].status != IBV_WC_SUCCESS, mpi_errno, MPI_ERR_OTHER,
+ "**MPID_nem_ib_cm_drain_rcq");
+
+ MPID_nem_ib_cm_cmd_type_t *type = (MPID_nem_ib_cm_cmd_type_t *) cqe[i].wr_id;
+ switch (*type) {
+ case MPID_NEM_IB_NOTIFY_OUTSTANDING_TX_EMPTY:{
+ int initiator_rank;
+ MPID_nem_ib_com_t *ibcom;
+
+ dprintf("cm_drain_rcq,notify_outstanding_tx_empty\n");
+ shadow_cm = (MPID_nem_ib_cm_wr_send_t *) cqe[i].wr_id;
+ initiator_rank = shadow_cm->initiator_rank;
+
+ MPID_nem_ib_rdmawr_from_free(shadow_cm, sizeof(MPID_nem_ib_cm_wr_send_t));
+
+ MPID_nem_ib_com_obtain_pointer(MPID_nem_ib_scratch_pad_fds[initiator_rank], &ibcom);
+ ibcom->notify_outstanding_tx_empty |= NOTIFY_OUTSTANDING_TX_RCQ;
+ MPID_nem_ib_com_scratch_pad_recv(MPID_nem_ib_scratch_pad_fds[initiator_rank],
+ sizeof(MPID_nem_ib_cm_wr_send_t));
+ }
+ break;
+ default:
+ printf("unknown type=%d\n", *type);
+ MPIU_ERR_CHKANDJUMP(1, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_cm_drain_rcq");
+ break;
+ }
+ }
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
#undef FUNCNAME
#define FUNCNAME MPID_nem_ib_cm_poll_syn
#undef FCNAME
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
index 1932198..0904b97 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c
@@ -1978,3 +1978,40 @@ int MPID_nem_ib_ringbuf_progress()
fn_fail:
goto fn_exit;
}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_ib_cm_wr_send
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_ib_cm_wr_send(int pg_rank, int myrank)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int ibcom_errno;
+
+ MPID_nem_ib_cm_cmd_shadow_t *shadow =
+ (MPID_nem_ib_cm_cmd_shadow_t *) MPIU_Malloc(sizeof(MPID_nem_ib_cm_cmd_shadow_t));
+ MPID_nem_ib_cm_wr_send_t *buf_from = (MPID_nem_ib_cm_wr_send_t *)
+ MPID_nem_ib_rdmawr_from_alloc(sizeof(MPID_nem_ib_cm_wr_send_t));
+ MPID_nem_ib_cm_req_t *req = MPIU_Malloc(sizeof(MPID_nem_ib_cm_req_t));
+
+ shadow->type = MPID_NEM_IB_NOTIFY_OUTSTANDING_TX_EMPTY;
+
+ buf_from->type = MPID_NEM_IB_NOTIFY_OUTSTANDING_TX_EMPTY;
+ buf_from->initiator_rank = myrank;
+ shadow->req = req;
+ shadow->buf_from = (void *) buf_from;
+ shadow->buf_from_sz = sizeof(MPID_nem_ib_cm_wr_send_t);
+
+ shadow->req->ibcom = MPID_nem_ib_scratch_pad_ibcoms[pg_rank];
+
+ ibcom_errno =
+ MPID_nem_ib_com_wr_scratch_pad(MPID_nem_ib_scratch_pad_fds[pg_rank],
+ (uint64_t) shadow, shadow->buf_from, shadow->buf_from_sz);
+
+ MPIU_ERR_CHKANDJUMP(ibcom_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_com_wr_scratch_pad");
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
-----------------------------------------------------------------------
Summary of changes:
.../ch3/channels/nemesis/netmod/ib/errnames.txt | 4 +
.../ch3/channels/nemesis/netmod/ib/ib_finalize.c | 2 +
src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.c | 306 ++++++-
src/mpid/ch3/channels/nemesis/netmod/ib/ib_ibcom.h | 46 +-
src/mpid/ch3/channels/nemesis/netmod/ib/ib_impl.h | 82 ++-
src/mpid/ch3/channels/nemesis/netmod/ib/ib_init.c | 52 +-
src/mpid/ch3/channels/nemesis/netmod/ib/ib_lmt.c | 31 +-
.../ch3/channels/nemesis/netmod/ib/ib_malloc.c | 121 ++-
src/mpid/ch3/channels/nemesis/netmod/ib/ib_poll.c | 934 +++++++++++++++-----
.../ch3/channels/nemesis/netmod/ib/ib_reg_mr.c | 88 ++-
src/mpid/ch3/channels/nemesis/netmod/ib/ib_send.c | 247 +++++-
11 files changed, 1538 insertions(+), 375 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.2-19-g522c268
by noreply@mpich.org 30 Jul '14
by noreply@mpich.org 30 Jul '14
30 Jul '14
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 522c26881144def06dec5b52bde6f583073df0a9 (commit)
from b76ebc6f2820d2d0a194abc8e2da3dab080bbea2 (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/522c26881144def06dec5b52bde6f5830…
commit 522c26881144def06dec5b52bde6f583073df0a9
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Sat Jul 26 18:42:07 2014 -0500
Change default values of CVARs in RMA code.
Change default values of MPIR_CVAR_CH3_RMA_NREQUEST_NEW_THRESHOLD,
MPIR_CVAR_CH3_RMA_NREQUEST_VISIT_THRESHOLD and
MPIR_CVAR_CH3_RMA_NREQUEST_TEST_THRESHOLD for better performance.
This experience is from running graph500 on single node on BLUES
and breadboard machine, with 16 or 8 processes and problem size is
2^16 to 2^20. We make the number of new requests since the last
attempt to complete pending requests to 0, so that the issuing code
will always try to complete pending requests. We also disable the
threshold of completed requests in GC and make the threshold of
tested requests in GC to be 100, so that we have opportunity to
find more pending requests in GC.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index 740192b..1f54473 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -41,7 +41,7 @@ cvars:
- name : MPIR_CVAR_CH3_RMA_NREQUEST_NEW_THRESHOLD
category : CH3
type : int
- default : 128
+ default : 0
class : none
verbosity : MPI_T_VERBOSITY_USER_BASIC
scope : MPI_T_SCOPE_ALL_EQ
@@ -54,7 +54,7 @@ cvars:
- name : MPIR_CVAR_CH3_RMA_GC_NUM_COMPLETED
category : CH3
type : int
- default : 1
+ default : (-1)
class : none
verbosity : MPI_T_VERBOSITY_USER_BASIC
scope : MPI_T_SCOPE_ALL_EQ
@@ -80,7 +80,7 @@ cvars:
- name : MPIR_CVAR_CH3_RMA_GC_NUM_TESTED
category : CH3
type : int
- default : (-1)
+ default : 100
class : none
verbosity : MPI_T_VERBOSITY_USER_BASIC
scope : MPI_T_SCOPE_ALL_EQ
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/src/ch3u_rma_sync.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.2-18-gb76ebc6
by noreply@mpich.org 30 Jul '14
by noreply@mpich.org 30 Jul '14
30 Jul '14
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 b76ebc6f2820d2d0a194abc8e2da3dab080bbea2 (commit)
from 1d3684ecd94a429fd1fd25659e5557fe9f2ecdc0 (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/b76ebc6f2820d2d0a194abc8e2da3dab0…
commit b76ebc6f2820d2d0a194abc8e2da3dab080bbea2
Author: Wesley Bland <wbland(a)anl.gov>
Date: Fri Mar 28 10:59:20 2014 -0500
Remove old FT functions
A few MPIX functions pertaining to fault tolerance were added to MPICH a while
back. These functions are no longer applicable given the new ULFM
implementation so they are being removed here.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index 20a9c33..c12e38c 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -1528,9 +1528,6 @@ int MPI_T_category_changed(int *stamp);
/* Non-standard but public extensions to MPI */
/* Fault Tolerance Extensions */
-int MPIX_Comm_group_failed(MPI_Comm comm, MPI_Group *failed_group);
-int MPIX_Comm_remote_group_failed(MPI_Comm comm, MPI_Group *failed_group);
-int MPIX_Comm_reenable_anysource(MPI_Comm comm, MPI_Group *failed_group);
/* End Prototypes */
@@ -2166,9 +2163,6 @@ int PMPI_T_category_changed(int *stamp);
/* Non-standard but public extensions to MPI */
/* Fault Tolerance Extensions */
-int PMPIX_Comm_group_failed(MPI_Comm comm, MPI_Group *failed_group);
-int PMPIX_Comm_remote_group_failed(MPI_Comm comm, MPI_Group *failed_group);
-int PMPIX_Comm_reenable_anysource(MPI_Comm comm, MPI_Group *failed_group);
#endif /* MPI_BUILD_PROFILING */
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index b07f448..105d7b3 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -2754,48 +2754,6 @@ int MPID_Comm_spawn_multiple(int, char *[], char **[], const int [], MPID_Info*
int, MPID_Comm *, MPID_Comm **, int []);
/*@
- MPID_Comm_group_failed - MPID entry point for MPI_Comm_group_failed
-
- Input Parameters:
-. comm - communicator
-
- Output Parameters
-. failed_group_ptr - group of failed processes
-
- Return Value:
- 'MPI_SUCCESS' or a valid MPI error code.
-@*/
-int MPID_Comm_group_failed(MPID_Comm *comm, MPID_Group **failed_group_ptr);
-
-/*@
- MPID_Comm_remote_group_failed - MPID entry point for MPI_Comm_remote_group_failed
-
- Input Parameters:
-. comm - intercommunicator
-
- Output Parameters
-. failed_group_ptr - group of failed processes in comm's remote group
-
- Return Value:
- 'MPI_SUCCESS' or a valid MPI error code.
-@*/
-int MPID_Comm_remote_group_failed(MPID_Comm *comm, MPID_Group **failed_group_ptr);
-
-/*@
- MPID_Comm_reenable_anysource - MPID entry point for MPI_Comm_reenable_anysource
-
- Input Parameters:
-. comm - communicator
-
- Output Parameters
-. failed_group_ptr - group of failed processes
-
- Return Value:
- 'MPI_SUCCESS' or a valid MPI error code.
-@*/
-int MPID_Comm_reenable_anysource(MPID_Comm *comm, MPID_Group **failed_group_ptr);
-
-/*@
MPID_Send - MPID entry point for MPI_Send
Notes:
diff --git a/src/mpi/comm/Makefile.mk b/src/mpi/comm/Makefile.mk
index 7c40af5..a14b695 100644
--- a/src/mpi/comm/Makefile.mk
+++ b/src/mpi/comm/Makefile.mk
@@ -26,10 +26,7 @@ mpi_sources += \
src/mpi/comm/comm_test_inter.c \
src/mpi/comm/intercomm_create.c \
src/mpi/comm/intercomm_merge.c \
- src/mpi/comm/comm_split_type.c \
- src/mpi/comm/comm_group_failed.c \
- src/mpi/comm/comm_reenable_anysource.c \
- src/mpi/comm/comm_remote_group_failed.c
+ src/mpi/comm/comm_split_type.c
mpi_core_sources += \
src/mpi/comm/commutil.c
diff --git a/src/mpi/comm/comm_group_failed.c b/src/mpi/comm/comm_group_failed.c
deleted file mode 100644
index a5c3b72..0000000
--- a/src/mpi/comm/comm_group_failed.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-#include "mpiimpl.h"
-#include "mpicomm.h"
-
-/* -- Begin Profiling Symbol Block for routine MPIX_Comm_group_failed */
-#if defined(HAVE_PRAGMA_WEAK)
-#pragma weak MPIX_Comm_group_failed = PMPIX_Comm_group_failed
-#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
-#pragma _HP_SECONDARY_DEF PMPIX_Comm_group_failed MPIX_Comm_group_failed
-#elif defined(HAVE_PRAGMA_CRI_DUP)
-#pragma _CRI duplicate MPIX_Comm_group_failed as PMPIX_Comm_group_failed
-#elif defined(HAVE_WEAK_ATTRIBUTE)
-int MPIX_Comm_group_failed(MPI_Comm comm, MPI_Group *failed_group) __attribute__((weak,alias("PMPIX_Comm_group_failed")));
-#endif
-/* -- End Profiling Symbol Block */
-
-/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
- the MPI routines */
-#ifndef MPICH_MPI_FROM_PMPI
-#undef MPIX_Comm_group_failed
-#define MPIX_Comm_group_failed PMPIX_Comm_group_failed
-
-#endif
-
-#undef FUNCNAME
-#define FUNCNAME MPIX_Comm_group_failed
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-/*@
-
-MPIX_Comm_group_failed - Accesses the group associated with given communicator
-
-Input Parameters:
-. comm - Communicator (handle)
-
-Output Parameters:
-. failed_group - Group of failed processes communicator (handle)
-
-Notes:
-.N COMMNULL
-
-.N ThreadSafe
-
-.N Fortran
-
-.N Errors
-.N MPI_SUCCESS
-.N MPI_ERR_COMM
-@*/
-int MPIX_Comm_group_failed(MPI_Comm comm, MPI_Group *failed_group)
-{
- int mpi_errno = MPI_SUCCESS;
- MPID_Comm *comm_ptr = NULL;
- MPID_Group *failed_group_ptr;
- MPID_MPI_STATE_DECL(MPID_STATE_MPIX_COMM_GROUP_FAILED);
-
- MPIR_ERRTEST_INITIALIZED_ORDIE();
-
- MPIU_THREAD_CS_ENTER(ALLFUNC,);
- MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_GROUP_FAILED);
-
- /* Validate parameters, especially handles needing to be converted */
-# ifdef HAVE_ERROR_CHECKING
- {
- MPID_BEGIN_ERROR_CHECKS;
- {
- MPIR_ERRTEST_COMM(comm, mpi_errno);
- }
- MPID_END_ERROR_CHECKS;
- }
-
-# endif /* HAVE_ERROR_CHECKING */
-
- /* Convert MPI object handles to object pointers */
- MPID_Comm_get_ptr( comm, comm_ptr );
-
- /* Validate parameters and objects (post conversion) */
-# ifdef HAVE_ERROR_CHECKING
- {
- MPID_BEGIN_ERROR_CHECKS;
- {
- /* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
- /* If comm_ptr is not valid, it will be reset to null */
- if (mpi_errno) goto fn_fail;
- }
- MPID_END_ERROR_CHECKS;
- }
-# endif /* HAVE_ERROR_CHECKING */
-
- /* ... body of routine ... */
-
- mpi_errno = MPID_Comm_group_failed(comm_ptr, &failed_group_ptr);
- if (mpi_errno) goto fn_fail;
-
- MPIU_OBJ_PUBLISH_HANDLE(*failed_group, failed_group_ptr->handle);
-
- /* ... end of body of routine ... */
-
- fn_exit:
- MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_GROUP_FAILED);
- MPIU_THREAD_CS_EXIT(ALLFUNC,);
- return mpi_errno;
-
- fn_fail:
- /* --BEGIN ERROR HANDLING-- */
-# ifdef HAVE_ERROR_CHECKING
- {
- mpi_errno = MPIR_Err_create_code(
- mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpix_comm_group_failed",
- "**mpix_comm_group_failed %C %p", comm, failed_group);
- }
-# endif
- mpi_errno = MPIR_Err_return_comm( comm_ptr, FCNAME, mpi_errno );
- goto fn_exit;
- /* --END ERROR HANDLING-- */
-}
-
diff --git a/src/mpi/comm/comm_reenable_anysource.c b/src/mpi/comm/comm_reenable_anysource.c
deleted file mode 100644
index 05cf847..0000000
--- a/src/mpi/comm/comm_reenable_anysource.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-#include "mpiimpl.h"
-
-/* -- Begin Profiling Symbol Block for routine MPIX_Comm_reenable_anysource */
-#if defined(HAVE_PRAGMA_WEAK)
-#pragma weak MPIX_Comm_reenable_anysource = PMPIX_Comm_reenable_anysource
-#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
-#pragma _HP_SECONDARY_DEF PMPIX_Comm_reenable_anysource MPIX_Comm_reenable_anysource
-#elif defined(HAVE_PRAGMA_CRI_DUP)
-#pragma _CRI duplicate MPIX_Comm_reenable_anysource as PMPIX_Comm_reenable_anysource
-#elif defined(HAVE_WEAK_ATTRIBUTE)
-int MPIX_Comm_reenable_anysource(MPI_Comm comm, MPI_Group *failed_group) __attribute__((weak,alias("PMPIX_Comm_reenable_anysource")));
-#endif
-/* -- End Profiling Symbol Block */
-
-/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
- the MPI routines */
-#ifndef MPICH_MPI_FROM_PMPI
-#undef MPIX_Comm_reenable_anysource
-#define MPIX_Comm_reenable_anysource PMPIX_Comm_reenable_anysource
-
-#endif
-
-#undef FUNCNAME
-#define FUNCNAME MPIX_Comm_reenable_anysource
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-/*@
-
-MPIX_Comm_reenable_anysource - Re-enable the ability to post receives using MPI_ANY_SOURCE on the communicator
-
-Input Parameters:
-. comm - Communicator (handle)
-
-Output Parameters:
-. failed_group - Group of failed processes communicator (handle)
-
-Notes:
-.N COMMNULL
-
-.N ThreadSafe
-
-.N Fortran
-
-.N Errors
-.N MPI_SUCCESS
-.N MPI_ERR_COMM
-@*/
-int MPIX_Comm_reenable_anysource(MPI_Comm comm, MPI_Group *failed_group)
-{
- int mpi_errno = MPI_SUCCESS;
- MPID_Comm *comm_ptr = NULL;
- MPID_Group *failed_group_ptr = NULL;
- MPIDI_STATE_DECL(MPID_STATE_MPIX_COMM_REENABLE_ANYSOURCE);
-
- MPIR_ERRTEST_INITIALIZED_ORDIE();
-
- MPIU_THREAD_CS_ENTER(ALLFUNC,);
- MPIDI_FUNC_ENTER(MPID_STATE_MPIX_COMM_REENABLE_ANYSOURCE);
-
- /* Validate parameters, especially handles needing to be converted */
-# ifdef HAVE_ERROR_CHECKING
- {
- MPID_BEGIN_ERROR_CHECKS;
- {
- MPIR_ERRTEST_COMM(comm, mpi_errno);
- }
- MPID_END_ERROR_CHECKS;
- }
-
-# endif /* HAVE_ERROR_CHECKING */
-
- /* Convert MPI object handles to object pointers */
- MPID_Comm_get_ptr( comm, comm_ptr );
-
- /* Validate parameters and objects (post conversion) */
-# ifdef HAVE_ERROR_CHECKING
- {
- MPID_BEGIN_ERROR_CHECKS;
- {
- /* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
- /* If comm_ptr is not valid, it will be reset to null */
- if (mpi_errno) goto fn_fail;
- }
- MPID_END_ERROR_CHECKS;
- }
-# endif /* HAVE_ERROR_CHECKING */
-
- /* ... body of routine ... */
-
- mpi_errno = MPID_Comm_reenable_anysource(comm_ptr, &failed_group_ptr);
- if (mpi_errno) goto fn_fail;
-
- MPIU_OBJ_PUBLISH_HANDLE(*failed_group, failed_group_ptr->handle);
-
- /* ... end of body of routine ... */
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPIX_COMM_REENABLE_ANYSOURCE);
- MPIU_THREAD_CS_EXIT(ALLFUNC,);
- return mpi_errno;
- fn_fail:
- /* --BEGIN ERROR HANDLING-- */
-# ifdef HAVE_ERROR_CHECKING
- {
- mpi_errno = MPIR_Err_create_code(
- mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpix_comm_reenable_anysource",
- "**mpix_comm_reenable_anysource %C %p", comm, failed_group);
- }
-# endif
- mpi_errno = MPIR_Err_return_comm( comm_ptr, FCNAME, mpi_errno );
- goto fn_exit;
- /* --END ERROR HANDLING-- */
-}
diff --git a/src/mpi/comm/comm_remote_group_failed.c b/src/mpi/comm/comm_remote_group_failed.c
deleted file mode 100644
index 30635e6..0000000
--- a/src/mpi/comm/comm_remote_group_failed.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-#include "mpiimpl.h"
-#include "mpicomm.h"
-
-/* -- Begin Profiling Symbol Block for routine MPIX_Comm_remote_group_failed */
-#if defined(HAVE_PRAGMA_WEAK)
-#pragma weak MPIX_Comm_remote_group_failed = PMPIX_Comm_remote_group_failed
-#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
-#pragma _HP_SECONDARY_DEF PMPIX_Comm_remote_group_failed MPIX_Comm_remote_group_failed
-#elif defined(HAVE_PRAGMA_CRI_DUP)
-#pragma _CRI duplicate MPIX_Comm_remote_group_failed as PMPIX_Comm_remote_group_failed
-#elif defined(HAVE_WEAK_ATTRIBUTE)
-int MPIX_Comm_remote_group_failed(MPI_Comm comm, MPI_Group *failed_group) __attribute__((weak,alias("PMPIX_Comm_remote_group_failed")));
-#endif
-/* -- End Profiling Symbol Block */
-
-/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
- the MPI routines */
-#ifndef MPICH_MPI_FROM_PMPI
-#undef MPIX_Comm_remote_group_failed
-#define MPIX_Comm_remote_group_failed PMPIX_Comm_remote_group_failed
-
-#endif
-
-#undef FUNCNAME
-#define FUNCNAME MPIX_Comm_remote_group_failed
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-/*@
-
-MPIX_Comm_remote_group_failed - Accesses the group associated with given communicator
-
-Input Parameters:
-. comm - Communicator (handle)
-
-Output Parameters:
-. failed_group - Group of failed processes communicator (handle)
-
-Notes:
-.N COMMNULL
-
-.N ThreadSafe
-
-.N Fortran
-
-.N Errors
-.N MPI_SUCCESS
-.N MPI_ERR_COMM
-@*/
-int MPIX_Comm_remote_group_failed(MPI_Comm comm, MPI_Group *failed_group)
-{
- int mpi_errno = MPI_SUCCESS;
- MPID_Comm *comm_ptr = NULL;
- MPID_Group *failed_group_ptr;
- MPID_MPI_STATE_DECL(MPID_STATE_MPIX_COMM_REMOTE_GROUP_FAILED);
-
- MPIR_ERRTEST_INITIALIZED_ORDIE();
-
- MPIU_THREAD_CS_ENTER(ALLFUNC,);
- MPID_MPI_FUNC_ENTER(MPID_STATE_MPIX_COMM_REMOTE_GROUP_FAILED);
-
- /* Validate parameters, especially handles needing to be converted */
-# ifdef HAVE_ERROR_CHECKING
- {
- MPID_BEGIN_ERROR_CHECKS;
- {
- MPIR_ERRTEST_COMM(comm, mpi_errno);
- }
- MPID_END_ERROR_CHECKS;
- }
-
-# endif /* HAVE_ERROR_CHECKING */
-
- /* Convert MPI object handles to object pointers */
- MPID_Comm_get_ptr( comm, comm_ptr );
-
- /* Validate parameters and objects (post conversion) */
-# ifdef HAVE_ERROR_CHECKING
- {
- MPID_BEGIN_ERROR_CHECKS;
- {
- /* Validate comm_ptr */
- MPID_Comm_valid_ptr( comm_ptr, mpi_errno );
- /* If comm_ptr is not valid, it will be reset to null */
- if (mpi_errno) goto fn_fail;
- }
- MPID_END_ERROR_CHECKS;
- }
-# endif /* HAVE_ERROR_CHECKING */
-
- /* ... body of routine ... */
-
- mpi_errno = MPID_Comm_remote_group_failed(comm_ptr, &failed_group_ptr);
- if (mpi_errno) goto fn_fail;
-
- MPIU_OBJ_PUBLISH_HANDLE(*failed_group, failed_group_ptr->handle);
-
- /* ... end of body of routine ... */
-
- fn_exit:
- MPID_MPI_FUNC_EXIT(MPID_STATE_MPIX_COMM_REMOTE_GROUP_FAILED);
- MPIU_THREAD_CS_EXIT(ALLFUNC,);
- return mpi_errno;
-
- fn_fail:
- /* --BEGIN ERROR HANDLING-- */
-# ifdef HAVE_ERROR_CHECKING
- {
- mpi_errno = MPIR_Err_create_code(
- mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpix_comm_remote_group_failed",
- "**mpix_comm_remote_group_failed %C %p", comm, failed_group);
- }
-# endif
- mpi_errno = MPIR_Err_return_comm( comm_ptr, FCNAME, mpi_errno );
- goto fn_exit;
- /* --END ERROR HANDLING-- */
-}
-
diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt
index d5de9f9..0cbe441 100644
--- a/src/mpi/errhan/errnames.txt
+++ b/src/mpi/errhan/errnames.txt
@@ -1095,12 +1095,6 @@ is too big (> MPIU_SHMW_GHND_SZ)
**mpi_comm_remote_size %C %p:MPI_Comm_remote_size(%C, size=%p) failed
**mpi_comm_remote_group:MPI_Comm_remote_group failed
**mpi_comm_remote_group %C %p:MPI_Comm_remote_group(%C, group=%p) failed
-**mpix_comm_remote_group_failed:MPIX_Comm_remote_group_failed failed
-**mpix_comm_remote_group_failed %C %p:MPIX_Comm_remote_group_failed(%C, group=%p) failed
-**mpix_comm_group_failed:MPIX_Comm_group_failed failed
-**mpix_comm_group_failed %C %p:MPIX_Comm_group_failed(%C, group=%p) failed
-**mpix_comm_reenable_anysource:MPIX_Comm_reenable_anysource
-**mpix_comm_reenable_anysource %C %p:MPIX_Comm_reenable_anysource(%C, group=%p) failed
**mpi_intercomm_create:MPI_Intercomm_create failed
**mpi_intercomm_create %C %d %C %d %d %p:MPI_Intercomm_create(%C, local_leader=%d, %C, remote_leader=%d, tag=%d, newintercomm=%p) failed
**mpi_intercomm_merge:MPI_Intercomm_merge failed
diff --git a/src/mpid/ch3/src/Makefile.mk b/src/mpid/ch3/src/Makefile.mk
index 64b075e..a69106a 100644
--- a/src/mpid/ch3/src/Makefile.mk
+++ b/src/mpid/ch3/src/Makefile.mk
@@ -28,8 +28,6 @@ mpi_core_sources += \
src/mpid/ch3/src/mpid_cancel_recv.c \
src/mpid/ch3/src/mpid_cancel_send.c \
src/mpid/ch3/src/mpid_comm_disconnect.c \
- src/mpid/ch3/src/mpid_comm_group_failed.c \
- src/mpid/ch3/src/mpid_comm_reenable_anysource.c \
src/mpid/ch3/src/mpid_comm_spawn_multiple.c \
src/mpid/ch3/src/mpid_finalize.c \
src/mpid/ch3/src/mpid_get_universe_size.c \
diff --git a/src/mpid/ch3/src/mpid_comm_group_failed.c b/src/mpid/ch3/src/mpid_comm_group_failed.c
deleted file mode 100644
index 1979928..0000000
--- a/src/mpid/ch3/src/mpid_comm_group_failed.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * (C) 2011 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-#include "mpidimpl.h"
-
-#undef FUNCNAME
-#define FUNCNAME MPID_Comm_group_failed
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_Comm_group_failed(MPID_Comm *comm_ptr, MPID_Group **failed_group_ptr)
-{
- int mpi_errno = MPI_SUCCESS;
- MPID_Group *group_ptr;
- MPIDI_STATE_DECL(MPID_STATE_MPID_COMM_GROUP_FAILED);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_COMM_GROUP_FAILED);
-
- mpi_errno = MPIR_Comm_group_impl(comm_ptr, &group_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- mpi_errno = MPIR_Group_intersection_impl(group_ptr, MPIDI_Failed_procs_group, failed_group_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- mpi_errno = MPIR_Group_free_impl(group_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_COMM_GROUP_FAILED);
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
-
-
-#undef FUNCNAME
-#define FUNCNAME MPID_Comm_remote_group_failed
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_Comm_remote_group_failed(MPID_Comm *comm_ptr, MPID_Group **failed_group_ptr)
-{
- int mpi_errno = MPI_SUCCESS;
- MPID_Group *group_ptr;
- MPIDI_STATE_DECL(MPID_STATE_MPID_COMM_REMOTE_GROUP_FAILED);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_COMM_REMOTE_GROUP_FAILED);
-
- mpi_errno = MPIR_Comm_remote_group_impl(comm_ptr, &group_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- mpi_errno = MPIR_Group_intersection_impl(group_ptr, MPIDI_Failed_procs_group, failed_group_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- mpi_errno = MPIR_Group_free_impl(group_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_COMM_REMOTE_GROUP_FAILED);
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
diff --git a/src/mpid/ch3/src/mpid_comm_reenable_anysource.c b/src/mpid/ch3/src/mpid_comm_reenable_anysource.c
deleted file mode 100644
index c6bfdc3..0000000
--- a/src/mpid/ch3/src/mpid_comm_reenable_anysource.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- * (C) 2012 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-#include "mpidimpl.h"
-
-#undef FUNCNAME
-#define FUNCNAME MPID_Comm_reenable_anysource
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_Comm_reenable_anysource(MPID_Comm *comm_ptr, MPID_Group **failed_group_ptr)
-{
- int mpi_errno = MPI_SUCCESS;
- MPID_Group *group_ptr;
- MPIDI_STATE_DECL(MPID_STATE_MPID_COMM_REENABLE_ANYSOURCE);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_COMM_REENABLE_ANYSOURCE);
-
- mpi_errno = MPIR_Comm_group_impl(comm_ptr, &group_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- mpi_errno = MPIR_Group_intersection_impl(group_ptr, MPIDI_Failed_procs_group, failed_group_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- mpi_errno = MPIR_Group_free_impl(group_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- comm_ptr->ch.anysource_enabled = TRUE;
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_COMM_REENABLE_ANYSOURCE);
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
diff --git a/src/mpid/pamid/src/misc/mpid_unimpl.c b/src/mpid/pamid/src/misc/mpid_unimpl.c
index 1009566..ff52890 100644
--- a/src/mpid/pamid/src/misc/mpid_unimpl.c
+++ b/src/mpid/pamid/src/misc/mpid_unimpl.c
@@ -71,22 +71,3 @@ int MPID_Comm_spawn_multiple(int count,
return 0;
}
#endif
-
-int MPID_Comm_reenable_anysource(MPID_Comm *comm,
- MPID_Group **failed_group_ptr)
-{
- MPID_abort();
- return 0;
-}
-
-int MPID_Comm_remote_group_failed(MPID_Comm *comm, MPID_Group **failed_group_ptr)
-{
- MPID_abort();
- return 0;
-}
-
-int MPID_Comm_group_failed(MPID_Comm *comm_ptr, MPID_Group **failed_group_ptr)
-{
- MPID_abort();
- return 0;
-}
-----------------------------------------------------------------------
Summary of changes:
src/include/mpi.h.in | 6 -
src/include/mpiimpl.h | 42 --------
src/mpi/comm/Makefile.mk | 5 +-
src/mpi/comm/comm_group_failed.c | 124 -----------------------
src/mpi/comm/comm_reenable_anysource.c | 121 ----------------------
src/mpi/comm/comm_remote_group_failed.c | 124 -----------------------
src/mpi/errhan/errnames.txt | 6 -
src/mpid/ch3/src/Makefile.mk | 2 -
src/mpid/ch3/src/mpid_comm_group_failed.c | 64 ------------
src/mpid/ch3/src/mpid_comm_reenable_anysource.c | 37 -------
src/mpid/pamid/src/misc/mpid_unimpl.c | 19 ----
11 files changed, 1 insertions(+), 549 deletions(-)
delete mode 100644 src/mpi/comm/comm_group_failed.c
delete mode 100644 src/mpi/comm/comm_reenable_anysource.c
delete mode 100644 src/mpi/comm/comm_remote_group_failed.c
delete mode 100644 src/mpid/ch3/src/mpid_comm_group_failed.c
delete mode 100644 src/mpid/ch3/src/mpid_comm_reenable_anysource.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.2-17-g1d3684e
by noreply@mpich.org 30 Jul '14
by noreply@mpich.org 30 Jul '14
30 Jul '14
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 1d3684ecd94a429fd1fd25659e5557fe9f2ecdc0 (commit)
from 3e5395d452339bdb009f4c5b505c02bde0c9ee6d (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/1d3684ecd94a429fd1fd25659e5557fe9…
commit 1d3684ecd94a429fd1fd25659e5557fe9f2ecdc0
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Tue Jul 29 15:00:50 2014 -0500
Fixed compile warnings in MPI_File_f2c with --disable-romio
MPI_File_f2c() is expected to return a value of type MPI_File. However,
the old code returns MPI_File*. We do a type casting here. Whether the
returned value is correct is not important since romio is disabled and we
just want to make the compiler happy.
Fixes #2140
Signed-off-by: Antonio J. Pena <apenya(a)mcs.anl.gov>
diff --git a/src/binding/fortran/mpif_h/mpi_fortimpl.h b/src/binding/fortran/mpif_h/mpi_fortimpl.h
index 0adfa11..a28f84c 100644
--- a/src/binding/fortran/mpif_h/mpi_fortimpl.h
+++ b/src/binding/fortran/mpif_h/mpi_fortimpl.h
@@ -264,6 +264,6 @@ typedef char *MPID_FCHAR_T;
/* A special case to help out when ROMIO is disabled */
#ifndef MPI_MODE_RDONLY
#ifndef MPI_File_f2c
-#define MPI_File_f2c(a) ((MPI_File*)(a))
+#define MPI_File_f2c(a) ((MPI_File)(MPI_Aint)(a))
#endif
#endif /* MPI_MODE_RDONLY */
-----------------------------------------------------------------------
Summary of changes:
src/binding/fortran/mpif_h/mpi_fortimpl.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.2-16-g3e5395d
by noreply@mpich.org 29 Jul '14
by noreply@mpich.org 29 Jul '14
29 Jul '14
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 3e5395d452339bdb009f4c5b505c02bde0c9ee6d (commit)
via 339b9cc661a5c5039826bb9def4c6bc5a3ca96d9 (commit)
via 8189d9cf4c080a86033a3c1b731e37976c6130e2 (commit)
from 494f597b956c4a1557c986848e3b5eabb80faa32 (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/3e5395d452339bdb009f4c5b505c02bde…
commit 3e5395d452339bdb009f4c5b505c02bde0c9ee6d
Author: Wesley Bland <wbland(a)anl.gov>
Date: Fri Apr 11 12:41:44 2014 -0500
Move MPIX functions to the end of mpi.h
Moving the MPIX functions to the end of the mpi.h.in file will help with ABI
compatibility.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index ebdce0f..20a9c33 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -1484,13 +1484,6 @@ int MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size);
int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *newcomm);
-/* Non-standard but public extensions to MPI */
-/* Fault Tolerance Extensions */
-int MPIX_Comm_group_failed(MPI_Comm comm, MPI_Group *failed_group);
-int MPIX_Comm_remote_group_failed(MPI_Comm comm, MPI_Group *failed_group);
-int MPIX_Comm_reenable_anysource(MPI_Comm comm, MPI_Group *failed_group);
-
-
/* MPI_T interface */
/* The MPI_T routines are available only in C bindings - tell tools that they
can skip these prototypes */
@@ -1531,6 +1524,15 @@ int MPI_T_category_get_pvars(int cat_index, int len, int indices[]);
int MPI_T_category_get_categories(int cat_index, int len, int indices[]);
int MPI_T_category_changed(int *stamp);
/* End Skip Prototypes */
+
+
+/* Non-standard but public extensions to MPI */
+/* Fault Tolerance Extensions */
+int MPIX_Comm_group_failed(MPI_Comm comm, MPI_Group *failed_group);
+int MPIX_Comm_remote_group_failed(MPI_Comm comm, MPI_Group *failed_group);
+int MPIX_Comm_reenable_anysource(MPI_Comm comm, MPI_Group *failed_group);
+
+
/* End Prototypes */
#endif /* MPICH_SUPPRESS_PROTOTYPES */
@@ -2119,12 +2121,6 @@ int PMPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *exte
int PMPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent);
int PMPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size);
-/* Non-standard but public extensions to MPI */
-/* Fault Tolerance Extensions */
-int PMPIX_Comm_group_failed(MPI_Comm comm, MPI_Group *failed_group);
-int PMPIX_Comm_remote_group_failed(MPI_Comm comm, MPI_Group *failed_group);
-int PMPIX_Comm_reenable_anysource(MPI_Comm comm, MPI_Group *failed_group);
-
/* MPI_T interface */
/* The MPI_T routines are available only in C bindings - tell tools that they
@@ -2166,6 +2162,15 @@ int PMPI_T_category_get_pvars(int cat_index, int len, int indices[]);
int PMPI_T_category_get_categories(int cat_index, int len, int indices[]);
int PMPI_T_category_changed(int *stamp);
/* End Skip Prototypes */
+
+
+/* Non-standard but public extensions to MPI */
+/* Fault Tolerance Extensions */
+int PMPIX_Comm_group_failed(MPI_Comm comm, MPI_Group *failed_group);
+int PMPIX_Comm_remote_group_failed(MPI_Comm comm, MPI_Group *failed_group);
+int PMPIX_Comm_reenable_anysource(MPI_Comm comm, MPI_Group *failed_group);
+
+
#endif /* MPI_BUILD_PROFILING */
/* End of MPI bindings */
http://git.mpich.org/mpich.git/commitdiff/339b9cc661a5c5039826bb9def4c6bc5a…
commit 339b9cc661a5c5039826bb9def4c6bc5a3ca96d9
Author: Wesley Bland <wbland(a)anl.gov>
Date: Tue Jul 29 10:16:32 2014 -0500
Move MPIX_ERR_FAIL_STOP to the MPIX errcode section
MPIX error codes now have their own section. Move MPIX_ERR_FAIL_STOP to that
section with a new value.
This does not break ABI compatiblity because this error code was prefixed MPIX
and therefore is not available in all implementations.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index 45c3b52..ebdce0f 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -842,8 +842,6 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
#define MPI_ERR_DISP 52 /* */
#define MPI_ERR_ASSERT 53 /* */
-#define MPIX_ERR_PROC_FAIL_STOP 54 /* Process failure */
-
#define MPI_ERR_RMA_RANGE 55 /* */
#define MPI_ERR_RMA_ATTACH 56 /* */
#define MPI_ERR_RMA_SHARED 57 /* */
@@ -879,6 +877,7 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
* range. All MPIX error codes will be
* above this value to be ABI complaint. */
+#define MPIX_ERR_PROC_FAIL_STOP MPICH_ERR_FIRST_MPIX+1 /* Process failure */
/* End of MPI's error classes */
http://git.mpich.org/mpich.git/commitdiff/8189d9cf4c080a86033a3c1b731e37976…
commit 8189d9cf4c080a86033a3c1b731e37976c6130e2
Author: Wesley Bland <wbland(a)anl.gov>
Date: Mon Jul 28 16:45:51 2014 -0500
Reorganize mpi.h for MPIX err codes
The mpi.h header already had one MPIX error code in the middle of the regular
MPI error codes. This is bad for ABI compatibility since if that error code
ever needs to change, it might cause problems. To avoid this, we'll now have a
new value called MPI_ERR_FIRST_MPIX which is bigger than MPICH_ERR_LAST_CLASS.
All MPIX error classes will be based on this value. If anything above that
value ever changes, it's not a problem because it's MPIX and not part of the
ABI agreement.
There is a gap between MPICH_ERR_LAST_CLASS and MPICH_ERR_FIRST_MPIX because
sock is currently using these values for some of its internal error codes.
Someday in the future, we could consider removing this gap if sock goes away.
This commit also does some minor reordering of the error codes within the file
(not their values) for readability reasons.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index bd047ce..45c3b52 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -802,18 +802,18 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
#define MPI_ERR_PENDING 18 /* Pending request */
/* New MPI-2 Error classes */
-#define MPI_ERR_FILE 27 /* */
#define MPI_ERR_ACCESS 20 /* */
#define MPI_ERR_AMODE 21 /* */
#define MPI_ERR_BAD_FILE 22 /* */
+#define MPI_ERR_CONVERSION 23 /* */
+#define MPI_ERR_DUP_DATAREP 24 /* */
#define MPI_ERR_FILE_EXISTS 25 /* */
#define MPI_ERR_FILE_IN_USE 26 /* */
+#define MPI_ERR_FILE 27 /* */
+#define MPI_ERR_IO 32 /* */
#define MPI_ERR_NO_SPACE 36 /* */
#define MPI_ERR_NO_SUCH_FILE 37 /* */
-#define MPI_ERR_IO 32 /* */
#define MPI_ERR_READ_ONLY 40 /* */
-#define MPI_ERR_CONVERSION 23 /* */
-#define MPI_ERR_DUP_DATAREP 24 /* */
#define MPI_ERR_UNSUPPORTED_DATAREP 43 /* */
/* MPI_ERR_INFO is NOT defined in the MPI-2 standard. I believe that
@@ -873,6 +873,13 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
/* WARNING: this is also defined in mpishared.h. Update both locations */
#define MPICH_ERR_LAST_CLASS 72 /* It is also helpful to know the
last valid class */
+
+#define MPICH_ERR_FIRST_MPIX 100 /* Define a gap here because sock is
+ * already using some of the values in this
+ * range. All MPIX error codes will be
+ * above this value to be ABI complaint. */
+
+
/* End of MPI's error classes */
/* Function type defs */
-----------------------------------------------------------------------
Summary of changes:
src/include/mpi.h.in | 49 ++++++++++++++++++++++++++++++-------------------
1 files changed, 30 insertions(+), 19 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0