Giter Site home page Giter Site logo

CPU demo loop about celeritas HOT 5 CLOSED

sethrj avatar sethrj commented on May 24, 2024
CPU demo loop

from celeritas.

Comments (5)

amandalund avatar amandalund commented on May 24, 2024 1

Do we need space for more than one track state on the CPU? Seems like we would have an outer loop over primaries and initialize the track from each primary/transport it one by one. The track initialization code (extend_from_primaries, initialize_tracks, extend_from_secondaries) is all device-specific, so we'll different logic on the CPU anyway.

from celeritas.

paulromano avatar paulromano commented on May 24, 2024 1

The way I've been structuring things so far is to have a loop over thread IDs when adding an equivalent CPU "kernel", e.g.
https://github.com/paulromano/celeritas/blob/a611b0ba8adc23d56e8d086a6552153ed8678af9/src/physics/em/detail/KleinNishina.cc#L32-L33

This exposes some loop-level parallelism so that if we wanted to actually use CPU threads, it would be pretty straightforward. The alternative would be for the CPU kernels to omit that loop and instead have an outer loop over primaries, as you suggest. Either way, we'll need to have an outer loop for the case where # primaries > # tracks, so the question is really just on the inner loop do we want to allow more than one primary/track?

from celeritas.

paulromano avatar paulromano commented on May 24, 2024

One issue I've run into with trying to run the demo loop on CPU: right now, the problem consists of 15 primaries but we're only setting room in the state data for a single primary:

resize(&state_storage, build_params_refs<MemSpace::host>(params), 1);

It looks like this is because VGNavCollection on the host only permits its size to be one, so increasing the above size just leads to precondition errors on the size of the navigation state. From what I can gather, the options to get around this are:

  1. Use NavStatePool on host as we currently do for device to allow multiple CPU "threads"
  2. Extend the demo loop logic to account for the case where # primaries > # tracks (not yet implemented for GPU), and continue with a single primary on CPU

Any thoughts on the best path forward would be appreciated

from celeritas.

sethrj avatar sethrj commented on May 24, 2024

I think either approach would be fine, but single-threaded should be our initial goal and I will approve most expedients to get us there. :)

from celeritas.

sethrj avatar sethrj commented on May 24, 2024

Closed by #273 and #310

from celeritas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.