Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reactivate the last MBI generator now that it produces tests that compile
[simgrid.git] / teshsuite / smpi / MBI / P2PProbeGenerator.py
index 545ca093957ba6564c401b44618f1f3d73ce0018..a5bc12f9ae1a6827345eb46d1fa67e70afe4a558 100755 (executable)
@@ -11,17 +11,17 @@ template = """// @{generatedby}@
   Description: @{shortdesc}@
     @{longdesc}@
 
-       Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+  Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
 
 BEGIN_MPI_FEATURES
-       P2P!basic: @{p2pfeature}@ 
-       P2P!nonblocking: @{ip2pfeature}@
-       P2P!persistent: Lacking
-       COLL!basic: Lacking
-       COLL!nonblocking: Lacking
-       COLL!persistent: Lacking
-       COLL!tools: Lacking
-       RMA: Lacking
+  P2P!basic: @{p2pfeature}@
+  P2P!nonblocking: @{ip2pfeature}@
+  P2P!persistent: Lacking
+  COLL!basic: Lacking
+  COLL!nonblocking: Lacking
+  COLL!persistent: Lacking
+  COLL!tools: Lacking
+  RMA: Lacking
 END_MPI_FEATURES
 
 BEGIN_MBI_TESTS
@@ -39,10 +39,10 @@ END_MBI_TESTS
 int main(int argc, char **argv) {
   int nprocs = -1;
   int rank = -1;
-       MPI_Status sta;
-       int src,dest;
-       int stag=0, rtag=0;
-       int buff_size = 1;
+  MPI_Status sta;
+  int src,dest;
+  int stag=0, rtag=0;
+  int buff_size = 1;
 
   MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
@@ -52,8 +52,8 @@ int main(int argc, char **argv) {
   if (nprocs < 2)
     printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
 
-       MPI_Comm newcom = MPI_COMM_WORLD;
-       MPI_Datatype type = MPI_INT;
+  MPI_Comm newcom = MPI_COMM_WORLD;
+  MPI_Datatype type = MPI_INT;
 
   @{init1a}@
   @{init1b}@
@@ -62,23 +62,23 @@ int main(int argc, char **argv) {
   @{init2b}@
   @{init2c}@
 
-       if (rank == 0) {
-               dest=1, src=1;
-       @{operation1a}@ /* MBIERROR1 */
-       @{operation1b}@ 
-       @{operation1c}@ 
+  if (rank == 0) {
+    dest=1, src=1;
+    @{operation1a}@ /* MBIERROR1 */
+    @{operation1b}@
+    @{operation1c}@
     @{fini1a}@
     @{fini1b}@
     @{fini1c}@
-       }else if (rank == 1){
-               dest=0, src=0;
-       @{operation2a}@ /* MBIERROR2 */
-       @{operation2b}@ 
-       @{operation2c}@ 
+  }else if (rank == 1){
+    dest=0, src=0;
+    @{operation2a}@ /* MBIERROR2 */
+    @{operation2b}@
+    @{operation2c}@
     @{fini2a}@
     @{fini2b}@
     @{fini2c}@
-       }
+  }
   @{free1a}@
   @{free1b}@
   @{free1c}@
@@ -128,20 +128,20 @@ for p in probe:
             patterns['operation2a'] = operation[p]("1")
             patterns['operation2b'] = operation[r]("3")
             patterns['operation2c'] = operation[s]("4")
-    
-            # Generate the incorrect matching 
-            replace = patterns 
+
+            # Generate the incorrect matching
+            replace = patterns
             replace['shortdesc'] = 'MPI_Probe is called before MPI_Recv.'
             replace['longdesc'] = 'MPI_Probe is a blocking call that returns only after a matching message has been found. By calling MPI_Probe before MPI_Recv, a deadlock is created.'
-            replace['outcome'] = 'ERROR: CallMatching' 
-            replace['errormsg'] = 'P2P mistmatch. @{p}@ at @{filename}@:@{line:MBIERROR1}@ and @{filename}@:@{line:MBIERROR2}@ are called before @{r}@.' 
+            replace['outcome'] = 'ERROR: CallMatching'
+            replace['errormsg'] = 'P2P mistmatch. @{p}@ at @{filename}@:@{line:MBIERROR1}@ and @{filename}@:@{line:MBIERROR2}@ are called before @{r}@.'
             make_file(template, f'CallOrdering_{p}_{r}_{s}_nok.c', replace)
 
-            # Generate a correct matching 
-            replace = patterns 
+            # Generate a correct matching
+            replace = patterns
             replace['shortdesc'] = 'Correct use of MPI_Probe.'
             replace['longdesc'] = 'Correct use of MPI_Probe.'
-            replace['outcome'] = 'OK' 
+            replace['outcome'] = 'OK'
             replace['errormsg'] = 'OK'
             replace['operation1a'] = operation[s]("1")
             replace['operation1b'] = operation[p]("1")