Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JUWELS Booster Pinning
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Herten
JUWELS Booster Pinning
Commits
ee213e37
Commit
ee213e37
authored
4 years ago
by
Andreas Herten
Browse files
Options
Downloads
Patches
Plain Diff
Add files for dual NUMA domain run
parent
08e7d8e2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+8
-0
8 additions, 0 deletions
Makefile
omp_id.c
+31
-0
31 additions, 0 deletions
omp_id.c
put_to_first_core.sh
+39
-0
39 additions, 0 deletions
put_to_first_core.sh
with
78 additions
and
0 deletions
Makefile
0 → 100644
+
8
−
0
View file @
ee213e37
CC
:=
mpicc
CFLAGS
:=
-fopenmp
.PHONY
:
all
all
:
omp_id
omp_id
:
omp_id.c
$(
CC
)
$(
CFLAGS
)
$<
-o
$@
This diff is collapsed.
Click to expand it.
omp_id.c
0 → 100644
+
31
−
0
View file @
ee213e37
#define _GNU_SOURCE // sched_getcpu(3) is glibc-specific (see the man page)
#include
<stdio.h>
#include
<mpi.h>
#include
<sched.h>
#include
<omp.h>
int
main
(
int
argc
,
char
**
argv
)
{
MPI_Init
(
NULL
,
NULL
);
fprintf
(
stderr
,
"LEGEND: 'MPI' = MPI Rank; 'CPU' = CPU Core ID, 'MCPU' = Master CPU Core ID; 'OMP' = OpenMP Thread ID, 'MOMP' = Master OpenMP Thread ID; 'F' = Fork
\n
"
);
int
world_size
;
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
world_size
);
int
world_rank
;
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
world_rank
);
int
thread_num_master
=
omp_get_thread_num
();
int
cpu_num_master
=
sched_getcpu
();
printf
(
"MPI
\t
F
\t
MOMP
\t
OMP
\t
MCPU
\t
CPU
\n
"
);
printf
(
"%3d
\t
•
\t
%4d
\t
%3d
\t
%4d
\t
%3d
\n
"
,
world_rank
,
thread_num_master
,
thread_num_master
,
cpu_num_master
,
cpu_num_master
);
#pragma omp parallel
{
int
thread_num
=
omp_get_thread_num
();
int
cpu_num
=
sched_getcpu
();
printf
(
"%3d
\t
└
\t
%4d
\t
%3d
\t
%4d
\t
%3d
\n
"
,
world_rank
,
thread_num_master
,
thread_num
,
cpu_num_master
,
cpu_num
);
}
MPI_Finalize
();
return
0
;
}
This diff is collapsed.
Click to expand it.
put_to_first_core.sh
0 → 100644
+
39
−
0
View file @
ee213e37
#!/usr/bin/env bash
## Get odd NUMA domain (which is always close to a GPU)
numa_domains
=
$(
numactl
-s
|
grep
nodebind |
sed
"s/nodebind: //"
)
for
domain
in
$numa_domains
;
do
if
[
$((
domain%2
))
==
1
]
;
then
odd_domain
=
$domain
fi
done
## GPU for odd NUMA domain
gpu_id
=
$(
bash get_close_gpu.sh
$odd_domain
)
## Get cores of NUMA domain
numa_cores
=
$(
numactl
-s
|
grep
physcpubind |
sed
"s/physcpubind: //"
)
numa_cores_array
=(
$numa_cores
)
## convert to array
## Split list of cores into single GPU-close core one the remaining ones
N_CORES_PER_DOMAIN
=
6
## this can probably be retrieved from the systems somewhere^TM
core_gpu
=
${
numa_cores_array
[
$N_CORES_PER_DOMAIN
]
}
## this implicitly assumes even NUMA domain before odd NUMA domain
core_rest
=
${
numa_cores_array
[@]/
$core_gpu
}
core_resorted
=(
$core_gpu
$core_rest
)
_OMP_PLACES
=
""
for
i
in
"
${
core_resorted
[@]
}
"
do
_OMP_PLACES+
=
"{
$i
},"
done
if
[[
-z
"
$OMP_PLACES
"
]]
;
then
export
OMP_PLACES
=
${
_OMP_PLACES
::-1
}
# removing trailing comma
else
echo
"OMP_PLACES already set. Not touching it."
fi
#echo $OMP_PLACES
$1
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