From 14ee1b7ba2fda75144b70a1bec4e6382716a8a37 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 12 Mar 2009 02:23:08 +0000 Subject: [PATCH] Refs trac:1826: remove barriers before all non-rooted collective ops. This commit was SVN r20763. The following Trac tickets were found above: Ticket 1826 --> https://svn.open-mpi.org/trac/ompi/ticket/1826 --- ompi/mca/coll/sync/Makefile.am | 6 --- ompi/mca/coll/sync/coll_sync.h | 46 -------------------- ompi/mca/coll/sync/coll_sync_allgather.c | 49 ---------------------- ompi/mca/coll/sync/coll_sync_allgatherv.c | 51 ----------------------- ompi/mca/coll/sync/coll_sync_allreduce.c | 48 --------------------- ompi/mca/coll/sync/coll_sync_alltoall.c | 51 ----------------------- ompi/mca/coll/sync/coll_sync_alltoallv.c | 51 ----------------------- ompi/mca/coll/sync/coll_sync_alltoallw.c | 51 ----------------------- ompi/mca/coll/sync/coll_sync_module.c | 26 ++++-------- 9 files changed, 8 insertions(+), 371 deletions(-) delete mode 100644 ompi/mca/coll/sync/coll_sync_allgather.c delete mode 100644 ompi/mca/coll/sync/coll_sync_allgatherv.c delete mode 100644 ompi/mca/coll/sync/coll_sync_allreduce.c delete mode 100644 ompi/mca/coll/sync/coll_sync_alltoall.c delete mode 100644 ompi/mca/coll/sync/coll_sync_alltoallv.c delete mode 100644 ompi/mca/coll/sync/coll_sync_alltoallw.c diff --git a/ompi/mca/coll/sync/Makefile.am b/ompi/mca/coll/sync/Makefile.am index 0d6547ab7f..7bafa3c40e 100644 --- a/ompi/mca/coll/sync/Makefile.am +++ b/ompi/mca/coll/sync/Makefile.am @@ -21,12 +21,6 @@ sources = \ coll_sync.h \ coll_sync_component.c \ coll_sync_module.c \ - coll_sync_allgather.c \ - coll_sync_allgatherv.c \ - coll_sync_allreduce.c \ - coll_sync_alltoall.c \ - coll_sync_alltoallv.c \ - coll_sync_alltoallw.c \ coll_sync_bcast.c \ coll_sync_exscan.c \ coll_sync_gather.c \ diff --git a/ompi/mca/coll/sync/coll_sync.h b/ompi/mca/coll/sync/coll_sync.h index f6ac2c3d73..ae7ebfd4c1 100644 --- a/ompi/mca/coll/sync/coll_sync.h +++ b/ompi/mca/coll/sync/coll_sync.h @@ -45,52 +45,6 @@ mca_coll_base_module_t int mca_coll_sync_module_enable(mca_coll_base_module_t *module, struct ompi_communicator_t *comm); -int mca_coll_sync_allgather(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, - void *rbuf, int rcount, - struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module); - -int mca_coll_sync_allgatherv(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, - void *rbuf, int *rcounts, - int *disps, - struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module); - -int mca_coll_sync_allreduce(void *sbuf, void *rbuf, int count, - struct ompi_datatype_t *dtype, - struct ompi_op_t *op, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module); - -int mca_coll_sync_alltoall(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, - void *rbuf, int rcount, - struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module); - -int mca_coll_sync_alltoallv(void *sbuf, int *scounts, - int *sdisps, - struct ompi_datatype_t *sdtype, - void *rbuf, int *rcounts, - int *rdisps, - struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module); - -int mca_coll_sync_alltoallw(void *sbuf, int *scounts, - int *sdisps, - struct ompi_datatype_t **sdtypes, - void *rbuf, int *rcounts, - int *rdisps, - struct ompi_datatype_t **rdtypes, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module); - int mca_coll_sync_barrier(struct ompi_communicator_t *comm, mca_coll_base_module_t *module); diff --git a/ompi/mca/coll/sync/coll_sync_allgather.c b/ompi/mca/coll/sync/coll_sync_allgather.c deleted file mode 100644 index 9d5c239ec2..0000000000 --- a/ompi/mca/coll/sync/coll_sync_allgather.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University - * 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) 2009 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "ompi_config.h" - -#include "coll_sync.h" - - -/* - * allgather - * - * Function: - allgather using other MPI collections - * Accepts: - same as MPI_Allgather() - * Returns: - MPI_SUCCESS or error code - */ -int mca_coll_sync_allgather(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, void *rbuf, - int rcount, struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module) -{ - mca_coll_sync_module_t *s = (mca_coll_sync_module_t*) module; - - if (s->in_operation) { - return s->c_coll.coll_allgather(sbuf, scount, sdtype, rbuf, rcount, - rdtype, comm, - s->c_coll.coll_allgather_module); - } else { - COLL_SYNC(s, s->c_coll.coll_allgather(sbuf, scount, sdtype, rbuf, - rcount, rdtype, comm, - s->c_coll.coll_allgather_module)); - } -} diff --git a/ompi/mca/coll/sync/coll_sync_allgatherv.c b/ompi/mca/coll/sync/coll_sync_allgatherv.c deleted file mode 100644 index cd2145d310..0000000000 --- a/ompi/mca/coll/sync/coll_sync_allgatherv.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University - * 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) 2009 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "ompi_config.h" - -#include "coll_sync.h" - - -/* - * allgatherv - * - * Function: - allgatherv - * Accepts: - same as MPI_Allgatherv() - * Returns: - MPI_SUCCESS or error code - */ -int mca_coll_sync_allgatherv(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, - void *rbuf, int *rcounts, int *disps, - struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module) -{ - mca_coll_sync_module_t *s = (mca_coll_sync_module_t*) module; - - if (s->in_operation) { - return s->c_coll.coll_allgatherv(sbuf, scount, sdtype, rbuf, rcounts, - disps, rdtype, comm, - s->c_coll.coll_allgatherv_module); - } else { - COLL_SYNC(s, s->c_coll.coll_allgatherv(sbuf, scount, sdtype, - rbuf, rcounts, - disps, rdtype, comm, - s->c_coll.coll_allgatherv_module)); - } -} diff --git a/ompi/mca/coll/sync/coll_sync_allreduce.c b/ompi/mca/coll/sync/coll_sync_allreduce.c deleted file mode 100644 index e68d8bda6a..0000000000 --- a/ompi/mca/coll/sync/coll_sync_allreduce.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - * 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) 2009 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "ompi_config.h" - -#include "coll_sync.h" - - -/* - * allreduce - * - * Function: - allreduce - * Accepts: - same as MPI_Allreduce() - * Returns: - MPI_SUCCESS or error code - */ -int mca_coll_sync_allreduce(void *sbuf, void *rbuf, int count, - struct ompi_datatype_t *dtype, - struct ompi_op_t *op, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module) -{ - mca_coll_sync_module_t *s = (mca_coll_sync_module_t*) module; - - if (s->in_operation) { - return s->c_coll.coll_allreduce(sbuf, rbuf, count, dtype, op, comm, - s->c_coll.coll_allreduce_module); - } else { - COLL_SYNC(s, s->c_coll.coll_allreduce(sbuf, rbuf, count, dtype, - op, comm, - s->c_coll.coll_allreduce_module)); - } -} diff --git a/ompi/mca/coll/sync/coll_sync_alltoall.c b/ompi/mca/coll/sync/coll_sync_alltoall.c deleted file mode 100644 index e2fa3e8c58..0000000000 --- a/ompi/mca/coll/sync/coll_sync_alltoall.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - * 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) 2009 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "ompi_config.h" - -#include "coll_sync.h" - - -/* - * alltoall_intra - * - * Function: - MPI_Alltoall - * Accepts: - same as MPI_Alltoall() - * Returns: - MPI_SUCCESS or an MPI error code - */ -int mca_coll_sync_alltoall(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, - void *rbuf, int rcount, - struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module) -{ - mca_coll_sync_module_t *s = (mca_coll_sync_module_t*) module; - - if (s->in_operation) { - return s->c_coll.coll_alltoall(sbuf, scount, sdtype, rbuf, rcount, - rdtype, comm, - s->c_coll.coll_alltoall_module); - } else { - COLL_SYNC(s, s->c_coll.coll_alltoall(sbuf, scount, sdtype, - rbuf, rcount, - rdtype, comm, - s->c_coll.coll_alltoall_module)); - } -} diff --git a/ompi/mca/coll/sync/coll_sync_alltoallv.c b/ompi/mca/coll/sync/coll_sync_alltoallv.c deleted file mode 100644 index 21fae56e86..0000000000 --- a/ompi/mca/coll/sync/coll_sync_alltoallv.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - * 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) 2009 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "ompi_config.h" - -#include "coll_sync.h" - - -/* - * alltoallv - * - * Function: - MPI_Alltoallv - * Accepts: - same as MPI_Alltoallv() - * Returns: - MPI_SUCCESS or an MPI error code - */ -int mca_coll_sync_alltoallv(void *sbuf, int *scounts, int *sdisps, - struct ompi_datatype_t *sdtype, - void *rbuf, int *rcounts, int *rdisps, - struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module) -{ - mca_coll_sync_module_t *s = (mca_coll_sync_module_t*) module; - - if (s->in_operation) { - return s->c_coll.coll_alltoallv(sbuf, scounts, sdisps, sdtype, - rbuf, rcounts, rdisps, rdtype, comm, - s->c_coll.coll_alltoallv_module); - } else { - COLL_SYNC(s, s->c_coll.coll_alltoallv(sbuf, scounts, sdisps, sdtype, - rbuf, rcounts, rdisps, rdtype, - comm, - s->c_coll.coll_alltoallv_module)); - } -} diff --git a/ompi/mca/coll/sync/coll_sync_alltoallw.c b/ompi/mca/coll/sync/coll_sync_alltoallw.c deleted file mode 100644 index 9fe04749f5..0000000000 --- a/ompi/mca/coll/sync/coll_sync_alltoallw.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - * 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) 2009 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "ompi_config.h" - -#include "coll_sync.h" - - -/* - * alltoallw - * - * Function: - MPI_Alltoallw - * Accepts: - same as MPI_Alltoallw() - * Returns: - MPI_SUCCESS or an MPI error code - */ -int mca_coll_sync_alltoallw(void *sbuf, int *scounts, int *sdisps, - struct ompi_datatype_t **sdtypes, - void *rbuf, int *rcounts, int *rdisps, - struct ompi_datatype_t **rdtypes, - struct ompi_communicator_t *comm, - mca_coll_base_module_t *module) -{ - mca_coll_sync_module_t *s = (mca_coll_sync_module_t*) module; - - if (s->in_operation) { - return s->c_coll.coll_alltoallw(sbuf, scounts, sdisps, sdtypes, - rbuf, rcounts, rdisps, rdtypes, comm, - s->c_coll.coll_alltoallw_module); - } else { - COLL_SYNC(s, s->c_coll.coll_alltoallw(sbuf, scounts, sdisps, sdtypes, - rbuf, rcounts, rdisps, rdtypes, - comm, - s->c_coll.coll_alltoallw_module)); - } -} diff --git a/ompi/mca/coll/sync/coll_sync_module.c b/ompi/mca/coll/sync/coll_sync_module.c index 0c777b5805..8af4ad61c5 100644 --- a/ompi/mca/coll/sync/coll_sync_module.c +++ b/ompi/mca/coll/sync/coll_sync_module.c @@ -43,12 +43,6 @@ static void mca_coll_sync_module_construct(mca_coll_sync_module_t *module) static void mca_coll_sync_module_destruct(mca_coll_sync_module_t *module) { - OBJ_RELEASE(module->c_coll.coll_allgather_module); - OBJ_RELEASE(module->c_coll.coll_allgatherv_module); - OBJ_RELEASE(module->c_coll.coll_allreduce_module); - OBJ_RELEASE(module->c_coll.coll_alltoall_module); - OBJ_RELEASE(module->c_coll.coll_alltoallv_module); - OBJ_RELEASE(module->c_coll.coll_alltoallw_module); OBJ_RELEASE(module->c_coll.coll_bcast_module); OBJ_RELEASE(module->c_coll.coll_gather_module); OBJ_RELEASE(module->c_coll.coll_gatherv_module); @@ -111,12 +105,14 @@ mca_coll_sync_comm_query(struct ompi_communicator_t *comm, sync_module->super.coll_module_enable = mca_coll_sync_module_enable; sync_module->super.ft_event = mca_coll_sync_ft_event; - sync_module->super.coll_allgather = mca_coll_sync_allgather; - sync_module->super.coll_allgatherv = mca_coll_sync_allgatherv; - sync_module->super.coll_allreduce = mca_coll_sync_allreduce; - sync_module->super.coll_alltoall = mca_coll_sync_alltoall; - sync_module->super.coll_alltoallv = mca_coll_sync_alltoallv; - sync_module->super.coll_alltoallw = mca_coll_sync_alltoallw; + /* The "all" versions are already synchronous. So no need for an + additional barrier there. */ + sync_module->super.coll_allgather = NULL; + sync_module->super.coll_allgatherv = NULL; + sync_module->super.coll_allreduce = NULL; + sync_module->super.coll_alltoall = NULL; + sync_module->super.coll_alltoallv = NULL; + sync_module->super.coll_alltoallw = NULL; sync_module->super.coll_barrier = NULL; sync_module->super.coll_bcast = mca_coll_sync_bcast; sync_module->super.coll_exscan = mca_coll_sync_exscan; @@ -153,12 +149,6 @@ int mca_coll_sync_module_enable(mca_coll_base_module_t *module, OBJ_RETAIN(s->c_coll.coll_ ## name ## _module); \ } - CHECK_AND_RETAIN(allgather); - CHECK_AND_RETAIN(allgatherv); - CHECK_AND_RETAIN(allreduce); - CHECK_AND_RETAIN(alltoall); - CHECK_AND_RETAIN(alltoallv); - CHECK_AND_RETAIN(alltoallw); CHECK_AND_RETAIN(bcast); CHECK_AND_RETAIN(gather); CHECK_AND_RETAIN(gatherv);