I've just pushed a whole suite of updates to the GitHub repo. Almost all of the major changes are under-the-hood things that we have resolved recently here at Pixar. Field3D is now much more stable and fault tolerant in multi-threaded contexts when it comes to I/O.
Most notably, it is now perfectly safe to use multiple Field3DInputFile and Field3DOutputFile instances on separate threads. Field3D will now perform internal locking to avoid any race conditions. Also, the sparse read cache is now thread safe, and loading multiple SparseField instances with memory limiting enabled is supported.
Full list of changes below:
------------------------------------------------------------
Multithreading improvements
- I/O routines for opening/closing/reading/writing are all fully thread safe. Multiple threads can read from separate files concurrently.
- DenseField and SparseField both have numGrains() and getGrainBounds() which simplify multithreading workload balancing.
- Improved robustness of the SparseFileManager and the lazy load/sparse cache implementation in general, especially in multithreaded contexts.
Adding coordinate system utility functions
- Coordinate system from basis vectors
- Coordinate system from bounding box
- Coordinate system from bounding box and voxel size
FieldCache
- Field3D will now keep weak pointers to all loaded fields.
- If a field is loaded a second time, the cache will return a pointer to the already-loaded data, if it is still in-memory.
FileSequence
- Utilities for resolving file sequences such as "/tmp/file.1-31#.f3d" into a list of filename strings
Various
- Added indexToCoord - inverse index-to-voxel mapping.
- Bug fix in FieldGroup's calculation of voxel size.
- Added MIPField<T>::concreteMipLevel() for accessing underlying data.
- makeMIP() now takes a template filter argument.
- MIP generation and resampling of half-precision fields now use 32 bits for calculations to avoid precision issues.
- MIP generation is now sparse-aware for efficiency.
- Updated filters in Resample.h to support arbitrary width.
- Added SparseField helper function - blockBounds() for computing block-space bounding boxes.