Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
fwi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gmsh
fwi
Commits
2812a955
Commit
2812a955
authored
2 years ago
by
Boris Martin
Browse files
Options
Downloads
Patches
Plain Diff
slurm
parent
16300280
No related branches found
No related tags found
1 merge request
!6
Draft: "Flexible acquisition", a configuration with arbitrary sources and receivers read from a YAML file.
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
input/boris/monaco_study/gen_slurm.py
+34
-0
34 additions, 0 deletions
input/boris/monaco_study/gen_slurm.py
with
34 additions
and
0 deletions
input/boris/monaco_study/gen_slurm.py
0 → 100644
+
34
−
0
View file @
2812a955
from
string
import
Template
import
os
all_files
=
[
filename
for
filename
in
os
.
listdir
()
if
filename
.
startswith
(
'
config_
'
)
and
filename
.
endswith
(
'
.txt
'
)]
all_files
.
sort
()
slurm_template
=
'''
#!/bin/bash
#SBATCH --job-name=$job_name
#SBATCH --output=$output
#SBATCH --error=$error
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --time=05:00:00
set -e
set -x
$command_line
'''
for
i
,
freq
in
enumerate
(
all_files
):
synth_job
=
Template
(
slurm_template
).
substitute
(
job_name
=
"
synth_{}
"
.
format
(
i
),
output
=
"
synth_{}.out
"
.
format
(
i
),
error
=
"
synth_{}.err
"
.
format
(
i
),
command_line
=
"
~/fwi/build/synthetics synthetics.txt common.txt {} -verbose 2
"
.
format
(
freq
))
with
open
(
'
synth_{}.slurm
'
.
format
(
i
),
'
w
'
)
as
f
:
f
.
write
(
synth_job
)
inv_job
=
Template
(
slurm_template
).
substitute
(
job_name
=
"
inv_{}
"
.
format
(
i
),
output
=
"
inv_{}.out
"
.
format
(
i
),
error
=
"
inv_{}.err
"
.
format
(
i
),
command_line
=
"
~/fwi/build/inversion inversion.txt common.txt localminimum_ncg.txt innerproduct_sst.txt {} -verbose 2
"
.
format
(
freq
))
with
open
(
'
inv_{}.slurm
'
.
format
(
i
),
'
w
'
)
as
f
:
f
.
write
(
inv_job
)
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