mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Renamed the namespace to Grid
This commit is contained in:
parent
06843d4574
commit
0c5c974e6d
2
Grid.h
2
Grid.h
@ -50,7 +50,7 @@
|
|||||||
#include <Grid_Lattice.h>
|
#include <Grid_Lattice.h>
|
||||||
#include <Grid_QCD.h>
|
#include <Grid_QCD.h>
|
||||||
|
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
|
|
||||||
void Grid_init(int *argc,char ***argv);
|
void Grid_init(int *argc,char ***argv);
|
||||||
double usecond(void);
|
double usecond(void);
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
|
|
||||||
#include <Grid.h>
|
#include <Grid.h>
|
||||||
#include <Grid_Communicator.h>
|
#include <Grid_Communicator.h>
|
||||||
namespace dpo{
|
namespace Grid{
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Grid Support. Following will go into Grid.h.
|
// Grid Support. Following will go into Grid.h.
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Cartesian grids
|
// Cartesian grids
|
||||||
// dpo::Grid
|
// Grid::Grid
|
||||||
// dpo::GridCartesian
|
// Grid::GridCartesian
|
||||||
// dpo::GridCartesianRedBlack
|
// Grid::GridCartesianRedBlack
|
||||||
|
|
||||||
|
|
||||||
class SimdGrid : public CartesianCommunicator {
|
class SimdGrid : public CartesianCommunicator {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#ifdef GRID_COMMS_MPI
|
#ifdef GRID_COMMS_MPI
|
||||||
#include <mpi.h>
|
#include <mpi.h>
|
||||||
#endif
|
#endif
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
class CartesianCommunicator {
|
class CartesianCommunicator {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
|
|
||||||
// Permute the pointers 32bitx16 = 512
|
// Permute the pointers 32bitx16 = 512
|
||||||
static int permute_map[4][16] = {
|
static int permute_map[4][16] = {
|
||||||
@ -37,22 +37,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include <Grid_cshift_common.h>
|
#include <Grid_cshift.h>
|
||||||
|
|
||||||
#ifdef GRID_COMMS_NONE
|
|
||||||
#include <Grid_none_cshift.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef GRID_COMMS_FAKE
|
|
||||||
#include <Grid_fake_cshift.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef GRID_COMMS_MPI
|
|
||||||
#include <Grid_mpi_cshift.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// overloading dpo::conformable but no conformable in dpo ...?:w
|
// overloading Grid::conformable but no conformable in Grid ...?:w
|
||||||
template<class obj1,class obj2>
|
template<class obj1,class obj2>
|
||||||
friend void conformable(const Lattice<obj1> &lhs,const Lattice<obj2> &rhs);
|
friend void conformable(const Lattice<obj1> &lhs,const Lattice<obj2> &rhs);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef GRID_QCD_H
|
#ifndef GRID_QCD_H
|
||||||
#define GRID_QCD_H
|
#define GRID_QCD_H
|
||||||
namespace dpo{
|
namespace Grid{
|
||||||
namespace QCD {
|
namespace QCD {
|
||||||
|
|
||||||
static const int Nc=3;
|
static const int Nc=3;
|
||||||
@ -89,5 +89,5 @@ namespace QCD {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} //namespace QCD
|
} //namespace QCD
|
||||||
} // dpo
|
} // Grid
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef GRID_ALIGNED_ALLOCATOR_H
|
#ifndef GRID_ALIGNED_ALLOCATOR_H
|
||||||
#define GRID_ALIGNED_ALLOCATOR_H
|
#define GRID_ALIGNED_ALLOCATOR_H
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// A lattice of something, but assume the something is SIMDized.
|
// A lattice of something, but assume the something is SIMDized.
|
||||||
@ -52,5 +52,5 @@ template<typename _Tp> inline bool
|
|||||||
operator!=(const alignedAllocator<_Tp>&, const alignedAllocator<_Tp>&){ return false; }
|
operator!=(const alignedAllocator<_Tp>&, const alignedAllocator<_Tp>&){ return false; }
|
||||||
|
|
||||||
|
|
||||||
}; // namespace dpo
|
}; // namespace Grid
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "Grid.h"
|
#include "Grid.h"
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
|
|
||||||
CartesianCommunicator::CartesianCommunicator(std::vector<int> &processors)
|
CartesianCommunicator::CartesianCommunicator(std::vector<int> &processors)
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "Grid.h"
|
#include "Grid.h"
|
||||||
|
|
||||||
#undef __X86_64
|
#undef __X86_64
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
|
|
||||||
void Grid_init(int *argc,char ***argv)
|
void Grid_init(int *argc,char ***argv)
|
||||||
{
|
{
|
||||||
|
12
Grid_main.cc
12
Grid_main.cc
@ -7,8 +7,8 @@
|
|||||||
#include "Grid_Lattice.h"
|
#include "Grid_Lattice.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace dpo;
|
using namespace Grid;
|
||||||
using namespace dpo::QCD;
|
using namespace Grid::QCD;
|
||||||
|
|
||||||
|
|
||||||
int main (int argc, char ** argv)
|
int main (int argc, char ** argv)
|
||||||
@ -175,10 +175,10 @@ int main (int argc, char ** argv)
|
|||||||
double t0,t1,flops;
|
double t0,t1,flops;
|
||||||
double bytes;
|
double bytes;
|
||||||
int ncall=100;
|
int ncall=100;
|
||||||
int Nc = dpo::QCD::Nc;
|
int Nc = Grid::QCD::Nc;
|
||||||
|
|
||||||
flops = ncall*1.0*volume*(8*Nc*Nc*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);
|
printf("%f flop and %f bytes\n",flops,bytes/ncall);
|
||||||
FooBar = Foo * Bar;
|
FooBar = Foo * Bar;
|
||||||
t0=usecond();
|
t0=usecond();
|
||||||
@ -195,7 +195,7 @@ int main (int argc, char ** argv)
|
|||||||
mult(FooBar,Foo,Bar);
|
mult(FooBar,Foo,Bar);
|
||||||
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();
|
t0=usecond();
|
||||||
for(int i=0;i<ncall;i++){
|
for(int i=0;i<ncall;i++){
|
||||||
mult(FooBar,Foo,Cshift(Bar,1,-2));
|
mult(FooBar,Foo,Cshift(Bar,1,-2));
|
||||||
@ -244,7 +244,7 @@ int main (int argc, char ** argv)
|
|||||||
for(coor[1]=0;coor[1]<latt_size[1]/mpi_layout[1];coor[1]++){
|
for(coor[1]=0;coor[1]<latt_size[1]/mpi_layout[1];coor[1]++){
|
||||||
for(coor[0]=0;coor[0]<latt_size[0]/mpi_layout[0];coor[0]++){
|
for(coor[0]=0;coor[0]<latt_size[0]/mpi_layout[0];coor[0]++){
|
||||||
|
|
||||||
std::complex<dpo::Real> diff;
|
std::complex<Grid::Real> diff;
|
||||||
|
|
||||||
std::vector<int> shiftcoor = coor;
|
std::vector<int> shiftcoor = coor;
|
||||||
shiftcoor[dir]=(shiftcoor[dir]+shift+latt_size[dir])%(latt_size[dir]/mpi_layout[dir]);
|
shiftcoor[dir]=(shiftcoor[dir]+shift+latt_size[dir])%(latt_size[dir]/mpi_layout[dir]);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef GRID_MATH_TYPES_H
|
#ifndef GRID_MATH_TYPES_H
|
||||||
#define GRID_MATH_TYPES_H
|
#define GRID_MATH_TYPES_H
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "Grid.h"
|
#include "Grid.h"
|
||||||
#include <mpi.h>
|
#include <mpi.h>
|
||||||
|
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
|
|
||||||
// Should error check all MPI calls.
|
// Should error check all MPI calls.
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
|
|
||||||
typedef float RealF;
|
typedef float RealF;
|
||||||
typedef double RealD;
|
typedef double RealD;
|
||||||
@ -57,7 +57,7 @@ namespace dpo {
|
|||||||
inline RealF localInnerProduct(const RealF & l, const RealF & r) { return l*r; }
|
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.
|
//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); };
|
inline void mac (ComplexD * __restrict__ y,const ComplexD * __restrict__ a,const ComplexD *__restrict__ x){ *y = (*a) * (*x)+(*y); };
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "Grid.h"
|
#include "Grid.h"
|
||||||
#include "Grid_vComplexF.h"
|
#include "Grid_vComplexF.h"
|
||||||
|
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
class vComplexD {
|
class vComplexD {
|
||||||
protected:
|
protected:
|
||||||
zvec v;
|
zvec v;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define VCOMPLEXF
|
#define VCOMPLEXF
|
||||||
#include "Grid.h"
|
#include "Grid.h"
|
||||||
|
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
class vComplexF {
|
class vComplexF {
|
||||||
protected:
|
protected:
|
||||||
cvec v;
|
cvec v;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "Grid.h"
|
#include "Grid.h"
|
||||||
|
|
||||||
namespace dpo{
|
namespace Grid {
|
||||||
class vRealD {
|
class vRealD {
|
||||||
protected:
|
protected:
|
||||||
dvec v; // dvec is double precision vector
|
dvec v; // dvec is double precision vector
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "Grid.h"
|
#include "Grid.h"
|
||||||
|
|
||||||
namespace dpo {
|
namespace Grid {
|
||||||
class vRealF {
|
class vRealF {
|
||||||
protected:
|
protected:
|
||||||
fvec v;
|
fvec v;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user