message: silence warning in device destructor, fixup device commit()
diff: @@ -76,36 +76,21 @@ namespace ospray {
  MPIDistributedDevice::~MPIDistributedDevice()
  {
  + try {
  MPI_CALL(Finalize());
  + } catch (...) {
  + //TODO: anything to do here? try-catch added to silence a warning...
  + }
  }
  void MPIDistributedDevice::commit()
  {
  - //TODO: is it necessary to track if we've initialized the device yet?
  -#if 0
  - if (initialized)
  - return;
  -#endif
  -
  - Device::commit();
  -
  - initialized = true;
  -
  + if (!initialized) {
  int _ac = 1;
  const char *_av[] = {"ospray_mpi_worker"};
  mpi::init(&_ac, _av);
  - masterRank = getParam1i("masterRank", 0);
  -
  - std::string mode = getParamString("mode", "distributed");
  -
  - if (mode == "distributed") {
  - postErrorMsg() << "#dmpi: device commit() setting mode to " << mode;
  - } else {
  - throw std::runtime_error("#dmpi: bad device mode ['" + mode + "]");
  - }
  -
  std::stringstream embreeConfig;
  if (debugMode)
  embreeConfig << " threads=1,verbose=2";
  @@ -122,6 +107,21 @@ namespace ospray {
  assert(erc == RTC_NO_ERROR);
  }
  + initialized = true;
  + }
  +
  + Device::commit();
  +
  + masterRank = getParam1i("masterRank", 0);
  +
  + std::string mode = getParamString("mode", "distributed");
  +
  + if (mode == "distributed") {
  + postErrorMsg() << "#dmpi: device commit() setting mode to " << mode;
  + } else {
  + throw std::runtime_error("#dmpi: bad device mode ['" + mode + "]");
  + }
  +
  // TODO: implement 'staticLoadBalancer::Distributed'
  //TiledLoadBalancer::instance = make_unique<staticLoadBalancer::Master>();
  }
  