From: Roland Schulz Date: Sat, 2 Feb 2019 19:34:02 +0000 (-0800) Subject: Replace compat::make_unique with std::make_unique X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=a1232af41591e2d0c8bbab85aa0f5506a17b2d9d;p=alexxy%2Fgromacs.git Replace compat::make_unique with std::make_unique Change-Id: I6b0db007b8a7b9e1d72374dcee15f66587375f75 --- diff --git a/docs/doxygen/cycle-suppressions.txt b/docs/doxygen/cycle-suppressions.txt index 09410e82d6..9c8f5a4574 100644 --- a/docs/doxygen/cycle-suppressions.txt +++ b/docs/doxygen/cycle-suppressions.txt @@ -1,7 +1,6 @@ # Order (or more generally, edge selection) is significant (see gmxtree.md); # "moduleA -> moduleB" means that moduleA should not depend on moduleB, and is # a problem to be addressed at some point. -compat -> utility domdec -> imd domdec -> ewald domdec -> mdlib diff --git a/src/.clang-tidy b/src/.clang-tidy index 20be0b77f7..88b91c2add 100644 --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -16,10 +16,6 @@ HeaderFilterRegex: .* CheckOptions: - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor value: 1 - - key: modernize-make-unique.MakeSmartPtrFunction - value: gmx::compat::make_unique - - key: modernize-make-unique.MakeSmartPtrFunctionHeader - value: gromacs/compat/make_unique.h - key: modernize-make-unique.IncludeStyle value: google - key: modernize-make-shared.IncludeStyle diff --git a/src/.clang-tidy.new.code b/src/.clang-tidy.new.code index e495372d9b..d6d1d93fe4 100644 --- a/src/.clang-tidy.new.code +++ b/src/.clang-tidy.new.code @@ -20,10 +20,6 @@ HeaderFilterRegex: .* CheckOptions: - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor value: 1 - - key: modernize-make-unique.MakeSmartPtrFunction - value: gmx::compat::make_unique - - key: modernize-make-unique.MakeSmartPtrFunctionHeader - value: gromacs/compat/make_unique.h - key: modernize-make-unique.IncludeStyle value: google - key: modernize-make-shared.IncludeStyle diff --git a/src/api/cpp/context.cpp b/src/api/cpp/context.cpp index bea12dbf0f..d11571e878 100644 --- a/src/api/cpp/context.cpp +++ b/src/api/cpp/context.cpp @@ -54,7 +54,6 @@ #include "gromacs/commandline/pargs.h" #include "gromacs/commandline/filenm.h" #include "gromacs/commandline/pargs.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/gmxlib/network.h" #include "gromacs/mdlib/stophandler.h" #include "gromacs/mdrun/logging.h" diff --git a/src/api/cpp/include/gmxapi/gmxapi.h b/src/api/cpp/include/gmxapi/gmxapi.h index ac268ba27b..bc21459b1b 100644 --- a/src/api/cpp/include/gmxapi/gmxapi.h +++ b/src/api/cpp/include/gmxapi/gmxapi.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -424,7 +424,7 @@ class MDHolder * * # With `system` as a gmxapi::System object * auto spec = system->getSpec(); - * auto holder = gmx::compat::make_unique(spec); + * auto holder = std::make_unique(spec); * * A PyCapsule object with the name given by gmxapi::MDHolder_Name is assumed to * contain a pointer to an MDHolder and to have an appropriate deleter attached. diff --git a/src/api/cpp/md.cpp b/src/api/cpp/md.cpp index b978c67f23..5d235301f0 100644 --- a/src/api/cpp/md.cpp +++ b/src/api/cpp/md.cpp @@ -36,7 +36,6 @@ #include -#include "gromacs/compat/make_unique.h" #include "gromacs/mdtypes/state.h" #include "gromacs/utility/keyvaluetree.h" @@ -70,7 +69,7 @@ class MDWorkSpec::Impl //! \endcond MDWorkSpec::MDWorkSpec() : - impl_ {gmx::compat::make_unique()} + impl_ {std::make_unique()} { GMX_ASSERT(impl_, "Expected non-null implementation object."); } diff --git a/src/api/cpp/mdsignals.cpp b/src/api/cpp/mdsignals.cpp index da00f81e6e..17718780c2 100644 --- a/src/api/cpp/mdsignals.cpp +++ b/src/api/cpp/mdsignals.cpp @@ -43,7 +43,7 @@ #include -#include "gromacs/compat/make_unique.h" +#include #include "gromacs/mdlib/simulationsignal.h" #include "gromacs/mdrun/runner.h" #include "gromacs/utility/gmxassert.h" @@ -164,7 +164,7 @@ Signal SignalManager::getSignal(std::string name, throw gmxapi::NotImplementedError("This signaller only handles stop signals."); } - auto signalImpl = gmx::compat::make_unique(this, name); + auto signalImpl = std::make_unique(this, name); auto functor = Signal(std::move(signalImpl)); return functor; } diff --git a/src/api/cpp/mdsignals.h b/src/api/cpp/mdsignals.h index 113dcfaa87..2ebdd17f85 100644 --- a/src/api/cpp/mdsignals.h +++ b/src/api/cpp/mdsignals.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -45,7 +45,7 @@ #include #include -#include "gromacs/compat/make_unique.h" +#include #include "gromacs/mdlib/simulationsignal.h" #include "gromacs/mdlib/stophandler.h" #include "gromacs/mdrun/runner.h" diff --git a/src/api/cpp/session.cpp b/src/api/cpp/session.cpp index e1abb57b73..a5bfd0d624 100644 --- a/src/api/cpp/session.cpp +++ b/src/api/cpp/session.cpp @@ -39,7 +39,7 @@ #include "gmxapi/session.h" -#include "gromacs/compat/make_unique.h" +#include #include "gromacs/gmxlib/network.h" #include "gromacs/mdlib/sighandler.h" #include "gromacs/mdrun/logging.h" @@ -193,11 +193,11 @@ std::unique_ptr SessionImpl::create(std::shared_ptr c { // We should be able to get a communicator (or subcommunicator) through the // Context. - return gmx::compat::make_unique(std::move(context), - std::move(runnerBuilder), - simulationContext, - std::move(logFilehandle), - multiSim); + return std::make_unique(std::move(context), + std::move(runnerBuilder), + simulationContext, + std::move(logFilehandle), + multiSim); } SessionImpl::SessionImpl(std::shared_ptr context, @@ -206,7 +206,7 @@ SessionImpl::SessionImpl(std::shared_ptr context, gmx::LogFilePtr fplog, gmx_multisim_t * multiSim) : context_(std::move(context)), - mpiContextManager_(gmx::compat::make_unique()), + mpiContextManager_(std::make_unique()), simulationContext_(simulationContext), logFilePtr_(std::move(fplog)), multiSim_(multiSim) @@ -219,12 +219,12 @@ SessionImpl::SessionImpl(std::shared_ptr context, // \todo Session objects can have logic specialized for the runtime environment. - auto stopHandlerBuilder = gmx::compat::make_unique(); - signalManager_ = gmx::compat::make_unique(stopHandlerBuilder.get()); + auto stopHandlerBuilder = std::make_unique(); + signalManager_ = std::make_unique(stopHandlerBuilder.get()); GMX_ASSERT(signalManager_, "SessionImpl invariant includes a valid SignalManager."); runnerBuilder.addStopHandlerBuilder(std::move(stopHandlerBuilder)); - runner_ = gmx::compat::make_unique(runnerBuilder.build()); + runner_ = std::make_unique(runnerBuilder.build()); GMX_ASSERT(runner_, "SessionImpl invariant implies valid Mdrunner handle."); // For the libgromacs context, a session should explicitly reset global variables that could @@ -324,7 +324,7 @@ gmxapi::SessionResources *SessionImpl::createResources(std::shared_ptrname(); if (resources_.find(name) == resources_.end()) { - auto resourcesInstance = gmx::compat::make_unique(this, name); + auto resourcesInstance = std::make_unique(this, name); resources_.emplace(std::make_pair(name, std::move(resourcesInstance))); resources = resources_.at(name).get(); // To do: This should be more dynamic. diff --git a/src/api/cpp/status.cpp b/src/api/cpp/status.cpp index dde46e5912..017fda99c7 100644 --- a/src/api/cpp/status.cpp +++ b/src/api/cpp/status.cpp @@ -35,7 +35,7 @@ #include "gmxapi/status.h" -#include "gromacs/compat/make_unique.h" +#include namespace gmxapi { @@ -82,17 +82,17 @@ class Status::Impl /// \endcond Status::Status() : - impl_ {gmx::compat::make_unique()} + impl_ {std::make_unique()} {} Status::Status(const Status &status) { - impl_ = gmx::compat::make_unique(status.success()); + impl_ = std::make_unique(status.success()); } Status &Status::operator=(const Status &status) { - this->impl_ = gmx::compat::make_unique(status.success()); + this->impl_ = std::make_unique(status.success()); return *this; } @@ -100,14 +100,14 @@ Status &Status::operator=(Status &&) noexcept = default; Status &Status::operator=(bool success) { - this->impl_ = gmx::compat::make_unique(success); + this->impl_ = std::make_unique(success); return *this; } Status::Status(Status &&) noexcept = default; Status::Status(bool success) : - impl_ {gmx::compat::make_unique(success)} + impl_ {std::make_unique(success)} {} bool Status::success() const diff --git a/src/api/cpp/system.cpp b/src/api/cpp/system.cpp index 0ae2a5efec..2493b0b8e3 100644 --- a/src/api/cpp/system.cpp +++ b/src/api/cpp/system.cpp @@ -38,7 +38,7 @@ #include #include "gromacs/utility.h" -#include "gromacs/compat/make_unique.h" +#include #include "gromacs/mdrun/runner.h" #include "gmxapi/context.h" @@ -100,7 +100,7 @@ System fromTprFile(const std::string &filename) // This may produce errors or throw exceptions in the future, but as of // 0.0.3 only memory allocation errors are possible, and we do not have a // plan for how to recover from them. - auto systemImpl = gmx::compat::make_unique(std::move(workflow)); + auto systemImpl = std::make_unique(std::move(workflow)); GMX_ASSERT(systemImpl, "Could not create a valid implementation object."); auto system = System(std::move(systemImpl)); diff --git a/src/api/cpp/workflow.cpp b/src/api/cpp/workflow.cpp index c199975330..cf90d806fb 100644 --- a/src/api/cpp/workflow.cpp +++ b/src/api/cpp/workflow.cpp @@ -37,7 +37,6 @@ #include -#include "gromacs/compat/make_unique.h" #include "gromacs/utility/gmxassert.h" #include "workflow-impl.h" @@ -52,7 +51,7 @@ std::unique_ptr MDNodeSpecification::clone() { GMX_ASSERT(!tprfilename_.empty(), "Need a non-empty filename string."); std::unique_ptr node = nullptr; - node = gmx::compat::make_unique(tprfilename_); + node = std::make_unique(tprfilename_); return node; } @@ -79,10 +78,10 @@ NodeKey Workflow::addNode(std::unique_ptr spec) std::unique_ptr Workflow::create(const std::string &filename) { const std::string name = "MD"; - auto spec = gmx::compat::make_unique(filename); + auto spec = std::make_unique(filename); Workflow::Impl graph; graph.emplace(std::make_pair(name, std::move(spec))); - auto workflow = gmx::compat::make_unique(std::move(graph)); + auto workflow = std::make_unique(std::move(graph)); return workflow; } diff --git a/src/api/cpp/workflow/tests/workflow.cpp b/src/api/cpp/workflow/tests/workflow.cpp index ccc60aed6c..ec04474bb4 100644 --- a/src/api/cpp/workflow/tests/workflow.cpp +++ b/src/api/cpp/workflow/tests/workflow.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -41,7 +41,6 @@ #include "api/cpp/include/gmxapi/status.h" #include "api/cpp/include/gmxapi/system.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/utility/arrayref.h" #include "api/cpp/tests/testingconfiguration.h" @@ -60,7 +59,7 @@ TEST_F(GmxApiTest, BuildApiWorkflowImpl) { makeTprFile(100); // Create work spec - auto node = gmx::compat::make_unique(runner_.tprFileName_); + auto node = std::make_unique(runner_.tprFileName_); EXPECT_NE(node, nullptr); // Create key diff --git a/src/gromacs/analysisdata/datastorage.cpp b/src/gromacs/analysisdata/datastorage.cpp index 164f9b877d..c80e919223 100644 --- a/src/gromacs/analysisdata/datastorage.cpp +++ b/src/gromacs/analysisdata/datastorage.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -53,7 +53,6 @@ #include "gromacs/analysisdata/dataframe.h" #include "gromacs/analysisdata/datamodulemanager.h" #include "gromacs/analysisdata/paralleloptions.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/utility/exceptions.h" #include "gromacs/utility/gmxassert.h" @@ -451,7 +450,7 @@ AnalysisDataStorageImpl::extendBuffer(size_t newSize) frames_.reserve(newSize); while (frames_.size() < newSize) { - frames_.push_back(compat::make_unique(this, nextIndex_)); + frames_.push_back(std::make_unique(this, nextIndex_)); ++nextIndex_; } // The unused frame should not be included in the count. diff --git a/src/gromacs/awh/awh.cpp b/src/gromacs/awh/awh.cpp index c503de4e48..1e731a6fd8 100644 --- a/src/gromacs/awh/awh.cpp +++ b/src/gromacs/awh/awh.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -421,8 +421,8 @@ prepareAwhModule(FILE *fplog, GMX_THROW(InvalidInputError("AWH biasing does not support shell particles.")); } - auto awh = compat::make_unique(fplog, inputRecord, commRecord, multiSimRecord, *inputRecord.awhParams, - biasInitFilename, pull_work); + auto awh = std::make_unique(fplog, inputRecord, commRecord, multiSimRecord, *inputRecord.awhParams, + biasInitFilename, pull_work); if (startingFromCheckpoint) { diff --git a/src/gromacs/awh/bias.cpp b/src/gromacs/awh/bias.cpp index 437784e24d..3c39990acb 100644 --- a/src/gromacs/awh/bias.cpp +++ b/src/gromacs/awh/bias.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -54,8 +54,8 @@ #include #include +#include -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/gmxfio.h" #include "gromacs/gmxlib/network.h" #include "gromacs/math/functions.h" @@ -351,11 +351,11 @@ Bias::Bias(int biasIndexInCollection, double blockLength = 0; /* Construct the force correlation object. */ forceCorrelationGrid_ = - compat::make_unique(state_.points().size(), ndim(), - blockLength, CorrelationGrid::BlockLengthMeasure::Time, - awhParams.nstSampleCoord*mdTimeStep); + std::make_unique(state_.points().size(), ndim(), + blockLength, CorrelationGrid::BlockLengthMeasure::Time, + awhParams.nstSampleCoord*mdTimeStep); - writer_ = compat::make_unique(*this); + writer_ = std::make_unique(*this); } } diff --git a/src/gromacs/awh/bias.h b/src/gromacs/awh/bias.h index 8f395bb17b..27ce32699e 100644 --- a/src/gromacs/awh/bias.h +++ b/src/gromacs/awh/bias.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -54,7 +54,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/math/vectypes.h" #include "gromacs/utility/alignedallocator.h" #include "gromacs/utility/basedefinitions.h" diff --git a/src/gromacs/awh/tests/bias.cpp b/src/gromacs/awh/tests/bias.cpp index 0a6ad40daa..8e4475ed5c 100644 --- a/src/gromacs/awh/tests/bias.cpp +++ b/src/gromacs/awh/tests/bias.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2017,2018, by the GROMACS development team, led by + * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -47,7 +47,6 @@ #include "gromacs/awh/correlationgrid.h" #include "gromacs/awh/pointstate.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/mdtypes/awh-params.h" #include "gromacs/utility/stringutil.h" @@ -211,7 +210,7 @@ class BiasTest : public ::testing::TestWithParam int numSamples = coordinates_.size() - 1; // No sample taken at step 0 GMX_RELEASE_ASSERT(numSamples % params.awhParams.numSamplesUpdateFreeEnergy == 0, "This test is intended to reproduce the situation when the might need to write output during a normal AWH run, therefore the number of samples should be a multiple of the free-energy update interval (but the test should also runs fine without this condition)."); - bias_ = gmx::compat::make_unique(-1, params.awhParams, params.awhBiasParams, params.dimParams, params.beta, mdTimeStep, 1, "", Bias::ThisRankWillDoIO::No, disableUpdateSkips); + bias_ = std::make_unique(-1, params.awhParams, params.awhBiasParams, params.dimParams, params.beta, mdTimeStep, 1, "", Bias::ThisRankWillDoIO::No, disableUpdateSkips); } }; diff --git a/src/gromacs/awh/tests/biasstate.cpp b/src/gromacs/awh/tests/biasstate.cpp index 57f518ccd2..06c871608d 100644 --- a/src/gromacs/awh/tests/biasstate.cpp +++ b/src/gromacs/awh/tests/biasstate.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2017,2018, by the GROMACS development team, led by + * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,7 +46,6 @@ #include "gromacs/awh/grid.h" #include "gromacs/awh/pointstate.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/math/functions.h" #include "gromacs/mdtypes/awh-params.h" #include "gromacs/utility/smalloc.h" @@ -140,7 +139,7 @@ class BiasStateTest : public ::testing::TestWithParam dimParams.emplace_back(1.0, 15.0, params.beta); Grid grid(dimParams, awhBiasParams.dimParams); BiasParams biasParams(awhParams, awhBiasParams, dimParams, 1.0, 1.0, BiasParams::DisableUpdateSkips::no, 1, grid.axis(), 0); - biasState_ = gmx::compat::make_unique(awhBiasParams, 1.0, dimParams, grid); + biasState_ = std::make_unique(awhBiasParams, 1.0, dimParams, grid); // Here we initialize the grid point state using the input file std::string filename = gmx::test::TestFileManager::getInputFilePath(GetParam()); diff --git a/src/gromacs/commandline/cmdlinehelpmodule.cpp b/src/gromacs/commandline/cmdlinehelpmodule.cpp index 9716758dfa..755617245e 100644 --- a/src/gromacs/commandline/cmdlinehelpmodule.cpp +++ b/src/gromacs/commandline/cmdlinehelpmodule.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -50,7 +50,6 @@ #include "gromacs/commandline/cmdlinehelpcontext.h" #include "gromacs/commandline/cmdlinehelpwriter.h" #include "gromacs/commandline/cmdlineparser.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/onlinehelp/helpformat.h" #include "gromacs/onlinehelp/helpmanager.h" #include "gromacs/onlinehelp/helptopic.h" @@ -568,12 +567,12 @@ HelpExportReStructuredText::HelpExportReStructuredText( void HelpExportReStructuredText::startModuleExport() { - indexFile_ = compat::make_unique( + indexFile_ = std::make_unique( outputRedirector_->openTextOutputFile("fragments/byname.rst")); indexFile_->writeLine(formatString("* :doc:`%s ` - %s", binaryName_.c_str(), binaryName_.c_str(), RootHelpText::title)); - manPagesFile_ = compat::make_unique( + manPagesFile_ = std::make_unique( outputRedirector_->openTextOutputFile("conf-man.py")); manPagesFile_->writeLine("man_pages = ["); } @@ -635,9 +634,9 @@ void HelpExportReStructuredText::finishModuleExport() void HelpExportReStructuredText::startModuleGroupExport() { - indexFile_ = compat::make_unique( + indexFile_ = std::make_unique( outputRedirector_->openTextOutputFile("fragments/bytopic.rst")); - manPagesFile_ = compat::make_unique( + manPagesFile_ = std::make_unique( outputRedirector_->openTextOutputFile("fragments/bytopic-man.rst")); } diff --git a/src/gromacs/commandline/cmdlineinit.cpp b/src/gromacs/commandline/cmdlineinit.cpp index a9561e08c2..035bcc8e09 100644 --- a/src/gromacs/commandline/cmdlineinit.cpp +++ b/src/gromacs/commandline/cmdlineinit.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -51,7 +51,6 @@ #include "gromacs/commandline/cmdlinemodulemanager.h" #include "gromacs/commandline/cmdlineoptionsmodule.h" #include "gromacs/commandline/cmdlineprogramcontext.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/utility/basenetwork.h" #include "gromacs/utility/datafilefinder.h" #include "gromacs/utility/exceptions.h" @@ -126,9 +125,9 @@ CommandLineProgramContext &initForCommandLine(int *argc, char ***argv) broadcastArguments(argc, argv); try { - g_commandLineContext = compat::make_unique(*argc, *argv); + g_commandLineContext = std::make_unique(*argc, *argv); setProgramContext(g_commandLineContext.get()); - g_libFileFinder = compat::make_unique(); + g_libFileFinder = std::make_unique(); g_libFileFinder->setSearchPathFromEnv("GMXLIB"); setLibraryFileFinder(g_libFileFinder.get()); } diff --git a/src/gromacs/commandline/shellcompletions.cpp b/src/gromacs/commandline/shellcompletions.cpp index 7fe52b3884..18b49bc812 100644 --- a/src/gromacs/commandline/shellcompletions.cpp +++ b/src/gromacs/commandline/shellcompletions.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -53,7 +53,6 @@ #include "gromacs/commandline/cmdlinehelpcontext.h" #include "gromacs/commandline/pargs.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/filetypes.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" @@ -222,7 +221,7 @@ TextWriter &ShellCompletionWriter::outputWriter() void ShellCompletionWriter::startCompletions() { - impl_->file_ = compat::make_unique(impl_->binaryName_ + "-completion.bash"); + impl_->file_ = std::make_unique(impl_->binaryName_ + "-completion.bash"); } void ShellCompletionWriter::writeModuleCompletions( diff --git a/src/gromacs/compat/CMakeLists.txt b/src/gromacs/compat/CMakeLists.txt index 5e4c52a0cd..8332601533 100644 --- a/src/gromacs/compat/CMakeLists.txt +++ b/src/gromacs/compat/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2018, by the GROMACS development team, led by +# Copyright (c) 2018,2019, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,7 +32,6 @@ # To help us fund GROMACS development, we humbly ask that you cite # the research papers on the package. Check out http://www.gromacs.org. -gmx_install_headers(make_unique.h) if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/compat/make_unique.h b/src/gromacs/compat/make_unique.h deleted file mode 100644 index 52bf6184bf..0000000000 --- a/src/gromacs/compat/make_unique.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is part of the GROMACS molecular simulation package. - * - * Copyright (c) 2017,2018, by the GROMACS development team, led by - * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, - * and including many others, as listed in the AUTHORS file in the - * top-level source directory and at http://www.gromacs.org. - * - * GROMACS is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * GROMACS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GROMACS; if not, see - * http://www.gnu.org/licenses, or write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * If you want to redistribute modifications to GROMACS, please - * consider that scientific software is very special. Version - * control is crucial - bugs must be traceable. We will be happy to - * consider code for inclusion in the official distribution, but - * derived work must not be called official GROMACS. Details are found - * in the README & COPYING files - if they are missing, get the - * official version at http://www.gromacs.org. - * - * To help us fund GROMACS development, we humbly ask that you cite - * the research papers on the package. Check out http://www.gromacs.org. - */ -#ifndef GMX_COMPAT_MAKE_UNIQUE_H -#define GMX_COMPAT_MAKE_UNIQUE_H -/*! \libinternal - * \defgroup module_compat C++ "standard" library compatibility helpers. - * - * \brief Provide uniform interface to selected C++ standard and - * popular library features. - * - * For some features not available on all platforms supported by - * \Gromacs, provides back-ports or mappings to available standard - * library implementations as appropriate. - * - * Backported implementations of features from newer C++ standards, or - * from community libraries such as Abseil or the Guidelines Support - * Library may also be considered for inclusion here. We generally - * expect that features included here are either already standard, - * proposed for the standard, or so useful in solving a frequently - * occuring problem that their use is not controversial. - */ - -/*! - * \file - * \brief Provides template gmx::compat::make_unique - * - * The implementation of gmx::compat::make_unique is copied with little - * modification from C++ standardization doc N3656 - * at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3656.htm - * though additional wrapping has been added for use in \Gromacs. - * - * \author M. Eric Irrgang - * \ingroup module_compat - * \inlibraryapi - */ -/*! \addtogroup module_compat - * ### gmx::compat::make_unique - * - * Provide a trivially adapted implementation of the C++ standard library `make_unique` function template. - * When All supported \Gromacs build platforms provide `std::make_unique`, this should be removed. - * - */ -#include - -#include -#include -#include - -namespace gmx -{ -namespace compat -{ - -///\cond - -// All gmx::compat code should use std::unique_ptr -using ::std::unique_ptr; - -template struct Unique_if { - typedef unique_ptr Single_object; -}; - -template struct Unique_if { - typedef unique_ptr Unknown_bound; -}; - -template struct Unique_if { - typedef void Known_bound; -}; - -template -typename Unique_if::Single_object -make_unique(Args && ... args) -{ - return unique_ptr(new T(::std::forward(args) ...)); -} - -template -typename Unique_if::Unknown_bound -make_unique(size_t n) -{ - typedef typename ::std::remove_extent::type U; - return unique_ptr(new U[n]()); -} - -template -typename Unique_if::Known_bound -make_unique(Args && ...) = delete; - -///\endcond - -} // namespace compat -} // namespace gmx - -#endif // header guard diff --git a/src/gromacs/compat/tests/make_unique.cpp b/src/gromacs/compat/tests/make_unique.cpp index 72cc32ca7e..5456720e3e 100644 --- a/src/gromacs/compat/tests/make_unique.cpp +++ b/src/gromacs/compat/tests/make_unique.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2017,2018, by the GROMACS development team, led by + * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -33,14 +33,14 @@ * the research papers on the package. Check out http://www.gromacs.org. */ /*! \internal \file - * \brief Tests for gmx::compat::make_unique + * \brief Tests for std::make_unique * * \author M. Eric Irrgang * \ingroup module_compat */ #include "gmxpre.h" -#include "gromacs/compat/make_unique.h" +#include #include @@ -67,14 +67,14 @@ struct dummy TEST(CompatibilityHelper, MakeUniqueCompiles) { // Check template parameters - auto ptr = gmx::compat::make_unique(); + auto ptr = std::make_unique(); ASSERT_NE(ptr, nullptr); ASSERT_NE(ptr.get(), nullptr); constexpr bool is_dummy = std::is_same < decltype(ptr), std::unique_ptr < dummy>>::value; ASSERT_TRUE(is_dummy); // Check template and function parameters - ptr = gmx::compat::make_unique('a', 'b'); + ptr = std::make_unique('a', 'b'); ASSERT_EQ(ptr->foo, 'a'); } diff --git a/src/gromacs/correlationfunctions/tests/autocorr.cpp b/src/gromacs/correlationfunctions/tests/autocorr.cpp index 0cf1b4af14..2da64bd675 100644 --- a/src/gromacs/correlationfunctions/tests/autocorr.cpp +++ b/src/gromacs/correlationfunctions/tests/autocorr.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -50,7 +50,6 @@ #include -#include "gromacs/compat/make_unique.h" #include "gromacs/correlationfunctions/expfit.h" #include "gromacs/fft/fft.h" #include "gromacs/utility/gmxassert.h" @@ -98,7 +97,7 @@ class AutocorrTest : public ::testing::Test { int n = 0; std::string fileName = "testCOS3.xvg"; - data_ = gmx::compat::make_unique(fileName); + data_ = std::make_unique(fileName); nrFrames_ = data_->getNrLines(); tempArgs_ = add_acf_pargs(&n, nullptr); } diff --git a/src/gromacs/domdec/domdec.cpp b/src/gromacs/domdec/domdec.cpp index 6ed75fbeaa..d4a5169b6c 100644 --- a/src/gromacs/domdec/domdec.cpp +++ b/src/gromacs/domdec/domdec.cpp @@ -48,8 +48,8 @@ #include #include +#include -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/collect.h" #include "gromacs/domdec/dlb.h" #include "gromacs/domdec/dlbtiming.h" @@ -1167,7 +1167,7 @@ static void make_load_communicator(gmx_domdec_t *dd, int dim_ind, ivec loc) if (dd->ci[dim] == dd->master_ci[dim]) { /* This is the root process of this row */ - cellsizes.rowMaster = gmx::compat::make_unique(); + cellsizes.rowMaster = std::make_unique(); RowMaster &rowMaster = *cellsizes.rowMaster; rowMaster.cellFrac.resize(ddCellFractionBufferSize(dd, dim_ind)); @@ -1770,9 +1770,9 @@ static void make_dd_communicators(const gmx::MDLogger &mdlog, /* We can not use DDMASTER(dd), because dd->masterrank is set later */ if (MASTER(cr)) { - dd->ma = gmx::compat::make_unique(dd->nc, - comm->cgs_gl.nr, - comm->cgs_gl.index[comm->cgs_gl.nr]); + dd->ma = std::make_unique(dd->nc, + comm->cgs_gl.nr, + comm->cgs_gl.index[comm->cgs_gl.nr]); } } @@ -2106,10 +2106,10 @@ static void setupUpdateGroups(const gmx::MDLogger &mdlog, */ int homeAtomCountEstimate = mtop.natoms/numMpiRanksTotal; comm->updateGroupsCog = - gmx::compat::make_unique(mtop, - comm->updateGroupingPerMoleculetype, - maxReferenceTemperature(inputrec), - homeAtomCountEstimate); + std::make_unique(mtop, + comm->updateGroupingPerMoleculetype, + maxReferenceTemperature(inputrec), + homeAtomCountEstimate); /* To use update groups, the large domain-to-domain cutoff distance * should be compatible with the box size. @@ -2173,7 +2173,7 @@ static void set_dd_limits_and_grid(const gmx::MDLogger &mdlog, comm->bPMELoadBalDLBLimits = FALSE; /* Allocate the charge group/atom sorting struct */ - comm->sort = gmx::compat::make_unique(); + comm->sort = std::make_unique(); comm->bCGs = (ncg_mtop(mtop) < mtop->natoms); diff --git a/src/gromacs/domdec/domdec_constraints.cpp b/src/gromacs/domdec/domdec_constraints.cpp index f9c8364336..92ffdd85bd 100644 --- a/src/gromacs/domdec/domdec_constraints.cpp +++ b/src/gromacs/domdec/domdec_constraints.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -49,8 +49,8 @@ #include #include +#include -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/dlbtiming.h" #include "gromacs/domdec/domdec.h" #include "gromacs/domdec/domdec_struct.h" @@ -651,7 +651,7 @@ void init_domdec_constraints(gmx_domdec_t *dd, */ int numKeysEstimate = std::min(mtop->natoms/20, mtop->natoms/(2*dd->nnodes)); - dc->ga2la = gmx::compat::make_unique < gmx::HashedMap < int>>(numKeysEstimate); + dc->ga2la = std::make_unique < gmx::HashedMap < int>>(numKeysEstimate); dc->nthread = gmx_omp_nthreads_get(emntDomdec); dc->ils.resize(dc->nthread); diff --git a/src/gromacs/domdec/domdec_topology.cpp b/src/gromacs/domdec/domdec_topology.cpp index 97587f933a..566102baff 100644 --- a/src/gromacs/domdec/domdec_topology.cpp +++ b/src/gromacs/domdec/domdec_topology.cpp @@ -51,9 +51,9 @@ #include #include +#include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/domdec.h" #include "gromacs/domdec/domdec_network.h" #include "gromacs/domdec/ga2la.h" @@ -739,7 +739,7 @@ static gmx_reverse_top_t make_reverse_top(const gmx_mtop_t *mtop, gmx_bool bFE, { for (thread_work_t &th_work : rt.th_work) { - th_work.vsitePbc = gmx::compat::make_unique(); + th_work.vsitePbc = std::make_unique(); } } diff --git a/src/gromacs/domdec/localatomsetmanager.cpp b/src/gromacs/domdec/localatomsetmanager.cpp index dfe05ddf67..6305d2bd2d 100644 --- a/src/gromacs/domdec/localatomsetmanager.cpp +++ b/src/gromacs/domdec/localatomsetmanager.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,7 +46,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/localatomset.h" #include "gromacs/utility/exceptions.h" @@ -78,7 +77,7 @@ LocalAtomSetManager::~LocalAtomSetManager(){} LocalAtomSet LocalAtomSetManager::add(ArrayRef globalAtomIndex) { - impl_->atomSetData_.push_back(compat::make_unique(globalAtomIndex)); + impl_->atomSetData_.push_back(std::make_unique(globalAtomIndex)); return LocalAtomSet(*impl_->atomSetData_.back()); } diff --git a/src/gromacs/essentialdynamics/edsam.cpp b/src/gromacs/essentialdynamics/edsam.cpp index 9e168eed94..8ad287bf6d 100644 --- a/src/gromacs/essentialdynamics/edsam.cpp +++ b/src/gromacs/essentialdynamics/edsam.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -43,8 +43,9 @@ #include #include +#include + #include "gromacs/commandline/filenm.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/domdec_struct.h" #include "gromacs/fileio/gmxfio.h" #include "gromacs/fileio/xvgr.h" @@ -1128,7 +1129,7 @@ static std::unique_ptr ed_open( const gmx_output_env_t *oenv, const t_commrec *cr) { - auto edHandle = gmx::compat::make_unique(); + auto edHandle = std::make_unique(); auto ed = edHandle->getLegacyED(); /* We want to perform ED (this switch might later be upgraded to EssentialDynamicsType::Flooding) */ ed->eEDtype = EssentialDynamicsType::EDSampling; @@ -1138,7 +1139,7 @@ static std::unique_ptr ed_open( // If we start from a checkpoint file, we already have an edsamHistory struct if (oh->edsamHistory == nullptr) { - oh->edsamHistory = gmx::compat::make_unique(edsamhistory_t {}); + oh->edsamHistory = std::make_unique(edsamhistory_t {}); } edsamhistory_t *EDstate = oh->edsamHistory.get(); diff --git a/src/gromacs/ewald/pme-gpu-internal.cpp b/src/gromacs/ewald/pme-gpu-internal.cpp index 5891a9c425..a8d98e96cf 100644 --- a/src/gromacs/ewald/pme-gpu-internal.cpp +++ b/src/gromacs/ewald/pme-gpu-internal.cpp @@ -52,9 +52,9 @@ #include "config.h" #include +#include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/ewald/ewald-utils.h" #include "gromacs/gpu_utils/gpu_utils.h" #include "gromacs/math/invertmatrix.h" @@ -578,7 +578,7 @@ void pme_gpu_reinit_3dfft(const PmeGpu *pmeGpu) pmeGpu->archSpecific->fftSetup.resize(0); for (int i = 0; i < pmeGpu->common->ngrids; i++) { - pmeGpu->archSpecific->fftSetup.push_back(gmx::compat::make_unique(pmeGpu)); + pmeGpu->archSpecific->fftSetup.push_back(std::make_unique(pmeGpu)); } } } diff --git a/src/gromacs/ewald/pme-gpu-program.cpp b/src/gromacs/ewald/pme-gpu-program.cpp index 46c2103e5e..fbb1a8eeb7 100644 --- a/src/gromacs/ewald/pme-gpu-program.cpp +++ b/src/gromacs/ewald/pme-gpu-program.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -47,12 +47,12 @@ #include "pme-gpu-program.h" -#include "gromacs/compat/make_unique.h" +#include #include "pme-gpu-program-impl.h" PmeGpuProgram::PmeGpuProgram(const gmx_device_info_t *deviceInfo) : - impl_(gmx::compat::make_unique(deviceInfo)) + impl_(std::make_unique(deviceInfo)) { } @@ -65,5 +65,5 @@ PmeGpuProgramStorage buildPmeGpuProgram(const gmx_device_info_t *deviceInfo) // This workaround is only needed for CodePath::CPU dummy in testhardwarecontexts.cpp return nullptr; } - return gmx::compat::make_unique(deviceInfo); + return std::make_unique(deviceInfo); } diff --git a/src/gromacs/ewald/pme-only.cpp b/src/gromacs/ewald/pme-only.cpp index 690a19df74..e448d45426 100644 --- a/src/gromacs/ewald/pme-only.cpp +++ b/src/gromacs/ewald/pme-only.cpp @@ -71,7 +71,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/domdec.h" #include "gromacs/ewald/pme.h" #include "gromacs/fft/parallel_3dfft.h" @@ -132,7 +131,7 @@ struct gmx_pme_pp { /*! \brief Initialize the PME-only side of the PME <-> PP communication */ static std::unique_ptr gmx_pme_pp_init(const t_commrec *cr) { - auto pme_pp = gmx::compat::make_unique(); + auto pme_pp = std::make_unique(); #if GMX_MPI int rank; diff --git a/src/gromacs/ewald/tests/testhardwarecontexts.cpp b/src/gromacs/ewald/tests/testhardwarecontexts.cpp index b4486fc7ca..6157cd3dd1 100644 --- a/src/gromacs/ewald/tests/testhardwarecontexts.cpp +++ b/src/gromacs/ewald/tests/testhardwarecontexts.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2017,2018, by the GROMACS development team, led by + * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -44,7 +44,8 @@ #include "testhardwarecontexts.h" -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/ewald/pme.h" #include "gromacs/gpu_utils/gpu_utils.h" #include "gromacs/hardware/detecthardware.h" @@ -109,7 +110,7 @@ static gmx_hw_info_t *hardwareInit() void PmeTestEnvironment::SetUp() { - hardwareContexts_.emplace_back(compat::make_unique(CodePath::CPU, "", nullptr)); + hardwareContexts_.emplace_back(std::make_unique(CodePath::CPU, "", nullptr)); hardwareInfo_ = hardwareInit(); if (!pme_gpu_supports_build(*hardwareInfo_, nullptr)) @@ -126,7 +127,7 @@ void PmeTestEnvironment::SetUp() char stmp[200] = {}; get_gpu_device_info_string(stmp, hardwareInfo_->gpu_info, gpuIndex); std::string description = "(GPU " + std::string(stmp) + ") "; - hardwareContexts_.emplace_back(compat::make_unique + hardwareContexts_.emplace_back(std::make_unique (CodePath::GPU, description.c_str(), deviceInfo)); } diff --git a/src/gromacs/fileio/checkpoint.cpp b/src/gromacs/fileio/checkpoint.cpp index 333342bc43..a3a7a09493 100644 --- a/src/gromacs/fileio/checkpoint.cpp +++ b/src/gromacs/fileio/checkpoint.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -55,7 +55,6 @@ #include #include "buildinfo.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/filetypes.h" #include "gromacs/fileio/gmxfio.h" #include "gromacs/fileio/gmxfio-xdr.h" @@ -1465,7 +1464,7 @@ static int do_cpt_enerhist(XDR *xd, gmx_bool bRead, { if (deltaH == nullptr) { - enerhist->deltaHForeignLambdas = gmx::compat::make_unique(); + enerhist->deltaHForeignLambdas = std::make_unique(); deltaH = enerhist->deltaHForeignLambdas.get(); } deltaH->dh.resize(numDeltaH); @@ -2580,7 +2579,7 @@ static void read_checkpoint(const char *fn, t_fileio *logfio, if (headerContents->flags_enh && observablesHistory->energyHistory == nullptr) { - observablesHistory->energyHistory = gmx::compat::make_unique(); + observablesHistory->energyHistory = std::make_unique(); } ret = do_cpt_enerhist(gmx_fio_getxdr(fp), TRUE, headerContents->flags_enh, observablesHistory->energyHistory.get(), nullptr); @@ -2593,7 +2592,7 @@ static void read_checkpoint(const char *fn, t_fileio *logfio, { if (observablesHistory->pullHistory == nullptr) { - observablesHistory->pullHistory = gmx::compat::make_unique(); + observablesHistory->pullHistory = std::make_unique(); } ret = doCptPullHist(gmx_fio_getxdr(fp), TRUE, headerContents->flagsPullHistory, observablesHistory->pullHistory.get(), StatePart::pullHistory, nullptr); @@ -2616,7 +2615,7 @@ static void read_checkpoint(const char *fn, t_fileio *logfio, if (headerContents->nED > 0 && observablesHistory->edsamHistory == nullptr) { - observablesHistory->edsamHistory = gmx::compat::make_unique(edsamhistory_t {}); + observablesHistory->edsamHistory = std::make_unique(edsamhistory_t {}); } ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, headerContents->nED, observablesHistory->edsamHistory.get(), nullptr); if (ret) @@ -2637,7 +2636,7 @@ static void read_checkpoint(const char *fn, t_fileio *logfio, if (headerContents->eSwapCoords != eswapNO && observablesHistory->swapHistory == nullptr) { - observablesHistory->swapHistory = gmx::compat::make_unique(swaphistory_t {}); + observablesHistory->swapHistory = std::make_unique(swaphistory_t {}); } ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, headerContents->eSwapCoords, observablesHistory->swapHistory.get(), nullptr); if (ret) diff --git a/src/gromacs/fileio/tpxio.cpp b/src/gromacs/fileio/tpxio.cpp index 2efb336f97..8891f103cd 100644 --- a/src/gromacs/fileio/tpxio.cpp +++ b/src/gromacs/fileio/tpxio.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -45,9 +45,9 @@ #include #include +#include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/filetypes.h" #include "gromacs/fileio/gmxfio.h" #include "gromacs/fileio/gmxfio-xdr.h" @@ -2544,7 +2544,7 @@ static void do_mtop(t_fileio *fio, gmx_mtop_t *mtop, gmx_bool bRead, { if (bRead) { - mtop->intermolecular_ilist = gmx::compat::make_unique(); + mtop->intermolecular_ilist = std::make_unique(); } do_ilists(fio, mtop->intermolecular_ilist.get(), bRead, file_version); } diff --git a/src/gromacs/gmxana/gmx_awh.cpp b/src/gromacs/gmxana/gmx_awh.cpp index dd1d468361..e17343a925 100644 --- a/src/gromacs/gmxana/gmx_awh.cpp +++ b/src/gromacs/gmxana/gmx_awh.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -52,7 +52,6 @@ #include #include "gromacs/commandline/pargs.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/enxio.h" #include "gromacs/fileio/gmxfio.h" #include "gromacs/fileio/oenv.h" @@ -440,7 +439,7 @@ AwhReader::AwhReader(const AwhParams *awhParams, std::unique_ptr frictionOutputFile; if (outputFriction) { - frictionOutputFile = gmx::compat::make_unique(opt2fn("-fric", numFileOptions, filenames), "Friction tensor", awhParams->numBias, k); + frictionOutputFile = std::make_unique(opt2fn("-fric", numFileOptions, filenames), "Friction tensor", awhParams->numBias, k); frictionOutputFile->initializeFrictionOutputFile(subblockStart, numSubBlocks, awhBiasParams, energyUnit, kT); } @@ -640,11 +639,11 @@ int gmx_awh(int argc, char *argv[]) AwhGraphSelection awhGraphSelection = (moreGraphs ? AwhGraphSelection::All : AwhGraphSelection::Pmf); EnergyUnit energyUnit = (kTUnit ? EnergyUnit::KT : EnergyUnit::KJPerMol); awhReader = - gmx::compat::make_unique(ir.awhParams, - nfile, fnm, - awhGraphSelection, - energyUnit, BOLTZ*ir.opts.ref_t[0], - block); + std::make_unique(ir.awhParams, + nfile, fnm, + awhGraphSelection, + energyUnit, BOLTZ*ir.opts.ref_t[0], + block); } awhReader->processAwhFrame(*block, frame->t, oenv); diff --git a/src/gromacs/gmxana/gmx_msd.cpp b/src/gromacs/gmxana/gmx_msd.cpp index 8cbd28a23e..f31fd08355 100644 --- a/src/gromacs/gmxana/gmx_msd.cpp +++ b/src/gromacs/gmxana/gmx_msd.cpp @@ -39,9 +39,10 @@ #include #include +#include + #include "gromacs/commandline/pargs.h" #include "gromacs/commandline/viewit.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/confio.h" #include "gromacs/fileio/trxio.h" #include "gromacs/fileio/xvgr.h" @@ -907,9 +908,9 @@ static void do_corr(const char *trx_file, const char *ndx_file, const char *msd_ index_atom2mol(&gnx[0], index[0], &top->mols); } - msd = gmx::compat::make_unique(nrgrp, type, axis, dim_factor, - mol_file == nullptr ? 0 : gnx[0], - bTen, bMW, dt, top, beginfit, endfit); + msd = std::make_unique(nrgrp, type, axis, dim_factor, + mol_file == nullptr ? 0 : gnx[0], + bTen, bMW, dt, top, beginfit, endfit); nat_trx = corr_loop(msd.get(), trx_file, top, ePBC, mol_file ? gnx[0] != 0 : false, gnx.data(), index, diff --git a/src/gromacs/gmxana/gmx_trjconv.cpp b/src/gromacs/gmxana/gmx_trjconv.cpp index 47cc18ecb2..731618fd6e 100644 --- a/src/gromacs/gmxana/gmx_trjconv.cpp +++ b/src/gromacs/gmxana/gmx_trjconv.cpp @@ -41,10 +41,10 @@ #include #include +#include #include "gromacs/commandline/pargs.h" #include "gromacs/commandline/viewit.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/confio.h" #include "gromacs/fileio/g96io.h" #include "gromacs/fileio/gmxfio.h" @@ -582,7 +582,7 @@ read_mtop_for_tng(const char *tps_file, efTNG == fn2ftp(output_file)) { int temp_natoms = -1; - mtop = gmx::compat::make_unique(); + mtop = std::make_unique(); read_tpx(tps_file, nullptr, nullptr, &temp_natoms, nullptr, nullptr, mtop.get()); } diff --git a/src/gromacs/gmxpreprocess/convparm.cpp b/src/gromacs/gmxpreprocess/convparm.cpp index ee73c32e20..a28d9918da 100644 --- a/src/gromacs/gmxpreprocess/convparm.cpp +++ b/src/gromacs/gmxpreprocess/convparm.cpp @@ -43,7 +43,8 @@ #include #include -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/gmxpreprocess/gpp_atomtype.h" #include "gromacs/gmxpreprocess/grompp-impl.h" #include "gromacs/gmxpreprocess/topio.h" @@ -565,7 +566,7 @@ void convert_params(int atnr, t_params nbtypes[], if (intermolecular_interactions != nullptr) { /* Process the intermolecular interaction list */ - mtop->intermolecular_ilist = gmx::compat::make_unique(); + mtop->intermolecular_ilist = std::make_unique(); for (i = 0; (i < F_NRE); i++) { diff --git a/src/gromacs/gmxpreprocess/grompp.cpp b/src/gromacs/gmxpreprocess/grompp.cpp index d526d23a6e..4e0922fd84 100644 --- a/src/gromacs/gmxpreprocess/grompp.cpp +++ b/src/gromacs/gmxpreprocess/grompp.cpp @@ -44,13 +44,13 @@ #include #include +#include #include #include #include "gromacs/awh/read-params.h" #include "gromacs/commandline/pargs.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/ewald/ewald-utils.h" #include "gromacs/ewald/pme.h" #include "gromacs/fft/calcgrid.h" diff --git a/src/gromacs/gmxpreprocess/pdb2gmx.cpp b/src/gromacs/gmxpreprocess/pdb2gmx.cpp index 9df3f293cf..cab4521a43 100644 --- a/src/gromacs/gmxpreprocess/pdb2gmx.cpp +++ b/src/gromacs/gmxpreprocess/pdb2gmx.cpp @@ -44,11 +44,11 @@ #include #include +#include #include #include #include "gromacs/commandline/cmdlineoptionsmodule.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/confio.h" #include "gromacs/fileio/filetypes.h" #include "gromacs/fileio/gmxfio.h" @@ -2445,7 +2445,7 @@ const char pdb2gmxInfo::shortDescription[] = "Convert coordinate files to topology and FF-compliant coordinate files"; ICommandLineOptionsModulePointer pdb2gmxInfo::create() { - return compat::make_unique(); + return std::make_unique(); } } // namespace gmx diff --git a/src/gromacs/gpu_utils/clfftinitializer.cpp b/src/gromacs/gpu_utils/clfftinitializer.cpp index f4ccdda703..693c32983a 100644 --- a/src/gromacs/gpu_utils/clfftinitializer.cpp +++ b/src/gromacs/gpu_utils/clfftinitializer.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -45,7 +45,8 @@ #include "config.h" -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/utility/exceptions.h" #include "gromacs/utility/stringutil.h" @@ -83,7 +84,7 @@ ClfftInitializer::~ClfftInitializer() std::unique_ptr initializeClfftLibrary() { - return compat::make_unique(); + return std::make_unique(); } } // namespace gmx diff --git a/src/gromacs/hardware/detecthardware.cpp b/src/gromacs/hardware/detecthardware.cpp index aea9a1a3e6..ff683eb49b 100644 --- a/src/gromacs/hardware/detecthardware.cpp +++ b/src/gromacs/hardware/detecthardware.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -52,7 +52,6 @@ #include "thread_mpi/threads.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/gpu_utils/gpu_utils.h" #include "gromacs/hardware/cpuinfo.h" #include "gromacs/hardware/hardwaretopology.h" @@ -432,7 +431,7 @@ gmx_hw_info_t *gmx_detect_hardware(const gmx::MDLogger &mdlog, /* only initialize the hwinfo structure if it is not already initalized */ if (n_hwinfo == 0) { - hwinfo_g = compat::make_unique(); + hwinfo_g = std::make_unique(); /* TODO: We should also do CPU hardware detection only once on each * physical node and broadcast it, instead of do it on every MPI rank. */ diff --git a/src/gromacs/mdlib/boxdeformation.cpp b/src/gromacs/mdlib/boxdeformation.cpp index cf84470f92..aa81638708 100644 --- a/src/gromacs/mdlib/boxdeformation.cpp +++ b/src/gromacs/mdlib/boxdeformation.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -50,7 +50,8 @@ #include "boxdeformation.h" -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/gmxlib/network.h" #include "gromacs/math/invertmatrix.h" #include "gromacs/math/vec.h" @@ -88,10 +89,10 @@ prepareBoxDeformation(const matrix &initialBox, gmx_bcast(sizeof(box), box, cr); } - return compat::make_unique(inputrec.delta_t, - inputrec.init_step, - inputrec.deform, - box); + return std::make_unique(inputrec.delta_t, + inputrec.init_step, + inputrec.deform, + box); } BoxDeformation::BoxDeformation(double timeStep, diff --git a/src/gromacs/mdlib/broadcaststructs.cpp b/src/gromacs/mdlib/broadcaststructs.cpp index 8591ae634f..61768551a7 100644 --- a/src/gromacs/mdlib/broadcaststructs.cpp +++ b/src/gromacs/mdlib/broadcaststructs.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -41,7 +41,8 @@ #include -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/gmxlib/network.h" #include "gromacs/math/vec.h" #include "gromacs/mdlib/mdrun.h" @@ -818,7 +819,7 @@ void bcast_ir_mtop(const t_commrec *cr, t_inputrec *inputrec, gmx_mtop_t *mtop) block_bc(cr, mtop->bIntermolecularInteractions); if (mtop->bIntermolecularInteractions) { - mtop->intermolecular_ilist = gmx::compat::make_unique(); + mtop->intermolecular_ilist = std::make_unique(); bc_ilists(cr, mtop->intermolecular_ilist.get()); } diff --git a/src/gromacs/mdlib/forcerec.cpp b/src/gromacs/mdlib/forcerec.cpp index c231eace7b..dec8a2a022 100644 --- a/src/gromacs/mdlib/forcerec.cpp +++ b/src/gromacs/mdlib/forcerec.cpp @@ -46,9 +46,9 @@ #include #include +#include #include "gromacs/commandline/filenm.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/domdec.h" #include "gromacs/domdec/domdec_struct.h" #include "gromacs/ewald/ewald.h" @@ -2145,14 +2145,14 @@ static void init_nb_verlet(const gmx::MDLogger &mdlog, } } - nbv->listParams = gmx::compat::make_unique(ir->rlist); + nbv->listParams = std::make_unique(ir->rlist); setupDynamicPairlistPruning(mdlog, ir, mtop, box, nbv->grp[0].kernel_type, fr->ic, nbv->listParams.get()); - nbv->nbs = gmx::compat::make_unique(DOMAINDECOMP(cr) ? &cr->dd->nc : nullptr, - DOMAINDECOMP(cr) ? domdec_zones(cr->dd) : nullptr, - bFEP_NonBonded, - gmx_omp_nthreads_get(emntPairsearch)); + nbv->nbs = std::make_unique(DOMAINDECOMP(cr) ? &cr->dd->nc : nullptr, + DOMAINDECOMP(cr) ? domdec_zones(cr->dd) : nullptr, + bFEP_NonBonded, + gmx_omp_nthreads_get(emntPairsearch)); for (int i = 0; i < nbv->ngrp; i++) { diff --git a/src/gromacs/mdlib/makeconstraints.h b/src/gromacs/mdlib/makeconstraints.h index 65246ecb7b..91fd83b57a 100644 --- a/src/gromacs/mdlib/makeconstraints.h +++ b/src/gromacs/mdlib/makeconstraints.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,7 +46,6 @@ #include -#include "gromacs/compat/make_unique.h" #include "gromacs/mdlib/constr.h" #include "gromacs/mdtypes/inputrec.h" #include "gromacs/pulling/pull.h" @@ -112,7 +111,7 @@ std::unique_ptr makeConstraints(const gmx_mtop_t &mtop, // No work, so don't make a Constraints object. return nullptr; } - return compat::make_unique + return std::make_unique (mtop, ir, std::forward(args) ..., numConstraints, numSettles); } diff --git a/src/gromacs/mdlib/mdatoms.cpp b/src/gromacs/mdlib/mdatoms.cpp index 6c015cc6ea..c86de049ec 100644 --- a/src/gromacs/mdlib/mdatoms.cpp +++ b/src/gromacs/mdlib/mdatoms.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -42,7 +42,6 @@ #include -#include "gromacs/compat/make_unique.h" #include "gromacs/ewald/pme.h" #include "gromacs/gpu_utils/hostallocator.h" #include "gromacs/math/functions.h" @@ -115,7 +114,7 @@ std::unique_ptr makeMDAtoms(FILE *fp, const gmx_mtop_t &mtop, const t_inputrec &ir, const bool rankHasPmeGpuTask) { - auto mdAtoms = compat::make_unique(); + auto mdAtoms = std::make_unique(); // GPU transfers may want to use a suitable pinning mode. if (rankHasPmeGpuTask) { diff --git a/src/gromacs/mdlib/mdebin_bar.cpp b/src/gromacs/mdlib/mdebin_bar.cpp index 7b2c030e79..4b33f86bb6 100644 --- a/src/gromacs/mdlib/mdebin_bar.cpp +++ b/src/gromacs/mdlib/mdebin_bar.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -43,7 +43,8 @@ #include #include -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/fileio/enxio.h" #include "gromacs/mdlib/mdebin.h" #include "gromacs/mdtypes/energyhistory.h" @@ -716,7 +717,7 @@ void mde_delta_h_coll_update_energyhistory(const t_mde_delta_h_coll *dhc, { if (enerhist->deltaHForeignLambdas == nullptr) { - enerhist->deltaHForeignLambdas = gmx::compat::make_unique(); + enerhist->deltaHForeignLambdas = std::make_unique(); enerhist->deltaHForeignLambdas->dh.resize(dhc->ndh); } diff --git a/src/gromacs/mdlib/stophandler.cpp b/src/gromacs/mdlib/stophandler.cpp index 3602f26d28..94c141aca2 100644 --- a/src/gromacs/mdlib/stophandler.cpp +++ b/src/gromacs/mdlib/stophandler.cpp @@ -44,7 +44,8 @@ #include "config.h" -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/timing/walltime_accounting.h" #include "gromacs/utility/cstringutil.h" @@ -205,7 +206,7 @@ std::unique_ptr StopHandlerBuilder::getStopHandlerMD ( {return stopConditionTime->getSignal(bNS, step, fplog, walltime_accounting); }); } - return compat::make_unique( + return std::make_unique( signal, simulationShareState, stopConditions_, neverUpdateNeighborList); } diff --git a/src/gromacs/mdlib/update.cpp b/src/gromacs/mdlib/update.cpp index 311d162298..c1f2c983a5 100644 --- a/src/gromacs/mdlib/update.cpp +++ b/src/gromacs/mdlib/update.cpp @@ -42,8 +42,8 @@ #include #include +#include -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/domdec_struct.h" #include "gromacs/fileio/confio.h" #include "gromacs/gmxlib/network.h" @@ -875,7 +875,7 @@ void update_temperature_constants(gmx_stochd_t *sd, const t_inputrec *ir) Update::Impl::Impl(const t_inputrec *ir, BoxDeformation *boxDeformation) { - sd = gmx::compat::make_unique(ir); + sd = std::make_unique(ir); update_temperature_constants(sd.get(), ir); xp.resizeWithPadding(0); deform = boxDeformation; diff --git a/src/gromacs/mdlib/vsite.cpp b/src/gromacs/mdlib/vsite.cpp index d5b4e07709..fe98a6ccce 100644 --- a/src/gromacs/mdlib/vsite.cpp +++ b/src/gromacs/mdlib/vsite.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -41,9 +41,9 @@ #include #include +#include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/domdec.h" #include "gromacs/domdec/domdec_struct.h" #include "gromacs/gmxlib/network.h" @@ -2039,7 +2039,7 @@ initVsite(const gmx_mtop_t &mtop, return vsite; } - vsite = gmx::compat::make_unique(); + vsite = std::make_unique(); vsite->n_intercg_vsite = count_intercg_vsites(&mtop); @@ -2068,7 +2068,7 @@ initVsite(const gmx_mtop_t &mtop, molt.cgs); } - vsite->vsite_pbc_loc = gmx::compat::make_unique(); + vsite->vsite_pbc_loc = std::make_unique(); } vsite->nthreads = gmx_omp_nthreads_get(emntVSITE); @@ -2082,7 +2082,7 @@ initVsite(const gmx_mtop_t &mtop, { try { - vsite->tData[thread] = gmx::compat::make_unique(); + vsite->tData[thread] = std::make_unique(); InterdependentTask &idTask = vsite->tData[thread]->idTask; idTask.nuse = 0; @@ -2092,7 +2092,7 @@ initVsite(const gmx_mtop_t &mtop, } if (vsite->nthreads > 1) { - vsite->tData[vsite->nthreads] = gmx::compat::make_unique(); + vsite->tData[vsite->nthreads] = std::make_unique(); } } @@ -2594,7 +2594,7 @@ void set_vsite_top(gmx_vsite_t *vsite, { if (vsite->n_intercg_vsite > 0 && vsite->bHaveChargeGroups) { - vsite->vsite_pbc_loc = gmx::compat::make_unique(); + vsite->vsite_pbc_loc = std::make_unique(); *vsite->vsite_pbc_loc = get_vsite_pbc(top->idef.iparams, top->idef.il, nullptr, md, top->cgs); diff --git a/src/gromacs/mdrun/md.cpp b/src/gromacs/mdrun/md.cpp index 86c7bea16a..1825b36b1b 100644 --- a/src/gromacs/mdrun/md.cpp +++ b/src/gromacs/mdrun/md.cpp @@ -53,7 +53,6 @@ #include "gromacs/awh/awh.h" #include "gromacs/commandline/filenm.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/collect.h" #include "gromacs/domdec/domdec.h" #include "gromacs/domdec/domdec_network.h" @@ -265,7 +264,7 @@ void gmx::Integrator::do_md() enerd); /* Kinetic energy data */ - std::unique_ptr eKinData = compat::make_unique(); + std::unique_ptr eKinData = std::make_unique(); gmx_ekindata_t *ekind = eKinData.get(); init_ekindata(fplog, top_global, &(ir->opts), ekind); /* Copy the cos acceleration to the groups struct */ @@ -301,7 +300,7 @@ void gmx::Integrator::do_md() { dd_init_local_top(*top_global, &top); - stateInstance = compat::make_unique(); + stateInstance = std::make_unique(); state = stateInstance.get(); dd_init_local_state(cr->dd, state_global, state); @@ -382,11 +381,11 @@ void gmx::Integrator::do_md() } if (!observablesHistory->energyHistory) { - observablesHistory->energyHistory = compat::make_unique(); + observablesHistory->energyHistory = std::make_unique(); } if (!observablesHistory->pullHistory) { - observablesHistory->pullHistory = compat::make_unique(); + observablesHistory->pullHistory = std::make_unique(); } /* Set the initial energy history in state by updating once */ update_energyhistory(observablesHistory->energyHistory.get(), mdebin); @@ -651,13 +650,13 @@ void gmx::Integrator::do_md() MASTER(cr), ir->nstlist, mdrunOptions.reproducible, nstSignalComm, mdrunOptions.maximumHoursToRun, ir->nstlist == 0, fplog, step, bNS, walltime_accounting); - auto checkpointHandler = compat::make_unique( + auto checkpointHandler = std::make_unique( compat::make_not_null(&signals[eglsCHKPT]), simulationsShareState, ir->nstlist == 0, MASTER(cr), mdrunOptions.writeConfout, mdrunOptions.checkpointOptions.period); const bool resetCountersIsLocal = true; - auto resetHandler = compat::make_unique( + auto resetHandler = std::make_unique( compat::make_not_null(&signals[eglsRESETCOUNTERS]), !resetCountersIsLocal, ir->nsteps, MASTER(cr), mdrunOptions.timingOptions.resetHalfway, mdrunOptions.maximumHoursToRun, mdlog, wcycle, walltime_accounting); diff --git a/src/gromacs/mdrun/mimic.cpp b/src/gromacs/mdrun/mimic.cpp index aaec3bbf1f..ffa3117749 100644 --- a/src/gromacs/mdrun/mimic.cpp +++ b/src/gromacs/mdrun/mimic.cpp @@ -52,7 +52,6 @@ #include "gromacs/awh/awh.h" #include "gromacs/commandline/filenm.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/collect.h" #include "gromacs/domdec/domdec.h" #include "gromacs/domdec/domdec_network.h" @@ -239,7 +238,7 @@ void gmx::Integrator::do_mimic() enerd); /* Kinetic energy data */ - std::unique_ptr eKinData = compat::make_unique(); + std::unique_ptr eKinData = std::make_unique(); gmx_ekindata_t *ekind = eKinData.get(); init_ekindata(fplog, top_global, &(ir->opts), ekind); /* Copy the cos acceleration to the groups struct */ @@ -270,7 +269,7 @@ void gmx::Integrator::do_mimic() { dd_init_local_top(*top_global, &top); - stateInstance = compat::make_unique(); + stateInstance = std::make_unique(); state = stateInstance.get(); dd_init_local_state(cr->dd, state_global, state); diff --git a/src/gromacs/mdrun/rerun.cpp b/src/gromacs/mdrun/rerun.cpp index 6ca622a2a1..aba3f6fc95 100644 --- a/src/gromacs/mdrun/rerun.cpp +++ b/src/gromacs/mdrun/rerun.cpp @@ -53,7 +53,6 @@ #include "gromacs/awh/awh.h" #include "gromacs/commandline/filenm.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/collect.h" #include "gromacs/domdec/domdec.h" #include "gromacs/domdec/domdec_network.h" @@ -305,7 +304,7 @@ void gmx::Integrator::do_rerun() enerd); /* Kinetic energy data */ - std::unique_ptr eKinData = compat::make_unique(); + std::unique_ptr eKinData = std::make_unique(); gmx_ekindata_t *ekind = eKinData.get(); init_ekindata(fplog, top_global, &(ir->opts), ekind); /* Copy the cos acceleration to the groups struct */ @@ -336,7 +335,7 @@ void gmx::Integrator::do_rerun() { dd_init_local_top(*top_global, &top); - stateInstance = compat::make_unique(); + stateInstance = std::make_unique(); state = stateInstance.get(); dd_init_local_state(cr->dd, state_global, state); diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index 7dfeb1293a..5f38a12d47 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -54,9 +54,9 @@ #include #include +#include #include "gromacs/commandline/filenm.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/domdec.h" #include "gromacs/domdec/domdec_struct.h" #include "gromacs/domdec/localatomsetmanager.h" @@ -169,7 +169,7 @@ Mdrunner Mdrunner::cloneOnSpawnedThread() const // part of the interface to the client code, which is associated only with the // original thread. Handles to the same resources can be obtained by copy. { - newRunner.restraintManager_ = compat::make_unique(*restraintManager_); + newRunner.restraintManager_ = std::make_unique(*restraintManager_); } // Copy original cr pointer before master thread can pass the thread barrier @@ -192,7 +192,7 @@ Mdrunner Mdrunner::cloneOnSpawnedThread() const newRunner.replExParams = replExParams; newRunner.pforce = pforce; newRunner.ms = ms; - newRunner.stopHandlerBuilder_ = compat::make_unique(*stopHandlerBuilder_); + newRunner.stopHandlerBuilder_ = std::make_unique(*stopHandlerBuilder_); threadMpiMdrunnerAccessBarrier(); @@ -552,7 +552,7 @@ int Mdrunner::mdrunner() if (SIMMASTER(cr)) { /* Only the master rank has the global state */ - globalState = compat::make_unique(); + globalState = std::make_unique(); /* Read (nearly) all data required for the simulation */ read_tpx_state(ftp2fn(efTPR, filenames.size(), filenames.data()), inputrec, globalState.get(), &mtop); @@ -754,7 +754,7 @@ int Mdrunner::mdrunner() { if (!MASTER(cr)) { - globalState = compat::make_unique(); + globalState = std::make_unique(); } broadcastStateWithoutDynamics(cr, globalState.get()); } @@ -1689,7 +1689,7 @@ void Mdrunner::BuilderImplementation::addReplicaExchange(const ReplicaExchangePa void Mdrunner::BuilderImplementation::addMultiSim(gmx_multisim_t* multisim) { - multisim_ = compat::make_unique(multisim); + multisim_ = std::make_unique(multisim); } Mdrunner Mdrunner::BuilderImplementation::build() @@ -1766,7 +1766,7 @@ Mdrunner Mdrunner::BuilderImplementation::build() GMX_THROW(gmx::APIError("MdrunnerBuilder::addBondedTaskAssignment() is required before build()")); } - newRunner.restraintManager_ = compat::make_unique(); + newRunner.restraintManager_ = std::make_unique(); if (stopHandlerBuilder_) { @@ -1774,7 +1774,7 @@ Mdrunner Mdrunner::BuilderImplementation::build() } else { - newRunner.stopHandlerBuilder_ = compat::make_unique(); + newRunner.stopHandlerBuilder_ = std::make_unique(); } return newRunner; @@ -1823,7 +1823,7 @@ void Mdrunner::BuilderImplementation::addStopHandlerBuilder(std::unique_ptr context) : - impl_ {gmx::compat::make_unique(context)} + impl_ {std::make_unique(context)} { } diff --git a/src/gromacs/mdrun/simulationcontext.cpp b/src/gromacs/mdrun/simulationcontext.cpp index 5a9e987140..19420dfb51 100644 --- a/src/gromacs/mdrun/simulationcontext.cpp +++ b/src/gromacs/mdrun/simulationcontext.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -39,8 +39,9 @@ #include +#include + #include "gromacs/commandline/filenm.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/domdec.h" #include "gromacs/fileio/oenv.h" #include "gromacs/hardware/hw_info.h" diff --git a/src/gromacs/mdrunutility/mdmodules.cpp b/src/gromacs/mdrunutility/mdmodules.cpp index fbf1bdd3be..039a11e774 100644 --- a/src/gromacs/mdrunutility/mdmodules.cpp +++ b/src/gromacs/mdrunutility/mdmodules.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -39,7 +39,6 @@ #include #include "gromacs/applied-forces/electricfield.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/mdtypes/iforceprovider.h" #include "gromacs/mdtypes/imdmodule.h" #include "gromacs/mdtypes/imdoutputprovider.h" @@ -151,7 +150,7 @@ ForceProviders *MDModules::initForceProviders() { GMX_RELEASE_ASSERT(impl_->forceProviders_ == nullptr, "Force providers initialized multiple times"); - impl_->forceProviders_ = compat::make_unique(); + impl_->forceProviders_ = std::make_unique(); impl_->field_->initForceProviders(impl_->forceProviders_.get()); for (auto && module : impl_->modules_) { diff --git a/src/gromacs/mdrunutility/tests/threadaffinitytest.cpp b/src/gromacs/mdrunutility/tests/threadaffinitytest.cpp index 3510be85c0..152960491a 100644 --- a/src/gromacs/mdrunutility/tests/threadaffinitytest.cpp +++ b/src/gromacs/mdrunutility/tests/threadaffinitytest.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -38,9 +38,10 @@ #include "config.h" +#include + #include -#include "gromacs/compat/make_unique.h" #include "gromacs/hardware/hardwaretopology.h" #include "gromacs/mdtypes/commrec.h" #include "gromacs/utility/basenetwork.h" @@ -87,7 +88,7 @@ ThreadAffinityTestHelper::~ThreadAffinityTestHelper() void ThreadAffinityTestHelper::setLogicalProcessorCount(int logicalProcessorCount) { - hwTop_ = gmx::compat::make_unique(logicalProcessorCount); + hwTop_ = std::make_unique(logicalProcessorCount); } } // namespace test diff --git a/src/gromacs/onlinehelp/helpwritercontext.cpp b/src/gromacs/onlinehelp/helpwritercontext.cpp index 831b22fccf..71ff04577e 100644 --- a/src/gromacs/onlinehelp/helpwritercontext.cpp +++ b/src/gromacs/onlinehelp/helpwritercontext.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -50,7 +50,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/onlinehelp/helpformat.h" #include "gromacs/utility/exceptions.h" #include "gromacs/utility/gmxassert.h" @@ -456,7 +455,7 @@ class HelpWriterContext::Impl "Accessing console formatter for non-console output"); if (!consoleOptionsFormatter_) { - consoleOptionsFormatter_ = compat::make_unique(); + consoleOptionsFormatter_ = std::make_unique(); consoleOptionsFormatter_->setFirstColumnIndent(1); consoleOptionsFormatter_->addColumn(nullptr, 7, false); consoleOptionsFormatter_->addColumn(nullptr, 18, false); diff --git a/src/gromacs/options/basicoptions.h b/src/gromacs/options/basicoptions.h index 6f3b73a3fe..abfe841cde 100644 --- a/src/gromacs/options/basicoptions.h +++ b/src/gromacs/options/basicoptions.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,10 +46,10 @@ #ifndef GMX_OPTIONS_BASICOPTIONS_H #define GMX_OPTIONS_BASICOPTIONS_H +#include #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/options/abstractoption.h" #include "gromacs/options/ivaluestore.h" #include "gromacs/utility/arrayref.h" @@ -577,7 +577,7 @@ class EnumOption : public OptionTemplate > *this, enumValues_, enumValuesCount_, convertToInt(MyBase::defaultValue()), convertToInt(MyBase::defaultValueIfSet()), - compat::make_unique >( + std::make_unique >( MyBase::store(), MyBase::storeVector())); } diff --git a/src/gromacs/options/options.cpp b/src/gromacs/options/options.cpp index 9f9486aeea..c8de6e435a 100644 --- a/src/gromacs/options/options.cpp +++ b/src/gromacs/options/options.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -43,9 +43,9 @@ #include "options.h" +#include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/options/abstractoption.h" #include "gromacs/options/abstractoptionstorage.h" #include "gromacs/options/optionsection.h" @@ -114,7 +114,7 @@ OptionSectionImpl::addSectionImpl(const AbstractOptionSection §ion) // Make sure that there are no duplicate sections. GMX_RELEASE_ASSERT(findSection(name) == nullptr, "Duplicate subsection name"); std::unique_ptr storage(section.createStorage()); - subsections_.push_back(compat::make_unique(managers_, std::move(storage), name)); + subsections_.push_back(std::make_unique(managers_, std::move(storage), name)); return subsections_.back().get(); } diff --git a/src/gromacs/options/optionsection.cpp b/src/gromacs/options/optionsection.cpp index 80835ecf5e..4c46b06e4b 100644 --- a/src/gromacs/options/optionsection.cpp +++ b/src/gromacs/options/optionsection.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2018, by the GROMACS development team, led by + * Copyright (c) 2016,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -36,7 +36,8 @@ #include "optionsection.h" -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/options/isectionstorage.h" namespace gmx @@ -57,7 +58,7 @@ class OptionSectionStorage : public IOptionSectionStorage std::unique_ptr OptionSection::createStorage() const { - return compat::make_unique(); + return std::make_unique(); } } // namespace gmx diff --git a/src/gromacs/options/optionstoragetemplate.h b/src/gromacs/options/optionstoragetemplate.h index 0081912bcf..c8abc6a069 100644 --- a/src/gromacs/options/optionstoragetemplate.h +++ b/src/gromacs/options/optionstoragetemplate.h @@ -601,7 +601,7 @@ void OptionStorageTemplate::setDefaultValueIfSet(const T &value) GMX_THROW(APIError("defaultValueIfSet() is not supported with allowMultiple()")); } setFlag(efOption_DefaultValueIfSetExists); - defaultValueIfSet_ = compat::make_unique(value); + defaultValueIfSet_ = std::make_unique(value); } } // namespace gmx diff --git a/src/gromacs/options/repeatingsection.h b/src/gromacs/options/repeatingsection.h index de1cbf6631..175afd8f17 100644 --- a/src/gromacs/options/repeatingsection.h +++ b/src/gromacs/options/repeatingsection.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2018, by the GROMACS development team, led by + * Copyright (c) 2016,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,7 +46,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/options/abstractsection.h" #include "gromacs/options/ioptionscontainerwithsections.h" #include "gromacs/options/isectionstorage.h" @@ -154,7 +153,7 @@ template std::unique_ptr RepeatingOptionSection::createStorage() const { - return compat::make_unique >(*this); + return std::make_unique >(*this); } /*! \brief diff --git a/src/gromacs/pulling/output.cpp b/src/gromacs/pulling/output.cpp index d0503544ad..4f5c58ec9d 100644 --- a/src/gromacs/pulling/output.cpp +++ b/src/gromacs/pulling/output.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -40,8 +40,9 @@ #include +#include + #include "gromacs/commandline/filenm.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/gmxfio.h" #include "gromacs/fileio/xvgr.h" #include "gromacs/math/vec.h" @@ -565,7 +566,7 @@ void initPullHistory(pull_t *pull, /* If pull->coordForceHistory is already set we are starting from a checkpoint. Do not reset it. */ if (observablesHistory->pullHistory == nullptr) { - observablesHistory->pullHistory = gmx::compat::make_unique(); + observablesHistory->pullHistory = std::make_unique(); pull->coordForceHistory = observablesHistory->pullHistory.get(); pull->coordForceHistory->numValuesInXSum = 0; pull->coordForceHistory->numValuesInFSum = 0; diff --git a/src/gromacs/pulling/pull.cpp b/src/gromacs/pulling/pull.cpp index 2b6017d56e..f0f05a0cf4 100644 --- a/src/gromacs/pulling/pull.cpp +++ b/src/gromacs/pulling/pull.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,9 +46,9 @@ #include #include +#include #include "gromacs/commandline/filenm.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/domdec_struct.h" #include "gromacs/domdec/localatomset.h" #include "gromacs/domdec/localatomsetmanager.h" @@ -1896,7 +1896,7 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir, if (group.epgrppbc == epgrppbcREFAT || group.epgrppbc == epgrppbcPREVSTEPCOM) { /* pbcAtomSet consists of a single atom */ - group.pbcAtomSet = gmx::compat::make_unique(atomSets->add({&group.params.pbcatom, &group.params.pbcatom + 1})); + group.pbcAtomSet = std::make_unique(atomSets->add({&group.params.pbcatom, &group.params.pbcatom + 1})); } } } diff --git a/src/gromacs/pulling/pull_rotation.cpp b/src/gromacs/pulling/pull_rotation.cpp index 0e460fe585..2f129777bc 100644 --- a/src/gromacs/pulling/pull_rotation.cpp +++ b/src/gromacs/pulling/pull_rotation.cpp @@ -45,9 +45,9 @@ #include #include +#include #include "gromacs/commandline/filenm.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/dlbtiming.h" #include "gromacs/domdec/domdec_struct.h" #include "gromacs/domdec/ga2la.h" @@ -3604,7 +3604,7 @@ init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[], fprintf(stdout, "%s Initializing ...\n", RotStr); } - auto enforcedRotation = gmx::compat::make_unique(); + auto enforcedRotation = std::make_unique(); gmx_enfrot *er = enforcedRotation->getLegacyEnfrot(); // TODO When this module implements IMdpOptions, the ownership will become more clear. er->rot = ir->rot; @@ -3667,7 +3667,7 @@ init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[], { gmx_enfrotgrp *erg = &ergRef; erg->rotg = &er->rot->grp[groupIndex]; - erg->atomSet = gmx::compat::make_unique(atomSets->add({erg->rotg->ind, erg->rotg->ind + erg->rotg->nat})); + erg->atomSet = std::make_unique(atomSets->add({erg->rotg->ind, erg->rotg->ind + erg->rotg->nat})); erg->groupIndex = groupIndex; if (nullptr != fplog) diff --git a/src/gromacs/restraint/manager.cpp b/src/gromacs/restraint/manager.cpp index 4778286082..780326ebc2 100644 --- a/src/gromacs/restraint/manager.cpp +++ b/src/gromacs/restraint/manager.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -51,7 +51,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/utility/exceptions.h" namespace gmx diff --git a/src/gromacs/restraint/restraintmdmodule.cpp b/src/gromacs/restraint/restraintmdmodule.cpp index c1f9882dc5..590516dfc0 100644 --- a/src/gromacs/restraint/restraintmdmodule.cpp +++ b/src/gromacs/restraint/restraintmdmodule.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -37,7 +37,8 @@ #include "restraintmdmodule.h" -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/mdtypes/forceoutput.h" #include "gromacs/mdtypes/iforceprovider.h" @@ -170,8 +171,8 @@ RestraintMDModuleImpl::~RestraintMDModuleImpl() = default; RestraintMDModuleImpl::RestraintMDModuleImpl(std::shared_ptr restraint, const std::vector &sites) : - forceProvider_(compat::make_unique(restraint, - sites)) + forceProvider_(std::make_unique(restraint, + sites)) { GMX_ASSERT(forceProvider_, "Class invariant implies non-null ForceProvider."); } @@ -218,9 +219,9 @@ std::unique_ptr RestraintMDModule::create(std::shared_ptr restraint, const std::vector &sites) { - auto implementation = compat::make_unique(std::move(restraint), - sites); - auto newModule = compat::make_unique(std::move(implementation)); + auto implementation = std::make_unique(std::move(restraint), + sites); + auto newModule = std::make_unique(std::move(implementation)); return newModule; } diff --git a/src/gromacs/selection/parsetree.cpp b/src/gromacs/selection/parsetree.cpp index 304da3d07f..6f2596c113 100644 --- a/src/gromacs/selection/parsetree.cpp +++ b/src/gromacs/selection/parsetree.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -228,8 +228,8 @@ #include #include +#include -#include "gromacs/compat/make_unique.h" #include "gromacs/selection/selection.h" #include "gromacs/utility/cstringutil.h" #include "gromacs/utility/exceptions.h" @@ -360,7 +360,7 @@ SelectionParserParameter::SelectionParserParameter( const SelectionLocation &location) : name_(name != nullptr ? name : ""), location_(location), - values_(values ? std::move(values) : compat::make_unique()) + values_(values ? std::move(values) : std::make_unique()) { } diff --git a/src/gromacs/selection/parsetree.h b/src/gromacs/selection/parsetree.h index eb8eaa538b..911e0b153a 100644 --- a/src/gromacs/selection/parsetree.h +++ b/src/gromacs/selection/parsetree.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2018, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -56,7 +56,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/math/vec.h" #include "gromacs/math/vectypes.h" #include "gromacs/utility/gmxassert.h" @@ -111,7 +110,7 @@ class SelectionParserValue //! Allocates and initializes an empty value list. static SelectionParserValueListPointer createList() { - return compat::make_unique(); + return std::make_unique(); } /*! \brief * Allocates and initializes a value list with a single value. @@ -322,7 +321,7 @@ class SelectionParserParameter //! Allocates and initializes an empty parameter list. static SelectionParserParameterListPointer createList() { - return compat::make_unique(); + return std::make_unique(); } /*! \brief * Allocates and initializes a parsed method parameter. diff --git a/src/gromacs/selection/selectioncollection.cpp b/src/gromacs/selection/selectioncollection.cpp index 6b96478b87..c2a6218fb8 100644 --- a/src/gromacs/selection/selectioncollection.cpp +++ b/src/gromacs/selection/selectioncollection.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -50,7 +50,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/onlinehelp/helpmanager.h" #include "gromacs/onlinehelp/helpwritercontext.h" #include "gromacs/options/basicoptions.h" @@ -92,7 +91,7 @@ SelectionCollection::Impl::Impl() sc_.top = nullptr; gmx_ana_index_clear(&sc_.gall); sc_.mempool = nullptr; - sc_.symtab = compat::make_unique(); + sc_.symtab = std::make_unique(); gmx_ana_index_clear(&requiredAtoms_); gmx_ana_selmethod_register_defaults(sc_.symtab.get()); } @@ -726,7 +725,7 @@ std::unique_ptr initStatusWriter(TextOutputStream *statusStream) std::unique_ptr statusWriter; if (statusStream != nullptr) { - statusWriter = compat::make_unique(statusStream); + statusWriter = std::make_unique(statusStream); statusWriter->wrapperSettings().setLineLength(78); } return statusWriter; diff --git a/src/gromacs/selection/tests/toputils.cpp b/src/gromacs/selection/tests/toputils.cpp index 5d1ed80ed6..ef6b40403d 100644 --- a/src/gromacs/selection/tests/toputils.cpp +++ b/src/gromacs/selection/tests/toputils.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,8 +46,8 @@ #include #include +#include -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/confio.h" #include "gromacs/fileio/trxio.h" #include "gromacs/math/vec.h" @@ -129,7 +129,7 @@ void TopologyManager::loadTopology(const char *filename) matrix box; GMX_RELEASE_ASSERT(mtop_ == nullptr, "Topology initialized more than once"); - mtop_ = gmx::compat::make_unique(); + mtop_ = std::make_unique(); readConfAndTopology( gmx::test::TestFileManager::getInputFilePath(filename).c_str(), &fullTopology, mtop_.get(), &ePBC, frame_ != nullptr ? &xtop : nullptr, @@ -152,7 +152,7 @@ void TopologyManager::loadTopology(const char *filename) void TopologyManager::initAtoms(int count) { GMX_RELEASE_ASSERT(mtop_ == nullptr, "Topology initialized more than once"); - mtop_ = gmx::compat::make_unique(); + mtop_ = std::make_unique(); mtop_->moltype.resize(1); init_t_atoms(&mtop_->moltype[0].atoms, count, FALSE); mtop_->molblock.resize(1); diff --git a/src/gromacs/swap/swapcoords.cpp b/src/gromacs/swap/swapcoords.cpp index 7df9da3d40..0066183c71 100644 --- a/src/gromacs/swap/swapcoords.cpp +++ b/src/gromacs/swap/swapcoords.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -47,10 +47,10 @@ #include #include +#include #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/domdec/domdec_struct.h" #include "gromacs/domdec/localatomset.h" #include "gromacs/domdec/localatomsetmanager.h" @@ -1559,7 +1559,7 @@ void init_swapcoords( { if (oh->swapHistory == nullptr) { - oh->swapHistory = gmx::compat::make_unique(swaphistory_t {}); + oh->swapHistory = std::make_unique(swaphistory_t {}); } swapstate = oh->swapHistory.get(); diff --git a/src/gromacs/tools/report-methods.cpp b/src/gromacs/tools/report-methods.cpp index c048ed739c..253895ea73 100644 --- a/src/gromacs/tools/report-methods.cpp +++ b/src/gromacs/tools/report-methods.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -241,7 +241,7 @@ const char ReportMethodsInfo::shortDescription[] = "and/or to the standard output."; ICommandLineOptionsModulePointer ReportMethodsInfo::create() { - return ICommandLineOptionsModulePointer(compat::make_unique()); + return ICommandLineOptionsModulePointer(std::make_unique()); } } // namespace gmx diff --git a/src/gromacs/topology/atomprop.cpp b/src/gromacs/topology/atomprop.cpp index 47dd6acea5..16bec32ef9 100644 --- a/src/gromacs/topology/atomprop.cpp +++ b/src/gromacs/topology/atomprop.cpp @@ -44,8 +44,8 @@ #include #include +#include -#include "gromacs/compat/make_unique.h" #include "gromacs/math/functions.h" #include "gromacs/math/utilities.h" #include "gromacs/topology/residuetypes.h" diff --git a/src/gromacs/trajectoryanalysis/modules/angle.cpp b/src/gromacs/trajectoryanalysis/modules/angle.cpp index 74ecf2df9c..d476fa5c13 100644 --- a/src/gromacs/trajectoryanalysis/modules/angle.cpp +++ b/src/gromacs/trajectoryanalysis/modules/angle.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -44,6 +44,7 @@ #include "angle.h" #include +#include #include #include @@ -51,7 +52,6 @@ #include "gromacs/analysisdata/modules/average.h" #include "gromacs/analysisdata/modules/histogram.h" #include "gromacs/analysisdata/modules/plot.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/math/units.h" #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" @@ -319,9 +319,9 @@ Angle::Angle() g1type_(Group1Type_Angle), g2type_(Group2Type_None), binWidth_(1.0), natoms1_(0), natoms2_(0) { - averageModule_ = compat::make_unique(); + averageModule_ = std::make_unique(); angles_.addModule(averageModule_); - histogramModule_ = compat::make_unique(); + histogramModule_ = std::make_unique(); angles_.addModule(histogramModule_); registerAnalysisDataset(&angles_, "angle"); diff --git a/src/gromacs/trajectoryanalysis/modules/distance.cpp b/src/gromacs/trajectoryanalysis/modules/distance.cpp index 6ad5ec183f..ff4bffc430 100644 --- a/src/gromacs/trajectoryanalysis/modules/distance.cpp +++ b/src/gromacs/trajectoryanalysis/modules/distance.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -43,13 +43,13 @@ #include "distance.h" +#include #include #include "gromacs/analysisdata/analysisdata.h" #include "gromacs/analysisdata/modules/average.h" #include "gromacs/analysisdata/modules/histogram.h" #include "gromacs/analysisdata/modules/plot.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" @@ -111,10 +111,10 @@ class Distance : public TrajectoryAnalysisModule Distance::Distance() : meanLength_(0.1), lengthDev_(1.0), binWidth_(0.001), - summaryStatsModule_(compat::make_unique()), - allStatsModule_(compat::make_unique()), - averageModule_(compat::make_unique()), - histogramModule_(compat::make_unique()) + summaryStatsModule_(std::make_unique()), + allStatsModule_(std::make_unique()), + averageModule_(std::make_unique()), + histogramModule_(std::make_unique()) { summaryStatsModule_->setAverageDataSets(true); distances_.addModule(summaryStatsModule_); diff --git a/src/gromacs/trajectoryanalysis/topologyinformation.cpp b/src/gromacs/trajectoryanalysis/topologyinformation.cpp index f7a292e649..c2e8eb2dc3 100644 --- a/src/gromacs/trajectoryanalysis/topologyinformation.cpp +++ b/src/gromacs/trajectoryanalysis/topologyinformation.cpp @@ -43,7 +43,8 @@ #include "topologyinformation.h" -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/fileio/confio.h" #include "gromacs/math/vec.h" #include "gromacs/pbcutil/rmpbc.h" @@ -59,7 +60,7 @@ namespace gmx { TopologyInformation::TopologyInformation() - : mtop_(compat::make_unique()), + : mtop_(std::make_unique()), hasLoadedMtop_(false), expandedTopology_(nullptr), atoms_ (nullptr), @@ -74,7 +75,7 @@ TopologyInformation::~TopologyInformation() void TopologyInformation::fillFromInputFile(const std::string &filename) { - mtop_ = gmx::compat::make_unique(); + mtop_ = std::make_unique(); // TODO When filename is not a .tpr, then using readConfAndAtoms // would be efficient for not doing multiple conversions for // makeAtomsData. However we'd also need to be able to copy the @@ -107,7 +108,7 @@ const gmx_localtop_t *TopologyInformation::expandedTopology() const // Do lazy initialization if (expandedTopology_ == nullptr && hasTopology()) { - expandedTopology_ = gmx::compat::make_unique(); + expandedTopology_ = std::make_unique(); gmx_mtop_generate_local_top(*mtop_, expandedTopology_.get(), false); } diff --git a/src/gromacs/utility/alignedallocator.cpp b/src/gromacs/utility/alignedallocator.cpp index eda7d1bcae..b7b7bf764c 100644 --- a/src/gromacs/utility/alignedallocator.cpp +++ b/src/gromacs/utility/alignedallocator.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2015,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -66,7 +66,6 @@ #include // only for the page size query purposes #endif -#include "gromacs/compat/make_unique.h" #include "gromacs/utility/gmxassert.h" namespace gmx diff --git a/src/gromacs/utility/any.h b/src/gromacs/utility/any.h index 05ece95265..8e9464e422 100644 --- a/src/gromacs/utility/any.h +++ b/src/gromacs/utility/any.h @@ -50,7 +50,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/utility/gmxassert.h" namespace gmx @@ -226,7 +225,7 @@ class Any explicit Content(T &&value) : value_(std::move(value)) {} const std::type_info &typeInfo() const override { return typeid(T); } - std::unique_ptr clone() const override { return compat::make_unique(value_); } + std::unique_ptr clone() const override { return std::make_unique(value_); } T value_; }; diff --git a/src/gromacs/utility/keyvaluetreetransform.cpp b/src/gromacs/utility/keyvaluetreetransform.cpp index ff884942f6..db5879ccf5 100644 --- a/src/gromacs/utility/keyvaluetreetransform.cpp +++ b/src/gromacs/utility/keyvaluetreetransform.cpp @@ -42,7 +42,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/utility/exceptions.h" #include "gromacs/utility/ikeyvaluetreeerror.h" #include "gromacs/utility/keyvaluetreebuilder.h" @@ -325,7 +324,7 @@ class KeyValueTreeTransformerImpl { GMX_RELEASE_ASSERT(rootRule_ == nullptr, "Cannot specify key match type after child rules"); - rootRule_ = compat::make_unique(keyMatchType); + rootRule_ = std::make_unique(keyMatchType); } std::unique_ptr rootRule_; diff --git a/src/programs/mdrun/mdrun.cpp b/src/programs/mdrun/mdrun.cpp index 19826e1e69..5f06e0ad3c 100644 --- a/src/programs/mdrun/mdrun.cpp +++ b/src/programs/mdrun/mdrun.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -52,8 +52,9 @@ */ #include "gmxpre.h" +#include + #include "gromacs/commandline/pargs.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/compat/pointers.h" #include "gromacs/domdec/domdec.h" #include "gromacs/fileio/gmxfio.h" diff --git a/src/programs/mdrun/tests/energyreader.cpp b/src/programs/mdrun/tests/energyreader.cpp index eb4d9d72a8..73c914f8d3 100644 --- a/src/programs/mdrun/tests/energyreader.cpp +++ b/src/programs/mdrun/tests/energyreader.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -50,7 +50,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/fileio/enxio.h" #include "gromacs/trajectory/energyframe.h" #include "gromacs/utility/exceptions.h" @@ -120,8 +119,8 @@ openEnergyFileToReadFields(const std::string &filename, GMX_THROW(APIError(requiredEnergiesNotFound)); } - return EnergyFrameReaderPtr(compat::make_unique(indicesOfEnergyFields, - energyFile.release())); + return EnergyFrameReaderPtr(std::make_unique(indicesOfEnergyFields, + energyFile.release())); } //! Helper function to obtain resources diff --git a/src/programs/mdrun/tests/minimize.cpp b/src/programs/mdrun/tests/minimize.cpp index c35e548915..d4346e1e6a 100644 --- a/src/programs/mdrun/tests/minimize.cpp +++ b/src/programs/mdrun/tests/minimize.cpp @@ -50,7 +50,6 @@ #include -#include "gromacs/compat/make_unique.h" #include "gromacs/options/filenameoption.h" #include "gromacs/topology/idef.h" #include "gromacs/topology/ifunc.h" diff --git a/src/programs/mdrun/tests/normalmodes.cpp b/src/programs/mdrun/tests/normalmodes.cpp index a58da532d6..4e14aba90b 100644 --- a/src/programs/mdrun/tests/normalmodes.cpp +++ b/src/programs/mdrun/tests/normalmodes.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -50,7 +50,6 @@ #include -#include "gromacs/compat/make_unique.h" #include "gromacs/options/filenameoption.h" #include "gromacs/topology/idef.h" #include "gromacs/topology/ifunc.h" diff --git a/src/programs/mdrun/tests/rerun.cpp b/src/programs/mdrun/tests/rerun.cpp index 29d9a49c01..6f97fbdc3d 100644 --- a/src/programs/mdrun/tests/rerun.cpp +++ b/src/programs/mdrun/tests/rerun.cpp @@ -52,7 +52,6 @@ #include -#include "gromacs/compat/make_unique.h" #include "gromacs/options/filenameoption.h" #include "gromacs/topology/idef.h" #include "gromacs/topology/ifunc.h" @@ -188,8 +187,8 @@ void executeRerunTest(TestFileManager *fileManager, }; // Build the manager that will present matching pairs of frames to compare FramePairManager - trajectoryManager(compat::make_unique(normalRunTrajectoryFileName), - compat::make_unique(rerunTrajectoryFileName)); + trajectoryManager(std::make_unique(normalRunTrajectoryFileName), + std::make_unique(rerunTrajectoryFileName)); // Compare the trajectory frames. trajectoryManager.compareAllFramePairs(trajectoryComparator); } diff --git a/src/programs/mdrun/tests/simple_mdrun.cpp b/src/programs/mdrun/tests/simple_mdrun.cpp index b2fb82e12b..10e25a19e9 100644 --- a/src/programs/mdrun/tests/simple_mdrun.cpp +++ b/src/programs/mdrun/tests/simple_mdrun.cpp @@ -51,7 +51,6 @@ #include -#include "gromacs/compat/make_unique.h" #include "gromacs/options/filenameoption.h" #include "gromacs/topology/idef.h" #include "gromacs/topology/ifunc.h" diff --git a/src/testutils/refdata-impl.h b/src/testutils/refdata-impl.h index 440607dc58..93f0798bc4 100644 --- a/src/testutils/refdata-impl.h +++ b/src/testutils/refdata-impl.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,7 +46,6 @@ #include #include -#include "gromacs/compat/make_unique.h" #include "gromacs/utility/gmxassert.h" namespace gmx @@ -63,7 +62,7 @@ class ReferenceDataEntry static EntryPointer createRoot() { - return gmx::compat::make_unique("", ""); + return std::make_unique("", ""); } ReferenceDataEntry(const char *type, const char *id) diff --git a/src/testutils/testinit.cpp b/src/testutils/testinit.cpp index 3b33c1e883..e87b9ea88f 100644 --- a/src/testutils/testinit.cpp +++ b/src/testutils/testinit.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -56,7 +56,6 @@ #include "gromacs/commandline/cmdlineinit.h" #include "gromacs/commandline/cmdlineparser.h" #include "gromacs/commandline/cmdlineprogramcontext.h" -#include "gromacs/compat/make_unique.h" #include "gromacs/math/utilities.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/options.h" @@ -188,7 +187,7 @@ void initTestUtils(const char *dataPath, const char *tempPath, bool usesMpi, { callAddGlobalTestEnvironment(); } - g_testContext = gmx::compat::make_unique(context); + g_testContext = std::make_unique(context); setProgramContext(g_testContext.get()); // Use the default finder that does not respect GMXLIB, since the tests // generally can only get confused by a different set of data files. diff --git a/src/testutils/textblockmatchers.cpp b/src/testutils/textblockmatchers.cpp index de7c06a79a..4f04ce62f3 100644 --- a/src/testutils/textblockmatchers.cpp +++ b/src/testutils/textblockmatchers.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2018, by the GROMACS development team, led by + * Copyright (c) 2015,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -43,7 +43,8 @@ #include "textblockmatchers.h" -#include "gromacs/compat/make_unique.h" +#include + #include "gromacs/utility/gmxregex.h" #include "gromacs/utility/stringstream.h" #include "gromacs/utility/textreader.h" @@ -134,12 +135,12 @@ ITextBlockMatcherSettings::~ITextBlockMatcherSettings() TextBlockMatcherPointer ExactTextMatch::createMatcher() const { - return TextBlockMatcherPointer(compat::make_unique()); + return TextBlockMatcherPointer(std::make_unique()); } TextBlockMatcherPointer NoTextMatch::createMatcher() const { - return TextBlockMatcherPointer(compat::make_unique()); + return TextBlockMatcherPointer(std::make_unique()); } void FilteringExactTextMatch::addRegexToSkip(const std::string &lineToSkip) @@ -149,7 +150,7 @@ void FilteringExactTextMatch::addRegexToSkip(const std::string &lineToSkip) TextBlockMatcherPointer FilteringExactTextMatch::createMatcher() const { - return TextBlockMatcherPointer(compat::make_unique(linesToSkip_)); + return TextBlockMatcherPointer(std::make_unique(linesToSkip_)); } } // namespace test