Grid 0.7.0
instantiation Directory Reference

Directories

 
GparityWilsonImplD
 
GparityWilsonImplF
 
SpWilsonImplD
 
SpWilsonImplF
 
SpWilsonTwoIndexAntiSymmetricImplD
 
SpWilsonTwoIndexAntiSymmetricImplF
 
SpWilsonTwoIndexSymmetricImplD
 
SpWilsonTwoIndexSymmetricImplF
 
StaggeredImplD
 
StaggeredImplF
 
WilsonAdjImplD
 
WilsonAdjImplF
 
WilsonImplD
 
WilsonImplD2
 
WilsonImplF
 
WilsonTwoIndexAntiSymmetricImplD
 
WilsonTwoIndexAntiSymmetricImplF
 
WilsonTwoIndexSymmetricImplD
 
WilsonTwoIndexSymmetricImplF
 
ZWilsonImplD
 
ZWilsonImplD2
 
ZWilsonImplF

Files

 
ImprovedStaggeredFermion5DInstantiation.cc
 
ImprovedStaggeredFermionInstantiation.cc
 
NaiveStaggeredFermionInstantiation.cc
 
StaggeredKernelsInstantiation.cc
 
WilsonFermion5DInstantiation.cc
 
WilsonFermionInstantiation.cc
 
WilsonKernelsInstantiation.cc
 
WilsonKernelsInstantiationAsm.cc

Detailed Description

Fermion instantiations

The subdirectories in this directory are procedurally generated by generate_instantiations.sh.

This script is never run by the build system; if you need to add new instantiations (or remove them), you need to run it by hand. The results of running this script should be committed to the repository; the subdirectories in this directory are the results of a previous run.

You should not need to touch the files in this directory unless you need to modify the set of instantiations built into Grid (for example, enabling a new representation or gauge group for a given type of fermion). If you do need to do this, then the information below may be useful.

Making changes

If the set of instantiations to build is expanded, this script must be edited, and then run manually from this directory as

./generate_instantiations.sh

If instantiations are removed from the list, then all subdirectories should be removed before running the script:

rm -r */ # Note the trailing /; we only want to remove subdirectories
./generate_instantiations.sh

If you require a type of fermion in your code that is not in the set instantiated here, you have two options:

  1. Follow the instructions above to expand the set, optionally add typedefs to Fermion.h, then rebuild Grid.
  2. Explicitly instantiate the requisite fermion in your own code, using the same structure used here.

Note that not all instantiations here are always built by Grid. See the --enable-fermion-reps and --enable-fermion-instantiations options to configure.

What this does

A directory is created for each implementation (e.g. Wilson or Staggered, $SU(N)$ or $Sp(2n)$, fundamental or higher representation). Inside this, a symbolic link is created for each target kernel (e.g. Wilson, Wilson clover, Mobius EOFA, etc. for Wilson implementations; naïve and improved for staggered fermions) to a common file.

For example, WilsonImplF/WilsonFermionInstantiationWilsonImplF.cc links to WilsonFermionInstantiation.cc.master in this directory.

Additionally, a file impl.h is created defining the attributes of the implementation that differ from one subdirectory to another. This is #included from the symlinked .cc files.

The ultimate effect of all this is to create a line like:

template class WilsonFermion<WilsonImplF>;

Using this setup of symbolic links and separate files allows each instantiation to be compiled separately, in parallel using make -j, rather than using macros or other setups to put them all in one file. Since the instantiations are by far the most expensive part of Grid to compile, this gives significant time savings.