HiRep 0.1
Loading...
Searching...
No Matches
geometry_omp.h File Reference

This file contains useful macros that perform OpenMP reduction operations and are necessary to define iterations over sites on the lattice. More...

#include "hr_omp.h"
Include dependency graph for geometry_omp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _PIECE_FOR(type, ip)
 Iterate over the pieces of the given geometry.
 
#define _SITE_FOR_RED(type, ip, is, redop1, redop2)
 Reduced iteration over sites of a given piece. Variables given as redop parameters are reduced using an OpenMP reduction sum.
 
#define _SITE_FOR(type, ip, is)
 Iterate over sites of a given piece.
 
#define _SITE_FOR_SUM(type, ip, is, ...)
 Iterate over sites on a given piece and omp-reduce using a sum.
 
#define _SITE_FOR_MAX(type, ip, is, ...)
 Iterate over sites on a given piece and omp-reduce using a max.
 
#define _SITE_FOR_MIN(type, ip, is, ...)
 Iterate over sites on a given piece and omp-reduce using a min. *.
 
#define _MASTER_FOR_RED(type, is, redop1, redop2)
 Reduced iteration over all sites of the local lattice. Variables given as redop parameters will be reduced using an OpenMP reduction sum.
 
#define _MASTER_FOR(type, is)
 Iterate over all sites of the local lattice.
 
#define _MASTER_FOR_SUM(type, is, ...)
 Reduced iteration over all sites of the local lattice and omp-reduce using a sum.
 
#define _MASTER_FOR_MAX(type, is, ...)
 Reduced iteration over all sites of the local lattice and omp-reduce using a max.
 
#define _MASTER_FOR_MIN(type, is, ...)
 Reduced iteration over all sites of the local lattice and omp-reduce using a min.
 
#define _FUSE_FOR_RED(type, ip, is, redop1, redop2)
 Fuse reduced on the current piece FIXME: more desc.
 
#define _FUSE_MASTER_FOR_RED(type, is, redop1, redop2)
 Fuse reduce on the whole local lattice TODO: more desc.
 
#define _ONE_SPINOR_FOR_RED(s, redop1, redop2)
 Iterate over all sites of the local lattice but not by index in memory but by spinor, applying a OpenMP reduction to the other variables. The current spinor can be found using _SPINOR_PTR(s).
 
#define _ONE_SITE_FOR_RED(s, redop1, redop2)
 Iterate over all sites of the local lattice but not by index in memory but by site, applying a OpenMP reduction to the other variables. The current site can be found using _SITE_PTR(s).
 
#define _ONE_SPINOR_FOR_SUM(s, ...)
 Iterate over all sites of the local lattice but not by index in memory but by spinor, applying an OpenMP sum reduction to the other variables. The current spinor can be found using _SPINOR_PTR(s).
 
#define _ONE_SITE_FOR_SUM(s, ...)
 Iterate over all sites of the local lattice but not by index in memory but by site, applying an OpenMP sum reduction to the other variables. The current site can be found using _SITE_PTR(s).
 
#define _ONE_SITE_FOR_MAX(s, ...)
 Iterate over all sites of the local lattice but not by index in memory but by site, applying an OpenMP max reduction to the other variables. The current site can be found using _SITE_PTR(s).
 
#define _TWO_SPINORS_FOR_RED(s1, s2, redop1, redop2)
 Iterate over two corresponding spinors on the given fields, applying an OpenMP reduction operation on the other given variables. The current spinors can be found using _SPINOR_PTR(s1) and _SPINOR_PTR(s2).
 
#define _TWO_SITE_FOR_RED(s1, s2, redop1, redop2)
 Iterate over two corresponding sites on the given fields, applying an OpenMP reduction operation on the other given variables. The current sites can be found using _SITE_PTR(s1) and _SITE_PTR(s2).
 
#define _TWO_SPINORS_FOR_SUM(s1, s2, ...)
 Iterate over two corresponding spinors on the given fields, applying an OpenMP sum reduction on the other given variables. The current spinors can be found using _SPINOR_PTR(s1) and _SPINOR_PTR(s2).
 
#define _TWO_SITE_FOR_SUM(s1, s2, ...)
 Iterate over two corresponding sites on the given fields, applying an OpenMP sum reduction on the other given variables. The current sites can be found using _SITE_PTR(s1) and _SITE_PTR(s2).
 
#define _THREE_SPINORS_FOR_RED(s1, s2, s3, redop1, redop2)
 Iterate over three corresponding spinors on the given fields, applying an OpenMP reduction on the other given variables. The current spinors can be found using _SPINOR_PTR(s1) and _SPINOR_PTR(s2).
 
#define _THREE_SITE_FOR_RED(s1, s2, s3, redop1, redop2)
 Iterate over three corresponding sites on the given fields, applying an OpenMP reduction on the other given variables. The current sites can be found using _SITE_PTR(s1) and _SITE_PTR(s2).
 
#define _ONE_SPINOR_FOR(s)
 Iterate over all sites of the local lattice but not by index in memory but by spinor. The current spinor can be found using _SPINOR_PTR(s).
 
#define _ONE_SITE_FOR(s)
 Iterate over all sites of the local lattice but not by index in memory but by site. The current site can be found using _SITE_PTR(s).
 
#define _TWO_SPINORS_FOR(s1, s2)
 Iterate over two corresponding spinors on the given fields. The current spinors can be found using _SPINOR_PTR(s1) and _SPINOR_PTR(s2).
 
#define _TWO_SITE_FOR(s1, s2)
 Iterate over two corresponding sites on the given fields. The current sites can be found using _SITE_PTR(s1) and _SITE_PTR(s2).
 
#define _THREE_SPINORS_FOR(s1, s2, s3)
 Iterate over all three corresponding spinors on the given fields. The current spinors can be found using _SPINOR_PTR(s1), _SPINOR_PTR(s2), _SPINOR_PTR(s3).
 
#define _THREE_SITE_FOR(s1, s2, s3)
 Iterate over all three corresponding sites on the given fields. The current sites can be found using _SITE_PTR(s1), _SITE_PTR(s2), _SITE_PTR(s3).
 
#define _SPINOR_PTR(s)
 Retrieve current spinor. This macro only works inside _SPINOR_FOR, _TWO_SPINORS_FOR or _THREE_SPINORS_FOR.
 
#define _SITE_PTR(__s, __mu, __dim)
 Retrieve current site. This macro only works inside _SITE_FOR, _TWO_SITE_FOR or _THREE_SITE_FOR.
 

Detailed Description

This file contains useful macros that perform OpenMP reduction operations and are necessary to define iterations over sites on the lattice.

Macro Definition Documentation

◆ _FUSE_FOR_RED

#define _FUSE_FOR_RED ( type,
ip,
is,
redop1,
redop2 )
Value:
_OMP_PRAGMA(_omp_parallel) \
_OMP_PRAGMA(_omp_for redop1 redop2) \
for (int ip = 0; ip < type->fuse_gauge_size; ip++)

Fuse reduced on the current piece FIXME: more desc.

Parameters
typegeometry_descriptor that contains information on the geometry of the local lattice.
ipIdentifying index of the current piece
isLocal variable that runs over all site indices on the given piece.
redop1Variable to reduce
redop2Variable to reduce

◆ _FUSE_MASTER_FOR_RED

#define _FUSE_MASTER_FOR_RED ( type,
is,
redop1,
redop2 )
Value:
_FUSE_FOR_RED((type), _fuse_master_for_ip_##is, is, redop1, redop2)
#define _FUSE_FOR_RED(type, ip, is, redop1, redop2)
Fuse reduced on the current piece FIXME: more desc.
Definition geometry_omp.h:138

Fuse reduce on the whole local lattice TODO: more desc.

Parameters
typegeometry_descriptor that contains information on the geometry of the local lattice.
isLocal variable that runs over all site indices on the given piece.
redop1Variable to reduce
redop2Variable to reduce

◆ _MASTER_FOR

#define _MASTER_FOR ( type,
is )
Value:
_MASTER_FOR_RED(type, is, , )
#define _MASTER_FOR_RED(type, is, redop1, redop2)
Reduced iteration over all sites of the local lattice. Variables given as redop parameters will be re...
Definition geometry_omp.h:88

Iterate over all sites of the local lattice.

Parameters
typegeometry_descriptor that contains information on the geometry of the local lattice
isLocal variable that runs over all site indices

◆ _MASTER_FOR_MAX

#define _MASTER_FOR_MAX ( type,
is,
... )
Value:
_MASTER_FOR_RED(type, is, _omp_max(__VA_ARGS__), )

Reduced iteration over all sites of the local lattice and omp-reduce using a max.

Parameters
typegeometry_descriptor that contains information on the geometry of the local lattice.
isLocal variable that runs over all site indices on the given piece

◆ _MASTER_FOR_MIN

#define _MASTER_FOR_MIN ( type,
is,
... )
Value:
_MASTER_FOR_RED(type, is, _omp_min(__VA_ARGS__), )

Reduced iteration over all sites of the local lattice and omp-reduce using a min.

Parameters
typegeometry_descriptor that contains information on the geometry of the local lattice.
isLocal variable that runs over all site indices on the given piece

◆ _MASTER_FOR_RED

#define _MASTER_FOR_RED ( type,
is,
redop1,
redop2 )
Value:
_PIECE_FOR((type), _master_for_ip_##is) \
_SITE_FOR_RED((type), _master_for_ip_##is, is, redop1, redop2)
#define _PIECE_FOR(type, ip)
Iterate over the pieces of the given geometry.
Definition geometry_omp.h:19

Reduced iteration over all sites of the local lattice. Variables given as redop parameters will be reduced using an OpenMP reduction sum.

Parameters
typegeometry_descriptor that contains information on the geometry of the local and global lattice
isLocal variable that runs over all site indices on the local lattice
redop1Variable to reduce
redop2Variable to reduce

◆ _MASTER_FOR_SUM

#define _MASTER_FOR_SUM ( type,
is,
... )
Value:
_MASTER_FOR_RED(type, is, _omp_sum(__VA_ARGS__), )

Reduced iteration over all sites of the local lattice and omp-reduce using a sum.

Parameters
typegeometry_descriptor that contains information on the geometry of the local lattice.
isLocal variable that runs over all site indices on the given piece

◆ _ONE_SITE_FOR

#define _ONE_SITE_FOR ( s)
Value:
#define _ONE_SITE_FOR_RED(s, redop1, redop2)
Iterate over all sites of the local lattice but not by index in memory but by site,...
Definition geometry_omp.h:174

Iterate over all sites of the local lattice but not by index in memory but by site. The current site can be found using _SITE_PTR(s).

Parameters
sInput field

◆ _ONE_SITE_FOR_MAX

#define _ONE_SITE_FOR_MAX ( s,
... )
Value:
_ONE_SITE_FOR_RED(s, _omp_max(__VA_ARGS__), )

Iterate over all sites of the local lattice but not by index in memory but by site, applying an OpenMP max reduction to the other variables. The current site can be found using _SITE_PTR(s).

Parameters
sInput field
...Variables to reduce

◆ _ONE_SITE_FOR_RED

#define _ONE_SITE_FOR_RED ( s,
redop1,
redop2 )
Value:
_MASTER_FOR_RED((s)->type, _site_for_is, redop1, redop2)

Iterate over all sites of the local lattice but not by index in memory but by site, applying a OpenMP reduction to the other variables. The current site can be found using _SITE_PTR(s).

Parameters
sInput field
redop1Variable to reduce
redop2Variable to reduce

◆ _ONE_SITE_FOR_SUM

#define _ONE_SITE_FOR_SUM ( s,
... )
Value:
_ONE_SITE_FOR_RED(s, _omp_sum(__VA_ARGS__), )

Iterate over all sites of the local lattice but not by index in memory but by site, applying an OpenMP sum reduction to the other variables. The current site can be found using _SITE_PTR(s).

Parameters
sInput field
...Variables to reduce

◆ _ONE_SPINOR_FOR

#define _ONE_SPINOR_FOR ( s)
Value:
#define _ONE_SPINOR_FOR_RED(s, redop1, redop2)
Iterate over all sites of the local lattice but not by index in memory but by spinor,...
Definition geometry_omp.h:163

Iterate over all sites of the local lattice but not by index in memory but by spinor. The current spinor can be found using _SPINOR_PTR(s).

Parameters
sInput spinor field

◆ _ONE_SPINOR_FOR_RED

#define _ONE_SPINOR_FOR_RED ( s,
redop1,
redop2 )
Value:
_MASTER_FOR_RED((s)->type, _spinor_for_is, redop1, redop2)

Iterate over all sites of the local lattice but not by index in memory but by spinor, applying a OpenMP reduction to the other variables. The current spinor can be found using _SPINOR_PTR(s).

Parameters
sInput spinor field
redop1Variable to reduce
redop2Variable to reduce

◆ _ONE_SPINOR_FOR_SUM

#define _ONE_SPINOR_FOR_SUM ( s,
... )
Value:
_ONE_SPINOR_FOR_RED(s, _omp_sum(__VA_ARGS__), )

Iterate over all sites of the local lattice but not by index in memory but by spinor, applying an OpenMP sum reduction to the other variables. The current spinor can be found using _SPINOR_PTR(s).

Parameters
sInput spinor field
...Variables to reduce

◆ _PIECE_FOR

#define _PIECE_FOR ( type,
ip )
Value:
for (int ip = 0; ip < (type)->local_master_pieces; ip++)

Iterate over the pieces of the given geometry.

Parameters
typegeometry_descriptor that contains information on the geometry of the local and global lattice
iplocal variable that denotes the piece index

◆ _SITE_FOR

#define _SITE_FOR ( type,
ip,
is )
Value:
_SITE_FOR_RED(type, ip, is, nowait, )
#define _SITE_FOR_RED(type, ip, is, redop1, redop2)
Reduced iteration over sites of a given piece. Variables given as redop parameters are reduced using ...
Definition geometry_omp.h:33

Iterate over sites of a given piece.

Parameters
typegeometry_descriptor that contains information on the geometry of the local lattice
ipIdentifying index of the current piece
isLocal variable that runs over all site indices on the given piece

◆ _SITE_FOR_MAX

#define _SITE_FOR_MAX ( type,
ip,
is,
... )
Value:
_SITE_FOR_RED(type, ip, is, _omp_max(__VA_ARGS__), )

Iterate over sites on a given piece and omp-reduce using a max.

Parameters
typegeometry_descriptor that contains information on the geometry of the local lattice.
ipIdentifying index of the current piece
islocal variable that runs over all site indices on the given piece

◆ _SITE_FOR_MIN

#define _SITE_FOR_MIN ( type,
ip,
is,
... )
Value:
_SITE_FOR_RED(type, ip, is, _omp_min(__VA_ARGS__), )

Iterate over sites on a given piece and omp-reduce using a min. *.

Parameters
typegeometry_descriptor that contains information on the geometry of the local lattice.
ipIdentifying index of the current piece
islocal variable that runs over all site indices on the given piece

◆ _SITE_FOR_RED

#define _SITE_FOR_RED ( type,
ip,
is,
redop1,
redop2 )
Value:
_OMP_PRAGMA(_omp_parallel) \
_OMP_PRAGMA(_omp_for redop1 redop2) \
for (size_t is = (type)->master_start[ip]; is <= (type)->master_end[ip]; is++)

Reduced iteration over sites of a given piece. Variables given as redop parameters are reduced using an OpenMP reduction sum.

Parameters
typegeometry_descriptor that contains information on the geometry of the local and global lattice
ipIdentifying index of the current piece
isLocal variable that runs over all site indices on the piece
redop1Variable to reduce
redop2Variable to reduce

◆ _SITE_FOR_SUM

#define _SITE_FOR_SUM ( type,
ip,
is,
... )
Value:
_SITE_FOR_RED(type, ip, is, _omp_sum(__VA_ARGS__), )

Iterate over sites on a given piece and omp-reduce using a sum.

Parameters
typegeometry_descriptor that contains information on the geometry of the local lattice.
ipIdentifying index of the current piece
islocal variable that runs over all site indices on the given piece

◆ _SITE_PTR

#define _SITE_PTR ( __s,
__mu,
__dim )
Value:
(_DFIELD_AT(__s, _site_for_is, __mu, __dim))

Retrieve current site. This macro only works inside _SITE_FOR, _TWO_SITE_FOR or _THREE_SITE_FOR.

Parameters
sField that is being iterated over.

◆ _SPINOR_PTR

#define _SPINOR_PTR ( s)
Value:
_FIELD_AT(s, _spinor_for_is)

Retrieve current spinor. This macro only works inside _SPINOR_FOR, _TWO_SPINORS_FOR or _THREE_SPINORS_FOR.

Parameters
sSpinor field that is being iterated over.

◆ _THREE_SITE_FOR

#define _THREE_SITE_FOR ( s1,
s2,
s3 )
Value:
_THREE_SITE_FOR_RED(s1, s2, s3, , )
#define _THREE_SITE_FOR_RED(s1, s2, s3, redop1, redop2)
Iterate over three corresponding sites on the given fields, applying an OpenMP reduction on the other...
Definition geometry_omp.h:281

Iterate over all three corresponding sites on the given fields. The current sites can be found using _SITE_PTR(s1), _SITE_PTR(s2), _SITE_PTR(s3).

Parameters
s1First input spinor field
s2Second input spinor field
s3Third input spinor field

◆ _THREE_SITE_FOR_RED

#define _THREE_SITE_FOR_RED ( s1,
s2,
s3,
redop1,
redop2 )
Value:
_CHECK_GEOMETRY_MATCHING(s1, s3); \
_ONE_SITE_FOR_RED(s1, redop1, redop2)
#define _CHECK_GEOMETRY_MATCHING(s1, s2)
This macro does nothing unless CHECK_SPINOR_MATCHING is defined.
Definition geometry_check.h:115

Iterate over three corresponding sites on the given fields, applying an OpenMP reduction on the other given variables. The current sites can be found using _SITE_PTR(s1) and _SITE_PTR(s2).

Parameters
s1First input field
s2Second input field
redop1Variable to reduce
redop2Variable to reduce

◆ _THREE_SPINORS_FOR

#define _THREE_SPINORS_FOR ( s1,
s2,
s3 )
Value:
_THREE_SPINORS_FOR_RED(s1, s2, s3, , )
#define _THREE_SPINORS_FOR_RED(s1, s2, s3, redop1, redop2)
Iterate over three corresponding spinors on the given fields, applying an OpenMP reduction on the oth...
Definition geometry_omp.h:266

Iterate over all three corresponding spinors on the given fields. The current spinors can be found using _SPINOR_PTR(s1), _SPINOR_PTR(s2), _SPINOR_PTR(s3).

Parameters
s1First input spinor field
s2Second input spinor field
s3Third input spinor field

◆ _THREE_SPINORS_FOR_RED

#define _THREE_SPINORS_FOR_RED ( s1,
s2,
s3,
redop1,
redop2 )
Value:
_TWO_SPINORS_MATCHING(s1, s3); \
_ONE_SPINOR_FOR_RED(s1, redop1, redop2)
#define _TWO_SPINORS_MATCHING(s1, s2)
This macro does nothing unless CHECK_SPINOR_MATCHING is defined.
Definition geometry_check.h:105

Iterate over three corresponding spinors on the given fields, applying an OpenMP reduction on the other given variables. The current spinors can be found using _SPINOR_PTR(s1) and _SPINOR_PTR(s2).

Parameters
s1First input spinor field
s2Second input spinor field
redop1Variable to reduce
redop2Variable to reduce

◆ _TWO_SITE_FOR

#define _TWO_SITE_FOR ( s1,
s2 )
Value:
_TWO_SITE_FOR_RED(s1, s2, , )
#define _TWO_SITE_FOR_RED(s1, s2, redop1, redop2)
Iterate over two corresponding sites on the given fields, applying an OpenMP reduction operation on t...
Definition geometry_omp.h:230

Iterate over two corresponding sites on the given fields. The current sites can be found using _SITE_PTR(s1) and _SITE_PTR(s2).

Parameters
s1First input spinor field
s2Second input spinor field

◆ _TWO_SITE_FOR_RED

#define _TWO_SITE_FOR_RED ( s1,
s2,
redop1,
redop2 )
Value:
_ONE_SITE_FOR_RED(s1, redop1, redop2)

Iterate over two corresponding sites on the given fields, applying an OpenMP reduction operation on the other given variables. The current sites can be found using _SITE_PTR(s1) and _SITE_PTR(s2).

Parameters
s1First input field
s2Second input field
redop1Variable to reduce
redop2Variable to reduce

◆ _TWO_SITE_FOR_SUM

#define _TWO_SITE_FOR_SUM ( s1,
s2,
... )
Value:
_TWO_SITE_FOR_RED(s1, s2, _omp_sum(__VA_ARGS__), )

Iterate over two corresponding sites on the given fields, applying an OpenMP sum reduction on the other given variables. The current sites can be found using _SITE_PTR(s1) and _SITE_PTR(s2).

Parameters
s1First input field
s2Second input field
...Variables to reduce

◆ _TWO_SPINORS_FOR

#define _TWO_SPINORS_FOR ( s1,
s2 )
Value:
#define _TWO_SPINORS_FOR_RED(s1, s2, redop1, redop2)
Iterate over two corresponding spinors on the given fields, applying an OpenMP reduction operation on...
Definition geometry_omp.h:216

Iterate over two corresponding spinors on the given fields. The current spinors can be found using _SPINOR_PTR(s1) and _SPINOR_PTR(s2).

Parameters
s1First input spinor field
s2Second input spinor field

◆ _TWO_SPINORS_FOR_RED

#define _TWO_SPINORS_FOR_RED ( s1,
s2,
redop1,
redop2 )
Value:
_ONE_SPINOR_FOR_RED(s1, redop1, redop2)

Iterate over two corresponding spinors on the given fields, applying an OpenMP reduction operation on the other given variables. The current spinors can be found using _SPINOR_PTR(s1) and _SPINOR_PTR(s2).

Parameters
s1First input spinor field
s2Second input spinor field
redop1Variable to reduce
redop2Variable to reduce

◆ _TWO_SPINORS_FOR_SUM

#define _TWO_SPINORS_FOR_SUM ( s1,
s2,
... )
Value:
_TWO_SPINORS_FOR_RED(s1, s2, _omp_sum(__VA_ARGS__), )

Iterate over two corresponding spinors on the given fields, applying an OpenMP sum reduction on the other given variables. The current spinors can be found using _SPINOR_PTR(s1) and _SPINOR_PTR(s2).

Parameters
s1First input spinor field
s2Second input spinor field
...Variables to reduce