class Gambit::module_functor_common

Functor derived class for module functions.

#include <functors.hpp>

Inherits from Gambit::functor

Inherited by Gambit::module_functor< ModelParameters >, Gambit::module_functor< TYPE >, Gambit::module_functor< void >

Public Functions

Name
module_functor_common(str func_name, str func_capability, str result_type, str origin_name, Models::ModelFunctorClaw & claw)
Constructor.
virtual~module_functor_common()
Destructor.
virtual doublegetRuntimeAverage()
Getter for averaged runtime.
virtual voidreset()
Reset functor.
virtual voidnotifyOfInvalidation(const str & msg)
Tell the functor that it invalidated the current point in model space, pass a message explaining why, and throw an exception.
virtual doublegetInvalidationRate()
Getter for invalidation rate.
virtual voidsetFadeRate(double new_rate)
Setter for the fade rate.
virtual voidsetTimingPrintRequirement(bool flag)
Setter for indicating if the timing data for this function’s execution should be printed.
virtual boolrequiresTimingPrinting() const
Getter indicating if the timing data for this function’s execution should be printed.
boolgetActiveModelFlag(str model)
Indicate whether or not a known model is activated or not.
safe_ptr< str >getChosenReqFromGroup(str group)
Return a safe pointer to a string indicating which backend requirement has been activated for a given backend group.
virtual voiditerate(long long iteration)
Execute a single iteration in the loop managed by this functor.
virtual voidinit_myCurrentIteration_if_NULL()
Initialise the array holding the current iteration(s) of this functor.
virtual voidsetIteration(long long iteration)
Setter for setting the iteration number in the loop in which this functor runs.
virtual omp_safe_ptr< long long >iterationPtr()
Return a safe pointer to the iteration number in the loop in which this functor runs.
virtual voidsetCanBeLoopManager(bool canManage)
Setter for specifying whether this is permitted to be a manager functor, which runs other functors nested in a loop.
virtual boolcanBeLoopManager()
Getter for revealing whether this is permitted to be a manager functor.
virtual voidsetLoopManagerCapType(str cap, str t)
Setter for specifying the capability required of a manager functor, if it is to run this functor nested in a loop.
virtual boolneedsLoopManager()
Getter for revealing whether this functor needs a loop manager.
virtual strloopManagerCapability()
Getter for revealing the required capability of the wrapped function’s loop manager.
virtual strloopManagerType()
Getter for revealing the required type of the wrapped function’s loop manager.
virtual strloopManagerName()
Getter for revealing the name of the wrapped function’s assigned loop manager.
virtual strloopManagerOrigin()
Getter for revealing the module of the wrapped function’s assigned loop manager.
virtual voidbreakLoopFromManagedFunctor()
Tell the manager of the loop in which this functor runs that it is time to break the loop.
virtual safe_ptr< bool >loopIsDone()
Return a safe pointer to the flag indicating that a loop managed by this functor should break now.
virtual voidresetLoop()
Provide a way to reset the flag indicating that a loop managed by this functor should break.
virtual voidbreakLoop()
Tell the functor that the loop it manages should break now.
virtual std::set< sspair >dependencies()
Getter for listing currently activated dependencies.
virtual std::set< sspair >backendclassloading()
Getter for listing backends that require class loading.
virtual std::set< str >backendgroups()
Getter for listing backend requirement groups.
virtual std::set< sspair >backendreqs()
Getter for listing all backend requirements.
virtual std::set< sspair >backendreqs(str group)
Getter for listing backend requirements from a specific group.
virtual std::set< sspair >backendspermitted(sspair quant)
Getter for listing permitted backends.
virtual std::set< str >backendreq_tags(sspair quant)
Getter for listing tags associated with backend requirements.
virtual std::set< sspair >forcematchingbackend(str tag)
Getter for listing backend requirements that must be resolved from the same backend.
virtual std::set< sspair >backend_conditional_dependencies(str req, str type, str be, str ver)
Getter for listing backend-specific conditional dependencies (4-string version)
virtual std::set< sspair >backend_conditional_dependencies(str req, str type, str be)
Getter for backend-specific conditional dependencies (3-string version)
virtual std::set< sspair >backend_conditional_dependencies(functor * be_functor)
Getter for backend-specific conditional dependencies (backend functor pointer version)
virtual std::set< sspair >model_conditional_dependencies(str model)
Getter for listing model-specific conditional dependencies (matches also on parents and friends)
virtual std::set< sspair >model_conditional_dependencies_exact(str model)
Getter for listing model-specific conditional dependencies (matches on the exact model)
virtual std::set< sspair >model_conditional_backend_reqs(str model)
Getter for listing model-specific conditional backend requirements (matches also on parents and friends)
virtual std::set< sspair >model_conditional_backend_reqs_exact(str model)
Getter for listing model-specific conditional backend requirements (matches on the exact model)
voidsetDependency(str dep, str dep_type, void(*)(functor *, module_functor_common *) resolver, str purpose ="")
Add and activate unconditional dependencies.
voidsetConditionalDependency(str dep, str dep_type)
Add conditional dependency-type pairs in advance of later conditions.
voidsetBackendConditionalDependency(str req, str be, str ver, str dep, void(*)(functor *, module_functor_common *) resolver)
Add a backend conditional dependency for multiple backend versions.
voidsetBackendConditionalDependencySingular(str req, str be, str ver, str dep, void(*)(functor *, module_functor_common *) resolver)
Add a backend conditional dependency for a single backend version.
voidsetModelConditionalDependency(str model, str dep, void(*)(functor *, module_functor_common *) resolver)
Add a model conditional dependency for multiple models.
voidsetModelConditionalDependencySingular(str model, str dep, void(*)(functor *, module_functor_common *) resolver)
Add a model conditional dependency for a single model.
voidmakeBackendRuleForModel(str model, str tag)
Add a rule for activating backend requirements according to the model being scanned.
voidsetBackendReq(str group, str req, str tags, str type, void(*)(functor *) resolver)
voidsetModelConditionalBackendReq(str model, str req, str type)
Add a model conditional backend requirement for multiple models.
voidsetModelConditionalBackendReqSingular(str model, str req, str type)
Add a model conditional backend requirement for a single model.
voidmakeBackendOptionRule(str be_and_ver, str tag)
Add a rule for dictating which backends can be used to fulfill which backend requirements.
voidsetPermittedBackend(str req, str be, str ver)
Add a single permitted backend version.
voidmakeBackendMatchingRule(str tag)
Add one or more rules for forcing backends reqs with the same tags to always be resolved from the same backend.
voidsetRequiredClassloader(str be, str ver, str safe_ver)
Add a rule indicating that classes from a given backend must be available.
virtual voidnotifyOfBackends(std::map< str, std::set< str > > be_ver_map)
Indicate to the functor which backends are actually loaded and working.
virtual voidsetNestedList(std::vector< functor * > & newNestedList)
Set the ordered list of pointers to other functors that should run nested in a loop managed by this one.
virtual voidresolveDependency(functor * dep_functor)
Resolve a dependency using a pointer to another functor object.
virtual voidresolveLoopManager(functor * dep_functor)
Set this functor’s loop manager (if it has one)
virtual voidresolveBackendReq(functor * be_functor)
Resolve a backend requirement using a pointer to another functor object.
virtual voidnotifyOfModel(str model)
Notify the functor that a certain model is being scanned, so that it can activate its dependencies and backend reqs accordingly.
virtual voidnotifyOfDependee(functor * dependent_functor)
Notify the functor that another functor depends on it.
virtual invalid_point_exception *retrieve_invalid_point_exception()
Retrieve the previously saved exception generated when this functor invalidated the current point in model space.

Protected Functions

Name
virtual voidreset(int thread_num)
Reset functor for one thread only.
virtual voidacknowledgeInvalidation(invalid_point_exception & e, functor * f =NULL)
Acknowledge that this functor invalidated the current point in model space.
virtual voidstartTiming(int thread_num)
Do pre-calculate timing things.
virtual voidfinishTiming(int thread_num)
Do post-calculate timing things.
virtual voidinit_memory()
Initialise the memory of this functor.
voidfill_activeModelFlags()
Construct the list of known models only if it doesn’t yet exist.
sspairretrieve_conditional_dep_type_pair(str dep)
Retrieve full conditional dependency-type pair from conditional dependency only.
voidcheck_missing_LogTag()
Check if an appropriate LogTag for this functor is missing from the logging system.
voidentering_multithreaded_region()
voidleaving_multithreaded_region()

Protected Attributes

Name
boolmyTimingPrintFlag
Flag to select whether or not the timing data for this function’s execution should be printed;.
std::chrono::time_point< std::chrono::system_clock > *start
Beginning and end timing points.
std::chrono::time_point< std::chrono::system_clock > *end
boolpoint_exception_raised
A flag indicating whether or not this functor has invalidated the current point.
invalid_point_exceptionraised_point_exception
An exception raised because this functor has invalidated the current point.
doubleruntime_average
Averaged runtime in ns.
doublefadeRate
Fade rate for average runtime.
doublepInvalidation
Probability that functors invalidates point in model parameter space.
bool *needs_recalculating
Needs recalculating or not?
bool *already_printed
Has result already been sent to the printer?
bool *already_printed_timing
Has timing data already been sent to the printer?
booliCanManageLoops
Flag indicating whether this function can manage a loop over other functions.
boolmyLoopIsDone
Flag indicating whether this function is ready to finish its loop (only relevant if iCanManageLoops = true)
booliRunNested
Flag indicating whether this function can run nested in a loop over functions.
strmyLoopManagerCapability
Capability of a function that mangages a loop that this function can run inside of.
strmyLoopManagerType
Capability of a function that mangages a loop that this function can run inside of.
functor *myLoopManager
Pointer to the functor that mangages the loop that this function runs inside of.
std::vector< functor * >myNestedFunctorList
Vector of functors that have been set up to run nested within this one.
long long *myCurrentIteration
Pointer to counters for iterations of nested functor loop.
const intgloblMaxThreads
Maximum number of OpenMP threads this MPI process is permitted to launch in total.
std::set< str >myGroups
Internal list of backend groups that this functor’s requirements fall into.
std::map< str, str >chosenReqsFromGroups
Map from groups to backend reqs, indicating which backend req has been activated for which backend group.
std::set< sspair >myBackendReqs
Set of all backend requirement-type string pairs.
std::set< sspair >myResolvableBackendReqs
Set of all backend requirement-type string pairs currently available for resolution.
std::map< str, std::set< sspair > >myGroupedBackendReqs
Set of backend requirement-type string pairs for specific backend groups.
std::set< sspair >myDependencies
Vector of dependency-type string pairs.
std::map< str, str >myConditionalDependencies
Map of conditional dependencies to their types.
std::map< std::vector< str >, std::set< sspair > >myBackendConditionalDependencies
Map from (vector with 4 strings: backend req, type, backend, version) to (set of {conditional dependency-type} pairs)
std::map< str, std::set< sspair > >myModelConditionalDependencies
Map from models to (set of {conditional dependency-type} pairs)
std::map< str, std::set< sspair > >myModelConditionalBackendReqs
Map from models to (set of {conditional backend requirement-type} pairs)
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)
std::map< sspair, void(*)(functor *, module_functor_common *)>dependency_map
std::map< sspair, functor * >dependency_functor_map
std::map< str, str >backendreq_types
Map from backend requirements to their required types.
std::map< sspair, str >backendreq_groups
Map from backend requirements to their designated groups.
std::map< sspair, std::set< str > >backendreq_tagmap
Map from backend requirements to their rule tags.
std::map< sspair, void(*)(functor *)>backendreq_map
std::map< sspair, std::set< sspair > >permitted_map
Map from (backend requirement-type pairs) to (set of permitted {backend-version} pairs)
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 backend.
std::map< str, std::set< str > >required_classloading_backends
Map from required classloading backends to their versions.
std::vector< str >missing_backends
Vector of required backends currently missing.
timespectp
Internal timespec object.
intmyLogTag
Integer LogTag, for tagging log messages.
boolsignal_mode_locked

Friends

Name
voidFunctorHelp::entering_multithreaded_region(module_functor_common & )
Connectors to external helper functions (to decouple signal handling from this class)
voidFunctorHelp::leaving_multithreaded_region(module_functor_common & )

Additional inherited members

Public Functions inherited from Gambit::functor

Name
functor(str func_name, str func_capability, str result_type, str origin_name, Models::ModelFunctorClaw & claw)
Constructor.
virtual~functor()
Destructor.
virtual voidcalculate()
Virtual calculate(); needs to be redefined in daughters.
virtual voidreset_and_calculate()
Reset-then-recalculate method.
voidsetStatus(FunctorStatus stat)
Setter for status.
virtual voidsetInUse(bool )
Set the inUse flag (must be overridden in derived class to have any effect).
voidsetPurpose(str purpose)
Setter for purpose (relevant only for next-to-output functors)
voidsetVertexID(int ID)
Setter for vertex ID (used in printer system)
voidsetTimingVertexID(int ID)
Set ID for timing ‘vertex’ (used in printer system)
strname() const
Getter for the wrapped function’s name.
strcapability() const
Getter for the wrapped function’s reported capability.
strtype() const
Getter for the wrapped function’s reported return type.
strorigin() const
Getter for the wrapped function’s origin (module or backend name)
virtual strversion() const
Getter for the version of the wrapped function’s origin (module or backend)
virtual strsafe_version() const
Getter for the ‘safe’ incarnation of the version of the wrapped function’s origin (module or backend)
FunctorStatusstatus() const
Getter for the functors current status.
boolisAvailable() const
Checks whether the functor is available (or even already activated)
boolisActive() const
Checks whether the functor is active.
boolisDisabled() const
Checks whether the functor is disabled (discriminant is negative)
boolisEnabled() const
Checks whether the functor is enabled (discriminant is non negative)
sspairquantity() const
Getter for the overall quantity provided by the wrapped function (capability-type pair)
strpurpose() const
Getter for purpose (relevant for output nodes, aka helper structures for the dep. resolution)
strcitationKey() const
Getter for the citation key.
intvertexID() const
Getter for vertex ID.
inttimingVertexID() const
Getter for timing vertex ID.
strlabel() const
Getter for string label.
strtimingLabel() const
Getter for the printer timing label.
virtual boolrequiresPrinting() const
Getter indicating if the wrapped function’s result should to be printed.
virtual voidsetPrintRequirement(bool flag)
Setter for indicating if the wrapped function’s result should to be printed.
virtual voidprint(Printers::BasePrinter * printer, const int pointID, int thread_num)
Printer function.
virtual voidprint(Printers::BasePrinter * printer, const int pointID)
Printer function (no-thread-index short-circuit)
voidnotifyOfIniOptions(const Options & opt)
template <typename TYPE >
void
setOption(const str & key, const TYPE val)
Set an option for the functor directly (for use in standalone executables).
safe_ptr< Options >getOptions()
Return a safe pointer to the options that this functor is supposed to run with (e.g. from the ini file).
voidnotifyOfSubCaps(const str & subcap_string)
Notify the functor about a string in YAML that contains the sub-capability information (for use in standalones)
voidnotifyOfSubCaps(const Options & subcaps)
Notify the functor about an instance of the options class that contains sub-capability information.
template <typename TYPE >
void
setSubCap(const str & key, const TYPE val)
Set a sub-capability (subcap)for the functor directly (for use in standalone executables).
safe_ptr< Options >getSubCaps()
Return a safe pointer to the subcaps that this functor realises it is supposed to facilitate downstream calculation of.
safe_ptr< std::set< sspair > >getDependees()
Return a safe pointer to the vector of all capability,type pairs of functors arranged downstream of this one in the dependency tree.
const std::set< str > &getAllowedModels()
Getter for listing allowed models.
const std::set< str > &getConditionalModels()
Getter for listing conditional models.
const std::map< str, std::set< str > > &getModelGroups()
Getter for map of model groups and the set of models in each group.
boolallModelsAllowed()
Test whether the functor is allowed to be used with all models.
boolmodelAllowed(str model)
Test whether the functor is always allowed (either explicitly or implicitly) to be used with a given model.
boolmodelExplicitlyAllowed(str model)
Test whether the functor is explictly always allowed to be used with a given model.
voidsetAllowedModel(str model)
Add a model to the internal list of models for which this functor is allowed to be used.
boolmodelComboAllowed(std::set< str > combo)
Test whether the functor is allowed (either explicitly or implicitly) to be used with a given combination of models.
boolmodelComboExplicitlyAllowed(std::set< str > combo)
Test whether the functor has been explictly allowed to be used with a given combination of models.
voidsetModelGroup(str group, str contents)
Add a model group definition to the internal list of model groups.
voidsetAllowedModelGroupCombo(str groups)
Add a combination of model groups to the internal list of combinations for which this functor is allowed to be used.
voidaddMatchedObservable(const DRes::Observable * obs)
Add an observable to the set of those that this functor matches.
const std::set< const DRes::Observable * > &getMatchedObservables()
Retrieve the set of observables that this functor matches.
voidaddMatchedModuleRule(const DRes::ModuleRule * r)
Add a module rule to the set of those against which this functor has been tested and found to match.
voidaddMatchedBackendRule(const DRes::BackendRule * r)
Add a backend rule to the set of those against which this functor has been tested and found to match.
const std::set< const DRes::ModuleRule * > &getMatchedModuleRules()
Retrieve the set of module rules against which this functor has been tested and found to match.
const std::set< const DRes::BackendRule * > &getMatchedBackendRules()
Retrieve the set of backend rules against which this functor has been tested and found to match.
template <class RuleT >
const std::set< RuleT * > &
getMatchedRules()
Retrieve matched rules by type.
const std::set< const DRes::ModuleRule * > &getMatchedRules()

Protected Functions inherited from Gambit::functor

Name
voidfailBigTime(str method)
Attempt to retrieve a dependency or model parameter that has not been resolved.
boolallowed_parent_or_friend_exists(str model)
Test if there is a model in the functor’s allowedModels list as which this model can be interpreted.
boolin_allowed_combo(str model)
Check that a model is actually part of a combination that is allowed to be used with this functor.
boolcontains_anything_interpretable_as_member_of(std::set< str > combo, str group)
Test whether any of the entries in a given model group is a valid interpretation of any members in a given combination.
boolhas_common_elements(std::set< str > combo, str group)
Work out whether a given combination of models and a model group have any elements in common.
strfind_friend_or_parent_model_in_map(str model, std::map< str, std::set< sspair > > karta)
Try to find a parent or friend model in some user-supplied map from models to sspair vectors.

Protected Attributes inherited from Gambit::functor

Name
strmyName
Internal storage of the function name.
strmyCapability
Internal storage of exactly what the function calculates.
strmyType
Internal storage of the type of what the function calculates.
strmyOrigin
Internal storage of the name of the module or backend to which the function belongs.
strmyPurpose
Purpose of the function (relevant for output and next-to-output functors)
strmyCitationKey
Citation key: BibTex key of the reference.
const Models::ModelFunctorClaw *myClaw
Bound model functor claw, for checking relationships between models.
const strmyLabel
String label, used to label functor results for printer system.
const strmyTimingLabel
String label, used to label functor timing data for printer system.
FunctorStatusmyStatus
Status:
intmyVertexID
Internal storage of the vertex ID number used by the printer system to identify functors.
intmyTimingVertexID
ID assigned by printers to the timing data output stream.
boolverbose
Debug flag.
OptionsmyOptions
Internal storage of function options, as a YAML node.
OptionsmySubCaps
Internal storage of function sub-capabilities, as a YAML node.
std::set< sspair >myDependees
List of all capability,type pairs of functors downstream of this one in the dependency tree.
std::set< str >allowedModels
List of allowed models.
std::set< str >conditionalModels
List of conditional models.
std::set< std::set< str > >allowedGroupCombos
List of allowed model group combinations.
std::map< str, std::set< str > >modelGroups
Map from model group names to group contents.
std::set< const DRes::Observable * >matched_observables
The set of observables that this functor matches.
std::set< const DRes::ModuleRule * >matched_module_rules
Set of module rules against which this functor has been tested and found to match.
std::set< const DRes::BackendRule * >matched_backend_rules
Set of backend rules against which this functor has been tested and found to match.

Public Functions Documentation

function module_functor_common

module_functor_common(
    str func_name,
    str func_capability,
    str result_type,
    str origin_name,
    Models::ModelFunctorClaw & claw
)

Constructor.

function ~module_functor_common

virtual ~module_functor_common()

Destructor.

function getRuntimeAverage

virtual double getRuntimeAverage()

Getter for averaged runtime.

Reimplements: Gambit::functor::getRuntimeAverage

function reset

virtual void reset()

Reset functor.

Reimplements: Gambit::functor::reset

Reset functor for all threads.

function notifyOfInvalidation

virtual void notifyOfInvalidation(
    const str & msg
)

Tell the functor that it invalidated the current point in model space, pass a message explaining why, and throw an exception.

Reimplements: Gambit::functor::notifyOfInvalidation

function getInvalidationRate

virtual double getInvalidationRate()

Getter for invalidation rate.

Reimplements: Gambit::functor::getInvalidationRate

function setFadeRate

virtual void setFadeRate(
    double new_rate
)

Setter for the fade rate.

Reimplements: Gambit::functor::setFadeRate

function setTimingPrintRequirement

virtual void setTimingPrintRequirement(
    bool flag
)

Setter for indicating if the timing data for this function’s execution should be printed.

Reimplements: Gambit::functor::setTimingPrintRequirement

function requiresTimingPrinting

virtual bool requiresTimingPrinting() const

Getter indicating if the timing data for this function’s execution should be printed.

Reimplements: Gambit::functor::requiresTimingPrinting

function getActiveModelFlag

bool getActiveModelFlag(
    str model
)

Indicate whether or not a known model is activated or not.

function getChosenReqFromGroup

safe_ptr< str > getChosenReqFromGroup(
    str group
)

Return a safe pointer to a string indicating which backend requirement has been activated for a given backend group.

function iterate

virtual void iterate(
    long long iteration
)

Execute a single iteration in the loop managed by this functor.

function init_myCurrentIteration_if_NULL

virtual void init_myCurrentIteration_if_NULL()

Initialise the array holding the current iteration(s) of this functor.

function setIteration

virtual void setIteration(
    long long iteration
)

Setter for setting the iteration number in the loop in which this functor runs.

Reimplements: Gambit::functor::setIteration

function iterationPtr

virtual omp_safe_ptr< long long > iterationPtr()

Return a safe pointer to the iteration number in the loop in which this functor runs.

function setCanBeLoopManager

virtual void setCanBeLoopManager(
    bool canManage
)

Setter for specifying whether this is permitted to be a manager functor, which runs other functors nested in a loop.

function canBeLoopManager

virtual bool canBeLoopManager()

Getter for revealing whether this is permitted to be a manager functor.

Reimplements: Gambit::functor::canBeLoopManager

function setLoopManagerCapType

virtual void setLoopManagerCapType(
    str cap,
    str t
)

Setter for specifying the capability required of a manager functor, if it is to run this functor nested in a loop.

Setter for specifying the capability and type required of a manager functor, if it is to run this functor nested in a loop.

function needsLoopManager

virtual bool needsLoopManager()

Getter for revealing whether this functor needs a loop manager.

Reimplements: Gambit::functor::needsLoopManager

function loopManagerCapability

virtual str loopManagerCapability()

Getter for revealing the required capability of the wrapped function’s loop manager.

Reimplements: Gambit::functor::loopManagerCapability

function loopManagerType

virtual str loopManagerType()

Getter for revealing the required type of the wrapped function’s loop manager.

Reimplements: Gambit::functor::loopManagerType

function loopManagerName

virtual str loopManagerName()

Getter for revealing the name of the wrapped function’s assigned loop manager.

Reimplements: Gambit::functor::loopManagerName

function loopManagerOrigin

virtual str loopManagerOrigin()

Getter for revealing the module of the wrapped function’s assigned loop manager.

Reimplements: Gambit::functor::loopManagerOrigin

function breakLoopFromManagedFunctor

virtual void breakLoopFromManagedFunctor()

Tell the manager of the loop in which this functor runs that it is time to break the loop.

function loopIsDone

virtual safe_ptr< bool > loopIsDone()

Return a safe pointer to the flag indicating that a loop managed by this functor should break now.

function resetLoop

virtual void resetLoop()

Provide a way to reset the flag indicating that a loop managed by this functor should break.

function breakLoop

virtual void breakLoop()

Tell the functor that the loop it manages should break now.

Reimplements: Gambit::functor::breakLoop

function dependencies

virtual std::set< sspair > dependencies()

Getter for listing currently activated dependencies.

Reimplements: Gambit::functor::dependencies

function backendclassloading

virtual std::set< sspair > backendclassloading()

Getter for listing backends that require class loading.

Reimplements: Gambit::functor::backendclassloading

function backendgroups

virtual std::set< str > backendgroups()

Getter for listing backend requirement groups.

Reimplements: Gambit::functor::backendgroups

function backendreqs

virtual std::set< sspair > backendreqs()

Getter for listing all backend requirements.

Reimplements: Gambit::functor::backendreqs

function backendreqs

virtual std::set< sspair > backendreqs(
    str group
)

Getter for listing backend requirements from a specific group.

Reimplements: Gambit::functor::backendreqs

function backendspermitted

virtual std::set< sspair > backendspermitted(
    sspair quant
)

Getter for listing permitted backends.

Reimplements: Gambit::functor::backendspermitted

function backendreq_tags

virtual std::set< str > backendreq_tags(
    sspair quant
)

Getter for listing tags associated with backend requirements.

Reimplements: Gambit::functor::backendreq_tags

function forcematchingbackend

virtual std::set< sspair > forcematchingbackend(
    str tag
)

Getter for listing backend requirements that must be resolved from the same backend.

Reimplements: Gambit::functor::forcematchingbackend

function backend_conditional_dependencies

virtual std::set< sspair > backend_conditional_dependencies(
    str req,
    str type,
    str be,
    str ver
)

Getter for listing backend-specific conditional dependencies (4-string version)

Reimplements: Gambit::functor::backend_conditional_dependencies

function backend_conditional_dependencies

virtual std::set< sspair > backend_conditional_dependencies(
    str req,
    str type,
    str be
)

Getter for backend-specific conditional dependencies (3-string version)

Reimplements: Gambit::functor::backend_conditional_dependencies

function backend_conditional_dependencies

virtual std::set< sspair > backend_conditional_dependencies(
    functor * be_functor
)

Getter for backend-specific conditional dependencies (backend functor pointer version)

Reimplements: Gambit::functor::backend_conditional_dependencies

function model_conditional_dependencies

virtual std::set< sspair > model_conditional_dependencies(
    str model
)

Getter for listing model-specific conditional dependencies (matches also on parents and friends)

Reimplements: Gambit::functor::model_conditional_dependencies

function model_conditional_dependencies_exact

virtual std::set< sspair > model_conditional_dependencies_exact(
    str model
)

Getter for listing model-specific conditional dependencies (matches on the exact model)

Reimplements: Gambit::functor::model_conditional_dependencies_exact

function model_conditional_backend_reqs

virtual std::set< sspair > model_conditional_backend_reqs(
    str model
)

Getter for listing model-specific conditional backend requirements (matches also on parents and friends)

Reimplements: Gambit::functor::model_conditional_backend_reqs

function model_conditional_backend_reqs_exact

virtual std::set< sspair > model_conditional_backend_reqs_exact(
    str model
)

Getter for listing model-specific conditional backend requirements (matches on the exact model)

Reimplements: Gambit::functor::model_conditional_backend_reqs_exact

function setDependency

void setDependency(
    str dep,
    str dep_type,
    void(*)(functor *, module_functor_common *) resolver,
    str purpose =""
)

Add and activate unconditional dependencies.

function setConditionalDependency

void setConditionalDependency(
    str dep,
    str dep_type
)

Add conditional dependency-type pairs in advance of later conditions.

function setBackendConditionalDependency

void setBackendConditionalDependency(
    str req,
    str be,
    str ver,
    str dep,
    void(*)(functor *, module_functor_common *) resolver
)

Add a backend conditional dependency for multiple backend versions.

function setBackendConditionalDependencySingular

void setBackendConditionalDependencySingular(
    str req,
    str be,
    str ver,
    str dep,
    void(*)(functor *, module_functor_common *) resolver
)

Add a backend conditional dependency for a single backend version.

function setModelConditionalDependency

void setModelConditionalDependency(
    str model,
    str dep,
    void(*)(functor *, module_functor_common *) resolver
)

Add a model conditional dependency for multiple models.

function setModelConditionalDependencySingular

void setModelConditionalDependencySingular(
    str model,
    str dep,
    void(*)(functor *, module_functor_common *) resolver
)

Add a model conditional dependency for a single model.

function makeBackendRuleForModel

void makeBackendRuleForModel(
    str model,
    str tag
)

Add a rule for activating backend requirements according to the model being scanned.

function setBackendReq

void setBackendReq(
    str group,
    str req,
    str tags,
    str type,
    void(*)(functor *) resolver
)

Add an unconditional backend requirement The info gets updated later if this turns out to be contitional on a model.

Add an unconditional backend requirement The info gets updated later if this turns out to be conditional on a model.

function setModelConditionalBackendReq

void setModelConditionalBackendReq(
    str model,
    str req,
    str type
)

Add a model conditional backend requirement for multiple models.

function setModelConditionalBackendReqSingular

void setModelConditionalBackendReqSingular(
    str model,
    str req,
    str type
)

Add a model conditional backend requirement for a single model.

function makeBackendOptionRule

void makeBackendOptionRule(
    str be_and_ver,
    str tag
)

Add a rule for dictating which backends can be used to fulfill which backend requirements.

function setPermittedBackend

void setPermittedBackend(
    str req,
    str be,
    str ver
)

Add a single permitted backend version.

function makeBackendMatchingRule

void makeBackendMatchingRule(
    str tag
)

Add one or more rules for forcing backends reqs with the same tags to always be resolved from the same backend.

Add one or more rules that force backends reqs with the same tag to always be resolved from the same backend.

function setRequiredClassloader

void setRequiredClassloader(
    str be,
    str ver,
    str safe_ver
)

Add a rule indicating that classes from a given backend must be available.

function notifyOfBackends

virtual void notifyOfBackends(
    std::map< str, std::set< str > > be_ver_map
)

Indicate to the functor which backends are actually loaded and working.

Reimplements: Gambit::functor::notifyOfBackends

function setNestedList

virtual void setNestedList(
    std::vector< functor * > & newNestedList
)

Set the ordered list of pointers to other functors that should run nested in a loop managed by this one.

Reimplements: Gambit::functor::setNestedList

function resolveDependency

virtual void resolveDependency(
    functor * dep_functor
)

Resolve a dependency using a pointer to another functor object.

Reimplements: Gambit::functor::resolveDependency

function resolveLoopManager

virtual void resolveLoopManager(
    functor * dep_functor
)

Set this functor’s loop manager (if it has one)

Reimplements: Gambit::functor::resolveLoopManager

function resolveBackendReq

virtual void resolveBackendReq(
    functor * be_functor
)

Resolve a backend requirement using a pointer to another functor object.

Reimplements: Gambit::functor::resolveBackendReq

function notifyOfModel

virtual void notifyOfModel(
    str model
)

Notify the functor that a certain model is being scanned, so that it can activate its dependencies and backend reqs accordingly.

Reimplements: Gambit::functor::notifyOfModel

function notifyOfDependee

virtual void notifyOfDependee(
    functor * dependent_functor
)

Notify the functor that another functor depends on it.

Reimplements: Gambit::functor::notifyOfDependee

function retrieve_invalid_point_exception

virtual invalid_point_exception * retrieve_invalid_point_exception()

Retrieve the previously saved exception generated when this functor invalidated the current point in model space.

Reimplements: Gambit::functor::retrieve_invalid_point_exception

Protected Functions Documentation

function reset

virtual void reset(
    int thread_num
)

Reset functor for one thread only.

Reimplements: Gambit::functor::reset

function acknowledgeInvalidation

virtual void acknowledgeInvalidation(
    invalid_point_exception & e,
    functor * f =NULL
)

Acknowledge that this functor invalidated the current point in model space.

function startTiming

virtual void startTiming(
    int thread_num
)

Do pre-calculate timing things.

function finishTiming

virtual void finishTiming(
    int thread_num
)

Do post-calculate timing things.

function init_memory

virtual void init_memory()

Initialise the memory of this functor.

Reimplemented by: Gambit::module_functor::init_memory, Gambit::module_functor::init_memory

function fill_activeModelFlags

void fill_activeModelFlags()

Construct the list of known models only if it doesn’t yet exist.

function retrieve_conditional_dep_type_pair

sspair retrieve_conditional_dep_type_pair(
    str dep
)

Retrieve full conditional dependency-type pair from conditional dependency only.

function check_missing_LogTag

void check_missing_LogTag()

Check if an appropriate LogTag for this functor is missing from the logging system.

function entering_multithreaded_region

inline void entering_multithreaded_region()

function leaving_multithreaded_region

inline void leaving_multithreaded_region()

Protected Attributes Documentation

variable myTimingPrintFlag

bool myTimingPrintFlag;

Flag to select whether or not the timing data for this function’s execution should be printed;.

variable start

std::chrono::time_point< std::chrono::system_clock > * start;

Beginning and end timing points.

variable end

std::chrono::time_point< std::chrono::system_clock > * end;

variable point_exception_raised

bool point_exception_raised;

A flag indicating whether or not this functor has invalidated the current point.

variable raised_point_exception

invalid_point_exception raised_point_exception;

An exception raised because this functor has invalidated the current point.

variable runtime_average

double runtime_average;

Averaged runtime in ns.

variable fadeRate

double fadeRate;

Fade rate for average runtime.

variable pInvalidation

double pInvalidation;

Probability that functors invalidates point in model parameter space.

variable needs_recalculating

bool * needs_recalculating;

Needs recalculating or not?

variable already_printed

bool * already_printed;

Has result already been sent to the printer?

variable already_printed_timing

bool * already_printed_timing;

Has timing data already been sent to the printer?

variable iCanManageLoops

bool iCanManageLoops;

Flag indicating whether this function can manage a loop over other functions.

variable myLoopIsDone

bool myLoopIsDone;

Flag indicating whether this function is ready to finish its loop (only relevant if iCanManageLoops = true)

variable iRunNested

bool iRunNested;

Flag indicating whether this function can run nested in a loop over functions.

variable myLoopManagerCapability

str myLoopManagerCapability;

Capability of a function that mangages a loop that this function can run inside of.

variable myLoopManagerType

str myLoopManagerType;

Capability of a function that mangages a loop that this function can run inside of.

variable myLoopManager

functor * myLoopManager;

Pointer to the functor that mangages the loop that this function runs inside of.

variable myNestedFunctorList

std::vector< functor * > myNestedFunctorList;

Vector of functors that have been set up to run nested within this one.

variable myCurrentIteration

long long * myCurrentIteration;

Pointer to counters for iterations of nested functor loop.

variable globlMaxThreads

const int globlMaxThreads;

Maximum number of OpenMP threads this MPI process is permitted to launch in total.

variable myGroups

std::set< str > myGroups;

Internal list of backend groups that this functor’s requirements fall into.

variable chosenReqsFromGroups

std::map< str, str > chosenReqsFromGroups;

Map from groups to backend reqs, indicating which backend req has been activated for which backend group.

variable myBackendReqs

std::set< sspair > myBackendReqs;

Set of all backend requirement-type string pairs.

variable myResolvableBackendReqs

std::set< sspair > myResolvableBackendReqs;

Set of all backend requirement-type string pairs currently available for resolution.

variable myGroupedBackendReqs

std::map< str, std::set< sspair > > myGroupedBackendReqs;

Set of backend requirement-type string pairs for specific backend groups.

variable myDependencies

std::set< sspair > myDependencies;

Vector of dependency-type string pairs.

variable myConditionalDependencies

std::map< str, str > myConditionalDependencies;

Map of conditional dependencies to their types.

variable myBackendConditionalDependencies

std::map< std::vector< str >, std::set< sspair > > myBackendConditionalDependencies;

Map from (vector with 4 strings: backend req, type, backend, version) to (set of {conditional dependency-type} pairs)

variable myModelConditionalDependencies

std::map< str, std::set< sspair > > myModelConditionalDependencies;

Map from models to (set of {conditional dependency-type} pairs)

variable myModelConditionalBackendReqs

std::map< str, std::set< sspair > > myModelConditionalBackendReqs;

Map from models to (set of {conditional backend requirement-type} pairs)

variable activeModelFlags

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)

variable dependency_map

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 pointers)

variable dependency_functor_map

std::map< sspair, functor * > dependency_functor_map;

Map from (dependency-type pairs) to pointers to functors used to resolve them that set dependency functor pointers)

variable backendreq_types

std::map< str, str > backendreq_types;

Map from backend requirements to their required types.

variable backendreq_groups

std::map< sspair, str > backendreq_groups;

Map from backend requirements to their designated groups.

variable backendreq_tagmap

std::map< sspair, std::set< str > > backendreq_tagmap;

Map from backend requirements to their rule tags.

variable backendreq_map

std::map< sspair, void(*)(functor *)> backendreq_map;

Map from (backend requirement-type pairs) to (pointers to templated void functions that set backend requirement functor pointers)

variable permitted_map

std::map< sspair, std::set< sspair > > permitted_map;

Map from (backend requirement-type pairs) to (set of permitted {backend-version} pairs)

variable myForcedMatches

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 backend.

variable required_classloading_backends

std::map< str, std::set< str > > required_classloading_backends;

Map from required classloading backends to their versions.

variable missing_backends

std::vector< str > missing_backends;

Vector of required backends currently missing.

variable tp

timespec tp;

Internal timespec object.

variable myLogTag

int myLogTag;

Integer LogTag, for tagging log messages.

variable signal_mode_locked

bool signal_mode_locked = true;

While locked, prevent this function switching off threadsafe* emergency signal handling. *The emergency signal handling cannot be made completely threadsafe; it can still cause lockups and memory corruption if it occurs at an inopportune time. “soft” shutdown is always preferable.

Friends

friend FunctorHelp::entering_multithreaded_region

friend void FunctorHelp::entering_multithreaded_region(
    module_functor_common & 
);

Connectors to external helper functions (to decouple signal handling from this class)

friend FunctorHelp::leaving_multithreaded_region

friend void FunctorHelp::leaving_multithreaded_region(
    module_functor_common & 
);

Updated on 2024-07-18 at 13:53:30 +0000