Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
Another update (#155)
Browse files Browse the repository at this point in the history
* new portal interface

* missed some portals

* disable lagrangian

* update vtk-m version in spack

* update vtkm hash in hash.txt

* missed a couple write portals

* disable contour tree testing due to vtkm deadlock

* update vtkm hash for lagrange fix

* print summary now causes deadlock

* disable lagrange again

* vtkm deadlock fixes

* prevent contour tree from deadlocking
  • Loading branch information
mclarsen authored Mar 10, 2020
1 parent 828a63f commit bef5bbe
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 102 deletions.
2 changes: 1 addition & 1 deletion hashes.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
blt branch='develop' commit='938345715810c6457d3e57a2c20d4ee0fa253632'
vtkm branch='master' commit='124fb23c50c14b171ae91b27abca77c435968fa5'
vtkm branch='master' commit='01b370296f1f684ed7217dab2e152a8ca9ee6295'
38 changes: 19 additions & 19 deletions package.py
Original file line number Diff line number Diff line change
@@ -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.
#
#
###############################################################################


Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions scripts/uberenv/packages/vtk-m/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
16 changes: 8 additions & 8 deletions scripts/uberenv/packages/vtkh/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions src/tests/vtkh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/tests/vtkh/t_test_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand All @@ -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",
Expand All @@ -149,16 +149,16 @@ template <typename FieldType>
vtkm::cont::Field CreatePointScalarField(UniformCoords coords, const char* fieldName)

{
const int size = coords.GetPortalConstControl().GetNumberOfValues();
const int size = coords.GetNumberOfValues();
vtkm::cont::ArrayHandle<FieldType> data;
data.Allocate(size);
auto portal = coords.GetPortalConstControl();
auto portal = coords.ReadPortal();
for(int i = 0; i < size; ++i)
{
vtkm::Vec<FieldType,3> 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,
Expand All @@ -179,7 +179,7 @@ vtkm::cont::Field CreatePointVecField(int size, const char* fieldName)

vtkm::Vec<FieldType, 3> vec(val, -val, val);

data.GetPortalControl().Set(i, vec);
data.WritePortal().Set(i, vec);
}

vtkm::cont::Field field(fieldName,
Expand Down
4 changes: 2 additions & 2 deletions src/tests/vtkh/t_vtk-h_dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ TEST(vtkh_dataset, vtkh_range)
vtkm::cont::ArrayHandle<vtkm::Range> 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<vtkm::Range> 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);
Expand Down
32 changes: 16 additions & 16 deletions src/tests/vtkh/t_vtk-h_lagrangian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ vtkm::cont::DataSet MakeTestUniformDataSet(vtkm::Id time)
vtkm::Float64 ydiff = (ymax - ymin) / (static_cast<vtkm::Float64>(DIMS[1] - 1));
vtkm::Float64 zdiff = (zmax - zmin) / (static_cast<vtkm::Float64>(DIMS[2] - 1));

vtkm::Vec<vtkm::Float64, 3> ORIGIN(0, 0, 0);
vtkm::Vec<vtkm::Float64, 3> ORIGIN(0, 0, 0);
vtkm::Vec<vtkm::Float64, 3> SPACING(xdiff, ydiff, zdiff);

vtkm::cont::DataSet dataset = dsb.Create(DIMS, ORIGIN, SPACING);
Expand All @@ -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<vtkm::Float64, 3>(0.01*time, 0.01*time, 0.01*time));
{
velocityField.WritePortal().Set(count, vtkm::Vec<vtkm::Float64, 3>(0.01*time, 0.01*time, 0.01*time));
count++;
}
}
}
}
}
dsf.AddPointField(dataset, "velocity", velocityField);
return dataset;
Expand All @@ -72,22 +72,22 @@ 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);

vtkh::LineRenderer tracer;
tracer.SetRadius(.1f);
tracer.SetInput(data);
tracer.SetField("lines");
tracer.SetField("lines");

scene.AddRenderer(&tracer);
scene.AddRenderer(&tracer);
scene.Render();
}

Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/vtkh/DataSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ DataSet::GetRange(const std::string &field_name) const
vtkm::cont::ArrayHandle<vtkm::Range> 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)
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/vtkh/filters/ContourTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<DataValueType> iso_values;

Expand Down Expand Up @@ -319,8 +319,8 @@ void ContourTree::DoExecute()
#endif // VTKM_ENABLE_MPI

BranchType* branchDecompostionRoot = caugmented_ns::ProcessContourTree::ComputeBranchDecomposition<DataValueType>(
filter.GetContourTree().superparents,
filter.GetContourTree().supernodes,
filter.GetContourTree().Superparents,
filter.GetContourTree().Supernodes,
whichBranch,
branchMinimum,
branchMaximum,
Expand All @@ -332,21 +332,21 @@ 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)
{
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;
Expand Down
4 changes: 2 additions & 2 deletions src/vtkh/filters/HistSampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -101,7 +101,7 @@ calculate_pdf(const vtkm::Int32 tot_points,

vtkm::cont::ArrayHandle<vtkm::Float32> 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);
Expand Down
Loading

0 comments on commit bef5bbe

Please sign in to comment.