Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] PMPI_Send: Cosmetics
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 3 Jun 2016 10:28:26 +0000 (12:28 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 8 Jun 2016 13:47:20 +0000 (15:47 +0200)
src/smpi/smpi_pmpi.cpp

index a4ee282..3d9c656 100644 (file)
@@ -1173,43 +1173,41 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI
     retval = MPI_SUCCESS;
   } else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0){
     retval = MPI_ERR_RANK;
-  } else if ((count < 0) || (buf==NULL && count > 0)) {
+  } else if ((count < 0) || (buf == nullptr && count > 0)) {
     retval = MPI_ERR_COUNT;
   } else if (!is_datatype_valid(datatype)) {
-      retval = MPI_ERR_TYPE;
-  } else if(tag<0 && tag !=  MPI_ANY_TAG){
+    retval = MPI_ERR_TYPE;
+  } else if(tag < 0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
   } else {
-
-  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_SEND;
-  extra->src = rank;
-  extra->dst = dst_traced;
-  int known=0;
-  extra->datatype1 = encode_datatype(datatype, &known);
-  int dt_size_send = 1;
-  if(known==0)
-    dt_size_send = smpi_datatype_size(datatype);
-  extra->send_size = count*dt_size_send;
-  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
-  if (!TRACE_smpi_view_internals()) {
-    TRACE_smpi_send(rank, rank, dst_traced,count*smpi_datatype_size(datatype));
-  }
+    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_SEND;
+    extra->src             = rank;
+    extra->dst             = dst_traced;
+    int known              = 0;
+    extra->datatype1       = encode_datatype(datatype, &known);
+    int dt_size_send       = 1;
+    if (known == 0) {
+      dt_size_send = smpi_datatype_size(datatype);
+    }
+    extra->send_size = count*dt_size_send;
+    TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
+    if (!TRACE_smpi_view_internals()) {
+      TRACE_smpi_send(rank, rank, dst_traced,count*smpi_datatype_size(datatype));
+    }
 
     smpi_mpi_send(buf, count, datatype, dst, tag, comm);
     retval = MPI_SUCCESS;
 
-  TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+    TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
   }
 
   smpi_bench_begin();
   return retval;
 }
 
-
-
 int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) {
   int retval = 0;