[mpich2-commits] r9512 - in mpich2/trunk/src: mpi/errhan mpid/ch3/channels/nemesis/nemesis/include mpid/ch3/channels/nemesis/nemesis/netmod/mx mpid/ch3/channels/nemesis/nemesis/netmod/newmad mpid/ch3/include mpid/ch3/src
goodell at mcs.anl.gov
goodell at mcs.anl.gov
Mon Feb 20 23:43:19 CST 2012
Author: goodell
Date: 2012-02-20 23:43:19 -0600 (Mon, 20 Feb 2012)
New Revision: 9512
Modified:
mpich2/trunk/src/mpi/errhan/errnames.txt
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_nets.h
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_impl.h
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_init.c
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_probe.c
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_probe.c
mpich2/trunk/src/mpid/ch3/include/mpidimpl.h
mpich2/trunk/src/mpid/ch3/src/mpid_improbe.c
mpich2/trunk/src/mpid/ch3/src/mpid_mprobe.c
Log:
(untested) "ENOSYS" version of mx/newmad mprobe support
This adds the appropriate code in the device to support networks
that natively do tag matching, such as mx and newmad. The appropriate
new functions in those netmods throw a new "**nomprobe" error message
and MPI_ERR_INTERN error class.
Due to lack of time and easy availability of MX+NewMad platforms, this
code has not been tested. (Sorry Guillaume!)
No reviewer.
Modified: mpich2/trunk/src/mpi/errhan/errnames.txt
===================================================================
--- mpich2/trunk/src/mpi/errhan/errnames.txt 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpi/errhan/errnames.txt 2012-02-21 05:43:19 UTC (rev 9512)
@@ -176,8 +176,10 @@
**unableToLoadDLLsym %s %s: Unable to find or load the symbol %s from a \
dynamically loaded library for reason %s
-**dynamic_node_ids: Node information for dynamic processes currently is not implemnted
+**dynamic_node_ids: Node information for dynamic processes currently is not implemented
+**nomprobe: Mprobe-related functionality is not implemented
+
**memcpyalias:memcpy arguments alias each other
**memcpyalias %p %p %L:memcpy arguments alias each other, dst=%p src=%p len=%L
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_nets.h
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_nets.h 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_nets.h 2012-02-21 05:43:19 UTC (rev 9512)
@@ -23,6 +23,8 @@
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 int (* MPID_nem_net_module_anysource_improbe_t)(int tag, MPID_Comm *comm, int context_offset, int *flag,
+ MPID_Request **message, MPI_Status *status);
typedef void (* MPID_nem_net_module_vc_dbg_print_sendq_t)(FILE *stream, MPIDI_VC_t *vc);
@@ -42,6 +44,7 @@
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_net_module_anysource_improbe_t anysource_improbe;
} MPID_nem_netmod_funcs_t;
extern MPID_nem_net_module_vc_dbg_print_sendq_t MPID_nem_net_module_vc_dbg_print_sendq;
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_impl.h
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_impl.h 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_impl.h 2012-02-21 05:43:19 UTC (rev 9512)
@@ -52,6 +52,7 @@
int MPID_nem_mx_cancel_recv(MPIDI_VC_t *vc, MPID_Request *rreq);
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_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPID_Request **message, MPI_Status *status);
int MPID_nem_mx_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status);
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_init.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_init.c 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_init.c 2012-02-21 05:43:19 UTC (rev 9512)
@@ -22,7 +22,8 @@
MPID_nem_mx_vc_init,
MPID_nem_mx_vc_destroy,
MPID_nem_mx_vc_terminate,
- MPID_nem_mx_anysource_iprobe
+ MPID_nem_mx_anysource_iprobe,
+ MPID_nem_mx_anysource_improbe
};
static MPIDI_Comm_ops_t comm_ops = {
@@ -45,7 +46,8 @@
MPID_nem_mx_cancel_recv, /* cancel_recv */
MPID_nem_mx_probe, /* probe */
- MPID_nem_mx_iprobe /* iprobe */
+ MPID_nem_mx_iprobe, /* iprobe */
+ MPID_nem_mx_improbe /* improbe */
};
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_probe.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_probe.c 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_probe.c 2012-02-21 05:43:19 UTC (rev 9512)
@@ -102,8 +102,26 @@
}
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_mx_improbe
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_mx_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPID_Request **message, MPI_Status *status)
+{
+ int mpi_errno = MPI_SUCCESS;
+ /* not currently implemented for MX */
+ MPIU_ERR_SET(mpi_errno, MPI_ERR_INTERN, "**nomprobe");
+ fn_exit:
+ return mpi_errno;
+ fn_fail: ATTRIBUTE((unused))
+ goto fn_exit;
+}
+
+
+
+
#undef FUNCNAME
#define FUNCNAME MPID_nem_mx_anysource_iprobe
#undef FCNAME
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h 2012-02-21 05:43:19 UTC (rev 9512)
@@ -51,6 +51,7 @@
int context_offset, MPI_Status *status);
int MPID_nem_newmad_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
int context_offset, int *flag, MPI_Status *status);
+int MPID_nem_newmad_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPID_Request **message, MPI_Status *status);
/* Any source management */
void MPID_nem_newmad_anysource_posted(MPID_Request *rreq);
int MPID_nem_newmad_anysource_matched(MPID_Request *rreq);
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c 2012-02-21 05:43:19 UTC (rev 9512)
@@ -19,7 +19,8 @@
MPID_nem_newmad_vc_init,
MPID_nem_newmad_vc_destroy,
MPID_nem_newmad_vc_terminate,
- MPID_nem_newmad_anysource_iprobe
+ MPID_nem_newmad_anysource_iprobe,
+ MPID_nem_newmad_anysource_improbe
};
static MPIDI_Comm_ops_t comm_ops = {
@@ -42,7 +43,8 @@
MPID_nem_newmad_cancel_recv, /* cancel_recv */
MPID_nem_newmad_probe, /* probe */
- MPID_nem_newmad_iprobe /* iprobe */
+ MPID_nem_newmad_iprobe, /* iprobe */
+ MPID_nem_newmad_improbe /* improbe */
};
#define MPIDI_CH3I_URL_KEY "url_id"
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_probe.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_probe.c 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_probe.c 2012-02-21 05:43:19 UTC (rev 9512)
@@ -156,7 +156,26 @@
goto fn_exit;
}
+
#undef FUNCNAME
+#define FUNCNAME MPID_nem_mx_improbe
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_newmad_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPID_Request **message, MPI_Status *status)
+{
+ int mpi_errno = MPI_SUCCESS;
+
+ /* not currently implemented for newmad */
+ MPIU_ERR_SET(mpi_errno, MPI_ERR_INTERN, "**nomprobe");
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail: ATTRIBUTE((unused))
+ goto fn_exit;
+}
+
+
+#undef FUNCNAME
#define FUNCNAME MPID_nem_newmad_anysource_iprobe
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
Modified: mpich2/trunk/src/mpid/ch3/include/mpidimpl.h
===================================================================
--- mpich2/trunk/src/mpid/ch3/include/mpidimpl.h 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpid/ch3/include/mpidimpl.h 2012-02-21 05:43:19 UTC (rev 9512)
@@ -690,11 +690,15 @@
MPI_Status *status);
int (*iprobe)(struct MPIDI_VC *vc, int source, int tag, MPID_Comm *comm, int context_offset,
int *flag, MPI_Status *status);
-
+ int (*improbe)(struct MPIDI_VC *vc, int source, int tag, MPID_Comm *comm, int context_offset,
+ int *flag, MPID_Request **message, 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);
+extern int (*MPIDI_Anysource_improbe_fn)(int tag, MPID_Comm * comm, int context_offset,
+ int *flag, MPID_Request **message,
+ MPI_Status * status);
#endif
typedef struct MPIDI_VC
Modified: mpich2/trunk/src/mpid/ch3/src/mpid_improbe.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/src/mpid_improbe.c 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpid/ch3/src/mpid_improbe.c 2012-02-21 05:43:19 UTC (rev 9512)
@@ -6,8 +6,9 @@
#include "mpidimpl.h"
-/* FIXME I think we still need to handle the anysource probe case for
- * channel/netmod override. See MPID_Iprobe for more info. */
+int (*MPIDI_Anysource_improbe_fn)(int tag, MPID_Comm * comm, int context_offset,
+ int *flag, MPID_Request **message,
+ MPI_Status * status) = NULL;
#undef FUNCNAME
#define FUNCNAME MPID_Improbe
@@ -28,6 +29,51 @@
goto fn_exit;
}
+#ifdef ENABLE_COMM_OVERRIDES
+ if (MPIDI_Anysource_improbe_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,);
+ *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
+ MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+ if (!*flag) {
+ /* not found, check network */
+ mpi_errno = MPIDI_Anysource_improbe_fn(tag, comm, context_offset, flag, message, status);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ if (!*flag) {
+ /* 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,);
+ *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
+ MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+ if (!*flag) {
+ /* check network again */
+ mpi_errno = MPIDI_Anysource_improbe_fn(tag, comm, context_offset, flag, message, status);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ }
+ }
+ }
+ goto fn_exit;
+ }
+ else {
+ /* it's not anysource, check if the netmod has overridden it */
+ MPIDI_VC_t * vc;
+ MPIDI_Comm_get_vc_set_active(comm, source, &vc);
+ if (vc->comm_ops && vc->comm_ops->probe) {
+ mpi_errno = vc->comm_ops->improbe_fn(vc, source, tag, comm, context_offset, flag, message, status);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ goto fn_exit;
+ }
+ /* fall-through to shm case */
+ }
+ }
+#endif
+
MPIU_THREAD_CS_ENTER(MSGQUEUE,);
*message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
MPIU_THREAD_CS_EXIT(MSGQUEUE,);
Modified: mpich2/trunk/src/mpid/ch3/src/mpid_mprobe.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/src/mpid_mprobe.c 2012-02-21 05:43:06 UTC (rev 9511)
+++ mpich2/trunk/src/mpid/ch3/src/mpid_mprobe.c 2012-02-21 05:43:19 UTC (rev 9512)
@@ -6,9 +6,6 @@
#include "mpidimpl.h"
-/* FIXME I think we still need to handle the anysource probe case for
- * channel/netmod override. See MPID_Iprobe for more info. */
-
#undef FUNCNAME
#define FUNCNAME MPID_Mprobe
#undef FCNAME
@@ -30,6 +27,53 @@
goto fn_exit;
}
+#ifdef ENABLE_COMM_OVERRIDES
+ if (MPIDI_Anysource_improbe_fn) {
+ if (source == MPI_ANY_SOURCE) {
+ /* if it's anysource, loop while checking the shm recv
+ queue and improbing the netmod, then do a progress
+ test to make some progress. */
+ do {
+ MPIU_THREAD_CS_ENTER(MSGQUEUE,);
+ *message = MPIDI_CH3U_Recvq_FDU_matchonly(source, tag, context_id, comm, flag);
+ MPIU_THREAD_CS_EXIT(MSGQUEUE,);
+ if (found) goto fn_exit;
+
+ mpi_errno = MPIDI_Anysource_improbe_fn(tag, comm, context_offset, &found, message, status);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ if (found) goto fn_exit;
+
+ MPIU_THREAD_CS_YIELD(ALLFUNC,);
+
+ /* FIXME could this be replaced with a progress_wait? */
+ mpi_errno = MPIDI_CH3_Progress_test();
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ } while (1);
+ }
+ else {
+ /* it's not anysource, see if this is for the netmod */
+ MPIDI_VC_t * vc;
+ MPIDI_Comm_get_vc_set_active(comm, source, &vc);
+
+ if (vc->comm_ops && vc->comm_ops->improbe) {
+ /* netmod has overridden improbe */
+ do {
+ mpi_errno = vc->comm_ops->improbe(vc, source, tag, comm, context_offset, &found,
+ message, status);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ if (found) goto fn_exit;
+
+ MPIU_THREAD_CS_YIELD(ALLFUNC,);
+
+ /* FIXME could this be replaced with a progress_wait? */
+ mpi_errno = MPIDI_CH3_Progress_test();
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ } while (1);
+ }
+ /* fall-through to shm case */
+ }
+ }
+#endif
/* Inefficient implementation: we poll the unexpected queue looking for a
* matching request, interleaved with calls to progress. If there are many
* non-matching unexpected messages in the queue then we will end up
@@ -40,7 +84,6 @@
* do than it seems at first because of the spread-out nature of callers to
* various CH3U_Recvq routines and especially because of the enqueue/dequeue
* hooks for native MX tag matching support. */
-
MPIDI_CH3_Progress_start(&progress_state);
do
{
@@ -56,12 +99,12 @@
MPIDI_CH3_Progress_end(&progress_state);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-fn_exit:
if (*message) {
(*message)->kind = MPID_REQUEST_MPROBE;
MPIR_Request_extract_status((*message), status);
}
+fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
More information about the mpich2-commits
mailing list