1
1

First cut of a "demo" component. Has hilighted a few errors in 3rd

party components, but I'll fix those after the tutorial.  :-)

This commit was SVN r3060.
Этот коммит содержится в:
Jeff Squyres 2004-10-12 14:19:29 +00:00
родитель 5d6174a348
Коммит a49fabdbd9
24 изменённых файлов: 1384 добавлений и 0 удалений

60
src/mca/coll/demo/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,60 @@
#
# $HEADER$
#
# Need to use our own AUTOMAKE_OPTIONS -- cannot include
# Makefile.options from main ompi tree because Automake now defers
# "include" statements until "make" time. Hence, if we're building
# this component outside the ompi tree, the include statement will
# fail.
AUTOMAKE_OPTIONS = foreign dist-bzip2
EXTRA_DIST = VERSION
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if OMPI_BUILD_coll_demo_DSO
component_noinst =
component_install = mca_coll_demo.la
else
component_noinst = libmca_coll_demo.la
component_install =
endif
mcacomponentdir = $(libdir)/openmpi
mcacomponent_LTLIBRARIES = $(component_install)
mca_coll_demo_la_SOURCES = $(sources)
mca_coll_demo_la_LIBADD = $(LIBMPI_LA)
mca_coll_demo_la_LDFLAGS = -module -avoid-version
noinst_LTLIBRARIES = $(component_noinst)
libmca_coll_demo_la_SOURCES = $(sources)
libmca_coll_demo_la_LIBADD = src/libmca_coll_demo.la
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

6
src/mca/coll/demo/VERSION Обычный файл
Просмотреть файл

@ -0,0 +1,6 @@
major=4
minor=5
release=6
alpha=0
beta=0
svn=0

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

@ -0,0 +1,19 @@
/*
* This file is automatically created by autogen.sh; it should not
* be edited by hand!!
*
* List of version number for this component
*/
#ifndef MCA_COLL_DEMO_VERSION_H
#define MCA_COLL_DEMO_VERSION_H
#define MCA_COLL_DEMO_MAJOR_VERSION @MCA_COLL_DEMO_MAJOR_VERSION@
#define MCA_COLL_DEMO_MINOR_VERSION @MCA_COLL_DEMO_MINOR_VERSION@
#define MCA_COLL_DEMO_RELEASE_VERSION @MCA_COLL_DEMO_RELEASE_VERSION@
#define MCA_COLL_DEMO_ALPHA_VERSION @MCA_COLL_DEMO_ALPHA_VERSION@
#define MCA_COLL_DEMO_BETA_VERSION @MCA_COLL_DEMO_BETA_VERSION@
#define MCA_COLL_DEMO_SVN_VERSION "@MCA_COLL_DEMO_SVN_VERSION@"
#define MCA_COLL_DEMO_FULL_VERSION "@MCA_COLL_DEMO_VERSION@"
#endif /* MCA_COLL_DEMO_VERSION_H */

134
src/mca/coll/demo/coll_demo.c Обычный файл
Просмотреть файл

@ -0,0 +1,134 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include <stdio.h>
#include "mpi.h"
#include "communicator/communicator.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* Linear set of collective algorithms
*/
static const mca_coll_base_module_1_0_0_t intra = {
/* Initialization / finalization functions */
mca_coll_demo_module_init,
mca_coll_demo_module_finalize,
/* Collective function pointers */
mca_coll_demo_allgather_intra,
mca_coll_demo_allgatherv_intra,
mca_coll_demo_allreduce_intra,
mca_coll_demo_alltoall_intra,
mca_coll_demo_alltoallv_intra,
mca_coll_demo_alltoallw_intra,
mca_coll_demo_barrier_intra,
mca_coll_demo_bcast_intra,
NULL, /* Leave exscan blank just to force basic to be loaded used */
mca_coll_demo_gather_intra,
mca_coll_demo_gatherv_intra,
mca_coll_demo_reduce_intra,
mca_coll_demo_reduce_scatter_intra,
mca_coll_demo_scan_intra,
mca_coll_demo_scatter_intra,
mca_coll_demo_scatterv_intra
};
/*
* Linear set of collective algorithms for intercommunicators
*/
static const mca_coll_base_module_1_0_0_t inter = {
/* Initialization / finalization functions */
mca_coll_demo_module_init,
mca_coll_demo_module_finalize,
/* Collective function pointers */
mca_coll_demo_allgather_inter,
mca_coll_demo_allgatherv_inter,
mca_coll_demo_allreduce_inter,
mca_coll_demo_alltoall_inter,
mca_coll_demo_alltoallv_inter,
mca_coll_demo_alltoallw_inter,
mca_coll_demo_barrier_inter,
mca_coll_demo_bcast_inter,
mca_coll_demo_exscan_inter,
mca_coll_demo_gather_inter,
mca_coll_demo_gatherv_inter,
mca_coll_demo_reduce_inter,
mca_coll_demo_reduce_scatter_inter,
NULL,
mca_coll_demo_scatter_inter,
mca_coll_demo_scatterv_inter
};
/*
* Initial query function that is invoked during MPI_INIT, allowing
* this module to indicate what level of thread support it provides.
*/
int mca_coll_demo_init_query(bool *allow_demo_user_threads,
bool *have_hidden_user_threads)
{
*allow_demo_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_demo_comm_query(struct ompi_communicator_t *comm, int *priority)
{
if (OMPI_SUCCESS != mca_base_param_lookup_int(mca_coll_demo_priority_param,
priority)) {
return NULL;
}
return OMPI_COMM_IS_INTER(comm) ? &inter : &intra;
}
/*
* Init module on the communicator
*/
const struct mca_coll_base_module_1_0_0_t *
mca_coll_demo_module_init(struct ompi_communicator_t *comm)
{
mca_base_param_lookup_int(mca_coll_demo_verbose_param,
&mca_coll_demo_verbose);
if (mca_coll_demo_verbose > 0) {
printf("Hello! This is the \"demo\" coll component. I'll be your coll component\ntoday. Please tip your waitresses well.\n");
}
return OMPI_COMM_IS_INTER(comm) ? &inter : &intra;
}
/*
* Finalize module on the communicator
*/
int mca_coll_demo_module_finalize(struct ompi_communicator_t *comm)
{
return OMPI_SUCCESS;
}

226
src/mca/coll/demo/coll_demo.h Обычный файл
Просмотреть файл

@ -0,0 +1,226 @@
/*
* $HEADER$
*/
#ifndef MCA_COLL_DEMO_EXPORT_H
#define MCA_COLL_DEMO_EXPORT_H
#include "ompi_config.h"
#include "mpi.h"
#include "mca/mca.h"
#include "mca/coll/coll.h"
#include "request/request.h"
#include "mca/pml/pml.h"
/*
* Globally exported variable
*/
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_verbose_param;
extern int mca_coll_demo_verbose;
/*
* coll API functions
*/
#ifdef __cplusplus
extern "C" {
#endif
/* API functions */
int mca_coll_demo_init_query(bool *allow_demo_user_threads,
bool *have_hidden_threads);
const struct mca_coll_base_module_1_0_0_t *
mca_coll_demo_comm_query(struct ompi_communicator_t *comm, int *priority);
int mca_coll_demo_comm_unquery(struct ompi_communicator_t *comm);
const struct mca_coll_base_module_1_0_0_t *
mca_coll_demo_module_init(struct ompi_communicator_t *comm);
int mca_coll_demo_module_finalize(struct ompi_communicator_t *comm);
int mca_coll_demo_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_demo_allgather_inter(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_demo_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_demo_allgatherv_inter(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_demo_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_demo_allreduce_inter(void *sbuf, void *rbuf, int count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm);
int mca_coll_demo_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_demo_alltoall_inter(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_demo_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_demo_alltoallv_inter(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_demo_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_demo_alltoallw_inter(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_demo_barrier_intra(struct ompi_communicator_t *comm);
int mca_coll_demo_barrier_inter(struct ompi_communicator_t *comm);
int mca_coll_demo_bcast_intra(void *buff, int count,
struct ompi_datatype_t *datatype,
int root,
struct ompi_communicator_t *comm);
int mca_coll_demo_bcast_inter(void *buff, int count,
struct ompi_datatype_t *datatype,
int root,
struct ompi_communicator_t *comm);
int mca_coll_demo_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_demo_exscan_inter(void *sbuf, void *rbuf, int count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm);
int mca_coll_demo_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_demo_gather_inter(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_demo_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_demo_gatherv_inter(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_demo_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_demo_reduce_inter(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_demo_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_demo_reduce_scatter_inter(void *sbuf, void *rbuf,
int *rcounts,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm);
int mca_coll_demo_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_demo_scan_inter(void *sbuf, void *rbuf, int count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm);
int mca_coll_demo_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_demo_scatter_inter(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_demo_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);
int mca_coll_demo_scatterv_inter(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);
#ifdef __cplusplus
}
#endif
/* Utility functions */
static inline void mca_coll_demo_free_reqs(ompi_request_t **reqs, int count)
{
int i;
for (i = 0; i < count; ++i)
mca_pml.pml_free(&reqs[i]);
}
/*
* Data structure for hanging data off the communicator
*/
struct mca_coll_base_comm_t {
ompi_request_t **mccb_reqs;
int mccb_num_reqs;
};
#endif /* MCA_COLL_DEMO_EXPORT_H */

50
src/mca/coll/demo/coll_demo_allgather.c Обычный файл
Просмотреть файл

@ -0,0 +1,50 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* allgather_intra
*
* Function: - allgather using other MPI collections
* Accepts: - same as MPI_Allgather()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo allgather_intra");
return comm->c_coll_basic_module->coll_allgather(sbuf, scount, sdtype, rbuf,
rcount, rdtype, comm);
}
/*
* allgather_inter
*
* Function: - allgather using other MPI collections
* Accepts: - same as MPI_Allgather()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_allgather_inter(void *sbuf, int scount,
struct ompi_datatype_t *sdtype,
void *rbuf, int rcount,
struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo allgather_inter");
return comm->c_coll_basic_module->coll_allgather(sbuf, scount, sdtype, rbuf,
rcount, rdtype, comm);
}

53
src/mca/coll/demo/coll_demo_allgatherv.c Обычный файл
Просмотреть файл

@ -0,0 +1,53 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* allgatherv_intra
*
* Function: - allgather using other MPI collectives
* Accepts: - same as MPI_Allgatherv()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo allgatherv_intra");
return comm->c_coll_basic_module->coll_allgatherv(sbuf, scount, sdtype,
rbuf, rcounts, disps,
rdtype, comm);
}
/*
* allgatherv_inter
*
* Function: - allgather using other MPI collectives
* Accepts: - same as MPI_Allgatherv()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_allgatherv_inter(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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo allgatherv_inter");
return comm->c_coll_basic_module->coll_allgatherv(sbuf, scount, sdtype,
rbuf, rcounts, disps,
rdtype, comm);
}

49
src/mca/coll/demo/coll_demo_allreduce.c Обычный файл
Просмотреть файл

@ -0,0 +1,49 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* allreduce_intra
*
* Function: - allreduce using other MPI collectives
* Accepts: - same as MPI_Allreduce()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_allreduce_intra(void *sbuf, void *rbuf, int count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo allreduce_intra");
return comm->c_coll_basic_module->coll_allreduce(sbuf, rbuf, count, dtype,
op, comm);
}
/*
* allreduce_inter
*
* Function: - allreduce using other MPI collectives
* Accepts: - same as MPI_Allreduce()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_allreduce_inter(void *sbuf, void *rbuf, int count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo allreduce_inter");
return comm->c_coll_basic_module->coll_allreduce(sbuf, rbuf, count, dtype,
op, comm);
}

53
src/mca/coll/demo/coll_demo_alltoall.c Обычный файл
Просмотреть файл

@ -0,0 +1,53 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* alltoall_intra
*
* Function: - MPI_Alltoall
* Accepts: - same as MPI_Alltoall()
* Returns: - MPI_SUCCESS or an MPI error code
*/
int mca_coll_demo_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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo alltoall_intra\n");
return comm->c_coll_basic_module->coll_alltoall(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
comm);
}
/*
* alltoall_inter
*
* Function: - MPI_Alltoall
* Accepts: - same as MPI_Alltoall()
* Returns: - MPI_SUCCESS or an MPI error code
*/
int mca_coll_demo_alltoall_inter(void *sbuf, int scount,
struct ompi_datatype_t *sdtype,
void *rbuf, int rcount,
struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo alltoall_inter\n");
return comm->c_coll_basic_module->coll_alltoall(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
comm);
}

55
src/mca/coll/demo/coll_demo_alltoallv.c Обычный файл
Просмотреть файл

@ -0,0 +1,55 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* alltoallv_intra
*
* Function: - MPI_Alltoallv for non-ompid RPIs
* Accepts: - same as MPI_Alltoallv()
* Returns: - MPI_SUCCESS or an MPI error code
*/
int
mca_coll_demo_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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo alltoallv_intra");
return comm->c_coll_basic_module->coll_alltoallv(sbuf, scounts, sdisps,
sdtype, rbuf, rcounts,
rdisps, rdtype, comm);
}
/*
* alltoallv_inter
*
* Function: - MPI_Alltoallv for non-lamd RPIs
* Accepts: - same as MPI_Alltoallv()
* Returns: - MPI_SUCCESS or an MPI error code
*/
int
mca_coll_demo_alltoallv_inter(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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo alltoallv_inter");
return comm->c_coll_basic_module->coll_alltoallv(sbuf, scounts, sdisps,
sdtype, rbuf, rcounts,
rdisps, rdtype, comm);
}

53
src/mca/coll/demo/coll_demo_alltoallw.c Обычный файл
Просмотреть файл

@ -0,0 +1,53 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* alltoallw_intra
*
* Function: - MPI_Alltoallw for non-ompid RPIs
* Accepts: - same as MPI_Alltoallw()
* Returns: - MPI_SUCCESS or an MPI error code
*/
int mca_coll_demo_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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo alltoallw_intra");
return comm->c_coll_basic_module->coll_alltoallw(sbuf, scounts, sdisps,
sdtypes, rbuf, rcounts,
rdisps, rdtypes, comm);
}
/*
* alltoallw_inter
*
* Function: - MPI_Alltoallw for non-lamd RPIs
* Accepts: - same as MPI_Alltoallw()
* Returns: - MPI_SUCCESS or an MPI error code
*/
int mca_coll_demo_alltoallw_inter(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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo alltoallw_inter");
return comm->c_coll_basic_module->coll_alltoallw(sbuf, scounts, sdisps,
sdtypes, rbuf, rcounts,
rdisps, rdtypes, comm);
}

41
src/mca/coll/demo/coll_demo_barrier.c Обычный файл
Просмотреть файл

@ -0,0 +1,41 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* barrier_intra
*
* Function: - barrier using O(N) algorithm
* Accepts: - same as MPI_Barrier()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_barrier_intra(struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo barrier_intra");
return comm->c_coll_basic_module->coll_barrier(comm);
}
/*
* barrier_inter
*
* Function: - barrier using O(log(N)) algorithm
* Accepts: - same as MPI_Barrier()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_barrier_inter(struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo barrier_inter");
return comm->c_coll_basic_module->coll_barrier(comm);
}

47
src/mca/coll/demo/coll_demo_bcast.c Обычный файл
Просмотреть файл

@ -0,0 +1,47 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* bcast_intra
*
* Function: - broadcast using O(N) algorithm
* Accepts: - same arguments as MPI_Bcast()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_bcast_intra(void *buff, int count,
struct ompi_datatype_t *datatype, int root,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo bcast_intra");
return comm->c_coll_basic_module->coll_bcast(buff, count, datatype,
root, comm);
}
/*
* bcast_inter
*
* Function: - broadcast using O(N) algorithm
* Accepts: - same arguments as MPI_Bcast()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_bcast_inter(void *buff, int count,
struct ompi_datatype_t *datatype, int root,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo bcast_inter");
return comm->c_coll_basic_module->coll_bcast(buff, count, datatype,
root, comm);
}

93
src/mca/coll/demo/coll_demo_component.c Обычный файл
Просмотреть файл

@ -0,0 +1,93 @@
/*
* $HEADER$
*
* These symbols are in a file by themselves to provide nice linker
* semantics. Since linkers generally pull in symbols by object
* files, keeping these symbols as the only symbols in this file
* prevents utility programs such as "ompi_info" from having to import
* entire components just to query their version and parameters.
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "coll-demo-version.h"
#include "mpi.h"
#include "mca/coll/coll.h"
#include "coll_demo.h"
/*
* Public string showing the coll ompi_demo component version number
*/
const char *mca_coll_demo_component_version_string =
"OMPI/MPI demo collective MCA component version " MCA_COLL_DEMO_FULL_VERSION;
/*
* Global variable
*/
int mca_coll_demo_priority_param = -1;
int mca_coll_demo_verbose_param = -1;
int mca_coll_demo_verbose = 0;
/*
* Local function
*/
static int demo_open(void);
/*
* Instantiate the public struct with all of our public information
* and pointers to our public functions in it
*/
const mca_coll_base_component_1_0_0_t mca_coll_demo_component = {
/* 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) */
MCA_COLL_BASE_VERSION_1_0_0,
/* Component name and version */
"demo",
MCA_COLL_DEMO_MAJOR_VERSION,
MCA_COLL_DEMO_MINOR_VERSION,
MCA_COLL_DEMO_RELEASE_VERSION,
/* Component open and close functions */
demo_open,
NULL
},
/* Next the MCA v1.0.0 component meta data */
{
/* Whether the component is checkpointable or not */
true
},
/* Initialization / querying functions */
mca_coll_demo_init_query,
mca_coll_demo_comm_query,
NULL
};
static int demo_open(void)
{
/* Use a low priority, but allow other components to be lower */
mca_coll_demo_priority_param =
mca_base_param_register_int("coll", "demo", "priority", NULL, 20);
mca_coll_demo_verbose_param =
mca_base_param_register_int("coll", "demo", "verbose", NULL,
mca_coll_demo_verbose);
return OMPI_SUCCESS;
}

51
src/mca/coll/demo/coll_demo_exscan.c Обычный файл
Просмотреть файл

@ -0,0 +1,51 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include <stdio.h>
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* exscan_intra
*
* Function: - demo exscan operation
* Accepts: - same arguments as MPI_Exccan()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_exscan_intra(void *sbuf, void *rbuf, int count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo exscan_intra");
return comm->c_coll_basic_module->coll_exscan(sbuf, rbuf, count, dtype,
op, comm);
}
/*
* exscan_inter
*
* Function: - demo exscan operation
* Accepts: - same arguments as MPI_Exccan()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_exscan_inter(void *sbuf, void *rbuf, int count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo exscan_inter");
return comm->c_coll_basic_module->coll_exscan(sbuf, rbuf, count, dtype,
op, comm);
}

52
src/mca/coll/demo/coll_demo_gather.c Обычный файл
Просмотреть файл

@ -0,0 +1,52 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* gather_intra
*
* Function: - demo gather operation
* Accepts: - same arguments as MPI_Gather()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo gather_intra");
return comm->c_coll_basic_module->coll_gather(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
root, comm);
}
/*
* gather_inter
*
* Function: - demo gather operation
* Accepts: - same arguments as MPI_Gather()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_gather_inter(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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo gather_inter");
return comm->c_coll_basic_module->coll_gather(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
root, comm);
}

53
src/mca/coll/demo/coll_demo_gatherv.c Обычный файл
Просмотреть файл

@ -0,0 +1,53 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* gatherv_intra
*
* Function: - demo gatherv operation
* Accepts: - same arguments as MPI_Bcast()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo gatherv_intra");
return comm->c_coll_basic_module->coll_gatherv(sbuf, scount, sdtype,
rbuf, rcounts, disps,
rdtype, root, comm);
}
/*
* gatherv_inter
*
* Function: - demo gatherv operation
* Accepts: - same arguments as MPI_Bcast()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_gatherv_inter(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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo gatherv_inter");
return comm->c_coll_basic_module->coll_gatherv(sbuf, scount, sdtype,
rbuf, rcounts, disps,
rdtype, root, comm);
}

51
src/mca/coll/demo/coll_demo_reduce.c Обычный файл
Просмотреть файл

@ -0,0 +1,51 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include <stdio.h>
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* reduce_intra
*
* Function: - reduction using O(N) algorithm
* Accepts: - same as MPI_Reduce()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo reduce_intra");
return comm->c_coll_basic_module->coll_reduce(sbuf, rbuf, count, dtype,
op, root, comm);
}
/*
* reduce_log_inter
*
* Function: - reduction using O(N) algorithm
* Accepts: - same as MPI_Reduce()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_reduce_inter(void *sbuf, void *rbuf, int count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
int root, struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo reduce_inter");
return comm->c_coll_basic_module->coll_reduce(sbuf, rbuf, count, dtype,
op, root, comm);
}

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

@ -0,0 +1,52 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include <stdio.h>
#include <errno.h>
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* reduce_scatter
*
* Function: - reduce then scatter
* Accepts: - same as MPI_Reduce_scatter()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_reduce_scatter_intra(void *sbuf, void *rbuf, int *rcounts,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo scatter_intra");
return comm->c_coll_basic_module->coll_reduce_scatter(sbuf, rbuf, rcounts,
dtype, op, comm);
}
/*
* reduce_scatter_inter
*
* Function: - reduce/scatter operation
* Accepts: - same arguments as MPI_Reduce_scatter()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_reduce_scatter_inter(void *sbuf, void *rbuf, int *rcounts,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo scatter_inter");
return comm->c_coll_basic_module->coll_reduce_scatter(sbuf, rbuf, rcounts,
dtype, op, comm);
}

33
src/mca/coll/demo/coll_demo_scan.c Обычный файл
Просмотреть файл

@ -0,0 +1,33 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include <stdio.h>
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* scan
*
* Function: - demo scan operation
* Accepts: - same arguments as MPI_Scan()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_scan_intra(void *sbuf, void *rbuf, int count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo scan_intra");
return comm->c_coll_basic_module->coll_scan(sbuf, rbuf, count,
dtype, op, comm);
}

55
src/mca/coll/demo/coll_demo_scatter.c Обычный файл
Просмотреть файл

@ -0,0 +1,55 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* scatter_intra
*
* Function: - scatter operation
* Accepts: - same arguments as MPI_Scatter()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo scatter_intra");
return comm->c_coll_basic_module->coll_scatter(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
root, comm);
}
/*
* scatter_inter
*
* Function: - scatter operation
* Accepts: - same arguments as MPI_Scatter()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_scatter_inter(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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo scatter_inter");
return comm->c_coll_basic_module->coll_scatter(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
root, comm);
}

53
src/mca/coll/demo/coll_demo_scatterv.c Обычный файл
Просмотреть файл

@ -0,0 +1,53 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "coll_demo.h"
#include "mpi.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "coll_demo.h"
/*
* scatterv_intra
*
* Function: - scatterv operation
* Accepts: - same arguments as MPI_Scatter()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo scatterv_intra");
return comm->c_coll_basic_module->coll_scatterv(sbuf, scounts, disps,
sdtype, rbuf, rcount, rdtype,
root, comm);
}
/*
* scatterv_inter
*
* Function: - scatterv operation
* Accepts: - same arguments as MPI_Scatter()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_demo_scatterv_inter(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)
{
ompi_output_verbose(10, mca_coll_base_output, "In demo scatterv_inter");
return comm->c_coll_basic_module->coll_scatterv(sbuf, scounts, disps,
sdtype, rbuf, rcount, rdtype,
root, comm);
}

10
src/mca/coll/demo/configure.params Обычный файл
Просмотреть файл

@ -0,0 +1,10 @@
# -*- shell-script -*-
#
# $HEADER$
#
# Specific to this module
PARAM_INIT_FILE=coll_demo.c
PARAM_CONFIG_HEADER_FILE=coll_demo_config.h
PARAM_CONFIG_FILES="Makefile"

35
src/mca/coll/demo/configure.stub Обычный файл
Просмотреть файл

@ -0,0 +1,35 @@
#
# Don't really need anything in here -- we just want a configure
# script so that this can be a standalone component.
#
# Hackaround until bug 1015 fixed
AC_DEFUN([MCA_CONFIGURE_STUB],[
dnl Generate the version header template
AC_CONFIG_FILES([coll-demo-version.h.template])
dnl After config.status has run, compare the version header template to
dnl the version header. If the version header does not exist, create it
dnl from the template. If it does already exist, diff it and see if
dnl they're different. If they're different, copy the template over the
dnl old version. If they're the same, leave the original alone so that
dnl we don't distrub any dependencies.
AC_CONFIG_COMMANDS([COLL-DEMO],
[if test -f "coll-demo-version.h"; then
diff "coll-demo-version.h" "coll-demo-version.h.template" > /dev/null 2>&1
if test "$?" != "0"; then
cp "coll-demo-version.h.template" "coll-demo-version.h"
echo "config.status: regenerating coll-demo-version.h"
else
echo "config.state: coll-demo-version.h unchanged"
fi
else
cp "coll-demo-version.h.template" "coll-demo-version.h"
echo "config.status: creating coll-demo-version.h"
fi
rm coll-demo-version.h.template])
])