Skip to content
Snippets Groups Projects
cl_check.py 888 B
Newer Older
import sys
import os
import numpy as N
import decomp as D

if len(sys.argv) < 6:
    print('USAGE: %s <nranks> <ngName> <exeName> <maxAspectRatio> <outBase>' % sys.argv[0])
    sys.exit(-1)

nranks = int(sys.argv[1])
ngName = sys.argv[2]
exeName = sys.argv[3]
maxAspectRatio = float(sys.argv[4])
outBase = sys.argv[5]

ngArr = N.loadtxt(ngName)

for ng in ngArr:
    d3ds = D.filterNgNranks(ng, nranks, maxAspectRatio)
    for d3d in d3ds:
        t3d = d3d[1]
        tmpBase = '%s_%d_%d_%d_%d_%d' % (outBase,nranks,ng,t3d[0],t3d[1],t3d[2])
        outName = tmpBase + '.out.txt'
        errName = tmpBase + '.err.txt'
        datName = tmpBase + '.data.txt'
        cmd = '%s %d %d %d %d %d %d %d 1> %s 2> %s' % (exeName,ng,ng,ng,nranks,t3d[0],t3d[1],t3d[2],outName,errName)
        os.system(cmd)
        os.system('touch error.data')
        os.system('mv error.data %s' % datName )