Skip to content

Conversation

@mmuetzel
Copy link
Contributor

@mmuetzel mmuetzel commented Dec 29, 2025

Determine the number of physical processors of the build host and limit the number of OpenMP threads to that for each test.
If a test is involving multiple MPI processes, divide the number of physical processors by the number of used MPI processes. Set the number of OpenMP threads to the integer floor of that result.

If a user sets OMP_NUM_THREADS explicitly in the environment that takes precedence over the automatic selection.

With that, remove explicitly setting OMP_NUM_THREADS in the build rules for Windows MinGW.

That is essentially what @juharu suggested in #725 (comment).

@mmuetzel
Copy link
Contributor Author

mmuetzel commented Dec 29, 2025

I don't know why the test TopoOptHeat2DCompMin is failing for some runners.
Re-running the tests didn't make a difference. So, the error is likely deterministic.

The failing Ubuntu runner has the following in its stderr:

  Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
  
  Backtrace for this error:
  #0  0x7fe28be23e59 in ???
  #1  0x7fe28be22e75 in ???
  #2  0x7fe28ba4532f in ???
  #3  0x7fe28c94d5d0 in __matrixassembly_MOD_uselocalmatrixstorage
  #4  0x7fe28c7abc05 in __defutils_MOD_defaultupdateequationsr
  #5  0x7fe28bc278fd in localmatrix.8.isra.0
  #6  0x7fe28bc2ab51 in heatsolver_._omp_fn.0
  #7  0x7fe28bc8d79e in ???
  #8  0x7fe28ba9caa3 in ???
  #9  0x7fe28bb29c6b in ???
  #10  0xffffffffffffffff in ???

I don't know if that helps.

@mmuetzel
Copy link
Contributor Author

Fwiw, the number of physical processors of the GitHub-hosted Ubuntu runners is 2. I.e., OMP_NUM_THREADS is set to 2 (for tests that don't involve multiple MPI processes like the failing one).

Determine the number of physical processors of the build host and limit
the number of OpenMP threads to that for each test.
If a test is involving multiple MPI processes, divide the number of
physical processors by the number of used MPI processes. Set the number
of OpenMP threads to the integer floor of that result.

If a user sets `OMP_NUM_THREADS` explicitly in the environment, that
takes precedence over the automatic selection.
The tests are limiting the number of OpenMP threads by themselves.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant