Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions arcane/src/arcane/launcher/ArcaneLauncher.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* ArcaneLauncher.cc (C) 2000-2023 */
/* ArcaneLauncher.cc (C) 2000-2024 */
/* */
/* Classe gérant le lancement de l'exécution. */
/*---------------------------------------------------------------------------*/
Expand All @@ -26,6 +26,8 @@
#include "arcane/utils/ParameterList.h"
#include "arcane/utils/Ref.h"
#include "arcane/utils/ConcurrencyUtils.h"
#include "arcane/utils/internal/ParallelLoopOptionsProperties.h"
#include "arcane/utils/internal/ApplicationInfoProperties.h"

#include "arcane/impl/ArcaneMain.h"
#include "arcane/impl/ArcaneSimpleExecutor.h"
Expand Down Expand Up @@ -102,7 +104,7 @@
if (config.null())
return;
std::cout << "READING CONFIG\n";
properties::readFromJSON(config,app_info);
properties::readFromJSON<ApplicationInfo,ApplicationInfoProperties>(config,app_info);

Check warning on line 107 in arcane/src/arcane/launcher/ArcaneLauncher.cc

View check run for this annotation

Codecov / codecov/patch

arcane/src/arcane/launcher/ArcaneLauncher.cc#L107

Added line #L107 was not covered by tests
}

/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -322,20 +324,22 @@
if (global_has_init_done)
ARCANE_FATAL("ArcaneLauncher::init() has already been called");
global_has_init_done = true;
applicationInfo().setCommandLineArguments(args);
auto& application_info = applicationInfo();
application_info.setCommandLineArguments(args);
bool do_list = false;
if (do_list)
_listPropertySettings();
const CommandLineArguments& cargs = applicationInfo().commandLineArguments();
String runtime_config_file_name = cargs.getParameter("RuntimeConfigFile");
if (!runtime_config_file_name.empty())
_checkReadConfigFile(runtime_config_file_name);
properties::readFromParameterList<ApplicationInfo,ApplicationInfoProperties>(args.parameters(),application_info);
auto& dotnet_info = ArcaneLauncher::dotNetRuntimeInitialisationInfo();
properties::readFromParameterList(args.parameters(),dotnet_info);
auto& accelerator_info = ArcaneLauncher::acceleratorRuntimeInitialisationInfo();
properties::readFromParameterList(args.parameters(),accelerator_info);
ParallelLoopOptions loop_options;
properties::readFromParameterList(args.parameters(),loop_options);
properties::readFromParameterList<ParallelLoopOptions,ParallelLoopOptionsProperties>(args.parameters(),loop_options);
TaskFactory::setDefaultParallelLoopOptions(loop_options);
}
catch(const Exception& ex){
Expand Down
12 changes: 8 additions & 4 deletions arcane/src/arcane/utils/ApplicationInfo.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* ApplicationInfo.cc (C) 2000-2020 */
/* ApplicationInfo.cc (C) 2000-2024 */
/* */
/* Informations sur une application. */
/*---------------------------------------------------------------------------*/
Expand All @@ -17,6 +17,7 @@
#include "arcane/utils/PlatformUtils.h"
#include "arcane/utils/List.h"
#include "arcane/utils/Property.h"
#include "arcane/utils/internal/ApplicationInfoProperties.h"

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -443,7 +444,10 @@ addParameterLine(const String& line)
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

template<typename V> void ApplicationInfo::
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

template<typename V> void ApplicationInfoProperties::
_applyPropertyVisitor(V& p)
{
auto b = p.builder();
Expand Down Expand Up @@ -486,7 +490,7 @@ _applyPropertyVisitor(V& p)
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

ARCANE_REGISTER_PROPERTY_CLASS(ApplicationInfo,());
ARCANE_REGISTER_PROPERTY_CLASS(ApplicationInfoProperties,());

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
Expand Down
6 changes: 2 additions & 4 deletions arcane/src/arcane/utils/ApplicationInfo.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* ApplicationInfo.h (C) 2000-2020 */
/* ApplicationInfo.h (C) 2000-2024 */
/* */
/* Informations sur une application. */
/*---------------------------------------------------------------------------*/
Expand All @@ -17,7 +17,6 @@
#include "arcane/utils/VersionInfo.h"
#include "arcane/utils/String.h"
#include "arcane/utils/UtilsTypes.h"
#include "arcane/utils/PropertyDeclarations.h"

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
Expand All @@ -38,7 +37,6 @@ class CommandLineArguments;
*/
class ARCANE_UTILS_EXPORT ApplicationInfo
{
ARCANE_DECLARE_PROPERTY_CLASS(ApplicationInfo);
public:

ApplicationInfo();
Expand Down
10 changes: 5 additions & 5 deletions arcane/src/arcane/utils/JSONPropertyReader.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* JSONPropertyReader.h (C) 2000-2020 */
/* JSONPropertyReader.h (C) 2000-2024 */
/* */
/* Lecture de propriétés au format JSON. */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -59,15 +59,15 @@
* Les valeurs de la propriété doivent être dans un élément fils de \a jv
* dont le nom est celui de la classe \a T.
*/
template<typename T> inline void
template<typename T, typename PropertyType = T> inline void
readFromJSON(JSONValue jv,T& instance)
{
const char* instance_property_name = T :: propertyClassName();
const char* instance_property_name = PropertyType :: propertyClassName();

Check warning on line 65 in arcane/src/arcane/utils/JSONPropertyReader.h

View check run for this annotation

Codecov / codecov/patch

arcane/src/arcane/utils/JSONPropertyReader.h#L65

Added line #L65 was not covered by tests
JSONValue child_value = jv.child(instance_property_name);
if (child_value.null())
return;
JSONPropertyReader reader(child_value,instance);
T :: applyPropertyVisitor(reader);
PropertyType :: applyPropertyVisitor(reader);

Check warning on line 70 in arcane/src/arcane/utils/JSONPropertyReader.h

View check run for this annotation

Codecov / codecov/patch

arcane/src/arcane/utils/JSONPropertyReader.h#L70

Added line #L70 was not covered by tests
}

/*---------------------------------------------------------------------------*/
Expand Down
9 changes: 5 additions & 4 deletions arcane/src/arcane/utils/ParallelLoopOptions.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* ParallelLoopOptions.cc (C) 2000-2022 */
/* ParallelLoopOptions.cc (C) 2000-2024 */
/* */
/* Options de configuration pour les boucles parallèles en multi-thread. */
/*---------------------------------------------------------------------------*/
Expand All @@ -15,6 +15,7 @@

#include "arcane/utils/Property.h"
#include "arcane/utils/FatalErrorException.h"
#include "arcane/utils/internal/ParallelLoopOptionsProperties.h"

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -57,7 +58,7 @@ namespace
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

template <typename V> void ParallelLoopOptions::
template <typename V> void ParallelLoopOptionsProperties::
_applyPropertyVisitor(V& p)
{
auto b = p.builder();
Expand All @@ -77,7 +78,7 @@ _applyPropertyVisitor(V& p)
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

ARCANE_REGISTER_PROPERTY_CLASS(ParallelLoopOptions, ());
ARCANE_REGISTER_PROPERTY_CLASS(ParallelLoopOptionsProperties, ());

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
Expand Down
7 changes: 2 additions & 5 deletions arcane/src/arcane/utils/ParallelLoopOptions.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* ParallelLoopOptions.h (C) 2000-2022 */
/* ParallelLoopOptions.h (C) 2000-2024 */
/* */
/* Options de configuration pour les boucles parallèles en multi-thread. */
/*---------------------------------------------------------------------------*/
Expand All @@ -15,7 +15,6 @@
/*---------------------------------------------------------------------------*/

#include "arcane/utils/UtilsTypes.h"
#include "arcane/utils/PropertyDeclarations.h"

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
Expand All @@ -34,8 +33,6 @@ namespace Arcane
*/
class ARCANE_UTILS_EXPORT ParallelLoopOptions
{
ARCANE_DECLARE_PROPERTY_CLASS(ParallelLoopOptions);

private:

//! Drapeau pour indiquer quels champs ont été positionnés.
Expand Down
12 changes: 6 additions & 6 deletions arcane/src/arcane/utils/ParameterListPropertyReader.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* ParameterListPropertyReader.h (C) 2000-2021 */
/* ParameterListPropertyReader.h (C) 2000-2024 */
/* */
/* Lecture de propriétés au format JSON. */
/*---------------------------------------------------------------------------*/
Expand All @@ -30,7 +30,7 @@ namespace Arcane::properties
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
//! \internal
template<typename T>
template<typename T, typename PropertyType = T>
class ParameterListPropertyVisitor
: public properties::PropertyVisitor<T>
{
Expand Down Expand Up @@ -61,11 +61,11 @@ class ParameterListPropertyVisitor
/*!
* \brief Remplit les valeurs de \a instance à partir des paramètres \a args.
*/
template<typename T> inline void
template<typename T, typename PropertyType = T> inline void
readFromParameterList(const ParameterList& args,T& instance)
{
ParameterListPropertyVisitor reader(args,instance);
T :: applyPropertyVisitor(reader);
ParameterListPropertyVisitor<T,PropertyType> reader(args,instance);
PropertyType :: applyPropertyVisitor(reader);
}

/*---------------------------------------------------------------------------*/
Expand Down
11 changes: 6 additions & 5 deletions arcane/src/arcane/utils/PropertyDeclarations.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* PropertyDeclarations.h (C) 2000-2020 */
/* PropertyDeclarations.h (C) 2000-2024 */
/* */
/* Déclaration des types et macros pour la gestion des propriétés. */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -57,12 +57,13 @@ class PropertyDeclaration
* class MyClass
* {
* public:
* ARCANE_DECLARE_PROPERTY_CLASS(MyClass);
* ARCANE_DECLARE_PROPERTY_CLASS(MyClass,InstanceType);
* };
* \endcode
*/
#define ARCANE_DECLARE_PROPERTY_CLASS(class_name)\
#define ARCANE_DECLARE_PROPERTY_CLASS(class_name) \
public:\
using PropertyInstanceType = class_name; \
static const char* propertyClassName() { return #class_name; }\
template<typename V> static void _applyPropertyVisitor(V& visitor);\
static void applyPropertyVisitor(Arcane::properties::PropertyVisitor<class_name>& p); \
Expand Down Expand Up @@ -109,7 +110,7 @@ namespace\
}\
}\
void aclass :: \
applyPropertyVisitor(Arcane::properties::PropertyVisitor<aclass>& p)\
applyPropertyVisitor(Arcane::properties::PropertyVisitor<typename aclass :: PropertyInstanceType >& p) \
{\
aclass :: _applyPropertyVisitor(p);\
}\
Expand Down
45 changes: 45 additions & 0 deletions arcane/src/arcane/utils/internal/ApplicationInfoProperties.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* ApplicationInfoProperties.h (C) 2000-2024 */
/* */
/* Informations sur une application. */
/*---------------------------------------------------------------------------*/
#ifndef ARCANE_UTILS_INTERNAL_APPLICATIONINFOPROPERTIES_H
#define ARCANE_UTILS_INTERNAL_APPLICATIONINFOPROPERTIES_H
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

#include "arcane/utils/ApplicationInfo.h"
#include "arcane/utils/PropertyDeclarations.h"

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

namespace Arcane
{

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/*!
* \brief Informations sur une application.
*/
class ARCANE_UTILS_EXPORT ApplicationInfoProperties
: public ApplicationInfo
{
ARCANE_DECLARE_PROPERTY_CLASS(ApplicationInfo);

Check warning on line 34 in arcane/src/arcane/utils/internal/ApplicationInfoProperties.h

View check run for this annotation

Codecov / codecov/patch

arcane/src/arcane/utils/internal/ApplicationInfoProperties.h#L34

Added line #L34 was not covered by tests
};

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

} // namespace Arcane

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

#endif
Loading
Loading