-
Notifications
You must be signed in to change notification settings - Fork 7
/
batch.py
24 lines (20 loc) · 1.08 KB
/
batch.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
import subprocess
import os
from os import listdir
from os.path import isfile, join
inputFolderPath = os.path.realpath('.') + '/input/'
progPath = os.path.realpath('.') + '/build/DOT_bin'
envSetStr = 'export LD_LIBRARY_PATH=/usr/local/lib\n'
NTSetStr0 = 'export MKL_NUM_THREADS=' # for Ubuntu or Mac when CHOLMOD is compiled with MKL LAPACK and BLAS
NTSetStr1 = 'export OMP_NUM_THREADS=' # for Ubuntu when CHOLMOD is compiled with libopenblas
NTSetStr2 = 'export VECLIB_MAXIMUM_THREADS=' # for Mac when CHOLMOD is compiled with default LAPACK and BLAS
for numOfThreads in ['1', '8', '12', '32']:
inputFolderPath = os.path.realpath('.') + '/input/' + numOfThreads + '/'
onlyfiles = [f for f in listdir(inputFolderPath) if isfile(join(inputFolderPath, f))]
for inputModelNameI in onlyfiles:
runCommand = envSetStr + NTSetStr0 + numOfThreads + '\n'
runCommand += NTSetStr1 + numOfThreads + '\n'
runCommand += NTSetStr2 + numOfThreads + '\n'
runCommand += progPath + ' 10 ' + inputFolderPath + inputModelNameI + ' t' + numOfThreads
if subprocess.call([runCommand], shell=True):
continue