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")
37 def short_description() :
return "substructure -- 8andares02.txt -- num_it 1000 - p2 - nsub 64 - serial" 39 def long_description():
40 desc =
"Execute the substruct tool collecting statistics for the following steps:" 41 for rdtarg
in rdtfiles_l :
42 desc = desc +
'\n\t' + rdtarg[0] +
' (' + rdtarg[1] +
' ' + rdtarg [2] +
') : ' + rdtarg[3]
48 import shlex, subprocess
55 builddir=
"@PERFTEST_BASE_DIR@" 56 datadir=
"@PERFTEST_SMALL_DATA_DIR@" 59 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_tst06')
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 +
' -num_it 1000' 90 arguments = arguments +
' -nsub 64' 91 arguments = arguments +
' -nt_a 0' 92 arguments = arguments +
' -nt_d 0' 93 arguments = arguments +
' -nt_m 0' 94 arguments = arguments +
' -nt_sm 0' 95 arguments = arguments +
' -p 2' 96 for rdtarg
in rdtfiles_l :
97 arguments = arguments +
' ' + rdtarg[1] +
' ' + rdtarg[2]
99 return rundir, executable+arguments
103 limits = {
"cpu" : (resource.RLIMIT_CPU, 38400,
"Max CPU user time in seconds (not wall clock time)"),
114 print "Setting resource limit in child" 115 for k, v
in limits.iteritems() :
116 resource.setrlimit(v[0], (v[1],v[1]))
122 for f
in rdtfiles_l :
124 rdt_fn = os.path.join(rundir,f[2])
126 results[rdt_id] = (rdt_fn, rdt_dsc)
134 args = shlex.split(cmd)
137 for i
in range(ntimes) :
138 p = subprocess.Popen(args, preexec_fn=setlimits, stdout=sout, stderr=serr, cwd=rundir)
140 if (p.returncode != 0) :
141 return p.returncode, {}
def sumarize_rdt_files(rundir)
def error(message, status)