Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::FlexLMMng Class Reference

FlexLM manager. More...

#include <arcane/impl/FlexLMTools.h>

Collaboration diagram for Arcane::FlexLMMng:

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 FlexLMMnginstance ()
 Access to the singleton.

Private Types

typedef std::map< String, IntegerFeatureMapType

Private Member Functions

 FlexLMMng ()
 Constructor.
virtual ~FlexLMMng ()
 Destructor.

Private Attributes

FeatureMapType m_features
IParallelSuperMngm_parallel_super_mng
bool m_is_master
 Is this host the master for checks?

Static Private Attributes

static FlexLMMngm_instance = NULL

Detailed Description

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.

Member Typedef Documentation

◆ FeatureMapType

typedef std::map<String, Integer> Arcane::FlexLMMng::FeatureMapType
private

Definition at line 127 of file FlexLMTools.h.

Constructor & Destructor Documentation

◆ FlexLMMng()

Arcane::FlexLMMng::FlexLMMng ( )
private

Constructor.

Definition at line 119 of file FlexLMTools.cc.

Referenced by instance().

Here is the caller graph for this function:

◆ ~FlexLMMng()

virtual Arcane::FlexLMMng::~FlexLMMng ( )
inlineprivatevirtual

Destructor.

Definition at line 81 of file FlexLMTools.h.

Member Function Documentation

◆ checkLicense()

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.

Parameters
do_fatalindicates whether to generate an error if unavailable
Returns
0 if no error

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ featureInfo()

String Arcane::FlexLMMng::featureInfo ( const String name,
const Real version ) const

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLicense()

void Arcane::FlexLMMng::getLicense ( const String name,
const Real version,
Integer nb_licenses = 1 )

Requests the allocation of.

Parameters
nb_licenseslicenses for the feature
name

The requested licenses are independent of the number of processors

Parameters
nb_licensesdefaults to 1
Returns
0 if no error

Definition at line 186 of file FlexLMTools.cc.

References featureInfo(), Arcane::String::localstr(), and m_is_master.

Referenced by Arcane::FlexLMTools< FeatureModel >::getLicense().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ instance()

FlexLMMng * Arcane::FlexLMMng::instance ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ releaseAllLicenses()

void Arcane::FlexLMMng::releaseAllLicenses ( )

Releases all allocated licenses.

Returns
0 if no error

Definition at line 237 of file FlexLMTools.cc.

References Arcane::String::localstr(), and m_is_master.

Referenced by Arcane::ArcaneMain::arcaneFinalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ releaseLicense()

void Arcane::FlexLMMng::releaseLicense ( const String name,
Integer nb_licenses = 0 )

Releases the licenses for the feature.

Parameters
name
nb_licensesis 0 if all licenses should be released
Returns
0 if no error

Definition at line 206 of file FlexLMTools.cc.

References Arcane::String::localstr(), and m_is_master.

Referenced by Arcane::FlexLMTools< FeatureModel >::releaseLicense().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCheckInterval()

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.

Member Data Documentation

◆ m_features

FeatureMapType Arcane::FlexLMMng::m_features
private

Definition at line 128 of file FlexLMTools.h.

◆ m_instance

FlexLMMng * Arcane::FlexLMMng::m_instance = NULL
staticprivate

Definition at line 129 of file FlexLMTools.h.

◆ m_is_master

bool Arcane::FlexLMMng::m_is_master
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().

◆ m_parallel_super_mng

IParallelSuperMng* Arcane::FlexLMMng::m_parallel_super_mng
private

Definition at line 130 of file FlexLMTools.h.


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