Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mhc_rank
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patrick Skillman-Lawrence
mhc_rank
Commits
e802c87b
Commit
e802c87b
authored
5 years ago
by
Tim O'Donnell
Browse files
Options
Downloads
Patches
Plain Diff
Add --additional-complete-file cluster parallelism argument
parent
49554ca3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
downloads-generation/models_class1_pan_unselected/cluster_submit_script_header.mssm_hpc.lsf
+7
-3
7 additions, 3 deletions
..._pan_unselected/cluster_submit_script_header.mssm_hpc.lsf
mhcflurry/cluster_parallelism.py
+40
-17
40 additions, 17 deletions
mhcflurry/cluster_parallelism.py
with
47 additions
and
20 deletions
downloads-generation/models_class1_pan_unselected/cluster_submit_script_header.mssm_hpc.lsf
+
7
−
3
View file @
e802c87b
...
...
@@ -8,17 +8,21 @@
#BSUB -W 46:00 # walltime in HH:MM
#BSUB -R rusage[mem=30000] # mb memory requested
#BSUB -o {work_dir}/%J.stdout # output log (%J : JobID)
#BSUB -eo {work_dir}/
%J.stderr
# error log
#BSUB -eo {work_dir}/
STDERR
# error log
#BSUB -L /bin/bash # Initialize the execution environment
#
set
-e
set
-x
echo
"Subsequent stderr output redirected to stdout"
>
&2
exec
2>&1
export
TMPDIR
=
/local/JOBS/mhcflurry-
{
work_item_num
}
export
PATH
=
$HOME
/.conda/envs/py36b/bin/:
$PATH
export
PYTHONUNBUFFERED
=
1
export
KMP_SETTINGS
=
1
set
-e
set
-x
free
-m
module add cuda/10.0.130 cudnn/7.1.1
...
...
This diff is collapsed.
Click to expand it.
mhcflurry/cluster_parallelism.py
+
40
−
17
View file @
e802c87b
...
...
@@ -44,6 +44,10 @@ def add_cluster_parallelism_args(parser):
"
--cluster-results-workdir
"
,
default
=
'
./cluster-workdir
'
,
help
=
"
Default: %(default)s
"
)
group
.
add_argument
(
"
--additional-complete-file
"
,
default
=
'
STDERR
'
,
help
=
"
Additional file to monitor for job completion. Default: %(default)s
"
)
group
.
add_argument
(
'
--cluster-script-prefix-path
'
,
help
=
""
,
...
...
@@ -85,6 +89,7 @@ def cluster_results_from_args(
constant_data
=
constant_data
,
submit_command
=
args
.
cluster_submit_command
,
results_workdir
=
args
.
cluster_results_workdir
,
additional_complete_file
=
args
.
additional_complete_file
,
script_prefix_path
=
args
.
cluster_script_prefix_path
,
result_serialization_method
=
result_serialization_method
,
clear_constant_data
=
clear_constant_data
...
...
@@ -97,6 +102,7 @@ def cluster_results(
constant_data
=
None
,
submit_command
=
"
sh
"
,
results_workdir
=
"
./cluster-workdir
"
,
additional_complete_file
=
None
,
script_prefix_path
=
None
,
result_serialization_method
=
"
pickle
"
,
max_retries
=
3
,
...
...
@@ -230,6 +236,15 @@ def cluster_results(
if
os
.
path
.
exists
(
d
[
'
finished_path
'
]):
result_item
=
d
break
if
additional_complete_file
:
additional_complete_file_path
=
os
.
path
.
join
(
d
[
'
work_dir
'
],
additional_complete_file
)
if
os
.
path
.
exists
(
additional_complete_file_path
):
result_item
=
d
print
(
"
Exists
"
,
additional_complete_file_path
)
break
if
result_item
is
None
:
time
.
sleep
(
60
)
else
:
...
...
@@ -245,25 +260,33 @@ def cluster_results(
print
(
"
[%0.1f sec elapsed] processing item %s
"
%
(
time
.
time
()
-
start
,
result_item
))
if
os
.
path
.
exists
(
error_path
):
print
(
"
Error path exists
"
,
error_path
)
with
open
(
error_path
,
"
rb
"
)
as
fd
:
exception
=
pickle
.
load
(
fd
)
print
(
exception
)
if
retry_num
<
max_retries
:
print
(
"
Relaunching
"
,
launch_command
)
attempt_dir
=
os
.
path
.
join
(
result_item
[
'
work_dir
'
],
"
attempt.%d
"
%
retry_num
)
if
os
.
path
.
exists
(
error_path
)
or
not
os
.
path
.
exists
(
result_path
):
if
os
.
path
.
exists
(
error_path
):
print
(
"
Error path exists
"
,
error_path
)
with
open
(
error_path
,
"
rb
"
)
as
fd
:
exception
=
pickle
.
load
(
fd
)
print
(
exception
)
if
not
os
.
path
.
exists
(
result_path
):
print
(
"
Result path does NOT exist
"
,
result_path
)
if
retry_num
<
max_retries
:
print
(
"
Relaunching
"
,
launch_command
)
attempt_dir
=
os
.
path
.
join
(
result_item
[
'
work_dir
'
],
"
attempt.%d
"
%
retry_num
)
if
os
.
path
.
exists
(
additional_complete_file_path
):
shutil
.
move
(
additional_complete_file_path
,
attempt_dir
)
if
os
.
path
.
exists
(
complete_dir
):
shutil
.
move
(
complete_dir
,
attempt_dir
)
if
os
.
path
.
exists
(
error_path
):
shutil
.
move
(
error_path
,
attempt_dir
)
subprocess
.
check_call
(
launch_command
,
shell
=
True
)
print
(
"
Invoked
"
,
launch_command
)
result_item
[
'
retry_num
'
]
+=
1
result_items
.
append
(
result_item
)
continue
else
:
print
(
"
Max retries exceeded
"
,
max_retries
)
raise
exception
subprocess
.
check_call
(
launch_command
,
shell
=
True
)
print
(
"
Invoked
"
,
launch_command
)
result_item
[
'
retry_num
'
]
+=
1
result_items
.
append
(
result_item
)
continue
else
:
print
(
"
Max retries exceeded
"
,
max_retries
)
raise
exception
if
os
.
path
.
exists
(
result_path
):
print
(
"
Result path exists
"
,
result_path
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment