int communicator_size = 0;
static int active_processes = 0;
-xbt_dynar_t *reqq;
+xbt_dynar_t *reqq = NULL;
MPI_Datatype MPI_DEFAULT_TYPE, MPI_CURRENT_TYPE;
/*initialize the number of active processes */
active_processes = smpi_process_count();
- reqq=xbt_new0(xbt_dynar_t,active_processes);
+ if (!reqq) {
+ reqq=xbt_new0(xbt_dynar_t,active_processes);
- for(i=0;i<active_processes;i++){
- reqq[i]=xbt_dynar_new(sizeof(MPI_Request),NULL);
+ for(i=0;i<active_processes;i++){
+ reqq[i]=xbt_dynar_new(sizeof(MPI_Request),NULL);
+ }
}
}
int root_traced = smpi_group_rank(smpi_comm_group(MPI_COMM_WORLD), 0);
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
#endif
- smpi_mpi_reduce(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, root, MPI_COMM_WORLD);
+ mpi_coll_reduce_fun(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, root, MPI_COMM_WORLD);
smpi_execute_flops(comp_size);
#ifdef HAVE_TRACING
TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
- smpi_mpi_reduce(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, 0, MPI_COMM_WORLD);
+ mpi_coll_reduce_fun(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, 0, MPI_COMM_WORLD);
smpi_execute_flops(comp_size);
- smpi_mpi_bcast(NULL, comm_size, MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
+ mpi_coll_bcast_fun(NULL, comm_size, MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
#ifdef HAVE_TRACING
TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
TRACE_smpi_computing_in(rank);
static void action_allToAll(const char *const *action) {
double clock = smpi_process_simulated_elapsed();
int comm_size = smpi_comm_size(MPI_COMM_WORLD);
- int send_size = atoi(action[2]);
- int recv_size = atoi(action[3]);
+ int send_size = parse_double(action[2]);
+ int recv_size = parse_double(action[3]);
void *send = xbt_new0(int, send_size*comm_size);
void *recv = xbt_new0(int, send_size*comm_size);
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
-
- if (send_size < 200 && comm_size > 12) {
- smpi_coll_tuned_alltoall_bruck(send, send_size, MPI_CURRENT_TYPE,
- recv, recv_size, MPI_CURRENT_TYPE,
- MPI_COMM_WORLD);
- } else if (send_size < 3000) {
- smpi_coll_tuned_alltoall_basic_linear(send, send_size, MPI_CURRENT_TYPE,
- recv, recv_size, MPI_CURRENT_TYPE,
- MPI_COMM_WORLD);
- } else {
- smpi_coll_tuned_alltoall_pairwise(send, send_size, MPI_CURRENT_TYPE,
- recv, recv_size, MPI_CURRENT_TYPE,
- MPI_COMM_WORLD);
- }
+ mpi_coll_alltoall_fun(send, send_size, MPI_CURRENT_TYPE, recv, recv_size, MPI_CURRENT_TYPE, MPI_COMM_WORLD);
#ifdef HAVE_TRACING
TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
int *senddisps = xbt_new0(int, comm_size);
int *recvdisps = xbt_new0(int, comm_size);
- send_buf_size=atoi(action[2]);
- recv_buf_size=atoi(action[3+2*comm_size]);
+ send_buf_size=parse_double(action[2]);
+ recv_buf_size=parse_double(action[3+2*comm_size]);
int *sendbuf = xbt_new0(int, send_buf_size);
int *recvbuf = xbt_new0(int, recv_buf_size);
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
- smpi_coll_basic_alltoallv(sendbuf, sendcounts, senddisps, MPI_CURRENT_TYPE,
+ mpi_coll_alltoallv_fun(sendbuf, sendcounts, senddisps, MPI_CURRENT_TYPE,
recvbuf, recvcounts, recvdisps, MPI_CURRENT_TYPE,
MPI_COMM_WORLD);
#ifdef HAVE_TRACING
double sim_time= 1.;
/* One active process will stop. Decrease the counter*/
active_processes--;
+ XBT_DEBUG("There are %lu elements in reqq[*]",
+ xbt_dynar_length(reqq[smpi_comm_rank(MPI_COMM_WORLD)]));
+ xbt_dynar_free(&reqq[smpi_comm_rank(MPI_COMM_WORLD)]);
if(!active_processes){
/* Last process alive speaking */
/* end the simulated timer */
- xbt_dynar_free(reqq);
sim_time = smpi_process_simulated_elapsed();
XBT_INFO("Simulation time %g", sim_time);
_xbt_replay_action_exit();
+ xbt_free(reqq);
+ reqq = NULL;
}
return PMPI_Finalize();
}