Skip to content

Make allocation of cpus and threads dynamic#437

Draft
mpaiao wants to merge 2 commits into
masterfrom
mpaiao-pr-ompcpu
Draft

Make allocation of cpus and threads dynamic#437
mpaiao wants to merge 2 commits into
masterfrom
mpaiao-pr-ompcpu

Conversation

@mpaiao

@mpaiao mpaiao commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

This is an attempt to fix issue #436. Instead of hard coding the number of threads and cpus, we allocate them based on the information retrieved by the intrinsic functions.

Collaborators

@LMurphy186232 who identified the problem
@xiangtaoxu who provided initial feedback

Types of changes

Changes in Settings, Input Files or Output Files

  • This feature requires changes in ED2IN
  • This feature requires changes in the XML parameter file
  • This feature requires changes in other input files
  • This feature will change output files

Expectation of Answer Changes:

  • No changes expected (bit-for-bit compatibility)
  • Changes expected with specific configurations (see details below)
  • Changes expected in all simulations (see details below)

Bit-for-bit compatibility when the number of cpus and number of threads is less than 64. Otherwise, this (hopefully) allows the code to run.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • ED2 Wiki update:

Testing :

  • All new and existing tests passed.

This is an attempt to fix issue #436. Instead of hard coding the number of threads and cpus, we allocate them based on the information retrieved by the intrinsic functions.
@mpaiao mpaiao requested a review from xiangtaoxu June 12, 2026 10:29
@LMurphy186232

Copy link
Copy Markdown

Don't merge this yet. It initializes thread_use and cpu_use before they are allocated, so OMP-enabled runs will crash.

@mpaiao

mpaiao commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @LMurphy186232! I made this very hastily, and it indeed needs testing.

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.

3 participants