Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into clean_events
[simgrid.git] / src / smpi / smpi_replay.cpp
index 558d0ec..9ba7295 100644 (file)
@@ -52,7 +52,7 @@ static void set_reqq_self(std::vector<MPI_Request> *mpi_request)
 //allocate a single buffer for all sends, growing it if needed
 void* smpi_get_tmp_sendbuffer(int size)
 {
-  if (!smpi_process()->replaying())
+  if (not smpi_process()->replaying())
     return xbt_malloc(size);
   if (sendbuffer_size<size){
     sendbuffer=static_cast<char*>(xbt_realloc(sendbuffer,size));
@@ -63,7 +63,7 @@ void* smpi_get_tmp_sendbuffer(int size)
 
 //allocate a single buffer for all recv
 void* smpi_get_tmp_recvbuffer(int size){
-  if (!smpi_process()->replaying())
+  if (not smpi_process()->replaying())
     return xbt_malloc(size);
   if (recvbuffer_size<size){
     recvbuffer=static_cast<char*>(xbt_realloc(recvbuffer,size));
@@ -73,7 +73,7 @@ void* smpi_get_tmp_recvbuffer(int size){
 }
 
 void smpi_free_tmp_buffer(void* buf){
-  if (!smpi_process()->replaying())
+  if (not smpi_process()->replaying())
     xbt_free(buf);
 }
 
@@ -164,8 +164,8 @@ static void action_init(const char *const *action)
 {
   XBT_DEBUG("Initialize the counters");
   CHECK_ACTION_PARAMS(action, 0, 1)
-  if(action[2]) 
-    MPI_DEFAULT_TYPE=MPI_DOUBLE; // default MPE dataype 
+  if(action[2])
+    MPI_DEFAULT_TYPE=MPI_DOUBLE; // default MPE dataype
   else MPI_DEFAULT_TYPE= MPI_BYTE; // default TAU datatype
 
   /* start a simulated timer */
@@ -236,7 +236,7 @@ static void action_send(const char *const *action)
   extra->dst = dst_traced;
   extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
   TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
-  if (!TRACE_smpi_view_internals())
+  if (not TRACE_smpi_view_internals())
     TRACE_smpi_send(rank, rank, dst_traced, 0, size*MPI_CURRENT_TYPE->size());
 
   Request::send(nullptr, size, MPI_CURRENT_TYPE, to , 0, MPI_COMM_WORLD);
@@ -253,9 +253,9 @@ static void action_Isend(const char *const *action)
   double size=parse_double(action[3]);
   double clock = smpi_process()->simulated_elapsed();
 
-  if(action[4]) 
+  if(action[4])
     MPI_CURRENT_TYPE=decode_datatype(action[4]);
-  else 
+  else
     MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
 
   int rank = smpi_process()->index();
@@ -267,7 +267,7 @@ static void action_Isend(const char *const *action)
   extra->dst = dst_traced;
   extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE, nullptr);
   TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
-  if (!TRACE_smpi_view_internals())
+  if (not TRACE_smpi_view_internals())
     TRACE_smpi_send(rank, rank, dst_traced, 0, size*MPI_CURRENT_TYPE->size());
 
   MPI_Request request = Request::isend(nullptr, size, MPI_CURRENT_TYPE, to, 0,MPI_COMM_WORLD);
@@ -286,9 +286,9 @@ static void action_recv(const char *const *action) {
   double clock = smpi_process()->simulated_elapsed();
   MPI_Status status;
 
-  if(action[4]) 
+  if(action[4])
     MPI_CURRENT_TYPE=decode_datatype(action[4]);
-  else 
+  else
     MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
 
   int rank = smpi_process()->index();
@@ -311,7 +311,7 @@ static void action_recv(const char *const *action) {
   Request::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()) {
+  if (not TRACE_smpi_view_internals()) {
     TRACE_smpi_recv(rank, src_traced, rank, 0);
   }
 
@@ -325,9 +325,9 @@ static void action_Irecv(const char *const *action)
   double size=parse_double(action[3]);
   double clock = smpi_process()->simulated_elapsed();
 
-  if(action[4]) 
+  if(action[4])
     MPI_CURRENT_TYPE=decode_datatype(action[4]);
-  else 
+  else
     MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
 
   int rank = smpi_process()->index();
@@ -361,8 +361,8 @@ static void action_test(const char *const *action){
 
   MPI_Request request = get_reqq_self()->back();
   get_reqq_self()->pop_back();
-  //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 
+  //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!=nullptr){
     int rank = smpi_process()->index();
@@ -469,12 +469,12 @@ static void action_bcast(const char *const *action)
   double clock = smpi_process()->simulated_elapsed();
   int root=0;
   /* Initialize MPI_CURRENT_TYPE in order to decrease the number of the checks */
-  MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;  
+  MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
 
   if(action[3]) {
     root= atoi(action[3]);
     if(action[4])
-      MPI_CURRENT_TYPE=decode_datatype(action[4]);   
+      MPI_CURRENT_TYPE=decode_datatype(action[4]);
   }
 
   int rank = smpi_process()->index();
@@ -755,8 +755,8 @@ static void action_allgather(const char *const *action) {
   double clock = smpi_process()->simulated_elapsed();
 
   CHECK_ACTION_PARAMS(action, 2, 2)
-  int sendcount=atoi(action[2]); 
-  int recvcount=atoi(action[3]); 
+  int sendcount=atoi(action[2]);
+  int recvcount=atoi(action[3]);
 
   MPI_Datatype MPI_CURRENT_TYPE2 = MPI_DEFAULT_TYPE;
 
@@ -964,7 +964,7 @@ void smpi_replay_main(int* argc, char*** argv)
   /* and now, finalize everything */
   /* One active process will stop. Decrease the counter*/
   XBT_DEBUG("There are %zu elements in reqq[*]", get_reqq_self()->size());
-  if (!get_reqq_self()->empty()){
+  if (not get_reqq_self()->empty()) {
     unsigned int count_requests=get_reqq_self()->size();
     MPI_Request requests[count_requests];
     MPI_Status status[count_requests];