Commit Graph

1439 Commits

Author SHA1 Message Date
Robert Maynard
4649c172c7 Merge topic 'correct_gcc_7_crashes'
f025c218 Suppress conversion warning inside Cell Interpolate code
822d4c61 Marching Cubes test doesn't abuse fall through case statements
dac7ab98 Correct a bad memcpy in ColorTable that gcc 7 found
c6726644 Reformat some test code to stop gcc 7.3 from segfaulting.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !1175
2018-05-03 10:54:08 -04:00
Robert Maynard
48aaabf661 Update AssignerMultiBlock to the new diy::Assigner class hierarchy. 2018-05-02 14:29:32 -04:00
Robert Maynard
dac7ab987a Correct a bad memcpy in ColorTable that gcc 7 found 2018-05-02 13:32:02 -04:00
Robert Maynard
c6726644b9 Reformat some test code to stop gcc 7.3 from segfaulting.
Somehow deducing the parameters to a static function was causing
gcc to segfault and crash. Changed around the code to use a free
function and everything works properly
2018-05-02 13:32:02 -04:00
Robert Maynard
bed777f078 Add missing virtual destructor to vtkm::cont::Field 2018-05-02 13:31:30 -04:00
Robert Maynard
9edd5cd383 Merge topic 'correct_delve_vs2015_cuda_errors'
c9ba80ad Replace uint with vtkm::Id in DeviceAdapterAlgorithmThrust

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1174
2018-05-02 13:30:53 -04:00
Robert Maynard
c9ba80ad93 Replace uint with vtkm::Id in DeviceAdapterAlgorithmThrust
The usage of uint was causing problems with CUDA + MSVC2015 as
type was not defined. Instead we use vtkm::Id as that was the expect
type to be passed to the task
2018-05-02 09:55:56 -04:00
Kenneth Moreland
bb54d9d411 Merge topic 'scatter-on-dispatcher'
edc4c85f Move Scatter from Worklet to Dispatcher

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1172
2018-05-01 12:17:32 -04:00
Robert Maynard
b56894dd09 Move VTK-m Cuda backend over to a grid-stride iteration pattern.
This allows for easier host side logic when determining grid and block
sizes, and allows for a smaller library side by moving some logic
into compiled in functions.
2018-04-30 17:29:26 -04:00
Kenneth Moreland
edc4c85fd9 Move Scatter from Worklet to Dispatcher
Previously, when a Worklet needed a scatter, the scatter object was
stored in the Worklet object. That was problematic because that means
the Scatter, which is a control object, was shoved into the execution
environment.

To prevent that, move the Scatter into the Dispatcher object. The
worklet still declares a ScatterType alias, but no longer has a
GetScatter method. Instead, the Dispatcher now takes a Scatter object in
its constructor. If using the default scatter (ScatterIdentity), the
default constructor is used. If using another type of Scatter that
requires data to set up its state, then the caller of the worklet needs
to provide that to the dispatcher. For convenience, worklets are
encouraged to have a MakeScatter method to help construct a proper
scatter object.
2018-04-27 00:43:51 -04:00
Robert Maynard
1ec478ce62 ColorTable now converts to and from double less often.
Previously we would convert to double to perform some operations instead
of always staying in float space.
2018-04-25 15:35:27 -04:00
Robert Maynard
b7e6371842 Correct issues found be enabling more CUDA warnings. 2018-04-23 14:27:53 -04:00
Utkarsh Ayachit
6d0e3036e4 Merge topic '220-filter-copy-fields'
cb7cbdbc fixes #220: pass only requested fields.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1162
2018-04-23 09:16:28 -04:00
Utkarsh Ayachit
cb7cbdbcf9 fixes #220: pass only requested fields.
Adding API to DataSet to `CopyStructure` from another dataset. This
copies the cellsets and coordinate systems while leaving the fields
unchanged.

CreateResult no longer copies all input fields to the output dataset
created.

Furthermore, if a Filter subclass doesn't provide `MapFieldOntoOutput`,
then the default implementation simply copies only the selected fields
to the output dataset.
2018-04-20 14:22:47 -04:00
Utkarsh Ayachit
5d3d49713a Avoid using ArrayHandle for message exchange.
Minimizing the need to have complex serialization code in vtkm/cont.
This is first step in moving DIY serialization code out of vtkm/cont. We
need to move that to filter so we can leverage policy correctly
serialize fields.
2018-04-19 21:06:38 -04:00
Utkarsh Ayachit
e62ff8096a Fix BoundsCompute for missing coordinate system.
DataSet::GetCoordinateSystem(Id) doesn't throw `ErrorBadValue`. Fixed
BoundsCompute to check for number of coordinate systems instead.
2018-04-16 16:57:36 -04:00
Utkarsh Ayachit
b31af29a8d New constructor for AssignerMultiBlock.
AssignerMultiBlock can now be created by simply passing in the number of
blocks on the local process.
2018-04-12 16:40:18 -04:00
Utkarsh Ayachit
dd3709c3ec make MultiBlock constructors explicit.
This avoids silent conversion from vtkm::Id or std::vector<DataSet> to
MultiBlock.
2018-04-12 16:40:18 -04:00
Utkarsh Ayachit
ddd14f25e3 mpi: avoid MPI calls when not using MPI.
AssignerMultiBlock did a mpi::scan which could get called when there was
only 1 rank (e.g. built with MPI, but without initializing it). Fixed
that.
2018-04-12 16:40:18 -04:00
Utkarsh Ayachit
8ecc21c0f1 init MPI when needed.
EnvironmentTracker now initializes MPI if not already initialized in MPI
builds. This is required so that MPI calls the DIY may make don't fail.
2018-04-12 16:40:18 -04:00
Utkarsh Ayachit
3211c1501c add support to run test with MPI.
`vtkm_unit_tests` now supports an MPI option that can be used to add
test that run with MPI. Adding `UnitTestFieldRangeGlobalCompute` to test
global ranges for fields.
2018-04-10 14:48:37 -04:00
Robert Maynard
2ed1bb7271 Merge topic 'color_table_stop_leaking_memory'
86c487e6 Properly clean up ColorTable's memory.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Acked-by: James Kress <james@jameskress.com>
Merge-request: !1141
2018-04-09 08:18:56 -04:00
Matt Larsen
715141737f Merge topic 'typos'
efdf8543 Misc. Typos

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <mlarsen@cs.uoregon.edu>
Merge-request: !1113
2018-04-06 18:04:46 -04:00
Utkarsh Ayachit
6938b05c33 Remove GetBounds methods from MultiBlock.
Removing GetBounds and related methods from MultiBlock. These have been
replaced by BoundsCompute and BoundsGlobalCompute.
2018-04-05 17:31:49 -04:00
Utkarsh Ayachit
c4970604fa Add BoundsCompute and BoundsGlobalCompute
Adding compute function to compute local and global bounds for datasets
and multiblocks alike.
2018-04-05 17:16:10 -04:00
Utkarsh Ayachit
f966a36214 Remove MultiBlock::GetGlobalNumberOfBlocks.
Removing another API that need not be on MultiBlock. There's generally
no need for apps to know this. If needed, we can add `...Compute`
function. This removes another API on MultiBlock that could trigger
parallel communication/synchronization.
2018-04-05 17:16:10 -04:00
Utkarsh Ayachit
f37e642563 Remove MultiBlock::GetGlobalRange API.
Removing MultiBlock::GetGlobalRange API to keep things consistent with
DataSet API. Instead, one should use `FieldRangeCompute` or
`FieldRangeGlobalCompute` as appropriate.
2018-04-05 17:16:10 -04:00
Utkarsh Ayachit
20a052f44e add FieldRangeCompute. 2018-04-05 17:16:10 -04:00
Utkarsh Ayachit
50bfb1d206 Add utility to serialize ArrayHandles for DIY. 2018-04-05 17:16:10 -04:00
Robert Maynard
86c487e614 Properly clean up ColorTable's memory. 2018-04-05 14:43:51 -04:00
Robert Maynard
84311a2453 Merge branch 'master' into cmake_refactor 2018-04-05 10:18:36 -04:00
Robert Maynard
84a772c38d Merge topic 'vtkm_storage_can_use_cuda_uvm_memory'
c1237969 VTK-m ArrayHandle can now take ownership of a user allocated memory location
707970f4 VTK-m StorageBasic is now able to give/take ownership of user allocated memory.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1137
2018-04-05 08:45:34 -04:00
Robert Maynard
c123796949 VTK-m ArrayHandle can now take ownership of a user allocated memory location
Previously memory that was allocated outside of VTK-m was impossible to transfer to
VTK-m as we didn't know how to free it. By extending the ArrayHandle constructors
to support a Storage object that is being moved, we can clearly express that
the ArrayHandle now owns memory it didn't allocate.

Here is an example of how this is done:
```cpp
  T* buffer = new T[100];
  auto user_free_function = [](void* ptr) { delete[] static_cast<T*>(ptr); };

  vtkm::cont::internal::Storage<T, vtkm::cont::StorageTagBasic>
      storage(buffer, 100, user_free_function);
  vtkm::cont::ArrayHandle<T> arrayHandle(std::move(storage));
```
2018-04-04 11:28:25 -04:00
Robert Maynard
707970f492 VTK-m StorageBasic is now able to give/take ownership of user allocated memory.
This fixes the three following issues with StorageBasic.

1. Memory that was allocated by VTK-m and Stolen by the user needed the
proper free function called which is generally StorageBasicAllocator::deallocate.
But that was hard for the user to hold onto. So now we provide a function
pointer to the correct free function.

2. Memory that was allocated outside of VTK-m was impossible to transfer to
VTK-m as we didn't know how to free it. This is now resolved by allowing the
user to specify a free function to be called on release.

3. When the CUDA backend allocates memory for an ArrayHandle that has no
control representation, and the location we are running on supports concurrent
managed access we want to specify that cuda managed memory as also the host memory.
This requires that StorageBasic be able to call an arbitrary new delete function
which is chosen at runtime.
2018-04-04 11:27:57 -04:00
Robert Maynard
0d45c5cff2 Correct warnings found after disabling all warning when CUDA is enabled. 2018-04-04 11:00:12 -04:00
Utkarsh Ayachit
cebe6820b7 add vtkm::cont::ErrorFilterExecution
Adding a new exception type `vtkm::cont::ErrorFilterExecution`. Unlike
existing exceptions, when thrown in `TryExecute`, this exception causes
the call to not attempt to execute on any other devices and let it be
thrown so that the application can catch it.
2018-04-03 16:55:03 -04:00
Kenneth Moreland
eca65146b3 Merge topic 'simplify-field-to-colors-interface'
3a812b04 Make default ColorTable preset
3391e5d2 Basic interface changes to FieldToColors
a3b2c393 Remove default constructor for ColorTable
cb8a05c7 Add a preset enum to ColorTable
97a24559 Make LAB the default color space

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1133
2018-04-02 18:24:05 -04:00
Kenneth Moreland
3a812b044e Make default ColorTable preset
Changed the "default" ColorTable preset from "cool to warm" to
"viridis." Also made a default constructor for ColorTable that sets it
to this default preset.

The main reason to change to viridis for the default is that it is in
LAB space. We are concerned that having the default ColorTable preset
being Diverging space could lead to users using that color space
inappropriately.
2018-04-02 15:32:23 -06:00
Utkarsh Ayachit
60a8ea67b4 Add Algorithm::Transform
Adding Algorithm::Transform API to match API provided by
`DeviceAdatorAlgorithm`.
2018-04-02 15:59:28 -04:00
Kenneth Moreland
a3b2c3931d Remove default constructor for ColorTable
The problem is that there is no good "default" constructor for
ColorTable. The previous default constructor created an empty color
table, but that would be confusing if someone actually tried to use it.
We could set ot to the default preset, but the default preset uses the
diverging color map, which could foul people up if they actually want to
edit or create their own color map. Instead, force the declaration of
ColorTable to indicate what you plan to do with it.
2018-04-02 11:44:17 -06:00
Kenneth Moreland
cb8a05c71b Add a preset enum to ColorTable
You can still select presets through strings (and we leave ourselves
open to add more presets through strings than enumerating with the
enum), but this provides a way to select a preset that is verified by
the compiler.
2018-04-02 11:44:16 -06:00
Kenneth Moreland
97a245597f Make LAB the default color space
Interpolations in LAB are perceptually uniform, which generally makes it
a better choice as the color space.
2018-04-02 11:44:16 -06:00
Utkarsh Ayachit
0f5ba79b3f fix warning in MakeTestDataSet 2018-04-02 09:30:58 -04:00
Utkarsh Ayachit
60f4936d54 cleanup diy usage in MultiBlock.
This fixes several issues with how DIY was used in MultiBlock.

Instead of using `diy::RegularSwapPartners` using
`diy::RegularMergePartners` to reduce data to block(gid=0) and then
broadcast out to all ranks (and not blocks) using
`diy::RegularBroadcastPartners`. Old code that used RegularSwapPartners
ended up building reduced result on all blocks, which was not only
unnecessary, but expensive since we would generally have more blocks
than ranks.

Remove `DecomposerMultiBlock`. This class was needed due to my
misunderstanding of how the decomposer works.
`diy::RegularDecomposer<diy::DiscreteBounds>` provides all the necessary
functionality provided by `DecomposerMultiBlock`.
2018-03-31 11:34:33 -04:00
Robert Maynard
83213fcb6b Merge topic 'correct_windows_compile_issues'
82163375 Correct windows compile issues with ColorTable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1128
2018-03-30 02:19:53 -04:00
Robert Maynard
68a8a60dfa Merge topic 'add_fieldtocolor_filter'
79d922ee Add a filter that uses ColorTable to color any field from a dataset.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1124
2018-03-30 01:16:28 -04:00
Robert Maynard
82163375f3 Correct windows compile issues with ColorTable 2018-03-30 01:14:30 -04:00
Robert Maynard
c9026870da CoordinateSystem now links with FloatDefault == 64 2018-03-30 00:07:13 -04:00
Robert Maynard
8808b41fbd Merge branch 'master' into vtk-m-cmake_refactor 2018-03-29 22:51:26 -04:00
Robert Maynard
79d922ee49 Add a filter that uses ColorTable to color any field from a dataset. 2018-03-29 22:12:30 -04:00