Grid 0.7.0
SpaceTimeGrid.cc
Go to the documentation of this file.
1/*************************************************************************************
2
3 Grid physics library, www.github.com/paboyle/Grid
4
5 Source file: ./lib/qcd/utils/SpaceTimeGrid.cc
6
7 Copyright (C) 2015
8
9Author: Peter Boyle <paboyle@ph.ed.ac.uk>
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License along
22 with this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25 See the full license in the file "LICENSE" in the top level distribution directory
26*************************************************************************************/
27/* END LEGAL */
28#include <Grid/GridCore.h>
29#include <Grid/GridQCDcore.h>
30
32
34// Public interface
37{
38 return new GridCartesian(latt,simd,mpi);
39}
45{
46 Coordinate simd(4,1);
47 return makeFourDimGrid(latt,simd,mpi);
48}
50{
51 int N4=FourDimGrid->_ndimension;
52
53 Coordinate latt5(1,Ls);
54 Coordinate simd5(1,1);
55 Coordinate mpi5(1,1);
56
57 for(int d=0;d<N4;d++){
58 latt5.push_back(FourDimGrid->_fdimensions[d]);
59 simd5.push_back(FourDimGrid->_simd_layout[d]);
60 mpi5.push_back(FourDimGrid->_processors[d]);
61 }
62 return new GridCartesian(latt5,simd5,mpi5,*FourDimGrid);
63}
64
65
67{
68 int N4=FourDimGrid->_ndimension;
69 int cbd=1;
70 Coordinate cb5(1,0);
71 for(int d=0;d<N4;d++){
72 cb5.push_back( 1);
73 }
74 GridCartesian *tmp = makeFiveDimGrid(Ls,FourDimGrid);
75 GridRedBlackCartesian *ret = new GridRedBlackCartesian(tmp,cb5,cbd);
76 delete tmp;
77 return ret;
78}
79
80
82{
83 int N4 = FourDimGrid->_ndimension;
84 int nsimd = FourDimGrid->Nsimd();
85
86 Coordinate latt5(1,Ls);
87 Coordinate simd5(1,nsimd);
88 Coordinate mpi5(1,1);
89
90 for(int d=0;d<N4;d++){
91 latt5.push_back(FourDimGrid->_fdimensions[d]);
92 simd5.push_back(1);
93 mpi5.push_back(FourDimGrid->_processors[d]);
94 }
95 return new GridCartesian(latt5,simd5,mpi5,*FourDimGrid);
96}
97
98// Interface is inefficient and forces the deletion
99// Pass in the non-redblack grid
102{
103 int N4=FourDimGrid->_ndimension;
104 int cbd=1;
105 Coordinate cb5(1,0);
106 for(int d=0;d<N4;d++){
107 cb5.push_back(1);
108 }
109 GridCartesian *tmp = makeFiveDimDWFGrid(Ls,FourDimGrid);
110 GridRedBlackCartesian *ret = new GridRedBlackCartesian(tmp,cb5,cbd);
111 delete tmp;
112 return ret;
113}
114
AcceleratorVector< int, MaxDims > Coordinate
Definition Coordinate.h:95
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
accelerator_inline void push_back(const value &val)
Definition Coordinate.h:69
Coordinate _fdimensions
Coordinate _simd_layout
int Nsimd(void) const
static GridCartesian * makeFourDimDWFGrid(const Coordinate &latt, const Coordinate &mpi)
static GridCartesian * makeFiveDimDWFGrid(int Ls, const GridCartesian *FourDimGrid)
static GridRedBlackCartesian * makeFourDimRedBlackGrid(const GridCartesian *FourDimGrid)
static GridCartesian * makeFiveDimGrid(int Ls, const GridCartesian *FourDimGrid)
static GridCartesian * makeFourDimGrid(const Coordinate &latt, const Coordinate &simd, const Coordinate &mpi)
static GridRedBlackCartesian * makeFiveDimDWFRedBlackGrid(int Ls, const GridCartesian *FourDimGrid)
static GridRedBlackCartesian * makeFiveDimRedBlackGrid(int Ls, const GridCartesian *FourDimGrid)