diff --git a/README.md b/README.md index 3d2f3c8..a2c77f2 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ on the SX-Aurora Vector Engines located in the current host: * load and memory statistics of VEs, * information on processes running on the VEs, * fan, temperature, voltage of VEs, +* reading and setting the VE core affinity of processes, * various statistical infos, * a mechanism to read VE register values of own processes. @@ -253,6 +254,32 @@ Example: '', '', '', '', '', '']} ``` +### `sched_getaffinity(int nodeid, pid_t pid)` and `sched_setaffinity(int nodeid, pid_t pid, uint64_t mask)` + +A VE thread's CPU affinity mask determines the set of cores on its VE +node on which it is eligible to run. These functions are equivalent to +the normal Linux +[*sched_getaffinity(2)*](https://linux.die.net/man/2/sched_getaffinity) +and +[*sched_setaffinity(2)*](https://linux.die.net/man/2/sched_setaffinity) +calls but refers to a particular *pid* running on a particular +*nodeid*. Setting the VE core affinity of a thread requires as third +argument a bitmask that specifies the cores. For 8 cores only the +lowest 8 bits are relevant. + +The functions return 0 on success and -1 on failure. + +Example: +``` +>>> from veosinfo import * +>>> sched_getaffinity(0, 23360) +255L +>>> sched_setaffinity(0, 23360, 0x4) +4L +>>> sched_getaffinity(0, 23360) +4L +``` + ### `stat_info(int nodeid)` Returns CPU statistics information of each code of the specified VE. diff --git a/setup.cfg b/setup.cfg index 091e511..01d8e59 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ executable=/usr/bin/env python [bdist_rpm] -release = 2 +release = 1 packager = Erich Focht [install] diff --git a/setup.py b/setup.py index 0cbc998..74a95b3 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ setup( name = "py-veosinfo", - version = "1.3.2", + version = "1.3.2a", ext_modules = ext_mods, scripts = ["veperf"], author = "Erich Focht",