|
26 | 26 | num_threads = opts["threads"] |
27 | 27 |
|
28 | 28 | # Adding --ciRun to the command line arguments of spheral-ats |
29 | | -# triggers move of Caliper files to benchmark location |
30 | | -benchmark_dir = None |
31 | 29 | test_runs = 1 # Number of times to run each test |
32 | | -CIRun = False |
33 | 30 | if "cirun" in opts and opts["cirun"]: |
34 | | - CIRun = True |
35 | 31 | test_runs = 3 |
36 | | - benchmark_dir = opts["benchmark_dir"] |
37 | 32 | is_rerun = False |
38 | 33 | if "rerun" in opts and opts["rerun"]: |
39 | 34 | is_rerun = True |
40 | 35 | #--------------------------------------------------------------------------- |
41 | 36 | # Hardware configuration |
42 | 37 | #--------------------------------------------------------------------------- |
43 | | -# This should be {$SYS_TYPE}_{compiler name}_{compiler version}_{mpi or cuda info} |
44 | | -spheral_install_config = SpheralConfigs.config() |
45 | 38 | mpi_enabled = SpheralConfigs.mpi_enabled() |
46 | 39 | # Retrieve the host name and remove any numbers |
47 | 40 | temp_uname = os.uname() |
|
65 | 58 | def gather_files(manager): |
66 | 59 | ''' |
67 | 60 | Function to gather Caliper file when ATS is finished running. |
68 | | - Used by ATS for gathering benchmark Caliper files. |
69 | 61 | ''' |
70 | | - instpath = os.path.join(benchmark_dir, spheral_install_config) |
71 | | - macpath = os.path.join(instpath, hostname) |
72 | | - outdir = os.path.join(macpath, "latest") |
73 | | - if (not is_rerun): |
74 | | - if (os.path.exists(outdir)): |
75 | | - # Move existing benchmark data to a different directory |
76 | | - log(f"Renaming existing {outdir} to {int(time.time())}", echo=True) |
77 | | - os.rename(outdir, os.path.join(macpath, f"{int(time.time())}")) |
78 | | - log(f"Creating {outdir}", echo=True) |
79 | | - os.makedirs(outdir) |
80 | 62 | filtered = [test for test in manager.testlist if test.status is PASSED] |
81 | | - # Set read/write/execute permissions for owner and group |
82 | | - perms = stat.S_IRWXU | stat.S_IRWXG |
| 63 | + logdir = log.directory |
| 64 | + log(f"Copying caliper files to {logdir}") |
83 | 65 | for test in filtered: |
84 | 66 | run_dir = test.directory |
85 | 67 | cali_filename = test.options["caliper_filename"] |
86 | 68 | cfile = os.path.join(run_dir, cali_filename) |
87 | 69 | test_name = test.options["label"] |
88 | | - outfile = os.path.join(outdir, cali_filename) |
89 | | - log(f"Moving {cali_filename} to {outdir}", echo=True) |
90 | | - if (CIRun): |
91 | | - shutil.move(cfile, outfile) |
92 | | - os.chmod(outfile, perms) |
93 | | - shutil.chown(outfile, group="sduser") |
94 | | - if (CIRun): |
95 | | - cpaths = [outdir, macpath, instpath, benchmark_dir] |
96 | | - for p in cpaths: |
97 | | - os.chmod(p, perms) |
98 | | - shutil.chown(p, group="sduser") |
| 70 | + outfile = os.path.join(logdir, cali_filename) |
| 71 | + shutil.move(cfile, outfile) |
99 | 72 |
|
100 | 73 | # If running CI, run gather_files on exit |
101 | | -if (benchmark_dir): |
102 | | - onExit(gather_files) |
| 74 | +onExit(gather_files) |
103 | 75 | glue(keep=True, independent=True, ngpu=0, nt=1) |
104 | 76 |
|
105 | 77 | #--------------------------------------------------------------------------- |
|
0 commit comments