From be182854562c0757a7dbff16045d1a17c8b20aa8 Mon Sep 17 00:00:00 2001 From: Chao Peng <cpeng@anl.gov> Date: Sun, 20 Jun 2021 21:44:51 -0500 Subject: [PATCH] update script --- benchmarks/imaging_shower_ML/sim_rec_tag.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/benchmarks/imaging_shower_ML/sim_rec_tag.py b/benchmarks/imaging_shower_ML/sim_rec_tag.py index 370e2ca3..13e67afa 100755 --- a/benchmarks/imaging_shower_ML/sim_rec_tag.py +++ b/benchmarks/imaging_shower_ML/sim_rec_tag.py @@ -38,6 +38,7 @@ tag_dir = os.path.join('tag_data', '{nametag}_{pmin}_{pmax}'.format(**kwargs)) os.makedirs(tag_dir, exist_ok=True) procs = [p.strip() for p in args.process.split(',')] +sdir = os.path.dirname(os.path.realpath(__file__)) if 'sim' in procs: # generate particles @@ -60,6 +61,7 @@ if 'sim' in procs: if args.seed > 0: sim_cmd += ['--random.seed', args.seed] return_code = subprocess.run(sim_cmd).returncode + print(return_code) if return_code is not None and return_code < 0: print("ERROR running simulation!") exit(return_code) @@ -76,8 +78,9 @@ if 'rec' in procs: os.environ['IMCAL_ML_N_HITS'] = '{}'.format(args.nhit) juggler_xenv = os.path.join(os.environ.get('JUGGLER_INTALL_PREFIX', '../local'), 'Juggler.xenv') - rec_cmd = ['xenv', '-x', juggler_xenv, 'gaudirun.py', 'options/imaging_ml_data.py'] + rec_cmd = ['xenv', '-x', juggler_xenv, 'gaudirun.py', os.path.join(sdir, 'options', 'imaging_ml_data.py')] return_code = subprocess.run(rec_cmd).returncode + print(return_code) if return_code is not None and return_code < 0: print("ERROR running juggler (reconstruction)!") exit(return_code) @@ -85,10 +88,11 @@ if 'rec' in procs: if 'tag' in procs: - tag_cmd = ['python', 'scripts/prepare_tf_dataset.py', rec_file, + tag_cmd = ['python', os.path.join(sdir, 'scripts', 'prepare_tf_dataset.py'), rec_file, '-o', tag_dir, '--shape', '{nlayer},{nhit},3'.format(**kwargs)] return_code = subprocess.run(tag_cmd).returncode + print(return_code) if return_code is not None and return_code < 0: print("ERROR running ML data tagging!") exit(return_code) -- GitLab