Skip to content

Commit 94fb20c

Browse files
authored
Merge pull request #11 from jorisv/topic/hwloc
Add hwloc instruction
2 parents 6c0887f + da43e8b commit 94fb20c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,40 @@ Then, when running CMake **for the first time** use the following command:
328328
```bash
329329
CC=clang CXX=clang++ cmake ..
330330
```
331+
332+
## Launch a process on a particular CPU/CORE/PU
333+
334+
[hwloc tools](https://www.open-mpi.org/projects/hwloc/) allow to study computer and computer cluster topology.
335+
336+
To install `hwloc` on ubuntu, run the following `apt` command:
337+
338+
```bash
339+
sudo apt install hwloc
340+
```
341+
342+
You can show your computer architecture topology with:
343+
344+
```bash
345+
lstopo
346+
```
347+
348+
Also, you can run a process on a particular CPU/CORE/PU with the following command:
349+
350+
```bash
351+
# Run my_exe on processing unit 0
352+
hwloc-bind pu:0 -- my_exe
353+
# Run my_exe on core 2
354+
hwloc-bind pu:2 -- my_exe
355+
```
356+
357+
You can then watch where processes are running with:
358+
359+
```bash
360+
lstopo --ps
361+
```
362+
363+
To go deeper, a [tutorial](https://www.open-mpi.org/projects/hwloc/tutorials/20120702-POA-hwloc-tutorial.html) is available.
364+
331365
## Get stack size
332366
333367
The stack of a program is limited in memory space available. One way to get this value is to run in your favorite terminal:
@@ -341,3 +375,4 @@ More information on the current configuration can be obtained via:
341375
```bash
342376
ulimit -a
343377
```
378+

0 commit comments

Comments
 (0)