Commit 34d594d4 authored by Wesley Bland's avatar Wesley Bland Committed by Pavan Balaji
Browse files

Move MPIC_* usage over to MPIC_*_ft functions.



All usages of the non-ft versions have moved over to use the ft versions
to avoid the need to maintain both and to ensure that we provide some
ability to provide ft everywhere. There are times where this isn't
necessary or useful and in those cases, the value of *errflag can be
ignored and just the return value can be checked to see if the function
was successful or not.

The MPIC_* functions that have an ft mirror
(e.g. MPIC_Send -> MPIC_Send_ft) are no longer accessible outside of
helper_fns.c. Now the MPIC_*_ft functions should be called directly.
Note that this is not going to be a long lived policy. Instead, the
MPIC_*_ft functions will be merged with the standard MPIC_* functions
and will replace them.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@mcs.anl.gov>
parent 9a048941
......@@ -3877,26 +3877,8 @@ int MPID_VCR_Get_lpid(MPID_VCR vcr, int * lpid_ptr);
other internal operations. They are wrappers around MPID send/recv
functions. They do sends/receives by setting the context offset to
MPID_CONTEXT_INTRA(INTER)_COLL. */
int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm);
int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPI_Comm comm, MPI_Status *status);
int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm);
int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPI_Comm comm, MPI_Status *status);
int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype type,
int dest, int sendtag,
int source, int recvtag,
MPI_Comm comm, MPI_Status *status);
int MPIR_Localcopy(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype);
int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int
source, int tag, MPI_Comm comm, MPI_Request *request);
int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, MPI_Request *request);
int MPIC_Wait(MPID_Request * request_ptr);
int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status);
......
......@@ -15,6 +15,25 @@
sends/receives by setting the context offset to
MPID_CONTEXT_INTRA_COLL or MPID_CONTEXT_INTER_COLL. */
static int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm);
static int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPI_Comm comm, MPI_Status *status);
static int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm);
static int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPI_Comm comm, MPI_Status *status);
static int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype type,
int dest, int sendtag,
int source, int recvtag,
MPI_Comm comm, MPI_Status *status);
static int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int
source, int tag, MPI_Comm comm, MPI_Request *request);
static int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, MPI_Request *request);
#undef FUNCNAME
#define FUNCNAME MPIC_Probe
#undef FCNAME
......@@ -44,8 +63,8 @@ int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
#define FUNCNAME MPIC_Send
#undef FCNAME
#define FCNAME "MPIC_Send"
int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm)
static int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
......@@ -86,8 +105,8 @@ int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int t
#define FUNCNAME MPIC_Recv
#undef FCNAME
#define FCNAME "MPIC_Recv"
int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPI_Comm comm, MPI_Status *status)
static int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPI_Comm comm, MPI_Status *status)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
......@@ -135,8 +154,8 @@ int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
#define FUNCNAME MPIC_Ssend
#undef FCNAME
#define FCNAME "MPIC_Ssend"
int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm)
static int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
......@@ -177,10 +196,10 @@ int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int
#define FUNCNAME MPIC_Sendrecv
#undef FCNAME
#define FCNAME "MPIC_Sendrecv"
int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPI_Comm comm, MPI_Status *status)
static int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPI_Comm comm, MPI_Status *status)
{
MPID_Request *recv_req_ptr=NULL, *send_req_ptr=NULL;
int mpi_errno = MPI_SUCCESS;
......@@ -231,10 +250,10 @@ int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
#define FUNCNAME MPIC_Sendrecv_replace
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
int dest, int sendtag,
int source, int recvtag,
MPI_Comm comm, MPI_Status *status)
static int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
int dest, int sendtag,
int source, int recvtag,
MPI_Comm comm, MPI_Status *status)
{
int mpi_errno = MPI_SUCCESS;
MPIR_Context_id_t context_id_offset;
......@@ -477,8 +496,8 @@ int MPIR_Localcopy(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
#define FUNCNAME MPIC_Isend
#undef FCNAME
#define FCNAME "MPIC_Isend"
int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, MPI_Request *request)
static int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
......@@ -513,8 +532,8 @@ int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int
#define FUNCNAME MPIC_Irecv
#undef FCNAME
#define FCNAME "MPIC_Irecv"
int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int
source, int tag, MPI_Comm comm, MPI_Request *request)
static int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int
source, int tag, MPI_Comm comm, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
......
......@@ -383,9 +383,9 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
info[0] = new_context_id;
info[1] = group_ptr->size;
mpi_errno = MPIC_Sendrecv(info, 2, MPI_INT, 0, 0,
rinfo, 2, MPI_INT, 0, 0,
comm, MPI_STATUS_IGNORE );
mpi_errno = MPIC_Sendrecv_ft(info, 2, MPI_INT, 0, 0,
rinfo, 2, MPI_INT, 0, 0,
comm, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
if (*newcomm_ptr != NULL) {
(*newcomm_ptr)->context_id = rinfo[0];
......@@ -397,9 +397,9 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
mpi_errno,"remote_mapping");
/* Populate and exchange the ranks */
mpi_errno = MPIC_Sendrecv( mapping, group_ptr->size, MPI_INT, 0, 0,
remote_mapping, remote_size, MPI_INT, 0, 0,
comm, MPI_STATUS_IGNORE );
mpi_errno = MPIC_Sendrecv_ft( mapping, group_ptr->size, MPI_INT, 0, 0,
remote_mapping, remote_size, MPI_INT, 0, 0,
comm, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
/* Broadcast to the other members of the local group */
......
......@@ -231,9 +231,9 @@ int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **ne
/* In the intercomm case, we need to exchange the context ids */
if (comm_ptr->comm_kind == MPID_INTERCOMM) {
if (comm_ptr->rank == 0) {
mpi_errno = MPIC_Sendrecv( &new_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, 0,
mpi_errno = MPIC_Sendrecv_ft( &new_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, 0,
&remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE,
0, 0, comm_ptr->handle, MPI_STATUS_IGNORE );
0, 0, comm_ptr->handle, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
mpi_errno = MPIR_Bcast_impl( &remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, local_comm_ptr, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......
......@@ -1409,9 +1409,9 @@ int MPIR_Get_intercomm_contextid( MPID_Comm *comm_ptr, MPIR_Context_id_t *contex
exchange data */
remote_context_id = -1;
if (comm_ptr->rank == 0) {
mpi_errno = MPIC_Sendrecv( &mycontext_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, tag,
&remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, tag,
comm_ptr->handle, MPI_STATUS_IGNORE );
mpi_errno = MPIC_Sendrecv_ft( &mycontext_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, tag,
&remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, tag,
comm_ptr->handle, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
......
......@@ -223,11 +223,11 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
/* printf( "About to sendrecv in intercomm_create\n" );fflush(stdout);*/
MPIU_DBG_MSG_FMT(COMM,VERBOSE,(MPIU_DBG_FDEST,"rank %d sendrecv to rank %d", peer_comm_ptr->rank,
remote_leader));
mpi_errno = MPIC_Sendrecv( &local_size, 1, MPI_INT,
remote_leader, cts_tag,
&remote_size, 1, MPI_INT,
remote_leader, cts_tag,
peer_comm_ptr->handle, MPI_STATUS_IGNORE );
mpi_errno = MPIC_Sendrecv_ft( &local_size, 1, MPI_INT,
remote_leader, cts_tag,
&remote_size, 1, MPI_INT,
remote_leader, cts_tag,
peer_comm_ptr->handle, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIU_DBG_MSG_FMT(COMM,VERBOSE,(MPIU_DBG_FDEST, "local size = %d, remote size = %d", local_size,
......@@ -243,10 +243,11 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* Exchange the lpid arrays */
mpi_errno = MPIC_Sendrecv( local_gpids, 2*local_size, MPI_INT,
remote_leader, cts_tag,
remote_gpids, 2*remote_size, MPI_INT,
remote_leader, cts_tag, peer_comm_ptr->handle, MPI_STATUS_IGNORE );
mpi_errno = MPIC_Sendrecv_ft( local_gpids, 2*local_size, MPI_INT,
remote_leader, cts_tag,
remote_gpids, 2*remote_size, MPI_INT,
remote_leader, cts_tag, peer_comm_ptr->handle,
MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* Convert the remote gpids to the lpids */
......@@ -301,9 +302,9 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
if (local_comm_ptr->rank == local_leader) {
MPIR_Context_id_t remote_context_id;
mpi_errno = MPIC_Sendrecv( &recvcontext_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, remote_leader, cts_tag,
&remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, remote_leader, cts_tag,
peer_comm_ptr->handle, MPI_STATUS_IGNORE );
mpi_errno = MPIC_Sendrecv_ft( &recvcontext_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, remote_leader, cts_tag,
&remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, remote_leader, cts_tag,
peer_comm_ptr->handle, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
final_context_id = remote_context_id;
......
......@@ -51,9 +51,9 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
if (comm_ptr->rank == 0) {
/* This routine allows use to use the collective communication
context rather than the point-to-point context. */
mpi_errno = MPIC_Sendrecv( &local_high, 1, MPI_INT, 0, 0,
&remote_high, 1, MPI_INT, 0, 0, comm_ptr->handle,
MPI_STATUS_IGNORE );
mpi_errno = MPIC_Sendrecv_ft( &local_high, 1, MPI_INT, 0, 0,
&remote_high, 1, MPI_INT, 0, 0, comm_ptr->handle,
MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* If local_high and remote_high are the same, then order is arbitrary.
......@@ -65,9 +65,9 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
mpi_errno = MPID_GPID_Get( comm_ptr, 0, ingpid );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPIC_Sendrecv( ingpid, 2, MPI_INT, 0, 1,
outgpid, 2, MPI_INT, 0, 1, comm_ptr->handle,
MPI_STATUS_IGNORE );
mpi_errno = MPIC_Sendrecv_ft( ingpid, 2, MPI_INT, 0, 1,
outgpid, 2, MPI_INT, 0, 1, comm_ptr->handle,
MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* Note that the gpids cannot be the same because we are
......
......@@ -271,12 +271,12 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
for (i = 0; i < comm_size; ++i) {
if (rin_sizes[i]) {
/* send edges where i is a destination to process i */
mpi_errno = MPIC_Isend(&rin[i][0], rin_sizes[i], MPI_INT, i, MPIR_TOPO_A_TAG, comm_old, &reqs[idx++]);
mpi_errno = MPIC_Isend_ft(&rin[i][0], rin_sizes[i], MPI_INT, i, MPIR_TOPO_A_TAG, comm_old, &reqs[idx++], &errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
if (rout_sizes[i]) {
/* send edges where i is a source to process i */
mpi_errno = MPIC_Isend(&rout[i][0], rout_sizes[i], MPI_INT, i, MPIR_TOPO_B_TAG, comm_old, &reqs[idx++]);
mpi_errno = MPIC_Isend_ft(&rout[i][0], rout_sizes[i], MPI_INT, i, MPIR_TOPO_B_TAG, comm_old, &reqs[idx++], &errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
}
......@@ -318,7 +318,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
buf = MPIU_Malloc(count*sizeof(int));
MPIU_ERR_CHKANDJUMP(!buf, mpi_errno, MPI_ERR_OTHER, "**nomem");
mpi_errno = MPIC_Recv(buf, count, MPI_INT, MPI_ANY_SOURCE, MPIR_TOPO_A_TAG, comm_old, MPI_STATUS_IGNORE);
mpi_errno = MPIC_Recv_ft(buf, count, MPI_INT, MPI_ANY_SOURCE, MPIR_TOPO_A_TAG, comm_old, MPI_STATUS_IGNORE, &errflag);
/* FIXME: buf is never freed on error! */
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......@@ -352,7 +352,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
buf = MPIU_Malloc(count*sizeof(int));
MPIU_ERR_CHKANDJUMP(!buf, mpi_errno, MPI_ERR_OTHER, "**nomem");
mpi_errno = MPIC_Recv(buf, count, MPI_INT, MPI_ANY_SOURCE, MPIR_TOPO_B_TAG, comm_old, MPI_STATUS_IGNORE);
mpi_errno = MPIC_Recv_ft(buf, count, MPI_INT, MPI_ANY_SOURCE, MPIR_TOPO_B_TAG, comm_old, MPI_STATUS_IGNORE, &errflag);
/* FIXME: buf is never freed on error! */
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......
......@@ -397,10 +397,10 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
MPIU_DBG_MSG_FMT(CH3_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
"sending 3 ints, %d, %d and %d, and receiving 3 ints",
send_ints[0], send_ints[1], send_ints[2]));
mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0,
sendtag++, recv_ints, 3, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
mpi_errno = MPIC_Sendrecv_ft(send_ints, 3, MPI_INT, 0,
sendtag++, recv_ints, 3, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
/* this is a no_port error because we may fail to connect
on the send if the port name is invalid */
......@@ -440,11 +440,11 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
MPIU_DBG_MSG_FMT(CH3_CONNECT,VERBOSE,(MPIU_DBG_FDEST,
"sending %d ints, receiving %d ints",
local_comm_size * 2, remote_comm_size * 2));
mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 2,
mpi_errno = MPIC_Sendrecv_ft(local_translation, local_comm_size * 2,
MPI_INT, 0, sendtag++,
remote_translation, remote_comm_size * 2,
MPI_INT, 0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
}
......@@ -497,10 +497,10 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
if (rank == root)
{
MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"sync with peer");
mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
sendtag++, &j, 0, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
mpi_errno = MPIC_Sendrecv_ft(&i, 0, MPI_INT, 0,
sendtag++, &j, 0, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
}
......@@ -704,8 +704,8 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
if (rank == root) {
/* First, receive the pg description from the partner */
mpi_errno = MPIC_Recv(&j, 1, MPI_INT, 0, recvtag++,
tmp_comm->handle, MPI_STATUS_IGNORE);
mpi_errno = MPIC_Recv_ft(&j, 1, MPI_INT, 0, recvtag++,
tmp_comm->handle, MPI_STATUS_IGNORE, &errflag);
*recvtag_p = recvtag;
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
......@@ -714,8 +714,8 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
if (pg_str == NULL) {
MPIU_ERR_POP(mpi_errno);
}
mpi_errno = MPIC_Recv(pg_str, j, MPI_CHAR, 0, recvtag++,
tmp_comm->handle, MPI_STATUS_IGNORE);
mpi_errno = MPIC_Recv_ft(pg_str, j, MPI_CHAR, 0, recvtag++,
tmp_comm->handle, MPI_STATUS_IGNORE, &errflag);
*recvtag_p = recvtag;
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
......@@ -875,6 +875,7 @@ static int SendPGtoPeerAndFree( MPID_Comm *tmp_comm, int *sendtag_p,
int mpi_errno = 0;
int sendtag = *sendtag_p, i;
pg_node *pg_iter;
int errflag = FALSE;
MPIDI_STATE_DECL(MPID_STATE_SENDPGTOPEERANDFREE);
MPIDI_FUNC_ENTER(MPID_STATE_SENDPGTOPEERANDFREE);
......@@ -883,15 +884,15 @@ static int SendPGtoPeerAndFree( MPID_Comm *tmp_comm, int *sendtag_p,
pg_iter = pg_list;
i = pg_iter->lenStr;
/*printf("connect:sending 1 int: %d\n", i);fflush(stdout);*/
mpi_errno = MPIC_Send(&i, 1, MPI_INT, 0, sendtag++, tmp_comm->handle);
mpi_errno = MPIC_Send_ft(&i, 1, MPI_INT, 0, sendtag++, tmp_comm->handle, &errflag);
*sendtag_p = sendtag;
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
}
/* printf("connect:sending string length %d\n", i);fflush(stdout); */
mpi_errno = MPIC_Send(pg_iter->str, i, MPI_CHAR, 0, sendtag++,
tmp_comm->handle);
mpi_errno = MPIC_Send_ft(pg_iter->str, i, MPI_CHAR, 0, sendtag++,
tmp_comm->handle, &errflag);
*sendtag_p = sendtag;
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
......@@ -994,10 +995,10 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
send_ints[2] = (*newcomm)->recvcontext_id;
/*printf("accept:sending 3 ints, %d, %d, %d, and receiving 2 ints\n", send_ints[0], send_ints[1], send_ints[2]);fflush(stdout);*/
mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0,
sendtag++, recv_ints, 3, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
mpi_errno = MPIC_Sendrecv_ft(send_ints, 3, MPI_INT, 0,
sendtag++, recv_ints, 3, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
}
......@@ -1033,11 +1034,11 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
/* Receive the translations from remote process rank to process group index */
/*printf("accept:sending %d ints and receiving %d ints\n", local_comm_size * 2, remote_comm_size * 2);fflush(stdout);*/
mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 2,
mpi_errno = MPIC_Sendrecv_ft(local_translation, local_comm_size * 2,
MPI_INT, 0, sendtag++,
remote_translation, remote_comm_size * 2,
MPI_INT, 0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
MPI_STATUS_IGNORE, &errflag);
#ifdef MPICH_DBG_OUTPUT
MPIU_DBG_PRINTF(("[%d]accept:Received remote_translation:\n", rank));
for (i=0; i<remote_comm_size; i++)
......@@ -1085,10 +1086,10 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
if (rank == root)
{
MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"sync with peer");
mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
sendtag++, &j, 0, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
mpi_errno = MPIC_Sendrecv_ft(&i, 0, MPI_INT, 0,
sendtag++, &j, 0, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
}
......
......@@ -561,23 +561,23 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
send_ints[2] = recvcontext_id;
TRACE_ERR("connect:sending 3 ints, %d, %d, %d, and receiving 2 ints with sendtag=%d recvtag=%d\n", send_ints[0], send_ints[1], send_ints[2], sendtag, recvtag);
mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0,
mpi_errno = MPIC_Sendrecv_ft(send_ints, 3, MPI_INT, 0,
sendtag++, recv_ints, 3, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
/* this is a no_port error because we may fail to connect
on the send if the port name is invalid */
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
TRACE_ERR("MPIC_Sendrecv_ft returned with mpi_errno=%d\n", mpi_errno);
}
mpi_errno = MPIC_Sendrecv_replace(&comm_cntr, 1, MPI_LONG_LONG_INT, 0,
mpi_errno = MPIC_Sendrecv_replace_ft(&comm_cntr, 1, MPI_LONG_LONG_INT, 0,
sendtag++, 0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
/* this is a no_port error because we may fail to connect
on the send if the port name is invalid */
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
TRACE_ERR("MPIC_Sendrecv_ft returned with mpi_errno=%d\n", mpi_errno);
}
}
......@@ -609,13 +609,13 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
n_remote_pgs, remote_pg );
/* Receive the translations from remote process rank to process group
index */
mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 3,
mpi_errno = MPIC_Sendrecv_ft(local_translation, local_comm_size * 3,
MPI_INT, 0, sendtag++,
remote_translation, remote_comm_size * 3,
MPI_INT, 0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno) {
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
TRACE_ERR("MPIC_Sendrecv_ft returned with mpi_errno=%d\n", mpi_errno);
}
for (i=0; i<remote_comm_size; i++)
......@@ -675,12 +675,12 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
/* synchronize with remote root */
if (rank == root)
{
mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
mpi_errno = MPIC_Sendrecv_ft(&i, 0, MPI_INT, 0,
sendtag++, &j, 0, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
TRACE_ERR("MPIC_Sendrecv_ft returned with mpi_errno=%d\n", mpi_errno);
}
/* All communication with remote root done. Release the communicator. */
......@@ -827,18 +827,18 @@ static int MPIDI_ReceivePGAndDistribute( struct MPID_Comm *tmp_comm, struct MPID
if (rank == root) {
/* First, receive the pg description from the partner */
mpi_errno = MPIC_Recv(&j, 1, MPI_INT, 0, recvtag++,
tmp_comm->handle, MPI_STATUS_IGNORE);
mpi_errno = MPIC_Recv_ft(&j, 1, MPI_INT, 0, recvtag++,
tmp_comm->handle, MPI_STATUS_IGNORE, &errflag);
*recvtag_p = recvtag;
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Recv returned with mpi_errno=%d\n", mpi_errno);
TRACE_ERR("MPIC_Recv_ft returned with mpi_errno=%d\n", mpi_errno);
}
pg_str = (char*)MPIU_Malloc(j);
mpi_errno = MPIC_Recv(pg_str, j, MPI_CHAR, 0, recvtag++,
tmp_comm->handle, MPI_STATUS_IGNORE);
mpi_errno = MPIC_Recv_ft(pg_str, j, MPI_CHAR, 0, recvtag++,
tmp_comm->handle, MPI_STATUS_IGNORE, &errflag);
*recvtag_p = recvtag;
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Recv returned with mpi_errno=%d\n", mpi_errno);
TRACE_ERR("MPIC_Recv_ft returned with mpi_errno=%d\n", mpi_errno);
}
}
......@@ -1093,20 +1093,21 @@ static int MPIDI_SendPGtoPeerAndFree( struct MPID_Comm *tmp_comm, int *sendtag_p
int mpi_errno = 0;
int sendtag = *sendtag_p, i;
pg_node *pg_iter;
int errflag = FALSE;
while (pg_list != NULL) {
pg_iter = pg_list;
i = pg_iter->lenStr;
TRACE_ERR("connect:sending 1 int: %d\n", i);
mpi_errno = MPIC_Send(&i, 1, MPI_INT, 0, sendtag++, tmp_comm->handle);
mpi_errno = MPIC_Send_ft(&i, 1, MPI_INT, 0, sendtag++, tmp_comm->handle, &errflag);
*sendtag_p = sendtag;
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Send returned with mpi_errno=%d\n", mpi_errno);
}
TRACE_ERR("connect:sending string length %d\n", i);
mpi_errno = MPIC_Send(pg_iter->str, i, MPI_CHAR, 0, sendtag++,
tmp_comm->handle);
mpi_errno = MPIC_Send_ft(pg_iter->str, i, MPI_CHAR, 0, sendtag++,
tmp_comm->handle, &errflag);
*sendtag_p = sendtag;
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Send returned with mpi_errno=%d\n", mpi_errno);
......@@ -1210,31 +1211,31 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
send_ints[2] = (*newcomm)->recvcontext_id;
TRACE_ERR("accept:sending 3 ints, %d, %d, %d, and receiving 2 ints with sendtag=%d recvtag=%d\n", send_ints[0], send_ints[1], send_ints[2], sendtag, recvtag);
mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0,
mpi_errno = MPIC_Sendrecv_ft(send_ints, 3, MPI_INT, 0,
sendtag++, recv_ints, 3, MPI_INT,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
TRACE_ERR("MPIC_Sendrecv_ft returned with mpi_errno=%d\n", mpi_errno);
}
#if 0
send_char = pg_list->str;
TRACE_ERR("accept:sending 1 string and receiving 1 string\n", send_char, recv_char);
mpi_errno = MPIC_Sendrecv(send_char, 1, MPI_CHAR, 0,
sendtag++, recv_char, 3, MPI_CHAR,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
mpi_errno = MPIC_Sendrecv_ft(send_char, 1, MPI_CHAR, 0,
sendtag++, recv_char, 3, MPI_CHAR,
0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
TRACE_ERR("MPIC_Sendrecv_ft returned with mpi_errno=%d\n", mpi_errno);
}
#endif
mpi_errno = MPIC_Sendrecv_replace(&comm_cntr, 1, MPI_LONG_LONG_INT, 0,
mpi_errno = MPIC_Sendrecv_replace_ft(&comm_cntr, 1, MPI_LONG_LONG_INT, 0,
sendtag++, 0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE);
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
/* this is a no_port error because we may fail to connect
on the send if the port name is invalid */
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
TRACE_ERR("MPIC_Sendrecv_ft returned with mpi_errno=%d\n", mpi_errno);
}
}
......@@ -1267,7 +1268,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
/* Receive the translations from remote process rank to process group index */
TRACE_ERR("accept:sending %d ints and receiving %d ints\n", local_comm_size * 2, remote_comm_size * 2);