From 9223d08be967d0ae446ea943f1a39edde78a65d8 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Fri, 28 Jul 2023 19:46:51 +0200 Subject: [PATCH 01/33] changes necessary due to moving application code to dedicated folder and redefining the PPL interface --- cmake/modules/autopas.cmake | 3 +- src/molecules/AutoPasSimpleMolecule.h | 4 +- src/particleContainer/AutoPasContainer.cpp | 58 +++++++++---------- src/particleContainer/AutoPasContainer.h | 2 +- .../iteratePairwiseLJFunctorAVXNoShiftMix.cpp | 4 +- ...teratePairwiseLJFunctorAVXNoShiftNoMix.cpp | 4 +- .../iteratePairwiseLJFunctorAVXShiftMix.cpp | 4 +- .../iteratePairwiseLJFunctorAVXShiftNoMix.cpp | 4 +- .../iteratePairwiseLJFunctorNoShiftMix.cpp | 4 +- .../iteratePairwiseLJFunctorNoShiftNoMix.cpp | 4 +- .../iteratePairwiseLJFunctorSVENoShiftMix.cpp | 4 +- ...teratePairwiseLJFunctorSVENoShiftNoMix.cpp | 4 +- .../iteratePairwiseLJFunctorSVEShiftMix.cpp | 4 +- .../iteratePairwiseLJFunctorSVEShiftNoMix.cpp | 4 +- .../iteratePairwiseLJFunctorShiftMix.cpp | 4 +- .../iteratePairwiseLJFunctorShiftNoMix.cpp | 4 +- 16 files changed, 58 insertions(+), 57 deletions(-) diff --git a/cmake/modules/autopas.cmake b/cmake/modules/autopas.cmake index 07c71e194b..67a9eddc73 100644 --- a/cmake/modules/autopas.cmake +++ b/cmake/modules/autopas.cmake @@ -41,7 +41,8 @@ if (ENABLE_AUTOPAS) add_subdirectory(${autopasfetch_SOURCE_DIR} ${autopasfetch_BINARY_DIR} EXCLUDE_FROM_ALL) endif () - set(AUTOPAS_LIB "autopas") + # Linking the md lib also links AutoPas + set(AUTOPAS_LIB "molecularDynamicsLibrary") else () message(STATUS "Not using AutoPas.") set(AUTOPAS_LIB "") diff --git a/src/molecules/AutoPasSimpleMolecule.h b/src/molecules/AutoPasSimpleMolecule.h index ab4cb31415..20a97ff3b3 100644 --- a/src/molecules/AutoPasSimpleMolecule.h +++ b/src/molecules/AutoPasSimpleMolecule.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -336,4 +336,4 @@ class AutoPasSimpleMolecule final : public MoleculeInterface, public autopas::Pa static Quaternion _quaternion; }; -std::ostream& operator<<( std::ostream& os, const AutoPasSimpleMolecule& m ); \ No newline at end of file +std::ostream& operator<<( std::ostream& os, const AutoPasSimpleMolecule& m ); diff --git a/src/particleContainer/AutoPasContainer.cpp b/src/particleContainer/AutoPasContainer.cpp index 97b5cefbb3..140634114a 100644 --- a/src/particleContainer/AutoPasContainer.cpp +++ b/src/particleContainer/AutoPasContainer.cpp @@ -18,7 +18,7 @@ //! @cond Doxygen_Suppress extern template class autopas::AutoPas; extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctor< + mdLib::LJFunctor< Molecule, /*applyShift*/ true, /*mixing*/ true, @@ -26,7 +26,7 @@ extern template bool autopas::AutoPas::iteratePairwise( /*calculateGlobals*/ true > *); extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctor< + mdLib::LJFunctor< Molecule, /*applyShift*/ true, /*mixing*/ false, @@ -34,7 +34,7 @@ extern template bool autopas::AutoPas::iteratePairwise( /*calculateGlobals*/ true > *); extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctor< + mdLib::LJFunctor< Molecule, /*applyShift*/ false, /*mixing*/ true, @@ -42,7 +42,7 @@ extern template bool autopas::AutoPas::iteratePairwise( /*calculateGlobals*/ true > *); extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctor< + mdLib::LJFunctor< Molecule, /*applyShift*/ false, /*mixing*/ false, @@ -51,7 +51,7 @@ extern template bool autopas::AutoPas::iteratePairwise( > *); #ifdef __AVX__ extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorAVX< + mdLib::LJFunctorAVX< Molecule, /*applyShift*/ true, /*mixing*/ true, @@ -59,7 +59,7 @@ extern template bool autopas::AutoPas::iteratePairwise( /*calculateGlobals*/ true > *); extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorAVX< + mdLib::LJFunctorAVX< Molecule, /*applyShift*/ true, /*mixing*/ false, @@ -67,7 +67,7 @@ extern template bool autopas::AutoPas::iteratePairwise( /*calculateGlobals*/ true > *); extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorAVX< + mdLib::LJFunctorAVX< Molecule, /*applyShift*/ false, /*mixing*/ true, @@ -75,7 +75,7 @@ extern template bool autopas::AutoPas::iteratePairwise( /*calculateGlobals*/ true > *); extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorAVX< + mdLib::LJFunctorAVX< Molecule, /*applyShift*/ false, /*mixing*/ false, @@ -85,7 +85,7 @@ extern template bool autopas::AutoPas::iteratePairwise( #endif #ifdef __ARM_FEATURE_SVE extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorSVE< + mdLib::LJFunctorSVE< Molecule, /*applyShift*/ true, /*mixing*/ true, @@ -93,7 +93,7 @@ extern template bool autopas::AutoPas::iteratePairwise( /*calculateGlobals*/ true > *); extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorSVE< + mdLib::LJFunctorSVE< Molecule, /*applyShift*/ true, /*mixing*/ false, @@ -101,7 +101,7 @@ extern template bool autopas::AutoPas::iteratePairwise( /*calculateGlobals*/ true > *); extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorSVE< + mdLib::LJFunctorSVE< Molecule, /*applyShift*/ false, /*mixing*/ true, @@ -109,7 +109,7 @@ extern template bool autopas::AutoPas::iteratePairwise( /*calculateGlobals*/ true > *); extern template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorSVE< + mdLib::LJFunctorSVE< Molecule, /*applyShift*/ false, /*mixing*/ false, @@ -454,7 +454,7 @@ void AutoPasContainer::traverseTemplateHelper() { case FunctorOption::SVE: { #ifdef __ARM_FEATURE_SVE // Generate the functor. Should be regenerated every iteration to wipe internally saved globals. - autopas::LJFunctorSVE functor(_cutoff, _particlePropertiesLibrary); @@ -467,7 +467,7 @@ void AutoPasContainer::traverseTemplateHelper() { case FunctorOption::AVX: { #ifdef __AVX__ // Generate the functor. Should be regenerated every iteration to wipe internally saved globals. - autopas::LJFunctorAVX functor(_cutoff, _particlePropertiesLibrary); @@ -479,7 +479,7 @@ void AutoPasContainer::traverseTemplateHelper() { } case FunctorOption::autoVec: { // Generate the functor. Should be regenerated every iteration to wipe internally saved globals. - autopas::LJFunctor functor(_cutoff, _particlePropertiesLibrary); @@ -496,10 +496,10 @@ void AutoPasContainer::traverseTemplateHelper() { case FunctorOption::SVE: { #ifdef __ARM_FEATURE_SVE // Generate the functor. Should be regenerated every iteration to wipe internally saved globals. - autopas::LJFunctorSVE functor(_cutoff); - functor.setParticleProperties(epsilon24FirstComponent, sigmasqFirstComponent); + functor.setParticleProperties(epsilonFirstComponent * 24, sigmaFirstComponent * sigmaFirstComponent); std::tie(upot, virial) = iterateWithFunctor(functor); #else throw std::runtime_error("SVE Functor not compiled due to lack of compiler support!"); @@ -509,10 +509,10 @@ void AutoPasContainer::traverseTemplateHelper() { case FunctorOption::AVX: { #ifdef __AVX__ // Generate the functor. Should be regenerated every iteration to wipe internally saved globals. - autopas::LJFunctorAVX functor(_cutoff); - functor.setParticleProperties(epsilon24FirstComponent, sigmasqFirstComponent); + functor.setParticleProperties(epsilonFirstComponent * 24, sigmaFirstComponent * sigmaFirstComponent); std::tie(upot, virial) = iterateWithFunctor(functor); #else throw std::runtime_error("AVX Functor not compiled due to lack of compiler support!"); @@ -521,10 +521,10 @@ void AutoPasContainer::traverseTemplateHelper() { } case FunctorOption::autoVec: { // Generate the functor. Should be regenerated every iteration to wipe internally saved globals. - autopas::LJFunctor functor(_cutoff); - functor.setParticleProperties(epsilon24FirstComponent, sigmasqFirstComponent); + functor.setParticleProperties(epsilonFirstComponent * 24, sigmaFirstComponent * sigmaFirstComponent); std::tie(upot, virial) = iterateWithFunctor(functor); break; } @@ -547,20 +547,20 @@ void AutoPasContainer::traverseCells(CellProcessor &cellProcessor) { bool hasShift = false; bool hasNoShift = false; - if (_particlePropertiesLibrary.getTypes().empty()) { - auto components = global_simulation->getEnsemble()->getComponents(); - for (auto &c : *components) { - _particlePropertiesLibrary.addType(c.getLookUpId(), c.ljcenter(0).eps(), c.ljcenter(0).sigma(), + if (_particlePropertiesLibrary.getNumberRegisteredSiteTypes() == 0) { + const auto components = global_simulation->getEnsemble()->getComponents(); + for (const auto &c : *components) { + _particlePropertiesLibrary.addSiteType(c.getLookUpId(), c.ljcenter(0).eps(), c.ljcenter(0).sigma(), c.ljcenter(0).m()); } _particlePropertiesLibrary.calculateMixingCoefficients(); size_t numComponentsAdded = 0; - for (auto &c : *components) { + for (const auto &c : *components) { if (c.ljcenter(0).shift6() != 0.) { hasShift = true; - double autoPasShift6 = - _particlePropertiesLibrary.mixingShift6(numComponentsAdded, numComponentsAdded); - double ls1Shift6 = c.ljcenter(0).shift6(); + const double autoPasShift6 = + _particlePropertiesLibrary.getMixingShift6(numComponentsAdded, numComponentsAdded); + const double ls1Shift6 = c.ljcenter(0).shift6(); if (std::fabs((autoPasShift6 - ls1Shift6) / ls1Shift6) > 1.e-10) { // warn if shift differs relatively by more than 1.e-10 global_log->warning() << "Dangerous shift6 detected: AutoPas will use: " << autoPasShift6 diff --git a/src/particleContainer/AutoPasContainer.h b/src/particleContainer/AutoPasContainer.h index f5b9bbe363..418f943074 100644 --- a/src/particleContainer/AutoPasContainer.h +++ b/src/particleContainer/AutoPasContainer.h @@ -9,7 +9,7 @@ #include "ParticleContainer.h" #include -#include +#include /** * A wrapper for the AutoPas library. diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXNoShiftMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXNoShiftMix.cpp index 709d42f7e1..743ff8e0c4 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXNoShiftMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXNoShiftMix.cpp @@ -7,11 +7,11 @@ #ifdef __AVX__ #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctorAVX.h" +#include "molecularDynamicsLibrary/LJFunctorAVX.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorAVX< + mdLib::LJFunctorAVX< Molecule, /*applyShift*/ false, /*mixing*/ true, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXNoShiftNoMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXNoShiftNoMix.cpp index b8004072bd..53a242ae79 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXNoShiftNoMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXNoShiftNoMix.cpp @@ -7,11 +7,11 @@ #ifdef __AVX__ #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctorAVX.h" +#include "molecularDynamicsLibrary/LJFunctorAVX.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorAVX< + mdLib::LJFunctorAVX< Molecule, /*applyShift*/ false, /*mixing*/ false, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXShiftMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXShiftMix.cpp index b9cce6736d..8b99279c69 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXShiftMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXShiftMix.cpp @@ -7,11 +7,11 @@ #ifdef __AVX__ #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctorAVX.h" +#include "molecularDynamicsLibrary/LJFunctorAVX.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorAVX< + mdLib::LJFunctorAVX< Molecule, /*applyShift*/ true, /*mixing*/ true, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXShiftNoMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXShiftNoMix.cpp index 8a62487a10..b3990b2e85 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXShiftNoMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorAVXShiftNoMix.cpp @@ -7,11 +7,11 @@ #ifdef __AVX__ #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctorAVX.h" +#include "molecularDynamicsLibrary/LJFunctorAVX.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorAVX< + mdLib::LJFunctorAVX< Molecule, /*applyShift*/ true, /*mixing*/ false, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorNoShiftMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorNoShiftMix.cpp index f318c218d4..589d9fbff4 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorNoShiftMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorNoShiftMix.cpp @@ -6,11 +6,11 @@ #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctor.h" +#include "molecularDynamicsLibrary/LJFunctor.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctor< + mdLib::LJFunctor< Molecule, /*applyShift*/ false, /*mixing*/ true, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorNoShiftNoMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorNoShiftNoMix.cpp index c5351de5b5..5a83c13811 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorNoShiftNoMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorNoShiftNoMix.cpp @@ -6,11 +6,11 @@ #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctor.h" +#include "molecularDynamicsLibrary/LJFunctor.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctor< + mdLib::LJFunctor< Molecule, /*applyShift*/ false, /*mixing*/ false, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVENoShiftMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVENoShiftMix.cpp index 653dd31436..977689dbcc 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVENoShiftMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVENoShiftMix.cpp @@ -7,11 +7,11 @@ #ifdef __ARM_FEATURE_SVE #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctorSVE.h" +#include "molecularDynamicsLibrary/LJFunctorSVE.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorSVE< + mdLib::LJFunctorSVE< Molecule, /*applyShift*/ false, /*mixing*/ true, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVENoShiftNoMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVENoShiftNoMix.cpp index 9a9b747f75..2ed8d42051 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVENoShiftNoMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVENoShiftNoMix.cpp @@ -7,11 +7,11 @@ #ifdef __ARM_FEATURE_SVE #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctorSVE.h" +#include "molecularDynamicsLibrary/LJFunctorSVE.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorSVE< + mdLib::LJFunctorSVE< Molecule, /*applyShift*/ false, /*mixing*/ false, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVEShiftMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVEShiftMix.cpp index d73e97647d..2bc71697c6 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVEShiftMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVEShiftMix.cpp @@ -7,11 +7,11 @@ #ifdef __ARM_FEATURE_SVE #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctorSVE.h" +#include "molecularDynamicsLibrary/LJFunctorSVE.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorSVE< + mdLib::LJFunctorSVE< Molecule, /*applyShift*/ true, /*mixing*/ true, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVEShiftNoMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVEShiftNoMix.cpp index 5291da9652..1a226a77a7 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVEShiftNoMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorSVEShiftNoMix.cpp @@ -7,11 +7,11 @@ #ifdef __ARM_FEATURE_SVE #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctorSVE.h" +#include "molecularDynamicsLibrary/LJFunctorSVE.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctorSVE< + mdLib::LJFunctorSVE< Molecule, /*applyShift*/ true, /*mixing*/ false, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorShiftMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorShiftMix.cpp index 0d77c0e027..3ee2788ada 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorShiftMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorShiftMix.cpp @@ -6,11 +6,11 @@ #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctor.h" +#include "molecularDynamicsLibrary/LJFunctor.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctor< + mdLib::LJFunctor< Molecule, /*applyShift*/ true, /*mixing*/ true, diff --git a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorShiftNoMix.cpp b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorShiftNoMix.cpp index 7d12eb6b81..f43afce07a 100644 --- a/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorShiftNoMix.cpp +++ b/src/particleContainer/AutoPasTemplateInstantiations/iteratePairwiseLJFunctorShiftNoMix.cpp @@ -6,11 +6,11 @@ #include "autopas/AutoPasImpl.h" #include "molecules/Molecule.h" -#include "autopas/molecularDynamics/LJFunctor.h" +#include "molecularDynamicsLibrary/LJFunctor.h" //! @cond Doxygen_Suppress template bool autopas::AutoPas::iteratePairwise( - autopas::LJFunctor< + mdLib::LJFunctor< Molecule, /*applyShift*/ true, /*mixing*/ false, From 0311c45c889fbc886deb2ceca6e8a919b17fc1c0 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Fri, 28 Jul 2023 19:47:52 +0200 Subject: [PATCH 02/33] parse multiple tuning strategies --- .../200K_18mol_l/config_autopas_lc_ALL.xml | 1 + src/particleContainer/AutoPasContainer.cpp | 41 +++++++++---------- src/particleContainer/AutoPasContainer.h | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/examples/Argon/200K_18mol_l/config_autopas_lc_ALL.xml b/examples/Argon/200K_18mol_l/config_autopas_lc_ALL.xml index 0314d8902d..0444273ca7 100644 --- a/examples/Argon/200K_18mol_l/config_autopas_lc_ALL.xml +++ b/examples/Argon/200K_18mol_l/config_autopas_lc_ALL.xml @@ -39,6 +39,7 @@ linkedCells + predictive,ruleBased 10000 10 10 diff --git a/src/particleContainer/AutoPasContainer.cpp b/src/particleContainer/AutoPasContainer.cpp index 140634114a..2b7339e022 100644 --- a/src/particleContainer/AutoPasContainer.cpp +++ b/src/particleContainer/AutoPasContainer.cpp @@ -129,7 +129,7 @@ AutoPasContainer::AutoPasContainer(double cutoff) : _cutoff(cutoff), _particlePr _traversalChoices = _autopasContainer.getAllowedTraversals(); _containerChoices = _autopasContainer.getAllowedContainers(); _selectorStrategy = _autopasContainer.getSelectorStrategy(); - _tuningStrategyOption = _autopasContainer.getTuningStrategyOption(); + _tuningStrategyOptions = _autopasContainer.getTuningStrategyOptions(); _tuningAcquisitionFunction = _autopasContainer.getAcquisitionFunction(); _dataLayoutChoices = _autopasContainer.getAllowedDataLayouts(); _newton3Choices = _autopasContainer.getAllowedNewton3Options(); @@ -171,15 +171,15 @@ AutoPasContainer::AutoPasContainer(double cutoff) : _cutoff(cutoff), _particlePr * @param defaultValue Set of options that is returned if nothing was found in the xml * @return */ -template +template > auto parseAutoPasOption(XMLfileUnits &xmlconfig, const std::string &xmlString, - const std::set &defaultValue) { + const OutputContainer &defaultValue) { auto stringInXml = string_utils::toLowercase(xmlconfig.getNodeValue_string(xmlString)); if (stringInXml.empty()) { return defaultValue; } try { - return OptionType::parseOptions(stringInXml); + return OptionType::template parseOptions(stringInXml); } catch (const std::exception &e) { global_log->error() << "AutoPasContainer: error when parsing " << xmlString << ":" << std::endl; global_log->error() << e.what() << std::endl; @@ -187,7 +187,7 @@ auto parseAutoPasOption(XMLfileUnits &xmlconfig, const std::string &xmlString, << autopas::utils::ArrayUtils::to_string(OptionType::getAllOptions()) << std::endl; Simulation::exit(4432); // dummy return - return decltype(OptionType::parseOptions(""))(); + return decltype(OptionType::template parseOptions(""))(); } } @@ -201,9 +201,8 @@ void AutoPasContainer::readXML(XMLfileUnits &xmlconfig) { _selectorStrategy = *parseAutoPasOption(xmlconfig, "selectorStrategy", {_selectorStrategy}) .begin(); - _tuningStrategyOption = - *parseAutoPasOption(xmlconfig, "tuningStrategy", {_tuningStrategyOption}) - .begin(); + _tuningStrategyOptions = + parseAutoPasOption>(xmlconfig, "tuningStrategies", {_tuningStrategyOptions}); _extrapolationMethod = *parseAutoPasOption(xmlconfig, "extrapolationMethod", {_extrapolationMethod}) .begin(); @@ -318,7 +317,7 @@ bool AutoPasContainer::rebuild(double *bBoxMin, double *bBoxMax) { _autopasContainer.setAllowedTraversals(_traversalChoices); _autopasContainer.setAllowedDataLayouts(_dataLayoutChoices); _autopasContainer.setAllowedNewton3Options(_newton3Choices); - _autopasContainer.setTuningStrategyOption(_tuningStrategyOption); + _autopasContainer.setTuningStrategyOption(_tuningStrategyOptions); _autopasContainer.setAcquisitionFunction(_tuningAcquisitionFunction); _autopasContainer.setMaxEvidence(_maxEvidence); _autopasContainer.setRelativeOptimumRange(_relativeOptimumRange); @@ -347,8 +346,9 @@ bool AutoPasContainer::rebuild(double *bBoxMin, double *bBoxMax) { << setw(valueOffset) << left << "Newton3" << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getAllowedNewton3Options()) << endl - << setw(valueOffset) << left << "Tuning strategy " - << ": " << _autopasContainer.getTuningStrategyOption() << endl + << setw(valueOffset) << left << "Tuning strategies " + << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getTuningStrategyOptions()) + << endl << setw(valueOffset) << left << "Selector strategy " << ": " << _autopasContainer.getSelectorStrategy() << endl << setw(valueOffset) << left << "Tuning frequency" @@ -420,8 +420,8 @@ template std::pair AutoPasContainer::iterateWithFunctor(F &&functor) { // here we call the actual autopas' iteratePairwise method to compute the forces. _autopasContainer.iteratePairwise(&functor); - double upot = functor.getUpot(); - double virial = functor.getVirial(); + const double upot = functor.getPotentialEnergy(); + const double virial = functor.getVirial(); return std::make_pair(upot, virial); } @@ -438,17 +438,16 @@ void AutoPasContainer::traverseTemplateHelper() { // Check if all components have the same eps24 and sigma. If that is the case, we can skip the mixing rules, which // is faster! - auto numComponents = _particlePropertiesLibrary.getTypes().size(); - double epsilon24FirstComponent = _particlePropertiesLibrary.get24Epsilon(0); - double sigmasqFirstComponent = _particlePropertiesLibrary.getSigmaSquare(0); + const auto numComponents = _particlePropertiesLibrary.getNumberRegisteredSiteTypes(); + const double epsilonFirstComponent = _particlePropertiesLibrary.getEpsilon(0); + const double sigmaFirstComponent = _particlePropertiesLibrary.getSigma(0); bool allSame = true; for (auto i = 1ul; i < numComponents; ++i) { - allSame &= _particlePropertiesLibrary.get24Epsilon(i) == epsilon24FirstComponent; - allSame &= _particlePropertiesLibrary.getSigmaSquare(i) == sigmasqFirstComponent; + allSame &= _particlePropertiesLibrary.getEpsilon(i) == epsilonFirstComponent; + allSame &= _particlePropertiesLibrary.getSigma(i) == sigmaFirstComponent; } - bool useMixing = not allSame; - if (useMixing) { + if (not allSame) { global_log->debug() << "AutoPasContainer: Using mixing." << std::endl; switch (functorOption) { case FunctorOption::SVE: { @@ -686,7 +685,7 @@ unsigned long AutoPasContainer::initCubicGrid(std::array numMo vcp_real_calc T = global_simulation->getEnsemble()->T(); const std::array spacing = autopas::utils::ArrayMath::div(simBoxLength, - autopas::utils::ArrayUtils::static_cast_array( + autopas::utils::ArrayUtils::static_cast_copy_array( numMoleculesPerDimension)); size_t numMolecules = 0; for (int grid = 0; grid < 2; ++grid) { diff --git a/src/particleContainer/AutoPasContainer.h b/src/particleContainer/AutoPasContainer.h index 418f943074..9c658eb5a1 100644 --- a/src/particleContainer/AutoPasContainer.h +++ b/src/particleContainer/AutoPasContainer.h @@ -161,7 +161,7 @@ class AutoPasContainer : public ParticleContainer { std::set _traversalChoices; std::set _containerChoices; autopas::SelectorStrategyOption _selectorStrategy; - autopas::TuningStrategyOption _tuningStrategyOption; + std::vector _tuningStrategyOptions; autopas::ExtrapolationMethodOption _extrapolationMethod; autopas::AcquisitionFunctionOption _tuningAcquisitionFunction; std::set _dataLayoutChoices; From 6965dc3199cf5f29167a39680e1524d35e1b33c7 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Fri, 28 Jul 2023 19:49:29 +0200 Subject: [PATCH 03/33] temporarily change the default AutoPas version to the head of the relevant dev branch --- cmake/modules/autopas.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/autopas.cmake b/cmake/modules/autopas.cmake index 67a9eddc73..81e7b38ab4 100644 --- a/cmake/modules/autopas.cmake +++ b/cmake/modules/autopas.cmake @@ -23,8 +23,8 @@ if (ENABLE_AUTOPAS) set(AUTOPAS_USE_VECTORIZATION ${USE_VECTORIZATION} CACHE BOOL "Set via USE_VECTORIZATION" FORCE) set(AUTOPAS_VECTOR_INSTRUCTIONS ${VECTOR_INSTRUCTIONS} CACHE STRING "Set via VECTOR_INSTRUCTIONS_OPTIONS" FORCE) - # Merge of fixSpacialLocksResize 2023-05-08; This includes the rewrites of remainder traversal and iterators. - set(AUTOPAS_TAG e47c9257bb8d0c6ab680d02823b1e8749b25369a CACHE STRING "AutoPas Git tag or commit id to use") + # TODO: change this to the merge of this branch with master + set(AUTOPAS_TAG combineStrategies CACHE STRING "AutoPas Git tag or commit id to use") FetchContent_Declare( autopasfetch From 6fe83c133bacd2c13c131f0efa2ea9195b21d9ad Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Sun, 30 Jul 2023 16:10:41 +0200 Subject: [PATCH 04/33] get rule file name from xml --- src/particleContainer/AutoPasContainer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/particleContainer/AutoPasContainer.cpp b/src/particleContainer/AutoPasContainer.cpp index 2b7339e022..35b76e7df5 100644 --- a/src/particleContainer/AutoPasContainer.cpp +++ b/src/particleContainer/AutoPasContainer.cpp @@ -242,6 +242,8 @@ void AutoPasContainer::readXML(XMLfileUnits &xmlconfig) { _relativeOptimumRange = xmlconfig.getNodeValue_double("optimumRange", _relativeOptimumRange); _relativeBlacklistRange = xmlconfig.getNodeValue_double("blacklistRange", _relativeBlacklistRange); + // string + xmlconfig.getNodeValue("ruleFile", _ruleFileName); std::string functorChoiceStr{}; xmlconfig.getNodeValue("functor", functorChoiceStr); if (functorChoiceStr.empty()) { @@ -318,6 +320,7 @@ bool AutoPasContainer::rebuild(double *bBoxMin, double *bBoxMax) { _autopasContainer.setAllowedDataLayouts(_dataLayoutChoices); _autopasContainer.setAllowedNewton3Options(_newton3Choices); _autopasContainer.setTuningStrategyOption(_tuningStrategyOptions); + _autopasContainer.setRuleFileName(_ruleFileName); _autopasContainer.setAcquisitionFunction(_tuningAcquisitionFunction); _autopasContainer.setMaxEvidence(_maxEvidence); _autopasContainer.setRelativeOptimumRange(_relativeOptimumRange); From 43a56eaf0a0f3788a2bd023e7f8d3c34e3c267cd Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Sun, 30 Jul 2023 16:11:16 +0200 Subject: [PATCH 05/33] formatting and doc --- src/particleContainer/AutoPasContainer.cpp | 10 +++++----- src/particleContainer/AutoPasContainer.h | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/particleContainer/AutoPasContainer.cpp b/src/particleContainer/AutoPasContainer.cpp index 35b76e7df5..9f3abea3a7 100644 --- a/src/particleContainer/AutoPasContainer.cpp +++ b/src/particleContainer/AutoPasContainer.cpp @@ -246,13 +246,13 @@ void AutoPasContainer::readXML(XMLfileUnits &xmlconfig) { xmlconfig.getNodeValue("ruleFile", _ruleFileName); std::string functorChoiceStr{}; xmlconfig.getNodeValue("functor", functorChoiceStr); - if (functorChoiceStr.empty()) { + if (functorChoiceStr.empty()) { #ifdef __ARM_FEATURE_SVE - functorChoiceStr = "sve"; + functorChoiceStr = "sve"; #elif defined(__AVX__) - functorChoiceStr = "avx"; + functorChoiceStr = "avx"; #endif - } + } if (functorChoiceStr.find("avx") != std::string::npos) { functorOption = FunctorOption::AVX; global_log->info() << "Selected AVX Functor." << std::endl; @@ -351,7 +351,7 @@ bool AutoPasContainer::rebuild(double *bBoxMin, double *bBoxMax) { << endl << setw(valueOffset) << left << "Tuning strategies " << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getTuningStrategyOptions()) - << endl + << endl << setw(valueOffset) << left << "Selector strategy " << ": " << _autopasContainer.getSelectorStrategy() << endl << setw(valueOffset) << left << "Tuning frequency" diff --git a/src/particleContainer/AutoPasContainer.h b/src/particleContainer/AutoPasContainer.h index 9c658eb5a1..8d9896737e 100644 --- a/src/particleContainer/AutoPasContainer.h +++ b/src/particleContainer/AutoPasContainer.h @@ -32,7 +32,8 @@ class AutoPasContainer : public ParticleContainer { STRINGLIST STRINGLIST STRING - STRING + STRING + STRING STRING STRINGLIST STRINGLIST @@ -47,8 +48,8 @@ class AutoPasContainer : public ParticleContainer { DOUBLE DOUBLE STRING - INTEGER - + INTEGER + \endcode * If you are using MPI-parallel simulations, tuningSamples should be a multiple of rebuildFrequency! * A list of the different Options can be found here: @@ -157,11 +158,12 @@ class AutoPasContainer : public ParticleContainer { unsigned int _evidenceForPrediction; autopas::AutoPas _autopasContainer; bool _autopasContainerIsInitialized{false}; + std::string _ruleFileName{}; std::set _traversalChoices; std::set _containerChoices; autopas::SelectorStrategyOption _selectorStrategy; - std::vector _tuningStrategyOptions; + std::vector _tuningStrategyOptions; autopas::ExtrapolationMethodOption _extrapolationMethod; autopas::AcquisitionFunctionOption _tuningAcquisitionFunction; std::set _dataLayoutChoices; From c0937072f3e572087fd8a350d11e3948d768c17c Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Wed, 2 Aug 2023 20:17:14 +0200 Subject: [PATCH 06/33] Print rule file name and use '\n' instead of endl --- src/particleContainer/AutoPasContainer.cpp | 44 +++++++++++----------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/particleContainer/AutoPasContainer.cpp b/src/particleContainer/AutoPasContainer.cpp index 9f3abea3a7..549a32c8bf 100644 --- a/src/particleContainer/AutoPasContainer.cpp +++ b/src/particleContainer/AutoPasContainer.cpp @@ -333,51 +333,53 @@ bool AutoPasContainer::rebuild(double *bBoxMin, double *bBoxMax) { _autopasContainerIsInitialized = true; // print full configuration to the command line - int valueOffset = 28; - global_log->info() << "AutoPas configuration:" << endl + constexpr int valueOffset = 28; + global_log->info() << "AutoPas configuration:\n" << setw(valueOffset) << left << "Data Layout " << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getAllowedDataLayouts()) - << endl + << "\n" << setw(valueOffset) << left << "Container " << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getAllowedContainers()) - << endl + << "\n" << setw(valueOffset) << left << "Cell size Factor " - << ": " << _autopasContainer.getAllowedCellSizeFactors() << endl + << ": " << _autopasContainer.getAllowedCellSizeFactors() << "\n" << setw(valueOffset) << left << "Traversals " << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getAllowedTraversals()) - << endl + << "\n" << setw(valueOffset) << left << "Newton3" << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getAllowedNewton3Options()) - << endl + << "\n" << setw(valueOffset) << left << "Tuning strategies " << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getTuningStrategyOptions()) - << endl + << "\n" << setw(valueOffset) << left << "Selector strategy " - << ": " << _autopasContainer.getSelectorStrategy() << endl + << ": " << _autopasContainer.getSelectorStrategy() << "\n" << setw(valueOffset) << left << "Tuning frequency" - << ": " << _autopasContainer.getTuningInterval() << endl + << ": " << _autopasContainer.getTuningInterval() << "\n" << setw(valueOffset) << left << "Number of samples " - << ": " << _autopasContainer.getNumSamples() << endl + << ": " << _autopasContainer.getNumSamples() << "\n" << setw(valueOffset) << left << "Tuning Acquisition Function" - << ": " << _autopasContainer.getAcquisitionFunction() << endl + << ": " << _autopasContainer.getAcquisitionFunction() << "\n" << setw(valueOffset) << left << "Number of evidence " - << ": " << _autopasContainer.getMaxEvidence() << endl + << ": " << _autopasContainer.getMaxEvidence() << "\n" << setw(valueOffset) << left << "Verlet Cluster size " - << ": " << _autopasContainer.getVerletClusterSize() << endl + << ": " << _autopasContainer.getVerletClusterSize() << "\n" << setw(valueOffset) << left << "Rebuild frequency " - << ": " << _autopasContainer.getVerletRebuildFrequency() << endl + << ": " << _autopasContainer.getVerletRebuildFrequency() << "\n" << setw(valueOffset) << left << "Verlet Skin " - << ": " << _autopasContainer.getVerletSkin() << endl + << ": " << _autopasContainer.getVerletSkin() << "\n" << setw(valueOffset) << left << "Optimum Range " - << ": " << _autopasContainer.getRelativeOptimumRange() << endl + << ": " << _autopasContainer.getRelativeOptimumRange() << "\n" << setw(valueOffset) << left << "Tuning Phases without test " - << ": " << _autopasContainer.getMaxTuningPhasesWithoutTest() << endl + << ": " << _autopasContainer.getMaxTuningPhasesWithoutTest() << "\n" << setw(valueOffset) << left << "Blacklist Range " - << ": " << _autopasContainer.getRelativeBlacklistRange() << endl + << ": " << _autopasContainer.getRelativeBlacklistRange() << "\n" << setw(valueOffset) << left << "Evidence for prediction " - << ": " << _autopasContainer.getEvidenceFirstPrediction() << endl + << ": " << _autopasContainer.getEvidenceFirstPrediction() << "\n" << setw(valueOffset) << left << "Extrapolation method " - << ": " << _autopasContainer.getExtrapolationMethodOption() << endl; + << ": " << _autopasContainer.getExtrapolationMethodOption() << "\n" + << setw(valueOffset) << left << "Rule File " + << ": " << _autopasContainer.getRuleFileName() << endl; /// @todo return sendHaloAndLeavingTogether, (always false) for simplicity. return false; From 3e78c5e1b8a5255f1610b55d3df6c15205f70048 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Tue, 8 Aug 2023 15:15:36 +0200 Subject: [PATCH 07/33] update xml example for AutoPas --- examples/Argon/200K_18mol_l/config_autopas_allOptions.xml | 4 +++- examples/Argon/200K_18mol_l/config_autopas_lc_ALL.xml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/Argon/200K_18mol_l/config_autopas_allOptions.xml b/examples/Argon/200K_18mol_l/config_autopas_allOptions.xml index 5e29ce127b..3ce57eac7e 100644 --- a/examples/Argon/200K_18mol_l/config_autopas_allOptions.xml +++ b/examples/Argon/200K_18mol_l/config_autopas_allOptions.xml @@ -44,16 +44,18 @@ --> + off ds_sequential, lc_sliced, lc_sliced_balanced, lc_sliced_c02, lc_c01, lc_c01_combined_SoA, lc_c01_cuda, lc_c04, lc_c04_HCP, lc_c04_combined_SoA, lc_c08, lc_c18, vcc_cluster_iteration_cuda, vcl_cluster_iteration, vcl_c06, vcl_c01_balanced, vl_list_iteration, vlc_c01, vlc_c18, vlc_sliced, vlc_sliced_balanced, vlc_sliced_c02, vvl_as_built DirectSum,LinkedCells, VerletLists, VerletListsCells, VerletClusterLists,VarVerletListsAsBuild,VerletClusterCells fastestMean - FullSearch + predictive,rulebased AoS, SoA enabled, disabled lower-confidence-bound 20 1000 10 + AutoPas/examples/md-flexible/input/tuningRules.rule 10 0.5 diff --git a/examples/Argon/200K_18mol_l/config_autopas_lc_ALL.xml b/examples/Argon/200K_18mol_l/config_autopas_lc_ALL.xml index 0444273ca7..41a774c00f 100644 --- a/examples/Argon/200K_18mol_l/config_autopas_lc_ALL.xml +++ b/examples/Argon/200K_18mol_l/config_autopas_lc_ALL.xml @@ -38,6 +38,7 @@ + linkedCells predictive,ruleBased 10000 From ee152875c6824252477ffe9f65362a2767ab9fd1 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Tue, 16 Jan 2024 11:35:57 +0100 Subject: [PATCH 08/33] freeze autopas to a revision in master that contains all desired features --- cmake/modules/autopas.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/autopas.cmake b/cmake/modules/autopas.cmake index 81e7b38ab4..0e25e3d0c0 100644 --- a/cmake/modules/autopas.cmake +++ b/cmake/modules/autopas.cmake @@ -23,8 +23,8 @@ if (ENABLE_AUTOPAS) set(AUTOPAS_USE_VECTORIZATION ${USE_VECTORIZATION} CACHE BOOL "Set via USE_VECTORIZATION" FORCE) set(AUTOPAS_VECTOR_INSTRUCTIONS ${VECTOR_INSTRUCTIONS} CACHE STRING "Set via VECTOR_INSTRUCTIONS_OPTIONS" FORCE) - # TODO: change this to the merge of this branch with master - set(AUTOPAS_TAG combineStrategies CACHE STRING "AutoPas Git tag or commit id to use") + # Merge of 798 (improve SoA loading); includes 787 combined tuning + set(AUTOPAS_TAG d338e23 CACHE STRING "AutoPas Git tag or commit id to use") FetchContent_Declare( autopasfetch From 33da19aa1f47254db845f5a63adf318ba1a6ac9e Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Tue, 16 Jan 2024 11:36:12 +0100 Subject: [PATCH 09/33] update relevant example xmls --- examples/Adsorption/Generator/adsorption_autopas_tuning.xml | 2 +- examples/all-options.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Adsorption/Generator/adsorption_autopas_tuning.xml b/examples/Adsorption/Generator/adsorption_autopas_tuning.xml index 27a09db982..7568ec8512 100644 --- a/examples/Adsorption/Generator/adsorption_autopas_tuning.xml +++ b/examples/Adsorption/Generator/adsorption_autopas_tuning.xml @@ -87,7 +87,7 @@ c01, c04, c08, c18, sli linkedCells fastestMedian - FullSearch + FullSearch SoA enabled 1000 diff --git a/examples/all-options.xml b/examples/all-options.xml index cf47f309fb..c52e1ca8d4 100644 --- a/examples/all-options.xml +++ b/examples/all-options.xml @@ -236,8 +236,8 @@ fastestAbsolute - - fullSearch + + fullSearch SoA From 5cf6bba4df3e2e3a3a7fad107cee17f00dca109f Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Tue, 16 Jan 2024 21:44:24 +0100 Subject: [PATCH 10/33] experimental autopas version --- cmake/modules/autopas.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/modules/autopas.cmake b/cmake/modules/autopas.cmake index 0e25e3d0c0..bb5a5d9958 100644 --- a/cmake/modules/autopas.cmake +++ b/cmake/modules/autopas.cmake @@ -24,7 +24,8 @@ if (ENABLE_AUTOPAS) set(AUTOPAS_VECTOR_INSTRUCTIONS ${VECTOR_INSTRUCTIONS} CACHE STRING "Set via VECTOR_INSTRUCTIONS_OPTIONS" FORCE) # Merge of 798 (improve SoA loading); includes 787 combined tuning - set(AUTOPAS_TAG d338e23 CACHE STRING "AutoPas Git tag or commit id to use") + # set(AUTOPAS_TAG d338e23 CACHE STRING "AutoPas Git tag or commit id to use") + set(AUTOPAS_TAG fixMakeProjectCompilers CACHE STRING "AutoPas Git tag or commit id to use") FetchContent_Declare( autopasfetch From 4a1f9c7a8d28928f8c5aed727aaa1313bf62cd78 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Tue, 16 Jan 2024 21:54:08 +0100 Subject: [PATCH 11/33] remove fullSearch from examples --- examples/Adsorption/Generator/adsorption_autopas_tuning.xml | 1 - examples/all-options.xml | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Adsorption/Generator/adsorption_autopas_tuning.xml b/examples/Adsorption/Generator/adsorption_autopas_tuning.xml index 7568ec8512..db11eef8b4 100644 --- a/examples/Adsorption/Generator/adsorption_autopas_tuning.xml +++ b/examples/Adsorption/Generator/adsorption_autopas_tuning.xml @@ -87,7 +87,6 @@ c01, c04, c08, c18, sli linkedCells fastestMedian - FullSearch SoA enabled 1000 diff --git a/examples/all-options.xml b/examples/all-options.xml index 22dc6d1df8..31e75a7fd2 100644 --- a/examples/all-options.xml +++ b/examples/all-options.xml @@ -243,7 +243,8 @@ fastestAbsolute - fullSearch + + ruleBasedTuning, predictiveTuning SoA From 0efdd4b821116ff20571eeb6547c24310579878c Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Tue, 16 Jan 2024 22:16:36 +0100 Subject: [PATCH 12/33] dirty trick to see logs --- .github/workflows/ls1_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ls1_test.yml b/.github/workflows/ls1_test.yml index 9086f5a367..f8266128da 100644 --- a/.github/workflows/ls1_test.yml +++ b/.github/workflows/ls1_test.yml @@ -91,7 +91,7 @@ jobs: -DENABLE_UNIT_TESTS=ON \ .. - cmake --build . --parallel 2 + cmake --build . --parallel 2 || cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && exit 42 cd .. @@ -151,7 +151,7 @@ jobs: -DENABLE_MPI=$mpi_enabled \ .. - cmake --build . --parallel 2 + cmake --build . --parallel 2 || cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && exit 1337 #as example list of new version is used, also the example files of new version should be used #therefore, go back to new version From aa365268f774f33f5c55af6b57be9ed275d087b1 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Tue, 16 Jan 2024 22:26:08 +0100 Subject: [PATCH 13/33] increase visibility --- .github/workflows/ls1_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ls1_test.yml b/.github/workflows/ls1_test.yml index f8266128da..55b47ae8a6 100644 --- a/.github/workflows/ls1_test.yml +++ b/.github/workflows/ls1_test.yml @@ -91,7 +91,7 @@ jobs: -DENABLE_UNIT_TESTS=ON \ .. - cmake --build . --parallel 2 || cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && exit 42 + cmake --build . --parallel 2 || echo "--------------------------" && pwd && echo "--------------------------" && cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && echo "--------------------------" && exit 42 cd .. @@ -151,7 +151,7 @@ jobs: -DENABLE_MPI=$mpi_enabled \ .. - cmake --build . --parallel 2 || cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && exit 1337 + cmake --build . --parallel 2 || echo "--------------------------" && pwd && echo "--------------------------" && cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && echo "--------------------------" && exit 1337 #as example list of new version is used, also the example files of new version should be used #therefore, go back to new version From 0c4e807a3e8c241718cac68369fa6be347d1a738 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Tue, 16 Jan 2024 22:34:29 +0100 Subject: [PATCH 14/33] less parallel? --- .github/workflows/ls1_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ls1_test.yml b/.github/workflows/ls1_test.yml index 55b47ae8a6..abc84ba8bd 100644 --- a/.github/workflows/ls1_test.yml +++ b/.github/workflows/ls1_test.yml @@ -91,7 +91,7 @@ jobs: -DENABLE_UNIT_TESTS=ON \ .. - cmake --build . --parallel 2 || echo "--------------------------" && pwd && echo "--------------------------" && cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && echo "--------------------------" && exit 42 + cmake --build . --parallel 1 || echo "--------------------------" && pwd && echo "--------------------------" && cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && echo "--------------------------" && exit 42 cd .. @@ -151,7 +151,7 @@ jobs: -DENABLE_MPI=$mpi_enabled \ .. - cmake --build . --parallel 2 || echo "--------------------------" && pwd && echo "--------------------------" && cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && echo "--------------------------" && exit 1337 + cmake --build . --parallel 1 || echo "--------------------------" && pwd && echo "--------------------------" && cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && echo "--------------------------" && exit 1337 #as example list of new version is used, also the example files of new version should be used #therefore, go back to new version From 0028e127abd24c2e4fe1883284df0616d9cde9f7 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Wed, 17 Jan 2024 00:55:53 +0100 Subject: [PATCH 15/33] remove debug output --- .github/workflows/ls1_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ls1_test.yml b/.github/workflows/ls1_test.yml index abc84ba8bd..4d4475c18e 100644 --- a/.github/workflows/ls1_test.yml +++ b/.github/workflows/ls1_test.yml @@ -91,7 +91,7 @@ jobs: -DENABLE_UNIT_TESTS=ON \ .. - cmake --build . --parallel 1 || echo "--------------------------" && pwd && echo "--------------------------" && cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && echo "--------------------------" && exit 42 + cmake --build . --parallel 1 cd .. @@ -151,7 +151,7 @@ jobs: -DENABLE_MPI=$mpi_enabled \ .. - cmake --build . --parallel 1 || echo "--------------------------" && pwd && echo "--------------------------" && cat _deps/autopasfetch-build/libs/harmony/src/harmony_bundled-stamp/harmony_bundled-build-*.log && echo "--------------------------" && exit 1337 + cmake --build . --parallel 1 #as example list of new version is used, also the example files of new version should be used #therefore, go back to new version From 7ae320dd50f3840ae0fbadb16ebbf9586776027d Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Fri, 26 Jan 2024 16:57:35 +0100 Subject: [PATCH 16/33] clarify comment --- src/parallel/DomainDecompBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parallel/DomainDecompBase.cpp b/src/parallel/DomainDecompBase.cpp index da4e876af4..3478ae79d6 100644 --- a/src/parallel/DomainDecompBase.cpp +++ b/src/parallel/DomainDecompBase.cpp @@ -260,7 +260,7 @@ void DomainDecompBase::handleDomainLeavingParticlesDirect(const HaloRegion& halo }; if (moleculeContainer->isInvalidParticleReturner()) { - // move all particles that will be inserted now to the end of the container + // Shift and add all invalid particles that do belong in this halo region auto removeBegin = std::partition(invalidParticles.begin(), invalidParticles.end(), [=](const Molecule& m) { // if this is true, it will be put in the first part of the partition, if it is false, in the second. return not m.inBox(haloRegion.rmin, haloRegion.rmax); From 31aba3c4a8bc85bfa1cc704f75de49b7c47f4149 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Fri, 26 Jan 2024 16:58:07 +0100 Subject: [PATCH 17/33] fix AutoPasContainer::getHaloSize() to give the correct size for all dimensions --- src/particleContainer/AutoPasContainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/particleContainer/AutoPasContainer.cpp b/src/particleContainer/AutoPasContainer.cpp index a5c81666a7..e8c2b8b9e8 100644 --- a/src/particleContainer/AutoPasContainer.cpp +++ b/src/particleContainer/AutoPasContainer.cpp @@ -719,7 +719,7 @@ double *AutoPasContainer::getCellLength() { } double *AutoPasContainer::getHaloSize() { - static std::array haloLength{_verletSkin + _cutoff}; + static std::array haloLength{_verletSkin + _cutoff, _verletSkin + _cutoff, _verletSkin + _cutoff}; return haloLength.data(); } From 5c1bb20fdba2ab81dfad2bb0182f4aa44d2a316d Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Mon, 29 Jan 2024 13:54:58 +0100 Subject: [PATCH 18/33] Clarify doc, update style, fix typo --- src/particleContainer/ParticleContainer.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/particleContainer/ParticleContainer.h b/src/particleContainer/ParticleContainer.h index 447bb9b709..66e44fbbe3 100644 --- a/src/particleContainer/ParticleContainer.h +++ b/src/particleContainer/ParticleContainer.h @@ -271,20 +271,25 @@ class ParticleContainer: public MemoryProfilable { * Only used for logging / output. * @note: Formatting rules: * - The whole configuration should be enclosed in curly brackets. - * - Different elements should be separated by a comma sourrounded by spaces: " , ". + * - Different elements should be separated by a comma surrounded by spaces: " , ". * - Every element should be in the form "key: value" * @return */ virtual std::string getConfigurationAsString() = 0; protected: - - //! coordinates of the left, lower, front corner of the bounding box + /** + * Coordinates of the left, lower, front corner of the local bounding box. + */ double _boundingBoxMin[3]; - //! coordinates of the right, upper, back corner of the bounding box + /** + * Coordinates of the right, upper, back corner of the local bounding box. + */ double _boundingBoxMax[3]; - //! Vector of particles that are about to be removed from the container. - //! Currently only used by AutoPasContainer but here for interface reasons. + /** + * Vector of particles that are about to be removed from the container. + * Currently only used by AutoPasContainer but here for interface reasons. + */ std::vector _invalidParticles{}; }; From 69de7e20b123d77c7e10ce3bcb43e10f9a6188df Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Mon, 29 Jan 2024 14:24:36 +0100 Subject: [PATCH 19/33] fix wrong indent --- src/parallel/CommunicationPartner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parallel/CommunicationPartner.cpp b/src/parallel/CommunicationPartner.cpp index de7141bf55..c43812d911 100644 --- a/src/parallel/CommunicationPartner.cpp +++ b/src/parallel/CommunicationPartner.cpp @@ -265,7 +265,7 @@ bool CommunicationPartner::iprobeCount(const MPI_Comm& comm, const MPI_Datatype& return _countReceived; } bool CommunicationPartner::testRecv(ParticleContainer* moleculeContainer, bool removeRecvDuplicates, bool force) { - if (_countReceived and not _msgReceived) { + if (_countReceived and not _msgReceived) { int flag = 1; if (_countTested > 10) { // some MPI (Intel, IBM) implementations can produce deadlocks using MPI_Test without any MPI_Wait From 2b36232a4b0b3995242933cda0e835dffc4afef9 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Wed, 31 Jan 2024 13:37:30 +0100 Subject: [PATCH 20/33] add getRebuildFrequency --- src/parallel/NeighbourCommunicationScheme.cpp | 1 + src/particleContainer/AutoPasContainer.cpp | 2 ++ src/particleContainer/AutoPasContainer.h | 2 ++ src/particleContainer/ParticleContainer.h | 2 ++ 4 files changed, 7 insertions(+) diff --git a/src/parallel/NeighbourCommunicationScheme.cpp b/src/parallel/NeighbourCommunicationScheme.cpp index c138410d59..750d24e427 100644 --- a/src/parallel/NeighbourCommunicationScheme.cpp +++ b/src/parallel/NeighbourCommunicationScheme.cpp @@ -299,6 +299,7 @@ void DirectNeighbourCommunicationScheme::finalizeExchangeMoleculesMPI(ParticleCo removeRecvDuplicates |= (domainDecomp->getRank() == (*_neighbours)[0][i].getRank()); } + // local helper function to apply f to all real neighbours auto forAllRealNeighbors = [&](auto&& f) { for (auto& neighbor : (*_neighbours)[0]) { if (not _useSequentialFallback or domainDecomp->getRank() != neighbor.getRank()) { diff --git a/src/particleContainer/AutoPasContainer.cpp b/src/particleContainer/AutoPasContainer.cpp index e8c2b8b9e8..76e5ad2b2a 100644 --- a/src/particleContainer/AutoPasContainer.cpp +++ b/src/particleContainer/AutoPasContainer.cpp @@ -628,6 +628,8 @@ double AutoPasContainer::getCutoff() const { return _cutoff; } double AutoPasContainer::getSkin() const { return _verletSkin; } +size_t AutoPasContainer::getRebuildFrequency() const {return _verletRebuildFrequency;}; + void AutoPasContainer::deleteMolecule(ParticleIterator &moleculeIter, const bool & /*rebuildCaches*/) { _autopasContainer.deleteParticle(moleculeIter); } diff --git a/src/particleContainer/AutoPasContainer.h b/src/particleContainer/AutoPasContainer.h index 8d9896737e..fa766e55fa 100644 --- a/src/particleContainer/AutoPasContainer.h +++ b/src/particleContainer/AutoPasContainer.h @@ -95,6 +95,8 @@ class AutoPasContainer : public ParticleContainer { double getSkin() const override; + size_t getRebuildFrequency() const override; + void deleteMolecule(ParticleIterator &moleculeIter, const bool &rebuildCaches) override; double getEnergy(ParticlePairsHandler *particlePairsHandler, Molecule *m1, CellProcessor &cellProcessor) override; diff --git a/src/particleContainer/ParticleContainer.h b/src/particleContainer/ParticleContainer.h index 66e44fbbe3..eea8af21cc 100644 --- a/src/particleContainer/ParticleContainer.h +++ b/src/particleContainer/ParticleContainer.h @@ -199,6 +199,8 @@ class ParticleContainer: public MemoryProfilable { virtual double getSkin() const {return 0.;} + virtual size_t getRebuildFrequency() const {return 1;}; + /* TODO: Have a look on this */ virtual void deleteMolecule(ParticleIterator& moleculeIter, const bool& rebuildCaches) = 0; From d056136d2c10b76bfea5856fc96eb2cca8bea864 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Wed, 31 Jan 2024 16:36:29 +0100 Subject: [PATCH 21/33] switch to hotfix branch --- cmake/modules/autopas.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/autopas.cmake b/cmake/modules/autopas.cmake index bb5a5d9958..a41a76bdad 100644 --- a/cmake/modules/autopas.cmake +++ b/cmake/modules/autopas.cmake @@ -25,7 +25,7 @@ if (ENABLE_AUTOPAS) # Merge of 798 (improve SoA loading); includes 787 combined tuning # set(AUTOPAS_TAG d338e23 CACHE STRING "AutoPas Git tag or commit id to use") - set(AUTOPAS_TAG fixMakeProjectCompilers CACHE STRING "AutoPas Git tag or commit id to use") + set(AUTOPAS_TAG fixLeavingParticleCollector CACHE STRING "AutoPas Git tag or commit id to use") FetchContent_Declare( autopasfetch From 35fc6834ee598d23e462e6c8fdc066469bb927b5 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Thu, 1 Feb 2024 14:56:11 +0100 Subject: [PATCH 22/33] typo --- src/parallel/DomainDecompMPIBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parallel/DomainDecompMPIBase.cpp b/src/parallel/DomainDecompMPIBase.cpp index 173856045d..be61e34858 100644 --- a/src/parallel/DomainDecompMPIBase.cpp +++ b/src/parallel/DomainDecompMPIBase.cpp @@ -247,7 +247,7 @@ void DomainDecompMPIBase::assertDisjunctivity(ParticleContainer* moleculeContain } } if (not isOk) { - Log::global_log->error() << "Aborting because of duplicated partices." << std::endl; + Log::global_log->error() << "Aborting because of duplicated particles." << std::endl; MPI_Abort(_comm, 1); } From 1702079a9fb583cda24c006e534be4840a084416 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Mon, 5 Feb 2024 17:39:14 +0100 Subject: [PATCH 23/33] Avoid race conditions by using thread local variables and restrict scope to necessary minimum --- src/Domain.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Domain.cpp b/src/Domain.cpp index b64528cdf9..879a2d5f71 100644 --- a/src/Domain.cpp +++ b/src/Domain.cpp @@ -261,30 +261,27 @@ void Domain::calculateGlobalValues( Log::global_log->debug() << "Selective thermostat will be applied to set " << thermit->first << " (beta_trans = " << this->_universalBTrans[thermit->first] << ", beta_rot = " << this->_universalBRot[thermit->first] << "!)" << std::endl; - int rot_dof; const double limit_energy = KINLIMIT_PER_T * Ti; #if defined(_OPENMP) #pragma omp parallel #endif { - - double Utrans, Urot, limit_rot_energy, vcorr, Dcorr; for (auto tM = particleContainer->iterator(ParticleIterator::ONLY_INNER_AND_BOUNDARY); tM.isValid(); ++tM) { - Utrans = tM->U_trans(); + const auto Utrans = tM->U_trans(); if (Utrans > limit_energy) { - vcorr = sqrt(limit_energy / Utrans); + const auto vcorr = sqrt(limit_energy / Utrans); Log::global_log->debug() << ": v(m" << tM->getID() << ") *= " << vcorr << std::endl; tM->scale_v(vcorr); tM->scale_F(vcorr); } - rot_dof = tM->component()->getRotationalDegreesOfFreedom(); + const auto rot_dof = tM->component()->getRotationalDegreesOfFreedom(); if (rot_dof > 0) { - limit_rot_energy = 3.0 * rot_dof * Ti; - Urot = tM->U_rot(); + const auto limit_rot_energy = 3.0 * rot_dof * Ti; + const auto Urot = tM->U_rot(); if (Urot > limit_rot_energy) { - Dcorr = sqrt(limit_rot_energy / Urot); + const auto Dcorr = sqrt(limit_rot_energy / Urot); Log::global_log->debug() << "D(m" << tM->getID() << ") *= " << Dcorr << std::endl; tM->scale_D(Dcorr); tM->scale_M(Dcorr); From c5c81d86ad818adbdea7f11b2f309cfd7447e571 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Tue, 6 Feb 2024 19:44:51 +0100 Subject: [PATCH 24/33] Update AutoPas version to next hotfix --- cmake/modules/autopas.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/autopas.cmake b/cmake/modules/autopas.cmake index a41a76bdad..58f78ca39a 100644 --- a/cmake/modules/autopas.cmake +++ b/cmake/modules/autopas.cmake @@ -25,7 +25,7 @@ if (ENABLE_AUTOPAS) # Merge of 798 (improve SoA loading); includes 787 combined tuning # set(AUTOPAS_TAG d338e23 CACHE STRING "AutoPas Git tag or commit id to use") - set(AUTOPAS_TAG fixLeavingParticleCollector CACHE STRING "AutoPas Git tag or commit id to use") + set(AUTOPAS_TAG fixLeavingParticleCollectorHaloBoxes CACHE STRING "AutoPas Git tag or commit id to use") FetchContent_Declare( autopasfetch From e7958300fa345147343129df35ad85880802b277 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Thu, 8 Feb 2024 10:55:59 +0100 Subject: [PATCH 25/33] fix parsing for negative numbers --- tools/decomp2vtkConverter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/decomp2vtkConverter.py b/tools/decomp2vtkConverter.py index deabe43b57..612ba63a14 100755 --- a/tools/decomp2vtkConverter.py +++ b/tools/decomp2vtkConverter.py @@ -88,7 +88,8 @@ def getCellPointIndices(self): line = f_in.readline() celllist = [] while line != "": - match = re.search(r'([0-9]+) ([0-9. ]+)(.*)', line) + # Matches "[int] [float] [whatever]" + match = re.search(r'([-0-9]+) ([-0-9. ]+)(.*)', line) rank = int(match.group(1).rstrip()) minMaxString = match.group(2).rstrip() configString = match.group(3) From 871b04981b9cfd7097fa22ac7d5f21734dba7b74 Mon Sep 17 00:00:00 2001 From: Manish Kumar Mishra Date: Mon, 8 Apr 2024 18:15:28 +0200 Subject: [PATCH 26/33] adding TuningMetricOption in autopas --- src/particleContainer/AutoPasContainer.cpp | 6 ++++++ src/particleContainer/AutoPasContainer.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/particleContainer/AutoPasContainer.cpp b/src/particleContainer/AutoPasContainer.cpp index 76e5ad2b2a..53a7ae24a1 100644 --- a/src/particleContainer/AutoPasContainer.cpp +++ b/src/particleContainer/AutoPasContainer.cpp @@ -130,6 +130,7 @@ AutoPasContainer::AutoPasContainer(double cutoff) : _cutoff(cutoff), _particlePr _containerChoices = _autopasContainer.getAllowedContainers(); _selectorStrategy = _autopasContainer.getSelectorStrategy(); _tuningStrategyOptions = _autopasContainer.getTuningStrategyOptions(); + _tuningMetricOptions = _autopasContainer.getTuningMetricOptions(); _tuningAcquisitionFunction = _autopasContainer.getAcquisitionFunction(); _dataLayoutChoices = _autopasContainer.getAllowedDataLayouts(); _newton3Choices = _autopasContainer.getAllowedNewton3Options(); @@ -203,6 +204,7 @@ void AutoPasContainer::readXML(XMLfileUnits &xmlconfig) { .begin(); _tuningStrategyOptions = parseAutoPasOption>(xmlconfig, "tuningStrategies", {_tuningStrategyOptions}); + _tuningMetricOptions = parseAutoPasOption(xmlconfig, "tuningMetric", {_tuningMetricOptions}); _extrapolationMethod = *parseAutoPasOption(xmlconfig, "extrapolationMethod", {_extrapolationMethod}) .begin(); @@ -320,6 +322,7 @@ bool AutoPasContainer::rebuild(double *bBoxMin, double *bBoxMax) { _autopasContainer.setAllowedDataLayouts(_dataLayoutChoices); _autopasContainer.setAllowedNewton3Options(_newton3Choices); _autopasContainer.setTuningStrategyOption(_tuningStrategyOptions); + _autopasContainer.setTuningMetricOptions(_tuningMetricOptions); _autopasContainer.setRuleFileName(_ruleFileName); _autopasContainer.setAcquisitionFunction(_tuningAcquisitionFunction); _autopasContainer.setMaxEvidence(_maxEvidence); @@ -349,6 +352,9 @@ bool AutoPasContainer::rebuild(double *bBoxMin, double *bBoxMax) { << std::setw(valueOffset) << std::left << "Newton3" << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getAllowedNewton3Options()) << "\n" + << std::setw(valueOffset) << std::left << "Tuning Metric Options" + << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getTuningMetricOptions()) + << "\n" << std::setw(valueOffset) << std::left << "Tuning strategies " << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getTuningStrategyOptions()) << "\n" diff --git a/src/particleContainer/AutoPasContainer.h b/src/particleContainer/AutoPasContainer.h index fa766e55fa..bda13e5db1 100644 --- a/src/particleContainer/AutoPasContainer.h +++ b/src/particleContainer/AutoPasContainer.h @@ -166,6 +166,7 @@ class AutoPasContainer : public ParticleContainer { std::set _containerChoices; autopas::SelectorStrategyOption _selectorStrategy; std::vector _tuningStrategyOptions; + std::set _tuningMetricOptions; autopas::ExtrapolationMethodOption _extrapolationMethod; autopas::AcquisitionFunctionOption _tuningAcquisitionFunction; std::set _dataLayoutChoices; From a23dbe3e3cc68ae05d2606ad6ca213685a3ccec9 Mon Sep 17 00:00:00 2001 From: Manish Kumar Mishra Date: Tue, 9 Apr 2024 11:51:00 +0200 Subject: [PATCH 27/33] updating call to gettter and setter of tuningMetric --- src/particleContainer/AutoPasContainer.cpp | 9 ++++----- src/particleContainer/AutoPasContainer.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/particleContainer/AutoPasContainer.cpp b/src/particleContainer/AutoPasContainer.cpp index 53a7ae24a1..f412182111 100644 --- a/src/particleContainer/AutoPasContainer.cpp +++ b/src/particleContainer/AutoPasContainer.cpp @@ -130,7 +130,7 @@ AutoPasContainer::AutoPasContainer(double cutoff) : _cutoff(cutoff), _particlePr _containerChoices = _autopasContainer.getAllowedContainers(); _selectorStrategy = _autopasContainer.getSelectorStrategy(); _tuningStrategyOptions = _autopasContainer.getTuningStrategyOptions(); - _tuningMetricOptions = _autopasContainer.getTuningMetricOptions(); + _tuningMetricOption = _autopasContainer.getTuningMetricOption(); _tuningAcquisitionFunction = _autopasContainer.getAcquisitionFunction(); _dataLayoutChoices = _autopasContainer.getAllowedDataLayouts(); _newton3Choices = _autopasContainer.getAllowedNewton3Options(); @@ -204,7 +204,7 @@ void AutoPasContainer::readXML(XMLfileUnits &xmlconfig) { .begin(); _tuningStrategyOptions = parseAutoPasOption>(xmlconfig, "tuningStrategies", {_tuningStrategyOptions}); - _tuningMetricOptions = parseAutoPasOption(xmlconfig, "tuningMetric", {_tuningMetricOptions}); + _tuningMetricOption = *parseAutoPasOption(xmlconfig, "tuningMetric", {_tuningMetricOption}).begin(); _extrapolationMethod = *parseAutoPasOption(xmlconfig, "extrapolationMethod", {_extrapolationMethod}) .begin(); @@ -322,7 +322,7 @@ bool AutoPasContainer::rebuild(double *bBoxMin, double *bBoxMax) { _autopasContainer.setAllowedDataLayouts(_dataLayoutChoices); _autopasContainer.setAllowedNewton3Options(_newton3Choices); _autopasContainer.setTuningStrategyOption(_tuningStrategyOptions); - _autopasContainer.setTuningMetricOptions(_tuningMetricOptions); + _autopasContainer.setTuningMetricOption(_tuningMetricOption); _autopasContainer.setRuleFileName(_ruleFileName); _autopasContainer.setAcquisitionFunction(_tuningAcquisitionFunction); _autopasContainer.setMaxEvidence(_maxEvidence); @@ -353,8 +353,7 @@ bool AutoPasContainer::rebuild(double *bBoxMin, double *bBoxMax) { << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getAllowedNewton3Options()) << "\n" << std::setw(valueOffset) << std::left << "Tuning Metric Options" - << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getTuningMetricOptions()) - << "\n" + << ": " << _autopasContainer.getTuningMetricOption() << "\n" << std::setw(valueOffset) << std::left << "Tuning strategies " << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getTuningStrategyOptions()) << "\n" diff --git a/src/particleContainer/AutoPasContainer.h b/src/particleContainer/AutoPasContainer.h index bda13e5db1..5167ba5818 100644 --- a/src/particleContainer/AutoPasContainer.h +++ b/src/particleContainer/AutoPasContainer.h @@ -166,7 +166,7 @@ class AutoPasContainer : public ParticleContainer { std::set _containerChoices; autopas::SelectorStrategyOption _selectorStrategy; std::vector _tuningStrategyOptions; - std::set _tuningMetricOptions; + autopas::TuningMetricOption _tuningMetricOption; autopas::ExtrapolationMethodOption _extrapolationMethod; autopas::AcquisitionFunctionOption _tuningAcquisitionFunction; std::set _dataLayoutChoices; From 6b7e98d110ddd86e6050e9a77531b158bfa63ea6 Mon Sep 17 00:00:00 2001 From: Manish Kumar Mishra Date: Tue, 9 Apr 2024 11:56:41 +0200 Subject: [PATCH 28/33] tuningMetric option in all-options.xml --- examples/all-options.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/all-options.xml b/examples/all-options.xml index 31e75a7fd2..d4f91f6787 100644 --- a/examples/all-options.xml +++ b/examples/all-options.xml @@ -245,6 +245,8 @@ ruleBasedTuning, predictiveTuning + + time, energy SoA From b6698e09753e463d65b0da37e810353bedd27139 Mon Sep 17 00:00:00 2001 From: Manish Kumar Mishra Date: Tue, 9 Apr 2024 12:48:29 +0200 Subject: [PATCH 29/33] adding energy option in Argon simulation --- examples/Argon/200K_18mol_l/config_autopas_aos.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/Argon/200K_18mol_l/config_autopas_aos.xml b/examples/Argon/200K_18mol_l/config_autopas_aos.xml index 2542cc05d4..cbd7ff39a0 100644 --- a/examples/Argon/200K_18mol_l/config_autopas_aos.xml +++ b/examples/Argon/200K_18mol_l/config_autopas_aos.xml @@ -35,6 +35,7 @@ lc_c01, lc_c08, lc_c18, lc_sli, ds_sequential linkedCells, verletLists, directsum fastestMedian + energy AoS enabled, disabled 1000 From d2837829e1fd68c0faef18a9e2a3121491bf38d8 Mon Sep 17 00:00:00 2001 From: Manish Kumar Mishra Date: Tue, 9 Apr 2024 14:20:17 +0200 Subject: [PATCH 30/33] minor fix --- examples/all-options.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/all-options.xml b/examples/all-options.xml index d4f91f6787..432a50647f 100644 --- a/examples/all-options.xml +++ b/examples/all-options.xml @@ -245,8 +245,8 @@ ruleBasedTuning, predictiveTuning - - time, energy + + energy SoA From 7b671ca6ca750923d4caa6a7ce07a391d382e633 Mon Sep 17 00:00:00 2001 From: Manish Kumar Mishra Date: Tue, 9 Apr 2024 14:34:27 +0200 Subject: [PATCH 31/33] minor console out update --- src/particleContainer/AutoPasContainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/particleContainer/AutoPasContainer.cpp b/src/particleContainer/AutoPasContainer.cpp index f412182111..014c5faf9d 100644 --- a/src/particleContainer/AutoPasContainer.cpp +++ b/src/particleContainer/AutoPasContainer.cpp @@ -352,7 +352,7 @@ bool AutoPasContainer::rebuild(double *bBoxMin, double *bBoxMax) { << std::setw(valueOffset) << std::left << "Newton3" << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getAllowedNewton3Options()) << "\n" - << std::setw(valueOffset) << std::left << "Tuning Metric Options" + << std::setw(valueOffset) << std::left << "Tuning Metric" << ": " << _autopasContainer.getTuningMetricOption() << "\n" << std::setw(valueOffset) << std::left << "Tuning strategies " << ": " << autopas::utils::ArrayUtils::to_string(_autopasContainer.getTuningStrategyOptions()) From a94780f092d6333e1c1a5cc7dd4fbbd2d467d6c3 Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Tue, 9 Apr 2024 15:34:24 +0200 Subject: [PATCH 32/33] bump autopas version for energy tuning --- cmake/modules/autopas.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/autopas.cmake b/cmake/modules/autopas.cmake index 58f78ca39a..a26056a95e 100644 --- a/cmake/modules/autopas.cmake +++ b/cmake/modules/autopas.cmake @@ -23,9 +23,9 @@ if (ENABLE_AUTOPAS) set(AUTOPAS_USE_VECTORIZATION ${USE_VECTORIZATION} CACHE BOOL "Set via USE_VECTORIZATION" FORCE) set(AUTOPAS_VECTOR_INSTRUCTIONS ${VECTOR_INSTRUCTIONS} CACHE STRING "Set via VECTOR_INSTRUCTIONS_OPTIONS" FORCE) - # Merge of 798 (improve SoA loading); includes 787 combined tuning + # Merge of 845 (getTuningMetricOption()); includes 787 combined tuning # set(AUTOPAS_TAG d338e23 CACHE STRING "AutoPas Git tag or commit id to use") - set(AUTOPAS_TAG fixLeavingParticleCollectorHaloBoxes CACHE STRING "AutoPas Git tag or commit id to use") + set(AUTOPAS_TAG 8eb3804 CACHE STRING "AutoPas Git tag or commit id to use") FetchContent_Declare( autopasfetch From 7c7d7b4adbff8507abd1bfe846d565ab5fb4ad5d Mon Sep 17 00:00:00 2001 From: FG-TUM Date: Fri, 12 Apr 2024 17:08:16 +0200 Subject: [PATCH 33/33] bump autopas version for fixed region iterators --- cmake/modules/autopas.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/modules/autopas.cmake b/cmake/modules/autopas.cmake index a26056a95e..99a02230fc 100644 --- a/cmake/modules/autopas.cmake +++ b/cmake/modules/autopas.cmake @@ -23,9 +23,8 @@ if (ENABLE_AUTOPAS) set(AUTOPAS_USE_VECTORIZATION ${USE_VECTORIZATION} CACHE BOOL "Set via USE_VECTORIZATION" FORCE) set(AUTOPAS_VECTOR_INSTRUCTIONS ${VECTOR_INSTRUCTIONS} CACHE STRING "Set via VECTOR_INSTRUCTIONS_OPTIONS" FORCE) - # Merge of 845 (getTuningMetricOption()); includes 787 combined tuning - # set(AUTOPAS_TAG d338e23 CACHE STRING "AutoPas Git tag or commit id to use") - set(AUTOPAS_TAG 8eb3804 CACHE STRING "AutoPas Git tag or commit id to use") + # Merge of #830 (fixRegionIterators); includes #787 (combined tuning) + set(AUTOPAS_TAG faef573 CACHE STRING "AutoPas Git tag or commit id to use") FetchContent_Declare( autopasfetch