pnnl / lamellar-runtime

Lamellar is an asynchronous tasking runtime for HPC systems developed in RUST
Other
43 stars 5 forks source link

Add API call to get number of PE threads #28

Closed JosephCottam closed 1 year ago

JosephCottam commented 1 year ago

I'm working on some code that will only work if the PE only has one thread to execute with (some values are not Send). I would like to check that it was started with only one thread per PE when validating the program flags.

rdfriese commented 1 year ago

Ahh timely issue, there is a new function in the Dev branch for LamellarWorld called num_threads(), this will return the number of threads executing on the PE (including the main thread)

I don't currently provide the function for lamellar teams, but if you think it would be useful that's an easy thing to add!

JosephCottam commented 1 year ago

Does that give the threads per-pe, or total number of threads across all PEs?

On the world object would be sufficient for my needs, since I am checking the global configuration at startup.

rdfriese commented 1 year ago

It will be per-pe, but it should be the same on all PEs so total threads across PEs would be world.num_pes() * world.num_threads() (and now that I type that out I can see the confusion...)

rdfriese commented 1 year ago

changed this to now be num_threads_per_pe() instead of num_threads() This function is implemented for any object that implements LamellarEnv #14