su2hmc
Loading...
Searching...
No Matches
sizes.h File Reference

Defines the constants of the code and other parameters for loop dimensions. Each subroutine includes these definitions using: More...

#include <complex.h>
Include dependency graph for sizes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define Complex_f   float complex
 Single precision complex number.
 
#define Complex   double complex
 Double precision complex number.
 
#define FILELEN   64
 Default file name length.
 
#define nx   12
 Lattice x extent.
 
#define ny   nx
 Lattice y extent. We normally use cubic lattices so this is the same as nx.
 
#define nz   nx
 Lattice z extent. We normally use cubic lattices so this is the same as nx.
 
#define nt   16
 Lattice temporal extent. This also corresponds to the inverse temperature.
 
#define gvol   (nx*ny*nz*nt)
 Lattice volume.
 
#define gvol3   (nx*ny*nz)
 Lattice spatial volume.
 
#define npx   2
 Processor grid x extent. This must be a divisor of nx.
 
#define npy   npx
 Processor grid y extent.
 
#define npz   npx
 Processor grid z extent.
 
#define npt   2
 Processor grid t extent.
 
#define nproc   (npx*npy*npz*npt)
 Number of processors for MPI.
 
#define nthreads   16
 /Number of threads for OpenMP, which can be overwritten at runtime
 
#define ksizex   (nx/npx)
 Sublattice x extent.
 
#define ksizey   (ny/npy)
 Sublattice y extent.
 
#define ksizez   (nz/npz)
 Sublattice z extent.
 
#define ksize   ksizex
 Sublattice spatial extent for a cubic lattice.
 
#define ksizet   (nt/npt)
 Sublattice t extent.
 
#define nf   1
 Fermion flavours (double it)
 
#define kvol   (ksizet*ksizez*ksizey*ksizex)
 Sublattice volume.
 
#define kvol3   (ksizez*ksizey*ksizex)
 Sublattice spatial volume.
 
#define niterc   gvol3
 Hard limit for runaway trajectories in Conjugate gradient.
 
#define nc   2
 Colours.
 
#define nadj   3
 adjacent spatial indices
 
#define ndirac   4
 Dirac indices.
 
#define ndim   4
 Dimensions.
 
#define ngorkov   8
 Gor'kov indices.
 
#define kmom   (ndim*nadj*kvol)
 sublattice momentum sites
 
#define kferm   (nc*ngorkov*kvol)
 sublattice size including Gor'kov indices
 
#define kferm2   (nc*ndirac*kvol)
 sublattice size including Dirac indices
 
#define halox   0
 x Halo size
 
#define haloy   0
 y Halo size
 
#define haloz   0
 z Halo size
 
#define halot   0
 t Halo size
 
#define halo   (2*(halox+haloy+haloz+halot))
 Total Halo size.
 
#define kfermHalo   (nc*ngorkov*(kvol+halo))
 Gor'kov lattice and halo.
 
#define kferm2Halo   (nc*ndirac*(kvol+halo))
 Dirac lattice and halo.
 
#define kmomHalo   (ndim*nadj*(kvol+halo))
 Momentum lattice and halo.
 
#define respbp   1E-6
 Conjugate gradient residue for \(\langle\bar{\Psi}\Psi\rangle\).
 
#define rescgg   1E-6
 Conjugate gradient residue for update.
 
#define rescga   1E-9
 Conjugate gradient residue for acceptance.
 
#define AVX   16
 Alignment of arrays. 64 for AVX-512, 32 for AVX/AVX2. 16 for SSE. Since AVX is standard on modern x86 machines I've called it that.
 

Detailed Description

Defines the constants of the code and other parameters for loop dimensions. Each subroutine includes these definitions using:

INCLUDE sizes.h  

Or at least they used to. But this is the C version, so no need for that. Include once in each source file and it should work just fine.

The only potential snag is that including the header makes its content global in scope. Where this could cause an issue we shall instead declare the variable inside the function and its scope shall override that of the global variable.

I've tried keeping the comments as close to the original as possible. Of course some magic numbers will be redundant and some will need to be added or redefined. Anything that was commented out has been left commented out with a second C commented out version beneath it.

Author
D. Lawlor September 2020

Macro Definition Documentation

◆ AVX

#define AVX   16

Alignment of arrays. 64 for AVX-512, 32 for AVX/AVX2. 16 for SSE. Since AVX is standard on modern x86 machines I've called it that.

◆ Complex

#define Complex   double complex

Double precision complex number.

◆ Complex_f

#define Complex_f   float complex

Single precision complex number.

◆ FILELEN

#define FILELEN   64

Default file name length.

◆ gvol

#define gvol   (nx*ny*nz*nt)

Lattice volume.

◆ gvol3

#define gvol3   (nx*ny*nz)

Lattice spatial volume.

◆ halo

#define halo   (2*(halox+haloy+haloz+halot))

Total Halo size.

◆ halot

#define halot   0

t Halo size

◆ halox

#define halox   0

x Halo size

MPI Halos

For those who may not have used MPI Before, halos are just a bit of padding we put outside of the sublattices we're using in MPI so we can look at terms outside the sublattice we're actively working on with that process.

◆ haloy

#define haloy   0

y Halo size

◆ haloz

#define haloz   0

z Halo size

◆ kferm

#define kferm   (nc*ngorkov*kvol)

sublattice size including Gor'kov indices

◆ kferm2

#define kferm2   (nc*ndirac*kvol)

sublattice size including Dirac indices

◆ kferm2Halo

#define kferm2Halo   (nc*ndirac*(kvol+halo))

Dirac lattice and halo.

◆ kfermHalo

#define kfermHalo   (nc*ngorkov*(kvol+halo))

Gor'kov lattice and halo.

◆ kmom

#define kmom   (ndim*nadj*kvol)

sublattice momentum sites

◆ kmomHalo

#define kmomHalo   (ndim*nadj*(kvol+halo))

Momentum lattice and halo.

◆ ksize

#define ksize   ksizex

Sublattice spatial extent for a cubic lattice.

◆ ksizet

#define ksizet   (nt/npt)

Sublattice t extent.

◆ ksizex

#define ksizex   (nx/npx)

Sublattice x extent.

◆ ksizey

#define ksizey   (ny/npy)

Sublattice y extent.

◆ ksizez

#define ksizez   (nz/npz)

Sublattice z extent.

◆ kvol

#define kvol   (ksizet*ksizez*ksizey*ksizex)

Sublattice volume.

◆ kvol3

#define kvol3   (ksizez*ksizey*ksizex)

Sublattice spatial volume.

◆ nadj

#define nadj   3

adjacent spatial indices

◆ nc

#define nc   2

Colours.

◆ ndim

#define ndim   4

Dimensions.

◆ ndirac

#define ndirac   4

Dirac indices.

◆ nf

#define nf   1

Fermion flavours (double it)

◆ ngorkov

#define ngorkov   8

Gor'kov indices.

◆ niterc

#define niterc   gvol3

Hard limit for runaway trajectories in Conjugate gradient.

◆ nproc

#define nproc   (npx*npy*npz*npt)

Number of processors for MPI.

◆ npt

#define npt   2

Processor grid t extent.

◆ npx

#define npx   2

Processor grid x extent. This must be a divisor of nx.

◆ npy

#define npy   npx

Processor grid y extent.

◆ npz

#define npz   npx

Processor grid z extent.

◆ nt

#define nt   16

Lattice temporal extent. This also corresponds to the inverse temperature.

◆ nthreads

#define nthreads   16

/Number of threads for OpenMP, which can be overwritten at runtime

◆ nx

#define nx   12

Lattice x extent.

◆ ny

#define ny   nx

Lattice y extent. We normally use cubic lattices so this is the same as nx.

◆ nz

#define nz   nx

Lattice z extent. We normally use cubic lattices so this is the same as nx.

◆ rescga

#define rescga   1E-9

Conjugate gradient residue for acceptance.

◆ rescgg

#define rescgg   1E-6

Conjugate gradient residue for update.

◆ respbp

#define respbp   1E-6

Conjugate gradient residue for \(\langle\bar{\Psi}\Psi\rangle\).