gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-252-gf9a3f78
a Global And Modular Bsm Inference Tool

Master driver class for a GAMBIT scan. More...

#include <core.hpp>

Collaboration diagram for Gambit::gambit_core:

Public Member Functions

 gambit_core (const Models::ModelFunctorClaw &, const Backends::backend_info &)
 Constructor. More...
 
 ~gambit_core ()
 Destructor. More...
 
void bail (int mpirank=-1)
 Command-line info function. More...
 
str process_primary_options (int, char **)
 Process default command line options. More...
 
str run_diagnostic (int, char **)
 Diagnostics function. More...
 
void registerModule (str)
 Add a new module to modules list. More...
 
void registerBackend (str, str)
 Register a new backend. More...
 
void registerModuleFunctor (functor &)
 Add a new module functor to functorList. More...
 
void registerNestedModuleFunctor (functor &)
 Add a new module functor to nestFunctorList. More...
 
void registerBackendFunctor (functor &)
 Add a new backend functor to backendFunctorList. More...
 
void registerPrimaryModelFunctor (primary_model_functor &)
 Add a new primary model functor to primaryModelFunctorList. More...
 
void registerActiveModelFunctors (const pmfVec &)
 Add entries to the map of activated primary model functors. More...
 
const std::map< str, std::set< str > > getBackends () const
 Get a reference to the map of all registered backends. More...
 
const fVecgetModuleFunctors () const
 Get a reference to the list of module functors. More...
 
const fVecgetNestedModuleFunctors () const
 Get a reference to the list of nested module functors. More...
 
const fVecgetBackendFunctors () const
 Get a reference to the list of backend model functors. More...
 
const pmfVecgetPrimaryModelFunctors () const
 Get a reference to the list of primary model functors. More...
 
const pmfMapgetActiveModelFunctors () const
 Get a reference to the map of all user-activated primary model functors. More...
 
void accountForMissingClasses () const
 Tell the module functors which backends are actually present. More...
 
const capability_info get_capability_info (const str &) const
 Get the description (and other info) of the named item from the capability database. More...
 
const model_info get_model_info (const str &) const
 Get the description (and other info) of the named item from the model database. More...
 
int get_outprec () const
 Getter for precision to use for cout. More...
 
void check_databases ()
 Check the named database for conflicts and missing descriptions. More...
 
void check_capability_descriptions ()
 Check for missing capability descriptions (after reading in runtime flags) More...
 

Public Attributes

int show_runorder
 Flags set by command line options Flag to trigger dependency resolver to report functor run order. More...
 
bool resume
 Flag to trigger "resume" mode. More...
 
bool verbose_flag
 Verbosity mode. More...
 
bool found_inifile
 Flag recording whether an inifile has been supplied. More...
 
bool developer_mode
 Developer mode (ignore missing capability descriptions) More...
 
bool missing_capability_description
 set to true if capability descriptions missing More...
 
std::vector< capability_infocapability_dbase
 Vector of all capability_info objects. More...
 
std::vector< model_infomodel_dbase
 Vector of all model_info objects. More...
 

Private Types

typedef std::vector< functor * > fVec
 Internal typedefs to keep things readable. More...
 
typedef std::vector< primary_model_functor * > pmfVec
 
typedef std::map< str, primary_model_functor * > pmfMap
 

Private Member Functions

str backend_status (str, str, bool &)
 Compute the status of a given backend. More...
 
int launch_diagnostic_MPI ()
 Launch MPI and return the rank, for limiting diagnostic output to master node. More...
 
void quit_diagnostic_MPI ()
 Quit MPI used for diagnostic mode. More...
 
void module_diagnostic ()
 Basic diagnostic functions. More...
 
void backend_diagnostic ()
 Basic backend diagnostic function. More...
 
void capability_diagnostic ()
 Basic capability diagnostic function. More...
 
void model_diagnostic ()
 Basic model diagnostic function. More...
 
void scanner_diagnostic ()
 Basic scanner diagnostic function. More...
 
void test_function_diagnostic ()
 Basic test function diagnostic function. More...
 
void prior_diagnostic ()
 
void ff_module_diagnostic (str &)
 Free-form diagnostic functions. More...
 
void ff_backend_diagnostic (str &)
 Free-form backend diagnostic function. More...
 
void ff_capability_diagnostic (str &)
 Free-form capability diagnostic function. More...
 
void ff_model_diagnostic (str &)
 Free-form model diagnostic function. More...
 
void ff_scanner_diagnostic (str &)
 Free-form scanner diagnostic function. More...
 
void ff_test_function_diagnostic (str &)
 Free-form test function diagnostic function. More...
 
void ff_prior_diagnostic (str &)
 

Private Attributes

const Models::ModelFunctorClawmodelInfo
 Internal model claw pointer. More...
 
const Backends::backend_info * backendData
 Internal backend info pointer. More...
 
std::set< strmodules
 Set of all declared modules. More...
 
std::map< str, std::set< str > > backend_versions
 Map from backend names to a list of all registered versions of the backend. More...
 
std::set< strcapabilities
 List of all declared capabilities. More...
 
std::set< strmodels
 List of all declared models. More...
 
fVec functorList
 List of all declared module functors. More...
 
fVec nestedFunctorList
 List of all module functors that are declared as nested (i.e. require loop managers) More...
 
fVec backendFunctorList
 List of all declared backend functors. More...
 
pmfVec primaryModelFunctorList
 List of all declared primary model functors. More...
 
pmfMap activeModelFunctorList
 A map of all user-activated primary model functors. More...
 
const str input_capability_descriptions
 Filename of the file from which to harvest capability descriptions. More...
 
const str input_model_descriptions
 Filename of the file from which to harvest model descriptions. More...
 
const int outprec
 Precision to use for cout. More...
 
bool processed_options
 Flag specifying whether command line options have been processed yet. More...
 

Detailed Description

Master driver class for a GAMBIT scan.

Definition at line 35 of file core.hpp.

Member Typedef Documentation

◆ fVec

typedef std::vector<functor*> Gambit::gambit_core::fVec
private

Internal typedefs to keep things readable.

Definition at line 42 of file core.hpp.

◆ pmfMap

Definition at line 44 of file core.hpp.

◆ pmfVec

typedef std::vector<primary_model_functor*> Gambit::gambit_core::pmfVec
private

Definition at line 43 of file core.hpp.

Constructor & Destructor Documentation

◆ gambit_core()

Gambit::gambit_core::gambit_core ( const Models::ModelFunctorClaw claw,
const Backends::backend_info &  beinfo 
)

Constructor.

Definitions of public methods in GAMBIT core class.

Constructor

Definition at line 60 of file core.cpp.

61  : modelInfo(&claw)
62  , backendData(&beinfo)
63  , input_capability_descriptions(GAMBIT_DIR "/config/capabilities.dat")
64  , input_model_descriptions(GAMBIT_DIR "/config/models.dat")
65  , outprec(8)
66  /* command line flags */
67  , processed_options(false)
68  , show_runorder(false)
69  , resume(true)
70  , verbose_flag(false)
71  , found_inifile(false)
72  , developer_mode(false)
73  {}
bool developer_mode
Developer mode (ignore missing capability descriptions)
Definition: core.hpp:145
bool verbose_flag
Verbosity mode.
Definition: core.hpp:139
const str input_model_descriptions
Filename of the file from which to harvest model descriptions.
Definition: core.hpp:83
bool found_inifile
Flag recording whether an inifile has been supplied.
Definition: core.hpp:142
bool processed_options
Flag specifying whether command line options have been processed yet.
Definition: core.hpp:89
bool resume
Flag to trigger "resume" mode.
Definition: core.hpp:135
const str input_capability_descriptions
Filename of the file from which to harvest capability descriptions.
Definition: core.hpp:81
int show_runorder
Flags set by command line options Flag to trigger dependency resolver to report functor run order...
Definition: core.hpp:132
const Models::ModelFunctorClaw * modelInfo
Internal model claw pointer.
Definition: core.hpp:48
const int outprec
Precision to use for cout.
Definition: core.hpp:86
const Backends::backend_info * backendData
Internal backend info pointer.
Definition: core.hpp:51

◆ ~gambit_core()

Gambit::gambit_core::~gambit_core ( )
inline

Destructor.

Definition at line 128 of file core.hpp.

128 {}

Member Function Documentation

◆ accountForMissingClasses()

void Gambit::gambit_core::accountForMissingClasses ( ) const

Tell the module functors which backends are actually present.

Tell the module functors which backends are actually present, so that they can deactivate themselves if they require a class that is supposed to be provided by a backend that is AWOL.

Definition at line 258 of file core.cpp.

References backend_versions, backendData, and functorList.

Referenced by main().

259  {
260  // Create a map of all the registered backends that are connected and fully functional (including factories for classloading)
261  std::map<str, std::set<str> > working_bes;
262  // Start by looping over all registered backends
263  for (std::map<str, std::set<str> >::const_iterator it = backend_versions.begin(); it != backend_versions.end(); ++it)
264  {
265  // Then loop over all registered versions of this backend
266  for (std::set<str>::const_iterator jt = it->second.begin(); jt != it->second.end(); ++jt)
267  {
268  const str be_ver = it->first+*jt;
269  if (backendData->works.at(be_ver))
270  {
271  if (backendData->classloader.at(be_ver))
272  {
273  if (backendData->classes_OK.at(be_ver)) working_bes[it->first].insert(*jt);
274  }
275  else
276  {
277  working_bes[it->first].insert(*jt);
278  }
279  }
280  }
281  }
282  // Feed the new map to each of the module functors.
283  for (fVec::const_iterator it = functorList.begin(); it != functorList.end(); ++it)
284  {
285  (*it)->notifyOfBackends(working_bes);
286  }
287  }
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
fVec functorList
List of all declared module functors.
Definition: core.hpp:66
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
const Backends::backend_info * backendData
Internal backend info pointer.
Definition: core.hpp:51
Here is the caller graph for this function:

◆ backend_diagnostic()

void Gambit::gambit_core::backend_diagnostic ( )
private

Basic backend diagnostic function.

Definition at line 56 of file diagnostics.cpp.

References backend_status(), backend_versions, backendData, backendFunctorList, Gambit::table_formatter::capitalize_title(), Gambit::table_formatter::default_widths(), Gambit::table_formatter::green(), Gambit::table_formatter::padding(), Gambit::print_to_screen(), Gambit::table_formatter::red(), and Gambit::table_formatter::str().

Referenced by run_diagnostic().

57  {
58  bool all_good = true;
59  table_formatter table("Backends", "Version", "Path to lib", "Status ", " #func ", "#types ", "#ctors");
60  table.padding(1);
61  table.capitalize_title();
62  table.default_widths(18, 7, 70, 13, 3, 3);
63 
64  // Loop over all registered backends
65  for (std::map<str, std::set<str> >::const_iterator it = backend_versions.begin(); it != backend_versions.end(); ++it)
66  {
67  // Loop over all registered versions of this backend
68  for (std::set<str>::const_iterator jt = it->second.begin(); jt != it->second.end(); ++jt)
69  {
70  int nfuncs = 0;
71  int ntypes = 0;
72  int nctors = 0;
73 
74  // Retrieve the status and path info.
75  const str path = backendData->path(it->first,*jt); // Get the path of this backend
76  const str status = backend_status(it->first, *jt, all_good); // Save the status of this backend
77 
78  // Count up the number of functions in this version of the backend, using the registered functors.
79  for (fVec::const_iterator kt = backendFunctorList.begin(); kt != backendFunctorList.end(); ++kt)
80  {
81  if ((*kt)->origin() == it->first and (*kt)->version() == *jt) nfuncs++; // If backend matches, increment the count of the functions in this version
82  }
83 
84  // Do things specific to versions that provide classes
85  if (backendData->classloader.at(it->first+*jt))
86  {
87  std::set<str> classes = backendData->classes.at(it->first+*jt); // Retrieve classes loaded by this version
88  ntypes = classes.size(); // Get the number of classes loaded by this backend
89  for (std::set<str>::const_iterator kt = classes.begin(); kt != classes.end(); ++kt)
90  {
91  nctors += backendData->factory_args.at(it->first+*jt+*kt).size(); // Add the number of factories for this class to the total
92  }
93  }
94 
95  // Print the info
96  std::ostringstream ss1, ss2;
97  str ss1a, ss2a;
98  const str firstentry = (jt == it->second.begin() ? it->first : "");
99  ss1 << nfuncs;
100  ss2 << ntypes;
101  table << firstentry << *jt << path;
102  if (status == "OK")
103  table.green() << status;
104  else
105  table.red() << status;
106  table << " " + ss1.str() << ss2.str() << nctors;
107  }
108  }
109 
110  std::stringstream out;
111  out << "All relative paths are given with reference to " << GAMBIT_DIR << ".";
112  if (all_good) out << endl << endl << "\033[032m" << "All your backend are belong to us." << "\033[0m" << endl;
113  out << endl;
114  out << table.str();
115  if (out.str().size() > 0)
116  print_to_screen(out.str(), "backend");
117  }
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
str backend_status(str, str, bool &)
Compute the status of a given backend.
Definition: core.cpp:553
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
fVec backendFunctorList
List of all declared backend functors.
Definition: core.hpp:72
const Backends::backend_info * backendData
Internal backend info pointer.
Definition: core.hpp:51
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ backend_status()

str Gambit::gambit_core::backend_status ( str  be,
str  version,
bool &  no_failures 
)
private

Compute the status of a given backend.

Definition at line 553 of file core.cpp.

References backendData.

Referenced by backend_diagnostic(), and ff_backend_diagnostic().

554  {
555  const str OK = "OK";
556  const str bad = "absent/broken";
557  const str badclass = "bad types";
558  const str missingMath = "Mathematica absent";
559  str status;
560  if (backendData->works.at(be+version))
561  {
562  if (backendData->classloader.at(be+version))
563  {
564  status = (backendData->classes_OK.at(be+version) ? OK : badclass);
565  }
566  else { status = OK; }
567  }
568  else if (backendData->needsMathematica.at(be+version))
569  {
570  #ifdef HAVE_MATHEMATICA
571  status = bad;
572  #else
573  status = missingMath;
574  #endif
575  }
576  else if (backendData->missingPythonVersion.at(be+version) > 0)
577  {
578  std::ostringstream status_stream;
579  status_stream << "needs Python " << backendData->missingPythonVersion.at(be+version);
580  status = status_stream.str();
581  }
582  else { status = bad; }
583  if (status == bad or status == badclass) no_failures = false;
584  return status;
585  }
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
const Backends::backend_info * backendData
Internal backend info pointer.
Definition: core.hpp:51
Here is the caller graph for this function:

◆ bail()

void Gambit::gambit_core::bail ( int  mpirank = -1)

Command-line info function.

Inform the user of the ways to invoke GAMBIT, then die.

Definition at line 79 of file core.cpp.

References Gambit::Logging::LogMaster::disable(), GET_RANK, and Gambit::logger().

Referenced by process_primary_options(), and run_diagnostic().

80  {
81  if (mpirank < 0) mpirank = GET_RANK;
82  if (mpirank == 0)
83  {
84  cout << "\nusage: gambit [options] [<command>] "
85  "\n "
86  "\nRun scan: "
87  "\n gambit -f <inifile> Start a scan using instructions from inifile "
88  "\n e.g.: gambit -f gambit.yaml "
89  "\n "
90  "\nAvailable commands: "
91  "\n modules List registered modules "
92  "\n backends List registered backends and their status "
93  "\n models List registered models and output model graph "
94  "\n capabilities List all registered function capabilities "
95  "\n scanners List registered scanners "
96  "\n test-functions List registered scanner test objective functions "
97  "\n <name> Give info on a specific module, backend, model, "
98  "\n capability or scanner "
99  "\n e.g.: gambit DarkBit "
100  "\n gambit Pythia "
101  "\n gambit MSSM "
102  "\n gambit IC79WL_loglike "
103  "\n gambit MultiNest "
104  "\n "
105  "\nBasic options: "
106  "\n --version Display GAMBIT version information "
107  "\n --developer Run in developer mode (suppress database errors) "
108  "\n -h/--help Display this usage information "
109  "\n -f <inifile> Start scan using <inifile> "
110  "\n -v/--verbose Turn on verbose mode "
111  "\n -d/--dryrun List the function evaluation order computed based "
112  "\n on inifile "
113  "\n -r/--restart Restart the scan defined by <inifile>. Existing "
114  "\n output files for the run will be overwritten. "
115  "\n Default behaviour in the absence of this option is"
116  "\n to attempt to resume the scan from any existing "
117  "\n output. "
118  "\n" << endl << endl;
119  }
120  logger().disable();
121  throw SilentShutdownException();
122  }
#define GET_RANK
Definition: core.cpp:50
Logging::LogMaster & logger()
Function to retrieve a reference to the Gambit global log object.
Definition: logger.cpp:95
Here is the call graph for this function:
Here is the caller graph for this function:

◆ capability_diagnostic()

void Gambit::gambit_core::capability_diagnostic ( )
private

Basic capability diagnostic function.

Definition at line 150 of file diagnostics.cpp.

References backendFunctorList, capabilities, Gambit::table_formatter::capitalize_title(), Gambit::table_formatter::default_widths(), functorList, Gambit::table_formatter::padding(), Gambit::print_to_screen(), and Gambit::table_formatter::str().

Referenced by run_diagnostic().

151  {
152 
153  // Default, list-format output header
154  table_formatter table("Capabilities", "Available in (modules/models)", "Available in (backends)");
155  table.padding(1);
156  table.capitalize_title();
157  table.default_widths(35, 25);
158  for (std::set<str>::const_iterator it = capabilities.begin(); it != capabilities.end(); ++it)
159  {
160  std::set<str> modset, beset;
161  str mods, bes, description;
162 
163  // Make sets of matching modules and backends
164  for (fVec::const_iterator jt = functorList.begin(); jt != functorList.end(); ++jt)
165  {
166  if ((*jt)->capability() == *it) modset.insert((*jt)->origin());
167  }
168  for (fVec::const_iterator jt = backendFunctorList.begin(); jt != backendFunctorList.end(); ++jt)
169  {
170  if ((*jt)->capability() == *it) beset.insert((*jt)->origin());
171  }
172 
173  // Make strings out of the sets
174  for (std::set<str>::const_iterator jt = modset.begin(); jt != modset.end(); ++jt)
175  {
176  if (jt != modset.begin()) mods += ", ";
177  mods += *jt;
178  }
179  for (std::set<str>::const_iterator jt = beset.begin(); jt != beset.end(); ++jt)
180  {
181  if (jt != beset.begin()) bes += ", ";
182  bes += *jt;
183  }
184 
185  // Identify the primary model parameters with their models.
186  if (mods.length() == 0 and bes.length() == 0) mods = it->substr(0,it->length()-11);
187 
188  // Print the entry in the table (list format)
189  table << *it << mods << bes;
190  }
191  std::stringstream out;
192  out << table.str();
193  if (out.str().size() > 0)
194  print_to_screen(out.str(), "capability");
195  }
fVec functorList
List of all declared module functors.
Definition: core.hpp:66
std::set< str > capabilities
List of all declared capabilities.
Definition: core.hpp:60
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
fVec backendFunctorList
List of all declared backend functors.
Definition: core.hpp:72
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_capability_descriptions()

void Gambit::gambit_core::check_capability_descriptions ( )

Check for missing capability descriptions (after reading in runtime flags)

Definition at line 495 of file core.cpp.

References capability_dbase, input_capability_descriptions, and missing_capability_description.

Referenced by run_diagnostic().

496  {
497 
499  {
500  cout << "Descriptions are missing for the following capabilities:" << endl;
501  for (std::vector<capability_info>::const_iterator it = capability_dbase.begin(); it != capability_dbase.end(); ++it)
502  {
503  if(not it->has_description)
504  {
505  cout << " " << it->name << endl;
506  }
507  }
508  cout << "Please add descriptions of these to "<< input_capability_descriptions << endl;
509  }
510  }
std::vector< capability_info > capability_dbase
Vector of all capability_info objects.
Definition: core.hpp:217
const str input_capability_descriptions
Filename of the file from which to harvest capability descriptions.
Definition: core.hpp:81
bool missing_capability_description
set to true if capability descriptions missing
Definition: core.hpp:211
Here is the caller graph for this function:

◆ check_databases()

void Gambit::gambit_core::check_databases ( )

Check the named database for conflicts and missing descriptions.

Check the capability and model databases for conflicts and missing descriptions.

Definition at line 292 of file core.cpp.

References backendFunctorList, Gambit::capability_info::beset, capabilities, capability_dbase, Gambit::DescriptionDatabase::check_for_duplicates(), Gambit::core_error(), Gambit::model_info::descendants, Gambit::capability_info::description, Gambit::model_info::description, functorList, Gambit::DescriptionDatabase::get_all_values(), Gambit::Models::ModelFunctorClaw::get_descendants(), Gambit::Models::ModelFunctorClaw::get_lineage(), Gambit::Models::ModelFunctorClaw::get_parent(), Gambit::DescriptionDatabase::getValue(), Gambit::capability_info::has_description, Gambit::model_info::has_description, Gambit::DescriptionDatabase::hasKey(), input_capability_descriptions, input_model_descriptions, Gambit::model_info::lineage, LOCAL_INFO, missing_capability_description, model_dbase, modelInfo, Gambit::capability_info::modset, Gambit::capability_info::name, Gambit::model_info::name, Gambit::model_info::nparams, Gambit::model_info::parameters, Gambit::model_info::parent, primaryModelFunctorList, and Gambit::Utils::runtime_scratch().

Referenced by run_diagnostic().

293  {
294  // Loop through registered capabilities and try to find their descriptions (potentially from many files, but for now just checking one)
295  DescriptionDatabase description_file(input_capability_descriptions); // Load descriptions file
296  //std::set<str> parsed_descriptions; // Set of capabilities whose description we have parsed
297  bool missing_flag = false; // Lets us know if any missing descriptions identified
298 
299  // Check for duplicate description keys
300  std::map<str,int> duplicates = description_file.check_for_duplicates();
301 
302  // Search through GAMBIT for information about registered capabilities to match to the descriptions
303  for (std::set<str>::const_iterator it = capabilities.begin(); it != capabilities.end(); ++it)
304  {
305  capability_info capinfo;
306  capinfo.name = *it;
307 
308  // Make sets of matching module and backend functions
309  for (fVec::const_iterator jt = functorList.begin(); jt != functorList.end(); ++jt)
310  {
311  if ((*jt)->capability() == *it)
312  {
313  str origin((*jt)->origin());
314  std::pair<str,str> name_type((*jt)->name(), (*jt)->type());
315  if (capinfo.modset.find(origin) == capinfo.modset.end()) capinfo.modset[origin] = std::set<std::pair<str,str> >();
316  capinfo.modset[origin].insert(name_type);
317  }
318  }
319  for (fVec::const_iterator jt = backendFunctorList.begin(); jt != backendFunctorList.end(); ++jt)
320  {
321  if ((*jt)->capability() == *it)
322  {
323  str origin((*jt)->origin() + " v" + (*jt)->version());
324  std::pair<str,str> name_type((*jt)->name(), (*jt)->type());
325  if (capinfo.beset.find(origin) == capinfo.beset.end()) capinfo.beset[origin] = std::set<std::pair<str,str> >();
326  capinfo.beset[origin].insert(name_type);
327  }
328  }
329 
330  // Check original description files for descriptions matching this capability
331  if( description_file.hasKey(*it) )
332  {
333  // Check whether there are duplicates of this key
334  if ( duplicates[*it] > 0 )
335  {
336  std::vector<str> dups = description_file.get_all_values(*it);
337  std::ostringstream errmsg;
338  errmsg << "Error! Duplicate capability descriptions found for capability \""<<*it<<
339  "\"! Only one description is permitted, since all capabilities going by the same name "
340  "must provide the same information. Please rename a capability or delete one of the descriptions."<<endl;
341  errmsg << "The duplicate descriptions are:" <<endl;
342  errmsg << "---------------------" <<endl;
343  int dup_num = 0;
344  for(std::vector<str>::iterator kt = dups.begin(); kt != dups.end(); ++kt)
345  {
346  errmsg << dup_num << ":" <<endl;
347  errmsg << *kt;
348  errmsg << "----------------------" <<endl;
349  dup_num++;
350  }
351  core_error().raise(LOCAL_INFO,errmsg.str());
352  }
353  else
354  {
355  capinfo.description = description_file.getValue<str>(*it);
356  capinfo.has_description = true;
357  }
358  }
359  else
360  {
361  // Record that this description is missing
362  capinfo.description = "Missing!";
363  capinfo.has_description = false;
364  missing_flag = true;
365  }
366  capability_dbase.push_back(capinfo);
367  }
368 
370 
371  if(missing_flag)
372  {
373  // Warn user of missing descriptions
375  }
376 
377  // Write out the centralised database file containing all this information
378  // (we could also keep this in memory for other functions to use; it's probably not that large)
379  // Should probably sort it by module or something.
380 
381  // Could have built this directly in the other loop, but for now it is separate.
382  YAML::Emitter out;
383  out << YAML::BeginSeq;
384  for (std::vector<capability_info>::iterator it = capability_dbase.begin(); it != capability_dbase.end(); ++it)
385  {
386  //capability_info tmp = *it;
387  out << *it; //custom emitter to do this is in yaml_description_database.hpp
388  }
389  out << YAML::EndSeq;
390  // Create file and write YAML output there
391  std::ofstream outfile;
392  outfile.open(Utils::runtime_scratch()+"central_capabilities.dat");
393  outfile << "# Auto-generated capability description library. Edits will be erased." << endl;;
394  outfile << "# Edit \"" << input_capability_descriptions << "\" instead." << endl << endl << out.c_str();
395 
396 
397  // Now the models
398  // This is distressingly similar to the capabilities case, but it doesn't seem so straightforward to modularise any further...
399 
400  // Loop through registered models and try to find their descriptions (potentially from many files, but for now just checking one)
401  DescriptionDatabase model_description_file(input_model_descriptions); // Load descriptions file
402  missing_flag = false; // reset this flag
403 
404  // Check for duplicate description keys
405  duplicates = description_file.check_for_duplicates();
406 
407  // Search through GAMBIT for information about registered models to match to the descriptions
408  for (pmfVec::const_iterator it = primaryModelFunctorList.begin(); it != primaryModelFunctorList.end(); ++it)
409  {
410  model_info model;
411  model.name = (*it)->origin();
412 
413  // Check original description files for descriptions matching this capability
414  if( model_description_file.hasKey(model.name) )
415  {
416  // Check whether there are duplicates of this key
417  if (duplicates[model.name] > 0)
418  {
419  std::vector<str> dups = model_description_file.get_all_values(model.name);
420  std::ostringstream errmsg;
421  errmsg << "Error! Duplicate model descriptions found for model \""<<model.name<<
422  "\"! Only one description is permitted, since model names must be unique. "
423  "Please rename a model or delete one of the descriptions."<<endl;
424  errmsg << "The duplicate descriptions are:" <<endl;
425  errmsg << "---------------------" <<endl;
426  int dup_num = 0;
427  for(std::vector<str>::iterator kt = dups.begin(); kt != dups.end(); ++kt)
428  {
429  errmsg << dup_num << ":" <<endl;
430  errmsg << *kt;
431  errmsg << "----------------------" <<endl;
432  dup_num++;
433  }
434  core_error().raise(LOCAL_INFO,errmsg.str());
435  }
436  else
437  {
438  model.description = model_description_file.getValue<str>(model.name);
439  model.has_description = true;
440  }
441  }
442  else
443  {
444  // Record that this description is missing
445  model.description = "Missing!";
446  model.has_description = false;
447  missing_flag = true;
448  }
449 
450  // Get the rest of the info
451  model.nparams = (*it)->valuePtr()->getNumberOfPars();
452  model.parameters = (*it)->valuePtr()->getKeys();
453  model.parent = modelInfo->get_parent(model.name);
454  model.lineage = modelInfo->get_lineage(model.name);
455  model.descendants = modelInfo->get_descendants(model.name);
456 
457  model_dbase.push_back(model);
458  }
459 
460  if(missing_flag)
461  {
462  // Warn user of missing descriptions
463  cout << "Descriptions are missing for the following models:" << endl;
464  for (std::vector<model_info>::const_iterator it = model_dbase.begin(); it != model_dbase.end(); ++it)
465  {
466  if(not it->has_description)
467  {
468  cout << " " << it->name << endl;
469  }
470  }
471  cout << "Please add descriptions of these to "<< input_model_descriptions << endl;
472  }
473 
474  // Write out the centralised database file containing all this information
475  // (we could also keep this in memory for other functions to use; it's probably not that large)
476  // Should probably sort it by module or something.
477 
478  // Could have built this directly in the other loop, but for now it is separate.
479  YAML::Emitter out2;
480  out2 << YAML::BeginSeq;
481  for (std::vector<model_info>::const_iterator it = model_dbase.begin(); it != model_dbase.end(); ++it)
482  {
483  out2 << *it; //custom emitter to do this is in yaml_description_database.hpp
484  }
485  out2 << YAML::EndSeq;
486  // Create file and write YAML output there
487  std::ofstream outfile2;
488  outfile2.open(Utils::runtime_scratch()+"central_models.dat");
489  outfile2 << "# Auto-generated model description library. Edits will be erased." << endl;;
490  outfile2 << "# Edit \"" << input_model_descriptions << "\" instead." << endl << endl << out2.c_str();
491 
492  }
std::vector< capability_info > capability_dbase
Vector of all capability_info objects.
Definition: core.hpp:217
#define LOCAL_INFO
Definition: local_info.hpp:34
error & core_error()
Core errors.
str get_parent(const str &) const
Retrieve the parent model for a given model.
Definition: models.cpp:244
fVec functorList
List of all declared module functors.
Definition: core.hpp:66
std::set< str > capabilities
List of all declared capabilities.
Definition: core.hpp:60
const str input_model_descriptions
Filename of the file from which to harvest model descriptions.
Definition: core.hpp:83
pmfVec primaryModelFunctorList
List of all declared primary model functors.
Definition: core.hpp:75
const str input_capability_descriptions
Filename of the file from which to harvest capability descriptions.
Definition: core.hpp:81
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
EXPORT_SYMBOLS const str & runtime_scratch()
Return the path the the run-specific scratch directory.
const Models::ModelFunctorClaw * modelInfo
Internal model claw pointer.
Definition: core.hpp:48
bool missing_capability_description
set to true if capability descriptions missing
Definition: core.hpp:211
std::vector< model_info > model_dbase
Vector of all model_info objects.
Definition: core.hpp:220
std::vector< str > get_lineage(const str &) const
Retrieve the lineage for a given model.
Definition: models.cpp:250
std::vector< str > get_descendants(const str &) const
Retrieve the descendants for a given model.
Definition: models.cpp:238
fVec backendFunctorList
List of all declared backend functors.
Definition: core.hpp:72
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ff_backend_diagnostic()

void Gambit::gambit_core::ff_backend_diagnostic ( str command)
private

Free-form backend diagnostic function.

Definition at line 292 of file diagnostics.cpp.

References backend_status(), backend_versions, backendData, backendFunctorList, Gambit::table_formatter::bottom_line(), Gambit::table_formatter::capitalize_title(), Gambit::table_formatter::default_widths(), combine_hdf5::f, Gambit::table_formatter::green(), Gambit::table_formatter::padding(), Gambit::print_to_screen(), Gambit::table_formatter::red(), Gambit::table_formatter::rows(), Gambit::table_formatter::str(), and Gambit::table_formatter::top_line().

Referenced by run_diagnostic().

293  {
294  std::stringstream out;
295  //Iterate over all backends to see if command matches one of them
296  for (std::map<str, std::set<str> >::const_iterator it = backend_versions.begin(); it != backend_versions.end(); ++it)
297  {
298  if (command == it->first)
299  {
300  const std::set<str> versions = it->second;
301  bool has_classloader = false;
302  out << "Information for backend " << it->first << "." << std::endl << std::endl;
303 
304  // Loop over all registered versions of this backend
305  for (std::set<str>::const_iterator jt = versions.begin(); jt != versions.end(); ++jt)
306  {
307  bool who_cares;
308  const str path = backendData->corrected_path(it->first,*jt); // Save the path of this backend
309  const str status = backend_status(it->first, *jt, who_cares); // Save the status of this backend
310  out << "Version: " << *jt << std::endl;
311  out << "Path to library: " << path << std::endl;
312  out << "Library status: " << status << std::endl;
313  //bool first = true;
314 
315  table_formatter back_table(" Function/Variable", "Capability", "Type", "Status");
316  back_table.capitalize_title();
317  back_table.default_widths(27, 35, 40, 40);
318  back_table.padding(1);
319  back_table.top_line(true);
320  back_table.bottom_line(true);
321  // Loop over all the backend functions and variables
322  for (fVec::const_iterator kt = backendFunctorList.begin(); kt != backendFunctorList.end(); ++kt)
323  {
324  if (((*kt)->origin() == it->first) and ((*kt)->version() == (*jt)))
325  {
326  const str f = (*kt)->name();
327  const str c = (*kt)->capability();
328  const str t = (*kt)->type();
329  const int s = (*kt)->status();
330  back_table << (" " + f) << c << t;
331  if(s == -5) back_table.red() << "Mathematica absent";
332  else if (s == -2) back_table.red() << "Function absent";//ss = "Function absent";
333  else if (s == -1) back_table.red() << "Backend absent";//ss = "Backend absent";
334  else if (s >= 0) back_table.green() << "Available";//ss = "Available";
335  else back_table << "";
336  }
337  }
338  if (back_table.rows() > 0)
339  out << back_table.str();
340  table_formatter class_table(" Class", "Constructor overload", "Status");
341  class_table.capitalize_title();
342  class_table.default_widths(46, 60, 60);
343  class_table.padding(1);
344  class_table.top_line(true);
345  class_table.bottom_line(true);
346  // If this version has classes to offer, print out info on them too
347  if (backendData->classloader.at(it->first+*jt))
348  {
349  std::set<str> classes;
350  if (backendData->classes.find(it->first+*jt) != backendData->classes.end()) classes = backendData->classes.at(it->first+*jt);
351  has_classloader = true;
352  // Loop over the classes
353  for (std::set<str>::const_iterator kt = classes.begin(); kt != classes.end(); ++kt)
354  {
355  const std::set<str> ctors = backendData->factory_args.at(it->first+*jt+*kt);
356  // Loop over the constructors in each class
357  for (std::set<str>::const_iterator lt = ctors.begin(); lt != ctors.end(); ++lt)
358  {
359  str args = *lt;
360  boost::replace_all(args, "my_ns::", "");
361  const str ss = backendData->constructor_status.at(it->first+*jt+*kt+args);
362  const str firstentry = (lt == ctors.begin() ? *kt : "");
363  class_table << (" " + firstentry) << args;
364  if (ss == "OK")
365  class_table.green() << status;
366  else
367  class_table.red() << status;
368  }
369  }
370  }
371  if (class_table.rows() > 0)
372  out << class_table.str();
373  }
374  // Tell the user what the default version is for classes of this backend (if there are any).
375  if (has_classloader)
376  {
377  const std::map<str, str> defs = backendData->default_safe_versions;
378  const str my_def = (defs.find(it->first) != defs.end() ? backendData->version_from_safe_version(it->first,defs.at(it->first)) : "none");
379  out << std::endl << "Default version for loaded classes: " << my_def << std::endl << std::endl;
380  }
381  break;
382  }
383  }
384  if (out.str().size() > 0)
385  print_to_screen(out.str(), command);
386  }
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
str backend_status(str, str, bool &)
Compute the status of a given backend.
Definition: core.cpp:553
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
fVec backendFunctorList
List of all declared backend functors.
Definition: core.hpp:72
const Backends::backend_info * backendData
Internal backend info pointer.
Definition: core.hpp:51
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ff_capability_diagnostic()

void Gambit::gambit_core::ff_capability_diagnostic ( str command)
private

Free-form capability diagnostic function.

Definition at line 426 of file diagnostics.cpp.

References Gambit::capability_info::beset, capabilities, Gambit::capability_info::description, get_capability_info(), Gambit::capability_info::modset, and Gambit::print_to_screen().

Referenced by run_diagnostic().

427  {
428  std::stringstream out;
429  //Iterate over all capabilities to see if command matches one of them
430  for (std::set<str>::const_iterator it = capabilities.begin(); it != capabilities.end(); ++it)
431  {
432  if (command == *it)
433  {
434  out << "Information for capability " << *it << "." << std::endl << std::endl;
435 
436  // Retrieve info on this capability from the database file
437  const capability_info cap = get_capability_info(*it);
438  std::vector< std::pair<str, std::map<str, std::set<std::pair<str,str> > > > > origins;
439  origins.push_back(std::pair<str, std::map<str, std::set<std::pair<str,str> > > >("modules", cap.modset));
440  origins.push_back(std::pair<str, std::map<str, std::set<std::pair<str,str> > > >("backends", cap.beset));
441  // Loop over {modules, backends}
442  for (std::vector< std::pair<str, std::map<str, std::set<std::pair<str,str> > > > >::const_iterator it = origins.begin(); it != origins.end(); ++it)
443  {
444  if (not it->second.empty())
445  {
446  out << " Available in " << it->first << ": " << std::endl;
447  // Loop over modules or backends
448  for (std::map<str, std::set<std::pair<str,str> > >::const_iterator jt = it->second.begin(); jt != it->second.end(); ++jt)
449  {
450  out << " " << jt->first << ": " << std::endl;
451  // Loop over matching module/backend functions
452  for (std::set<std::pair<str,str> >::const_iterator kt = jt->second.begin(); kt != jt->second.end(); ++kt)
453  {
454  // Spit out: function name [function type]
455  out << " function " << kt->first << " [type " << kt->second << "]" << std::endl;
456  }
457  }
458  out << std::endl;
459  }
460  }
461  out << " Description: " << std::endl << cap.description << std::endl;
462  break;
463  }
464  }
465  if (out.str().size() > 0)
466  print_to_screen(out.str(), command);
467  }
std::set< str > capabilities
List of all declared capabilities.
Definition: core.hpp:60
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
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ff_model_diagnostic()

void Gambit::gambit_core::ff_model_diagnostic ( str command)
private

Free-form model diagnostic function.

Definition at line 389 of file diagnostics.cpp.

References Gambit::model_info::descendants, Gambit::model_info::description, get_model_info(), Gambit::model_info::lineage, Gambit::model_info::name, Gambit::model_info::nparams, Gambit::model_info::parameters, Gambit::model_info::parent, primaryModelFunctorList, and Gambit::print_to_screen().

Referenced by run_diagnostic().

390  {
391  std::stringstream out;
392  //Iterate over all models to see if command matches one of them
393  for (pmfVec::const_iterator it = primaryModelFunctorList.begin(); it != primaryModelFunctorList.end(); ++it)
394  {
395  str model = (*it)->origin();
396  if (command == model)
397  {
398  out << "Information for model " << model << "." << endl << endl;;
399 
400  // Retrieve info on this capability from the database file
401  model_info mod = get_model_info(model);
402 
403  // Need copies of lineage and descendant vectors with self-reference removed
404  std::vector<str> lin_X = mod.lineage;
405  std::vector<str> des_X = mod.descendants;
406 
407  // Erase element matching name
408  lin_X.erase(std::remove(lin_X.begin(), lin_X.end(), mod.name), lin_X.end());
409  des_X.erase(std::remove(des_X.begin(), des_X.end(), mod.name), des_X.end());
410 
411  out << " Parent Model: " << mod.parent << std::endl;
412  out << " Number of parameters: " << mod.nparams << std::endl;
413  out << " Parameter names:" << mod.parameters << std::endl;
414  out << " 'Ancestor' models:" << lin_X << std::endl;
415  out << " 'Descendant' models:" << des_X << std::endl;
416  out << " Description: " << endl << mod.description << std::endl;
417 
418  break;
419  }
420  }
421  if (out.str().size() > 0)
422  print_to_screen(out.str(), command);
423  }
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
pmfVec primaryModelFunctorList
List of all declared primary model functors.
Definition: core.hpp:75
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ff_module_diagnostic()

void Gambit::gambit_core::ff_module_diagnostic ( str command)
private

Free-form diagnostic functions.

Free-form module diagnostic function.

Definition at line 232 of file diagnostics.cpp.

References Gambit::table_formatter::capitalize_title(), Gambit::table_formatter::default_widths(), combine_hdf5::f, functorList, modules, Gambit::table_formatter::new_titles(), Gambit::table_formatter::newline(), Gambit::table_formatter::no_newline(), Gambit::table_formatter::padding(), Gambit::print_to_screen(), Gambit::table_formatter::row_pos(), and Gambit::table_formatter::str().

Referenced by run_diagnostic().

233  {
234  std::stringstream out; //added this! not 'cout' but 'out'
235  for (std::set<str>::const_iterator it = modules.begin(); it != modules.end(); ++it)
236  {
237  if (command == *it)
238  {
239  out << "Information for module " << *it << "." << std::endl << std::endl;
240  table_formatter table("", "", "", "LOOP MANAGER:", "DEPENDENCIES / BACKEND REQUIREMENTS");
241  table.new_titles("Function", "Capability", "Result Type", " IS NEEDS", "[type] {type}");
242  table.padding(1);
243  table.capitalize_title();
244  table.default_widths(30, 35, 35, 19, 27);
245 
246  for (fVec::const_iterator jt = functorList.begin(); jt != functorList.end(); ++jt)
247  {
248  if ((*jt)->origin() == *it) // Module matches
249  {
250  str f = (*jt)->name();
251  str c = (*jt)->capability();
252  str t = (*jt)->type();
253  str islm = (*jt)->canBeLoopManager() ? "Yes" : "No ";
254  str nlm = (*jt)->loopManagerCapability();
255  std::set<sspair> deps = (*jt)->dependencies();
256  std::set<sspair> reqs = (*jt)->backendreqs();
257  table.no_newline() << f << c << t << (" " + islm + " " + nlm);
258 
259  if (not deps.empty())
260  {
261  for (std::set<sspair>::const_iterator kt = deps.begin(); kt != deps.end(); ++kt)
262  {
263  if (kt != deps.begin())
264  table.no_newline() << "" << "" << "" << "" << kt->first + " [" + kt->second + "]";
265  else
266  table << kt->first + " [" + kt->second + "]";
267  }
268  }
269  if (not reqs.empty())
270  {
271  for (std::set<sspair>::const_iterator kt = reqs.begin(); kt != reqs.end(); ++kt)
272  {
273  if (kt != reqs.begin() or not deps.empty())
274  table.no_newline() << "" << "" << "" << "" << kt->first + " {" + kt->second + "}";
275  else
276  table << kt->first + " {" + kt->second + "}";
277  }
278  }
279  if (reqs.empty() and deps.empty()) table << "";
280  table.newline(table.row_pos()-1);
281  }
282  }
283  out << table.str();
284  break;
285  }
286  }
287  if (out.str().size() > 0)
288  print_to_screen(out.str(), command);
289  }
fVec functorList
List of all declared module functors.
Definition: core.hpp:66
std::set< str > modules
Set of all declared modules.
Definition: core.hpp:54
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ff_prior_diagnostic()

void Gambit::gambit_core::ff_prior_diagnostic ( str command)
private

Definition at line 221 of file diagnostics.cpp.

References Gambit::Scanner::Plugins::plugin_info, and Gambit::print_to_screen().

Referenced by run_diagnostic().

222  {
223  if (command != "priors")
224  {
225  std::string output = Scanner::Plugins::plugin_info().print_priors(command);
226  if (output.length() > 0)
227  print_to_screen(output, command);
228  }
229  }
EXPORT_SYMBOLS pluginInfo plugin_info
Access Functor for plugin info.
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ff_scanner_diagnostic()

void Gambit::gambit_core::ff_scanner_diagnostic ( str command)
private

Free-form scanner diagnostic function.

Definition at line 470 of file diagnostics.cpp.

References Gambit::Scanner::Plugins::plugin_info, and Gambit::print_to_screen().

Referenced by run_diagnostic().

471  {
472  std::string output = Scanner::Plugins::plugin_info().print_plugin("scanner", command);
473  if (output.length() > 0)
474  print_to_screen(output, command);
475  }
EXPORT_SYMBOLS pluginInfo plugin_info
Access Functor for plugin info.
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ff_test_function_diagnostic()

void Gambit::gambit_core::ff_test_function_diagnostic ( str command)
private

Free-form test function diagnostic function.

Definition at line 478 of file diagnostics.cpp.

References Gambit::Scanner::Plugins::plugin_info, and Gambit::print_to_screen().

Referenced by run_diagnostic().

479  {
480  std::string output = Scanner::Plugins::plugin_info().print_plugin("objective", command);
481  if (output.length() > 0)
482  print_to_screen(output, command);
483  }
EXPORT_SYMBOLS pluginInfo plugin_info
Access Functor for plugin info.
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_capability_info()

const capability_info Gambit::gambit_core::get_capability_info ( const str name) const

Get the description (and other info) of the named item from the capability database.

Get the description of the named capability from the description database.

Definition at line 513 of file core.cpp.

References capability_dbase, Gambit::core_error(), and LOCAL_INFO.

Referenced by ff_capability_diagnostic().

514  {
515 
516  for(std::vector<capability_info>::const_iterator it=capability_dbase.begin();
517  it!=capability_dbase.end();++it)
518  {
519  if(it->name==name)
520  {
521  return *it; //Should only be one match possible after database check
522  }
523  }
524  // if no match...
525  std::ostringstream errmsg;
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 "
528  "in the calling code, or something went wrong creating the capability database.";
529  core_error().raise(LOCAL_INFO,errmsg.str());
530  return capability_info();
531  }
std::vector< capability_info > capability_dbase
Vector of all capability_info objects.
Definition: core.hpp:217
#define LOCAL_INFO
Definition: local_info.hpp:34
error & core_error()
Core errors.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_model_info()

const model_info Gambit::gambit_core::get_model_info ( const str name) const

Get the description (and other info) of the named item from the model database.

Definition at line 533 of file core.cpp.

References Gambit::core_error(), LOCAL_INFO, and model_dbase.

Referenced by ff_model_diagnostic().

534  {
535  for(std::vector<model_info>::const_iterator it=model_dbase.begin();
536  it!=model_dbase.end();++it)
537  {
538  if(it->name==name)
539  {
540  return *it; //Should only be one match possible after database check
541  }
542  }
543  // if no match...
544  std::ostringstream errmsg;
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 "
547  "something went wrong creating the model database.";
548  core_error().raise(LOCAL_INFO,errmsg.str());
549  return model_info();
550  }
#define LOCAL_INFO
Definition: local_info.hpp:34
error & core_error()
Core errors.
std::vector< model_info > model_dbase
Vector of all model_info objects.
Definition: core.hpp:220
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_outprec()

int Gambit::gambit_core::get_outprec ( ) const

Getter for precision to use for cout.

Definition at line 76 of file core.cpp.

References outprec.

Referenced by Gambit::DRes::DependencyResolver::calcObsLike().

76 { return outprec; }
const int outprec
Precision to use for cout.
Definition: core.hpp:86
Here is the caller graph for this function:

◆ getActiveModelFunctors()

const gambit_core::pmfMap & Gambit::gambit_core::getActiveModelFunctors ( ) const

Get a reference to the map of all user-activated primary model functors.

Definition at line 253 of file core.cpp.

References activeModelFunctorList.

Referenced by Gambit::Likelihood_Container_Factory::Likelihood_Container_Factory().

253 { return activeModelFunctorList; }
pmfMap activeModelFunctorList
A map of all user-activated primary model functors.
Definition: core.hpp:78
Here is the caller graph for this function:

◆ getBackendFunctors()

const gambit_core::fVec & Gambit::gambit_core::getBackendFunctors ( ) const

Get a reference to the list of backend model functors.

Get a reference to the list of backend functors.

Definition at line 247 of file core.cpp.

References backendFunctorList.

Referenced by main(), Gambit::DRes::DependencyResolver::makeFunctorsModelCompatible(), Gambit::DRes::DependencyResolver::printFunctorList(), and Gambit::DRes::DependencyResolver::solveRequirement().

247 { return backendFunctorList; }
fVec backendFunctorList
List of all declared backend functors.
Definition: core.hpp:72
Here is the caller graph for this function:

◆ getBackends()

const std::map<str, std::set<str> > Gambit::gambit_core::getBackends ( ) const

Get a reference to the map of all registered backends.

◆ getModuleFunctors()

const gambit_core::fVec & Gambit::gambit_core::getModuleFunctors ( ) const

Get a reference to the list of module functors.

Definition at line 241 of file core.cpp.

References functorList.

Referenced by Gambit::DRes::DependencyResolver::addFunctors(), and main().

241 { return functorList; }
fVec functorList
List of all declared module functors.
Definition: core.hpp:66
Here is the caller graph for this function:

◆ getNestedModuleFunctors()

const gambit_core::fVec & Gambit::gambit_core::getNestedModuleFunctors ( ) const

Get a reference to the list of nested module functors.

Definition at line 244 of file core.cpp.

References nestedFunctorList.

244 { return nestedFunctorList; }
fVec nestedFunctorList
List of all module functors that are declared as nested (i.e. require loop managers) ...
Definition: core.hpp:69

◆ getPrimaryModelFunctors()

const gambit_core::pmfVec & Gambit::gambit_core::getPrimaryModelFunctors ( ) const

Get a reference to the list of primary model functors.

Definition at line 250 of file core.cpp.

References primaryModelFunctorList.

Referenced by Gambit::DRes::DependencyResolver::addFunctors().

250 { return primaryModelFunctorList; }
pmfVec primaryModelFunctorList
List of all declared primary model functors.
Definition: core.hpp:75
Here is the caller graph for this function:

◆ launch_diagnostic_MPI()

int Gambit::gambit_core::launch_diagnostic_MPI ( )
private

Launch MPI and return the rank, for limiting diagnostic output to master node.

◆ model_diagnostic()

void Gambit::gambit_core::model_diagnostic ( )
private

Basic model diagnostic function.

Definition at line 120 of file diagnostics.cpp.

References Gambit::table_formatter::capitalize_title(), Gambit::table_formatter::default_widths(), Gambit::Models::ModelFunctorClaw::get_parent(), modelInfo, Gambit::table_formatter::padding(), primaryModelFunctorList, Gambit::print_to_screen(), Gambit::Utils::runtime_scratch(), and Gambit::table_formatter::str().

Referenced by run_diagnostic().

121  {
122  std::stringstream out;
123  table_formatter table("Model", "Parent", "Parameters");
124  table.default_widths(35);
125  table.padding(1);
126  table.capitalize_title();
127  for (pmfVec::const_iterator it = primaryModelFunctorList.begin(); it != primaryModelFunctorList.end(); ++it)
128  {
129  str model = (*it)->origin();
130  str parentof = modelInfo->get_parent(model);
131  int nparams = (*it)->valuePtr()->getNumberOfPars();
132  table << model << parentof << nparams;
133  }
134  #ifdef HAVE_GRAPHVIZ
135  // Create and spit out graph of the model hierarchy.
136  str graphfile = Utils::runtime_scratch() + "GAMBIT_model_hierarchy.gv";
137  ModelHierarchy modelGraph(*modelInfo,primaryModelFunctorList,graphfile,false);
138  out << endl << "Created graphviz model hierarchy graph in "+graphfile+"." << endl;
139  out << endl << "To get postscript plot of model hierarchy, please run: " << endl;
140  out << GAMBIT_DIR << "/Core/scripts/./graphviz.sh "+graphfile << endl;
141  #else
142  out << endl << "To get postscript plot of model hierarchy, please install graphviz, rerun cmake and remake GAMBIT." << endl;
143  #endif
144  out << table.str();
145  if (out.str().size() > 0)
146  print_to_screen(out.str(), "model");
147  }
str get_parent(const str &) const
Retrieve the parent model for a given model.
Definition: models.cpp:244
pmfVec primaryModelFunctorList
List of all declared primary model functors.
Definition: core.hpp:75
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
EXPORT_SYMBOLS const str & runtime_scratch()
Return the path the the run-specific scratch directory.
const Models::ModelFunctorClaw * modelInfo
Internal model claw pointer.
Definition: core.hpp:48
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ module_diagnostic()

void Gambit::gambit_core::module_diagnostic ( )
private

Basic diagnostic functions.

Basic module diagnostic function.

Definition at line 34 of file diagnostics.cpp.

References Gambit::table_formatter::capitalize_title(), Gambit::table_formatter::default_widths(), functorList, modules, Gambit::table_formatter::padding(), Gambit::print_to_screen(), and Gambit::table_formatter::str().

Referenced by run_diagnostic().

35  {
36  table_formatter table("Modules", "#functions");
37  table.padding(1);
38  table.capitalize_title();
39  table.default_widths(25);
40  for (std::set<str>::const_iterator it = modules.begin(); it != modules.end(); ++it)
41  {
42  int nf = 0;
43  for (fVec::const_iterator jt = functorList.begin(); jt != functorList.end(); ++jt)
44  {
45  if ((*jt)->origin() == *it) nf++;
46  }
47  table << *it << nf;
48  }
49  std::stringstream out;
50  out << table.str();
51  if (out.str().size() > 0)
52  print_to_screen(out.str(), "module");
53  }
fVec functorList
List of all declared module functors.
Definition: core.hpp:66
std::set< str > modules
Set of all declared modules.
Definition: core.hpp:54
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prior_diagnostic()

void Gambit::gambit_core::prior_diagnostic ( )
private

Definition at line 214 of file diagnostics.cpp.

References Gambit::Scanner::Plugins::plugin_info, and Gambit::print_to_screen().

Referenced by run_diagnostic().

215  {
216  std::string output = Scanner::Plugins::plugin_info().print_priors("priors");
217  if (output.length() > 0)
218  print_to_screen(output, "priors");
219  }
EXPORT_SYMBOLS pluginInfo plugin_info
Access Functor for plugin info.
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_primary_options()

str Gambit::gambit_core::process_primary_options ( int  argc,
char **  argv 
)

Process default command line options.

Process default mode command line options and return filename.

Gambit 'standard mode' command line option definitions (needed by getopt)

Definition at line 125 of file core.cpp.

References bail(), developer_mode, Gambit::Logging::LogMaster::disable(), found_inifile, GET_SIZE, combine_hdf5::index, Gambit::logger(), processed_options, resume, show_runorder, and verbose_flag.

Referenced by run_diagnostic().

126  {
127  int index;
128  int iarg=0;
129  str filename;
130 
132  // Basically this is a clone of the example in the getopt_long documentation
133  // (http://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/Getopt-Long-Option-Example.html#Getopt-Long-Option-Example)
134  //
135  // Note that specialised versions of this structure exist for some of the special run modes.
136  const struct option primary_options[] =
137  {
138  {"version", no_argument, 0, 1}, /*1 is just a unique integer key to identify this argument*/
139  {"developer", no_argument, 0, 2},
140  {"verbose", no_argument, 0, 'v'},
141  {"help", no_argument, 0, 'h'},
142  {"dryrun", no_argument, 0, 'd'},
143  {"restart", no_argument, 0, 'r'},
144  {0,0,0,0},
145  };
146 
147  // Must at least have one argument.
148  if (argc < 2) bail();
149 
150  while(iarg != -1)
151  {
152  iarg = getopt_long(argc, argv, "vhdrf:", primary_options, &index);
153  switch (iarg)
154  {
155  case 1:
156  {
157  // Shut down.
158  logger().disable();
159  throw SilentShutdownException();
160  }
161  case 'v':
162  // Turn on verbose mode
163  verbose_flag = true;
164  break;
165  case 2:
166  // Turn on developer mode
167  developer_mode = true;
168  break;
169  case 'h':
170  case '?':
171  // display usage message and quit (also happens on unrecognised options)
172  bail();
173  break;
174  case 'd':
175  // Display proposed functor evaluation order and quit
176  show_runorder = true; // Sorted out in dependency resolver
177  // Should not allow this on multiple processes, just produces
178  // mixed up junk output.
179  if(GET_SIZE>1)
180  {
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;
182  logger().disable();
183  throw SilentShutdownException();
184  }
185  break;
186  case 'r':
187  // Restart scan (turn off "resume" mode, activate output overwrite)
188  resume = false;
189  break;
190  case 'f':
191  // Argument must contain the ini-filename
192  filename = optarg;
193  found_inifile = true;
194  }
195  }
196  // Set flag telling core object that command line option processing is complete
197  processed_options = true;
198  return filename;
199  }
bool developer_mode
Developer mode (ignore missing capability descriptions)
Definition: core.hpp:145
bool verbose_flag
Verbosity mode.
Definition: core.hpp:139
void bail(int mpirank=-1)
Command-line info function.
Definition: core.cpp:79
bool found_inifile
Flag recording whether an inifile has been supplied.
Definition: core.hpp:142
bool processed_options
Flag specifying whether command line options have been processed yet.
Definition: core.hpp:89
bool resume
Flag to trigger "resume" mode.
Definition: core.hpp:135
Logging::LogMaster & logger()
Function to retrieve a reference to the Gambit global log object.
Definition: logger.cpp:95
#define GET_SIZE
Definition: core.cpp:51
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
int show_runorder
Flags set by command line options Flag to trigger dependency resolver to report functor run order...
Definition: core.hpp:132
Here is the call graph for this function:
Here is the caller graph for this function:

◆ quit_diagnostic_MPI()

void Gambit::gambit_core::quit_diagnostic_MPI ( )
private

Quit MPI used for diagnostic mode.

◆ registerActiveModelFunctors()

void Gambit::gambit_core::registerActiveModelFunctors ( const pmfVec fvec)

Add entries to the map of activated primary model functors.

Definition at line 232 of file core.cpp.

References activeModelFunctorList.

Referenced by main().

233  {
234  for (gambit_core::pmfVec::const_iterator it = fvec.begin(); it != fvec.end(); ++it)
235  {
236  activeModelFunctorList[(*it)->origin()] = *it;
237  }
238  }
pmfMap activeModelFunctorList
A map of all user-activated primary model functors.
Definition: core.hpp:78
Here is the caller graph for this function:

◆ registerBackend()

void Gambit::gambit_core::registerBackend ( str  be,
str  version 
)

Register a new backend.

Definition at line 222 of file core.cpp.

References backend_versions.

Referenced by Gambit::register_backend().

222 { backend_versions[be].insert(version); }
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
Here is the caller graph for this function:

◆ registerBackendFunctor()

void Gambit::gambit_core::registerBackendFunctor ( functor f)

Add a new backend functor to backendFunctorList.

Definition at line 215 of file core.cpp.

References backendFunctorList, capabilities, and Gambit::functor::capability().

Referenced by Gambit::register_backend_functor().

216  {
217  backendFunctorList.push_back(&f);
218  capabilities.insert(f.capability());
219  }
std::set< str > capabilities
List of all declared capabilities.
Definition: core.hpp:60
fVec backendFunctorList
List of all declared backend functors.
Definition: core.hpp:72
Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerModule()

void Gambit::gambit_core::registerModule ( str  module)

Add a new module to modules list.

Definition at line 202 of file core.cpp.

References modules.

Referenced by Gambit::register_module().

202 { modules.insert(module); }
std::set< str > modules
Set of all declared modules.
Definition: core.hpp:54
Here is the caller graph for this function:

◆ registerModuleFunctor()

void Gambit::gambit_core::registerModuleFunctor ( functor f)

Add a new module functor to functorList.

Definition at line 205 of file core.cpp.

References capabilities, Gambit::functor::capability(), and functorList.

Referenced by Gambit::register_module_functor_core().

206  {
207  functorList.push_back(&f);
208  capabilities.insert(f.capability());
209  }
fVec functorList
List of all declared module functors.
Definition: core.hpp:66
std::set< str > capabilities
List of all declared capabilities.
Definition: core.hpp:60
Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerNestedModuleFunctor()

void Gambit::gambit_core::registerNestedModuleFunctor ( functor f)

Add a new module functor to nestFunctorList.

Definition at line 212 of file core.cpp.

References nestedFunctorList.

Referenced by Gambit::register_management_req().

212 { nestedFunctorList.push_back(&f); }
fVec nestedFunctorList
List of all module functors that are declared as nested (i.e. require loop managers) ...
Definition: core.hpp:69
Here is the caller graph for this function:

◆ registerPrimaryModelFunctor()

void Gambit::gambit_core::registerPrimaryModelFunctor ( primary_model_functor f)

Add a new primary model functor to primaryModelFunctorList.

Definition at line 225 of file core.cpp.

References capabilities, Gambit::functor::capability(), and primaryModelFunctorList.

Referenced by Gambit::register_model_functor_core().

226  {
227  primaryModelFunctorList.push_back(&f);
228  capabilities.insert(f.capability());
229  }
std::set< str > capabilities
List of all declared capabilities.
Definition: core.hpp:60
pmfVec primaryModelFunctorList
List of all declared primary model functors.
Definition: core.hpp:75
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_diagnostic()

str Gambit::gambit_core::run_diagnostic ( int  argc,
char **  argv 
)

Diagnostics function.

Launch non-interactive command-line diagnostic mode, for printing info about current GAMBIT configuration.

Definition at line 588 of file core.cpp.

References Gambit::Utils::are_similar(), backend_diagnostic(), backend_versions, bail(), capabilities, capability_diagnostic(), check_capability_descriptions(), check_databases(), Gambit::Logging::LogMaster::disable(), Gambit::Logging::LogMaster::emit_backlog(), ff_backend_diagnostic(), ff_capability_diagnostic(), ff_model_diagnostic(), ff_module_diagnostic(), ff_prior_diagnostic(), ff_scanner_diagnostic(), ff_test_function_diagnostic(), found_inifile, GET_RANK, Gambit::logger(), model_diagnostic(), module_diagnostic(), modules, Gambit::Scanner::Plugins::plugin_info, primaryModelFunctorList, prior_diagnostic(), process_primary_options(), processed_options, scanner_diagnostic(), and test_function_diagnostic().

Referenced by main().

589  {
590 
591  str filename;
592  str command = "none";
593  std::vector<std::string> didyoumean;
594 
595  // Parse the arguments, ignoring everything before gambit executable
596  if (argc > 1)
597  {
598  for (int i = 0; i < argc-1; i++)
599  {
600  str arg = argv[i];
601  str x(GAMBIT_EXECUTABLE);
602  int len = arg.length();
603  int xlen = x.length();
604  if (len >= xlen and arg.substr(len-xlen,xlen) == x)
605  {
606  command = argv[i+1];
607  break;
608  }
609  }
610  }
611 
612  // Initial list of valid diagnostic commands
613  std::vector<str> valid_commands = initVector<str>
614  (
615  "modules",
616  "backends",
617  "models",
618  "capabilities",
619  "scanners",
620  "test-functions"
621  );
622 
623  // Test if the user has requested one of the basic diagnostics
624  if (std::find(valid_commands.begin(), valid_commands.end(), command) == valid_commands.end())
625  {
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.
628  check_databases();
629 
630  // Add other valid diagnostic commands
631  valid_commands.insert(valid_commands.end(), modules.begin(), modules.end());
632  valid_commands.insert(valid_commands.end(), capabilities.begin(), capabilities.end());
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");
637  std::vector<std::string> prior_groups = Scanner::Plugins::plugin_info().list_prior_groups();
638  valid_commands.insert(valid_commands.end(), scanner_names.begin(), scanner_names.end());
639  valid_commands.insert(valid_commands.end(), objective_names.begin(), objective_names.end());
640  valid_commands.insert(valid_commands.end(), prior_groups.begin(), prior_groups.end());
641  //valid_commands.push_back("priors");
642 
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.
644  if (std::find(valid_commands.begin(), valid_commands.end(), command) == valid_commands.end())
645  {
646  if (not processed_options)
647  {
648  filename = process_primary_options(argc,argv);
650  // Check if we indeed received a valid filename (needs the -f option)
651  if (found_inifile) return filename;
652  // Ok then, report an unrecognised command and bail
653  int mpirank = GET_RANK;
654  if (mpirank == 0) cout << "Unrecognised command received!" << endl;
655  // Give a list of valid commands that user might have mistyped
656  for (std::vector<str>::iterator it = valid_commands.begin(); it != valid_commands.end(); ++it)
657  {
658  if (Utils::are_similar(command,*it)){ didyoumean.push_back(*it); }
659  }
660  if (didyoumean.size() > 0)
661  {
662  if (mpirank == 0)
663  {
664  cout<<"Did you mean one of the following?"<<endl;
665  for (std::vector<str>::iterator it = didyoumean.begin(); it != didyoumean.end(); ++it)
666  {
667  if(Utils::are_similar(command,*it)){ cout<<" "<<*it<<endl; }
668  }
669  cout<<endl;
670  cout<<"Run \"gambit --help\" for a full list of options and usage instructions"<<endl;
671  }
672  logger().disable();
673  throw SilentShutdownException();
674  }
675  else
676  {
677  bail(mpirank);
678  }
679 
680  }
681  else
682  {
683  int mpirank = GET_RANK;
684  if (mpirank == 0) cout << "Command line options have already been "
685  "processed in a special run mode... GAMBIT should not reach this "
686  "point. Quitting..." << endl;
687  logger().disable();
688  throw SilentShutdownException();
689  }
690  }
691  }
692 
693 
694 
695  // Guaranteed from this point that no scans (nor scanners) will be invoked.
696 
697  // Get MPI rank (assume MPI already initialised)
698  int mpirank = GET_RANK;
699 
700  // Disable all but the master MPI node
701  if (mpirank == 0)
702  {
703  if (command == "modules") module_diagnostic();
704  if (command == "backends") backend_diagnostic();
705  if (command == "models") model_diagnostic();
706  if (command == "capabilities") capability_diagnostic();
707  if (command == "scanners") scanner_diagnostic();
708  if (command == "test-functions") test_function_diagnostic();
709  if (command == "priors") prior_diagnostic();
710  ff_module_diagnostic(command);
711  ff_backend_diagnostic(command);
712  ff_model_diagnostic(command);
713  ff_capability_diagnostic(command);
714  ff_scanner_diagnostic(command);
716  ff_prior_diagnostic(command);
717  cout << endl;
718  }
719 
720  // Silently print the logs to scratch/run_time/<processID>/default.log
721  logger().emit_backlog(false);
722  // Split.
723  logger().disable();
724  throw SilentShutdownException();
725  return "";
726 
727  }
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.
void capability_diagnostic()
Basic capability diagnostic function.
void model_diagnostic()
Basic model diagnostic function.
void check_databases()
Check the named database for conflicts and missing descriptions.
Definition: core.cpp:292
void backend_diagnostic()
Basic backend diagnostic function.
Definition: diagnostics.cpp:56
void emit_backlog(bool verbose)
Print the backlogs to the default log file.
Definition: logmaster.cpp:137
std::set< str > capabilities
List of all declared capabilities.
Definition: core.hpp:60
void bail(int mpirank=-1)
Command-line info function.
Definition: core.cpp:79
bool found_inifile
Flag recording whether an inifile has been supplied.
Definition: core.hpp:142
bool processed_options
Flag specifying whether command line options have been processed yet.
Definition: core.hpp:89
void ff_prior_diagnostic(str &)
#define GET_RANK
Definition: core.cpp:50
std::set< str > modules
Set of all declared modules.
Definition: core.hpp:54
void ff_scanner_diagnostic(str &)
Free-form scanner diagnostic function.
pmfVec primaryModelFunctorList
List of all declared primary model functors.
Definition: core.hpp:75
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
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
void test_function_diagnostic()
Basic test function diagnostic function.
void scanner_diagnostic()
Basic scanner diagnostic function.
void ff_test_function_diagnostic(str &)
Free-form test function diagnostic function.
void module_diagnostic()
Basic diagnostic functions.
Definition: diagnostics.cpp:34
void ff_model_diagnostic(str &)
Free-form model diagnostic function.
EXPORT_SYMBOLS pluginInfo plugin_info
Access Functor for plugin info.
void ff_module_diagnostic(str &)
Free-form diagnostic functions.
void check_capability_descriptions()
Check for missing capability descriptions (after reading in runtime flags)
Definition: core.cpp:495
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...
void ff_backend_diagnostic(str &)
Free-form backend diagnostic function.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ scanner_diagnostic()

void Gambit::gambit_core::scanner_diagnostic ( )
private

Basic scanner diagnostic function.

Definition at line 198 of file diagnostics.cpp.

References Gambit::Scanner::Plugins::plugin_info, and Gambit::print_to_screen().

Referenced by run_diagnostic().

199  {
200  // Import scanner plugin info from ScannerBit
201  std::string output = Scanner::Plugins::plugin_info().print_all("scanner");
202  if (output.length() > 0)
203  print_to_screen(output, "scanners");
204  }
EXPORT_SYMBOLS pluginInfo plugin_info
Access Functor for plugin info.
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_function_diagnostic()

void Gambit::gambit_core::test_function_diagnostic ( )
private

Basic test function diagnostic function.

Definition at line 207 of file diagnostics.cpp.

References Gambit::Scanner::Plugins::plugin_info, and Gambit::print_to_screen().

Referenced by run_diagnostic().

208  {
209  std::string output = Scanner::Plugins::plugin_info().print_all("objective");
210  if (output.length() > 0)
211  print_to_screen(output, "objectives");
212  }
EXPORT_SYMBOLS pluginInfo plugin_info
Access Functor for plugin info.
void print_to_screen(const std::string &file_in, const std::string &name)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ activeModelFunctorList

pmfMap Gambit::gambit_core::activeModelFunctorList
private

A map of all user-activated primary model functors.

Definition at line 78 of file core.hpp.

Referenced by getActiveModelFunctors(), and registerActiveModelFunctors().

◆ backend_versions

std::map<str, std::set<str> > Gambit::gambit_core::backend_versions
private

Map from backend names to a list of all registered versions of the backend.

Definition at line 57 of file core.hpp.

Referenced by accountForMissingClasses(), backend_diagnostic(), ff_backend_diagnostic(), registerBackend(), and run_diagnostic().

◆ backendData

const Backends::backend_info* Gambit::gambit_core::backendData
private

Internal backend info pointer.

Definition at line 51 of file core.hpp.

Referenced by accountForMissingClasses(), backend_diagnostic(), backend_status(), and ff_backend_diagnostic().

◆ backendFunctorList

fVec Gambit::gambit_core::backendFunctorList
private

List of all declared backend functors.

Definition at line 72 of file core.hpp.

Referenced by backend_diagnostic(), capability_diagnostic(), check_databases(), ff_backend_diagnostic(), getBackendFunctors(), and registerBackendFunctor().

◆ capabilities

std::set<str> Gambit::gambit_core::capabilities
private

◆ capability_dbase

std::vector<capability_info> Gambit::gambit_core::capability_dbase

Vector of all capability_info objects.

Definition at line 217 of file core.hpp.

Referenced by check_capability_descriptions(), check_databases(), and get_capability_info().

◆ developer_mode

bool Gambit::gambit_core::developer_mode

Developer mode (ignore missing capability descriptions)

Definition at line 145 of file core.hpp.

Referenced by process_primary_options().

◆ found_inifile

bool Gambit::gambit_core::found_inifile

Flag recording whether an inifile has been supplied.

Definition at line 142 of file core.hpp.

Referenced by process_primary_options(), and run_diagnostic().

◆ functorList

fVec Gambit::gambit_core::functorList
private

◆ input_capability_descriptions

const str Gambit::gambit_core::input_capability_descriptions
private

Filename of the file from which to harvest capability descriptions.

Definition at line 81 of file core.hpp.

Referenced by check_capability_descriptions(), and check_databases().

◆ input_model_descriptions

const str Gambit::gambit_core::input_model_descriptions
private

Filename of the file from which to harvest model descriptions.

Definition at line 83 of file core.hpp.

Referenced by check_databases().

◆ missing_capability_description

bool Gambit::gambit_core::missing_capability_description

set to true if capability descriptions missing

Definition at line 211 of file core.hpp.

Referenced by check_capability_descriptions(), and check_databases().

◆ model_dbase

std::vector<model_info> Gambit::gambit_core::model_dbase

Vector of all model_info objects.

Definition at line 220 of file core.hpp.

Referenced by check_databases(), and get_model_info().

◆ modelInfo

const Models::ModelFunctorClaw* Gambit::gambit_core::modelInfo
private

Internal model claw pointer.

Definition at line 48 of file core.hpp.

Referenced by check_databases(), and model_diagnostic().

◆ models

std::set<str> Gambit::gambit_core::models
private

List of all declared models.

Definition at line 63 of file core.hpp.

◆ modules

std::set<str> Gambit::gambit_core::modules
private

Set of all declared modules.

Definition at line 54 of file core.hpp.

Referenced by ff_module_diagnostic(), module_diagnostic(), registerModule(), and run_diagnostic().

◆ nestedFunctorList

fVec Gambit::gambit_core::nestedFunctorList
private

List of all module functors that are declared as nested (i.e. require loop managers)

Definition at line 69 of file core.hpp.

Referenced by getNestedModuleFunctors(), and registerNestedModuleFunctor().

◆ outprec

const int Gambit::gambit_core::outprec
private

Precision to use for cout.

Definition at line 86 of file core.hpp.

Referenced by get_outprec().

◆ primaryModelFunctorList

pmfVec Gambit::gambit_core::primaryModelFunctorList
private

List of all declared primary model functors.

Definition at line 75 of file core.hpp.

Referenced by check_databases(), ff_model_diagnostic(), getPrimaryModelFunctors(), model_diagnostic(), registerPrimaryModelFunctor(), and run_diagnostic().

◆ processed_options

bool Gambit::gambit_core::processed_options
private

Flag specifying whether command line options have been processed yet.

Definition at line 89 of file core.hpp.

Referenced by process_primary_options(), and run_diagnostic().

◆ resume

bool Gambit::gambit_core::resume

Flag to trigger "resume" mode.

Definition at line 135 of file core.hpp.

Referenced by main(), and process_primary_options().

◆ show_runorder

int Gambit::gambit_core::show_runorder

Flags set by command line options Flag to trigger dependency resolver to report functor run order.

Definition at line 132 of file core.hpp.

Referenced by Gambit::DRes::DependencyResolver::doResolution(), Gambit::DRes::DependencyResolver::generateTree(), and process_primary_options().

◆ verbose_flag

bool Gambit::gambit_core::verbose_flag

Verbosity mode.

Definition at line 139 of file core.hpp.

Referenced by process_primary_options().


The documentation for this class was generated from the following files: