Skip to content

Capability to switch number of OpenMP threads for different sub-apps #1173

@lewisgross1296

Description

@lewisgross1296

Reason

I recently ran into trouble when trying to do a coupled simulation where I was having inability to converge with any number of OpenMP threads greater than a certain number. This effectively limits my --n-threads argument to that number (which was 32). However, I really would like to be able to run OpenMC with the max threads per node (112 on Windriver). This thread behavior is likely a bug, but until it gets solved, I'll need to run my MOOSE Heat Conduction with 32 threads. In theory, you can just bump up the MPI procs to account for less threads, however, using multiple MPI processes per node has multiplicative memory requirements and my OpenMC models are large.

It appears, that there's currently no way to accomplish something like this, see libmesh/libmesh#4185.

Design

A few things would be required

  • A function to change the number of threads being used, likely from the OpenMC side.
  • Code in OpenMCCellAverageProblem to switch the number of threads back and forth before/after each OpenMC run. Likely some MOOSE data structures rely on the initial threading configuration, so we'd want to make sure not to break it
  • Some member variable that stores the number of threads for each (sub)app

Impact

This would be pretty useful for me in the case that we can't debug my threading issue quickly. It could also be useful for others wishing to use different numbers of threads for different applications, which might be a generally useful feature, for simulation and/or debugging.

Additional context
Add any other context or screenshots about the feature request here.
Tagging @pshriwise in case I missed anything from our discussion

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