Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gpfs-policy
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
gpfs-policy
Commits
21d0f5f1
Commit
21d0f5f1
authored
1 month ago
by
Matthew K Defenderfer
Browse files
Options
Downloads
Patches
Plain Diff
Add random delay to nested sbatch submissions
parent
3f9bb027
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!62
Add random delay to nested sbatch submissions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rc_gpfs/cli/convert_flat_to_hive.py
+8
-0
8 additions, 0 deletions
src/rc_gpfs/cli/convert_flat_to_hive.py
src/rc_gpfs/cli/convert_to_parquet.py
+8
-1
8 additions, 1 deletion
src/rc_gpfs/cli/convert_to_parquet.py
with
16 additions
and
1 deletion
src/rc_gpfs/cli/convert_flat_to_hive.py
+
8
−
0
View file @
21d0f5f1
import
argparse
import
argparse
import
subprocess
import
subprocess
import
time
import
random
from
pathlib
import
Path
from
pathlib
import
Path
import
polars
as
pl
import
polars
as
pl
...
@@ -76,6 +78,12 @@ def submit_batch(**kwargs):
...
@@ -76,6 +78,12 @@ def submit_batch(**kwargs):
script
=
f
"
#!/bin/bash
\n
#
\n
{
slurm_opts
}
\n
{
BATCH_CMDS
.
format
(
**
kwargs
)
}
"
script
=
f
"
#!/bin/bash
\n
#
\n
{
slurm_opts
}
\n
{
BATCH_CMDS
.
format
(
**
kwargs
)
}
"
# Wait between 1 and 5 seconds before batch submission. This helps avoid a situation where this setup is running in
# a batch array job and all of the array tasks submit their child array jobs at the same time. That results in jobs
# failing to be submitted due to overwhelming the scheduler with simultaneous requests. Adding a random delay should
# fix that
time
.
sleep
(
random
.
uniform
(
1
,
5
))
subprocess
.
run
([
'
sbatch
'
],
input
=
script
,
shell
=
True
,
text
=
True
)
subprocess
.
run
([
'
sbatch
'
],
input
=
script
,
shell
=
True
,
text
=
True
)
pass
pass
...
...
This diff is collapsed.
Click to expand it.
src/rc_gpfs/cli/convert_to_parquet.py
+
8
−
1
View file @
21d0f5f1
import
argparse
import
argparse
import
re
import
time
import
random
import
subprocess
import
subprocess
from
pathlib
import
Path
from
pathlib
import
Path
import
multiprocessing
import
multiprocessing
...
@@ -71,6 +72,12 @@ def submit_batch(**kwargs):
...
@@ -71,6 +72,12 @@ def submit_batch(**kwargs):
script
=
BATCH_SCRIPT
.
format
(
**
kwargs
)
script
=
BATCH_SCRIPT
.
format
(
**
kwargs
)
# Wait between 1 and 5 seconds before batch submission. This helps avoid a situation where this setup is running in
# a batch array job and all of the array tasks submit their child array jobs at the same time. That results in jobs
# failing to be submitted due to overwhelming the scheduler with simultaneous requests. Adding a random delay should
# fix that
time
.
sleep
(
random
.
uniform
(
1
,
5
))
subprocess
.
run
([
'
sbatch
'
],
input
=
script
,
shell
=
True
,
text
=
True
)
subprocess
.
run
([
'
sbatch
'
],
input
=
script
,
shell
=
True
,
text
=
True
)
pass
pass
...
...
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