FlexLM manager. More...
#include <arcane/impl/FlexLMTools.h>
Public Member Functions | |
| void | init (IParallelSuperMng *parallel_super_mng) |
| Initializes the license manager. | |
| void | setCheckInterval (const Integer t=120) |
| Sets a new license check periodicity. | |
| bool | checkLicense (const String name, const Real version, bool do_fatal=true) const |
| Tests the presence of a static feature. | |
| void | getLicense (const String name, const Real version, Integer nb_licenses=1) |
| Requests the allocation of. | |
| void | releaseLicense (const String name, Integer nb_licenses=0) |
| Releases the licenses for the feature. | |
| void | releaseAllLicenses () |
| Releases all allocated licenses. | |
| String | featureInfo (const String name, const Real version) const |
| Return info on feature. | |
Static Public Member Functions | |
| static FlexLMMng * | instance () |
| Access to the singleton. | |
Private Types | |
| typedef std::map< String, Integer > | FeatureMapType |
Private Member Functions | |
| FlexLMMng () | |
| Constructor. | |
| virtual | ~FlexLMMng () |
| Destructor. | |
Private Attributes | |
| FeatureMapType | m_features |
| IParallelSuperMng * | m_parallel_super_mng |
| bool | m_is_master |
| Is this host the master for checks? | |
Static Private Attributes | |
| static FlexLMMng * | m_instance = NULL |
FlexLM manager.
Singleton for recording all taken feature licenses
The checks are performed by the master node (commRank==0) To verify the validity of this check, either the ArcaneMasterFlexLM feature must be available (which does not lock other nodes of the parallel execution on the license node) or all nodes must have ArcaneCore authorization. This is tested in the init() phase.
Definition at line 73 of file FlexLMTools.h.
Definition at line 127 of file FlexLMTools.h.
|
private |
Constructor.
Definition at line 119 of file FlexLMTools.cc.
Referenced by instance().
|
inlineprivatevirtual |
Destructor.
Definition at line 81 of file FlexLMTools.h.
| bool Arcane::FlexLMMng::checkLicense | ( | const String | name, |
| const Real | version, | ||
| bool | do_fatal = true ) const |
Tests the presence of a static feature.
This feature will not use a license token.
| do_fatal | indicates whether to generate an error if unavailable |
Definition at line 167 of file FlexLMTools.cc.
References featureInfo(), Arcane::String::localstr(), and m_is_master.
Referenced by Arcane::FlexLMTools< FeatureModel >::checkLicense(), and Arcane::FlexLMTools< FeatureModel >::checkLicense().
Return info on feature.
Definition at line 258 of file FlexLMTools.cc.
References Arcane::String::localstr(), m_is_master, Arcane::ConstArrayView< T >::size(), Arcane::StringBuilder::toString(), and Arcane::String::utf8().
Referenced by checkLicense(), Arcane::FlexLMTools< FeatureModel >::featureInfo(), and getLicense().
| void Arcane::FlexLMMng::getLicense | ( | const String | name, |
| const Real | version, | ||
| Integer | nb_licenses = 1 ) |
Requests the allocation of.
| nb_licenses | licenses for the feature |
| name |
The requested licenses are independent of the number of processors
| nb_licenses | defaults to 1 |
Definition at line 186 of file FlexLMTools.cc.
References featureInfo(), Arcane::String::localstr(), and m_is_master.
Referenced by Arcane::FlexLMTools< FeatureModel >::getLicense().
| void Arcane::FlexLMMng::init | ( | IParallelSuperMng * | parallel_super_mng | ) |
Initializes the license manager.
Definition at line 141 of file FlexLMTools.cc.
References Arcane::IParallelSuperMng::commRank(), and m_is_master.
Referenced by Arcane::ArcaneMainExecInfo::initialize().
|
static |
Access to the singleton.
Definition at line 130 of file FlexLMTools.cc.
References FlexLMMng().
Referenced by Arcane::ArcaneMain::arcaneFinalize(), Arcane::FlexLMTools< FeatureModel >::checkLicense(), Arcane::FlexLMTools< FeatureModel >::checkLicense(), Arcane::FlexLMTools< FeatureModel >::featureInfo(), Arcane::FlexLMTools< FeatureModel >::getLicense(), Arcane::ArcaneMainExecInfo::initialize(), and Arcane::FlexLMTools< FeatureModel >::releaseLicense().
| void Arcane::FlexLMMng::releaseAllLicenses | ( | ) |
Releases all allocated licenses.
Definition at line 237 of file FlexLMTools.cc.
References Arcane::String::localstr(), and m_is_master.
Referenced by Arcane::ArcaneMain::arcaneFinalize().
Releases the licenses for the feature.
| name | |
| nb_licenses | is 0 if all licenses should be released |
Definition at line 206 of file FlexLMTools.cc.
References Arcane::String::localstr(), and m_is_master.
Referenced by Arcane::FlexLMTools< FeatureModel >::releaseLicense().
| void Arcane::FlexLMMng::setCheckInterval | ( | const Integer | t = 120 | ) |
Sets a new license check periodicity.
The default value is 120s. if t == -1 : disables periodic checking if 0 <= t < 30 : the value is ignored if t >= 30 : sets a new check periodicity
Definition at line 157 of file FlexLMTools.cc.
|
private |
Definition at line 128 of file FlexLMTools.h.
|
staticprivate |
Definition at line 129 of file FlexLMTools.h.
|
private |
Is this host the master for checks?
Definition at line 131 of file FlexLMTools.h.
Referenced by checkLicense(), featureInfo(), getLicense(), init(), releaseAllLicenses(), and releaseLicense().
|
private |
Definition at line 130 of file FlexLMTools.h.