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

Small optimization in CoordinationBase #1096

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

Iximiel
Copy link
Member

@Iximiel Iximiel commented Jul 10, 2024

Description

I changed how the couples are traversed in the CoordinationBase calculate() method, by passing from a "striped" traversal to a "block" one.
I get a 3%-5% speedup on my local machine.


Here are some results I got on my workstation, the graph show the time spent in calculate() relative to the time spent in calculate in the master branch

for 4 mpi processes and 2 threads each one
image

for 1 process with 8 threads (Here I did not expect performance improvement)
image


Before removing the draft status I'd like to see if it is possible to not store the couples in the neighbor list if the user asks for a fixed list

Target release

I would like my code to appear in release 2.10 (but I think this can rebased on 2.9)

Type of contribution
  • changes to code or doc authored by PLUMED developers, or additions of code in the core or within the default modules
  • changes to a module not authored by you
  • new module contribution or edit of a module authored by you
Copyright
  • I agree to transfer the copyright of the code I have written to the PLUMED developers or to the author of the code I am modifying.
  • the module I added or modified contains a COPYRIGHT file with the correct license information. Code should be released under an open source license. I also used the command cd src && ./header.sh mymodulename in order to make sure the headers of the module are correct.
Tests
  • I added a new regtest or modified an existing regtest to validate my changes.
  • I verified that all regtests are passed successfully on GitHub Actions.

@GiovanniBussi
Copy link
Member

I think you get an improvement also with pure openmp because also in that case the access to continuous memory is faster

@Iximiel Iximiel marked this pull request as ready for review July 24, 2024 12:29
@Iximiel
Copy link
Member Author

Iximiel commented Jul 24, 2024

Before removing the draft status I'd like to see if it is possible to not store the couples in the neighbor list if the user asks for a fixed list

I think it may be a better idea to do that in a separate PR

If you think it may be better to try another benchmark I'll do it, otherwise, I think it can be merged/rebased on 2.9

@GiovanniBussi
Copy link
Member

I think we can merge it. It can even go to v2.9 because the change is minimal.

@Iximiel
Copy link
Member Author

Iximiel commented Jul 24, 2024

Ok, then I'm rebasing this to the v2.9

@Iximiel Iximiel force-pushed the CoordinationStride branch from b11eb0a to 74fa8d1 Compare July 24, 2024 14:25
@Iximiel Iximiel changed the base branch from master to v2.9 July 24, 2024 14:26
@Iximiel
Copy link
Member Author

Iximiel commented Jul 24, 2024

I changed the base and I pushed for the CI. while the CI is running I'm also comparing the branch with the master v2.9

@GiovanniBussi GiovanniBussi merged commit fe18eee into plumed:v2.9 Jul 24, 2024
22 checks passed
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.

2 participants