// -------------------------------------------------- void EnvironmentOptions::getMyOptionValues(po::options_description& optionsDesc) { #ifdef QUESO_MEMORY_DEBUGGING std::cout << "Entering EnvOptions::getMyOptionsValues()" << std::endl; #endif if (m_env.allOptionsMap().count(m_option_help.c_str())) { // 'm_subDisplayOutputFile' is still not available at this moment. Use 'std::cout' if (m_env.fullRank() == 0) std::cout << optionsDesc << std::endl; } if (m_env.allOptionsMap().count(m_option_numSubEnvironments.c_str())) { m_ov.m_numSubEnvironments = m_env.allOptionsMap()[m_option_numSubEnvironments].as<unsigned int>(); } if ((m_env.fullComm().NumProc()%m_ov.m_numSubEnvironments) != 0) { std::cerr << "In BaseEnvironment::getMyOptionValues()" << ": m_env.fullComm().NumProc() = " << m_env.fullComm().NumProc() << ", m_numSubEnvironments = " << m_ov.m_numSubEnvironments << std::endl; } UQ_FATAL_TEST_MACRO((m_env.fullComm().NumProc()%m_ov.m_numSubEnvironments) != 0, m_env.worldRank(), "BaseEnvironment::getMyOptionValues()", "total number of processors in environment must be multiple of the specified number of subEnvironments"); if (m_env.allOptionsMap().count(m_option_subDisplayFileName.c_str())) { m_ov.m_subDisplayFileName = m_env.allOptionsMap()[m_option_subDisplayFileName].as<std::string>(); } if (m_env.allOptionsMap().count(m_option_subDisplayAllowAll.c_str())) { m_ov.m_subDisplayAllowAll = m_env.allOptionsMap()[m_option_subDisplayAllowAll].as<bool>(); } if (m_env.allOptionsMap().count(m_option_subDisplayAllowInter0.c_str())) { m_ov.m_subDisplayAllowInter0 = m_env.allOptionsMap()[m_option_subDisplayAllowInter0].as<bool>(); } if (m_ov.m_subDisplayAllowAll) { m_ov.m_subDisplayAllowedSet.clear(); // The line below is commented because 'm_subId' is not set at this point yet //m_subDisplayAllowedSet.insert((unsigned int) m_subId); } else if (m_ov.m_subDisplayAllowInter0) { m_ov.m_subDisplayAllowedSet.clear(); } else if (m_env.allOptionsMap().count(m_option_subDisplayAllowedSet.c_str())) { m_ov.m_subDisplayAllowedSet.clear(); std::vector<double> tmpAllow(0,0.); std::string inputString = m_env.allOptionsMap()[m_option_subDisplayAllowedSet].as<std::string>(); MiscReadDoublesFromString(inputString,tmpAllow); //if (m_subDisplayOutputFile) { // *m_subDisplayOutputFile << "In EnvironmentOptions::getMyOptionValues(): allow = "; // for (unsigned int i = 0; i < tmpAllow.size(); ++i) { // *m_subDisplayOutputFile << " " << tmpAllow[i]; // } // *m_subDisplayOutputFile << std::endl; //} if (tmpAllow.size() > 0) { for (unsigned int i = 0; i < tmpAllow.size(); ++i) { m_ov.m_subDisplayAllowedSet.insert((unsigned int) tmpAllow[i]); } } } if (m_env.allOptionsMap().count(m_option_displayVerbosity.c_str())) { m_ov.m_displayVerbosity = m_env.allOptionsMap()[m_option_displayVerbosity].as<unsigned int>(); } if (m_env.allOptionsMap().count(m_option_syncVerbosity.c_str())) { m_ov.m_syncVerbosity = m_env.allOptionsMap()[m_option_syncVerbosity].as<unsigned int>(); } if (m_env.allOptionsMap().count(m_option_checkingLevel.c_str())) { m_ov.m_checkingLevel = m_env.allOptionsMap()[m_option_checkingLevel].as<unsigned int>(); } if (m_env.allOptionsMap().count(m_option_rngType.c_str())) { m_ov.m_rngType = m_env.allOptionsMap()[m_option_rngType].as<std::string>(); } if (m_env.allOptionsMap().count(m_option_seed.c_str())) { m_ov.m_seed = m_env.allOptionsMap()[m_option_seed].as<int>(); } if (m_env.allOptionsMap().count(m_option_platformName.c_str())) { m_ov.m_platformName = m_env.allOptionsMap()[m_option_platformName].as<std::string>(); } if (m_env.allOptionsMap().count(m_option_identifyingString.c_str())) { m_ov.m_identifyingString = m_env.allOptionsMap()[m_option_identifyingString].as<std::string>(); } //if (m_env.allOptionsMap().count(m_option_numDebugParams.c_str())) { // m_numDebugParams = m_env.allOptionsMap()[m_option_numDebugParams].as<unsigned int>(); //} #ifdef QUESO_MEMORY_DEBUGGING std::cout << "Leaving EnvOptions::getMyOptionsValues()" << std::endl; #endif return; }
void GpmsaComputerModelOptions::getMyOptionValues(boost::program_options::options_description& optionsDesc) { queso_deprecated(); if (m_env.allOptionsMap().count(m_option_help)) { if (m_env.subDisplayFile()) { *m_env.subDisplayFile() << optionsDesc << std::endl; } } if (m_env.allOptionsMap().count(m_option_checkAgainstPreviousSample)) { m_ov.m_checkAgainstPreviousSample = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_checkAgainstPreviousSample]).as<bool>(); } if (m_env.allOptionsMap().count(m_option_dataOutputFileName)) { m_ov.m_dataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dataOutputFileName]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_dataOutputAllowAll)) { m_ov.m_dataOutputAllowAll = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dataOutputAllowAll]).as<bool>(); } if (m_ov.m_dataOutputAllowAll) { m_ov.m_dataOutputAllowedSet.insert(m_env.subId()); } else if (m_env.allOptionsMap().count(m_option_dataOutputAllowedSet)) { m_ov.m_dataOutputAllowedSet.clear(); std::vector<double> tmpAllow(0,0.); std::string inputString = m_env.allOptionsMap()[m_option_dataOutputAllowedSet].as<std::string>(); MiscReadDoublesFromString(inputString,tmpAllow); if (tmpAllow.size() > 0) { for (unsigned int i = 0; i < tmpAllow.size(); ++i) { m_ov.m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]); } } } //std::cout << "In GpmsaComputerModelOptions::getMyOptionValues(), m_option_priorSeqNumSamples = " << m_option_priorSeqNumSamples << "___" << std::endl; if (m_env.allOptionsMap().count(m_option_priorSeqNumSamples)) { //std::cout << "In GpmsaComputerModelOptions::getMyOptionValues(), going to read m_option_priorSeqNumSamples..." << std::endl; m_ov.m_priorSeqNumSamples = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_priorSeqNumSamples]).as<unsigned int>(); //std::cout << "In GpmsaComputerModelOptions::getMyOptionValues(), just read m_option_priorSeqNumSamples = " << m_ov.m_priorSeqNumSamples << std::endl; } if (m_env.allOptionsMap().count(m_option_priorSeqDataOutputFileName)) { m_ov.m_priorSeqDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_priorSeqDataOutputFileName]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_priorSeqDataOutputFileType)) { m_ov.m_priorSeqDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_priorSeqDataOutputFileType]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_priorSeqDataOutputAllowAll)) { m_ov.m_priorSeqDataOutputAllowAll = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_priorSeqDataOutputAllowAll]).as<bool>(); } if (m_ov.m_priorSeqDataOutputAllowAll) { m_ov.m_priorSeqDataOutputAllowedSet.insert(m_env.subId()); } else if (m_env.allOptionsMap().count(m_option_priorSeqDataOutputAllowedSet)) { m_ov.m_priorSeqDataOutputAllowedSet.clear(); std::vector<double> tmpAllow(0,0.); std::string inputString = m_env.allOptionsMap()[m_option_priorSeqDataOutputAllowedSet].as<std::string>(); MiscReadDoublesFromString(inputString,tmpAllow); if (tmpAllow.size() > 0) { for (unsigned int i = 0; i < tmpAllow.size(); ++i) { m_ov.m_priorSeqDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]); } } } if (m_env.allOptionsMap().count(m_option_nuggetValueForBtWyB)) { m_ov.m_nuggetValueForBtWyB = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_nuggetValueForBtWyB]).as<double>(); } if (m_env.allOptionsMap().count(m_option_nuggetValueForBtWyBInv)) { m_ov.m_nuggetValueForBtWyBInv = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_nuggetValueForBtWyBInv]).as<double>(); } if (m_env.allOptionsMap().count(m_option_formCMatrix)) { m_ov.m_formCMatrix = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_formCMatrix]).as<double>(); } if (m_env.allOptionsMap().count(m_option_useTildeLogicForRankDefficientC)) { m_ov.m_useTildeLogicForRankDefficientC = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_useTildeLogicForRankDefficientC]).as<bool>(); } if (m_env.allOptionsMap().count(m_option_predLag)) { m_ov.m_predLag = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_predLag]).as<unsigned int>(); } if (m_env.allOptionsMap().count(m_option_predVUsBySamplingRVs)) { m_ov.m_predVUsBySamplingRVs = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_predVUsBySamplingRVs]).as<bool>(); } if (m_env.allOptionsMap().count(m_option_predVUsBySummingRVs)) { m_ov.m_predVUsBySummingRVs = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_predVUsBySummingRVs]).as<bool>(); } if (m_env.allOptionsMap().count(m_option_predVUsAtKeyPoints)) { m_ov.m_predVUsAtKeyPoints = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_predVUsAtKeyPoints]).as<bool>(); } if (m_env.allOptionsMap().count(m_option_predWsBySamplingRVs)) { m_ov.m_predWsBySamplingRVs = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_predWsBySamplingRVs]).as<bool>(); } if (m_env.allOptionsMap().count(m_option_predWsBySummingRVs)) { m_ov.m_predWsBySummingRVs = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_predWsBySummingRVs]).as<bool>(); } if (m_env.allOptionsMap().count(m_option_predWsAtKeyPoints)) { m_ov.m_predWsAtKeyPoints = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_predWsAtKeyPoints]).as<bool>(); } return; }
void uqMonteCarloSGOptionsClass::getMyOptionValues(po::options_description& optionsDesc) { if (m_env.allOptionsMap().count(m_option_help)) { if (m_env.subDisplayFile()) { *m_env.subDisplayFile() << optionsDesc << std::endl; } } if (m_env.allOptionsMap().count(m_option_dataOutputFileName)) { m_ov.m_dataOutputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_dataOutputFileName]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_dataOutputAllowedSet)) { m_ov.m_dataOutputAllowedSet.clear(); std::vector<double> tmpAllow(0,0.); std::string inputString = m_env.allOptionsMap()[m_option_dataOutputAllowedSet].as<std::string>(); uqMiscReadDoublesFromString(inputString,tmpAllow); if (tmpAllow.size() > 0) { for (unsigned int i = 0; i < tmpAllow.size(); ++i) { m_ov.m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]); } } } if (m_env.allOptionsMap().count(m_option_pseq_dataOutputPeriod)) { m_ov.m_pseqDataOutputPeriod = ((const po::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputPeriod]).as<unsigned int>(); } if (m_env.allOptionsMap().count(m_option_pseq_dataOutputFileName)) { m_ov.m_pseqDataOutputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputFileName]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_pseq_dataOutputFileType)) { m_ov.m_pseqDataOutputFileType = ((const po::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputFileType]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_pseq_dataOutputAllowedSet)) { m_ov.m_pseqDataOutputAllowedSet.clear(); std::vector<double> tmpAllow(0,0.); std::string inputString = m_env.allOptionsMap()[m_option_pseq_dataOutputAllowedSet].as<std::string>(); uqMiscReadDoublesFromString(inputString,tmpAllow); if (tmpAllow.size() > 0) { for (unsigned int i = 0; i < tmpAllow.size(); ++i) { m_ov.m_pseqDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]); } } } #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS if (m_env.allOptionsMap().count(m_option_pseq_computeStats)) { m_ov.m_pseqComputeStats = ((const po::variable_value&) m_env.allOptionsMap()[m_option_pseq_computeStats]).as<bool>(); } #endif if (m_env.allOptionsMap().count(m_option_qseq_dataInputFileName)) { m_ov.m_qseqDataInputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataInputFileName]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_qseq_dataInputFileType)) { m_ov.m_qseqDataInputFileType = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataInputFileType]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_qseq_size)) { m_ov.m_qseqSize = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_size]).as<unsigned int>(); } if (m_env.allOptionsMap().count(m_option_qseq_displayPeriod)) { m_ov.m_qseqDisplayPeriod = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_displayPeriod]).as<unsigned int>(); } if (m_env.allOptionsMap().count(m_option_qseq_measureRunTimes)) { m_ov.m_qseqMeasureRunTimes = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_measureRunTimes]).as<bool>(); } if (m_env.allOptionsMap().count(m_option_qseq_dataOutputPeriod)) { m_ov.m_qseqDataOutputPeriod = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputPeriod]).as<unsigned int>(); } if (m_env.allOptionsMap().count(m_option_qseq_dataOutputFileName)) { m_ov.m_qseqDataOutputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputFileName]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_qseq_dataOutputFileType)) { m_ov.m_qseqDataOutputFileType = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputFileType]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_qseq_dataOutputAllowedSet)) { m_ov.m_qseqDataOutputAllowedSet.clear(); std::vector<double> tmpAllow(0,0.); std::string inputString = m_env.allOptionsMap()[m_option_qseq_dataOutputAllowedSet].as<std::string>(); uqMiscReadDoublesFromString(inputString,tmpAllow); if (tmpAllow.size() > 0) { for (unsigned int i = 0; i < tmpAllow.size(); ++i) { m_ov.m_qseqDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]); } } } #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS if (m_env.allOptionsMap().count(m_option_qseq_computeStats)) { m_ov.m_qseqComputeStats = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_computeStats]).as<bool>(); } #endif return; }
void uqMLSamplingOptionsClass::getMyOptionValues(po::options_description& optionsDesc) { if (m_env.allOptionsMap().count(m_option_help.c_str())) { if (m_env.subDisplayFile()) { *m_env.subDisplayFile() << optionsDesc << std::endl; } } #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY if (m_env.allOptionsMap().count(m_option_restartOutput_levelPeriod.c_str())) { m_restartOutput_levelPeriod = ((const po::variable_value&) m_env.allOptionsMap()[m_option_restartOutput_levelPeriod.c_str()]).as<unsigned int>(); } if (m_env.allOptionsMap().count(m_option_restartOutput_baseNameForFiles.c_str())) { m_restartOutput_baseNameForFiles = ((const po::variable_value&) m_env.allOptionsMap()[m_option_restartOutput_baseNameForFiles.c_str()]).as<std::string>(); } UQ_FATAL_TEST_MACRO((m_restartOutput_levelPeriod > 0) && (m_restartOutput_baseNameForFiles == "."), m_env.worldRank(), "uqMLSamplingOptionsClass::getMyOptionsValues()", "Option 'restartOutput_levelPeriod' is > 0, but 'restartOutput_baseNameForFiles' is not specified..."); if (m_env.allOptionsMap().count(m_option_restartOutput_fileType.c_str())) { m_restartOutput_fileType = ((const po::variable_value&) m_env.allOptionsMap()[m_option_restartOutput_fileType.c_str()]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_restartInput_baseNameForFiles.c_str())) { m_restartInput_baseNameForFiles = ((const po::variable_value&) m_env.allOptionsMap()[m_option_restartInput_baseNameForFiles.c_str()]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_restartInput_fileType.c_str())) { m_restartInput_fileType = ((const po::variable_value&) m_env.allOptionsMap()[m_option_restartInput_fileType.c_str()]).as<std::string>(); } #else if (m_env.allOptionsMap().count(m_option_restartInputFileName.c_str())) { m_restartInputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_restartInputFileName.c_str()]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_restartInputFileType.c_str())) { m_restartInputFileType = ((const po::variable_value&) m_env.allOptionsMap()[m_option_restartInputFileType.c_str()]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_restartChainSize.c_str())) { m_restartChainSize = ((const po::variable_value&) m_env.allOptionsMap()[m_option_restartChainSize.c_str()]).as<unsigned int>(); } #endif if (m_env.allOptionsMap().count(m_option_dataOutputFileName.c_str())) { m_dataOutputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_dataOutputFileName.c_str()]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_dataOutputAllowedSet.c_str())) { m_dataOutputAllowedSet.clear(); std::vector<double> tmpAllow(0,0.); std::string inputString = m_env.allOptionsMap()[m_option_dataOutputAllowedSet.c_str()].as<std::string>(); uqMiscReadDoublesFromString(inputString,tmpAllow); if (tmpAllow.size() > 0) { for (unsigned int i = 0; i < tmpAllow.size(); ++i) { m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]); } } } return; }
void SimulationModelOptions::getMyOptionValues(po::options_description& optionsDesc) { if (m_env.allOptionsMap().count(m_option_help)) { if (m_env.subDisplayFile()) { *m_env.subDisplayFile() << optionsDesc << std::endl; } } if (m_env.allOptionsMap().count(m_option_dataOutputFileName)) { m_ov.m_dataOutputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_dataOutputFileName]).as<std::string>(); } if (m_env.allOptionsMap().count(m_option_dataOutputAllowAll)) { m_ov.m_dataOutputAllowAll = ((const po::variable_value&) m_env.allOptionsMap()[m_option_dataOutputAllowAll]).as<bool>(); } if (m_ov.m_dataOutputAllowAll) { m_ov.m_dataOutputAllowedSet.insert(m_env.subId()); } else if (m_env.allOptionsMap().count(m_option_dataOutputAllowedSet)) { m_ov.m_dataOutputAllowedSet.clear(); std::vector<double> tmpAllow(0,0.); std::string inputString = m_env.allOptionsMap()[m_option_dataOutputAllowedSet].as<std::string>(); MiscReadDoublesFromString(inputString,tmpAllow); if (tmpAllow.size() > 0) { for (unsigned int i = 0; i < tmpAllow.size(); ++i) { m_ov.m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]); } } } if (m_env.allOptionsMap().count(m_option_p_eta)) { m_ov.m_p_eta = ((const po::variable_value&) m_env.allOptionsMap()[m_option_p_eta]).as<unsigned int>(); } if (m_env.allOptionsMap().count(m_option_zeroRelativeSingularValue)) { m_ov.m_zeroRelativeSingularValue = ((const po::variable_value&) m_env.allOptionsMap()[m_option_zeroRelativeSingularValue]).as<double>(); } if (m_env.allOptionsMap().count(m_option_cdfThresholdForPEta)) { m_ov.m_cdfThresholdForPEta = ((const po::variable_value&) m_env.allOptionsMap()[m_option_cdfThresholdForPEta]).as<double>(); } if (m_env.allOptionsMap().count(m_option_a_w)) { m_ov.m_a_w = ((const po::variable_value&) m_env.allOptionsMap()[m_option_a_w]).as<double>(); } if (m_env.allOptionsMap().count(m_option_b_w)) { m_ov.m_b_w = ((const po::variable_value&) m_env.allOptionsMap()[m_option_b_w]).as<double>(); } if (m_env.allOptionsMap().count(m_option_a_rho_w)) { m_ov.m_a_rho_w = ((const po::variable_value&) m_env.allOptionsMap()[m_option_a_rho_w]).as<double>(); } if (m_env.allOptionsMap().count(m_option_b_rho_w)) { m_ov.m_b_rho_w = ((const po::variable_value&) m_env.allOptionsMap()[m_option_b_rho_w]).as<double>(); } if (m_env.allOptionsMap().count(m_option_a_eta)) { m_ov.m_a_eta = ((const po::variable_value&) m_env.allOptionsMap()[m_option_a_eta]).as<double>(); } if (m_env.allOptionsMap().count(m_option_b_eta)) { m_ov.m_b_eta = ((const po::variable_value&) m_env.allOptionsMap()[m_option_b_eta]).as<double>(); } if (m_env.allOptionsMap().count(m_option_a_s)) { m_ov.m_a_s = ((const po::variable_value&) m_env.allOptionsMap()[m_option_a_s]).as<double>(); } if (m_env.allOptionsMap().count(m_option_b_s)) { m_ov.m_b_s = ((const po::variable_value&) m_env.allOptionsMap()[m_option_b_s]).as<double>(); } return; }