Commit Graph

25 Commits

Author SHA1 Message Date
Li-Ta Lo
b9c2ddf9d1 add missing #include 2021-10-13 13:22:26 -06:00
Dave Pugmire
f8021dbc0d Add threaded filters for multiblock dataset. 2021-08-04 14:27:41 -04:00
Robert Maynard
7eaedfe84b Reduce compiler memory usage by removing auto hxx inclusion
A large portion of the VTK-m filters are now compiled into the
vtkm_filter library. These pre-built filters now don't include
the respective hxx file to remove the amount of template
instantiation users do.

To verify that this removal reduces compiler memory ( and maybe time)
I profiled the compiler while it building filter tests in debug mode.
Here is a selection of results:

```
CleanGrid           10.25s => 9.01s,  901MB => 795MB
ExternalFaces       13.40s => 5.96s, 1122MB => 744MB
ExtractStructured    4.69s => 4.75s,  492MB => 492MB
GradientExplicit    22.97s => 5.88s, 1296MB => 740MB
```
2020-11-19 09:59:25 -05:00
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Vicente Adolfo Bolea Sanchez
afd394377e cmake: split vtkm_filter into common|extra|contour|gradient
There is a limitation in Windows builds using VS2019 where libraries cannot be
bigger than 4GiB. This is normally not an issue but in `VTKm` due to its strong
template usage libraries can reach that size.

The `VTKm` filter library is can easily reach that size and it will halt the
build

This MR tries to avoid reaching those sizes for now by splitting the filter
library into four smaller libraries.

The proposal scheme is:

It splits vtkm-filter into:

  - vtkm-common, Classes that are dependencies of other filter libs.
  - vtkm-contour, Contour class and its instantiations.
  - vtkm-contour, Gradient class and its instantiations.
  - vtkm-extra, Classes other than Contour or Gradient that are
    not dependencies.

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-08-19 19:20:43 -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
882dcacca4 Have filter specify its own field types
Previously, the policy specified which field types the filter should
operate on. The filter could remove some types, but it was not able to
add any types.

This is backward. Instead, the filter should specify what types its
supports and the policy may cull out some of those.
2020-04-28 10:31:44 -06:00
Kenneth Moreland
6fc883213c Deprecate ListTag operations
The newer List operations should still work on the old ListTags, so make
those changes first to ensure that everything still works as expected if
given an old ListTag.

Next step is to deprecate ListTagBase itself and move all the lists to
the new types.
2019-12-05 11:27:31 -05:00
Robert Maynard
8520d70e0d Compile most frequently used VTK-m filters into a library
VTK-m now provides the following filters with the default policy
as part of the vtkm_filter library:
  - CellAverage
  - CleanGrid
  - ClipWithField
  - ClipWithImplicitFunction
  - Contour
  - ExternalFaces
  - ExtractStructured
  - PointAverage
  - Threshold
  - VectorMagnitude

By building these as a library we hope to provide faster compile
times for consumers of VTK-m when using common configurations.
2019-09-18 12:06:13 -04:00
Robert Maynard
d1d61b9ebc vtkm::filter::Filter passes filter policies by value
It now follows the same pattern that all filter implementations use
2019-09-17 13:50:58 -04:00
Kenneth Moreland
07c59fcf72 Update filters with secondary fields to use new policy method
Rather than do a CastAndCall on all possible field types when calling a
worklet with two fields (where they all typically get cast to the same
type as the primary field), use the new mechanism with
ArrayHandleMultiplexer to create one code path.

Also update the ApplyPolicy to accept the Field type, which is used to
determine any additional storage types to support.
2019-09-09 08:19:16 -06:00
Allison Vacanti
63050f68fc MultiBlock renamed to PartitionedDataSet
The `MultiBlock` class has been renamed to `PartitionedDataSet`, and its API
has been refactored to refer to "partitions", rather than "blocks".
Additionally, the `AddBlocks` method has been changed to `AppendPartitions` to
more accurately reflect the operation performed. The associated
`AssignerMultiBlock` class has also been renamed to
`AssignerPartitionedDataSet`.

This change is motivated towards unifying VTK-m's data model with VTK. VTK has
started to move away from `vtkMultiBlockDataSet`, which is a hierarchical tree
of nested datasets, to `vtkPartitionedDataSet`, which is always a flat vector
of datasets used to assist geometry distribution in multi-process environments.
This simplifies traversal during processing and clarifies the intent of the
container: The component datasets are partitions for distribution, not
organizational groupings (e.g. materials).

Ref #405
2019-09-03 12:42:23 -04:00
Robert Maynard
cec717015a CreateResult is now part of vtkm::filter instead of being inside internals 2019-08-09 12:44:43 -04:00
Robert Maynard
3a7d3cb5ff VTK-m filters now launch all worklets via a vtkm::cont::Invoker
This has been done as to showcase the recommend best practices
for new VTK-m contributors.
2019-08-09 10:37:35 -04:00
Robert Maynard
d7b2ff04c9 Provide a simpler way to restrict value types for filters 2019-08-06 17:04:07 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Kenneth Moreland
bddad9b386 Remove TryExecute from filters
Now that the dispatcher does its own TryExecute, filters do not need to
do that. This change requires all worklets called by filters to be able
to execute without knowing the device a priori.
2018-10-16 15:59:53 -06:00
luz.paz
940c891886 Misc. typos
Found via `codespell` and `grep`
more typos

includes source typo change and a typo that needs further review
follow-up typos


Follow-up typos


Revert a commit
2018-06-14 16:49:11 -04:00
Haocheng LIU
5c797169ec Use the strong typed enums for vtkm::cont::Field
Since Field association is used either when creating or working
with 'vtkm::cont::Field', it's put in the class itself.
2018-05-22 11:44:51 -04:00
Utkarsh Ayachit
0af0271f59 Filter API enhancements.
This revamps Filter API to improve support for multiblock dataset and
distributed use-cases. Filters now operate on MultiBlock alone thus
`Filter::Execute(MultiBlock&)` is the primary method.
`Filter::Execute(DataSet*)` is only provided as an convenience that
internally puts the dataset into a MultiBlock and calls the primary
method.

Subclasses can provides PreExecute and PostExecute overrides to handle
init/reduction operations for filters with operating on multiple blocks.
Since blocks can be distributed, filters are expected to handle that as
well.

Subclasses can provide `PrepareForExecution(MultiBlock*..)` to customize
behavior for handling multiblock inputs. Default is to simply loop
over blocks.
2018-04-12 16:40:19 -04:00
Utkarsh Ayachit
a3eacce786 doc: fix typos 2018-04-02 09:30:58 -04:00
Kenneth Moreland
86f6ecbfa5 Add some convenience methods for Filter::SetFieldsToPass
The first convenience method takes a FieldSelection and a mode. The mode
given will override the mode in the FieldSelection. The intention is to
make it easy to give the constructor argument for FieldSelection and the
mode. For example, if you wanted to pass all variables _except_
"stopfield", you could say

field.SetFieldsToPass("stopfield",
                      vtkm::filter::FieldSelection::MODE_EXCLUDE);

I also added a convenience method that takes the name of a field and an
association.

field.SetFieldsToPass("pointfield",
                      vtkm::cont::Field::ASSOC_POINTS);

Granted, you could get the same effect by wrapping this arguments in
initializer braces, but this is a bit more clear.
2018-03-22 10:47:04 -06:00
Kenneth Moreland
f8237a9d3a Make selection of fields to pass a field member variable
Previously you passed a FieldSelection to Filter::Execute to specify
which fields to pass from input to output. There is no real reason for
this as other information about input and output fields are member
variables to Filter. This moves field selection as a member variable as
well. (This should also help confusion when updating old code to new to
prevent users from mistaking field passing with input fields.

Also added a few convenience constructors to FieldSelection so that you
can call Field::SetFieldsToPass() with just the string of what you want
to pass.
2018-03-22 10:25:09 -06:00
Kenneth Moreland
6a6ac7cd82 Change filter to pass all fields by default
You can still select independent fields with a FieldSelection object if
desired.
2018-03-21 12:43:11 -06:00
Utkarsh Ayachit
de4e840eae enhance filter API
Filters now support executing on a dataset to produce a result dataset
with automatic mapping of fields to the output dataset. Fields to map
can be selected using `vtkm::filter::FieldSelection` class, which provides
constructors to map all or no fields, along with a selection of fields.

This updates all tests to use the new filter API.
2018-03-07 13:42:23 -05:00