summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
19254ca)
When datatype was unknown to replay, it was replayed as MPI_BYTE.
This modification adds a parameter to encode_datatype, to tell tracing that the datatype size has to be taken into account in the count parameter
This results in the fact that a message of count*datatype_size being replayed as a message of (count*datatype_size)*sizeof(MPI_BYTE), which is the same.
This is not a perfect or elegant solution, but :
- it works.
- it handles manually created datatypes
- it doesn't break previously generated replay files
- it avoids testing each time 50 different datatypes (see encode_datatype function)
- the new parameter avoids doing strcmp with "-1" at each time, performance should not be too bad
void TRACE_smpi_finalize(int rank);
#endif
void TRACE_smpi_finalize(int rank);
#endif
-const char* encode_datatype(MPI_Datatype datatype);
+const char* encode_datatype(MPI_Datatype datatype, int* known);
// TODO, make this static and expose it more cleanly
// TODO, make this static and expose it more cleanly
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_IRECV;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_IRECV;
- extra->send_size = count;
extra->src = src_traced;
extra->dst = rank;
extra->src = src_traced;
extra->dst = rank;
- extra->datatype1 = encode_datatype(datatype);
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
#endif
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
#endif
#ifdef HAVE_TRACING
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
#ifdef HAVE_TRACING
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ISEND;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ISEND;
- extra->send_size = count;
extra->src = rank;
extra->dst = dst_traced;
extra->src = rank;
extra->dst = dst_traced;
- extra->datatype1 = encode_datatype(datatype);
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced, count*smpi_datatype_size(datatype));
#endif
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced, count*smpi_datatype_size(datatype));
#endif
int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ISSEND;
int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ISSEND;
- extra->send_size = count;
extra->src = rank;
extra->dst = dst_traced;
extra->src = rank;
extra->dst = dst_traced;
- extra->datatype1 = encode_datatype(datatype);
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced, count*smpi_datatype_size(datatype));
#endif
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced, count*smpi_datatype_size(datatype));
#endif
int src_traced = smpi_group_index(smpi_comm_group(comm), src);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_RECV;
int src_traced = smpi_group_index(smpi_comm_group(comm), src);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_RECV;
- extra->send_size = count;
extra->src = src_traced;
extra->dst = rank;
extra->src = src_traced;
extra->dst = rank;
- extra->datatype1 = encode_datatype(datatype);
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
#endif
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
#endif
int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SEND;
int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SEND;
- extra->send_size = count;
extra->src = rank;
extra->dst = dst_traced;
extra->src = rank;
extra->dst = dst_traced;
- extra->datatype1 = encode_datatype(datatype);
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced,count*smpi_datatype_size(datatype));
#endif
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced,count*smpi_datatype_size(datatype));
#endif
int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SSEND;
int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SSEND;
- extra->send_size = count;
extra->src = rank;
extra->dst = dst_traced;
extra->src = rank;
extra->dst = dst_traced;
- extra->datatype1 = encode_datatype(datatype);
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra); TRACE_smpi_send(rank, rank, dst_traced,count*smpi_datatype_size(datatype));
#endif
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra); TRACE_smpi_send(rank, rank, dst_traced,count*smpi_datatype_size(datatype));
#endif
int src_traced = smpi_group_index(smpi_comm_group(comm), src);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SENDRECV;
int src_traced = smpi_group_index(smpi_comm_group(comm), src);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SENDRECV;
- extra->send_size = sendcount;
- extra->recv_size = recvcount;
extra->src = src_traced;
extra->dst = dst_traced;
extra->src = src_traced;
extra->dst = dst_traced;
- extra->datatype1 = encode_datatype(sendtype);
- extra->datatype2 = encode_datatype(recvtype);
+ int known=0;
+ extra->datatype1 = encode_datatype(sendtype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(sendtype);
+ extra->send_size = sendcount*dt_size_send;
+ extra->datatype2 = encode_datatype(recvtype, &known);
+ int dt_size_recv = 1;
+ if(!known)
+ dt_size_recv = smpi_datatype_size(recvtype);
+ extra->recv_size = recvcount*dt_size_recv;
TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced,sendcount*smpi_datatype_size(sendtype));
TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced,sendcount*smpi_datatype_size(sendtype));
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_BCAST;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_BCAST;
- extra->send_size = count;
extra->root = root_traced;
extra->root = root_traced;
- extra->datatype1 = encode_datatype(datatype);
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
#endif
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
#endif
int root_traced = smpi_group_index(smpi_comm_group(comm), root);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_GATHER;
int root_traced = smpi_group_index(smpi_comm_group(comm), root);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_GATHER;
- extra->send_size = sendtmpcount;
- extra->recv_size = recvcount;
extra->root = root_traced;
extra->root = root_traced;
- extra->datatype1 = encode_datatype(sendtmptype);
- extra->datatype2 = encode_datatype(recvtype);
+ int known=0;
+ extra->datatype1 = encode_datatype(sendtmptype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(sendtmptype);
+ extra->send_size = sendtmpcount*dt_size_send;
+ extra->datatype2 = encode_datatype(recvtype, &known);
+ int dt_size_recv = 1;
+ if(!known)
+ dt_size_recv = smpi_datatype_size(recvtype);
+ extra->recv_size = recvcount*dt_size_recv;
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
#endif
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
#endif
int size = smpi_comm_size(comm);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_GATHERV;
int size = smpi_comm_size(comm);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_GATHERV;
- extra->send_size = sendtmpcount;
- extra->recvcounts= xbt_malloc(size*sizeof(int));
- for(i=0; i< size; i++)//copy data to avoid bad free
- extra->recvcounts[i] = recvcounts[i];
extra->num_processes = size;
extra->root = root_traced;
extra->num_processes = size;
extra->root = root_traced;
- extra->datatype1 = encode_datatype(sendtmptype);
- extra->datatype2 = encode_datatype(recvtype);
+ int known=0;
+ extra->datatype1 = encode_datatype(sendtmptype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(sendtype);
+ extra->send_size = sendtmpcount*dt_size_send;
+ extra->datatype2 = encode_datatype(recvtype, &known);
+ int dt_size_recv = 1;
+ if(!known)
+ dt_size_recv = smpi_datatype_size(recvtype);
+ extra->recvcounts= xbt_malloc(size*sizeof(int));
+ for(i=0; i< size; i++)//copy data to avoid bad free
+ extra->recvcounts[i] = recvcounts[i]*dt_size_recv;
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
#endif
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
#endif
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ALLGATHER;
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
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(sendtype);
- extra->datatype2 = encode_datatype(recvtype);
+ int known=0;
+ extra->datatype1 = encode_datatype(sendtype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(sendtype);
+ extra->send_size = sendcount*dt_size_send;
+ extra->datatype2 = encode_datatype(recvtype, &known);
+ int dt_size_recv = 1;
+ if(!known)
+ dt_size_recv = smpi_datatype_size(recvtype);
+ extra->recv_size = recvcount*dt_size_recv;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
#endif
TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
#endif
int size = smpi_comm_size(comm);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ALLGATHERV;
int size = smpi_comm_size(comm);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ALLGATHERV;
- extra->send_size = sendcount;
+ extra->num_processes = size;
+ int known=0;
+ extra->datatype1 = encode_datatype(sendtype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(sendtype);
+ extra->send_size = sendcount*dt_size_send;
+ extra->datatype2 = encode_datatype(recvtype, &known);
+ int dt_size_recv = 1;
+ if(!known)
+ dt_size_recv = smpi_datatype_size(recvtype);
extra->recvcounts= xbt_malloc(size*sizeof(int));
for(i=0; i< size; i++)//copy data to avoid bad free
extra->recvcounts= xbt_malloc(size*sizeof(int));
for(i=0; i< size; i++)//copy data to avoid bad free
- extra->recvcounts[i] = recvcounts[i];
- extra->num_processes = size;
- extra->datatype1 = encode_datatype(sendtype);
- extra->datatype2 = encode_datatype(recvtype);
+ extra->recvcounts[i] = recvcounts[i]*dt_size_recv;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
int root_traced = smpi_group_index(smpi_comm_group(comm), root);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SCATTER;
int root_traced = smpi_group_index(smpi_comm_group(comm), root);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SCATTER;
- extra->send_size = sendcount;
- extra->recv_size= recvcount;
extra->root = root_traced;
extra->root = root_traced;
- extra->datatype1 = encode_datatype(sendtype);
- extra->datatype2 = encode_datatype(recvtype);
-
+ int known=0;
+ extra->datatype1 = encode_datatype(sendtype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(sendtype);
+ extra->send_size = sendcount*dt_size_send;
+ extra->datatype2 = encode_datatype(recvtype, &known);
+ int dt_size_recv = 1;
+ if(!known)
+ dt_size_recv = smpi_datatype_size(recvtype);
+ extra->recv_size = recvcount*dt_size_recv;
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
#endif
mpi_coll_scatter_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount,
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
#endif
mpi_coll_scatter_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount,
int size = smpi_comm_size(comm);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SCATTERV;
int size = smpi_comm_size(comm);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SCATTERV;
- extra->recv_size = recvcount;
- extra->sendcounts= xbt_malloc(size*sizeof(int));
- for(i=0; i< size; i++)//copy data to avoid bad free
- extra->sendcounts[i] = sendcounts[i];
extra->num_processes = size;
extra->root = root_traced;
extra->num_processes = size;
extra->root = root_traced;
- extra->datatype1 = encode_datatype(sendtype);
- extra->datatype2 = encode_datatype(recvtype);
-
+ int known=0;
+ extra->datatype1 = encode_datatype(sendtype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(sendtype);
+ extra->sendcounts= xbt_malloc(size*sizeof(int));
+ for(i=0; i< size; i++)//copy data to avoid bad free
+ extra->sendcounts[i] = sendcounts[i]*dt_size_send;
+ extra->datatype2 = encode_datatype(recvtype, &known);
+ int dt_size_recv = 1;
+ if(!known)
+ dt_size_recv = smpi_datatype_size(recvtype);
+ extra->recv_size = recvcount*dt_size_recv;
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
#endif
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
#endif
int root_traced = smpi_group_index(smpi_comm_group(comm), root);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_REDUCE;
int root_traced = smpi_group_index(smpi_comm_group(comm), root);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_REDUCE;
- extra->send_size = count;
- extra->datatype1 = encode_datatype(datatype);
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
extra->root = root_traced;
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
extra->root = root_traced;
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ALLREDUCE;
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ALLREDUCE;
- extra->send_size = count;
- extra->datatype1 = encode_datatype(datatype);
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SCAN;
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SCAN;
- extra->send_size = count;
- extra->datatype1 = encode_datatype(datatype);
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_EXSCAN;
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_EXSCAN;
- extra->send_size = count;
- extra->datatype1 = encode_datatype(datatype);
-
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
+ extra->send_size = count*dt_size_send;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
smpi_mpi_exscan(sendbuf, recvbuf, count, datatype, op, comm);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
smpi_mpi_exscan(sendbuf, recvbuf, count, datatype, op, comm);
int size = smpi_comm_size(comm);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_REDUCE_SCATTER;
int size = smpi_comm_size(comm);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_REDUCE_SCATTER;
+ extra->num_processes = size;
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
extra->send_size = 0;
extra->recvcounts= xbt_malloc(size*sizeof(int));
for(i=0; i< size; i++)//copy data to avoid bad free
extra->send_size = 0;
extra->recvcounts= xbt_malloc(size*sizeof(int));
for(i=0; i< size; i++)//copy data to avoid bad free
- extra->recvcounts[i] = recvcounts[i];
- extra->num_processes = size;
- extra->datatype1 = encode_datatype(datatype);
-
+ extra->recvcounts[i] = recvcounts[i]*dt_size_send;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
void* sendtmpbuf=sendbuf;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
void* sendtmpbuf=sendbuf;
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_REDUCE_SCATTER;
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_REDUCE_SCATTER;
+ extra->num_processes = count;
+ int known=0;
+ extra->datatype1 = encode_datatype(datatype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(datatype);
extra->send_size = 0;
extra->recvcounts= xbt_malloc(count*sizeof(int));
for(i=0; i< count; i++)//copy data to avoid bad free
extra->send_size = 0;
extra->recvcounts= xbt_malloc(count*sizeof(int));
for(i=0; i< count; i++)//copy data to avoid bad free
- extra->recvcounts[i] = recvcount;
- extra->num_processes = count;
- extra->datatype1 = encode_datatype(datatype);
+ extra->recvcounts[i] = recvcount*dt_size_send;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ALLTOALL;
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ALLTOALL;
- extra->send_size = sendcount;
- extra->recv_size = recvcount;
- extra->datatype1 = encode_datatype(sendtype);
- extra->datatype2 = encode_datatype(recvtype);
-
+ int known=0;
+ extra->datatype1 = encode_datatype(sendtype, &known);
+ if(!known)
+ extra->send_size = sendcount*smpi_datatype_size(sendtype);
+ else
+ extra->send_size = sendcount;
+ extra->datatype2 = encode_datatype(recvtype, &known);
+ if(!known)
+ extra->recv_size = recvcount*smpi_datatype_size(recvtype);
+ else
+ extra->recv_size = recvcount;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
retval = mpi_coll_alltoall_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
retval = mpi_coll_alltoall_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
extra->recv_size = 0;
extra->recvcounts= xbt_malloc(size*sizeof(int));
extra->sendcounts= xbt_malloc(size*sizeof(int));
extra->recv_size = 0;
extra->recvcounts= xbt_malloc(size*sizeof(int));
extra->sendcounts= xbt_malloc(size*sizeof(int));
+ int known=0;
+ extra->datatype1 = encode_datatype(sendtype, &known);
+ int dt_size_send = 1;
+ if(!known)
+ dt_size_send = smpi_datatype_size(sendtype);
+ int dt_size_recv = 1;
+ extra->datatype2 = encode_datatype(recvtype, &known);
+ if(!known)
+ dt_size_recv = smpi_datatype_size(recvtype);
for(i=0; i< size; i++){//copy data to avoid bad free
for(i=0; i< size; i++){//copy data to avoid bad free
- extra->send_size += sendcounts[i];
- extra->recv_size += recvcounts[i];
+ extra->send_size += sendcounts[i]*dt_size_send;
+ extra->recv_size += recvcounts[i]*dt_size_recv;
- extra->sendcounts[i] = sendcounts[i];
- extra->recvcounts[i] = recvcounts[i];
+ extra->sendcounts[i] = sendcounts[i]*dt_size_send;
+ extra->recvcounts[i] = recvcounts[i]*dt_size_recv;
}
extra->num_processes = size;
}
extra->num_processes = size;
-
- extra->datatype1 = encode_datatype(sendtype);
- extra->datatype2 = encode_datatype(recvtype);
-
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
retval =
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
retval =
-const char* encode_datatype(MPI_Datatype datatype)
+const char* encode_datatype(MPI_Datatype datatype, int* known)
{
//default type for output is set to MPI_BYTE
// MPI_DEFAULT_TYPE is not set for output, use directly MPI_BYTE
{
//default type for output is set to MPI_BYTE
// MPI_DEFAULT_TYPE is not set for output, use directly MPI_BYTE
if (datatype==MPI_BYTE){
return "";
}
if (datatype==MPI_BYTE){
return "";
}
return "4";
if(datatype==MPI_FLOAT)
return "5";
return "4";
if(datatype==MPI_FLOAT)
return "5";
+ //tell that the datatype is not handled by replay, and that its size should be measured and replayed as size*MPI_BYTE
+ if(known)*known=0;
// default - not implemented.
// do not warn here as we pass in this function even for other trace formats
return "-1";
// default - not implemented.
// do not warn here as we pass in this function even for other trace formats
return "-1";
extra->send_size = size;
extra->src = rank;
extra->dst = dst_traced;
extra->send_size = size;
extra->src = rank;
extra->dst = dst_traced;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced, size*smpi_datatype_size(MPI_CURRENT_TYPE));
#endif
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced, size*smpi_datatype_size(MPI_CURRENT_TYPE));
#endif
extra->send_size = size;
extra->src = rank;
extra->dst = dst_traced;
extra->send_size = size;
extra->src = rank;
extra->dst = dst_traced;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced, size*smpi_datatype_size(MPI_CURRENT_TYPE));
#endif
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced, size*smpi_datatype_size(MPI_CURRENT_TYPE));
#endif
extra->send_size = size;
extra->src = src_traced;
extra->dst = rank;
extra->send_size = size;
extra->src = src_traced;
extra->dst = rank;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
#endif
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
#endif
extra->send_size = size;
extra->src = src_traced;
extra->dst = rank;
extra->send_size = size;
extra->src = src_traced;
extra->dst = rank;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
#endif
MPI_Status status;
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
#endif
MPI_Status status;
extra->type = TRACING_BCAST;
extra->send_size = size;
extra->root = root_traced;
extra->type = TRACING_BCAST;
extra->send_size = size;
extra->root = root_traced;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
#endif
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
#endif
extra->type = TRACING_REDUCE;
extra->send_size = comm_size;
extra->comp_size = comp_size;
extra->type = TRACING_REDUCE;
extra->send_size = comm_size;
extra->comp_size = comp_size;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
extra->root = root_traced;
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
extra->root = root_traced;
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,extra);
extra->type = TRACING_ALLREDUCE;
extra->send_size = comm_size;
extra->comp_size = comp_size;
extra->type = TRACING_ALLREDUCE;
extra->send_size = comm_size;
extra->comp_size = comp_size;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
extra->type = TRACING_ALLTOALL;
extra->send_size = send_size;
extra->recv_size = recv_size;
extra->type = TRACING_ALLTOALL;
extra->send_size = send_size;
extra->recv_size = recv_size;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
extra->send_size = send_size;
extra->recv_size = recv_size;
extra->root = root;
extra->send_size = send_size;
extra->recv_size = recv_size;
extra->root = root;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
TRACE_smpi_collective_in(smpi_process_index(), root, __FUNCTION__, extra);
#endif
TRACE_smpi_collective_in(smpi_process_index(), root, __FUNCTION__, extra);
#endif
extra->recvcounts[i] = recvcounts[i];
extra->root = root;
extra->num_processes = comm_size;
extra->recvcounts[i] = recvcounts[i];
extra->root = root;
extra->num_processes = comm_size;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
TRACE_smpi_collective_in(smpi_process_index(), root, __FUNCTION__, extra);
#endif
TRACE_smpi_collective_in(smpi_process_index(), root, __FUNCTION__, extra);
#endif
extra->recvcounts= xbt_malloc(comm_size*sizeof(int));
for(i=0; i< comm_size; i++)//copy data to avoid bad free
extra->recvcounts[i] = recvcounts[i];
extra->recvcounts= xbt_malloc(comm_size*sizeof(int));
for(i=0; i< comm_size; i++)//copy data to avoid bad free
extra->recvcounts[i] = recvcounts[i];
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
extra->comp_size = comp_size;
extra->num_processes = comm_size;
extra->comp_size = comp_size;
extra->num_processes = comm_size;
extra->type = TRACING_ALLGATHER;
extra->send_size = sendcount;
extra->recv_size= recvcount;
extra->type = TRACING_ALLGATHER;
extra->send_size = sendcount;
extra->recv_size= recvcount;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2);
+ 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);
extra->num_processes = smpi_comm_size(MPI_COMM_WORLD);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
extra->recvcounts= xbt_malloc(comm_size*sizeof(int));
for(i=0; i< comm_size; i++)//copy data to avoid bad free
extra->recvcounts[i] = recvcounts[i];
extra->recvcounts= xbt_malloc(comm_size*sizeof(int));
for(i=0; i< comm_size; i++)//copy data to avoid bad free
extra->recvcounts[i] = recvcounts[i];
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
extra->num_processes = comm_size;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
extra->num_processes = comm_size;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
extra->recv_size += recvcounts[i];
extra->recvcounts[i] = recvcounts[i];
}
extra->recv_size += recvcounts[i];
extra->recvcounts[i] = recvcounts[i];
}
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
#endif