diff --git a/hashes.txt b/hashes.txt index 05963ab4..1b5b9cd5 100644 --- a/hashes.txt +++ b/hashes.txt @@ -1,2 +1,2 @@ blt branch='develop' commit='938345715810c6457d3e57a2c20d4ee0fa253632' -vtkm branch='master' commit='124fb23c50c14b171ae91b27abca77c435968fa5' +vtkm branch='master' commit='01b370296f1f684ed7217dab2e152a8ca9ee6295' diff --git a/package.py b/package.py index be450c25..c7b199c8 100755 --- a/package.py +++ b/package.py @@ -1,46 +1,46 @@ #!/bin/env python ############################################################################### # Copyright (c) 2014-2017, Lawrence Livermore National Security, LLC. -# +# # Produced at the Lawrence Livermore National Laboratory -# +# # LLNL-CODE-666778 -# +# # All rights reserved. -# -# This file is part of Conduit. -# +# +# This file is part of Conduit. +# # For details, see: http://software.llnl.gov/conduit/. -# +# # Please also read conduit/LICENSE -# -# Redistribution and use in source and binary forms, with or without +# +# 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, +# +# * Redistributions of source code must retain the above copyright notice, # this list of conditions and the disclaimer below. -# +# # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the disclaimer (as noted below) in the # documentation and/or other materials provided with the distribution. -# +# # * Neither the name of the LLNS/LLNL 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 LAWRENCE LIVERMORE NATIONAL SECURITY, # LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# 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, +# 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 +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -# +# ############################################################################### @@ -65,7 +65,7 @@ def create_package(output_file,version): suffix = "tar" t = datetime.datetime.now() output_file = "%s.%04d.%02d.%02d.%s" % (repo_name,t.year,t.month,t.day,suffix) - cmd = "python " + pkg_script + " --prefix=vtkh" + cmd = "python " + pkg_script + " --prefix=vtkh" if not version is None: cmd += "-" + version cmd += " " + output_file diff --git a/scripts/uberenv/packages/vtk-m/package.py b/scripts/uberenv/packages/vtk-m/package.py index f262c2a0..45bf7522 100644 --- a/scripts/uberenv/packages/vtk-m/package.py +++ b/scripts/uberenv/packages/vtk-m/package.py @@ -22,6 +22,7 @@ class VtkM(CMakePackage, CudaPackage): git = "https://gitlab.kitware.com/vtk/vtk-m.git" version('master', branch='master') + version('1.5.2', commit="01b370296f1f684ed7217dab2e152a8ca9ee6295") version('1.5.1', commit="124fb23c50c14b171ae91b27abca77c435968fa5") version('1.5.0', sha256="b1b13715c7fcc8d17f5c7166ff5b3e9025f6865dc33eb9b06a63471c21349aa8") version('1.4.0', sha256="8d83cca7cd5e204d10da151ce4f1846c1f7414c7c1e579173d15c5ea0631555a") diff --git a/scripts/uberenv/packages/vtkh/package.py b/scripts/uberenv/packages/vtkh/package.py index 810cc406..bbae56c1 100644 --- a/scripts/uberenv/packages/vtkh/package.py +++ b/scripts/uberenv/packages/vtkh/package.py @@ -59,17 +59,17 @@ class Vtkh(Package, CudaPackage): depends_on("mpi", when="+mpi") depends_on("cuda", when="+cuda") - depends_on("vtk-m@1.5.1~tbb+openmp", when="+openmp") - depends_on("vtk-m@1.5.1~tbb~openmp", when="~openmp") + depends_on("vtk-m@1.5.2~tbb+openmp", when="+openmp") + depends_on("vtk-m@1.5.2~tbb~openmp", when="~openmp") - depends_on("vtk-m@1.5.1+cuda~tbb+openmp", when="+cuda+openmp") - depends_on("vtk-m@1.5.1+cuda~tbb~openmp", when="+cuda~openmp") + depends_on("vtk-m@1.5.2+cuda~tbb+openmp", when="+cuda+openmp") + depends_on("vtk-m@1.5.2+cuda~tbb~openmp", when="+cuda~openmp") - depends_on("vtk-m@1.5.1~tbb+openmp~shared", when="+openmp~shared") - depends_on("vtk-m@1.5.1~tbb~openmp~shared", when="~openmp~shared") + depends_on("vtk-m@1.5.2~tbb+openmp~shared", when="+openmp~shared") + depends_on("vtk-m@1.5.2~tbb~openmp~shared", when="~openmp~shared") - depends_on("vtk-m@1.5.1+cuda~tbb+openmp~shared", when="+cuda+openmp~shared") - depends_on("vtk-m@1.5.1+cuda~tbb~openmp~shared", when="+cuda~openmp~shared") + depends_on("vtk-m@1.5.2+cuda~tbb+openmp~shared", when="+cuda+openmp~shared") + depends_on("vtk-m@1.5.2+cuda~tbb~openmp~shared", when="+cuda~openmp~shared") def install(self, spec, prefix): with working_dir('spack-build', create=True): diff --git a/src/tests/vtkh/CMakeLists.txt b/src/tests/vtkh/CMakeLists.txt index 60fcbde8..f3d323b7 100644 --- a/src/tests/vtkh/CMakeLists.txt +++ b/src/tests/vtkh/CMakeLists.txt @@ -65,7 +65,7 @@ set(BASIC_TESTS t_vtk-h_smoke t_vtk-h_dataset t_vtk-h_clip t_vtk-h_clip_field - ${t_vtk-h_contour_tree_} + #${t_vtk-h_contour_tree_} t_vtk-h_device_control t_vtk-h_empty_data t_vtk-h_gradient @@ -89,7 +89,7 @@ set(BASIC_TESTS t_vtk-h_smoke set(CUDA_TESTS t_vtk-h_cuda) set(MPI_TESTS t_vtk-h_smoke_par - ${t_vtk-h_contour_tree_par_} + #${t_vtk-h_contour_tree_par_} t_vtk-h_dataset_par t_vtk-h_no_op_par t_vtk-h_histogram_par diff --git a/src/tests/vtkh/t_test_utils.hpp b/src/tests/vtkh/t_test_utils.hpp index 0c3ff139..a0edb0b6 100644 --- a/src/tests/vtkh/t_test_utils.hpp +++ b/src/tests/vtkh/t_test_utils.hpp @@ -111,7 +111,7 @@ vtkm::cont::Field CreateCellScalarField(int size, const char* fieldName) for(int i = 0; i < size; ++i) { FieldType val = i / vtkm::Float32(size); - data.GetPortalControl().Set(i, val); + data.WritePortal().Set(i, val); } @@ -136,7 +136,7 @@ vtkm::cont::Field CreateGhostScalarField(vtkm::Id3 dims) if(y < 1 || y > dims[1] - 2) flag = 1; if(z < 1 || z > dims[2] - 2) flag = 1; vtkm::Id index = z * dims[0] * dims[1] + y * dims[0] + x; - data.GetPortalControl().Set(index, flag); + data.WritePortal().Set(index, flag); } vtkm::cont::Field field("ghosts", @@ -149,16 +149,16 @@ template vtkm::cont::Field CreatePointScalarField(UniformCoords coords, const char* fieldName) { - const int size = coords.GetPortalConstControl().GetNumberOfValues(); + const int size = coords.GetNumberOfValues(); vtkm::cont::ArrayHandle data; data.Allocate(size); - auto portal = coords.GetPortalConstControl(); + auto portal = coords.ReadPortal(); for(int i = 0; i < size; ++i) { vtkm::Vec point = portal.Get(i); FieldType val = vtkm::Magnitude(point) + 1.f; - data.GetPortalControl().Set(i, val); + data.WritePortal().Set(i, val); } vtkm::cont::Field field(fieldName, @@ -179,7 +179,7 @@ vtkm::cont::Field CreatePointVecField(int size, const char* fieldName) vtkm::Vec vec(val, -val, val); - data.GetPortalControl().Set(i, vec); + data.WritePortal().Set(i, vec); } vtkm::cont::Field field(fieldName, diff --git a/src/tests/vtkh/t_vtk-h_dataset.cpp b/src/tests/vtkh/t_vtk-h_dataset.cpp index 4f2c27f9..df156864 100644 --- a/src/tests/vtkh/t_vtk-h_dataset.cpp +++ b/src/tests/vtkh/t_vtk-h_dataset.cpp @@ -43,12 +43,12 @@ TEST(vtkh_dataset, vtkh_range) vtkm::cont::ArrayHandle vec_range; vec_range = data_set.GetGlobalRange("vector_data_Float64"); - EXPECT_EQ(3, vec_range.GetPortalControl().GetNumberOfValues()); + EXPECT_EQ(3, vec_range.GetNumberOfValues()); vtkm::cont::ArrayHandle scalar_range; scalar_range = data_set.GetGlobalRange("point_data_Float64"); - EXPECT_EQ(1, scalar_range.GetPortalControl().GetNumberOfValues()); + EXPECT_EQ(1, scalar_range.GetNumberOfValues()); vtkm::Float64 min_coord = 0.; vtkm::Float64 max_coord = vtkm::Float64(base_size * num_blocks); diff --git a/src/tests/vtkh/t_vtk-h_lagrangian.cpp b/src/tests/vtkh/t_vtk-h_lagrangian.cpp index 8ee124e7..c29d0e9e 100644 --- a/src/tests/vtkh/t_vtk-h_lagrangian.cpp +++ b/src/tests/vtkh/t_vtk-h_lagrangian.cpp @@ -36,7 +36,7 @@ vtkm::cont::DataSet MakeTestUniformDataSet(vtkm::Id time) vtkm::Float64 ydiff = (ymax - ymin) / (static_cast(DIMS[1] - 1)); vtkm::Float64 zdiff = (zmax - zmin) / (static_cast(DIMS[2] - 1)); - vtkm::Vec ORIGIN(0, 0, 0); + vtkm::Vec ORIGIN(0, 0, 0); vtkm::Vec SPACING(xdiff, ydiff, zdiff); vtkm::cont::DataSet dataset = dsb.Create(DIMS, ORIGIN, SPACING); @@ -51,13 +51,13 @@ vtkm::cont::DataSet MakeTestUniformDataSet(vtkm::Id time) for (vtkm::Id i = 0; i < DIMS[0]; i++) { for (vtkm::Id j = 0; j < DIMS[1]; j++) - { + { for (vtkm::Id k = 0; k < DIMS[2]; k++) - { - velocityField.GetPortalControl().Set(count, vtkm::Vec(0.01*time, 0.01*time, 0.01*time)); + { + velocityField.WritePortal().Set(count, vtkm::Vec(0.01*time, 0.01*time, 0.01*time)); count++; - } - } + } + } } dsf.AddPointField(dataset, "velocity", velocityField); return dataset; @@ -72,12 +72,12 @@ void render_output(vtkh::DataSet *data, std::string file_name) vtkm::rendering::Camera camera; camera.ResetToBounds(bounds); float bg_color[4] = { 0.f, 0.f, 0.f, 1.f}; - vtkh::Render render = vtkh::MakeRender(512, - 512, - camera, - *data, + vtkh::Render render = vtkh::MakeRender(512, + 512, + camera, + *data, file_name, - bg_color); + bg_color); vtkh::Scene scene; scene.AddRender(render); @@ -85,9 +85,9 @@ void render_output(vtkh::DataSet *data, std::string file_name) vtkh::LineRenderer tracer; tracer.SetRadius(.1f); tracer.SetInput(data); - tracer.SetField("lines"); + tracer.SetField("lines"); - scene.AddRenderer(&tracer); + scene.AddRenderer(&tracer); scene.Render(); } @@ -102,9 +102,9 @@ TEST(vtkh_lagrangian, vtkh_serial_lagrangian) lagrangian.SetSeedResolutionInX(1); lagrangian.SetSeedResolutionInY(1); lagrangian.SetSeedResolutionInZ(1); - - std::cout << "Running Lagrangian filter test - vtkh" << std::endl; - + + std::cout << "Running Lagrangian filter test - vtkh" << std::endl; + for(vtkm::Id time = 1; time <= 10; ++time) { vtkh::DataSet data_set; diff --git a/src/vtkh/DataSet.cpp b/src/vtkh/DataSet.cpp index 63dc7106..83570fdc 100644 --- a/src/vtkh/DataSet.cpp +++ b/src/vtkh/DataSet.cpp @@ -335,7 +335,7 @@ DataSet::GetRange(const std::string &field_name) const vtkm::cont::ArrayHandle sub_range; sub_range = field.GetRange(); - vtkm::Id components = sub_range.GetPortalConstControl().GetNumberOfValues(); + vtkm::Id components = sub_range.ReadPortal().GetNumberOfValues(); // first range with data. Set range and keep looking if(num_components == 0) @@ -358,10 +358,10 @@ DataSet::GetRange(const std::string &field_name) const for(vtkm::Id c = 0; c < components; ++c) { - vtkm::Range s_range = sub_range.GetPortalControl().Get(c); - vtkm::Range c_range = range.GetPortalControl().Get(c); + vtkm::Range s_range = sub_range.ReadPortal().Get(c); + vtkm::Range c_range = range.ReadPortal().Get(c); c_range.Include(s_range); - range.GetPortalControl().Set(c, c_range); + range.WritePortal().Set(c, c_range); } } return range; @@ -424,7 +424,7 @@ DataSet::GetGlobalRange(const std::string &field_name) const for(int i = 0; i < components; ++i) { - vtkm::Range c_range = range.GetPortalControl().Get(i); + vtkm::Range c_range = range.ReadPortal().Get(i); vtkm::Float64 local_min; vtkm::Float64 local_max; @@ -458,7 +458,7 @@ DataSet::GetGlobalRange(const std::string &field_name) const mpi_comm); c_range.Min = global_min; c_range.Max = global_max; - range.GetPortalControl().Set(i, c_range); + range.WritePortal().Set(i, c_range); } } diff --git a/src/vtkh/filters/ContourTree.cpp b/src/vtkh/filters/ContourTree.cpp index 8910bbd0..72b02e03 100644 --- a/src/vtkh/filters/ContourTree.cpp +++ b/src/vtkh/filters/ContourTree.cpp @@ -253,8 +253,8 @@ void ContourTree::DoExecute() bool computeRegularStructure = true; //Convert the mesh of values into contour tree, pairs of vertex ids - vtkm::filter::ContourTreePPP2 filter(useMarchingCubes, - computeRegularStructure); + vtkm::filter::ContourTreeAugmented filter(useMarchingCubes, + computeRegularStructure); std::vector iso_values; @@ -319,8 +319,8 @@ void ContourTree::DoExecute() #endif // VTKM_ENABLE_MPI BranchType* branchDecompostionRoot = caugmented_ns::ProcessContourTree::ComputeBranchDecomposition( - filter.GetContourTree().superparents, - filter.GetContourTree().supernodes, + filter.GetContourTree().Superparents, + filter.GetContourTree().Supernodes, whichBranch, branchMinimum, branchMaximum, @@ -332,7 +332,7 @@ void ContourTree::DoExecute() ); // Simplify the contour tree of the branch decompostion - branchDecompostionRoot->simplifyToSize(numComp, usePersistenceSorter); + branchDecompostionRoot->SimplifyToSize(numComp, usePersistenceSorter); // Compute the relevant iso-values switch(contourSelectMethod) @@ -340,13 +340,13 @@ void ContourTree::DoExecute() default: case 0: { - branchDecompostionRoot->getRelevantValues(contourType, eps, iso_values); + branchDecompostionRoot->GetRelevantValues(contourType, eps, iso_values); } break; case 1: { PLFType plf; - branchDecompostionRoot->accumulateIntervals(contourType, eps, plf); + branchDecompostionRoot->AccumulateIntervals(contourType, eps, plf); iso_values = plf.nLargest(m_levels); } break; diff --git a/src/vtkh/filters/HistSampling.cpp b/src/vtkh/filters/HistSampling.cpp index 2216086c..160df210 100644 --- a/src/vtkh/filters/HistSampling.cpp +++ b/src/vtkh/filters/HistSampling.cpp @@ -73,7 +73,7 @@ calculate_pdf(const vtkm::Int32 tot_points, vtkm::cont::Algorithm::Sort(zipArray); - auto binPortal = zipArray.GetPortalConstControl(); + auto binPortal = zipArray.ReadPortal(); vtkm::Float32 remainingSamples = sample_percent*tot_points; @@ -101,7 +101,7 @@ calculate_pdf(const vtkm::Int32 tot_points, vtkm::cont::ArrayHandle acceptanceProbsVec; acceptanceProbsVec.Allocate(num_bins); - auto acceptance_portal = acceptanceProbsVec.GetPortalControl(); + auto acceptance_portal = acceptanceProbsVec.WritePortal(); for(int i = 0; i < num_bins; ++i) { acceptance_portal.Set(i, -1.f); diff --git a/src/vtkh/filters/Histogram.cpp b/src/vtkh/filters/Histogram.cpp index 9de3e7b5..c63988f5 100644 --- a/src/vtkh/filters/Histogram.cpp +++ b/src/vtkh/filters/Histogram.cpp @@ -46,11 +46,11 @@ merge_histograms(std::vector &histograms) Histogram::HistogramResult res; res = histograms[0]; - auto bins1 = res.m_bins.GetPortalControl(); + auto bins1 = res.m_bins.WritePortal(); const int num_bins = res.m_bins.GetNumberOfValues(); for(int i = 1; i < size; ++i) { - auto bins2 = histograms[i].m_bins.GetPortalControl(); + auto bins2 = histograms[i].m_bins.WritePortal(); for(int n = 0; n < num_bins; ++n) { bins1.Set(n, bins1.Get(n) + bins2.Get(n)); @@ -140,7 +140,7 @@ Histogram::Run(vtkh::DataSet &data_set, const std::string &field_name) { throw Error("Histogram: field must have a single component"); } - range = ranges.GetPortalControl().Get(0); + range = ranges.ReadPortal().Get(0); } const int num_domains = data_set.GetNumberOfDomains(); @@ -177,7 +177,7 @@ Histogram::Run(vtkh::DataSet &data_set, const std::string &field_name) void Histogram::HistogramResult::Print(std::ostream &out) { - auto binPortal = m_bins.GetPortalConstControl(); + auto binPortal = m_bins.ReadPortal(); const int num_bins = m_bins.GetNumberOfValues(); vtkm::Id sum = 0; for (vtkm::Id i = 0; i < num_bins; i++) diff --git a/src/vtkh/filters/Integrator.hpp b/src/vtkh/filters/Integrator.hpp index 9eacbd64..dc28db20 100644 --- a/src/vtkh/filters/Integrator.hpp +++ b/src/vtkh/filters/Integrator.hpp @@ -62,7 +62,7 @@ class VTKH_API Integrator vtkm::worklet::ParticleAdvectionResult result; result = particleAdvection.Run(rk4, seedArray, maxSteps); - auto parPortal = result.Particles.GetPortalConstControl(); + auto parPortal = result.Particles.ReadPortal(); //Update particle data. //Need a functor to do this... @@ -110,7 +110,7 @@ class VTKH_API Integrator vtkm::worklet::Streamline streamline; vtkm::worklet::StreamlineResult result; result = streamline.Run(rk4, seedArray, maxSteps); - auto parPortal = result.Particles.GetPortalConstControl(); + auto parPortal = result.Particles.ReadPortal(); //Update particle data. int steps1 = 0; @@ -174,7 +174,7 @@ class VTKH_API Integrator int stepsTaken = 0; size_t nSeeds = particles.size(); seedArray.Allocate(nSeeds); - auto seedPortal = seedArray.GetPortalControl(); + auto seedPortal = seedArray.WritePortal(); for (int i = 0; i < nSeeds; i++) { seedPortal.Set(i, particles[i].p); diff --git a/src/vtkh/filters/Log.cpp b/src/vtkh/filters/Log.cpp index cae49fe4..83b8fe16 100644 --- a/src/vtkh/filters/Log.cpp +++ b/src/vtkh/filters/Log.cpp @@ -109,7 +109,7 @@ void Log::PostExecute() void Log::DoExecute() { - vtkm::Range scalar_range = m_input->GetGlobalRange(m_field_name).GetPortalControl().Get(0); + vtkm::Range scalar_range = m_input->GetGlobalRange(m_field_name).ReadPortal().Get(0); if(scalar_range.Min <= 0.f && !m_clamp_to_min) { std::stringstream msg; diff --git a/src/vtkh/filters/MarchingCubes.cpp b/src/vtkh/filters/MarchingCubes.cpp index 6af37e4a..70b31368 100644 --- a/src/vtkh/filters/MarchingCubes.cpp +++ b/src/vtkh/filters/MarchingCubes.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -68,17 +69,18 @@ void MarchingCubes::PreExecute() { if(m_use_contour_tree) { - // run contour tree every time - vtkh::ContourTree contour_tree; - contour_tree.SetInput(this->m_input); - contour_tree.SetField(m_field_name); - contour_tree.SetNumLevels(m_levels); - contour_tree.Update(); - m_iso_values = contour_tree.GetIsoValues(); + throw Error("Contour tree disabled"); + //// run contour tree every time + //vtkh::ContourTree contour_tree; + //contour_tree.SetInput(this->m_input); + //contour_tree.SetField(m_field_name); + //contour_tree.SetNumLevels(m_levels); + //contour_tree.Update(); + //m_iso_values = contour_tree.GetIsoValues(); } else { - vtkm::Range scalar_range = m_input->GetGlobalRange(m_field_name).GetPortalControl().Get(0); + vtkm::Range scalar_range = m_input->GetGlobalRange(m_field_name).ReadPortal().Get(0); float length = scalar_range.Length(); float step = length / (m_levels + 1.f); diff --git a/src/vtkh/filters/ParticleAdvection.cpp b/src/vtkh/filters/ParticleAdvection.cpp index 57b61e99..11ad35c8 100644 --- a/src/vtkh/filters/ParticleAdvection.cpp +++ b/src/vtkh/filters/ParticleAdvection.cpp @@ -264,13 +264,13 @@ void ParticleAdvection::DoExecute() vtkm::cont::ArrayHandle ids; positions.Allocate(totalNumPts); ids.Allocate(totalNumPts); - auto posPortal = positions.GetPortalControl(); - auto idPortal = ids.GetPortalControl(); + auto posPortal = positions.ReadPortal(); + auto idPortal = ids.ReadPortal(); vtkm::Id idx = 0; for (int i = 0; i < particleTraces.size(); i++) { - auto inP = particleTraces[i].Particles.GetPortalConstControl(); + auto inP = particleTraces[i].Particles.ReadPortal(); vtkm::Id numPts = particleTraces[i].Particles.GetNumberOfValues(); for (int j = 0; j < numPts; j++, idx++) { @@ -300,14 +300,14 @@ void ParticleAdvection::DoExecute() vtkm::cont::ArrayHandle ids; positions.Allocate(totalNumPts); ids.Allocate(totalNumPts); - auto posPortal = positions.GetPortalControl(); - auto idPortal = ids.GetPortalControl(); + auto posPortal = positions.ReadPortal(); + auto idPortal = ids.ReadPortal(); vtkm::Id idx = 0; for (int i = 0; i < particleTraces.size(); i++) { - auto parPortal = particleTraces[i].Particles.GetPortalConstControl(); - auto inP = particleTraces[i].Positions.GetPortalConstControl(); + auto parPortal = particleTraces[i].Particles.ReadPortal(); + auto inP = particleTraces[i].Positions.ReadPortal(); vtkm::Id numPts = particleTraces[i].Positions.GetNumberOfValues(); vtkm::Id pid = 0; //parPortal.Get(i).ID; for (int j = 0; j < numPts; j++, idx++) @@ -341,7 +341,7 @@ void ParticleAdvection::DoExecute() //Append all the positions into one array. vtkm::cont::ArrayHandle> positions; positions.Allocate(totalNumPts); - auto posPortal = positions.GetPortalControl(); + auto posPortal = positions.ReadPortal(); vtkm::Id idx = 0; for (int i = 0; i < particleTraces.size(); i++) { @@ -361,8 +361,8 @@ void ParticleAdvection::DoExecute() vtkm::cont::ArrayHandle cellCounts; connectivity.Allocate(totalNumPts); cellCounts.Allocate(totalNumCells); - auto connPortal = connectivity.GetPortalControl(); - auto cntPortal = cellCounts.GetPortalControl(); + auto connPortal = connectivity.ReadPortal(); + auto cntPortal = cellCounts.ReadPortal(); vtkm::Id offset = 0, connIdx = 0, cntIdx = 0; for (int i = 0; i < particleTraces.size(); i++) @@ -377,7 +377,7 @@ void ParticleAdvection::DoExecute() { particleTraces[i].PolyLines.GetIndices(j, ids); vtkm::Id nids = ids.GetNumberOfValues(); - auto idsPortal = ids.GetPortalControl(); + auto idsPortal = ids.ReadPortal(); for (vtkm::Id k = 0; k < nids; k++, connIdx++) connPortal.Set(connIdx, idsPortal.Get(k)+offset); cntPortal.Set(cntIdx, nids); @@ -468,7 +468,7 @@ ParticleAdvection::DumpSLOutput(vtkm::cont::DataSet *ds, int domId, int ts) if (ds) { int nPts = ds->GetCoordinateSystem(0).GetNumberOfPoints(); - auto portal = ds->GetCoordinateSystem(0).GetData().GetPortalConstControl(); + auto portal = ds->GetCoordinateSystem(0).GetData().ReadPortal(); for (int i = 0; i < nPts; i++) { vtkm::Vec pt; @@ -698,7 +698,7 @@ ParticleAdvection::DumpTraces(const vtkm::cont::ArrayHandle &pts, output.open(nm, std::ofstream::out); output<<"X,Y,Z,ID"< &a) const { vtkm::Id s = a.GetNumberOfValues(); - auto p = a.GetPortalConstControl(); + auto p = a.ReadPortal(); for(int i = 0; i < s; ++i) { std::cout< ranges = m_input->GetGlobalRange(m_field_name); - int num_components = ranges.GetPortalControl().GetNumberOfValues(); + int num_components = ranges.GetNumberOfValues(); // // current vtkm renderers only supports single component scalar fields // @@ -150,7 +150,7 @@ Renderer::PreExecute() throw Error(msg.str()); } - vtkm::Range global_range = ranges.GetPortalControl().Get(0); + vtkm::Range global_range = ranges.ReadPortal().Get(0); // a min or max may be been set by the user, check to see if(m_range.Min == vtkm::Infinity64()) { diff --git a/src/vtkh/utils/vtkm_array_utils.hpp b/src/vtkh/utils/vtkm_array_utils.hpp index b37cbbb3..8ed3b37b 100644 --- a/src/vtkh/utils/vtkm_array_utils.hpp +++ b/src/vtkh/utils/vtkm_array_utils.hpp @@ -14,7 +14,7 @@ GetVTKMPointer(vtkm::cont::ArrayHandle &handle) typedef typename vtkm::cont::ArrayHandle HandleType; typedef typename HandleType::template ExecutionTypes::Portal PortalType; typedef typename vtkm::cont::ArrayPortalToIterators::IteratorType IteratorType; - IteratorType iter = vtkm::cont::ArrayPortalToIterators(handle.GetPortalControl()).GetBegin(); + IteratorType iter = vtkm::cont::ArrayPortalToIterators(handle.WritePortal()).GetBegin(); return &(*iter); }