block_size = extent * send_count;
if (!is_2dmesh(num_procs, &X, &Y))
- return MPI_ERR_COMM;
+ THROWF(arg_error,0, "allgather_2dmesh algorithm can't be used with this number of processes! ");
my_row_base = (rank / Y) * Y;
my_col_base = rank % Y;
num_procs = smpi_comm_size(comm);
extent = smpi_datatype_get_extent(send_type);
- is_3dmesh(num_procs, &X, &Y, &Z);
+ if (!is_3dmesh(num_procs, &X, &Y, &Z))
+ THROWF(arg_error,0, "allgather_3dmesh algorithm can't be used with this number of processes! ");
+
num_reqs = X;
int inter_comm_size = (comm_size + NUM_CORE - 1) / NUM_CORE;
int num_core_in_current_smp = NUM_CORE;
+ if(comm_size%NUM_CORE)
+ THROWF(arg_error,0, "allgather SMP NTS algorithm can't be used with non multiple of NUM_CORE=%d number of processes ! ", NUM_CORE);
+
/* for too small number of processes, use default implementation */
if (comm_size <= NUM_CORE) {
XBT_WARN("MPI_allgather_SMP_NTS use default MPI_allgather.");
int inter_dst, inter_src;
comm_size = smpi_comm_size(comm);
+
+ if(comm_size%4)
+ THROWF(arg_error,0, "allgather loosely lr algorithm can't be used with non multiple of NUM_CORE=4 number of processes ! ");
+
rank = smpi_comm_rank(comm);
MPI_Aint rextent, sextent;
rextent = smpi_datatype_get_extent(rtype);
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "allgather pair algorithm can't be used with non power of two number of processes ! ");
+
extent = smpi_datatype_get_extent(send_type);
// local send/recv
// get size of the communicator, followed by rank
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "allgather rhv algorithm can't be used with non power of two number of processes ! ");
+
rank = smpi_comm_rank(comm);
// get size of single element's type for send buffer and recv buffer
{
int src, dst, comm_size, rank;
comm_size = smpi_comm_size(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);
+
rank = smpi_comm_rank(comm);
MPI_Aint rextent, sextent;
rextent = smpi_datatype_get_extent(rtype);
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "allgatherv pair algorithm can't be used with non power of two number of processes ! ");
+
extent = smpi_datatype_get_extent(send_type);
// local send/recv
rank = smpi_comm_rank(comm);
nprocs = smpi_comm_size(comm);
+ if((nprocs&(nprocs-1)))
+ THROWF(arg_error,0, "allreduce rab1 algorithm can't be used with non power of two number of processes ! ");
+
extent = smpi_datatype_get_extent(dtype);
pof2 = 1;
int num_core = NUM_CORE;
comm_size = smpi_comm_size(comm);
+
+ if((comm_size&(comm_size-1)))
+ THROWF(arg_error,0, "allreduce smp rsag rab algorithm can't be used with non power of two number of processes ! ");
+
rank = smpi_comm_rank(comm);
MPI_Aint extent;
extent = smpi_datatype_get_extent(dtype);
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "alltoall pair algorithm can't be used with non power of two number of processes ! ");
+
send_chunk = smpi_datatype_get_extent(send_type);
recv_chunk = smpi_datatype_get_extent(recv_type);
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "alltoall pair algorithm can't be used with non power of two number of processes ! ");
+
send_chunk = smpi_datatype_get_extent(send_type);
recv_chunk = smpi_datatype_get_extent(recv_type);
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "alltoall pair algorithm can't be used with non power of two number of processes ! ");
+
send_chunk = smpi_datatype_get_extent(send_type);
recv_chunk = smpi_datatype_get_extent(recv_type);
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "alltoall pair algorithm can't be used with non power of two number of processes ! ");
+
send_chunk = smpi_datatype_get_extent(send_type);
recv_chunk = smpi_datatype_get_extent(recv_type);
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "alltoallv pair algorithm can't be used with non power of two number of processes ! ");
+
send_chunk = smpi_datatype_get_extent(send_type);
recv_chunk = smpi_datatype_get_extent(recv_type);
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "alltoallv pair algorithm can't be used with non power of two number of processes ! ");
+
send_chunk = smpi_datatype_get_extent(send_type);
recv_chunk = smpi_datatype_get_extent(recv_type);
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "alltoallv pair algorithm can't be used with non power of two number of processes ! ");
+
send_chunk = smpi_datatype_get_extent(send_type);
recv_chunk = smpi_datatype_get_extent(recv_type);
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
+
+ if((num_procs&(num_procs-1)))
+ THROWF(arg_error,0, "alltoallv pair algorithm can't be used with non power of two number of processes ! ");
+
send_chunk = smpi_datatype_get_extent(send_type);
recv_chunk = smpi_datatype_get_extent(recv_type);
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
+ if(size%NUM_CORE)
+ THROWF(arg_error,0, "bcast SMP binary can't be used with non multiple of NUM_CORE=%d number of processes ! ",NUM_CORE);
+
int segment = bcast_SMP_binary_segment_byte / extent;
int pipe_length = count / segment;
int remainder = count % segment;
size = smpi_comm_size(comm);
rank = smpi_comm_rank(comm);
+ 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);
+
int to_intra, to_inter;
int from_intra, from_inter;
int inter_rank = rank / NUM_CORE;
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
+ if(size%NUM_CORE)
+ THROWF(arg_error,0, "bcast SMP linear can't be used with non multiple of NUM_CORE=%d number of processes ! ",NUM_CORE);
+
int segment = bcast_SMP_linear_segment_byte / extent;
int pipe_length = count / segment;
int remainder = count % segment;
#include <math.h>
#include "smpi/mpi.h"
#include "smpi/private.h"
+#include "xbt/ex.h"
#include "xbt.h"
#define COLL_DESCRIPTION(cat, ret, args, name) \
double time1, time2, time_min=DBL_MAX;\
int min_coll=-1, global_coll=-1;\
int i;\
+ xbt_ex_t ex;\
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;\
smpi_mpi_barrier(comm);\
TRACE_AUTO_COLL(cat)\
time1 = SIMIX_get_clock();\
+ TRY{\
((int (*) args)\
mpi_coll_##cat##_description[i].coll) args2 ;\
+ }\
+ CATCH(ex) {\
+ continue;\
+ }\
time2 = SIMIX_get_clock();\
buf_out=time2-time1;\
smpi_mpi_reduce((void*)&buf_out,(void*)&buf_in, 1, MPI_DOUBLE, MPI_MAX, 0,comm );\