-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix-newmac-arm-issues
- Loading branch information
Showing
38 changed files
with
69,756 additions
and
69,281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../../scripts/test.make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type=make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
#include "plumed/tools/AtomNumber.h" | ||
#include "plumed/tools/Communicator.h" | ||
#include "plumed/tools/NeighborList.h" | ||
#include "plumed/tools/Pbc.h" | ||
#include <fstream> | ||
#include <iostream> | ||
|
||
using PLMD::AtomNumber; | ||
using PLMD::Communicator; | ||
using PLMD::NeighborList; | ||
using PLMD::Pbc; | ||
|
||
// Testing that the Neigbour list will be intialized with the desired number of | ||
// couples | ||
// We are initializing with distance and stride not set to check the default | ||
// parameters | ||
|
||
#define check(arg) (((arg)) ? "pass\n" : "not pass\n") | ||
|
||
int main(int, char **) { | ||
std::ofstream report("unitTest"); | ||
Pbc pbc{}; | ||
pbc.setBox(PLMD::Tensor({1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0})); | ||
Communicator cm{}; | ||
bool serial = true; | ||
bool do_pbc = false; | ||
for (const size_t nat0 : {100, 500, 1000, 10000}) { | ||
std::vector<AtomNumber> list0(nat0); | ||
size_t i = 0; | ||
for (auto &an : list0) { | ||
an.setIndex(i); | ||
++i; | ||
} | ||
{ | ||
report << "Single list:\n"; | ||
std::string prepend="["+std::to_string(nat0)+"]"; | ||
size_t expected = ((nat0 - 1) * nat0) / 2; | ||
auto nl = NeighborList(list0, serial, do_pbc, pbc, cm); | ||
|
||
bool expectedcouples = true; | ||
{ | ||
size_t cID = 0; | ||
for (size_t i0 = 0; i0 < nat0 && expectedcouples; ++i0) { | ||
for (size_t i1 = i0+1; i1 < nat0 && expectedcouples; ++i1) { | ||
auto couple = nl.getClosePair(cID); | ||
expectedcouples &= couple.first == i0; | ||
expectedcouples &= couple.second == i1; | ||
++cID; | ||
} | ||
} | ||
} | ||
report << prepend << "Initial number: " | ||
<< check(nl.size() == expected); | ||
report << prepend << "getIndexPair(): " | ||
<< check(expectedcouples); | ||
report << prepend << "Lastupdate is 0: " | ||
<< check(nl.getLastUpdate() == 0); | ||
report << prepend << "Default stride is 0: " | ||
<< check(nl.getStride() == 0); | ||
report << "\n"; | ||
} | ||
for (const size_t nat1 : {100, 500, 1000, 10000}) { | ||
|
||
std::vector<AtomNumber> list1(nat1); | ||
|
||
i = 0; | ||
for (auto &an : list1) { | ||
an.setIndex(i); | ||
++i; | ||
} | ||
|
||
{ | ||
report << "Double list, no pairs:\n"; | ||
std::string prepend="["+std::to_string(nat0) | ||
+ ", " + std::to_string(nat1) +"]"; | ||
bool do_pair = false; | ||
size_t expected = nat1 * nat0; | ||
auto nl = NeighborList(list0, list1, serial, do_pair, do_pbc, pbc, cm); | ||
|
||
bool expectedcouples = true; | ||
{ | ||
size_t cID = 0; | ||
for (size_t i0 = 0; i0 < nat0 && expectedcouples; ++i0) { | ||
for (size_t i1 = 0; i1 < nat1 && expectedcouples; ++i1) { | ||
auto couple = nl.getClosePair(cID); | ||
//The getIndexPair for non couple input must return this be this | ||
//(cID / nat1); | ||
expectedcouples &= couple.first == i0; | ||
//(cID % nat1 + nat0); | ||
expectedcouples &= couple.second == nat0+i1; | ||
++cID; | ||
} | ||
} | ||
} | ||
report << prepend << "Initial number: " | ||
<< check(nl.size() == expected); | ||
report << prepend << "getIndexPair(): " | ||
<< check(expectedcouples); | ||
report << prepend << "Lastupdate is 0: " | ||
<< check(nl.getLastUpdate() == 0); | ||
report << prepend << "Default stride is 0: " | ||
<< check(nl.getStride() == 0); | ||
report << "\n"; | ||
} | ||
|
||
if (nat1 == nat0) { | ||
report << "Double list, with pairs:\n"; | ||
std::string prepend="["+std::to_string(nat0) | ||
+ ", " + std::to_string(nat1) +"]"; | ||
bool do_pair = true; | ||
size_t expected = nat0; | ||
auto nl = NeighborList(list0, list1, serial, do_pair, do_pbc, pbc, cm); | ||
|
||
bool expectedcouples = true; | ||
for (size_t cID = 0; cID < nat0 && expectedcouples; ++cID) { | ||
auto couple = nl.getClosePair(cID); | ||
expectedcouples &= couple.first == cID; | ||
expectedcouples &= couple.second == cID + nat0; | ||
} | ||
report << prepend << "Initial number: " | ||
<< check(nl.size() == expected); | ||
report << prepend << "getIndexPair(): " | ||
<< check(expectedcouples); | ||
report << prepend << "Lastupdate is 0: " | ||
<< check(nl.getLastUpdate() == 0); | ||
report << prepend << "Default stride is 0: " | ||
<< check(nl.getStride() == 0); | ||
report << "\n"; | ||
} | ||
} | ||
} | ||
} |
144 changes: 144 additions & 0 deletions
144
regtest/basic/rt-NeigbourlistInitialization/unitTest.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
Single list: | ||
[100]Initial number: pass | ||
[100]getIndexPair(): pass | ||
[100]Lastupdate is 0: pass | ||
[100]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[100, 100]Initial number: pass | ||
[100, 100]getIndexPair(): pass | ||
[100, 100]Lastupdate is 0: pass | ||
[100, 100]Default stride is 0: pass | ||
|
||
Double list, with pairs: | ||
[100, 100]Initial number: pass | ||
[100, 100]getIndexPair(): pass | ||
[100, 100]Lastupdate is 0: pass | ||
[100, 100]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[100, 500]Initial number: pass | ||
[100, 500]getIndexPair(): pass | ||
[100, 500]Lastupdate is 0: pass | ||
[100, 500]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[100, 1000]Initial number: pass | ||
[100, 1000]getIndexPair(): pass | ||
[100, 1000]Lastupdate is 0: pass | ||
[100, 1000]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[100, 10000]Initial number: pass | ||
[100, 10000]getIndexPair(): pass | ||
[100, 10000]Lastupdate is 0: pass | ||
[100, 10000]Default stride is 0: pass | ||
|
||
Single list: | ||
[500]Initial number: pass | ||
[500]getIndexPair(): pass | ||
[500]Lastupdate is 0: pass | ||
[500]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[500, 100]Initial number: pass | ||
[500, 100]getIndexPair(): pass | ||
[500, 100]Lastupdate is 0: pass | ||
[500, 100]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[500, 500]Initial number: pass | ||
[500, 500]getIndexPair(): pass | ||
[500, 500]Lastupdate is 0: pass | ||
[500, 500]Default stride is 0: pass | ||
|
||
Double list, with pairs: | ||
[500, 500]Initial number: pass | ||
[500, 500]getIndexPair(): pass | ||
[500, 500]Lastupdate is 0: pass | ||
[500, 500]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[500, 1000]Initial number: pass | ||
[500, 1000]getIndexPair(): pass | ||
[500, 1000]Lastupdate is 0: pass | ||
[500, 1000]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[500, 10000]Initial number: pass | ||
[500, 10000]getIndexPair(): pass | ||
[500, 10000]Lastupdate is 0: pass | ||
[500, 10000]Default stride is 0: pass | ||
|
||
Single list: | ||
[1000]Initial number: pass | ||
[1000]getIndexPair(): pass | ||
[1000]Lastupdate is 0: pass | ||
[1000]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[1000, 100]Initial number: pass | ||
[1000, 100]getIndexPair(): pass | ||
[1000, 100]Lastupdate is 0: pass | ||
[1000, 100]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[1000, 500]Initial number: pass | ||
[1000, 500]getIndexPair(): pass | ||
[1000, 500]Lastupdate is 0: pass | ||
[1000, 500]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[1000, 1000]Initial number: pass | ||
[1000, 1000]getIndexPair(): pass | ||
[1000, 1000]Lastupdate is 0: pass | ||
[1000, 1000]Default stride is 0: pass | ||
|
||
Double list, with pairs: | ||
[1000, 1000]Initial number: pass | ||
[1000, 1000]getIndexPair(): pass | ||
[1000, 1000]Lastupdate is 0: pass | ||
[1000, 1000]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[1000, 10000]Initial number: pass | ||
[1000, 10000]getIndexPair(): pass | ||
[1000, 10000]Lastupdate is 0: pass | ||
[1000, 10000]Default stride is 0: pass | ||
|
||
Single list: | ||
[10000]Initial number: pass | ||
[10000]getIndexPair(): pass | ||
[10000]Lastupdate is 0: pass | ||
[10000]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[10000, 100]Initial number: pass | ||
[10000, 100]getIndexPair(): pass | ||
[10000, 100]Lastupdate is 0: pass | ||
[10000, 100]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[10000, 500]Initial number: pass | ||
[10000, 500]getIndexPair(): pass | ||
[10000, 500]Lastupdate is 0: pass | ||
[10000, 500]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[10000, 1000]Initial number: pass | ||
[10000, 1000]getIndexPair(): pass | ||
[10000, 1000]Lastupdate is 0: pass | ||
[10000, 1000]Default stride is 0: pass | ||
|
||
Double list, no pairs: | ||
[10000, 10000]Initial number: pass | ||
[10000, 10000]getIndexPair(): pass | ||
[10000, 10000]Lastupdate is 0: pass | ||
[10000, 10000]Default stride is 0: pass | ||
|
||
Double list, with pairs: | ||
[10000, 10000]Initial number: pass | ||
[10000, 10000]getIndexPair(): pass | ||
[10000, 10000]Lastupdate is 0: pass | ||
[10000, 10000]Default stride is 0: pass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../../scripts/test.make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
type=make | ||
|
||
plumed_regtest_after(){ | ||
#this discards the lines like | ||
#"(tools/NeighborList.cpp:98) void PLMD::NeighborList::initialize()" | ||
# in this way if NeighborList.cpp is moved or modified this test won't | ||
#trigger a (false) error | ||
awk '/(Single|Double|neighbor) list/{print} | ||
/Exception text/{print}' ./unitTest > unitTest.proc | ||
} |
Oops, something went wrong.
50701c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found broken examples in automatic/a-masterclass-22-09.txt
Found broken examples in automatic/a-masterclass-22-11.txt
Found broken examples in automatic/a-masterclass-22-12.txt
Found broken examples in automatic/performance-optimization.txt
Found broken examples in automatic/a-trieste-6.txt
Found broken examples in automatic/munster.txt
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/ENVIRONMENTSIMILARITY.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/MAZE_MEMETIC_SAMPLING.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_RANDOM_WALK.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in MiscelaneousPP.md