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 -- num_it 1000 - p2 - nsub 128 - 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')
64 if not os.path.isdir(builddir) :
65 error(builddir+
' is an invalid build directory.', 1)
67 rundir = os.path.join(builddir,
'scripts',
'substruct_tst11')
68 if not os.path.isdir(rundir) :
69 error(rundir+
' is an invalid run directory.', 1)
70 if not os.path.isdir(builddir) :
71 error(builddir+
' is an invalid build directory.', 1)
73 executable=os.path.join(builddir,
"progs",
"substruct",
"substruct-perf")
74 if not os.path.isfile(executable) :
75 error(executable+
' is an invalid executable file name.', 1)
77 inputfn = os.path.join(datadir,
"substruct",
"inputs",
"8andares02.txt")
78 if not os.path.isfile(inputfn) :
79 error(inputfn+
' is an invalid input file name.', 1)
81 arguments =
' -mp '+inputfn
82 arguments = arguments +
' -num_it 1000' 89 arguments = arguments +
' -nsub 128' 90 arguments = arguments +
' -nt_a 64' 91 arguments = arguments +
' -nt_d 64' 92 arguments = arguments +
' -nt_m 64' 93 arguments = arguments +
' -nt_sm 64' 94 arguments = arguments +
' -p 2' 95 for rdtarg
in rdtfiles_l :
96 arguments = arguments +
' ' + rdtarg[1] +
' ' + rdtarg[2]
98 return rundir, executable+arguments
102 limits = {
"cpu" : (resource.RLIMIT_CPU, 38400,
"Max CPU user time in seconds (not wall clock time)"),
113 print "Setting resource limit in child" 114 for k, v
in limits.iteritems() :
115 resource.setrlimit(v[0], (v[1],v[1]))
121 for f
in rdtfiles_l :
123 rdt_fn = os.path.join(rundir,f[2])
125 results[rdt_id] = (rdt_fn, rdt_dsc)
133 args = shlex.split(cmd)
136 for i
in range(ntimes) :
137 p = subprocess.Popen(args, preexec_fn=setlimits, stdout=sout, stderr=serr, cwd=rundir)
139 if (p.returncode != 0) :
140 return p.returncode, {}
def sumarize_rdt_files(rundir)
def error(message, status)