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
7b36e681
Commit
7b36e681
authored
3 years ago
by
Izzard, Robert Dr (Maths & Physics)
Browse files
Options
Downloads
Patches
Plain Diff
allow making the joiningfile allow the file to exist if force join is true
parent
6a375925
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
binarycpython/utils/HPC.py
+9
-4
9 additions, 4 deletions
binarycpython/utils/HPC.py
with
9 additions
and
4 deletions
binarycpython/utils/HPC.py
+
9
−
4
View file @
7b36e681
...
@@ -94,16 +94,18 @@ class HPC(condor,slurm):
...
@@ -94,16 +94,18 @@ class HPC(condor,slurm):
# check for joiningfile again
# check for joiningfile again
if
self
.
grid_options
[
'
HPC_force_join
'
]
==
1
:
if
self
.
grid_options
[
'
HPC_force_join
'
]
==
1
:
print
(
"
Forcing join because HPC_force_join is set
"
)
print
(
"
Forcing join because HPC_force_join is set
"
)
x
=
True
elif
os
.
path
.
exists
(
joiningfile
):
elif
os
.
path
.
exists
(
joiningfile
):
if
vb
:
if
vb
:
print
(
"
cannot join: joiningfile exists at {}
"
.
format
(
joiningfile
))
print
(
"
cannot join: joiningfile exists at {}
"
.
format
(
joiningfile
))
return
False
x
=
False
elif
vb
:
elif
vb
:
print
(
"
joiningfile does not exist : can join
"
)
print
(
"
joiningfile does not exist : can join
"
)
x
=
True
if
vb
:
if
vb
:
print
(
"
returning
True
from HPC_can_join()
"
)
print
(
"
returning
{}
from HPC_can_join()
"
.
format
(
x
)
)
return
True
return
x
def
HPCjob
(
self
):
def
HPCjob
(
self
):
"""
"""
...
@@ -340,7 +342,10 @@ class HPC(condor,slurm):
...
@@ -340,7 +342,10 @@ class HPC(condor,slurm):
print
(
"
We can join
"
)
print
(
"
We can join
"
)
try
:
try
:
# touch joiningfile
# touch joiningfile
pathlib
.
Path
(
joiningfile
).
touch
(
exist_ok
=
False
)
if
grid_options
[
'
HPC_force_join
'
]
==
1
:
pathlib
.
Path
(
joiningfile
).
touch
(
exist_ok
=
True
)
else
:
pathlib
.
Path
(
joiningfile
).
touch
(
exist_ok
=
False
)
try
:
try
:
self
.
HPC_join_from_files
(
self
,
joinfiles
)
self
.
HPC_join_from_files
(
self
,
joinfiles
)
except
Exception
as
e
:
except
Exception
as
e
:
...
...
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