+static void action_allgather(const char *const *action) {
+ /*
+ The structure of the allgather action for the rank 0 (total 4 processes)
+ is the following:
+ 0 allGather 275427 275427
+
+ where:
+ 1) 275427 is the sendcount
+ 2) 275427 is the recvcount
+ 3) No more values mean that the datatype for sent and receive buffer
+ is the default one, see decode_datatype().
+
+ */
+
+ double clock = smpi_process_simulated_elapsed();
+
+ CHECK_ACTION_PARAMS(action, 2, 2);
+ int sendcount=atoi(action[2]);
+ int recvcount=atoi(action[3]);
+
+ MPI_Datatype MPI_CURRENT_TYPE2;
+
+ if(action[4]) {
+ MPI_CURRENT_TYPE = decode_datatype(action[3]);
+ MPI_CURRENT_TYPE2 = decode_datatype(action[4]);
+ } else {
+ MPI_CURRENT_TYPE = MPI_DEFAULT_TYPE;
+ MPI_CURRENT_TYPE2 = MPI_DEFAULT_TYPE;
+ }
+ void *sendbuf = smpi_get_tmp_sendbuffer(sendcount* smpi_datatype_size(MPI_CURRENT_TYPE));
+ void *recvbuf = smpi_get_tmp_recvbuffer(recvcount* smpi_datatype_size(MPI_CURRENT_TYPE2));
+
+ int rank = smpi_process_index();
+ instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
+ extra->type = TRACING_ALLGATHER;
+ extra->send_size = sendcount;
+ extra->recv_size= recvcount;
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
+ extra->num_processes = smpi_comm_size(MPI_COMM_WORLD);
+
+ TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
+
+ mpi_coll_allgather_fun(sendbuf, sendcount, MPI_CURRENT_TYPE, recvbuf, recvcount, MPI_CURRENT_TYPE2, MPI_COMM_WORLD);
+
+ TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+ log_timed_action (action, clock);
+}