* under the terms of the license (GNU LGPL) which comes with this package. */
#include "colls_private.h"
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
int smpi_coll_tuned_allgather_SMP_NTS(void *sbuf, int scount,
MPI_Datatype stype, void *rbuf,
int i, send_offset, recv_offset;
int intra_rank, inter_rank;
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }
intra_rank = rank % num_core;
#include "colls_private.h"
-#ifndef NUM_CORE
-#define NUM_CORE 4
-#endif
-
int smpi_coll_tuned_allgather_loosely_lr(void *sbuf, int scount,
MPI_Datatype stype, void *rbuf,
int rcount, MPI_Datatype rtype,
comm_size = smpi_comm_size(comm);
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
+if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }
if(comm_size%num_core)
THROWF(arg_error,0, "allgather loosely lr algorithm can't be used with non multiple of NUM_CORE=%d number of processes ! ",num_core);
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "colls_private.h"
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
int smpi_coll_tuned_allgather_smp_simple(void *send_buf, int scount,
MPI_Datatype stype, void *recv_buf,
int src, dst, comm_size, rank;
comm_size = smpi_comm_size(comm);
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }
if(comm_size%num_core)
THROWF(arg_error,0, "allgather SMP simple algorithm can't be used with non multiple of NUM_CORE=%d number of processes ! ", num_core);
inter-communication
The communication are done in a pipeline fashion */
-/* change number of core per smp-node
- we assume that number of core per process will be the same for all implementations */
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
+
/* this is a default segment size for pipelining,
but it is typically passed as a command line argument */
int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
MPI_Status status;
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }
comm_size = smpi_comm_size(comm);
rank = smpi_comm_rank(comm);
It uses 2-layer communication: binomial for both intra-communication
inter-communication*/
-/* change number of core per smp-node
- we assume that number of core per process will be the same for all implementations */
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
/* ** NOTE **
Use -DMPICH2 if this code does not compile.
int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
-
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }
MPI_Status status;
comm_size=smpi_comm_size(comm);
It uses 2-layer communication: binomial for intra-communication
and rdb for inter-communication*/
-/* change number of core per smp-node
- we assume that number of core per process will be the same for all implementations */
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
/* ** NOTE **
Use -DMPICH2 if this code does not compile.
int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
MPI_Status status;
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }
/*
#ifdef MPICH2_REDUCTION
MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
#include "colls_private.h"
//#include <star-reduction.c>
-/* change number of core per smp-node
- we assume that number of core per process will be the same for all implementations */
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
-
/*
This fucntion performs all-reduce operation as follow.
1) binomial_tree reduce inside each SMP node
int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
MPI_Status status;
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }
/*
#ifdef MPICH2_REDUCTION
MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
#include "colls_private.h"
//#include <star-reduction.c>
-/* change number of core per smp-node
- we assume that number of core per process will be the same for all implementations */
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
/*
This fucntion performs all-reduce operation as follow.
int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
MPI_Status status;
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }
comm_size = smpi_comm_size(comm);
#include "colls_private.h"
-/* change number of core per smp-node
- we assume that number of core per process will be the same for all implementations */
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
-
/*
This fucntion performs all-reduce operation as follow.
1) binomial_tree reduce inside each SMP node
int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
MPI_Status status;
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }
/*
#ifdef MPICH2_REDUCTION
MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "colls_private.h"
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
+
int bcast_SMP_binary_segment_byte = 8192;
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
- int host_num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (host_num_core == 1) host_num_core = NUM_CORE;
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int host_num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ host_num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }else{
+ //implementation buggy in this case
+ return smpi_coll_tuned_bcast_mpich( buf , count, datatype,
+ root, comm);
+ }
int segment = bcast_SMP_binary_segment_byte / extent;
int pipe_length = count / segment;
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "colls_private.h"
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
int smpi_coll_tuned_bcast_SMP_binomial(void *buf, int count,
MPI_Datatype datatype, int root,
size = smpi_comm_size(comm);
rank = smpi_comm_rank(comm);
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
-
- if(size%num_core)
- THROWF(arg_error,0, "bcast SMP binomial can't be used with non multiple of NUM_CORE=%d number of processes ! ",num_core);
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }else{
+ //implementation buggy in this case
+ return smpi_coll_tuned_bcast_mpich( buf , count, datatype,
+ root, comm);
+ }
int to_intra, to_inter;
int from_intra, from_inter;
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "colls_private.h"
-#ifndef NUM_CORE
-#define NUM_CORE 8
-#endif
int bcast_SMP_linear_segment_byte = 8192;
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
- int num_core = simcall_host_get_core(SIMIX_host_self());
- // do we use the default one or the number of cores in the platform ?
- // if the number of cores is one, the platform may be simulated with 1 node = 1 core
- if (num_core == 1) num_core = NUM_CORE;
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }else{
+ //implementation buggy in this case
+ return smpi_coll_tuned_bcast_mpich( buf , count, datatype,
+ root, comm);
+ }
int segment = bcast_SMP_linear_segment_byte / extent;
segment = segment == 0 ? 1 :segment;