void dump_dmi(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) { CREATE_NEW_OBJECT; add_hb(is_dmi_valid); if (hardware->is_dmi_valid == false) { FLUSH_OBJECT; goto exit; } else { char buffer[8]={0}; snprintf(buffer,sizeof(buffer),"%d.%d",hardware->dmi.dmitable.major_version, hardware->dmi.dmitable.minor_version); add_s("dmi.version",buffer); FLUSH_OBJECT; } dump_base_board(hardware,config,item); dump_system(hardware,config,item); dump_bios(hardware,config,item); dump_chassis(hardware,config,item); dump_ipmi(hardware,config,item); dump_battery(hardware,config,item); dump_processor(hardware,config,item); dump_cache(hardware,config,item); dump_memory_banks(hardware,config,item); dump_memory_modules(hardware,config,item); dump_memory_size(hardware,config,item); dump_oem_strings(hardware,config,item); dump_hardware_security(hardware,config,item); exit: to_cpio("dmi"); }
void ExplicitSystemManager::run() { if (options.verbose) std::cout << "Starting analysis:" << std::endl; auto t1 = std::chrono::high_resolution_clock::now(); ValueCompare<double> compare; double time_period = end_time - start_time; int old_percent = 0; int new_percent = 0; if (options.verbose) { std::cout << "\tSaving initial system state..." << std::endl; } dump_system(); if (options.verbose) std::cout << "\tAdvancing equations of motion..." << std::endl; while (compare.lessThan(explicit_system->getTime(), end_time)) { explicit_system->update(dt); ++iteration_number; if (options.save_frequency > 0 && iteration_number % options.save_frequency == 0) dump_system(); if (options.verbose) { new_percent = (int)((explicit_system->getTime() - start_time) / time_period * 100 + 0.1); if (new_percent > old_percent) { std::cout << "\t\t" << new_percent << "% completed." << std::endl; old_percent = new_percent; } } } if (options.verbose) { std::cout << "\tSaving final system state..." << std::endl; } dump_system(); auto t2 = std::chrono::high_resolution_clock::now(); auto time_span = std::chrono::duration_cast<std::chrono::duration<double>>(t2 - t1); if (options.verbose) std::cout << "Explicit time integration completed in " << time_span.count() << " seconds." << std::endl; }