Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
remind
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Jerome Hilaire
remind
Commits
9b510e4b
Commit
9b510e4b
authored
5 years ago
by
David Klein
Browse files
Options
Downloads
Patches
Plain Diff
Added file for choosing the slurm config
parent
37afd75d
No related branches found
Branches containing commit
No related tags found
1 merge request
!80
Minor changes to scenario_config_coupled
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/utils/choose_slurmConfig.R
+45
-0
45 additions, 0 deletions
scripts/utils/choose_slurmConfig.R
with
45 additions
and
0 deletions
scripts/utils/choose_slurmConfig.R
0 → 100644
+
45
−
0
View file @
9b510e4b
#######################################################################
############### Select slurm partitiion ###############################
#######################################################################
get_line
<-
function
(){
# gets characters (line) from the terminal or from a connection
# and returns it
if
(
interactive
()){
s
<-
readline
()
}
else
{
con
<-
file
(
"stdin"
)
s
<-
readLines
(
con
,
1
,
warn
=
FALSE
)
on.exit
(
close
(
con
))
}
return
(
s
);
}
choose_slurmConfig
<-
function
()
{
slurm
<-
suppressWarnings
(
ifelse
(
system2
(
"srun"
,
stdout
=
FALSE
,
stderr
=
FALSE
)
!=
127
,
TRUE
,
FALSE
))
if
(
slurm
)
{
modes
<-
c
(
" SLURM standby "
,
" SLURM priority"
)
cat
(
"\nCurrent cluster utilization:\n"
)
system
(
"sclass"
)
cat
(
"\n"
)
cat
(
"\nPlease choose run submission type:\n"
)
cat
(
paste
(
1
:
length
(
modes
),
modes
,
sep
=
": "
),
sep
=
"\n"
)
cat
(
"Number: "
)
identifier
<-
get_line
()
identifier
<-
as.numeric
(
strsplit
(
identifier
,
","
)[[
1
]])
comp
<-
switch
(
identifier
,
"1"
=
"--qos=standby --nodes=1 --tasks-per-node=1"
,
"2"
=
"--qos=priority --nodes=1 --tasks-per-node=1"
)
if
(
is.null
(
comp
))
stop
(
"This type is invalid. Please choose a valid type"
)
}
else
{
comp
<-
"direct"
}
return
(
comp
)
}
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