-
Notifications
You must be signed in to change notification settings - Fork 1
/
testAll.py
32 lines (25 loc) · 943 Bytes
/
testAll.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/bash
import os, time
from testNameList import nameList, coreNumList
# This script will perform tests on test cases defined in testNameList.
MPIRUN='mpirun' # please modify MPIRUN to fit your system accordingly.
print('testAll: MPIRUN is ', MPIRUN)
print('testAll: please modify MPIRUN to fit your system accordingly.')
os.system('rm -rf test')
os.system('mkdir test')
os.chdir('test')
startTime = time.time()
def runTest(testDir, compSet, coreNum):
cmd = 'create.newcase '+testDir+' '+compSet
os.system(cmd)
os.chdir(testDir)
os.system('./case.setup')
os.system(MPIRUN+' -np '+str(coreNum)+' eqdyna')
os.system('python3 plotRuptureDynamics')
os.chdir('..')
for testName, coreNum in zip(nameList, coreNumList):
runTest(testName, testName, coreNum)
os.chdir('..')
os.system('python3 check.test.py')
endTime = time.time()
print('Time consumed for all the tests are ', endTime-startTime, ' s')