1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 01:05:38 +01:00

Renamed the namespace to Grid

This commit is contained in:
Peter Boyle 2015-04-03 05:29:54 +01:00
parent 06843d4574
commit 0c5c974e6d
16 changed files with 29 additions and 42 deletions

2
Grid.h
View File

@ -50,7 +50,7 @@
#include <Grid_Lattice.h>
#include <Grid_QCD.h>
namespace dpo {
namespace Grid {
void Grid_init(int *argc,char ***argv);
double usecond(void);

View File

@ -3,15 +3,15 @@
#include <Grid.h>
#include <Grid_Communicator.h>
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 {

View File

@ -6,7 +6,7 @@
#ifdef GRID_COMMS_MPI
#include <mpi.h>
#endif
namespace dpo {
namespace Grid {
class CartesianCommunicator {
public:

View File

@ -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 <Grid_cshift_common.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
#include <Grid_cshift.h>
// overloading dpo::conformable but no conformable in dpo ...?:w
// overloading Grid::conformable but no conformable in Grid ...?:w
template<class obj1,class obj2>
friend void conformable(const Lattice<obj1> &lhs,const Lattice<obj2> &rhs);

View File

@ -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

View File

@ -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<typename _Tp> inline bool
operator!=(const alignedAllocator<_Tp>&, const alignedAllocator<_Tp>&){ return false; }
}; // namespace dpo
}; // namespace Grid
#endif

View File

@ -1,5 +1,5 @@
#include "Grid.h"
namespace dpo {
namespace Grid {
CartesianCommunicator::CartesianCommunicator(std::vector<int> &processors)
{

View File

@ -14,7 +14,7 @@
#include "Grid.h"
#undef __X86_64
namespace dpo {
namespace Grid {
void Grid_init(int *argc,char ***argv)
{

View File

@ -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<ncall;i++){
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[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;
shiftcoor[dir]=(shiftcoor[dir]+shift+latt_size[dir])%(latt_size[dir]/mpi_layout[dir]);

View File

@ -1,6 +1,6 @@
#ifndef GRID_MATH_TYPES_H
#define GRID_MATH_TYPES_H
namespace dpo {
namespace Grid {

View File

@ -1,7 +1,7 @@
#include "Grid.h"
#include <mpi.h>
namespace dpo {
namespace Grid {
// Should error check all MPI calls.

View File

@ -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); };

View File

@ -3,7 +3,7 @@
#include "Grid.h"
#include "Grid_vComplexF.h"
namespace dpo {
namespace Grid {
class vComplexD {
protected:
zvec v;

View File

@ -2,7 +2,7 @@
#define VCOMPLEXF
#include "Grid.h"
namespace dpo {
namespace Grid {
class vComplexF {
protected:
cvec v;

View File

@ -3,7 +3,7 @@
#include "Grid.h"
namespace dpo{
namespace Grid {
class vRealD {
protected:
dvec v; // dvec is double precision vector

View File

@ -3,7 +3,7 @@
#include "Grid.h"
namespace dpo {
namespace Grid {
class vRealF {
protected:
fvec v;