2005-01-30 03:30:31 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-01-30 03:30:31 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2005-01-30 03:30:31 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/constants.h"
|
|
|
|
#include "ompi/datatype/datatype.h"
|
2005-01-30 03:30:31 +03:00
|
|
|
#include "coll_self.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* alltoallw_intra
|
|
|
|
*
|
|
|
|
* Function: - MPI_Alltoallw
|
|
|
|
* Accepts: - same as MPI_Alltoallw()
|
|
|
|
* Returns: - MPI_SUCCESS or an MPI error code
|
|
|
|
*/
|
|
|
|
int mca_coll_self_alltoallw_intra(void *sbuf, int *scounts, int *sdisps,
|
|
|
|
struct ompi_datatype_t **sdtypes,
|
|
|
|
void *rbuf, int *rcounts, int *rdisps,
|
|
|
|
struct ompi_datatype_t **rdtypes,
|
2007-08-19 07:37:49 +04:00
|
|
|
struct ompi_communicator_t *comm,
|
2008-07-29 02:40:57 +04:00
|
|
|
mca_coll_base_module_t *module)
|
2005-01-30 03:30:31 +03:00
|
|
|
{
|
2007-10-05 21:40:16 +04:00
|
|
|
int err;
|
|
|
|
ptrdiff_t lb, rextent, sextent;
|
|
|
|
err = ompi_ddt_get_extent(sdtypes[0], &lb, &sextent);
|
|
|
|
if (OMPI_SUCCESS != err) {
|
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
err = ompi_ddt_get_extent(rdtypes[0], &lb, &rextent);
|
|
|
|
if (OMPI_SUCCESS != err) {
|
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ompi_ddt_sndrcv(((char *) sbuf) + sdisps[0] * sextent,
|
|
|
|
scounts[0], sdtypes[0],
|
|
|
|
((char *) rbuf) + rdisps[0] * rextent,
|
|
|
|
rcounts[0], rdtypes[0]);
|
2005-01-30 03:30:31 +03:00
|
|
|
}
|