Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/QMCPACK/qmcpack into gpa…
Browse files Browse the repository at this point in the history
…w_converter
  • Loading branch information
Juha Tiihonen committed Nov 18, 2021
2 parents 6afc761 + af3cca2 commit 31a2155
Show file tree
Hide file tree
Showing 240 changed files with 21,456 additions and 4,837 deletions.
116 changes: 106 additions & 10 deletions .github/workflows/ci-github-actions-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,112 @@ jobs:
fail-fast: false
matrix:
jobname: [
gcc-real-gpu-cuda-mixed, # mixed precision
gcc-complex-gpu-cuda-mixed,
gcc-real-gpu-cuda-full, # full precision
gcc-complex-gpu-cuda-full,
gcc-real-gpu-enable-cuda-afqmc-mixed, # auxiliary field, requires MPI
gcc-complex-gpu-enable-cuda-afqmc-mixed,
gcc-real-gpu-enable-cuda-afqmc-full,
gcc-complex-gpu-enable-cuda-afqmc-full,
clang14_dev-real-gpu-enable-cuda-afqmc-offload-mixed, # auxiliary field, offload requires development llvm14
clang14_dev-real-gpu-enable-cuda-afqmc-offload-full, # TODO: update to llvm/clang14 when available
GCC8-NoMPI-Legacy-CUDA-Real-Mixed, # mixed precision
GCC8-NoMPI-Legacy-CUDA-Complex-Mixed,
GCC8-NoMPI-Legacy-CUDA-Real, # full precision
GCC8-NoMPI-Legacy-CUDA-Complex,
GCC8-MPI-CUDA-AFQMC-Real-Mixed, # auxiliary field, requires MPI
GCC8-MPI-CUDA-AFQMC-Complex-Mixed,
GCC8-MPI-CUDA-AFQMC-Real,
GCC8-MPI-CUDA-AFQMC-Complex,
Clang14Dev-MPI-CUDA-AFQMC-Offload-Real-Mixed, # auxiliary field, offload requires development llvm14
Clang14Dev-MPI-CUDA-AFQMC-Offload-Real,
]

steps:
- name: Verify actor
# Only trigger for certain "actors" (those commenting the PR, not the PR originator)
# this is in-line with the current workflow
env:
ACTOR_TOKEN: ${{secrets.TOKENIZER}}${{github.actor}}${{secrets.TOKENIZER}}
SECRET_ACTORS: ${{secrets.CI_GPU_ACTORS}}
if: contains(env.SECRET_ACTORS, env.ACTOR_TOKEN)
id: check
run: |
echo "::set-output name=triggered::true"
# Request repo info, required since issue_comment doesn't point at PR commit, but develop
- name: GitHub API Request
if: steps.check.outputs.triggered == 'true'
id: request
uses: octokit/request-action@v2.0.0
with:
route: ${{github.event.issue.pull_request.url}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

# Create a separate PR status pointing at GitHub Actions tab URL
# just like any other third-party service
- name: Create PR status
if: steps.check.outputs.triggered == 'true'
uses: Sibz/github-status-action@v1
with:
authToken: ${{secrets.GITHUB_TOKEN}}
context: "GitHub Actions self-hosted CI ${{ matrix.jobname }}"
state: "pending"
sha: ${{fromJson(steps.request.outputs.data).head.sha}}
target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

- name: Get PR information
if: steps.check.outputs.triggered == 'true'
id: pr_data
run: |
echo "::set-output name=branch::${{ fromJson(steps.request.outputs.data).head.ref }}"
echo "::set-output name=repo_name::${{ fromJson(steps.request.outputs.data).head.repo.full_name }}"
echo "::set-output name=repo_clone_url::${{ fromJson(steps.request.outputs.data).head.repo.clone_url }}"
echo "::set-output name=repo_ssh_url::${{ fromJson(steps.request.outputs.data).head.repo.ssh_url }}"
- name: Checkout PR branch
if: steps.check.outputs.triggered == 'true'
uses: actions/checkout@v2
with:
token: ${{secrets.GITHUB_TOKEN}}
repository: ${{fromJson(steps.request.outputs.data).head.repo.full_name}}
ref: ${{steps.pr_data.outputs.branch}}

- name: Configure
if: steps.check.outputs.triggered == 'true'
run: tests/test_automation/github-actions/ci/run_step.sh configure

- name: Build
if: steps.check.outputs.triggered == 'true'
run: tests/test_automation/github-actions/ci/run_step.sh build

- name: Test
if: steps.check.outputs.triggered == 'true'
run: tests/test_automation/github-actions/ci/run_step.sh test

- name: Report PR status
if: always() && steps.check.outputs.triggered == 'true'
uses: Sibz/github-status-action@v1
with:
authToken: ${{secrets.GITHUB_TOKEN}}
context: "GitHub Actions self-hosted CI ${{matrix.jobname}}"
state: ${{job.status}}
sha: ${{fromJson(steps.request.outputs.data).head.sha}}
target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

gpu-rocm:
if: |
github.repository_owner == 'QMCPACK' &&
github.event.issue.pull_request &&
( startsWith(github.event.comment.body, 'Test this please') ||
startsWith(github.event.comment.body, 'Start testing in-house') )
runs-on: [self-hosted, Linux, X64, gpu, rocm]

env:
GH_JOBNAME: ${{matrix.jobname}}
GH_OS: Linux
strategy:
fail-fast: false
matrix:
jobname:
[
ROCm-Clang13-NoMPI-CUDA2HIP-Real-Mixed,
ROCm-Clang13-NoMPI-CUDA2HIP-Real,
ROCm-Clang13-NoMPI-CUDA2HIP-Complex-Mixed,
ROCm-Clang13-NoMPI-CUDA2HIP-Complex,
]

steps:
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/ci-github-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,52 +20,52 @@ jobs:
matrix:
jobname:
[
gcc-openmpi-real-coverage,
gcc-openmpi-complex-coverage,
gcc11-real-werror,
gcc11-complex-werror,
clang-real-asan,
clang-complex-asan,
clang-openmpi-real-ubsan,
clang-latest-openmp-offload,
GCC9-MPI-Gcov-Real,
GCC9-MPI-Gcov-Complex,
GCC11-NoMPI-Werror-Real,
GCC11-NoMPI-Werror-Complex,
Clang10-NoMPI-ASan-Real,
Clang10-NoMPI-ASan-Complex,
Clang10-NoMPI-UBSan-Real,
Clang12-NoMPI-Offload-Real,
]
include:
- jobname: gcc-openmpi-real-coverage
- jobname: GCC9-MPI-Gcov-Real
container:
image: williamfgc/qmcpack-ci:ubuntu20-openmpi
options: -u 1001

- jobname: gcc-openmpi-complex-coverage
- jobname: GCC9-MPI-Gcov-Complex
container:
image: williamfgc/qmcpack-ci:ubuntu20-openmpi
options: -u 1001

- jobname: gcc11-real-werror
- jobname: GCC11-NoMPI-Werror-Real
container:
image: williamfgc/qmcpack-ci:ubuntu2110-serial
options: -u 1001

- jobname: gcc11-complex-werror
- jobname: GCC11-NoMPI-Werror-Complex
container:
image: williamfgc/qmcpack-ci:ubuntu2110-serial
options: -u 1001

- jobname: clang-real-asan
- jobname: Clang10-NoMPI-ASan-Real
container:
image: williamfgc/qmcpack-ci:ubuntu20-openmpi
options: -u 1001

- jobname: clang-complex-asan
- jobname: Clang10-NoMPI-ASan-Complex
container:
image: williamfgc/qmcpack-ci:ubuntu20-openmpi
options: -u 1001

- jobname: clang-openmpi-real-ubsan
- jobname: Clang10-NoMPI-UBSan-Real
container:
image: williamfgc/qmcpack-ci:ubuntu20-openmpi
options: -u 1001

- jobname: clang-latest-openmp-offload
- jobname: Clang12-NoMPI-Offload-Real
container:
image: williamfgc/qmcpack-ci:ubuntu20-clang-latest
options: -u 1001
Expand Down Expand Up @@ -105,16 +105,16 @@ jobs:
strategy:
fail-fast: false
matrix:
jobname: [macOS-gcc11-real]
jobname: [macOS-GCC11-NoMPI-Real]

steps:
- name: Checkout Action
uses: actions/checkout@v2

- name: Setup Dependencies
run: |
brew install ninja hdf5 fftw boost
pip3 install numpy h5py pandas
brew install ninja hdf5 fftw boost
pip3 install numpy h5py pandas
- name: Configure
run: tests/test_automation/github-actions/ci/run_step.sh configure
Expand Down
17 changes: 16 additions & 1 deletion CMake/ClangCompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,26 @@ endif()
if(QMC_OMP)
set(ENABLE_OPENMP 1)
if(ENABLE_OFFLOAD AND NOT CMAKE_SYSTEM_NAME STREQUAL "CrayLinuxEnvironment")
if (QMC_CUDA2HIP)
set(OFFLOAD_TARGET_DEFAULT "amdgcn-amd-amdhsa")
else()
set(OFFLOAD_TARGET_DEFAULT "nvptx64-nvidia-cuda")
endif()
set(OFFLOAD_TARGET
"nvptx64-nvidia-cuda"
${OFFLOAD_TARGET_DEFAULT}
CACHE STRING "Offload target architecture")
set(OPENMP_OFFLOAD_COMPILE_OPTIONS "-fopenmp-targets=${OFFLOAD_TARGET}")

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-Wno-linker-warnings" LINKER_WARNING_SUPPORTED)
if(LINKER_WARNING_SUPPORTED)
set(OPENMP_OFFLOAD_COMPILE_OPTIONS "${OPENMP_OFFLOAD_COMPILE_OPTIONS} -Wno-linker-warnings")
endif()

if(NOT DEFINED OFFLOAD_ARCH AND OFFLOAD_TARGET MATCHES "amdgcn")
set(OFFLOAD_ARCH gfx906)
endif()

if(NOT DEFINED OFFLOAD_ARCH AND OFFLOAD_TARGET MATCHES "nvptx64" AND DEFINED CMAKE_CUDA_ARCHITECTURES)
list(LENGTH CMAKE_CUDA_ARCHITECTURES NUMBER_CUDA_ARCHITECTURES)
if(NUMBER_CUDA_ARCHITECTURES EQUAL "1")
Expand Down
12 changes: 12 additions & 0 deletions CMake/FindRMG.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Locate rmg-cpu
# Take RMG_BIN as hint for location

find_program(RMG_CPU_EXE rmg-cpu HINTS ${RMG_BIN})

set(RMG_FOUND FALSE)
if(RMG_CPU_EXE)
MESSAGE(STATUS "RMG_CPU_EXE=${RMG_CPU_EXE}")
set(RMG_FOUND TRUE)
endif()

mark_as_advanced(RMG_CPU_EXE RMG_FOUND)
8 changes: 8 additions & 0 deletions CMake/ctest_script.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ if(DEFINED QE_BIN)
set(CTEST_OPTIONS "${CTEST_OPTIONS};-DQE_BIN='${QE_BIN}'")
endif()

if(DEFINED RMG_BIN)
set(CTEST_OPTIONS "${CTEST_OPTIONS};-DRMG_BIN='${RMG_BIN}'")
endif()

if(DEFINED QMC_CUDA)
set(CTEST_OPTIONS "${CTEST_OPTIONS};-DQMC_CUDA=${QMC_CUDA}")
endif()
Expand All @@ -178,6 +182,10 @@ if(DEFINED ENABLE_CUDA)
set(CTEST_OPTIONS "${CTEST_OPTIONS};-DENABLE_CUDA=${ENABLE_CUDA}")
endif()

if(DEFINED QMC_CUDA2HIP)
set(CTEST_OPTIONS "${CTEST_OPTIONS};-DQMC_CUDA2HIP=${QMC_CUDA2HIP}")
endif()

if(DEFINED QMC_COMPLEX)
set(CTEST_OPTIONS "${CTEST_OPTIONS};-DQMC_COMPLEX=${QMC_COMPLEX}")
endif()
Expand Down
110 changes: 110 additions & 0 deletions CMake/run_rmg.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# functions for RMG workflow test

if(QMC_NO_SLOW_CUSTOM_TESTING_COMMANDS)
function(ADD_RMG_TEST)

endfunction()
function(RUN_RMG_TEST)

endfunction()
else(QMC_NO_SLOW_CUSTOM_TESTING_COMMANDS)

function(
ADD_RMG_TEST
TESTNAME
NPROCS
NTHREADS
TEST_BINARY
WORKDIR
TEST_INPUT)
#if(HAVE_MPI)
# add_test(NAME ${TESTNAME} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${NPROCS} ${MPIEXEC_PREFLAGS}
# ${TEST_BINARY} ${TEST_INPUT})
#else(HAVE_MPI)
add_test(NAME ${TESTNAME} COMMAND ${TEST_BINARY} ${TEST_INPUT})
#endif(HAVE_MPI)
set_tests_properties(
${TESTNAME}
PROPERTIES ENVIRONMENT
"OMP_NUM_THREADS=${NTHREADS};RMG_NUM_THREADS=${NTHREADS}"
PROCESSORS
${NPROCS}
PROCESSOR_AFFINITY
TRUE
WORKING_DIRECTORY
${WORKDIR})
set_property(
TEST ${TESTNAME}
APPEND
PROPERTY LABELS "converter;rmg")
endfunction()

function(
ADD_RMG_CONVERT_TEST
TESTNAME
PREFIX
WORKDIR
TEST_INPUT)
add_test(NAME ${TESTNAME} COMMAND $<TARGET_FILE:convert4qmc> -rmg ${TEST_INPUT} -prefix ${PREFIX})
set_tests_properties(
${TESTNAME}
PROPERTIES
WORKING_DIRECTORY
${WORKDIR})
set_property(
TEST ${TESTNAME}
APPEND
PROPERTY LABELS "converter;rmg")
endfunction()

function(
RUN_RMG_TEST
BASE_NAME
SRC_DIR
NPROCS
NTHREADS
TEST_NAME)
set(FULL_NAME ${BASE_NAME}-np-${NPROCS})
set(${TEST_NAME}
${FULL_NAME}
PARENT_SCOPE)
set(MY_WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/${FULL_NAME})
message(VERBOSE "Adding test ${FULL_NAME}")
copy_directory("${SRC_DIR}" "${MY_WORKDIR}")
message("workdir: ${MY_WORKDIR}")
add_rmg_test(${FULL_NAME}-scf ${NPROCS} ${NTHREADS} ${RMG_CPU_EXE} ${MY_WORKDIR} input)
softlink_h5_rmg_waves(${FULL_NAME} ${BASE_NAME})
add_rmg_convert_test(${FULL_NAME}-rmg2qmc ${BASE_NAME} ${MY_WORKDIR} ${BASE_NAME}.h5)
set_tests_properties(${FULL_NAME}-rmg2qmc PROPERTIES DEPENDS ${FULL_NAME}-scf)

endfunction()

endif(QMC_NO_SLOW_CUSTOM_TESTING_COMMANDS)

function(SOFTLINK_H5_RMG_WAVES SOURCE PREFIX)
# set(${TEST_NAME}
# "LINK_${SOURCE}_h5_Waves"
# PARENT_SCOPE)
add_test(NAME LINK_${SOURCE}_h5_Waves COMMAND ${qmcpack_SOURCE_DIR}/tests/scripts/clean_and_link_h5.sh
${SOURCE}/Waves/wave.out.h5 ${SOURCE}/${PREFIX}.h5)
set_tests_properties(LINK_${SOURCE}_h5_Waves PROPERTIES DEPENDS ${SOURCE}-scf)
set_property(TEST LINK_${SOURCE}_h5_Waves APPEND PROPERTY LABELS "rmg")
endfunction()

function(SOFTLINK_RMG_INPUT SOURCE TARGET PREFIX TEST_NAME)
set(${TEST_NAME}
"LINK_${SOURCE}_TO_${TARGET}"
PARENT_SCOPE)
add_test(NAME LINK_${SOURCE}_TO_${TARGET} COMMAND ${qmcpack_SOURCE_DIR}/tests/scripts/clean_and_link_h5.sh
${SOURCE}/${PREFIX}.h5 ${SOURCE}-${TARGET}/${PREFIX}.h5)
set_tests_properties(LINK_${SOURCE}_TO_${TARGET} PROPERTIES DEPENDS ${SOURCE}-scf)
set_property(TEST LINK_${SOURCE}_TO_${TARGET} APPEND PROPERTY LABELS "rmg")
add_test(NAME COPY_${SOURCE}_XML_TO_${TARGET} COMMAND
bash -c "mkdir -p ${SOURCE}-${TARGET}; \
cp ${SOURCE}/${PREFIX}.structure.xml ${SOURCE}-${TARGET}/${PREFIX}.structure.xml ; \
cp ${SOURCE}/${PREFIX}.wfnoj.xml ${SOURCE}-${TARGET}/${PREFIX}.wfnoj.xml ; \
cp ${SOURCE}/*.qmcpp.xml ${SOURCE}-${TARGET}/")
set_tests_properties(COPY_${SOURCE}_XML_TO_${TARGET} PROPERTIES DEPENDS ${SOURCE}-scf)
set_property(TEST COPY_${SOURCE}_XML_TO_${TARGET} APPEND PROPERTY LABELS "rmg")
endfunction()

Loading

0 comments on commit 31a2155

Please sign in to comment.