|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* (C) 2001 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include "mpiimpl.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
=== BEGIN_MPI_T_CVAR_INFO_BLOCK ===
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
cvars:
|
|
Packit Service |
c5cf8c |
- name : MPIR_CVAR_ALLTOALLW_INTRA_ALGORITHM
|
|
Packit Service |
c5cf8c |
category : COLLECTIVE
|
|
Packit Service |
c5cf8c |
type : string
|
|
Packit Service |
c5cf8c |
default : auto
|
|
Packit Service |
c5cf8c |
class : device
|
|
Packit Service |
c5cf8c |
verbosity : MPI_T_VERBOSITY_USER_BASIC
|
|
Packit Service |
c5cf8c |
scope : MPI_T_SCOPE_ALL_EQ
|
|
Packit Service |
c5cf8c |
description : |-
|
|
Packit Service |
c5cf8c |
Variable to select alltoallw algorithm
|
|
Packit Service |
c5cf8c |
auto - Internal algorithm selection
|
|
Packit Service |
c5cf8c |
nb - Force nonblocking algorithm
|
|
Packit Service |
c5cf8c |
pairwise_sendrecv_replace - Force pairwise sendrecv replace algorithm
|
|
Packit Service |
c5cf8c |
scattered - Force scattered algorithm
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
- name : MPIR_CVAR_ALLTOALLW_INTER_ALGORITHM
|
|
Packit Service |
c5cf8c |
category : COLLECTIVE
|
|
Packit Service |
c5cf8c |
type : string
|
|
Packit Service |
c5cf8c |
default : auto
|
|
Packit Service |
c5cf8c |
class : device
|
|
Packit Service |
c5cf8c |
verbosity : MPI_T_VERBOSITY_USER_BASIC
|
|
Packit Service |
c5cf8c |
scope : MPI_T_SCOPE_ALL_EQ
|
|
Packit Service |
c5cf8c |
description : |-
|
|
Packit Service |
c5cf8c |
Variable to select alltoallw algorithm
|
|
Packit Service |
c5cf8c |
auto - Internal algorithm selection
|
|
Packit Service |
c5cf8c |
nb - Force nonblocking algorithm
|
|
Packit Service |
c5cf8c |
pairwise_exchange - Force pairwise exchange algorithm
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
- name : MPIR_CVAR_ALLTOALLW_DEVICE_COLLECTIVE
|
|
Packit Service |
c5cf8c |
category : COLLECTIVE
|
|
Packit Service |
c5cf8c |
type : boolean
|
|
Packit Service |
c5cf8c |
default : true
|
|
Packit Service |
c5cf8c |
class : device
|
|
Packit Service |
c5cf8c |
verbosity : MPI_T_VERBOSITY_USER_BASIC
|
|
Packit Service |
c5cf8c |
scope : MPI_T_SCOPE_ALL_EQ
|
|
Packit Service |
c5cf8c |
description : >-
|
|
Packit Service |
c5cf8c |
If set to true, MPI_Alltoallw will allow the device to override the
|
|
Packit Service |
c5cf8c |
MPIR-level collective algorithms. The device still has the
|
|
Packit Service |
c5cf8c |
option to call the MPIR-level algorithms manually.
|
|
Packit Service |
c5cf8c |
If set to false, the device-level alltoallw function will not be
|
|
Packit Service |
c5cf8c |
called.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
=== END_MPI_T_CVAR_INFO_BLOCK ===
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* -- Begin Profiling Symbol Block for routine MPI_Alltoallw */
|
|
Packit Service |
c5cf8c |
#if defined(HAVE_PRAGMA_WEAK)
|
|
Packit Service |
c5cf8c |
#pragma weak MPI_Alltoallw = PMPI_Alltoallw
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
|
|
Packit Service |
c5cf8c |
#pragma _HP_SECONDARY_DEF PMPI_Alltoallw MPI_Alltoallw
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_CRI_DUP)
|
|
Packit Service |
c5cf8c |
#pragma _CRI duplicate MPI_Alltoallw as PMPI_Alltoallw
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_WEAK_ATTRIBUTE)
|
|
Packit Service |
c5cf8c |
int MPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[],
|
|
Packit Service |
c5cf8c |
const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
|
|
Packit Service |
c5cf8c |
const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm)
|
|
Packit Service |
c5cf8c |
__attribute__ ((weak, alias("PMPI_Alltoallw")));
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
/* -- End Profiling Symbol Block */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
|
|
Packit Service |
c5cf8c |
the MPI routines */
|
|
Packit Service |
c5cf8c |
#ifndef MPICH_MPI_FROM_PMPI
|
|
Packit Service |
c5cf8c |
#undef MPI_Alltoallw
|
|
Packit Service |
c5cf8c |
#define MPI_Alltoallw PMPI_Alltoallw
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPIR_Alltoallw_intra_auto
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
int MPIR_Alltoallw_intra_auto(const void *sendbuf, const int sendcounts[], const int sdispls[],
|
|
Packit Service |
c5cf8c |
const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
|
|
Packit Service |
c5cf8c |
const int rdispls[], const MPI_Datatype recvtypes[],
|
|
Packit Service |
c5cf8c |
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int mpi_errno = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (sendbuf == MPI_IN_PLACE) {
|
|
Packit Service |
c5cf8c |
mpi_errno =
|
|
Packit Service |
c5cf8c |
MPIR_Alltoallw_intra_pairwise_sendrecv_replace(sendbuf, sendcounts, sdispls, sendtypes,
|
|
Packit Service |
c5cf8c |
recvbuf, recvcounts, rdispls, recvtypes,
|
|
Packit Service |
c5cf8c |
comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
if (mpi_errno)
|
|
Packit Service |
c5cf8c |
MPIR_ERR_POP(mpi_errno);
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
mpi_errno =
|
|
Packit Service |
c5cf8c |
MPIR_Alltoallw_intra_scattered(sendbuf, sendcounts, sdispls, sendtypes, recvbuf,
|
|
Packit Service |
c5cf8c |
recvcounts, rdispls, recvtypes, comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
if (mpi_errno)
|
|
Packit Service |
c5cf8c |
MPIR_ERR_POP(mpi_errno);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
if (*errflag != MPIR_ERR_NONE)
|
|
Packit Service |
c5cf8c |
MPIR_ERR_SET(mpi_errno, *errflag, "**coll_fail");
|
|
Packit Service |
c5cf8c |
return mpi_errno;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_fail:
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPIR_Alltoallw_inter_auto
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
int MPIR_Alltoallw_inter_auto(const void *sendbuf, const int sendcounts[], const int sdispls[],
|
|
Packit Service |
c5cf8c |
const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
|
|
Packit Service |
c5cf8c |
const int rdispls[], const MPI_Datatype recvtypes[],
|
|
Packit Service |
c5cf8c |
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int mpi_errno = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Alltoallw_inter_pairwise_exchange(sendbuf, sendcounts, sdispls,
|
|
Packit Service |
c5cf8c |
sendtypes, recvbuf, recvcounts, rdispls,
|
|
Packit Service |
c5cf8c |
recvtypes, comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return mpi_errno;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPIR_Alltoallw_impl
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
int MPIR_Alltoallw_impl(const void *sendbuf, const int sendcounts[], const int sdispls[],
|
|
Packit Service |
c5cf8c |
const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
|
|
Packit Service |
c5cf8c |
const int rdispls[], const MPI_Datatype recvtypes[],
|
|
Packit Service |
c5cf8c |
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int mpi_errno = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM) {
|
|
Packit Service |
c5cf8c |
/* intracommunicator */
|
|
Packit Service |
c5cf8c |
switch (MPIR_Alltoallw_intra_algo_choice) {
|
|
Packit Service |
c5cf8c |
case MPIR_ALLTOALLW_INTRA_ALGO_PAIRWISE_SENDRECV_REPLACE:
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Alltoallw_intra_pairwise_sendrecv_replace(sendbuf, sendcounts,
|
|
Packit Service |
c5cf8c |
sdispls, sendtypes,
|
|
Packit Service |
c5cf8c |
recvbuf, recvcounts,
|
|
Packit Service |
c5cf8c |
rdispls, recvtypes,
|
|
Packit Service |
c5cf8c |
comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
case MPIR_ALLTOALLW_INTRA_ALGO_SCATTERED:
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Alltoallw_intra_scattered(sendbuf, sendcounts,
|
|
Packit Service |
c5cf8c |
sdispls, sendtypes, recvbuf, recvcounts,
|
|
Packit Service |
c5cf8c |
rdispls, recvtypes, comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
case MPIR_ALLTOALLW_INTRA_ALGO_NB:
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Alltoallw_allcomm_nb(sendbuf, sendcounts,
|
|
Packit Service |
c5cf8c |
sdispls, sendtypes, recvbuf, recvcounts,
|
|
Packit Service |
c5cf8c |
rdispls, recvtypes, comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
case MPIR_ALLTOALLW_INTRA_ALGO_AUTO:
|
|
Packit Service |
c5cf8c |
MPL_FALLTHROUGH;
|
|
Packit Service |
c5cf8c |
default:
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Alltoallw_intra_auto(sendbuf, sendcounts,
|
|
Packit Service |
c5cf8c |
sdispls, sendtypes, recvbuf, recvcounts,
|
|
Packit Service |
c5cf8c |
rdispls, recvtypes, comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
/* intercommunicator */
|
|
Packit Service |
c5cf8c |
switch (MPIR_Alltoallw_inter_algo_choice) {
|
|
Packit Service |
c5cf8c |
case MPIR_ALLTOALLW_INTER_ALGO_PAIRWISE_EXCHANGE:
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Alltoallw_inter_pairwise_exchange(sendbuf, sendcounts, sdispls,
|
|
Packit Service |
c5cf8c |
sendtypes, recvbuf, recvcounts,
|
|
Packit Service |
c5cf8c |
rdispls, recvtypes, comm_ptr,
|
|
Packit Service |
c5cf8c |
errflag);
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
case MPIR_ALLTOALLW_INTER_ALGO_NB:
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Alltoallw_allcomm_nb(sendbuf, sendcounts,
|
|
Packit Service |
c5cf8c |
sdispls, sendtypes, recvbuf, recvcounts,
|
|
Packit Service |
c5cf8c |
rdispls, recvtypes, comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
case MPIR_ALLTOALLW_INTER_ALGO_AUTO:
|
|
Packit Service |
c5cf8c |
MPL_FALLTHROUGH;
|
|
Packit Service |
c5cf8c |
default:
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Alltoallw_inter_auto(sendbuf, sendcounts, sdispls,
|
|
Packit Service |
c5cf8c |
sendtypes, recvbuf, recvcounts,
|
|
Packit Service |
c5cf8c |
rdispls, recvtypes, comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (mpi_errno)
|
|
Packit Service |
c5cf8c |
MPIR_ERR_POP(mpi_errno);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
return mpi_errno;
|
|
Packit Service |
c5cf8c |
fn_fail:
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPIR_Alltoallw
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
int MPIR_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[],
|
|
Packit Service |
c5cf8c |
const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
|
|
Packit Service |
c5cf8c |
const int rdispls[], const MPI_Datatype recvtypes[],
|
|
Packit Service |
c5cf8c |
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int mpi_errno = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (MPIR_CVAR_ALLTOALLW_DEVICE_COLLECTIVE && MPIR_CVAR_DEVICE_COLLECTIVES) {
|
|
Packit Service |
c5cf8c |
mpi_errno = MPID_Alltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts,
|
|
Packit Service |
c5cf8c |
rdispls, recvtypes, comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Alltoallw_impl(sendbuf, sendcounts, sdispls, sendtypes, recvbuf,
|
|
Packit Service |
c5cf8c |
recvcounts, rdispls, recvtypes, comm_ptr, errflag);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return mpi_errno;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPI_Alltoallw
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
/*@
|
|
Packit Service |
c5cf8c |
MPI_Alltoallw - Generalized all-to-all communication allowing different
|
|
Packit Service |
c5cf8c |
datatypes, counts, and displacements for each partner
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Input Parameters:
|
|
Packit Service |
c5cf8c |
+ sendbuf - starting address of send buffer (choice)
|
|
Packit Service |
c5cf8c |
. sendcounts - integer array equal to the group size specifying the number of
|
|
Packit Service |
c5cf8c |
elements to send to each processor (integer)
|
|
Packit Service |
c5cf8c |
. sdispls - integer array (of length group size). Entry j specifies the
|
|
Packit Service |
c5cf8c |
displacement in bytes (relative to sendbuf) from which to take the outgoing
|
|
Packit Service |
c5cf8c |
data destined for process j
|
|
Packit Service |
c5cf8c |
. sendtypes - array of datatypes (of length group size). Entry j specifies the
|
|
Packit Service |
c5cf8c |
type of data to send to process j (handle)
|
|
Packit Service |
c5cf8c |
. recvcounts - integer array equal to the group size specifying the number of
|
|
Packit Service |
c5cf8c |
elements that can be received from each processor (integer)
|
|
Packit Service |
c5cf8c |
. rdispls - integer array (of length group size). Entry i specifies the
|
|
Packit Service |
c5cf8c |
displacement in bytes (relative to recvbuf) at which to place the incoming
|
|
Packit Service |
c5cf8c |
data from process i
|
|
Packit Service |
c5cf8c |
. recvtypes - array of datatypes (of length group size). Entry i specifies
|
|
Packit Service |
c5cf8c |
the type of data received from process i (handle)
|
|
Packit Service |
c5cf8c |
- comm - communicator (handle)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Output Parameters:
|
|
Packit Service |
c5cf8c |
. recvbuf - address of receive buffer (choice)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N ThreadSafe
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N Fortran
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N Errors
|
|
Packit Service |
c5cf8c |
.N MPI_SUCCESS
|
|
Packit Service |
c5cf8c |
.N MPI_ERR_COMM
|
|
Packit Service |
c5cf8c |
.N MPI_ERR_ARG
|
|
Packit Service |
c5cf8c |
.N MPI_ERR_COUNT
|
|
Packit Service |
c5cf8c |
.N MPI_ERR_TYPE
|
|
Packit Service |
c5cf8c |
@*/
|
|
Packit Service |
c5cf8c |
int MPI_Alltoallw(const void *sendbuf, const int sendcounts[],
|
|
Packit Service |
c5cf8c |
const int sdispls[], const MPI_Datatype sendtypes[],
|
|
Packit Service |
c5cf8c |
void *recvbuf, const int recvcounts[], const int rdispls[],
|
|
Packit Service |
c5cf8c |
const MPI_Datatype recvtypes[], MPI_Comm comm)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int mpi_errno = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
MPIR_Comm *comm_ptr = NULL;
|
|
Packit Service |
c5cf8c |
MPIR_Errflag_t errflag = MPIR_ERR_NONE;
|
|
Packit Service |
c5cf8c |
MPIR_FUNC_TERSE_STATE_DECL(MPID_STATE_MPI_ALLTOALLW);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_INITIALIZED_ORDIE();
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
|
|
Packit Service |
c5cf8c |
MPIR_FUNC_TERSE_COLL_ENTER(MPID_STATE_MPI_ALLTOALLW);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Validate parameters, especially handles needing to be converted */
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_ERROR_CHECKING
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPID_BEGIN_ERROR_CHECKS;
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_COMM(comm, mpi_errno);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
MPID_END_ERROR_CHECKS;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif /* HAVE_ERROR_CHECKING */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Convert MPI object handles to object pointers */
|
|
Packit Service |
c5cf8c |
MPIR_Comm_get_ptr(comm, comm_ptr);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Validate parameters and objects (post conversion) */
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_ERROR_CHECKING
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPID_BEGIN_ERROR_CHECKS;
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPIR_Datatype *sendtype_ptr = NULL, *recvtype_ptr = NULL;
|
|
Packit Service |
c5cf8c |
int i, comm_size;
|
|
Packit Service |
c5cf8c |
int check_send;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPIR_Comm_valid_ptr(comm_ptr, mpi_errno, FALSE);
|
|
Packit Service |
c5cf8c |
if (mpi_errno != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
goto fn_fail;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
check_send = (comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM &&
|
|
Packit Service |
c5cf8c |
sendbuf != MPI_IN_PLACE);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (comm_ptr->comm_kind == MPIR_COMM_KIND__INTERCOMM && sendbuf == MPI_IN_PLACE) {
|
|
Packit Service |
c5cf8c |
MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sendbuf_inplace");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM) {
|
|
Packit Service |
c5cf8c |
comm_size = comm_ptr->local_size;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (sendbuf != MPI_IN_PLACE && sendcounts == recvcounts && sendtypes == recvtypes)
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_ALIAS_COLL(sendbuf, recvbuf, mpi_errno);
|
|
Packit Service |
c5cf8c |
} else
|
|
Packit Service |
c5cf8c |
comm_size = comm_ptr->remote_size;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
for (i = 0; i < comm_size; i++) {
|
|
Packit Service |
c5cf8c |
if (check_send) {
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_COUNT(sendcounts[i], mpi_errno);
|
|
Packit Service |
c5cf8c |
if (sendcounts[i] > 0) {
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_DATATYPE(sendtypes[i], "sendtype[i]", mpi_errno);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if ((sendcounts[i] > 0) &&
|
|
Packit Service |
c5cf8c |
(HANDLE_GET_KIND(sendtypes[i]) != HANDLE_KIND_BUILTIN)) {
|
|
Packit Service |
c5cf8c |
MPIR_Datatype_get_ptr(sendtypes[i], sendtype_ptr);
|
|
Packit Service |
c5cf8c |
MPIR_Datatype_valid_ptr(sendtype_ptr, mpi_errno);
|
|
Packit Service |
c5cf8c |
if (mpi_errno != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
goto fn_fail;
|
|
Packit Service |
c5cf8c |
MPIR_Datatype_committed_ptr(sendtype_ptr, mpi_errno);
|
|
Packit Service |
c5cf8c |
if (mpi_errno != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
goto fn_fail;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_COUNT(recvcounts[i], mpi_errno);
|
|
Packit Service |
c5cf8c |
if (recvcounts[i] > 0) {
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_DATATYPE(recvtypes[i], "recvtype[i]", mpi_errno);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if ((recvcounts[i] > 0) && (HANDLE_GET_KIND(recvtypes[i]) != HANDLE_KIND_BUILTIN)) {
|
|
Packit Service |
c5cf8c |
MPIR_Datatype_get_ptr(recvtypes[i], recvtype_ptr);
|
|
Packit Service |
c5cf8c |
MPIR_Datatype_valid_ptr(recvtype_ptr, mpi_errno);
|
|
Packit Service |
c5cf8c |
if (mpi_errno != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
goto fn_fail;
|
|
Packit Service |
c5cf8c |
MPIR_Datatype_committed_ptr(recvtype_ptr, mpi_errno);
|
|
Packit Service |
c5cf8c |
if (mpi_errno != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
goto fn_fail;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
for (i = 0; i < comm_size && check_send; i++) {
|
|
Packit Service |
c5cf8c |
if (sendcounts[i] > 0) {
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_USERBUFFER(sendbuf, sendcounts[i], sendtypes[i], mpi_errno);
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
for (i = 0; i < comm_size; i++) {
|
|
Packit Service |
c5cf8c |
if (recvcounts[i] > 0) {
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_RECVBUF_INPLACE(recvbuf, recvcounts[i], mpi_errno);
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_USERBUFFER(recvbuf, recvcounts[i], recvtypes[i], mpi_errno);
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (mpi_errno != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
goto fn_fail;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
MPID_END_ERROR_CHECKS;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif /* HAVE_ERROR_CHECKING */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* ... body of routine ... */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Alltoallw(sendbuf, sendcounts, sdispls,
|
|
Packit Service |
c5cf8c |
sendtypes, recvbuf, recvcounts,
|
|
Packit Service |
c5cf8c |
rdispls, recvtypes, comm_ptr, &errflag);
|
|
Packit Service |
c5cf8c |
if (mpi_errno)
|
|
Packit Service |
c5cf8c |
goto fn_fail;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* ... end of body of routine ... */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
MPIR_FUNC_TERSE_COLL_EXIT(MPID_STATE_MPI_ALLTOALLW);
|
|
Packit Service |
c5cf8c |
MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
|
|
Packit Service |
c5cf8c |
return mpi_errno;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_fail:
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_ERROR_CHECKING
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
mpi_errno =
|
|
Packit Service |
c5cf8c |
MPIR_Err_create_code(mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER,
|
|
Packit Service |
c5cf8c |
"**mpi_alltoallw", "**mpi_alltoallw %p %p %p %p %p %p %p %p %C",
|
|
Packit Service |
c5cf8c |
sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts,
|
|
Packit Service |
c5cf8c |
rdispls, recvtypes, comm);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Err_return_comm(comm_ptr, FCNAME, mpi_errno);
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
}
|