Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hpc-compendium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
ZIH
hpcsupport
hpc-compendium
Commits
fcc0b2f8
Commit
fcc0b2f8
authored
3 years ago
by
Martin Schroschk
Browse files
Options
Downloads
Patches
Plain Diff
Add way to gather max. mem from the job
parent
a5b551f8
No related branches found
No related tags found
2 merge requests
!478
Automated merge from preview to main
,
!464
Add way to gather max. mem from the job
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc.zih.tu-dresden.de/docs/jobs_and_resources/slurm_profiling.md
+34
-0
34 additions, 0 deletions
....tu-dresden.de/docs/jobs_and_resources/slurm_profiling.md
with
34 additions
and
0 deletions
doc.zih.tu-dresden.de/docs/jobs_and_resources/slurm_profiling.md
+
34
−
0
View file @
fcc0b2f8
...
@@ -60,3 +60,37 @@ More information about profiling with Slurm:
...
@@ -60,3 +60,37 @@ More information about profiling with Slurm:
-
[
Slurm Profiling
](
http://slurm.schedmd.com/hdf5_profile_user_guide.html
)
-
[
Slurm Profiling
](
http://slurm.schedmd.com/hdf5_profile_user_guide.html
)
-
[
`sh5util`
](
http://slurm.schedmd.com/sh5util.html
)
-
[
`sh5util`
](
http://slurm.schedmd.com/sh5util.html
)
====== Memory Consumption of a Job ======
If you are only interested in the maximal memory consumption of your job, you
don't need profiling at all. This information can be retrieved from within
[
batch files
](
slurm.md#batch_jobs
)
as follows:
```
bash
#!/bin/bash
#SBATCH [...]
module purge
module load
[
...]
srun a.exe
# Retrieve max. memory for this job for all nodes
srun max_mem.sh
```
The script max_mem.sh is:
```
bash
#!/bin/bash
echo
-n
"
$(
hostname
)
: "
cat
/sys/fs/cgroup/memory/slurm/uid_
${
SLURM_JOB_UID
}
/job_
${
SLURM_JOB_ID
}
/memory.max_usage_in_bytes
```
**Remarks**
:
*
Make sure that
`max_mem.sh`
is executable (e.g.,
`chmod +x max_mem.sh`
) and add the path to this script if it is not within the same directory.
*
The
`srun`
command is necessary to gather the max. memory from all nodes within this job. Otherwise, you would only get the data from one node.
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