diff --git a/modules/cpu/camera/Camera.h b/modules/cpu/camera/Camera.h index 4002befd0..b93d50f1f 100644 --- a/modules/cpu/camera/Camera.h +++ b/modules/cpu/camera/Camera.h @@ -38,9 +38,9 @@ struct OSPRAY_SDK_INTERFACE Camera // Data members // // if motionBlur in local camera space; otherwise in world-space: - vec3f pos; // position of the camera - vec3f dir; // main direction of the camera - vec3f up; // up direction of the camera + vec3f pos{0.f, 0.f, 0.f}; // position of the camera + vec3f dir{0.f, 0.f, 1.f}; // main direction of the camera + vec3f up{0.f, 1.f, 0.f}; // up direction of the camera float nearClip{1e-6f}; // near clipping distance // definition of the image region, may even be outside of [0..1]^2 diff --git a/modules/cpu/fb/SparseFB.cpp b/modules/cpu/fb/SparseFB.cpp index 3b5ce887e..10cc3b27a 100644 --- a/modules/cpu/fb/SparseFB.cpp +++ b/modules/cpu/fb/SparseFB.cpp @@ -41,8 +41,7 @@ SparseFrameBuffer::SparseFrameBuffer(api::ISPCDevice &device, FFO_FB_SPARSE), device(device), useTaskAccumIDs((channels & OSP_FB_ACCUM) || overrideUseTaskAccumIDs), - totalTiles(divRoundUp(size, vec2i(TILE_SIZE))), - numRenderTasks(0) + totalTiles(divRoundUp(size, vec2i(TILE_SIZE))) { if (size.x <= 0 || size.y <= 0) { throw std::runtime_error( diff --git a/modules/cpu/fb/SparseFB.h b/modules/cpu/fb/SparseFB.h index 8b0cc69ef..41531fdbb 100644 --- a/modules/cpu/fb/SparseFB.h +++ b/modules/cpu/fb/SparseFB.h @@ -153,7 +153,7 @@ struct OSPRAY_SDK_INTERFACE SparseFrameBuffer // Total number of render tasks that the framebuffer is divided into, // including those not owned by this sparsefb - vec2i numRenderTasks; + vec2i numRenderTasks{0}; // holds error per task for each tile, stored in tiled order. // The SparseFB doesn't do its own error refinement since it doesn't have diff --git a/modules/mpi/common/maml/Context.cpp b/modules/mpi/common/maml/Context.cpp index 8f3acbbe9..ec20cda6a 100644 --- a/modules/mpi/common/maml/Context.cpp +++ b/modules/mpi/common/maml/Context.cpp @@ -7,6 +7,7 @@ #include #include +#include "common/OSPCommon.h" #include "rkcommon/memory/malloc.h" #include "rkcommon/tasking/async.h" #include "rkcommon/tasking/tasking_system_init.h" @@ -30,7 +31,11 @@ Context::Context(bool enableCompression) : compressMessages(enableCompression) Context::~Context() { - stop(); + try { + stop(); + } catch (const std::exception &e) { + ospray::handleError(OSP_UNKNOWN_ERROR, e.what()); + } } /*! register a new incoing-message handler. if any message comes in diff --git a/modules/mpi/ospray/MPIOffloadDevice.cpp b/modules/mpi/ospray/MPIOffloadDevice.cpp index b7dd3fd02..428547492 100644 --- a/modules/mpi/ospray/MPIOffloadDevice.cpp +++ b/modules/mpi/ospray/MPIOffloadDevice.cpp @@ -189,24 +189,29 @@ void createMPI_ListenForClient( MPIOffloadDevice::~MPIOffloadDevice() { - if (dynamic_cast(fabric.get()) && world.rank == 0) { - postStatusMsg(OSP_LOG_INFO) << "shutting down mpi device"; - - sendWork([](networking::WriteStream &writer) { writer << work::FINALIZE; }, - true); - fabric = nullptr; - maml::shutdown(); - - MPI_Finalize(); - - RKCOMMON_IF_TRACING_ENABLED({ - char hostname[512] = {0}; - gethostname(hostname, 511); - const std::string masterTraceFile = - std::string(hostname) + "_master.json"; - rkcommon::tracing::saveLog( - masterTraceFile.c_str(), masterTraceFile.c_str()); - }); + try { + if (dynamic_cast(fabric.get()) && world.rank == 0) { + postStatusMsg(OSP_LOG_INFO) << "shutting down mpi device"; + + sendWork( + [](networking::WriteStream &writer) { writer << work::FINALIZE; }, + true); + fabric = nullptr; + maml::shutdown(); + + MPI_Finalize(); + + RKCOMMON_IF_TRACING_ENABLED({ + char hostname[512] = {0}; + gethostname(hostname, 511); + const std::string masterTraceFile = + std::string(hostname) + "_master.json"; + rkcommon::tracing::saveLog( + masterTraceFile.c_str(), masterTraceFile.c_str()); + }); + } + } catch (const std::exception &e) { + handleError(OSP_UNKNOWN_ERROR, e.what()); } } diff --git a/ospray/common/Managed.cpp b/ospray/common/Managed.cpp index 918327ab4..5fb901aa8 100644 --- a/ospray/common/Managed.cpp +++ b/ospray/common/Managed.cpp @@ -9,7 +9,7 @@ ManagedObject::~ManagedObject() { std::for_each(params_begin(), params_end(), [&](std::shared_ptr &p) { auto ¶m = *p; - if (param.data.is()) { + if (param.data.valid() && param.data.is()) { auto *obj = param.data.get(); if (obj != nullptr) obj->refDec();