1
1

- Remove unnecessary #include's (but still leave some that are

unnecessary for this demo component, but will generally be needed
  for a real coll component, by way of example)
- Re-indent to 4 space tabs, since this component is used as a
  template
- Update to new coll selection API (with the data parameter)

This commit was SVN r4252.
Этот коммит содержится в:
Jeff Squyres 2005-01-30 18:44:00 +00:00
родитель 5e47dafca6
Коммит adf454c3c4
20 изменённых файлов: 393 добавлений и 422 удалений

Просмотреть файл

@ -20,9 +20,31 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2 AUTOMAKE_OPTIONS = foreign dist-bzip2
EXTRA_DIST = VERSION EXTRA_DIST = VERSION
# Source files
sources = \
coll_demo.h \
coll_demo_allgather.c \
coll_demo_allgatherv.c \
coll_demo_allreduce.c \
coll_demo_alltoall.c \
coll_demo_alltoallv.c \
coll_demo_alltoallw.c \
coll_demo_barrier.c \
coll_demo_bcast.c \
coll_demo_component.c \
coll_demo_gather.c \
coll_demo_gatherv.c \
coll_demo_module.c \
coll_demo_reduce.c \
coll_demo_reduce_scatter.c \
coll_demo_scan.c \
coll_demo_exscan.c \
coll_demo_scatter.c \
coll_demo_scatterv.c
# Make the output library in this directory, and name it either # Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la # mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds). # (for static builds).
@ -45,26 +67,3 @@ noinst_LTLIBRARIES = $(component_noinst)
libmca_coll_demo_la_SOURCES = $(sources) libmca_coll_demo_la_SOURCES = $(sources)
libmca_coll_demo_la_LIBADD = src/libmca_coll_demo.la libmca_coll_demo_la_LIBADD = src/libmca_coll_demo.la
libmca_coll_demo_la_LDFLAGS = -module -avoid-version libmca_coll_demo_la_LDFLAGS = -module -avoid-version
# Source files
sources = \
coll_demo.h \
coll_demo.c \
coll_demo_allgather.c \
coll_demo_allgatherv.c \
coll_demo_allreduce.c \
coll_demo_alltoall.c \
coll_demo_alltoallv.c \
coll_demo_alltoallw.c \
coll_demo_barrier.c \
coll_demo_bcast.c \
coll_demo_component.c \
coll_demo_gather.c \
coll_demo_gatherv.c \
coll_demo_reduce.c \
coll_demo_reduce_scatter.c \
coll_demo_scan.c \
coll_demo_exscan.c \
coll_demo_scatter.c \
coll_demo_scatterv.c

Просмотреть файл

@ -27,9 +27,7 @@
extern "C" { extern "C" {
#endif #endif
/* /* Globally exported variables */
* Globally exported variable
*/
extern const mca_coll_base_component_1_0_0_t mca_coll_demo_component; extern const mca_coll_base_component_1_0_0_t mca_coll_demo_component;
extern int mca_coll_demo_priority_param; extern int mca_coll_demo_priority_param;
@ -37,18 +35,15 @@ extern int mca_coll_demo_verbose_param;
extern int mca_coll_demo_verbose; extern int mca_coll_demo_verbose;
/* /* Component functions */
* coll API functions
*/
/* API functions */
int mca_coll_demo_init_query(bool *allow_demo_user_threads, int mca_coll_demo_init_query(bool *allow_demo_user_threads,
bool *have_hidden_threads); bool *have_hidden_threads);
const struct mca_coll_base_module_1_0_0_t * const struct mca_coll_base_module_1_0_0_t *
mca_coll_demo_comm_query(struct ompi_communicator_t *comm, int *priority); mca_coll_demo_comm_query(struct ompi_communicator_t *comm, int *priority,
int mca_coll_demo_comm_unquery(struct ompi_communicator_t *comm); struct mca_coll_base_comm_t **data);
/* Module functions */
const struct mca_coll_base_module_1_0_0_t * const struct mca_coll_base_module_1_0_0_t *
mca_coll_demo_module_init(struct ompi_communicator_t *comm); mca_coll_demo_module_init(struct ompi_communicator_t *comm);
@ -210,8 +205,6 @@ extern int mca_coll_demo_verbose;
struct ompi_datatype_t *rdtype, int root, struct ompi_datatype_t *rdtype, int root,
struct ompi_communicator_t *comm); struct ompi_communicator_t *comm);
#if defined(c_plusplus) || defined(__cplusplus) #if defined(c_plusplus) || defined(__cplusplus)
} }
#endif #endif

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -26,7 +25,7 @@
/* /*
* allgather_intra * allgather_intra
* *
* Function: - allgather using other MPI collections * Function: - allgather
* Accepts: - same as MPI_Allgather() * Accepts: - same as MPI_Allgather()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
@ -44,7 +43,7 @@ int mca_coll_demo_allgather_intra(void *sbuf, int scount,
/* /*
* allgather_inter * allgather_inter
* *
* Function: - allgather using other MPI collections * Function: - allgather
* Accepts: - same as MPI_Allgather() * Accepts: - same as MPI_Allgather()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -26,7 +25,7 @@
/* /*
* allgatherv_intra * allgatherv_intra
* *
* Function: - allgather using other MPI collectives * Function: - allgather
* Accepts: - same as MPI_Allgatherv() * Accepts: - same as MPI_Allgatherv()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
@ -46,7 +45,7 @@ int mca_coll_demo_allgatherv_intra(void *sbuf, int scount,
/* /*
* allgatherv_inter * allgatherv_inter
* *
* Function: - allgather using other MPI collectives * Function: - allgather
* Accepts: - same as MPI_Allgatherv() * Accepts: - same as MPI_Allgatherv()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -26,7 +25,7 @@
/* /*
* allreduce_intra * allreduce_intra
* *
* Function: - allreduce using other MPI collectives * Function: - allreduce
* Accepts: - same as MPI_Allreduce() * Accepts: - same as MPI_Allreduce()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -26,7 +25,7 @@
/* /*
* alltoallw_intra * alltoallw_intra
* *
* Function: - MPI_Alltoallw for non-ompid RPIs * Function: - MPI_Alltoallw
* Accepts: - same as MPI_Alltoallw() * Accepts: - same as MPI_Alltoallw()
* Returns: - MPI_SUCCESS or an MPI error code * Returns: - MPI_SUCCESS or an MPI error code
*/ */
@ -46,7 +45,7 @@ int mca_coll_demo_alltoallw_intra(void *sbuf, int *scounts, int *sdisps,
/* /*
* alltoallw_inter * alltoallw_inter
* *
* Function: - MPI_Alltoallw for non-lamd RPIs * Function: - MPI_Alltoallw
* Accepts: - same as MPI_Alltoallw() * Accepts: - same as MPI_Alltoallw()
* Returns: - MPI_SUCCESS or an MPI error code * Returns: - MPI_SUCCESS or an MPI error code
*/ */

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -26,7 +25,7 @@
/* /*
* barrier_intra * barrier_intra
* *
* Function: - barrier using O(N) algorithm * Function: - barrier
* Accepts: - same as MPI_Barrier() * Accepts: - same as MPI_Barrier()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
@ -40,7 +39,7 @@ int mca_coll_demo_barrier_intra(struct ompi_communicator_t *comm)
/* /*
* barrier_inter * barrier_inter
* *
* Function: - barrier using O(log(N)) algorithm * Function: - barrier
* Accepts: - same as MPI_Barrier() * Accepts: - same as MPI_Barrier()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -26,7 +25,7 @@
/* /*
* bcast_intra * bcast_intra
* *
* Function: - broadcast using O(N) algorithm * Function: - broadcast
* Accepts: - same arguments as MPI_Bcast() * Accepts: - same arguments as MPI_Bcast()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
@ -43,7 +42,7 @@ int mca_coll_demo_bcast_intra(void *buff, int count,
/* /*
* bcast_inter * bcast_inter
* *
* Function: - broadcast using O(N) algorithm * Function: - broadcast
* Accepts: - same arguments as MPI_Bcast() * Accepts: - same arguments as MPI_Bcast()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */

Просмотреть файл

@ -19,11 +19,10 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "coll-demo-version.h"
#include "mpi.h" #include "mpi.h"
#include "mca/coll/coll.h" #include "mca/coll/coll.h"
#include "coll-demo-version.h"
#include "coll_demo.h" #include "coll_demo.h"
/* /*
@ -44,6 +43,7 @@ int mca_coll_demo_verbose = 0;
*/ */
static int demo_open(void); static int demo_open(void);
/* /*
* Instantiate the public struct with all of our public information * Instantiate the public struct with all of our public information
* and pointers to our public functions in it * and pointers to our public functions in it
@ -55,8 +55,8 @@ const mca_coll_base_component_1_0_0_t mca_coll_demo_component = {
about the component itself */ about the component itself */
{ {
/* Indicate that we are a coll v1.0.0 component (which also implies a /* Indicate that we are a coll v1.0.0 component (which also
specific MCA version) */ implies a specific MCA version) */
MCA_COLL_BASE_VERSION_1_0_0, MCA_COLL_BASE_VERSION_1_0_0,
@ -91,8 +91,6 @@ const mca_coll_base_component_1_0_0_t mca_coll_demo_component = {
static int demo_open(void) static int demo_open(void)
{ {
/* Use a low priority, but allow other components to be lower */
mca_coll_demo_priority_param = mca_coll_demo_priority_param =
mca_base_param_register_int("coll", "demo", "priority", NULL, 20); mca_base_param_register_int("coll", "demo", "priority", NULL, 20);
mca_coll_demo_verbose_param = mca_coll_demo_verbose_param =

Просмотреть файл

@ -13,9 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include <stdio.h>
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -28,8 +25,8 @@
/* /*
* exscan_intra * exscan_intra
* *
* Function: - demo exscan operation * Function: - exscan
* Accepts: - same arguments as MPI_Exccan() * Accepts: - same arguments as MPI_Exscan()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
int mca_coll_demo_exscan_intra(void *sbuf, void *rbuf, int count, int mca_coll_demo_exscan_intra(void *sbuf, void *rbuf, int count,
@ -46,8 +43,8 @@ int mca_coll_demo_exscan_intra(void *sbuf, void *rbuf, int count,
/* /*
* exscan_inter * exscan_inter
* *
* Function: - demo exscan operation * Function: - exscan
* Accepts: - same arguments as MPI_Exccan() * Accepts: - same arguments as MPI_Exscan()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
int mca_coll_demo_exscan_inter(void *sbuf, void *rbuf, int count, int mca_coll_demo_exscan_inter(void *sbuf, void *rbuf, int count,

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -25,7 +24,7 @@
/* /*
* gather_intra * gather_intra
* *
* Function: - demo gather operation * Function: - gather
* Accepts: - same arguments as MPI_Gather() * Accepts: - same arguments as MPI_Gather()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -26,8 +25,8 @@
/* /*
* gatherv_intra * gatherv_intra
* *
* Function: - demo gatherv operation * Function: - gatherv
* Accepts: - same arguments as MPI_Bcast() * Accepts: - same arguments as MPI_Gatherv()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
int mca_coll_demo_gatherv_intra(void *sbuf, int scount, int mca_coll_demo_gatherv_intra(void *sbuf, int scount,
@ -46,8 +45,8 @@ int mca_coll_demo_gatherv_intra(void *sbuf, int scount,
/* /*
* gatherv_inter * gatherv_inter
* *
* Function: - demo gatherv operation * Function: - gatherv
* Accepts: - same arguments as MPI_Bcast() * Accepts: - same arguments as MPI_Gatherv()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
int mca_coll_demo_gatherv_inter(void *sbuf, int scount, int mca_coll_demo_gatherv_inter(void *sbuf, int scount,

Просмотреть файл

@ -44,7 +44,7 @@ static const mca_coll_base_module_1_0_0_t intra = {
mca_coll_demo_alltoallw_intra, mca_coll_demo_alltoallw_intra,
mca_coll_demo_barrier_intra, mca_coll_demo_barrier_intra,
mca_coll_demo_bcast_intra, mca_coll_demo_bcast_intra,
NULL, /* Leave exscan blank just to force basic to be loaded used */ NULL, /* Leave exscan blank just to force basic to be used */
mca_coll_demo_gather_intra, mca_coll_demo_gather_intra,
mca_coll_demo_gatherv_intra, mca_coll_demo_gatherv_intra,
mca_coll_demo_reduce_intra, mca_coll_demo_reduce_intra,
@ -108,10 +108,11 @@ int mca_coll_demo_init_query(bool *allow_demo_user_threads,
* priority we want to return. * priority we want to return.
*/ */
const mca_coll_base_module_1_0_0_t * const mca_coll_base_module_1_0_0_t *
mca_coll_demo_comm_query(struct ompi_communicator_t *comm, int *priority) mca_coll_demo_comm_query(struct ompi_communicator_t *comm, int *priority,
struct mca_coll_base_comm_t **data)
{ {
if (OMPI_SUCCESS != mca_base_param_lookup_int(mca_coll_demo_priority_param, if (OMPI_SUCCESS !=
priority)) { mca_base_param_lookup_int(mca_coll_demo_priority_param, priority)) {
return NULL; return NULL;
} }

Просмотреть файл

@ -13,9 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include <stdio.h>
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -28,7 +25,7 @@
/* /*
* reduce_intra * reduce_intra
* *
* Function: - reduction using O(N) algorithm * Function: - reduction
* Accepts: - same as MPI_Reduce() * Accepts: - same as MPI_Reduce()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
@ -44,9 +41,9 @@ int mca_coll_demo_reduce_intra(void *sbuf, void *rbuf, int count,
/* /*
* reduce_log_inter * reduce_inter
* *
* Function: - reduction using O(N) algorithm * Function: - reduction
* Accepts: - same as MPI_Reduce() * Accepts: - same as MPI_Reduce()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */

Просмотреть файл

@ -13,10 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include <stdio.h>
#include <errno.h>
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"

Просмотреть файл

@ -13,9 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include <stdio.h>
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -28,7 +25,7 @@
/* /*
* scan * scan
* *
* Function: - demo scan operation * Function: - scan
* Accepts: - same arguments as MPI_Scan() * Accepts: - same arguments as MPI_Scan()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
@ -41,3 +38,8 @@ int mca_coll_demo_scan_intra(void *sbuf, void *rbuf, int count,
return comm->c_coll_basic_module->coll_scan(sbuf, rbuf, count, return comm->c_coll_basic_module->coll_scan(sbuf, rbuf, count,
dtype, op, comm); dtype, op, comm);
} }
/*
* NOTE: There is no exscan defined for intercommunicators (see MPI-2).
*/

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"

Просмотреть файл

@ -13,7 +13,6 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h" #include "mpi.h"
#include "include/constants.h" #include "include/constants.h"
@ -27,7 +26,7 @@
* scatterv_intra * scatterv_intra
* *
* Function: - scatterv operation * Function: - scatterv operation
* Accepts: - same arguments as MPI_Scatter() * Accepts: - same arguments as MPI_Scatterv()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
int mca_coll_demo_scatterv_intra(void *sbuf, int *scounts, int mca_coll_demo_scatterv_intra(void *sbuf, int *scounts,
@ -38,8 +37,8 @@ int mca_coll_demo_scatterv_intra(void *sbuf, int *scounts,
{ {
ompi_output_verbose(10, mca_coll_base_output, "In demo scatterv_intra"); ompi_output_verbose(10, mca_coll_base_output, "In demo scatterv_intra");
return comm->c_coll_basic_module->coll_scatterv(sbuf, scounts, disps, return comm->c_coll_basic_module->coll_scatterv(sbuf, scounts, disps,
sdtype, rbuf, rcount, rdtype, sdtype, rbuf, rcount,
root, comm); rdtype, root, comm);
} }
@ -47,7 +46,7 @@ int mca_coll_demo_scatterv_intra(void *sbuf, int *scounts,
* scatterv_inter * scatterv_inter
* *
* Function: - scatterv operation * Function: - scatterv operation
* Accepts: - same arguments as MPI_Scatter() * Accepts: - same arguments as MPI_Scatterv()
* Returns: - MPI_SUCCESS or error code * Returns: - MPI_SUCCESS or error code
*/ */
int mca_coll_demo_scatterv_inter(void *sbuf, int *scounts, int mca_coll_demo_scatterv_inter(void *sbuf, int *scounts,
@ -58,6 +57,6 @@ int mca_coll_demo_scatterv_inter(void *sbuf, int *scounts,
{ {
ompi_output_verbose(10, mca_coll_base_output, "In demo scatterv_inter"); ompi_output_verbose(10, mca_coll_base_output, "In demo scatterv_inter");
return comm->c_coll_basic_module->coll_scatterv(sbuf, scounts, disps, return comm->c_coll_basic_module->coll_scatterv(sbuf, scounts, disps,
sdtype, rbuf, rcount, rdtype, sdtype, rbuf, rcount,
root, comm); rdtype, root, comm);
} }