Commit 0fef33e6 by Uddeepta Deka

check unfinished jobs script added

parent cb93d558
......@@ -4,3 +4,4 @@ __pycache__/
notebooks/test.ipynb
data/
scripts/params.txt
scripts/unfinished_jobs.txt
......@@ -62,7 +62,7 @@
" return Ft_data, Fw_data\n",
"\n",
"def fetch_condor_data(folder_path, **kwargs):\n",
" filetag = 'y_%.3f_q_%.3f_Ml_%.1f_zl_%.1f_dect_%s_fhi_%.1f_zs_%.1f_m1_%.1f_m2_%.1f_approx_%s_deltaf_%.5f_tmax_%.1f_dtfac_%.1f'%(\n",
" filetag = 'y_%.3f_q_%.1e_Ml_%.1f_zl_%.1f_dect_%s_fhi_%.1f_zs_%.1f_m1_%.1f_m2_%.1f_approx_%s_deltaf_%.5f_tmax_%.1f_dtfac_%.1f'%(\n",
" kwargs['y'], kwargs['q'], kwargs['Ml'], kwargs['zl'], kwargs['dect'], kwargs['f_hi'], kwargs['zs'], kwargs['m1'], kwargs['m2'],\n",
" kwargs['approx'], kwargs['delta_f'], kwargs['t_max'], kwargs['dt_fac'])\n",
" outdir = folder_path+filetag+\"/\"\n",
import os
# Define the template for the runtag
runtag_template = 'y_%.3f_q_%.1e_Ml_%.1f_zl_%.1f_dect_%s_fhi_%.1f_zs_%.1f_m1_%.1f_m2_%.1f_approx_%s_deltaf_%.5f_tmax_%.1f_dtfac_%.1f'
# Values for fixed parameters (adjust as necessary)
kwargs = {
"Ml":100.0, "zl":0.5, "dect":"ET",
"f_hi":1024.0, "zs":2.0, "m1":20.0, "m2":20.0,
"approx":"IMRPhenomXP", "delta_f":1./32, "t_max":200., "dt_fac":7.5
}
# File containing all the parameter combinations
param_file = "params.txt"
# Directory where the jobs are stored
job_directory = "/home1/uddeepta.deka/lensing/charged_lens_updated/data/lensed_waveform_data/results"
# File to store the unfinished jobs
output_file = "unfinished_jobs.txt"
# List to store unfinished jobs
unfinished_jobs = []
# Open and read the parameter file
with open(param_file, 'r') as f:
for line in f:
# Parse the y, q values from the line
y, q = map(float, line.split())
# Generate the expected runtag folder name
runtag = runtag_template % (y, q, kwargs['Ml'], kwargs['zl'], kwargs['dect'],
kwargs['f_hi'], kwargs['zs'], kwargs['m1'], kwargs['m2'],
kwargs['approx'], kwargs['delta_f'], kwargs['t_max'], kwargs['dt_fac'])
# Check if the folder exists in the job directory
job_folder = os.path.join(job_directory, runtag)
if not os.path.exists(job_folder) or not os.listdir(job_folder):
# If the folder doesn't exist, store the y, q values
#print(job_folder)
unfinished_jobs.append((y, q))
# Save the unfinished jobs to the output file
with open(output_file, 'w') as f:
for y, q in unfinished_jobs:
f.write(f"{y} {q} \n")
print(f"Unfinished jobs have been saved to {output_file}")
#!/bin/bash
# Directory to search for error files
# You can modify this to the directory where your error files are stored
DIR_TO_SEARCH="/home1/uddeepta.deka/lensing/charged_lens_updated/data/lensed_waveform_data/errors/"
# Find all .err files with non-zero size
echo "Finding all non-zero size error files in $DIR_TO_SEARCH..."
find "$DIR_TO_SEARCH" -type f -name "*.err" -size +0c
......@@ -8,7 +8,7 @@ import numpy as np
# Define your range for y_value and Ml_value
y_values = [0.1, 0.5, 1.0]
q_values = [1, 1e-3, 1e-6, 1e-9, 1e-11, 0]
q_values = [0.1, 1e-3, 1e-6, 1e-9, 1e-11, 0]
# Write to a parameter file
with open('params.txt', 'w') as f:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment