Skip to content

Commit

Permalink
check is ect has already been done on combination
Browse files Browse the repository at this point in the history
  • Loading branch information
teopb committed Aug 3, 2023
1 parent 28f8168 commit 9905d72
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions MPAS_true_failure_testing/post_run_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,41 @@ def main(argv):
# test folder name (change from negative to positive)
test_folder = f"{var_name}_perturb_neg{order}"

# Create symlinks to history files
output_folder = test_output_dir + "/" + test_folder
# check if pca values have already been calculated for this variable perturbation combo?
if os.path.isfile(f"{test_output_dir}/{test_folder}/pca.npy"):
print(f"Existing PCA file found for {var_name}_perturb_neg{order}")
else:
# Create symlinks to history files
output_folder = test_output_dir + "/" + test_folder

command = f"find {test_output_dir}/{test_folder}/{test_folder}* -name \"history_full*\" -exec cp -s '{{}}' {test_output_dir}/{test_folder}/history_files/ \;"

os.system(command)
# print(command)

# Run PyCECT
args_for_ECT = [f'--sumfile={true_sum_file}', f"--indir={test_output_dir}/{test_folder}/history_files", f"--tslice={t_slice}", f"--nPC={PCA_dims}", "--mpas", f"--eet={verify_runs}", f"--savePCAMat={test_output_dir}/{test_folder}/pca.npy", f"--saveEET={test_output_dir}/{test_folder}/eet.npy", "mpi_enable"]
ECT(args_for_ECT)

command = f"find {test_output_dir}/{test_folder}/{test_folder}* -name \"history_full*\" -exec cp -s '{{}}' {test_output_dir}/{test_folder}/history_files/ \;"

os.system(command)
# print(command)

# Run PyCECT
args_for_ECT = [f'--sumfile={true_sum_file}', f"--indir={test_output_dir}/{test_folder}/history_files", f"--tslice={t_slice}", f"--nPC={PCA_dims}", "--mpas", f"--eet={verify_runs}", f"--savePCAMat={test_output_dir}/{test_folder}/pca.npy", f"--saveEET={test_output_dir}/{test_folder}/eet.npy", "mpi_enable"]
ECT(args_for_ECT)
for order in neg_test_orders:
# test folder name (positive)
test_folder = f"{var_name}_perturb_{order}"

# check if pca values have already been calculated for this variable perturbation combo?
if os.path.isfile(f"{test_output_dir}/{test_folder}/pca.npy"):
print(f"Existing PCA file found for {var_name}_perturb_neg{order}")
else:
# Create symlinks to history files
output_folder = test_output_dir + "/" + test_folder

command = f"find {test_output_dir}/{test_folder}/{test_folder}* -name \"history_full*\" -exec cp -s '{{}}' {test_output_dir}/{test_folder}/history_files/ \;"

os.system(command)
# print(command)

# Run PyCECT
args_for_ECT = [f'--sumfile={true_sum_file}', f"--indir={test_output_dir}/{test_folder}/history_files", f"--tslice={t_slice}", f"--nPC={PCA_dims}", "--mpas", f"--eet={verify_runs}", f"--savePCAMat={test_output_dir}/{test_folder}/pca.npy", f"--saveEET={test_output_dir}/{test_folder}/eet.npy", "mpi_enable"]
ECT(args_for_ECT)



Expand Down

0 comments on commit 9905d72

Please sign in to comment.