28 (
"ass",
"-ass_rdt",
"ass.rdt",
"Assemble: dohrstruct->Assemble(...). Assemble element matrices and decompose matrices."),
29 (
"cre",
"-cre_rdt",
"cre.rdt",
"Create: dohrstruct->Create()"),
30 (
"sol",
"-sol_rdt",
"sol.rdt",
"Solver: cg.Solve(...)"),
31 (
"tot",
"-tot_rdt",
"tot.rdt",
"Total: all the steps"),
32 (
"dohrass",
"-tpz_dohr_ass",
"tpzdohrass.rdt",
"Assemble element matrices"),
33 (
"dohrdec",
"-tpz_dohr_dec",
"tpzdohrdec.rdt",
"Decompose matrices")
36 def short_description() :
return "substructure -- 8andares02.txt -- p1 -- nsub 64 -- 64 threads" 38 def long_description():
39 desc =
"Execute the substruct tool collecting statistics for the following steps:" 40 for rdtarg
in rdtfiles_l :
41 desc = desc +
'\n\t' + rdtarg[0] +
' (' + rdtarg[1] +
' ' + rdtarg [2] +
') : ' + rdtarg[3]
47 import shlex, subprocess
54 builddir=
"@PERFTEST_BASE_DIR@" 55 datadir=
"@PERFTEST_SMALL_DATA_DIR@" 58 sys.stderr.write(
'ERROR (test.py): '+message+
'\n')
65 if not os.path.isdir(builddir) :
66 error(builddir+
' is an invalid build directory.', 1)
68 rundir = os.path.join(builddir,
'scripts',
'substruct_tst04')
69 if not os.path.isdir(rundir) :
70 error(rundir+
' is an invalid run directory.', 1)
71 if not os.path.isdir(builddir) :
72 error(builddir+
' is an invalid build directory.', 1)
74 executable=os.path.join(builddir,
"progs",
"substruct",
"substruct-perf")
75 if not os.path.isfile(executable) :
76 error(executable+
' is an invalid executable file name.', 1)
78 inputfn = os.path.join(datadir,
"substruct",
"inputs",
"8andares02.txt")
79 if not os.path.isfile(inputfn) :
80 error(inputfn+
' is an invalid input file name.', 1)
82 arguments =
' -mp '+inputfn
83 arguments = arguments +
' -nsub 64' 84 arguments = arguments +
' -nt_a 64' 85 arguments = arguments +
' -nt_d 64' 86 arguments = arguments +
' -nt_m 64' 87 arguments = arguments +
' -nt_sm 64' 88 arguments = arguments +
' -p 1' 89 for rdtarg
in rdtfiles_l :
90 arguments = arguments +
' ' + rdtarg[1] +
' ' + rdtarg[2]
92 return rundir, executable+arguments
95 limits = {
"cpu" : (resource.RLIMIT_CPU, 38400,
"Max CPU user time in seconds (not wall clock time)"),
106 print "Setting resource limit in child" 107 for k, v
in limits.iteritems() :
108 resource.setrlimit(v[0], (v[1],v[1]))
114 for f
in rdtfiles_l :
116 rdt_fn = os.path.join(rundir,f[2])
118 results[rdt_id] = (rdt_fn, rdt_dsc)
126 args = shlex.split(cmd)
129 for i
in range(ntimes) :
130 p = subprocess.Popen(args, preexec_fn=setlimits, stdout=sout, stderr=serr, cwd=rundir)
132 if (p.returncode != 0) :
133 return p.returncode, {}
def sumarize_rdt_files(rundir)
def error(message, status)