Commit e146fc1c authored by Darius Buntinas's avatar Darius Buntinas
Browse files

[svn-r6965] more NMPI_ to MPIR_ changes. Reviewed by goodell@.

parent 5b93b07e
......@@ -3480,7 +3480,7 @@ int MPIU_Get_intranode_rank(MPID_Comm *comm_ptr, int r);
int MPIR_Cancel_impl(MPID_Request *request_ptr);
struct MPIR_Topology;
void MPIR_Cart_rank_impl(struct MPIR_Topology *cart_ptr, int *coords, int *rank);
int MPIR_Cart_create_impl(const MPID_Comm *comm_ptr, int ndims, const int dims[],
int MPIR_Cart_create_impl(MPID_Comm *comm_ptr, int ndims, const int dims[],
const int periods[], int reorder, MPI_Comm *comm_cart);
int MPIR_Cart_map_impl(const MPID_Comm *comm_ptr, int ndims, const int dims[],
const int periodic[], int *newrank);
......@@ -3508,9 +3508,17 @@ void MPIR_Comm_set_errhandler_impl(MPID_Comm *comm_ptr, MPID_Errhandler *errhand
void MPIR_Comm_get_name_impl(MPID_Comm *comm, char *comm_name, int *resultlen);
int MPIR_Comm_group_impl(MPID_Comm *comm_ptr, MPID_Group **group_ptr);
int MPIR_Comm_remote_group_impl(MPID_Comm *comm_ptr, MPID_Group **group_ptr);
int MPIR_Comm_split(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **newcomm_ptr);
int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **newcomm_ptr);
void MPIR_Group_compare_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, int *result);
int MPIR_Group_free_impl(MPID_Group *group_ptr);
void MPIR_Get_count_impl(MPI_Status *status, MPI_Datatype datatype, int *count);
void MPIR_Grequest_complete_impl(MPID_Request *request_ptr);
int MPIR_Grequest_start_impl(MPI_Grequest_query_function *query_fn,
MPI_Grequest_free_function *free_fn,
MPI_Grequest_cancel_function *cancel_fn,
void *extra_state, MPID_Request **request_ptr);
int MPIR_Graph_map_impl(const MPID_Comm *comm_ptr, int nnodes,
const int indx[], const int edges[], int *newrank);
int MPIR_Type_commit_impl(MPI_Datatype *datatype);
int MPIR_Type_create_struct_impl(int count,
int array_of_blocklengths[],
......@@ -3537,5 +3545,4 @@ int MPIR_Type_vector_impl(int count, int blocklength, int stride, MPI_Datatype o
int MPIR_Type_struct_impl(int count, int blocklens[], MPI_Aint indices[], MPI_Datatype old_types[], MPI_Datatype *newtype);
#endif /* MPIIMPL_INCLUDED */
......@@ -23,7 +23,6 @@
*/
#ifdef USE_MPI_FOR_NMPI
#define NMPI_Get_count MPI_Get_count
#define NMPI_Pack MPI_Pack
#define NMPI_Pack_size MPI_Pack_size
#define NMPI_Unpack MPI_Unpack
......@@ -31,7 +30,6 @@
#define NMPI_Test MPI_Test
#define NMPI_Type_get_attr MPI_Type_get_attr
#define NMPI_Type_set_attr MPI_Type_set_attr
#define NMPI_Comm_split MPI_Comm_split
#define NMPI_Isend MPI_Isend
#define NMPI_Irecv MPI_Irecv
#define NMPI_Recv MPI_Recv
......@@ -39,7 +37,6 @@
#define NMPI_Waitall MPI_Waitall
#define NMPI_Sendrecv MPI_Sendrecv
#define NMPI_Type_lb MPI_Type_lb
#define NMPI_Graph_map MPI_Graph_map
#define NMPI_Iprobe MPI_Iprobe
#define NMPI_Probe MPI_Probe
#define NMPI_Group_translate_ranks MPI_Group_translate_ranks
......@@ -47,8 +44,6 @@
#define NMPI_Info_create MPI_Info_create
#define NMPI_Info_set MPI_Info_set
#define NMPI_Comm_call_errhandler MPI_Comm_call_errhandler
#define NMPI_Grequest_start MPI_Grequest_start
#define NMPI_Grequest_complete MPI_Grequest_complete
#define NMPI_Test_cancelled MPI_Test_cancelled
#define NMPI_Ibsend MPI_Ibsend
#define NMPI_Buffer_detach MPI_Buffer_detach
......@@ -57,7 +52,6 @@
#define NMPIX_Grequest_class_allocate MPIX_Grequest_class_allocate
#define NMPIX_Grequest_start MPIX_Grequest_start
#else
#define NMPI_Get_count PMPI_Get_count
#define NMPI_Pack PMPI_Pack
#define NMPI_Pack_size PMPI_Pack_size
#define NMPI_Unpack PMPI_Unpack
......@@ -65,7 +59,6 @@
#define NMPI_Test PMPI_Test
#define NMPI_Type_get_attr PMPI_Type_get_attr
#define NMPI_Type_set_attr PMPI_Type_set_attr
#define NMPI_Comm_split PMPI_Comm_split
#define NMPI_Isend PMPI_Isend
#define NMPI_Irecv PMPI_Irecv
#define NMPI_Recv PMPI_Recv
......@@ -73,7 +66,6 @@
#define NMPI_Waitall PMPI_Waitall
#define NMPI_Sendrecv PMPI_Sendrecv
#define NMPI_Type_lb PMPI_Type_lb
#define NMPI_Graph_map PMPI_Graph_map
#define NMPI_Iprobe PMPI_Iprobe
#define NMPI_Probe PMPI_Probe
#define NMPI_Group_translate_ranks PMPI_Group_translate_ranks
......@@ -81,8 +73,6 @@
#define NMPI_Info_create PMPI_Info_create
#define NMPI_Info_set PMPI_Info_set
#define NMPI_Comm_call_errhandler PMPI_Comm_call_errhandler
#define NMPI_Grequest_start PMPI_Grequest_start
#define NMPI_Grequest_complete PMPI_Grequest_complete
#define NMPI_Test_cancelled PMPI_Test_cancelled
#define NMPI_Ibsend PMPI_Ibsend
#define NMPI_Buffer_detach PMPI_Buffer_detach
......
......@@ -177,7 +177,7 @@ int MPIR_Allgather_intra (
MPIU_ERR_POP(mpi_errno);
}
NMPI_Get_count(&status, recvtype, &last_recv_cnt);
MPIR_Get_count_impl(&status, recvtype, &last_recv_cnt);
curr_cnt += last_recv_cnt;
}
......@@ -254,7 +254,7 @@ int MPIR_Allgather_intra (
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
}
NMPI_Get_count(&status, recvtype, &last_recv_cnt);
MPIR_Get_count_impl(&status, recvtype, &last_recv_cnt);
curr_cnt += last_recv_cnt;
}
tmp_mask >>= 1;
......@@ -335,7 +335,7 @@ int MPIR_Allgather_intra (
MPIU_ERR_POP(mpi_errno);
}
NMPI_Get_count(&status, MPI_BYTE, &last_recv_cnt);
MPIR_Get_count_impl(&status, MPI_BYTE, &last_recv_cnt);
curr_cnt += last_recv_cnt;
}
......@@ -405,7 +405,7 @@ int MPIR_Allgather_intra (
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
}
NMPI_Get_count(&status, MPI_BYTE, &last_recv_cnt);
MPIR_Get_count_impl(&status, MPI_BYTE, &last_recv_cnt);
curr_cnt += last_recv_cnt;
}
tmp_mask >>= 1;
......
......@@ -195,7 +195,7 @@ int MPIR_Allgatherv_intra (
/* for convenience, recv is posted for a bigger amount
than will be sent */
NMPI_Get_count(&status, recvtype, &last_recv_cnt);
MPIR_Get_count_impl(&status, recvtype, &last_recv_cnt);
curr_cnt += last_recv_cnt;
}
......@@ -277,7 +277,7 @@ int MPIR_Allgatherv_intra (
/* for convenience, recv is posted for a
bigger amount than will be sent */
NMPI_Get_count(&status, recvtype, &last_recv_cnt);
MPIR_Get_count_impl(&status, recvtype, &last_recv_cnt);
curr_cnt += last_recv_cnt;
}
tmp_mask >>= 1;
......@@ -378,7 +378,7 @@ int MPIR_Allgatherv_intra (
/* for convenience, recv is posted for a bigger amount
than will be sent */
NMPI_Get_count(&status, MPI_BYTE, &last_recv_cnt);
MPIR_Get_count_impl(&status, MPI_BYTE, &last_recv_cnt);
curr_cnt += last_recv_cnt;
}
......@@ -447,7 +447,7 @@ int MPIR_Allgatherv_intra (
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* for convenience, recv is posted for a bigger amount
than will be sent */
NMPI_Get_count(&status, MPI_BYTE, &last_recv_cnt);
MPIR_Get_count_impl(&status, MPI_BYTE, &last_recv_cnt);
curr_cnt += last_recv_cnt;
}
tmp_mask >>= 1;
......@@ -521,7 +521,7 @@ int MPIR_Allgatherv_intra (
src, MPIR_ALLGATHERV_TAG, comm, &status);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
NMPI_Get_count(&status, recvtype, &recv_cnt);
MPIR_Get_count_impl(&status, recvtype, &recv_cnt);
curr_cnt += recv_cnt;
pof2 *= 2;
......
......@@ -311,7 +311,7 @@ int MPIR_Alltoall_intra(
/* in case of non-power-of-two nodes, less data may be
received than specified */
NMPI_Get_count(&status, sendtype, &last_recv_cnt);
MPIR_Get_count_impl(&status, sendtype, &last_recv_cnt);
curr_cnt += last_recv_cnt;
}
......@@ -370,7 +370,7 @@ int MPIR_Alltoall_intra(
dst, MPIR_ALLTOALL_TAG,
comm, &status);
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
NMPI_Get_count(&status, sendtype, &last_recv_cnt);
MPIR_Get_count_impl(&status, sendtype, &last_recv_cnt);
curr_cnt += last_recv_cnt;
}
tmp_mask >>= 1;
......
......@@ -284,7 +284,7 @@ static int scatter_for_bcast(
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* query actual size of data received */
NMPI_Get_count(&status, MPI_BYTE, &curr_size);
MPIR_Get_count_impl(&status, MPI_BYTE, &curr_size);
}
break;
}
......@@ -470,7 +470,7 @@ static int MPIR_Bcast_scatter_doubling_allgather(
MPI_BYTE, dst, MPIR_BCAST_TAG, comm, &status);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
NMPI_Get_count(&status, MPI_BYTE, &recv_size);
MPIR_Get_count_impl(&status, MPI_BYTE, &recv_size);
curr_size += recv_size;
}
......@@ -556,7 +556,7 @@ static int MPIR_Bcast_scatter_doubling_allgather(
whose data we don't have */
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
NMPI_Get_count(&status, MPI_BYTE, &recv_size);
MPIR_Get_count_impl(&status, MPI_BYTE, &recv_size);
curr_size += recv_size;
/* printf("Rank %d, recv from %d, offset %d, size %d\n", rank, dst, offset, recv_size);
fflush(stdout);*/
......
......@@ -359,7 +359,7 @@ int MPIR_Gather_intra (
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* the recv size is larger than what may be sent in
some cases. query amount of data actually received */
NMPI_Get_count(&status, MPI_BYTE, &recv_size);
MPIR_Get_count_impl(&status, MPI_BYTE, &recv_size);
curr_cnt += recv_size;
}
}
......
......@@ -184,7 +184,7 @@ int MPIR_Scatter_intra (
/* the recv size is larger than what may be sent in
some cases. query amount of data actually received */
NMPI_Get_count(&status, MPI_BYTE, &curr_cnt);
MPIR_Get_count_impl(&status, MPI_BYTE, &curr_cnt);
}
break;
}
......@@ -321,7 +321,7 @@ int MPIR_Scatter_intra (
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* the recv size is larger than what may be sent in
some cases. query amount of data actually received */
NMPI_Get_count(&status, MPI_BYTE, &curr_cnt);
MPIR_Get_count_impl(&status, MPI_BYTE, &curr_cnt);
break;
}
mask <<= 1;
......
......@@ -48,15 +48,15 @@ static void MPIU_Sort_inttable( splittype *keytable, int size )
}
#undef FUNCNAME
#define FUNCNAME MPIR_Comm_split
#define FUNCNAME MPIR_Comm_split_impl
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Comm_split(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **newcomm_ptr)
int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **newcomm_ptr)
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *local_comm_ptr;
splittype *table, *remotetable=0, *keytable, *remotekeytable=0;
int rank, size, remote_size, i, new_size, new_remote_size,
int rank, size, remote_size, i, new_size, new_remote_size,
first_entry = 0, first_remote_entry = 0, *last_ptr;
int in_newcomm; /* TRUE iff *newcomm should be populated */
MPIR_Context_id_t new_context_id, remote_context_id;
......@@ -302,7 +302,6 @@ int MPIR_Comm_split(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **newcomm
MPIU_CHKLMEM_FREEALL();
return mpi_errno;
fn_fail:
goto fn_exit;
}
......@@ -395,7 +394,7 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm)
/* ... body of routine ... */
mpi_errno = MPIR_Comm_split(comm_ptr, color, key, &newcomm_ptr);
mpi_errno = MPIR_Comm_split_impl(comm_ptr, color, key, &newcomm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
if (newcomm_ptr)
MPIU_OBJ_PUBLISH_HANDLE(*newcomm, newcomm_ptr->handle);
......
......@@ -21,13 +21,48 @@
#ifndef MPICH_MPI_FROM_PMPI
#undef MPI_Get_count
#define MPI_Get_count PMPI_Get_count
#undef FUNCNAME
#define FUNCNAME MPIR_Get_count_impl
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
void MPIR_Get_count_impl(MPI_Status *status, MPI_Datatype datatype, int *count)
{
int size;
/* Check for correct number of bytes */
MPID_Datatype_get_size_macro(datatype, size);
if (size != 0) {
if ((status->count % size) != 0)
(*count) = MPI_UNDEFINED;
else
(*count) = status->count / size;
} else {
if (status->count > 0) {
/* --BEGIN ERROR HANDLING-- */
/* case where datatype size is 0 and count is > 0 should
* never occur.
*/
(*count) = MPI_UNDEFINED;
/* --END ERROR HANDLING-- */
} else {
/* This is ambiguous. However, discussions on MPI Forum
reached a consensus that this is the correct return
value
*/
(*count) = 0;
}
}
}
#endif
#undef FUNCNAME
#define FUNCNAME MPI_Get_count
#undef FCNAME
#define FCNAME "MPI_Get_count"
#define FCNAME MPIU_QUOTE(FUNCNAME)
/*@
MPI_Get_count - Gets the number of "top level" elements
......@@ -52,7 +87,6 @@ size of 'datatype' (so that 'count' would not be integral), a 'count' of
int MPI_Get_count( MPI_Status *status, MPI_Datatype datatype, int *count )
{
int mpi_errno = MPI_SUCCESS;
int size;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_GET_COUNT);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......@@ -84,34 +118,7 @@ int MPI_Get_count( MPI_Status *status, MPI_Datatype datatype, int *count )
/* ... body of routine ... */
/* Check for correct number of bytes */
MPID_Datatype_get_size_macro(datatype, size);
if (size != 0) {
if ((status->count % size) != 0)
(*count) = MPI_UNDEFINED;
else
(*count) = status->count / size;
}
else {
if (status->count > 0)
{
/* --BEGIN ERROR HANDLING-- */
/* case where datatype size is 0 and count is > 0 should
* never occur.
*/
(*count) = MPI_UNDEFINED;
/* --END ERROR HANDLING-- */
}
else {
/* This is ambiguous. However, discussions on MPI Forum
reached a consensus that this is the correct return
value
*/
(*count) = 0;
}
}
MPIR_Get_count_impl(status, datatype, count);
/* ... end of body of routine ... */
......
......@@ -27,11 +27,26 @@
are used by both the MPI and PMPI versions, use PMPI_LOCAL instead of
static; this macro expands into "static" if weak symbols are supported and
into nothing otherwise. */
#undef FUNCNAME
#define FUNCNAME MPIR_Grequest_complete
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
void MPIR_Grequest_complete_impl(MPID_Request *request_ptr)
{
/* Set the request as completed. This does not change the
reference count on the generalized request */
MPID_Request_set_completed( request_ptr );
/* The request release comes with the wait/test, not this complete
routine, so we don't call the MPID_Request_release routine */
}
#endif
#undef FUNCNAME
#define FUNCNAME MPI_Grequest_complete
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
/*@
MPI_Grequest_complete - Notify MPI that a user-defined request is complete
......@@ -49,9 +64,6 @@
@*/
int MPI_Grequest_complete( MPI_Request request )
{
#ifdef HAVE_ERROR_CHECKING
static const char FCNAME[] = "MPI_Grequest_complete";
#endif
int mpi_errno = MPI_SUCCESS;
MPID_Request *request_ptr;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_GREQUEST_COMPLETE);
......@@ -94,12 +106,7 @@ int MPI_Grequest_complete( MPI_Request request )
/* ... body of routine ... */
/* Set the request as completed. This does not change the
reference count on the generalized request */
MPID_Request_set_completed( request_ptr );
/* The request release comes with the wait/test, not this complete
routine, so we don't call the MPID_Request_release routine */
MPIR_Grequest_complete_impl(request_ptr);
/* ... end of body of routine ... */
......
......@@ -66,6 +66,42 @@ PMPI_LOCAL int MPIR_Grequest_free_classes_on_finalize(void *extra_data ATTRIBUTE
return mpi_errno;
}
#undef FUNCNAME
#define FUNCNAME MPIR_Grequest_start
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Grequest_start_impl(MPI_Grequest_query_function *query_fn,
MPI_Grequest_free_function *free_fn,
MPI_Grequest_cancel_function *cancel_fn,
void *extra_state, MPID_Request **request_ptr)
{
int mpi_errno = MPI_SUCCESS;
/* MT FIXME this routine is not thread-safe in the non-global case */
*request_ptr = MPID_Request_create();
MPIU_ERR_CHKANDJUMP1(request_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "generalized request");
(*request_ptr)->kind = MPID_UREQUEST;
MPIU_Object_set_ref( *request_ptr, 1 );
(*request_ptr)->cc_ptr = &(*request_ptr)->cc;
MPID_cc_set((*request_ptr)->cc_ptr, 1);
(*request_ptr)->comm = NULL;
(*request_ptr)->cancel_fn = cancel_fn;
(*request_ptr)->free_fn = free_fn;
(*request_ptr)->query_fn = query_fn;
(*request_ptr)->poll_fn = NULL;
(*request_ptr)->wait_fn = NULL;
(*request_ptr)->grequest_extra_state = extra_state;
(*request_ptr)->greq_lang = MPID_LANG_C;
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
#else
extern MPID_Grequest_class MPID_Grequest_class_direct[];
extern MPIU_Object_alloc_t MPID_Grequest_class_mem;
......@@ -75,7 +111,8 @@ extern MPID_Grequest_class *MPIR_Grequest_class_list;
#undef FUNCNAME
#define FUNCNAME MPI_Grequest_start
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
/*@
MPI_Grequest_start - Create and return a user-defined request
......@@ -127,9 +164,8 @@ int MPI_Grequest_start( MPI_Grequest_query_function *query_fn,
MPI_Grequest_cancel_function *cancel_fn,
void *extra_state, MPI_Request *request )
{
static const char FCNAME[] = "MPI_Grequest_start";
int mpi_errno = MPI_SUCCESS;
MPID_Request *lrequest_ptr;
MPID_Request *request_ptr;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_GREQUEST_START);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......@@ -150,35 +186,11 @@ int MPI_Grequest_start( MPI_Grequest_query_function *query_fn,
# endif /* HAVE_ERROR_CHECKING */
/* ... body of routine ... */
/* MT FIXME this routine is not thread-safe in the non-global case */
lrequest_ptr = MPID_Request_create();
/* --BEGIN ERROR HANDLING-- */
if (lrequest_ptr == NULL)
{
mpi_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
FCNAME, __LINE__, MPI_ERR_OTHER,
"**nomem", "**nomem %s",
"generalized request" );
goto fn_fail;
}
/* --END ERROR HANDLING-- */
mpi_errno = MPIR_Grequest_start_impl(query_fn, free_fn, cancel_fn, extra_state, &request_ptr);
if (mpi_errno) goto fn_fail;
lrequest_ptr->kind = MPID_UREQUEST;
MPIU_Object_set_ref( lrequest_ptr, 1 );
lrequest_ptr->cc_ptr = &lrequest_ptr->cc;
MPID_cc_set(lrequest_ptr->cc_ptr, 1);
lrequest_ptr->comm = NULL;
lrequest_ptr->cancel_fn = cancel_fn;
lrequest_ptr->free_fn = free_fn;
lrequest_ptr->query_fn = query_fn;
lrequest_ptr->poll_fn = NULL;
lrequest_ptr->wait_fn = NULL;
lrequest_ptr->grequest_extra_state = extra_state;
lrequest_ptr->greq_lang = MPID_LANG_C;
MPIU_OBJ_PUBLISH_HANDLE(*request, lrequest_ptr->handle);
MPIU_OBJ_PUBLISH_HANDLE(*request, request_ptr->handle);
/* ... end of body of routine ... */
......@@ -222,6 +234,8 @@ int MPI_Grequest_start( MPI_Grequest_query_function *query_fn,
#undef FUNCNAME
#define FUNCNAME MPIX_Grequest_class_create
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
/* extensions for Generalized Request redesign paper */
int MPIX_Grequest_class_create(MPI_Grequest_query_function *query_fn,
MPI_Grequest_free_function *free_fn,
......@@ -230,7 +244,6 @@ int MPIX_Grequest_class_create(MPI_Grequest_query_function *query_fn,
MPIX_Grequest_wait_function *wait_fn,
MPIX_Grequest_class *greq_class)
{
static const char FCNAME[] = "MPIX_Grequest_class_create";
MPID_Grequest_class *class_ptr;
int mpi_errno = MPI_SUCCESS;
......
......@@ -120,10 +120,8 @@ int MPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
static const char FCNAME[] = "MPI_Ibsend";
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPI_Request new_handle;
MPID_Request *request_ptr;
MPID_Request *request_ptr, *new_request_ptr;
ibsend_req_info *ibinfo=0;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_IBSEND);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......@@ -131,8 +129,6 @@ int MPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPIU_THREAD_CS_ENTER(ALLFUNC,);
MPID_MPI_PT2PT_FUNC_ENTER_FRONT(MPID_STATE_MPI_IBSEND);
MPIU_THREADPRIV_GET;
/* Validate handle parameters needing to be converted */
# ifdef HAVE_ERROR_CHECKING
{
......@@ -197,17 +193,15 @@ int MPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
ibinfo = (ibsend_req_info *)MPIU_Malloc( sizeof(ibsend_req_info) );
ibinfo->req = request_ptr;
ibinfo->cancelled = 0;
MPIR_Nest_incr();
NMPI_Grequest_start( MPIR_Ibsend_query,
MPIR_Ibsend_free,
MPIR_Ibsend_cancel, ibinfo, &new_handle );
mpi_errno = MPIR_Grequest_start_impl( MPIR_Ibsend_query, MPIR_Ibsend_free,
MPIR_Ibsend_cancel, ibinfo, &new_request_ptr );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* The request is immediately complete because the MPIR_Bsend_isend has
already moved the data out of the user's buffer */
MPIR_Request_add_ref( request_ptr );
/* Request count is now 2 (set to 1 in Grequest_start) */
NMPI_Grequest_complete( new_handle );
MPIR_Nest_decr();
MPIU_OBJ_PUBLISH_HANDLE(*request, new_handle);
MPIR_Grequest_complete_impl(new_request_ptr);
MPIU_OBJ_PUBLISH_HANDLE(*request, new_request_ptr->handle);
/* ... end of body of routine ... */
fn_exit:
......
......@@ -33,13 +33,12 @@
#define FUNCNAME MPIR_Cart_create
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Cart_create( const MPID_Comm *comm_ptr, int ndims, const int dims[],
int MPIR_Cart_create( MPID_Comm *comm_ptr, int ndims, const int dims[],
const int periods[], int reorder, MPI_Comm *comm_cart )
{
int i, newsize, rank, nranks, mpi_errno = MPI_SUCCESS;
MPID_Comm *newcomm_ptr = NULL;
MPIR_Topology *cart_ptr = NULL;
MPI_Comm ncomm;
MPIU_CHKPMEM_DECL(4);
/* Set this as null incase we exit with an error */
......@@ -90,9 +89,7 @@ int MPIR_Cart_create( const MPID_Comm *comm_ptr, int ndims, const int dims[],
*comm_cart = MPI_COMM_NULL;
goto fn_exit;
}
}
else {
} else {
/* Create a new communicator as a duplicate of the input communicator
(but do not duplicate the attributes) */
......@@ -107,21 +104,12 @@ int MPIR_Cart_create( const MPID_Comm *comm_ptr, int ndims, const int dims[],
/* Create the new communicator with split, since we need to reorder
the ranks (including the related internals, such as the connection
tables */
if (mpi_errno == 0) {
MPIU_THREADPRIV_DECL;
MPIU_THREADPRIV_GET;
MPIR_Nest_incr();
mpi_errno = NMPI_Comm_split( comm_ptr->handle,
rank == MPI_UNDEFINED ? MPI_UNDEFINED : 1,