13#include "arcane/impl/FlexLMTools.h"
20#define FLEXLMAPI_IS_STATIC_LIBRARY
24#include "arcane/IParallelSuperMng.h"
25#include "arcane/utils/FatalErrorException.h"
26#include "arcane/utils/TraceInfo.h"
27#include "arcane/utils/StringBuilder.h"
28#include "arcane/utils/Array.h"
38LicenseErrorException::
39LicenseErrorException(
const String& where)
40: Exception(
"LicenseError",where)
48LicenseErrorException::
49LicenseErrorException(
const String& where,
const String& message)
50: Exception(
"LicenseError",where,message)
58LicenseErrorException::
59LicenseErrorException(
const TraceInfo& where)
60: Exception(
"LicenseError",where)
68LicenseErrorException::
69LicenseErrorException(
const TraceInfo& where,
const String& message)
70: Exception(
"LicenseError",where,message)
78void LicenseErrorException::
79explain(std::ostream& m)
const
81 m <<
"Licensing error occured.\n"
82 <<
"Excution stopped.\n";
88void LicenseErrorException::
89write(std::ostream& o)
const
93 o <<
"Exception thrown in: '" << where() <<
"\n";
95 if (!message().null())
96 o <<
"Message: " << message() <<
'\n';
99 String st = stackTrace().toString();
101 o <<
"\nCall stack:\n";
113FlexLMMng* FlexLMMng::m_instance = NULL ;
120 : m_parallel_super_mng(
NULL)
144 if (m_parallel_super_mng !=
NULL)
154#ifndef ARCANE_TEST_RLM
155 license_tool.checkLicense(ArcaneFeatureModel::ArcaneCore,
true);
157 license_tool.checkLicense(ArcaneFeatureModel::Arcane,
true);
179 if (m_parallel_super_mng ==
NULL)
184 test =
license_test((
char*)name.localstr(),(
char*)String::format(
"{0}",version).localstr());
199 if (m_parallel_super_mng ==
NULL)
207 error +=
license_begin_rc((
char*)name.localstr(), (
char*)String::format(
"{0}",version).localstr()) ;
221 if (m_parallel_super_mng ==
NULL)
229 FeatureMapType::iterator
finder = m_features.find(name);
232 if (
finder == m_features.end())
return;
251 if (m_parallel_super_mng ==
NULL)
256 for(FeatureMapType::iterator iter = m_features.begin(); iter!=m_features.end(); ++iter)
258 const String name = (*iter).first ;
278 if (
license_test((
char*)name.localstr(),(
char*)String::format(
"{0}",version).localstr()) == 0)
297 info =
"Unknown feature";
319const String ArcaneFeatureModel::m_arcane_feature_name[] =
321#ifndef ARCANE_TEST_RLM
static FlexLMMng * instance()
Accès au singleton.
void getLicense(const String name, const Real version, Integer nb_licenses=1)
Demande l'allocation de.
bool checkLicense(const String name, const Real version, bool do_fatal=true) const
Teste la présence d'une fonctionnalité statique.
void setCheckInterval(const Integer t=120)
Définit une nouvelle périodicité du contrôle des licences.
void init(IParallelSuperMng *parallel_super_mng)
Initialise le gestionnaire de licences.
void releaseAllLicenses()
Relache toutes les licences allouées.
bool m_is_master
Cet host est il le maître des contrôles ?
void releaseLicense(const String name, Integer nb_licenses=0)
Relache les licences de la fonctionnalité
String featureInfo(const String name, const Real version) const
Return info on feature.
Classe abstraite du superviseur de parallélisme.
virtual void broadcast(ByteArrayView send_buf, Integer process_id)=0
Envoie un tableau de valeurs sur tous les processus Cette opération synchronise le tableau de valeur ...
Lecteur des fichiers de maillage via la bibliothèque LIMA.
constexpr Integer size() const noexcept
Nombre d'éléments du tableau.
Constructeur de chaîne de caractère unicode.
Chaîne de caractères unicode.
ByteConstArrayView utf8() const
Retourne la conversion de l'instance dans l'encodage UTF-8.
bool null() const
Retourne true si la chaîne est nulle.
Vecteur 1D de données avec sémantique par valeur (style STL).
ArrayView< Integer > IntegerArrayView
Equivalent C d'un tableau à une dimension d'entiers.