mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-20 00:36:55 +01:00
Merge branch 'develop' into feature/hirep
This commit is contained in:
@ -1,83 +1,69 @@
|
||||
|
||||
bin_PROGRAMS += Test_cf_coarsen_support Test_checker Test_contfrac_even_odd Test_cshift_red_black Test_cshift_red_black_rotate Test_cshift_rotate Test_dwf_even_odd Test_dwf_rb5d Test_gamma Test_GaugeAction Test_gparity Test_gpwilson_even_odd Test_lie_generators Test_main Test_quenched_update Test_RectPlaq Test_rng Test_rng_fixed Test_wilson_even_odd Test_wilson_tm_even_odd
|
||||
|
||||
tests: Test_cf_coarsen_support Test_checker Test_contfrac_even_odd Test_cshift_red_black Test_cshift_red_black_rotate Test_cshift_rotate Test_dwf_even_odd Test_dwf_rb5d Test_fft Test_fftf Test_gamma Test_GaugeAction Test_gparity Test_gpwilson_even_odd Test_lie_generators Test_main Test_quenched_update Test_RectPlaq Test_rng Test_rng_fixed Test_wilson_even_odd Test_wilson_tm_even_odd
|
||||
EXTRA_PROGRAMS = Test_cf_coarsen_support Test_checker Test_contfrac_even_odd Test_cshift_red_black Test_cshift_red_black_rotate Test_cshift_rotate Test_dwf_even_odd Test_dwf_rb5d Test_fft Test_fftf Test_gamma Test_GaugeAction Test_gparity Test_gpwilson_even_odd Test_lie_generators Test_main Test_quenched_update Test_RectPlaq Test_rng Test_rng_fixed Test_wilson_even_odd Test_wilson_tm_even_odd
|
||||
|
||||
Test_cf_coarsen_support_SOURCES=Test_cf_coarsen_support.cc
|
||||
Test_cf_coarsen_support_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_checker_SOURCES=Test_checker.cc
|
||||
Test_checker_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_contfrac_even_odd_SOURCES=Test_contfrac_even_odd.cc
|
||||
Test_contfrac_even_odd_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_cshift_red_black_SOURCES=Test_cshift_red_black.cc
|
||||
Test_cshift_red_black_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_cshift_red_black_rotate_SOURCES=Test_cshift_red_black_rotate.cc
|
||||
Test_cshift_red_black_rotate_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_cshift_rotate_SOURCES=Test_cshift_rotate.cc
|
||||
Test_cshift_rotate_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_dwf_even_odd_SOURCES=Test_dwf_even_odd.cc
|
||||
Test_dwf_even_odd_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_dwf_rb5d_SOURCES=Test_dwf_rb5d.cc
|
||||
Test_dwf_rb5d_LDADD=-lGrid
|
||||
|
||||
Test_fft_SOURCES=Test_fft.cc
|
||||
Test_fft_LDADD=-lGrid
|
||||
|
||||
Test_fftf_SOURCES=Test_fftf.cc
|
||||
Test_fftf_LDADD=-lGrid
|
||||
|
||||
Test_gamma_SOURCES=Test_gamma.cc
|
||||
Test_gamma_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_GaugeAction_SOURCES=Test_GaugeAction.cc
|
||||
Test_GaugeAction_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_gparity_SOURCES=Test_gparity.cc
|
||||
Test_gparity_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_gpwilson_even_odd_SOURCES=Test_gpwilson_even_odd.cc
|
||||
Test_gpwilson_even_odd_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_lie_generators_SOURCES=Test_lie_generators.cc
|
||||
Test_lie_generators_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_main_SOURCES=Test_main.cc
|
||||
Test_main_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_quenched_update_SOURCES=Test_quenched_update.cc
|
||||
Test_quenched_update_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_RectPlaq_SOURCES=Test_RectPlaq.cc
|
||||
Test_RectPlaq_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_rng_SOURCES=Test_rng.cc
|
||||
Test_rng_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_rng_fixed_SOURCES=Test_rng_fixed.cc
|
||||
Test_rng_fixed_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_wilson_even_odd_SOURCES=Test_wilson_even_odd.cc
|
||||
Test_wilson_even_odd_LDADD=-lGrid
|
||||
|
||||
|
||||
Test_wilson_tm_even_odd_SOURCES=Test_wilson_tm_even_odd.cc
|
||||
Test_wilson_tm_even_odd_LDADD=-lGrid
|
||||
|
||||
|
@ -1,19 +1 @@
|
||||
# additional include paths necessary to compile the C++ library
|
||||
|
||||
bin_PROGRAMS =
|
||||
SUBDIRS =
|
||||
|
||||
AM_CXXFLAGS = -I$(top_srcdir)/include
|
||||
AM_LDFLAGS = -L$(top_builddir)/lib
|
||||
|
||||
if USE_LAPACK
|
||||
AM_CXXFLAGS += -DUSE_LAPACK
|
||||
if USE_LAPACK_LIB
|
||||
#if test "X${ac_LAPACK}X" != XyesX
|
||||
AM_CXXFLAGS += -I$(ac_LAPACK)/include
|
||||
AM_LDFLAGS += -L$(ac_LAPACK)/lib
|
||||
#fi
|
||||
endif
|
||||
endif
|
||||
|
||||
include Make.inc
|
||||
|
111
tests/core/Test_fft.cc
Normal file
111
tests/core/Test_fft.cc
Normal file
@ -0,0 +1,111 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: ./tests/Test_cshift.cc
|
||||
|
||||
Copyright (C) 2015
|
||||
|
||||
Author: Azusa Yamaguchi <ayamaguc@staffmail.ed.ac.uk>
|
||||
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Grid.h>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Grid::QCD;
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
{
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
int threads = GridThread::GetThreads();
|
||||
std::cout<<GridLogMessage << "Grid is setup to use "<<threads<<" threads"<<std::endl;
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout( { vComplexD::Nsimd(),1,1,1});
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
|
||||
int vol = 1;
|
||||
for(int d=0;d<latt_size.size();d++){
|
||||
vol = vol * latt_size[d];
|
||||
}
|
||||
GridCartesian Fine(latt_size,simd_layout,mpi_layout);
|
||||
|
||||
LatticeComplexD one(&Fine);
|
||||
LatticeComplexD zz(&Fine);
|
||||
LatticeComplexD C(&Fine);
|
||||
LatticeComplexD Ctilde(&Fine);
|
||||
LatticeComplexD coor(&Fine);
|
||||
|
||||
LatticeSpinMatrixD S(&Fine);
|
||||
LatticeSpinMatrixD Stilde(&Fine);
|
||||
|
||||
std::vector<int> p({1,2,3,2});
|
||||
|
||||
one = ComplexD(1.0,0.0);
|
||||
zz = ComplexD(0.0,0.0);
|
||||
|
||||
ComplexD ci(0.0,1.0);
|
||||
|
||||
C=zero;
|
||||
for(int mu=0;mu<4;mu++){
|
||||
RealD TwoPiL = M_PI * 2.0/ latt_size[mu];
|
||||
LatticeCoordinate(coor,mu);
|
||||
C = C - (TwoPiL * p[mu]) * coor;
|
||||
}
|
||||
|
||||
C = exp(C*ci);
|
||||
|
||||
S=zero;
|
||||
S = S+C;
|
||||
|
||||
FFT theFFT(&Fine);
|
||||
|
||||
theFFT.FFT_dim(Ctilde,C,0,FFT::forward); C=Ctilde; std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Ctilde,C,1,FFT::forward); C=Ctilde; std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Ctilde,C,2,FFT::forward); C=Ctilde; std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Ctilde,C,3,FFT::forward); std::cout << theFFT.MFlops()<<std::endl;
|
||||
|
||||
// C=zero;
|
||||
// Ctilde = where(abs(Ctilde)<1.0e-10,C,Ctilde);
|
||||
TComplexD cVol;
|
||||
cVol()()() = vol;
|
||||
|
||||
C=zero;
|
||||
pokeSite(cVol,C,p);
|
||||
C=C-Ctilde;
|
||||
std::cout << "diff scalar "<<norm2(C) << std::endl;
|
||||
|
||||
theFFT.FFT_dim(Stilde,S,0,FFT::forward); S=Stilde; std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Stilde,S,1,FFT::forward); S=Stilde;std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Stilde,S,2,FFT::forward); S=Stilde;std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Stilde,S,3,FFT::forward);std::cout << theFFT.MFlops()<<std::endl;
|
||||
|
||||
SpinMatrixD Sp;
|
||||
Sp = zero; Sp = Sp+cVol;
|
||||
|
||||
S=zero;
|
||||
pokeSite(Sp,S,p);
|
||||
|
||||
S= S-Stilde;
|
||||
std::cout << "diff FT[SpinMat] "<<norm2(S) << std::endl;
|
||||
|
||||
Grid_finalize();
|
||||
}
|
111
tests/core/Test_fftf.cc
Normal file
111
tests/core/Test_fftf.cc
Normal file
@ -0,0 +1,111 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: ./tests/Test_cshift.cc
|
||||
|
||||
Copyright (C) 2015
|
||||
|
||||
Author: Azusa Yamaguchi <ayamaguc@staffmail.ed.ac.uk>
|
||||
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Grid.h>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Grid::QCD;
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
{
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
int threads = GridThread::GetThreads();
|
||||
std::cout<<GridLogMessage << "Grid is setup to use "<<threads<<" threads"<<std::endl;
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout( { vComplexF::Nsimd(),1,1,1});
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
|
||||
int vol = 1;
|
||||
for(int d=0;d<latt_size.size();d++){
|
||||
vol = vol * latt_size[d];
|
||||
}
|
||||
GridCartesian Fine(latt_size,simd_layout,mpi_layout);
|
||||
|
||||
LatticeComplexF one(&Fine);
|
||||
LatticeComplexF zz(&Fine);
|
||||
LatticeComplexF C(&Fine);
|
||||
LatticeComplexF Ctilde(&Fine);
|
||||
LatticeComplexF coor(&Fine);
|
||||
|
||||
LatticeSpinMatrixF S(&Fine);
|
||||
LatticeSpinMatrixF Stilde(&Fine);
|
||||
|
||||
std::vector<int> p({1,2,3,2});
|
||||
|
||||
one = ComplexF(1.0,0.0);
|
||||
zz = ComplexF(0.0,0.0);
|
||||
|
||||
ComplexF ci(0.0,1.0);
|
||||
|
||||
C=zero;
|
||||
for(int mu=0;mu<4;mu++){
|
||||
RealD TwoPiL = M_PI * 2.0/ latt_size[mu];
|
||||
LatticeCoordinate(coor,mu);
|
||||
C = C - (TwoPiL * p[mu]) * coor;
|
||||
}
|
||||
|
||||
C = exp(C*ci);
|
||||
|
||||
S=zero;
|
||||
S = S+C;
|
||||
|
||||
FFT theFFT(&Fine);
|
||||
|
||||
theFFT.FFT_dim(Ctilde,C,0,FFT::forward); C=Ctilde; std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Ctilde,C,1,FFT::forward); C=Ctilde; std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Ctilde,C,2,FFT::forward); C=Ctilde; std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Ctilde,C,3,FFT::forward); std::cout << theFFT.MFlops()<<std::endl;
|
||||
|
||||
// C=zero;
|
||||
// Ctilde = where(abs(Ctilde)<1.0e-10,C,Ctilde);
|
||||
TComplexF cVol;
|
||||
cVol()()() = vol;
|
||||
|
||||
C=zero;
|
||||
pokeSite(cVol,C,p);
|
||||
C=C-Ctilde;
|
||||
std::cout << "diff scalar "<<norm2(C) << std::endl;
|
||||
|
||||
theFFT.FFT_dim(Stilde,S,0,FFT::forward); S=Stilde; std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Stilde,S,1,FFT::forward); S=Stilde;std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Stilde,S,2,FFT::forward); S=Stilde;std::cout << theFFT.MFlops()<<std::endl;
|
||||
theFFT.FFT_dim(Stilde,S,3,FFT::forward);std::cout << theFFT.MFlops()<<std::endl;
|
||||
|
||||
SpinMatrixF Sp;
|
||||
Sp = zero; Sp = Sp+cVol;
|
||||
|
||||
S=zero;
|
||||
pokeSite(Sp,S,p);
|
||||
|
||||
S= S-Stilde;
|
||||
std::cout << "diff FT[SpinMat] "<<norm2(S) << std::endl;
|
||||
|
||||
Grid_finalize();
|
||||
}
|
Reference in New Issue
Block a user