Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
tud-zih-energy
Slurm
Commits
8aa9e802
Commit
8aa9e802
authored
21 years ago
by
Mark Grondona
Browse files
Options
Downloads
Patches
Plain Diff
o propagate all resource limits from srun to slurmd
parent
bbda4331
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
NEWS
+2
-0
2 additions, 0 deletions
NEWS
src/slurmd/ulimits.c
+20
-2
20 additions, 2 deletions
src/slurmd/ulimits.c
src/srun/srun.c
+66
-33
66 additions, 33 deletions
src/srun/srun.c
with
88 additions
and
35 deletions
NEWS
+
2
−
0
View file @
8aa9e802
...
@@ -19,6 +19,8 @@ documents those changes that are of interest to users and admins.
...
@@ -19,6 +19,8 @@ documents those changes that are of interest to users and admins.
shared nodes.
shared nodes.
-- Set SLURM_DISTRIBUTION environment varible for user tasks.
-- Set SLURM_DISTRIBUTION environment varible for user tasks.
-- Fix for file descriptor leak in slurmd.
-- Fix for file descriptor leak in slurmd.
-- Propagate stacksize limit to jobs along with other resource limits
that were previously ignored.
* Changes in SLURM 0.3.0.0-pre9
* Changes in SLURM 0.3.0.0-pre9
===============================
===============================
...
...
This diff is collapsed.
Click to expand it.
src/slurmd/ulimits.c
+
20
−
2
View file @
8aa9e802
...
@@ -52,17 +52,35 @@ struct userlim {
...
@@ -52,17 +52,35 @@ struct userlim {
*/
*/
static
struct
userlim
ulims
[]
=
static
struct
userlim
ulims
[]
=
{
{
#ifdef RLIMIT_CPU
{
"SLURM_RLIMIT_CPU"
,
RLIMIT_CPU
},
#endif
#ifdef RLIMIT_FSIZE
{
"SLURM_RLIMIT_FSIZE"
,
RLIMIT_FSIZE
},
#endif
#ifdef RLIMIT_DATA
{
"SLURM_RLIMIT_DATA"
,
RLIMIT_DATA
},
#endif
#ifdef RLIMIT_STACK
{
"SLURM_RLIMIT_STACK"
,
RLIMIT_STACK
},
#endif
#ifdef RLIMIT_CORE
#ifdef RLIMIT_CORE
{
"SLURM_RLIMIT_CORE"
,
RLIMIT_CORE
},
{
"SLURM_RLIMIT_CORE"
,
RLIMIT_CORE
},
#endif
#endif
#ifdef RLIMIT_
FSIZE
#ifdef RLIMIT_
RSS
{
"SLURM_RLIMIT_
FSIZE"
,
RLIMIT_
FSIZE
},
{
"SLURM_RLIMIT_
RSS"
,
RLIMIT_
RSS
},
#endif
#endif
#ifdef RLIMIT_NPROC
#ifdef RLIMIT_NPROC
{
"SLURM_RLIMIT_NPROC"
,
RLIMIT_NPROC
},
{
"SLURM_RLIMIT_NPROC"
,
RLIMIT_NPROC
},
#endif
#endif
#ifdef RLIMIT_NOFILE
#ifdef RLIMIT_NOFILE
{
"SLURM_RLIMIT_NOFILE"
,
RLIMIT_NOFILE
},
{
"SLURM_RLIMIT_NOFILE"
,
RLIMIT_NOFILE
},
#endif
#ifdef RLIMIT_MEMLOCK
{
"SLURM_RLIMIT_MEMLOCK"
,
RLIMIT_MEMLOCK
},
#endif
#ifdef RLIMIT_AS
{
"SLURM_RLIMIT_AS"
,
RLIMIT_AS
},
#endif
#endif
{
NULL
,
0
}
{
NULL
,
0
}
};
};
...
...
This diff is collapsed.
Click to expand it.
src/srun/srun.c
+
66
−
33
View file @
8aa9e802
...
@@ -119,8 +119,6 @@ int main(int ac, char **av)
...
@@ -119,8 +119,6 @@ int main(int ac, char **av)
*/
*/
initialize_and_process_args
(
ac
,
av
);
initialize_and_process_args
(
ac
,
av
);
if
(
!
opt
.
allocate
)
(
void
)
_set_rlimit_env
();
/* reinit log with new verbosity (if changed by command line)
/* reinit log with new verbosity (if changed by command line)
*/
*/
...
@@ -131,6 +129,9 @@ int main(int ac, char **av)
...
@@ -131,6 +129,9 @@ int main(int ac, char **av)
log_alter
(
logopt
,
0
,
NULL
);
log_alter
(
logopt
,
0
,
NULL
);
}
}
if
(
!
opt
.
allocate
)
(
void
)
_set_rlimit_env
();
/* Set up slurmctld message handler */
/* Set up slurmctld message handler */
slurmctld_msg_init
();
slurmctld_msg_init
();
...
@@ -691,49 +692,81 @@ _set_batch_script_env(job_t *job)
...
@@ -691,49 +692,81 @@ _set_batch_script_env(job_t *job)
static
int
_set_rlimit_env
(
void
)
static
int
_set_rlimit_env
(
void
)
{
{
int
rc
=
SLURM_SUCCESS
;
int
rc
=
SLURM_SUCCESS
;
struct
rlimit
my_rlimit
;
struct
rlimit
rlim
[
1
];
struct
rlimit_info
{
const
int
res
;
const
char
*
var
;
}
rlimit_vars
[]
=
{
#ifdef RLIMIT_CPU
{
RLIMIT_CPU
,
"CPU"
},
#endif
#ifdef RLIMIT_FSIZE
#ifdef RLIMIT_FSIZE
if
(
getrlimit
(
RLIMIT_FSIZE
,
&
my_rlimit
)
||
{
RLIMIT_FSIZE
,
"FSIZE"
},
setenvf
(
"SLURM_RLIMIT_FSIZE=%ld"
,
(
long
)
my_rlimit
.
rlim_cur
))
{
#endif
error
(
"Can't set SLURM_RLIMIT_FSIZE environment variable"
);
#ifdef RLIMIT_DATA
rc
=
SLURM_FAILURE
;
{
RLIMIT_DATA
,
"DATA"
},
}
#endif
#ifdef RLIMIT_STACK
{
RLIMIT_STACK
,
"STACK"
},
#endif
#endif
#ifdef RLIMIT_CORE
#ifdef RLIMIT_CORE
if
(
getrlimit
(
RLIMIT_CORE
,
&
my_rlimit
)
||
{
RLIMIT_CORE
,
"CORE"
},
setenvf
(
"SLURM_RLIMIT_CORE=%ld"
,
(
long
)
my_rlimit
.
rlim_cur
))
{
#endif
error
(
"Can't set SLURM_RLIMIT_CORE environment variable"
);
#ifdef RLIMIT_RSS
rc
=
SLURM_FAILURE
;
{
RLIMIT_RSS
,
"RSS"
},
}
#endif
#endif
#ifdef RLIMIT_NPROC
#ifdef RLIMIT_NPROC
if
(
getrlimit
(
RLIMIT_NPROC
,
&
my_rlimit
)
||
{
RLIMIT_NPROC
,
"NPROC"
},
setenvf
(
"SLURM_RLIMIT_NPROC=%ld"
,
(
long
)
my_rlimit
.
rlim_cur
))
{
error
(
"Can't set SLURM_RLIMIT_NPROC environment variable"
);
rc
=
SLURM_FAILURE
;
}
#endif
#endif
#ifdef RLIMIT_NOFILE
#ifdef RLIMIT_NOFILE
if
(
getrlimit
(
RLIMIT_NOFILE
,
&
my_rlimit
)
==
0
)
{
{
RLIMIT_NOFILE
,
"NOFILE"
},
if
(
setenvf
(
"SLURM_RLIMIT_NOFILE=%ld"
,
#endif
(
long
)
my_rlimit
.
rlim_cur
))
{
#ifdef RLIMIT_MEMLOCK
error
(
"Can't set SLURM_RLIMIT_NOFILE environment variable"
);
{
RLIMIT_MEMLOCK
,
"MEMLOCK"
},
#endif
#ifdef RLIMIT_AS
{
RLIMIT_AS
,
"AS"
},
#endif
{
0
,
NULL
}
};
struct
rlimit_info
*
r
;
for
(
r
=
rlimit_vars
;
r
->
var
;
r
++
)
{
long
cur
;
if
(
getrlimit
(
r
->
res
,
rlim
)
<
0
)
{
error
(
"getrlimit (%s): %m"
,
r
->
var
);
rc
=
SLURM_FAILURE
;
rc
=
SLURM_FAILURE
;
continue
;
}
}
my_rlimit
.
rlim_cur
=
my_rlimit
.
rlim_max
;
if
(
setrlimit
(
RLIMIT_NOFILE
,
&
my_rlimit
))
{
cur
=
(
long
)
rlim
->
rlim_cur
;
error
(
"Can't set SLURM_RLIMIT_NOFILE value"
);
if
(
setenvf
(
"SLURM_RLIMIT_%s=%ld"
,
r
->
var
,
cur
)
<
0
)
{
error
(
"unable to set RLIMIT_%s in environment"
,
r
->
var
);
rc
=
SLURM_FAILURE
;
rc
=
SLURM_FAILURE
;
continue
;
}
}
}
else
{
error
(
"Can't get RLIMIT_NOFILE value"
);
debug
(
"propagating RLIMIT_%s=%ld"
,
r
->
var
,
cur
);
rc
=
SLURM_FAILURE
;
}
/*
* Now increase NOFILE to the max available for this srun
*/
if
(
getrlimit
(
RLIMIT_NOFILE
,
rlim
)
<
0
)
return
(
error
(
"getrlimit (RLIMIT_NOFILE): %m"
));
if
(
rlim
->
rlim_cur
<
rlim
->
rlim_max
)
{
rlim
->
rlim_cur
=
rlim
->
rlim_max
;
if
(
setrlimit
(
RLIMIT_NOFILE
,
rlim
)
<
0
)
return
(
error
(
"Unable to increase max no. files: %m"
));
}
}
#endif
return
rc
;
return
rc
;
}
}
...
...
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