Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[MBI] Replace more wildard imports.
[simgrid.git] / teshsuite / smpi / MBI / simgrid.py
index 8e39b13..947bcce 100644 (file)
@@ -3,9 +3,10 @@
 
 import re
 import os
-from MBIutils import *
+import subprocess
+import MBIutils as mbi
 
-class Tool(AbstractTool):
+class Tool(mbi.AbstractTool):
     def identify(self):
         return "SimGrid wrapper"
 
@@ -31,14 +32,14 @@ class Tool(AbstractTool):
 
 
     def ensure_image(self):
-        AbstractTool.ensure_image(self, "-x simgrid")
+        mbi.AbstractTool.ensure_image(self, "-x simgrid")
 
     def setup(self, rootdir):
         os.environ['PATH'] = os.environ['PATH'] + ":" + rootdir + "/builds/SimGrid/bin"
         os.environ['VERBOSE'] = '1'
 
-    def run(self, execcmd, filename, binary, id, timeout, batchinfo):
-        cachefile = f'{binary}_{id}'
+    def run(self, execcmd, filename, binary, num_id, timeout, batchinfo):
+        cachefile = f'{binary}_{num_id}'
 
         if not os.path.exists("cluster.xml"):
             with open('cluster.xml', 'w') as outfile:
@@ -53,7 +54,7 @@ class Tool(AbstractTool):
         execcmd = execcmd.replace('$zero_buffer', "--cfg=smpi/buffering:zero")
         execcmd = execcmd.replace('$infty_buffer', "--cfg=smpi/buffering:infty")
 
-        run_cmd(
+        mbi.run_cmd(
             buildcmd=f"smpicc {filename} -trace-call-location -g -Wl,-znorelro -Wl,-znoseparate-code -o {binary}",
             execcmd=execcmd,
             cachefile=cachefile,
@@ -64,7 +65,7 @@ class Tool(AbstractTool):
 
     def teardown(self):
         subprocess.run("find -type f -a -executable | xargs rm -f", shell=True, check=True) # Remove generated cruft (binary files)
-        subprocess.run("rm -f smpitmp-* core", shell=True, check=True) 
+        subprocess.run("rm -f smpitmp-* core", shell=True, check=True)
 
     def parse(self, cachefile):
         if os.path.exists(f'{cachefile}.timeout') or os.path.exists(f'logs/simgrid/{cachefile}.timeout'):
@@ -100,7 +101,7 @@ class Tool(AbstractTool):
         if re.search('DFS exploration ended.', output):
             return 'OK'
 
-        print (f">>>>[ INCONCLUSIVE ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ({cachefile})")
+        print(f">>>>[ INCONCLUSIVE ]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ({cachefile})")
         print(output)
-        print ("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")
+        print("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")
         return 'other'