Skip to content

Pulled out existing affinity setting code to put in a separate library. Code simply wraps affinity routines, aims to be cross platform, but currently only supports linux.

License

Notifications You must be signed in to change notification settings

RaftLib/affinity

Repository files navigation

Affinity

Build status

CI

Notes

  • Pulled out raftlib core affinity functions to try to make more modular. This piece looks like it should be tested in isolation.
  • To build
cmake <path to affinity> -Wno-dev -CMAKE_BUILD_TYPE=[Release/Debug] -GNinja
ninja
ninja test
  • You can inject your own namespace if you'd like by setting the following options, also include the moduleflags.cmake file at the global level so that CFLAGS prop through all files:
-DAFFINITY_CUSTOM_NAMESPACE=YES
-DAFFINITY_NAMESPACE=<Name>
  • test cases only test functionality at the moment, need to add test cases for perf as well and more corner cases.

Usage

Include the header file

#include <affinity>

then link

-laffinity

and use this library inside your c++ code base

affinity::set( core );

and that's pretty much it. If you've chosen to inject your own namespace when building the library, you'll need to modify the invocation above like this:

your_namespace::affinity::set( core );

Platforms

  • Currently only sets affinity for Linux, will assign others to do Win/Mac at some point.
  • CI currently only checks Linux but will add others as we enable setting affinity on those platforms.

About

Pulled out existing affinity setting code to put in a separate library. Code simply wraps affinity routines, aims to be cross platform, but currently only supports linux.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published