int communicator_size = 0;
static int active_processes = 0;
-xbt_dict_t reqq = NULL;
+xbt_dict_t reqq = nullptr;
MPI_Datatype MPI_DEFAULT_TYPE;
MPI_Datatype MPI_CURRENT_TYPE;
static int sendbuffer_size=0;
-char* sendbuffer=NULL;
+char* sendbuffer=nullptr;
static int recvbuffer_size=0;
-char* recvbuffer=NULL;
+char* recvbuffer=nullptr;
static void log_timed_action (const char *const *action, double clock){
if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){
{
//default type for output is set to MPI_BYTE
// MPI_DEFAULT_TYPE is not set for output, use directly MPI_BYTE
- if(known!=NULL)
+ if(known!=nullptr)
*known=1;
if (datatype==MPI_BYTE){
return "";
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!=NULL)
+ if(known!=nullptr)
*known=0;
// default - not implemented.
// do not warn here as we pass in this function even for other trace formats
#define CHECK_ACTION_PARAMS(action, mandatory, optional) {\
int i=0;\
- while(action[i]!=NULL)\
+ while(action[i]!=nullptr)\
i++;\
if(i<mandatory+2) \
THROWF(arg_error, 0, "%s replay failed.\n" \
/*initialize the number of active processes */
active_processes = smpi_process_count();
- if (reqq==NULL) {
+ if (reqq==nullptr) {
reqq = xbt_dict_new();
}
extra->send_size = size;
extra->src = rank;
extra->dst = dst_traced;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
if (!TRACE_smpi_view_internals()) {
TRACE_smpi_send(rank, rank, dst_traced, size*smpi_datatype_size(MPI_CURRENT_TYPE));
}
- smpi_mpi_send(NULL, size, MPI_CURRENT_TYPE, to , 0, MPI_COMM_WORLD);
+ smpi_mpi_send(nullptr, size, MPI_CURRENT_TYPE, to , 0, MPI_COMM_WORLD);
log_timed_action (action, clock);
extra->send_size = size;
extra->src = rank;
extra->dst = dst_traced;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
if (!TRACE_smpi_view_internals()) {
TRACE_smpi_send(rank, rank, dst_traced, size*smpi_datatype_size(MPI_CURRENT_TYPE));
}
- request = smpi_mpi_isend(NULL, size, MPI_CURRENT_TYPE, to, 0,MPI_COMM_WORLD);
+ request = smpi_mpi_isend(nullptr, size, MPI_CURRENT_TYPE, to, 0,MPI_COMM_WORLD);
TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
request->send = 1;
extra->send_size = size;
extra->src = src_traced;
extra->dst = rank;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
//unknow size from the receiver pov
size=status.count;
}
- smpi_mpi_recv(NULL, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD, &status);
+ smpi_mpi_recv(nullptr, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD, &status);
TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
if (!TRACE_smpi_view_internals()) {
extra->send_size = size;
extra->src = src_traced;
extra->dst = rank;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra);
MPI_Status status;
//unknow size from the receiver pov
size=status.count;
}
- request = smpi_mpi_irecv(NULL, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD);
+ request = smpi_mpi_irecv(nullptr, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD);
TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
request->recv = 1;
//if request is null here, this may mean that a previous test has succeeded
//Different times in traced application and replayed version may lead to this
//In this case, ignore the extra calls.
- if(request!=NULL){
+ if(request!=nullptr){
int rank = smpi_process_index();
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type=TRACING_TEST;
flag = smpi_mpi_test(&request, &status);
XBT_DEBUG("MPI_Test result: %d", flag);
- /* push back request in dynar to be caught by a subsequent wait. if the test did succeed, the request is now NULL.*/
+ /* push back request in dynar to be caught by a subsequent wait. if the test did succeed, the request is now nullptr.*/
xbt_dynar_push_as(get_reqq_self(),MPI_Request, request);
TRACE_smpi_testing_out(rank);
xbt_str_join_array(action," "));
request = xbt_dynar_pop_as(get_reqq_self(),MPI_Request);
- if (request==NULL){
+ if (request==nullptr){
/* Assume that the trace is well formed, meaning the comm might have been caught by a MPI_test. Then just return.*/
return;
}
xbt_dynar_foreach(get_reqq_self(),i,requests[i]);
//save information from requests
- xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), NULL);
- xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), NULL);
- xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), NULL);
+ xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), nullptr);
+ xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), nullptr);
+ xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), nullptr);
for (i = 0; static_cast<int>(i) < count_requests; i++) {
if(requests[i]){
int *asrc = xbt_new(int, 1);
extra->type = TRACING_BCAST;
extra->send_size = size;
extra->root = root_traced;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
void *sendbuf = smpi_get_tmp_sendbuffer(size* smpi_datatype_size(MPI_CURRENT_TYPE));
extra->type = TRACING_REDUCE;
extra->send_size = comm_size;
extra->comp_size = comp_size;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
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->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
void *recvbuf = smpi_get_tmp_sendbuffer(comm_size* smpi_datatype_size(MPI_CURRENT_TYPE));
extra->type = TRACING_ALLTOALL;
extra->send_size = send_size;
extra->recv_size = recv_size;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
}
void *send = smpi_get_tmp_sendbuffer(send_size* smpi_datatype_size(MPI_CURRENT_TYPE));
- void *recv = NULL;
+ void *recv = nullptr;
int root=0;
if(action[4])
root=atoi(action[4]);
extra->send_size = send_size;
extra->recv_size = recv_size;
extra->root = root;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
TRACE_smpi_collective_in(smpi_process_index(), root, __FUNCTION__, extra);
MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
}
void *send = smpi_get_tmp_sendbuffer(send_size* smpi_datatype_size(MPI_CURRENT_TYPE));
- void *recv = NULL;
+ void *recv = nullptr;
for(i=0;i<comm_size;i++) {
recvcounts[i] = atoi(action[i+3]);
recv_sum=recv_sum+recvcounts[i];
extra->recvcounts[i] = recvcounts[i];
extra->root = root;
extra->num_processes = comm_size;
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
TRACE_smpi_collective_in(smpi_process_index(), root, __FUNCTION__, extra);
extra->recvcounts= xbt_new(int, comm_size);
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, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
extra->comp_size = comp_size;
extra->num_processes = comm_size;
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->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
extra->num_processes = smpi_comm_size(MPI_COMM_WORLD);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
extra->recvcounts= xbt_new(int, comm_size);
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, NULL);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
extra->num_processes = comm_size;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
extra->recv_size += recvcounts[i];
extra->recvcounts[i] = recvcounts[i];
}
- extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, NULL);
- extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, NULL);
+ extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
+ extra->datatype2 = encode_datatype(MPI_CURRENT_TYPE2, nullptr);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
xbt_free(sendbuffer);
xbt_free(recvbuffer);
xbt_dict_free(&reqq); //not need, data have been freed ???
- reqq = NULL;
+ reqq = nullptr;
}
instr_extra_data extra_fin = xbt_new0(s_instr_extra_data_t,1);