Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rob Latham
MPICH-BlueGene
Commits
b46eb963
Commit
b46eb963
authored
Oct 28, 2010
by
Darius Buntinas
Browse files
[svn-r7390] adding anysource probe support for mx and newmad
parent
5e0e3c84
Changes
14
Hide whitespace changes
Inline
Side-by-side
src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_nets.h
View file @
b46eb963
...
...
@@ -21,6 +21,8 @@ typedef int (* MPID_nem_net_module_connect_to_root_t)(const char *business_card,
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
;
...
...
src/mpid/ch3/channels/nemesis/nemesis/netmod/elan/elan_init.c
View file @
b46eb963
...
...
@@ -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 */
};
...
...
src/mpid/ch3/channels/nemesis/nemesis/netmod/gm/gm_init.c
View file @
b46eb963
...
...
@@ -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 */
};
...
...
src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_impl.h
View file @
b46eb963
...
...
@@ -47,6 +47,8 @@ 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_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
);
...
...
src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_init.c
View file @
b46eb963
...
...
@@ -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
=
{
...
...
@@ -254,7 +255,9 @@ MPID_nem_mx_vc_init (MPIDI_VC_t *vc)
mpi_errno
=
MPID_nem_mx_get_from_bc
(
business_card
,
&
VC_FIELD
(
vc
,
remote_endpoint_id
),
&
VC_FIELD
(
vc
,
remote_nic_id
));
if
(
mpi_errno
)
MPIU_ERR_POP
(
mpi_errno
);
MPIU_Free
(
business_card
);
ret
=
mx_connect
(
MPID_nem_mx_local_endpoint
,
VC_FIELD
(
vc
,
remote_nic_id
),
VC_FIELD
(
vc
,
remote_endpoint_id
),
MPID_NEM_MX_FILTER
,
MX_INFINITE
,
&
(
VC_FIELD
(
vc
,
remote_endpoint_addr
)));
MPIU_ERR_CHKANDJUMP1
(
ret
!=
MX_SUCCESS
,
mpi_errno
,
MPI_ERR_OTHER
,
"**mx_connect"
,
"**mx_connect %s"
,
mx_strerror
(
ret
));
...
...
src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_probe.c
View file @
b46eb963
...
...
@@ -98,3 +98,11 @@ int MPID_nem_mx_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, in
#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
);
}
src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c
View file @
b46eb963
...
...
@@ -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
=
{
...
...
src/mpid/ch3/channels/nemesis/nemesis/netmod/none/none.c
View file @
b46eb963
...
...
@@ -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 */
};
src/mpid/ch3/channels/nemesis/nemesis/netmod/psm/psm_init.c
View file @
b46eb963
...
...
@@ -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"
...
...
src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_init.c
View file @
b46eb963
...
...
@@ -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 */
...
...
src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_network.c
View file @
b46eb963
...
...
@@ -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
;
}
}
...
...
src/mpid/ch3/include/mpidimpl.h
View file @
b46eb963
...
...
@@ -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
...
...
src/mpid/ch3/src/mpid_iprobe.c
View file @
b46eb963
...
...
@@ -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,52 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
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
);
}
}
}
*
flag
=
found
;
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
->
iprobe
(
vc
,
source
,
tag
,
comm
,
context_offset
,
&
found
,
status
);
if
(
mpi_errno
)
MPIU_ERR_POP
(
mpi_errno
);
*
flag
=
found
;
goto
fn_exit
;
}
/* fall-through to shm case */
}
}
#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 +104,6 @@ int MPID_Iprobe(int source, int tag, MPID_Comm *comm, int context_offset,
fn_exit:
MPIDI_FUNC_EXIT
(
MPID_STATE_MPID_IPROBE
);
return
mpi_errno
;
fn_fail:
goto
fn_exit
;
}
src/mpid/ch3/src/mpid_probe.c
View file @
b46eb963
...
...
@@ -26,6 +26,43 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
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
);
goto
fn_exit
;
}
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
->
probe
)
{
/* netmod has overridden 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
;
}
/* fall-through to shm case */
}
}
#endif
MPIDI_CH3_Progress_start
(
&
progress_state
);
do
{
...
...
@@ -44,4 +81,6 @@ int MPID_Probe(int source, int tag, MPID_Comm * comm, int context_offset,
fn_exit:
MPIDI_FUNC_EXIT
(
MPID_STATE_MPID_PROBE
);
return
mpi_errno
;
fn_fail:
goto
fn_exit
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment