diff --git a/.github/workflows/dockerimage-clang-3.9-ubuntu-mpich.yml b/.github/workflows/dockerimage-clang-3.9-ubuntu-mpich.yml index ff1fd7e498..e3eb56253e 100644 --- a/.github/workflows/dockerimage-clang-3.9-ubuntu-mpich.yml +++ b/.github/workflows/dockerimage-clang-3.9-ubuntu-mpich.yml @@ -28,6 +28,7 @@ jobs: VT_MIMALLOC: 0 VT_DOCS: 0 VT_ASAN: 0 + VT_CI_BUILD: 1 CACHE: ~/.local/cache/ steps: diff --git a/.github/workflows/dockerimage-clang-5.0-ubuntu-mpich.yml b/.github/workflows/dockerimage-clang-5.0-ubuntu-mpich.yml index 67947049b3..54d12f52f6 100644 --- a/.github/workflows/dockerimage-clang-5.0-ubuntu-mpich.yml +++ b/.github/workflows/dockerimage-clang-5.0-ubuntu-mpich.yml @@ -28,6 +28,7 @@ jobs: VT_MIMALLOC: 0 VT_DOCS: 0 VT_ASAN: 0 + VT_CI_BUILD: 1 CACHE: ~/.local/cache/ steps: diff --git a/.github/workflows/dockerimage-clang-8-alpine-mpich.yml b/.github/workflows/dockerimage-clang-8-alpine-mpich.yml index e39622cab5..57b2652131 100644 --- a/.github/workflows/dockerimage-clang-8-alpine-mpich.yml +++ b/.github/workflows/dockerimage-clang-8-alpine-mpich.yml @@ -21,6 +21,7 @@ jobs: VT_MIMALLOC: 0 VT_DOCS: 0 VT_ASAN: 0 + VT_CI_BUILD: 1 CACHE: ~/.local/cache/ steps: diff --git a/.github/workflows/dockerimage-gcc-5-ubuntu-mpich.yml b/.github/workflows/dockerimage-gcc-5-ubuntu-mpich.yml index ecfd8bbfcc..9cdf5bb78f 100644 --- a/.github/workflows/dockerimage-gcc-5-ubuntu-mpich.yml +++ b/.github/workflows/dockerimage-gcc-5-ubuntu-mpich.yml @@ -28,6 +28,7 @@ jobs: VT_MIMALLOC: 0 VT_DOCS: 0 VT_ASAN: 0 + VT_CI_BUILD: 1 CACHE: ~/.local/cache/ steps: diff --git a/.github/workflows/dockerimage-gcc-6-ubuntu-mpich.yml b/.github/workflows/dockerimage-gcc-6-ubuntu-mpich.yml index 40c9bd90b6..539d39250e 100644 --- a/.github/workflows/dockerimage-gcc-6-ubuntu-mpich.yml +++ b/.github/workflows/dockerimage-gcc-6-ubuntu-mpich.yml @@ -28,6 +28,7 @@ jobs: VT_MIMALLOC: 0 VT_DOCS: 0 VT_ASAN: 0 + VT_CI_BUILD: 1 CACHE: ~/.local/cache/ steps: diff --git a/.github/workflows/dockerimage-gcc-7-ubuntu-mpich.yml b/.github/workflows/dockerimage-gcc-7-ubuntu-mpich.yml index 6fbcce3926..72792a7e10 100644 --- a/.github/workflows/dockerimage-gcc-7-ubuntu-mpich.yml +++ b/.github/workflows/dockerimage-gcc-7-ubuntu-mpich.yml @@ -27,6 +27,7 @@ jobs: VT_MIMALLOC: 0 VT_DOCS: 0 VT_ASAN: 0 + VT_CI_BUILD: 1 CACHE: ~/.local/cache/ steps: diff --git a/.github/workflows/dockerimage-gcc-8-ubuntu-mpich.yml b/.github/workflows/dockerimage-gcc-8-ubuntu-mpich.yml index 1864bb5b2b..275f024c62 100644 --- a/.github/workflows/dockerimage-gcc-8-ubuntu-mpich.yml +++ b/.github/workflows/dockerimage-gcc-8-ubuntu-mpich.yml @@ -28,6 +28,7 @@ jobs: VT_DOCS: 0 VT_ASAN: 1 VT_POOL: 0 + VT_CI_BUILD: 1 CACHE: ~/.local/cache/ steps: diff --git a/.github/workflows/dockerimage-intel-18-ubuntu-mpich.yml b/.github/workflows/dockerimage-intel-18-ubuntu-mpich.yml index 8e8d79e376..b75e4765c2 100644 --- a/.github/workflows/dockerimage-intel-18-ubuntu-mpich.yml +++ b/.github/workflows/dockerimage-intel-18-ubuntu-mpich.yml @@ -28,6 +28,7 @@ jobs: VT_DOCS: 0 VT_ASAN: 0 VT_POOL: 0 + VT_CI_BUILD: 1 CACHE: ~/.local/cache/ steps: diff --git a/ci/azure/azure-intel-18-ubuntu-mpich-extended.yml b/ci/azure/azure-intel-18-ubuntu-mpich-extended.yml new file mode 100644 index 0000000000..0d82919e33 --- /dev/null +++ b/ci/azure/azure-intel-18-ubuntu-mpich-extended.yml @@ -0,0 +1,139 @@ +############################################################################### +############## Warning this is a generated file---do not modify ############### +############################################################################### + +name: PR tests extended (intel 18.03, ubuntu, mpich) + + + + + + + +resources: +- repo: self + +variables: + tag: '$(Build.BuildId)' + REPO: lifflander1/vt + ARCH: amd64 + UBUNTU: 18.04 + COMPILER_TYPE: intel + COMPILER: icc-18 + BUILD_TYPE: release + ULIMIT_CORE: 0 + CODE_COVERAGE: 0 + VT_LB: 1 + VT_TRACE: 1 + VT_TRACE_RT: 0 + VT_MIMALLOC: 0 + VT_DOCS: 0 + VT_ASAN: 0 + VT_POOL: 0 + VT_EXTENDED_TESTS: 1 + VT_UNITY_BUILD: 1 + VT_ZOLTAN: 0 + VT_CI_BUILD: 1 + VT_DIAGNOSTICS: 1 + CACHE: "$(Agent.TempDirectory)/cache/" + cache_name: ubuntu-intel-18-cache + build_root: "$(CACHE)/$(ARCH)-ubuntu-$(UBUNTU)-$(COMPILER)-cache/" + TS: 0 + TS_YEAR: 0 + TS_MONTH: 0 + TS_DAY: 0 + +stages: +- stage: Build + displayName: Build image + jobs: + - job: Build + displayName: Build + pool: + vmImage: 'ubuntu-18.04' + timeoutInMinutes: 180 + steps: + - task: Bash@3 + displayName: Job setup + inputs: + targetType: 'inline' + script: | + echo setup + - task: Bash@3 + displayName: Build timestep for caching + inputs: + targetType: 'inline' + script: | + echo 'string(TIMESTAMP current_date "%H;%M;%S" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS]$val" + echo 'string(TIMESTAMP current_date "%Y" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS_YEAR]$val" + echo 'string(TIMESTAMP current_date "%m" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS_MONTH]$val" + echo 'string(TIMESTAMP current_date "%d" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS_DAY]$val" + - task: Bash@3 + displayName: Output timestamp for caching + inputs: + targetType: 'inline' + script: 'echo "my pipeline variable is $(TS) $(TS_YEAR) $(TS_MONTH) $(TS_DAY)"' + - task: Cache@2 + displayName: Update cache + inputs: + securityNamespace: cache + key: $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) | $(TS_MONTH) | $(TS_DAY) | $(TS) + path: '$(build_root)/ccache' + restoreKeys: | + $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) | $(TS_MONTH) | $(TS_DAY) + $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) | $(TS_MONTH) + $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) + $(Agent.OS) | "$(cache_name)" + - task: DockerCompose@0 + displayName: Pull container + inputs: + containerregistrytype: 'Container Registry' + dockerComposeFile: '**/docker-compose.yml' + action: 'Run a Docker Compose command' + dockerComposeCommand: 'pull --ignore-pull-failures ubuntu-cpp-clean' + - task: DockerCompose@0 + displayName: Build container + inputs: + containerregistrytype: 'Container Registry' + dockerComposeFile: '**/docker-compose.yml' + action: 'Run a Docker Compose command' + dockerComposeCommand: 'run ubuntu-cpp-clean' + - task: DockerCompose@0 + displayName: Push container to registry + inputs: + containerregistrytype: 'Container Registry' + dockerRegistryEndpoint: 'dockerRegistryConnection1' + dockerComposeFile: '**/docker-compose.yml' + action: 'Run a Docker Compose command' + dockerComposeCommand: 'push ubuntu-cpp-clean' + - task: Bash@3 + displayName: Create artifacts + inputs: + targetType: 'inline' + script: | + zip -j $(Agent.TempDirectory)/LastTest.log.gz $(build_root)/vt/Testing/Temporary/LastTest.log + zip -j $(Agent.TempDirectory)/cmake-output.log.gz $(build_root)/vt/cmake-output.log + - task: PublishPipelineArtifact@1 + displayName: Upload CMake test output artifact + inputs: + targetPath: '$(Agent.TempDirectory)/LastTest.log.gz' + artifact: 'CMakeLastTestLog' + publishLocation: 'pipeline' + - task: PublishPipelineArtifact@1 + displayName: Upload CMake full output artifact + inputs: + targetPath: '$(Agent.TempDirectory)/cmake-output.log.gz' + artifact: 'CMakeOutputLog' + publishLocation: 'pipeline' diff --git a/ci/azure/azure-nvidia-10-ubuntu-mpich-extended.yml b/ci/azure/azure-nvidia-10-ubuntu-mpich-extended.yml new file mode 100644 index 0000000000..19d53105d9 --- /dev/null +++ b/ci/azure/azure-nvidia-10-ubuntu-mpich-extended.yml @@ -0,0 +1,139 @@ +############################################################################### +############## Warning this is a generated file---do not modify ############### +############################################################################### + +name: PR tests extended (nvidia cuda 10.1, ubuntu, mpich) + + + + + + + +resources: +- repo: self + +variables: + tag: '$(Build.BuildId)' + REPO: lifflander1/vt + ARCH: amd64 + UBUNTU: 18.04 + COMPILER_TYPE: nvidia + COMPILER: nvcc-10 + BUILD_TYPE: release + ULIMIT_CORE: 0 + CODE_COVERAGE: 0 + VT_LB: 1 + VT_TRACE: 1 + VT_TRACE_RT: 0 + VT_MIMALLOC: 0 + VT_DOCS: 0 + VT_ASAN: 0 + VT_POOL: 0 + VT_EXTENDED_TESTS: 1 + VT_UNITY_BUILD: 1 + VT_ZOLTAN: 0 + VT_CI_BUILD: 1 + VT_DIAGNOSTICS: 1 + CACHE: "$(Agent.TempDirectory)/cache/" + cache_name: ubuntu-nvidia-10-cache + build_root: "$(CACHE)/$(ARCH)-ubuntu-$(UBUNTU)-$(COMPILER)-cache/" + TS: 0 + TS_YEAR: 0 + TS_MONTH: 0 + TS_DAY: 0 + +stages: +- stage: Build + displayName: Build image + jobs: + - job: Build + displayName: Build + pool: + vmImage: 'ubuntu-18.04' + timeoutInMinutes: 180 + steps: + - task: Bash@3 + displayName: Job setup + inputs: + targetType: 'inline' + script: | + echo setup + - task: Bash@3 + displayName: Build timestep for caching + inputs: + targetType: 'inline' + script: | + echo 'string(TIMESTAMP current_date "%H;%M;%S" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS]$val" + echo 'string(TIMESTAMP current_date "%Y" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS_YEAR]$val" + echo 'string(TIMESTAMP current_date "%m" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS_MONTH]$val" + echo 'string(TIMESTAMP current_date "%d" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS_DAY]$val" + - task: Bash@3 + displayName: Output timestamp for caching + inputs: + targetType: 'inline' + script: 'echo "my pipeline variable is $(TS) $(TS_YEAR) $(TS_MONTH) $(TS_DAY)"' + - task: Cache@2 + displayName: Update cache + inputs: + securityNamespace: cache + key: $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) | $(TS_MONTH) | $(TS_DAY) | $(TS) + path: '$(build_root)/ccache' + restoreKeys: | + $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) | $(TS_MONTH) | $(TS_DAY) + $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) | $(TS_MONTH) + $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) + $(Agent.OS) | "$(cache_name)" + - task: DockerCompose@0 + displayName: Pull container + inputs: + containerregistrytype: 'Container Registry' + dockerComposeFile: '**/docker-compose.yml' + action: 'Run a Docker Compose command' + dockerComposeCommand: 'pull --ignore-pull-failures ubuntu-cpp-clean' + - task: DockerCompose@0 + displayName: Build container + inputs: + containerregistrytype: 'Container Registry' + dockerComposeFile: '**/docker-compose.yml' + action: 'Run a Docker Compose command' + dockerComposeCommand: 'run ubuntu-cpp-clean' + - task: DockerCompose@0 + displayName: Push container to registry + inputs: + containerregistrytype: 'Container Registry' + dockerRegistryEndpoint: 'dockerRegistryConnection1' + dockerComposeFile: '**/docker-compose.yml' + action: 'Run a Docker Compose command' + dockerComposeCommand: 'push ubuntu-cpp-clean' + - task: Bash@3 + displayName: Create artifacts + inputs: + targetType: 'inline' + script: | + zip -j $(Agent.TempDirectory)/LastTest.log.gz $(build_root)/vt/Testing/Temporary/LastTest.log + zip -j $(Agent.TempDirectory)/cmake-output.log.gz $(build_root)/vt/cmake-output.log + - task: PublishPipelineArtifact@1 + displayName: Upload CMake test output artifact + inputs: + targetPath: '$(Agent.TempDirectory)/LastTest.log.gz' + artifact: 'CMakeLastTestLog' + publishLocation: 'pipeline' + - task: PublishPipelineArtifact@1 + displayName: Upload CMake full output artifact + inputs: + targetPath: '$(Agent.TempDirectory)/cmake-output.log.gz' + artifact: 'CMakeOutputLog' + publishLocation: 'pipeline' diff --git a/ci/azure/azure-nvidia-11-ubuntu-mpich-extended.yml b/ci/azure/azure-nvidia-11-ubuntu-mpich-extended.yml new file mode 100644 index 0000000000..257def3268 --- /dev/null +++ b/ci/azure/azure-nvidia-11-ubuntu-mpich-extended.yml @@ -0,0 +1,139 @@ +############################################################################### +############## Warning this is a generated file---do not modify ############### +############################################################################### + +name: PR tests extended (nvidia cuda 11.0, ubuntu, mpich) + + + + + + + +resources: +- repo: self + +variables: + tag: '$(Build.BuildId)' + REPO: lifflander1/vt + ARCH: amd64 + UBUNTU: 18.04 + COMPILER_TYPE: nvidia + COMPILER: nvcc-11 + BUILD_TYPE: release + ULIMIT_CORE: 0 + CODE_COVERAGE: 0 + VT_LB: 1 + VT_TRACE: 1 + VT_TRACE_RT: 0 + VT_MIMALLOC: 0 + VT_DOCS: 0 + VT_ASAN: 0 + VT_POOL: 0 + VT_EXTENDED_TESTS: 1 + VT_UNITY_BUILD: 1 + VT_ZOLTAN: 0 + VT_CI_BUILD: 1 + VT_DIAGNOSTICS: 1 + CACHE: "$(Agent.TempDirectory)/cache/" + cache_name: ubuntu-nvidia-11-cache + build_root: "$(CACHE)/$(ARCH)-ubuntu-$(UBUNTU)-$(COMPILER)-cache/" + TS: 0 + TS_YEAR: 0 + TS_MONTH: 0 + TS_DAY: 0 + +stages: +- stage: Build + displayName: Build image + jobs: + - job: Build + displayName: Build + pool: + vmImage: 'ubuntu-18.04' + timeoutInMinutes: 180 + steps: + - task: Bash@3 + displayName: Job setup + inputs: + targetType: 'inline' + script: | + echo setup + - task: Bash@3 + displayName: Build timestep for caching + inputs: + targetType: 'inline' + script: | + echo 'string(TIMESTAMP current_date "%H;%M;%S" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS]$val" + echo 'string(TIMESTAMP current_date "%Y" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS_YEAR]$val" + echo 'string(TIMESTAMP current_date "%m" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS_MONTH]$val" + echo 'string(TIMESTAMP current_date "%d" UTC)' > script + echo 'execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${current_date}")' >> script + val=$(cmake -P script) + echo "##vso[task.setvariable variable=TS_DAY]$val" + - task: Bash@3 + displayName: Output timestamp for caching + inputs: + targetType: 'inline' + script: 'echo "my pipeline variable is $(TS) $(TS_YEAR) $(TS_MONTH) $(TS_DAY)"' + - task: Cache@2 + displayName: Update cache + inputs: + securityNamespace: cache + key: $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) | $(TS_MONTH) | $(TS_DAY) | $(TS) + path: '$(build_root)/ccache' + restoreKeys: | + $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) | $(TS_MONTH) | $(TS_DAY) + $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) | $(TS_MONTH) + $(Agent.OS) | "$(cache_name)" | $(TS_YEAR) + $(Agent.OS) | "$(cache_name)" + - task: DockerCompose@0 + displayName: Pull container + inputs: + containerregistrytype: 'Container Registry' + dockerComposeFile: '**/docker-compose.yml' + action: 'Run a Docker Compose command' + dockerComposeCommand: 'pull --ignore-pull-failures ubuntu-cpp-clean' + - task: DockerCompose@0 + displayName: Build container + inputs: + containerregistrytype: 'Container Registry' + dockerComposeFile: '**/docker-compose.yml' + action: 'Run a Docker Compose command' + dockerComposeCommand: 'run ubuntu-cpp-clean' + - task: DockerCompose@0 + displayName: Push container to registry + inputs: + containerregistrytype: 'Container Registry' + dockerRegistryEndpoint: 'dockerRegistryConnection1' + dockerComposeFile: '**/docker-compose.yml' + action: 'Run a Docker Compose command' + dockerComposeCommand: 'push ubuntu-cpp-clean' + - task: Bash@3 + displayName: Create artifacts + inputs: + targetType: 'inline' + script: | + zip -j $(Agent.TempDirectory)/LastTest.log.gz $(build_root)/vt/Testing/Temporary/LastTest.log + zip -j $(Agent.TempDirectory)/cmake-output.log.gz $(build_root)/vt/cmake-output.log + - task: PublishPipelineArtifact@1 + displayName: Upload CMake test output artifact + inputs: + targetPath: '$(Agent.TempDirectory)/LastTest.log.gz' + artifact: 'CMakeLastTestLog' + publishLocation: 'pipeline' + - task: PublishPipelineArtifact@1 + displayName: Upload CMake full output artifact + inputs: + targetPath: '$(Agent.TempDirectory)/cmake-output.log.gz' + artifact: 'CMakeOutputLog' + publishLocation: 'pipeline' diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 2197e85dd4..cfd113afb2 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -101,6 +101,7 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \ -Dcheckpoint_DIR="$CHECKPOINT_BUILD/install" \ -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH:-}" \ -DCMAKE_INSTALL_PREFIX="$VT_BUILD/install" \ + -Dvt_ci_build="${VT_CI_BUILD:-0}" \ "$VT" if test "${VT_DOXYGEN_ENABLED:-0}" -eq 1 diff --git a/cmake-modules/CheckLinkerFlag.cmake b/cmake-modules/CheckLinkerFlag.cmake new file mode 100644 index 0000000000..aa913b31ab --- /dev/null +++ b/cmake-modules/CheckLinkerFlag.cmake @@ -0,0 +1,12 @@ +include(CheckCXXCompilerFlag) + +if(POLICY CMP0056) + # Honor link flags in try_compile() source-file signature. + cmake_policy(SET CMP0056 NEW) +endif() + +# This is written because cmake does not support `check_linker_flag` until 3.18 +function(check_linker_flag flag out_var) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag}") + check_cxx_compiler_flag("" ${out_var}) +endfunction() diff --git a/cmake/define_build_types.cmake b/cmake/define_build_types.cmake index e6f61e1baf..0e8a2f2eed 100644 --- a/cmake/define_build_types.cmake +++ b/cmake/define_build_types.cmake @@ -152,6 +152,14 @@ else() set(vt_feature_cmake_mpi_access_guards "0") endif() +if(${vt_ci_build}) + set(vt_feature_cmake_ci_build "1") +else() + set(vt_feature_cmake_ci_build "0") +endif() + +message(STATUS "CI_BUILD = ${vt_feature_cmake_ci_build}") + set(vt_feature_cmake_no_feature "0") set(vt_feature_cmake_production "0") @@ -192,8 +200,8 @@ foreach(loop_build_type ${VT_CONFIG_TYPES}) ${cmake_vt_debug_modes_${loop_build_type}} ) - # assume production mode for everything except debug - if (loop_build_type STREQUAL "debug") + # assume production mode for everything except debug or CI build + if (loop_build_type STREQUAL "debug" OR ${vt_feature_cmake_ci_build}) set(vt_feature_cmake_production "0") else() set(vt_feature_cmake_production "1") diff --git a/cmake/set_linker_flags.cmake b/cmake/set_linker_flags.cmake new file mode 100644 index 0000000000..7a4a9ffd47 --- /dev/null +++ b/cmake/set_linker_flags.cmake @@ -0,0 +1,11 @@ +include(CheckLinkerFlag) + +check_linker_flag(-rdynamic LINKER_SUPPORTS_RDYNAMIC) + +if (LINKER_SUPPORTS_RDYNAMIC) + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13) + target_link_options(${VIRTUAL_TRANSPORT_LIBRARY} INTERFACE -rdynamic) + else() + target_link_libraries(${VIRTUAL_TRANSPORT_LIBRARY} INTERFACE -rdynamic) + endif() +endif() diff --git a/cmake_config.h.in b/cmake_config.h.in index 4927f62f0a..9297178c96 100644 --- a/cmake_config.h.in +++ b/cmake_config.h.in @@ -66,6 +66,7 @@ #define vt_feature_cmake_mimalloc @vt_feature_cmake_mimalloc@ #define vt_feature_cmake_zoltan @vt_feature_cmake_zoltan@ #define vt_feature_cmake_mpi_access_guards @vt_feature_cmake_mpi_access_guards@ +#define vt_feature_cmake_ci_build @vt_feature_cmake_ci_build@ #cmakedefine vt_has_malloc_h #cmakedefine vt_has_malloc_malloc_h diff --git a/docker-compose.yml b/docker-compose.yml index 4925122d4b..7174b170bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -102,6 +102,7 @@ x-vtopts: &vtopts VT_MPI_GUARD_ENABLED: ${VT_MPI_GUARD:-1} https_proxy: ${PROXY-} http_proxy: ${PROXY-} + VT_CI_BUILD: ${VT_CI_BUILD:-0} services: ############################################################################## diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f7e2ad8382..c6a95fa9c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -263,6 +263,7 @@ if(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") endif() endif() +include(../cmake/set_linker_flags.cmake) install( TARGETS ${VIRTUAL_TRANSPORT_LIBRARY} diff --git a/src/vt/collective/startup.cc b/src/vt/collective/startup.cc index e0a8ed6d71..40010925f5 100644 --- a/src/vt/collective/startup.cc +++ b/src/vt/collective/startup.cc @@ -52,16 +52,20 @@ namespace vt { // vt::{initialize,finalize} for main ::vt namespace RuntimePtrType initialize( - int argc, char** argv, WorkerCountType const num_workers, - bool is_interop /* = false */, MPI_Comm* comm /* = nullptr */ + int& argc, char**& argv, WorkerCountType const num_workers, + bool is_interop, MPI_Comm* comm ) { return CollectiveOps::initialize(argc,argv,num_workers,is_interop,comm); } -RuntimePtrType initialize( - int argc /* = 0 */, char** argv /* = nullptr */, - MPI_Comm* comm /* = nullptr */ -) { +RuntimePtrType initialize(int& argc, char**& argv, MPI_Comm* comm) { + bool const is_interop = comm != nullptr; + return CollectiveOps::initialize(argc,argv,no_workers,is_interop,comm); +} + +RuntimePtrType initialize(MPI_Comm* comm) { + int argc = 0; + char** argv = nullptr; bool const is_interop = comm != nullptr; return CollectiveOps::initialize(argc,argv,no_workers,is_interop,comm); } diff --git a/src/vt/collective/startup.h b/src/vt/collective/startup.h index fc5bb9a743..c7a05d53e8 100644 --- a/src/vt/collective/startup.h +++ b/src/vt/collective/startup.h @@ -51,12 +51,11 @@ namespace vt { RuntimePtrType initialize( - int argc, char** argv, WorkerCountType const num_workers, + int& argc, char**& argv, WorkerCountType const num_workers, bool is_interop = false, MPI_Comm* comm = nullptr ); -RuntimePtrType initialize( - int argc = 0, char** argv = nullptr, MPI_Comm* comm = nullptr -); +RuntimePtrType initialize(int& argc, char**& argv, MPI_Comm* comm = nullptr); +RuntimePtrType initialize(MPI_Comm* comm = nullptr); void finalize(RuntimePtrType in_rt); void finalize(); diff --git a/src/vt/configs/features/features_defines.h b/src/vt/configs/features/features_defines.h index 03a9f74852..0898da046a 100644 --- a/src/vt/configs/features/features_defines.h +++ b/src/vt/configs/features/features_defines.h @@ -69,5 +69,6 @@ #define vt_feature_mimalloc 0 || vt_feature_cmake_mimalloc #define vt_feature_zoltan 0 || vt_feature_cmake_zoltan #define vt_feature_mpi_access_guards 0 || vt_feature_cmake_mpi_access_guards +#define vt_feature_ci_build 0 || vt_feature_cmake_ci_build #endif /*INCLUDED_VT_CONFIGS_FEATURES_FEATURES_DEFINES_H*/ diff --git a/src/vt/messaging/irecv_holder.h b/src/vt/messaging/irecv_holder.h index 226fcda791..da367e7bc4 100644 --- a/src/vt/messaging/irecv_holder.h +++ b/src/vt/messaging/irecv_holder.h @@ -78,8 +78,6 @@ struct IRecvHolder { template bool testAll(Callable c) { - VT_ALLOW_MPI_CALLS; // MPI_Test in loop - # if backend_check_enabled(trace_enabled) std::size_t const holder_size_start = holder_.size(); TimeType tr_begin = 0.0; diff --git a/tests/unit/runtime/test_initialization_with_args.cc b/tests/unit/runtime/test_initialization_with_args.cc new file mode 100644 index 0000000000..387dc4ac6d --- /dev/null +++ b/tests/unit/runtime/test_initialization_with_args.cc @@ -0,0 +1,96 @@ +/* +//@HEADER +// ***************************************************************************** +// +// test_initialization.cc +// DARMA Toolkit v. 1.0.0 +// DARMA/vt => Virtual Transport +// +// Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC +// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. +// Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact darma@sandia.gov +// +// ***************************************************************************** +//@HEADER +*/ + +#include + +#include "test_parallel_harness.h" + +#include + +namespace vt { namespace tests { namespace unit { + +struct TestInitialization : TestParallelHarness { + void SetUp() override { + using namespace vt; + + TestHarness::SetUp(); + + if (mpi_singleton == nullptr) { + mpi_singleton = + std::make_unique(test_argc, test_argv); + } + + // communicator is duplicated. + MPI_Comm comm = mpi_singleton->getComm(); + + static char prog_name[]{"vt_program"}; + static char cli_argument[]{"--cli_argument=100"}; + static char vt_no_terminate[]{"--vt_no_terminate"}; + custom_args.emplace_back(&prog_name[0]); + custom_args.emplace_back(&cli_argument[0]); + custom_args.emplace_back(&vt_no_terminate[0]); + custom_args.emplace_back(nullptr); + + custom_argc = custom_args.size() - 1; + custom_argv = custom_args.data(); + EXPECT_EQ(custom_argc, 3); + + vt::initialize(custom_argc, custom_argv, no_workers, true, &comm); + } + + std::vector custom_args; + int custom_argc; + char** custom_argv; +}; + +TEST_F(TestInitialization, test_initialize_with_args) { + EXPECT_EQ(vt::arguments::ArgConfig::vt_no_terminate, true); + + EXPECT_EQ(custom_argc, 2); + EXPECT_STREQ(custom_argv[0], "vt_program"); + EXPECT_STREQ(custom_argv[1], "--cli_argument=100"); + EXPECT_EQ(custom_argv[2], nullptr); +} + +}}} // end namespace vt::tests::unit