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

WIP: MetaD NEIGHBOR list option to sum gaussians #639

Merged
merged 35 commits into from Nov 19, 2020

Conversation

carlocamilloni
Copy link
Member

this can be usefull with many cvs where grids are either too memory consuming
and/or too slow. I was playing with this idea with OPES and it actually works
pretty well. The neighbor list update at the moment is only openMP parallelised.
this commits add also the openMP parallelisation to the cycle over the gaussians.
The neighbour list is updated:

  • upon hill addition
  • upon replica-exchange step
  • if the CV gets farther than some sigma of when it was at the time of the last update

@GiovanniBussi @maxbonomi

I also need to add and perform some test

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 9, 2020

This pull request introduces 2 alerts when merging 3ae9fac into 4cc8ce7 - view on LGTM.com

new alerts:

  • 2 for Multiplication result converted to larger type

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 12, 2020

This pull request introduces 2 alerts when merging c35c4aa into 597647b - view on LGTM.com

new alerts:

  • 2 for Multiplication result converted to larger type

@GiovanniBussi
Copy link
Member

@carlocamilloni I didn't check the code, but I was wondering if this is exact or with some approximation.

If the criterion is on the distance from the position where the list was updated and it is exact, you might also remove the replica exchange condition, right?

Then, if it is exact, I would set it as a default and just allow to remove it for debugging. It might even be an environment variable and we would use it in the regtests as a reference. It looks something very useful, as it is will be easier than grids to use, and I saw many people doing the mistake of forgetting using grids.

Thanks!

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 12, 2020

This pull request introduces 3 alerts when merging d835bd6 into 329636b - view on LGTM.com

new alerts:

  • 3 for Multiplication result converted to larger type

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 12, 2020

This pull request introduces 3 alerts when merging ef3049e into 329636b - view on LGTM.com

new alerts:

  • 3 for Multiplication result converted to larger type

@codecov-io
Copy link

codecov-io commented Nov 12, 2020

Codecov Report

Merging #639 (241a475) into master (415dce9) will increase coverage by 0.12%.
The diff coverage is 89.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #639      +/-   ##
==========================================
+ Coverage   85.58%   85.71%   +0.12%     
==========================================
  Files         579      580       +1     
  Lines       49672    50350     +678     
==========================================
+ Hits        42514    43158     +644     
- Misses       7158     7192      +34     
Impacted Files Coverage Δ
src/bias/MetaD.cpp 86.38% <89.51%> (-1.84%) ⬇️
src/opes/OPESexpanded.cpp 98.05% <0.00%> (-0.42%) ⬇️
src/colvar/Energy.cpp 100.00% <0.00%> (ø)
src/opes/ECVmultiThermal.cpp 96.22% <0.00%> (ø)
src/opes/ECVmultiThermalBaric.cpp 96.47% <0.00%> (+0.74%) ⬆️
src/opes/OPESmetad.cpp 98.66% <0.00%> (+1.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 415dce9...66d6ced. Read the comment docs.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 13, 2020

This pull request introduces 3 alerts when merging 0d570f4 into 415dce9 - view on LGTM.com

new alerts:

  • 3 for Multiplication result converted to larger type

@carlocamilloni
Copy link
Member Author

@GiovanniBussi it is not exact, it may be made exact for gaussians with fixed sigma, otherwise it will be in general an approximation. Furthermore, while being faster than plain MetaD is not faster than using GRID because wrt OPES in METAD the number of gaussian increases linearly with time. Anyway I think that for METAD in 3-5 CVs it is the method of choice and it make it feasible. The pull request also add a general, quite significant, speed up to the simple METAD with no grid and neighbour list and an initial cleaning. Gaussian summation is also openMP parallelised now. At the moment I think that the main source of error in using NLIST is the discontinuity at DP2CUTOFF. Tomorrow I will add some number about the performances.

@carlocamilloni
Copy link
Member Author

carlocamilloni commented Nov 13, 2020

@GiovanniBussi

Numbers on ALADP (scalar)
ALADP in vacuum, 10ns

Plumed.dat:
MOLINFO STRUCTURE=aladp.pdb
phi: TORSION ATOMS=@Phi-2
psi: TORSION ATOMS=@psi-2
METAD ARG=phi,psi SIGMA=0.3,0.3 HEIGHT=1 BIASFACTOR=16 PACE=400
PRINT FILE=colvar ARG=* STRIDE=400

Original numbers (master branch)
SIMPLE: 260 ns/day with plumed taking 98% of the total simulation time
GRID: 6050 ns/day with plumed taking 60% of the total simulation time

New numbers (pull request):
SIMPLE: 900 ns/day with plumed taking 94% of the total simulation time
GRID: 7650 ns/day with plumed taking 55% of the total simulation time
NLIST: 1370 ns/day with plumed taking 91% of the total simulation time
NLIST (SIGMA=0.15,0.15): 2260 ns/day with plumed taking 86% of the total simulation time

note: the performances of GRID are constant, while those of SIMPLE and NLIST decreases with time, the pull request reduces the slope of the drop of performances quite significantly in the SIMPLE case and even more by using NLIST. For GRID and SIMPLE the gain is almost completely associated with a more efficient update(), while NLIST has an impact on calculate().

@carlocamilloni
Copy link
Member Author

I still need to add some regtest and port some more of the work done on OPES

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 16, 2020

This pull request introduces 3 alerts when merging a0d92fd into a2fc8b4 - view on LGTM.com

new alerts:

  • 3 for Multiplication result converted to larger type

src/bias/MetaD.cpp Outdated Show resolved Hide resolved

#define DP2CUTOFF 6.25

using namespace std;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlocamilloni good choice removing this... Code is more verbose but way more readable

@GiovanniBussi
Copy link
Member

@carlocamilloni is this also the right moment to transition to smoother functions? (see #420)

@carlocamilloni
Copy link
Member Author

carlocamilloni commented Nov 17, 2020 via email

@carlocamilloni
Copy link
Member Author

carlocamilloni commented Nov 17, 2020 via email

@GiovanniBussi
Copy link
Member

@GiovanniBussi it depends whether we want just a local change or if we want to change it all over plumed, in the latter case it should be a separate pull request. Anyway I think this is rather important for NLIST because right now it is the largest source of error.

On 17 Nov 2020, at 09:25, Giovanni @.***> wrote: @carlocamilloni https://github.com/carlocamilloni is this also the right moment to transition to smoother functions? (see #420 <#420>) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#639 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABC6L5VSMRPDUXV33F6W5JTSQIXNZANCNFSM4TOMIDMQ.

Yes I agree... Another PR to be opened after this is merged

@GiovanniBussi
Copy link
Member

GiovanniBussi commented Nov 17, 2020 via email

@carlocamilloni
Copy link
Member Author

carlocamilloni commented Nov 17, 2020 via email

GiovanniBussi added a commit that referenced this pull request Nov 17, 2020
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 17, 2020

This pull request introduces 3 alerts when merging 99cd349 into a2fc8b4 - view on LGTM.com

new alerts:

  • 3 for Multiplication result converted to larger type

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 17, 2020

This pull request introduces 3 alerts when merging 36ecc51 into c5c6ba9 - view on LGTM.com

new alerts:

  • 3 for Multiplication result converted to larger type

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 17, 2020

This pull request introduces 3 alerts when merging 58c71c2 into 2a40493 - view on LGTM.com

new alerts:

  • 3 for Multiplication result converted to larger type

- restart stops if hills not found
- broadcasting avoided if absolute path provided
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 17, 2020

This pull request introduces 3 alerts when merging 2091eab into 9b53458 - view on LGTM.com

new alerts:

  • 3 for Multiplication result converted to larger type

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 18, 2020

This pull request introduces 3 alerts when merging 241a475 into 9b53458 - view on LGTM.com

new alerts:

  • 3 for Multiplication result converted to larger type

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 18, 2020

This pull request introduces 3 alerts when merging 66d6ced into a4456d9 - view on LGTM.com

new alerts:

  • 3 for Multiplication result converted to larger type

@carlocamilloni carlocamilloni merged commit 190093f into master Nov 19, 2020
@carlocamilloni carlocamilloni deleted the metad-neighborlist branch November 19, 2020 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MPI_walker of the metaD failed to read and taken into account of the previous HILL files
4 participants