/* Initialize the SysEvents subsystem */ void SysEventInitialize( uint8_t categoryMask, bool buffer, bool print, bool overwrite ) { // Make sure the clock is initialized InitializeTime( ); // Have we already been initialized assert( !_schedExec ); assert( !_seInit ); // Pool size must be at least 1 Header + Max data size (25gb) assert( SYSEVENT_POOLSIZE_B > 256 + 8 ); // Initialize the global SE master record _seMasterRecord.categoryMask = categoryMask; _seMasterRecord.firstRecord = _seMasterRecord.pool; _seMasterRecord.nextFree = _seMasterRecord.pool; _seMasterRecord.recordCount = 0; _seMasterRecord.inBufferCount = 0; _seMasterRecord.bytesRemaining = SYSEVENT_POOLSIZE_B; _seMasterRecord.buffer = buffer; _seMasterRecord.print = print; _seMasterRecord.overwrite = overwrite; _seMasterRecord.overrun = false; // Now zero out the entire pool memset( _seMasterRecord.pool, 0, SYSEVENT_POOLSIZE_B ); // Initialize the event-type arrays(zero out the array) _seMasterRecord.numRequestedTypes = 0; memset( _seMasterRecord.categories, 0, sizeof(SysEventCategory) * SYSEVENT_TYPECATEGORIES ); memset( _seMasterRecord.types, 0, sizeof(SysEventType) * SYSEVENT_TYPESPOOLSIZE ); // Initialize the semaphore (init to 1 so that is initially available) _seMasterRecord.semaphore = _CreateSemaphore( "_seSemaphore", 1 ); // Mark as initialized _seInit = true; }
void InitializeUCSlave(void){ InitializeUART(); InitializeTime(); InitializeServo(); InitializeWatchdog(); InitializeVelocityControl(); //InitializeIMU(); EnableSensorFeedbackMessages = 0; }
//----------------------------------------------------------------------------------------------- void Initialize( HINSTANCE applicationInstanceHandle ) { CreateOpenGLWindow( applicationInstanceHandle ); OpenGLRenderer::Initalize(); InitializeTime(); LoadTextures(); LoadDeveloperConsole(); g_game.Initialize(); }
//----------------------------------------------------------------------------------------------- void GameServer::Initalize() { srand( (unsigned int) time( NULL ) ); InitializeTime(); m_server.StartServer( PORT_NUMBER ); std::cout << "Server is up and running\n"; }
///---------------------------------------------------------------------------------------------------------- /// void TheApp::StartUp( void* windowHandle ) { m_windowHandle = windowHandle; InitializeTime(); InitializeClockSystem(); m_jobManager = new JobManager(); if (m_jobManager) { m_jobManager->StartUp(0); } m_networkSystem = new NetworkSystem(); if (m_networkSystem) { m_networkSystem->StartUp(); } // m_soundSystem = new SoundSystem(); // if (m_soundSystem){ // m_soundSystem->StartUp(); // } Vector2 displaySize; //initialize renderer m_renderer = new OpenGLRenderer(); if (m_renderer) { m_renderer->StartUp((HWND)windowHandle); displaySize = Vector2(m_renderer->GetDisplayWidth(), m_renderer->GetDisplayHeight()); } //initialize text renderer m_textSystem = new TextSystem(); //mem leak: 648 if (m_textSystem) { m_textSystem->StartUp("Data/Fonts/lucidaCL.fnt", m_renderer); } //initialize input system m_inputSystem = new InputSystem(); if (m_inputSystem) { m_inputSystem->StartUp(m_windowHandle, displaySize); } m_particleSystem = new ParticleSystem(); if (m_particleSystem) { //do something } ConsolePrintf("\n===The App Start Up Completed===\n"); //initialize world m_world = new World(displaySize ); if (m_world) { m_world->StartUp(); } }
static GameState* CreateNewGameState(char* window_title, int res_x, int res_y) { MemoryArena arena; // NOTE: this is the allocation for the game, store this somewhere if this should be freed manually at some point AllocateMemoryArena(&arena, sizeof(GameState) + GAME_PERMANENT_MEMORY_SIZE + FRAME_TEMPORARY_MEMORY_SIZE); GameState* result = PushStruct(&arena, GameState); result->temporary_memory = CreateSubArena(&arena, FRAME_TEMPORARY_MEMORY_SIZE); result->permanent_memory = CreateSubArena(&arena, GAME_PERMANENT_MEMORY_SIZE); assert(arena.used == arena.size); result->input = PushStruct(&result->permanent_memory, NewInput); result->renderer = CreateRenderer(&result->permanent_memory); InitializeTime(result, MS_PER_FRAME); return result->renderer ? result : nullptr; }
//============================================================================= std::ostream& Ifpack_ICT::Print(std::ostream& os) const { if (!Comm().MyPID()) { os << endl; os << "================================================================================" << endl; os << "Ifpack_ICT: " << Label() << endl << endl; os << "Level-of-fill = " << LevelOfFill() << endl; os << "Absolute threshold = " << AbsoluteThreshold() << endl; os << "Relative threshold = " << RelativeThreshold() << endl; os << "Relax value = " << RelaxValue() << endl; os << "Condition number estimate = " << Condest() << endl; os << "Global number of rows = " << Matrix().NumGlobalRows() << endl; if (IsComputed_) { os << "Number of nonzeros of H = " << H_->NumGlobalNonzeros() << endl; os << "nonzeros / rows = " << 1.0 * H_->NumGlobalNonzeros() / H_->NumGlobalRows() << endl; } os << endl; os << "Phase # calls Total Time (s) Total MFlops MFlops/s" << endl; os << "----- ------- -------------- ------------ --------" << endl; os << "Initialize() " << std::setw(5) << NumInitialize() << " " << std::setw(15) << InitializeTime() << " 0.0 0.0" << endl; os << "Compute() " << std::setw(5) << NumCompute() << " " << std::setw(15) << ComputeTime() << " " << std::setw(15) << 1.0e-6 * ComputeFlops(); if (ComputeTime() != 0.0) os << " " << std::setw(15) << 1.0e-6 * ComputeFlops() / ComputeTime() << endl; else os << " " << std::setw(15) << 0.0 << endl; os << "ApplyInverse() " << std::setw(5) << NumApplyInverse() << " " << std::setw(15) << ApplyInverseTime() << " " << std::setw(15) << 1.0e-6 * ApplyInverseFlops(); if (ApplyInverseTime() != 0.0) os << " " << std::setw(15) << 1.0e-6 * ApplyInverseFlops() / ApplyInverseTime() << endl; else os << " " << std::setw(15) << 0.0 << endl; os << "================================================================================" << endl; os << endl; } return(os); }
//============================================================================= std::ostream& Ifpack_SPARSKIT::Print(std::ostream& os) const { if (!Comm().MyPID()) { os << endl; os << "================================================================================" << endl; os << "Ifpack_SPARSKIT: " << Label() << endl << endl; os << "Condition number estimate = " << Condest() << endl; os << "Global number of rows = " << A_.NumGlobalRows() << endl; os << endl; os << "Phase # calls Total Time (s) Total MFlops MFlops/s" << endl; os << "----- ------- -------------- ------------ --------" << endl; os << "Initialize() " << std::setw(5) << NumInitialize() << " " << std::setw(15) << InitializeTime() << " 0.0 0.0" << endl; os << "Compute() " << std::setw(5) << NumCompute() << " " << std::setw(15) << ComputeTime() << " " << std::setw(15) << 1.0e-6 * ComputeFlops(); if (ComputeTime() != 0.0) os << " " << std::setw(15) << 1.0e-6 * ComputeFlops() / ComputeTime() << endl; else os << " " << std::setw(15) << 0.0 << endl; os << "ApplyInverse() " << std::setw(5) << NumApplyInverse() << " " << std::setw(15) << ApplyInverseTime() << " " << std::setw(15) << 1.0e-6 * ApplyInverseFlops(); if (ApplyInverseTime() != 0.0) os << " " << std::setw(15) << 1.0e-6 * ApplyInverseFlops() / ApplyInverseTime() << endl; else os << " " << std::setw(15) << 0.0 << endl; os << "================================================================================" << endl; os << endl; } return(os); }
FROLogger::FROLogger( const std::string &configFile ) : _exec(true), _channels(), _messageTypes() { // Initialize the timing subsystem InitializeTime(); // Parse the config file this->ParseConfig( configFile ); }