Skip to content

Commit dc30039

Browse files
committed
Supporting energize_docking runs in condor framework
1 parent d1fbcbc commit dc30039

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

code/condor.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ def load_lines(fn):
169169

170170

171171
def prep_energize(args):
172+
"""
173+
Prepare a condor run for calculating Rosetta energies
174+
"""
175+
176+
# supports original energies (energize.py) or docking for GB1 docking energies (gb1_docking.py)
177+
if args.run_type == "energize":
178+
pyscript = "energize.py"
179+
elif args.run_type == "energize_docking":
180+
pyscript = "gb1_docking.py"
181+
else:
182+
raise ValueError("Invalid run type: {}".format(args.run_type))
172183

173184
out_dir = join("output", "htcondor_runs", get_run_dir_name(args.run_name))
174185
os.makedirs(out_dir)
@@ -190,6 +201,8 @@ def prep_energize(args):
190201
with open(join(out_dir, "env_vars.txt"), "w") as f:
191202
f.write("export GITHUB_TAG={}\n".format(args.github_tag))
192203
f.write("export NUM_JOBS={}\n".format(num_jobs))
204+
# additional environment variables to handle the different types of runs
205+
f.write("export PYSCRIPT={}\n".format(pyscript))
193206

194207
# prepare the additional data files
195208
additional_files = prep_additional_data_files(args.additional_data_files, out_dir)
@@ -204,7 +217,7 @@ def prep_energize(args):
204217
shutil.copy("htcondor/templates/run.sh", out_dir)
205218
shutil.copy("htcondor/templates/pass.txt", out_dir)
206219

207-
# copy over the energize args and rename to standard filename
220+
# copy over energize args and rename to standard filename
208221
shutil.copyfile(args.energize_args_fn, join(out_dir, "energize_args.txt"))
209222

210223
# create output directories where jobs will place their outputs
@@ -388,7 +401,7 @@ def main(args):
388401
help="prepare or energize",
389402
type=str,
390403
default="energize",
391-
choices=["prepare", "energize"])
404+
choices=["prepare", "energize", "energize_docking"])
392405

393406
parser.add_argument("--run_name",
394407
help="name for this condor run, used for log directory",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--rosetta_main_dir
2+
rosetta_minimal
3+
--pdb_dir
4+
pdb_files/prepared_pdb_files
5+
--chain
6+
C
7+
--num_structs
8+
1
9+
--log_dir_base
10+
output/energize_outputs

htcondor/templates/energize.sub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ request_cpus = 1
2222
request_memory = 2GB
2323
request_disk = 20GB
2424

25-
environment = "CLUSTER=$(Cluster) PROCESS=$(Process) RUNNINGON=$$(Name) GITHUB_TAG=$ENV(GITHUB_TAG)"
25+
environment = "CLUSTER=$(Cluster) PROCESS=$(Process) RUNNINGON=$$(Name) GITHUB_TAG=$ENV(GITHUB_TAG) PYSCRIPT=$ENV(PYSCRIPT)"
2626

2727
# when submitting more than 10k jobs this will prevent the scheduler from getting overloaded
2828
max_idle = 1000

htcondor/templates/run.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ tar -xzf rosettafy_env_v0.7.11.tar.gz -C rosettafy_env
5858
. rosettafy_env/bin/activate
5959
rm rosettafy_env_v0.7.11.tar.gz
6060

61-
6261
# decrypt
6362
# note this is done AFTER setting up the Python environment because it requires
6463
# the openssl version inside the environment
@@ -79,6 +78,5 @@ then
7978
fi
8079

8180
# launch our python run script with argument file number
82-
echo "Launching energize.py"
83-
python3 code/energize.py @energize_args.txt --variants_fn="${PROCESS}.txt" --cluster="$CLUSTER" --process="$PROCESS" --commit_id="$GITHUB_TAG"
84-
81+
echo "Launching ${PYSCRIPT}"
82+
python3 code/${PYSCRIPT} @energize_args.txt --variants_fn="${PROCESS}.txt" --cluster="$CLUSTER" --process="$PROCESS" --commit_id="$GITHUB_TAG"

0 commit comments

Comments
 (0)