Update collectives selection logic to allow for multiple components to be
used at nce (up to one unique collective module per collective function). Matches r15795:15921 of the tmp/bwb-coll-select branch This commit was SVN r15924. The following SVN revisions from the original message are invalid or inconsistent and therefore were not cross-referenced: r15795 r15921
Этот коммит содержится в:
родитель
2b8af283de
Коммит
af4e86c25f
@ -31,6 +31,7 @@ dnl
|
||||
|
||||
sinclude(@M4DIR@/ompi_setup_cc.m4)
|
||||
sinclude(@M4DIR@/ompi_check_optflags.m4)
|
||||
sinclude(@M4DIR@/ompi_check_vendor.m4)
|
||||
|
||||
dnl
|
||||
dnl C++ compiler tests
|
||||
|
@ -225,7 +225,7 @@ if test -z "$with_openmpi"; then
|
||||
|
||||
top_ompi_srcdir='$(top_srcdir)/../../../..'
|
||||
top_ompi_builddir='$(top_builddir)/../../../..'
|
||||
INCFLAGS='-I$(top_ompi_srcdir)/include -I$(top_ompi_builddir)/include -I$(top_ompi_srcdir) -I$(top_ompi_builddir) -I$(top_ompi_srcdir)/opal -I$(top_ompi_builddir)/opal -I$(top_ompi_srcdir)/orte -I$(top_ompi_builddir)/orte -I$(top_ompi_srcdir)/ompi -I$(top_ompi_builddir)/ompi'" $CPPFLAGS"
|
||||
INCFLAGS='-I$(top_ompi_srcdir) -I$(top_ompi_builddir) -I$(top_ompi_srcdir)/opal/include -I$(top_ompi_builddir)/opal/include -I$(top_ompi_srcdir)/orte/include -I$(top_ompi_builddir)/orte/include -I$(top_ompi_srcdir)/ompi/include -I$(top_ompi_builddir)/ompi/include'" $CPPFLAGS"
|
||||
found_ompi_headers=1
|
||||
AC_MSG_RESULT([already in Open MPI source tree])
|
||||
fi
|
||||
|
@ -18,6 +18,7 @@ int main(int argc, char* argv[])
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &size);
|
||||
printf("Hello, world, I am %d of %d\n", rank, size);
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
MPI_Finalize();
|
||||
|
||||
return 0;
|
||||
|
@ -60,12 +60,14 @@ static int ompi_comm_fill_rest (ompi_communicator_t *comm,
|
||||
*/
|
||||
typedef int ompi_comm_allgatherfct (void* inbuf, int incount, MPI_Datatype intype,
|
||||
void* outbuf, int outcount, MPI_Datatype outtype,
|
||||
ompi_communicator_t *comm);
|
||||
ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *data);
|
||||
|
||||
static int ompi_comm_allgather_emulate_intra (void* inbuf, int incount, MPI_Datatype intype,
|
||||
void* outbuf, int outcount,
|
||||
MPI_Datatype outtype,
|
||||
ompi_communicator_t *comm);
|
||||
ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *data);
|
||||
|
||||
static int ompi_comm_copy_topo (ompi_communicator_t *oldcomm,
|
||||
ompi_communicator_t *newcomm);
|
||||
@ -269,7 +271,8 @@ int ompi_comm_create ( ompi_communicator_t *comm, ompi_group_t *group,
|
||||
|
||||
rc = comm->c_coll.coll_allgather ( &(group->grp_my_rank),
|
||||
1, MPI_INT, allranks,
|
||||
1, MPI_INT, comm );
|
||||
1, MPI_INT, comm,
|
||||
comm->c_coll.coll_allgather_module);
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
@ -355,8 +358,7 @@ int ompi_comm_create ( ompi_communicator_t *comm, ompi_group_t *group,
|
||||
NULL, /* remote_leader */
|
||||
mode, /* mode */
|
||||
-1, /* send first */
|
||||
0, /* sync_flag */
|
||||
NULL ); /* coll component */
|
||||
0); /* sync_flag */
|
||||
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
@ -430,7 +432,7 @@ int ompi_comm_split ( ompi_communicator_t* comm, int color, int key,
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
rc = allgatherfct( myinfo, 2, MPI_INT, results, 2, MPI_INT, comm );
|
||||
rc = allgatherfct( myinfo, 2, MPI_INT, results, 2, MPI_INT, comm, comm->c_coll.coll_allgather_module );
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
@ -485,7 +487,8 @@ int ompi_comm_split ( ompi_communicator_t* comm, int color, int key,
|
||||
|
||||
/* this is an allgather on an inter-communicator */
|
||||
rc = comm->c_coll.coll_allgather( myinfo, 2, MPI_INT, rresults, 2,
|
||||
MPI_INT, comm );
|
||||
MPI_INT, comm,
|
||||
comm->c_coll.coll_allgather_module);
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
@ -586,8 +589,7 @@ int ompi_comm_split ( ompi_communicator_t* comm, int color, int key,
|
||||
NULL, /* remote_leader */
|
||||
mode, /* mode */
|
||||
-1, /* send first */
|
||||
0, /* sync_flag */
|
||||
NULL ); /* coll component */
|
||||
0); /* sync_flag */
|
||||
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
@ -691,8 +693,7 @@ int ompi_comm_dup ( ompi_communicator_t * comm, ompi_communicator_t **newcomm,
|
||||
NULL, /* remote_leader */
|
||||
mode, /* mode */
|
||||
-1, /* send_first */
|
||||
0, /* sync_flag */
|
||||
(mca_base_component_t *) comp->c_coll_selected_component /* coll component */
|
||||
0 /* sync_flag */
|
||||
);
|
||||
if ( MPI_SUCCESS != rc ) {
|
||||
return rc;
|
||||
@ -706,8 +707,7 @@ int ompi_comm_dup ( ompi_communicator_t * comm, ompi_communicator_t **newcomm,
|
||||
NULL, /* remote_leader */
|
||||
mode, /* mode */
|
||||
-1, /* send_first */
|
||||
1, /* sync_flag */
|
||||
(mca_base_component_t *) comp->c_coll_selected_component /* coll component */
|
||||
1 /* sync_flag */
|
||||
);
|
||||
if ( MPI_SUCCESS != rc ) {
|
||||
return rc;
|
||||
@ -883,7 +883,8 @@ int ompi_comm_set_name (ompi_communicator_t *comm, char *name )
|
||||
static int ompi_comm_allgather_emulate_intra( void *inbuf, int incount,
|
||||
MPI_Datatype intype, void* outbuf,
|
||||
int outcount, MPI_Datatype outtype,
|
||||
ompi_communicator_t *comm)
|
||||
ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *data)
|
||||
{
|
||||
int rank, size, rsize, i, rc;
|
||||
int *tmpbuf=NULL;
|
||||
@ -1090,7 +1091,8 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
|
||||
|
||||
/* broadcast buffer length to all processes in local_comm */
|
||||
rc = local_comm->c_coll.coll_bcast( &rlen, 1, MPI_INT,
|
||||
local_leader, local_comm );
|
||||
local_leader, local_comm,
|
||||
local_comm->c_coll.coll_bcast_module );
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto err_exit;
|
||||
}
|
||||
@ -1123,7 +1125,8 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
|
||||
|
||||
/* broadcast name list to all proceses in local_comm */
|
||||
rc = local_comm->c_coll.coll_bcast( recvbuf, rlen, MPI_BYTE,
|
||||
local_leader, local_comm );
|
||||
local_leader, local_comm,
|
||||
local_comm->c_coll.coll_bcast_module);
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto err_exit;
|
||||
}
|
||||
@ -1220,7 +1223,8 @@ int ompi_comm_determine_first ( ompi_communicator_t *intercomm, int high )
|
||||
|
||||
rc = intercomm->c_coll.coll_allgatherv(&high, scount, MPI_INT,
|
||||
&rhigh, rcounts, rdisps,
|
||||
MPI_INT, intercomm);
|
||||
MPI_INT, intercomm,
|
||||
intercomm->c_coll.coll_allgatherv_module);
|
||||
if ( rc != OMPI_SUCCESS ) {
|
||||
flag = MPI_UNDEFINED;
|
||||
}
|
||||
@ -1542,8 +1546,7 @@ int ompi_topo_create (ompi_communicator_t *old_comm,
|
||||
NULL, /* remote_leader */
|
||||
OMPI_COMM_CID_INTRA, /* mode */
|
||||
-1, /* send first, doesn't matter */
|
||||
0, /* sync_flag */
|
||||
NULL ); /* coll component */
|
||||
0); /* sync_flag */
|
||||
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
/* something wrong happened during setting the communicator */
|
||||
|
@ -405,8 +405,7 @@ int ompi_comm_activate ( ompi_communicator_t* newcomm,
|
||||
void* remote_leader,
|
||||
int mode,
|
||||
int send_first,
|
||||
int sync_flag,
|
||||
mca_base_component_t *collcomponent )
|
||||
int sync_flag)
|
||||
{
|
||||
int ok=0, gok=0;
|
||||
ompi_comm_cid_allredfct* allredfnct;
|
||||
@ -475,7 +474,7 @@ int ompi_comm_activate ( ompi_communicator_t* newcomm,
|
||||
/* Let the collectives components fight over who will do
|
||||
collective on this new comm. */
|
||||
if (OMPI_SUCCESS !=
|
||||
(ok = mca_coll_base_comm_select(newcomm, collcomponent))) {
|
||||
(ok = mca_coll_base_comm_select(newcomm))) {
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
@ -501,7 +500,8 @@ static int ompi_comm_allreduce_intra ( int *inbuf, int *outbuf,
|
||||
int send_first )
|
||||
{
|
||||
return comm->c_coll.coll_allreduce ( inbuf, outbuf, count, MPI_INT,
|
||||
op,comm );
|
||||
op,comm,
|
||||
comm->c_coll.coll_allreduce_module );
|
||||
}
|
||||
|
||||
/* Arguments not used in this implementation:
|
||||
@ -548,7 +548,8 @@ static int ompi_comm_allreduce_inter ( int *inbuf, int *outbuf,
|
||||
/* Execute the inter-allreduce: the result of our group will
|
||||
be in the buffer of the remote group */
|
||||
rc = intercomm->c_coll.coll_allreduce ( inbuf, tmpbuf, count, MPI_INT,
|
||||
op, intercomm );
|
||||
op, intercomm,
|
||||
intercomm->c_coll.coll_allreduce_module);
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
@ -610,7 +611,8 @@ static int ompi_comm_allreduce_inter ( int *inbuf, int *outbuf,
|
||||
sbuf = outbuf;
|
||||
rc = intercomm->c_coll.coll_allgatherv (sbuf, scount, MPI_INT, outbuf,
|
||||
rcounts, rdisps, MPI_INT,
|
||||
intercomm);
|
||||
intercomm,
|
||||
intercomm->c_coll.coll_allgatherv_module);
|
||||
|
||||
exit:
|
||||
if ( NULL != tmpbuf ) {
|
||||
@ -658,7 +660,7 @@ static int ompi_comm_allreduce_intra_bridge (int *inbuf, int *outbuf,
|
||||
|
||||
/* Intercomm_create */
|
||||
rc = comm->c_coll.coll_allreduce ( inbuf, tmpbuf, count, MPI_INT,
|
||||
op, comm );
|
||||
op, comm, comm->c_coll.coll_allreduce_module );
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
@ -707,7 +709,7 @@ static int ompi_comm_allreduce_intra_bridge (int *inbuf, int *outbuf,
|
||||
}
|
||||
|
||||
rc = comm->c_coll.coll_bcast ( outbuf, count, MPI_INT, local_leader,
|
||||
comm);
|
||||
comm, comm->c_coll.coll_bcast_module );
|
||||
|
||||
exit:
|
||||
if (NULL != tmpbuf ) {
|
||||
@ -755,7 +757,8 @@ static int ompi_comm_allreduce_intra_oob (int *inbuf, int *outbuf,
|
||||
}
|
||||
|
||||
/* comm is an intra-communicator */
|
||||
rc = comm->c_coll.coll_allreduce(inbuf,tmpbuf,count,MPI_INT,op, comm );
|
||||
rc = comm->c_coll.coll_allreduce(inbuf,tmpbuf,count,MPI_INT,op, comm,
|
||||
comm->c_coll.coll_allreduce_module);
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
@ -811,7 +814,8 @@ static int ompi_comm_allreduce_intra_oob (int *inbuf, int *outbuf,
|
||||
}
|
||||
|
||||
rc = comm->c_coll.coll_bcast (outbuf, count, MPI_INT,
|
||||
local_leader, comm);
|
||||
local_leader, comm,
|
||||
comm->c_coll.coll_bcast_module);
|
||||
|
||||
exit:
|
||||
if (NULL != tmpbuf ) {
|
||||
|
@ -175,7 +175,8 @@ int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root,
|
||||
rnamebuflen_int = (int)rnamebuflen;
|
||||
|
||||
/* bcast the buffer-length to all processes in the local comm */
|
||||
rc = comm->c_coll.coll_bcast (&rnamebuflen_int, 1, MPI_INT, root, comm );
|
||||
rc = comm->c_coll.coll_bcast (&rnamebuflen_int, 1, MPI_INT, root, comm,
|
||||
comm->c_coll.coll_bcast_module);
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
@ -195,7 +196,8 @@ int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root,
|
||||
adds processes, which were not known yet to our
|
||||
process pool.
|
||||
*/
|
||||
rc = comm->c_coll.coll_bcast (rnamebuf, rnamebuflen_int, MPI_BYTE, root, comm );
|
||||
rc = comm->c_coll.coll_bcast (rnamebuf, rnamebuflen_int, MPI_BYTE, root, comm,
|
||||
comm->c_coll.coll_bcast_module);
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
@ -280,8 +282,7 @@ int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root,
|
||||
rport, /* remote leader */
|
||||
OMPI_COMM_CID_INTRA_OOB, /* mode */
|
||||
send_first, /* send or recv first */
|
||||
0, /* sync_flag */
|
||||
NULL ); /* coll component */
|
||||
0); /* sync_flag */
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -304,21 +304,17 @@ static void ompi_comm_construct(ompi_communicator_t* comm)
|
||||
this communiucator */
|
||||
comm->c_keyhash = NULL;
|
||||
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
memset (&(comm->c_coll), 0, sizeof(mca_coll_base_module_1_0_0_t));
|
||||
#endif
|
||||
|
||||
comm->c_coll_selected_component = NULL;
|
||||
comm->c_coll_selected_module = NULL;
|
||||
comm->c_coll_selected_data = NULL;
|
||||
comm->c_coll_basic_module = NULL;
|
||||
comm->c_coll_basic_data = NULL;
|
||||
|
||||
comm->errhandler_type = OMPI_ERRHANDLER_TYPE_COMM;
|
||||
#ifdef OMPI_WANT_PERUSE
|
||||
comm->c_peruse_handles = NULL;
|
||||
#endif
|
||||
|
||||
/* Need to zero out the collectives module because we sometimes
|
||||
call coll_unselect without a matching call to coll_select, and
|
||||
we need an easy way for the coll base code to realize we've
|
||||
done this. */
|
||||
memset(&comm->c_coll, 0, sizeof(mca_coll_base_comm_coll_t));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -31,9 +31,7 @@
|
||||
#include "orte/mca/rml/rml_types.h"
|
||||
#include "ompi/proc/proc.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
BEGIN_C_DECLS
|
||||
|
||||
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_communicator_t);
|
||||
|
||||
@ -154,24 +152,8 @@ struct ompi_communicator_t {
|
||||
/* Hooks for PML to hang things */
|
||||
struct mca_pml_comm_t *c_pml_comm;
|
||||
|
||||
mca_coll_base_module_1_0_0_t c_coll;
|
||||
/**< Selected collective module, saved by value for speed (instead
|
||||
of by reference) */
|
||||
|
||||
const mca_coll_base_component_1_0_0_t *c_coll_selected_component;
|
||||
/**< Selected coll component */
|
||||
const mca_coll_base_module_1_0_0_t *c_coll_selected_module;
|
||||
/**< The selected module, but only when the selected module
|
||||
is not* the basic module. Used during comm_unselect(). */
|
||||
struct mca_coll_base_comm_t *c_coll_selected_data;
|
||||
/**< Allow the selected module to cache data on the communicator */
|
||||
|
||||
const mca_coll_base_module_1_0_0_t *c_coll_basic_module;
|
||||
/**< Save the basic module; only necessary when the selected
|
||||
module is *not* the basic module, but was supplemented
|
||||
with methods from the basic module. */
|
||||
struct mca_coll_base_comm_t *c_coll_basic_data;
|
||||
/**< Allow the basic module to cache data on the communicator */
|
||||
/* Collectives module interface and data */
|
||||
mca_coll_base_comm_coll_t c_coll;
|
||||
};
|
||||
typedef struct ompi_communicator_t ompi_communicator_t;
|
||||
OMPI_DECLSPEC extern ompi_communicator_t *ompi_mpi_comm_parent;
|
||||
@ -436,8 +418,7 @@ struct ompi_communicator_t {
|
||||
void* remote_leader,
|
||||
int mode,
|
||||
int send_first,
|
||||
int sync_flag,
|
||||
mca_base_component_t *collcomponent );
|
||||
int sync_flag );
|
||||
|
||||
|
||||
/**
|
||||
@ -536,8 +517,6 @@ struct ompi_communicator_t {
|
||||
ompi_comm_disconnect_obj *ompi_comm_disconnect_init (ompi_communicator_t *comm);
|
||||
void ompi_comm_disconnect_waitall (int count, ompi_comm_disconnect_obj **objs );
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* OMPI_COMMUNICATOR_H */
|
||||
|
@ -117,32 +117,6 @@ int mca_coll_base_find_available(bool enable_progress_threads,
|
||||
* almost everything else is functional on the communicator (e.g.,
|
||||
* point-to-point communication).
|
||||
*
|
||||
* This function invokes the selection process for coll components,
|
||||
* which works as follows:
|
||||
*
|
||||
* - If the \em preferred argument is NULL, the selection set is
|
||||
* defined to be all the components found during
|
||||
* mca_coll_base_find_available().
|
||||
* - If \em preferred is not NULL, then the selection set is just
|
||||
* that component. (However, in this mode, we may make 2 passes
|
||||
* through the selection process -- more on this below).
|
||||
* - All components in the selection set are queried to see if they
|
||||
* want to run with that communicator. All components that want to
|
||||
* run are ranked by their priority and the highest priority
|
||||
* component is selected. All non-selected components have their
|
||||
* "unquery" function invoked to let them know that they were not
|
||||
* selected.
|
||||
* - The selected component will have its "init" function invoked to
|
||||
* let it know that it was selected.
|
||||
* - If we fall through this entire process and no component is
|
||||
* selected \em and the \em preferred argument is not NULL, then
|
||||
* run the entire process again as if the \em preferred argument
|
||||
* was NULL (i.e., use the entire available set of components).
|
||||
*
|
||||
* At the end of this process, we'll either have a single component
|
||||
* that is selected and initialized for the communicator, or no
|
||||
* component was selected and an error is returned up the stack.
|
||||
*
|
||||
* Note that new communicators may be created as a result of
|
||||
* invoking this function. Specifically: this function is called in
|
||||
* the depths of communicator creation, but during the execution of
|
||||
@ -150,8 +124,7 @@ int mca_coll_base_find_available(bool enable_progress_threads,
|
||||
* communicator creation functions may be re-entered (albiet with
|
||||
* different arguments).
|
||||
*/
|
||||
int mca_coll_base_comm_select(struct ompi_communicator_t *comm,
|
||||
struct mca_base_component_t *preferred);
|
||||
int mca_coll_base_comm_select(struct ompi_communicator_t *comm);
|
||||
|
||||
/**
|
||||
* Finalize a coll component on a specific communicator.
|
||||
@ -176,15 +149,6 @@ int mca_coll_base_comm_select(struct ompi_communicator_t *comm,
|
||||
*/
|
||||
int mca_coll_base_comm_unselect(struct ompi_communicator_t *comm);
|
||||
|
||||
/**
|
||||
* Finalize the coll usage on a communicator.
|
||||
*
|
||||
* @param comm The communicator that is being destroyed.
|
||||
*
|
||||
* @retval OMPI_SUCCESS Always.
|
||||
*/
|
||||
int mca_coll_base_comm_finalize(struct ompi_communicator_t *comm);
|
||||
|
||||
/**
|
||||
* Shut down the coll MCA framework.
|
||||
*
|
||||
@ -240,14 +204,6 @@ extern bool mca_coll_base_components_available_valid;
|
||||
*/
|
||||
extern opal_list_t mca_coll_base_components_available;
|
||||
|
||||
/**
|
||||
* Pointer to the "basic" component so that it can be found easily
|
||||
* (since the "basic" component is fairly special -- it's the lowest
|
||||
* common denominator between all coll components and may be used
|
||||
* interchangably).
|
||||
*/
|
||||
OMPI_DECLSPEC extern const mca_coll_base_component_1_0_0_t *mca_coll_base_basic_component;
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* MCA_BASE_COLL_H */
|
||||
|
@ -37,19 +37,6 @@
|
||||
/*
|
||||
* Local variables
|
||||
*/
|
||||
static int basic_priority = -1;
|
||||
static mca_coll_base_module_1_0_0_t null_module = {
|
||||
|
||||
/* Module init and finalize */
|
||||
|
||||
NULL, NULL,
|
||||
|
||||
/* Collective function pointers */
|
||||
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
@ -59,9 +46,7 @@ struct avail_coll_t {
|
||||
opal_list_item_t super;
|
||||
|
||||
int ac_priority;
|
||||
const mca_coll_base_component_1_0_0_t *ac_component;
|
||||
const mca_coll_base_module_1_0_0_t *ac_module;
|
||||
struct mca_coll_base_comm_t *ac_data;
|
||||
mca_coll_base_module_1_1_0_t *ac_module;
|
||||
};
|
||||
typedef struct avail_coll_t avail_coll_t;
|
||||
|
||||
@ -74,31 +59,15 @@ static opal_list_t *check_components(opal_list_t *components,
|
||||
char **names, int num_names);
|
||||
static int check_one_component(ompi_communicator_t *comm,
|
||||
const mca_base_component_t *component,
|
||||
const mca_coll_base_module_1_0_0_t **module,
|
||||
struct mca_coll_base_comm_t **data);
|
||||
mca_coll_base_module_1_1_0_t **module);
|
||||
|
||||
static int query(const mca_base_component_t *component,
|
||||
ompi_communicator_t *comm, int *priority,
|
||||
const mca_coll_base_module_1_0_0_t **module,
|
||||
struct mca_coll_base_comm_t **data);
|
||||
static int query_1_0_0(const mca_coll_base_component_1_0_0_t *coll_component,
|
||||
mca_coll_base_module_1_1_0_t **module);
|
||||
|
||||
static int query_1_1_0(const mca_coll_base_component_1_1_0_t *coll_component,
|
||||
ompi_communicator_t *comm, int *priority,
|
||||
const mca_coll_base_module_1_0_0_t **module,
|
||||
struct mca_coll_base_comm_t **data);
|
||||
|
||||
static void unquery(const mca_coll_base_component_1_0_0_t *coll_component,
|
||||
ompi_communicator_t *comm,
|
||||
struct mca_coll_base_comm_t *data);
|
||||
static void unquery_1_0_0(const mca_coll_base_component_1_0_0_t *coll_component,
|
||||
ompi_communicator_t *comm,
|
||||
struct mca_coll_base_comm_t *data);
|
||||
|
||||
static int module_init(const mca_coll_base_module_1_0_0_t *module,
|
||||
ompi_communicator_t *comm);
|
||||
|
||||
static int query_basic(ompi_communicator_t *comm);
|
||||
static int replace_null_with_basic(ompi_communicator_t *comm);
|
||||
|
||||
mca_coll_base_module_1_1_0_t **module);
|
||||
|
||||
/*
|
||||
* Stuff for the OBJ interface
|
||||
@ -106,6 +75,18 @@ static int replace_null_with_basic(ompi_communicator_t *comm);
|
||||
static OBJ_CLASS_INSTANCE(avail_coll_t, opal_list_item_t, NULL, NULL);
|
||||
|
||||
|
||||
#define COPY(module, comm, func) \
|
||||
do { \
|
||||
if (NULL != module->coll_ ## func) { \
|
||||
if (NULL != comm->c_coll.coll_ ## func ## _module) { \
|
||||
OBJ_RELEASE(comm->c_coll.coll_ ## func ## _module); \
|
||||
} \
|
||||
comm->c_coll.coll_ ## func = module->coll_ ## func; \
|
||||
comm->c_coll.coll_ ## func ## _module = module; \
|
||||
OBJ_RETAIN(module); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* This function is called at the initialization time of every
|
||||
* communicator. It is used to select which coll component will be
|
||||
@ -113,23 +94,15 @@ static OBJ_CLASS_INSTANCE(avail_coll_t, opal_list_item_t, NULL, NULL);
|
||||
*
|
||||
* This selection logic is not for the weak.
|
||||
*/
|
||||
int mca_coll_base_comm_select(ompi_communicator_t *comm,
|
||||
mca_base_component_t *preferred)
|
||||
int mca_coll_base_comm_select(ompi_communicator_t *comm)
|
||||
{
|
||||
bool found, using_basic;
|
||||
int err, num_names;
|
||||
char name[MPI_MAX_OBJECT_NAME + 32];
|
||||
char *names, **name_array;
|
||||
char *str;
|
||||
avail_coll_t *avail;
|
||||
opal_list_t *selectable;
|
||||
opal_list_item_t *item;
|
||||
const mca_coll_base_component_1_0_0_t *selected_component, *component;
|
||||
const mca_coll_base_module_1_0_0_t *selected_module;
|
||||
struct mca_coll_base_comm_t *selected_data;
|
||||
int ret, num_names;
|
||||
char name[MPI_MAX_OBJECT_NAME + 32];
|
||||
char *names, **name_array;
|
||||
opal_list_t *selectable;
|
||||
opal_list_item_t *item;
|
||||
|
||||
/* Announce */
|
||||
|
||||
snprintf(name, sizeof(name), "%s (cid %d)", comm->c_name,
|
||||
comm->c_contextid);
|
||||
name[sizeof(name) - 1] = '\0';
|
||||
@ -139,58 +112,15 @@ int mca_coll_base_comm_select(ompi_communicator_t *comm,
|
||||
|
||||
/* Initialize all the relevant pointers, since they're used as
|
||||
sentinel values */
|
||||
|
||||
comm->c_coll = null_module;
|
||||
|
||||
comm->c_coll_selected_component = NULL;
|
||||
comm->c_coll_selected_data = NULL;
|
||||
comm->c_coll_selected_module = NULL;
|
||||
|
||||
comm->c_coll_basic_data = NULL;
|
||||
comm->c_coll_basic_module = NULL;
|
||||
memset(&comm->c_coll, 0, sizeof(mca_coll_base_comm_coll_t));
|
||||
|
||||
/* See if a set of component was requested by the MCA parameter.
|
||||
Don't check for error. */
|
||||
|
||||
names = NULL;
|
||||
mca_base_param_lookup_string(mca_coll_base_param, &names);
|
||||
|
||||
/* Compute the intersection of all of my available components with
|
||||
the components from all the other processes in this
|
||||
communicator */
|
||||
|
||||
/* JMS CONTINUE HERE */
|
||||
|
||||
/* See if a preferred component was provided. If so, try to select
|
||||
it. If we don't succeed, fall through and do a normal
|
||||
selection. */
|
||||
|
||||
err = OMPI_ERROR;
|
||||
if (NULL != preferred) {
|
||||
str = &(preferred->mca_component_name[0]);
|
||||
|
||||
opal_output_verbose(10, mca_coll_base_output,
|
||||
"coll:base:comm_select: Checking preferred module: %s",
|
||||
str);
|
||||
selectable = check_components(&mca_coll_base_components_available,
|
||||
comm, &str, 1);
|
||||
|
||||
/* If we didn't get a preferred module, then call again without a
|
||||
preferred module. This makes the logic below dramatically
|
||||
simpler. */
|
||||
|
||||
if (NULL == selectable) {
|
||||
return mca_coll_base_comm_select(comm, NULL);
|
||||
}
|
||||
|
||||
/* We only fall through here if we were able to select one of the
|
||||
preferred modules */
|
||||
}
|
||||
|
||||
/* If there was no preferred module, then see if there were any listed
|
||||
in the MCA parameter; parse them and check them all */
|
||||
|
||||
else if (NULL != names && 0 < strlen(names)) {
|
||||
if (NULL != names && 0 < strlen(names)) {
|
||||
/* mca param based */
|
||||
name_array = opal_argv_split(names, ',');
|
||||
num_names = opal_argv_count(name_array);
|
||||
|
||||
@ -200,12 +130,8 @@ int mca_coll_base_comm_select(ompi_communicator_t *comm,
|
||||
selectable = check_components(&mca_coll_base_components_available,
|
||||
comm, name_array, num_names);
|
||||
opal_argv_free(name_array);
|
||||
}
|
||||
|
||||
/* Nope -- a specific [set of] component[s] was not requested. Go
|
||||
check them all. */
|
||||
|
||||
else {
|
||||
} else {
|
||||
/* no specific components given -- try all */
|
||||
opal_output_verbose(10, mca_coll_base_output,
|
||||
"coll:base:comm_select: Checking all available modules");
|
||||
selectable = check_components(&mca_coll_base_components_available,
|
||||
@ -215,112 +141,72 @@ int mca_coll_base_comm_select(ompi_communicator_t *comm,
|
||||
/* Upon return from the above, the modules list will contain the
|
||||
list of modules that returned (priority >= 0). If we have no
|
||||
collective modules available, then use the basic component */
|
||||
|
||||
if (NULL == selectable) {
|
||||
found = false;
|
||||
if (NULL != mca_coll_base_basic_component) {
|
||||
query_basic(comm);
|
||||
if (NULL != comm->c_coll_basic_module) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
/* There's no modules available -- including basic. Doh! */
|
||||
/* There's no modules available */
|
||||
opal_show_help("help-mca-coll-base",
|
||||
"comm-select:none-available", true);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
/* Do some kind of collective operation to find a module that
|
||||
everyone has available */
|
||||
/* FIX ME - Do some kind of collective operation to find a module
|
||||
that everyone has available */
|
||||
|
||||
#if 1
|
||||
/* For the moment, just take the top module off the list */
|
||||
/* do the selection loop */
|
||||
for (item = opal_list_get_first(selectable) ;
|
||||
item != opal_list_get_end(selectable) ;
|
||||
item = opal_list_get_next(item)) {
|
||||
avail_coll_t *avail = (avail_coll_t*) item;
|
||||
|
||||
if (NULL != selectable) {
|
||||
using_basic = false;
|
||||
item = opal_list_remove_first(selectable);
|
||||
avail = (avail_coll_t *) item;
|
||||
/* initialize the module */
|
||||
ret = avail->ac_module->coll_module_enable(avail->ac_module, comm);
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
mca_coll_base_comm_unselect(comm);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Check to see if the basic component has a higher priority than
|
||||
the highest priority component on the selectable list. If so,
|
||||
use basic. */
|
||||
/* copy over any of the pointers */
|
||||
COPY(avail->ac_module, comm, allgather);
|
||||
COPY(avail->ac_module, comm, allgatherv);
|
||||
COPY(avail->ac_module, comm, allreduce);
|
||||
COPY(avail->ac_module, comm, alltoall);
|
||||
COPY(avail->ac_module, comm, alltoallv);
|
||||
COPY(avail->ac_module, comm, alltoallw);
|
||||
COPY(avail->ac_module, comm, barrier);
|
||||
COPY(avail->ac_module, comm, bcast);
|
||||
COPY(avail->ac_module, comm, exscan);
|
||||
COPY(avail->ac_module, comm, gather);
|
||||
COPY(avail->ac_module, comm, gatherv);
|
||||
COPY(avail->ac_module, comm, reduce);
|
||||
COPY(avail->ac_module, comm, reduce_scatter);
|
||||
COPY(avail->ac_module, comm, scan);
|
||||
COPY(avail->ac_module, comm, scatter);
|
||||
COPY(avail->ac_module, comm, scatterv);
|
||||
|
||||
if (NULL != mca_coll_base_basic_component) {
|
||||
query_basic(comm);
|
||||
}
|
||||
if (avail->ac_priority > basic_priority) {
|
||||
selected_component = avail->ac_component;
|
||||
selected_module = avail->ac_module;
|
||||
selected_data = avail->ac_data;
|
||||
OBJ_RELEASE(avail);
|
||||
} else {
|
||||
opal_output_verbose(10, mca_coll_base_output,
|
||||
"coll:base:comm_select: component available: basic, priority: %d\n", basic_priority);
|
||||
using_basic = true;
|
||||
selected_component = mca_coll_base_basic_component;
|
||||
selected_module = comm->c_coll_basic_module;
|
||||
selected_data = comm->c_coll_basic_data;
|
||||
}
|
||||
} else {
|
||||
using_basic = true;
|
||||
selected_component = mca_coll_base_basic_component;
|
||||
selected_module = comm->c_coll_basic_module;
|
||||
selected_data = comm->c_coll_basic_data;
|
||||
}
|
||||
#else
|
||||
/* JMS CONTINUE HERE */
|
||||
#endif
|
||||
|
||||
/* Everything left in the selectable list is therefore unwanted,
|
||||
and we call their unquery() method (because they all had query()
|
||||
invoked, but will never have init() invoked in this scope). */
|
||||
|
||||
if (NULL != selectable) {
|
||||
for (item = opal_list_remove_first(selectable); item != NULL;
|
||||
item = opal_list_remove_first(selectable)) {
|
||||
avail = (avail_coll_t *) item;
|
||||
component = avail->ac_component;
|
||||
unquery(component, comm, avail->ac_data);
|
||||
OBJ_RELEASE(avail);
|
||||
}
|
||||
OBJ_RELEASE(selectable);
|
||||
/* release the original module reference */
|
||||
OBJ_RELEASE(avail->ac_module);
|
||||
}
|
||||
|
||||
/* If we're not using the basic module, then set it up, replace all
|
||||
NULL function pointers with those from basic, and then initialize
|
||||
it. */
|
||||
|
||||
comm->c_coll_selected_component = selected_component;
|
||||
comm->c_coll_selected_module = selected_module;
|
||||
comm->c_coll_selected_data = selected_data;
|
||||
if (!using_basic) {
|
||||
comm->c_coll = *selected_module;
|
||||
replace_null_with_basic(comm);
|
||||
|
||||
/* Finally -- intialize the selected module. If it's the basic
|
||||
module, we've initialized it already. */
|
||||
|
||||
err = module_init(selected_module, comm);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Now double check because we may have gotten a different module
|
||||
back from the init function; ensure that there are no NULL's in
|
||||
there */
|
||||
|
||||
replace_null_with_basic(comm);
|
||||
/* check to make sure no NULLs */
|
||||
if ((NULL == comm->c_coll.coll_allgather) ||
|
||||
(NULL == comm->c_coll.coll_allgatherv) ||
|
||||
(NULL == comm->c_coll.coll_allreduce) ||
|
||||
(NULL == comm->c_coll.coll_alltoall) ||
|
||||
(NULL == comm->c_coll.coll_alltoallv) ||
|
||||
(NULL == comm->c_coll.coll_alltoallw) ||
|
||||
(NULL == comm->c_coll.coll_barrier) ||
|
||||
(NULL == comm->c_coll.coll_bcast) ||
|
||||
((OMPI_COMM_IS_INTRA(comm)) && (NULL == comm->c_coll.coll_exscan)) ||
|
||||
(NULL == comm->c_coll.coll_gather) ||
|
||||
(NULL == comm->c_coll.coll_gatherv) ||
|
||||
(NULL == comm->c_coll.coll_reduce) ||
|
||||
(NULL == comm->c_coll.coll_reduce_scatter) ||
|
||||
((OMPI_COMM_IS_INTRA(comm)) && (NULL == comm->c_coll.coll_scan)) ||
|
||||
(NULL == comm->c_coll.coll_scatter) ||
|
||||
(NULL == comm->c_coll.coll_scatterv)) {
|
||||
mca_coll_base_comm_unselect(comm);
|
||||
return OMPI_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* Announce the winner */
|
||||
|
||||
opal_output_verbose(10, mca_coll_base_output,
|
||||
"coll:base:comm_select: Selected coll module %s",
|
||||
selected_component->collm_version.mca_component_name);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -339,11 +225,10 @@ static opal_list_t *check_components(opal_list_t *components,
|
||||
int i, priority;
|
||||
const mca_base_component_t *component;
|
||||
opal_list_item_t *item, *item2;
|
||||
const mca_coll_base_module_1_0_0_t *module;
|
||||
mca_coll_base_module_1_1_0_t *module;
|
||||
bool want_to_check;
|
||||
opal_list_t *selectable;
|
||||
avail_coll_t *avail, *avail2;
|
||||
struct mca_coll_base_comm_t *data;
|
||||
|
||||
/* Make a list of the components that query successfully */
|
||||
|
||||
@ -376,7 +261,7 @@ static opal_list_t *check_components(opal_list_t *components,
|
||||
so */
|
||||
|
||||
if (want_to_check) {
|
||||
priority = check_one_component(comm, component, &module, &data);
|
||||
priority = check_one_component(comm, component, &module);
|
||||
if (priority >= 0) {
|
||||
|
||||
/* We have a component that indicated that it wants to run by
|
||||
@ -384,11 +269,9 @@ static opal_list_t *check_components(opal_list_t *components,
|
||||
|
||||
avail = OBJ_NEW(avail_coll_t);
|
||||
avail->ac_priority = priority;
|
||||
avail->ac_component = (mca_coll_base_component_1_0_0_t *) component;
|
||||
avail->ac_module = module;
|
||||
avail->ac_data = data;
|
||||
|
||||
/* Put this item on the list in priority order (highest
|
||||
/* Put this item on the list in priority order (lowest
|
||||
priority first). Should it go first? */
|
||||
|
||||
if (opal_list_is_empty(selectable)) {
|
||||
@ -396,13 +279,13 @@ static opal_list_t *check_components(opal_list_t *components,
|
||||
} else {
|
||||
item2 = opal_list_get_first(selectable);
|
||||
avail2 = (avail_coll_t *) item2;
|
||||
if (avail->ac_priority > avail2->ac_priority) {
|
||||
if (avail->ac_priority < avail2->ac_priority) {
|
||||
opal_list_prepend(selectable, (opal_list_item_t *) avail);
|
||||
} else {
|
||||
for (i = 1; item2 != opal_list_get_end(selectable);
|
||||
item2 = opal_list_get_next(item2), ++i) {
|
||||
avail2 = (avail_coll_t *) item2;
|
||||
if (avail->ac_priority > avail2->ac_priority) {
|
||||
if (avail->ac_priority < avail2->ac_priority) {
|
||||
opal_list_insert(selectable,
|
||||
(opal_list_item_t *) avail, i);
|
||||
break;
|
||||
@ -440,13 +323,12 @@ static opal_list_t *check_components(opal_list_t *components,
|
||||
*/
|
||||
static int check_one_component(ompi_communicator_t *comm,
|
||||
const mca_base_component_t *component,
|
||||
const mca_coll_base_module_1_0_0_t **module,
|
||||
struct mca_coll_base_comm_t **data)
|
||||
mca_coll_base_module_1_1_0_t **module)
|
||||
{
|
||||
int err;
|
||||
int priority = -1;
|
||||
|
||||
err = query(component, comm, &priority, module, data);
|
||||
err = query(component, comm, &priority, module);
|
||||
|
||||
if (OMPI_SUCCESS == err) {
|
||||
priority = (priority < 100) ? priority : 100;
|
||||
@ -475,8 +357,7 @@ static int check_one_component(ompi_communicator_t *comm,
|
||||
*/
|
||||
static int query(const mca_base_component_t *component,
|
||||
ompi_communicator_t *comm,
|
||||
int *priority, const mca_coll_base_module_1_0_0_t **module,
|
||||
struct mca_coll_base_comm_t **data)
|
||||
int *priority, mca_coll_base_module_1_1_0_t **module)
|
||||
{
|
||||
/* coll v1.0.0 */
|
||||
|
||||
@ -484,10 +365,10 @@ static int query(const mca_base_component_t *component,
|
||||
if (1 == component->mca_major_version &&
|
||||
0 == component->mca_minor_version &&
|
||||
0 == component->mca_release_version) {
|
||||
const mca_coll_base_component_1_0_0_t *coll100 =
|
||||
(mca_coll_base_component_1_0_0_t *) component;
|
||||
const mca_coll_base_component_1_1_0_t *coll100 =
|
||||
(mca_coll_base_component_1_1_0_t *) component;
|
||||
|
||||
return query_1_0_0(coll100, comm, priority, module, data);
|
||||
return query_1_1_0(coll100, comm, priority, module);
|
||||
}
|
||||
|
||||
/* Unknown coll API version -- return error */
|
||||
@ -496,16 +377,15 @@ static int query(const mca_base_component_t *component,
|
||||
}
|
||||
|
||||
|
||||
static int query_1_0_0(const mca_coll_base_component_1_0_0_t *component,
|
||||
static int query_1_1_0(const mca_coll_base_component_1_1_0_t *component,
|
||||
ompi_communicator_t *comm, int *priority,
|
||||
const mca_coll_base_module_1_0_0_t **module,
|
||||
struct mca_coll_base_comm_t **data)
|
||||
mca_coll_base_module_1_1_0_t **module)
|
||||
{
|
||||
const mca_coll_base_module_1_0_0_t *ret;
|
||||
mca_coll_base_module_1_1_0_t *ret;
|
||||
|
||||
/* There's currently no need for conversion */
|
||||
|
||||
ret = component->collm_comm_query(comm, priority, data);
|
||||
ret = component->collm_comm_query(comm, priority);
|
||||
if (NULL != ret) {
|
||||
*module = ret;
|
||||
return OMPI_SUCCESS;
|
||||
@ -513,128 +393,3 @@ static int query_1_0_0(const mca_coll_base_component_1_0_0_t *component,
|
||||
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Unquery functions
|
||||
**************************************************************************/
|
||||
|
||||
static void unquery(const mca_coll_base_component_1_0_0_t *component,
|
||||
ompi_communicator_t *comm,
|
||||
struct mca_coll_base_comm_t *data)
|
||||
{
|
||||
if (1 == component->collm_version.mca_major_version &&
|
||||
0 == component->collm_version.mca_minor_version &&
|
||||
0 == component->collm_version.mca_release_version) {
|
||||
const mca_coll_base_component_1_0_0_t *coll100 =
|
||||
(mca_coll_base_component_1_0_0_t *) component;
|
||||
|
||||
unquery_1_0_0(coll100, comm, data);
|
||||
}
|
||||
|
||||
/* There's no way to have a version that we don't recognize here --
|
||||
it would have already been removed from the list */
|
||||
}
|
||||
|
||||
|
||||
static void unquery_1_0_0(const mca_coll_base_component_1_0_0_t *component,
|
||||
ompi_communicator_t *comm,
|
||||
struct mca_coll_base_comm_t *data)
|
||||
{
|
||||
if (NULL != component->collm_comm_unquery) {
|
||||
component->collm_comm_unquery(comm, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Module_Init functions
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Initialize a module
|
||||
*/
|
||||
static int module_init(const mca_coll_base_module_1_0_0_t *module,
|
||||
ompi_communicator_t *comm)
|
||||
{
|
||||
const mca_coll_base_module_1_0_0_t *ret;
|
||||
|
||||
/* There's currently no need for conversion */
|
||||
|
||||
ret = module->coll_module_init(comm);
|
||||
if (NULL != ret) {
|
||||
if (comm->c_coll_selected_module != ret) {
|
||||
comm->c_coll = *ret;
|
||||
comm->c_coll_selected_module = ret;
|
||||
}
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Misc functions
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* If the basic module has not already been setup on this
|
||||
* communicator, query and initialize it.
|
||||
*/
|
||||
static int query_basic(ompi_communicator_t *comm)
|
||||
{
|
||||
int ret;
|
||||
struct mca_coll_base_comm_t *data;
|
||||
|
||||
ret = OMPI_SUCCESS;
|
||||
if (NULL == comm->c_coll_basic_module) {
|
||||
ret = query((mca_base_component_t *) mca_coll_base_basic_component, comm,
|
||||
&basic_priority, &comm->c_coll_basic_module, &data);
|
||||
if (ret != OMPI_SUCCESS) {
|
||||
comm->c_coll_basic_module = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
comm->c_coll_basic_data = data;
|
||||
ret = module_init(comm->c_coll_basic_module, comm);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Replace the NULL pointers by corresponsing ompi_basic pointers
|
||||
*/
|
||||
static int replace_null_with_basic(ompi_communicator_t *comm)
|
||||
{
|
||||
int err;
|
||||
|
||||
#define CHECK(name) \
|
||||
if (NULL == comm->c_coll.coll_##name) { \
|
||||
if (OMPI_SUCCESS != (err = query_basic(comm))) { \
|
||||
return err; \
|
||||
} \
|
||||
comm->c_coll.coll_##name = comm->c_coll_basic_module->coll_##name; \
|
||||
}
|
||||
|
||||
CHECK(allgather);
|
||||
CHECK(allgatherv);
|
||||
CHECK(allreduce);
|
||||
CHECK(alltoall);
|
||||
CHECK(alltoallv);
|
||||
CHECK(alltoallw);
|
||||
CHECK(barrier);
|
||||
CHECK(bcast);
|
||||
CHECK(exscan);
|
||||
CHECK(gather);
|
||||
CHECK(gatherv);
|
||||
CHECK(reduce);
|
||||
CHECK(reduce_scatter);
|
||||
CHECK(scan);
|
||||
CHECK(scatter);
|
||||
CHECK(scatterv);
|
||||
|
||||
/* Happiness; all done */
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
@ -30,57 +30,35 @@
|
||||
#include "ompi/mca/coll/coll.h"
|
||||
#include "ompi/mca/coll/base/base.h"
|
||||
|
||||
extern opal_list_t mca_coll_base_available;
|
||||
#define CLOSE(comm, func) \
|
||||
do { \
|
||||
if (NULL != comm->c_coll.coll_ ## func ## _module) { \
|
||||
OBJ_RELEASE(comm->c_coll.coll_ ## func ## _module); \
|
||||
comm->c_coll.coll_## func = NULL; \
|
||||
comm->c_coll.coll_## func ## _module = NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
/*
|
||||
* This function is called to shut down a collective module on a
|
||||
* specific communicator. If we used some of the basic module
|
||||
* functions in here to fill in NULL pointers, we also need to shut
|
||||
* down the basic module.
|
||||
*/
|
||||
int mca_coll_base_comm_unselect(ompi_communicator_t *comm)
|
||||
{
|
||||
int err;
|
||||
CLOSE(comm, allgather);
|
||||
CLOSE(comm, allgatherv);
|
||||
CLOSE(comm, allreduce);
|
||||
CLOSE(comm, alltoall);
|
||||
CLOSE(comm, alltoallv);
|
||||
CLOSE(comm, alltoallw);
|
||||
CLOSE(comm, barrier);
|
||||
CLOSE(comm, bcast);
|
||||
CLOSE(comm, exscan);
|
||||
CLOSE(comm, gather);
|
||||
CLOSE(comm, gatherv);
|
||||
CLOSE(comm, reduce);
|
||||
CLOSE(comm, reduce_scatter);
|
||||
CLOSE(comm, scan);
|
||||
CLOSE(comm, scatter);
|
||||
CLOSE(comm, scatterv);
|
||||
|
||||
/* Shut down the selected module. Note that this pointer can be
|
||||
NULL if only the basic module was selected. */
|
||||
|
||||
if (NULL != comm->c_coll_selected_module &&
|
||||
comm->c_coll_basic_module != comm->c_coll_selected_module &&
|
||||
NULL != comm->c_coll_selected_module->coll_module_finalize) {
|
||||
err = comm->c_coll_selected_module->coll_module_finalize(comm);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
opal_show_help("help-mca-coll-base",
|
||||
"comm-unselect:failed-finalize", true);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the basic module was used at all (even if it was just to fill
|
||||
in NULL pointers for functions that the selected module did not
|
||||
provide), it may have hung stuff on c_coll_comm_basic, and
|
||||
therefore needs to be finalized in this scope. */
|
||||
|
||||
if (NULL != comm->c_coll_basic_module &&
|
||||
NULL != comm->c_coll_basic_module->coll_module_finalize) {
|
||||
err = comm->c_coll_basic_module->coll_module_finalize(comm);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
opal_show_help("help-mca-coll-base",
|
||||
"comm-unselect:basic-failed-finalize", true);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
/* Zero them all out, since they act as sentinel values */
|
||||
|
||||
comm->c_coll_selected_data = NULL;
|
||||
comm->c_coll_selected_module = NULL;
|
||||
comm->c_coll_basic_data = NULL;
|
||||
comm->c_coll_basic_module = NULL;
|
||||
|
||||
/* All done */
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
/* All done */
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
*/
|
||||
bool mca_coll_base_components_available_valid = false;
|
||||
opal_list_t mca_coll_base_components_available;
|
||||
const mca_coll_base_component_1_0_0_t *mca_coll_base_basic_component = NULL;
|
||||
|
||||
|
||||
/*
|
||||
@ -49,7 +48,7 @@ static int init_query(const mca_base_component_t *ls,
|
||||
mca_base_component_priority_list_item_t *entry,
|
||||
bool enable_progress_threads,
|
||||
bool enable_mpi_threads);
|
||||
static int init_query_1_0_0(const mca_base_component_t *ls,
|
||||
static int init_query_1_1_0(const mca_base_component_t *ls,
|
||||
mca_base_component_priority_list_item_t *entry,
|
||||
bool enable_progress_threads,
|
||||
bool enable_mpi_threads);
|
||||
@ -98,32 +97,9 @@ int mca_coll_base_find_available(bool enable_progress_threads,
|
||||
if (OMPI_SUCCESS == init_query(component, entry,
|
||||
enable_progress_threads,
|
||||
enable_mpi_threads)) {
|
||||
|
||||
/* Is this the basic component? If so, save it, because it's
|
||||
special. Keep it off the available list -- we'll use it
|
||||
specially in the selection process. */
|
||||
|
||||
if (0 == strcmp(component->mca_component_name, "basic")) {
|
||||
mca_coll_base_basic_component =
|
||||
(mca_coll_base_component_1_0_0_t *) component;
|
||||
OBJ_RELEASE(entry);
|
||||
}
|
||||
|
||||
/* Otherwise, save the results in the list. The priority isn't
|
||||
relevant, because selection is decided at
|
||||
communicator-constructor time. But we save the thread
|
||||
arguments (set in the init_query() function) so that the
|
||||
initial selection algorithm can negotiate the overall thread
|
||||
level for this process. */
|
||||
|
||||
else {
|
||||
opal_list_append(&mca_coll_base_components_available,
|
||||
(opal_list_item_t *) entry);
|
||||
}
|
||||
|
||||
/* Either way, we found something :-) */
|
||||
|
||||
found = true;
|
||||
found = true;
|
||||
} else {
|
||||
|
||||
/* If the component doesn't want to run, then close it. It's
|
||||
@ -185,7 +161,7 @@ static int init_query(const mca_base_component_t *m,
|
||||
if (1 == m->mca_type_major_version &&
|
||||
0 == m->mca_type_minor_version &&
|
||||
0 == m->mca_type_release_version) {
|
||||
ret = init_query_1_0_0(m, entry, enable_progress_threads,
|
||||
ret = init_query_1_1_0(m, entry, enable_progress_threads,
|
||||
enable_mpi_threads);
|
||||
} else {
|
||||
/* Unrecognized coll API version */
|
||||
@ -222,13 +198,13 @@ static int init_query(const mca_base_component_t *m,
|
||||
/*
|
||||
* Query a specific component, coll v1.0.0
|
||||
*/
|
||||
static int init_query_1_0_0(const mca_base_component_t *component,
|
||||
static int init_query_1_1_0(const mca_base_component_t *component,
|
||||
mca_base_component_priority_list_item_t *entry,
|
||||
bool enable_progress_threads,
|
||||
bool enable_mpi_threads)
|
||||
{
|
||||
mca_coll_base_component_1_0_0_t *coll =
|
||||
(mca_coll_base_component_1_0_0_t *) component;
|
||||
mca_coll_base_component_1_1_0_t *coll =
|
||||
(mca_coll_base_component_1_1_0_t *) component;
|
||||
|
||||
return coll->collm_init_query(enable_progress_threads,
|
||||
enable_mpi_threads);
|
||||
|
@ -51,6 +51,7 @@ int mca_coll_base_associative = 1;
|
||||
bool mca_coll_base_components_opened_valid = false;
|
||||
opal_list_t mca_coll_base_components_opened;
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_coll_base_module_1_1_0_t, opal_object_t, NULL, NULL);
|
||||
|
||||
/*
|
||||
* Function for finding and opening either all MCA components, or the one
|
||||
|
@ -28,13 +28,11 @@
|
||||
#include "ompi/mca/pml/pml.h"
|
||||
#include "ompi/communicator/communicator.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/* Globally exported variables */
|
||||
|
||||
OMPI_MODULE_DECLSPEC extern const mca_coll_base_component_1_0_0_t
|
||||
OMPI_MODULE_DECLSPEC extern const mca_coll_base_component_1_1_0_t
|
||||
mca_coll_basic_component;
|
||||
extern int mca_coll_basic_priority;
|
||||
extern int mca_coll_basic_crossover;
|
||||
@ -43,58 +41,64 @@ extern "C" {
|
||||
|
||||
int mca_coll_basic_init_query(bool enable_progress_threads,
|
||||
bool enable_mpi_threads);
|
||||
const struct mca_coll_base_module_1_0_0_t
|
||||
struct mca_coll_base_module_1_1_0_t
|
||||
*mca_coll_basic_comm_query(struct ompi_communicator_t *comm,
|
||||
int *priority,
|
||||
struct mca_coll_base_comm_t **data);
|
||||
int *priority);
|
||||
|
||||
const struct mca_coll_base_module_1_0_0_t
|
||||
*mca_coll_basic_module_init(struct ompi_communicator_t *comm);
|
||||
int mca_coll_basic_module_finalize(struct ompi_communicator_t *comm);
|
||||
int mca_coll_basic_module_enable(struct mca_coll_base_module_1_1_0_t *module,
|
||||
struct ompi_communicator_t *comm);
|
||||
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_allreduce_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_allreduce_inter(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_alltoallv_intra(void *sbuf, int *scounts,
|
||||
int *sdisps,
|
||||
@ -102,14 +106,16 @@ extern "C" {
|
||||
void *rbuf, int *rcounts,
|
||||
int *rdisps,
|
||||
struct ompi_datatype_t *rdtype,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_alltoallw_intra(void *sbuf, int *scounts,
|
||||
int *sdisps,
|
||||
@ -117,142 +123,172 @@ extern "C" {
|
||||
void *rbuf, int *rcounts,
|
||||
int *rdisps,
|
||||
struct ompi_datatype_t **rdtypes,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_barrier_intra_lin(struct ompi_communicator_t *comm);
|
||||
int mca_coll_basic_barrier_inter_lin(struct ompi_communicator_t *comm);
|
||||
int mca_coll_basic_barrier_intra_lin(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_barrier_intra_log(struct ompi_communicator_t *comm);
|
||||
int mca_coll_basic_barrier_inter_lin(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_barrier_intra_log(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_bcast_lin_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_bcast_lin_inter(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_bcast_log_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_bcast_log_inter(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_exscan_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_exscan_inter(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_reduce_lin_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_reduce_lin_inter(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_reduce_log_inter(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_reduce_scatter_intra(void *sbuf, void *rbuf,
|
||||
int *rcounts,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t
|
||||
*comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_reduce_scatter_inter(void *sbuf, void *rbuf,
|
||||
int *rcounts,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t
|
||||
*comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_scan_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_scan_inter(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_basic_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_basic_ft_event(int status);
|
||||
|
||||
@ -268,16 +304,15 @@ extern "C" {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Data structure for hanging data off the communicator
|
||||
*/
|
||||
struct mca_coll_base_comm_t
|
||||
{
|
||||
ompi_request_t **mccb_reqs;
|
||||
int mccb_num_reqs;
|
||||
};
|
||||
struct mca_coll_basic_module_t {
|
||||
mca_coll_base_module_1_1_0_t super;
|
||||
|
||||
ompi_request_t **mccb_reqs;
|
||||
int mccb_num_reqs;
|
||||
};
|
||||
typedef struct mca_coll_basic_module_t mca_coll_basic_module_t;
|
||||
OBJ_CLASS_DECLARATION(mca_coll_basic_module_t);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif /* MCA_COLL_BASIC_EXPORT_H */
|
||||
|
@ -41,7 +41,8 @@ int
|
||||
mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int err;
|
||||
ptrdiff_t lb, extent;
|
||||
@ -61,10 +62,10 @@ mca_coll_basic_allgather_intra(void *sbuf, int scount,
|
||||
/* Gather and broadcast. */
|
||||
|
||||
err = comm->c_coll.coll_gather(sbuf, scount, sdtype, rbuf, rcount,
|
||||
rdtype, 0, comm);
|
||||
rdtype, 0, comm, module);
|
||||
if (MPI_SUCCESS == err) {
|
||||
err = comm->c_coll.coll_bcast(rbuf, rcount * ompi_comm_size(comm),
|
||||
rdtype, 0, comm);
|
||||
rdtype, 0, comm, module);
|
||||
}
|
||||
|
||||
/* All done */
|
||||
@ -85,13 +86,15 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int rank, root = 0, size, rsize, err, i;
|
||||
char *tmpbuf = NULL, *ptmp;
|
||||
ptrdiff_t rlb, slb, rextent, sextent, incr;
|
||||
ompi_request_t *req;
|
||||
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
ompi_request_t **reqs = basic_module->mccb_reqs;
|
||||
|
||||
rank = ompi_comm_rank(comm);
|
||||
size = ompi_comm_size(comm);
|
||||
|
@ -39,7 +39,8 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, size, rank ;
|
||||
int err;
|
||||
@ -70,7 +71,7 @@ mca_coll_basic_allgatherv_intra(void *sbuf, int scount,
|
||||
err = comm->c_coll.coll_gatherv(send_buf,
|
||||
rcounts[rank], send_type,rbuf,
|
||||
rcounts, disps, rdtype, 0,
|
||||
comm);
|
||||
comm, module);
|
||||
|
||||
if (MPI_SUCCESS != err) {
|
||||
return err;
|
||||
@ -98,7 +99,7 @@ mca_coll_basic_allgatherv_intra(void *sbuf, int scount,
|
||||
return err;
|
||||
}
|
||||
|
||||
comm->c_coll.coll_bcast( rbuf, 1 ,newtype,0,comm);
|
||||
comm->c_coll.coll_bcast( rbuf, 1 ,newtype,0,comm, module);
|
||||
|
||||
ompi_ddt_destroy (&newtype);
|
||||
|
||||
@ -118,7 +119,8 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int size, rsize;
|
||||
int err, i;
|
||||
@ -139,7 +141,7 @@ mca_coll_basic_allgatherv_inter(void *sbuf, int scount,
|
||||
}
|
||||
|
||||
err = comm->c_coll.coll_alltoallv(sbuf, scounts, sdisps, sdtype,
|
||||
rbuf, rcounts, disps, rdtype, comm);
|
||||
rbuf, rcounts, disps, rdtype, comm, module);
|
||||
|
||||
if (NULL != sdisps) {
|
||||
free(sdisps);
|
||||
|
@ -40,7 +40,8 @@ int
|
||||
mca_coll_basic_allreduce_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int err;
|
||||
|
||||
@ -48,18 +49,18 @@ mca_coll_basic_allreduce_intra(void *sbuf, void *rbuf, int count,
|
||||
|
||||
if (MPI_IN_PLACE == sbuf) {
|
||||
if (0 == ompi_comm_rank(comm)) {
|
||||
err = comm->c_coll.coll_reduce(MPI_IN_PLACE, rbuf, count, dtype, op, 0, comm);
|
||||
err = comm->c_coll.coll_reduce(MPI_IN_PLACE, rbuf, count, dtype, op, 0, comm, module);
|
||||
} else {
|
||||
err = comm->c_coll.coll_reduce(rbuf, NULL, count, dtype, op, 0, comm);
|
||||
err = comm->c_coll.coll_reduce(rbuf, NULL, count, dtype, op, 0, comm, module);
|
||||
}
|
||||
} else {
|
||||
err = comm->c_coll.coll_reduce(sbuf, rbuf, count, dtype, op, 0, comm);
|
||||
err = comm->c_coll.coll_reduce(sbuf, rbuf, count, dtype, op, 0, comm, module);
|
||||
}
|
||||
if (MPI_SUCCESS != err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
return comm->c_coll.coll_bcast(rbuf, count, dtype, 0, comm);
|
||||
return comm->c_coll.coll_bcast(rbuf, count, dtype, 0, comm, module);
|
||||
}
|
||||
|
||||
|
||||
@ -74,13 +75,15 @@ int
|
||||
mca_coll_basic_allreduce_inter(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int err, i, rank, root = 0, rsize;
|
||||
ptrdiff_t lb, extent;
|
||||
char *tmpbuf = NULL, *pml_buffer = NULL;
|
||||
ompi_request_t *req[2];
|
||||
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
ompi_request_t **reqs = basic_module->mccb_reqs;
|
||||
|
||||
rank = ompi_comm_rank(comm);
|
||||
rsize = ompi_comm_remote_size(comm);
|
||||
|
@ -39,7 +39,8 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int rank;
|
||||
@ -55,6 +56,7 @@ mca_coll_basic_alltoall_intra(void *sbuf, int scount,
|
||||
ompi_request_t **req;
|
||||
ompi_request_t **sreq;
|
||||
ompi_request_t **rreq;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
|
||||
/* Initialize. */
|
||||
|
||||
@ -91,7 +93,7 @@ mca_coll_basic_alltoall_intra(void *sbuf, int scount,
|
||||
|
||||
/* Initiate all send/recv to/from others. */
|
||||
|
||||
req = rreq = comm->c_coll_basic_data->mccb_reqs;
|
||||
req = rreq = basic_module->mccb_reqs;
|
||||
sreq = rreq + size - 1;
|
||||
|
||||
prcv = (char *) rbuf;
|
||||
@ -160,7 +162,8 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int rank;
|
||||
@ -177,6 +180,8 @@ mca_coll_basic_alltoall_inter(void *sbuf, int scount,
|
||||
ompi_request_t **sreq;
|
||||
ompi_request_t **rreq;
|
||||
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
|
||||
/* Initialize. */
|
||||
|
||||
size = ompi_comm_remote_size(comm);
|
||||
@ -196,7 +201,7 @@ mca_coll_basic_alltoall_inter(void *sbuf, int scount,
|
||||
|
||||
/* Initiate all send/recv to/from others. */
|
||||
nreqs = size * 2;
|
||||
req = rreq = comm->c_coll_basic_data->mccb_reqs;
|
||||
req = rreq = basic_module->mccb_reqs;
|
||||
sreq = rreq + size;
|
||||
|
||||
prcv = (char *) rbuf;
|
||||
|
@ -39,7 +39,8 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int size;
|
||||
@ -52,6 +53,8 @@ mca_coll_basic_alltoallv_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
MPI_Aint rcvextent;
|
||||
MPI_Request *preq;
|
||||
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
|
||||
/* Initialize. */
|
||||
|
||||
size = ompi_comm_size(comm);
|
||||
@ -82,7 +85,7 @@ mca_coll_basic_alltoallv_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
/* Initiate all send/recv to/from others. */
|
||||
|
||||
nreqs = 0;
|
||||
preq = comm->c_coll_basic_data->mccb_reqs;
|
||||
preq = basic_module->mccb_reqs;
|
||||
|
||||
/* Post all receives first -- a simple optimization */
|
||||
|
||||
@ -97,8 +100,7 @@ mca_coll_basic_alltoallv_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
preq++));
|
||||
++nreqs;
|
||||
if (MPI_SUCCESS != err) {
|
||||
mca_coll_basic_free_reqs(comm->c_coll_basic_data->mccb_reqs,
|
||||
nreqs);
|
||||
mca_coll_basic_free_reqs(basic_module->mccb_reqs, nreqs);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
@ -117,15 +119,14 @@ mca_coll_basic_alltoallv_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
preq++));
|
||||
++nreqs;
|
||||
if (MPI_SUCCESS != err) {
|
||||
mca_coll_basic_free_reqs(comm->c_coll_basic_data->mccb_reqs,
|
||||
nreqs);
|
||||
mca_coll_basic_free_reqs(basic_module->mccb_reqs, nreqs);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
/* Start your engines. This will never return an error. */
|
||||
|
||||
MCA_PML_CALL(start(nreqs, comm->c_coll_basic_data->mccb_reqs));
|
||||
MCA_PML_CALL(start(nreqs, basic_module->mccb_reqs));
|
||||
|
||||
/* Wait for them all. If there's an error, note that we don't care
|
||||
* what the error was -- just that there *was* an error. The PML
|
||||
@ -134,12 +135,12 @@ mca_coll_basic_alltoallv_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
* So free them anyway -- even if there was an error, and return the
|
||||
* error after we free everything. */
|
||||
|
||||
err = ompi_request_wait_all(nreqs, comm->c_coll_basic_data->mccb_reqs,
|
||||
err = ompi_request_wait_all(nreqs, basic_module->mccb_reqs,
|
||||
MPI_STATUSES_IGNORE);
|
||||
|
||||
/* Free the requests. */
|
||||
|
||||
mca_coll_basic_free_reqs(comm->c_coll_basic_data->mccb_reqs, nreqs);
|
||||
mca_coll_basic_free_reqs(basic_module->mccb_reqs, nreqs);
|
||||
|
||||
/* All done */
|
||||
|
||||
@ -159,7 +160,8 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int rsize;
|
||||
@ -170,8 +172,9 @@ mca_coll_basic_alltoallv_inter(void *sbuf, int *scounts, int *sdisps,
|
||||
size_t nreqs;
|
||||
MPI_Aint sndextent;
|
||||
MPI_Aint rcvextent;
|
||||
ompi_request_t **preq = comm->c_coll_basic_data->mccb_reqs;
|
||||
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
ompi_request_t **preq = basic_module->mccb_reqs;
|
||||
|
||||
/* Initialize. */
|
||||
|
||||
|
@ -38,7 +38,8 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int size;
|
||||
@ -48,6 +49,7 @@ mca_coll_basic_alltoallw_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
char *prcv;
|
||||
int nreqs;
|
||||
MPI_Request *preq;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
|
||||
/* Initialize. */
|
||||
|
||||
@ -76,7 +78,7 @@ mca_coll_basic_alltoallw_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
/* Initiate all send/recv to/from others. */
|
||||
|
||||
nreqs = 0;
|
||||
preq = comm->c_coll_basic_data->mccb_reqs;
|
||||
preq = basic_module->mccb_reqs;
|
||||
|
||||
/* Post all receives first -- a simple optimization */
|
||||
|
||||
@ -90,7 +92,7 @@ mca_coll_basic_alltoallw_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
preq++));
|
||||
++nreqs;
|
||||
if (MPI_SUCCESS != err) {
|
||||
mca_coll_basic_free_reqs(comm->c_coll_basic_data->mccb_reqs,
|
||||
mca_coll_basic_free_reqs(basic_module->mccb_reqs,
|
||||
nreqs);
|
||||
return err;
|
||||
}
|
||||
@ -109,7 +111,7 @@ mca_coll_basic_alltoallw_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
preq++));
|
||||
++nreqs;
|
||||
if (MPI_SUCCESS != err) {
|
||||
mca_coll_basic_free_reqs(comm->c_coll_basic_data->mccb_reqs,
|
||||
mca_coll_basic_free_reqs(basic_module->mccb_reqs,
|
||||
nreqs);
|
||||
return err;
|
||||
}
|
||||
@ -117,7 +119,7 @@ mca_coll_basic_alltoallw_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
|
||||
/* Start your engines. This will never return an error. */
|
||||
|
||||
MCA_PML_CALL(start(nreqs, comm->c_coll_basic_data->mccb_reqs));
|
||||
MCA_PML_CALL(start(nreqs, basic_module->mccb_reqs));
|
||||
|
||||
/* Wait for them all. If there's an error, note that we don't care
|
||||
* what the error was -- just that there *was* an error. The PML
|
||||
@ -126,12 +128,12 @@ mca_coll_basic_alltoallw_intra(void *sbuf, int *scounts, int *sdisps,
|
||||
* So free them anyway -- even if there was an error, and return the
|
||||
* error after we free everything. */
|
||||
|
||||
err = ompi_request_wait_all(nreqs, comm->c_coll_basic_data->mccb_reqs,
|
||||
err = ompi_request_wait_all(nreqs, basic_module->mccb_reqs,
|
||||
MPI_STATUSES_IGNORE);
|
||||
|
||||
/* Free the requests. */
|
||||
|
||||
mca_coll_basic_free_reqs(comm->c_coll_basic_data->mccb_reqs, nreqs);
|
||||
mca_coll_basic_free_reqs(basic_module->mccb_reqs, nreqs);
|
||||
|
||||
/* All done */
|
||||
|
||||
@ -151,7 +153,8 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int size;
|
||||
@ -161,6 +164,7 @@ mca_coll_basic_alltoallw_inter(void *sbuf, int *scounts, int *sdisps,
|
||||
char *prcv;
|
||||
int nreqs;
|
||||
MPI_Request *preq;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
|
||||
/* Initialize. */
|
||||
size = ompi_comm_remote_size(comm);
|
||||
@ -168,7 +172,7 @@ mca_coll_basic_alltoallw_inter(void *sbuf, int *scounts, int *sdisps,
|
||||
|
||||
/* Initiate all send/recv to/from others. */
|
||||
nreqs = size * 2;
|
||||
preq = comm->c_coll_basic_data->mccb_reqs;
|
||||
preq = basic_module->mccb_reqs;
|
||||
|
||||
/* Post all receives first -- a simple optimization */
|
||||
for (i = 0; i < size; ++i) {
|
||||
@ -177,7 +181,7 @@ mca_coll_basic_alltoallw_inter(void *sbuf, int *scounts, int *sdisps,
|
||||
i, MCA_COLL_BASE_TAG_ALLTOALLW,
|
||||
comm, preq++));
|
||||
if (OMPI_SUCCESS != err) {
|
||||
mca_coll_basic_free_reqs(comm->c_coll_basic_data->mccb_reqs,
|
||||
mca_coll_basic_free_reqs(basic_module->mccb_reqs,
|
||||
nreqs);
|
||||
return err;
|
||||
}
|
||||
@ -191,14 +195,14 @@ mca_coll_basic_alltoallw_inter(void *sbuf, int *scounts, int *sdisps,
|
||||
MCA_PML_BASE_SEND_STANDARD, comm,
|
||||
preq++));
|
||||
if (OMPI_SUCCESS != err) {
|
||||
mca_coll_basic_free_reqs(comm->c_coll_basic_data->mccb_reqs,
|
||||
mca_coll_basic_free_reqs(basic_module->mccb_reqs,
|
||||
nreqs);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
/* Start your engines. This will never return an error. */
|
||||
MCA_PML_CALL(start(nreqs, comm->c_coll_basic_data->mccb_reqs));
|
||||
MCA_PML_CALL(start(nreqs, basic_module->mccb_reqs));
|
||||
|
||||
/* Wait for them all. If there's an error, note that we don't care
|
||||
* what the error was -- just that there *was* an error. The PML
|
||||
@ -206,11 +210,11 @@ mca_coll_basic_alltoallw_inter(void *sbuf, int *scounts, int *sdisps,
|
||||
* i.e., by the end of this call, all the requests are free-able.
|
||||
* So free them anyway -- even if there was an error, and return the
|
||||
* error after we free everything. */
|
||||
err = ompi_request_wait_all(nreqs, comm->c_coll_basic_data->mccb_reqs,
|
||||
err = ompi_request_wait_all(nreqs, basic_module->mccb_reqs,
|
||||
MPI_STATUSES_IGNORE);
|
||||
|
||||
/* Free the requests. */
|
||||
mca_coll_basic_free_reqs(comm->c_coll_basic_data->mccb_reqs, nreqs);
|
||||
mca_coll_basic_free_reqs(basic_module->mccb_reqs, nreqs);
|
||||
|
||||
/* All done */
|
||||
return err;
|
||||
|
@ -36,7 +36,8 @@
|
||||
* Returns: - MPI_SUCCESS or error code
|
||||
*/
|
||||
int
|
||||
mca_coll_basic_barrier_intra_lin(struct ompi_communicator_t *comm)
|
||||
mca_coll_basic_barrier_intra_lin(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int err;
|
||||
@ -101,7 +102,8 @@ mca_coll_basic_barrier_intra_lin(struct ompi_communicator_t *comm)
|
||||
* Returns: - MPI_SUCCESS or error code
|
||||
*/
|
||||
int
|
||||
mca_coll_basic_barrier_intra_log(struct ompi_communicator_t *comm)
|
||||
mca_coll_basic_barrier_intra_log(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int err;
|
||||
@ -179,12 +181,13 @@ mca_coll_basic_barrier_intra_log(struct ompi_communicator_t *comm)
|
||||
* Returns: - MPI_SUCCESS or error code
|
||||
*/
|
||||
int
|
||||
mca_coll_basic_barrier_inter_lin(struct ompi_communicator_t *comm)
|
||||
mca_coll_basic_barrier_inter_lin(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int rank;
|
||||
int result;
|
||||
|
||||
rank = ompi_comm_rank(comm);
|
||||
return comm->c_coll.coll_allreduce(&rank, &result, 1, MPI_INT, MPI_MAX,
|
||||
comm);
|
||||
comm, module);
|
||||
}
|
||||
|
@ -39,14 +39,16 @@
|
||||
int
|
||||
mca_coll_basic_bcast_lin_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int size;
|
||||
int rank;
|
||||
int err;
|
||||
ompi_request_t **preq;
|
||||
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
ompi_request_t **reqs = basic_module->mccb_reqs;
|
||||
|
||||
size = ompi_comm_size(comm);
|
||||
rank = ompi_comm_rank(comm);
|
||||
@ -109,7 +111,8 @@ mca_coll_basic_bcast_lin_intra(void *buff, int count,
|
||||
int
|
||||
mca_coll_basic_bcast_log_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int size;
|
||||
@ -122,7 +125,8 @@ mca_coll_basic_bcast_log_intra(void *buff, int count,
|
||||
int err;
|
||||
int nreqs;
|
||||
ompi_request_t **preq;
|
||||
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
ompi_request_t **reqs = basic_module->mccb_reqs;
|
||||
|
||||
size = ompi_comm_size(comm);
|
||||
rank = ompi_comm_rank(comm);
|
||||
@ -205,13 +209,15 @@ mca_coll_basic_bcast_log_intra(void *buff, int count,
|
||||
int
|
||||
mca_coll_basic_bcast_lin_inter(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int rsize;
|
||||
int rank;
|
||||
int err;
|
||||
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
ompi_request_t **reqs = basic_module->mccb_reqs;
|
||||
|
||||
rsize = ompi_comm_remote_size(comm);
|
||||
rank = ompi_comm_rank(comm);
|
||||
@ -254,7 +260,8 @@ mca_coll_basic_bcast_lin_inter(void *buff, int count,
|
||||
int
|
||||
mca_coll_basic_bcast_log_inter(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ static int basic_open(void);
|
||||
* and pointers to our public functions in it
|
||||
*/
|
||||
|
||||
const mca_coll_base_component_1_0_0_t mca_coll_basic_component = {
|
||||
const mca_coll_base_component_1_1_0_t mca_coll_basic_component = {
|
||||
|
||||
/* First, the mca_component_t struct containing meta information
|
||||
* about the component itself */
|
||||
@ -60,7 +60,7 @@ const mca_coll_base_component_1_0_0_t mca_coll_basic_component = {
|
||||
/* 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_1_0,
|
||||
|
||||
/* Component name and version */
|
||||
|
||||
@ -85,8 +85,7 @@ const mca_coll_base_component_1_0_0_t mca_coll_basic_component = {
|
||||
/* Initialization / querying functions */
|
||||
|
||||
mca_coll_basic_init_query,
|
||||
mca_coll_basic_comm_query,
|
||||
NULL
|
||||
mca_coll_basic_comm_query
|
||||
};
|
||||
|
||||
|
||||
@ -108,3 +107,23 @@ basic_open(void)
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mca_coll_basic_module_construct(mca_coll_basic_module_t *module)
|
||||
{
|
||||
module->mccb_reqs = NULL;
|
||||
module->mccb_num_reqs = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
mca_coll_basic_module_destruct(mca_coll_basic_module_t *module)
|
||||
{
|
||||
if (NULL != module->mccb_reqs) free(module->mccb_reqs);
|
||||
}
|
||||
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_coll_basic_module_t,
|
||||
mca_coll_base_module_1_1_0_t,
|
||||
mca_coll_basic_module_construct,
|
||||
mca_coll_basic_module_destruct);
|
||||
|
@ -42,7 +42,8 @@ int
|
||||
mca_coll_basic_exscan_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int size, rank, err;
|
||||
ptrdiff_t true_lb, true_extent, lb, extent;
|
||||
@ -176,7 +177,8 @@ int
|
||||
mca_coll_basic_exscan_inter(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -39,7 +39,8 @@ mca_coll_basic_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int err;
|
||||
@ -101,7 +102,8 @@ mca_coll_basic_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i;
|
||||
int err;
|
||||
|
@ -38,7 +38,8 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, size, err;
|
||||
char *ptmp;
|
||||
@ -110,12 +111,14 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, size, err;
|
||||
char *ptmp;
|
||||
ptrdiff_t lb, extent;
|
||||
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
ompi_request_t **reqs = basic_module->mccb_reqs;
|
||||
|
||||
size = ompi_comm_remote_size(comm);
|
||||
rank = ompi_comm_rank(comm);
|
||||
|
@ -28,104 +28,6 @@
|
||||
#include "coll_basic.h"
|
||||
|
||||
|
||||
/*
|
||||
* Linear set of collective algorithms
|
||||
*/
|
||||
static const mca_coll_base_module_1_0_0_t intra_linear = {
|
||||
|
||||
/* Initialization / finalization functions */
|
||||
|
||||
mca_coll_basic_module_init,
|
||||
mca_coll_basic_module_finalize,
|
||||
|
||||
/* Collective function pointers */
|
||||
|
||||
mca_coll_basic_allgather_intra,
|
||||
mca_coll_basic_allgatherv_intra,
|
||||
mca_coll_basic_allreduce_intra,
|
||||
mca_coll_basic_alltoall_intra,
|
||||
mca_coll_basic_alltoallv_intra,
|
||||
mca_coll_basic_alltoallw_intra,
|
||||
mca_coll_basic_barrier_intra_lin,
|
||||
mca_coll_basic_bcast_lin_intra,
|
||||
mca_coll_basic_exscan_intra,
|
||||
mca_coll_basic_gather_intra,
|
||||
mca_coll_basic_gatherv_intra,
|
||||
mca_coll_basic_reduce_lin_intra,
|
||||
mca_coll_basic_reduce_scatter_intra,
|
||||
mca_coll_basic_scan_intra,
|
||||
mca_coll_basic_scatter_intra,
|
||||
mca_coll_basic_scatterv_intra,
|
||||
mca_coll_basic_ft_event
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Lograthmic set of collective algorithms. Note that not all
|
||||
* collectives have lograthmic algorithms. For example, scan will use
|
||||
* the same algorithm as in the linear set.
|
||||
*/
|
||||
static const mca_coll_base_module_1_0_0_t intra_log = {
|
||||
|
||||
/* Initialization / finalization functions */
|
||||
|
||||
mca_coll_basic_module_init,
|
||||
mca_coll_basic_module_finalize,
|
||||
|
||||
/* Collective function pointers */
|
||||
|
||||
mca_coll_basic_allgather_intra,
|
||||
mca_coll_basic_allgatherv_intra,
|
||||
mca_coll_basic_allreduce_intra,
|
||||
mca_coll_basic_alltoall_intra,
|
||||
mca_coll_basic_alltoallv_intra,
|
||||
mca_coll_basic_alltoallw_intra,
|
||||
mca_coll_basic_barrier_intra_log,
|
||||
mca_coll_basic_bcast_log_intra,
|
||||
mca_coll_basic_exscan_intra,
|
||||
mca_coll_basic_gather_intra,
|
||||
mca_coll_basic_gatherv_intra,
|
||||
mca_coll_basic_reduce_log_intra,
|
||||
mca_coll_basic_reduce_scatter_intra,
|
||||
mca_coll_basic_scan_intra,
|
||||
mca_coll_basic_scatter_intra,
|
||||
mca_coll_basic_scatterv_intra,
|
||||
mca_coll_basic_ft_event
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Linear set of collective algorithms for intercommunicators
|
||||
*/
|
||||
static const mca_coll_base_module_1_0_0_t inter_linear = {
|
||||
|
||||
/* Initialization / finalization functions */
|
||||
|
||||
mca_coll_basic_module_init,
|
||||
mca_coll_basic_module_finalize,
|
||||
|
||||
/* Collective function pointers */
|
||||
|
||||
mca_coll_basic_allgather_inter,
|
||||
mca_coll_basic_allgatherv_inter,
|
||||
mca_coll_basic_allreduce_inter,
|
||||
mca_coll_basic_alltoall_inter,
|
||||
mca_coll_basic_alltoallv_inter,
|
||||
mca_coll_basic_alltoallw_inter,
|
||||
mca_coll_basic_barrier_inter_lin,
|
||||
mca_coll_basic_bcast_lin_inter,
|
||||
NULL,
|
||||
mca_coll_basic_gather_inter,
|
||||
mca_coll_basic_gatherv_inter,
|
||||
mca_coll_basic_reduce_lin_inter,
|
||||
mca_coll_basic_reduce_scatter_inter,
|
||||
NULL,
|
||||
mca_coll_basic_scatter_inter,
|
||||
mca_coll_basic_scatterv_inter,
|
||||
mca_coll_basic_ft_event
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Initial query function that is invoked during MPI_INIT, allowing
|
||||
* this component to disqualify itself if it doesn't support the
|
||||
@ -146,37 +48,17 @@ mca_coll_basic_init_query(bool enable_progress_threads,
|
||||
* 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_basic_comm_query(struct ompi_communicator_t *comm, int *priority,
|
||||
struct mca_coll_base_comm_t **data)
|
||||
{
|
||||
*priority = mca_coll_basic_priority;
|
||||
|
||||
/* Choose whether to use [intra|inter], and [linear|log]-based
|
||||
* algorithms. */
|
||||
|
||||
if (OMPI_COMM_IS_INTER(comm)) {
|
||||
return &inter_linear;
|
||||
} else {
|
||||
if (ompi_comm_size(comm) <= mca_coll_basic_crossover) {
|
||||
return &intra_linear;
|
||||
} else {
|
||||
return &intra_log;
|
||||
}
|
||||
}
|
||||
|
||||
/* Never reach here */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Init module on the communicator
|
||||
*/
|
||||
const struct mca_coll_base_module_1_0_0_t *
|
||||
mca_coll_basic_module_init(struct ompi_communicator_t *comm)
|
||||
mca_coll_base_module_1_1_0_t *
|
||||
mca_coll_basic_comm_query(struct ompi_communicator_t *comm,
|
||||
int *priority)
|
||||
{
|
||||
int size;
|
||||
struct mca_coll_base_comm_t *data;
|
||||
mca_coll_basic_module_t *basic_module;
|
||||
|
||||
basic_module = OBJ_NEW(mca_coll_basic_module_t);
|
||||
if (NULL == basic_module) return NULL;
|
||||
|
||||
*priority = mca_coll_basic_priority;
|
||||
|
||||
/* Allocate the data that hangs off the communicator */
|
||||
|
||||
@ -185,48 +67,86 @@ mca_coll_basic_module_init(struct ompi_communicator_t *comm)
|
||||
} else {
|
||||
size = ompi_comm_size(comm);
|
||||
}
|
||||
data = (struct mca_coll_base_comm_t*)malloc(sizeof(struct mca_coll_base_comm_t) +
|
||||
(sizeof(ompi_request_t *) * size * 2));
|
||||
basic_module->mccb_num_reqs = size * 2;
|
||||
basic_module->mccb_reqs = (ompi_request_t**)
|
||||
malloc(sizeof(ompi_request_t *) * basic_module->mccb_num_reqs);
|
||||
|
||||
if (NULL == data) {
|
||||
return NULL;
|
||||
/* Choose whether to use [intra|inter], and [linear|log]-based
|
||||
* algorithms. */
|
||||
basic_module->super.coll_module_enable = mca_coll_basic_module_enable;
|
||||
basic_module->super.ft_event = mca_coll_basic_ft_event;
|
||||
|
||||
if (OMPI_COMM_IS_INTER(comm)) {
|
||||
basic_module->super.coll_allgather = mca_coll_basic_allgather_inter;
|
||||
basic_module->super.coll_allgatherv = mca_coll_basic_allgatherv_inter;
|
||||
basic_module->super.coll_allreduce = mca_coll_basic_allreduce_inter;
|
||||
basic_module->super.coll_alltoall = mca_coll_basic_alltoall_inter;
|
||||
basic_module->super.coll_alltoallv = mca_coll_basic_alltoallv_inter;
|
||||
basic_module->super.coll_alltoallw = mca_coll_basic_alltoallw_inter;
|
||||
basic_module->super.coll_barrier = mca_coll_basic_barrier_inter_lin;
|
||||
basic_module->super.coll_bcast = mca_coll_basic_bcast_lin_inter;
|
||||
basic_module->super.coll_exscan = NULL;
|
||||
basic_module->super.coll_gather = mca_coll_basic_gather_inter;
|
||||
basic_module->super.coll_gatherv = mca_coll_basic_gatherv_inter;
|
||||
basic_module->super.coll_reduce = mca_coll_basic_reduce_lin_inter;
|
||||
basic_module->super.coll_reduce_scatter = mca_coll_basic_reduce_scatter_inter;
|
||||
basic_module->super.coll_scan = NULL;
|
||||
basic_module->super.coll_scatter = mca_coll_basic_scatter_inter;
|
||||
basic_module->super.coll_scatterv = mca_coll_basic_scatterv_inter;
|
||||
} else if (ompi_comm_size(comm) <= mca_coll_basic_crossover) {
|
||||
basic_module->super.coll_allgather = mca_coll_basic_allgather_intra;
|
||||
basic_module->super.coll_allgatherv = mca_coll_basic_allgatherv_intra;
|
||||
basic_module->super.coll_allreduce = mca_coll_basic_allreduce_intra;
|
||||
basic_module->super.coll_alltoall = mca_coll_basic_alltoall_intra;
|
||||
basic_module->super.coll_alltoallv = mca_coll_basic_alltoallv_intra;
|
||||
basic_module->super.coll_alltoallw = mca_coll_basic_alltoallw_intra;
|
||||
basic_module->super.coll_barrier = mca_coll_basic_barrier_intra_lin;
|
||||
basic_module->super.coll_bcast = mca_coll_basic_bcast_lin_intra;
|
||||
basic_module->super.coll_exscan = mca_coll_basic_exscan_intra;
|
||||
basic_module->super.coll_gather = mca_coll_basic_gather_intra;
|
||||
basic_module->super.coll_gatherv = mca_coll_basic_gatherv_intra;
|
||||
basic_module->super.coll_reduce = mca_coll_basic_reduce_lin_intra;
|
||||
basic_module->super.coll_reduce_scatter = mca_coll_basic_reduce_scatter_intra;
|
||||
basic_module->super.coll_scan = mca_coll_basic_scan_intra;
|
||||
basic_module->super.coll_scatter = mca_coll_basic_scatter_intra;
|
||||
basic_module->super.coll_scatterv = mca_coll_basic_scatterv_intra;
|
||||
} else {
|
||||
basic_module->super.coll_allgather = mca_coll_basic_allgather_intra;
|
||||
basic_module->super.coll_allgatherv = mca_coll_basic_allgatherv_intra;
|
||||
basic_module->super.coll_allreduce = mca_coll_basic_allreduce_intra;
|
||||
basic_module->super.coll_alltoall = mca_coll_basic_alltoall_intra;
|
||||
basic_module->super.coll_alltoallv = mca_coll_basic_alltoallv_intra;
|
||||
basic_module->super.coll_alltoallw = mca_coll_basic_alltoallw_intra;
|
||||
basic_module->super.coll_barrier = mca_coll_basic_barrier_intra_log;
|
||||
basic_module->super.coll_bcast = mca_coll_basic_bcast_log_intra;
|
||||
basic_module->super.coll_exscan = mca_coll_basic_exscan_intra;
|
||||
basic_module->super.coll_gather = mca_coll_basic_gather_intra;
|
||||
basic_module->super.coll_gatherv = mca_coll_basic_gatherv_intra;
|
||||
basic_module->super.coll_reduce = mca_coll_basic_reduce_log_intra;
|
||||
basic_module->super.coll_reduce_scatter = mca_coll_basic_reduce_scatter_intra;
|
||||
basic_module->super.coll_scan = mca_coll_basic_scan_intra;
|
||||
basic_module->super.coll_scatter = mca_coll_basic_scatter_intra;
|
||||
basic_module->super.coll_scatterv = mca_coll_basic_scatterv_intra;
|
||||
}
|
||||
data->mccb_reqs = (ompi_request_t **) (data + 1);
|
||||
data->mccb_num_reqs = size * 2;
|
||||
|
||||
/* All done */
|
||||
|
||||
comm->c_coll_basic_data = data;
|
||||
return comm->c_coll_basic_module;
|
||||
return &(basic_module->super);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finalize module on the communicator
|
||||
* Init module on the communicator
|
||||
*/
|
||||
int
|
||||
mca_coll_basic_module_finalize(struct ompi_communicator_t *comm)
|
||||
mca_coll_basic_module_enable(mca_coll_base_module_1_1_0_t *module,
|
||||
struct ompi_communicator_t *comm)
|
||||
{
|
||||
if (NULL == comm->c_coll_basic_module) {
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
/* Reset the reqs to NULL/0 -- they'll be freed as part of freeing
|
||||
* the generel c_coll_basic_data */
|
||||
|
||||
comm->c_coll_basic_data->mccb_reqs = NULL;
|
||||
comm->c_coll_basic_data->mccb_num_reqs = 0;
|
||||
#endif
|
||||
|
||||
/* All done */
|
||||
|
||||
free(comm->c_coll_basic_data);
|
||||
comm->c_coll_basic_data = NULL;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_coll_basic_ft_event(int state) {
|
||||
|
||||
int
|
||||
mca_coll_basic_ft_event(int state) {
|
||||
if(OPAL_CRS_CHECKPOINT == state) {
|
||||
;
|
||||
}
|
||||
|
@ -38,7 +38,8 @@ int
|
||||
mca_coll_basic_reduce_lin_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, err, size;
|
||||
ptrdiff_t true_lb, true_extent, lb, extent;
|
||||
@ -316,7 +317,8 @@ int
|
||||
mca_coll_basic_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, size, rank, vrank;
|
||||
int err, peer, dim, mask;
|
||||
@ -335,7 +337,7 @@ mca_coll_basic_reduce_log_intra(void *sbuf, void *rbuf, int count,
|
||||
|
||||
if (!ompi_op_is_commute(op)) {
|
||||
return mca_coll_basic_reduce_lin_intra(sbuf, rbuf, count, dtype,
|
||||
op, root, comm);
|
||||
op, root, comm, module);
|
||||
}
|
||||
|
||||
/* Some variables */
|
||||
@ -524,7 +526,8 @@ int
|
||||
mca_coll_basic_reduce_lin_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, err, size;
|
||||
ptrdiff_t true_lb, true_extent, lb, extent;
|
||||
@ -603,7 +606,8 @@ int
|
||||
mca_coll_basic_reduce_log_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -58,7 +58,8 @@ int
|
||||
mca_coll_basic_reduce_scatter_intra(void *sbuf, void *rbuf, int *rcounts,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, size, count, err = OMPI_SUCCESS;
|
||||
ptrdiff_t true_lb, true_extent, lb, extent, buf_size;
|
||||
@ -324,13 +325,13 @@ mca_coll_basic_reduce_scatter_intra(void *sbuf, void *rbuf, int *rcounts,
|
||||
/* reduction */
|
||||
err =
|
||||
comm->c_coll.coll_reduce(sbuf, recv_buf, count, dtype, op, 0,
|
||||
comm);
|
||||
comm, module);
|
||||
|
||||
/* scatter */
|
||||
if (MPI_SUCCESS == err) {
|
||||
err = comm->c_coll.coll_scatterv(recv_buf, rcounts, disps, dtype,
|
||||
rbuf, rcounts[rank], dtype, 0,
|
||||
comm);
|
||||
comm, module);
|
||||
}
|
||||
}
|
||||
|
||||
@ -354,14 +355,16 @@ int
|
||||
mca_coll_basic_reduce_scatter_inter(void *sbuf, void *rbuf, int *rcounts,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int err, i, rank, root = 0, rsize;
|
||||
int totalcounts, tcount;
|
||||
ptrdiff_t lb, extent;
|
||||
char *tmpbuf = NULL, *tmpbuf2 = NULL, *tbuf = NULL;
|
||||
ompi_request_t *req;
|
||||
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
ompi_request_t **reqs = basic_module->mccb_reqs;
|
||||
|
||||
rank = ompi_comm_rank(comm);
|
||||
rsize = ompi_comm_remote_size(comm);
|
||||
@ -493,7 +496,7 @@ mca_coll_basic_reduce_scatter_inter(void *sbuf, void *rbuf, int *rcounts,
|
||||
|
||||
err =
|
||||
ompi_request_wait_all(rsize,
|
||||
comm->c_coll_basic_data->mccb_reqs,
|
||||
basic_module->mccb_reqs,
|
||||
MPI_STATUSES_IGNORE);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
goto exit;
|
||||
|
@ -40,7 +40,8 @@ int
|
||||
mca_coll_basic_scan_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int size, rank, err;
|
||||
ptrdiff_t true_lb, true_extent, lb, extent;
|
||||
|
@ -40,7 +40,8 @@ mca_coll_basic_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, size, err;
|
||||
char *ptmp;
|
||||
@ -106,12 +107,14 @@ mca_coll_basic_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, size, err;
|
||||
char *ptmp;
|
||||
ptrdiff_t lb, incr;
|
||||
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
ompi_request_t **reqs = basic_module->mccb_reqs;
|
||||
|
||||
/* Initialize */
|
||||
|
||||
@ -145,7 +148,7 @@ mca_coll_basic_scatter_inter(void *sbuf, int scount,
|
||||
}
|
||||
|
||||
err =
|
||||
ompi_request_wait_all(size, comm->c_coll_basic_data->mccb_reqs,
|
||||
ompi_request_wait_all(size, basic_module->mccb_reqs,
|
||||
MPI_STATUSES_IGNORE);
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,8 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, size, err;
|
||||
char *ptmp;
|
||||
@ -112,12 +113,14 @@ mca_coll_basic_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, size, err;
|
||||
char *ptmp;
|
||||
ptrdiff_t lb, extent;
|
||||
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs;
|
||||
mca_coll_basic_module_t *basic_module = (mca_coll_basic_module_t*) module;
|
||||
ompi_request_t **reqs = basic_module->mccb_reqs;
|
||||
|
||||
/* Initialize */
|
||||
|
||||
|
@ -16,8 +16,34 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef MCA_COLL_H
|
||||
#define MCA_COLL_H
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Collective Communication Interface
|
||||
*
|
||||
* Interface for implementing the collective communication interface
|
||||
* of MPI. The MPI interface provides error checking and error
|
||||
* handler invocation, but the collective components provide all other
|
||||
* functionality.
|
||||
*
|
||||
* Component selection is per communicator (ie, comm_query will be
|
||||
* called once per communicator when the communicator is called).
|
||||
* During the call to coll_enable(), components are ordered by
|
||||
* priority and functions are copied form the highest available
|
||||
* component then the next highest and so on until all functions are
|
||||
* available. This selection process is detailed during comm_query()
|
||||
* and comm_enable() and can result in up to N different components
|
||||
* being used for a single communicator, one per needed collective
|
||||
* function.
|
||||
*
|
||||
* The interface is the same for inter- or intra-communicators, and
|
||||
* components should be able to handle either style of communicator
|
||||
* during initialization (although handling may include indicating the
|
||||
* component is not available).
|
||||
*/
|
||||
|
||||
#ifndef OMPI_MCA_COLL_COLL_H
|
||||
#define OMPI_MCA_COLL_COLL_H
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
@ -28,165 +54,319 @@
|
||||
#include "opal/mca/crs/crs.h"
|
||||
#include "opal/mca/crs/base/base.h"
|
||||
|
||||
/*
|
||||
* Forward declaration
|
||||
BEGIN_C_DECLS
|
||||
|
||||
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
struct ompi_communicator_t;
|
||||
struct ompi_datatype_t;
|
||||
struct ompi_op_t;
|
||||
|
||||
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
/**
|
||||
* Collective component initialization
|
||||
*
|
||||
* Initialize the given collective component. This function should
|
||||
* initialize any component-level. data. It will be called exactly
|
||||
* once during MPI_INIT.
|
||||
*
|
||||
* @note The component framework is not lazily opened, so attempts
|
||||
* should be made to minimze the amount of memory allocated during
|
||||
* this function.
|
||||
*
|
||||
* @param[in] enable_progress_threads True if the component needs to
|
||||
* support progress threads
|
||||
* @param[in] enable_mpi_threads True if the component needs to
|
||||
* support MPI_THREAD_MULTIPLE
|
||||
*
|
||||
* @retval ORTE_SUCCESS Component successfully initialized
|
||||
* @retval ORTE_ERROR An unspecified error occurred
|
||||
*/
|
||||
|
||||
struct mca_coll_base_comm_t;
|
||||
|
||||
|
||||
/*
|
||||
* Coll component function typedefs
|
||||
*/
|
||||
|
||||
typedef int (*mca_coll_base_component_init_query_fn_t)
|
||||
(bool enable_progress_threads, bool enable_mpi_threads);
|
||||
typedef const struct mca_coll_base_module_1_0_0_t *
|
||||
(*mca_coll_base_component_comm_query_1_0_0_fn_t)
|
||||
(struct ompi_communicator_t *comm, int *priority,
|
||||
struct mca_coll_base_comm_t **data);
|
||||
typedef int (*mca_coll_base_component_comm_unquery_fn_t)
|
||||
(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_comm_t *data);
|
||||
(bool enable_progress_threads, bool enable_mpi_threads);
|
||||
|
||||
/*
|
||||
* Coll module function typedefs
|
||||
|
||||
/**
|
||||
* Query whether a component is available for the given communicator
|
||||
*
|
||||
* Query whether the component is available for the given
|
||||
* communicator. If the component is available, an object should be
|
||||
* allocated and returned (with refcount at 1). The module will not
|
||||
* be used for collective operations until module_enable() is called
|
||||
* on the module, but may be destroyed (via OBJ_RELEASE) either before
|
||||
* or after module_enable() is called. If the module needs to release
|
||||
* resources obtained during query(), it should do so in the module
|
||||
* destructor.
|
||||
*
|
||||
* A component may provide NULL to this function to indicate it does
|
||||
* not wish to run or return an error during module_enable().
|
||||
*
|
||||
* @note The communicator is available for point-to-point
|
||||
* communication, but other functionality is not available during this
|
||||
* phase of initialization.
|
||||
*
|
||||
* @param[in] comm The communicator being created
|
||||
* @param[out] priority Priority setting for component on
|
||||
* this communicator
|
||||
*
|
||||
* @returns An initialized module structure if the component can
|
||||
* provide a module with the requested functionality or NULL if the
|
||||
* component should not be used on the given communicator.
|
||||
*/
|
||||
typedef struct mca_coll_base_module_1_1_0_t *
|
||||
(*mca_coll_base_component_comm_query_1_1_0_fn_t)
|
||||
(struct ompi_communicator_t *comm, int *priority);
|
||||
|
||||
typedef const struct mca_coll_base_module_1_0_0_t *
|
||||
(*mca_coll_base_module_init_1_0_0_fn_t)(struct ompi_communicator_t *comm);
|
||||
typedef int (*mca_coll_base_module_finalize_fn_t)
|
||||
(struct ompi_communicator_t *comm);
|
||||
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
/**
|
||||
* Enable module for collective communication
|
||||
*
|
||||
* Enable the module for collective commuication. Modules are enabled
|
||||
* in order from lowest to highest priority. At each component,
|
||||
* collective functions with priority higher than the existing
|
||||
* function are copied into the communicator's function table and the
|
||||
* module's reference count is incremented. Replaced functions have
|
||||
* their module's reference count decremented, so a component will go
|
||||
* out of scope when it has been examined and is no longer used in any
|
||||
* collective functions.
|
||||
*
|
||||
* Because the function list is built on increasing priority, a
|
||||
* component that needs functions from a lower priority component
|
||||
* (say, a multi-cast barrier that might need a point-to-point barrier
|
||||
* for resource exhaustion issues) can keep the function pointer and
|
||||
* module pointer and increase the reference count of the module and
|
||||
* use the module during execution.
|
||||
*
|
||||
* When a module is not used for any interface functions and no
|
||||
* higher-priority module has increased its refcount, it will have
|
||||
* it's destructor triggered and the module will be destroyed.
|
||||
*
|
||||
* @note The collective component should not modify the communicator
|
||||
* during this operation. The communicator will be updated with the
|
||||
* collective algorithm's function pointers and module (and the ref
|
||||
* count increased on the module) by the base selection functionality.
|
||||
*
|
||||
* @param[in/out] module Module created during comm_query()
|
||||
* @param[in] comm Communicator being created
|
||||
*/
|
||||
typedef int
|
||||
(*mca_coll_base_module_enable_1_1_0_fn_t)(struct mca_coll_base_module_1_1_0_t* module,
|
||||
struct ompi_communicator_t *comm);
|
||||
|
||||
|
||||
typedef int (*mca_coll_base_module_allgather_fn_t)
|
||||
(void *sbuf, int scount, struct ompi_datatype_t *sdtype,
|
||||
void *rbuf, int rcount, struct ompi_datatype_t *rdtype,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_allgatherv_fn_t)
|
||||
(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);
|
||||
struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_allreduce_fn_t)
|
||||
(void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op, struct ompi_communicator_t *comm);
|
||||
struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_alltoall_fn_t)
|
||||
(void *sbuf, int scount, struct ompi_datatype_t *sdtype,
|
||||
void* rbuf, int rcount, struct ompi_datatype_t *rdtype,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_alltoallv_fn_t)
|
||||
(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);
|
||||
struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_alltoallw_fn_t)
|
||||
(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);
|
||||
struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_barrier_fn_t)
|
||||
(struct ompi_communicator_t *comm);
|
||||
(struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_bcast_fn_t)
|
||||
(void *buff, int count, struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_exscan_fn_t)
|
||||
(void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op, struct ompi_communicator_t *comm);
|
||||
struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_gather_fn_t)
|
||||
(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 root, struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_gatherv_fn_t)
|
||||
(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 root, struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_reduce_fn_t)
|
||||
(void *sbuf, void* rbuf, int count, struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op, int root, struct ompi_communicator_t *comm);
|
||||
struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_reduce_scatter_fn_t)
|
||||
(void *sbuf, void *rbuf, int *rcounts, struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op, struct ompi_communicator_t *comm);
|
||||
struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_scan_fn_t)
|
||||
(void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op, struct ompi_communicator_t *comm);
|
||||
struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_scatter_fn_t)
|
||||
(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 root, struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
typedef int (*mca_coll_base_module_scatterv_fn_t)
|
||||
(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 root, struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *data);
|
||||
|
||||
|
||||
/**
|
||||
* Fault Tolerance Awareness function
|
||||
* @param status Checkpoint status
|
||||
* @return OMPI_SUCCESS or failure status
|
||||
*
|
||||
* Fault tolerance function -- called when a process / job state change is noticed
|
||||
*
|
||||
* @param[in] state State change that triggered the function
|
||||
*
|
||||
* @retval ORTE_SUCCESS Component successfully selected
|
||||
* @retval ORTE_ERROR An unspecified error occurred
|
||||
*/
|
||||
typedef int (*mca_coll_base_module_ft_event_fn_t) (int state);
|
||||
|
||||
|
||||
/*
|
||||
* Structure for coll v1.0.0 components
|
||||
* Chained to MCA v1.0.0
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
/**
|
||||
* Collective component interface
|
||||
*
|
||||
* Component interface for the collective framework. A public
|
||||
* instance of this structure, called
|
||||
* mca_coll_[component_name]_component, must exist in any collective
|
||||
* component.
|
||||
*/
|
||||
struct mca_coll_base_component_1_0_0_t {
|
||||
mca_base_component_t collm_version;
|
||||
mca_base_component_data_1_0_0_t collm_data;
|
||||
struct mca_coll_base_component_1_1_0_t {
|
||||
/** Base component description */
|
||||
mca_base_component_t collm_version;
|
||||
/** Base component data block */
|
||||
mca_base_component_data_1_0_0_t collm_data;
|
||||
|
||||
/* Initialization / querying functions */
|
||||
|
||||
mca_coll_base_component_init_query_fn_t collm_init_query;
|
||||
mca_coll_base_component_comm_query_1_0_0_fn_t collm_comm_query;
|
||||
mca_coll_base_component_comm_unquery_fn_t collm_comm_unquery;
|
||||
/** Component initialization function */
|
||||
mca_coll_base_component_init_query_fn_t collm_init_query;
|
||||
/** Query whether component is useable for given communicator */
|
||||
mca_coll_base_component_comm_query_1_1_0_fn_t collm_comm_query;
|
||||
};
|
||||
typedef struct mca_coll_base_component_1_0_0_t mca_coll_base_component_1_0_0_t;
|
||||
typedef struct mca_coll_base_component_1_1_0_t mca_coll_base_component_1_1_0_t;
|
||||
|
||||
|
||||
/*
|
||||
* This struct is hung on the communicator by the winning coll component
|
||||
* after the negotiation. It has pointers for all the collective
|
||||
* functions, as well as a "finalize" function for when the
|
||||
* communicator is freed.
|
||||
/**
|
||||
* Collective module interface
|
||||
*
|
||||
* Module interface to the Collective framework. Modules are
|
||||
* reference counted based on the number of functions from the module
|
||||
* used on the commuicator. There is at most one module per component
|
||||
* on a given communicator, and there can be many component modules on
|
||||
* a given communicator.
|
||||
*
|
||||
* @note The collective framework and the
|
||||
* communicator functionality only stores a pointer to the module
|
||||
* function, so the component is free to create a structure that
|
||||
* inherits from this one for use as the module structure.
|
||||
*/
|
||||
struct mca_coll_base_module_1_1_0_t {
|
||||
/** Collective modules all inherit from opal_object */
|
||||
opal_object_t super;
|
||||
|
||||
struct mca_coll_base_module_1_0_0_t {
|
||||
/** Enable function called when a collective module is (possibly)
|
||||
going to be used for the given communicator */
|
||||
mca_coll_base_module_enable_1_1_0_fn_t coll_module_enable;
|
||||
|
||||
/* Per-communicator initialization and finalization functions */
|
||||
/* Collective function pointers */
|
||||
mca_coll_base_module_allgather_fn_t coll_allgather;
|
||||
mca_coll_base_module_allgatherv_fn_t coll_allgatherv;
|
||||
mca_coll_base_module_allreduce_fn_t coll_allreduce;
|
||||
mca_coll_base_module_alltoall_fn_t coll_alltoall;
|
||||
mca_coll_base_module_alltoallv_fn_t coll_alltoallv;
|
||||
mca_coll_base_module_alltoallw_fn_t coll_alltoallw;
|
||||
mca_coll_base_module_barrier_fn_t coll_barrier;
|
||||
mca_coll_base_module_bcast_fn_t coll_bcast;
|
||||
mca_coll_base_module_exscan_fn_t coll_exscan;
|
||||
mca_coll_base_module_gather_fn_t coll_gather;
|
||||
mca_coll_base_module_gatherv_fn_t coll_gatherv;
|
||||
mca_coll_base_module_reduce_fn_t coll_reduce;
|
||||
mca_coll_base_module_reduce_scatter_fn_t coll_reduce_scatter;
|
||||
mca_coll_base_module_scan_fn_t coll_scan;
|
||||
mca_coll_base_module_scatter_fn_t coll_scatter;
|
||||
mca_coll_base_module_scatterv_fn_t coll_scatterv;
|
||||
|
||||
mca_coll_base_module_init_1_0_0_fn_t coll_module_init;
|
||||
mca_coll_base_module_finalize_fn_t coll_module_finalize;
|
||||
|
||||
/* Collective function pointers */
|
||||
|
||||
mca_coll_base_module_allgather_fn_t coll_allgather;
|
||||
mca_coll_base_module_allgatherv_fn_t coll_allgatherv;
|
||||
mca_coll_base_module_allreduce_fn_t coll_allreduce;
|
||||
mca_coll_base_module_alltoall_fn_t coll_alltoall;
|
||||
mca_coll_base_module_alltoallv_fn_t coll_alltoallv;
|
||||
mca_coll_base_module_alltoallw_fn_t coll_alltoallw;
|
||||
mca_coll_base_module_barrier_fn_t coll_barrier;
|
||||
mca_coll_base_module_bcast_fn_t coll_bcast;
|
||||
mca_coll_base_module_exscan_fn_t coll_exscan;
|
||||
mca_coll_base_module_gather_fn_t coll_gather;
|
||||
mca_coll_base_module_gatherv_fn_t coll_gatherv;
|
||||
mca_coll_base_module_reduce_fn_t coll_reduce;
|
||||
mca_coll_base_module_reduce_scatter_fn_t coll_reduce_scatter;
|
||||
mca_coll_base_module_scan_fn_t coll_scan;
|
||||
mca_coll_base_module_scatter_fn_t coll_scatter;
|
||||
mca_coll_base_module_scatterv_fn_t coll_scatterv;
|
||||
|
||||
mca_coll_base_module_ft_event_fn_t ft_event;
|
||||
/** Fault tolerance event trigger function */
|
||||
mca_coll_base_module_ft_event_fn_t ft_event;
|
||||
};
|
||||
typedef struct mca_coll_base_module_1_0_0_t mca_coll_base_module_1_0_0_t;
|
||||
typedef struct mca_coll_base_module_1_1_0_t mca_coll_base_module_1_1_0_t;
|
||||
OBJ_CLASS_DECLARATION(mca_coll_base_module_1_1_0_t);
|
||||
|
||||
|
||||
/**
|
||||
* Collectives communicator cache structure
|
||||
*
|
||||
* Collectives communicator cache structure, used to find functions to
|
||||
* implement collective algorithms and their associated modules. This
|
||||
* function may also be used internally by a module if it needs to
|
||||
* keep a large number of "backing" functions, such as the demo
|
||||
* component.
|
||||
*/
|
||||
struct mca_coll_base_comm_coll_t {
|
||||
mca_coll_base_module_allgather_fn_t coll_allgather;
|
||||
mca_coll_base_module_1_1_0_t *coll_allgather_module;
|
||||
mca_coll_base_module_allgatherv_fn_t coll_allgatherv;
|
||||
mca_coll_base_module_1_1_0_t *coll_allgatherv_module;
|
||||
mca_coll_base_module_allreduce_fn_t coll_allreduce;
|
||||
mca_coll_base_module_1_1_0_t *coll_allreduce_module;
|
||||
mca_coll_base_module_alltoall_fn_t coll_alltoall;
|
||||
mca_coll_base_module_1_1_0_t *coll_alltoall_module;
|
||||
mca_coll_base_module_alltoallv_fn_t coll_alltoallv;
|
||||
mca_coll_base_module_1_1_0_t *coll_alltoallv_module;
|
||||
mca_coll_base_module_alltoallw_fn_t coll_alltoallw;
|
||||
mca_coll_base_module_1_1_0_t *coll_alltoallw_module;
|
||||
mca_coll_base_module_barrier_fn_t coll_barrier;
|
||||
mca_coll_base_module_1_1_0_t *coll_barrier_module;
|
||||
mca_coll_base_module_bcast_fn_t coll_bcast;
|
||||
mca_coll_base_module_1_1_0_t *coll_bcast_module;
|
||||
mca_coll_base_module_exscan_fn_t coll_exscan;
|
||||
mca_coll_base_module_1_1_0_t *coll_exscan_module;
|
||||
mca_coll_base_module_gather_fn_t coll_gather;
|
||||
mca_coll_base_module_1_1_0_t *coll_gather_module;
|
||||
mca_coll_base_module_gatherv_fn_t coll_gatherv;
|
||||
mca_coll_base_module_1_1_0_t *coll_gatherv_module;
|
||||
mca_coll_base_module_reduce_fn_t coll_reduce;
|
||||
mca_coll_base_module_1_1_0_t *coll_reduce_module;
|
||||
mca_coll_base_module_reduce_scatter_fn_t coll_reduce_scatter;
|
||||
mca_coll_base_module_1_1_0_t *coll_reduce_scatter_module;
|
||||
mca_coll_base_module_scan_fn_t coll_scan;
|
||||
mca_coll_base_module_1_1_0_t *coll_scan_module;
|
||||
mca_coll_base_module_scatter_fn_t coll_scatter;
|
||||
mca_coll_base_module_1_1_0_t *coll_scatter_module;
|
||||
mca_coll_base_module_scatterv_fn_t coll_scatterv;
|
||||
mca_coll_base_module_1_1_0_t *coll_scatterv_module;
|
||||
};
|
||||
typedef struct mca_coll_base_comm_coll_t mca_coll_base_comm_coll_t;
|
||||
|
||||
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
/*
|
||||
* Macro for use in components that are of type coll v1.0.0
|
||||
*/
|
||||
#define MCA_COLL_BASE_VERSION_1_0_0 \
|
||||
#define MCA_COLL_BASE_VERSION_1_1_0 \
|
||||
/* coll v1.0 is chained to MCA v1.0 */ \
|
||||
MCA_BASE_VERSION_1_0_0, \
|
||||
/* coll v1.0 */ \
|
||||
"coll", 1, 0, 0
|
||||
|
||||
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* MCA_COLL_H */
|
||||
|
@ -62,7 +62,6 @@ endif
|
||||
mcacomponentdir = $(pkglibdir)
|
||||
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
|
||||
mca_coll_demo_la_LIBADD = \
|
||||
$(top_ompi_builddir)/ompi/libmpi.la \
|
||||
|
@ -27,13 +27,11 @@
|
||||
#include "ompi/request/request.h"
|
||||
#include "ompi/mca/pml/pml.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/* Globally exported variables */
|
||||
|
||||
extern const mca_coll_base_component_1_0_0_t mca_coll_demo_component;
|
||||
OMPI_MODULE_DECLSPEC extern const mca_coll_base_component_1_1_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;
|
||||
@ -43,175 +41,214 @@ extern "C" {
|
||||
|
||||
int mca_coll_demo_init_query(bool enable_progress_threads,
|
||||
bool enable_mpi_threads);
|
||||
const struct mca_coll_base_module_1_0_0_t *
|
||||
mca_coll_demo_comm_query(struct ompi_communicator_t *comm, int *priority,
|
||||
struct mca_coll_base_comm_t **data);
|
||||
struct mca_coll_base_module_1_1_0_t *
|
||||
mca_coll_demo_comm_query(struct ompi_communicator_t *comm, int *priority);
|
||||
|
||||
/* Module functions */
|
||||
|
||||
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_module_enable(struct mca_coll_base_module_1_1_0_t *module,
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_demo_barrier_intra(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_demo_barrier_inter(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_demo_bcast_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_demo_bcast_inter(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_demo_ft_event(int status);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
struct mca_coll_demo_module_t {
|
||||
mca_coll_base_module_1_1_0_t super;
|
||||
|
||||
mca_coll_base_comm_coll_t underlying;
|
||||
};
|
||||
typedef struct mca_coll_demo_module_t mca_coll_demo_module_t;
|
||||
OBJ_CLASS_DECLARATION(mca_coll_demo_module_t);
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* MCA_COLL_DEMO_EXPORT_H */
|
||||
|
@ -36,11 +36,14 @@
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_allgather(sbuf, scount, sdtype, rbuf,
|
||||
rcount, rdtype, comm,
|
||||
demo_module->underlying.coll_allgather_module);
|
||||
}
|
||||
|
||||
|
||||
@ -55,9 +58,12 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_allgather(sbuf, scount, sdtype, rbuf,
|
||||
rcount, rdtype, comm,
|
||||
demo_module->underlying.coll_allgather_module);
|
||||
}
|
||||
|
@ -37,12 +37,15 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_allgatherv(sbuf, scount, sdtype,
|
||||
rbuf, rcounts, disps,
|
||||
rdtype, comm,
|
||||
demo_module->underlying.coll_allgatherv_module);
|
||||
}
|
||||
|
||||
|
||||
@ -57,10 +60,13 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_allgatherv(sbuf, scount, sdtype,
|
||||
rbuf, rcounts, disps,
|
||||
rdtype, comm,
|
||||
demo_module->underlying.coll_allgatherv_module);
|
||||
}
|
||||
|
@ -36,11 +36,14 @@
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_allreduce(sbuf, rbuf, count, dtype,
|
||||
op, comm,
|
||||
demo_module->underlying.coll_allreduce_module);
|
||||
}
|
||||
|
||||
|
||||
@ -54,9 +57,12 @@ int mca_coll_demo_allreduce_intra(void *sbuf, void *rbuf, int count,
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_allreduce(sbuf, rbuf, count, dtype,
|
||||
op, comm,
|
||||
demo_module->underlying.coll_allreduce_module);
|
||||
}
|
||||
|
@ -37,12 +37,15 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_alltoall(sbuf, scount, sdtype,
|
||||
rbuf, rcount, rdtype,
|
||||
comm,
|
||||
demo_module->underlying.coll_alltoall_module);
|
||||
}
|
||||
|
||||
|
||||
@ -57,10 +60,13 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_alltoall(sbuf, scount, sdtype,
|
||||
rbuf, rcount, rdtype,
|
||||
comm,
|
||||
demo_module->underlying.coll_alltoall_module);
|
||||
}
|
||||
|
@ -38,12 +38,15 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_alltoallv(sbuf, scounts, sdisps,
|
||||
sdtype, rbuf, rcounts,
|
||||
rdisps, rdtype, comm,
|
||||
demo_module->underlying.coll_alltoallv_module);
|
||||
}
|
||||
|
||||
|
||||
@ -59,10 +62,13 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_alltoallv(sbuf, scounts, sdisps,
|
||||
sdtype, rbuf, rcounts,
|
||||
rdisps, rdtype, comm,
|
||||
demo_module->underlying.coll_alltoallv_module);
|
||||
}
|
||||
|
@ -37,12 +37,15 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_alltoallw(sbuf, scounts, sdisps,
|
||||
sdtypes, rbuf, rcounts,
|
||||
rdisps, rdtypes, comm,
|
||||
demo_module->underlying.coll_alltoallw_module);
|
||||
}
|
||||
|
||||
|
||||
@ -57,10 +60,13 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_alltoallw(sbuf, scounts, sdisps,
|
||||
sdtypes, rbuf, rcounts,
|
||||
rdisps, rdtypes, comm,
|
||||
demo_module->underlying.coll_alltoallw_module);
|
||||
}
|
||||
|
@ -33,10 +33,13 @@
|
||||
* Accepts: - same as MPI_Barrier()
|
||||
* Returns: - MPI_SUCCESS or error code
|
||||
*/
|
||||
int mca_coll_demo_barrier_intra(struct ompi_communicator_t *comm)
|
||||
int mca_coll_demo_barrier_intra(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_output_verbose(10, mca_coll_base_output, "In demo barrier_intra");
|
||||
return comm->c_coll_basic_module->coll_barrier(comm);
|
||||
return demo_module->underlying.coll_barrier(comm,
|
||||
demo_module->underlying.coll_barrier_module);
|
||||
}
|
||||
|
||||
|
||||
@ -47,8 +50,11 @@ int mca_coll_demo_barrier_intra(struct ompi_communicator_t *comm)
|
||||
* Accepts: - same as MPI_Barrier()
|
||||
* Returns: - MPI_SUCCESS or error code
|
||||
*/
|
||||
int mca_coll_demo_barrier_inter(struct ompi_communicator_t *comm)
|
||||
int mca_coll_demo_barrier_inter(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_output_verbose(10, mca_coll_base_output, "In demo barrier_inter");
|
||||
return comm->c_coll_basic_module->coll_barrier(comm);
|
||||
return demo_module->underlying.coll_barrier(comm,
|
||||
demo_module->underlying.coll_barrier_module);
|
||||
}
|
||||
|
@ -35,11 +35,14 @@
|
||||
*/
|
||||
int mca_coll_demo_bcast_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_output_verbose(10, mca_coll_base_output, "In demo bcast_intra");
|
||||
return comm->c_coll_basic_module->coll_bcast(buff, count, datatype,
|
||||
root, comm);
|
||||
return demo_module->underlying.coll_bcast(buff, count, datatype,
|
||||
root, comm,
|
||||
demo_module->underlying.coll_bcast_module);
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +55,12 @@ int mca_coll_demo_bcast_intra(void *buff, int count,
|
||||
*/
|
||||
int mca_coll_demo_bcast_inter(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_output_verbose(10, mca_coll_base_output, "In demo bcast_inter");
|
||||
return comm->c_coll_basic_module->coll_bcast(buff, count, datatype,
|
||||
root, comm);
|
||||
return demo_module->underlying.coll_bcast(buff, count, datatype,
|
||||
root, comm,
|
||||
demo_module->underlying.coll_bcast_module);
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include "mpi.h"
|
||||
#include "ompi/mca/coll/coll.h"
|
||||
#include "coll-demo-version.h"
|
||||
#include "coll_demo.h"
|
||||
|
||||
/*
|
||||
@ -53,7 +52,7 @@ static int demo_open(void);
|
||||
* and pointers to our public functions in it
|
||||
*/
|
||||
|
||||
const mca_coll_base_component_1_0_0_t mca_coll_demo_component = {
|
||||
const mca_coll_base_component_1_1_0_t mca_coll_demo_component = {
|
||||
|
||||
/* First, the mca_component_t struct containing meta information
|
||||
about the component itself */
|
||||
@ -62,7 +61,7 @@ const mca_coll_base_component_1_0_0_t mca_coll_demo_component = {
|
||||
/* 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_1_0,
|
||||
|
||||
/* Component name and version */
|
||||
|
||||
@ -87,8 +86,7 @@ const mca_coll_base_component_1_0_0_t mca_coll_demo_component = {
|
||||
/* Initialization / querying functions */
|
||||
|
||||
mca_coll_demo_init_query,
|
||||
mca_coll_demo_comm_query,
|
||||
NULL
|
||||
mca_coll_demo_comm_query
|
||||
};
|
||||
|
||||
|
||||
@ -102,3 +100,44 @@ static int demo_open(void)
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mca_coll_demo_module_construct(mca_coll_demo_module_t *module)
|
||||
{
|
||||
memset(&module->underlying, 0, sizeof(mca_coll_base_comm_coll_t));
|
||||
}
|
||||
|
||||
#define RELEASE(module, func) \
|
||||
do { \
|
||||
if (NULL != module->underlying.coll_ ## func ## _module) { \
|
||||
OBJ_RELEASE(module->underlying.coll_ ## func ## _module); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static void
|
||||
mca_coll_demo_module_destruct(mca_coll_demo_module_t *module)
|
||||
{
|
||||
RELEASE(module, allgather);
|
||||
RELEASE(module, allgatherv);
|
||||
RELEASE(module, allreduce);
|
||||
RELEASE(module, alltoall);
|
||||
RELEASE(module, alltoallv);
|
||||
RELEASE(module, alltoallw);
|
||||
RELEASE(module, barrier);
|
||||
RELEASE(module, bcast);
|
||||
RELEASE(module, exscan);
|
||||
RELEASE(module, gather);
|
||||
RELEASE(module, gatherv);
|
||||
RELEASE(module, reduce);
|
||||
RELEASE(module, reduce_scatter);
|
||||
RELEASE(module, scan);
|
||||
RELEASE(module, scatter);
|
||||
RELEASE(module, scatterv);
|
||||
}
|
||||
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_coll_demo_module_t,
|
||||
mca_coll_base_module_1_1_0_t,
|
||||
mca_coll_demo_module_construct,
|
||||
mca_coll_demo_module_destruct);
|
||||
|
@ -36,27 +36,16 @@
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_exscan(sbuf, rbuf, count, dtype,
|
||||
op, comm,
|
||||
demo_module->underlying.coll_exscan_module);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* exscan_inter
|
||||
*
|
||||
* Function: - exscan
|
||||
* Accepts: - same arguments as MPI_Exscan()
|
||||
* Returns: - MPI_SUCCESS or error code
|
||||
* NOTE: There is no exscan defined for intercommunicators (see MPI-2).
|
||||
*/
|
||||
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)
|
||||
{
|
||||
opal_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);
|
||||
}
|
||||
|
@ -36,12 +36,15 @@ 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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_gather(sbuf, scount, sdtype,
|
||||
rbuf, rcount, rdtype,
|
||||
root, comm,
|
||||
demo_module->underlying.coll_gather_module);
|
||||
}
|
||||
|
||||
|
||||
@ -56,10 +59,13 @@ 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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_gather(sbuf, scount, sdtype,
|
||||
rbuf, rcount, rdtype,
|
||||
root, comm,
|
||||
demo_module->underlying.coll_gather_module);
|
||||
}
|
||||
|
@ -37,12 +37,15 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_gatherv(sbuf, scount, sdtype,
|
||||
rbuf, rcounts, disps,
|
||||
rdtype, root, comm,
|
||||
demo_module->underlying.coll_gatherv_module);
|
||||
}
|
||||
|
||||
|
||||
@ -57,10 +60,13 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_gatherv(sbuf, scount, sdtype,
|
||||
rbuf, rcounts, disps,
|
||||
rdtype, root, comm,
|
||||
demo_module->underlying.coll_gatherv_module);
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "ompi/mca/coll/base/base.h"
|
||||
#include "coll_demo.h"
|
||||
|
||||
#if 0
|
||||
|
||||
/*
|
||||
* Linear set of collective algorithms
|
||||
@ -91,6 +92,7 @@ static const mca_coll_base_module_1_0_0_t inter = {
|
||||
mca_coll_demo_ft_event
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initial query function that is invoked during MPI_INIT, allowing
|
||||
@ -105,50 +107,110 @@ int mca_coll_demo_init_query(bool enable_progress_threads,
|
||||
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,
|
||||
struct mca_coll_base_comm_t **data)
|
||||
mca_coll_base_module_1_1_0_t *
|
||||
mca_coll_demo_comm_query(struct ompi_communicator_t *comm, int *priority)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module;
|
||||
|
||||
demo_module = OBJ_NEW(mca_coll_demo_module_t);
|
||||
if (NULL == demo_module) return NULL;
|
||||
|
||||
if (OMPI_SUCCESS !=
|
||||
mca_base_param_lookup_int(mca_coll_demo_priority_param, priority)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return OMPI_COMM_IS_INTER(comm) ? &inter : &intra;
|
||||
demo_module->super.coll_module_enable = mca_coll_demo_module_enable;
|
||||
demo_module->super.ft_event = mca_coll_demo_ft_event;
|
||||
|
||||
if (OMPI_COMM_IS_INTRA(comm)) {
|
||||
demo_module->super.coll_allgather = mca_coll_demo_allgather_intra;
|
||||
demo_module->super.coll_allgatherv = mca_coll_demo_allgatherv_intra;
|
||||
demo_module->super.coll_allreduce = mca_coll_demo_allreduce_intra;
|
||||
demo_module->super.coll_alltoall = mca_coll_demo_alltoall_intra;
|
||||
demo_module->super.coll_alltoallv = mca_coll_demo_alltoallv_intra;
|
||||
demo_module->super.coll_alltoallw = mca_coll_demo_alltoallw_intra;
|
||||
demo_module->super.coll_barrier = mca_coll_demo_barrier_intra;
|
||||
demo_module->super.coll_bcast = mca_coll_demo_bcast_intra;
|
||||
demo_module->super.coll_exscan = mca_coll_demo_exscan_intra;
|
||||
demo_module->super.coll_gather = mca_coll_demo_gather_intra;
|
||||
demo_module->super.coll_gatherv = mca_coll_demo_gatherv_intra;
|
||||
demo_module->super.coll_reduce = mca_coll_demo_reduce_intra;
|
||||
demo_module->super.coll_reduce_scatter = mca_coll_demo_reduce_scatter_intra;
|
||||
demo_module->super.coll_scan = mca_coll_demo_scan_intra;
|
||||
demo_module->super.coll_scatter = mca_coll_demo_scatter_intra;
|
||||
demo_module->super.coll_scatterv = mca_coll_demo_scatterv_intra;
|
||||
} else {
|
||||
demo_module->super.coll_allgather = mca_coll_demo_allgather_inter;
|
||||
demo_module->super.coll_allgatherv = mca_coll_demo_allgatherv_inter;
|
||||
demo_module->super.coll_allreduce = mca_coll_demo_allreduce_inter;
|
||||
demo_module->super.coll_alltoall = mca_coll_demo_alltoall_inter;
|
||||
demo_module->super.coll_alltoallv = mca_coll_demo_alltoallv_inter;
|
||||
demo_module->super.coll_alltoallw = mca_coll_demo_alltoallw_inter;
|
||||
demo_module->super.coll_barrier = mca_coll_demo_barrier_inter;
|
||||
demo_module->super.coll_bcast = mca_coll_demo_bcast_inter;
|
||||
demo_module->super.coll_exscan = NULL;
|
||||
demo_module->super.coll_gather = mca_coll_demo_gather_inter;
|
||||
demo_module->super.coll_gatherv = mca_coll_demo_gatherv_inter;
|
||||
demo_module->super.coll_reduce = mca_coll_demo_reduce_inter;
|
||||
demo_module->super.coll_reduce_scatter = mca_coll_demo_reduce_scatter_inter;
|
||||
demo_module->super.coll_scan = NULL;
|
||||
demo_module->super.coll_scatter = mca_coll_demo_scatter_inter;
|
||||
demo_module->super.coll_scatterv = mca_coll_demo_scatterv_inter;
|
||||
}
|
||||
|
||||
return &(demo_module->super);
|
||||
}
|
||||
|
||||
#define COPY(comm, module, func) \
|
||||
do { \
|
||||
module->underlying.coll_ ## func = comm->c_coll.coll_ ## func; \
|
||||
module->underlying.coll_ ## func = comm->c_coll.coll_ ## func; \
|
||||
if (NULL != module->underlying.coll_ ## func ## _module) { \
|
||||
OBJ_RETAIN(module->underlying.coll_ ## func ## _module); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* 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)
|
||||
int
|
||||
mca_coll_demo_module_enable(mca_coll_base_module_1_1_0_t *module,
|
||||
struct ompi_communicator_t *comm)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
|
||||
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;
|
||||
}
|
||||
/* save the old pointers */
|
||||
COPY(comm, demo_module, allgather);
|
||||
COPY(comm, demo_module, allgatherv);
|
||||
COPY(comm, demo_module, allreduce);
|
||||
COPY(comm, demo_module, alltoall);
|
||||
COPY(comm, demo_module, alltoallv);
|
||||
COPY(comm, demo_module, alltoallw);
|
||||
COPY(comm, demo_module, barrier);
|
||||
COPY(comm, demo_module, bcast);
|
||||
COPY(comm, demo_module, exscan);
|
||||
COPY(comm, demo_module, gather);
|
||||
COPY(comm, demo_module, gatherv);
|
||||
COPY(comm, demo_module, reduce);
|
||||
COPY(comm, demo_module, reduce_scatter);
|
||||
COPY(comm, demo_module, scan);
|
||||
COPY(comm, demo_module, scatter);
|
||||
COPY(comm, demo_module, scatterv);
|
||||
|
||||
|
||||
/*
|
||||
* Finalize module on the communicator
|
||||
*/
|
||||
int mca_coll_demo_module_finalize(struct ompi_communicator_t *comm)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_coll_demo_ft_event(int status) {
|
||||
|
||||
int mca_coll_demo_ft_event(int state) {
|
||||
if(OPAL_CRS_CHECKPOINT == state) {
|
||||
;
|
||||
}
|
||||
|
@ -36,11 +36,14 @@
|
||||
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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_reduce(sbuf, rbuf, count, dtype,
|
||||
op, root, comm,
|
||||
demo_module->underlying.coll_reduce_module);
|
||||
}
|
||||
|
||||
|
||||
@ -54,9 +57,12 @@ int mca_coll_demo_reduce_intra(void *sbuf, void *rbuf, int count,
|
||||
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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_reduce(sbuf, rbuf, count, dtype,
|
||||
op, root, comm,
|
||||
demo_module->underlying.coll_reduce_module);
|
||||
}
|
||||
|
@ -36,11 +36,14 @@
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_reduce_scatter(sbuf, rbuf, rcounts,
|
||||
dtype, op, comm,
|
||||
demo_module->underlying.coll_reduce_scatter_module);
|
||||
}
|
||||
|
||||
|
||||
@ -54,9 +57,12 @@ int mca_coll_demo_reduce_scatter_intra(void *sbuf, void *rbuf, int *rcounts,
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_reduce_scatter(sbuf, rbuf, rcounts,
|
||||
dtype, op, comm,
|
||||
demo_module->underlying.coll_reduce_scatter_module);
|
||||
}
|
||||
|
@ -36,14 +36,17 @@
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_scan(sbuf, rbuf, count,
|
||||
dtype, op, comm,
|
||||
demo_module->underlying.coll_scan_module);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: There is no exscan defined for intercommunicators (see MPI-2).
|
||||
* NOTE: There is no scan defined for intercommunicators (see MPI-2).
|
||||
*/
|
||||
|
@ -38,12 +38,15 @@ int mca_coll_demo_scatter_intra(void *sbuf, int scount,
|
||||
void *rbuf, int rcount,
|
||||
struct ompi_datatype_t *rdtype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_scatter(sbuf, scount, sdtype,
|
||||
rbuf, rcount, rdtype,
|
||||
root, comm,
|
||||
demo_module->underlying.coll_scatter_module);
|
||||
}
|
||||
|
||||
|
||||
@ -59,10 +62,13 @@ int mca_coll_demo_scatter_inter(void *sbuf, int scount,
|
||||
void *rbuf, int rcount,
|
||||
struct ompi_datatype_t *rdtype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_scatter(sbuf, scount, sdtype,
|
||||
rbuf, rcount, rdtype,
|
||||
root, comm,
|
||||
demo_module->underlying.coll_scatter_module);
|
||||
}
|
||||
|
@ -37,12 +37,15 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_scatterv(sbuf, scounts, disps,
|
||||
sdtype, rbuf, rcount,
|
||||
rdtype, root, comm,
|
||||
demo_module->underlying.coll_scatterv_module);
|
||||
}
|
||||
|
||||
|
||||
@ -57,10 +60,13 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
|
||||
opal_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);
|
||||
return demo_module->underlying.coll_scatterv(sbuf, scounts, disps,
|
||||
sdtype, rbuf, rcount,
|
||||
rdtype, root, comm,
|
||||
demo_module->underlying.coll_scatterv_module);
|
||||
}
|
||||
|
0
ompi/mca/coll/hierarch/.ompi_ignore
Обычный файл
0
ompi/mca/coll/hierarch/.ompi_ignore
Обычный файл
@ -39,11 +39,9 @@
|
||||
#include "ompi/mca/btl/btl.h"
|
||||
|
||||
|
||||
#if 0
|
||||
static void mca_coll_inter_dump_struct ( struct mca_coll_base_comm_t *c);
|
||||
|
||||
/*
|
||||
* Linear set of collective algorithms
|
||||
*/
|
||||
static const mca_coll_base_module_1_0_0_t inter = {
|
||||
|
||||
/* Initialization / finalization functions */
|
||||
@ -71,36 +69,7 @@ static const mca_coll_base_module_1_0_0_t inter = {
|
||||
mca_coll_inter_scatter_inter,
|
||||
mca_coll_inter_scatterv_inter
|
||||
};
|
||||
|
||||
|
||||
static const mca_coll_base_module_1_0_0_t null_inter = {
|
||||
|
||||
/* Initialization / finalization functions */
|
||||
|
||||
mca_coll_inter_module_init,
|
||||
mca_coll_inter_module_finalize,
|
||||
|
||||
/* Collective function pointers */
|
||||
/* function pointers marked with NULL are not yet implemented
|
||||
and will use the functions provided in the basic module */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@ -110,7 +79,6 @@ static const mca_coll_base_module_1_0_0_t null_inter = {
|
||||
int mca_coll_inter_init_query(bool allow_inter_user_threads,
|
||||
bool have_hidden_user_threads)
|
||||
{
|
||||
|
||||
/* Don't ask. All done */
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
@ -121,17 +89,19 @@ int mca_coll_inter_init_query(bool allow_inter_user_threads,
|
||||
* 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_inter_comm_query(struct ompi_communicator_t *comm, int *priority,
|
||||
struct mca_coll_base_comm_t **data)
|
||||
mca_coll_base_module_1_1_0_t *
|
||||
mca_coll_inter_comm_query(struct ompi_communicator_t *comm, int *priority)
|
||||
{
|
||||
int size, rsize;
|
||||
mca_coll_inter_module_t *inter_module;
|
||||
|
||||
inter_module = OBJ_NEW(mca_coll_inter_module_t);
|
||||
|
||||
/* This module only works for inter-communicators */
|
||||
if ( !OMPI_COMM_IS_INTER(comm) ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Get the priority level */
|
||||
*priority = mca_coll_inter_priority_param;
|
||||
if ( 0 >= mca_coll_inter_priority_param ) {
|
||||
@ -144,61 +114,57 @@ mca_coll_inter_comm_query(struct ompi_communicator_t *comm, int *priority,
|
||||
if ( size < mca_coll_inter_crossover && rsize < mca_coll_inter_crossover) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inter_module->super.coll_module_enable = mca_coll_inter_module_enable;
|
||||
inter_module->super.ft_event = NULL;
|
||||
|
||||
inter_module->super.coll_allgather = mca_coll_inter_allgather_inter;
|
||||
inter_module->super.coll_allgatherv = mca_coll_inter_allgatherv_inter;
|
||||
inter_module->super.coll_allreduce = mca_coll_inter_allreduce_inter;
|
||||
inter_module->super.coll_alltoall = NULL;
|
||||
inter_module->super.coll_alltoallv = NULL;
|
||||
inter_module->super.coll_alltoallw = NULL;
|
||||
inter_module->super.coll_barrier = NULL;
|
||||
inter_module->super.coll_bcast = mca_coll_inter_bcast_inter;
|
||||
inter_module->super.coll_exscan = NULL;
|
||||
inter_module->super.coll_gather = mca_coll_inter_gather_inter;
|
||||
inter_module->super.coll_gatherv = mca_coll_inter_gatherv_inter;
|
||||
inter_module->super.coll_reduce = mca_coll_inter_reduce_inter;
|
||||
inter_module->super.coll_reduce_scatter = NULL;
|
||||
inter_module->super.coll_scan = NULL;
|
||||
inter_module->super.coll_scatter = mca_coll_inter_scatter_inter;
|
||||
inter_module->super.coll_scatterv = mca_coll_inter_scatterv_inter;
|
||||
|
||||
return &inter;
|
||||
return &(inter_module->super);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Init module on the communicator
|
||||
*/
|
||||
const struct mca_coll_base_module_1_0_0_t *
|
||||
mca_coll_inter_module_init(struct ompi_communicator_t *comm)
|
||||
int
|
||||
mca_coll_inter_module_enable(struct mca_coll_base_module_1_1_0_t *module,
|
||||
struct ompi_communicator_t *comm)
|
||||
{
|
||||
int size, rank;
|
||||
struct mca_coll_base_comm_t *data=NULL;
|
||||
mca_coll_inter_module_t *inter_module = (mca_coll_inter_module_t*) module;
|
||||
|
||||
rank = ompi_comm_rank(comm);
|
||||
size = ompi_comm_size(comm);
|
||||
|
||||
data = (struct mca_coll_base_comm_t *) malloc ( sizeof(struct mca_coll_base_comm_t));
|
||||
if ( NULL == data ) {
|
||||
return NULL;
|
||||
}
|
||||
data->inter_comm = comm;
|
||||
|
||||
comm->c_coll_selected_data=data;
|
||||
inter_module->inter_comm = comm;
|
||||
|
||||
#if 0
|
||||
if ( mca_coll_inter_verbose_param ) {
|
||||
mca_coll_inter_dump_struct (data);
|
||||
}
|
||||
#endif
|
||||
|
||||
return &inter;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finalize module on the communicator
|
||||
*/
|
||||
int mca_coll_inter_module_finalize(struct ompi_communicator_t *comm)
|
||||
{
|
||||
struct mca_coll_base_comm_t *data=NULL;
|
||||
|
||||
data = comm->c_coll_selected_data;
|
||||
free ( data );
|
||||
comm->c_coll_selected_data = NULL;
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_coll_inter_comm_unquery ( struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_comm_t *data )
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
static void mca_coll_inter_dump_struct ( struct mca_coll_base_comm_t *c)
|
||||
{
|
||||
int rank;
|
||||
@ -211,3 +177,4 @@ static void mca_coll_inter_dump_struct ( struct mca_coll_base_comm_t *c)
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -29,94 +29,95 @@
|
||||
#include "ompi/request/request.h"
|
||||
#include "ompi/communicator/communicator.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/*
|
||||
* Globally exported variable
|
||||
*/
|
||||
|
||||
OMPI_MODULE_DECLSPEC extern const mca_coll_base_component_1_0_0_t mca_coll_inter_component;
|
||||
OMPI_MODULE_DECLSPEC extern const mca_coll_base_component_1_1_0_t mca_coll_inter_component;
|
||||
extern int mca_coll_inter_priority_param;
|
||||
extern int mca_coll_inter_verbose_param;
|
||||
|
||||
|
||||
/*
|
||||
* Data structure for attaching data to the communicator
|
||||
*/
|
||||
|
||||
/* Clarifying some terminology:
|
||||
* comm: the input communicator, consisting of several lower level communicators.
|
||||
*/
|
||||
|
||||
struct mca_coll_base_comm_t {
|
||||
struct ompi_communicator_t *inter_comm; /* link back to the attached comm */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* coll API functions
|
||||
*/
|
||||
int mca_coll_inter_init_query(bool allow_inter_user_threads,
|
||||
bool have_hidden_threads);
|
||||
const struct mca_coll_base_module_1_0_0_t *
|
||||
mca_coll_inter_comm_query(struct ompi_communicator_t *comm,
|
||||
int *priority, struct mca_coll_base_comm_t **data);
|
||||
int mca_coll_inter_comm_unquery(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_comm_t *data);
|
||||
bool have_hidden_threads);
|
||||
struct mca_coll_base_module_1_1_0_t *
|
||||
mca_coll_inter_comm_query(struct ompi_communicator_t *comm, int *priority);
|
||||
|
||||
const struct mca_coll_base_module_1_0_0_t *
|
||||
mca_coll_inter_module_init(struct ompi_communicator_t *comm);
|
||||
|
||||
int mca_coll_inter_module_finalize(struct ompi_communicator_t *comm);
|
||||
int mca_coll_inter_module_enable(struct mca_coll_base_module_1_1_0_t *module,
|
||||
struct ompi_communicator_t *comm);
|
||||
|
||||
int mca_coll_inter_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_inter_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_inter_allreduce_inter(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_inter_bcast_inter(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_inter_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_inter_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_inter_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_inter_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_inter_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
|
||||
struct mca_coll_inter_module_t {
|
||||
mca_coll_base_module_1_1_0_t super;
|
||||
|
||||
/* Clarifying some terminology:
|
||||
* comm: the input communicator, consisting of several lower level communicators.
|
||||
*/
|
||||
struct ompi_communicator_t *inter_comm; /* link back to the attached comm */
|
||||
};
|
||||
typedef struct mca_coll_inter_module_t mca_coll_inter_module_t;
|
||||
OBJ_CLASS_DECLARATION(mca_coll_inter_module_t);
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif /* MCA_COLL_INTER_EXPORT_H */
|
||||
|
@ -41,7 +41,8 @@ mca_coll_inter_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int rank, root = 0, size, rsize, err;
|
||||
char *ptmp = NULL;
|
||||
@ -66,7 +67,8 @@ mca_coll_inter_allgather_inter(void *sbuf, int scount,
|
||||
|
||||
err = comm->c_local_comm->c_coll.coll_gather(sbuf, scount, sdtype,
|
||||
ptmp, scount, sdtype,
|
||||
0, comm->c_local_comm);
|
||||
0, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_gather_module);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
goto exit;
|
||||
}
|
||||
@ -95,7 +97,8 @@ mca_coll_inter_allgather_inter(void *sbuf, int scount,
|
||||
}
|
||||
/* bcast the message to all the local processes */
|
||||
err = comm->c_local_comm->c_coll.coll_bcast(rbuf, rcount*rsize, rdtype,
|
||||
root, comm->c_local_comm);
|
||||
root, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_bcast_module);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -40,7 +40,8 @@ mca_coll_inter_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, size, size_local, total=0, err;
|
||||
int *count=NULL,*displace=NULL;
|
||||
@ -68,7 +69,8 @@ mca_coll_inter_allgatherv_inter(void *sbuf, int scount,
|
||||
/* Local gather to get the scount of each process */
|
||||
err = comm->c_local_comm->c_coll.coll_gather(&scount, 1, MPI_INT,
|
||||
count, 1, MPI_INT,
|
||||
0, comm->c_local_comm);
|
||||
0, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_gather_module);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
return err;
|
||||
}
|
||||
@ -93,7 +95,8 @@ mca_coll_inter_allgatherv_inter(void *sbuf, int scount,
|
||||
}
|
||||
err = comm->c_local_comm->c_coll.coll_gatherv(sbuf, scount, sdtype,
|
||||
ptmp, count, displace,
|
||||
sdtype,0, comm->c_local_comm);
|
||||
sdtype,0, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_gatherv_module);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
return err;
|
||||
}
|
||||
@ -129,7 +132,8 @@ mca_coll_inter_allgatherv_inter(void *sbuf, int scount,
|
||||
|
||||
/* bcast the message to all the local processes */
|
||||
err = comm->c_local_comm->c_coll.coll_bcast(rbuf, 1, ndtype,
|
||||
0, comm->c_local_comm);
|
||||
0, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_bcast_module);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
return err;
|
||||
}
|
||||
|
@ -39,7 +39,8 @@ int
|
||||
mca_coll_inter_allreduce_inter(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int err, rank, root = 0, rsize;
|
||||
ptrdiff_t lb, extent;
|
||||
@ -48,7 +49,6 @@ mca_coll_inter_allreduce_inter(void *sbuf, void *rbuf, int count,
|
||||
|
||||
rank = ompi_comm_rank(comm);
|
||||
rsize = ompi_comm_remote_size(comm);
|
||||
|
||||
|
||||
/* Perform the reduction locally */
|
||||
err = ompi_ddt_get_extent(dtype, &lb, &extent);
|
||||
@ -64,7 +64,8 @@ mca_coll_inter_allreduce_inter(void *sbuf, void *rbuf, int count,
|
||||
|
||||
err = comm->c_local_comm->c_coll.coll_reduce(sbuf, pml_buffer, count,
|
||||
dtype, op, root,
|
||||
comm->c_local_comm);
|
||||
comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_reduce_module);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
goto exit;
|
||||
}
|
||||
@ -94,7 +95,8 @@ mca_coll_inter_allreduce_inter(void *sbuf, void *rbuf, int count,
|
||||
|
||||
/* bcast the message to all the local processes */
|
||||
err = comm->c_local_comm->c_coll.coll_bcast(rbuf, count, dtype,
|
||||
root, comm->c_local_comm);
|
||||
root, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_bcast_module);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -38,8 +38,9 @@
|
||||
*/
|
||||
int
|
||||
mca_coll_inter_bcast_inter(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int rsize;
|
||||
int rank;
|
||||
@ -62,7 +63,8 @@ mca_coll_inter_bcast_inter(void *buff, int count,
|
||||
}
|
||||
}
|
||||
err = comm->c_local_comm->c_coll.coll_bcast(buff, count, datatype, 0,
|
||||
comm->c_local_comm);
|
||||
comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_bcast_module);
|
||||
} else {
|
||||
/* root section, send to the first process of the remote group */
|
||||
err = MCA_PML_CALL(send(buff, count, datatype, 0,
|
||||
|
@ -52,7 +52,7 @@ static int inter_open(void);
|
||||
* and pointers to our public functions in it
|
||||
*/
|
||||
|
||||
const mca_coll_base_component_1_0_0_t mca_coll_inter_component = {
|
||||
const mca_coll_base_component_1_1_0_t mca_coll_inter_component = {
|
||||
|
||||
/* First, the mca_component_t struct containing meta information
|
||||
about the component itself */
|
||||
@ -61,7 +61,7 @@ const mca_coll_base_component_1_0_0_t mca_coll_inter_component = {
|
||||
/* 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_1_0,
|
||||
|
||||
/* Component name and version */
|
||||
|
||||
@ -85,8 +85,7 @@ const mca_coll_base_component_1_0_0_t mca_coll_inter_component = {
|
||||
|
||||
/* Initialization / querying functions */
|
||||
mca_coll_inter_init_query,
|
||||
mca_coll_inter_comm_query,
|
||||
mca_coll_inter_comm_unquery
|
||||
mca_coll_inter_comm_query
|
||||
};
|
||||
|
||||
|
||||
@ -110,3 +109,22 @@ static int inter_open(void)
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mca_coll_inter_module_construct(mca_coll_inter_module_t *module)
|
||||
{
|
||||
module->inter_comm = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
mca_coll_inter_module_destruct(mca_coll_inter_module_t *module)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_coll_inter_module_t,
|
||||
mca_coll_base_module_1_1_0_t,
|
||||
mca_coll_inter_module_construct,
|
||||
mca_coll_inter_module_destruct);
|
||||
|
@ -40,7 +40,8 @@ mca_coll_inter_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int err;
|
||||
int rank;
|
||||
@ -72,7 +73,8 @@ mca_coll_inter_gather_inter(void *sbuf, int scount,
|
||||
|
||||
err = comm->c_local_comm->c_coll.coll_gather(sbuf, scount, sdtype,
|
||||
ptmp, scount, sdtype,
|
||||
0, comm->c_local_comm);
|
||||
0, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_gather_module);
|
||||
if (0 == rank) {
|
||||
/* First process sends data to the root */
|
||||
err = MCA_PML_CALL(send(ptmp, scount*size_local, sdtype, root,
|
||||
|
@ -39,7 +39,8 @@ mca_coll_inter_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
|
||||
int i, rank, size, size_local, total=0, err;
|
||||
@ -71,7 +72,8 @@ mca_coll_inter_gatherv_inter(void *sbuf, int scount,
|
||||
|
||||
err = comm->c_local_comm->c_coll.coll_gather(&scount, 1, MPI_INT,
|
||||
count, 1, MPI_INT,
|
||||
0, comm->c_local_comm);
|
||||
0, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_gather_module);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
return err;
|
||||
}
|
||||
@ -96,7 +98,8 @@ mca_coll_inter_gatherv_inter(void *sbuf, int scount,
|
||||
}
|
||||
err = comm->c_local_comm->c_coll.coll_gatherv(sbuf, scount, sdtype,
|
||||
ptmp, count, displace,
|
||||
sdtype,0, comm->c_local_comm);
|
||||
sdtype,0, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_gatherv_module);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
return err;
|
||||
}
|
||||
|
@ -38,9 +38,10 @@
|
||||
*/
|
||||
int
|
||||
mca_coll_inter_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)
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
int root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int rank, err, size;
|
||||
ptrdiff_t true_lb, true_extent, lb, extent;
|
||||
@ -66,7 +67,8 @@ mca_coll_inter_reduce_inter(void *sbuf, void *rbuf, int count,
|
||||
pml_buffer = free_buffer - lb;
|
||||
|
||||
err = comm->c_local_comm->c_coll.coll_reduce(sbuf, pml_buffer, count,
|
||||
dtype, op, 0, comm->c_local_comm);
|
||||
dtype, op, 0, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_reduce_module);
|
||||
if (0 == rank) {
|
||||
/* First process sends the result to the root */
|
||||
err = MCA_PML_CALL(send(pml_buffer, count, dtype, root,
|
||||
|
@ -39,7 +39,8 @@ mca_coll_inter_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int rank, size, size_local, err;
|
||||
char *ptmp = NULL;
|
||||
@ -78,7 +79,8 @@ mca_coll_inter_scatter_inter(void *sbuf, int scount,
|
||||
/* Perform the scatter locally with the first process as root */
|
||||
err = comm->c_local_comm->c_coll.coll_scatter(ptmp, rcount, rdtype,
|
||||
rbuf, rcount, rdtype,
|
||||
0, comm->c_local_comm);
|
||||
0, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_scatter_module);
|
||||
if (NULL != ptmp) {
|
||||
free(ptmp);
|
||||
}
|
||||
|
@ -40,7 +40,8 @@ mca_coll_inter_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int i, rank, size, err, total, size_local;
|
||||
int *counts=NULL,*displace=NULL;
|
||||
@ -102,7 +103,8 @@ mca_coll_inter_scatterv_inter(void *sbuf, int *scounts,
|
||||
/* perform the scatterv locally */
|
||||
err = comm->c_local_comm->c_coll.coll_scatterv(ptmp, counts, displace,
|
||||
rdtype, rbuf, rcount,
|
||||
rdtype, 0, comm->c_local_comm);
|
||||
rdtype, 0, comm->c_local_comm,
|
||||
comm->c_local_comm->c_coll.coll_scatterv_module);
|
||||
if (OMPI_SUCCESS != err) {
|
||||
return err;
|
||||
}
|
||||
|
@ -27,15 +27,13 @@
|
||||
#include "ompi/request/request.h"
|
||||
#include "ompi/mca/pml/pml.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/*
|
||||
* Globally exported variable
|
||||
*/
|
||||
|
||||
OMPI_MODULE_DECLSPEC extern const mca_coll_base_component_1_0_0_t mca_coll_self_component;
|
||||
OMPI_MODULE_DECLSPEC extern const mca_coll_base_component_1_1_0_t mca_coll_self_component;
|
||||
extern int mca_coll_self_priority_param;
|
||||
|
||||
|
||||
@ -46,90 +44,114 @@ extern int mca_coll_self_priority_param;
|
||||
|
||||
/* API functions */
|
||||
|
||||
int mca_coll_self_init_query(bool enable_progress_threads,
|
||||
bool enable_mpi_threads);
|
||||
const struct mca_coll_base_module_1_0_0_t *
|
||||
mca_coll_self_comm_query(struct ompi_communicator_t *comm, int *priority,
|
||||
struct mca_coll_base_comm_t **data);
|
||||
int mca_coll_self_init_query(bool enable_progress_threads,
|
||||
bool enable_mpi_threads);
|
||||
struct mca_coll_base_module_1_1_0_t *
|
||||
mca_coll_self_comm_query(struct ompi_communicator_t *comm, int *priority);
|
||||
|
||||
const struct mca_coll_base_module_1_0_0_t *
|
||||
mca_coll_self_module_init(struct ompi_communicator_t *comm);
|
||||
int mca_coll_self_module_finalize(struct ompi_communicator_t *comm);
|
||||
|
||||
int mca_coll_self_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_self_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_self_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_self_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_self_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_self_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_self_barrier_intra(struct ompi_communicator_t *comm);
|
||||
int mca_coll_self_bcast_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
int mca_coll_self_module_enable(struct mca_coll_base_module_1_1_0_t *module,
|
||||
struct ompi_communicator_t *comm);
|
||||
int mca_coll_self_exscan_intra(void *sbuf, void *rbuf, int count,
|
||||
|
||||
int mca_coll_self_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,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_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,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_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_self_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_self_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_self_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_self_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_self_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_self_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_self_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);
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_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,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_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,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_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,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_barrier_intra(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_bcast_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_exscan_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_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,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_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,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_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,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_reduce_scatter_intra(void *sbuf, void *rbuf,
|
||||
int *rcounts,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_scan_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_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,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_self_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,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_self_ft_event(int state);
|
||||
int mca_coll_self_ft_event(int state);
|
||||
|
||||
|
||||
struct mca_coll_self_module_t {
|
||||
mca_coll_base_module_1_1_0_t super;
|
||||
|
||||
ompi_request_t **mccb_reqs;
|
||||
int mccb_num_reqs;
|
||||
};
|
||||
typedef struct mca_coll_self_module_t mca_coll_self_module_t;
|
||||
OBJ_CLASS_DECLARATION(mca_coll_self_module_t);
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif /* MCA_COLL_SELF_EXPORT_H */
|
||||
|
@ -33,7 +33,8 @@
|
||||
int mca_coll_self_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
if (MPI_IN_PLACE == sbuf) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -34,7 +34,8 @@ int mca_coll_self_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
if (MPI_IN_PLACE == sbuf) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -33,7 +33,8 @@
|
||||
int mca_coll_self_allreduce_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
if (MPI_IN_PLACE == sbuf) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -34,7 +34,8 @@ int mca_coll_self_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
return ompi_ddt_sndrcv(sbuf, scount, sdtype,
|
||||
rbuf, rcount, rdtype);
|
||||
|
@ -32,10 +32,11 @@
|
||||
*/
|
||||
int
|
||||
mca_coll_self_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)
|
||||
struct ompi_datatype_t *sdtype,
|
||||
void *rbuf, int *rcounts, int *rdisps,
|
||||
struct ompi_datatype_t *rdtype,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
return ompi_ddt_sndrcv(((char *) sbuf) + sdisps[0], scounts[0], sdtype,
|
||||
((char *) rbuf) + rdisps[0], rcounts[0], rdtype);
|
||||
|
@ -34,7 +34,8 @@ int mca_coll_self_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
return ompi_ddt_sndrcv(((char *) sbuf) + sdisps[0], scounts[0], sdtypes[0],
|
||||
((char *) rbuf) + rdisps[0], rcounts[0], rdtypes[0]);
|
||||
|
@ -29,7 +29,8 @@
|
||||
* Accepts: - same as MPI_Barrier()
|
||||
* Returns: - MPI_SUCCESS
|
||||
*/
|
||||
int mca_coll_self_barrier_intra(struct ompi_communicator_t *comm)
|
||||
int mca_coll_self_barrier_intra(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
/* Since there is only one process, this is a no-op */
|
||||
|
||||
|
@ -32,7 +32,8 @@
|
||||
*/
|
||||
int mca_coll_self_bcast_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
/* Since there's only one process, there's nothing to do */
|
||||
|
||||
|
@ -51,7 +51,7 @@ static int self_open(void);
|
||||
* and pointers to our public functions in it
|
||||
*/
|
||||
|
||||
const mca_coll_base_component_1_0_0_t mca_coll_self_component = {
|
||||
const mca_coll_base_component_1_1_0_t mca_coll_self_component = {
|
||||
|
||||
/* First, the mca_component_t struct containing meta information
|
||||
about the component itself */
|
||||
@ -60,7 +60,7 @@ const mca_coll_base_component_1_0_0_t mca_coll_self_component = {
|
||||
/* 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_1_0,
|
||||
|
||||
/* Component name and version */
|
||||
|
||||
@ -85,8 +85,7 @@ const mca_coll_base_component_1_0_0_t mca_coll_self_component = {
|
||||
/* Initialization / querying functions */
|
||||
|
||||
mca_coll_self_init_query,
|
||||
mca_coll_self_comm_query,
|
||||
NULL,
|
||||
mca_coll_self_comm_query
|
||||
};
|
||||
|
||||
|
||||
@ -101,3 +100,7 @@ static int self_open(void)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_coll_self_module_t,
|
||||
mca_coll_base_module_1_1_0_t,
|
||||
NULL, NULL);
|
||||
|
@ -32,7 +32,8 @@
|
||||
int mca_coll_self_exscan_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
/* Since there's only one process, there's nothing to do */
|
||||
|
||||
|
@ -34,7 +34,8 @@ int mca_coll_self_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
if (MPI_IN_PLACE == sbuf) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -34,7 +34,8 @@ int mca_coll_self_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
if (MPI_IN_PLACE == sbuf) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -29,38 +29,6 @@
|
||||
#include "coll_self.h"
|
||||
|
||||
|
||||
/*
|
||||
* Module
|
||||
*/
|
||||
static const mca_coll_base_module_1_0_0_t module = {
|
||||
|
||||
/* Initialization / finalization functions */
|
||||
|
||||
mca_coll_self_module_init,
|
||||
mca_coll_self_module_finalize,
|
||||
|
||||
/* Collective function pointers */
|
||||
|
||||
mca_coll_self_allgather_intra,
|
||||
mca_coll_self_allgatherv_intra,
|
||||
mca_coll_self_allreduce_intra,
|
||||
mca_coll_self_alltoall_intra,
|
||||
mca_coll_self_alltoallv_intra,
|
||||
mca_coll_self_alltoallw_intra,
|
||||
mca_coll_self_barrier_intra,
|
||||
mca_coll_self_bcast_intra,
|
||||
mca_coll_self_exscan_intra,
|
||||
mca_coll_self_gather_intra,
|
||||
mca_coll_self_gatherv_intra,
|
||||
mca_coll_self_reduce_intra,
|
||||
mca_coll_self_reduce_scatter_intra,
|
||||
mca_coll_self_scan_intra,
|
||||
mca_coll_self_scatter_intra,
|
||||
mca_coll_self_scatterv_intra,
|
||||
mca_coll_self_ft_event
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Initial query function that is invoked during MPI_INIT, allowing
|
||||
* this module to indicate what level of thread support it provides.
|
||||
@ -79,10 +47,12 @@ int mca_coll_self_init_query(bool enable_progress_threads,
|
||||
* 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_self_comm_query(struct ompi_communicator_t *comm, int *priority,
|
||||
struct mca_coll_base_comm_t **data)
|
||||
mca_coll_base_module_1_1_0_t *
|
||||
mca_coll_self_comm_query(struct ompi_communicator_t *comm,
|
||||
int *priority)
|
||||
{
|
||||
mca_coll_self_module_t *module;
|
||||
|
||||
/* We only work on intracommunicators of size 1 */
|
||||
|
||||
if (!OMPI_COMM_IS_INTER(comm) && 1 == ompi_comm_size(comm)) {
|
||||
@ -92,7 +62,29 @@ mca_coll_self_comm_query(struct ompi_communicator_t *comm, int *priority,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &module;
|
||||
module = OBJ_NEW(mca_coll_self_module_t);
|
||||
if (NULL == module) return NULL;
|
||||
|
||||
module->super.coll_module_enable = mca_coll_self_module_enable;
|
||||
module->super.ft_event = mca_coll_self_ft_event;
|
||||
module->super.coll_allgather = mca_coll_self_allgather_intra;
|
||||
module->super.coll_allgatherv = mca_coll_self_allgatherv_intra;
|
||||
module->super.coll_allreduce = mca_coll_self_allreduce_intra;
|
||||
module->super.coll_alltoall = mca_coll_self_alltoall_intra;
|
||||
module->super.coll_alltoallv = mca_coll_self_alltoallv_intra;
|
||||
module->super.coll_alltoallw = mca_coll_self_alltoallw_intra;
|
||||
module->super.coll_barrier = mca_coll_self_barrier_intra;
|
||||
module->super.coll_bcast = mca_coll_self_bcast_intra;
|
||||
module->super.coll_exscan = mca_coll_self_exscan_intra;
|
||||
module->super.coll_gather = mca_coll_self_gather_intra;
|
||||
module->super.coll_gatherv = mca_coll_self_gatherv_intra;
|
||||
module->super.coll_reduce = mca_coll_self_reduce_intra;
|
||||
module->super.coll_reduce_scatter = mca_coll_self_reduce_scatter_intra;
|
||||
module->super.coll_scan = mca_coll_self_scan_intra;
|
||||
module->super.coll_scatter = mca_coll_self_scatter_intra;
|
||||
module->super.coll_scatterv = mca_coll_self_scatterv_intra;
|
||||
|
||||
return &(module->super);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -102,23 +94,14 @@ mca_coll_self_comm_query(struct ompi_communicator_t *comm, int *priority,
|
||||
/*
|
||||
* Init module on the communicator
|
||||
*/
|
||||
const struct mca_coll_base_module_1_0_0_t *
|
||||
mca_coll_self_module_init(struct ompi_communicator_t *comm)
|
||||
{
|
||||
/* Don't really need to do anything */
|
||||
|
||||
return &module;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finalize module on the communicator
|
||||
*/
|
||||
int mca_coll_self_module_finalize(struct ompi_communicator_t *comm)
|
||||
int
|
||||
mca_coll_self_module_enable(struct mca_coll_base_module_1_1_0_t *module,
|
||||
struct ompi_communicator_t *comm)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int mca_coll_self_ft_event(int state) {
|
||||
if(OPAL_CRS_CHECKPOINT == state) {
|
||||
;
|
||||
|
@ -33,7 +33,8 @@
|
||||
int mca_coll_self_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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
if (MPI_IN_PLACE == sbuf) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -33,7 +33,8 @@
|
||||
int mca_coll_self_reduce_scatter_intra(void *sbuf, void *rbuf, int *rcounts,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
if (MPI_IN_PLACE == sbuf) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -33,7 +33,8 @@
|
||||
int mca_coll_self_scan_intra(void *sbuf, void *rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
if (MPI_IN_PLACE == sbuf) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -35,7 +35,8 @@ int mca_coll_self_scatter_intra(void *sbuf, int scount,
|
||||
void *rbuf, int rcount,
|
||||
struct ompi_datatype_t *rdtype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
if (MPI_IN_PLACE == rbuf) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -34,7 +34,8 @@ int mca_coll_self_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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
if (MPI_IN_PLACE == rbuf) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "ompi/mca/mpool/mpool.h"
|
||||
#include "ompi/mca/common/sm/common_sm_mmap.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/*
|
||||
* Horrid debugging macro
|
||||
*/
|
||||
@ -46,10 +48,6 @@
|
||||
# define SPIN SwitchToThread()
|
||||
#else /* no switch available */
|
||||
# define SPIN
|
||||
#endif
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -129,7 +127,7 @@ extern "C" {
|
||||
*/
|
||||
struct mca_coll_sm_component_t {
|
||||
/** Base coll component */
|
||||
mca_coll_base_component_1_0_0_t super;
|
||||
mca_coll_base_component_1_1_0_t super;
|
||||
|
||||
/** MCA parameter: Priority of this component */
|
||||
int sm_priority;
|
||||
@ -272,7 +270,7 @@ extern "C" {
|
||||
* into the data mpool for this comm's sm collective operations
|
||||
* area.
|
||||
*/
|
||||
struct mca_coll_base_comm_t {
|
||||
struct mca_coll_sm_comm_t {
|
||||
/** If this process is the one that invoked mpool_alloc() for
|
||||
the data segment, the return value will be in here.
|
||||
Otherwise, it will be NULL (i.e., only the allocating
|
||||
@ -326,8 +324,19 @@ extern "C" {
|
||||
/**
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct mca_coll_base_comm_t mca_coll_base_comm_t;
|
||||
|
||||
typedef struct mca_coll_sm_comm_t mca_coll_sm_comm_t;
|
||||
|
||||
|
||||
struct mca_coll_sm_module_t {
|
||||
mca_coll_base_module_1_1_0_t super;
|
||||
|
||||
mca_coll_sm_comm_t *sm_data;
|
||||
mca_coll_base_module_reduce_fn_t previous_reduce;
|
||||
mca_coll_base_module_1_1_0_t *previous_reduce_module;
|
||||
};
|
||||
typedef struct mca_coll_sm_module_t mca_coll_sm_module_t;
|
||||
OBJ_CLASS_DECLARATION(mca_coll_sm_module_t);
|
||||
|
||||
|
||||
/**
|
||||
* Global component instance
|
||||
@ -339,103 +348,114 @@ extern "C" {
|
||||
*/
|
||||
|
||||
int mca_coll_sm_init_query(bool enable_progress_threads,
|
||||
bool enable_mpi_threads);
|
||||
bool enable_mpi_threads);
|
||||
|
||||
const struct mca_coll_base_module_1_0_0_t *
|
||||
mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority,
|
||||
struct mca_coll_base_comm_t **data);
|
||||
|
||||
int mca_coll_sm_comm_unquery(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_comm_t *data);
|
||||
struct mca_coll_base_module_1_1_0_t *
|
||||
mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority);
|
||||
|
||||
int mca_coll_sm_bootstrap_finalize(void);
|
||||
|
||||
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);
|
||||
struct ompi_datatype_t *sdtype,
|
||||
void *rbuf, int rcount,
|
||||
struct ompi_datatype_t *rdtype,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
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);
|
||||
struct ompi_datatype_t *sdtype,
|
||||
void * rbuf, int *rcounts, int *disps,
|
||||
struct ompi_datatype_t *rdtype,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *sdtype,
|
||||
void* rbuf, int rcount,
|
||||
struct ompi_datatype_t *rdtype,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *sdtype,
|
||||
void *rbuf, int *rcounts, int *rdisps,
|
||||
struct ompi_datatype_t *rdtype,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t **sdtypes,
|
||||
void *rbuf, int *rcounts, int *rdisps,
|
||||
struct ompi_datatype_t **rdtypes,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_sm_barrier_intra(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_sm_bcast_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
int mca_coll_sm_bcast_log_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm);
|
||||
struct ompi_datatype_t *datatype,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *sdtype, void *rbuf,
|
||||
int rcount, struct ompi_datatype_t *rdtype,
|
||||
int root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *sdtype, void *rbuf,
|
||||
int *rcounts, int *disps,
|
||||
struct ompi_datatype_t *rdtype, int root,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
int root,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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 *rcounts,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *sdtype, void *rbuf,
|
||||
int rcount, struct ompi_datatype_t *rdtype,
|
||||
int root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
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);
|
||||
struct ompi_datatype_t *sdtype,
|
||||
void* rbuf, int rcount,
|
||||
struct ompi_datatype_t *rdtype, int root,
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
int mca_coll_sm_ft_event(int state);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Global variables used in the macros (essentially constants, so
|
||||
* these are thread safe)
|
||||
@ -567,4 +587,6 @@ extern uint32_t mca_coll_sm_iov_size;
|
||||
*ptr = 0; \
|
||||
} while (0)
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* MCA_COLL_SM_EXPORT_H */
|
||||
|
@ -32,7 +32,8 @@
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -33,7 +33,8 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -32,11 +32,12 @@
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = mca_coll_sm_reduce_intra(sbuf, rbuf, count, dtype, op, 0, comm);
|
||||
ret = mca_coll_sm_reduce_intra(sbuf, rbuf, count, dtype, op, 0, comm, module);
|
||||
return (ret == OMPI_SUCCESS) ?
|
||||
mca_coll_sm_bcast_intra(rbuf, count, dtype, 0, comm) : ret;
|
||||
mca_coll_sm_bcast_intra(rbuf, count, dtype, 0, comm, module) : ret;
|
||||
}
|
||||
|
@ -32,7 +32,8 @@
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -33,7 +33,8 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -33,7 +33,8 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -49,17 +49,19 @@
|
||||
* parent, and the leaves that have no children. But that's the
|
||||
* general idea.
|
||||
*/
|
||||
int mca_coll_sm_barrier_intra(struct ompi_communicator_t *comm)
|
||||
int mca_coll_sm_barrier_intra(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
int rank, buffer_set;
|
||||
mca_coll_base_comm_t *data;
|
||||
mca_coll_sm_comm_t *data;
|
||||
uint32_t i, num_children;
|
||||
volatile uint32_t *me_in, *me_out, *parent, *children = NULL;
|
||||
int uint_control_size;
|
||||
mca_coll_sm_module_t *sm_module = (mca_coll_sm_module_t*) module;
|
||||
|
||||
uint_control_size =
|
||||
mca_coll_sm_component.sm_control_size / sizeof(uint32_t);
|
||||
data = comm->c_coll_selected_data;
|
||||
data = sm_module->sm_data;
|
||||
rank = ompi_comm_rank(comm);
|
||||
num_children = data->mcb_tree[rank].mcstn_num_children;
|
||||
buffer_set = ((data->mcb_barrier_count++) % 2) * 2;
|
||||
|
@ -52,10 +52,12 @@
|
||||
*/
|
||||
int mca_coll_sm_bcast_intra(void *buff, int count,
|
||||
struct ompi_datatype_t *datatype, int root,
|
||||
struct ompi_communicator_t *comm)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
struct iovec iov;
|
||||
mca_coll_base_comm_t *data = comm->c_coll_selected_data;
|
||||
mca_coll_sm_module_t *sm_module = (mca_coll_sm_module_t*) module;
|
||||
mca_coll_sm_comm_t *data = sm_module->sm_data;
|
||||
int i, ret, rank, size, num_children, src_rank;
|
||||
int flag_num, segment_num, max_segment_num;
|
||||
int parent_rank;
|
||||
|
@ -53,17 +53,17 @@ static int sm_close(void);
|
||||
|
||||
mca_coll_sm_component_t mca_coll_sm_component = {
|
||||
|
||||
/* First, fill in the super (mca_coll_base_component_1_0_0_t) */
|
||||
/* First, fill in the super (mca_coll_base_component_1_1_0_t) */
|
||||
|
||||
{
|
||||
/* First, the mca_component_t struct containing meta
|
||||
information about the component itself */
|
||||
|
||||
{
|
||||
/* Indicate that we are a coll v1.0.0 component (which
|
||||
/* Indicate that we are a coll v1.1.0 component (which
|
||||
also implies a specific MCA version) */
|
||||
|
||||
MCA_COLL_BASE_VERSION_1_0_0,
|
||||
MCA_COLL_BASE_VERSION_1_1_0,
|
||||
|
||||
/* Component name and version */
|
||||
|
||||
@ -78,7 +78,7 @@ mca_coll_sm_component_t mca_coll_sm_component = {
|
||||
sm_close,
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
/* Next the MCA v1.1.0 component meta data */
|
||||
|
||||
{
|
||||
/* The component is not checkpoint ready */
|
||||
@ -89,7 +89,6 @@ mca_coll_sm_component_t mca_coll_sm_component = {
|
||||
|
||||
mca_coll_sm_init_query,
|
||||
mca_coll_sm_comm_query,
|
||||
mca_coll_sm_comm_unquery,
|
||||
},
|
||||
|
||||
/* sm-component specifc information */
|
||||
@ -284,3 +283,45 @@ static int sm_close(void)
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mca_coll_sm_module_construct(mca_coll_sm_module_t *module)
|
||||
{
|
||||
module->sm_data = NULL;
|
||||
module->previous_reduce_module = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
mca_coll_sm_module_destruct(mca_coll_sm_module_t *module)
|
||||
{
|
||||
mca_coll_sm_comm_t *data;
|
||||
|
||||
/* Free the space in the data mpool and the data hanging off the
|
||||
communicator */
|
||||
|
||||
data = module->sm_data;
|
||||
if (NULL != data) {
|
||||
/* If this was the process that allocated the space in the
|
||||
data mpool, then this is the process that frees it */
|
||||
|
||||
if (NULL != data->mcb_data_mpool_malloc_addr) {
|
||||
mca_coll_sm_component.sm_data_mpool->mpool_free(mca_coll_sm_component.sm_data_mpool,
|
||||
data->mcb_data_mpool_malloc_addr, NULL);
|
||||
}
|
||||
|
||||
/* Now free the data hanging off the communicator */
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
||||
if (NULL != module->previous_reduce_module) {
|
||||
OBJ_RELEASE(module->previous_reduce_module);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_coll_sm_module_t,
|
||||
mca_coll_base_module_1_1_0_t,
|
||||
mca_coll_sm_module_construct,
|
||||
mca_coll_sm_module_destruct);
|
||||
|
@ -32,7 +32,8 @@
|
||||
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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -32,7 +32,8 @@
|
||||
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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -33,7 +33,8 @@ 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)
|
||||
struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -62,12 +62,12 @@ uint32_t mca_coll_sm_iov_size = 1;
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
static const struct mca_coll_base_module_1_0_0_t *
|
||||
sm_module_init(struct ompi_communicator_t *comm);
|
||||
static int sm_module_finalize(struct ompi_communicator_t *comm);
|
||||
static int sm_module_enable(struct mca_coll_base_module_1_1_0_t *module,
|
||||
struct ompi_communicator_t *comm);
|
||||
static bool have_local_peers(ompi_group_t *group, size_t size);
|
||||
static int bootstrap_init(void);
|
||||
static int bootstrap_comm(ompi_communicator_t *comm);
|
||||
static int bootstrap_comm(ompi_communicator_t *comm,
|
||||
mca_coll_sm_module_t *module);
|
||||
|
||||
|
||||
/*
|
||||
@ -76,37 +76,6 @@ static int bootstrap_comm(ompi_communicator_t *comm);
|
||||
static bool bootstrap_inited = false;
|
||||
|
||||
|
||||
/*
|
||||
* Linear set of collective algorithms
|
||||
*/
|
||||
static const mca_coll_base_module_1_0_0_t module = {
|
||||
|
||||
/* Initialization / finalization functions */
|
||||
|
||||
sm_module_init,
|
||||
sm_module_finalize,
|
||||
|
||||
/* Collective function pointers */
|
||||
|
||||
NULL,
|
||||
NULL,
|
||||
mca_coll_sm_allreduce_intra,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
mca_coll_sm_barrier_intra,
|
||||
mca_coll_sm_bcast_intra,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
mca_coll_sm_reduce_intra,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
mca_coll_sm_ft_event
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Initial query function that is invoked during MPI_INIT, allowing
|
||||
@ -156,10 +125,11 @@ int mca_coll_sm_init_query(bool enable_progress_threads,
|
||||
* 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,
|
||||
struct mca_coll_base_comm_t **data)
|
||||
mca_coll_base_module_1_1_0_t *
|
||||
mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority)
|
||||
{
|
||||
mca_coll_sm_module_t *sm_module;
|
||||
|
||||
/* See if someone has previously lazily initialized and failed */
|
||||
|
||||
if (mca_coll_sm_component.sm_component_setup &&
|
||||
@ -190,31 +160,43 @@ mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority,
|
||||
*priority = mca_coll_sm_component.sm_priority;
|
||||
|
||||
/* All is good -- return a module */
|
||||
sm_module = OBJ_NEW(mca_coll_sm_module_t);
|
||||
|
||||
return &module;
|
||||
}
|
||||
sm_module->super.coll_module_enable = sm_module_enable;
|
||||
sm_module->super.ft_event = mca_coll_sm_ft_event;
|
||||
sm_module->super.coll_allgather = NULL;
|
||||
sm_module->super.coll_allgatherv = NULL;
|
||||
sm_module->super.coll_allreduce = mca_coll_sm_allreduce_intra;
|
||||
sm_module->super.coll_alltoall = NULL;
|
||||
sm_module->super.coll_alltoallv = NULL;
|
||||
sm_module->super.coll_alltoallw = NULL;
|
||||
sm_module->super.coll_barrier = mca_coll_sm_barrier_intra;
|
||||
sm_module->super.coll_bcast = mca_coll_sm_bcast_intra;
|
||||
sm_module->super.coll_exscan = NULL;
|
||||
sm_module->super.coll_gather = NULL;
|
||||
sm_module->super.coll_gatherv = NULL;
|
||||
sm_module->super.coll_reduce = mca_coll_sm_reduce_intra;
|
||||
sm_module->super.coll_reduce_scatter = NULL;
|
||||
sm_module->super.coll_scan = NULL;
|
||||
sm_module->super.coll_scatter = NULL;
|
||||
sm_module->super.coll_scatterv = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Unquery the coll on comm
|
||||
*/
|
||||
int mca_coll_sm_comm_unquery(struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_comm_t *data)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
return &(sm_module->super);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Init module on the communicator
|
||||
*/
|
||||
static const struct mca_coll_base_module_1_0_0_t *
|
||||
sm_module_init(struct ompi_communicator_t *comm)
|
||||
static int
|
||||
sm_module_enable(struct mca_coll_base_module_1_1_0_t *module,
|
||||
struct ompi_communicator_t *comm)
|
||||
{
|
||||
int i, j, root;
|
||||
int i, j, root, ret;
|
||||
int rank = ompi_comm_rank(comm);
|
||||
int size = ompi_comm_size(comm);
|
||||
mca_coll_base_comm_t *data = NULL;
|
||||
mca_coll_sm_module_t *sm_module = (mca_coll_sm_module_t*) module;
|
||||
mca_coll_sm_comm_t *data = NULL;
|
||||
size_t control_size, frag_size;
|
||||
mca_coll_sm_component_t *c = &mca_coll_sm_component;
|
||||
opal_maffinity_base_segment_t *maffinity;
|
||||
@ -222,6 +204,11 @@ sm_module_init(struct ompi_communicator_t *comm)
|
||||
char *base = NULL;
|
||||
const int num_barrier_buffers = 2;
|
||||
|
||||
if (NULL == sm_module->previous_reduce ||
|
||||
NULL == sm_module->previous_reduce_module) {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
/* Once-per-component setup. This may happen at any time --
|
||||
during MPI_INIT or later. So we must protect this with locks
|
||||
to ensure that only one thread in the process actually does
|
||||
@ -231,10 +218,10 @@ sm_module_init(struct ompi_communicator_t *comm)
|
||||
if (!mca_coll_sm_component.sm_component_setup) {
|
||||
mca_coll_sm_component.sm_component_setup = true;
|
||||
|
||||
if (OMPI_SUCCESS != bootstrap_init()) {
|
||||
if (OMPI_SUCCESS != (ret = bootstrap_init())) {
|
||||
mca_coll_sm_component.sm_component_setup_success = false;
|
||||
opal_atomic_unlock(&mca_coll_sm_component.sm_component_setup_lock);
|
||||
return NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Can we get an mpool allocation? See if there was one created
|
||||
@ -250,7 +237,7 @@ sm_module_init(struct ompi_communicator_t *comm)
|
||||
mca_coll_sm_bootstrap_finalize();
|
||||
mca_coll_sm_component.sm_component_setup_success = false;
|
||||
opal_atomic_unlock(&mca_coll_sm_component.sm_component_setup_lock);
|
||||
return NULL;
|
||||
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
|
||||
}
|
||||
mca_coll_sm_component.sm_data_mpool_created = true;
|
||||
} else {
|
||||
@ -264,7 +251,7 @@ sm_module_init(struct ompi_communicator_t *comm)
|
||||
we got in here */
|
||||
|
||||
if (!mca_coll_sm_component.sm_component_setup_success) {
|
||||
return NULL;
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
/* Get some space to setup memory affinity (just easier to try to
|
||||
@ -273,7 +260,7 @@ sm_module_init(struct ompi_communicator_t *comm)
|
||||
maffinity = (opal_maffinity_base_segment_t*)malloc(sizeof(opal_maffinity_base_segment_t) *
|
||||
c->sm_comm_num_segments * 3);
|
||||
if (NULL == maffinity) {
|
||||
return NULL;
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
/* Allocate data to hang off the communicator. The memory we
|
||||
@ -289,8 +276,8 @@ sm_module_init(struct ompi_communicator_t *comm)
|
||||
mca_coll_sm_tree_node_t
|
||||
*/
|
||||
|
||||
comm->c_coll_selected_data = data = (mca_coll_base_comm_t*)
|
||||
malloc(sizeof(mca_coll_base_comm_t) +
|
||||
sm_module->sm_data = data = (mca_coll_sm_comm_t*)
|
||||
malloc(sizeof(mca_coll_sm_comm_t) +
|
||||
(c->sm_comm_num_segments *
|
||||
sizeof(mca_coll_base_mpool_index_t)) +
|
||||
(size *
|
||||
@ -298,7 +285,7 @@ sm_module_init(struct ompi_communicator_t *comm)
|
||||
(sizeof(mca_coll_sm_tree_node_t*) * c->sm_tree_degree))));
|
||||
|
||||
if (NULL == data) {
|
||||
return NULL;
|
||||
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
|
||||
}
|
||||
data->mcb_data_mpool_malloc_addr = NULL;
|
||||
|
||||
@ -360,10 +347,10 @@ sm_module_init(struct ompi_communicator_t *comm)
|
||||
mpool that has been allocated among my peers for this
|
||||
communicator. */
|
||||
|
||||
if (OMPI_SUCCESS != bootstrap_comm(comm)) {
|
||||
if (OMPI_SUCCESS != (ret = bootstrap_comm(comm, sm_module))) {
|
||||
free(data);
|
||||
comm->c_coll_selected_data = NULL;
|
||||
return NULL;
|
||||
sm_module->sm_data = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Once the communicator is bootstrapped, setup the pointers into
|
||||
@ -474,40 +461,17 @@ sm_module_init(struct ompi_communicator_t *comm)
|
||||
c->sm_control_size);
|
||||
}
|
||||
|
||||
/* Save previous component's reduce informaation */
|
||||
sm_module->previous_reduce = comm->c_coll.coll_reduce;
|
||||
sm_module->previous_reduce_module = comm->c_coll.coll_reduce_module;
|
||||
OBJ_RETAIN(sm_module->previous_reduce_module);
|
||||
|
||||
/* All done */
|
||||
|
||||
return &module;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finalize module on the communicator
|
||||
*/
|
||||
static int sm_module_finalize(struct ompi_communicator_t *comm)
|
||||
{
|
||||
mca_coll_base_comm_t *data;
|
||||
|
||||
/* Free the space in the data mpool and the data hanging off the
|
||||
communicator */
|
||||
|
||||
data = comm->c_coll_selected_data;
|
||||
if (NULL != data) {
|
||||
/* If this was the process that allocated the space in the
|
||||
data mpool, then this is the process that frees it */
|
||||
|
||||
if (NULL != data->mcb_data_mpool_malloc_addr) {
|
||||
mca_coll_sm_component.sm_data_mpool->mpool_free(mca_coll_sm_component.sm_data_mpool,
|
||||
data->mcb_data_mpool_malloc_addr, NULL);
|
||||
}
|
||||
|
||||
/* Now free the data hanging off the communicator */
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static bool have_local_peers(ompi_group_t *group, size_t size)
|
||||
{
|
||||
size_t i;
|
||||
@ -597,14 +561,15 @@ static int bootstrap_init(void)
|
||||
}
|
||||
|
||||
|
||||
static int bootstrap_comm(ompi_communicator_t *comm)
|
||||
static int bootstrap_comm(ompi_communicator_t *comm,
|
||||
mca_coll_sm_module_t *module)
|
||||
{
|
||||
int i, empty_index, err;
|
||||
bool found;
|
||||
mca_coll_sm_component_t *c = &mca_coll_sm_component;
|
||||
mca_coll_sm_bootstrap_header_extension_t *bshe;
|
||||
mca_coll_sm_bootstrap_comm_setup_t *bscs;
|
||||
mca_coll_base_comm_t *data = comm->c_coll_selected_data;
|
||||
mca_coll_sm_comm_t *data = module->sm_data;
|
||||
int comm_size = ompi_comm_size(comm);
|
||||
int num_segments = c->sm_comm_num_segments;
|
||||
int num_in_use = c->sm_comm_num_in_use_flags;
|
||||
@ -767,7 +732,6 @@ static int bootstrap_comm(ompi_communicator_t *comm)
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This function is not static and has a prefix-rule-enabled name
|
||||
* because it gets called from the component (but may also be called
|
||||
|
@ -33,13 +33,15 @@
|
||||
static int reduce_inorder(void *sbuf, void* rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
int root, struct ompi_communicator_t *comm);
|
||||
int root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
#define WANT_REDUCE_NO_ORDER 0
|
||||
#if WANT_REDUCE_NO_ORDER
|
||||
static int reduce_no_order(void *sbuf, void* rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
int root, struct ompi_communicator_t *comm);
|
||||
int root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -60,9 +62,11 @@ static inline int min(int a, int b)
|
||||
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 root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
size_t size;
|
||||
mca_coll_sm_module_t *sm_module = (mca_coll_sm_module_t*) module;
|
||||
|
||||
/* There are several possibilities:
|
||||
*
|
||||
@ -78,20 +82,21 @@ int mca_coll_sm_reduce_intra(void *sbuf, void* rbuf, int count,
|
||||
|
||||
ompi_ddt_type_size(dtype, &size);
|
||||
if ((int)size > mca_coll_sm_component.sm_control_size) {
|
||||
return comm->c_coll_basic_module->coll_reduce(sbuf, rbuf, count,
|
||||
dtype, op, root, comm);
|
||||
return sm_module->previous_reduce(sbuf, rbuf, count,
|
||||
dtype, op, root, comm,
|
||||
sm_module->previous_reduce_module);
|
||||
}
|
||||
#if WANT_REDUCE_NO_ORDER
|
||||
else if (!ompi_op_is_intrinsic(op) ||
|
||||
(ompi_op_is_intrinsic(op) && !ompi_op_is_float_assoc(op) &&
|
||||
0 != (dtype->flags & DT_FLAG_DATA_FLOAT))) {
|
||||
return reduce_inorder(sbuf, rbuf, count, dtype, op, root, comm);
|
||||
return reduce_inorder(sbuf, rbuf, count, dtype, op, root, comm, module);
|
||||
} else {
|
||||
return reduce_no_order(sbuf, rbuf, count, dtype, op, root, comm);
|
||||
return reduce_no_order(sbuf, rbuf, count, dtype, op, root, comm, module);
|
||||
}
|
||||
#else
|
||||
else {
|
||||
return reduce_inorder(sbuf, rbuf, count, dtype, op, root, comm);
|
||||
return reduce_inorder(sbuf, rbuf, count, dtype, op, root, comm, module);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -140,10 +145,12 @@ int mca_coll_sm_reduce_intra(void *sbuf, void* rbuf, int count,
|
||||
static int reduce_inorder(void *sbuf, void* rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
int root, struct ompi_communicator_t *comm)
|
||||
int root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
struct iovec iov;
|
||||
mca_coll_base_comm_t *data = comm->c_coll_selected_data;
|
||||
mca_coll_sm_module_t *sm_module = (mca_coll_sm_module_t*) module;
|
||||
mca_coll_sm_comm_t *data = sm_module->sm_data;
|
||||
int ret, rank, size;
|
||||
int flag_num, segment_num, max_segment_num;
|
||||
size_t total_size, max_data, bytes;
|
||||
@ -494,7 +501,8 @@ static int reduce_inorder(void *sbuf, void* rbuf, int count,
|
||||
static int reduce_no_order(void *sbuf, void* rbuf, int count,
|
||||
struct ompi_datatype_t *dtype,
|
||||
struct ompi_op_t *op,
|
||||
int root, struct ompi_communicator_t *comm)
|
||||
int root, struct ompi_communicator_t *comm,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче
Block a user