Skip to content
Discussion options

You must be logged in to vote

@phil-skillwon There might be better ways to achieve what you want, depending on why you need CPU affinity in the first place, but I recently had to do something similar so here's one mechanism related to what you need:

The thread_schedule_hint can be used to schedule an hpx thread on a specific queue in the hpx scheduler (each queue is associated with a single physical core).

If you are using hpx::async to launch tasks, you can pass an executor with an appropriate thread_schedule_hint:
https://github.com/STEllAR-GROUP/hpx/blob/d08354defb0a5c37bf5ad5da77191f10db9c3067/libs/core/resource_partitioner/tests/unit/scheduler_binding_check.cpp#L64-L75

(or decorate an existing executor using hpx:…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@phil-skillwon
Comment options

@hkaiser
Comment options

@phil-skillwon
Comment options

@hkaiser
Comment options

Answer selected by phil-skillwon
Comment options

You must be logged in to vote
1 reply
@phil-skillwon
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants