2013-03-27 21:09:41 +00:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2008-05-07 02:31:24 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2016-03-23 18:21:50 -04:00
|
|
|
* Copyright (c) 2004-2016 The University of Tennessee and The University
|
2008-05-07 02:31:24 +00:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
2013-03-27 21:09:41 +00:00
|
|
|
* Copyright (c) 2013 Los Alamos National Security, LLC. All Rights
|
|
|
|
* reserved.
|
2013-09-17 11:35:18 +00:00
|
|
|
* Copyright (c) 2013 FUJITSU LIMITED. All rights reserved.
|
2015-08-28 16:43:13 +09:00
|
|
|
* Copyright (c) 2014-2015 Research Organization for Information Science
|
2014-11-04 12:16:30 +09:00
|
|
|
* and Technology (RIST). All rights reserved.
|
2008-05-07 02:31:24 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
#include "mpi.h"
|
|
|
|
#include "ompi/constants.h"
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 04:56:31 +00:00
|
|
|
#include "ompi/datatype/ompi_datatype.h"
|
2008-05-07 02:31:24 +00:00
|
|
|
#include "ompi/communicator/communicator.h"
|
|
|
|
#include "ompi/mca/coll/coll.h"
|
|
|
|
#include "ompi/mca/coll/base/coll_tags.h"
|
|
|
|
#include "ompi/mca/pml/pml.h"
|
2015-02-15 14:47:27 -05:00
|
|
|
#include "ompi/mca/coll/base/coll_base_functions.h"
|
|
|
|
#include "coll_base_topo.h"
|
|
|
|
#include "coll_base_util.h"
|
2013-03-27 21:09:41 +00:00
|
|
|
|
2015-02-15 17:59:18 -05:00
|
|
|
int
|
2015-08-28 16:43:13 +09:00
|
|
|
mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts, const int *rdisps,
|
2015-10-21 00:55:28 -04:00
|
|
|
struct ompi_datatype_t *rdtype,
|
|
|
|
struct ompi_communicator_t *comm,
|
|
|
|
mca_coll_base_module_t *module)
|
2013-07-25 19:19:41 +00:00
|
|
|
{
|
2015-02-15 14:47:27 -05:00
|
|
|
mca_coll_base_module_t *base_module = (mca_coll_base_module_t*) module;
|
2013-08-16 21:23:09 +00:00
|
|
|
int i, j, size, rank, err=MPI_SUCCESS;
|
2016-03-23 18:21:50 -04:00
|
|
|
ompi_request_t **preq, **reqs;
|
2013-07-25 19:19:41 +00:00
|
|
|
char *tmp_buffer;
|
2014-06-17 06:11:34 +00:00
|
|
|
size_t max_size, rdtype_size;
|
2015-12-17 07:51:24 -08:00
|
|
|
OPAL_PTRDIFF_TYPE ext, gap = 0;
|
2013-07-25 19:19:41 +00:00
|
|
|
|
|
|
|
/* Initialize. */
|
|
|
|
|
|
|
|
size = ompi_comm_size(comm);
|
|
|
|
rank = ompi_comm_rank(comm);
|
2014-06-17 06:11:34 +00:00
|
|
|
ompi_datatype_type_size(rdtype, &rdtype_size);
|
2013-07-25 19:19:41 +00:00
|
|
|
|
|
|
|
/* If only one process, we're done. */
|
2014-06-17 06:11:34 +00:00
|
|
|
if (1 == size || 0 == rdtype_size) {
|
2013-07-25 19:19:41 +00:00
|
|
|
return MPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Find the largest receive amount */
|
|
|
|
ompi_datatype_type_extent (rdtype, &ext);
|
|
|
|
for (i = 0, max_size = 0 ; i < size ; ++i) {
|
2015-10-21 00:55:28 -04:00
|
|
|
size_t size = opal_datatype_span(&rdtype->super, rcounts[i], &gap);
|
2013-07-25 19:19:41 +00:00
|
|
|
max_size = size > max_size ? size : max_size;
|
|
|
|
}
|
2015-10-21 00:55:28 -04:00
|
|
|
/* The gap will always be the same as we are working on the same datatype */
|
2013-07-25 19:19:41 +00:00
|
|
|
|
|
|
|
/* Allocate a temporary buffer */
|
|
|
|
tmp_buffer = calloc (max_size, 1);
|
|
|
|
if (NULL == tmp_buffer) {
|
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2015-10-21 00:55:28 -04:00
|
|
|
tmp_buffer += gap;
|
2013-07-25 19:19:41 +00:00
|
|
|
|
2016-03-23 18:21:50 -04:00
|
|
|
/* Initiate all send/recv to/from others. */
|
|
|
|
reqs = preq = coll_base_comm_get_reqs(base_module->base_data, 2);
|
|
|
|
if( NULL == reqs ) { err = OMPI_ERR_OUT_OF_RESOURCE; goto error_hndl; }
|
|
|
|
|
2013-07-25 19:19:41 +00:00
|
|
|
/* in-place alltoallv slow algorithm (but works) */
|
|
|
|
for (i = 0 ; i < size ; ++i) {
|
|
|
|
for (j = i+1 ; j < size ; ++j) {
|
2016-03-23 18:21:50 -04:00
|
|
|
preq = reqs;
|
2013-07-25 19:19:41 +00:00
|
|
|
|
2014-04-24 20:27:03 +00:00
|
|
|
if (i == rank && rcounts[j]) {
|
2013-07-25 19:19:41 +00:00
|
|
|
/* Copy the data into the temporary buffer */
|
|
|
|
err = ompi_datatype_copy_content_same_ddt (rdtype, rcounts[j],
|
2013-09-17 11:35:18 +00:00
|
|
|
tmp_buffer, (char *) rbuf + rdisps[j] * ext);
|
2013-07-25 19:19:41 +00:00
|
|
|
if (MPI_SUCCESS != err) { goto error_hndl; }
|
|
|
|
|
|
|
|
/* Exchange data with the peer */
|
2013-09-17 11:35:18 +00:00
|
|
|
err = MCA_PML_CALL(irecv ((char *) rbuf + rdisps[j] * ext, rcounts[j], rdtype,
|
2013-07-25 19:19:41 +00:00
|
|
|
j, MCA_COLL_BASE_TAG_ALLTOALLV, comm, preq++));
|
|
|
|
if (MPI_SUCCESS != err) { goto error_hndl; }
|
|
|
|
|
|
|
|
err = MCA_PML_CALL(isend ((void *) tmp_buffer, rcounts[j], rdtype,
|
|
|
|
j, MCA_COLL_BASE_TAG_ALLTOALLV, MCA_PML_BASE_SEND_STANDARD,
|
|
|
|
comm, preq++));
|
|
|
|
if (MPI_SUCCESS != err) { goto error_hndl; }
|
2014-04-24 20:27:03 +00:00
|
|
|
} else if (j == rank && rcounts[i]) {
|
2013-07-25 19:19:41 +00:00
|
|
|
/* Copy the data into the temporary buffer */
|
|
|
|
err = ompi_datatype_copy_content_same_ddt (rdtype, rcounts[i],
|
2013-09-17 11:35:18 +00:00
|
|
|
tmp_buffer, (char *) rbuf + rdisps[i] * ext);
|
2013-07-25 19:19:41 +00:00
|
|
|
if (MPI_SUCCESS != err) { goto error_hndl; }
|
|
|
|
|
|
|
|
/* Exchange data with the peer */
|
2013-09-17 11:35:18 +00:00
|
|
|
err = MCA_PML_CALL(irecv ((char *) rbuf + rdisps[i] * ext, rcounts[i], rdtype,
|
2013-07-25 19:19:41 +00:00
|
|
|
i, MCA_COLL_BASE_TAG_ALLTOALLV, comm, preq++));
|
|
|
|
if (MPI_SUCCESS != err) { goto error_hndl; }
|
|
|
|
|
|
|
|
err = MCA_PML_CALL(isend ((void *) tmp_buffer, rcounts[i], rdtype,
|
|
|
|
i, MCA_COLL_BASE_TAG_ALLTOALLV, MCA_PML_BASE_SEND_STANDARD,
|
|
|
|
comm, preq++));
|
|
|
|
if (MPI_SUCCESS != err) { goto error_hndl; }
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Wait for the requests to complete */
|
2016-03-23 18:21:50 -04:00
|
|
|
err = ompi_request_wait_all (2, reqs, MPI_STATUSES_IGNORE);
|
2013-07-25 19:19:41 +00:00
|
|
|
if (MPI_SUCCESS != err) { goto error_hndl; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
error_hndl:
|
|
|
|
/* Free the temporary buffer */
|
|
|
|
free (tmp_buffer);
|
2015-09-19 21:14:40 -04:00
|
|
|
if( MPI_SUCCESS != err ) {
|
2016-03-23 18:21:50 -04:00
|
|
|
ompi_coll_base_free_reqs(reqs, 2 );
|
2015-09-19 21:14:40 -04:00
|
|
|
}
|
2013-07-25 19:19:41 +00:00
|
|
|
|
|
|
|
/* All done */
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2008-05-07 02:31:24 +00:00
|
|
|
int
|
2015-08-28 16:43:13 +09:00
|
|
|
ompi_coll_base_alltoallv_intra_pairwise(const void *sbuf, const int *scounts, const int *sdisps,
|
2008-05-07 02:31:24 +00:00
|
|
|
struct ompi_datatype_t *sdtype,
|
2015-08-28 16:43:13 +09:00
|
|
|
void* rbuf, const int *rcounts, const int *rdisps,
|
2008-05-07 02:31:24 +00:00
|
|
|
struct ompi_datatype_t *rdtype,
|
|
|
|
struct ompi_communicator_t *comm,
|
2008-07-28 22:40:57 +00:00
|
|
|
mca_coll_base_module_t *module)
|
2008-05-07 02:31:24 +00:00
|
|
|
{
|
2012-10-08 21:34:26 +00:00
|
|
|
int line = -1, err = 0, rank, size, step = 0, sendto, recvfrom;
|
2008-05-07 02:31:24 +00:00
|
|
|
void *psnd, *prcv;
|
|
|
|
ptrdiff_t sext, rext;
|
|
|
|
|
2013-07-25 19:19:41 +00:00
|
|
|
if (MPI_IN_PLACE == sbuf) {
|
2015-02-15 14:47:27 -05:00
|
|
|
return mca_coll_base_alltoallv_intra_basic_inplace (rbuf, rcounts, rdisps,
|
2013-07-25 19:19:41 +00:00
|
|
|
rdtype, comm, module);
|
|
|
|
}
|
|
|
|
|
2008-05-07 02:31:24 +00:00
|
|
|
size = ompi_comm_size(comm);
|
|
|
|
rank = ompi_comm_rank(comm);
|
|
|
|
|
2015-02-15 14:47:27 -05:00
|
|
|
OPAL_OUTPUT((ompi_coll_base_framework.framework_output,
|
|
|
|
"coll:base:alltoallv_intra_pairwise rank %d", rank));
|
2008-05-07 02:31:24 +00:00
|
|
|
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 04:56:31 +00:00
|
|
|
ompi_datatype_type_extent(sdtype, &sext);
|
|
|
|
ompi_datatype_type_extent(rdtype, &rext);
|
2008-05-07 02:31:24 +00:00
|
|
|
|
2012-10-08 21:34:26 +00:00
|
|
|
/* Perform pairwise exchange starting from 1 since local exhange is done */
|
|
|
|
for (step = 0; step < size; step++) {
|
2008-05-07 02:31:24 +00:00
|
|
|
|
|
|
|
/* Determine sender and receiver for this step. */
|
|
|
|
sendto = (rank + step) % size;
|
|
|
|
recvfrom = (rank + size - step) % size;
|
|
|
|
|
|
|
|
/* Determine sending and receiving locations */
|
2012-03-05 22:23:44 +00:00
|
|
|
psnd = (char*)sbuf + (ptrdiff_t)sdisps[sendto] * sext;
|
|
|
|
prcv = (char*)rbuf + (ptrdiff_t)rdisps[recvfrom] * rext;
|
2008-05-07 02:31:24 +00:00
|
|
|
|
|
|
|
/* send and receive */
|
2015-02-15 14:47:27 -05:00
|
|
|
err = ompi_coll_base_sendrecv( psnd, scounts[sendto], sdtype, sendto,
|
2008-05-07 02:31:24 +00:00
|
|
|
MCA_COLL_BASE_TAG_ALLTOALLV,
|
2015-02-15 14:47:27 -05:00
|
|
|
prcv, rcounts[recvfrom], rdtype, recvfrom,
|
2008-05-07 02:31:24 +00:00
|
|
|
MCA_COLL_BASE_TAG_ALLTOALLV,
|
|
|
|
comm, MPI_STATUS_IGNORE, rank);
|
2012-10-08 21:34:26 +00:00
|
|
|
if (MPI_SUCCESS != err) { line = __LINE__; goto err_hndl; }
|
2008-05-07 02:31:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return MPI_SUCCESS;
|
2015-02-15 14:47:27 -05:00
|
|
|
|
2008-05-07 02:31:24 +00:00
|
|
|
err_hndl:
|
2015-02-15 14:47:27 -05:00
|
|
|
OPAL_OUTPUT((ompi_coll_base_framework.framework_output,
|
|
|
|
"%s:%4d\tError occurred %d, rank %2d at step %d", __FILE__, line,
|
2012-10-08 21:34:26 +00:00
|
|
|
err, rank, step));
|
2015-12-17 07:51:24 -08:00
|
|
|
(void)line; // silence compiler warning
|
2008-05-07 02:31:24 +00:00
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2015-02-15 14:47:27 -05:00
|
|
|
/**
|
2008-05-07 02:31:24 +00:00
|
|
|
* Linear functions are copied from the basic coll module. For
|
|
|
|
* some small number of nodes and/or small data sizes they are just as
|
2015-02-15 14:47:27 -05:00
|
|
|
* fast as base/tree based segmenting operations and as such may be
|
2008-05-07 02:31:24 +00:00
|
|
|
* selected by the decision functions. These are copied into this module
|
|
|
|
* due to the way we select modules in V1. i.e. in V2 we will handle this
|
2015-02-15 14:47:27 -05:00
|
|
|
* differently and so will not have to duplicate code.
|
2008-05-07 02:31:24 +00:00
|
|
|
*/
|
|
|
|
int
|
2015-08-28 16:43:13 +09:00
|
|
|
ompi_coll_base_alltoallv_intra_basic_linear(const void *sbuf, const int *scounts, const int *sdisps,
|
2008-05-07 02:31:24 +00:00
|
|
|
struct ompi_datatype_t *sdtype,
|
2015-08-28 16:43:13 +09:00
|
|
|
void *rbuf, const int *rcounts, const int *rdisps,
|
2008-05-07 02:31:24 +00:00
|
|
|
struct ompi_datatype_t *rdtype,
|
|
|
|
struct ompi_communicator_t *comm,
|
2008-07-28 22:40:57 +00:00
|
|
|
mca_coll_base_module_t *module)
|
2008-05-07 02:31:24 +00:00
|
|
|
{
|
2012-04-06 15:48:07 +00:00
|
|
|
int i, size, rank, err, nreqs;
|
2008-05-07 02:31:24 +00:00
|
|
|
char *psnd, *prcv;
|
|
|
|
ptrdiff_t sext, rext;
|
2016-03-23 18:21:50 -04:00
|
|
|
ompi_request_t **preq, **reqs;
|
2015-02-15 14:47:27 -05:00
|
|
|
mca_coll_base_module_t *base_module = (mca_coll_base_module_t*) module;
|
|
|
|
mca_coll_base_comm_t *data = base_module->base_data;
|
2008-05-07 02:31:24 +00:00
|
|
|
|
2013-07-25 19:19:41 +00:00
|
|
|
if (MPI_IN_PLACE == sbuf) {
|
2015-02-15 14:47:27 -05:00
|
|
|
return mca_coll_base_alltoallv_intra_basic_inplace (rbuf, rcounts, rdisps,
|
2013-07-25 19:19:41 +00:00
|
|
|
rdtype, comm, module);
|
|
|
|
}
|
|
|
|
|
2008-05-07 02:31:24 +00:00
|
|
|
size = ompi_comm_size(comm);
|
|
|
|
rank = ompi_comm_rank(comm);
|
|
|
|
|
2015-02-15 14:47:27 -05:00
|
|
|
OPAL_OUTPUT((ompi_coll_base_framework.framework_output,
|
|
|
|
"coll:base:alltoallv_intra_basic_linear rank %d", rank));
|
2008-05-23 13:57:55 +00:00
|
|
|
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 04:56:31 +00:00
|
|
|
ompi_datatype_type_extent(sdtype, &sext);
|
|
|
|
ompi_datatype_type_extent(rdtype, &rext);
|
2008-05-07 02:31:24 +00:00
|
|
|
|
|
|
|
/* Simple optimization - handle send to self first */
|
2012-03-05 22:23:44 +00:00
|
|
|
psnd = ((char *) sbuf) + (ptrdiff_t)sdisps[rank] * sext;
|
|
|
|
prcv = ((char *) rbuf) + (ptrdiff_t)rdisps[rank] * rext;
|
2008-05-07 02:31:24 +00:00
|
|
|
if (0 != scounts[rank]) {
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 04:56:31 +00:00
|
|
|
err = ompi_datatype_sndrcv(psnd, scounts[rank], sdtype,
|
2008-05-07 02:31:24 +00:00
|
|
|
prcv, rcounts[rank], rdtype);
|
|
|
|
if (MPI_SUCCESS != err) {
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If only one process, we're done. */
|
|
|
|
if (1 == size) {
|
|
|
|
return MPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now, initiate all send/recv to/from others. */
|
|
|
|
nreqs = 0;
|
2016-03-23 18:21:50 -04:00
|
|
|
reqs = preq = coll_base_comm_get_reqs(data, 2 * size);
|
|
|
|
if( NULL == reqs ) { err = OMPI_ERR_OUT_OF_RESOURCE; goto err_hndl; }
|
2008-05-07 02:31:24 +00:00
|
|
|
|
|
|
|
/* Post all receives first */
|
|
|
|
for (i = 0; i < size; ++i) {
|
|
|
|
if (i == rank || 0 == rcounts[i]) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2016-03-23 18:21:50 -04:00
|
|
|
++nreqs;
|
2012-03-05 22:23:44 +00:00
|
|
|
prcv = ((char *) rbuf) + (ptrdiff_t)rdisps[i] * rext;
|
2008-05-07 02:31:24 +00:00
|
|
|
err = MCA_PML_CALL(irecv_init(prcv, rcounts[i], rdtype,
|
|
|
|
i, MCA_COLL_BASE_TAG_ALLTOALLV, comm,
|
|
|
|
preq++));
|
2016-03-23 18:21:50 -04:00
|
|
|
if (MPI_SUCCESS != err) { goto err_hndl; }
|
2008-05-07 02:31:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Now post all sends */
|
|
|
|
for (i = 0; i < size; ++i) {
|
|
|
|
if (i == rank || 0 == scounts[i]) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2016-03-23 18:21:50 -04:00
|
|
|
++nreqs;
|
2012-03-05 22:23:44 +00:00
|
|
|
psnd = ((char *) sbuf) + (ptrdiff_t)sdisps[i] * sext;
|
2008-05-07 02:31:24 +00:00
|
|
|
err = MCA_PML_CALL(isend_init(psnd, scounts[i], sdtype,
|
|
|
|
i, MCA_COLL_BASE_TAG_ALLTOALLV,
|
|
|
|
MCA_PML_BASE_SEND_STANDARD, comm,
|
|
|
|
preq++));
|
2016-03-23 18:21:50 -04:00
|
|
|
if (MPI_SUCCESS != err) { goto err_hndl; }
|
2008-05-07 02:31:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Start your engines. This will never return an error. */
|
2016-03-23 18:21:50 -04:00
|
|
|
MCA_PML_CALL(start(nreqs, reqs));
|
2008-05-07 02:31:24 +00:00
|
|
|
|
|
|
|
/* Wait for them all. If there's an error, note that we don't care
|
|
|
|
* what the error was -- just that there *was* an error. The PML
|
|
|
|
* will finish all requests, even if one or more of them fail.
|
|
|
|
* i.e., by the end of this call, all the requests are free-able.
|
|
|
|
* So free them anyway -- even if there was an error, and return the
|
|
|
|
* error after we free everything. */
|
2016-03-23 18:21:50 -04:00
|
|
|
err = ompi_request_wait_all(nreqs, reqs, MPI_STATUSES_IGNORE);
|
|
|
|
if( MPI_SUCCESS == err )
|
|
|
|
return MPI_SUCCESS;
|
2015-09-19 21:14:40 -04:00
|
|
|
err_hndl:
|
2015-09-23 10:59:45 +02:00
|
|
|
/* Free the requests in all cases as they are persistent */
|
2016-03-23 18:21:50 -04:00
|
|
|
ompi_coll_base_free_reqs(reqs, nreqs);
|
2008-05-07 02:31:24 +00:00
|
|
|
|
|
|
|
return err;
|
|
|
|
}
|