+++ /dev/null
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SMPI_INTERFACE_H
-#define SMPI_INTERFACE_H
-#include "smpi/smpi.h"
-
-SG_BEGIN_DECL()
-
-/** \brief MPI collective description */
-
-struct mpi_coll_description {
- const char *name;
- const char *description;
- void *coll;
-};
-typedef struct mpi_coll_description s_mpi_coll_description_t;
-typedef struct mpi_coll_description* mpi_coll_description_t;
-
-/** \ingroup MPI gather
- * \brief The list of all available allgather collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_gather_description[];
-
-/** \ingroup MPI allgather
- * \brief The list of all available allgather collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_allgather_description[];
-
-/** \ingroup MPI allgather
- * \brief The list of all available allgather collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_allgatherv_description[];
-
-/** \ingroup MPI allreduce
- * \brief The list of all available allgather collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_allreduce_description[];
-
-/** \ingroup MPI alltoall
- * \brief The list of all available alltoall collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_alltoall_description[];
-
-/** \ingroup MPI alltoallv
- * \brief The list of all available alltoallv collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_alltoallv_description[];
-
-/** \ingroup MPI bcast
- * \brief The list of all available bcast collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_bcast_description[];
-
-/** \ingroup MPI reduce
- * \brief The list of all available reduce collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_reduce_description[];
-
-/** \ingroup MPI reduce_scatter
- * \brief The list of all available allgather collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_reduce_scatter_description[];
-
-/** \ingroup MPI scatter
- * \brief The list of all available allgather collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_scatter_description[];
-
-/** \ingroup MPI barrier
- * \brief The list of all available allgather collectives
- */
-XBT_PUBLIC_DATA(s_mpi_coll_description_t) mpi_coll_barrier_description[];
-XBT_PUBLIC_DATA(int (*mpi_coll_barrier_fun)(MPI_Comm comm));
-
-XBT_PUBLIC(void) coll_help(const char *category, s_mpi_coll_description_t * table);
-XBT_PUBLIC(int) find_coll_description(s_mpi_coll_description_t * table, const char *name, const char *desc);
-
-XBT_PUBLIC_DATA(void) (*smpi_coll_cleanup_callback)();
-XBT_PUBLIC(void) smpi_coll_cleanup_mvapich2(void);
-
-SG_END_DECL()
-
-#endif
#include "simgrid/simix.h"
#include "simgrid/sg_config.h"
#include "simgrid_config.h" /* what was compiled in? */
-#if HAVE_SMPI
-#include "smpi/smpi_interface.h"
-#endif
#include "mc/mc.h"
#include "simgrid/instr.h"
#include "src/mc/mc_replay.h"
/* New Module missing */
find_model_description(surf_network_model_description, val);
}
-
-#if HAVE_SMPI
-/* callback of the mpi collectives: simply check that this is a valid name. It will be picked up in smpi_global.cpp */
-static void _check_coll(const char *category,
- s_mpi_coll_description_t * table,
- const char *name)
-{
- xbt_assert(_sg_cfg_init_status < 2, "Cannot change the collective algorithm after the initialization");
-
- char *val = xbt_cfg_get_string(name);
- if (val && !strcmp(val, "help")) {
- coll_help(category, table);
- sg_cfg_exit_early();
- }
-
- find_coll_description(table, val, category);
-}
-static void _check_coll_gather(const char *name){
- _check_coll("gather", mpi_coll_gather_description, name);
-}
-static void _check_coll_allgather(const char *name){
- _check_coll("allgather", mpi_coll_allgather_description, name);
-}
-static void _check_coll_allgatherv(const char *name){
- _check_coll("allgatherv", mpi_coll_allgatherv_description, name);
-}
-static void _check_coll_allreduce(const char *name)
-{
- _check_coll("allreduce", mpi_coll_allreduce_description, name);
-}
-static void _check_coll_alltoall(const char *name)
-{
- _check_coll("alltoall", mpi_coll_alltoall_description, name);
-}
-static void _check_coll_alltoallv(const char *name)
-{
- _check_coll("alltoallv", mpi_coll_alltoallv_description, name);
-}
-static void _check_coll_bcast(const char *name)
-{
- _check_coll("bcast", mpi_coll_bcast_description, name);
-}
-static void _check_coll_reduce(const char *name)
-{
- _check_coll("reduce", mpi_coll_reduce_description, name);
-}
-static void _check_coll_reduce_scatter(const char *name){
- _check_coll("reduce_scatter", mpi_coll_reduce_scatter_description, name);
-}
-static void _check_coll_scatter(const char *name){
- _check_coll("scatter", mpi_coll_scatter_description, name);
-}
-static void _check_coll_barrier(const char *name){
- _check_coll("barrier", mpi_coll_barrier_description, name);
-}
-
-#endif
-
/* callback to decide if we want to use the model-checking */
#include "src/xbt_modinter.h"
xbt_cfg_register_string("smpi/coll-selector", "default", nullptr, "Which collective selector to use");
xbt_cfg_register_alias("smpi/coll-selector","smpi/coll_selector");
- xbt_cfg_register_string("smpi/gather", nullptr, &_check_coll_gather, "Which collective to use for gather");
- xbt_cfg_register_string("smpi/allgather", nullptr, &_check_coll_allgather, "Which collective to use for allgather");
- xbt_cfg_register_string("smpi/barrier", nullptr, &_check_coll_barrier, "Which collective to use for barrier");
- xbt_cfg_register_string("smpi/reduce-scatter",nullptr, &_check_coll_reduce_scatter, "Which collective to use for reduce_scatter");
+ xbt_cfg_register_string("smpi/gather", nullptr, nullptr, "Which collective to use for gather");
+ xbt_cfg_register_string("smpi/allgather", nullptr, nullptr, "Which collective to use for allgather");
+ xbt_cfg_register_string("smpi/barrier", nullptr, nullptr, "Which collective to use for barrier");
+ xbt_cfg_register_string("smpi/reduce-scatter",nullptr, nullptr, "Which collective to use for reduce_scatter");
xbt_cfg_register_alias("smpi/reduce-scatter","smpi/reduce_scatter");
- xbt_cfg_register_string("smpi/scatter", nullptr, &_check_coll_scatter, "Which collective to use for scatter");
- xbt_cfg_register_string("smpi/allgatherv", nullptr, &_check_coll_allgatherv, "Which collective to use for allgatherv");
- xbt_cfg_register_string("smpi/allreduce", nullptr, &_check_coll_allreduce, "Which collective to use for allreduce");
- xbt_cfg_register_string("smpi/alltoall", nullptr, &_check_coll_alltoall, "Which collective to use for alltoall");
- xbt_cfg_register_string("smpi/alltoallv", nullptr, &_check_coll_alltoallv,"Which collective to use for alltoallv");
- xbt_cfg_register_string("smpi/bcast", nullptr, &_check_coll_bcast, "Which collective to use for bcast");
- xbt_cfg_register_string("smpi/reduce", nullptr, &_check_coll_reduce, "Which collective to use for reduce");
+ xbt_cfg_register_string("smpi/scatter", nullptr, nullptr, "Which collective to use for scatter");
+ xbt_cfg_register_string("smpi/allgatherv", nullptr, nullptr, "Which collective to use for allgatherv");
+ xbt_cfg_register_string("smpi/allreduce", nullptr, nullptr, "Which collective to use for allreduce");
+ xbt_cfg_register_string("smpi/alltoall", nullptr, nullptr, "Which collective to use for alltoall");
+ xbt_cfg_register_string("smpi/alltoallv", nullptr, nullptr,"Which collective to use for alltoallv");
+ xbt_cfg_register_string("smpi/bcast", nullptr, nullptr, "Which collective to use for bcast");
+ xbt_cfg_register_string("smpi/reduce", nullptr, nullptr, "Which collective to use for reduce");
#endif // HAVE_SMPI
/* Storage */
+++ /dev/null
-/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SMPI_COLLS_H
-#define SMPI_COLLS_H
-
-#include <math.h>
-#include "smpi/mpi.h"
-#include "src/smpi/private.h"
-#include "xbt/ex.h"
-#include "xbt.h"
-
-SG_BEGIN_DECL()
-
-
-namespace simgrid{
-namespace smpi{
-
-#define COLL_DESCRIPTION(cat, ret, args, name) \
- {# name,\
- # cat " " # name " collective",\
- (void*) Coll_ ## cat ## _ ## name::cat }
-
-#define COLL_PROTO(cat, ret, args, name) \
-class Coll_ ## cat ## _ ## name : public Coll_ ## cat { \
-public: \
-static ret cat (COLL_UNPAREN args); \
-};
-
-#define COLL_UNPAREN(...) __VA_ARGS__
-
-#define COLL_APPLY(action, sig, name) action(sig, name)
-#define COLL_COMMA ,
-#define COLL_NOsep
-#define COLL_NOTHING(...)
-
-/*************
- * GATHER *
- *************/
-
-#define COLL_GATHER_SIG gather, int, \
- (void *send_buff, int send_count, MPI_Datatype send_type, \
- void *recv_buff, int recv_count, MPI_Datatype recv_type, \
- int root, MPI_Comm comm)
-
-#define COLL_GATHERS(action, COLL_sep) \
-COLL_APPLY(action, COLL_GATHER_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, ompi_basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, ompi_binomial) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, ompi_linear_sync) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, mvapich2_two_level) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, automatic)
-
-COLL_GATHERS(COLL_PROTO, COLL_NOsep)
-
-/*************
- * ALLGATHER *
- *************/
-#define COLL_ALLGATHER_SIG allgather, int, \
- (void *send_buff, int send_count, MPI_Datatype send_type, \
- void *recv_buff, int recv_count, MPI_Datatype recv_type, \
- MPI_Comm comm)
-
-#define COLL_ALLGATHERS(action, COLL_sep) \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, 2dmesh) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, 3dmesh) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, bruck) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, GB) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, loosely_lr) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, NTSLR) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, NTSLR_NB) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, pair) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, rhv) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, ring) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, SMP_NTS) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, smp_simple) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, spreading_simple) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, ompi_neighborexchange) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, mvapich2_smp) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, automatic)
-
-COLL_ALLGATHERS(COLL_PROTO, COLL_NOsep)
-
-/**************
- * ALLGATHERV *
- **************/
-#define COLL_ALLGATHERV_SIG allgatherv, int, \
- (void *send_buff, int send_count, MPI_Datatype send_type, \
- void *recv_buff, int *recv_count, int *recv_disps, \
- MPI_Datatype recv_type, MPI_Comm comm)
-
-#define COLL_ALLGATHERVS(action, COLL_sep) \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, GB) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, pair) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, ring) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi_neighborexchange) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi_bruck) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich_rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich_ring) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, automatic)
-
-COLL_ALLGATHERVS(COLL_PROTO, COLL_NOsep)
-
-/*************
- * ALLREDUCE *
- *************/
-#define COLL_ALLREDUCE_SIG allreduce, int, \
- (void *sbuf, void *rbuf, int rcount, \
- MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
-
-#define COLL_ALLREDUCES(action, COLL_sep) \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, lr) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab1) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab2) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab_rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_binomial) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_binomial_pipeline) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rsag) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rsag_lr) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rsag_rab) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, redbcast) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, ompi_ring_segmented) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, mvapich2_rs) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, mvapich2_two_level) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, automatic)
-
-COLL_ALLREDUCES(COLL_PROTO, COLL_NOsep)
-
-/************
- * ALLTOALL *
- ************/
-#define COLL_ALLTOALL_SIG alltoall, int, \
- (void *send_buff, int send_count, MPI_Datatype send_type, \
- void *recv_buff, int recv_count, MPI_Datatype recv_type, \
- MPI_Comm comm)
-
-#define COLL_ALLTOALLS(action, COLL_sep) \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, 2dmesh) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, 3dmesh) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, bruck) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, pair) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_rma) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_light_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_mpi_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_one_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, ring) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_light_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_mpi_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_one_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, mvapich2_scatter_dest) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, automatic)
-
-COLL_ALLTOALLS(COLL_PROTO, COLL_NOsep)
-
-/*************
- * ALLTOALLV *
- *************/
-#define COLL_ALLTOALLV_SIG alltoallv, int, \
- (void *send_buff, int *send_counts, int *send_disps, MPI_Datatype send_type, \
- void *recv_buff, int *recv_counts, int *recv_disps, MPI_Datatype recv_type, \
- MPI_Comm comm)
-
-#define COLL_ALLTOALLVS(action, COLL_sep) \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, bruck) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair_light_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair_mpi_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair_one_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_light_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_mpi_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_one_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ompi_basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, automatic)
-
-COLL_ALLTOALLVS(COLL_PROTO, COLL_NOsep)
-
-/*********
- * BCAST *
- *********/
-#define COLL_BCAST_SIG bcast, int, \
- (void *buf, int count, MPI_Datatype datatype, \
- int root, MPI_Comm comm)
-
-#define COLL_BCASTS(action, COLL_sep) \
-COLL_APPLY(action, COLL_BCAST_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, arrival_pattern_aware) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, arrival_pattern_aware_wait) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, arrival_scatter) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, binomial_tree) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, flattree) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, flattree_pipeline) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, NTSB) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, NTSL) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, NTSL_Isend) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, scatter_LR_allgather) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, scatter_rdb_allgather) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, SMP_binary) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, SMP_binomial) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, SMP_linear) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, ompi_split_bintree) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, ompi_pipeline) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mvapich2_inter_node) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mvapich2_intra_node) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mvapich2_knomial_intra_node) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, automatic)
-
-COLL_BCASTS(COLL_PROTO, COLL_NOsep)
-
-
-/**********
- * REDUCE *
- **********/
-#define COLL_REDUCE_SIG reduce, int, \
- (void *buf, void *rbuf, int count, MPI_Datatype datatype, \
- MPI_Op op, int root, MPI_Comm comm)
-
-#define COLL_REDUCES(action, COLL_sep) \
-COLL_APPLY(action, COLL_REDUCE_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, arrival_pattern_aware) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, binomial) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, flat_tree) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, NTSL) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, scatter_gather) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_chain) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_pipeline) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_in_order_binary) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_binary) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_binomial) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, mvapich2_knomial) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, mvapich2_two_level) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, rab) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, automatic)
-
-COLL_REDUCES(COLL_PROTO, COLL_NOsep)
-
-/*************
- * REDUCE_SCATTER *
- *************/
-#define COLL_REDUCE_SCATTER_SIG reduce_scatter, int, \
- (void *sbuf, void *rbuf, int *rcounts,\
- MPI_Datatype dtype,MPI_Op op,MPI_Comm comm)
-
-#define COLL_REDUCE_SCATTERS(action, COLL_sep) \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, ompi_basic_recursivehalving) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, ompi_ring) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_pair) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_rdb) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_noncomm) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, automatic)
-
-
-
-COLL_REDUCE_SCATTERS(COLL_PROTO, COLL_NOsep)
-
-
-/*************
- * SCATTER *
- *************/
-#define COLL_SCATTER_SIG scatter, int, \
- (void *sendbuf, int sendcount, MPI_Datatype sendtype,\
- void *recvbuf, int recvcount, MPI_Datatype recvtype,\
- int root, MPI_Comm comm)
-
-#define COLL_SCATTERS(action, COLL_sep) \
-COLL_APPLY(action, COLL_SCATTER_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, ompi_basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, ompi_binomial) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, mvapich2_two_level_binomial) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, mvapich2_two_level_direct) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, automatic)
-
-COLL_SCATTERS(COLL_PROTO, COLL_NOsep)
-
-/*************
- * SCATTER *
- *************/
-#define COLL_BARRIER_SIG barrier, int, \
- (MPI_Comm comm)
-
-#define COLL_BARRIERS(action, COLL_sep) \
-COLL_APPLY(action, COLL_BARRIER_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_two_procs) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_tree) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_bruck) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_recursivedoubling) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_doublering) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, mvapich2_pair) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, automatic)
-
-COLL_BARRIERS(COLL_PROTO, COLL_NOsep)
-
-}
-}
-
-SG_END_DECL()
-
-#endif
#ifndef SMPI_COLLS_PRIVATE_H
#define SMPI_COLLS_PRIVATE_H
-#include "colls.h"
+#include <math.h>
+#include "smpi/mpi.h"
+#include "src/smpi/private.h"
+#include "xbt/ex.h"
+#include "xbt.h"
+#include "../smpi_coll.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_colls);
}\
char cont_name[25];\
snprintf(cont_name,25, "rank-%d", smpi_process_index());\
- val_t value = PJ_value_get_or_new(mpi_coll_##cat##_description[i].name,"1.0 1.0 1.0", type);\
+ val_t value = PJ_value_get_or_new(Colls::mpi_coll_##cat##_description[i].name,"1.0 1.0 1.0", type);\
new_pajeNewEvent (SIMIX_get_clock(), PJ_container_get(cont_name), type, value);\
}
int min_coll=-1, global_coll=-1;\
int i;\
double buf_in, buf_out, max_min=DBL_MAX;\
- for (i = 0; mpi_coll_##cat##_description[i].name; i++){\
- if(!strcmp(mpi_coll_##cat##_description[i].name, "automatic"))continue;\
- if(!strcmp(mpi_coll_##cat##_description[i].name, "default"))continue;\
+ for (i = 0; Colls::mpi_coll_##cat##_description[i].name; i++){\
+ if(!strcmp(Colls::mpi_coll_##cat##_description[i].name, "automatic"))continue;\
+ if(!strcmp(Colls::mpi_coll_##cat##_description[i].name, "default"))continue;\
Coll_barrier_default::barrier(comm);\
TRACE_AUTO_COLL(cat)\
time1 = SIMIX_get_clock();\
try {\
((int (*) args)\
- mpi_coll_##cat##_description[i].coll) args2 ;\
+ Colls::mpi_coll_##cat##_description[i].coll) args2 ;\
}\
catch (std::exception& ex) {\
continue;\
}\
}\
if(comm->rank()==0){\
- XBT_WARN("For rank 0, the quickest was %s : %f , but global was %s : %f at max",mpi_coll_##cat##_description[min_coll].name, time_min,mpi_coll_##cat##_description[global_coll].name, max_min);\
+ XBT_WARN("For rank 0, the quickest was %s : %f , but global was %s : %f at max",Colls::mpi_coll_##cat##_description[min_coll].name, time_min,Colls::mpi_coll_##cat##_description[global_coll].name, max_min);\
}else\
- XBT_WARN("The quickest %s was %s on rank %d and took %f",#cat,mpi_coll_##cat##_description[min_coll].name, comm->rank(), time_min);\
+ XBT_WARN("The quickest %s was %s on rank %d and took %f",#cat,Colls::mpi_coll_##cat##_description[min_coll].name, comm->rank(), time_min);\
return (min_coll!=-1)?MPI_SUCCESS:MPI_ERR_INTERN;\
}
using namespace simgrid::smpi;
+XBT_PUBLIC(void) smpi_coll_cleanup_mvapich2(void);
+
typedef struct {
int min;
int max;
int agg_table_sum = 0;
mv2_alltoall_tuning_table **table_ptrs = NULL;
mv2_alltoall_num_ppn_conf = 3;
- if(smpi_coll_cleanup_callback==NULL)
- smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+ if(Colls::smpi_coll_cleanup_callback==NULL)
+ Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
mv2_alltoall_thresholds_table = static_cast<mv2_alltoall_tuning_table**>(xbt_malloc(sizeof(mv2_alltoall_tuning_table *)
* mv2_alltoall_num_ppn_conf));
table_ptrs = static_cast<mv2_alltoall_tuning_table**>(xbt_malloc(sizeof(mv2_alltoall_tuning_table *)
int i;
int agg_table_sum = 0;
- if(smpi_coll_cleanup_callback==NULL)
- smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+ if(Colls::smpi_coll_cleanup_callback==NULL)
+ Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
mv2_allgather_tuning_table **table_ptrs = NULL;
mv2_allgather_num_ppn_conf = 3;
mv2_allgather_thresholds_table
static void init_mv2_gather_tables_stampede(){
- if(smpi_coll_cleanup_callback==NULL)
- smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+ if(Colls::smpi_coll_cleanup_callback==NULL)
+ Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
mv2_size_gather_tuning_table=7;
mv2_gather_thresholds_table = static_cast<mv2_gather_tuning_table*>(xbt_malloc(mv2_size_gather_tuning_table*
sizeof (mv2_gather_tuning_table)));
static void init_mv2_allgatherv_tables_stampede(){
- if(smpi_coll_cleanup_callback==NULL)
- smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+ if(Colls::smpi_coll_cleanup_callback==NULL)
+ Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
mv2_size_allgatherv_tuning_table = 6;
mv2_allgatherv_thresholds_table = static_cast<mv2_allgatherv_tuning_table*>(xbt_malloc(mv2_size_allgatherv_tuning_table *
sizeof (mv2_allgatherv_tuning_table)));
static void init_mv2_allreduce_tables_stampede(){
- if(smpi_coll_cleanup_callback==NULL)
- smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+ if(Colls::smpi_coll_cleanup_callback==NULL)
+ Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
mv2_size_allreduce_tuning_table = 8;
mv2_allreduce_thresholds_table = static_cast<mv2_allreduce_tuning_table*>(xbt_malloc(mv2_size_allreduce_tuning_table *
sizeof (mv2_allreduce_tuning_table)));
static void init_mv2_bcast_tables_stampede(){
//Stampede,
- if(smpi_coll_cleanup_callback==NULL)
- smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+ if(Colls::smpi_coll_cleanup_callback==NULL)
+ Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
mv2_size_bcast_tuning_table=8;
mv2_bcast_thresholds_table = static_cast<mv2_bcast_tuning_table*>(xbt_malloc(mv2_size_bcast_tuning_table *
sizeof (mv2_bcast_tuning_table)));
static void init_mv2_reduce_tables_stampede(){
- if(smpi_coll_cleanup_callback==NULL)
- smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+ if(Colls::smpi_coll_cleanup_callback==NULL)
+ Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
/*Stampede*/
mv2_size_reduce_tuning_table = 8;
mv2_reduce_thresholds_table = static_cast<mv2_reduce_tuning_table*>(xbt_malloc(mv2_size_reduce_tuning_table *
static void init_mv2_reduce_scatter_tables_stampede(){
- if(smpi_coll_cleanup_callback==NULL)
- smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+ if(Colls::smpi_coll_cleanup_callback==NULL)
+ Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
mv2_size_red_scat_tuning_table = 6;
mv2_red_scat_thresholds_table = static_cast<mv2_red_scat_tuning_table*>(xbt_malloc(mv2_size_red_scat_tuning_table *
sizeof (mv2_red_scat_tuning_table)));
static void init_mv2_scatter_tables_stampede(){
- if(smpi_coll_cleanup_callback==NULL)
- smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+ if(Colls::smpi_coll_cleanup_callback==NULL)
+ Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
int agg_table_sum = 0;
int i;
#include "simgrid/simix.h"
#include "smpi/smpi.h"
-#include "src/include/smpi/smpi_interface.h"
#include "src/instr/instr_private.h"
#include "src/internal_config.h"
#include "xbt.h"
#include "surf/surf.h"
#include "simgrid/sg_config.h"
#include "smpi/smpi_utils.hpp"
-#include "colls/colls.h"
#include <simgrid/s4u/host.hpp>
#include "src/kernel/activity/SynchroComm.hpp"
#include <assert.h>
#include "private.h"
-#include "colls/colls.h"
#include "simgrid/sg_config.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi, "Logging specific to SMPI (coll)");
-s_mpi_coll_description_t mpi_coll_gather_description[] = {
- COLL_GATHERS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */
-};
-
-s_mpi_coll_description_t mpi_coll_allgather_description[] = {
- COLL_ALLGATHERS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr}
-};
-
-s_mpi_coll_description_t mpi_coll_allgatherv_description[] = { COLL_ALLGATHERVS(COLL_DESCRIPTION, COLL_COMMA),
- {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */
-};
-
-s_mpi_coll_description_t mpi_coll_allreduce_description[] ={ COLL_ALLREDUCES(COLL_DESCRIPTION, COLL_COMMA),
- {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */
-};
-
-s_mpi_coll_description_t mpi_coll_reduce_scatter_description[] = {COLL_REDUCE_SCATTERS(COLL_DESCRIPTION, COLL_COMMA),
- {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */
-};
-
-s_mpi_coll_description_t mpi_coll_scatter_description[] ={COLL_SCATTERS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr}};
-
-s_mpi_coll_description_t mpi_coll_barrier_description[] ={COLL_BARRIERS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr}};
-
-s_mpi_coll_description_t mpi_coll_alltoall_description[] = {COLL_ALLTOALLS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr}};
-
-s_mpi_coll_description_t mpi_coll_alltoallv_description[] = {COLL_ALLTOALLVS(COLL_DESCRIPTION, COLL_COMMA),
- {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */
-};
-
-s_mpi_coll_description_t mpi_coll_bcast_description[] = {COLL_BCASTS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr}};
-
-s_mpi_coll_description_t mpi_coll_reduce_description[] = {COLL_REDUCES(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+namespace simgrid{
+namespace smpi{
+void (*Colls::smpi_coll_cleanup_callback)();
+
+/* these arrays must be nullptr terminated */
+s_mpi_coll_description_t Colls::mpi_coll_gather_description[] = {
+ COLL_GATHERS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+s_mpi_coll_description_t Colls::mpi_coll_allgather_description[] = {
+ COLL_ALLGATHERS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+s_mpi_coll_description_t Colls::mpi_coll_allgatherv_description[] = {
+ COLL_ALLGATHERVS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+s_mpi_coll_description_t Colls::mpi_coll_allreduce_description[] ={
+ COLL_ALLREDUCES(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+s_mpi_coll_description_t Colls::mpi_coll_reduce_scatter_description[] = {
+ COLL_REDUCE_SCATTERS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+s_mpi_coll_description_t Colls::mpi_coll_scatter_description[] ={
+ COLL_SCATTERS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+s_mpi_coll_description_t Colls::mpi_coll_barrier_description[] ={
+ COLL_BARRIERS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+s_mpi_coll_description_t Colls::mpi_coll_alltoall_description[] = {
+ COLL_ALLTOALLS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+s_mpi_coll_description_t Colls::mpi_coll_alltoallv_description[] = {
+ COLL_ALLTOALLVS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+s_mpi_coll_description_t Colls::mpi_coll_bcast_description[] = {
+ COLL_BCASTS(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
+s_mpi_coll_description_t Colls::mpi_coll_reduce_description[] = {
+ COLL_REDUCES(COLL_DESCRIPTION, COLL_COMMA), {nullptr, nullptr, nullptr} };
/** Displays the long description of all registered models, and quit */
-void coll_help(const char *category, s_mpi_coll_description_t * table)
+void Colls::coll_help(const char *category, s_mpi_coll_description_t * table)
{
printf("Long description of the %s models accepted by this simulator:\n", category);
for (int i = 0; table[i].name; i++)
printf(" %s: %s\n", table[i].name, table[i].description);
}
-int find_coll_description(s_mpi_coll_description_t * table, const char *name, const char *desc)
+int Colls::find_coll_description(s_mpi_coll_description_t * table, const char *name, const char *desc)
{
char *name_list = nullptr;
- int selector_on=0;
- if (name==nullptr || name[0] == '\0') {
- //no argument provided, use active selector's algorithm
- name=static_cast<char*>(xbt_cfg_get_string("smpi/coll-selector"));
- selector_on=1;
- }
for (int i = 0; table[i].name; i++)
if (!strcmp(name, table[i].name)) {
if (strcmp(table[i].name,"default"))
return i;
}
- if(selector_on){
- // collective seems not handled by the active selector, try with default one
- for (int i = 0; table[i].name; i++)
- if (!strcmp("default", table[i].name)) {
- return i;
- }
- }
if (!table[0].name)
xbt_die("No collective is valid for '%s'! This is a bug.",name);
name_list = xbt_strdup(table[0].name);
return -1;
}
-void (*smpi_coll_cleanup_callback)();
-
-namespace simgrid{
-namespace smpi{
-
-int (*Colls::gather)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, int root, MPI_Comm);
-int (*Colls::allgather)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
-int (*Colls::allgatherv)(void *, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm);
-int (*Colls::allreduce)(void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm);
-int (*Colls::alltoall)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
-int (*Colls::alltoallv)(void *, int*, int*, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm);
-int (*Colls::bcast)(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm com);
-int (*Colls::reduce)(void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
-int (*Colls::reduce_scatter)(void *sbuf, void *rbuf, int *rcounts,MPI_Datatype dtype,MPI_Op op,MPI_Comm comm);
-int (*Colls::scatter)(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,int root, MPI_Comm comm);
-int (*Colls::barrier)(MPI_Comm comm);
#define COLL_SETTER(cat, ret, args, args2)\
+int (*Colls::cat ) args;\
void Colls::set_##cat (const char * name){\
int id = find_coll_description(mpi_coll_## cat ##_description,\
name,#cat);\
}
+//Implementations of the single algorith collectives
+
int Colls::gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, int root, MPI_Comm comm)
{
#include "private.h"
+/** \brief MPI collective description */
+
+struct mpi_coll_description {
+ const char *name;
+ const char *description;
+ void *coll;
+};
+typedef struct mpi_coll_description s_mpi_coll_description_t;
+typedef struct mpi_coll_description* mpi_coll_description_t;
+
+
namespace simgrid{
namespace smpi{
+
class Colls{
private:
public:
- static void set_collectives();
static void set_gather(const char* name);
static void set_allgather(const char* name);
static void set_allgatherv(const char* name);
static void set_barrier(const char* name);
static void set_bcast(const char* name);
- static void coll_help(const char *category, s_mpi_coll_description_t * table);
+ static s_mpi_coll_description_t mpi_coll_gather_description[];
+ static s_mpi_coll_description_t mpi_coll_allgather_description[];
+ static s_mpi_coll_description_t mpi_coll_allgatherv_description[];
+ static s_mpi_coll_description_t mpi_coll_allreduce_description[];
+ static s_mpi_coll_description_t mpi_coll_alltoall_description[];
+ static s_mpi_coll_description_t mpi_coll_alltoallv_description[];
+ static s_mpi_coll_description_t mpi_coll_bcast_description[];
+ static s_mpi_coll_description_t mpi_coll_reduce_description[];
+ static s_mpi_coll_description_t mpi_coll_reduce_scatter_description[];
+ static s_mpi_coll_description_t mpi_coll_scatter_description[];
+ static s_mpi_coll_description_t mpi_coll_barrier_description[];
+
+
+ static XBT_PUBLIC(void) coll_help(const char *category, s_mpi_coll_description_t * table);
+ static XBT_PUBLIC(int) find_coll_description(s_mpi_coll_description_t * table, const char *name, const char *desc);
+ static void set_collectives();
static int (*gather)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, int root, MPI_Comm);
static int (*allgather)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
static int scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
static int scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
static int exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
+
+ static void (*smpi_coll_cleanup_callback)();
};
class Coll_algo{
};
+
+#define COLL_DESCRIPTION(cat, ret, args, name) \
+ {# name,\
+ # cat " " # name " collective",\
+ (void*) Coll_ ## cat ## _ ## name::cat }
+
+#define COLL_PROTO(cat, ret, args, name) \
+class Coll_ ## cat ## _ ## name : public Coll_ ## cat { \
+public: \
+static ret cat (COLL_UNPAREN args); \
+};
+
+#define COLL_UNPAREN(...) __VA_ARGS__
+
+#define COLL_APPLY(action, sig, name) action(sig, name)
+#define COLL_COMMA ,
+#define COLL_NOsep
+#define COLL_NOTHING(...)
+
+/*************
+ * GATHER *
+ *************/
+
+#define COLL_GATHER_SIG gather, int, \
+ (void *send_buff, int send_count, MPI_Datatype send_type, \
+ void *recv_buff, int recv_count, MPI_Datatype recv_type, \
+ int root, MPI_Comm comm)
+
+#define COLL_GATHERS(action, COLL_sep) \
+COLL_APPLY(action, COLL_GATHER_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_GATHER_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_GATHER_SIG, ompi_basic_linear) COLL_sep \
+COLL_APPLY(action, COLL_GATHER_SIG, ompi_binomial) COLL_sep \
+COLL_APPLY(action, COLL_GATHER_SIG, ompi_linear_sync) COLL_sep \
+COLL_APPLY(action, COLL_GATHER_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_GATHER_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_GATHER_SIG, mvapich2_two_level) COLL_sep \
+COLL_APPLY(action, COLL_GATHER_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_GATHER_SIG, automatic)
+
+COLL_GATHERS(COLL_PROTO, COLL_NOsep)
+
+/*************
+ * ALLGATHER *
+ *************/
+#define COLL_ALLGATHER_SIG allgather, int, \
+ (void *send_buff, int send_count, MPI_Datatype send_type, \
+ void *recv_buff, int recv_count, MPI_Datatype recv_type, \
+ MPI_Comm comm)
+
+#define COLL_ALLGATHERS(action, COLL_sep) \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, 2dmesh) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, 3dmesh) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, bruck) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, GB) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, loosely_lr) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, NTSLR) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, NTSLR_NB) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, pair) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, rdb) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, rhv) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, ring) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, SMP_NTS) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, smp_simple) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, spreading_simple) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, ompi_neighborexchange) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, mvapich2_smp) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, automatic)
+
+COLL_ALLGATHERS(COLL_PROTO, COLL_NOsep)
+
+/**************
+ * ALLGATHERV *
+ **************/
+#define COLL_ALLGATHERV_SIG allgatherv, int, \
+ (void *send_buff, int send_count, MPI_Datatype send_type, \
+ void *recv_buff, int *recv_count, int *recv_disps, \
+ MPI_Datatype recv_type, MPI_Comm comm)
+
+#define COLL_ALLGATHERVS(action, COLL_sep) \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, GB) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, pair) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, ring) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi_neighborexchange) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi_bruck) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich_rdb) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich_ring) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, automatic)
+
+COLL_ALLGATHERVS(COLL_PROTO, COLL_NOsep)
+
+/*************
+ * ALLREDUCE *
+ *************/
+#define COLL_ALLREDUCE_SIG allreduce, int, \
+ (void *sbuf, void *rbuf, int rcount, \
+ MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
+
+#define COLL_ALLREDUCES(action, COLL_sep) \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, lr) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab1) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab2) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab_rdb) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, rdb) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_binomial) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_binomial_pipeline) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rdb) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rsag) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rsag_lr) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rsag_rab) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, redbcast) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, ompi_ring_segmented) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, mvapich2_rs) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, mvapich2_two_level) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, automatic)
+
+COLL_ALLREDUCES(COLL_PROTO, COLL_NOsep)
+
+/************
+ * ALLTOALL *
+ ************/
+#define COLL_ALLTOALL_SIG alltoall, int, \
+ (void *send_buff, int send_count, MPI_Datatype send_type, \
+ void *recv_buff, int recv_count, MPI_Datatype recv_type, \
+ MPI_Comm comm)
+
+#define COLL_ALLTOALLS(action, COLL_sep) \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, 2dmesh) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, 3dmesh) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, basic_linear) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, bruck) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, pair) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_rma) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_light_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_mpi_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_one_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, rdb) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, ring) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_light_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_mpi_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_one_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, mvapich2_scatter_dest) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, automatic)
+
+COLL_ALLTOALLS(COLL_PROTO, COLL_NOsep)
+
+/*************
+ * ALLTOALLV *
+ *************/
+#define COLL_ALLTOALLV_SIG alltoallv, int, \
+ (void *send_buff, int *send_counts, int *send_disps, MPI_Datatype send_type, \
+ void *recv_buff, int *recv_counts, int *recv_disps, MPI_Datatype recv_type, \
+ MPI_Comm comm)
+
+#define COLL_ALLTOALLVS(action, COLL_sep) \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, bruck) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair_light_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair_mpi_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair_one_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_light_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_mpi_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_one_barrier) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, ompi_basic_linear) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, automatic)
+
+COLL_ALLTOALLVS(COLL_PROTO, COLL_NOsep)
+
+/*********
+ * BCAST *
+ *********/
+#define COLL_BCAST_SIG bcast, int, \
+ (void *buf, int count, MPI_Datatype datatype, \
+ int root, MPI_Comm comm)
+
+#define COLL_BCASTS(action, COLL_sep) \
+COLL_APPLY(action, COLL_BCAST_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, arrival_pattern_aware) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, arrival_pattern_aware_wait) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, arrival_scatter) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, binomial_tree) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, flattree) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, flattree_pipeline) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, NTSB) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, NTSL) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, NTSL_Isend) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, scatter_LR_allgather) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, scatter_rdb_allgather) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, SMP_binary) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, SMP_binomial) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, SMP_linear) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, ompi_split_bintree) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, ompi_pipeline) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, mvapich2_inter_node) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, mvapich2_intra_node) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, mvapich2_knomial_intra_node) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, automatic)
+
+COLL_BCASTS(COLL_PROTO, COLL_NOsep)
+
+
+/**********
+ * REDUCE *
+ **********/
+#define COLL_REDUCE_SIG reduce, int, \
+ (void *buf, void *rbuf, int count, MPI_Datatype datatype, \
+ MPI_Op op, int root, MPI_Comm comm)
+
+#define COLL_REDUCES(action, COLL_sep) \
+COLL_APPLY(action, COLL_REDUCE_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, arrival_pattern_aware) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, binomial) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, flat_tree) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, NTSL) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, scatter_gather) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, ompi_chain) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, ompi_pipeline) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, ompi_basic_linear) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, ompi_in_order_binary) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, ompi_binary) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, ompi_binomial) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, mvapich2_knomial) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, mvapich2_two_level) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, rab) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, automatic)
+
+COLL_REDUCES(COLL_PROTO, COLL_NOsep)
+
+/*************
+ * REDUCE_SCATTER *
+ *************/
+#define COLL_REDUCE_SCATTER_SIG reduce_scatter, int, \
+ (void *sbuf, void *rbuf, int *rcounts,\
+ MPI_Datatype dtype,MPI_Op op,MPI_Comm comm)
+
+#define COLL_REDUCE_SCATTERS(action, COLL_sep) \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, ompi_basic_recursivehalving) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, ompi_ring) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_pair) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_rdb) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_noncomm) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, automatic)
+
+
+
+COLL_REDUCE_SCATTERS(COLL_PROTO, COLL_NOsep)
+
+
+/*************
+ * SCATTER *
+ *************/
+#define COLL_SCATTER_SIG scatter, int, \
+ (void *sendbuf, int sendcount, MPI_Datatype sendtype,\
+ void *recvbuf, int recvcount, MPI_Datatype recvtype,\
+ int root, MPI_Comm comm)
+
+#define COLL_SCATTERS(action, COLL_sep) \
+COLL_APPLY(action, COLL_SCATTER_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_SCATTER_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_SCATTER_SIG, ompi_basic_linear) COLL_sep \
+COLL_APPLY(action, COLL_SCATTER_SIG, ompi_binomial) COLL_sep \
+COLL_APPLY(action, COLL_SCATTER_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_SCATTER_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_SCATTER_SIG, mvapich2_two_level_binomial) COLL_sep \
+COLL_APPLY(action, COLL_SCATTER_SIG, mvapich2_two_level_direct) COLL_sep \
+COLL_APPLY(action, COLL_SCATTER_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_SCATTER_SIG, automatic)
+
+COLL_SCATTERS(COLL_PROTO, COLL_NOsep)
+
+/*************
+ * SCATTER *
+ *************/
+#define COLL_BARRIER_SIG barrier, int, \
+ (MPI_Comm comm)
+
+#define COLL_BARRIERS(action, COLL_sep) \
+COLL_APPLY(action, COLL_BARRIER_SIG, default) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, ompi) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, ompi_basic_linear) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, ompi_two_procs) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, ompi_tree) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, ompi_bruck) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, ompi_recursivedoubling) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, ompi_doublering) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, mvapich2_pair) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, mvapich2) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, impi) COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, automatic)
+
+COLL_BARRIERS(COLL_PROTO, COLL_NOsep)
+
+
}
}
#include "private.h"
#include "src/simix/smx_private.h"
-#include "colls/colls.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_comm, smpi, "Logging specific to SMPI (comm)");
if (MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED){
MPI_COMM_WORLD->cleanup_smp();
MPI_COMM_WORLD->cleanup_attributes();
- if(smpi_coll_cleanup_callback!=nullptr)
- smpi_coll_cleanup_callback();
+ if(Colls::smpi_coll_cleanup_callback!=nullptr)
+ Colls::smpi_coll_cleanup_callback();
delete MPI_COMM_WORLD;
}
static void smpi_init_options(){
Colls::set_collectives();
- smpi_coll_cleanup_callback=nullptr;
+ Colls::smpi_coll_cleanup_callback=nullptr;
smpi_cpu_threshold = xbt_cfg_get_double("smpi/cpu-threshold");
smpi_host_speed = xbt_cfg_get_double("smpi/host-speed");
smpi_privatize_global_variables = xbt_cfg_get_boolean("smpi/privatize-global-variables");
src/mc/PageStore.hpp
src/mc/mc_record.h
src/include/simgrid/sg_config.h
- src/include/smpi/smpi_interface.h
src/include/smpi/smpi_utils.hpp
src/include/surf/datatypes.h
src/include/surf/maxmin.h
src/kernel/activity/SynchroSleep.hpp
src/kernel/activity/SynchroRaw.hpp
src/smpi/colls/coll_tuned_topo.h
- src/smpi/colls/colls.h
src/smpi/colls/colls_private.h
src/smpi/colls/smpi_mvapich2_selector_stampede.h
src/smpi/private.h
src/smpi/smpi_memory.cpp
src/smpi/smpi_static_variables.cpp
src/smpi/smpi_coll.cpp
+ src/smpi/smpi_coll.hpp
src/smpi/smpi_comm.cpp
src/smpi/smpi_comm.hpp
src/smpi/smpi_deployment.cpp