Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
e425485
add code for heavy-light tetraquark computations
mpflaumer Oct 4, 2022
d5a4f26
Merge branch 'master' into old-state
mpflaumer Oct 4, 2022
e241d0e
Merge branch 'master' into old-state
mpflaumer Oct 4, 2022
a01e8c8
start merging with current QUDA develop
pittlerf Oct 5, 2022
f31adba
small progress in the compilation of current develop QUDA
pittlerf Oct 10, 2022
543f385
include target cuda
pittlerf Oct 10, 2022
7bf7678
added codes and kernels for Soft Function and TMDPDFs with one-end an…
Oct 13, 2022
3084a48
Delete .#WallSourceNucleon.shexit
sbacchio Oct 13, 2022
d6bb238
Delete .#slurm-243497.out
sbacchio Oct 13, 2022
368f609
replacing checkCudaError with checkQudaError
pittlerf Oct 18, 2022
a630d62
remove artificial files
pittlerf Oct 18, 2022
49b9212
Merge branch 'master' of github.com:cylqcd/PLEGMA into softfunctionTM…
sbacchio Oct 19, 2022
643b1c0
Correcting time_step
sbacchio Oct 19, 2022
e2d4fc3
defining QUDA_PRECISION
pittlerf Oct 25, 2022
6f0a8c8
including checkQudaError in PLEGMA_BLAS.h
pittlerf Oct 25, 2022
b439586
including get_stream for creating process id
pittlerf Oct 25, 2022
b5f46e5
adding the location of get_stream
pittlerf Oct 25, 2022
c2560b9
updating QUDA_interface.cpp
pittlerf Oct 25, 2022
eb7fb72
removing non-longer existed parameters in inv_param
pittlerf Oct 25, 2022
6772da0
using device::get_stream instead of target::cuda::get_stream
pittlerf Oct 25, 2022
6d9382e
restoring compilation
pittlerf Oct 25, 2022
e93e1e8
restoring compilation
pittlerf Oct 25, 2022
4e186f5
renaming clover to clover_term
pittlerf Oct 25, 2022
92bc63b
correcting typo in documentation
pittlerf Oct 26, 2022
cbf4412
getting compiled
pittlerf Oct 27, 2022
61463d8
replacing functions needed default topology
pittlerf Nov 2, 2022
64e1600
replacing functions needed default topology 2
pittlerf Nov 2, 2022
0a24cca
merging PLEGMA_Field.cu
pittlerf Nov 6, 2022
bf16b3d
replacing checkCudaError with checkQudaError
pittlerf Nov 6, 2022
a55e8c8
Merge remote-tracking branch 'origin/heavy_light_tetraquark' into HEAD
pittlerf Nov 7, 2022
1bfcd10
correcting time_step for tetraquarks kernel
pittlerf Nov 7, 2022
98413ce
replacing cudaMalloc with device_malloc
pittlerf Nov 8, 2022
40b27d1
correcting typos
pittlerf Nov 10, 2022
4341bb0
Merge branch 'master' of github.com:cylqcd/PLEGMA into heavy_light_te…
mpflaumer Nov 14, 2022
5f06b35
adding python scripts
mpflaumer Nov 14, 2022
a6516d6
Merge remote-tracking branch 'origin/heavy_light_tetraquark' into hip…
pittlerf Nov 14, 2022
42e59da
correcting possible error in M diagrams for NJN -pion and correcting …
pittlerf Nov 15, 2022
e557e51
compiliting tetraquarks kernels only when udsc baryons are set
pittlerf Nov 18, 2022
8c18dbc
replacing cudaMalloc with quda-s device_malloc
pittlerf Nov 18, 2022
f03e892
momentum setting for the threept functions Npi =J = Npi
pittlerf Nov 18, 2022
13f6016
continue hipify
pittlerf Nov 21, 2022
92677e9
update nucleon 2pt 3pt
pittlerf Nov 21, 2022
2c6edb8
continue hipify
pittlerf Nov 21, 2022
93c3174
pack propagator as sink routine to the library
pittlerf Dec 5, 2022
55c5688
adding packing routines for fermions
pittlerf Dec 6, 2022
56bf3fb
correcting pack_fermion_to_sink
pittlerf Dec 6, 2022
db3716b
N J Npi calculation
pittlerf Dec 9, 2022
c936036
B,W diagrams for N- J-Npi
pittlerf Dec 11, 2022
e8268e5
working on the threept functions
pittlerf Dec 11, 2022
b24d676
removing debug printf
pittlerf Dec 12, 2022
188ffad
changing the order of propagators in M7/M8 Thanks Yan
pittlerf Dec 12, 2022
971790a
correcting comm_get_rank_from_coords
pittlerf Dec 12, 2022
82fd193
version for xcheck with Yan Li
pittlerf Dec 12, 2022
b6a55e8
correcting from source to sink and as sink for both PLEGMA Vector and…
pittlerf Dec 13, 2022
54539c6
including Z_diagrams for std vectors of ScattCorrelator object
pittlerf Dec 13, 2022
9a17957
including Z diagrams
pittlerf Dec 13, 2022
509d7a4
do not store the final diagrams for all source sink separations
pittlerf Dec 13, 2022
2d67903
correcting typos and small mistakes
pittlerf Dec 13, 2022
fc1dbbf
V3 kernel for all the insertion gammas, correcting meson gamma initial
pittlerf Dec 13, 2022
0c88675
temporary solution for Z diagrams in the NJNpi case
pittlerf Dec 14, 2022
46f1722
setting the fermion always unsmeared at the insertion and smeared at …
pittlerf Dec 14, 2022
4ae45e6
correcting some typos
pittlerf Dec 14, 2022
8a5a76c
correcting error in packing
pittlerf Dec 15, 2022
7f101da
including boundary condition for the 3pt function
pittlerf Dec 15, 2022
540baae
correcting typos including some debugging
pittlerf Dec 15, 2022
33b350a
correcting typo
pittlerf Dec 16, 2022
444d31f
adding load after each copy from HOST
pittlerf Dec 16, 2022
bb33f98
free some memory place with quda device free
pittlerf Dec 16, 2022
3fe9a8a
apply the correct Boundary condition and correct some typos
pittlerf Dec 16, 2022
8f0585f
small rewriting of from_source_to_sink routine for propagators
pittlerf Dec 18, 2022
f30163e
correcting two bugs: 1 in the absorb of doing the point to all, anoth…
pittlerf Dec 18, 2022
47df23f
before V2,V4 reduction in B,W diagrams pack stochastic propagators to…
pittlerf Dec 19, 2022
2761c87
Z diagrams without oet
pittlerf Dec 22, 2022
ec9b98d
adding possibility mom column 3 in V3V2reductions for Diagrams NjNpi
pittlerf Dec 23, 2022
8b8e09f
correcting smearing
pittlerf Dec 23, 2022
a0247f7
adding 2pt functions
pittlerf Dec 29, 2022
d7b6daa
Z diagram for 3pt now with gamma_f2 calculated
pittlerf Dec 30, 2022
da2d1ec
wrapper functions for memcpy and memset in order to avoid tuning prob…
pittlerf Jan 11, 2023
6fc8708
replacing qudaMemcpy and memset with the PLEGMA ones where needed
pittlerf Jan 11, 2023
9ed0967
correcting packing routines and include static bool variable to do th…
pittlerf Jan 13, 2023
101abea
correcting boundary Sign for 3pt function
pittlerf Jan 13, 2023
deabb21
static variable added
pittlerf Jan 13, 2023
fc62bac
typo corrected
pittlerf Jan 13, 2023
307e9a5
recent changes in nucleon 3pt code
pittlerf Jan 19, 2023
4c9a63d
removing verbose and unnecessary lines
pittlerf Jan 19, 2023
67f1619
correcting default sign of P for the V4,V2 reduction
pittlerf Jan 19, 2023
3277bb7
removing debug printf
pittlerf Feb 10, 2023
b47290b
moving writiing out N0 outside pi2 loop, thanks Yan
pittlerf Feb 10, 2023
521fcf1
correct name fOR M diagrams
pittlerf Feb 10, 2023
34edaa1
remove debug absorb function no longer needed
pittlerf Feb 20, 2023
95af29e
Change in the absorb function; defined a direction of the staple in t…
May 1, 2023
3c6c43d
merging
May 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
include(CheckIncludeFileCXX)
include(CheckSymbolExists)

Expand Down Expand Up @@ -33,6 +33,16 @@ endif()
FIND_LIBRARY(QUDA_LIB quda ${QUDA_HOME}/lib)
include_directories(SYSTEM ${QUDA_HOME}/include)

set(QUDA_PRECISION
"14"
CACHE STRING "which precisions to instantiate in QUDA (4-bit number - double, single, half, quarter)")
set(QUDA_RECONSTRUCT
"7"
CACHE STRING "which reconstructs to instantiate in QUDA (3-bit number - 18, 13/12, 9/8)")
add_definitions(-DQUDA_PRECISION=${QUDA_PRECISION})
add_definitions(-DQUDA_RECONSTRUCT=${QUDA_RECONSTRUCT})


set(QUDA_SRC "" CACHE PATH "path to QUDA src directory")
if("${QUDA_SRC}" STREQUAL "")
message( FATAL_ERROR "QUDA_SRC must be defined" )
Expand Down Expand Up @@ -149,7 +159,6 @@ set(PLEGMA_LIGHT_BARYONS FALSE CACHE BOOL "compile contractions for all light ba
if(PLEGMA_LIGHT_BARYONS)
add_definitions(-DPLEGMA_LIGHT_BARYONS)
endif()

set(PLEGMA_SCATTERING_CONTRACTIONS FALSE CACHE BOOL "compile contractions for pi-N scattering")
if (PLEGMA_SCATTERING_CONTRACTIONS)
add_definitions(-DPLEGMA_SCATTERING_CONTRACTIONS)
Expand Down Expand Up @@ -264,7 +273,7 @@ find_package(PythonInterp)
if(${CMAKE_VERSION} VERSION_GREATER 3.7.99)
find_package(CUDAWrapper)
set(USING_CUDA_LANG_SUPPORT True)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED True)
else()
set(CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC")
Expand Down Expand Up @@ -415,7 +424,7 @@ add_definitions(-D__COMPUTE_CAPABILITY__=${COMP_CAP})

# NVCC FLAGS independet off build type
if(NOT USING_CUDA_LANG_SUPPORT)
set(CUDA_NVCC_FLAGS "-std c++11 -arch=${GPU_ARCH} -ftz=true -prec-div=false -prec-sqrt=false")
set(CUDA_NVCC_FLAGS "-std c++17 -arch=${GPU_ARCH} -ftz=true -prec-div=false -prec-sqrt=false")
else()
set(CUDA_NVCC_FLAGS "-ftz=true -prec-div=false -prec-sqrt=false")
set(CMAKE_CUDA_FLAGS "-arch=${GPU_ARCH}" CACHE STRING "Flags used by the CUDA compiler" FORCE)
Expand Down Expand Up @@ -471,17 +480,17 @@ set(CMAKE_CUDA_FLAGS_DEBUG "${CUDA_NVCC_FLAGS} -g -DHOST_DEBUG -G" CACHE STRING
FORCE )

#define CXX FLAGS
set(CMAKE_CXX_FLAGS_DEVEL "${OpenMP_CXX_FLAGS} -O3 -Wall ${CLANG_FORCE_COLOR}" CACHE STRING
set(CMAKE_CXX_FLAGS_DEVEL "${OpenMP_CXX_FLAGS} -std=c++17 -O3 -Wall ${CLANG_FORCE_COLOR}" CACHE STRING
"Flags used by the C++ compiler during regular development builds.")
set(CMAKE_CXX_FLAGS_STRICT "${OpenMP_CXX_FLAGS} -O3 -Wall -Werror ${CLANG_NOERROR}" CACHE STRING
set(CMAKE_CXX_FLAGS_STRICT "${OpenMP_CXX_FLAGS} -std=c++17 -O3 -Wall -Werror ${CLANG_NOERROR}" CACHE STRING
"Flags used by the C++ compiler during strict jenkins builds.")
set(CMAKE_CXX_FLAGS_RELEASE "${OpenMP_CXX_FLAGS} -O3 -w" CACHE STRING
set(CMAKE_CXX_FLAGS_RELEASE "${OpenMP_CXX_FLAGS} -std=c++17 -O3 -w" CACHE STRING
"Flags used by the C++ compiler during release builds.")
set(CMAKE_CXX_FLAGS_HOSTDEBUG "${OpenMP_CXX_FLAGS} -Wall -Wno-unknown-pragmas -g -fno-inline -DHOST_DEBUG ${CLANG_FORCE_COLOR}" CACHE STRING
set(CMAKE_CXX_FLAGS_HOSTDEBUG "${OpenMP_CXX_FLAGS} -std=c++17 -Wall -Wno-unknown-pragmas -g -fno-inline -DHOST_DEBUG ${CLANG_FORCE_COLOR}" CACHE STRING
"Flags used by the C++ compiler during host-debug builds.")
set(CMAKE_CXX_FLAGS_DEVICEDEBUG "${OpenMP_CXX_FLAGS} -Wall -Wno-unknown-pragmas ${CLANG_FORCE_COLOR}" CACHE STRING
set(CMAKE_CXX_FLAGS_DEVICEDEBUG "${OpenMP_CXX_FLAGS} -std=c++17 -Wall -Wno-unknown-pragmas ${CLANG_FORCE_COLOR}" CACHE STRING
"Flags used by the C++ compiler during device-debug builds.")
set(CMAKE_CXX_FLAGS_DEBUG "${OpenMP_CXX_FLAGS} -Wall -Wno-unknown-pragmas -g -fno-inline -DHOST_DEBUG ${CLANG_FORCE_COLOR}" CACHE STRING
set(CMAKE_CXX_FLAGS_DEBUG "${OpenMP_CXX_FLAGS} -std=c++17 -Wall -Wno-unknown-pragmas -g -fno-inline -DHOST_DEBUG ${CLANG_FORCE_COLOR}" CACHE STRING
"Flags used by the C++ compiler during full (host+device) debug builds.")

OPTION(USE_OpenMP "Use OpenMP" ON)
Expand Down Expand Up @@ -555,4 +564,3 @@ add_subdirectory(tests)
### add PLEGMA directory
add_subdirectory(utils)
add_subdirectory(plegma)

10 changes: 6 additions & 4 deletions include/PLEGMA_BLAS.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#include <cublas_v2.h>
#include <mpi.h>
#include <PLEGMA_utils.h>
#include <quda_api.h>
#pragma once
enum OPER_MATR_BLAS {NOTRANS, TRANS, DAGGER};
namespace cBLAS{
Expand Down Expand Up @@ -232,8 +234,8 @@ namespace cuBLAS{
if(trans == NOTRANS) PLEGMA_error("Use gemv without MPI comm");
if(comm == MPI_COMM_NULL) PLEGMA_error("Communicator is NULL and cannot be used for MPI reduction");
cuBLAS::gemv_(trans, m, n, alpha, A, x, beta, y);
cudaMemcpy(yHost,y,n*2*sizeof(Float),cudaMemcpyDeviceToHost);
checkCudaError();
qudaMemcpy(yHost,y,n*2*sizeof(Float),qudaMemcpyDeviceToHost);
checkQudaError();
int mpiErr = MPI_Allreduce(MPI_IN_PLACE,yHost,n*2,MPI_Type(yHost),MPI_SUM,comm);
if(mpiErr != MPI_SUCCESS) PLEGMA_error("MPI_Allreduce failed with error %d\n", mpiErr);
}
Expand All @@ -244,8 +246,8 @@ namespace cuBLAS{
inline void gemv(OPER_MATR_BLAS trans, int m, int n, Float alpha[2], Float* A, Float* x, Float beta[2], Float* y, MPI_Comm comm){
Float yHost[n*2];
cuBLAS::gemv(trans,m, n, alpha, A, x, beta, y, yHost,comm);
cudaMemcpy(y,yHost,sizeof(yHost),cudaMemcpyHostToDevice);
checkCudaError();
qudaMemcpy(y,yHost,sizeof(yHost),qudaMemcpyHostToDevice);
checkQudaError();
}
}
//=================================================================//
Expand Down
74 changes: 73 additions & 1 deletion include/PLEGMA_Correlator.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,68 @@ namespace plegma {
void contractMesonsAll(PLEGMA_Propagator<Float> &prop1,
PLEGMA_Propagator<Float> &prop2);


void contractBaryons(PLEGMA_Propagator<Float> &prop1,
PLEGMA_Propagator<Float> &prop2);

void contractBaryonsWall(PLEGMA_Propagator<Float> &prop1,
PLEGMA_Propagator<Float> &prop2,
PLEGMA_Propagator<Float> &prop3,
PLEGMA_Propagator<Float> &prop4);

void contractBaryonsUDSC(PLEGMA_Propagator<Float> &propUP,
PLEGMA_Propagator<Float> &propDN,
PLEGMA_Propagator<Float> &propST,
PLEGMA_Propagator<Float> &propCH,
bool only_st=false, bool only_ch=false);

template<typename Float2>
void contractTetraquarks(PLEGMA_Propagator<Float2> &propLT,
PLEGMA_Propagator<Float2> &propST,
PLEGMA_Propagator<Float2> &propCH,
PLEGMA_Propagator<Float2> &propBT,
bool only_st=false, bool only_ch=false);

template<typename Float2>
void contractTetraquarksBCUD(PLEGMA_Propagator<Float2> &propLT,
PLEGMA_Propagator<Float2> &propST,
PLEGMA_Propagator<Float2> &propCH,
PLEGMA_Propagator<Float2> &propBT,
bool only_st=false, bool only_ch=false);

template<typename Float2>
void contractTetraquarkScatteringOpenIndex(
PLEGMA_Propagator<Float2> &prop1,
PLEGMA_Propagator<Float2> &prop2,
std::vector<GAMMAS> gammas, int s1,
std::string Quarks);

template<typename Float2>
void contractTetraquarksStochastic(
PLEGMA_Propagator<Float2> &propLT1,
PLEGMA_Propagator<Float2> &propLT2,
PLEGMA_Propagator<Float2> &propST1,
PLEGMA_Propagator<Float2> &propST2,
PLEGMA_Propagator<Float2> &propBT1,
PLEGMA_Propagator<Float2> &propBT2);

template<typename Float2>
void contractTetraquarksStochasticBCUD(PLEGMA_Propagator<Float2> &propLT1,
PLEGMA_Propagator<Float2> &propLT2,
PLEGMA_Propagator<Float2> &propST1,
PLEGMA_Propagator<Float2> &propST2,
PLEGMA_Propagator<Float2> &propCH1,
PLEGMA_Propagator<Float2> &propCH2,
PLEGMA_Propagator<Float2> &propBT1,
PLEGMA_Propagator<Float2> &propBT2);


template<typename Float2>
void contractTetraquarkScatteringOpenIndexStochastic(
PLEGMA_Propagator<Float2> &prop1,
PLEGMA_Propagator<Float2> &prop2,
std::vector<GAMMAS> gammas,
int randInd1, int randInd2, int s1,
std::string Quarks);

void contractNucleonThrp_local(PLEGMA_Propagator<Float> &bwdProp,
PLEGMA_Propagator<Float> &fwdProp,
Expand Down Expand Up @@ -270,12 +323,31 @@ namespace plegma {
int signProps, std::vector<GAMMAS> gammas,
int z, std::string quark);

void contractNucleonThrp_staple(PLEGMA_Propagator<Float> &bwdProp,
PLEGMA_Propagator<Float> &fwdProp,
PLEGMA_Su3field<Float> &su3,
int signProps, std::vector<GAMMAS> gammas, bool isZfac, int b, int l, int z);

void contractNucleonThrp_qgq(PLEGMA_Propagator<Float> &bwdProp,
PLEGMA_Propagator<Float> &fwdProp,
PLEGMA_Su3field<Float> &su3_1,
PLEGMA_Fmunu<Float> &Fmunu, std::pair<int,int> munu,
PLEGMA_Su3field<Float> &su3_2,
int signProps, std::vector<GAMMAS> gammas, int z2, int z1);
void contractMesonsFourp_ultralocal_oneendtrick(PLEGMA_Propagator<Float> &prop1,
PLEGMA_Propagator<Float> &prop2,int b);

void contractMesonsFourp_ultralocal(PLEGMA_Propagator<Float> &prop1,
PLEGMA_Propagator<Float> &prop2,
PLEGMA_Propagator<Float> &prop3,
PLEGMA_Propagator<Float> &prop4,int b);

void contractTMDWFMesonsTrick_Zfac(PLEGMA_Propagator<Float> &prop1,
PLEGMA_Su3field<float> &staple, int b, int l);

void contractTMDWFMesons_Zfac(PLEGMA_Propagator<Float> &prop1,
PLEGMA_Propagator<Float> &prop2,
PLEGMA_Su3field<float> &staple, int b, int l);

virtual void writeASCII(std::string filename) const;
virtual void writeHDF5(std::string filename) const;
Expand Down
3 changes: 3 additions & 0 deletions include/PLEGMA_Field.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ namespace plegma {
* @param munu: the mu,nu pair of lorentz indices of the Plq
*/
void trPmunu(PLEGMA_Gauge<Float> &gauge, std::pair<int,int> munu);

void SU3Trace(PLEGMA_Su3field<Float> &su3field);

/**
@brief Absorbs all elements from a 3D field and puts it at a specific global time of the 4D field
@param PLEGMA_Field3D<Float> prop, The 3D field
Expand Down
8 changes: 5 additions & 3 deletions include/PLEGMA_Hprobing.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once
//#include <PLEGMA_utils.h>
#include <tune_quda.h>

namespace plegma {
inline int getVecToInd(std::vector<int> x, std::vector<int> L){
Expand Down Expand Up @@ -100,15 +102,15 @@ namespace plegma {
createColLattice();
// if(check)checkColoring();
cudaMalloc((void**)&d_arrVc, HGC_localVolume*sizeof(int));
checkCudaError();
// checkQudaError();
cudaMemcpy(d_arrVc, h_arrVc, HGC_localVolume*sizeof(int), cudaMemcpyHostToDevice);
checkCudaError();
// checkQudaError();
}
~PLEGMA_Hprobing(){
delete[] h_arrVc;
delete[] arrlc;
cudaFree(d_arrVc);
checkCudaError();
//checkQudaError();
}
int* H_arrVc() const{return h_arrVc;}
int* D_arrVc() const{return d_arrVc;}
Expand Down
20 changes: 20 additions & 0 deletions include/PLEGMA_Propagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,30 @@ namespace plegma {
@return void
**/
void absorb(PLEGMA_Vector3D<Float> &vec, int global_it, int nu, int c2);

/**
@brief packing the sinktime slice in all other time slices
@param the initial propagator to be broadcasted
@param PLEGMA_Propagator<Float> in initial propagator to be broadcasted
@param int sinktimeslice the sinktime slice to be broadcasted
**/
void pack_propagator_as_sink(PLEGMA_Propagator<Float> &in, int sinktimeslice, int max_source_sink_separations, bool initial);

/**
@brief packing the sinktime slice in all other time slices
@param the initial propagator to be broadcasted
@param PLEGMA_Propagator<Float> in initial propagator to be broadcasted
@param int sinktimeslice the sinktime slice to be broadcasted
**/
void pack_propagator_from_source_to_sink(PLEGMA_Propagator<Float> &in, int sinktimeslice, int source_sink_separations, bool initial);




void applyBoundaries_device(int t0);
void rotateToPhysicalBase_host(int sign);
void rotateToPhysicalBase_device(int sign);
void PropmulVVdag(PLEGMA_Vector<Float> &vec1,PLEGMA_Vector<Float> &vec2);
};

///////////////////////////////
Expand Down
20 changes: 13 additions & 7 deletions include/PLEGMA_ScattCorrelator.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace plegma {
* in most cases we do set this to false
*
**/
void V2( PLEGMA_Vector<Float> &Phi, std::vector<GAMMAS_SCATT> &Gammas, PLEGMA_Propagator<Float> &S1, PLEGMA_Propagator<Float> &S2,bool conj_v=false );
void V2( PLEGMA_Vector<Float> &Phi, std::vector<GAMMAS_SCATT> &Gammas, PLEGMA_Propagator<Float> &S1, PLEGMA_Propagator<Float> &S2,bool conj_v=true );
/**
*
* @brief performs V3 type reduction produces one spin and one color indices tensor from a fermion vector and a fermion propagator
Expand Down Expand Up @@ -138,7 +138,7 @@ namespace plegma {
*
*
**/
void V4( PLEGMA_Vector<Float> &Phi, std::vector<GAMMAS_SCATT> &Gammas, PLEGMA_Propagator<Float> &S1, PLEGMA_Propagator<Float> &S2, bool conj_v=false );
void V4( PLEGMA_Vector<Float> &Phi, std::vector<GAMMAS_SCATT> &Gammas, PLEGMA_Propagator<Float> &S1, PLEGMA_Propagator<Float> &S2, bool conj_v=true );
/**
*
* @brief performs V5 type reduction produces two spin and one color indices tensor from two fermion vectors
Expand Down Expand Up @@ -190,7 +190,7 @@ namespace plegma {
void T1( std::vector<GAMMAS_SCATT> &Gammas_i, std::vector<GAMMAS_SCATT> &Gammas_f, PLEGMA_Propagator<Float> &S1, PLEGMA_Propagator<Float> &S2, PLEGMA_Propagator<Float> &S3 );
/**
* @brief performs T2 type reduction to compute baryon 2pt functions
* T2_{alpha,beta}=\epsilon_{a,b,c}\epsilon_{l,m,n}S2^{c,l}_{alpha,beta}\Gamma_{i}_{alpha0,alpha1}S2^{b,m}_{beta0,alpha1}\Gamma_{f}_{beta0,beta1}S3^{a,n}_{beta1,alpha0}
* T2_{alpha,beta}=\epsilon_{a,b,c}\epsilon_{l,m,n}S1^{c,l}_{alpha,beta}\Gamma_{i}_{alpha0,alpha1}S2^{b,m}_{beta0,alpha1}\Gamma_{f}_{beta0,beta1}S3^{a,n}_{beta1,alpha0}
* @param std::vector<GAMMAS_SCATT> &Gammas_i: list of gammas at the source for the contractions
* @param std::vector<GAMMAS_SCATT> &Gammas_f: list of gammas at the sink for the contractions
* @param PLEGMA_Propagator<Float> &S1: propagator to the sink spin from the source spin index
Expand All @@ -202,7 +202,7 @@ namespace plegma {

//manipulation
//Note that in the case of oet B, W diagram g0 refers not to gamma_i2 but to gamma_f2
void V3V2reduction( PLEGMA_ScattCorrelator<Float> &srcV3,PLEGMA_ScattCorrelator<Float> &srcV2, int index_abs, bool transp, int g0, bool transp_i1=false, Float* factor=NULL, bool transp_f1=false, bool oet=false );
void V3V2reduction( PLEGMA_ScattCorrelator<Float> &srcV3,PLEGMA_ScattCorrelator<Float> &srcV2, int index_abs, bool transp, int g0, bool transp_i1=false, Float* factor=NULL, bool transp_f1=false, bool oet=false, bool threept=false );

void V5V6reduction(PLEGMA_ScattCorrelator<Float> &srcV6,
std::shared_ptr<Float> &Phi0,
Expand All @@ -212,7 +212,7 @@ namespace plegma {
bool transp=false, bool transpgamma_i1=false, bool transgamma_f1=false,
Float *factor=NULL);

void V3V2reduction_matrix( PLEGMA_ScattCorrelator<Float> &srcV3, PLEGMA_ScattCorrelator<Float> &srcV2, int index_abs, bool transp, int g0, bool transp_i1=false, Float* factor=NULL, bool transp_f1=false, bool oet=false );
void V3V2reduction_matrix( PLEGMA_ScattCorrelator<Float> &srcV3, PLEGMA_ScattCorrelator<Float> &srcV2, int index_abs, bool transp, int g0, bool transp_i1=false, Float* factor=NULL, bool transp_f1=false, bool oet=false, bool threept=false );

void V5V6reduction_matrix( PLEGMA_ScattCorrelator<Float> &srcV6,
std::shared_ptr<Float> &Phi0,
Expand Down Expand Up @@ -258,12 +258,16 @@ namespace plegma {


//diagrams
void B_diagrams( PLEGMA_ScattCorrelator<Float> &srcV3, PLEGMA_ScattCorrelator<Float> &srcV2, int ig_i2, int diagram_index, bool accum=false, bool oet=false );
void W_diagrams( PLEGMA_ScattCorrelator<Float> &srcV3, PLEGMA_ScattCorrelator<Float> &srcV2, int ig_i2, int diagramm_index, bool accum=false );
void B_diagrams( PLEGMA_ScattCorrelator<Float> &srcV3, PLEGMA_ScattCorrelator<Float> &srcV2, int ig_i2, int diagram_index, bool accum=false, bool oet=false, bool threept=false );
void W_diagrams( PLEGMA_ScattCorrelator<Float> &srcV3, PLEGMA_ScattCorrelator<Float> &srcV2, int ig_i2, int diagramm_index, bool accum=false, bool threept=false );
void W_diagrams_oet(PLEGMA_ScattCorrelator<Float> &srcV6, std::shared_ptr<Float> &Phi0, std::vector<PLEGMA_Vector<Float>*> &Phi_1, int input_mom_f2, int diagram_index, bool accum=false);

void Z_diagrams( std::array<PLEGMA_ScattCorrelator<Float>,4> (&srcV3), std::array<PLEGMA_ScattCorrelator<Float>,4> (&srcV2),int diagramm_index, bool accum=false );
void Z_diagrams(std::vector<PLEGMA_ScattCorrelator<Float>*> (&srcV3), std::vector<PLEGMA_ScattCorrelator<Float>*> (&srcV2),int srcV2index, int diagramm_index, bool accum=false );

void Z_diagrams_without_dilution( PLEGMA_ScattCorrelator<Float> &srcV3, PLEGMA_ScattCorrelator<Float> &srcV2, int ig_i2, int diagramm_index, bool accum=false );
void Z_diagrams_without_dilution( PLEGMA_ScattCorrelator<Float> &srcV3, std::vector<PLEGMA_ScattCorrelator<Float>*> (&srcV2), int srcV2index, int diagramm_index, bool accum=false, bool threept=false);

void Z_diagrams_without_dilution_check(PLEGMA_ScattCorrelator<Float> &srcV3,
PLEGMA_ScattCorrelator<Float> &srcV2, int i_g_i2,
std::string proporder, int diagram_number, bool transp_i1, bool transp_f1, bool accum );
Expand Down Expand Up @@ -304,6 +308,8 @@ namespace plegma {

void multiply_by_time_slice(std::shared_ptr<Float>&);
void applyBoundaryConditions( bool antiperiodic, int n_coherent_source=1, int *attract_look_up_table=NULL );
void applyBoundaryConditions_3pt( bool antiperiodic, int n_coherent_source, int *attract_look_up_table, int source_sink_separation );

void apply_phase( );


Expand Down
10 changes: 10 additions & 0 deletions include/PLEGMA_Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ namespace plegma {
void rotate_uk_ch_g5g4();
void covD(PLEGMA_Vector<Float> &vecIn, PLEGMA_Gauge<Float> &gauge, int dirOr);
void mulGV(PLEGMA_Vector<Float> &vecIn, PLEGMA_Su3field<Float> &u);
void pack_fermion_to_sink(std::vector<PLEGMA_Vector<Float>*> &stochastic_vector, int sinktime);

void pack_propagator_from_source_to_sink(PLEGMA_Vector<Float> &in, int sinktimeslice, int source_sink_separation, bool initialize);

void pack_propagator_as_sink(PLEGMA_Vector<Float> &in, int sinktimeslice, int source_sink_separation, bool initialize);


};

template<typename Float> void copyToQUDA(quda::ColorSpinorField *cudaVector, Float* delem, bool isEv = false); // delem is a device pointer
Expand Down Expand Up @@ -135,6 +142,9 @@ namespace plegma {
**/
void absorb(PLEGMA_Propagator<Float> &prop, int global_it, int nu, int c2, bool broadcast=false);

void absorb(PLEGMA_Vector<Float> &vec, int global_it, bool broadcast=false);


void gaussianSmearing(PLEGMA_Vector3D<Float> &vecIn, PLEGMA_Gauge3D<Float> &gauge, int nsmearGauss, Float alphaGauss) {
this->activeTimeSlice = vecIn.activeTimeSlice;
return ((PLEGMA_Vector<Float>*) this)->gaussianSmearing(vecIn,gauge,nsmearGauss,alphaGauss);
Expand Down
9 changes: 9 additions & 0 deletions include/PLEGMA_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ using namespace std::chrono_literals;

//======== Preprocessor macros =========//
#include <global/PLEGMA_macros.hpp>
#include <tune_quda.h>
#include <comm_quda.h>
using namespace quda;

namespace plegma {
//======== PLEGMA_printf, PLEGMA_error, PLEGMA_warning =========//
Expand All @@ -64,5 +67,11 @@ namespace plegma {
#include <global/PLEGMA_global_constants.h>


static inline void PLEGMA_memset(void *ptr, int value, size_t count){
return qudaMemset(ptr,value,count);
}
static inline void PLEGMA_memcpy(void *dst, const void *src, size_t count,qudaMemcpyKind kind){
return qudaMemcpy(dst,src,count,kind);
}
}
using namespace plegma; // TODO: This one shouldn't be here.. But helps avoiding missing namespace.
Loading