Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom intrinsic scopes #72

Open
eleon opened this issue Jan 31, 2024 · 0 comments
Open

Custom intrinsic scopes #72

eleon opened this issue Jan 31, 2024 · 0 comments

Comments

@eleon
Copy link
Member

eleon commented Jan 31, 2024

We currently have predefined intrinsic scopes such as QV_SCOPE_USER and QV_SCOPE_PROCESS. It would be helpful to allow users to define intrinsic scopes that external libraries can use for computing.

Let's say I have an application that calls into a QV-enabled MPI library and this application wants the MPI library to use specific cores for doing MPI progress. Since the app cannot change the MPI API, passing these resources as a scope has to be done implicitly. The app could create an intrinsic scope via:

## Mirror call of qv_scope_get
qv_scope_put(qv_context_t *ctx, qv_scope_t **scope, char *name);
## For example 
qv_scope_put(ctx, bottom_hw_threads_scope, 'QV_SCOPE_UTILITY'); 

The MPI library would then use the resources associated with QV_SCOPE_UTILITY to launch its progress threads:

qv_scope_get(ctx, QV_SCOPE_UTILITY, &progress_th_scope); 

Among other things, this may involve changing the type of iscope in

qv_scope_get(qv_context_t *ctx, qv_scope_intrinsic_t iscope, qv_scope_t **scope)

Alternatively, we can allow users to custom-define a specific intrinsic scope, say QV_SCOPE_UTILITY, rather than allow them to create custom intrinsic scopes in general. This would work too and, perhaps, would make the implementation easier 😃

In this case the following call would work, but it would only be supported for QV_SCOPE_UTILITY (and other specific names if we decide to extend this capability):

qv_scope_put(ctx, bottom_hw_threads_scope, QV_SCOPE_UTILITY); 

Note that QV_SCOPE_UTILITY would be an enum, not a string, since QV would control the names of all the intrinsic scopes 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant