Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/mpid/ch3/include/mpidimpl.h
- ===================================================================
- --- src/mpid/ch3/include/mpidimpl.h (revision 7382)
- +++ src/mpid/ch3/include/mpidimpl.h (working copy)
- @@ -684,6 +684,9 @@ typedef struct MPIDI_Comm_ops
- int *flag, MPI_Status *status);
- } MPIDI_Comm_ops_t;
- +
- +extern int (*MPIDI_Anysource_iprobe_fn)(int tag, MPID_Comm * comm, int context_offset, int *flag,
- + MPI_Status * status);
- #endif
- typedef struct MPIDI_VC
- Index: src/mpid/ch3/src/mpid_probe.c
- ===================================================================
- --- src/mpid/ch3/src/mpid_probe.c (revision 7382)
- +++ src/mpid/ch3/src/mpid_probe.c (working copy)
- @@ -26,6 +26,38 @@ int MPID_Probe(int source, int tag, MPID_Comm * co
- goto fn_exit;
- }
- +#ifdef ENABLE_COMM_OVERRIDES
- + if (MPIDI_Anysource_iprobe_fn) {
- + if (source == MPI_ANY_SOURCE) {
- + /* if it's anysource, loop while checking the shm recv
- + queue and iprobing the netmod, then do a progress
- + test to make some progress. */
- + do {
- + int found;
- +
- + MPIU_THREAD_CS_ENTER(MSGQUEUE,);
- + found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
- + MPIU_THREAD_CS_EXIT(MSGQUEUE,);
- + if (found) break;
- +
- + mpi_errno = MPIDI_Anysource_iprobe_fn(tag, comm, context_offset, &found, status);
- + if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- + if (found) break;
- +
- + mpi_errno = MPIDI_CH3_Progress_test();
- + if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- + } while (1);
- + } else {
- + /* it's not anysource, so just probe on the netmod*/
- + MPIDI_VC_t * vc;
- + MPIDI_Comm_get_vc_set_active(comm, source, &vc);
- + MPIU_Assert(vc->comm_ops && vc->comm_ops->probe);
- + mpi_errno = vc->comm_ops->probe(vc, source, tag, comm, context_offset, status);
- + if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- + }
- + goto fn_exit;
- + }
- +#endif
- MPIDI_CH3_Progress_start(&progress_state);
- do
- {
- @@ -44,4 +76,6 @@ int MPID_Probe(int source, int tag, MPID_Comm * co
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_PROBE);
- return mpi_errno;
- + fn_fail:
- + goto fn_exit;
- }
- Index: src/mpid/ch3/src/mpid_iprobe.c
- ===================================================================
- --- src/mpid/ch3/src/mpid_iprobe.c (revision 7382)
- +++ src/mpid/ch3/src/mpid_iprobe.c (working copy)
- @@ -6,6 +6,9 @@
- #include "mpidimpl.h"
- +int (*MPIDI_Anysource_iprobe_fn)(int tag, MPID_Comm * comm, int context_offset, int *flag,
- + MPI_Status * status) = NULL;
- +
- #undef FUNCNAME
- #define FUNCNAME MPID_Iprobe
- #undef FCNAME
- @@ -29,6 +32,48 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *co
- goto fn_exit;
- }
- +#ifdef ENABLE_COMM_OVERRIDES
- + if (MPIDI_Anysource_iprobe_fn) {
- + if (source == MPI_ANY_SOURCE) {
- + /* if it's anysource, check shm, then check the network.
- + If still not found, call progress, and check again. */
- +
- + /* check shm*/
- + MPIU_THREAD_CS_ENTER(MSGQUEUE,);
- + found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
- + MPIU_THREAD_CS_EXIT(MSGQUEUE,);
- + if (!found) {
- + /* not found, check network */
- + mpi_errno = MPIDI_Anysource_iprobe_fn(tag, comm, context_offset, &found, status);
- + if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- + if (!found) {
- + /* still not found, make some progress*/
- + mpi_errno = MPIDI_CH3_Progress_poke();
- + if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- + /* check shm again */
- + MPIU_THREAD_CS_ENTER(MSGQUEUE,);
- + found = MPIDI_CH3U_Recvq_FU(source, tag, context, status);
- + MPIU_THREAD_CS_EXIT(MSGQUEUE,);
- + if (!found) {
- + /* check network again */
- + mpi_errno = MPIDI_Anysource_iprobe_fn(tag, comm, context_offset, &found, status);
- + if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- + }
- + }
- + }
- + } else {
- + /* it's not anysource, so just iprobe on the netmod*/
- + MPIDI_VC_t * vc;
- + MPIDI_Comm_get_vc_set_active(comm, source, &vc);
- + MPIU_Assert(vc->comm_ops && vc->comm_ops->probe);
- + mpi_errno = vc->comm_ops->iprobe(vc, source, tag, comm, context_offset, &found, status);
- + if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- + }
- + *flag = found;
- + goto fn_exit;
- + }
- +#endif
- +
- /* FIXME: The routine CH3U_Recvq_FU is used only by the probe functions;
- it should atomically return the flag and status rather than create
- a request. Note that in some cases it will be possible to
- @@ -55,4 +100,6 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *co
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_IPROBE);
- return mpi_errno;
- + fn_fail:
- + goto fn_exit;
- }
- Index: src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_nets.h
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_nets.h (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_nets.h (working copy)
- @@ -21,6 +21,8 @@ typedef int (* MPID_nem_net_module_connect_to_root
- typedef int (* MPID_nem_net_module_vc_init_t)(MPIDI_VC_t *vc);
- typedef int (* MPID_nem_net_module_vc_destroy_t)(MPIDI_VC_t *vc);
- typedef int (* MPID_nem_net_module_vc_terminate_t)(MPIDI_VC_t *vc);
- +typedef int (* MPID_nem_net_module_anysource_iprobe_t)(int tag, MPID_Comm *comm, int context_offset, int *flag,
- + MPI_Status *status);
- typedef void (* MPID_nem_net_module_vc_dbg_print_sendq_t)(FILE *stream, MPIDI_VC_t *vc);
- @@ -39,6 +41,7 @@ typedef struct MPID_nem_netmod_funcs
- MPID_nem_net_module_vc_init_t vc_init;
- MPID_nem_net_module_vc_destroy_t vc_destroy;
- MPID_nem_net_module_vc_terminate_t vc_terminate;
- + MPID_nem_net_module_anysource_iprobe_t anysource_iprobe;
- } MPID_nem_netmod_funcs_t;
- extern MPID_nem_net_module_vc_dbg_print_sendq_t MPID_nem_net_module_vc_dbg_print_sendq;
- Index: src/mpid/ch3/channels/nemesis/nemesis/netmod/elan/elan_init.c
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/netmod/elan/elan_init.c (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/netmod/elan/elan_init.c (working copy)
- @@ -21,7 +21,8 @@ MPID_nem_netmod_funcs_t MPIDI_nem_elan_funcs = {
- MPID_nem_elan_connect_to_root,
- MPID_nem_elan_vc_init,
- MPID_nem_elan_vc_destroy,
- - MPID_nem_elan_vc_terminate
- + MPID_nem_elan_vc_terminate,
- + NULL /* anysource iprobe */
- };
- Index: src/mpid/ch3/channels/nemesis/nemesis/netmod/none/none.c
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/netmod/none/none.c (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/netmod/none/none.c (working copy)
- @@ -63,5 +63,6 @@ MPID_nem_netmod_funcs_t MPIDI_nem_none_funcs = {
- nm_connect_to_root,
- nm_vc_init,
- nm_vc_destroy,
- - nm_vc_terminate
- + nm_vc_terminate,
- + NULL /* anysource iprobe */
- };
- Index: src/mpid/ch3/channels/nemesis/nemesis/netmod/psm/psm_init.c
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/netmod/psm/psm_init.c (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/netmod/psm/psm_init.c (working copy)
- @@ -18,7 +18,8 @@ MPID_nem_netmod_funcs_t MPIDI_nem_psm_funcs = {
- MPID_nem_psm_connect_to_root,
- MPID_nem_psm_vc_init,
- MPID_nem_psm_vc_destroy,
- - MPID_nem_psm_vc_terminate
- + MPID_nem_psm_vc_terminate,
- + NULL /* anysource iprobe */
- };
- #define MPIDI_CH3I_ENDPOINT_KEY "endpoint_id"
- Index: src/mpid/ch3/channels/nemesis/nemesis/netmod/gm/gm_init.c
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/netmod/gm/gm_init.c (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/netmod/gm/gm_init.c (working copy)
- @@ -15,7 +15,8 @@ MPID_nem_netmod_funcs_t MPIDI_nem_gm_funcs = {
- MPID_nem_gm_connect_to_root,
- MPID_nem_gm_vc_init,
- MPID_nem_gm_vc_destroy,
- - MPID_nem_gm_vc_terminate
- + MPID_nem_gm_vc_terminate,
- + NULL /* anysource iprobe */
- };
- Index: src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_init.c
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_init.c (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_init.c (working copy)
- @@ -15,7 +15,8 @@ MPID_nem_netmod_funcs_t MPIDI_nem_mx_funcs = {
- MPID_nem_mx_connect_to_root,
- MPID_nem_mx_vc_init,
- MPID_nem_mx_vc_destroy,
- - MPID_nem_mx_vc_terminate
- + MPID_nem_mx_vc_terminate,
- + MPID_nem_mx_anysource_iprobe
- };
- static MPIDI_Comm_ops_t comm_ops = {
- Index: src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_impl.h
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_impl.h (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_impl.h (working copy)
- @@ -42,6 +42,8 @@ int MPID_nem_mx_cancel_recv(MPIDI_VC_t *vc, MPID_R
- int MPID_nem_mx_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, MPI_Status *status);
- int MPID_nem_mx_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status);
- +int MPID_nem_mx_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status);
- +
- /* Callback routine for unex msgs in MX */
- mx_unexp_handler_action_t MPID_nem_mx_get_adi_msg(void *context,mx_endpoint_addr_t source,
- uint64_t match_info,uint32_t length,void *data);
- Index: src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_probe.c
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_probe.c (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_probe.c (working copy)
- @@ -114,3 +114,11 @@ int MPID_nem_mx_iprobe(MPIDI_VC_t *vc, int source
- +#undef FUNCNAME
- +#define FUNCNAME MPID_nem_mx_anysource_iprobe
- +#undef FCNAME
- +#define FCNAME MPIU_QUOTE(FUNCNAME)
- +int MPID_nem_mx_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status)
- +{
- + return MPID_nem_mx_iprobe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, status);
- +}
- Index: src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_init.c
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_init.c (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_init.c (working copy)
- @@ -31,7 +31,8 @@ MPID_nem_netmod_funcs_t MPIDI_nem_tcp_funcs = {
- MPID_nem_tcp_connect_to_root,
- MPID_nem_tcp_vc_init,
- MPID_nem_tcp_vc_destroy,
- - MPID_nem_tcp_vc_terminate
- + MPID_nem_tcp_vc_terminate,
- + NULL /* anysource iprobe */
- };
- /* in case there are no packet types defined (e.g., they're ifdef'ed out) make sure the array is not zero length */
- Index: src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c (working copy)
- @@ -17,7 +17,8 @@ MPID_nem_netmod_funcs_t MPIDI_nem_newmad_funcs = {
- MPID_nem_newmad_connect_to_root,
- MPID_nem_newmad_vc_init,
- MPID_nem_newmad_vc_destroy,
- - MPID_nem_newmad_vc_terminate
- + MPID_nem_newmad_vc_terminate,
- + MPID_nem_newmad_anysource_iprobe
- };
- static MPIDI_Comm_ops_t comm_ops = {
- Index: src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_network.c
- ===================================================================
- --- src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_network.c (revision 7382)
- +++ src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_network.c (working copy)
- @@ -41,6 +41,9 @@ int MPID_nem_choose_netmod(void)
- {
- MPID_nem_netmod_func = MPID_nem_netmod_funcs[i];
- MPID_nem_netmod_id = i;
- +#ifdef ENABLE_COMM_OVERRIDES
- + MPIDI_Anysource_iprobe_fn = MPID_nem_netmod_func->anysource_iprobe;
- +#endif
- goto fn_exit;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement