gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
functors.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
35 
36 
37 #ifndef __functors_hpp__
38 #define __functors_hpp__
39 
40 #include <map>
41 #include <set>
42 #include <vector>
43 #include <chrono>
44 #include <sstream>
45 #include <algorithm>
46 #include <omp.h>
47 
52 #include "gambit/Logs/logger.hpp"
53 #include "gambit/Logs/logmaster.hpp" // Need full declaration of LogMaster class
54 
56 #define FUNCTORS_FADE_RATE 0.01
57 #define FUNCTORS_BASE_INVALIDATION_RATE 0.01
59 #define FUNCTORS_RUNTIME_INIT 0.000001
61 
62 namespace Gambit
63 {
64 
66  namespace Printers { class BasePrinter; }
67 
69  namespace Models { class ModelFunctorClaw; }
70 
72  template <typename TYPE, typename... ARGS>
73  struct variadic_ptr { typedef TYPE(*type)(ARGS..., ...); };
74 
77  namespace FunctorHelp {
78  // void check_for_shutdown_signal(module_functor_common&);
79  // bool emergency_shutdown_begun();
82  }
83 
84  // ======================== Base Functor =====================================
85 
87  class functor
88  {
89 
90  public:
91 
94 
96  virtual ~functor() {}
97 
99  virtual void calculate();
100 
101 
102  // It may be safer to have some of the following things accessible
103  // only to the likelihood wrapper class and/or dependency resolver, i.e. so they cannot be used
104  // from within module functions
105 
109  virtual double getRuntimeAverage();
110  virtual double getInvalidationRate();
111  virtual void setFadeRate(double);
112  virtual void notifyOfInvalidation(const str&);
113  virtual void reset();
115 
117  virtual void reset_and_calculate();
118 
128  void setStatus(int);
130  virtual void setInUse(bool){};
132  void setPurpose(str);
134  void setVertexID(int);
136  void setTimingVertexID(int);
138  str name() const;
140  str capability() const;
142  str type() const;
144  str origin() const;
146  str version() const;
148  virtual str safe_version() const;
157  int status() const;
159  sspair quantity() const;
161  str purpose() const;
163  int vertexID() const;
165  int timingVertexID() const;
167  str label() const;
169  str timingLabel() const;
171  virtual bool requiresPrinting() const;
172 
174  virtual bool requiresTimingPrinting() const;
175 
177  virtual void setPrintRequirement(bool);
178 
180  virtual void setTimingPrintRequirement(bool);
181 
183  virtual void setNestedList (std::vector<functor*>&);
184 
186  virtual void setIteration (long long);
187 
189  virtual bool canBeLoopManager();
190 
192  virtual str loopManagerCapability();
194  virtual str loopManagerType();
196  virtual str loopManagerName();
198  virtual str loopManagerOrigin();
199 
201  virtual void breakLoop();
202 
204  virtual std::set<sspair> dependencies();
206  virtual std::set<str> backendgroups();
208  virtual std::set<sspair> backendreqs();
210  virtual std::set<sspair> backendreqs(str);
212  virtual std::set<sspair> backendspermitted(sspair);
214  virtual std::set<str> backendreq_tags(sspair);
216  virtual std::set<sspair> forcematchingbackend(str);
217 
219  virtual std::set<sspair> backend_conditional_dependencies (str, str, str, str);
220 
222  virtual std::set<sspair> backend_conditional_dependencies (str req, str type, str be);
223 
225  virtual std::set<sspair> backend_conditional_dependencies (functor*);
226 
228  virtual std::set<sspair> model_conditional_dependencies (str);
229 
231  virtual std::set<sspair> model_conditional_backend_reqs (str);
232 
234  virtual void resolveDependency (functor*);
235 
237  virtual void resolveLoopManager (functor*);
238 
240  virtual void resolveBackendReq (functor*);
241 
243  virtual void notifyOfModel(str);
244 
246  virtual void notifyOfDependee(functor*);
247 
249  virtual void notifyOfBackends(std::map<str, std::set<str> >);
250 
251  #ifndef NO_PRINTERS
252  virtual void print(Printers::BasePrinter* printer, const int pointID, int thread_num);
254 
256  virtual void print(Printers::BasePrinter* printer, const int pointID);
257  #endif
258 
260  virtual invalid_point_exception* retrieve_invalid_point_exception();
261 
265  void notifyOfIniOptions(const Options&);
266 
268  template<typename TYPE>
269  void setOption(const str& key, const TYPE val)
270  {
271  myOptions.setValue<str,TYPE>(key, val);
272  }
273 
275  safe_ptr<Options> getOptions();
276 
278  void notifyOfSubCaps(const Options&);
279 
281  template<typename TYPE>
282  void setSubCap(const str& key, const TYPE val)
283  {
284  mySubCaps.setValue<str,TYPE>(key, val);
285  }
286 
288  safe_ptr<Options> getSubCaps();
289 
291  safe_ptr<std::set<sspair>> getDependees();
292 
294  bool allModelsAllowed();
295 
297  bool modelAllowed(str model);
298 
300  bool modelExplicitlyAllowed(str model);
301 
303  void setAllowedModel(str model);
304 
306  bool modelComboAllowed(std::set<str> combo);
307 
309  bool modelComboExplicitlyAllowed(std::set<str> combo);
310 
312  void setModelGroup(str group, str contents);
313 
315  void setAllowedModelGroupCombo(str groups);
316 
317  protected:
318 
333 
335  const str myLabel;
346  int myStatus;
352  bool verbose;
353 
356 
359 
361  std::set<sspair> myDependees;
362 
364  std::set<str> allowedModels;
365 
367  std::set<std::set<str> > allowedGroupCombos;
368 
370  std::map<str, std::set<str> > modelGroups;
371 
373  static void failBigTime(str method);
374 
376  inline bool allowed_parent_or_friend_exists(str model);
377 
379  inline bool in_allowed_combo(str model);
380 
382  inline bool contains_anything_interpretable_as_member_of(std::set<str> combo, str group);
383 
385  inline bool has_common_elements(std::set<str> combo, str group);
386 
388  str find_friend_or_parent_model_in_map(str model, std::map< str, std::set<sspair> > karta);
389 
391  virtual void reset(int);
392 
393  };
394 
395 
396  // ======================== Module Functors =====================================
397 
400  {
401 
402  public:
403 
406 
408  virtual ~module_functor_common();
409 
411  double getRuntimeAverage();
412 
414  void reset();
415 
417  void notifyOfInvalidation(const str&);
418 
420  double getInvalidationRate();
421 
423  void setFadeRate(double);
424 
426  void setTimingPrintRequirement(bool);
427 
429  bool requiresTimingPrinting() const;
430 
432  bool getActiveModelFlag(str);
433 
435  safe_ptr<str> getChosenReqFromGroup(str);
436 
438  virtual void iterate(long long iteration);
439 
441  virtual void init_myCurrentIteration_if_NULL();
443  virtual void setIteration (long long iteration);
445  virtual omp_safe_ptr<long long> iterationPtr();
446 
448  virtual void setCanBeLoopManager (bool canManage);
450  virtual bool canBeLoopManager();
451 
453  virtual void setLoopManagerCapType (str cap, str t);
455  virtual str loopManagerCapability();
457  virtual str loopManagerType();
459  virtual str loopManagerName();
461  virtual str loopManagerOrigin();
462 
464  virtual void breakLoopFromManagedFunctor();
466  virtual safe_ptr<bool> loopIsDone();
468  virtual void resetLoop();
470  virtual void breakLoop();
471 
473  virtual std::set<sspair> dependencies();
475  virtual std::set<str> backendgroups();
477  virtual std::set<sspair> backendreqs();
479  virtual std::set<sspair> backendreqs(str);
481  virtual std::set<sspair> backendspermitted(sspair quant);
483  virtual std::set<str> backendreq_tags(sspair);
485  virtual std::set<sspair> forcematchingbackend(str);
486 
488  virtual std::set<sspair> backend_conditional_dependencies (str req, str type, str be, str ver);
489 
491  virtual std::set<sspair> backend_conditional_dependencies (str req, str type, str be);
492 
494  virtual std::set<sspair> backend_conditional_dependencies (functor* be_functor);
495 
497  virtual std::set<sspair> model_conditional_dependencies (str model);
498 
500  virtual std::set<sspair> model_conditional_backend_reqs (str model);
501 
503  void setDependency(str, str, void(*)(functor*, module_functor_common*), str purpose= "");
504 
506  void setConditionalDependency(str, str);
507 
509  void setBackendConditionalDependency(str, str, str, str, void(*)(functor*, module_functor_common*));
510 
512  void setBackendConditionalDependencySingular(str, str, str, str, void(*)(functor*, module_functor_common*));
513 
515  void setModelConditionalDependency(str, str, void(*)(functor*, module_functor_common*));
516 
518  void setModelConditionalDependencySingular(str, str, void(*)(functor*, module_functor_common*));
519 
521  void makeBackendRuleForModel(str, str);
522 
525  void setBackendReq(str, str, str, str, void(*)(functor*));
526 
528  void setModelConditionalBackendReq(str model, str req, str type);
529 
531  void setModelConditionalBackendReqSingular(str model, str req, str type);
532 
534  void makeBackendOptionRule(str, str);
535 
537  void setPermittedBackend(str req, str be, str ver);
538 
540  void makeBackendMatchingRule(str tag);
541 
543  void setRequiredClassloader(str, str, str);
544 
546  void notifyOfBackends(std::map<str, std::set<str> >);
547 
549  virtual void setNestedList (std::vector<functor*> &newNestedList);
550 
552  virtual void resolveDependency (functor* dep_functor);
553 
555  virtual void resolveLoopManager (functor*);
556 
558  virtual void resolveBackendReq (functor* be_functor);
559 
561  virtual void notifyOfModel(str model);
562 
564  virtual void notifyOfDependee (functor*);
565 
567  virtual invalid_point_exception* retrieve_invalid_point_exception();
568 
569 
570  protected:
571 
573  void reset(int);
574 
576  virtual void acknowledgeInvalidation(invalid_point_exception&, functor* f = NULL);
577 
579  virtual void startTiming(int);
580 
582  virtual void finishTiming(int);
583 
586 
588  virtual void init_memory();
589 
591  void fill_activeModelFlags();
592 
594  sspair retrieve_conditional_dep_type_pair(str);
595 
597  std::chrono::time_point<std::chrono::system_clock> *start, *end;
598 
601 
604 
607 
609  double fadeRate;
610 
613 
616 
619 
622 
625 
628 
631 
638 
640  std::vector<functor*> myNestedFunctorList;
641 
643  long long* myCurrentIteration;
644 
646  const int globlMaxThreads;
647 
649  std::set<str> myGroups;
650 
652  std::map<str,str> chosenReqsFromGroups;
653 
655  std::set<sspair> myBackendReqs;
656 
658  std::set<sspair> myResolvableBackendReqs;
659 
661  std::map<str,std::set<sspair> > myGroupedBackendReqs;
662 
664  std::set<sspair> myDependencies;
665 
667  std::map<str,str> myConditionalDependencies;
668 
670  std::map< std::vector<str>, std::set<sspair> > myBackendConditionalDependencies;
671 
673  std::map< str, std::set<sspair> > myModelConditionalDependencies;
674 
676  std::map< str, std::set<sspair> > myModelConditionalBackendReqs;
677 
679  std::map<str, bool> activeModelFlags;
680 
683  std::map<sspair, void(*)(functor*, module_functor_common*)> dependency_map;
684 
687  std::map<sspair, functor*> dependency_functor_map;
688 
690  std::map<str, str> backendreq_types;
691 
693  std::map<sspair, str> backendreq_groups;
694 
696  std::map<sspair, std::set<str> > backendreq_tagmap;
697 
700  std::map<sspair, void(*)(functor*)> backendreq_map;
701 
703  std::map< sspair, std::set<sspair> > permitted_map;
704 
706  std::map< str, std::set<sspair> > myForcedMatches;
707 
709  std::map< str, std::set<str> > required_classloading_backends;
710 
712  std::vector<str> missing_backends;
713 
715  timespec tp;
716 
718  int myLogTag;
719 
721  void check_missing_LogTag();
722 
727  bool signal_mode_locked = true;
729 
731  // friend void FunctorHelp::check_for_shutdown_signal(module_functor_common&);
732  // friend bool FunctorHelp::emergency_shutdown_begun();
735  // void check_for_shutdown_signal(){ FunctorHelp::check_for_shutdown_signal(*this); }
736  // bool emergency_shutdown_begun(){ return FunctorHelp::emergency_shutdown_begun(); }
739 
740  };
741 
742 
744  template <typename TYPE>
746  {
747 
748  public:
749 
751  module_functor(void(*)(TYPE &), str, str, str, str, Models::ModelFunctorClaw&);
752 
754  virtual ~module_functor();
755 
757  virtual void setPrintRequirement(bool flag);
758 
760  virtual bool requiresPrinting() const;
761 
763  void calculate();
764 
766  const TYPE& operator()(int index);
767 
769  safe_ptr<TYPE> valuePtr();
770 
771  #ifndef NO_PRINTERS
772  virtual void print(Printers::BasePrinter* printer, const int pointID, int index);
774 
776  virtual void print(Printers::BasePrinter* printer, const int pointID);
777  #endif
778 
779 
780  protected:
781 
783  void (*myFunction)(TYPE &);
784 
786  TYPE* myValue;
787 
790 
792  virtual void init_memory();
793 
794  };
795 
796 
798  template <>
800  {
801 
802  public:
803 
806 
808  virtual ~module_functor() {}
809 
811  void calculate();
812 
813  #ifndef NO_PRINTERS
814  virtual void print(Printers::BasePrinter*, const int, int);
816 
818  virtual void print(Printers::BasePrinter*, const int);
819  #endif
820 
821  protected:
822 
824  void (*myFunction)();
825 
826  };
827 
828 
829  // ======================== Backend Functors =====================================
830 
832  template <typename PTR_TYPE, typename TYPE, typename... ARGS>
834  {
835 
836  protected:
837 
839  virtual void setInUse(bool);
840 
842  typedef PTR_TYPE funcPtrType;
843 
845  funcPtrType myFunction;
846 
848  int myLogTag;
849 
852 
854  bool inUse;
855 
856  public:
857 
860 
863 
865  void updatePointer(funcPtrType);
866 
868  funcPtrType handoutFunctionPointer();
869 
871  safe_ptr<bool> inUsePtr();
872 
874  virtual str safe_version() const;
875 
876  };
877 
878 
880  template <typename PTR_TYPE, typename TYPE, typename... ARGS> class backend_functor;
881 
883  template <typename TYPE, typename... ARGS>
884  class backend_functor<TYPE(*)(ARGS...), TYPE, ARGS...> : public backend_functor_common<TYPE(*)(ARGS...), TYPE, ARGS...>
885  {
886 
887  public:
888 
891 
893  virtual ~backend_functor() {}
894 
896  TYPE operator()(ARGS&&... args);
897 
898  };
899 
900 
902  template <typename... ARGS>
903  class backend_functor<void(*)(ARGS...), void, ARGS...> : public backend_functor_common<void(*)(ARGS...), void, ARGS...>
904  {
905 
906  public:
907 
910 
912  virtual ~backend_functor() {}
913 
915  void operator()(ARGS&&... args);
916 
917  };
918 
920  template <typename TYPE, typename... ARGS>
921  class backend_functor<typename variadic_ptr<TYPE,ARGS...>::type, TYPE, ARGS...>
922  : public backend_functor_common<typename variadic_ptr<TYPE,ARGS...>::type, TYPE, ARGS...>
923  {
924 
925  public:
926 
929 
931  virtual ~backend_functor() {}
932 
934  template <typename... VARARGS>
935  TYPE operator()(VARARGS&&... varargs)
936  {
937  logger().entering_backend(this->myLogTag);
938  TYPE tmp = this->myFunction(std::forward<VARARGS>(varargs)...);
940  return tmp;
941  }
942 
943  };
944 
946  template <typename... ARGS>
947  class backend_functor<typename variadic_ptr<void,ARGS...>::type, void, ARGS...>
948  : public backend_functor_common<typename variadic_ptr<void,ARGS...>::type, void, ARGS...>
949  {
950 
951  public:
952 
955 
957  virtual ~backend_functor() {}
958 
960  template <typename... VARARGS>
961  void operator()(VARARGS&&... varargs)
962  {
963  logger().entering_backend(this->myLogTag);
964  this->myFunction(std::forward<VARARGS>(varargs)...);
966  }
967 
968  };
969 
970 
971  // ======================== Model Functors =====================================
972 
974  class model_functor : public module_functor<ModelParameters>
975  {
976 
977  public:
978 
981 
983  virtual ~model_functor() {}
984 
986  void setModelName(str model_name);
987 
989  void addParameter(str parname);
990 
992  void donateParameters(model_functor &receiver);
993 
994  };
995 
996 
1002  {
1003 
1004  public:
1005 
1008 
1011 
1016  ModelParameters* getcontentsPtr();
1017 
1018  };
1019 
1020 }
1021 
1022 #endif /* defined(__functors_hpp__) */
funcPtrType myFunction
Internal storage of function pointer.
Definition: functors.hpp:845
void print(MixMatrix A)
Helper function to print a matrix.
str myVersion
Internal storage of the version of the module or backend to which the function belongs.
Definition: functors.hpp:328
void leaving_multithreaded_region(module_functor_common &functor)
virtual ~model_functor()
Destructor.
Definition: functors.hpp:983
bool iCanManageLoops
Flag indicating whether this function can manage a loop over other functions.
Definition: functors.hpp:624
Options myOptions
Internal storage of function options, as a YAML node.
Definition: functors.hpp:355
std::map< sspair, void(*)(functor *)> backendreq_map
Map from (backend requirement-type pairs) to (pointers to templated void functions that set backend r...
Definition: functors.hpp:700
std::map< str, str > backendreq_types
Map from backend requirements to their required types.
Definition: functors.hpp:690
bool point_exception_raised
A flag indicating whether or not this functor has invalidated the current point.
Definition: functors.hpp:600
std::map< str, std::set< str > > required_classloading_backends
Map from required classloading backends to their versions.
Definition: functors.hpp:709
Backend functor class for functions with result type TYPE and argumentlist ARGS.
Definition: functors.hpp:833
str myCapability
Internal storage of exactly what the function calculates.
Definition: functors.hpp:322
Functors specific to primary ModelParameters objects.
Definition: functors.hpp:1001
const str myTimingLabel
String label, used to label functor timing data for printer system.
Definition: functors.hpp:337
A safe pointer that throws an informative error if you try to dereference it when nullified...
Definition: util_types.hpp:175
str myOrigin
Internal storage of the name of the module or backend to which the function belongs.
Definition: functors.hpp:326
Header for logging classes.
Actual module functor type for all but TYPE=void.
Definition: functors.hpp:745
void setSubCap(const str &key, const TYPE val)
Set a sub-capability (subcap)for the functor directly (for use in standalone executables).
Definition: functors.hpp:282
int myLogTag
Integer LogTag, for tagging log messages.
Definition: functors.hpp:848
Function wrapper (functor) base class.
Definition: functors.hpp:87
General small utility classes, typedefs, etc.
timespec tp
Internal timespec object.
Definition: functors.hpp:715
std::map< str, str > myConditionalDependencies
Map of conditional dependencies to their types.
Definition: functors.hpp:667
bool myLoopIsDone
Flag indicating whether this function is ready to finish its loop (only relevant if iCanManageLoops =...
Definition: functors.hpp:627
bool verbose
Debug flag.
Definition: functors.hpp:352
std::map< str, std::set< sspair > > myForcedMatches
Map from tags to sets of matching (backend requirement-type pairs) that are forced to use the same ba...
Definition: functors.hpp:706
str myPurpose
Purpose of the function (relevant for output and next-to-output functors)
Definition: functors.hpp:330
Logging access header for GAMBIT.
std::set< sspair > myBackendReqs
Set of all backend requirement-type string pairs.
Definition: functors.hpp:655
std::map< sspair, str > backendreq_groups
Map from backend requirements to their designated groups.
Definition: functors.hpp:693
std::vector< functor * > myNestedFunctorList
Vector of functors that have been set up to run nested within this one.
Definition: functors.hpp:640
str mySafeVersion
Internal storage of the &#39;safe&#39; version of the version (for use in namespaces, variable names...
Definition: functors.hpp:851
str myType
Internal storage of the type of what the function calculates.
Definition: functors.hpp:324
virtual ~functor()
Definition: functors.hpp:96
std::map< sspair, std::set< str > > backendreq_tagmap
Map from backend requirements to their rule tags.
Definition: functors.hpp:696
Gambit invalid point exception class.
Definition: exceptions.hpp:229
bool myTimingPrintFlag
Flag to select whether or not the timing data for this function&#39;s execution should be printed;...
Definition: functors.hpp:585
std::map< sspair, void(*)(functor *, module_functor_common *)> dependency_map
Map from (dependency-type pairs) to (pointers to templated void functions that set dependency functor...
Definition: functors.hpp:683
Declarations for the YAML options class.
std::set< sspair > myDependees
List of all capability,type pairs of functors downstream of this one in the dependency tree...
Definition: functors.hpp:361
bool myPrintFlag
Flag to select whether or not the results of this functor should be sent to the printer object...
Definition: functors.hpp:789
TYPE operator()(VARARGS &&... varargs)
Operation (execute function and return value)
Definition: functors.hpp:935
std::map< sspair, functor * > dependency_functor_map
Map from (dependency-type pairs) to pointers to functors used to resolve them that set dependency fun...
Definition: functors.hpp:687
std::map< str, std::set< str > > modelGroups
Map from model group names to group contents.
Definition: functors.hpp:370
std::set< sspair > myResolvableBackendReqs
Set of all backend requirement-type string pairs currently available for resolution.
Definition: functors.hpp:658
std::pair< str, str > sspair
Shorthand for a pair of standard strings.
Definition: util_types.hpp:64
bool * needs_recalculating
Needs recalculating or not?
Definition: functors.hpp:615
Functor derived class for module functions.
Definition: functors.hpp:399
General small utility functions.
Models object that performs initialisation and checking operations on a primary_model_functor list...
Definition: models.hpp:55
void operator()(VARARGS &&... varargs)
Operation (execute function)
Definition: functors.hpp:961
A safe pointer designed to point at an array, and return the entry in that array corresponding to the...
Definition: util_types.hpp:230
double pInvalidation
Probability that functors invalidates point in model parameter space.
Definition: functors.hpp:612
std::map< str, bool > activeModelFlags
Map from known models to flags indicating if they are activated or not (known = allowed, in allowed groups or conditions for conditional dependencies)
Definition: functors.hpp:679
std::string str
Definition: sqlitebase.hpp:52
const str myLabel
String label, used to label functor results for printer system.
Definition: functors.hpp:335
bool * already_printed
Has result already been sent to the printer?
Definition: functors.hpp:618
virtual ~backend_functor_common()
Destructor.
Definition: functors.hpp:862
Functors specific to ModelParameters objects.
Definition: functors.hpp:974
const int method
Definition: Axions.cpp:655
std::set< sspair > myDependencies
Vector of dependency-type string pairs.
Definition: functors.hpp:664
std::map< sspair, std::set< sspair > > permitted_map
Map from (backend requirement-type pairs) to (set of permitted {backend-version} pairs) ...
Definition: functors.hpp:703
long long * myCurrentIteration
Pointer to counters for iterations of nested functor loop.
Definition: functors.hpp:643
EXPORT_SYMBOLS Logging::LogMaster & logger()
Function to retrieve a reference to the Gambit global log object.
Definition: logger.cpp:95
Printers::BaseBasePrinter printer
Type of the printer objects.
hb_ModelParameters void
Actual backend functor type.
Definition: functors.hpp:880
std::vector< str > missing_backends
Vector of required backends currently missing.
Definition: functors.hpp:712
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
std::map< str, std::set< sspair > > myGroupedBackendReqs
Set of backend requirement-type string pairs for specific backend groups.
Definition: functors.hpp:661
void setOption(const str &key, const TYPE val)
Set an option for the functor directly (for use in standalone executables).
Definition: functors.hpp:269
virtual ~primary_model_functor()
Destructor.
Definition: functors.hpp:1010
virtual ~module_functor()
Destructor.
Definition: functors.hpp:808
double fadeRate
Fade rate for average runtime.
Definition: functors.hpp:609
std::map< std::vector< str >, std::set< sspair > > myBackendConditionalDependencies
Map from (vector with 4 strings: backend req, type, backend, version) to (set of {conditional depende...
Definition: functors.hpp:670
functor * myLoopManager
Pointer to the functor that mangages the loop that this function runs inside of.
Definition: functors.hpp:637
Type redefinition to get around icc compiler bugs.
Definition: functors.hpp:73
bool * already_printed_timing
Has timing data already been sent to the printer?
Definition: functors.hpp:621
std::map< str, std::set< sspair > > myModelConditionalBackendReqs
Map from models to (set of {conditional backend requirement-type} pairs)
Definition: functors.hpp:676
str myLoopManagerCapability
Capability of a function that mangages a loop that this function can run inside of.
Definition: functors.hpp:633
std::set< std::set< str > > allowedGroupCombos
List of allowed model group combinations.
Definition: functors.hpp:367
std::chrono::time_point< std::chrono::system_clock > * start
Beginning and end timing points.
Definition: functors.hpp:597
double runtime_average
Averaged runtime in ns.
Definition: functors.hpp:606
virtual void setInUse(bool)
Set the inUse flag (must be overridden in derived class to have any effect).
Definition: functors.hpp:130
bool iRunNested
Flag indicating whether this function can run nested in a loop over functions.
Definition: functors.hpp:630
str myLoopManagerType
Capability of a function that mangages a loop that this function can run inside of.
Definition: functors.hpp:635
str myName
Internal storage of the function name.
Definition: functors.hpp:320
Class for holding model parameters.
std::set< str > myGroups
Internal list of backend groups that this functor&#39;s requirements fall into.
Definition: functors.hpp:649
std::map< str, str > chosenReqsFromGroups
Map from groups to backend reqs, indicating which backend req has been activated for which backend gr...
Definition: functors.hpp:652
invalid_point_exception raised_point_exception
An exception raised because this functor has invalidated the current point.
Definition: functors.hpp:603
int myVertexID
Internal storage of the vertex ID number used by the printer system to identify functors.
Definition: functors.hpp:348
PTR_TYPE funcPtrType
Type of the function pointer being encapsulated.
Definition: functors.hpp:842
int myStatus
Status: -4 = required backend absent (backend ini functions) -3 = required classes absent -2 = functi...
Definition: functors.hpp:346
const int globlMaxThreads
Maximum number of OpenMP threads this MPI process is permitted to launch in total.
Definition: functors.hpp:646
const Models::ModelFunctorClaw * myClaw
Bound model functor claw, for checking relationships between models.
Definition: functors.hpp:332
TODO: see if we can use this one:
Definition: Analysis.hpp:33
void entering_multithreaded_region(module_functor_common &functor)
A small wrapper object for &#39;options&#39; nodes.
int myTimingVertexID
ID assigned by printers to the timing data output stream.
Definition: functors.hpp:350
bool inUse
Flag indicating if this backend functor is actually in use in a given scan.
Definition: functors.hpp:854
int myLogTag
Integer LogTag, for tagging log messages.
Definition: functors.hpp:718
std::set< str > allowedModels
List of allowed models.
Definition: functors.hpp:364
TYPE * myValue
Internal pointer to storage location of function value.
Definition: functors.hpp:786
std::map< str, std::set< sspair > > myModelConditionalDependencies
Map from models to (set of {conditional dependency-type} pairs)
Definition: functors.hpp:673
Options mySubCaps
Internal storage of function sub-capabilities, as a YAML node.
Definition: functors.hpp:358