Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
b9504c02
Commit
b9504c02
authored
3 years ago
by
Izzard, Robert Dr (Maths & Physics)
Browse files
Options
Downloads
Patches
Plain Diff
automatically find date, which, bash, env etc. using shutil.which()
parent
0e65a1dd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
binarycpython/utils/condor.py
+1
-1
1 addition, 1 deletion
binarycpython/utils/condor.py
binarycpython/utils/grid_options_defaults.py
+9
-7
9 additions, 7 deletions
binarycpython/utils/grid_options_defaults.py
binarycpython/utils/slurm.py
+4
-5
4 additions, 5 deletions
binarycpython/utils/slurm.py
with
14 additions
and
13 deletions
binarycpython/utils/condor.py
+
1
−
1
View file @
b9504c02
...
...
@@ -216,7 +216,7 @@ class condor():
# build the grid command
grid_command
=
[
os
.
path
.
join
(
"
/usr
"
,
"
bin
"
,
"
env
"
),
str
(
self
.
grid_options
[
'
condor_
env
'
]
),
sys
.
executable
,
pyscriptpath
,
]
+
sys
.
argv
[
1
:]
+
[
...
...
This diff is collapsed.
Click to expand it.
binarycpython/utils/grid_options_defaults.py
+
9
−
7
View file @
b9504c02
...
...
@@ -15,6 +15,7 @@ All the options starting with _ should not be changed by the user except when yo
import
datetime
import
os
import
shutil
import
sys
from
binarycpython.utils.custom_logging_functions
import
temp_dir
...
...
@@ -207,9 +208,10 @@ class grid_options_defaults():
"
slurm_extra_settings
"
:
{},
# Dictionary of extra settings for Slurm to put in its launch script.
"
slurm_sbatch
"
:
"
sbatch
"
,
# sbatch command
"
slurm_restart_dir
"
:
None
,
# restart Slurm jobs from this directory
"
slurm_bash
"
:
"
/bin/bash
"
,
# bash location for Slurm
"
slurm_pwd
"
:
"
/usr/bin/pwd
"
,
# pwd command location for Slurm
"
slurm_date
"
:
"
/usr/bin/date
"
,
# bash location for Slurm
"
slurm_env
"
:
shutil
.
which
(
"
env
"
),
# env location for Slurm
"
slurm_bash
"
:
shutil
.
which
(
"
bash
"
),
# bash location for Slurm
"
slurm_pwd
"
:
shutil
.
which
(
"
pwd
"
),
# pwd command location for Slurm
"
slurm_date
"
:
shutil
.
which
(
"
date
"
),
# bash location for Slurm
########################################
# Condor stuff
...
...
@@ -239,10 +241,10 @@ class grid_options_defaults():
'
condor_save_joined_file
'
:
0
,
# if 1 then results/joined contains the results
# (useful for debugging, otherwise a lot of work)
'
condor_requirements
'
:
''
,
# job requirements
'
condor_usr_bin_env
'
:
'
/usr/bin/
env
'
,
# /usr/bin/env location
'
condor_bash
'
:
'
/bin/
bash
'
,
# bash executable location
"
condor_pwd
"
:
"
/usr/bin/
pwd
"
,
# pwd command location for Condor
"
condor_date
"
:
"
/usr/bin/
date
"
,
# bash location for Condor
'
condor_usr_bin_env
'
:
shutil
.
which
(
"
env
"
)
,
# /usr/bin/env location
'
condor_bash
'
:
shutil
.
which
(
"
bash
"
)
,
# bash executable location
"
condor_pwd
"
:
shutil
.
which
(
"
pwd
"
)
,
# pwd command location for Condor
"
condor_date
"
:
shutil
.
which
(
"
date
"
)
,
# bash location for Condor
"
condor_array_max_jobs
"
:
None
,
# override for the max number of concurrent array jobs
"
condor_initial_dir
"
:
None
,
# directory from which condor is run, if None is the directory in which your script is run
"
condor_submit
"
:
"
condor_submit
"
,
# the condor_submit command
...
...
This diff is collapsed.
Click to expand it.
binarycpython/utils/slurm.py
+
4
−
5
View file @
b9504c02
...
...
@@ -175,19 +175,19 @@ class slurm():
# run a grid of stars only, leaving the results
# in the appropriate outfile
return
False
elif
self
.
grid_options
[
'
slurm
'
]
==
3
:
# joining : set the evolution type to "join" and return
# False to continue
self
.
grid_options
[
'
evolution_type
'
]
=
'
join
'
return
False
elif
self
.
grid_options
[
'
slurm
'
]
==
1
:
# if slurm=1, we should have no evolution type, we
# set up the Slurm scripts and get them evolving
# in a Slurm array
self
.
grid_options
[
'
evolution_type
'
]
=
None
# make dirs
self
.
make_slurm_dirs
()
...
...
@@ -219,7 +219,7 @@ class slurm():
# build the grid command
grid_command
=
[
os
.
path
.
join
(
"
/usr
"
,
"
bin
"
,
"
env
"
),
str
(
grid_options
[
'
slurm_env
'
])
sys
.
executable
,
str
(
lib_programname
.
get_path_executed_script
()),
]
+
sys
.
argv
[
1
:]
+
[
...
...
@@ -351,4 +351,3 @@ echo {slurm_dir}/results/$SLURM_ARRAY_JOB_ID.$SLURM_ARRAY_TASK_ID.gz >> {slurm_d
# return True so we exit immediately
return
True
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