bool Application::init( const int argc, char** argv, co::Object* initData ) { LBASSERT( !_impl ); if( _impl ) { LBERROR << "Already initialized" << std::endl; return false; } _impl = new detail::Application( this, initData ); initErrors(); if( !eq::init( argc, argv, _impl )) { LBERROR << "Equalizer initialization failed" << std::endl; return false; } if( !initLocal( argc, argv )) { LBERROR << "Can't initialization client node" << std::endl; exit(); return false; } if( !_impl->init( )) { exit(); return false; } return true; }
Client::Client(const int argc, char** argv, const bool isResident) : _impl(new Client::Impl(isResident)) { if (!initLocal(argc, argv)) LBTHROW(std::runtime_error("Can't init client")); _impl->server = new eq::Server; if (!connectServer(_impl->server)) { exitLocal(); LBTHROW(std::runtime_error("Can't open server")); } }
void Repo::connect() { initCentral(); initLocal(); if (!RuntimeOption::RepoEvalMode.compare("local")) { m_evalRepoId = (m_localWritable) ? RepoIdLocal : RepoIdCentral; } else if (!RuntimeOption::RepoEvalMode.compare("central")) { m_evalRepoId = RepoIdCentral; } else { assert(!RuntimeOption::RepoEvalMode.compare("readonly")); m_evalRepoId = RepoIdInvalid; } TRACE(1, "Repo.Eval.Mode=%s\n", (m_evalRepoId == RepoIdLocal) ? "local" : (m_evalRepoId == RepoIdCentral) ? "central" : "readonly"); }
int Client::run( const int argc, char** argv ) { // 0. Init local client if( !initLocal( argc, argv )) { LBERROR << "Can't init client" << std::endl; return EXIT_FAILURE; } // 1. connect to server eq::ServerPtr server = new eq::Server; if( !connectServer( server )) { LBERROR << "Can't open server" << std::endl; exitLocal(); return EXIT_FAILURE; } // 2. choose config eq::fabric::ConfigParams configParams; Config* config = static_cast< Config * >( server->chooseConfig( configParams )); if( !config ) { LBERROR << "No matching config on server" << std::endl; disconnectServer( server ); exitLocal(); return EXIT_FAILURE; } FrameData& frameData = config->getFrameData(); frameData.setup( _impl->_applicationParameters, _impl->_rendererParameters ); frameData.getVolumeSettings()->setURI( _impl->_applicationParameters.dataFileName); // 3. init config lunchbox::Clock clock; if( !config->init( argc, argv )) { server->releaseConfig( config ); disconnectServer( server ); exitLocal(); return EXIT_FAILURE; } LBLOG( LOG_STATS ) << "Config init took " << clock.getTimef() << " ms" << std::endl; // 4. run main loop uint32_t maxFrames = _impl->_applicationParameters.maxFrames; frameData.getCameraSettings()->setDefaultCameraPosition( _impl->_applicationParameters.cameraPosition ); frameData.getCameraSettings()->setDefaultCameraLookAt( _impl->_applicationParameters.cameraLookAt ); clock.reset(); while( config->isRunning() && maxFrames-- ) { if( !config->frame()) // If not valid, reset maxFrames maxFrames++; if( _impl->_idleFunc ) _impl->_idleFunc(); // order is important to latency while( !config->needRedraw( )) // wait for an event requiring redraw { if( hasCommands( )) // execute non-critical pending commands { processCommand(); config->handleEvents(); // non-blocking } else // no pending commands, block on user event { // Poll ZeroEq subscribers at least every 100 ms in handleEvents const eq::EventICommand& event = config->getNextEvent( 100 ); if( event.isValid( )) config->handleEvent( event ); config->handleEvents(); // non-blocking } } config->handleEvents(); // process all pending events } const uint32_t frame = config->finishAllFrames(); const float time = clock.getTimef(); LBLOG( LOG_STATS ) << "Rendering took " << time << " ms (" << frame << " frames @ " << ( frame / time * 1000.f) << " FPS)" << std::endl; // 5. exit config clock.reset(); config->exit(); LBLOG( LOG_STATS ) << "Exit took " << clock.getTimef() << " ms" <<std::endl; // 6. cleanup and exit server->releaseConfig( config ); if( !disconnectServer( server )) LBERROR << "Client::disconnectServer failed" << std::endl; server = 0; exitLocal(); return EXIT_SUCCESS; }
/** * @brief Constructor with file to open and potential shift applied */ HiJitCube::HiJitCube(const std::string &filename, PvlObject &shift) { initLocal(); OpenCube(filename, shift); }
/** * @brief Constructor with file to open */ HiJitCube::HiJitCube(const std::string &filename) { initLocal(); OpenCube(filename); }
/** * @brief Default constructor with no cube */ HiJitCube::HiJitCube() { initLocal(); }