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

Prefetch data products from Event concurrently #15433

Merged
merged 22 commits into from
Aug 11, 2016

Commits on Aug 10, 2016

  1. Legacy and one modules must prefetch mayConsumes

    In order to avoid the possibility of deadlocks occurring while a legacy or one module is doing a delayed get while running, we will disallow such activities. Once the full implementation of multiple threads per event is implemented, this restriction will be lifted.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    5529a76 View commit details
    Browse the repository at this point in the history
  2. Always prefetch

    To simplify the initial implementation of allowing multiple threads for one event, we require all 'mayConsumes' to be prefetched.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    e249165 View commit details
    Browse the repository at this point in the history
  3. Removed unnecessary functions

    The Event based module signals are handled elsewhere.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    6a6247e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9bc1e5d View commit details
    Browse the repository at this point in the history
  5. Add WaitingTaskList to InputProductResolver

    Once we allow asynchronous data fetching from the source for one event we will need to using a WaitingTaskList to handle starting tasks which are waiting for the data.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    dbfa6e2 View commit details
    Browse the repository at this point in the history
  6. Refactoring needed to allow prefetching data asynchronously

    -changed function names for prefetching to include Async and pass in a callback task as argument.
    -separated prefetching and running modules into two different functions in Worker
    -made sure all unit tests still pass
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    7314e11 View commit details
    Browse the repository at this point in the history
  7. Moved exceptionContext into Worker

    exceptionContext was previously a standalone templated function. The template was being created for each OccurenceTraits. This was changed to just be a static non-templated function of Worker.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    2b4034a View commit details
    Browse the repository at this point in the history
  8. Removed return value argument from ProductResolver::resolveProduct call

    Previously one of the function arguments to ProductResolverBase::resolveProduct was used as a return value to denote if the request was 'ambiguous'. Such an argument is problematic for an asynchronous call. Instead, the return value of the function was changed to accommodate also carrying that information.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    398a096 View commit details
    Browse the repository at this point in the history
  9. Cache decisions from NoProcessProductResolver

    Cache the decision of what ProductResolver to call after the first call each transition to NoProcessProductResolver. This will allow prefetching to trigger the real work and then when the data is later requested in the module we will not redo the work.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    bf5a5c9 View commit details
    Browse the repository at this point in the history
  10. Begin transition to using SerialTaskQueues instead of mutexes

    Ultimately shared resources will be handled via SerialTaskQueues but that transition can be done gradually. First start by using a SerialTaskQueue for all requests going to the Source.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    a7d30d9 View commit details
    Browse the repository at this point in the history
  11. First crude implementation of asynchronous prefetching

    This is only a starting point for asynchronous prefetches used to checkpoint that the code which has been written passes all framework unit tests.
    Items which are still under work:
    -Modules on Paths request asynchronous prefetches but then wait for them to be resolved.
    -UnscheduledProductResolvers will run their modules synchronously if that is the first request for the data product. If other requests come while running the module, those requests will be done asynchronously.
    -Mutexes are still used to synchronize across Streams.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    903e648 View commit details
    Browse the repository at this point in the history
  12. Make UnscheduledProductResolver::prefetchAsync actually asynchronous

    Spawn a task in the case where prefetchAsync is called for the first time. This eventually should be changed to properly handle using the WaitingTaskQueue in the Worker as well as separating prefetching the products for the Worker from running of the module via the Worker.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    542b3d8 View commit details
    Browse the repository at this point in the history
  13. Added BusyWaitIntProducer for testing

    The BusyWaitIntProducer was developed in order to have a test module actually take up some time and CPU cycles.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    1fffaad View commit details
    Browse the repository at this point in the history
  14. Updated unit test output for unscheduled changes

    Updated the unit test output comparison files to account for the changed order of calling unscheduled modules. The order was changed because asynchronous prefetching runs the modules in FILO order instead of FIFO as was done before. The two orderings are equivalent since unscheduled doesn't care about the order.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    4b85d2b View commit details
    Browse the repository at this point in the history
  15. Set worker state in a thread safe manner

    Handle the worker state transitions as well as state accounting in a thread safe manner.
    Switch to using std::exception_ptr for caching any exceptions.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    741fda1 View commit details
    Browse the repository at this point in the history
  16. Added Worker::shouldRethrowException function

    Moved the logic that decides if an exception should be rethrown into a separate function. This decreases the size of the templated Worker::doWork function and setups to allow that code to be used for the asynchronous processing function.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    834dd9c View commit details
    Browse the repository at this point in the history
  17. Separate prefetching and module running into different tasks

    When running a module in unscheduled mode, have the UnscheduledProductResolver start a task to do any needed prefetching of data. Once all the prefetching has been completed, have the last task launch the task which will run the module.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    f60dc14 View commit details
    Browse the repository at this point in the history
  18. Added prefetching signals to ActivityRegistry

    The Service system now emits a signal before and after a module has done prefetching.
    The Tracer service was updated to use this signal.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    0e996f1 View commit details
    Browse the repository at this point in the history
  19. Enable Service system within TBB tasks

    When a TBB task started by the framework starts up, we need to make sure the ServiceRegistry is properly setup to allow Services to be visible.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    854196c View commit details
    Browse the repository at this point in the history
  20. Make ROOT aware of all TBB threads

    Now that we can use more TBB threads than Streams in the system, we need to make sure that all of the threads are known to ROOT. This is done by creating 1 task for each thread and then waiting until all tasks have done their work before proceeding.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    3203550 View commit details
    Browse the repository at this point in the history
  21. Fixed case of recursive call into NoProcessProductResolver

    Fixed the case where a module asks for data with the same label as
    the module but from an earlier process via the skipCurrentProcess
    mechanism.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    043b0e3 View commit details
    Browse the repository at this point in the history
  22. Move CMS_THREAD_GUARD to proper line

    CMS_THREAD_GUARD should be on the line for the variable being guarded and the argument should be the variable doing the guarding. The previous version of the code had those reversed.
    Dr15Jones committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    516d54a View commit details
    Browse the repository at this point in the history