Skip to content

Custom intrinsic scopes #72

@eleon

Description

@eleon

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 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions