Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Indent the rest of the code (examples, buildtools, doc...) except for examples/SMPI...
[simgrid.git] / examples / smpi / ttest01.c
index 848cfe8..2324eeb 100644 (file)
@@ -16,28 +16,28 @@ int main(int argc, char *argv[])
   int rank, numprocs, tag = 0;
   int *r = malloc(sizeof(int) * DATATOSENT);
 
-  MPI_Init(&argc,&argv);
+  MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 
-  TRACE_smpi_set_category ("A"); 
-  if (rank == 0){
+  TRACE_smpi_set_category("A");
+  if (rank == 0) {
     MPI_Send(r, DATATOSENT, MPI_INT, 1, tag, MPI_COMM_WORLD);
-  }else if (rank == 1){
+  } else if (rank == 1) {
     MPI_Recv(r, DATATOSENT, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
-  }else{ 
+  } else {
     //do nothing
   }
-  TRACE_smpi_set_category ("B"); 
-  if (rank == 0){
+  TRACE_smpi_set_category("B");
+  if (rank == 0) {
     MPI_Recv(r, DATATOSENT, MPI_INT, 1, tag, MPI_COMM_WORLD, &status);
-  }else if (rank == 1){
+  } else if (rank == 1) {
     MPI_Send(r, DATATOSENT, MPI_INT, 0, tag, MPI_COMM_WORLD);
-  }else{ 
+  } else {
     //do nothing
   }
-  TRACE_smpi_set_category ("C"); 
-  MPI_Barrier (MPI_COMM_WORLD);
+  TRACE_smpi_set_category("C");
+  MPI_Barrier(MPI_COMM_WORLD);
   MPI_Finalize();
   return 0;
 }