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);
+ }
}
}
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);
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) {
-
+ } 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);
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);
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();
}