From 8bf1d661a79afa8a60a398e58b72c44433dd0e7d Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Thu, 13 Apr 2023 11:51:11 +0300 Subject: [PATCH 01/27] Turn of HIP separate compilation --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b07c1b78..fe6923dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) set(CMAKE_COLOR_MAKEFILE ON) -set(CMAKE_CUDA_SEPARABLE_COMPILATION ON) +set(CMAKE_HIP_SEPARABLE_COMPILATION ON) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_STANDARD 17) include(CheckIncludeFileCXX) @@ -424,13 +424,21 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() endif() +set(CPU_ARCH ${CMAKE_HOST_SYSTEM_PROCESSOR}) +if(${CPU_ARCH} STREQUAL "x86_64") + set(CXX_OPT "-mtune=native") +elseif(${CPU_ARCH} STREQUAL "ppc64le") + set(CXX_OPT "-Ofast -mcpu=native -mtune=native") +endif() + + #define CXX FLAGS 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} -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} -std=c++17 -O3 -w" CACHE STRING +set(CMAKE_CXX_FLAGS_RELEASE "${OpenMP_CXX_FLAGS} -std=c++17 -O3 -w ${CXX_OPT}" CACHE STRING "Flags used by the C++ compiler during release builds.") 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.") From 7c5a95d1c02d8f452ef64d2ea039bd452d36eff9 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Thu, 13 Apr 2023 12:09:28 +0300 Subject: [PATCH 02/27] using static __device__ __constant__ in HIP instead of extern __constant__ --- include/global/PLEGMA_global_constants.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/global/PLEGMA_global_constants.h b/include/global/PLEGMA_global_constants.h index 10042620..a916a914 100644 --- a/include/global/PLEGMA_global_constants.h +++ b/include/global/PLEGMA_global_constants.h @@ -22,18 +22,16 @@ #endif #ifdef ADD_TO_GLOBAL -void *symbolAddress; #define global_host(dtype, name, ...) \ HGC_global_vars.add(#name, \ PRODUCT(__VA_ARGS__), \ &HGC_##name PARENTHESES(0,__VA_ARGS__)) #define global_both(dtype, name, ...) \ - HIP_CHECK(hipGetSymbolAddress(&symbolAddress, HIP_SYMBOL(DGC_##name))); \ HGC_global_vars.add(#name, \ PRODUCT(__VA_ARGS__), \ &HGC_##name PARENTHESES(0,__VA_ARGS__), \ - (void**) &symbolAddress) + (void**) &DGC_##name) #else #ifdef ALLOCATE @@ -64,7 +62,7 @@ void *symbolAddress; #elif defined ( __HIP__ ) #define global_both(dtype, name, ...) \ extern dtype HGC_##name PARENTHESES(1,__VA_ARGS__); \ - extern __device__ __constant__ dtype DGC_##name PARENTHESES(1,__VA_ARGS__); + static __device__ __constant__ dtype DGC_##name PARENTHESES(1,__VA_ARGS__); #else #define global_both(dtype, name, ...) \ extern dtype HGC_##name PARENTHESES(1,__VA_ARGS__); From a1fa652120c39f191e8275a6ed68bdc008bd74b5 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Thu, 13 Apr 2023 12:14:52 +0300 Subject: [PATCH 03/27] correcting hipMemcpyToSymbol --- include/global/PLEGMA_structs.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/include/global/PLEGMA_structs.h b/include/global/PLEGMA_structs.h index 75ed43b5..65f2a22f 100644 --- a/include/global/PLEGMA_structs.h +++ b/include/global/PLEGMA_structs.h @@ -2,6 +2,7 @@ #define HIP_CHECK(error) \ { \ hipError_t localError = error; \ + PLEGMA_printf("Error in MemcpytoSymbol %d\n", error); \ if ((localError != hipSuccess) && (localError != hipErrorPeerAccessAlreadyEnabled)) { \ PLEGMA_printf("Error: %s, Code %d\n", hipGetErrorString(localError), localError); \ PLEGMA_printf("FILE: %s, LINE %d\n", __FILE__, __LINE__ ); \ @@ -87,8 +88,12 @@ struct pointer_holder { if (err != cudaSuccess) { errorQuda("Failed to copy constant host memory of size to device %zu \n", size); } -#else - HIP_CHECK(hipMemcpy(*devPointer, hostPointer, bytes*size, hipMemcpyHostToDevice)); +#elif defined(__HIP__) + hipError_t err = hipMemcpyToSymbol( *devPointer, hostPointer, bytes*size); + if (err != hipSuccess) { + errorQuda("Failed to copy constant host memory of size to device %zu \n", size); + } + //HIP_CHECK(hipMemcpyToSymbol(*devPointer, hostPointer, bytes*size)); #endif } } @@ -100,13 +105,16 @@ struct pointer_holder { errorQuda("Failed to copy constant host memory of size to device %zu \n", size); } #else - qudaMemcpy(hostPointer, *devPointer, bytes*size,qudaMemcpyDeviceToHost); + hipError_t err = hipMemcpyFromSymbol(hostPointer, *devPointer, bytes*size, 0, hipMemcpyDeviceToHost); + if (err != hipSuccess) { + errorQuda("Failed to copy constant host memory of size to device %zu \n", size); + } #endif } } bool checkDeviceConstant() { - if(false and devPointer != nullptr) { - char tmp[bytes*size]; + if( devPointer != nullptr) { + char tmp[bytes*size]; memcpy(tmp,hostPointer,bytes*size); copyFromDeviceConstant(); bool check=true; From 17f62c6044678b2319a790794a774cfc232b4fce Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 2 May 2023 09:31:47 +0300 Subject: [PATCH 04/27] temporary working version of CMakeLists --- lib/CMakeLists.txt | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 379c27bf..7a703baa 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -16,7 +16,6 @@ if(DEBUG_BUILD) endif() set (PLEGMA_OBJS - PLEGMA_Correlator.cu PLEGMA.cu PLEGMA_Propagator.cu PLEGMA_Vector.cu @@ -24,24 +23,8 @@ set (PLEGMA_OBJS PLEGMA_Field.cu PLEGMA_Su3field.cu PLEGMA_Random.cu - kernels/PLEGMA_baryons_NtoN.cu kernels/PLEGMA_seqSourceNucleon.cu - kernels/PLEGMA_threep_local.cu - kernels/PLEGMA_threep_noe.cu - kernels/PLEGMA_threep_oneD.cu - kernels/PLEGMA_threep_twoD.cu - kernels/PLEGMA_threep_threeD_part1.cu - kernels/PLEGMA_threep_threeD_part2.cu - kernels/PLEGMA_threep_threeD_part3.cu - kernels/PLEGMA_threep_threeD_part4.cu - kernels/PLEGMA_threep_wilsonLine.cu - kernels/PLEGMA_threep_staple.cu - kernels/PLEGMA_threep_qgq.cu - PLEGMA_QLoops.cu - PLEGMA_FT.cu PLEGMA_BLAS.cu - PLEGMA_Fmunu.cu - PLEGMA_U1Gauge.cu ) if(PLEGMA_UDSC_BARYONS) LIST(APPEND PLEGMA_OBJS @@ -128,6 +111,7 @@ if(${PLEGMA_TARGET_TYPE} STREQUAL "CUDA") include(targets/cuda/target_cuda.cmake) endif() if(${PLEGMA_TARGET_TYPE} STREQUAL "HIP") + find_package(HIPWrapper) include(targets/hip/target_hip.cmake) endif() if(${PLEGMA_TARGET_TYPE} STREQUAL "SYCL") @@ -254,9 +238,9 @@ write_basic_package_version_file( include(CMakePackageConfigHelpers) configure_package_config_file(${CMAKE_SOURCE_DIR}/PLEGMAConfig.cmake.in PLEGMAConfig.cmake INSTALL_DESTINATION lib/cmake/PLEGMA) -#export(EXPORT PLEGMATargets FILE "${CMAKE_CURRENT_BINARY_DIR}/PLEGMATargets.cmake" NAMESPACE quda::) -#set(ConfigPackageLocation lib/cmake/quda/) -#install(EXPORT PLEGMATargets NAMESPACE quda:: DESTINATION ${ConfigPackageLocation}) +export(EXPORT PLEGMATargets FILE "${CMAKE_CURRENT_BINARY_DIR}/PLEGMATargets.cmake" NAMESPACE quda::) +set(ConfigPackageLocation lib/cmake/quda/) +install(EXPORT PLEGMATargets NAMESPACE quda:: DESTINATION ${ConfigPackageLocation}) add_custom_target(gen ${PYTHON_EXECUTABLE} ${PLEGMA_QUDA_HOME}/lib/generate/gen.py From 799656f6e574547798552e47e928651f79a08cf9 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 2 May 2023 09:34:40 +0300 Subject: [PATCH 05/27] changing __HIP__ to __HIP_DEVICE_COMPILE --- lib/kernels/PLEGMA_kernel_getSet.cuh | 34 ++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/lib/kernels/PLEGMA_kernel_getSet.cuh b/lib/kernels/PLEGMA_kernel_getSet.cuh index b022e7b5..1cfd5d6b 100644 --- a/lib/kernels/PLEGMA_kernel_getSet.cuh +++ b/lib/kernels/PLEGMA_kernel_getSet.cuh @@ -81,17 +81,31 @@ namespace plegma { const int site_size; size_t sid; size_t stride; - +/* + #if defined ( _CUDA_ARCH_) || ( _HIP_ARCH_ ) + #define __where__ __device__ + #else + #define __where__ __host__ + #endif +*/ inline __host__ __device__ size_t volume() const { - #if defined ( __CUDA_ARCH__ ) || ( __HIP__ ) + #if defined ( __CUDA_ARCH__ ) || ( __HIP_DEVICE_COMPILE__ ) return is4D ? DGC_localVolume : DGC_localVolume3D; #else return is4D ? HGC_localVolume : HGC_localVolume3D; #endif } + /* + inline __host__ __device__ size_t volume() const { + #if defined ( __CUDA_ARCH__ ) || ( __HIP_DEVICE_COMPILE__ ) + return is4D ? DGC_localVolume : DGC_localVolume3D; + #else + return is4D ? HGC_localVolume : HGC_localVolume3D; + #endif + }*/ inline __host__ __device__ size_t sideGhostVolume() const { - #if defined ( __CUDA_ARCH__) || ( __HIP__ ) + #if defined ( __CUDA_ARCH__) || ( __HIP_DEVICE_COMPILE__ ) return is4D ? DGC_sideGhostVolume : DGC_sideGhostVolume3D; #else return is4D ? HGC_sideGhostVolume : HGC_sideGhostVolume3D; @@ -99,7 +113,7 @@ namespace plegma { } inline __host__ __device__ size_t sideGhostL(const short& dir) const { - #if defined ( __CUDA_ARCH__) || ( __HIP__ ) + #if defined ( __CUDA_ARCH__) || ( __HIP_DEVICE_COMPILE__ ) return is4D ? DGC_surface3D[dir] : (DGC_surface3D[dir]/DGC_localL[DIM_T]); #else return is4D ? HGC_surface3D[dir] : (HGC_surface3D[dir]/HGC_localL[DIM_T]); @@ -107,7 +121,7 @@ namespace plegma { } inline __host__ __device__ size_t sideGhostShift(const short& dir, const ORIENTATION& sign) const { - #if defined ( __CUDA_ARCH__) || ( __HIP__ ) + #if defined ( __CUDA_ARCH__) || ( __HIP_DEVICE_COMPILE__ ) return is4D ? DGC_sideGhost[dir][sign] : (DGC_sideGhost[dir][sign]/DGC_localL[DIM_T]); #else return is4D ? HGC_sideGhost[dir][sign] : (HGC_sideGhost[dir][sign]/HGC_localL[DIM_T]); @@ -115,7 +129,7 @@ namespace plegma { } inline __host__ __device__ size_t cornerGhostVolume() const { - #if defined ( __CUDA_ARCH__) || ( __HIP__ ) + #if defined ( __CUDA_ARCH__) || ( __HIP_DEVICE_COMPILE__ ) return is4D ? DGC_cornerGhostVolume : DGC_cornerGhostVolume3D; #else return is4D ? HGC_cornerGhostVolume : HGC_cornerGhostVolume3D; @@ -123,7 +137,7 @@ namespace plegma { } inline __host__ __device__ size_t cornerGhostL(const short& dir1, const short& dir2) const { - #if defined ( __CUDA_ARCH__) || ( __HIP__ ) + #if defined ( __CUDA_ARCH__) || ( __HIP_DEVICE_COMPILE__ ) return is4D ? DGC_surface2D[OFF2(dir1,dir2)] : (DGC_surface2D[OFF2(dir1,dir2)]/DGC_localL[DIM_T]); #else return is4D ? HGC_surface2D[OFF2(dir1,dir2)] : (HGC_surface2D[OFF2(dir1,dir2)]/HGC_localL[DIM_T]); @@ -131,7 +145,7 @@ namespace plegma { } inline __host__ __device__ size_t vertexGhostL(const short& dir1, const short& dir2, const short& dir3) const { - #if defined ( __CUDA_ARCH__) || ( __HIP__ ) + #if defined ( __CUDA_ARCH__) || ( __HIP_DEVICE_COMPILE__ ) return is4D ? DGC_surface1D[OFF3(dir1,dir2,dir3)] : (DGC_surface1D[OFF3(dir1,dir2,dir3)]/DGC_localL[DIM_T]); #else return is4D ? HGC_surface1D[OFF3(dir1,dir2,dir3)] : (HGC_surface1D[OFF3(dir1,dir2,dir3)]/HGC_localL[DIM_T]); @@ -140,7 +154,7 @@ namespace plegma { inline __host__ __device__ size_t cornerGhostShift(const short& dir1, const short& dir2, const ORIENTATION& sign1, const ORIENTATION& sign2) const { - #if defined ( __CUDA_ARCH__) || ( __HIP__ ) + #if defined ( __CUDA_ARCH__) || ( __HIP_DEVICE_COMPILE__ ) return is4D ? DGC_cornerGhost[OFF2SIGN(dir1,dir2,sign1,sign2)] : (DGC_cornerGhost[OFF2SIGN(dir1,dir2,sign1,sign2)]/DGC_localL[DIM_T]); #else return is4D ? HGC_cornerGhost[OFF2SIGN(dir1,dir2,sign1,sign2)] : (HGC_cornerGhost[OFF2SIGN(dir1,dir2,sign1,sign2)]/HGC_localL[DIM_T]); @@ -149,7 +163,7 @@ namespace plegma { inline __host__ __device__ size_t vertexGhostShift(const short& dir1, const short& dir2, const short& dir3, const ORIENTATION& sign1, const ORIENTATION& sign2, const ORIENTATION& sign3) const { - #if defined ( __CUDA_ARCH__) || ( __HIP__ ) + #if defined ( __CUDA_ARCH__) || ( __HIP_DEVICE_COMPILE__ ) return is4D ? DGC_vertexGhost[OFF3SIGN(dir1,dir2,dir3,sign1,sign2,sign3)] : (DGC_vertexGhost[OFF3SIGN(dir1,dir2,dir3,sign1,sign2,sign3)]/DGC_localL[DIM_T]); #else return is4D ? HGC_vertexGhost[OFF3SIGN(dir1,dir2,dir3,sign1,sign2,sign3)] : (HGC_vertexGhost[OFF3SIGN(dir1,dir2,dir3,sign1,sign2,sign3)]/HGC_localL[DIM_T]); From edd1a92622e46fe19480289dd4152309c889a04e Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 2 May 2023 09:37:49 +0300 Subject: [PATCH 06/27] temporary fixed kernel_tuner --- lib/kernels/PLEGMA_kernel_tuner.cuh | 35 ++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/lib/kernels/PLEGMA_kernel_tuner.cuh b/lib/kernels/PLEGMA_kernel_tuner.cuh index efa0351a..89157680 100644 --- a/lib/kernels/PLEGMA_kernel_tuner.cuh +++ b/lib/kernels/PLEGMA_kernel_tuner.cuh @@ -202,8 +202,16 @@ public: sprintf(volString, "%lldx%lldx%lldx%lld", HGC_localL[0], HGC_localL[1], HGC_localL[2], HGC_localL[3]); sprintf(aux, "volume=%lld,Ndims=%d,Ncols=%d,maxvolume=%d,aux_range=(%d,%d,%d,%d)", ps.volume, N_DIMS, N_COLS, ps.max_volume, ps.aux_range.x, ps.aux_range.y, ps.aux_range.z, ps.aux_range.w); kernelName = kname + (std::string) typeid(*kernel).name(); // with cupti no longer necessary + PLEGMA_printf("Aux %s\n",aux); + PLEGMA_printf("Volstring %s\n",volString); setPolicyTuning(ps.tune_globally); - } + PLEGMA_printf("TUNING policy %s kernel name\n",kernelName.c_str()); + +// #define ADD_TO_GLOBAL +// #include +// #undef ADD_TO_GLOBAL +// HGC_global_vars.copyToDevice(); + } ~PLEGMA_kernel_tuner(){ setPolicyTuning(false); @@ -251,11 +259,24 @@ void PLEGMA_kernel_tuner::apply(const qudaStream_t &stream){ #else // performing tuning if we need to tune if( !ps.tuned && !activeTuning() && ps.tune_globally ) comm_barrier(); //syncronizing - if( !ps.tuned ) ps.tp = tuneLaunch(*this, getTuning(), (QudaVerbosity) HGC_verbosity); - if( !ps.tuned ) qudaGetLastError(); // ensuring that the error state has been clean + if( !ps.tuned ) {PLEGMA_printf("Tuner1 \n"); + fflush(stdout); + ps.tp = tuneLaunch(*this, getTuning(), (QudaVerbosity) HGC_verbosity); + } + if( !ps.tuned ){ + PLEGMA_printf("Tuner2 \n"); + fflush(stdout); + qudaGetLastError(); // ensuring that the error state has been clean + } + PLEGMA_printf("Tuner3 \n"); + fflush(stdout); if( !activeTuning() ) ps.tuned = true; + PLEGMA_printf("Tuner4 \n"); + fflush(stdout); if( onlyTuning && !activeTuning() ) return; + PLEGMA_printf("Before launching kernels\n"); + fflush(stdout); launchKernel(ps.tp,stream); // HACK: For unknown reason, the Out Of Memory error state is not seen in QUDA/lib/tune.cpp @@ -275,13 +296,15 @@ void PLEGMA_kernel_tuner::apply(const qudaStream_t &stream){ } template -void PLEGMA_kernel_tuner::apply(){ apply(device::get_stream(0)); } +void PLEGMA_kernel_tuner::apply(){PLEGMA_printf("before device get stream\n");fflush(stdout); apply(device::get_stream(0)); } template void PLEGMA_kernel_tuner::run(){ #ifdef PLEGMA_NO_TUNING if(!ps.tuned) tune(); - launchKernel(ps.tp.grid,ps.tp.block,ps.tp.shared_bytes,0); + PLEGMA_printf("Here the kernel should launch\n"); + fflush(stdout); + launchKernel(ps.tp,device::get_stream(0));//,ps.tp.shared_bytes,0); #else if(!ps.tuned) ps.tp = tuneLaunch(*this, QUDA_TUNE_NO, (QudaVerbosity) HGC_verbosity); launchKernel(ps.tp,device::get_stream(0)); @@ -304,6 +327,8 @@ void run(ProfileStruct &ps, std::string kname, void(* kernel)(typesK...), types& template void tuneAndRun(ProfileStruct &ps, std::string kname, void(* kernel)(typesK...), types&&... kArgs){ PLEGMA_kernel_tuner tuner(ps, kname, kernel, kArgs...); + PLEGMA_printf("before apppllly\n"); + fflush(stdout); tuner.apply(); } From 95605e8679bc64736e2be3447ff7e1eda263abe6 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 2 May 2023 09:38:45 +0300 Subject: [PATCH 07/27] temporary working hip target --- lib/targets/hip/target_hip.cmake | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/targets/hip/target_hip.cmake b/lib/targets/hip/target_hip.cmake index 4e8c18a6..c691f926 100644 --- a/lib/targets/hip/target_hip.cmake +++ b/lib/targets/hip/target_hip.cmake @@ -23,6 +23,16 @@ mark_as_advanced(GPU_TARGETS) mark_as_advanced(CMAKE_HIP_ARCHITECTURES) message(STATUS "Building for GPU Architectures: ${GPU_ARCH}") +if(NOT DEFINED HIP_PATH) + if(NOT DEFINED ENV{HIP_PATH}) + set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to which HIP has been installed") + else() + set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to which HIP has been installed") + endif() +endif() +set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH}) +find_package(HIP) + find_package(HIP) find_package(hipfft REQUIRED) find_package(hiprand REQUIRED) @@ -115,7 +125,7 @@ target_compile_options( -Wno-unknown-pragmas -Wno-unused-result -Wno-deprecated-register -dc - -fgpu-rdc #--amdgpu-target=gfx90a + --hip-link -fopenmp $<$:-Werror -Wno-error=pass-failed> @@ -126,8 +136,8 @@ target_compile_options( # malloc.cpp uses both the driver and runtime api So we need to find the CUDA_CUDA_LIBRARY (driver api) or the stub # version for cmake 3.8 and later this has been integrated into FindCUDALibs.cmake target_link_libraries(plegma PUBLIC hip::hiprand roc::rocrand hip::hipcub roc::rocprim_hip) -target_link_libraries(plegma PUBLIC roc::hipblas roc::rocblas) - +target_link_libraries(plegma PUBLIC roc::hipblas roc::rocblas ) +target_include_directories(plegma PUBLIC /users/pittlerf/code/quda/build2/_deps/eigen-src/) target_include_directories(plegma PUBLIC ${ROCM_PATH}/hipfft/include) target_include_directories(plegma PUBLIC ${QUDA_HOME}/include/targets/hip) target_link_libraries(plegma PUBLIC hip::hipfft) From e2e85a5f669d11efb15915acd19660355e9fae56 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 2 May 2023 09:40:02 +0300 Subject: [PATCH 08/27] temporary working version of utils CMakeLists --- utils/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 7d71e446..f25a5027 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -6,10 +6,11 @@ file(GLOB PLEGMA_UTILS #cuda_add_library(PLEGMAutils STATIC ${PLEGMA_UTILS}) add_library(PLEGMAutils STATIC ${PLEGMA_UTILS}) if(${PLEGMA_TARGET_TYPE} STREQUAL "HIP") -target_include_directories(PLEGMAutils SYSTEM PRIVATE ${QUDA_SRC}/lib ${QUDA_HOME}/include/targets/hip) +target_link_libraries(PLEGMAutils PRIVATE ${QUDA_HOME}/lib/libquda.so) +target_include_directories(PLEGMAutils SYSTEM PRIVATE ${QUDA_SRC}/lib ${QUDA_HOME}/include/targets/hip /users/pittlerf/code/quda/build2/_deps/eigen-src/) endif() if(${PLEGMA_TARGET_TYPE} STREQUAL "CUDA") -target_include_directories(PLEGMAutils SYSTEM PRIVATE ${QUDA_SRC}/lib ${QUDA_HOME}/include/targets/cuda) +target_include_directories(PLEGMAutils SYSTEM PRIVATE ${QUDA_SRC}/lib ${QUDA_HOME}/include/targets/cuda /users/pittlerf/code/quda/build2/_deps/eigen-src/) endif() add_dependencies(PLEGMAutils BoostPP) From c7aa245669743a2ce9a5e3b3be8434bc0ecbfd41 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Thu, 4 May 2023 18:10:33 +0300 Subject: [PATCH 09/27] change from static to extern of the DGC global variables --- include/global/PLEGMA_global_constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/global/PLEGMA_global_constants.h b/include/global/PLEGMA_global_constants.h index a916a914..2fc42612 100644 --- a/include/global/PLEGMA_global_constants.h +++ b/include/global/PLEGMA_global_constants.h @@ -62,7 +62,7 @@ #elif defined ( __HIP__ ) #define global_both(dtype, name, ...) \ extern dtype HGC_##name PARENTHESES(1,__VA_ARGS__); \ - static __device__ __constant__ dtype DGC_##name PARENTHESES(1,__VA_ARGS__); + extern __device__ __constant__ dtype DGC_##name PARENTHESES(1,__VA_ARGS__); #else #define global_both(dtype, name, ...) \ extern dtype HGC_##name PARENTHESES(1,__VA_ARGS__); From 0e3e947ca7066ca2204e9f9ebc2814c4af07fadb Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Thu, 4 May 2023 18:11:18 +0300 Subject: [PATCH 10/27] initializing hipBlas --- lib/PLEGMA.cu | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/PLEGMA.cu b/lib/PLEGMA.cu index cd933b59..deb67ae2 100644 --- a/lib/PLEGMA.cu +++ b/lib/PLEGMA.cu @@ -166,6 +166,7 @@ void plegma::PLEGMA_init(int localL[4], int nProcs[4], int verbosity){ HGC_procPosition[i] = comm_coord(i); // copying globals to device + printf("Local lattice volume %d \n", HGC_localVolume); HGC_global_vars.copyToDevice(); // create groups of process to use mpi reduce only on spatial points @@ -201,9 +202,13 @@ void plegma::PLEGMA_init(int localL[4], int nProcs[4], int verbosity){ int tmp; MPI_Comm_rank(HGC_timeComm,&tmp); assert(tmp==HGC_timeRank); - - //cublasStatus_t error = cublasCreate(&HGC_cublas_handle); - //if (error != CUBLAS_STATUS_SUCCESS) PLEGMA_error("cublasCreate failed with error %d", error); +#ifdef __HIP__ + hipblasStatus_t error = hipblasCreate(&HGC_hipblas_handle); + if (error != HIPBLAS_STATUS_SUCCESS) PLEGMA_error("hipblasCreate failed with error %d", error); +#else + cublasStatus_t error = cublasCreate(&HGC_cublas_handle); + if (error != CUBLAS_STATUS_SUCCESS) PLEGMA_error("cublasCreate failed with error %d", error); +#endif HGC_init_PLEGMA_flag = true; PLEGMA_printf("PLEGMA has been initialized\n"); From 54641628eac02797fb5b5e433f489b14fe64fbb2 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Wed, 21 Jun 2023 10:32:47 +0300 Subject: [PATCH 11/27] avoid warning --- include/PLEGMA_Hprobing.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/PLEGMA_Hprobing.h b/include/PLEGMA_Hprobing.h index bb7c5f44..2980bead 100644 --- a/include/PLEGMA_Hprobing.h +++ b/include/PLEGMA_Hprobing.h @@ -97,7 +97,7 @@ namespace plegma { arrlc = new int[Nc]; } catch (const std::bad_alloc& err) { - PLEGMA_error(err.what()); + PLEGMA_error("%s\n",err.what()); } createElemColBlock(); createColLattice(); From 2b9066cb6b7688ba4684f870fa400c6e21577d1b Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Wed, 21 Jun 2023 10:36:59 +0300 Subject: [PATCH 12/27] start running --- include/global/PLEGMA_prints.hpp | 6 +- include/global/PLEGMA_structs.h | 9 ++- include/io/PLEGMA_lime.h | 6 +- lib/CMakeLists.txt | 17 +++++ lib/PLEGMA_Correlator.cu | 6 +- lib/kernels/PLEGMA_TMDWF.cuh | 2 +- lib/kernels/PLEGMA_baryons.cuh | 2 +- lib/kernels/PLEGMA_baryons_udsc.cuh | 2 +- lib/kernels/PLEGMA_bcud_tetraquarks.cuh | 4 +- lib/kernels/PLEGMA_bcud_tetraquarks_arrays.cu | 2 +- .../PLEGMA_bcud_tetraquarks_arrays_stoch.cu | 2 +- .../PLEGMA_bcud_tetraquarks_stochastic.cu | 4 +- .../PLEGMA_heavy_light_tetraquarks.cuh | 4 +- .../PLEGMA_heavy_light_tetraquarks_arrays.cu | 2 +- ...MA_heavy_light_tetraquarks_arrays_stoch.cu | 2 +- lib/kernels/PLEGMA_kernel_getSet.cuh | 7 ++ lib/kernels/PLEGMA_kernel_tuner.cuh | 25 ++----- lib/kernels/PLEGMA_kernel_utils.cuh | 13 ++-- lib/kernels/PLEGMA_plaquette.cuh | 10 ++- lib/kernels/PLEGMA_seqSourceNucleon.cu | 2 +- lib/targets/hip/target_hip.cmake | 1 + plegma/CMakeLists.txt | 19 ++++- plegma/PDFs_nucleon.cpp | 73 ++++++++++++------- plegma/TMDPDFs_nucleon.cpp | 3 +- plegma/TMDPDFs_pion.cpp | 3 +- 25 files changed, 143 insertions(+), 83 deletions(-) diff --git a/include/global/PLEGMA_prints.hpp b/include/global/PLEGMA_prints.hpp index 9c2011a6..8110794d 100644 --- a/include/global/PLEGMA_prints.hpp +++ b/include/global/PLEGMA_prints.hpp @@ -50,7 +50,7 @@ extern class Options * HGC_options; HGC_options->checkErrors(); \ if (HGC_init_PLEGMA_flag) { \ fprintf(getOutputFile(), "%sERROR: ", getOutputPrefix()); \ - fprintf(getOutputFile(), __VA_ARGS__); \ + fprintf(getOutputFile(), "%s\n", __VA_ARGS__); \ fprintf(getOutputFile(), " (rank %d, host %s, " __FILE__ ":%d in %s())\n", \ comm_rank(), comm_hostname(), __LINE__, __func__); \ fprintf(getOutputFile(), "%s last kernel called was (name=%s,volume=%s,aux=%s)\n", \ @@ -65,12 +65,12 @@ extern class Options * HGC_options; if(rank) { \ MPI_Comm_rank(MPI_COMM_WORLD,&rank); \ printf( "ERROR: "); \ - printf(__VA_ARGS__); \ + printf("%s\n",__VA_ARGS__); \ printf(" (rank %d, " __FILE__ ":%d in %s())\n", \ rank, __LINE__, __func__); \ } else { \ printf( "ERROR: "); \ - printf(__VA_ARGS__); \ + printf("%s\n",__VA_ARGS__); \ printf(" (" __FILE__ ":%d in %s())\n", \ __LINE__, __func__); \ } \ diff --git a/include/global/PLEGMA_structs.h b/include/global/PLEGMA_structs.h index 65f2a22f..2a151b36 100644 --- a/include/global/PLEGMA_structs.h +++ b/include/global/PLEGMA_structs.h @@ -93,6 +93,9 @@ struct pointer_holder { if (err != hipSuccess) { errorQuda("Failed to copy constant host memory of size to device %zu \n", size); } + else{ + printf("No error in hipMemcpyToSymbol %d\n",err); + } //HIP_CHECK(hipMemcpyToSymbol(*devPointer, hostPointer, bytes*size)); #endif } @@ -153,8 +156,10 @@ struct global_vars { globals[i].copyToDeviceConstant(); } } - bool check() { + bool check() { for(size_t i = 0; i < globals.size(); i++) { + + std::string line = "HGC_" + globals[i].get_value(); if(globals[i].checkDeviceConstant() == false) return false; } return true; @@ -167,7 +172,7 @@ struct global_vars { PLEGMA_printf("%s",line.c_str()); } PLEGMA_printf("\nGlobal constants available on both, host and device:\n"); - for(int i = 0; i < globals.size(); i++) { + for(int i = 0; i < (int)globals.size(); i++) { if(globals[i].devPointer == nullptr) continue; if(globals[i].checkDeviceConstant()) { std::string line = "H/DGC_" + globals[i].get_value(); diff --git a/include/io/PLEGMA_lime.h b/include/io/PLEGMA_lime.h index 4d70a5a2..e0ab362a 100644 --- a/include/io/PLEGMA_lime.h +++ b/include/io/PLEGMA_lime.h @@ -11,7 +11,7 @@ inline bool exists_file (const char* name) { return ( access( name, F_OK ) != -1 ); } -static void swap_8(double *Rd, int N) +static inline void swap_8(double *Rd, int N) { char *i,*j,*k; char swap; @@ -32,7 +32,7 @@ static void swap_8(double *Rd, int N) } } -static void swap_4(float *Rd, int N) +static inline void swap_4(float *Rd, int N) { char *i,*j,*k; char swap; @@ -49,7 +49,7 @@ static void swap_4(float *Rd, int N) } } -static int isBigEndian() +static inline int isBigEndian() { union{ char C[4]; diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 7a703baa..10a09207 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -16,6 +16,7 @@ if(DEBUG_BUILD) endif() set (PLEGMA_OBJS + PLEGMA_Correlator.cu PLEGMA.cu PLEGMA_Propagator.cu PLEGMA_Vector.cu @@ -23,8 +24,24 @@ set (PLEGMA_OBJS PLEGMA_Field.cu PLEGMA_Su3field.cu PLEGMA_Random.cu + kernels/PLEGMA_baryons_NtoN.cu kernels/PLEGMA_seqSourceNucleon.cu + kernels/PLEGMA_threep_local.cu + kernels/PLEGMA_threep_noe.cu + kernels/PLEGMA_threep_oneD.cu + kernels/PLEGMA_threep_twoD.cu + kernels/PLEGMA_threep_threeD_part1.cu + kernels/PLEGMA_threep_threeD_part2.cu + kernels/PLEGMA_threep_threeD_part3.cu + kernels/PLEGMA_threep_threeD_part4.cu + kernels/PLEGMA_threep_wilsonLine.cu + kernels/PLEGMA_threep_staple.cu + kernels/PLEGMA_threep_qgq.cu + PLEGMA_QLoops.cu + PLEGMA_FT.cu PLEGMA_BLAS.cu + PLEGMA_Fmunu.cu + PLEGMA_U1Gauge.cu ) if(PLEGMA_UDSC_BARYONS) LIST(APPEND PLEGMA_OBJS diff --git a/lib/PLEGMA_Correlator.cu b/lib/PLEGMA_Correlator.cu index 3c6a32c8..2e58ed8c 100644 --- a/lib/PLEGMA_Correlator.cu +++ b/lib/PLEGMA_Correlator.cu @@ -12,9 +12,9 @@ #include #include #ifdef PLEGMA_UDSC_BARYONS -#include -#include -#include +#include +#include +#include #endif using namespace plegma; diff --git a/lib/kernels/PLEGMA_TMDWF.cuh b/lib/kernels/PLEGMA_TMDWF.cuh index bc4e253a..f544ccb3 100644 --- a/lib/kernels/PLEGMA_TMDWF.cuh +++ b/lib/kernels/PLEGMA_TMDWF.cuh @@ -4,7 +4,7 @@ using namespace plegma; const int N_TMDWF_MESONS=1; // TODO: This is hard to extend. These variables should replaced by compile-time functions. -const __device__ short int mesons_TMDWF_indices[N_TMDWF_MESONS][16][4] = {0,0,0,0,0,0,1,1,0,0,2,2,0,0,3,3,1,1,0,0,1,1,1,1,1,1,2,2,1,1,3,3,2,2,0,0,2,2,1,1,2,2,2,2,2,2,3,3,3,3,0,0,3,3,1,1,3,3,2,2,3,3,3,3}; +const __device__ short int mesons_TMDWF_indices[N_TMDWF_MESONS][16][4] = {{0,0,0,0,0,0,1,1,0,0,2,2,0,0,3,3,1,1,0,0,1,1,1,1,1,1,2,2,1,1,3,3,2,2,0,0,2,2,1,1,2,2,2,2,2,2,3,3,3,3,0,0,3,3,1,1,3,3,2,2,3,3,3,3}}; const __device__ float mesons_TMDWF_values[N_TMDWF_MESONS][16] = {-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1}; diff --git a/lib/kernels/PLEGMA_baryons.cuh b/lib/kernels/PLEGMA_baryons.cuh index 445dcc18..d2dcab86 100644 --- a/lib/kernels/PLEGMA_baryons.cuh +++ b/lib/kernels/PLEGMA_baryons.cuh @@ -189,7 +189,7 @@ static void contract_baryons_host( ProfileStruct &ps, Float2 *h_partial_block = NULL; Float2 *d_partial_block = NULL; - d_partial_block=(Float2*)device_malloc(sizeof(Float2) ); + d_partial_block=(Float2*)device_malloc(alloc_size*sizeof(Float2) ); // cudaMalloc((void**)&d_partial_block, alloc_size * sizeof(Float2) ); // Checking for allocation error. In case we return and let the tuner handle the error. /*cudaError_t error=cudaPeekAtLastError(); diff --git a/lib/kernels/PLEGMA_baryons_udsc.cuh b/lib/kernels/PLEGMA_baryons_udsc.cuh index ff66f68a..4285345c 100644 --- a/lib/kernels/PLEGMA_baryons_udsc.cuh +++ b/lib/kernels/PLEGMA_baryons_udsc.cuh @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include "PLEGMA_baryons_udsc_arrays.cuh" template void contract_baryons_udsc(PLEGMA_Propagator& propUP, PLEGMA_Propagator& propDN, diff --git a/lib/kernels/PLEGMA_bcud_tetraquarks.cuh b/lib/kernels/PLEGMA_bcud_tetraquarks.cuh index 3ecf4d06..2da7e536 100644 --- a/lib/kernels/PLEGMA_bcud_tetraquarks.cuh +++ b/lib/kernels/PLEGMA_bcud_tetraquarks.cuh @@ -1,8 +1,8 @@ #pragma once #include #include -#include -#include +#include "PLEGMA_bcud_tetraquarks_arrays.cuh" +#include "PLEGMA_bcud_tetraquarks_arrays_stoch.cuh" template void contract_tetraquarks_bcud(PLEGMA_Propagator& propLT, PLEGMA_Propagator& propST, diff --git a/lib/kernels/PLEGMA_bcud_tetraquarks_arrays.cu b/lib/kernels/PLEGMA_bcud_tetraquarks_arrays.cu index 84ccd046..008477c0 100644 --- a/lib/kernels/PLEGMA_bcud_tetraquarks_arrays.cu +++ b/lib/kernels/PLEGMA_bcud_tetraquarks_arrays.cu @@ -25,7 +25,7 @@ * bcud_J0 : {'flavs': ['bt^-up-ch^-dn', 'bt^-dn-ch^-up'], 'coeffs': [1, -1], 'spin': 0} */ #include -#include +#include"PLEGMA_bcud_tetraquarks_arrays.cuh" float2 bcud_J1_g5_gj_g5_gj_ll_vals[1536] = { {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 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}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.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 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, }; diff --git a/lib/kernels/PLEGMA_bcud_tetraquarks_arrays_stoch.cu b/lib/kernels/PLEGMA_bcud_tetraquarks_arrays_stoch.cu index 15c56928..e5341d91 100644 --- a/lib/kernels/PLEGMA_bcud_tetraquarks_arrays_stoch.cu +++ b/lib/kernels/PLEGMA_bcud_tetraquarks_arrays_stoch.cu @@ -25,7 +25,7 @@ * bcud_J0 : {'flavs': ['bt^-up-ch^-dn', 'bt^-dn-ch^-up'], 'coeffs': [1, -1], 'spin': 0} */ #include -#include +#include"PLEGMA_bcud_tetraquarks_arrays_stoch.cuh" float2 bcud_J1_g5_g1_g5_g1_ls_vals[1024] = { {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 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, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 0, }; diff --git a/lib/kernels/PLEGMA_bcud_tetraquarks_stochastic.cu b/lib/kernels/PLEGMA_bcud_tetraquarks_stochastic.cu index 5dced21d..6de8a4e1 100644 --- a/lib/kernels/PLEGMA_bcud_tetraquarks_stochastic.cu +++ b/lib/kernels/PLEGMA_bcud_tetraquarks_stochastic.cu @@ -1,5 +1,5 @@ -#include -#include +#include "PLEGMA_kernel_utils.cuh" +#include "PLEGMA_bcud_tetraquarks.cuh" template diff --git a/lib/kernels/PLEGMA_heavy_light_tetraquarks.cuh b/lib/kernels/PLEGMA_heavy_light_tetraquarks.cuh index 8c97ec31..b9b500b8 100644 --- a/lib/kernels/PLEGMA_heavy_light_tetraquarks.cuh +++ b/lib/kernels/PLEGMA_heavy_light_tetraquarks.cuh @@ -1,8 +1,8 @@ #pragma once #include #include -#include -#include +#include "PLEGMA_heavy_light_tetraquarks_arrays.cuh" +#include "PLEGMA_heavy_light_tetraquarks_arrays_stoch.cuh" template void contract_tetraquarks(PLEGMA_Propagator& propLT, PLEGMA_Propagator& propST, diff --git a/lib/kernels/PLEGMA_heavy_light_tetraquarks_arrays.cu b/lib/kernels/PLEGMA_heavy_light_tetraquarks_arrays.cu index 18ea65e1..7cde68e8 100644 --- a/lib/kernels/PLEGMA_heavy_light_tetraquarks_arrays.cu +++ b/lib/kernels/PLEGMA_heavy_light_tetraquarks_arrays.cu @@ -121,4 +121,4 @@ short bbus_gkC_Cg5_gi_gj_ll_col_contr[768*8] = { 0, 2, 1, 3, 2, 0, 3, 1, 0, 2, 1 float2 bbus_gjC_Cg5_gjC_Cg5_ll_vals[768] = { {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0},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{2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-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/PLEGMA_heavy_light_tetraquarks_arrays_stoch.cu b/lib/kernels/PLEGMA_heavy_light_tetraquarks_arrays_stoch.cu index 22a3211a..af20ab20 100644 --- a/lib/kernels/PLEGMA_heavy_light_tetraquarks_arrays_stoch.cu +++ b/lib/kernels/PLEGMA_heavy_light_tetraquarks_arrays_stoch.cu @@ -25,7 +25,7 @@ * bbus : {'flavs': ['bt^-up-bt^-sr'], 'coeffs': [1], 'spin': 1} */ #include -#include +#include"kernels/PLEGMA_heavy_light_tetraquarks_arrays_stoch.cuh" float2 bbud_g5_gj_g5_gj_ls_vals[768] = { {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0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, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {2.0, -0.0}, {-2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-2.0, 0.0}, {2.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, -0.0}, {-1.0, -0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, {1.0, -0.0}, {-1.0, 0.0}, {-1.0, 0.0}, {1.0, -0.0}, }; short bbud_g5_gj_g5_gj_ls_idxs[768*8] = { 2, 0, 3, 1, 2, 0, 2, 0, 2, 0, 3, 3, 2, 0, 0,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ernels/PLEGMA_kernel_getSet.cuh b/lib/kernels/PLEGMA_kernel_getSet.cuh index 1cfd5d6b..24e904c1 100644 --- a/lib/kernels/PLEGMA_kernel_getSet.cuh +++ b/lib/kernels/PLEGMA_kernel_getSet.cuh @@ -95,6 +95,13 @@ namespace plegma { return is4D ? HGC_localVolume : HGC_localVolume3D; #endif } + inline __host__ __device__ size_t volume_dev() const { + #if defined ( __CUDA_ARCH__ ) || ( __HIP_DEVICE_COMPILE__ ) + return is4D ? DGC_localVolume : DGC_localVolume3D; + #else + return -1; + #endif + } /* inline __host__ __device__ size_t volume() const { #if defined ( __CUDA_ARCH__ ) || ( __HIP_DEVICE_COMPILE__ ) diff --git a/lib/kernels/PLEGMA_kernel_tuner.cuh b/lib/kernels/PLEGMA_kernel_tuner.cuh index 89157680..7d698f66 100644 --- a/lib/kernels/PLEGMA_kernel_tuner.cuh +++ b/lib/kernels/PLEGMA_kernel_tuner.cuh @@ -202,10 +202,7 @@ public: sprintf(volString, "%lldx%lldx%lldx%lld", HGC_localL[0], HGC_localL[1], HGC_localL[2], HGC_localL[3]); sprintf(aux, "volume=%lld,Ndims=%d,Ncols=%d,maxvolume=%d,aux_range=(%d,%d,%d,%d)", ps.volume, N_DIMS, N_COLS, ps.max_volume, ps.aux_range.x, ps.aux_range.y, ps.aux_range.z, ps.aux_range.w); kernelName = kname + (std::string) typeid(*kernel).name(); // with cupti no longer necessary - PLEGMA_printf("Aux %s\n",aux); - PLEGMA_printf("Volstring %s\n",volString); setPolicyTuning(ps.tune_globally); - PLEGMA_printf("TUNING policy %s kernel name\n",kernelName.c_str()); // #define ADD_TO_GLOBAL // #include @@ -259,24 +256,15 @@ void PLEGMA_kernel_tuner::apply(const qudaStream_t &stream){ #else // performing tuning if we need to tune if( !ps.tuned && !activeTuning() && ps.tune_globally ) comm_barrier(); //syncronizing - if( !ps.tuned ) {PLEGMA_printf("Tuner1 \n"); - fflush(stdout); + if( !ps.tuned ) { ps.tp = tuneLaunch(*this, getTuning(), (QudaVerbosity) HGC_verbosity); } if( !ps.tuned ){ - PLEGMA_printf("Tuner2 \n"); - fflush(stdout); qudaGetLastError(); // ensuring that the error state has been clean } - PLEGMA_printf("Tuner3 \n"); - fflush(stdout); if( !activeTuning() ) ps.tuned = true; - PLEGMA_printf("Tuner4 \n"); - fflush(stdout); if( onlyTuning && !activeTuning() ) return; - PLEGMA_printf("Before launching kernels\n"); - fflush(stdout); launchKernel(ps.tp,stream); // HACK: For unknown reason, the Out Of Memory error state is not seen in QUDA/lib/tune.cpp @@ -296,15 +284,14 @@ void PLEGMA_kernel_tuner::apply(const qudaStream_t &stream){ } template -void PLEGMA_kernel_tuner::apply(){PLEGMA_printf("before device get stream\n");fflush(stdout); apply(device::get_stream(0)); } +void PLEGMA_kernel_tuner::apply(){ +apply(device::get_stream(0)); } template void PLEGMA_kernel_tuner::run(){ #ifdef PLEGMA_NO_TUNING if(!ps.tuned) tune(); - PLEGMA_printf("Here the kernel should launch\n"); - fflush(stdout); - launchKernel(ps.tp,device::get_stream(0));//,ps.tp.shared_bytes,0); + launchKernel(ps.tp,device::get_stream(0));//,ps.tp.shared_bytes,0); #else if(!ps.tuned) ps.tp = tuneLaunch(*this, QUDA_TUNE_NO, (QudaVerbosity) HGC_verbosity); launchKernel(ps.tp,device::get_stream(0)); @@ -327,9 +314,7 @@ void run(ProfileStruct &ps, std::string kname, void(* kernel)(typesK...), types& template void tuneAndRun(ProfileStruct &ps, std::string kname, void(* kernel)(typesK...), types&&... kArgs){ PLEGMA_kernel_tuner tuner(ps, kname, kernel, kArgs...); - PLEGMA_printf("before apppllly\n"); - fflush(stdout); - tuner.apply(); + tuner.apply(); } #endif diff --git a/lib/kernels/PLEGMA_kernel_utils.cuh b/lib/kernels/PLEGMA_kernel_utils.cuh index 67f7d859..0596487d 100644 --- a/lib/kernels/PLEGMA_kernel_utils.cuh +++ b/lib/kernels/PLEGMA_kernel_utils.cuh @@ -805,10 +805,10 @@ namespace plegma { int r = blockDim.x%2; while (i > 0){ __syncthreads(); - if(threadIdx.x < i){ + if((int)threadIdx.x < i){ for(int ip = 0 ; ip < n_comp ; ip++) { shared_cache[ip*blockDim.x + threadIdx.x] = shared_cache[ip*blockDim.x + threadIdx.x] + shared_cache[ip*blockDim.x + threadIdx.x + i]; - if(r==1 && threadIdx.x==i-1) + if(r==1 && (int)threadIdx.x==i-1) shared_cache[ip*blockDim.x + threadIdx.x] = shared_cache[ip*blockDim.x + threadIdx.x] + shared_cache[ip*blockDim.x + threadIdx.x + i+1]; } } @@ -1065,10 +1065,11 @@ namespace plegma { } } - -//---------------------------// -// Used in Plegma_topocharge | -//---------------------------\\ +/** + --------------------------- + Used in Plegma_topocharge + --------------------------- + **/ template __inline__ __device__ void init_to_zero(Float2 a[N_COLS][N_COLS]){ diff --git a/lib/kernels/PLEGMA_plaquette.cuh b/lib/kernels/PLEGMA_plaquette.cuh index 05403eb9..963988b3 100644 --- a/lib/kernels/PLEGMA_plaquette.cuh +++ b/lib/kernels/PLEGMA_plaquette.cuh @@ -44,7 +44,7 @@ static __global__ void calculatePlaquette_device(gaugeTex gTex, Float *p int sid = blockIdx.x*blockDim.x + threadIdx.x; int cacheIndex = threadIdx.x; - if (sid < gTex.volume()) { + if (sid < gTex.volume_dev()) { Float2 G1[N_COLS][N_COLS], G2[N_COLS][N_COLS], G3[N_COLS][N_COLS], G4[N_COLS][N_COLS]; Float trace = 0.; @@ -85,6 +85,8 @@ static void calculatePlaquette_host(ProfileStruct& ps, TG gTex, Float& plaquette Float *d_partial_plaq = NULL; int gridDimX = ps.tp.grid.x; d_partial_plaq=(Float*)device_malloc( gridDimX * sizeof(Float)); + PLEGMA_printf("calculate Plaquette host %d\n", gridDimX); + fflush(stdout); calculatePlaquette_device<<>>(gTex, d_partial_plaq); Float *h_partial_plaq = NULL; @@ -104,7 +106,11 @@ template static Float calculatePlaquette(TG gTex){ assert(gTex.is4D); // TODO: For 3D we should not compute the plaquette in T + PLEGMA_printf("gTex.volume() %d\n", gTex.volume()); + fflush(stdout); ProfileStruct ps(gTex.volume(),sizeof(Float)); + PLEGMA_printf("ps.tp.grid.x %d\n", ps.tp.grid.x); + fflush(stdout); Float plaquette; std::string nameK; int normC; @@ -117,6 +123,8 @@ static Float calculatePlaquette(TG gTex){ normC=1; } else assert(false); + PLEGMA_printf("Before tuneAndRun\n"); + fflush(stdout); tuneAndRun(ps, nameK, calculatePlaquette_host, ps, gTex, plaquette); Float globalPlaquette = 0.; diff --git a/lib/kernels/PLEGMA_seqSourceNucleon.cu b/lib/kernels/PLEGMA_seqSourceNucleon.cu index e7be573f..25721ef1 100644 --- a/lib/kernels/PLEGMA_seqSourceNucleon.cu +++ b/lib/kernels/PLEGMA_seqSourceNucleon.cu @@ -26,7 +26,7 @@ __device__ void contractNucleonSeqSource(vector2& vec, propTex& } else{ printf("Error: You can use only PROTON or NEUTRON\n"); - asm("trap;"); +// asm("s_trap;"); } #ifdef PLEGMA_SCATTERING_CONTRACTIONS diff --git a/lib/targets/hip/target_hip.cmake b/lib/targets/hip/target_hip.cmake index c691f926..e0ca75e2 100644 --- a/lib/targets/hip/target_hip.cmake +++ b/lib/targets/hip/target_hip.cmake @@ -125,6 +125,7 @@ target_compile_options( -Wno-unknown-pragmas -Wno-unused-result -Wno-deprecated-register -dc + -fgpu-rdc --hip-link -fopenmp $<$:-Werror diff --git a/plegma/CMakeLists.txt b/plegma/CMakeLists.txt index 99544915..b668f342 100644 --- a/plegma/CMakeLists.txt +++ b/plegma/CMakeLists.txt @@ -1,4 +1,5 @@ -set(PLEGMA_LIBS plegma PLEGMAutils ${CMAKE_THREAD_LIBS_INIT} ${QUDA_LIB} /opt/cray/pe/hdf5-parallel/1.12.1.5/gnu/9.1/lib/libhdf5_parallel.so.200 ${MPI_CXX_LIBRARIES} /pfs/lustrep2/projappl/project_462000125/samantao-public/rocm/rocm-5.2.3/hip/lib/libamdhip64.so /pfs/lustrep2/projappl/project_462000125/samantao-public/rocm/rocm-5.2.3/rccl/lib/librccl.so) +set(PLEGMA_LIBS plegma PLEGMAutils ${CMAKE_THREAD_LIBS_INIT} ${QUDA_LIB} ${MPI_CXX_LIBRARIES} ${HDF5_LIBRARIES}/libhdf5_parallel.so.200) +#opt/cray/pe/hdf5-parallel/1.12.1.5/gnu/9.1/lib/libhdf5_parallel.so.200 ${MPI_CXX_LIBRARIES} /pfs/lustrep2/projappl/project_462000125/samantao-public/rocm/rocm-5.3.3/hip/lib/libamdhip64.so) LIST(APPEND PLEGMA_LIBS ${MPI_CXX_LIBRARIES}) @@ -33,8 +34,20 @@ if(PLEGMA_MKL) endif(PLEGMA_MKL) #define PLEGMA executables - -add_executable(Plaquette Plaquette.cpp) +#if(NOT DEFINED(HCC_HOME)) +# set(HCC_HOME "${HIP_PATH}/../llvm/bin") +#endif() +#set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_HOME} -o ") +#set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} -o ") +#set(HIPCC "${HIP_PATH}/bin/hipcc") +if(${PLEGMA_TARGET_TYPE} STREQUAL "HIP") + find_package(HIPWrapper) +endif() +hip_add_executable(Plaquette Plaquette.cpp) +set_property(TARGET Plaquette PROPERTY HIP_ARCHITECTURES gfx90a) +message("Stop ${CMAKE_HIP_COMPILE_OBJECT}") +message("SAS ${CMAKE_HIP_LINK_EXECUTABLE}") +#set_source_files_properties(Plaquette.cpp PROPERTIES LANGUAGE HIP) target_link_libraries(Plaquette ${PLEGMA_LIBS}) add_executable(Topo Topo.cpp) diff --git a/plegma/PDFs_nucleon.cpp b/plegma/PDFs_nucleon.cpp index 2a2b170b..64f40c89 100644 --- a/plegma/PDFs_nucleon.cpp +++ b/plegma/PDFs_nucleon.cpp @@ -37,6 +37,14 @@ int main(int argc, char **argv) size_t stepStout = 5; HGC_options->set("stout-steps", "Save the PDFs every step_stout stout smearing step", verbosity, stepStout); + bool calc3pt = true ; + HGC_options->set("calc3pt", "If true then the 3pt function is computed", verbosity, calc3pt); + + std::string proj ; + HGC_options->set("which_projector", "Which projector to use for 3pt function", verbosity, proj); + WHICHPROJECTOR which_proj=get_projector(proj.c_str()); + + /* We consider the momenta in the symmetric frame. Both P-momentum and Delta-momentum are vectors having three components. @@ -119,14 +127,21 @@ int main(int argc, char **argv) // ensuring mu positive if(mu<0) mu*=-1.; - TIME(QUDA_solver solver(mu)); + QUDA_solver *solver = new QUDA_solver(mu); - PLEGMA_Propagator propUP(BOTH); - PLEGMA_Propagator propDN(BOTH); - PLEGMA_Propagator propUP_SL(tSinks.size()>0 ? BOTH:NONE, FIRST_CORNER); - PLEGMA_Propagator propDN_SL(tSinks.size()>0 ? BOTH:NONE, FIRST_CORNER); - + PLEGMA_Propagator *propUP = new PLEGMA_Propagator(BOTH); + PLEGMA_Propagator *propDN = new PLEGMA_Propagator(BOTH); + + PLEGMA_Propagator *propUP_SL=new PLEGMA_Propagator(tSinks.size()>0 ? BOTH:NONE, FIRST_CORNER); + PLEGMA_Propagator *propDN_SL=new PLEGMA_Propagator(tSinks.size()>0 ? BOTH:NONE, FIRST_CORNER); + + PLEGMA_Propagator *propIn = new PLEGMA_Propagator(BOTH); + + PLEGMA_Propagator *seqPropOut = new PLEGMA_Propagator(BOTH); + + PLEGMA_Propagator *propExchange = nullptr; + PLEGMA_Gauge gaugeWL; PLEGMA_Gauge *AuxSinkGauge; if(isGPD) AuxSinkGauge = smearedGauge_sink; else AuxSinkGauge = &smearedGauge; @@ -137,12 +152,12 @@ int main(int argc, char **argv) PLEGMA_Gauge3D smearedGauge3D; smearedGauge3D.absorb(smearedGauge, source[DIM_T]); - auto computePropagator = [&](PLEGMA_Propagator& prop_SS, PLEGMA_Propagator& prop_SL, + auto computePropagator = [&](PLEGMA_Propagator* prop_SS, PLEGMA_Propagator* prop_SL, double run_mu) { // ensuring mu value if(mu != run_mu) { mu = run_mu; - solver.UpdateSolver(); + solver->UpdateSolver(); } for(int isc = 0 ; isc < 12 ; isc++){ PLEGMA_Vector vectorInOut; @@ -155,18 +170,18 @@ int main(int argc, char **argv) // Inverting PLEGMA_printf("Going to invert %s for component %d\n", run_mu>0 ? "UP" : "DN", isc); - TIME(solver.solve(vectorInOut, vectorInOut)); - if(prop_SL.getAllocation() != NONE) { + TIME(solver->solve(vectorInOut, vectorInOut)); + if(prop_SL->getAllocation() != NONE) { PLEGMA_Vector vectorAuxF; vectorAuxF.copy(vectorInOut); - prop_SL.absorb(vectorAuxF, isc/3, isc%3); + prop_SL->absorb(vectorAuxF, isc/3, isc%3); } { // Smearing the solution PLEGMA_Vector vectorAuxD; PLEGMA_Vector vectorAuxF; TIME(vectorAuxD.gaussianSmearing(vectorInOut, smearedGauge, nsmearGauss, alphaGauss)); vectorAuxF.copy(vectorAuxD); - prop_SS.absorb(vectorAuxF, isc/3, isc%3); + prop_SS->absorb(vectorAuxF, isc/3, isc%3); } } }; @@ -186,15 +201,14 @@ int main(int argc, char **argv) PLEGMA_Gauge3D smearedGauge3D_sink; smearedGauge3D_sink.absorb(*AuxSinkGauge, global_fixSinkTime); - propUP3D.absorb(propUP_SL, global_fixSinkTime); - propDN3D.absorb(propDN_SL, global_fixSinkTime); for(int isc = 0 ; isc < 12 ; isc++){ PLEGMA_Vector3D vectorAuxD; PLEGMA_Vector3D vectorAuxD2; PLEGMA_Vector3D vectorAuxF; - vectorAuxF.absorb(propUP3D,isc/3, isc%3); + vectorAuxF.absorb(*propUP_SL,global_fixSinkTime,isc/3, isc%3); vectorAuxD2.copy(vectorAuxF); + TIME(vectorAuxD.gaussianSmearing(vectorAuxD2, smearedGauge3D_sink, nsmearGauss, alphaGauss)); vectorAuxF.copy(vectorAuxD); propUP3D.absorb(vectorAuxF,isc/3, isc%3); @@ -203,7 +217,7 @@ int main(int argc, char **argv) PLEGMA_Vector3D vectorAuxD; PLEGMA_Vector3D vectorAuxD2; PLEGMA_Vector3D vectorAuxF; - vectorAuxF.absorb(propDN3D,isc/3, isc%3); + vectorAuxF.absorb(*propDN_SL,global_fixSinkTime,isc/3, isc%3); vectorAuxD2.copy(vectorAuxF); TIME(vectorAuxD.gaussianSmearing(vectorAuxD2, smearedGauge3D_sink, nsmearGauss, alphaGauss)); vectorAuxF.copy(vectorAuxD); @@ -224,6 +238,10 @@ int main(int argc, char **argv) for(int nu = 0 ; nu < 4 ; nu++) for(int c2 = 0 ; c2 < 3 ; c2++){ PLEGMA_Vector3D vectorAux3D; + PLEGMA_Vector vectorAuxF; + PLEGMA_Vector vectorAuxD; + PLEGMA_Vector vectorOut,vectorIn; + if(nucleon == PROTON) vectorAux3D.seqSourceNucleon(propUP3D, propDN3D, which_proj, nucleon, nu, c2); else @@ -274,7 +292,7 @@ int main(int argc, char **argv) su3.absorbDir_device(gaugeWL, WilsDir); WL.setUnit( (std::vector) {0,4,8}); for(int i = 0 ; i < HGC_totalL[WilsDir]/2;i++){ - corrThrpWL.contractNucleonThrp_wilsonLine(*seqPropOut, *propF, WL, signProps, gammas); + corrThrpWL.contractNucleonThrp_wilsonLine(*seqPropOut, *propF, WL, signProps, gammas,0, (std::string)""); if(signPer < 0) for(int iv = 0 ; iv < corrThrpWL.getTotalSize()*2; iv++) corrThrpWL.H_elem()[iv] *= signPer; corrThrpWL.writeASCII( (threep_filename + suff + std::to_string(i) + "_ts_" + std::to_string(tSinks[ts]) + ".dat").c_str() ); propExchange = propIn; propIn = propF; propF = propExchange; @@ -287,7 +305,7 @@ int main(int argc, char **argv) su3.absorbDir_device(gaugeWL, WilsDir); // only for z direction WL.setUnit( (std::vector) {0,4,8}); for(int i = 0 ; i < HGC_totalL[WilsDir]/2;i++){ // HGC_totalL[2] only for z direction - corrThrpWL.contractNucleonThrp_wilsonLine(*seqPropOut, *propF, WL, signProps, gammas); + corrThrpWL.contractNucleonThrp_wilsonLine(*seqPropOut, *propF, WL, signProps, gammas,0, (std::string)""); if(signPer < 0) for(int iv = 0 ; iv < corrThrpWL.getTotalSize()*2; iv++) corrThrpWL.H_elem()[iv] *= signPer; corrThrpWL.writeASCII( (threep_filename + suff + std::to_string(i) + "_ts_" + std::to_string(tSinks[ts]) + ".dat").c_str() ); propExchange = propIn; propIn = propF; propF = propExchange; @@ -303,6 +321,9 @@ int main(int argc, char **argv) for(int nu = 0 ; nu < 4 ; nu++) for(int c2 = 0 ; c2 < 3 ; c2++){ PLEGMA_Vector3D vectorAux3D; + PLEGMA_Vector vectorOut,vectorIn; + PLEGMA_Vector vectorAuxD; + PLEGMA_Vector vectorAuxF; if(nucleon == PROTON) vectorAux3D.seqSourceNucleon(propUP3D, which_proj, nucleon, nu, c2); else @@ -353,7 +374,7 @@ int main(int argc, char **argv) su3.absorbDir_device(gaugeWL, WilsDir); WL.setUnit( (std::vector) {0,4,8}); for(int i = 0 ; i < HGC_totalL[WilsDir]/2;i++){ // HGC_totalL[2] only for z direction - corrThrpWL.contractNucleonThrp_wilsonLine(*seqPropOut, *propF, WL, signProps, gammas); + corrThrpWL.contractNucleonThrp_wilsonLine(*seqPropOut, *propF, WL, signProps, gammas,0, (std::string)""); if(signPer < 0) for(int iv = 0 ; iv < corrThrpWL.getTotalSize()*2; iv++) corrThrpWL.H_elem()[iv] *= signPer; corrThrpWL.writeASCII( (threep_filename + suff + std::to_string(i) + "_ts_" + std::to_string(tSinks[ts]) + ".dat").c_str() ); propExchange = propIn; propIn = propF; propF = propExchange; @@ -366,7 +387,7 @@ int main(int argc, char **argv) su3.absorbDir_device(gaugeWL, WilsDir); WL.setUnit( (std::vector) {0,4,8}); for(int i = 0 ; i < HGC_totalL[WilsDir]/2;i++){ // HGC_totalL[2] only for z direction - corrThrpWL.contractNucleonThrp_wilsonLine(*seqPropOut, *propF, WL, signProps, gammas); + corrThrpWL.contractNucleonThrp_wilsonLine(*seqPropOut, *propF, WL, signProps, gammas,0, (std::string)""); if(signPer < 0) for(int iv = 0 ; iv < corrThrpWL.getTotalSize()*2; iv++) corrThrpWL.H_elem()[iv] *= signPer; corrThrpWL.writeASCII( (threep_filename + suff + std::to_string(i) + "_ts_" + std::to_string(tSinks[ts]) + ".dat").c_str() ); propExchange = propIn; propIn = propF; propF = propExchange; @@ -379,16 +400,16 @@ int main(int argc, char **argv) } } - propUP.rotateToPhysicalBase_device(+1); - propDN.rotateToPhysicalBase_device(-1); - propUP.applyBoundaries_device(source[3]); - propDN.applyBoundaries_device(source[3]); + propUP->rotateToPhysicalBase_device(+1); + propDN->rotateToPhysicalBase_device(-1); + propUP->applyBoundaries_device(source[3]); + propDN->applyBoundaries_device(source[3]); PLEGMA_Correlator corr(corr_space, source, maxQsq); - TIME(corr.contractMesons(propUP, propDN)); + TIME(corr.contractMesons(*propUP, *propDN)); THREAD(corr.writeFile(twop_filename, corr_file_format)); - TIME(corr.contractBaryons(propUP, propDN)); + TIME(corr.contractBaryons(*propUP, *propDN)); THREAD(corr.writeFile(twop_filename, corr_file_format)); } if(isGPD) delete smearedGauge_sink; diff --git a/plegma/TMDPDFs_nucleon.cpp b/plegma/TMDPDFs_nucleon.cpp index 463873a2..f5b2e2f7 100644 --- a/plegma/TMDPDFs_nucleon.cpp +++ b/plegma/TMDPDFs_nucleon.cpp @@ -12,6 +12,7 @@ int main(int argc, char **argv) "corr-space", "tSinks","Projs","xiMomSm","sinkMom","which_particle","gammas"}; initializeOptions(argc, argv, true, listOpt); + std::vector sinkMom = {0,0,0}; int L_LEN; HGC_options->set("l-len", "length of l", verbosity, L_LEN); @@ -61,7 +62,7 @@ int main(int argc, char **argv) initGaugeQuda(gauge, true, QUDA_WILSON_LINKS); plaqQuda(); - WHICHPARTICLE nucleon = which_particle; + WHICHPARTICLE nucleon = PROTON; if(nucleon!=NEUTRON && nucleon!=PROTON) PLEGMA_error("Only nucleon PDFs have been implemented so far\n"); // Smearing diff --git a/plegma/TMDPDFs_pion.cpp b/plegma/TMDPDFs_pion.cpp index b929173d..3ad3563a 100644 --- a/plegma/TMDPDFs_pion.cpp +++ b/plegma/TMDPDFs_pion.cpp @@ -16,7 +16,8 @@ int main(int argc, char **argv) if(mu<0){ mu *= -1.0; } - + + std::vector sinkMom = {0,0,0}; double mu_ud = mu; double mu_s; From ad963840a9543f5d49b0a866d4abb05f630e55e6 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Thu, 29 Jun 2023 16:16:49 +0300 Subject: [PATCH 13/27] including -O3 in the CXX and HIP flags --- lib/CMakeLists.txt | 2 +- lib/targets/hip/target_hip.cmake | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 10a09207..b83ab99f 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -148,7 +148,7 @@ target_link_options(plegma PRIVATE $<$:$<${PLEGMA_LINKER_COMPRESS} # set up QUDA compile options, put them before target specific options target_compile_options( plegma BEFORE PRIVATE $<$: - $,-w,-Wall -Wextra> + $,-w, -O3 -Wall -Wextra> $<$:-Werror> >) diff --git a/lib/targets/hip/target_hip.cmake b/lib/targets/hip/target_hip.cmake index e0ca75e2..fb765ac4 100644 --- a/lib/targets/hip/target_hip.cmake +++ b/lib/targets/hip/target_hip.cmake @@ -62,13 +62,13 @@ set(CMAKE_HIP_FLAGS_RELEASE "-O3 -w" CACHE STRING "Flags used by the CUDA compiler during release builds.") set(CMAKE_HIP_FLAGS_HOSTDEBUG - "-g" + "-g -O3" CACHE STRING "Flags used by the C++ compiler during host-debug builds.") set(CMAKE_HIP_FLAGS_DEBUG - "-g -G" + "-g -G -O3" CACHE STRING "Flags used by the C++ compiler during full (host+device) debug builds.") set(CMAKE_HIP_FLAGS_SANITIZE - "-g " + "-g -O3" CACHE STRING "Flags used by the C++ compiler during sanitizer debug builds.") mark_as_advanced(CMAKE_HIP_FLAGS_DEVEL) @@ -122,6 +122,7 @@ target_compile_options( plegma PRIVATE -Wall -Wextra + -O3 -Wno-unknown-pragmas -Wno-unused-result -Wno-deprecated-register -dc From ff1b60e7892f02598f3be02b00bd0623975e0596 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 8 Aug 2023 16:13:31 +0300 Subject: [PATCH 14/27] adding openmp flags --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe6923dc..4123de5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -455,6 +455,7 @@ IF(USE_OpenMP) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler ${OpenMP_CXX_FLAGS}") + set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -Xcompiler ${OpenMP_CXX_FLAGS}") ENDIF() ENDIF() From 25e54ec7400859e95b7a038aa34d9248547abf57 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 8 Aug 2023 16:21:15 +0300 Subject: [PATCH 15/27] for debugging it is very useful to remove -O3 flag, the compilation time reduces a lot --- include/global/PLEGMA_prints.hpp | 6 +++--- lib/CMakeLists.txt | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/global/PLEGMA_prints.hpp b/include/global/PLEGMA_prints.hpp index 8110794d..1c864d16 100644 --- a/include/global/PLEGMA_prints.hpp +++ b/include/global/PLEGMA_prints.hpp @@ -50,7 +50,7 @@ extern class Options * HGC_options; HGC_options->checkErrors(); \ if (HGC_init_PLEGMA_flag) { \ fprintf(getOutputFile(), "%sERROR: ", getOutputPrefix()); \ - fprintf(getOutputFile(), "%s\n", __VA_ARGS__); \ + fprintf(getOutputFile(), __VA_ARGS__); \ fprintf(getOutputFile(), " (rank %d, host %s, " __FILE__ ":%d in %s())\n", \ comm_rank(), comm_hostname(), __LINE__, __func__); \ fprintf(getOutputFile(), "%s last kernel called was (name=%s,volume=%s,aux=%s)\n", \ @@ -65,12 +65,12 @@ extern class Options * HGC_options; if(rank) { \ MPI_Comm_rank(MPI_COMM_WORLD,&rank); \ printf( "ERROR: "); \ - printf("%s\n",__VA_ARGS__); \ + printf(__VA_ARGS__); \ printf(" (rank %d, " __FILE__ ":%d in %s())\n", \ rank, __LINE__, __func__); \ } else { \ printf( "ERROR: "); \ - printf("%s\n",__VA_ARGS__); \ + printf(__VA_ARGS__); \ printf(" (" __FILE__ ":%d in %s())\n", \ __LINE__, __func__); \ } \ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index b83ab99f..21df942a 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -146,6 +146,7 @@ target_link_options(plegma PRIVATE $<$:$<${PLEGMA_LINKER_COMPRESS} # set up QUDA compile options, put them before target specific options +# You have to set -O3 target_compile_options( plegma BEFORE PRIVATE $<$: $,-w, -O3 -Wall -Wextra> From c1a9dc86a77a6daf1a728f9d0d33e57a26a7415b Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 8 Aug 2023 16:21:56 +0300 Subject: [PATCH 16/27] removing debug printf --- lib/kernels/PLEGMA_plaquette.cuh | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/kernels/PLEGMA_plaquette.cuh b/lib/kernels/PLEGMA_plaquette.cuh index 963988b3..a2327a0c 100644 --- a/lib/kernels/PLEGMA_plaquette.cuh +++ b/lib/kernels/PLEGMA_plaquette.cuh @@ -85,8 +85,6 @@ static void calculatePlaquette_host(ProfileStruct& ps, TG gTex, Float& plaquette Float *d_partial_plaq = NULL; int gridDimX = ps.tp.grid.x; d_partial_plaq=(Float*)device_malloc( gridDimX * sizeof(Float)); - PLEGMA_printf("calculate Plaquette host %d\n", gridDimX); - fflush(stdout); calculatePlaquette_device<<>>(gTex, d_partial_plaq); Float *h_partial_plaq = NULL; From 74f4766296f3ccedaa7684bce397bc9079f0ab60 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 8 Aug 2023 16:25:23 +0300 Subject: [PATCH 17/27] add target link options --- lib/kernels/PLEGMA_vector_utils.cuh | 6 ++++-- lib/targets/hip/target_hip.cmake | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/kernels/PLEGMA_vector_utils.cuh b/lib/kernels/PLEGMA_vector_utils.cuh index fe4d090f..e11b283c 100644 --- a/lib/kernels/PLEGMA_vector_utils.cuh +++ b/lib/kernels/PLEGMA_vector_utils.cuh @@ -169,6 +169,7 @@ static __global__ void copy_from_QUDA_kernel(FloatOut *out, FloatIn *inEven, Flo Float2 *inOdd2 = (Float2 *) inOdd; Float2 *out2 = (Float2 *) out; + #pragma unroll for(int mu = 0 ; mu < N_SPINS ; mu++) { #pragma unroll @@ -191,6 +192,8 @@ static __global__ void copy_from_QUDA_kernel(FloatOut *out, FloatIn *inEven, Flo template static void copy_from_QUDA(FloatOut* out, ColorSpinorField &qudaVec, bool isEven){ ProfileStruct ps(HGC_localVolume); + PLEGMA_printf("qudaVec.SiteSubset() %d \n",qudaVec.SiteSubset()); + PLEGMA_printf("isEven() %d \n",isEven); if( qudaVec.SiteSubset() == QUDA_PARITY_SITE_SUBSET ){ if( isEven ) tuneAndRun(ps, "copy_from_QUDA_kernel", copy_from_QUDA_kernel,out,(FloatIn*) qudaVec.V(), (FloatIn*) NULL); @@ -270,8 +273,7 @@ static void compute_rms(const PLEGMA_Vector3D &vec, std::vector &lis checkQudaError(); qudaMemcpy(d_listR2,listR2.data(), listR2.size() * sizeof(int), qudaMemcpyHostToDevice); checkQudaError(); - qudaMemset(d_absPsi,0,absPsi.size() * sizeof(Float)); - //checkQudaError(); + qudaMemset(d_absPsi,0,absPsi.size() * sizeof(Float)); checkQudaError(); thrust::counting_iterator first(0); thrust::counting_iterator last = first + HGC_localVolume3D; typedef thrust::device_ptr > DpF2; diff --git a/lib/targets/hip/target_hip.cmake b/lib/targets/hip/target_hip.cmake index fb765ac4..9aa52b99 100644 --- a/lib/targets/hip/target_hip.cmake +++ b/lib/targets/hip/target_hip.cmake @@ -134,6 +134,22 @@ target_compile_options( $<$:-fsanitize=address -fsanitize=undefined>) +target_link_options( + plegma + PRIVATE -Wall + -Wextra + -O3 + -Wno-unknown-pragmas + -Wno-unused-result + -Wno-deprecated-register -dc + -fgpu-rdc + --hip-link + -fopenmp + $<$:-Werror + -Wno-error=pass-failed> + $<$:-fsanitize=address + -fsanitize=undefined>) + set_source_files_properties( ${PLEGMA_CU_OBJS} PROPERTIES LANGUAGE HIP) # malloc.cpp uses both the driver and runtime api So we need to find the CUDA_CUDA_LIBRARY (driver api) or the stub # version for cmake 3.8 and later this has been integrated into FindCUDALibs.cmake From d300de15ddd4cbd30bfd22f0e46a37596f435a01 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 8 Aug 2023 16:26:24 +0300 Subject: [PATCH 18/27] changing add_executables to hip_add_executables --- plegma/CMakeLists.txt | 115 ++++++++++++++++++++++-------------------- 1 file changed, 59 insertions(+), 56 deletions(-) diff --git a/plegma/CMakeLists.txt b/plegma/CMakeLists.txt index b668f342..521f540d 100644 --- a/plegma/CMakeLists.txt +++ b/plegma/CMakeLists.txt @@ -1,4 +1,4 @@ -set(PLEGMA_LIBS plegma PLEGMAutils ${CMAKE_THREAD_LIBS_INIT} ${QUDA_LIB} ${MPI_CXX_LIBRARIES} ${HDF5_LIBRARIES}/libhdf5_parallel.so.200) +set(PLEGMA_LIBS plegma PLEGMAutils ${CMAKE_THREAD_LIBS_INIT} ${QUDA_LIB} ${MPI_CXX_LIBRARIES} ${HDF5_LIBRARIES}/libhdf5_parallel.so.200 -fopenmp ) #opt/cray/pe/hdf5-parallel/1.12.1.5/gnu/9.1/lib/libhdf5_parallel.so.200 ${MPI_CXX_LIBRARIES} /pfs/lustrep2/projappl/project_462000125/samantao-public/rocm/rocm-5.3.3/hip/lib/libamdhip64.so) LIST(APPEND PLEGMA_LIBS ${MPI_CXX_LIBRARIES}) @@ -50,165 +50,168 @@ message("SAS ${CMAKE_HIP_LINK_EXECUTABLE}") #set_source_files_properties(Plaquette.cpp PROPERTIES LANGUAGE HIP) target_link_libraries(Plaquette ${PLEGMA_LIBS}) -add_executable(Topo Topo.cpp) +hip_add_executable(Topo Topo.cpp) target_link_libraries(Topo ${PLEGMA_LIBS}) -add_executable(Calc_2pt Calc_2pt.cpp) +hip_add_executable(Calc_2pt Calc_2pt.cpp) target_link_libraries(Calc_2pt ${PLEGMA_LIBS}) -add_executable(Calc_2pt_wilson Calc_2pt_wilson.cpp) +hip_add_executable(Calc_2pt_marconi Calc_2pt_marconi.cpp) +target_link_libraries(Calc_2pt_marconi ${PLEGMA_LIBS}) + +hip_add_executable(Calc_2pt_wilson Calc_2pt_wilson.cpp) target_link_libraries(Calc_2pt_wilson ${PLEGMA_LIBS}) -add_executable(Tetraquark Tetraquark.cpp) +hip_add_executable(Tetraquark Tetraquark.cpp) target_link_libraries(Tetraquark ${PLEGMA_LIBS}) -add_executable(TetraquarkBCUD TetraquarkBCUD.cpp) +hip_add_executable(TetraquarkBCUD TetraquarkBCUD.cpp) target_link_libraries(TetraquarkBCUD ${PLEGMA_LIBS}) -add_executable(TestFrame EXCLUDE_FROM_ALL TestFrame.cpp) +hip_add_executable(TestFrame EXCLUDE_FROM_ALL TestFrame.cpp) target_link_libraries(TestFrame ${PLEGMA_LIBS}) -add_executable(StochasticTetraquark StochasticTetraquark.cpp) +hip_add_executable(StochasticTetraquark StochasticTetraquark.cpp) target_link_libraries(StochasticTetraquark ${PLEGMA_LIBS}) -add_executable(StochasticTetraquarkBCUD StochasticTetraquarkBCUD.cpp) +hip_add_executable(StochasticTetraquarkBCUD StochasticTetraquarkBCUD.cpp) target_link_libraries(StochasticTetraquarkBCUD ${PLEGMA_LIBS}) -add_executable(ComputeLightStochProp ComputeLightStochProp.cpp) +hip_add_executable(ComputeLightStochProp ComputeLightStochProp.cpp) target_link_libraries(ComputeLightStochProp ${PLEGMA_LIBS}) -add_executable(ComputeLightPointProp ComputeLightPointProp.cpp) +hip_add_executable(ComputeLightPointProp ComputeLightPointProp.cpp) target_link_libraries(ComputeLightPointProp ${PLEGMA_LIBS}) -add_executable(Calc_2pt_charmonium Calc_2pt_charmonium.cpp) +hip_add_executable(Calc_2pt_charmonium Calc_2pt_charmonium.cpp) target_link_libraries(Calc_2pt_charmonium ${PLEGMA_LIBS}) -add_executable(PDFs_nucleon PDFs_nucleon.cpp) +hip_add_executable(PDFs_nucleon PDFs_nucleon.cpp) target_link_libraries(PDFs_nucleon ${PLEGMA_LIBS}) -add_executable(TMDPDFs_nucleon TMDPDFs_nucleon.cpp) +hip_add_executable(TMDPDFs_nucleon TMDPDFs_nucleon.cpp) target_link_libraries(TMDPDFs_nucleon ${PLEGMA_LIBS}) -add_executable(PDFs_qgq_nucleon PDFs_qgq_nucleon.cpp) +hip_add_executable(PDFs_qgq_nucleon PDFs_qgq_nucleon.cpp) target_link_libraries(PDFs_qgq_nucleon ${PLEGMA_LIBS}) -add_executable(nucleon_2pt_3pt nucleon_2pt_3pt.cpp) +hip_add_executable(nucleon_2pt_3pt nucleon_2pt_3pt.cpp) target_link_libraries(nucleon_2pt_3pt ${PLEGMA_LIBS}) -add_executable(nucleon_2pt_3pt_npi nucleon_2pt_3pt_npi.cpp) +hip_add_executable(nucleon_2pt_3pt_npi nucleon_2pt_3pt_npi.cpp) target_link_libraries(nucleon_2pt_3pt_npi ${PLEGMA_LIBS}) -add_executable(mesons_3pt mesons_3pt.cpp) +hip_add_executable(mesons_3pt mesons_3pt.cpp) target_link_libraries(mesons_3pt ${PLEGMA_LIBS}) -add_executable(correcting_ZM EXCLUDE_FROM_ALL correcting_ZM.cpp) +hip_add_executable(correcting_ZM EXCLUDE_FROM_ALL correcting_ZM.cpp) target_link_libraries(correcting_ZM ${PLEGMA_LIBS}) -add_executable(Source EXCLUDE_FROM_ALL Source.cpp) +hip_add_executable(Source EXCLUDE_FROM_ALL Source.cpp) target_link_libraries(Source ${PLEGMA_LIBS}) -add_executable(Random EXCLUDE_FROM_ALL Random.cpp) +hip_add_executable(Random EXCLUDE_FROM_ALL Random.cpp) target_link_libraries(Random ${PLEGMA_LIBS}) -add_executable(Dilution EXCLUDE_FROM_ALL Dilution.cpp) +hip_add_executable(Dilution EXCLUDE_FROM_ALL Dilution.cpp) target_link_libraries(Dilution ${PLEGMA_LIBS}) -add_executable(testLinksSmearings EXCLUDE_FROM_ALL testLinksSmearings.cpp) +hip_add_executable(testLinksSmearings EXCLUDE_FROM_ALL testLinksSmearings.cpp) target_link_libraries(testLinksSmearings ${PLEGMA_LIBS}) -add_executable(testHDF5 EXCLUDE_FROM_ALL testHDF5.cpp) +hip_add_executable(testHDF5 EXCLUDE_FROM_ALL testHDF5.cpp) target_link_libraries(testHDF5 ${PLEGMA_LIBS}) -add_executable(qLoops qLoops.cpp) +hip_add_executable(qLoops qLoops.cpp) target_link_libraries(qLoops ${PLEGMA_LIBS}) -add_executable(qLoops_WilsonLine qLoops_WilsonLine.cpp) +hip_add_executable(qLoops_WilsonLine qLoops_WilsonLine.cpp) target_link_libraries(qLoops_WilsonLine ${PLEGMA_LIBS}) -add_executable(gLoops_WilsonLine gLoops_WilsonLine.cpp) +hip_add_executable(gLoops_WilsonLine gLoops_WilsonLine.cpp) target_link_libraries(gLoops_WilsonLine ${PLEGMA_LIBS}) -add_executable(FT EXCLUDE_FROM_ALL FT.cpp) +hip_add_executable(FT EXCLUDE_FROM_ALL FT.cpp) target_link_libraries(FT ${PLEGMA_LIBS}) -add_executable(LowModesCalc LowModesCalc.cpp) +hip_add_executable(LowModesCalc LowModesCalc.cpp) target_link_libraries(LowModesCalc ${PLEGMA_LIBS}) -add_executable(MG_tuner MG_tuner.cpp) +hip_add_executable(MG_tuner MG_tuner.cpp) target_link_libraries(MG_tuner ${PLEGMA_LIBS}) -add_executable(benchmark benchmark.cpp) +hip_add_executable(benchmark benchmark.cpp) target_link_libraries(benchmark ${PLEGMA_LIBS}) -add_executable(TMDWFs_mesons TMDWFs_mesons.cpp) +hip_add_executable(TMDWFs_mesons TMDWFs_mesons.cpp) target_link_libraries(TMDWFs_mesons ${PLEGMA_LIBS}) -add_executable(quark_rms EXCLUDE_FROM_ALL quark_rms.cpp) +hip_add_executable(quark_rms EXCLUDE_FROM_ALL quark_rms.cpp) target_link_libraries(quark_rms ${PLEGMA_LIBS}) -add_executable(Zfac_Vgg EXCLUDE_FROM_ALL Zfac_Vgg.cpp) +hip_add_executable(Zfac_Vgg EXCLUDE_FROM_ALL Zfac_Vgg.cpp) target_link_libraries(Zfac_Vgg ${PLEGMA_LIBS}) -add_executable(testShifts EXCLUDE_FROM_ALL testShifts.cpp) +hip_add_executable(testShifts EXCLUDE_FROM_ALL testShifts.cpp) target_link_libraries(testShifts ${PLEGMA_LIBS}) -add_executable(Zfac Zfac.cpp) +hip_add_executable(Zfac Zfac.cpp) target_link_libraries(Zfac ${PLEGMA_LIBS}) -add_executable(ZfacStaple ZfacStaple.cpp) +hip_add_executable(ZfacStaple ZfacStaple.cpp) target_link_libraries(ZfacStaple ${PLEGMA_LIBS}) -add_executable(SoftFunction SoftFunction.cpp) +hip_add_executable(SoftFunction SoftFunction.cpp) target_link_libraries(SoftFunction ${PLEGMA_LIBS}) -add_executable(SoftFunctionWall SoftFunctionWall.cpp) +hip_add_executable(SoftFunctionWall SoftFunctionWall.cpp) target_link_libraries(SoftFunctionWall ${PLEGMA_LIBS}) -add_executable(WallSourceNucleon WallSourceNucleon.cpp) +hip_add_executable(WallSourceNucleon WallSourceNucleon.cpp) target_link_libraries(WallSourceNucleon ${PLEGMA_LIBS}) -add_executable(TMDPDFs_pion TMDPDFs_pion.cpp) +hip_add_executable(TMDPDFs_pion TMDPDFs_pion.cpp) target_link_libraries(TMDPDFs_pion ${PLEGMA_LIBS}) if (PLEGMA_SCATTERING_CONTRACTIONS) - add_executable(testScattReductions EXCLUDE_FROM_ALL testScattReductions.cpp) + hip_add_executable(testScattReductions EXCLUDE_FROM_ALL testScattReductions.cpp) target_link_libraries(testScattReductions ${PLEGMA_LIBS}) - add_executable(piNdiagrams piNdiagrams.cpp) + hip_add_executable(piNdiagrams piNdiagrams.cpp) target_link_libraries(piNdiagrams ${PLEGMA_LIBS}) - add_executable(nucleon_delta_test EXCLUDE_FROM_ALL nucleon_delta_test.cpp) + hip_add_executable(nucleon_delta_test EXCLUDE_FROM_ALL nucleon_delta_test.cpp) target_link_libraries(nucleon_delta_test ${PLEGMA_LIBS}) - add_executable(piNdiagrams_oet EXCLUDE_FROM_ALL piNdiagrams_oet.cpp) + hip_add_executable(piNdiagrams_oet EXCLUDE_FROM_ALL piNdiagrams_oet.cpp) target_link_libraries(piNdiagrams_oet ${PLEGMA_LIBS}) - add_executable(nucleon_3pt_n_npi EXCLUDE_FROM_ALL nucleon_3pt_n_npi.cpp) + hip_add_executable(nucleon_3pt_n_npi EXCLUDE_FROM_ALL nucleon_3pt_n_npi.cpp) target_link_libraries(nucleon_3pt_n_npi ${PLEGMA_LIBS}) target_link_libraries(piNdiagrams_oet ${PLEGMA_LIBS}) - add_executable(checking_Doet checking_Doet.cpp) + hip_add_executable(checking_Doet checking_Doet.cpp) target_link_libraries(checking_Doet ${PLEGMA_LIBS}) - add_executable(omegamass EXCLUDE_FROM_ALL omegamass.cpp) + hip_add_executable(omegamass EXCLUDE_FROM_ALL omegamass.cpp) target_link_libraries(omegamass ${PLEGMA_LIBS}) endif(PLEGMA_SCATTERING_CONTRACTIONS) -add_executable(gaugeFixing gaugeFixing.cpp) +hip_add_executable(gaugeFixing gaugeFixing.cpp) target_link_libraries(gaugeFixing ${PLEGMA_LIBS}) -add_executable(invert invert.cpp) +hip_add_executable(invert invert.cpp) target_link_libraries(invert ${PLEGMA_LIBS}) -add_executable(polarN EXCLUDE_FROM_ALL polarN.cpp) +hip_add_executable(polarN EXCLUDE_FROM_ALL polarN.cpp) target_link_libraries(polarN ${PLEGMA_LIBS}) -add_executable(Zfac_GI Zfac_GI.cpp) +hip_add_executable(Zfac_GI Zfac_GI.cpp) target_link_libraries(Zfac_GI ${PLEGMA_LIBS}) -add_executable(Zfac_GI_meson3pt Zfac_GI_meson3pt.cpp) +hip_add_executable(Zfac_GI_meson3pt Zfac_GI_meson3pt.cpp) target_link_libraries(Zfac_GI_meson3pt ${PLEGMA_LIBS}) -add_executable(mesons_2pt mesons_2pt.cpp) +hip_add_executable(mesons_2pt mesons_2pt.cpp) target_link_libraries(mesons_2pt ${PLEGMA_LIBS}) -add_executable(mesons_simple mesons_simple.cpp) +hip_add_executable(mesons_simple mesons_simple.cpp) target_link_libraries(mesons_simple ${PLEGMA_LIBS}) -add_executable(Zfac_diagGI Zfac_diagGI.cpp) +hip_add_executable(Zfac_diagGI Zfac_diagGI.cpp) target_link_libraries(Zfac_diagGI ${PLEGMA_LIBS}) From a143472304cacb9cc9adeea7dc63736b630b6cb7 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 8 Aug 2023 16:29:12 +0300 Subject: [PATCH 19/27] producing momentum smeared two point functions, checked against Simone's branch and the juwelsbooster branch --- plegma/Calc_2pt_marconi.cpp | 192 ++++++++++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 plegma/Calc_2pt_marconi.cpp diff --git a/plegma/Calc_2pt_marconi.cpp b/plegma/Calc_2pt_marconi.cpp new file mode 100644 index 00000000..30413989 --- /dev/null +++ b/plegma/Calc_2pt_marconi.cpp @@ -0,0 +1,192 @@ +#include +#include + +std::vector runtime; +#define TIME(fnc) runtime.push_back(MPI_Wtime()); fnc; \ + PLEGMA_printf("TIME for "#fnc" %f sec\n", MPI_Wtime()-runtime.back()); \ + runtime.pop_back() + +std::vector threads; +//#define THREAD(fnc) threads.push_back(std::thread([=]() { TIME(fnc); })) +#define THREAD(fnc) TIME(fnc) + +using namespace plegma; +using namespace quda; +static std::vector listOpt = { "verbosity", "load-gauge", "nsmear-APE", "alpha-APE", "nsmear-gauss", "alpha-gauss", + "nsrc", "src-filename", "maxQsq", "twop-filename", "corr-file-format", "corr-space", "xiMomSm","sinkMom"}; + +int main(int argc, char **argv) +{ + initializeOptions(argc, argv, true, listOpt); + //================ Add your options in this between initializeOptions and initializePLEGMA ================// + std::vector mu_s; + std::vector mu_c; + double mu_ud = mu; + double mu_ud_factor[QUDA_MAX_MG_LEVEL]; + for(int i=0;i sinkMom = {0,0,0}; + + std::string given_twop_filename = twop_filename; + { + PLEGMA_Gauge smearedGauge(BOTH); + double max_mom = 0; + { + // Reading from Lime file and loading to device + PLEGMA_Gauge gauge; + gauge.readFile(latfile, LIME_FORMAT); + gauge.calculatePlaq(); + + // Loading to QUDA and computing plaquette also there + initGaugeQuda(gauge, true); + plaqQuda(); + + // Smearing + TIME(smearedGauge.APEsmearing(gauge, nsmearAPE, alphaAPE, 3)); + PLEGMA_printf("Plaquette after smearing:\n"); + smearedGauge.calculatePlaq(); + + //Momentum smearing: put the momentum phase to smeared gauge field + std::complex momSmScale[N_DIMS]; + std::complex I(0,1); + for(int i = 0 ; i < N_DIMS; i++) { + momSmScale[i] = std::exp(-(xiMomSm*2.*PI*sinkMom[i]/HGC_totalL[i])*I); + max_mom = max_mom>pow(xiMomSm*sinkMom[i],2) ? max_mom:pow(xiMomSm*sinkMom[i],2); + } + if(max_mom>0) + smearedGauge.scaleDirWise(momSmScale); + } + if(run_ud) { + updateOptions(LIGHT); + mu = mu_ud; + } else if(mu_s.size()>0) { + updateOptions(STRANGE); + mu = mu_s[0]; + } else { + updateOptions(CHARM); + mu = mu_c[0]; + } + TIME(QUDA_solver solver(mu)); + std::vector threads; + + + for(int isource = 0 ; isource < numSourcePositions; isource++){ + PLEGMA_printf("\n ### Calculations for source-position %d - %02d.%02d.%02d.%02d begin now ###\n\n", + isource, sourcePositions[isource][0], sourcePositions[isource][1], + sourcePositions[isource][2], sourcePositions[isource][3]); + + site& source = sourcePositions[isource]; + PLEGMA_Propagator propUP(run_ud ? BOTH : NONE); + PLEGMA_Propagator propDN(run_ud ? BOTH : NONE); + + char * src_string; + asprintf(&src_string, "_sx%02dsy%02dsz%02dst%03d", source[0], source[1], source[2], source[3]); + twop_filename = given_twop_filename + std::string("_") + ((nsmearGauss>0) ? "SS" : "LL") + + "_gN" + std::to_string(nsmearGauss) + "a" + convNumToStr(alphaGauss) + + "_aN" + std::to_string(nsmearAPE) + "a" + convNumToStr(alphaAPE) + src_string; + free(src_string); + + if(max_mom > 0) { + asprintf(&src_string, "_mx%02dmy%02dmz%02d_xi%0.2f", sinkMom[0], sinkMom[1], sinkMom[2], xiMomSm); + twop_filename = twop_filename + src_string; + free(src_string); + } + twop_filename = twop_filename+".h5"; + + if(access( twop_filename.c_str(), F_OK ) != -1) + continue; + + { + PLEGMA_Gauge3D smearedGauge3D; + smearedGauge3D.absorb(smearedGauge, source[DIM_T]); + + auto computePropagator = [&](PLEGMA_Propagator& prop, const double run_mu, WHICHFLAVOR fl, int nSmear) { + // ensuring mu value + if(mu != run_mu) { + updateOptions(fl); + mu = run_mu; + solver.UpdateSolver(); + } + for(int isc = 0 ; isc < 12 ; isc++){ + PLEGMA_Vector vectorInOut; + vectorInOut.zero_where(BOTH); + { // Smearing the source + PLEGMA_Vector3D vector1, vector2; + vector1.pointSource(source, isc/3, isc%3, DEVICE); + TIME(vector2.gaussianSmearing(vector1, smearedGauge3D, nSmear, alphaGauss)); + vectorInOut.absorb(vector2,source[DIM_T]); + } + // Inverting + PLEGMA_printf("Going to invert %s for component %d\n", + fl==LIGHT ? "LIGHT" : (fl == STRANGE ? "STRANGE" : "CHARM"), isc); + vectorInOut.unload(); + vectorInOut.writeHDF5("testinput"); + vectorInOut.load(); + TIME(solver.solve(vectorInOut, vectorInOut)); + vectorInOut.unload(); + vectorInOut.writeHDF5("testoutput"); + vectorInOut.load(); + + { // Smearing the solution + PLEGMA_Vector vectorAuxD; + PLEGMA_Vector vectorAuxF; + TIME(vectorAuxD.gaussianSmearing(vectorInOut, smearedGauge, nSmear, alphaGauss)); + vectorAuxF.copy(vectorAuxD); + prop.absorb(vectorAuxF, isc/3, isc%3); + } + } + prop.rotateToPhysicalBase_device(run_mu/abs(run_mu)); + prop.applyBoundaries_device(source[DIM_T]); + }; + + TIME(computePropagator(propUP, mu_ud, LIGHT, nsmearGauss)); + TIME(computePropagator(propDN, -mu_ud, LIGHT, nsmearGauss)); + } + + PLEGMA_Correlator corr(corr_space, source, maxQsq); + TIME(corr.contractMesonsNew(propUP, propDN)); + char *dset1, *dset2; + asprintf(&dset1, "twop_mesons_new_u[%+1.1e]d[%+1.1e]", mu_ud, -1*mu_ud); + asprintf(&dset2, "twop_mesons_new_d[%+1.1e]u[%+1.1e]", -1*mu_ud, mu_ud); + corr.setDatasets((std::vector) {dset1}); + free(dset1); free(dset2); + THREAD(corr.writeFile(twop_filename, corr_file_format)); + + TIME(corr.contractBaryons(propUP, propDN)); + THREAD(corr.writeFile(twop_filename, corr_file_format)); + +#ifdef PLEGMA_UDSC_BARYONS +#if 0 + PLEGMA_Propagator none(NONE); + TIME(corr.contractBaryonsUDSC(propUP, propDN, none, none)); + + char * group; + asprintf(&group, "baryons_u[%+1.1e]d[%+1.1e]", mu_ud, -1*mu_ud); + corr.setGroups(group); + free(group); + THREAD(corr.writeFile(twop_filename, corr_file_format)); +#endif +#endif + } + while(not threads.empty()) {threads.back().join(); threads.pop_back();} + } + + //finalize(); + return 0; +} + From f2465445e277071465f4139d9909afcbe2c9b1e6 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Sun, 13 Aug 2023 23:05:52 +0300 Subject: [PATCH 20/27] correcting one memory leak --- lib/kernels/PLEGMA_threep_threeD_part1.cu | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/kernels/PLEGMA_threep_threeD_part1.cu b/lib/kernels/PLEGMA_threep_threeD_part1.cu index a7692284..4306c97a 100644 --- a/lib/kernels/PLEGMA_threep_threeD_part1.cu +++ b/lib/kernels/PLEGMA_threep_threeD_part1.cu @@ -167,7 +167,6 @@ static void threep_threeD_part1_host(ProfileStruct &ps, Float2 *result, KernelArr listGammas; listGammas.size = gammas.size(); - listGammas.array=(GAMMAS*)device_malloc(gammas.size()*sizeof(GAMMAS)); // cudaMalloc((void**)&listGammas.array, gammas.size()*sizeof(GAMMAS)); listGammas.array=(GAMMAS*)device_malloc(gammas.size()*sizeof(GAMMAS)); qudaMemcpy(listGammas.array, gammas.data(), gammas.size()*sizeof(GAMMAS), qudaMemcpyHostToDevice); From fc2ccefc5594bcb179e169c2b6f3c5439a1a382a Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Sun, 13 Aug 2023 23:21:13 +0300 Subject: [PATCH 21/27] removing comments --- lib/kernels/PLEGMA_scattreductions.cuh | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/lib/kernels/PLEGMA_scattreductions.cuh b/lib/kernels/PLEGMA_scattreductions.cuh index d15d9cff..f394142a 100644 --- a/lib/kernels/PLEGMA_scattreductions.cuh +++ b/lib/kernels/PLEGMA_scattreductions.cuh @@ -51,7 +51,6 @@ static void V_reductions_host( ProfileStruct &ps, VRED V, PLEGMA_ScattCorrelator Float2 *h_partial_block = NULL; Float2 *d_partial_block = NULL; hostMalloc(h_partial_block, alloc_size*sizeof(Float2)); -// cudaMalloc((void**)&d_partial_block, alloc_size*sizeof(Float2)); d_partial_block=(Float2 *)device_malloc(alloc_size*sizeof(Float2)); // Checking for allocation error. In case we return and let the tuner handle the error. auto error= qudaGetLastError(); @@ -68,21 +67,14 @@ static void V_reductions_host( ProfileStruct &ps, VRED V, PLEGMA_ScattCorrelator if (gammas.size()==0){ listGammas.array=(GAMMAS_SCATT*)device_malloc(sizeof(GAMMAS_SCATT)); -// checkQudaError(); -// cudaMalloc((void**)&listGammas.array, sizeof(GAMMAS_SCATT)); - listGammas.array=(GAMMAS_SCATT*)device_malloc(sizeof(GAMMAS_SCATT)); checkQudaError(); - } else{ -// listGammas.array=device_malloc(gammas.size()*sizeof(GAMMAS_SCATT)); -// cudaMalloc((void**)&listGammas.array, gammas.size()*sizeof(GAMMAS_SCATT)); listGammas.array=(GAMMAS_SCATT*)device_malloc(gammas.size()*sizeof(GAMMAS_SCATT)); auto error= qudaGetLastError(); if(error != QUDA_SUCCESS) { errorQuda("Failed to clear error state %s\n", qudaGetLastErrorString().c_str()); - PLEGMA_printf("Error in allocating listGammas.array %d\n",gammas.size()*sizeof(GAMMAS_SCATT)); - device_free(d_partial_block); + PLEGMA_error("Error in allocating listGammas.array %d\n",gammas.size()*sizeof(GAMMAS_SCATT)); return; } qudaMemcpy(listGammas.array, gammas.data(), gammas.size()*sizeof(GAMMAS_SCATT), qudaMemcpyHostToDevice); @@ -93,7 +85,6 @@ static void V_reductions_host( ProfileStruct &ps, VRED V, PLEGMA_ScattCorrelator return; } -// qudaMemcpy(listGammas.array, gammas.data(), gammas.size()*sizeof(GAMMAS_SCATT), qudaMemcpyHostToDevice); } //loop over the bunches of timeslices passed to device @@ -377,13 +368,11 @@ static void T_reductions_host( ProfileStruct &ps, TRED T, PLEGMA_ScattCorrelator d_partial_block=(Float2 *)device_malloc(alloc_size*sizeof(Float2)); -// cudaMalloc((void**)&d_partial_block, alloc_size*sizeof(Float2)); // Checking for allocation error. In case we return and let the tuner handle the error. //cudaError_t error=cudaPeekAtLastError(); //if(error != cudaSuccess) { // PLEGMA_printf("ERROR0\n"); - // device_free(d_partial_block); // return; //} hostMalloc(h_partial_block, alloc_size*sizeof(Float2)); @@ -392,15 +381,10 @@ static void T_reductions_host( ProfileStruct &ps, TRED T, PLEGMA_ScattCorrelator listGammas_i.size = gammas_i.size(); listGammas_f.size = gammas_f.size(); -// listGammas_i.array=quda::device_malloc_(__func__, quda::file_name(__FILE__), __LINE__, gammas_i.size()*sizeof(GAMMAS_SCATT)); - -// listGammas_f.array=quda::device_malloc_(__func__, quda::file_name(__FILE__), __LINE__, gammas_f.size()*sizeof(GAMMAS_SCATT)); listGammas_i.array=(GAMMAS_SCATT*)device_malloc(gammas_i.size()*sizeof(GAMMAS_SCATT)); listGammas_f.array=(GAMMAS_SCATT*)device_malloc(gammas_i.size()*sizeof(GAMMAS_SCATT)); -// cudaMalloc((void**)&listGammas_i.array, gammas_i.size()*sizeof(GAMMAS_SCATT)); -// cudaMalloc((void**)&listGammas_f.array, gammas_f.size()*sizeof(GAMMAS_SCATT)); checkQudaError(); qudaMemcpy(listGammas_i.array, gammas_i.data(), gammas_i.size()*sizeof(GAMMAS_SCATT), qudaMemcpyHostToDevice); qudaMemcpy(listGammas_f.array, gammas_f.data(), gammas_f.size()*sizeof(GAMMAS_SCATT), qudaMemcpyHostToDevice); @@ -435,9 +419,6 @@ static void T_reductions_host( ProfileStruct &ps, TRED T, PLEGMA_ScattCorrelator device_free(d_partial_block); device_free(listGammas_i.array); device_free(listGammas_f.array); - //cudaFree(d_partial_block); - //cudaFree(listGammas_i.array); - //cudaFree(listGammas_f.array); } From 70e791488d82e7307bbd8b46548833e1cfce6c9a Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Sun, 13 Aug 2023 23:31:20 +0300 Subject: [PATCH 22/27] remove unneccary free --- lib/kernels/PLEGMA_QWF.cuh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/kernels/PLEGMA_QWF.cuh b/lib/kernels/PLEGMA_QWF.cuh index 343243e1..7056b35c 100644 --- a/lib/kernels/PLEGMA_QWF.cuh +++ b/lib/kernels/PLEGMA_QWF.cuh @@ -157,8 +157,7 @@ void contract_TMDWF_mesons_trick_zfac_host( ProfileStruct &ps,PLEGMA_Propagator< //cudaError_t error=cudaPeekAtLastError(); if(h_partial_block==NULL) { - hostFree(h_partial_block, alloc_size*sizeof(FloatC)); - device_free(d_partial_block); + PLEGMA_error("failure allocating h_partial_block"); return; } @@ -232,8 +231,7 @@ void contract_TMDWF_mesons_zfac_host( ProfileStruct &ps,PLEGMA_Propagator Date: Sun, 13 Aug 2023 23:33:17 +0300 Subject: [PATCH 23/27] remove one comment --- lib/kernels/PLEGMA_su3field.cuh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/kernels/PLEGMA_su3field.cuh b/lib/kernels/PLEGMA_su3field.cuh index ff9d3a53..7234453f 100644 --- a/lib/kernels/PLEGMA_su3field.cuh +++ b/lib/kernels/PLEGMA_su3field.cuh @@ -177,7 +177,6 @@ static void sum_real_trace_host(ProfileStruct& ps, PLEGMA_Su3field &su3M hostMalloc(h_partial_sum, gridDimX * sizeof(Float) ); d_partial_sum=(Float*)device_malloc(gridDimX * sizeof(Float)); -// d_partial_sum=quda::device_malloc_(__func__, quda::file_name(__FILE__), __LINE__, gridDimX * sizeof(Float)); sum_real_trace_kernel<<>>(toField2(su3M), d_partial_sum); From 3f51550590381ccdc17fab0d974e25921cc6ead4 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Sun, 13 Aug 2023 23:40:40 +0300 Subject: [PATCH 24/27] remove comment --- lib/PLEGMA_FT.cu | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/PLEGMA_FT.cu b/lib/PLEGMA_FT.cu index 9e9e6bcb..d34495a9 100644 --- a/lib/PLEGMA_FT.cu +++ b/lib/PLEGMA_FT.cu @@ -152,7 +152,6 @@ std::shared_ptr PLEGMA_FT::getTexMomList() { int hostPtr[Nmoms()*N_DIMS]; memset(hostPtr, 0, sizeof(hostPtr)); devPtr=device_malloc(sizeof(hostPtr)); -// cudaMalloc(&devPtr, sizeof(hostPtr)); Float intp; for(int i=0; i Date: Thu, 7 Sep 2023 18:28:43 +0300 Subject: [PATCH 25/27] Bug of having all momenta equal zero on the hip is corrected --- include/global/PLEGMA_structs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/global/PLEGMA_structs.h b/include/global/PLEGMA_structs.h index 2a151b36..0fc7af2e 100644 --- a/include/global/PLEGMA_structs.h +++ b/include/global/PLEGMA_structs.h @@ -61,6 +61,8 @@ struct tex_mom_list { inline __device__ int4 get(const size_t &i) const { #ifdef __NVCC__ return tex1Dfetch(tex,i); +#elif defined (__HIP__) + return tex1Dfetch(tex,i); #else return make_int4(0,0,0,0); #endif From fa6e33d9e5921d94ffac3ff1d1a931bf2b7539ab Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Tue, 29 Jul 2025 17:28:21 +0300 Subject: [PATCH 26/27] compiling on lumi with the current quda version --- CMakeLists.txt | 2 +- include/PLEGMA_Propagator.h | 16 ++ include/PLEGMA_Vector.h | 11 +- include/PLEGMA_global.h | 2 +- include/PLEGMA_utils.h | 28 +++ include/utils/QUDA_interface.h | 41 +++- lib/CMakeLists.txt | 10 +- lib/PLEGMA_Propagator.cu | 114 +++++++++ lib/PLEGMA_Vector.cu | 38 ++- lib/kernels/PLEGMA_gaussian_smearing.cuh | 165 ++++++++++++- lib/kernels/PLEGMA_kernel_getSet.cuh | 86 ++++++- lib/kernels/PLEGMA_kernel_tuner.cuh | 10 +- lib/kernels/PLEGMA_kernel_utils.cuh | 64 +++++ lib/kernels/PLEGMA_vector_utils.cuh | 70 +++--- lib/targets/hip/target_hip.cmake | 1 + plegma/CMakeLists.txt | 2 +- plegma/Calc_2pt_marconi.cpp | 2 +- utils/CMakeLists.txt | 4 +- utils/QUDA_interface.cpp | 285 ++++++++++++++++++----- 19 files changed, 827 insertions(+), 124 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4123de5a..7dd1afcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -451,7 +451,7 @@ OPTION(USE_OpenMP "Use OpenMP" ON) IF(USE_OpenMP) FIND_PACKAGE(OpenMP) IF( OPENMP_FOUND ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -fPIC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler ${OpenMP_CXX_FLAGS}") diff --git a/include/PLEGMA_Propagator.h b/include/PLEGMA_Propagator.h index 0da42c9a..b7ca3622 100644 --- a/include/PLEGMA_Propagator.h +++ b/include/PLEGMA_Propagator.h @@ -1,4 +1,5 @@ #include +#include #ifndef _PLEGMA_PROPAGATOR_H #define _PLEGMA_PROPAGATOR_H @@ -17,6 +18,10 @@ namespace plegma { public: PLEGMA_Propagator(ALLOCATION_FLAG alloc_flag=BOTH, GHOST_FLAG ghost_flag=FIRST_SIDE); ~PLEGMA_Propagator(){;} + + void copyToQUDA( std::vector& cudaVector, bool isEv = false); + void copyFromQUDA( std::vector& cudaVector, bool isEv = false); + void apply_gamma(GAMMAS gMat, LEFTRIGHT LR = LEFT); void apply_gamma5(); @@ -54,6 +59,17 @@ namespace plegma { **/ void absorb(PLEGMA_Vector3D &vec, int global_it, int nu, int c2); +/** + @brief Applies N times Gaussian(Wuppertal) smearing operator on all time-slices of a vector. NOTE: works also for Vector3D + @param PLEGMA_Vector &vecIn, The 4D input vector (Exchange of boundaries happens inside the function) + @param PLEGMA_Gauge &gauge, The gauge field that will be used in the Gaussian smearing operator (Exchange of boundaries happens inside the function) + @param int nsmearGauss, The number of times to apply the operator (if zero copies inVec to outVec) + @param Float alphaGauss, alpha parameter of the Gaussian smearing + **/ + + void gaussianSmearing(PLEGMA_Propagator &propIn, PLEGMA_Gauge &gauge, int nsmearGauss, Float alphaGauss); + + /** @brief packing the sinktime slice in all other time slices @param the initial propagator to be broadcasted diff --git a/include/PLEGMA_Vector.h b/include/PLEGMA_Vector.h index 81933ceb..f3e85dce 100644 --- a/include/PLEGMA_Vector.h +++ b/include/PLEGMA_Vector.h @@ -25,8 +25,8 @@ namespace plegma { PLEGMA_Vector(ALLOCATION_FLAG alloc_flag=BOTH, GHOST_FLAG ghost_flag=FIRST_SIDE); ~PLEGMA_Vector(){;} - void copyToQUDA( quda::ColorSpinorField *cudaVector, bool isEv = false); - void copyFromQUDA( quda::ColorSpinorField *cudaVector, bool isEv = false); + void copyToQUDA( std::vector& cudaVector, bool isEv = false); + void copyFromQUDA( std::vector& cudaVector, bool isEv = false); /** @brief Applies N times Gaussian(Wuppertal) smearing operator on all time-slices of a vector. NOTE: works also for Vector3D @@ -67,6 +67,9 @@ namespace plegma { @return void **/ void absorb(PLEGMA_Propagator &prop, int nu , int c2); + + void absorb(PLEGMA_Propagator *prop, int nu , int c2); + void dilutespin(PLEGMA_Vector &vecIn, int spin); @@ -108,8 +111,8 @@ namespace plegma { }; - template void copyToQUDA(quda::ColorSpinorField *cudaVector, Float* delem, bool isEv = false); // delem is a device pointer - template void copyFromQUDA(Float* delem, quda::ColorSpinorField *cudaVector, bool isEv = false); + template void copyToQUDA(std::vector& cudaVector, Float* delem, bool isEv = false); // delem is a device pointer + template void copyFromQUDA(Float* delem, std::vector& cudaVector, bool isEv = false); ///////////////////////////////////// // CLASS: PLEGMA_Vector3D /////////// diff --git a/include/PLEGMA_global.h b/include/PLEGMA_global.h index 49d9e486..6656685b 100644 --- a/include/PLEGMA_global.h +++ b/include/PLEGMA_global.h @@ -15,7 +15,7 @@ #include #include #ifndef __HIP__ -#include +//##include #endif //#include #ifdef __GNUG__ // gnu C++ compiler diff --git a/include/PLEGMA_utils.h b/include/PLEGMA_utils.h index b4abaf18..f8eb94bd 100644 --- a/include/PLEGMA_utils.h +++ b/include/PLEGMA_utils.h @@ -14,6 +14,32 @@ using namespace plegma; + /** + @brief Helper function for signalling that DD is not supported + @param[in] a Input field + @return true if all fields are supported + */ + template + inline bool Nrhs_(const char *func, const char *file, int line, const T1 &a_) + { + const unwrap_t &a(a_); + if (a->Nrhs() != 12) errorQuda("Propagator solve is not supported (%s:%d in %s())", file, line, func); + return true; + } + /** + @brief Helper function for signalling that DD is not supported + @param[in] a Input field + @param[in] args List of additional fields to check domain decomposition on + @return true if all fields match + */ + template + inline bool Nrhs_(const char *func, const char *file, int line, const T1 &a, const Args &...args) + { + // checking all possible pairs + return (Nrhs_(func, file, line, a) && Nrhs_(func, file, line, args...)); + } + #define assertNrhs(...) Nrhs_(__func__, __FILE__, __LINE__, __VA_ARGS__) + //============ QUDA_interface.cpp ===============================// void initComms(int argc, char **argv, const int *commDims); void finalizeComms(); @@ -23,6 +49,8 @@ void finalizeGaugeQuda(); void plaqQuda(); void gFixingLandauOVR_QUDA(PLEGMA_Gauge &gaugeOut, PLEGMA_Gauge &gaugeIn, int type, double overelaxPar=1.5, double tolerance=1e-12, int maxiter=10000,int verbosePerSteps=1, int reunit_interval=1, int stop_theta=0); +void gSmear_QUDA(PLEGMA_Gauge &gaugeOut,PLEGMA_Gauge &gaugeIn, bool antiperiodic); + //============= QUDA_params.cpp ===================================// void infoQuda(); diff --git a/include/utils/QUDA_interface.h b/include/utils/QUDA_interface.h index 296dc016..52e01878 100644 --- a/include/utils/QUDA_interface.h +++ b/include/utils/QUDA_interface.h @@ -17,7 +17,7 @@ namespace quda { QudaMultigridParam mg_param; Dirac *D, *DSloppy, *DPre; DiracMatrix *M, *MSloppy, *MPre; - ColorSpinorField *b, *x; + std::vector b, x; #ifdef QUDA_INCLUDES_COMMIT_775a033 QudaEigParam *mg_eig_param; #endif @@ -26,15 +26,32 @@ namespace quda { QudaInvertParam getInvParams() const{return inv_param;} SolverParam* getSolverParam() const{return solverParam;} void UpdateSolver(); - QUDA_solver(double mu); + void UpdateGaugeSolver(); + + double Mu() const { return inv_param.mu;} + int Nrhs() const { return inv_param.num_src;} + + QUDA_solver(double mu, int nsrc); virtual ~QUDA_solver(); - ColorSpinorField* solve(ColorSpinorField * rhs); - template - ColorSpinorField* solve(PLEGMA_Vector &vectorIn); - template - void solve(PLEGMA_Vector &out, PLEGMA_Vector &in); - template - void runOneIter(PLEGMA_Vector &out, PLEGMA_Vector &in); + std::vector solve(std::vector& rhs); + + template std::vector solve(PLEGMA_Vector &vectorIn); + template std::vector solve(PLEGMA_Propagator &vectorIn); + + + template void solve(PLEGMA_Propagator &out, PLEGMA_Propagator &in); + template void solve(PLEGMA_Vector &out, PLEGMA_Vector &in); + + template void runOneIter( PLEGMA_Vector &out, PLEGMA_Vector &in); + template void runOneIter( PLEGMA_Propagator &out, PLEGMA_Propagator &in); + + + template + std::vector solve(typename std::conditional, PLEGMA_Propagator>::type &vectorIn); + template + void solve(typename std::conditional, PLEGMA_Propagator>::type &out, typename std::conditional, PLEGMA_Propagator>::type &in); + template + void runOneIter(typename std::conditional, PLEGMA_Propagator>::type &out, typename std::conditional, PLEGMA_Propagator>::type &in); }; enum APP_TYPE {M,Mdag,MdagM,MMdag}; @@ -43,7 +60,7 @@ namespace quda { DiracParam dParam; QudaInvertParam inv_param; Dirac *D; - ColorSpinorField *in, *out; + std::vector in, out; template void apply(); public: //only QUDA_WILSON_DSLASH, QUDA_CLOVER_WILSON_DSLASH, QUDA_TWISTED_MASS_DSLASH, QUDA_TWISTED_CLOVER_DSLASH @@ -52,8 +69,10 @@ namespace quda { void print(){dParam.print();} void switchMu(double mu); void switchKappa(double kappa); + template void apply(typename std::conditional, PLEGMA_Propagator>::type &out, typename std::conditional, PLEGMA_Propagator>::type &in, QudaMassNormalization normType = QUDA_KAPPA_NORMALIZATION); // Default it is without any normalization template void apply(PLEGMA_Vector &out, PLEGMA_Vector &in, QudaMassNormalization normType = QUDA_KAPPA_NORMALIZATION); // Default it is without any normalization + template void apply(PLEGMA_Propagator &out, PLEGMA_Propagator &in, QudaMassNormalization normType = QUDA_KAPPA_NORMALIZATION); // Default it is without any normalization + template void apply(Float *dout, Float *din, QudaMassNormalization normType = QUDA_KAPPA_NORMALIZATION); // Default is without any normalization // Note that dout and din are device pointers }; } - diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 21df942a..f7a8d509 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -92,8 +92,8 @@ LIST(REMOVE_ITEM PLEGMA_OBJS ${PLEGMA_CU_OBJS}) if(PLEGMA_OBJS) add_library(plegma_cpp OBJECT ${PLEGMA_OBJS}) - target_compile_definitions(plegma_cpp PUBLIC -DQUDA_HASH="${HASH}") - set_target_properties(plegma_cpp PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + target_compile_definitions(plegma_cpp PUBLIC -DQUDA_HASH="${HASH}" -fPIC) + set_target_properties(plegma_cpp PROPERTIES POSITION_INDEPENDENT_CODE TRUE -fPIC) endif() if(${CMAKE_BUILD_TYPE} STREQUAL "DEVEL") @@ -141,15 +141,15 @@ target_sources(plegma PRIVATE ${PLEGMA_CU_OBJS}) # ${PLEGMA_CU_OBJS}) include(CheckLinkerFlag) -check_linker_flag(CXX "-Wl,--compress-debug-sections=zlib" PLEGMA_LINKER_COMPRESS) -target_link_options(plegma PRIVATE $<$:$<${PLEGMA_LINKER_COMPRESS}:-Wl,--compress-debug-sections=zlib>>) +check_linker_flag(CXX "-Wl,--compress-debug-sections=zlib -fPIC" PLEGMA_LINKER_COMPRESS) +target_link_options(plegma PRIVATE $<$:$<${PLEGMA_LINKER_COMPRESS}:-Wl,--compress-debug-sections=zlib -fPIC>>) # set up QUDA compile options, put them before target specific options # You have to set -O3 target_compile_options( plegma BEFORE PRIVATE $<$: - $,-w, -O3 -Wall -Wextra> + $,-w, -O3 -Wall -Wextra -fPIC> $<$:-Werror> >) diff --git a/lib/PLEGMA_Propagator.cu b/lib/PLEGMA_Propagator.cu index dc9f4412..324c8905 100644 --- a/lib/PLEGMA_Propagator.cu +++ b/lib/PLEGMA_Propagator.cu @@ -1,8 +1,13 @@ #include #include #include +#include +#include + using namespace plegma; +using namespace quda; + //-------------------------------// // class PLEGMA_Propagator // //-------------------------------// @@ -11,6 +16,95 @@ template PLEGMA_Propagator::PLEGMA_Propagator(ALLOCATION_FLAG alloc_flag, GHOST_FLAG ghost_flag): PLEGMA_Field(alloc_flag, PROPAGATOR, ghost_flag){;} + + +template +void PLEGMA_Propagator::gaussianSmearing(PLEGMA_Propagator &propIn, + PLEGMA_Gauge &gauge, + int nsmearGauss, Float alphaGauss){ + std::vector runtime; + double start=0, finish=0, core=0, ghost=0; +#define TIME(add,fnc) runtime.push_back(MPI_Wtime()); fnc; \ + add += MPI_Wtime()-runtime.back(); \ + runtime.pop_back() + + if(propIn.IsAllocHost()) { + propIn.unload(); // backing up the propIn + } else { + PLEGMA_warning("PropIn is not allocated on BOTH; gaussianSmearing will overwrite the device memory.\n"); + } + + assert(this->checkVolume(propIn, gauge)); + auto texGauge = toTexture(gauge); + auto texPropIn = toTexture(propIn); + auto texPropOut = toTexture(*this); + + for(int i = 0 ; i < nsmearGauss ; i++){ + if( (i%2) == 0){ + TIME(start, + for(int dir=0; dircommunicateSideGhost(dir, DIR_BOTH, START); + }); + TIME(core, + gaussian_smearing_prop_no_ghost(*texPropIn, *texPropOut, *texGauge, alphaGauss)); + TIME(finish, + for(int dir=0; dircommunicateSideGhost(dir, DIR_BOTH, FINISH); + }); + #if defined __HIP__ + TIME(ghost, + gaussian_smearing_prop_only_ghost(*texPropIn, *texPropOut, *texGauge, alphaGauss); + hipDeviceSynchronize()); +#elif defined __NVCC__ + TIME(ghost, + gaussian_smearing_prop_only_ghost(*texPropIn, *texPropOut, *texGauge, alphaGauss); + cudaDeviceSynchronize()); +#endif + } + } + PLEGMA_printf("### GAUSSIAN SMEARING breakdown: comm-start %.2f, comm-finish %.2f, calc-core %.2f, calc-ghost %.2f\n", start, finish, core, ghost); + if( (nsmearGauss%2) == 0) + qudaMemcpy(this->D_elem(),propIn.D_elem(), + this->Bytes_total(),qudaMemcpyDeviceToDevice); + + //checkCudaError(); + + if(propIn.IsAllocHost()) { + propIn.load(); // restoring propIn + } +} + + template void PLEGMA_Propagator:: absorbVectorToHost(PLEGMA_Vector &vec, int nu, int c2){ @@ -259,6 +353,26 @@ void PLEGMA_Propagator::PropmulVVdag(PLEGMA_Vector &vec1,PLEGMA_Ve prop_mul_V_Vdag(toField2(*this), *vectex1, *vectex2); checkQudaError(); } + +template +void PLEGMA_Propagator::copyToQUDA(std::vector &qudaVector, bool isEv){ + + for (int isc=0; isc<12; ++isc){ + PLEGMA_Vector temporary; + temporary.absorb(this, isc/3, isc%3); + copy_to_QUDA(temporary.D_elem(), (qudaVector), isc, isEv); + } +} + +template +void PLEGMA_Propagator::copyFromQUDA( std::vector &qudaVector, bool isEv){ + for (int isc=0; isc<12; ++isc){ + PLEGMA_Vector temporary; + copy_from_QUDA(temporary.D_elem(), (qudaVector), isc, isEv); + this->absorb(temporary, isc/3, isc%3); + } +} + //----------------------------------// diff --git a/lib/PLEGMA_Vector.cu b/lib/PLEGMA_Vector.cu index 8d182d4e..d4b5a2f5 100644 --- a/lib/PLEGMA_Vector.cu +++ b/lib/PLEGMA_Vector.cu @@ -82,13 +82,13 @@ void PLEGMA_Vector::gaussianSmearing(PLEGMA_Vector &vecIn, template -void PLEGMA_Vector::copyToQUDA(ColorSpinorField *qudaVector, bool isEv){ - copy_to_QUDA(this->d_elem, *qudaVector, isEv); +void PLEGMA_Vector::copyToQUDA(std::vector &qudaVector, bool isEv){ + copy_to_QUDA(this->d_elem, (qudaVector), 0, isEv); } template -void PLEGMA_Vector::copyFromQUDA(ColorSpinorField *qudaVector, bool isEv){ - copy_from_QUDA(this->d_elem, *qudaVector, isEv); +void PLEGMA_Vector::copyFromQUDA( std::vector &qudaVector, bool isEv){ + copy_from_QUDA(this->d_elem, (qudaVector), 0, isEv); } template @@ -180,6 +180,20 @@ void PLEGMA_Vector::absorb(PLEGMA_Propagator &prop, int global_it, checkQudaError(); } +template +void PLEGMA_Vector::absorb(PLEGMA_Propagator *prop, int nu , int c2){ + Float *pointer_src = NULL; + Float *pointer_dst = NULL; + int V4 = HGC_localVolume; + for(int mu = 0 ; mu < N_SPINS ; mu++) + for(int c1 = 0 ; c1 < N_COLS ; c1++){ + pointer_dst = (this->d_elem + mu*N_COLS*V4*2 + c1*V4*2); + pointer_src = (prop->D_elem() + mu*N_SPINS*N_COLS*N_COLS*V4*2 + nu*N_COLS*N_COLS*V4*2 + c1*N_COLS*V4*2 + c2*V4*2); + qudaMemcpy(pointer_dst, pointer_src, V4*2 * sizeof(Float), qudaMemcpyDeviceToDevice); + } + checkQudaError(); +} + //vec4D <- vec3D (it) template void PLEGMA_Vector::absorb(PLEGMA_Vector3D &vec, int global_it, bool broadcast){ @@ -493,19 +507,19 @@ template class plegma::PLEGMA_Vector; namespace plegma{ template - void copyToQUDA(ColorSpinorField *qudaVector, Float* delem, bool isEv){ - copy_to_QUDA(delem, *qudaVector, isEv); + void copyToQUDA(std::vector& qudaVector, Float* delem, bool isEv){ + copy_to_QUDA(delem, qudaVector, 0, isEv); } - template void copyToQUDA(ColorSpinorField *qudaVector, float* delem, bool isEv); - template void copyToQUDA(ColorSpinorField *qudaVector, double* delem, bool isEv); + template void copyToQUDA(std::vector&qudaVector, float* delem, bool isEv); + template void copyToQUDA(std::vector&qudaVector, double* delem, bool isEv); template - void copyFromQUDA(Float* delem, ColorSpinorField *qudaVector, bool isEv){ - copy_from_QUDA(delem, *qudaVector, isEv); + void copyFromQUDA(Float* delem, std::vector&qudaVector, bool isEv){ + copy_from_QUDA(delem, qudaVector, 0, isEv); } - template void copyFromQUDA(float* delem, ColorSpinorField *qudaVector, bool isEv); - template void copyFromQUDA(double* delem, ColorSpinorField *qudaVector, bool isEv); + template void copyFromQUDA(float* delem, std::vector& qudaVector, bool isEv); + template void copyFromQUDA(double* delem, std::vector&qudaVector, bool isEv); //----------------------------------// // class PLEGMA_Vector3D // diff --git a/lib/kernels/PLEGMA_gaussian_smearing.cuh b/lib/kernels/PLEGMA_gaussian_smearing.cuh index d203758d..71737a25 100644 --- a/lib/kernels/PLEGMA_gaussian_smearing.cuh +++ b/lib/kernels/PLEGMA_gaussian_smearing.cuh @@ -48,7 +48,7 @@ template __global__ void gaussian_smearing_only_ghost_kernel(vectorTexout, vectorTex vecInTex, gaugeTex gaugeTex, - FloatOut alpha, short dir){ + FloatOut alpha, short dir, bool tuning=0){ size_t sid = blockIdx.x*blockDim.x + threadIdx.x; if (sid >= 2*out.sideGhostL(dir)) return; @@ -90,7 +90,7 @@ __global__ void gaussian_smearing_only_ghost_kernel(vectorTexout, } } - FloatOut normalize = alpha/(1 + 6 * alpha); + FloatOut normalize = tuning ? 0 : (alpha/(1 + 6 * alpha)); out.setSid(sid); if(isNotZeroV(tmp)) { @@ -125,8 +125,165 @@ static void gaussian_smearing_only_ghost(vectorTex& out, vectorTex, - out, vecInTex, gaugeTex, alpha, dir); + auto kernel = tuner(ps, "gaussian_smearing_only_ghost_kernel", gaussian_smearing_only_ghost_kernel, + out, vecInTex, gaugeTex, alpha, dir, 0); + if(not kernel->tuned()) { + tune(ps, "gaussian_smearing_only_ghost_kernel", gaussian_smearing_only_ghost_kernel, + out, vecInTex, gaugeTex, alpha, dir, 1); + } + if(not kernel->tuned()) { + PLEGMA_warning("ISSUE: Tuning again???!!!!"); + } + kernel->apply(); + delete kernel; + } + } +} + +template +__global__ void gaussian_smearing_prop_kernel(propTexout, + propTex propInTex, + gaugeTex gaugeTex, + FloatOut alpha){ + int sid = blockIdx.x*blockDim.x + threadIdx.x; + if (sid >= out.volume()) return; + + Float2 G[N_COLS][N_COLS]; + Float2 S[N_SPINS][N_SPINS][N_COLS][N_COLS]; + Float2 tmp[N_SPINS][N_SPINS][N_COLS][N_COLS]; + + #pragma unroll + for(int mu=0; mu N_DIMS-1 + #pragma unroll + for(int dir = 0; dir < N_DIMS-1; dir++) { + propInTex.template get(S, sid, dir); + gaugeTex.get(G, dir, sid); + mul_G(tmp,G,S); + propInTex.template get(S, sid, dir); + gaugeTex.template get(G, dir, sid, dir); + mul_Gdag(tmp,G,S); + } + + FloatOut normalize = 1/(1 + 6 * alpha); + + out.setSid(sid); + propInTex.get(S,sid); + + #pragma unroll + for(int mu=0; mu +__global__ void gaussian_smearing_prop_only_ghost_kernel(propTexout, + propTex propInTex, + gaugeTex gaugeTex, + FloatOut alpha, short dir, bool tuning=0){ + size_t sid = blockIdx.x*blockDim.x + threadIdx.x; + if (sid >= 2*out.sideGhostL(dir)) return; + + ORIENTATION sign = sid>=out.sideGhostL(dir) ? DIR_MINUS : DIR_PLUS; + size_t id[4]; + sid = sid % out.sideGhostL(dir); + #pragma unroll + for(int i = 0 ; i G[N_COLS][N_COLS]; + Float2 S[N_SPINS][N_SPINS][N_COLS][N_COLS]; + Float2 tmp[N_SPINS][N_SPINS][N_COLS][N_COLS]; + + #pragma unroll + for(int mu=0; mu(S, sid, dir); + gaugeTex.get(G, dir, sid); + mul_G(tmp,G,S); + } else { + propInTex.template get(S, sid, dir); + gaugeTex.template get(G, dir, sid, dir); + mul_Gdag(tmp,G,S); + } + + FloatOut normalize = tuning ? 0:(alpha/(1 + 6 * alpha)); + + out.setSid(sid); + + #pragma unroll + for(int mu=0; mu +static void gaussian_smearing_prop(propTex& out, propTex& propInTex, + gaugeTex& gaugeTex, FloatOut alpha){ + ProfileStruct ps(out.volume()); + tuneAndRun(ps, "gaussian_smearing_prop_kernel", gaussian_smearing_prop_kernel, + out, propInTex, gaugeTex, alpha); +} + +template +static void gaussian_smearing_prop_no_ghost(propTex& out, propTex& propInTex, + gaugeTex& gaugeTex, FloatOut alpha){ + ProfileStruct ps(out.volume()); + tuneAndRun(ps, "gaussian_smearing_prop_no_ghost_kernel", gaussian_smearing_prop_kernel, + out, propInTex, gaugeTex, alpha); +} + +template +static void gaussian_smearing_prop_only_ghost(propTex& out, propTex& propInTex, + gaugeTex& gaugeTex, FloatOut alpha){ + for(int dir = 0; dir < N_DIMS-1; dir++) { + if(HGC_dimBreak[dir]) { + ProfileStruct ps(out.sideGhostL(dir)*2); + auto kernel = tuner(ps, "gaussian_smearing_prop_only_ghost_kernel", gaussian_smearing_prop_only_ghost_kernel, + out, propInTex, gaugeTex, alpha, dir, 0); + if(not kernel->tuned()) { + tune(ps, "gaussian_smearing_prop_only_ghost_kernel", gaussian_smearing_prop_only_ghost_kernel, + out, propInTex, gaugeTex, alpha, dir, 1); + } + if(not kernel->tuned()) { + PLEGMA_warning("ISSUE: Tuning again???!!!!"); + } + kernel->apply(); + delete kernel; } } } diff --git a/lib/kernels/PLEGMA_kernel_getSet.cuh b/lib/kernels/PLEGMA_kernel_getSet.cuh index 24e904c1..410898ec 100644 --- a/lib/kernels/PLEGMA_kernel_getSet.cuh +++ b/lib/kernels/PLEGMA_kernel_getSet.cuh @@ -812,6 +812,90 @@ namespace plegma { template using vector2 = genericVector< pFloat2, Float>; + template + struct genericProp : generic { + using generic::generic; + inline __device__ void set(const short& mu, const short& nu, const short& c1, const short& c2, const Float2& v) { + T::set((((mu*N_SPINS + nu)*N_COLS + c1)*N_COLS + c2),v); + } + inline __device__ void set(const short& mu, const short& nu, const short& c1, const short& c2, const size_t& sid, const Float2& v) { + sidStride::setSid(sid); + set(mu, nu, c1, c2,v); + } + inline __device__ void set(Float2 P[4][4][3][3], const size_t& sid) { + sidStride::setSid(sid); + #pragma unroll + for(short mu = 0 ; mu < N_SPINS ; mu++) + #pragma unroll + for(short nu = 0 ; nu < N_SPINS ; nu++) + #pragma unroll + for(short c1 = 0 ; c1 < N_COLS ; c1++) + #pragma unroll + for(short c2 = 0 ; c2 < N_COLS ; c2++) + set(mu, nu, c1, c2, P[mu][nu][c1][c2]); + } + + inline __device__ Float2 get(const short& mu, const short& nu, const short& c1, const short& c2) const { + return T::get(((mu*N_SPINS + nu)*N_COLS + c1)*N_COLS + c2); + } + inline __device__ Float2 get(const short& mu, const short& nu, const short& c1, const short& c2, const size_t& sid) { + sidStride::setSid(sid); + return get(mu, nu, c1, c2); + } + template + inline __device__ Float2 get(const short& mu, const short& nu, const short& c1, const short& c2, const size_t& sid, const dir_t&... dirs) { + sidStride::setSid(sid); + sidStride::shift(dirs ...); + return get(mu,nu,c1,c2); + } + inline __device__ void get(Float2 P[N_SPINS][N_SPINS][N_COLS][N_COLS]) const { + #pragma unroll + for(short mu = 0 ; mu < N_SPINS ; mu++) + #pragma unroll + for(short nu = 0 ; nu < N_SPINS ; nu++) + #pragma unroll + for(short c1 = 0 ; c1 < N_COLS ; c1++) + #pragma unroll + for(short c2 = 0 ; c2 < N_COLS ; c2++) + P[mu][nu][c1][c2] = get(mu, nu, c1, c2); + } + inline __device__ void get(Float2 P[N_SPINS][N_SPINS][N_COLS][N_COLS], const size_t& sid) { + sidStride::setSid(sid); + get(P); + } + template + inline __device__ void get(Float2 P[N_SPINS][N_SPINS][N_COLS][N_COLS], const size_t& sid, const dir_t&... dirs) { + sidStride::setSid(sid); + sidStride::shift(dirs ...); + get(P); + } + + template + inline __device__ void get(Float2 P[N_SPINS][N_SPINS][N_COLS][COLS]) const { + #pragma unroll + for(short mu = 0 ; mu < N_SPINS ; mu++) + #pragma unroll + for(short nu = 0 ; nu < N_SPINS ; nu++) + #pragma unroll + for(short c1 = 0 ; c1 < N_COLS ; c1++) + #pragma unroll + for(short c2 = 0 ; c2 < COLS ; c2++) + P[mu][nu][c1][c2] = get(mu, nu, c1, c2); + } + template + inline __device__ void get(Float2 P[N_SPINS][N_SPINS][N_COLS][COLS], const size_t& sid) { + sidStride::setSid(sid); + get(P); + } + template + inline __device__ void get(Float2 P[N_SPINS][N_SPINS][N_COLS][COLS], const size_t& sid, const dir_t&... dirs) { + sidStride::setSid(sid); + sidStride::shift(dirs ...); + get(P); + } + }; +#if 0 + template struct genericProp : generic { using generic::generic; @@ -870,7 +954,7 @@ namespace plegma { get(P); } }; - +#endif template using propTex = genericProp< texture, Float>; diff --git a/lib/kernels/PLEGMA_kernel_tuner.cuh b/lib/kernels/PLEGMA_kernel_tuner.cuh index 7d698f66..7b9f46e0 100644 --- a/lib/kernels/PLEGMA_kernel_tuner.cuh +++ b/lib/kernels/PLEGMA_kernel_tuner.cuh @@ -293,14 +293,20 @@ void PLEGMA_kernel_tuner::run(){ if(!ps.tuned) tune(); launchKernel(ps.tp,device::get_stream(0));//,ps.tp.shared_bytes,0); #else - if(!ps.tuned) ps.tp = tuneLaunch(*this, QUDA_TUNE_NO, (QudaVerbosity) HGC_verbosity); + if(!ps.tuned) ps.tp = tuneLaunch(*this, getTuning(), (QudaVerbosity) HGC_verbosity); launchKernel(ps.tp,device::get_stream(0)); #endif checkQudaError(); } +template +PLEGMA_kernel_tuner* tuner(ProfileStruct &ps, std::string kname, void (*kernel)(typesK...), types&&... kArgs){ + return new PLEGMA_kernel_tuner(ps, kname, kernel, kArgs...); +} + template void tune(ProfileStruct &ps, std::string kname, void (*kernel)(typesK...), types&&... kArgs){ + PLEGMA_kernel_tuner tuner(ps, kname, kernel, kArgs...); tuner.tune(); } @@ -314,7 +320,7 @@ void run(ProfileStruct &ps, std::string kname, void(* kernel)(typesK...), types& template void tuneAndRun(ProfileStruct &ps, std::string kname, void(* kernel)(typesK...), types&&... kArgs){ PLEGMA_kernel_tuner tuner(ps, kname, kernel, kArgs...); - tuner.apply(); + tuner.apply(); } #endif diff --git a/lib/kernels/PLEGMA_kernel_utils.cuh b/lib/kernels/PLEGMA_kernel_utils.cuh index 0596487d..08c8f49a 100644 --- a/lib/kernels/PLEGMA_kernel_utils.cuh +++ b/lib/kernels/PLEGMA_kernel_utils.cuh @@ -266,6 +266,70 @@ namespace plegma { Gtrans(a); Gconj(a); } + + + template + __inline__ __device__ void mul_G(Float2 out[N_SPINS][N_SPINS][N_COLS][N_COLS], + Float2 G[N_COLS][N_COLS], + Float2 in[N_SPINS][N_SPINS][N_COLS][N_COLS]){ + if(accum==ACC_ZERO || accum == ZERO_PLUS || accum == ZERO_MINUS) + #pragma unroll + for(int mu=0; mu + __inline__ __device__ void mul_Gdag(Float2 out[N_SPINS][N_SPINS][N_COLS][N_COLS], + Float2 G[N_COLS][N_COLS], + Float2 in[N_SPINS][N_SPINS][N_COLS][N_COLS]){ + if(accum==ACC_ZERO || accum == ZERO_PLUS || accum == ZERO_MINUS) + #pragma unroll + for(int mu=0; mu __inline__ __device__ void scaleG(Float2 a[N_COLS][N_COLS], T w){ diff --git a/lib/kernels/PLEGMA_vector_utils.cuh b/lib/kernels/PLEGMA_vector_utils.cuh index e11b283c..c425cd7b 100644 --- a/lib/kernels/PLEGMA_vector_utils.cuh +++ b/lib/kernels/PLEGMA_vector_utils.cuh @@ -1,4 +1,3 @@ -#pragma once #include #include #include "PLEGMA_kernel_utils.cuh" @@ -19,6 +18,18 @@ static __global__ void rotate_uk_ch_g5g4_kernel(vector2 vec){ vec.set(Sout,sid); } +template +static __global__ void rotate_uk_ch_etmc_kernel(vector2 vec){ + int sid = blockIdx.x*blockDim.x + threadIdx.x; + Float2 Sin[N_SPINS][N_COLS]; + Float2 Sout[N_SPINS][N_COLS]; + if (sid >= vec.volume()) return; + vec.get(Sin,sid); + U_uk_ch_etmc(Sout,Sin); + vec.set(Sout,sid); +} + + template void rotate_uk_ch_g5g4_k(vector2 vec){ dim3 blockDim( THREADS_PER_BLOCK , 1, 1); @@ -27,6 +38,14 @@ void rotate_uk_ch_g5g4_k(vector2 vec){ } +template +void rotate_uk_ch_etmc_k(vector2 vec){ + dim3 blockDim( THREADS_PER_BLOCK , 1, 1); + dim3 gridDim( (vec.volume() + blockDim.x -1)/blockDim.x , 1 , 1); + rotate_uk_ch_etmc_kernel<<>>(vec); +} + + template static __global__ void apply_gamma_vector_kernel(vector2 vec, GAMMAS r){ int sid = blockIdx.x*blockDim.x + threadIdx.x; @@ -123,26 +142,26 @@ static __global__ void copy_to_QUDA(FloatIn *in, FloatOut *outEven, FloatOut *ou } template -static void copy_to_QUDA(FloatIn* in,ColorSpinorField &qudaVec, bool isEven){ +static void copy_to_QUDA(FloatIn* in, std::vector& qudaVec, int src, bool isEven){ dim3 blockDim( THREADS_PER_BLOCK , 1, 1); dim3 gridDim( (HGC_localVolume + blockDim.x -1)/blockDim.x , 1 , 1); - if( qudaVec.SiteSubset() == QUDA_PARITY_SITE_SUBSET ){ + if( (qudaVec[src]).SiteSubset() == QUDA_PARITY_SITE_SUBSET ){ if( isEven ) - copy_to_QUDA<<>>(in,(FloatOut*) qudaVec.V(), NULL); + copy_to_QUDA<<>>(in,(FloatOut*) (qudaVec[src]).data(), NULL); else - copy_to_QUDA<<>>(in, NULL,(FloatOut*) qudaVec.V()); + copy_to_QUDA<<>>(in, NULL,(FloatOut*) (qudaVec[src]).data()); } else - copy_to_QUDA<<>>(in, (FloatOut*) qudaVec.Even().V(),(FloatOut*) qudaVec.Odd().V()); + copy_to_QUDA<<>>(in, (FloatOut*) (qudaVec[src]).Even().data(),(FloatOut*) (qudaVec[src]).Odd().data()); } template -static void copy_to_QUDA(FloatIn* in, ColorSpinorField &qudaVec, bool isEven){ - if( qudaVec.Precision() == QUDA_SINGLE_PRECISION ) - copy_to_QUDA(in, qudaVec, isEven); - else if ( qudaVec.Precision() == QUDA_DOUBLE_PRECISION ) - copy_to_QUDA(in, qudaVec, isEven); +static void copy_to_QUDA(FloatIn* in,std::vector& qudaVec,int src, bool isEven){ + if( (qudaVec[src]).Precision() == QUDA_SINGLE_PRECISION ) + copy_to_QUDA(in, qudaVec, src, isEven); + else if ( (qudaVec[src]).Precision() == QUDA_DOUBLE_PRECISION ) + copy_to_QUDA(in, qudaVec, src, isEven); else - PLEGMA_error("Precision %d not supported", qudaVec.Precision()); + PLEGMA_error("Precision %d not supported", (qudaVec[src]).Precision()); checkQudaError(); } @@ -169,7 +188,6 @@ static __global__ void copy_from_QUDA_kernel(FloatOut *out, FloatIn *inEven, Flo Float2 *inOdd2 = (Float2 *) inOdd; Float2 *out2 = (Float2 *) out; - #pragma unroll for(int mu = 0 ; mu < N_SPINS ; mu++) { #pragma unroll @@ -190,27 +208,25 @@ static __global__ void copy_from_QUDA_kernel(FloatOut *out, FloatIn *inEven, Flo } template -static void copy_from_QUDA(FloatOut* out, ColorSpinorField &qudaVec, bool isEven){ +static void copy_from_QUDA(FloatOut* out, std::vector& qudaVec,int src, bool isEven){ ProfileStruct ps(HGC_localVolume); - PLEGMA_printf("qudaVec.SiteSubset() %d \n",qudaVec.SiteSubset()); - PLEGMA_printf("isEven() %d \n",isEven); - if( qudaVec.SiteSubset() == QUDA_PARITY_SITE_SUBSET ){ + if( (qudaVec[src]).SiteSubset() == QUDA_PARITY_SITE_SUBSET ){ if( isEven ) - tuneAndRun(ps, "copy_from_QUDA_kernel", copy_from_QUDA_kernel,out,(FloatIn*) qudaVec.V(), (FloatIn*) NULL); + tuneAndRun(ps, "copy_from_QUDA_kernel", copy_from_QUDA_kernel,out,(FloatIn*) (qudaVec[src]).data(), (FloatIn*) NULL); else - tuneAndRun(ps, "copy_from_QUDA_kernel", copy_from_QUDA_kernel, out, (FloatIn*) NULL,(FloatIn*) qudaVec.V()); + tuneAndRun(ps, "copy_from_QUDA_kernel", copy_from_QUDA_kernel, out, (FloatIn*) NULL,(FloatIn*) (qudaVec[src]).data()); } else - tuneAndRun(ps, "copy_from_QUDA_kernel", copy_from_QUDA_kernel, out, (FloatIn*) qudaVec.Even().V(),(FloatIn*) qudaVec.Odd().V()); + tuneAndRun(ps, "copy_from_QUDA_kernel", copy_from_QUDA_kernel, out, (FloatIn*) (qudaVec[src]).Even().data(),(FloatIn*) (qudaVec[src]).Odd().data()); } template -static void copy_from_QUDA(FloatOut* out, ColorSpinorField &qudaVec, bool isEven){ - if( qudaVec.Precision() == QUDA_SINGLE_PRECISION ) - copy_from_QUDA(out, qudaVec, isEven); - else if ( qudaVec.Precision() == QUDA_DOUBLE_PRECISION ) - copy_from_QUDA(out, qudaVec, isEven); +static void copy_from_QUDA(FloatOut* out, std::vector &qudaVec, int src, bool isEven){ + if( (qudaVec[src]).Precision() == QUDA_SINGLE_PRECISION ) + copy_from_QUDA(out, qudaVec, src, isEven); + else if ( (qudaVec[src]).Precision() == QUDA_DOUBLE_PRECISION ) + copy_from_QUDA(out, qudaVec, src, isEven); else - PLEGMA_error("Precision %d not supported", qudaVec.Precision()); + PLEGMA_error("Precision %d not supported", (qudaVec[src]).Precision()); checkQudaError(); } @@ -283,9 +299,11 @@ static void compute_rms(const PLEGMA_Vector3D &vec, std::vector &lis zipTplIntDev2 z1 = thrust::make_zip_iterator(thrust::make_tuple(first,y)); zipTplIntDev2 z2 = thrust::make_zip_iterator(thrust::make_tuple(last,y+HGC_localVolume3D)); thrust::for_each(z1,z2,computeRMS(sourceposition[0],sourceposition[1],sourceposition[2],listR2.size(),d_listR2,d_absPsi)); + qudaMemcpy(absPsi.data(), d_absPsi, absPsi.size() * sizeof(Float), qudaMemcpyDeviceToHost); checkQudaError(); device_free(d_listR2); device_free(d_absPsi); + } template diff --git a/lib/targets/hip/target_hip.cmake b/lib/targets/hip/target_hip.cmake index 9aa52b99..75785a1e 100644 --- a/lib/targets/hip/target_hip.cmake +++ b/lib/targets/hip/target_hip.cmake @@ -145,6 +145,7 @@ target_link_options( -fgpu-rdc --hip-link -fopenmp + -fno-cray-openmp $<$:-Werror -Wno-error=pass-failed> $<$:-fsanitize=address diff --git a/plegma/CMakeLists.txt b/plegma/CMakeLists.txt index 521f540d..9d7f2266 100644 --- a/plegma/CMakeLists.txt +++ b/plegma/CMakeLists.txt @@ -1,4 +1,4 @@ -set(PLEGMA_LIBS plegma PLEGMAutils ${CMAKE_THREAD_LIBS_INIT} ${QUDA_LIB} ${MPI_CXX_LIBRARIES} ${HDF5_LIBRARIES}/libhdf5_parallel.so.200 -fopenmp ) +set(PLEGMA_LIBS plegma PLEGMAutils ${CMAKE_THREAD_LIBS_INIT} ${QUDA_LIB} ${MPI_CXX_LIBRARIES} ${PLEGMA_HDF5HOME}/lib/libhdf5_parallel.so.200 -fopenmp -I${PLEGMA_HDF5HOME}/include/) #opt/cray/pe/hdf5-parallel/1.12.1.5/gnu/9.1/lib/libhdf5_parallel.so.200 ${MPI_CXX_LIBRARIES} /pfs/lustrep2/projappl/project_462000125/samantao-public/rocm/rocm-5.3.3/hip/lib/libamdhip64.so) LIST(APPEND PLEGMA_LIBS ${MPI_CXX_LIBRARIES}) diff --git a/plegma/Calc_2pt_marconi.cpp b/plegma/Calc_2pt_marconi.cpp index 30413989..a5287151 100644 --- a/plegma/Calc_2pt_marconi.cpp +++ b/plegma/Calc_2pt_marconi.cpp @@ -81,7 +81,7 @@ int main(int argc, char **argv) updateOptions(CHARM); mu = mu_c[0]; } - TIME(QUDA_solver solver(mu)); + TIME(QUDA_solver solver(mu,1)); std::vector threads; diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index f25a5027..43acd99f 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -6,8 +6,8 @@ file(GLOB PLEGMA_UTILS #cuda_add_library(PLEGMAutils STATIC ${PLEGMA_UTILS}) add_library(PLEGMAutils STATIC ${PLEGMA_UTILS}) if(${PLEGMA_TARGET_TYPE} STREQUAL "HIP") -target_link_libraries(PLEGMAutils PRIVATE ${QUDA_HOME}/lib/libquda.so) -target_include_directories(PLEGMAutils SYSTEM PRIVATE ${QUDA_SRC}/lib ${QUDA_HOME}/include/targets/hip /users/pittlerf/code/quda/build2/_deps/eigen-src/) +target_link_libraries(PLEGMAutils PRIVATE ${QUDA_HOME}/lib/libquda.so -fPIC) +target_include_directories(PLEGMAutils SYSTEM PRIVATE ${QUDA_SRC}/lib ${QUDA_HOME}/include/targets/hip /users/pittlerf/code/quda/build2/_deps/eigen-src/ ${PLEGMA_HDF5HOME}/include -fPIC) endif() if(${PLEGMA_TARGET_TYPE} STREQUAL "CUDA") target_include_directories(PLEGMAutils SYSTEM PRIVATE ${QUDA_SRC}/lib ${QUDA_HOME}/include/targets/cuda /users/pittlerf/code/quda/build2/_deps/eigen-src/) diff --git a/utils/QUDA_interface.cpp b/utils/QUDA_interface.cpp index caebe769..dcd79f86 100644 --- a/utils/QUDA_interface.cpp +++ b/utils/QUDA_interface.cpp @@ -82,7 +82,7 @@ void gFixingLandauOVR_QUDA(PLEGMA_Gauge &gaugeOut,PLEGMA_Gauge & double* buf[N_DIMS]; for(int i=0; i &gaugeOut,PLEGMA_Gauge & gaugeOut.calculatePlaq(); } +void gSmear_QUDA(PLEGMA_Gauge &gaugeOut,PLEGMA_Gauge &gaugeIn, bool antiperiodic){ + + updateGaugeQuda(gaugeIn, antiperiodic); + + QudaGaugeParam gauge_param = newQudaGaugeParam(); + setGaugeParam(gauge_param); + gauge_param.type = QUDA_WILSON_LINKS; + gauge_param.make_resident_gauge = 0; + + double* new_gauge[N_DIMS]; + for(int i=0; i &gauge, bool antiperiodic, QudaLinkType type) { QudaGaugeParam gauge_param = newQudaGaugeParam(); setGaugeParam(gauge_param); @@ -135,8 +182,8 @@ void plaqQuda() { PLEGMA_printf("TEST: Calculated plaquette in QUDA: %f (sp: %f, T: %f)\n", plq[0], plq[1], plq[2]); } -QUDA_solver::QUDA_solver(double mu) { - profiler = new TimeProfile(("Solver profiler mu="+to_string(mu)).c_str()); +QUDA_solver::QUDA_solver(double mu, int nsrc) { + profiler = new TimeProfile(("Solver profiler mu="+std::to_string(mu)).c_str()); profiler->TPSTART(QUDA_PROFILE_TOTAL); if(use_mg){ @@ -179,6 +226,9 @@ QUDA_solver::QUDA_solver(double mu) { inv_param.gflops = 0; inv_param.iter = 0; + inv_param.num_src= nsrc; + inv_param.num_src_per_sub_partition= nsrc; + D = NULL; DSloppy = NULL; DPre = NULL; @@ -195,7 +245,7 @@ QUDA_solver::QUDA_solver(double mu) { // Create Solvers solverParam = new SolverParam(inv_param); solver = Solver::create(*solverParam, *M, *MSloppy, - *MPre, *MPre, *profiler); + *MPre, *MPre); quda::lat_dim_t X = {HGC_localL[0], HGC_localL[1], HGC_localL[2], HGC_localL[3]}; @@ -203,14 +253,21 @@ QUDA_solver::QUDA_solver(double mu) { inv_param.input_location); ColorSpinorParam cudaParam(cpuParam, inv_param,inv_param.input_location); cudaParam.create = QUDA_ZERO_FIELD_CREATE; - b = new ColorSpinorField(cudaParam); - x = new ColorSpinorField(cudaParam); + + for (int i=0; i < nsrc; ++i){ + + b.push_back(ColorSpinorField(cudaParam)); + x.push_back(ColorSpinorField(cudaParam)); + + } profiler->TPSTOP(QUDA_PROFILE_TOTAL); profiler->Print(); profiler->TPRESET(); } + + QUDA_solver::~QUDA_solver(){ if(use_mg){ destroyMultigridQuda(mg_preconditioner); @@ -221,8 +278,12 @@ QUDA_solver::~QUDA_solver(){ delete solver; delete solverParam; delete profiler; - delete b; - delete x; + for (int i=0; i smoother_tol = param->smoother_tol[level]; current->cycle_type = param->cycle_type[level]; current->global_reduction = param->global_reduction[level]; + current->n_vec_batch= param->n_vec_batch[level]; current->omega = param->omega[level]; current->smoother = param->smoother[level]; @@ -305,6 +367,44 @@ static void updateMultigridParam(MG* mg, MGParam* current, QudaMultigridParam* p } } +void QUDA_solver::UpdateGaugeSolver() +{ + profiler->TPSTART(QUDA_PROFILE_TOTAL); + delete solver; + delete solverParam; + delete M; + delete MSloppy; + delete MPre; + + + delete D; D = NULL; + delete DSloppy; DSloppy = NULL; + delete DPre; DPre = NULL; + + loadCloverQuda(NULL, NULL, &inv_param); + + bool pc_solve = true; + createDirac(D, DSloppy, DPre, inv_param, pc_solve); + + // Create Operators + M = (inv_param.inv_type == QUDA_CG_INVERTER || inv_param.inv_type == QUDA_CA_CG_INVERTER) ? static_cast(new DiracMdagM(*D)) : static_cast(new DiracM(*D)); + MSloppy = (inv_param.inv_type == QUDA_CG_INVERTER || inv_param.inv_type == QUDA_CA_CG_INVERTER) ? static_cast(new DiracMdagM(*DSloppy)) : static_cast(new DiracM(*DSloppy)); + MPre = (inv_param.inv_type == QUDA_CG_INVERTER || inv_param.inv_type == QUDA_CA_CG_INVERTER) ? static_cast(new DiracMdagM(*DPre)) : static_cast(new DiracM(*DPre)); + + // Create Solvers + solverParam = new SolverParam(inv_param); + + solver = Solver::create(*solverParam, *M, *MSloppy, + *MPre, *MPre ); + + profiler->*get(Profiler_name()) = ((std::string)("Solver profiler mu=")+std::to_string(mu)).c_str(); + profiler->TPSTOP(QUDA_PROFILE_TOTAL); + profiler->Print(); + profiler->TPRESET(); + + +} + void QUDA_solver::UpdateSolver() { profiler->TPSTART(QUDA_PROFILE_TOTAL); @@ -353,21 +453,32 @@ void QUDA_solver::UpdateSolver() solverParam = new SolverParam(inv_param); solver = Solver::create(*solverParam, *M, *MSloppy, - *MPre, *MPre, *profiler); + *MPre, *MPre ); - profiler->*get(Profiler_name()) = ((std::string)("Solver profiler mu=")+to_string(mu)).c_str(); + profiler->*get(Profiler_name()) = ((std::string)("Solver profiler mu=")+std::to_string(mu)).c_str(); profiler->TPSTOP(QUDA_PROFILE_TOTAL); profiler->Print(); profiler->TPRESET(); } -ColorSpinorField *QUDA_solver::solve(ColorSpinorField * rhs){ +std::vector QUDA_solver::solve(std::vector& rhs){ profiler->TPSTART(QUDA_PROFILE_TOTAL); - ColorSpinorField *in = NULL; - ColorSpinorField *out = NULL; - D->prepare(in,out,*x,*rhs,inv_param.solution_type); - (*solver)(*out, *in); - D->reconstruct(*x,*rhs,inv_param.solution_type); + + std::vector in(rhs.size()); + std::vector out(rhs.size()); + + D->prepare(out,in,x,rhs,inv_param.solution_type); + + (*solver)(out, in); +#if 0 + for (int i=0;inum_src, solverParam->iter, solverParam->true_res[i]); + } +#endif + if (solverParam->iter == solverParam->maxiter){ + PLEGMA_error("Max iteration reached in the inversion %d\n",solverParam->iter); + } + D->reconstruct(x,rhs,inv_param.solution_type); profiler->TPSTOP(QUDA_PROFILE_TOTAL); profiler->Print(); profiler->TPRESET(); @@ -375,52 +486,92 @@ ColorSpinorField *QUDA_solver::solve(ColorSpinorField * rhs){ } -template -ColorSpinorField *QUDA_solver::solve(PLEGMA_Vector &vectorIn){ +template +std::vector QUDA_solver::solve(typename std::conditional, PLEGMA_Propagator>::type &vectorIn){ bool flag_eo=false; if( inv_param.matpc_type == QUDA_MATPC_EVEN_EVEN ) flag_eo = true; - vectorIn.copyToQUDA(b,flag_eo); + vectorIn.copyToQUDA(b, flag_eo); return solve(b); } - template -void QUDA_solver::solve(PLEGMA_Vector &vectorOut, PLEGMA_Vector &vectorIn){ +std::vector QUDA_solver::solve( PLEGMA_Vector &vectorIn){ + return solve(vectorIn); +} +template +std::vector QUDA_solver::solve( PLEGMA_Propagator &vectorIn){ + return solve(vectorIn); +} + + + +template +void QUDA_solver::solve(typename std::conditional, PLEGMA_Propagator>::type &vectorOut, + typename std::conditional, PLEGMA_Propagator>::type &vectorIn){ bool flag_eo = false; if( inv_param.matpc_type == QUDA_MATPC_EVEN_EVEN ) flag_eo = true; - x = solve(vectorIn); + x = solve(vectorIn); vectorOut.copyFromQUDA( x, flag_eo); if (inv_param.mass_normalization == QUDA_MASS_NORMALIZATION || inv_param.mass_normalization == QUDA_ASYMMETRIC_MASS_NORMALIZATION) { - vectorOut.scale(2*inv_param.kappa); + vectorOut.scale(2*inv_param.kappa); } + +} +template void QUDA_solver::solve( PLEGMA_Vector &vectorOut, PLEGMA_Vector &vectorIn ){ + return solve(vectorOut, vectorIn); } +template void QUDA_solver::solve( PLEGMA_Propagator &vectorOut, PLEGMA_Propagator &vectorIn ){ + assertNrhs(this); + return solve(vectorOut, vectorIn); +} + template void QUDA_solver::solve(PLEGMA_Vector &vectorOut, PLEGMA_Vector &vectorIn); template void QUDA_solver::solve(PLEGMA_Vector &vectorOut, PLEGMA_Vector &vectorIn); +template void QUDA_solver::solve(PLEGMA_Propagator &vectorOut, PLEGMA_Propagator &vectorIn); +template void QUDA_solver::solve(PLEGMA_Propagator &vectorOut, PLEGMA_Propagator &vectorIn); -template ColorSpinorField *QUDA_solver::solve(PLEGMA_Vector &vectorIn); -template ColorSpinorField *QUDA_solver::solve(PLEGMA_Vector &vectorIn); +template std::vector QUDA_solver::solve(PLEGMA_Vector &vectorIn); +template std::vector QUDA_solver::solve(PLEGMA_Vector &vectorIn); -template -void QUDA_solver::runOneIter(PLEGMA_Vector &vectorOut, PLEGMA_Vector &vectorIn){ +template std::vector QUDA_solver::solve(PLEGMA_Propagator &vectorIn); +template std::vector QUDA_solver::solve(PLEGMA_Propagator &vectorIn); + +template +void QUDA_solver::runOneIter(typename std::conditional, PLEGMA_Propagator>::type &vectorOut, + typename std::conditional, PLEGMA_Propagator>::type &vectorIn){ int maxiter = solverParam->maxiter; solverParam->maxiter = 1; - solve(vectorOut, vectorIn); + solve(vectorOut, vectorIn); solverParam->maxiter = maxiter; } +template +void QUDA_solver::runOneIter(PLEGMA_Vector &vectorOut, PLEGMA_Vector &vectorIn){ + return runOneIter(vectorOut, vectorIn); +} + +template +void QUDA_solver::runOneIter(PLEGMA_Propagator &vectorOut, PLEGMA_Propagator &vectorIn){ + return runOneIter(vectorOut, vectorIn); +} + + + template void QUDA_solver::runOneIter(PLEGMA_Vector &vectorOut, PLEGMA_Vector &vectorIn); template void QUDA_solver::runOneIter(PLEGMA_Vector &vectorOut, PLEGMA_Vector &vectorIn); +template void QUDA_solver::runOneIter(PLEGMA_Propagator &vectorOut, PLEGMA_Propagator &vectorIn); +template void QUDA_solver::runOneIter(PLEGMA_Propagator &vectorOut, PLEGMA_Propagator &vectorIn); //######################### Quda Dirac operator class ################################ QUDA_dirac::QUDA_dirac(QudaDslashType dslashType): - D(nullptr), in(nullptr), out(nullptr){ + D(nullptr), in(), out(){ if(dslashType != QUDA_WILSON_DSLASH && dslashType != QUDA_CLOVER_WILSON_DSLASH && dslashType != QUDA_TWISTED_MASS_DSLASH @@ -439,49 +590,77 @@ QUDA_dirac::QUDA_dirac(QudaDslashType dslashType): inv_param.input_location); ColorSpinorParam cudaParam(cpuParam, inv_param,inv_param.input_location); cudaParam.create = QUDA_ZERO_FIELD_CREATE; - in = new ColorSpinorField(cudaParam); - out = new ColorSpinorField(cudaParam); - if(in->SiteSubset() != QUDA_FULL_SITE_SUBSET || out->SiteSubset() != QUDA_FULL_SITE_SUBSET) - PLEGMA_error("cudaColorSpinorField should be a full vector for this class"); + in.push_back(ColorSpinorField(cudaParam)); + out.push_back(ColorSpinorField(cudaParam)); +// if(in[0]->SiteSubset() != QUDA_FULL_SITE_SUBSET || out[0]->SiteSubset() != QUDA_FULL_SITE_SUBSET) +// PLEGMA_error("cudaColorSpinorField should be a full vector for this class"); } QUDA_dirac::~QUDA_dirac(){ delete D; - delete in; - delete out; + in.pop_back(); + out.pop_back(); +// delete in; +// delete out; } template void QUDA_dirac::apply(){ switch (type){ - case(M): D->M(*out,*in); break; - case(Mdag): D->Mdag(*out,*in); break; - case(MdagM): D->MdagM(*out,*in); break; - case(MMdag): D->MMdag(*out,*in); break; + case(M): D->M(out,in); break; + case(Mdag): D->Mdag(out,in); break; + case(MdagM): D->MdagM(out,in); break; + case(MMdag): D->MMdag(out,in); break; } } -template -void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType){ +template +void QUDA_dirac::apply(typename std::conditional, PLEGMA_Propagator>::type &Pout, + typename std::conditional, PLEGMA_Propagator>::type &Pin, + QudaMassNormalization normType){ Pin.copyToQUDA(in); apply(); Pout.copyFromQUDA(out); - if (normType == QUDA_MASS_NORMALIZATION || normType == QUDA_ASYMMETRIC_MASS_NORMALIZATION) Pout.scale(1./(2*inv_param.kappa)); + if (normType == QUDA_MASS_NORMALIZATION || normType == QUDA_ASYMMETRIC_MASS_NORMALIZATION){ + Pout.scale(1./(2*inv_param.kappa)); + } +} +templatevoid QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType){ + return apply( Pout, Pin, normType); } +templatevoid QUDA_dirac::apply(PLEGMA_Propagator &Pout, PLEGMA_Propagator &Pin, QudaMassNormalization normType){ + return apply( Pout, Pin, normType); +} + + +template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Propagator &Pout, PLEGMA_Propagator &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Propagator &Pout, PLEGMA_Propagator &Pin, QudaMassNormalization normType); -template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); -template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); -template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); -template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); -template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); -template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); -template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); -template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Propagator &Pout, PLEGMA_Propagator &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Propagator &Pout, PLEGMA_Propagator &Pin, QudaMassNormalization normType); -template +template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Propagator &Pout, PLEGMA_Propagator &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Propagator &Pout, PLEGMA_Propagator &Pin, QudaMassNormalization normType); + +template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Vector &Pout, PLEGMA_Vector &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Propagator &Pout, PLEGMA_Propagator &Pin, QudaMassNormalization normType); +template void QUDA_dirac::apply(PLEGMA_Propagator &Pout, PLEGMA_Propagator &Pin, QudaMassNormalization normType); + + +template void QUDA_dirac::apply(Float *dout, Float *din, QudaMassNormalization normType){ - plegma::copyToQUDA(in,din); + plegma::copyToQUDA(in,(Float *)din); + apply(); - plegma::copyFromQUDA(dout,out); + + plegma::copyFromQUDA((Float *)dout,out); + if (normType == QUDA_MASS_NORMALIZATION || normType == QUDA_ASYMMETRIC_MASS_NORMALIZATION) cuBLAS::scal(N_SPINS*N_COLS*HGC_localVolume, (Float) (1./(2*inv_param.kappa)), dout); } From c681ec5a0644faebc081a6ffa21d2927385b3484 Mon Sep 17 00:00:00 2001 From: Ferenc Pittler Date: Wed, 30 Jul 2025 16:03:44 +0300 Subject: [PATCH 27/27] avioiding issue MPIDI_CRAY_init: GPU_SUPPORT_ENABLED is requested, but GTL library is not linked --- plegma/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plegma/CMakeLists.txt b/plegma/CMakeLists.txt index 9d7f2266..9ac61888 100644 --- a/plegma/CMakeLists.txt +++ b/plegma/CMakeLists.txt @@ -1,4 +1,4 @@ -set(PLEGMA_LIBS plegma PLEGMAutils ${CMAKE_THREAD_LIBS_INIT} ${QUDA_LIB} ${MPI_CXX_LIBRARIES} ${PLEGMA_HDF5HOME}/lib/libhdf5_parallel.so.200 -fopenmp -I${PLEGMA_HDF5HOME}/include/) +set(PLEGMA_LIBS plegma PLEGMAutils ${CMAKE_THREAD_LIBS_INIT} ${QUDA_LIB} ${MPI_CXX_LIBRARIES} ${PLEGMA_HDF5HOME}/lib/libhdf5_parallel.so.200 -fopenmp -I${PLEGMA_HDF5HOME}/include/ -I${MPICH_DIR}/include -L${MPICH_DIR}/lib -lmpi ${PE_MPICH_GTL_DIR_amd_gfx90a} ${PE_MPICH_GTL_LIBS_amd_gfx90a}) #opt/cray/pe/hdf5-parallel/1.12.1.5/gnu/9.1/lib/libhdf5_parallel.so.200 ${MPI_CXX_LIBRARIES} /pfs/lustrep2/projappl/project_462000125/samantao-public/rocm/rocm-5.3.3/hip/lib/libamdhip64.so) LIST(APPEND PLEGMA_LIBS ${MPI_CXX_LIBRARIES})