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")
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_tst01')
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",
"Cubo986.msh")
78 if not os.path.isfile(inputfn) :
79 error(inputfn+
' is an invalid input file name.', 1)
81 arguments =
' -mc '+inputfn
82 arguments = arguments +
' -nsub 64' 83 arguments = arguments +
' -nt_a 1' 84 arguments = arguments +
' -nt_d 1' 85 arguments = arguments +
' -nt_m 1' 86 arguments = arguments +
' -nt_sm 1' 87 arguments = arguments +
' -p 2' 88 for rdtarg
in rdtfiles_l :
89 arguments = arguments +
' ' + rdtarg[1] +
' ' + rdtarg[2]
91 return rundir, executable+arguments
94 limits = {
"cpu" : (resource.RLIMIT_CPU, 60,
"Max CPU time in seconds"),
105 print "Setting resource limit in child" 106 for k, v
in limits.iteritems() :
107 resource.setrlimit(v[0], (v[1],v[1]))
113 for f
in rdtfiles_l :
115 rdt_fn = os.path.join(rundir,f[2])
117 results[rdt_id] = (rdt_fn, rdt_dsc)
125 args = shlex.split(cmd)
128 for i
in range(ntimes) :
129 p = subprocess.Popen(args, preexec_fn=setlimits, stdout=sout, stderr=serr, cwd=rundir)
131 if (p.returncode != 0) :
132 return p.returncode, {}
def sumarize_rdt_files(rundir)
def error(message, status)