[mpich2-commits] r4195 - mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx
mercierg at mcs.anl.gov
mercierg at mcs.anl.gov
Thu Mar 26 10:06:57 CDT 2009
Author: mercierg
Date: 2009-03-26 10:06:57 -0500 (Thu, 26 Mar 2009)
New Revision: 4195
Added:
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_probe.c
Modified:
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/Makefile.sm
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_poll.c
Log:
Added mx_probe.c file
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/Makefile.sm
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/Makefile.sm 2009-03-26 14:42:51 UTC (rev 4194)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/Makefile.sm 2009-03-26 15:06:57 UTC (rev 4195)
@@ -1,3 +1,3 @@
INCLUDES = -I. -I../../include -I${master_top_srcdir}/src/ch3/channels/nemesis/nemesis/include -I${master_top_srcdir}/src/include \
-I${top_builddir}/src/include
-lib${MPILIBNAME}_a_SOURCES = mx_finalize.c mx_init.c mx_poll.c mx_send.c mx_cancel.c
+lib${MPILIBNAME}_a_SOURCES = mx_finalize.c mx_init.c mx_poll.c mx_send.c mx_cancel.c mx_probe.c
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 2009-03-26 14:42:51 UTC (rev 4194)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_impl.h 2009-03-26 15:06:57 UTC (rev 4195)
@@ -10,7 +10,7 @@
#include "mx_extensions.h"
#include "mpid_nem_impl.h"
-/* #define USE_CTXT_AS_MARK */
+/* #define USE_CTXT_AS_MARK */
/* #define DEBUG_IOV */
/* #define ONDEMAND */
@@ -45,6 +45,8 @@
int MPID_nem_mx_directRecv(MPIDI_VC_t *vc, MPID_Request *rreq);
int MPID_nem_mx_cancel_send(MPIDI_VC_t *vc, MPID_Request *sreq);
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);
/* 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,
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 2009-03-26 14:42:51 UTC (rev 4194)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_init.c 2009-03-26 15:06:57 UTC (rev 4195)
@@ -37,7 +37,10 @@
NULL, /* startall */
MPID_nem_mx_cancel_send,/* cancel_send */
- MPID_nem_mx_cancel_recv /* cancel_recv */
+ MPID_nem_mx_cancel_recv, /* cancel_recv */
+
+ MPID_nem_mx_probe, /* probe */
+ MPID_nem_mx_iprobe /* iprobe */
};
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_poll.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_poll.c 2009-03-26 14:42:51 UTC (rev 4194)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_poll.c 2009-03-26 15:06:57 UTC (rev 4195)
@@ -1,4 +1,4 @@
-
+
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* (C) 2006 by Argonne National Laboratory.
@@ -304,7 +304,6 @@
}
-
#ifndef USE_CTXT_AS_MARK
#undef FUNCNAME
#define FUNCNAME MPID_nem_mx_poll
@@ -318,12 +317,6 @@
mx_return_t ret;
uint32_t result;
- /*
- if ( ((my__count++)%100000000) == 0)
- fprintf(stdout,"[%i] ==== Polling %i\n",MPID_nem_mem_region.rank,my__count);
- */
- /*mx_progress(MPID_nem_mx_local_endpoint); */
-
/* first check ADI msgs */
ret = mx_test_any(MPID_nem_mx_local_endpoint,NEM_MX_MATCH_INTRA,NEM_MX_MASK,&status,&result);
MPIU_Assert(ret == MX_SUCCESS);
@@ -332,7 +325,6 @@
MPID_Request *req = (MPID_Request *)(status.context);
if ((req->kind == MPID_REQUEST_SEND) || (req->kind == MPID_PREQUEST_SEND))
{
-
MPID_nem_mx_handle_sreq(req);
}
else if (req->kind == MPID_REQUEST_RECV)
@@ -413,13 +405,6 @@
mx_return_t ret;
uint32_t result;
- /*
- mx_progress(MPID_nem_mx_local_endpoint);
-
- if ( ((my__count++)%100000000) == 0)
- fprintf(stdout,"[%i] ==== Polling %i\n",MPID_nem_mem_region.rank,my__count);
- */
-
ret = mx_test_any(MPID_nem_mx_local_endpoint,NEM_MX_MATCH_EMPTY_MASK,NEM_MX_MATCH_EMPTY_MASK,&status,&result);
MPIU_Assert(ret == MX_SUCCESS);
if ((ret == MX_SUCCESS) && (result > 0))
@@ -432,7 +417,6 @@
{
if ((req->kind == MPID_REQUEST_SEND) || (req->kind == MPID_PREQUEST_SEND))
{
-
MPID_nem_mx_handle_sreq(req);
}
else if (req->kind == MPID_REQUEST_RECV)
Added: 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 (rev 0)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_probe.c 2009-03-26 15:06:57 UTC (rev 4195)
@@ -0,0 +1,112 @@
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2006 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "mx_impl.h"
+#include "my_papi_defs.h"
+
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_mx_probe
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_mx_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, MPI_Status *status)
+{
+ uint64_t match_info = NEM_MX_MATCH_DIRECT;
+ uint64_t match_mask = NEM_MX_MATCH_FULL_MASK;
+ int mpi_errno = MPI_SUCCESS;
+ mx_return_t ret;
+ mx_status_t mx_status;
+ uint32_t result;
+
+ NEM_MX_DIRECT_MATCH(match_info,0,source,comm->context_id + context_offset);
+ //NEM_MX_SET_CTXT(match_info,comm->context_id + context_offset);
+ /*
+ if( source == MPI_ANY_SOURCE)
+ {
+ NEM_MX_SET_ANYSRC(match_info);
+ NEM_MX_SET_ANYSRC(match_mask);
+ }
+ else
+ */
+ //NEM_MX_SET_SRC(match_info,source);
+
+ if (tag == MPI_ANY_TAG)
+ {
+ NEM_MX_SET_ANYTAG(match_info);
+ NEM_MX_SET_ANYTAG(match_mask);
+ }
+ else
+ NEM_MX_SET_TAG(match_info,tag);
+
+
+ ret = mx_probe(MPID_nem_mx_local_endpoint,MX_INFINITE,match_info,match_mask,&mx_status,&result);
+ MPIU_Assert(ret == MX_SUCCESS);
+ MPIU_Assert(result != 0);
+
+ NEM_MX_MATCH_GET_RANK(mx_status.match_info,status->MPI_SOURCE);
+ NEM_MX_MATCH_GET_TAG(mx_status.match_info,status->MPI_TAG);
+ status->count = mx_status.xfer_length;
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_mx_iprobe
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_mx_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status)
+{
+ uint64_t match_info = NEM_MX_MATCH_DIRECT;
+ uint64_t match_mask = NEM_MX_MATCH_FULL_MASK;
+ int mpi_errno = MPI_SUCCESS;
+ mx_return_t ret;
+ mx_status_t mx_status;
+ uint32_t result;
+
+ NEM_MX_DIRECT_MATCH(match_info,0,source,comm->context_id + context_offset);
+ // NEM_MX_SET_CTXT(match_info,comm->context_id + context_offset);
+ /*
+ if( source == MPI_ANY_SOURCE)
+ {
+ NEM_MX_SET_ANYSRC(match_info);
+ NEM_MX_SET_ANYSRC(match_mask);
+ }
+ else
+ */
+ //NEM_MX_SET_SRC(match_info,source);
+
+ if (tag == MPI_ANY_TAG)
+ {
+ NEM_MX_SET_ANYTAG(match_info);
+ NEM_MX_SET_ANYTAG(match_mask);
+ }
+ else
+ NEM_MX_SET_TAG(match_info,tag);
+
+
+ ret = mx_iprobe(MPID_nem_mx_local_endpoint,match_info,match_mask,&mx_status,&result);
+ MPIU_Assert(ret == MX_SUCCESS);
+
+ if (result != 0)
+ {
+ NEM_MX_MATCH_GET_RANK(mx_status.match_info,status->MPI_SOURCE);
+ NEM_MX_MATCH_GET_TAG(mx_status.match_info,status->MPI_TAG);
+ status->count = mx_status.xfer_length;
+ *flag = TRUE;
+ }
+ else
+ *flag = FALSE;
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
More information about the mpich2-commits
mailing list