- TRACE_smpi_comm_out(my_proc_id);
- log_timed_action (action, clock);
-}
-
-static void action_allToAllv(const char *const *action) {
- /* The structure of the allToAllV action for the rank 0 (total 4 processes) is the following:
- 0 allToAllV 100 1 7 10 12 100 1 70 10 5
- where:
- 1) 100 is the size of the send buffer *sizeof(int),
- 2) 1 7 10 12 is the sendcounts array
- 3) 100*sizeof(int) is the size of the receiver buffer
- 4) 1 70 10 5 is the recvcounts array
- */
- double clock = smpi_process()->simulated_elapsed();
-
- int comm_size = MPI_COMM_WORLD->size();
- CHECK_ACTION_PARAMS(action, 2*comm_size+2, 2)
- int send_size = 0;
- int recv_size = 0;
- int sendcounts[comm_size];
- std::vector<int>* trace_sendcounts = new std::vector<int>;
- int recvcounts[comm_size];
- std::vector<int>* trace_recvcounts = new std::vector<int>;
- int senddisps[comm_size];
- int recvdisps[comm_size];
-
- MPI_Datatype MPI_CURRENT_TYPE2 = MPI_DEFAULT_TYPE;
-
- int send_buf_size=parse_double(action[2]);
- int recv_buf_size=parse_double(action[3+comm_size]);
- if(action[4+2*comm_size] && action[5+2*comm_size]) {
- MPI_CURRENT_TYPE=decode_datatype(action[4+2*comm_size]);
- MPI_CURRENT_TYPE2=decode_datatype(action[5+2*comm_size]);
- }
- else
- MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
-
- int my_proc_id = Actor::self()->getPid();
- void *sendbuf = smpi_get_tmp_sendbuffer(send_buf_size* MPI_CURRENT_TYPE->size());
- void *recvbuf = smpi_get_tmp_recvbuffer(recv_buf_size* MPI_CURRENT_TYPE2->size());
-
- for(int i=0;i<comm_size;i++) {
- sendcounts[i] = atoi(action[i+3]);
- trace_sendcounts->push_back(sendcounts[i]);
- send_size += sendcounts[i];
- recvcounts[i] = atoi(action[i+4+comm_size]);
- trace_recvcounts->push_back(recvcounts[i]);
- recv_size += recvcounts[i];
- senddisps[i] = 0;
- recvdisps[i] = 0;
- }
-
- TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::VarCollTIData(
- "allToAllV", -1, send_size, trace_sendcounts, recv_size, trace_recvcounts,
- encode_datatype(MPI_CURRENT_TYPE), encode_datatype(MPI_CURRENT_TYPE2)));
-
- Colls::alltoallv(sendbuf, sendcounts, senddisps, MPI_CURRENT_TYPE,recvbuf, recvcounts, recvdisps,
- MPI_CURRENT_TYPE, MPI_COMM_WORLD);
-
- TRACE_smpi_comm_out(my_proc_id);
- log_timed_action (action, clock);
-}