14#include "arcane/utils/PlatformUtils.h"
15#include "arcane/utils/ScopedPtr.h"
17#include "arcane/core/EntryPoint.h"
18#include "arcane/core/ISubDomain.h"
19#include "arcane/core/ModuleFactory.h"
20#include "arcane/core/IVerifierService.h"
21#include "arcane/core/ServiceUtils.h"
22#include "arcane/core/IVariableMng.h"
23#include "arcane/core/IParallelMng.h"
24#include "arcane/core/IMesh.h"
25#include "arcane/core/IItemFamily.h"
26#include "arcane/core/ITimeLoopMng.h"
27#include "arcane/core/ServiceBuilder.h"
28#include "arcane/core/ObserverPool.h"
29#include "arcane/core/ICheckpointMng.h"
30#include "arcane/core/MeshVisitor.h"
31#include "arcane/core/IDirectory.h"
33#include "arcane/cea/ArcaneCeaVerifier_axl.h"
47:
public ArcaneArcaneCeaVerifierObject
59 void onExit()
override;
60 void onInit()
override;
68 void _checkSortedGroups();
76: ArcaneArcaneCeaVerifierObject(mb)
83void ArcaneVerifierModule::
86 if (options()->trace.size()!=0)
87 this->pwarning() <<
"The option 'trace' is no longer used and should be removed";
89 if (!platform::getEnvironmentVariable(
"ARCANE_VERIFY_SORTEDGROUP").null()){
90 info() <<
"Add observer to check sorted groups before checkpoint";
93 &ArcaneVerifierModule::_checkSortedGroups,
94 subDomain()->checkpointMng()->writeObservable());
101void ArcaneVerifierModule::
107 auto check_sorted_func = [&](ItemGroup& g)
110 if (g.checkIsSorted())
113 info() <<
"VerifierModule: group not sorted name=" << g.name();
115 meshvisitor::visitGroups(this->mesh(),check_sorted_func);
116 info() <<
"VerifierModule: nb_unsorted_group=" << (nb_group-nb_sorted_group)
123void ArcaneVerifierModule::
126 if (!options()->verify())
128 if (!platform::getEnvironmentVariable(
"ARCANE_NO_VERIFY").null())
131 IParallelMng* pm = subDomain()->parallelMng();
132 bool is_parallel = pm->isParallel();
134 Ref<IVerifierService> verifier_service;
137 ServiceBuilder<IVerifierService> sf(subDomain());
139 String verifier_service_name = options()->verifierServiceName();
141 String env_service_name = platform::getEnvironmentVariable(
"ARCANE_VERIFIER_SERVICE");
142 if (!env_service_name.null())
143 verifier_service_name = env_service_name;
144 info() <<
"Verification Module using service=" << verifier_service_name;
145 verifier_service = sf.createReference(verifier_service_name);
148 bool compare_from_sequential = options()->compareParallelSequential();
150 compare_from_sequential =
false;
152 String result_file_name = options()->resultFile();
153 String reference_file_name = options()->referenceFile();
155 if (options()->filesInOutputDir()) {
156 if (result_file_name.empty()) {
157 result_file_name = subDomain()->exportDirectory().file(
"compare.xml");
160 result_file_name = subDomain()->exportDirectory().file(result_file_name);
163 if (reference_file_name.empty()) {
164 reference_file_name = subDomain()->exportDirectory().file(
"check");
167 reference_file_name = subDomain()->exportDirectory().file(reference_file_name);
171 if (result_file_name.empty()) {
172 result_file_name =
"compare.xml";
175 if (reference_file_name.empty()) {
176 reference_file_name =
"check";
180 verifier_service->setResultFileName(result_file_name);
182 info() <<
"Verification check is_parallel?=" << is_parallel <<
" compare_from_sequential?=" << compare_from_sequential;
183 verifier_service->setFileName(reference_file_name);
185 if (options()->generate()){
186 info() <<
"Writing check file '" << reference_file_name <<
"'";
187 verifier_service->writeReferenceFile();
190 info() <<
"Comparing reference file '" << reference_file_name <<
"'";
191 verifier_service->doVerifFromReferenceFile(compare_from_sequential,
false);
198ARCANE_REGISTER_MODULE_ARCANECEAVERIFIER(ArcaneVerifierModule);
Informations pour construire un module.
void addObserver(T *obj, void(T::*func)(const IObservable &), IObservable *oba)
Ajoute un observateur.
Informations sur une version.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.