core.cpp
Go to the documentation of this file.
60 gambit_core::gambit_core(const Models::ModelFunctorClaw &claw, const Backends::backend_info &beinfo ) 133 // (http://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/Getopt-Long-Option-Example.html#Getopt-Long-Option-Example) 181 cout << "Tried to run GAMBIT dry-run mode in parallel! This is not allowed, please use only one process when performing dry-runs." << endl; 222 void gambit_core::registerBackend(str be, str version) { backend_versions[be].insert(version); } 244 const gambit_core::fVec& gambit_core::getNestedModuleFunctors() const { return nestedFunctorList; } 250 const gambit_core::pmfVec& gambit_core::getPrimaryModelFunctors() const { return primaryModelFunctorList; } 253 const gambit_core::pmfMap& gambit_core::getActiveModelFunctors() const { return activeModelFunctorList; } 260 // Create a map of all the registered backends that are connected and fully functional (including factories for classloading) 263 for (std::map<str, std::set<str> >::const_iterator it = backend_versions.begin(); it != backend_versions.end(); ++it) 294 // Loop through registered capabilities and try to find their descriptions (potentially from many files, but for now just checking one) 302 // Search through GAMBIT for information about registered capabilities to match to the descriptions 315 if (capinfo.modset.find(origin) == capinfo.modset.end()) capinfo.modset[origin] = std::set<std::pair<str,str> >(); 319 for (fVec::const_iterator jt = backendFunctorList.begin(); jt != backendFunctorList.end(); ++jt) 325 if (capinfo.beset.find(origin) == capinfo.beset.end()) capinfo.beset[origin] = std::set<std::pair<str,str> >(); 340 "must provide the same information. Please rename a capability or delete one of the descriptions."<<endl; 384 for (std::vector<capability_info>::iterator it = capability_dbase.begin(); it != capability_dbase.end(); ++it) 394 outfile << "# Edit \"" << input_capability_descriptions << "\" instead." << endl << endl << out.c_str(); 398 // This is distressingly similar to the capabilities case, but it doesn't seem so straightforward to modularise any further... 400 // Loop through registered models and try to find their descriptions (potentially from many files, but for now just checking one) 408 for (pmfVec::const_iterator it = primaryModelFunctorList.begin(); it != primaryModelFunctorList.end(); ++it) 464 for (std::vector<model_info>::const_iterator it = model_dbase.begin(); it != model_dbase.end(); ++it) 481 for (std::vector<model_info>::const_iterator it = model_dbase.begin(); it != model_dbase.end(); ++it) 490 outfile2 << "# Edit \"" << input_model_descriptions << "\" instead." << endl << endl << out2.c_str(); 501 for (std::vector<capability_info>::const_iterator it = capability_dbase.begin(); it != capability_dbase.end(); ++it) 526 errmsg << "No capability with the name \""<<name<< "\" could be found in the capability database. " 527 "This function should not run when we don't know if the capability exists! Either there is a bug " 545 errmsg << "No model with the name \""<<name<< "\" could be found in the model database. This function " 546 "should not run when we don't know if the model exists! Either there is a bug in the calling code, or " 626 // If we aren't just checking what stuff is registered, we could end up running a scan, or needing the descriptions of things. 627 // Therefore we must construct the description databases and make sure there are no naming conflicts etc. 633 for (auto it = backend_versions.begin(); it != backend_versions.end(); ++it) valid_commands.push_back(it->first); 634 for (auto it = primaryModelFunctorList.begin(); it != primaryModelFunctorList.end(); ++it) valid_commands.push_back((*it)->origin()); 635 std::vector<std::string> scanner_names = Scanner::Plugins::plugin_info().print_plugin_names("scanner"); 636 std::vector<std::string> objective_names = Scanner::Plugins::plugin_info().print_plugin_names("objective"); 643 // If the user hasn't asked for a diagnostic at all, process the command line options for the standard run mode and get out. bool hasKey(const args &... keys) const Getters for key/value pairs (which is all the options node should contain) Definition: yaml_description_database.hpp:103 Exception object declarations. Define overloadings of the stream operator for various containers. std::map< str, std::set< str > > backend_versions Map from backend names to a list of all registered versions of the backend. Definition: core.hpp:57 void ff_capability_diagnostic(str &) Free-form capability diagnostic function. Definition: diagnostics.cpp:426 std::map< str, std::set< std::pair< str, str > > > modset Set of modules and module functions in which capability is used, along with corresponding result type... Definition: yaml_description_database.hpp:45 void registerPrimaryModelFunctor(primary_model_functor &) Add a new primary model functor to primaryModelFunctorList. Definition: core.cpp:225 Special exception used during clean exit from diagnostics. Definition: exceptions.hpp:308 std::vector< capability_info > capability_dbase Vector of all capability_info objects. Definition: core.hpp:217 bool has_description Flag to check if description is missing. Definition: yaml_description_database.hpp:72 Helper struct to carry around model information. Definition: yaml_description_database.hpp:55 Functors specific to primary ModelParameters objects. Definition: functors.hpp:1001 const pmfVec & getPrimaryModelFunctors() const Get a reference to the list of primary model functors. Definition: core.cpp:250 bool has_description Flag to check if description is missing. Definition: yaml_description_database.hpp:51 void registerActiveModelFunctors(const pmfVec &) Add entries to the map of activated primary model functors. Definition: core.cpp:232 void check_databases() Check the named database for conflicts and missing descriptions. Definition: core.cpp:292 str get_parent(const str &) const Retrieve the parent model for a given model. Definition: models.cpp:244 const fVec & getBackendFunctors() const Get a reference to the list of backend model functors. Definition: core.cpp:247 void emit_backlog(bool verbose) Print the backlogs to the default log file. Definition: logmaster.cpp:137 Small wrapper object for parsing and emitting capability/model etc. const fVec & getNestedModuleFunctors() const Get a reference to the list of nested module functors. Definition: core.cpp:244 const fVec & getModuleFunctors() const Get a reference to the list of module functors. Definition: core.cpp:241 std::vector< str > get_all_values(str key) Return vector of descriptions matching key (for retrieving values with non-unique keys) ... Definition: yaml_description_database.cpp:136 void registerNestedModuleFunctor(functor &) Add a new module functor to nestFunctorList. Definition: core.cpp:212 General small utility functions. Models object that performs initialisation and checking operations on a primary_model_functor list... Definition: models.hpp:55 std::map< str, int > check_for_duplicates() Check 'descriptions' for duplicate keys. Definition: yaml_description_database.cpp:115 const capability_info get_capability_info(const str &) const Get the description (and other info) of the named item from the capability database. Definition: core.cpp:513 const pmfMap & getActiveModelFunctors() const Get a reference to the map of all user-activated primary model functors. Definition: core.cpp:253 gambit_core(const Models::ModelFunctorClaw &, const Backends::backend_info &) Constructor. Definition: core.cpp:60 const str input_model_descriptions Filename of the file from which to harvest model descriptions. Definition: core.hpp:83 bool processed_options Flag specifying whether command line options have been processed yet. Definition: core.hpp:89 void ff_prior_diagnostic(str &) Definition: diagnostics.cpp:221 void ff_scanner_diagnostic(str &) Free-form scanner diagnostic function. Definition: diagnostics.cpp:470 const model_info get_model_info(const str &) const Get the description (and other info) of the named item from the model database. Definition: core.cpp:533 const str input_capability_descriptions Filename of the file from which to harvest capability descriptions. Definition: core.hpp:81 std::map< str, std::set< std::pair< str, str > > > beset Set of backends and backend functions in which capability is used, along with corresponding type sign... Definition: yaml_description_database.hpp:47 GAMBIT Core driver class. Logging::LogMaster & logger() Function to retrieve a reference to the Gambit global log object. Definition: logger.cpp:95 str process_primary_options(int, char **) Process default command line options. Definition: core.cpp:125 void test_function_diagnostic() Basic test function diagnostic function. Definition: diagnostics.cpp:207 str capability() const Getter for the wrapped function's reported capability. Definition: functors.cpp:117 fVec nestedFunctorList List of all module functors that are declared as nested (i.e. require loop managers) ... Definition: core.hpp:69 Helper struct to carry around capability information. Definition: yaml_description_database.hpp:40 TYPE getValue(const args &... keys) const Definition: yaml_description_database.hpp:109 A small wrapper object for 'description database' nodes. Definition: yaml_description_database.hpp:83 int show_runorder Flags set by command line options Flag to trigger dependency resolver to report functor run order... Definition: core.hpp:132 void ff_test_function_diagnostic(str &) Free-form test function diagnostic function. Definition: diagnostics.cpp:478 EXPORT_SYMBOLS const str & runtime_scratch() Return the path the the run-specific scratch directory. Definition: util_functions.cpp:58 A simple C++ wrapper for the MPI C bindings. void accountForMissingClasses() const Tell the module functors which backends are actually present. Definition: core.cpp:258 std::vector< str > descendants All children and later descendants. Definition: yaml_description_database.hpp:68 std::vector< str > lineage Parent and all ancestor models. Definition: yaml_description_database.hpp:66 bool missing_capability_description set to true if capability descriptions missing Definition: core.hpp:211 Loader singleton class for scanner plugins. std::vector< str > get_lineage(const str &) const Retrieve the lineage for a given model. Definition: models.cpp:250 EXPORT_SYMBOLS pluginInfo plugin_info Access Functor for plugin info. Definition: plugin_loader.cpp:736 std::vector< str > get_descendants(const str &) const Retrieve the descendants for a given model. Definition: models.cpp:238 Version numbering. void registerModuleFunctor(functor &) Add a new module functor to functorList. Definition: core.cpp:205 pmfMap activeModelFunctorList A map of all user-activated primary model functors. Definition: core.hpp:78 void check_capability_descriptions() Check for missing capability descriptions (after reading in runtime flags) Definition: core.cpp:495 void registerBackendFunctor(functor &) Add a new backend functor to backendFunctorList. Definition: core.cpp:215 EXPORT_SYMBOLS bool are_similar(const str &s1, const str &s2) Check if two strings are a "close" match Used for "did you mean?" type checking during command line a... Definition: util_functions.cpp:314 void ff_backend_diagnostic(str &) Free-form backend diagnostic function. Definition: diagnostics.cpp:292 |