Skip to content

Commit 8468a4b

Browse files
committed
graph: add shape files with patterns
Signed-off-by: vsoch <[email protected]>
1 parent d45b4f7 commit 8468a4b

File tree

17 files changed

+1003
-721
lines changed

17 files changed

+1003
-721
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ fluxbind predict core:0-7
7575
fluxbind predict --xml ./examples/topology/corona.xml numa:0,1 x core:0-2
7676
```
7777

78+
7879
## License
7980

8081
DevTools is distributed under the terms of the MIT license.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Find the 8 cores that are physically closest to the first available GPU
2+
resources:
3+
- type: machine
4+
count: 1
5+
with:
6+
- type: core
7+
count: 8
8+
affinity:
9+
type: gpu
10+
pattern: packed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Find the 4 cores that are physically closest to the NIC
2+
resources:
3+
- type: machine
4+
count: 1
5+
with:
6+
- type: core
7+
count: 4
8+
# Sort all available cores by distance to the NIC...
9+
affinity:
10+
type: nic
11+
# ...then take the first 4 (the closest ones).
12+
pattern: packed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Find a NUMA node that contains a NIC, and then find a GPU
2+
# that is also under that *same* NUMA node.
3+
resources:
4+
- type: numanode
5+
count: 1
6+
with:
7+
# This NUMA node MUST contain at least one NIC
8+
- type: nic
9+
count: 1
10+
# It also MUST contain at least one GPU
11+
- type: gpu
12+
count: 1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Simplest possible test: Allocate 4 cores anywhere on the node.
2+
# The allocator should succeed on almost any machine.
3+
resources:
4+
- type: machine
5+
count: 1
6+
with:
7+
- type: core
8+
count: 4
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Basic containment: Allocate 8 cores, but ensure they all
2+
# come from the same single socket (Package).
3+
# This will fail on a machine where no single socket has 8 cores.
4+
resources:
5+
- type: socket
6+
count: 1
7+
with:
8+
- type: core
9+
count: 8
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Single-rank application with complex needs.
2+
# The rank needs:
3+
# 1. A GPU
4+
# 2. Four cores that are as close as possible to THAT GPU
5+
# 3. One separate core that is as close as possible to the NIC
6+
resources:
7+
# First, find one NUMA node that contains at least one GPU.
8+
- type: numanode
9+
count: 1
10+
with:
11+
- type: gpu
12+
count: 1
13+
# Within this NUMA node, find 4 cores close to the GPU we just found.
14+
with:
15+
- type: core
16+
count: 4
17+
affinity:
18+
type: gpu
19+
pattern: packed
20+
21+
# Separately, find one core anywhere on the machine that is close to the NIC.
22+
- type: machine
23+
count: 1
24+
with:
25+
- type: core
26+
count: 1
27+
affinity:
28+
type: nic
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# A job to be partitioned across 4 ranks.
3+
# This requests a total of 16 cores. When run with --local-size=4,
4+
# each of the 4 ranks should be assigned a unique slice of 4 cores.
5+
#
6+
resources:
7+
- type: machine
8+
count: 1
9+
with:
10+
- type: core
11+
count: 16
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# A complex multi-rank job for 4 ranks.
2+
# The total allocation asks for 4 GPUs and 16 cores.
3+
# The affinity key sorts the GPUs by closeness to the NIC before partitioning.
4+
# When run with --local-size=4, each rank will get 1 GPU and 4 cores.
5+
resources:
6+
- type: machine
7+
count: 1
8+
with:
9+
- type: gpu
10+
count: 4
11+
affinity:
12+
type: nic
13+
- type: core
14+
count: 16
15+
affinity:
16+
type: nic
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Test local pattern (smart packing).
2+
# Requests 4 cores within a single socket, packed into the fewest
3+
# number of L3 caches possible.
4+
resources:
5+
- type: socket
6+
count: 1
7+
with:
8+
- type: core
9+
count: 4
10+
pattern: local

0 commit comments

Comments
 (0)