diff --git a/Hadrons/Modules/MDistil/Distil.hpp b/Hadrons/Modules/MDistil/Distil.hpp index ca5b3de8..3b889aa4 100644 --- a/Hadrons/Modules/MDistil/Distil.hpp +++ b/Hadrons/Modules/MDistil/Distil.hpp @@ -30,9 +30,6 @@ #ifndef Hadrons_MDistil_Distil_hpp_ #define Hadrons_MDistil_Distil_hpp_ -#define _USE_MATH_DEFINES -#include - #include #include #include @@ -72,15 +69,13 @@ struct DistilParameters: Serializable { int, TI, int, LI, int, SI ) - DistilParameters() = default; - DistilParameters( const DistilParameters &p ) = default; // member-wise copy }; /****************************************************************************** Make a lower dimensional grid in preparation for local slice operations ******************************************************************************/ -inline GridCartesian * MakeLowerDimGrid( GridCartesian * gridHD ) +inline void MakeLowerDimGrid( std::unique_ptr &up, GridCartesian * gridHD ) { int nd{static_cast(gridHD->_ndimension)}; Coordinate latt_size = gridHD->_gdimensions; @@ -89,8 +84,7 @@ inline GridCartesian * MakeLowerDimGrid( GridCartesian * gridHD ) simd_layout.push_back( 1 ); Coordinate mpi_layout = gridHD->_processors; mpi_layout[nd-1] = 1; - GridCartesian * gridLD = new GridCartesian(latt_size,simd_layout,mpi_layout,*gridHD); - return gridLD; + up.reset( new GridCartesian(latt_size,simd_layout,mpi_layout,*gridHD) ); } /************************************************************************************* diff --git a/Hadrons/Modules/MDistil/DistilVectors.hpp b/Hadrons/Modules/MDistil/DistilVectors.hpp index 8866b875..de871a64 100644 --- a/Hadrons/Modules/MDistil/DistilVectors.hpp +++ b/Hadrons/Modules/MDistil/DistilVectors.hpp @@ -137,7 +137,7 @@ void TDistilVectors::setup(void) simd_layout_3.push_back( 1 ); mpi_layout[Nd-1] = 1; GridCartesian * const grid4d{env().getGrid()}; - grid3d.reset(MakeLowerDimGrid(grid4d)); + MakeLowerDimGrid(grid3d, grid4d); envTmp(LatticeSpinColourVector, "source4d",1,LatticeSpinColourVector(grid4d)); envTmp(LatticeSpinColourVector, "source3d",1,LatticeSpinColourVector(grid3d.get())); @@ -170,7 +170,6 @@ void TDistilVectors::execute(void) const int Nt_inv{ full_tdil ? 1 : dp.TI }; int vecindex; - int t_inv; if (!RhoName.empty()) { auto &rho = envGet(std::vector, RhoName); diff --git a/Hadrons/Modules/MDistil/LapEvec.hpp b/Hadrons/Modules/MDistil/LapEvec.hpp index 83e44c76..80ac25df 100644 --- a/Hadrons/Modules/MDistil/LapEvec.hpp +++ b/Hadrons/Modules/MDistil/LapEvec.hpp @@ -142,7 +142,7 @@ template void TLapEvec::setup(void) { GridCartesian * gridHD = env().getGrid(); - gridLD.reset(MakeLowerDimGrid(gridHD)); + MakeLowerDimGrid(gridLD,gridHD); const int Ntlocal{gridHD->LocalDimensions()[Tdir]}; // Temporaries envTmpLat(GaugeField, "Umu_stout"); @@ -305,7 +305,7 @@ void TLapEvec::execute(void) } GridLogIRL.Active( PreviousIRLLogState ); gridHD->GlobalSum(ConvergenceErrors); - if(!ConvergenceErrors==0) + if(ConvergenceErrors!=0) { HADRONS_ERROR(Program,"The eingensolver failed to find enough eigenvectors on at least one node"); } diff --git a/Hadrons/Modules/MDistil/PerambFromSolve.hpp b/Hadrons/Modules/MDistil/PerambFromSolve.hpp index 29745751..11721eb6 100644 --- a/Hadrons/Modules/MDistil/PerambFromSolve.hpp +++ b/Hadrons/Modules/MDistil/PerambFromSolve.hpp @@ -112,7 +112,7 @@ void TPerambFromSolve::setup(void) const int Nt{env().getDim(Tdir)}; const bool full_tdil{ dp.TI == Nt }; const int Nt_inv{ full_tdil ? 1 : dp.TI }; - grid3d.reset( MakeLowerDimGrid( env().getGrid() ) ); + MakeLowerDimGrid( grid3d, env().getGrid() ); const int nvec_reduced{par().nvec_reduced}; const int LI_reduced{ par().LI_reduced}; envCreate(PerambTensor, getName(), 1, Nt,nvec_reduced,LI_reduced,dp.nnoise,Nt_inv,dp.SI); diff --git a/Hadrons/Modules/MDistil/Perambulator.hpp b/Hadrons/Modules/MDistil/Perambulator.hpp index 2ffaf6fc..fb9d16dc 100644 --- a/Hadrons/Modules/MDistil/Perambulator.hpp +++ b/Hadrons/Modules/MDistil/Perambulator.hpp @@ -99,7 +99,7 @@ std::vector TPerambulator::getOutput(void) template void TPerambulator::setup(void) { - grid3d.reset( MakeLowerDimGrid( env().getGrid() ) ); + MakeLowerDimGrid(grid3d, env().getGrid()); const DistilParameters &dp = envGet(DistilParameters, par().DistilParams); const int Nt{env().getDim(Tdir)}; const bool full_tdil{ dp.TI == Nt };