From b8c7fa8e12436a689f28d58cca1f6787d8709cbe Mon Sep 17 00:00:00 2001 From: Phil Miller Date: Fri, 4 Dec 2020 12:37:00 -0700 Subject: [PATCH 1/5] #728: Overload templates rather than instantiating in default argument to avoid ICE in Intel 19.x --- src/vt/collective/reduce/reduce.h | 88 +++++++++++++++++++-- src/vt/objgroup/proxy/proxy_objgroup.h | 42 ++++++++-- src/vt/vrt/collection/reducable/reducable.h | 36 ++++++++- 3 files changed, 149 insertions(+), 17 deletions(-) diff --git a/src/vt/collective/reduce/reduce.h b/src/vt/collective/reduce/reduce.h index 495adcb793..c06f90bf27 100644 --- a/src/vt/collective/reduce/reduce.h +++ b/src/vt/collective/reduce/reduce.h @@ -179,15 +179,33 @@ struct Reduce : virtual collective::tree::Tree { template < typename OpT, typename MsgT, - ActiveTypedFnType *f = MsgT::template msgHandler< - MsgT, OpT, collective::reduce::operators::ReduceCallback - > + ActiveTypedFnType *f > PendingSendType reduce( NodeType const& root, MsgT* msg, Callback cb, detail::ReduceStamp id = detail::ReduceStamp{}, ReduceNumType const& num_contrib = 1 ); + template < + typename OpT, + typename MsgT + > + PendingSendType reduce( + NodeType const& root, MsgT* msg, Callback cb, + detail::ReduceStamp id = detail::ReduceStamp{}, + ReduceNumType const& num_contrib = 1 + ) + { + return reduce< + OpT, + MsgT, + MsgT::template msgHandler< + MsgT, + OpT, + collective::reduce::operators::ReduceCallback + > + >(root, msg, cb, id, num_contrib); + } /** * \brief Reduce a message up the tree @@ -203,15 +221,33 @@ struct Reduce : virtual collective::tree::Tree { template < typename OpT, typename MsgT, - ActiveTypedFnType *f = MsgT::template msgHandler< - MsgT, OpT, collective::reduce::operators::ReduceCallback - > + ActiveTypedFnType *f > detail::ReduceStamp reduceImmediate( NodeType const& root, MsgT* msg, Callback cb, detail::ReduceStamp id = detail::ReduceStamp{}, ReduceNumType const& num_contrib = 1 ); + template < + typename OpT, + typename MsgT + > + detail::ReduceStamp reduceImmediate( + NodeType const& root, MsgT* msg, Callback cb, + detail::ReduceStamp id = detail::ReduceStamp{}, + ReduceNumType const& num_contrib = 1 + ) + { + return reduceImmediate< + OpT, + MsgT, + MsgT::template msgHandler< + MsgT, + OpT, + collective::reduce::operators::ReduceCallback + > + >(root, msg, cb, id, num_contrib); + } /** * \brief Reduce a message up the tree with a target function on the root node @@ -227,13 +263,31 @@ struct Reduce : virtual collective::tree::Tree { typename OpT, typename FunctorT, typename MsgT, - ActiveTypedFnType *f = MsgT::template msgHandler + ActiveTypedFnType *f > PendingSendType reduce( NodeType const& root, MsgT* msg, detail::ReduceStamp id = detail::ReduceStamp{}, ReduceNumType const& num_contrib = 1 ); + template < + typename OpT, + typename FunctorT, + typename MsgT + > + PendingSendType reduce( + NodeType const& root, MsgT* msg, + detail::ReduceStamp id = detail::ReduceStamp{}, + ReduceNumType const& num_contrib = 1 + ) + { + return reduce< + OpT, + FunctorT, + MsgT, + MsgT::template msgHandler + >(root, msg, id, num_contrib); + } /** * \brief Reduce a message up the tree with a target function on the root node @@ -249,13 +303,31 @@ struct Reduce : virtual collective::tree::Tree { typename OpT, typename FunctorT, typename MsgT, - ActiveTypedFnType *f = MsgT::template msgHandler + ActiveTypedFnType *f > detail::ReduceStamp reduceImmediate( NodeType const& root, MsgT* msg, detail::ReduceStamp id = detail::ReduceStamp{}, ReduceNumType const& num_contrib = 1 ); + template < + typename OpT, + typename FunctorT, + typename MsgT + > + detail::ReduceStamp reduceImmediate( + NodeType const& root, MsgT* msg, + detail::ReduceStamp id = detail::ReduceStamp{}, + ReduceNumType const& num_contrib = 1 + ) + { + return reduceImmediate< + OpT, + FunctorT, + MsgT, + MsgT::template msgHandler + >(root, msg, id, num_contrib); + } /** * \internal \brief Combine in a new message for a given reduction diff --git a/src/vt/objgroup/proxy/proxy_objgroup.h b/src/vt/objgroup/proxy/proxy_objgroup.h index e81712d465..d481d0a569 100644 --- a/src/vt/objgroup/proxy/proxy_objgroup.h +++ b/src/vt/objgroup/proxy/proxy_objgroup.h @@ -149,14 +149,30 @@ struct Proxy { template < typename OpT = collective::None, typename MsgPtrT, - typename MsgT = typename util::MsgPtrType::MsgType, - ActiveTypedFnType *f = MsgT::template msgHandler< - MsgT, OpT, collective::reduce::operators::ReduceCallback - > + typename MsgT, + ActiveTypedFnType *f > PendingSendType reduce( MsgPtrT msg, Callback cb, ReduceStamp stamp = ReduceStamp{} ) const; + template < + typename OpT = collective::None, + typename MsgPtrT, + typename MsgT = typename util::MsgPtrType::MsgType + > + PendingSendType reduce( + MsgPtrT msg, Callback cb, ReduceStamp stamp = ReduceStamp{} + ) const + { + return reduce< + OpT, + MsgPtrT, + MsgT, + MsgT::template msgHandler< + MsgT, OpT, collective::reduce::operators::ReduceCallback + > + >(msg, cb, stamp); + } /** * \brief Reduce over the objgroup instances on each node with a functor @@ -172,9 +188,25 @@ struct Proxy { typename FunctorT, typename MsgPtrT, typename MsgT = typename util::MsgPtrType::MsgType, - ActiveTypedFnType *f = MsgT::template msgHandler + ActiveTypedFnType *f > PendingSendType reduce(MsgPtrT msg, ReduceStamp stamp = ReduceStamp{}) const; + template < + typename OpT = collective::None, + typename FunctorT, + typename MsgPtrT, + typename MsgT = typename util::MsgPtrType::MsgType + > + PendingSendType reduce(MsgPtrT msg, ReduceStamp stamp = ReduceStamp{}) const + { + return reduce< + OpT, + FunctorT, + MsgPtrT, + MsgT, + MsgT::template msgHandler + >(msg, stamp); + } /** * \brief Reduce over the objgroup instance on each node with target specified diff --git a/src/vt/vrt/collection/reducable/reducable.h b/src/vt/vrt/collection/reducable/reducable.h index 40a2f7709f..e9c4c1ea4b 100644 --- a/src/vt/vrt/collection/reducable/reducable.h +++ b/src/vt/vrt/collection/reducable/reducable.h @@ -71,21 +71,49 @@ struct Reducable : BaseProxyT { template < typename OpT = collective::None, typename MsgT, - ActiveTypedFnType *f = MsgT::template msgHandler< - MsgT, OpT, collective::reduce::operators::ReduceCallback - > + ActiveTypedFnType *f > messaging::PendingSend reduce( MsgT *const msg, Callback cb, ReduceStamp stamp = ReduceStamp{} ) const; + template < + typename OpT = collective::None, + typename MsgT + > + messaging::PendingSend reduce( + MsgT *const msg, Callback cb, ReduceStamp stamp = ReduceStamp{} + ) const + { + return reduce< + OpT, + MsgT, + MsgT::template msgHandler< + MsgT, OpT, collective::reduce::operators::ReduceCallback + > + >(msg, cb, stamp); + } template < typename OpT, typename FunctorT, typename MsgT, - ActiveTypedFnType *f = MsgT::template msgHandler + ActiveTypedFnType *f > messaging::PendingSend reduce(MsgT *const msg, ReduceStamp stamp = ReduceStamp{}) const; + template < + typename OpT, + typename FunctorT, + typename MsgT + > + messaging::PendingSend reduce(MsgT *const msg, ReduceStamp stamp = ReduceStamp{}) const + { + return reduce< + OpT, + FunctorT, + MsgT, + MsgT::template msgHandler + >(msg, stamp); + } template *f> messaging::PendingSend reduce( From 325495d45db259dc63508dbdb4da39b3337edbfd Mon Sep 17 00:00:00 2001 From: Phil Miller Date: Fri, 4 Dec 2020 12:37:24 -0700 Subject: [PATCH 2/5] #728: Fix ubiquitous warning about silly const return from Intel 19 --- tests/unit/test_parallel_harness.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_parallel_harness.h b/tests/unit/test_parallel_harness.h index 7b6dfe9b2f..d496b38c20 100644 --- a/tests/unit/test_parallel_harness.h +++ b/tests/unit/test_parallel_harness.h @@ -77,7 +77,7 @@ struct MPISingletonMultiTest { } public: - const MPI_Comm getComm() { return comm_; } + MPI_Comm getComm() { return comm_; } private: MPI_Comm comm_; From 1be594d40930810fc41020b42a557e019b953ae0 Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Fri, 4 Dec 2020 12:06:58 -0800 Subject: [PATCH 3/5] #728: CI: add Intel 19 to build --- ci/azure/azure-intel-19-ubuntu-mpich.yml | 145 +++++++++++++++++++++++ scripts/workflows-azure.ini | 10 ++ 2 files changed, 155 insertions(+) create mode 100644 ci/azure/azure-intel-19-ubuntu-mpich.yml diff --git a/ci/azure/azure-intel-19-ubuntu-mpich.yml b/ci/azure/azure-intel-19-ubuntu-mpich.yml new file mode 100644 index 0000000000..0e28d769dc --- /dev/null +++ b/ci/azure/azure-intel-19-ubuntu-mpich.yml @@ -0,0 +1,145 @@ +############################################################################### +############## Warning this is a generated file---do not modify ############### +############################################################################### + +name: PR tests (intel 19, ubuntu, mpich) + +trigger: + branches: + include: + - develop + - 1.0.0* + +pr: + branches: + include: + - '*' + + +resources: +- repo: self + +variables: + tag: '$(Build.BuildId)' + REPO: lifflander1/vt + ARCH: amd64 + UBUNTU: 18.04 + COMPILER_TYPE: intel + COMPILER: icc-19 + 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: 0 + VT_UNITY_BUILD: 1 + VT_ZOLTAN: 0 + VT_CI_BUILD: 1 + VT_DIAGNOSTICS: 1 + CACHE: "$(Agent.TempDirectory)/cache/" + cache_name: ubuntu-intel-19-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/scripts/workflows-azure.ini b/scripts/workflows-azure.ini index 4fbe57ed7b..8ae15a42ba 100644 --- a/scripts/workflows-azure.ini +++ b/scripts/workflows-azure.ini @@ -42,6 +42,16 @@ vt_trace = 1 vt_pool = 0 vt_extended_tests = 0 +[PR-tests-intel-19] +test_configuration = "intel 19, ubuntu, mpich" +compiler_type = intel +compiler = icc-19 +cache_name = ubuntu-intel-19-cache +output_name = ci/azure/azure-intel-19-ubuntu-mpich.yml +vt_trace = 1 +vt_pool = 0 +vt_extended_tests = 0 + [PR-tests-intel-18-03-extended] test_type = "PR tests extended" test_configuration = "intel 18.03, ubuntu, mpich" From 83ece582e4e0a0a98dced68dbd2ca5cd9daa0a46 Mon Sep 17 00:00:00 2001 From: Phil Miller Date: Fri, 4 Dec 2020 16:10:13 -0500 Subject: [PATCH 4/5] #728: Adjust syntax to avoid confusing nvcc --- src/vt/collective/reduce/reduce.h | 8 ++++---- src/vt/objgroup/proxy/proxy_objgroup.h | 4 ++-- src/vt/vrt/collection/reducable/reducable.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/vt/collective/reduce/reduce.h b/src/vt/collective/reduce/reduce.h index c06f90bf27..0d2d331570 100644 --- a/src/vt/collective/reduce/reduce.h +++ b/src/vt/collective/reduce/reduce.h @@ -199,7 +199,7 @@ struct Reduce : virtual collective::tree::Tree { return reduce< OpT, MsgT, - MsgT::template msgHandler< + &MsgT::template msgHandler< MsgT, OpT, collective::reduce::operators::ReduceCallback @@ -241,7 +241,7 @@ struct Reduce : virtual collective::tree::Tree { return reduceImmediate< OpT, MsgT, - MsgT::template msgHandler< + &MsgT::template msgHandler< MsgT, OpT, collective::reduce::operators::ReduceCallback @@ -285,7 +285,7 @@ struct Reduce : virtual collective::tree::Tree { OpT, FunctorT, MsgT, - MsgT::template msgHandler + &MsgT::template msgHandler >(root, msg, id, num_contrib); } @@ -325,7 +325,7 @@ struct Reduce : virtual collective::tree::Tree { OpT, FunctorT, MsgT, - MsgT::template msgHandler + &MsgT::template msgHandler >(root, msg, id, num_contrib); } diff --git a/src/vt/objgroup/proxy/proxy_objgroup.h b/src/vt/objgroup/proxy/proxy_objgroup.h index d481d0a569..a191b0870c 100644 --- a/src/vt/objgroup/proxy/proxy_objgroup.h +++ b/src/vt/objgroup/proxy/proxy_objgroup.h @@ -168,7 +168,7 @@ struct Proxy { OpT, MsgPtrT, MsgT, - MsgT::template msgHandler< + &MsgT::template msgHandler< MsgT, OpT, collective::reduce::operators::ReduceCallback > >(msg, cb, stamp); @@ -204,7 +204,7 @@ struct Proxy { FunctorT, MsgPtrT, MsgT, - MsgT::template msgHandler + &MsgT::template msgHandler >(msg, stamp); } diff --git a/src/vt/vrt/collection/reducable/reducable.h b/src/vt/vrt/collection/reducable/reducable.h index e9c4c1ea4b..acaadc23e7 100644 --- a/src/vt/vrt/collection/reducable/reducable.h +++ b/src/vt/vrt/collection/reducable/reducable.h @@ -87,7 +87,7 @@ struct Reducable : BaseProxyT { return reduce< OpT, MsgT, - MsgT::template msgHandler< + &MsgT::template msgHandler< MsgT, OpT, collective::reduce::operators::ReduceCallback > >(msg, cb, stamp); @@ -111,7 +111,7 @@ struct Reducable : BaseProxyT { OpT, FunctorT, MsgT, - MsgT::template msgHandler + &MsgT::template msgHandler >(msg, stamp); } From b290e7e9666dfeb317796596eebf190406a046a3 Mon Sep 17 00:00:00 2001 From: Phil Miller Date: Tue, 8 Dec 2020 12:15:14 -0700 Subject: [PATCH 5/5] #728: Work around *another* nvcc ICE --- tests/unit/active/test_active_send_large.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/active/test_active_send_large.cc b/tests/unit/active/test_active_send_large.cc index 37b6d6b2df..07498e8f0f 100644 --- a/tests/unit/active/test_active_send_large.cc +++ b/tests/unit/active/test_active_send_large.cc @@ -135,8 +135,9 @@ TYPED_TEST_P(TestActiveSendLarge, test_large_bytes_msg) { auto e = pipe::LifetimeEnum::Once; auto cb = theCB()->makeFunc(e, [&counter](RecvMsg*){ counter++; }); + NodeType next_node = (this_node + 1) % num_nodes; + vt::runInEpochCollective([&]{ - NodeType next_node = (this_node + 1) % num_nodes; auto msg = makeMessage(); fillMsg(msg); msg->cb_ = cb;