From 0c5c974e6d5a24e68424ca8121bea337e400b8f7 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Fri, 3 Apr 2015 05:29:54 +0100 Subject: [PATCH] Renamed the namespace to Grid --- Grid.h | 2 +- Grid_Cartesian.h | 8 ++++---- Grid_Communicator.h | 2 +- Grid_Lattice.h | 19 +++---------------- Grid_QCD.h | 4 ++-- Grid_aligned_allocator.h | 4 ++-- Grid_fake.cc | 2 +- Grid_init.cc | 2 +- Grid_main.cc | 12 ++++++------ Grid_math_types.h | 2 +- Grid_mpi.cc | 2 +- Grid_simd.h | 4 ++-- Grid_vComplexD.h | 2 +- Grid_vComplexF.h | 2 +- Grid_vRealD.h | 2 +- Grid_vRealF.h | 2 +- 16 files changed, 29 insertions(+), 42 deletions(-) diff --git a/Grid.h b/Grid.h index cc8b36c6..184e7e36 100644 --- a/Grid.h +++ b/Grid.h @@ -50,7 +50,7 @@ #include #include -namespace dpo { +namespace Grid { void Grid_init(int *argc,char ***argv); double usecond(void); diff --git a/Grid_Cartesian.h b/Grid_Cartesian.h index 908d08a8..ced06825 100644 --- a/Grid_Cartesian.h +++ b/Grid_Cartesian.h @@ -3,15 +3,15 @@ #include #include -namespace dpo{ +namespace Grid{ ///////////////////////////////////////////////////////////////////////////////////////// // Grid Support. Following will go into Grid.h. ///////////////////////////////////////////////////////////////////////////////////////// // Cartesian grids - // dpo::Grid - // dpo::GridCartesian - // dpo::GridCartesianRedBlack + // Grid::Grid + // Grid::GridCartesian + // Grid::GridCartesianRedBlack class SimdGrid : public CartesianCommunicator { diff --git a/Grid_Communicator.h b/Grid_Communicator.h index 19e25167..4f83da34 100644 --- a/Grid_Communicator.h +++ b/Grid_Communicator.h @@ -6,7 +6,7 @@ #ifdef GRID_COMMS_MPI #include #endif -namespace dpo { +namespace Grid { class CartesianCommunicator { public: diff --git a/Grid_Lattice.h b/Grid_Lattice.h index fcff36eb..6219235a 100644 --- a/Grid_Lattice.h +++ b/Grid_Lattice.h @@ -5,7 +5,7 @@ -namespace dpo { +namespace Grid { // Permute the pointers 32bitx16 = 512 static int permute_map[4][16] = { @@ -37,22 +37,9 @@ public: } -#include - -#ifdef GRID_COMMS_NONE -#include -#endif - -#ifdef GRID_COMMS_FAKE -#include -#endif - -#ifdef GRID_COMMS_MPI -#include -#endif - +#include - // overloading dpo::conformable but no conformable in dpo ...?:w + // overloading Grid::conformable but no conformable in Grid ...?:w template friend void conformable(const Lattice &lhs,const Lattice &rhs); diff --git a/Grid_QCD.h b/Grid_QCD.h index e51e2641..f6cc6087 100644 --- a/Grid_QCD.h +++ b/Grid_QCD.h @@ -1,6 +1,6 @@ #ifndef GRID_QCD_H #define GRID_QCD_H -namespace dpo{ +namespace Grid{ namespace QCD { static const int Nc=3; @@ -89,5 +89,5 @@ namespace QCD { return ret; } } //namespace QCD -} // dpo +} // Grid #endif diff --git a/Grid_aligned_allocator.h b/Grid_aligned_allocator.h index 6040c233..dbaa0ba3 100644 --- a/Grid_aligned_allocator.h +++ b/Grid_aligned_allocator.h @@ -1,6 +1,6 @@ #ifndef GRID_ALIGNED_ALLOCATOR_H #define GRID_ALIGNED_ALLOCATOR_H -namespace dpo { +namespace Grid { //////////////////////////////////////////////////////////////////// // A lattice of something, but assume the something is SIMDized. @@ -52,5 +52,5 @@ template inline bool operator!=(const alignedAllocator<_Tp>&, const alignedAllocator<_Tp>&){ return false; } -}; // namespace dpo +}; // namespace Grid #endif diff --git a/Grid_fake.cc b/Grid_fake.cc index abc54c8e..83d5475e 100644 --- a/Grid_fake.cc +++ b/Grid_fake.cc @@ -1,5 +1,5 @@ #include "Grid.h" -namespace dpo { +namespace Grid { CartesianCommunicator::CartesianCommunicator(std::vector &processors) { diff --git a/Grid_init.cc b/Grid_init.cc index 4f7d1849..3a601209 100755 --- a/Grid_init.cc +++ b/Grid_init.cc @@ -14,7 +14,7 @@ #include "Grid.h" #undef __X86_64 -namespace dpo { +namespace Grid { void Grid_init(int *argc,char ***argv) { diff --git a/Grid_main.cc b/Grid_main.cc index 795ea395..504f7778 100644 --- a/Grid_main.cc +++ b/Grid_main.cc @@ -7,8 +7,8 @@ #include "Grid_Lattice.h" using namespace std; -using namespace dpo; -using namespace dpo::QCD; +using namespace Grid; +using namespace Grid::QCD; int main (int argc, char ** argv) @@ -175,10 +175,10 @@ int main (int argc, char ** argv) double t0,t1,flops; double bytes; int ncall=100; - int Nc = dpo::QCD::Nc; + int Nc = Grid::QCD::Nc; flops = ncall*1.0*volume*(8*Nc*Nc*Nc); - bytes = ncall*1.0*volume*Nc*Nc *2*3*sizeof(dpo::Real); + bytes = ncall*1.0*volume*Nc*Nc *2*3*sizeof(Grid::Real); printf("%f flop and %f bytes\n",flops,bytes/ncall); FooBar = Foo * Bar; t0=usecond(); @@ -195,7 +195,7 @@ int main (int argc, char ** argv) mult(FooBar,Foo,Bar); FooBar = Foo * Bar; - bytes = ncall*1.0*volume*Nc*Nc *2*5*sizeof(dpo::Real); + bytes = ncall*1.0*volume*Nc*Nc *2*5*sizeof(Grid::Real); t0=usecond(); for(int i=0;i diff; + std::complex diff; std::vector shiftcoor = coor; shiftcoor[dir]=(shiftcoor[dir]+shift+latt_size[dir])%(latt_size[dir]/mpi_layout[dir]); diff --git a/Grid_math_types.h b/Grid_math_types.h index e5387f12..533ce424 100644 --- a/Grid_math_types.h +++ b/Grid_math_types.h @@ -1,6 +1,6 @@ #ifndef GRID_MATH_TYPES_H #define GRID_MATH_TYPES_H -namespace dpo { +namespace Grid { diff --git a/Grid_mpi.cc b/Grid_mpi.cc index 6cda0f1b..e00e3dce 100644 --- a/Grid_mpi.cc +++ b/Grid_mpi.cc @@ -1,7 +1,7 @@ #include "Grid.h" #include -namespace dpo { +namespace Grid { // Should error check all MPI calls. diff --git a/Grid_simd.h b/Grid_simd.h index bef21bcf..b5d34d4a 100644 --- a/Grid_simd.h +++ b/Grid_simd.h @@ -38,7 +38,7 @@ // -namespace dpo { +namespace Grid { typedef float RealF; typedef double RealD; @@ -57,7 +57,7 @@ namespace dpo { inline RealF localInnerProduct(const RealF & l, const RealF & r) { return l*r; } //////////////////////////////////////////////////////////////////////////////// - //Provide support functions for basic real and complex data types required by dpo + //Provide support functions for basic real and complex data types required by Grid //Single and double precision versions. Should be able to template this once only. //////////////////////////////////////////////////////////////////////////////// inline void mac (ComplexD * __restrict__ y,const ComplexD * __restrict__ a,const ComplexD *__restrict__ x){ *y = (*a) * (*x)+(*y); }; diff --git a/Grid_vComplexD.h b/Grid_vComplexD.h index 15dc00c6..f575f3ad 100644 --- a/Grid_vComplexD.h +++ b/Grid_vComplexD.h @@ -3,7 +3,7 @@ #include "Grid.h" #include "Grid_vComplexF.h" -namespace dpo { +namespace Grid { class vComplexD { protected: zvec v; diff --git a/Grid_vComplexF.h b/Grid_vComplexF.h index 0b4f5e61..6c3e9eac 100644 --- a/Grid_vComplexF.h +++ b/Grid_vComplexF.h @@ -2,7 +2,7 @@ #define VCOMPLEXF #include "Grid.h" -namespace dpo { +namespace Grid { class vComplexF { protected: cvec v; diff --git a/Grid_vRealD.h b/Grid_vRealD.h index e5d3d4c6..34150e4b 100644 --- a/Grid_vRealD.h +++ b/Grid_vRealD.h @@ -3,7 +3,7 @@ #include "Grid.h" -namespace dpo{ +namespace Grid { class vRealD { protected: dvec v; // dvec is double precision vector diff --git a/Grid_vRealF.h b/Grid_vRealF.h index db74b005..94875f7e 100644 --- a/Grid_vRealF.h +++ b/Grid_vRealF.h @@ -3,7 +3,7 @@ #include "Grid.h" -namespace dpo { +namespace Grid { class vRealF { protected: fvec v;