-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Courtesy of @adammoody.
As a concrete use case, we might have a situation like:
- an application uses SCR and MPI
- SCR spawns a background thread per application process for data copies from node-local storage to parallel file system
- MPI spawns a background thread per application process for async progress
Ideally, those background threads would run on different cores than the main application thread to avoid contention. However, they could run on the same core as the main app thread if there are no spare cores available. The background threads could run on the same core together, since they are likely not CPU intensive.
Does the Quo Vadis interface provide a way to specify a situation like that?
We can use hints within qv_scope_create to accomodate this.
// worker_scope has been defined by the app
// Get the system cores
qv_scope_get(ctx, QV_SCOPE_SYSTEM, &sys_scope);
// Check if there are available PUs
qv_scope_nobjs_avail(ctx, sys_scope, QV_HW_OBJ_PU, &pus);
if (pus > 0)
qv_scope_create(ctx, sys_scope, QV_HW_OBJ_PU, 1,
QV_SCOPE_ATTR_INCLUSIVE,
&sub_scope);
else
sub_scope = worker_scope;
// Launch the thread(s)
qv_pthread_create(thread, attr, start_routine, arg,
subscope, ctx);
What we need to implement:
QV_SCOPE_SYSTEMqv_pthread_createqv_scope_nobjs_avail- Hints: Implement (and define) the hints that
qv_scope_createcan take. The INCLUSIVE (or shared) hint means that other workers may be running on the same resource (the opposite of exclusive). By default we should place threads using a BFS strategy and then fill up the cores if multiple hardware threads are available.
I guess both SCR and MPI would need to make QV calls?
Yes, the more components that use QV, the better placement and coordination.
samuelkgutierrez
Metadata
Metadata
Assignees
Labels
No labels