Skip to content

Commit

Permalink
Merge branch 'master' into fix-newmac-arm-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocamilloni committed Dec 1, 2023
2 parents f145349 + 3b92f7e commit 50701c3
Show file tree
Hide file tree
Showing 38 changed files with 69,756 additions and 69,281 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/linuxWF.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- -debug-mpi-
# temporarily commented out
# see https://github.com/plumed/plumed2/issues/976
# - -intel-
- -intel-
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
Expand Down Expand Up @@ -113,17 +113,21 @@ jobs:
# install INTEL at last since it modifies CC and CXX
if: contains( matrix.variant, '-intel-' )
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
#wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
#sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
#rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mkl intel-oneapi-mkl-devel intel-oneapi-compiler-fortran
#sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mkl intel-oneapi-mkl-devel intel-oneapi-compiler-fortran
sudo apt-get install intel-basekit intel-hpckit
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
echo "CXX=icpc" >> $GITHUB_ENV
echo "CC=icc" >> $GITHUB_ENV
echo "FC=ifort" >> $GITHUB_ENV
echo "CXX=icpx" >> $GITHUB_ENV
echo "CC=icx" >> $GITHUB_ENV
echo "FC=ifx" >> $GITHUB_ENV
- name: Install MPI
# install MPI at last since it modifies CC and CXX
if: contains( matrix.variant, '-mpi-' )
Expand Down
1 change: 1 addition & 0 deletions regtest/basic/rt-NeigbourlistInitialization/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../scripts/test.make
1 change: 1 addition & 0 deletions regtest/basic/rt-NeigbourlistInitialization/config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type=make
132 changes: 132 additions & 0 deletions regtest/basic/rt-NeigbourlistInitialization/main.cpp
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 regtest/basic/rt-NeigbourlistInitialization/unitTest.reference
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

1 change: 1 addition & 0 deletions regtest/basic/rt-NeigbourlistInitializationError/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../scripts/test.make
10 changes: 10 additions & 0 deletions regtest/basic/rt-NeigbourlistInitializationError/config
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
}
Loading

1 comment on commit 50701c3

@PlumedBot
Copy link
Contributor

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

Please sign in to comment.