From 97d5f615587d02c74cadb95c2e6cd313eb694022 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sun, 30 Jan 2005 01:42:57 +0000 Subject: [PATCH] Commit second cut of the sm component shell -- nothing implemented yet. This commit was SVN r4247. --- src/mca/coll/sm/.ompi_unignore | 1 + src/mca/coll/sm/Makefile.am | 13 +- src/mca/coll/sm/coll_sm.c | 191 ------------------ src/mca/coll/sm/coll_sm.h | 151 +++++++++----- src/mca/coll/sm/coll_sm_allgather.c | 21 +- src/mca/coll/sm/coll_sm_allgatherv.c | 35 ++++ src/mca/coll/sm/coll_sm_allreduce.c | 34 ++++ src/mca/coll/sm/coll_sm_alltoall.c | 18 +- src/mca/coll/sm/coll_sm_alltoallv.c | 35 ++++ src/mca/coll/sm/coll_sm_alltoallw.c | 35 ++++ src/mca/coll/sm/coll_sm_barrier.c | 12 +- src/mca/coll/sm/coll_sm_bcast.c | 19 +- src/mca/coll/sm/coll_sm_component.c | 79 +++++--- src/mca/coll/sm/coll_sm_exscan.c | 34 ++++ src/mca/coll/sm/coll_sm_gather.c | 18 +- src/mca/coll/sm/coll_sm_gatherv.c | 35 ++++ src/mca/coll/sm/coll_sm_module.c | 145 +++++++++++++ src/mca/coll/sm/coll_sm_reduce.c | 18 +- src/mca/coll/sm/coll_sm_reduce_scatter.c | 34 ++++ .../sm/{coll_sm_util.c => coll_sm_scan.c} | 23 ++- src/mca/coll/sm/coll_sm_scatter.c | 18 +- src/mca/coll/sm/coll_sm_scatterv.c | 35 ++++ src/mca/coll/sm/configure.params | 2 - 23 files changed, 644 insertions(+), 362 deletions(-) create mode 100644 src/mca/coll/sm/.ompi_unignore delete mode 100644 src/mca/coll/sm/coll_sm.c create mode 100644 src/mca/coll/sm/coll_sm_allgatherv.c create mode 100644 src/mca/coll/sm/coll_sm_allreduce.c create mode 100644 src/mca/coll/sm/coll_sm_alltoallv.c create mode 100644 src/mca/coll/sm/coll_sm_alltoallw.c create mode 100644 src/mca/coll/sm/coll_sm_exscan.c create mode 100644 src/mca/coll/sm/coll_sm_gatherv.c create mode 100644 src/mca/coll/sm/coll_sm_module.c create mode 100644 src/mca/coll/sm/coll_sm_reduce_scatter.c rename src/mca/coll/sm/{coll_sm_util.c => coll_sm_scan.c} (53%) create mode 100644 src/mca/coll/sm/coll_sm_scatterv.c diff --git a/src/mca/coll/sm/.ompi_unignore b/src/mca/coll/sm/.ompi_unignore new file mode 100644 index 0000000000..814285c7e5 --- /dev/null +++ b/src/mca/coll/sm/.ompi_unignore @@ -0,0 +1 @@ +jsquyres diff --git a/src/mca/coll/sm/Makefile.am b/src/mca/coll/sm/Makefile.am index c4eed05926..bc4f95d092 100644 --- a/src/mca/coll/sm/Makefile.am +++ b/src/mca/coll/sm/Makefile.am @@ -20,15 +20,24 @@ EXTRA_DIST = VERSION sources = \ coll_sm.h \ - coll_sm.c \ coll_sm_allgather.c \ + coll_sm_allgatherv.c \ + coll_sm_allreduce.c \ coll_sm_alltoall.c \ + coll_sm_alltoallv.c \ + coll_sm_alltoallw.c \ coll_sm_barrier.c \ coll_sm_bcast.c \ coll_sm_component.c \ coll_sm_gather.c \ + coll_sm_gatherv.c \ + coll_sm_module.c \ coll_sm_reduce.c \ - coll_sm_scatter.c + coll_sm_reduce_scatter.c \ + coll_sm_scan.c \ + coll_sm_exscan.c \ + coll_sm_scatter.c \ + coll_sm_scatterv.c # Make the output library in this directory, and name it either # mca__.la (for DSO builds) or libmca__.la diff --git a/src/mca/coll/sm/coll_sm.c b/src/mca/coll/sm/coll_sm.c deleted file mode 100644 index aa6e9320c3..0000000000 --- a/src/mca/coll/sm/coll_sm.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "ompi_config.h" - -#include - -#include "mpi.h" -#include "communicator/communicator.h" -#include "mca/coll/coll.h" -#include "mca/coll/base/base.h" -#include "coll_sm.h" - - -/* - * Linear set of collective algorithms - */ -static const mca_coll_base_module_1_0_0_t sm_func_ptrs = { - - /* Initialization / finalization functions */ - - mca_coll_sm_module_init, - mca_coll_sm_module_finalize, - - /* Collective function pointers */ - - mca_coll_sm_allgather, - NULL, /* Goto basic */ - NULL, - mca_coll_sm_alltoall, - NULL, - NULL, - mca_coll_sm_barrier, - mca_coll_sm_bcast, - NULL, - mca_coll_sm_gather, - NULL, - mca_coll_sm_reduce, - NULL, - NULL, - mca_coll_sm_scatter, - NULL -}; - - -/* Open function to initialize a few parameters and return success for - * selection - */ -int mca_coll_sm_open(void) -{ - /* VPS: Initialize some run-time MCA parameters here - if required - - such as "sm_message_pool_size" or "sm_number_of_segments", - that kinda. For example: - mca_base_param_register_int("coll", "sm", "message_pool_size", - NULL, 1024) - */ - return 1; -} - - -/* - * Anything that needs to be done which is opposite of what was done - * in open() should be done here. If nothing, just return OMPI_SUCCESS - */ -int mca_coll_sm_close(void) -{ - return OMPI_SUCCESS; -} - - -/* - * Initial query function that is invoked during MPI_INIT, allowing - * this module to indicate what level of thread support it provides. - */ -int mca_coll_sm_init_query(bool *allow_multi_user_threads, - bool *have_hidden_user_threads) -{ - *allow_multi_user_threads = true; - *have_hidden_user_threads = false; - - /* VPS: Nothing else needs to be done here */ - - return OMPI_SUCCESS; -} - - -/* - * Invoked when there's a new communicator that has been created. - * Look at the communicator and decide which set of functions and - * priority we want to return. - */ -const mca_coll_base_module_1_0_0_t * -mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority) -{ - - /* Abort if intercomm */ - - if (OMPI_COMM_IS_INTER(comm)) - return NULL; - - /* VPS: Find out whether all the processes in the comm are on the - same node - if not, return NULL */ - - /* VPS: Decide what needs to be done if only one process - if only - one process, return NULL, so that "basic" module can be - picked */ - - /* VPS: Now check if enough shared memory can be allocated for - this communicator. First allocate space for the local per - communicator structure. Lowest ranked process will create the - area and send the shmid to rest of the processes. All other - processes will see if they can attach to it. If yes then - success otherwise they will return NULL - */ - - /* Set the default priority */ - - *priority = 50; - - /* VPS: Get "basic" coll module function pointers so that we can - use them for some collective operations that we may need to do - now */ - - /* VPS: If required allreduce - using basic fn ptrs to confirm - that all the processes have successfully attached the shared - memory buffer */ - - /* VPS: Return the function pointer struct for basic coll got - above, the sm coll function pointers will be returned during - "init" of comm below */ -} - - -/* - * Unquery the coll on comm - */ -int -mca_coll_sm_comm_unquery(struct ompi_communicator_t *comm) -{ - - /* VPS: do the reverse of what was done in query. Can do the following - things: - - free the sm coll specific data on the comm - - remove the shared memory area that was allocated - */ - - return OMPI_SUCCESS; -} - - -/* - * Init module on the communicator - */ -const struct mca_coll_base_module_1_0_0_t * -mca_coll_sm_module_init(struct ompi_communicator_t *comm) -{ - /* VPS: When this module has been selected, it's all about creating and - * initializing the module-specific data that hangs off the - * communicator. - */ - - /* VPS: Allocate and initialize the data that hangs off the - communicator */ - - /* VPS: Now return the SM coll specific function pointers */ -} - - -/* - * Finalize module on the communicator - */ -int mca_coll_sm_module_finalize(struct ompi_communicator_t *comm) -{ - /* VPS: Free data which was allocated during init */ - - /* VPS: Can also inturn call mca_coll_sm_comm_unquery to finalize - other things */ -} - - diff --git a/src/mca/coll/sm/coll_sm.h b/src/mca/coll/sm/coll_sm.h index ffbf8408d8..560653acca 100644 --- a/src/mca/coll/sm/coll_sm.h +++ b/src/mca/coll/sm/coll_sm.h @@ -27,76 +27,129 @@ extern "C" { #define PUB(foo) mca_coll_sm##foo -/* Structure for sm collective module, per communicator. The structure - mainly stores memory pointers to the specific poritions in the shared - memory area. Each shared memory area is reserved for special functions. - The shared memory is split between two types of areas. One is control - section that stores shared flags used during synchronization, while other - section is purely used to pass messages from one process to other. */ + /* Structure for sm collective module, per communicator. The + structure mainly stores memory pointers to the specific + poritions in the shared memory area. Each shared memory area is + reserved for special functions. The shared memory is split + between two types of areas. One is control section that stores + shared flags used during synchronization, while other section + is purely used to pass messages from one process to other. */ -typedef struct mca_coll_base_module_comm_t { + typedef struct mca_coll_base_module_comm_t { - /* VPS: SM collective specific data to be cached on each comm goes - here */ + /* JMS fill in here */ + int foo; -} mca_coll_base_module_comm_t; + } mca_coll_base_module_comm_t; + + /* + * Globally exported variables + */ -/* - * Globally exported variables - */ - -OMPI_DECLSPEC extern const mca_coll_base_component_1_0_0_t mca_coll_sm_component; + OMPI_DECLSPEC extern const mca_coll_base_component_1_0_0_t mca_coll_sm_component; + OMPI_DECLSPEC extern int mca_coll_sm_param_priority; /* - * coll API functions + * coll module functions */ - int mca_coll_sm_open(void); - int mca_coll_sm_close(void); - int mca_coll_sm_init_query(bool *allow_multi_user_threads, bool *have_hidden_threads); const struct mca_coll_base_module_1_0_0_t * - mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority); + mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority, + mca_coll_base_module_comm_t **data); - int mca_coll_sm_comm_unquery(struct ompi_communicator_t *comm); + int mca_coll_sm_comm_unquery(struct ompi_communicator_t *comm, + mca_coll_base_module_comm_t *data); const struct mca_coll_base_module_1_0_0_t * mca_coll_sm_module_init(struct ompi_communicator_t *comm); int mca_coll_sm_module_finalize(struct ompi_communicator_t *comm); - - int mca_coll_sm_barrier(struct ompi_communicator_t *comm); - int mca_coll_sm_bcast(void *buff, int count, - struct ompi_datatype_t *datatype, int root, - struct ompi_communicator_t *comm); - int mca_coll_sm_scatter(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, void *rbuf, - int rcount, struct ompi_datatype_t *rdtype, - int root, struct ompi_communicator_t *comm); - int mca_coll_sm_reduce(void *sbuf, void* rbuf, int count, - struct ompi_datatype_t *dtype, - struct ompi_op_t *op, - int root, struct ompi_communicator_t *comm); - int mca_coll_sm_gather(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, void *rbuf, - int rcount, struct ompi_datatype_t *rdtype, - int root, struct ompi_communicator_t *comm); - int mca_coll_sm_alltoall(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, void *rbuf, - int rcount, struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm); - int mca_coll_sm_allgather(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, void *rbuf, - int rcount, struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm); - - /* VPS: Any other module utility function prototypes can go in here */ - + int mca_coll_sm_allgather_intra(void *sbuf, int scount, + struct ompi_datatype_t *sdtype, + void *rbuf, int rcount, + struct ompi_datatype_t *rdtype, + struct ompi_communicator_t *comm); + int mca_coll_sm_allgatherv_intra(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); + int mca_coll_sm_allreduce_intra(void *sbuf, void *rbuf, int count, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + struct ompi_communicator_t *comm); + int mca_coll_sm_alltoall_intra(void *sbuf, int scount, + struct ompi_datatype_t *sdtype, + void* rbuf, int rcount, + struct ompi_datatype_t *rdtype, + struct ompi_communicator_t *comm); + int mca_coll_sm_alltoallv_intra(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); + int mca_coll_sm_alltoallw_intra(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); + int mca_coll_sm_barrier_intra(struct ompi_communicator_t *comm); + int mca_coll_sm_bcast_intra(void *buff, int count, + struct ompi_datatype_t *datatype, + int root, + struct ompi_communicator_t *comm); + int mca_coll_sm_bcast_log_intra(void *buff, int count, + struct ompi_datatype_t *datatype, + int root, + struct ompi_communicator_t *comm); + int mca_coll_sm_exscan_intra(void *sbuf, void *rbuf, int count, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + struct ompi_communicator_t *comm); + int mca_coll_sm_gather_intra(void *sbuf, int scount, + struct ompi_datatype_t *sdtype, void *rbuf, + int rcount, struct ompi_datatype_t *rdtype, + int root, struct ompi_communicator_t *comm); + int mca_coll_sm_gatherv_intra(void *sbuf, int scount, + struct ompi_datatype_t *sdtype, void *rbuf, + int *rcounts, int *disps, + struct ompi_datatype_t *rdtype, int root, + struct ompi_communicator_t *comm); + int mca_coll_sm_reduce_intra(void *sbuf, void* rbuf, int count, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + int root, + struct ompi_communicator_t *comm); + int mca_coll_sm_reduce_log_intra(void *sbuf, void* rbuf, int count, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + int root, + struct ompi_communicator_t *comm); + int mca_coll_sm_reduce_scatter_intra(void *sbuf, void *rbuf, + int *rcounts, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + struct ompi_communicator_t *comm); + int mca_coll_sm_scan_intra(void *sbuf, void *rbuf, int count, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + struct ompi_communicator_t *comm); + int mca_coll_sm_scatter_intra(void *sbuf, int scount, + struct ompi_datatype_t *sdtype, void *rbuf, + int rcount, struct ompi_datatype_t *rdtype, + int root, struct ompi_communicator_t *comm); + int mca_coll_sm_scatterv_intra(void *sbuf, int *scounts, int *disps, + struct ompi_datatype_t *sdtype, + void* rbuf, int rcount, + struct ompi_datatype_t *rdtype, int root, + struct ompi_communicator_t *comm); + #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/src/mca/coll/sm/coll_sm_allgather.c b/src/mca/coll/sm/coll_sm_allgather.c index 1834615cb5..82965316ee 100644 --- a/src/mca/coll/sm/coll_sm_allgather.c +++ b/src/mca/coll/sm/coll_sm_allgather.c @@ -14,28 +14,21 @@ #include "ompi_config.h" -#include - -#include "mpi.h" -#include "communicator/communicator.h" -#include "mca/coll/coll.h" -#include "mca/coll/base/base.h" +#include "include/constants.h" #include "coll_sm.h" /* * allgather * - * Function: - allgather using other MPI collections + * Function: - allgather * Accepts: - same as MPI_Allgather() * Returns: - MPI_SUCCESS or error code */ -int -mca_coll_sm_allgather(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, void *rbuf, - int rcount, struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm) +int mca_coll_sm_allgather_intra(void *sbuf, int scount, + struct ompi_datatype_t *sdtype, void *rbuf, + int rcount, struct ompi_datatype_t *rdtype, + struct ompi_communicator_t *comm) { - - return MPI_SUCCESS; + return OMPI_ERR_NOT_IMPLEMENTED; } diff --git a/src/mca/coll/sm/coll_sm_allgatherv.c b/src/mca/coll/sm/coll_sm_allgatherv.c new file mode 100644 index 0000000000..7c8dc86876 --- /dev/null +++ b/src/mca/coll/sm/coll_sm_allgatherv.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "include/constants.h" +#include "coll_sm.h" + + +/* + * allgatherv_intra + * + * Function: - allgatherv + * Accepts: - same as MPI_Allgatherv() + * Returns: - MPI_SUCCESS or error code + */ +int mca_coll_sm_allgatherv_intra(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) +{ + return OMPI_ERR_NOT_IMPLEMENTED; +} diff --git a/src/mca/coll/sm/coll_sm_allreduce.c b/src/mca/coll/sm/coll_sm_allreduce.c new file mode 100644 index 0000000000..be9cb3209c --- /dev/null +++ b/src/mca/coll/sm/coll_sm_allreduce.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "include/constants.h" +#include "coll_sm.h" + + +/* + * allreduce_intra + * + * Function: - allreduce using other MPI collectives + * Accepts: - same as MPI_Allreduce() + * Returns: - MPI_SUCCESS or error code + */ +int mca_coll_sm_allreduce_intra(void *sbuf, void *rbuf, int count, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + struct ompi_communicator_t *comm) +{ + return OMPI_ERR_NOT_IMPLEMENTED; +} diff --git a/src/mca/coll/sm/coll_sm_alltoall.c b/src/mca/coll/sm/coll_sm_alltoall.c index 63b9edbe6d..5d33568bf2 100644 --- a/src/mca/coll/sm/coll_sm_alltoall.c +++ b/src/mca/coll/sm/coll_sm_alltoall.c @@ -14,12 +14,7 @@ #include "ompi_config.h" -#include - -#include "mpi.h" -#include "communicator/communicator.h" -#include "mca/coll/coll.h" -#include "mca/coll/base/base.h" +#include "include/constants.h" #include "coll_sm.h" @@ -30,11 +25,10 @@ * Accepts: - same as MPI_Alltoall() * Returns: - MPI_SUCCESS or an MPI error code */ -int -mca_coll_sm_alltoall(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, void *rbuf, - int rcount, struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm) +int mca_coll_sm_alltoall_intra(void *sbuf, int scount, + struct ompi_datatype_t *sdtype, void *rbuf, + int rcount, struct ompi_datatype_t *rdtype, + struct ompi_communicator_t *comm) { - return MPI_SUCCESS; + return OMPI_ERR_NOT_IMPLEMENTED; } diff --git a/src/mca/coll/sm/coll_sm_alltoallv.c b/src/mca/coll/sm/coll_sm_alltoallv.c new file mode 100644 index 0000000000..d99c5f23c1 --- /dev/null +++ b/src/mca/coll/sm/coll_sm_alltoallv.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "include/constants.h" +#include "coll_sm.h" + + +/* + * alltoallv_intra + * + * Function: - MPI_Alltoallv + * Accepts: - same as MPI_Alltoallv() + * Returns: - MPI_SUCCESS or an MPI error code + */ +int mca_coll_sm_alltoallv_intra(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) +{ + return OMPI_ERR_NOT_IMPLEMENTED; +} diff --git a/src/mca/coll/sm/coll_sm_alltoallw.c b/src/mca/coll/sm/coll_sm_alltoallw.c new file mode 100644 index 0000000000..01479598b9 --- /dev/null +++ b/src/mca/coll/sm/coll_sm_alltoallw.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "include/constants.h" +#include "coll_sm.h" + + +/* + * alltoallw_intra + * + * Function: - MPI_Alltoallw + * Accepts: - same as MPI_Alltoallw() + * Returns: - MPI_SUCCESS or an MPI error code + */ +int mca_coll_sm_alltoallw_intra(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) +{ + return OMPI_ERR_NOT_IMPLEMENTED; +} diff --git a/src/mca/coll/sm/coll_sm_barrier.c b/src/mca/coll/sm/coll_sm_barrier.c index e1fbddb07e..399bc43024 100644 --- a/src/mca/coll/sm/coll_sm_barrier.c +++ b/src/mca/coll/sm/coll_sm_barrier.c @@ -14,12 +14,7 @@ #include "ompi_config.h" -#include - -#include "mpi.h" -#include "communicator/communicator.h" -#include "mca/coll/coll.h" -#include "mca/coll/base/base.h" +#include "include/constants.h" #include "coll_sm.h" @@ -30,8 +25,7 @@ * Accepts: - same as MPI_Barrier() * Returns: - MPI_SUCCESS or error code */ -int -mca_coll_sm_barrier(struct ompi_communicator_t *comm) +int mca_coll_sm_barrier_intra(struct ompi_communicator_t *comm) { - return MPI_SUCCESS; + return OMPI_ERR_NOT_IMPLEMENTED; } diff --git a/src/mca/coll/sm/coll_sm_bcast.c b/src/mca/coll/sm/coll_sm_bcast.c index d22b198ac3..e010162a44 100644 --- a/src/mca/coll/sm/coll_sm_bcast.c +++ b/src/mca/coll/sm/coll_sm_bcast.c @@ -14,25 +14,20 @@ #include "ompi_config.h" -#include - -#include "mpi.h" -#include "communicator/communicator.h" -#include "mca/coll/coll.h" -#include "mca/coll/base/base.h" +#include "include/constants.h" #include "coll_sm.h" + /* * bcast * - * Function: - shared memory bcast + * Function: - broadcast * Accepts: - same as MPI_Bcast() * Returns: - MPI_SUCCESS or error code */ -int -mca_coll_sm_bcast(void *buff, int count, - struct ompi_datatype_t *datatype, int root, - struct ompi_communicator_t *comm) +int mca_coll_sm_bcast_intra(void *buff, int count, + struct ompi_datatype_t *datatype, int root, + struct ompi_communicator_t *comm) { - return MPI_SUCCESS; + return OMPI_ERR_NOT_IMPLEMENTED; } diff --git a/src/mca/coll/sm/coll_sm_component.c b/src/mca/coll/sm/coll_sm_component.c index e0cc14610e..e820ee897f 100644 --- a/src/mca/coll/sm/coll_sm_component.c +++ b/src/mca/coll/sm/coll_sm_component.c @@ -19,18 +19,26 @@ */ #include "ompi_config.h" + +#include "include/constants.h" +#include "mca/coll/coll.h" #include "coll_sm.h" #include "mca/coll/sm/coll-sm-version.h" -#include "mpi.h" -#include "mca/coll/coll.h" -#include "coll_sm.h" /* * Public string showing the coll ompi_sm component version number */ const char *mca_coll_sm_component_version_string = - "Open MPI sm collective MCA component version " MCA_coll_sm_FULL_VERSION; + "Open MPI sm collective MCA component version " MCA_coll_sm_VERSION; + + +/* + * Local functions + */ + +static int sm_open(void); + /* * Instantiate the public struct with all of our public information @@ -39,39 +47,54 @@ const char *mca_coll_sm_component_version_string = const mca_coll_base_component_1_0_0_t mca_coll_sm_component = { - /* First, the mca_component_t struct containing meta information - about the component itself */ + /* First, the mca_component_t struct containing meta information + about the component itself */ - { - /* Indicate that we are a coll v1.0.0 component (which also implies a - specific MCA version) */ + { + /* Indicate that we are a coll v1.0.0 component (which also + implies a specific MCA version) */ - MCA_COLL_BASE_VERSION_1_0_0, + MCA_COLL_BASE_VERSION_1_0_0, - /* Component name and version */ + /* Component name and version */ - "sm", - MCA_coll_sm_MAJOR_VERSION, - MCA_coll_sm_MINOR_VERSION, - MCA_coll_sm_RELEASE_VERSION, + "sm", + MCA_coll_sm_MAJOR_VERSION, + MCA_coll_sm_MINOR_VERSION, + MCA_coll_sm_RELEASE_VERSION, - /* Component open and close functions */ + /* Component open and close functions */ - mca_coll_sm_open, - mca_coll_sm_close - }, + sm_open, + NULL + }, - /* Next the MCA v1.0.0 component meta data */ + /* Next the MCA v1.0.0 component meta data */ - { - /* Whether the component is checkpointable or not */ + { + /* Whether the component is checkpointable or not */ - true - }, + true + }, - /* Initialization / querying functions */ + /* Initialization / querying functions */ - mca_coll_sm_init_query, - mca_coll_sm_comm_query, - mca_coll_sm_comm_unquery, + mca_coll_sm_init_query, + mca_coll_sm_comm_query, + mca_coll_sm_comm_unquery, }; + + +/* + * Open the component + */ +static int sm_open(void) +{ + /* If we want to be selected (i.e., all procs on one node), then + we should have a high priority */ + + mca_coll_sm_param_priority = + mca_base_param_register_int("coll", "sm", "priority", NULL, 75); + + return OMPI_SUCCESS; +} diff --git a/src/mca/coll/sm/coll_sm_exscan.c b/src/mca/coll/sm/coll_sm_exscan.c new file mode 100644 index 0000000000..7e5c118a57 --- /dev/null +++ b/src/mca/coll/sm/coll_sm_exscan.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "include/constants.h" +#include "coll_sm.h" + + +/* + * exscan_intra + * + * Function: - basic exscan operation + * Accepts: - same arguments as MPI_Exscan() + * Returns: - MPI_SUCCESS or error code + */ +int mca_coll_sm_exscan_intra(void *sbuf, void *rbuf, int count, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + struct ompi_communicator_t *comm) +{ + return OMPI_ERR_NOT_IMPLEMENTED; +} diff --git a/src/mca/coll/sm/coll_sm_gather.c b/src/mca/coll/sm/coll_sm_gather.c index 9252aa635f..99f337d5fb 100644 --- a/src/mca/coll/sm/coll_sm_gather.c +++ b/src/mca/coll/sm/coll_sm_gather.c @@ -14,12 +14,7 @@ #include "ompi_config.h" -#include - -#include "mpi.h" -#include "communicator/communicator.h" -#include "mca/coll/coll.h" -#include "mca/coll/base/base.h" +#include "include/constants.h" #include "coll_sm.h" @@ -30,11 +25,10 @@ * Accepts: - same as MPI_Gather() * Returns: - MPI_SUCCESS or error code */ -int -mca_coll_sm_gather(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, void *rbuf, - int rcount, struct ompi_datatype_t *rdtype, - int root, struct ompi_communicator_t *comm) +int mca_coll_sm_gather_intra(void *sbuf, int scount, + struct ompi_datatype_t *sdtype, void *rbuf, + int rcount, struct ompi_datatype_t *rdtype, + int root, struct ompi_communicator_t *comm) { - return MPI_SUCCESS; + return OMPI_ERR_NOT_IMPLEMENTED; } diff --git a/src/mca/coll/sm/coll_sm_gatherv.c b/src/mca/coll/sm/coll_sm_gatherv.c new file mode 100644 index 0000000000..4d0a466fe6 --- /dev/null +++ b/src/mca/coll/sm/coll_sm_gatherv.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "include/constants.h" +#include "coll_sm.h" + + +/* + * gatherv_intra + * + * Function: - basic gatherv operation + * Accepts: - same arguments as MPI_Gatherb() + * Returns: - MPI_SUCCESS or error code + */ +int mca_coll_sm_gatherv_intra(void *sbuf, int scount, + struct ompi_datatype_t *sdtype, + void *rbuf, int *rcounts, int *disps, + struct ompi_datatype_t *rdtype, int root, + struct ompi_communicator_t *comm) +{ + return OMPI_ERR_NOT_IMPLEMENTED; +} diff --git a/src/mca/coll/sm/coll_sm_module.c b/src/mca/coll/sm/coll_sm_module.c new file mode 100644 index 0000000000..74198d3cd2 --- /dev/null +++ b/src/mca/coll/sm/coll_sm_module.c @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include + +#include "mpi.h" +#include "communicator/communicator.h" +#include "mca/coll/coll.h" +#include "mca/coll/base/base.h" +#include "coll_sm.h" + + +/* + * Linear set of collective algorithms + */ +static const mca_coll_base_module_1_0_0_t module = { + + /* Initialization / finalization functions */ + + mca_coll_sm_module_init, + mca_coll_sm_module_finalize, + + /* Collective function pointers */ + + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + mca_coll_sm_barrier_intra, + mca_coll_sm_bcast_intra, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +int mca_coll_sm_param_priority = -1; + + +/* + * Initial query function that is invoked during MPI_INIT, allowing + * this module to indicate what level of thread support it provides. + */ +int mca_coll_sm_init_query(bool *allow_multi_user_threads, + bool *have_hidden_user_threads) +{ + *allow_multi_user_threads = true; + *have_hidden_user_threads = false; + + /* All done */ + + return OMPI_SUCCESS; +} + + +/* + * Invoked when there's a new communicator that has been created. + * Look at the communicator and decide which set of functions and + * priority we want to return. + */ +const mca_coll_base_module_1_0_0_t * +mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority, + mca_coll_base_module_comm_t **data) +{ + /* If we're intercomm, or if there's only one process in the + communicator, we don't want to run */ + + if (OMPI_COMM_IS_INTER(comm) || 1 == ompi_comm_size(comm)) { + return NULL; + } + + /* Get our priority */ + + if (OMPI_SUCCESS != + mca_base_param_lookup_int(mca_coll_sm_param_priority, + priority)) { + return NULL; + } + + /* We only want to run if all the processes in the communicator + are on the same node */ + + /* Can we get an mpool allocation? */ + + /* JMS ... */ + + return &module; +} + + +/* + * Unquery the coll on comm + */ +int mca_coll_sm_comm_unquery(struct ompi_communicator_t *comm, + mca_coll_base_module_comm_t *data) +{ + /* JMS */ + /* Remove mpool query, if we got one */ + + return OMPI_SUCCESS; +} + + +/* + * Init module on the communicator + */ +const struct mca_coll_base_module_1_0_0_t * +mca_coll_sm_module_init(struct ompi_communicator_t *comm) +{ + /* JMS */ + + return &module; +} + + +/* + * Finalize module on the communicator + */ +int mca_coll_sm_module_finalize(struct ompi_communicator_t *comm) +{ + /* JMS */ + + return OMPI_SUCCESS; +} + + diff --git a/src/mca/coll/sm/coll_sm_reduce.c b/src/mca/coll/sm/coll_sm_reduce.c index abda1a18e2..f7b9bbbc0d 100644 --- a/src/mca/coll/sm/coll_sm_reduce.c +++ b/src/mca/coll/sm/coll_sm_reduce.c @@ -14,12 +14,7 @@ #include "ompi_config.h" -#include - -#include "mpi.h" -#include "communicator/communicator.h" -#include "mca/coll/coll.h" -#include "mca/coll/base/base.h" +#include "include/constants.h" #include "coll_sm.h" @@ -30,12 +25,11 @@ * Accepts: - same as MPI_Reduce() * Returns: - MPI_SUCCESS or error code */ -int -mca_coll_sm_reduce(void *sbuf, void* rbuf, int count, - struct ompi_datatype_t *dtype, - struct ompi_op_t *op, - int root, struct ompi_communicator_t *comm) +int mca_coll_sm_reduce_intra(void *sbuf, void* rbuf, int count, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + int root, struct ompi_communicator_t *comm) { - return MPI_SUCCESS; + return OMPI_ERR_NOT_IMPLEMENTED; } diff --git a/src/mca/coll/sm/coll_sm_reduce_scatter.c b/src/mca/coll/sm/coll_sm_reduce_scatter.c new file mode 100644 index 0000000000..c60d9cbe59 --- /dev/null +++ b/src/mca/coll/sm/coll_sm_reduce_scatter.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "include/constants.h" +#include "coll_sm.h" + + +/* + * reduce_scatter + * + * Function: - reduce then scatter + * Accepts: - same as MPI_Reduce_scatter() + * Returns: - MPI_SUCCESS or error code + */ +int mca_coll_sm_reduce_scatter_intra(void *sbuf, void *rbuf, int *rcounts, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + struct ompi_communicator_t *comm) +{ + return OMPI_ERR_NOT_IMPLEMENTED; +} diff --git a/src/mca/coll/sm/coll_sm_util.c b/src/mca/coll/sm/coll_sm_scan.c similarity index 53% rename from src/mca/coll/sm/coll_sm_util.c rename to src/mca/coll/sm/coll_sm_scan.c index 4f707205d1..4b76f8ec20 100644 --- a/src/mca/coll/sm/coll_sm_util.c +++ b/src/mca/coll/sm/coll_sm_scan.c @@ -14,12 +14,21 @@ #include "ompi_config.h" -#include - -#include "mpi.h" -#include "communicator/communicator.h" -#include "mca/coll/coll.h" -#include "mca/coll/base/base.h" +#include "include/constants.h" #include "coll_sm.h" -/* VPS: All utility functions required for shmem module can go in here */ + +/* + * scan + * + * Function: - basic scan operation + * Accepts: - same arguments as MPI_Scan() + * Returns: - MPI_SUCCESS or error code + */ +int mca_coll_sm_scan_intra(void *sbuf, void *rbuf, int count, + struct ompi_datatype_t *dtype, + struct ompi_op_t *op, + struct ompi_communicator_t *comm) +{ + return OMPI_ERR_NOT_IMPLEMENTED; +} diff --git a/src/mca/coll/sm/coll_sm_scatter.c b/src/mca/coll/sm/coll_sm_scatter.c index 76972677b6..3bd2de7990 100644 --- a/src/mca/coll/sm/coll_sm_scatter.c +++ b/src/mca/coll/sm/coll_sm_scatter.c @@ -14,12 +14,7 @@ #include "ompi_config.h" -#include - -#include "mpi.h" -#include "communicator/communicator.h" -#include "mca/coll/coll.h" -#include "mca/coll/base/base.h" +#include "include/constants.h" #include "coll_sm.h" @@ -30,11 +25,10 @@ * Accepts: - same as MPI_Scatter() * Returns: - MPI_SUCCESS or error code */ -int -mca_coll_sm_scatter(void *sbuf, int scount, - struct ompi_datatype_t *sdtype, void *rbuf, - int rcount, struct ompi_datatype_t *rdtype, - int root, struct ompi_communicator_t *comm) +int mca_coll_sm_scatter_intra(void *sbuf, int scount, + struct ompi_datatype_t *sdtype, void *rbuf, + int rcount, struct ompi_datatype_t *rdtype, + int root, struct ompi_communicator_t *comm) { - return MPI_SUCCESS; + return OMPI_ERR_NOT_IMPLEMENTED; } diff --git a/src/mca/coll/sm/coll_sm_scatterv.c b/src/mca/coll/sm/coll_sm_scatterv.c new file mode 100644 index 0000000000..d2e7e8d67c --- /dev/null +++ b/src/mca/coll/sm/coll_sm_scatterv.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "include/constants.h" +#include "coll_sm.h" + + +/* + * scatterv_intra + * + * Function: - scatterv operation + * Accepts: - same arguments as MPI_Scatterv() + * Returns: - MPI_SUCCESS or error code + */ +int mca_coll_sm_scatterv_intra(void *sbuf, int *scounts, + int *disps, struct ompi_datatype_t *sdtype, + void *rbuf, int rcount, + struct ompi_datatype_t *rdtype, int root, + struct ompi_communicator_t *comm) +{ + return OMPI_ERR_NOT_IMPLEMENTED; +} diff --git a/src/mca/coll/sm/configure.params b/src/mca/coll/sm/configure.params index e1b5f6165f..6b87867422 100644 --- a/src/mca/coll/sm/configure.params +++ b/src/mca/coll/sm/configure.params @@ -13,7 +13,5 @@ # $HEADER$ # -# Specific to this module - PARAM_INIT_FILE=coll_sm.c PARAM_CONFIG_FILES=Makefile