Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: set OpenMP thread num to a proper default value #3943

Merged
merged 13 commits into from
May 22, 2024

Conversation

caic99
Copy link
Member

@caic99 caic99 commented Apr 10, 2024

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #3701

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

ABACUS will try to set a proper OpenMP threading value if OMP_NUM_THREADS is not set, and exit with error if the value set is beyond hardware availability (which should not happen since the value has been automatically set).

@caic99
Copy link
Member Author

caic99 commented Apr 11, 2024

Could someone please help me on this error building tests?

@QuantumMisaka
Copy link

QuantumMisaka commented Apr 11, 2024

@caic99 I have some test by using this repo. It worked well , but if the machine has hyper-thread (like WSL or bohrium image), the product of OMP number and MPI number will include hyper-thread and lead to lower parallel efficiency than the hardware-core (hyper-thread / 2) situation.

@caic99
Copy link
Member Author

caic99 commented Apr 11, 2024

@caic99 I have some test by using this repo. It worked well , but if the machine has hyper-thread (like WSL or bohrium image), the product of OMP number and MPI number will include hyper-thread and lead to lower parallel efficiency than the hardware-core (hyper-thread / 2) situation.

It's hard to determine with standard c++ API whether hyperthreading is used.

@caic99 caic99 requested a review from dyzheng April 17, 2024 06:00
@mohanchen
Copy link
Collaborator

Any updates?

@caic99 caic99 requested a review from WHUweiqingzhou May 6, 2024 07:14
@caic99 caic99 requested a review from mohanchen May 11, 2024 07:41
@mohanchen mohanchen added the Compile & CICD Issues related to compiling ABACUS label May 11, 2024
@caic99 caic99 requested a review from mohanchen May 20, 2024 09:24
@mohanchen mohanchen merged commit 857e73c into deepmodeling:develop May 22, 2024
13 checks passed
@caic99 caic99 deleted the fix-omp branch May 22, 2024 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compile & CICD Issues related to compiling ABACUS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: set default OpenMP parallel number to 1
4 participants