Commit Graph

513 Commits

Author SHA1 Message Date
Kenneth Moreland
d1a4aecc59 Improvements to moving data into ArrayHandle
We have made several improvements to adding data into an `ArrayHandle`.

## Moving data from an `std::vector`

For numerous reasons, it is convenient to define data in a `std::vector`
and then wrap that into an `ArrayHandle`. It is often the case that an
`std::vector` is filled and then becomes unused once it is converted to an
`ArrayHandle`. In this case, what we really want is to pass the data off to
the `ArrayHandle` so that the `ArrayHandle` is now managing the data and
not the `std::vector`.

C++11 has a mechanism to do this: move semantics. You can now pass
variables to functions as an "rvalue" (right-hand value). When something is
passed as an rvalue, it can pull state out of that variable and move it
somewhere else. `std::vector` implements this movement so that an rvalue
can be moved to another `std::vector` without actually copying the data.
`make_ArrayHandle` now also takes advantage of this feature to move rvalue
`std::vector`s.

There is a special form of `make_ArrayHandle` named `make_ArrayHandleMove`
that takes an rvalue. There is also a special overload of
`make_ArrayHandle` itself that handles an rvalue `vector`. (However, using
the explicit move version is better if you want to make sure the data is
actually moved.)

## Make `ArrayHandle` from initalizer list

A common use case for using `std::vector` (particularly in our unit tests)
is to quickly add an initalizer list into an `ArrayHandle`. Now you can
by simply passing an initializer list to `make_ArrayHandle`.

## Deprecated `make_ArrayHandle` with default shallow copy

For historical reasons, passing an `std::vector` or a pointer to
`make_ArrayHandle` does a shallow copy (i.e. `CopyFlag` defaults to `Off`).
Although more efficient, this mode is inherintly unsafe, and making it the
default is asking for trouble.

To combat this, calling `make_ArrayHandle` without a copy flag is
deprecated. In this way, if you wish to do the faster but more unsafe
creation of an `ArrayHandle` you should explicitly express that.

This requried quite a few changes through the VTK-m source (particularly in
the tests).

## Similar changes to `Field`

`vtkm::cont::Field` has a `make_Field` helper function that is similar to
`make_ArrayHandle`. It also features the ability to create fields from
`std::vector`s and C arrays. It also likewise had the same unsafe behavior
by default of not copying from the source of the arrays.

That behavior has similarly been depreciated. You now have to specify a
copy flag.

The ability to construct a `Field` from an initializer list of values has
also been added.
2020-07-23 10:53:38 -06:00
Li-Ta Lo
537557ef91 Merge topic 'worket_invoker_dispatcher2'
0dcc6cc16 reverse #include on CellNeighborhood
2489da125 restore comment, add needed #include
f33318247 Reverse Invoker, Dispatcher and Worklet dependency

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2192
2020-07-22 14:20:35 -04:00
Li-Ta Lo
2489da1259 restore comment, add needed #include 2020-07-21 18:21:44 -06:00
Li-Ta Lo
f333182476 Reverse Invoker, Dispatcher and Worklet dependency 2020-07-21 17:25:43 -06:00
dpugmire
246be1b7f0 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into generalizeField 2020-07-21 15:03:08 -04:00
Li-Ta Lo
567b1fedd2 Merge topic 'cell_neighbor'
9cd70a7dc Install WorkletNeighborhood.h
f66c782b1 Extract WorkletNeighborhood base class
760c51ed6 install ThreadIndicesNeighborhood.h
e52b8fa88 Add CellNeighborhood

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2181
2020-07-21 13:45:40 -04:00
dpugmire
2e3fe059b6 replace vtkm::Particle with vtkm::Massless 2020-07-21 11:19:47 -04:00
dpugmire
5fc822082e replace vtkm::Particle with vtkm::Massless 2020-07-21 11:14:31 -04:00
Li-Ta Lo
f66c782b14 Extract WorkletNeighborhood base class 2020-07-20 17:50:14 -06:00
Li-Ta Lo
e52b8fa88a Add CellNeighborhood 2020-07-15 14:41:32 -06:00
Kenneth Moreland
f6b13df513 Support coordinates of both float32 and float64
Previously there were issues if the coordinate system was using floating
point values that were not FloatDefault. This remedies that issue.
2020-07-14 08:53:01 -06:00
Sujin Philip
8c3c138bb9 Enable the Game of Life example back
It was commented out by accident in a previous commit.
2020-07-06 12:25:42 -05:00
Robert Maynard
7c66b1dd62 Update contour_tree_distributed to work with the new diy API 2020-07-01 08:28:10 -04:00
Kenneth Moreland
56bec1dd7b Replace basic ArrayHandle implementation to use Buffers
This encapsulates a lot of the required memory management into the
Buffer object and related code.

Many now unneeded classes were deleted.
2020-06-25 14:02:26 -06:00
Nick Thompson
ca0cd5f380 Merge conflict resolution. 2020-06-13 14:21:25 -04:00
Oliver Ruebel
66c96a983f Add BRACT for distributed contour tree computation
This merge request is Phase 1 of several to implement the distributed parallel
contour tree in VTKm. This merge requests adds the base outline for the
algorithm. The implementation of the details of the algorithm in the
BoundaryRestrictedAugmentedContourTree.h is currently still missing.
However, these will require a substantial (~3000) lines of additional code.
The goal is to stage the integration process across merge requests to make
the review process simpler.
2020-06-12 11:50:01 -06:00
NAThompson
8bba068c5e Revert maximum CMake version diff. 2020-06-11 15:24:35 -04:00
NAThompson
1c7b41aa5f Update demo to exhibit more VTK-m capabilities. 2020-06-11 14:46:29 -04:00
Sujin Philip
b7d0c94f1b Merge topic 'diy-mpi-nompi'
934f085e0 Build diy as a library
f0a37ac6a Merge branch 'upstream-diy' into diy-mpi-nompi
7687aabf8 diy 2020-06-05 (b62915aa)
6ca2b9f87 Point to new version of Diy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2123
2020-06-08 21:25:54 -04:00
Sujin Philip
934f085e09 Build diy as a library
Support both mpi and nompi versions simultaneously.
2020-06-08 15:57:51 -05:00
NAThompson
db8f3c9fc9 Remove Initialize() boilerplate. 2020-06-05 13:38:18 -04:00
NAThompson
3265460e66 Fix C++17 build. 2020-06-03 14:14:32 -04:00
Oliver Ruebel
3273f1c484 Update to AddPointField of dataset 2020-05-28 09:33:42 -07:00
Oliver Ruebel
eef30c2325 Merge branch 'master' into add/hyperstructstats 2020-05-28 09:32:30 -07:00
Oliver Ruebel
1014dbf046 Fix BOV reader support in ContourTreeApp 2020-05-28 06:40:31 -07:00
Oliver Ruebel
e908826c13 Temporary disabled BOV reader in ContourTreeApp pending #517 2020-05-28 01:33:10 -07:00
Oliver Ruebel
8a27ff5109 Merge branch 'master' into add/hyperstructstats 2020-05-28 00:38:29 -07:00
Oliver Ruebel
43e470de72 Fix g++ conversion warning in ContourTreeApp 2020-05-28 00:30:21 -07:00
NAThompson
8fe17e0a65 Remove DataSetFieldAdd from examples as well. 2020-05-27 16:26:11 -04:00
Kenneth Moreland
3c4e8a2ea5 Convert filters to use precompiled field map functions where applicable 2020-05-21 08:34:32 -06:00
Kenneth Moreland
d4ff67a226 Merge topic 'deprecate-execute-with-policy'
544a078cd Remove use of deprecated policies in examples
06f5119c2 Fix deprecation warning
f29a4712b Correct field types for ComputeMoments filter
a20ec03d0 Disable proxies in filter benchmark
72cd0107e Deprecate Execute with policy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2093
2020-05-20 18:28:37 -04:00
Kenneth Moreland
544a078cdb Remove use of deprecated policies in examples
This means that the filters in the examples will no longer properly
support the policies handed to them, but that is the direction we are
headed as the policies are now deprecated.
2020-05-20 12:58:24 -06:00
Kenneth Moreland
8657a9b3c8 Update VTKDataSetWriter to compile into vtkm_io 2020-05-19 14:32:48 -06:00
Kenneth Moreland
0612be9c5b Move VTKDataSetReaderBase code to vtkm_io
Most of this code is not templated methods. Rather, it implements over
several types to call templated functions, which creates quite a bit of
code. Rather than have all code using a reader recompile the code, just
compile it once and put it in a library.
2020-05-19 12:27:01 -06:00
dpugmire
72f1846bf1 missed a comment change. 2020-05-19 09:41:31 -04:00
dpugmire
bda8a1580b change comments as well. 2020-05-18 16:44:12 -04:00
dpugmire
2858186ddd Print statement was wrong for openMP 2020-05-18 16:42:37 -04:00
Kenneth Moreland
72cd0107ee Deprecate Execute with policy
The version of `Filter::Execute` that takes a policy as an argument is now
deprecated. Filters are now able to specify their own fields and types,
which is often why you want to customize the policy for an execution. The
other reason is that you are compiling VTK-m into some other source that
uses a particular types of storage. However, there is now a mechanism in
the CMake configuration to allow you to provide a header that customizes
the "default" types used in filters. This is a much more convenient way to
compile filters for specific types.

One thing that filters were not able to do was to customize what cell sets
they allowed using. This allows filters to self-select what types of cell
sets they support (beyond simply just structured or unstructured). To
support this, the lists `SupportedCellSets`, `SupportedStructuredCellSets`,
and `SupportedUnstructuredCellSets` have been added to `Filter`. When you
apply a policy to a cell set, you now have to also provide the filter.
2020-05-18 12:38:41 -06:00
Kenneth Moreland
f9d9b536d4 Fix conversion warnings in benchmarks and examples
These are caused when using 32-bit Id's. Although there are some
benchmarks that test for this, some code in benchmarking and examples is
not covered by them.
2020-05-14 17:16:19 -06:00
Robert Maynard
e17726ad0b Correct implicit signed conversion warnings 2020-05-12 09:38:18 -04:00
Kenneth Moreland
1a461594c2 Do not allow preprocessor directives inside of macro calls
This actually results in undefined behavior in C/C++. Get around the
problem in this instance by building a string first and then calling the
macro.
2020-05-07 14:01:14 -06:00
NAThompson
34585fdff5 Fix TemporalAdvection example by removing call to .Set on a ReadPortal(). 2020-05-05 10:23:16 -04:00
NAThompson
697369fc14 Remove deprecation warnings throughout the project. 2020-04-30 08:12:04 -04:00
Nick
1d4ebaec9f Image was upside down; flip it over, demo usage. 2020-04-17 07:56:03 -04:00
Sujin Philip
c102ea556c Update cmake minimum required version to 3.12 2020-04-13 12:42:28 -05:00
Robert Maynard
917919569c contour_tree_augmented example compiles when TBB is enabled
Fixes #486
2020-04-02 11:22:09 -04:00
oruebel
a9a4736c34 Add BOV reader support and fix TBB settings in contour tree app 2020-03-22 20:38:15 -07:00
oruebel
38da8dc435 Fix TBB check bug in ContourTreeApp 2020-03-20 16:04:39 -07:00
Oliver Ruebel
f2e655baef Add routine for outputing statistics about the hyper structure 2020-03-20 14:00:38 -07:00
Kenneth Moreland
ec34cb56c4 Use new ways to get array portal in control environment
Also fix deadlocks that occur when portals are not destroyed
in time.
2020-02-26 13:10:46 -07:00