From 4641f385a38ae9d6599cd7c8bd81f58485b341b8 Mon Sep 17 00:00:00 2001 From: Paul Wolfenbarger Date: Tue, 15 Jun 2021 13:46:30 -0600 Subject: [PATCH 1/4] New proxy setting to match the change Friday --- cmake/std/PullRequestLinuxDriver-old.sh | 4 ++-- cmake/std/PullRequestLinuxDriver.sh | 4 ++-- cmake/std/common.bash | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/std/PullRequestLinuxDriver-old.sh b/cmake/std/PullRequestLinuxDriver-old.sh index faf78ef9caef..918ea282ba14 100755 --- a/cmake/std/PullRequestLinuxDriver-old.sh +++ b/cmake/std/PullRequestLinuxDriver-old.sh @@ -20,8 +20,8 @@ # and we get the correct behavior for PR testing. # -export https_proxy=http://wwwproxy.sandia.gov:80 -export http_proxy=http://wwwproxy.sandia.gov:80 +export https_proxy=http://proxy.sandia.gov:80 +export http_proxy=http://proxy.sandia.gov:80 no_proxy='localhost,localnets,.sandia.gov,127.0.0.1,169.254.0.0/16,forge.sandia.gov' whoami diff --git a/cmake/std/PullRequestLinuxDriver.sh b/cmake/std/PullRequestLinuxDriver.sh index ae8d160ea9e5..8633435bcca5 100755 --- a/cmake/std/PullRequestLinuxDriver.sh +++ b/cmake/std/PullRequestLinuxDriver.sh @@ -68,8 +68,8 @@ function bootstrap_modules() { print_banner "PullRequestLinuxDriver.sh" # Set up Sandia PROXY environment vars -export https_proxy=http://wwwproxy.sandia.gov:80 -export http_proxy=http://wwwproxy.sandia.gov:80 +export https_proxy=http://proxy.sandia.gov:80 +export http_proxy=http://proxy.sandia.gov:80 export no_proxy='localhost,localnets,127.0.0.1,169.254.0.0/16,forge.sandia.gov' diff --git a/cmake/std/common.bash b/cmake/std/common.bash index 103602b88569..f732fdc1ad18 100644 --- a/cmake/std/common.bash +++ b/cmake/std/common.bash @@ -182,7 +182,7 @@ function get_md5sum() { # # get_pip_args=( # --user -# --proxy="http://user:nopass@wwwproxy.sandia.gov:80" +# --proxy="http://user:nopass@proxy.sandia.gov:80" # --no-setuptools # --no-wheel # ) From c8b9af07cb42c914c600a62c73ef3f276adb5cf6 Mon Sep 17 00:00:00 2001 From: Paul Wolfenbarger Date: Wed, 16 Jun 2021 15:17:27 -0600 Subject: [PATCH 2/4] Add .sandia.gov bacj into the no_proxy variable --- cmake/std/PullRequestLinuxDriver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/std/PullRequestLinuxDriver.sh b/cmake/std/PullRequestLinuxDriver.sh index 8633435bcca5..ca06a3602326 100755 --- a/cmake/std/PullRequestLinuxDriver.sh +++ b/cmake/std/PullRequestLinuxDriver.sh @@ -70,7 +70,7 @@ print_banner "PullRequestLinuxDriver.sh" # Set up Sandia PROXY environment vars export https_proxy=http://proxy.sandia.gov:80 export http_proxy=http://proxy.sandia.gov:80 -export no_proxy='localhost,localnets,127.0.0.1,169.254.0.0/16,forge.sandia.gov' +export no_proxy='localhost,.sandia.gov,localnets,127.0.0.1,169.254.0.0/16,forge.sandia.gov' # bootstrap the python and git modules for this system From 575656efa8b6e069da98efadf5c28c2946f68402 Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Mon, 19 Jul 2021 17:57:46 +0200 Subject: [PATCH 3/4] Fix Zoltan's kokkosBlock example when not using UVM --- .../Zoltan2_BasicKokkosIdentifierAdapter.hpp | 57 ++++++++++++++----- .../zoltan2/example/block/kokkosBlock.cpp | 6 +- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/packages/zoltan2/core/src/input/Zoltan2_BasicKokkosIdentifierAdapter.hpp b/packages/zoltan2/core/src/input/Zoltan2_BasicKokkosIdentifierAdapter.hpp index 33a75e619f9e..5090714aa6b0 100644 --- a/packages/zoltan2/core/src/input/Zoltan2_BasicKokkosIdentifierAdapter.hpp +++ b/packages/zoltan2/core/src/input/Zoltan2_BasicKokkosIdentifierAdapter.hpp @@ -62,7 +62,7 @@ namespace Zoltan2 { * and their associated weights, if any. * * The user supplies the identifiers and weights by way of pointers - * to arrays. + * to arrays. * * The template parameter (\c User) is a C++ class type which provides the * actual data types with which the Zoltan2 library will be compiled, through @@ -112,27 +112,41 @@ template // The Adapter interface. //////////////////////////////////////////////////////////////// - size_t getLocalNumIDs() const { + size_t getLocalNumIDs() const override { return idsView_.extent(0); } + void getIDsView(const gno_t *&ids) const override { + auto kokkosIds = idsView_.view_host(); + ids = kokkosIds.data(); + } + void getIDsKokkosView(Kokkos::View &ids) const { - ids = idsView_; + typename node_t::device_type> &ids) const override { + ids = idsView_.template view(); } - int getNumWeightsPerID() const { + int getNumWeightsPerID() const override { return weightsView_.extent(1); } + void getWeightsView(const scalar_t *&wgt, int &stride, + int idx = 0) const override + { + auto h_wgts_2d = weightsView_.view_host(); + + wgt = Kokkos::subview(h_wgts_2d, Kokkos::ALL, idx).data(); + stride = 1; + } + void getWeightsKokkosView(Kokkos::View &wgts) const { - wgts = weightsView_; + typename node_t::device_type> &wgts) const override { + wgts = weightsView_.template view(); } private: - Kokkos::View idsView_; - Kokkos::View weightsView_; + Kokkos::DualView idsView_; + Kokkos::DualView weightsView_; }; //////////////////////////////////////////////////////////////// @@ -140,12 +154,25 @@ template //////////////////////////////////////////////////////////////// template - BasicKokkosIdentifierAdapter::BasicKokkosIdentifierAdapter( - Kokkos::View &ids, - Kokkos::View &weights): - idsView_(ids), weightsView_(weights) { +BasicKokkosIdentifierAdapter::BasicKokkosIdentifierAdapter( + Kokkos::View &ids, + Kokkos::View &weights) +{ + idsView_ = Kokkos::DualView("idsView_", ids.extent(0)); + Kokkos::deep_copy(idsView_.h_view, ids); + + weightsView_ = Kokkos::DualView("weightsView_", weights.extent(0), weights.extent(1)); + Kokkos::deep_copy(weightsView_.h_view, weights); + + weightsView_.modify_host(); + weightsView_.sync_host(); + weightsView_.template sync(); + + idsView_.modify_host(); + idsView_.sync_host(); + idsView_.template sync(); } - + } //namespace Zoltan2 - + #endif diff --git a/packages/zoltan2/example/block/kokkosBlock.cpp b/packages/zoltan2/example/block/kokkosBlock.cpp index 4e27a9eba5ec..9bf66d60f809 100644 --- a/packages/zoltan2/example/block/kokkosBlock.cpp +++ b/packages/zoltan2/example/block/kokkosBlock.cpp @@ -113,10 +113,14 @@ int main(int narg, char *arg[]) { const int nWeights = 1; Kokkos::View weights("weights", localCount, nWeights); + auto host_weights = Kokkos::create_mirror_view(weights); + for (int index = 0; index < localCount; index++) { - weights(index, 0) = 1; // Error check relies on uniform weights + host_weights(index, 0) = 1; // Error check relies on uniform weights } + Kokkos::deep_copy(weights, host_weights); + inputAdapter_t ia(globalIds, weights); ///////////////////////////////////////////////////////////////////////// From 710c296e44d0dd9e55be9c47ed0b7910d94cdd0e Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Mon, 19 Jul 2021 17:57:59 +0200 Subject: [PATCH 4/4] Fix Zoltan's mj_backwardcompat test when not using UVM --- .../test/core/partition/mj_backwardcompat.cpp | 97 ++++++++++++------- 1 file changed, 61 insertions(+), 36 deletions(-) diff --git a/packages/zoltan2/test/core/partition/mj_backwardcompat.cpp b/packages/zoltan2/test/core/partition/mj_backwardcompat.cpp index d289efe4a69e..663d80e4ab52 100644 --- a/packages/zoltan2/test/core/partition/mj_backwardcompat.cpp +++ b/packages/zoltan2/test/core/partition/mj_backwardcompat.cpp @@ -79,7 +79,7 @@ class OldSchoolVectorAdapterContig : public Zoltan2::VectorAdapter int getNumWeightsPerID() const { return (weights != NULL); } - void getWeightsView(const scalar_t *&wgt, int &stride, int idx = 0) const + void getWeightsView(const scalar_t *&wgt, int &stride, int idx = 0) const { wgt = weights; stride = 1; } int getNumEntriesPerID() const { return dim; } @@ -122,7 +122,7 @@ class OldSchoolVectorAdapterStrided : public Zoltan2::VectorAdapter int getNumWeightsPerID() const { return (weights != NULL); } - void getWeightsView(const scalar_t *&wgt, int &stride, int idx = 0) const + void getWeightsView(const scalar_t *&wgt, int &stride, int idx = 0) const { wgt = weights; stride = 1; } int getNumEntriesPerID() const { return dim; } @@ -163,77 +163,102 @@ class KokkosVectorAdapter : public Zoltan2::VectorAdapter { // create kokkos_gids in default memory space { - typedef Kokkos::View view_ids_t; - view_ids_t gids = view_ids_t( + typedef Kokkos::DualView view_ids_t; + kokkos_gids = view_ids_t( Kokkos::ViewAllocateWithoutInitializing("gids"), nids); - typename view_ids_t::HostMirror host_gids = - Kokkos::create_mirror_view(gids); + + auto host_gids = kokkos_gids.h_view; for(size_t n = 0; n < nids; ++n) { host_gids(n) = gids_[n]; } - Kokkos::deep_copy(gids, host_gids); - kokkos_gids = gids; // to const View + + kokkos_gids.template modify(); + kokkos_gids.sync_host(); + kokkos_gids.template sync(); } // create kokkos_weights in default memory space if(weights_ != NULL) { - typedef Kokkos::View view_weights_t; + typedef Kokkos::DualView view_weights_t; kokkos_weights = view_weights_t( Kokkos::ViewAllocateWithoutInitializing("weights"), nids, 0); - typename view_weights_t::HostMirror host_kokkos_weights = - Kokkos::create_mirror_view(kokkos_weights); + auto host_kokkos_weights = kokkos_weights.h_view; for(size_t n = 0; n < nids; ++n) { host_kokkos_weights(n,0) = weights_[n]; } - Kokkos::deep_copy(kokkos_weights, host_kokkos_weights); + + kokkos_weights.template modify(); + kokkos_weights.sync_host(); + kokkos_weights.template sync(); } // create kokkos_coords in default memory space { - typedef Kokkos::View kokkos_coords_t; + typedef Kokkos::DualView kokkos_coords_t; kokkos_coords = kokkos_coords_t( Kokkos::ViewAllocateWithoutInitializing("coords"), nids, dim); - typename kokkos_coords_t::HostMirror host_kokkos_coords = - Kokkos::create_mirror_view(kokkos_coords); + auto host_kokkos_coords = kokkos_coords.h_view; + for(size_t n = 0; n < nids; ++n) { for(int idx = 0; idx < dim; ++idx) { host_kokkos_coords(n,idx) = coords_[n+idx*nids]; } } - Kokkos::deep_copy(kokkos_coords, host_kokkos_coords); + + kokkos_coords.template modify(); + kokkos_coords.sync_host(); + kokkos_coords.template sync(); } } size_t getLocalNumIDs() const { return nids; } + void getIDsView(const gno_t *&ids) const override { + auto kokkosIds = kokkos_gids.view_host(); + ids = kokkosIds.data(); + } + virtual void getIDsKokkosView(Kokkos::View &ids) const { - ids = kokkos_gids; + ids = kokkos_gids.template view();; } - int getNumWeightsPerID() const { return (kokkos_weights.size() != 0); } + int getNumWeightsPerID() const { return (kokkos_weights.h_view.size() != 0); } + + void getWeightsView(const scalar_t *&wgt, int &stride, + int idx = 0) const override + { + auto h_wgts_2d = kokkos_weights.view_host(); + + wgt = Kokkos::subview(h_wgts_2d, Kokkos::ALL, idx).data(); + stride = 1; + } virtual void getWeightsKokkosView(Kokkos::View & wgt) const { - wgt = kokkos_weights; + wgt = kokkos_weights.template view();; } int getNumEntriesPerID() const { return dim; } + void getEntriesView(const scalar_t *&elements, + int &stride, int idx = 0) const override { + elements = kokkos_coords.view_host().data(); + stride = 1; + } + virtual void getEntriesKokkosView(Kokkos::View & coo) const { - coo = kokkos_coords; + coo = kokkos_coords.template view(); } private: const size_t nids; - Kokkos::View kokkos_gids; + Kokkos::DualView kokkos_gids; const int dim; - Kokkos::View - kokkos_coords; - Kokkos::View kokkos_weights; + Kokkos::DualView kokkos_coords; + Kokkos::DualView kokkos_weights; }; ////////////////////////////////////////////// @@ -281,7 +306,7 @@ int run_test_strided_versus_contig(const std::string & algorithm) { globalId_t *globalIds = new globalId_t [localCount]; globalId_t offset = rank * localCount; for (size_t i=0; i < localCount; i++) globalIds[i] = offset++; - + /////////////////////////////////////////////////////////////////////// // Create parameters for an MJ problem @@ -296,12 +321,12 @@ int run_test_strided_versus_contig(const std::string & algorithm) { // Test one: No weights // Partition using strided coords - stridedAdapter_t *ia1 = + stridedAdapter_t *ia1 = new stridedAdapter_t(localCount,globalIds,dim,cStrided); Zoltan2::PartitioningProblem *problem1 = new Zoltan2::PartitioningProblem(ia1, ¶ms); - + problem1->solve(); quality_t *metricObject1 = new quality_t(ia1, ¶ms, comm, @@ -325,7 +350,7 @@ int run_test_strided_versus_contig(const std::string & algorithm) { Zoltan2::PartitioningProblem *problem2 = new Zoltan2::PartitioningProblem(ia2, ¶ms); - + problem2->solve(); // Partition using contiguous coords to generate kokkos adapter @@ -344,7 +369,7 @@ int run_test_strided_versus_contig(const std::string & algorithm) { (problem2->getSolution().getPartListView()[i] != problem3->getSolution().getPartListView()[i])) { - std::cout << rank << " Error: differing parts for index " << i + std::cout << rank << " Error: differing parts for index " << i << problem1->getSolution().getPartListView()[i] << " " << problem2->getSolution().getPartListView()[i] << " " << problem3->getSolution().getPartListView()[i] << std::endl; @@ -362,11 +387,11 @@ int run_test_strided_versus_contig(const std::string & algorithm) { delete ia1; delete ia2; delete ia3; - + /////////////////////////////////////////////////////////////////////// // Test two: weighted // Create a Zoltan2 input adapter that includes weights. - + scalar_t *weights = new scalar_t [localCount]; for (size_t i=0; i < localCount; i++) weights[i] = 1 + scalar_t(rank); @@ -397,18 +422,18 @@ int run_test_strided_versus_contig(const std::string & algorithm) { ia2 = new contigAdapter_t(localCount, globalIds, dim, cContig, weights); problem2 = new Zoltan2::PartitioningProblem(ia2, ¶ms); - + problem2->solve(); // compare strided vs contiguous ndiff = 0; for (size_t i = 0; i < localCount; i++) { - if (problem1->getSolution().getPartListView()[i] != + if (problem1->getSolution().getPartListView()[i] != problem2->getSolution().getPartListView()[i]) { - std::cout << rank << " Error: differing parts for index " << i + std::cout << rank << " Error: differing parts for index " << i << problem1->getSolution().getPartListView()[i] << " " << problem2->getSolution().getPartListView()[i] << std::endl; - + ndiff++; } }