plugin_loader.cpp
Go to the documentation of this file.
52 inline std::string print_plugins(std::map< std::string, std::map<std::string, std::vector<Plugin_Details> > >::const_iterator plugins) 104 bool is_new_plugin(std::map<str, std::map<str, std::vector<Plugin_Details>>>& pmap, Plugin_Details& cand) 107 bool new_plugin_name = new_plugin_type || pmap.at(cand.type).find(cand.plugin) == pmap.at(cand.type).end(); 117 void Plugin_Loader::process(const std::string& libFile, const std::string& plugFile, const std::string& flagFile, std::vector<Plugin_Details>& excluded_plugins) 160 for (auto it2 = it->second["plugins"].begin(), end2 = it->second["plugins"].end(); it2 != end2; ++it2) 188 for (auto it2 = excluded_plugins_temp.begin(), end2 = excluded_plugins_temp.end(); it2 != end2; ++it2) 194 excluded_plugins.insert(excluded_plugins.end(), excluded_plugins_temp.begin(), excluded_plugins_temp.end()); 195 total_plugins.insert(total_plugins.end(), excluded_plugins_temp.begin(), excluded_plugins_temp.end()); 206 if (FILE* f = popen((std::string("nm ") + p_str + std::string(" | grep \"__gambit_plugin_pluginInit_\"")).c_str(), "r")) 322 out << format_for_screen("For information on a specific prior, see its prior group's diagnostic via \"./gambit group_name\"."); 399 for (auto it_map = getPluginsMap().begin(), end = getPluginsMap().end(); it_map!= end; it_map++) 426 std::string Plugin_Loader::print_plugin(const std::string &type, const std::string &plugin) const 430 if((getPluginsMap().find(type) == getPluginsMap().end()) || (getPluginsMap().at(type).find(plugin) == getPluginsMap().at(type).end())) 435 for (auto it = getPluginsMap().at(type).at(plugin).begin(), end = getPluginsMap().at(type).at(plugin).end(); it != end; it++) 453 int Plugin_Loader::print_plugin_to_screen (const std::string &type, const std::string &name) const 478 Plugin_Details &Plugin_Loader::find (const std::string &type, const std::string &plugin, const std::string &version, const std::string &lib) const 482 if((plugin_map.find(type) == plugin_map.end()) || (plugin_map.at(type).find(plugin) == plugin_map.at(type).end())) 484 scan_err << "There is no plugin named \"" << plugin <<"\" of type \"" << type << "\"" << scan_end; 487 for (auto it = plugin_map.at(type).at(plugin).begin(), end = plugin_map.at(type).at(plugin).end(); it != end; it++) 504 scan_err << "More than one plugin met the input criteria in the YAML file:\n\n" << static_cast<Plugin_Details &>(*it2).print() << "\n"; 538 if (it->second.IsMap() && plug_type[plug_type.length()-1] == 's' && plug_type != "priors" && plug_type != "parameters") 584 Plugins::Plugin_Interface_Details pluginInfo::operator()(const std::string &type, const std::string &tag) 586 if (selectedPlugins.find(type) != selectedPlugins.end() && selectedPlugins[type].find(tag) != selectedPlugins[type].end()) 595 plugin_options["likelihood: model_invalid_for_lnlike_below"] = options.getValue<double>("model_invalid_for_lnlike_below"); 600 return Plugin_Interface_Details(plugins.find(type, detail.plugin, detail.version, detail.path), printer, prior, plugin_options); 604 scan_err << "Plugin \"" << tag << "\" of type \"" << type << "\" is not defined under the \"Scanner\"" 607 return Plugin_Interface_Details(plugins.find(type, "", "", ""), printer, prior, options.getOptions(type + "s", tag).getNode()); 615 std::string path = Gambit::Utils::ensure_path_exists(def_out_path + "/temp_files/" + it->first); 660 if (remove(state_fname.c_str())) scan_err << "Failed to delete alternative min_LogL persistence file '" << state_fname << "'! Error was: " << strerror(errno) << scan_end; 699 std::cerr << "Tried to retrieve scanComm MPI communicator (in ScannerBit), but it has not been initialised! Please be sure to call 'initMPIdata' and provide a communicator before allowing any scans to commence." << std::endl; 700 exit(1); //TODO not sure if this should be a standard GAMBIT error or not. Going with 'not' for now. table_formatter & green(int i=-1, int j=-1) Definition: table_formatter.hpp:347 table_formatter & red(int i=-1, int j=-1) Definition: table_formatter.hpp:342 const str buildtime_scratch Return the path to the build-time scratch directory. Definition: util_functions.hpp:70 Plugin_Loader() Definition: plugin_loader.cpp:75 std::string version Definition: plugin_loader.hpp:57 void process(const std::string &, const std::string &, const std::string &, std::vector< Plugin_Details > &) Definition: plugin_loader.cpp:117 void save_alt_min_LogL_state() const Save persistence file to record that the alternative min_LogL value is in use for this scan... Definition: plugin_loader.cpp:646 std::map< std::string, std::map< std::string, std::vector< Plugin_Details > > > excluded_plugin_map Definition: plugin_loader.hpp:84 std::vector< std::string > print_plugin_names(const std::string &="") const Definition: plugin_loader.cpp:239 container info for a specific plugin Definition: plugin_details.hpp:39 std::map< std::string, std::map< std::string, std::vector< Plugin_Details > > > plugin_map Definition: plugin_loader.hpp:82 int print_plugin_to_screen(const std::string &) const Definition: plugin_loader.cpp:443 std::string print_plugin(const std::string &) const Definition: plugin_loader.cpp:394 const std::map< std::string, std::map< std::string, std::vector< Plugin_Details > > > & getPluginsMap() const Definition: plugin_loader.hpp:93 void loadLibrary(const std::string &, const std::string &="") Definition: plugin_loader.cpp:203 std::string plugin Definition: plugin_loader.hpp:56 reg_elem< create_prior_function > prior_creators Definition: priors.hpp:43 Plugin_Details & find(const std::string &, const std::string &, const std::string &, const std::string &) const Definition: plugin_loader.cpp:478 bool Plugin_Version_Supersedes(const Plugin_Details &plug1, const Plugin_Details &plug2) compares the user defined plugin version to the actual plugin version. Definition: plugin_details.cpp:465 Definition: table_formatter.hpp:115 Utility Functions for the Gambit Scanner. std::vector< Plugin_Details > total_plugins Definition: plugin_loader.hpp:85 Plugin info from inifile. Definition: plugin_loader.hpp:54 Plugin info to be given to the interface class. Definition: plugin_loader.hpp:64 General small utility functions. void printer_prior(printer_interface &, Priors::BasePrior &) Definition: plugin_loader.cpp:578 table_formatter & no_newline(int j=-1) Definition: table_formatter.hpp:382 std::string print_priors(const std::string &prior_group="priors") const Definition: plugin_loader.cpp:288 bool is_new_plugin(std::map< str, std::map< str, std::vector< Plugin_Details >>> &pmap, Plugin_Details &cand) Check a plugin map and return a flag indicating if a candidate plugin is already in the map or not... Definition: plugin_loader.cpp:104 #define scan_err Defined to macros to output errors in the form: scan_err << "error" << scan_end; scan_warn << "warnin... Definition: scanner_utils.hpp:54 EXPORT_SYMBOLS bool file_exists(const std::string &filename) Check if a file exists. Definition: util_functions.cpp:241 std::vector< Plugin_Details > loadExcluded(const std::string &) Definition: plugin_loader.cpp:144 std::vector< Plugin_Details > plugins Definition: plugin_loader.hpp:81 Container for all the plugin info from the inifile and Scannerbit. Definition: plugin_loader.hpp:135 void capitalize_title(int i) Definition: table_formatter.hpp:201 static std::string printMultiPlugins(const std::vector< const Plugin_Details *> &) Definition: plugin_details.cpp:318 std::map< std::string, std::map< std::string, std::vector< Plugin_Details > > > total_plugin_map Definition: plugin_loader.hpp:86 Utility Functions for the Gambit Scanner. std::vector< Plugin_Details > excluded_plugins Definition: plugin_loader.hpp:83 std::string print_all(const std::string &plug_type="") const Definition: plugin_loader.cpp:359 EXPORT_SYMBOLS const str & ensure_path_exists(const str &) Ensure that a path exists (and then return the path, for chaining purposes) Definition: util_functions.cpp:227 Utility Functions for the Gambit Scanner. std::string print() const Definition: plugin_details.cpp:196 std::vector< std::string > list_prior_groups() const Definition: plugin_loader.cpp:272 A simple C++ wrapper for the MPI C bindings. std::string path Definition: plugin_loader.hpp:58 std::string print_plugins(std::map< std::string, std::map< std::string, std::vector< Plugin_Details > > >::const_iterator plugins) Definition: plugin_loader.cpp:52 void clear_alt_min_LogL_state() const Delete the persistence file if it exists (e.g. when starting a new run) Definition: plugin_loader.cpp:654 Manager class for creating printer objects. Definition: baseprintermanager.hpp:37 Loader singleton class for scanner plugins. bool check_alt_min_LogL_state() const Check persistence file to see if we should be using the alternative min_LogL value. Definition: plugin_loader.cpp:665 EXPORT_SYMBOLS pluginInfo plugin_info Access Functor for plugin info. Definition: plugin_loader.cpp:706 Advanced comparison utilities for scanner plugins. std::string format_for_screen(const std::string &input_string) Definition: screen_print_utils.cpp:100 virtual void finalise(bool abnormal=false)=0 Signal printer that scan is finished, and final output needs to be performed. int print_all_to_screen(const std::string &plug_type="") const Definition: plugin_loader.cpp:384 void print_to_screen(const std::string &file_in, const std::string &name) Definition: screen_print_utils.cpp:205 |