vtkObjectBase: add compilation option to avoid atomic ReferenceCount
The ReferenceCount
member of vtkObjectCase
is always std::atomic<int32_t>
. In pure MPI
applications ReferenceCount
can be directly declared as int32_t
avoiding additional computational cost related to atomic additions, memory fences, compilator (de)optimsations, etc. Of course this must be an opt-in
CMake option that should be OFF
by default.
If the option is activated, the CMake option VTK_SMP_IMPLEMENTATION_TYPE
should be SEQUENTIAL
. If not, a compilation configuration error should be output.
Would you be willing to review a MR regarding this issue?