Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lecture
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Leonard Wossnig
lecture
Commits
f78221bc
Commit
f78221bc
authored
9 years ago
by
Michele Dolfi
Browse files
Options
Downloads
Patches
Plain Diff
update instructions for hybrid jobs on Euler
parent
94b220b9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
exercises/ex07/mpi_hybrid_euler.pdf
+0
-0
0 additions, 0 deletions
exercises/ex07/mpi_hybrid_euler.pdf
exercises/ex07/myrun
+51
-0
51 additions, 0 deletions
exercises/ex07/myrun
with
51 additions
and
0 deletions
exercises/ex07/mpi_hybrid_euler.pdf
+
0
−
0
View file @
f78221bc
No preview for this file type
This diff is collapsed.
Click to expand it.
exercises/ex07/myrun
0 → 100755
+
51
−
0
View file @
f78221bc
#!/bin/sh
# Copyright (C) 2015 Institute for Theoretical Physics, ETH Zurich
# 2015-2015 by Michele Dolfi <dolfim@phys.ethz.ch>
# Bind an hybrid job to different CPU ids
# It makes use of MVAPICH2 and LSB environment variables to determine the availbale resources.
# Example job:
# export MV2_ENABLE_AFFINITY=0
# OMP_NUM_THREADS=2 bsub -n 8 -W 0:02 -R 'span[ptile=4]' -o test_mpi.log mpirun -np 4 -ppn 2 ./myrun ./a.out
# This will run 4 MPI processes with 2 threads each (a total of 8 cpus). The request asks for 2 MPI processes per node (-ppn 2), which
# means 4 cpus on each node (ptile=4).
if
[
-z
"
$MV2_COMM_WORLD_LOCAL_RANK
"
]
;
then
echo
"MV2_COMM_WORLD_LOCAL_RANK is not set. Did you submit with mpirun?"
exit
1
fi
if
[
-z
"
$MPIR_CVAR_CH3_INTERFACE_HOSTNAME
"
]
;
then
echo
"MPIR_CVAR_CH3_INTERFACE_HOSTNAME is not set. Did you submit with mpirun?"
exit
1
fi
if
[
-z
"
$LSB_AFFINITY_HOSTFILE
"
]
;
then
echo
"LSB_AFFINITY_HOSTFILE is not set. This environment variable should be set by the scheduling system."
exit
1
fi
if
[
-z
"
$THREADS_PER_PROC
"
]
;
then
if
[
-n
"
$OMP_NUM_THREADS
"
]
;
then
THREADS_PER_PROC
=
$OMP_NUM_THREADS
else
echo
"THREADS_PER_PROC is not set. This environment variable is required."
exit
1
fi
fi
IFS
=
$'
\r\n
'
GLOBIGNORE
=
'*'
:
;
ALLCPUS
=(
$(
grep
"
$MPIR_CVAR_CH3_INTERFACE_HOSTNAME
"
$LSB_AFFINITY_HOSTFILE
|
awk
'{print $2}'
)
)
function
join
{
local
IFS
=
"
$1
"
;
shift
;
echo
"
$*
"
;
}
mystart
=
$((
$THREADS_PER_PROC
*
$MV2_COMM_WORLD_LOCAL_RANK
))
myend
=
$((
$mystart
+
$THREADS_PER_PROC
))
mycpu
=(
"
${
ALLCPUS
[@]
:mystart:myend
}
"
)
mybind
=
$(
join
,
"
${
mycpu
[@]
}
"
)
## Debugging
#echo "[$MV2_COMM_WORLD_RANK, $MPIR_CVAR_CH3_INTERFACE_HOSTNAME] all: ${ALLCPUS[@]}, $LSB_BIND_CPU_LIST"
#echo "[$MV2_COMM_WORLD_RANK, $MPIR_CVAR_CH3_INTERFACE_HOSTNAME] local=$MV2_COMM_WORLD_LOCAL_RANK, start=$mystart, end=$myend : mycpu ${mycpu[@]} : mybind $mybind"
numactl
--physcpubind
=
$mybind
"
$@
"
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