Skip to content

Commit

Permalink
Added logic to testing script to detect slurm environment for quick_run
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas R Timmerman committed Sep 18, 2024
1 parent ef868ee commit a81ed01
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
-Name
-changes

--------------
September 18, 2024
Name: Lucas Timmerman
Changes: (tests/SPARC_testing_script.py)
1. Logic for detection of slurm environment to construct run commands for
quick_run tests

--------------
September 09, 2024
Name: Shashikant Kumar
Expand Down
18 changes: 14 additions & 4 deletions tests/SPARC_testing_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,16 @@ def WriteReport(data_info, systems, isparallel, ifVHQ, isorient):
print('\n')
elif isAuto == True and temp_result == False:
countrun=0
try:
subprocess.run(
'squeue',
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=True
)
cmd = 'srun '
except FileNotFoundError:
cmd = 'mpirun '
for systs in systems:
print(str(countrun)+": "+systs+" started running")
os.chdir(systs)
Expand All @@ -3230,7 +3240,7 @@ def WriteReport(data_info, systems, isparallel, ifVHQ, isorient):
os.system("cp standard/*.ion ./temp_run/")
# os.system("cp ./*.psp8 ./temp_run/")
os.chdir("temp_run")
os.system("./../../sparc -name "+systs+" > log")
os.system(cmd+"./../../sparc -name "+systs+" > log")
else:
if os.path.exists("temp_run1"):
os.system("rm -r temp_run1")
Expand All @@ -3244,7 +3254,7 @@ def WriteReport(data_info, systems, isparallel, ifVHQ, isorient):
os.system("cp standard_orientation1/*.ion ./temp_run1/")
# os.system("cp ./*.psp8 ./temp_run1/")
os.chdir("temp_run1")
os.system("./../../sparc -name "+systs+" > log")
os.system(cmd+"./../../sparc -name "+systs+" > log")

os.chdir("./..")
if os.path.exists("temp_run2"):
Expand All @@ -3260,7 +3270,7 @@ def WriteReport(data_info, systems, isparallel, ifVHQ, isorient):
# os.system("cp ./*.psp8 ./temp_run2/")

os.chdir("temp_run2")
os.system("./../../sparc -name "+systs+" > log")
os.system(cmd+"./../../sparc -name "+systs+" > log")
os.chdir("./..")
if os.path.exists("temp_run3"):
os.system("rm -r temp_run3")
Expand All @@ -3274,7 +3284,7 @@ def WriteReport(data_info, systems, isparallel, ifVHQ, isorient):
os.system("cp standard_orientation3/*.ion ./temp_run3/")
# os.system("cp ./*.psp8 ./temp_run3/")
os.chdir("temp_run3")
os.system("./../../sparc -name "+systs+" > log")
os.system(cmd+"./../../sparc -name "+systs+" > log")
countrun=countrun+1
print(str(countrun)+": "+systs+" has finished running")
os.chdir("./../..")
Expand Down

0 comments on commit a81ed01

Please sign in to comment.