MAIA bb96820c
Multiphysics at AIA
|
#include <context.h>
Static Public Member Functions | |
static void | readPropertyFile (FileType, const MString &fileName) |
static MInt | propertyLength (const MString &name, MInt solverId=m_noSolvers) |
Returns the number of elements of a property. More... | |
static void | assertPropertyLength (const MString &name, const MInt length, const MInt solverId=m_noSolvers) |
Assert that the length of a property matches the given length. More... | |
static MInt | propertySolverId (const MString &name, MInt solverId=m_noSolvers) |
Returns the number of elements of a property. More... | |
static MBool | propertyExists (const MString &name, MInt solver=m_noSolvers) |
This function checks if a property exists in general. More... | |
static MBool | solverPropertyExists (const MString &name, MInt solver) |
Checks existence of a solver property details This function returns true, if the solver property with the requested name exists for the requested solver. More... | |
static void | clear () |
static void | init () |
This intializes the property Map. More... | |
static void | addProperty (MProperty *) |
This method adds properties. More... | |
static void | writeProperties (char *fileName) |
static void | writePropertiesHumanReadable () |
Write the properties into a text file. More... | |
static void | initializationProcessFinished () |
Sets flag to forbide property access. More... | |
static void | communicateProperties () |
Communicates properties to check if default falues match. More... | |
static std::list< MProperty * > * | receiveProperties (MInt rank) |
Receives a property list from another cpu. More... | |
static void | sendProperties (MInt rank) |
Sends the property list to another cpu. More... | |
static void | checkPropertyViolation (MInt partnerrank, std::list< MProperty * > *prop) |
Checks if local properties differ from received properties. More... | |
static MString | propertyFileName () |
Return name of most recently read property file. More... | |
static MString | propertyFileText () |
Return unprocessed content of most recently read property file. More... | |
static void | dump (const MString &fileName) |
Dump all properties to text file. More... | |
template<typename T > | |
static T | getBasicProperty (const MString name, const MString &nameOfCallingFunction, const T *default_value, MInt pos=0) |
template<typename T > | |
static T | getBasicProperty (const MString name, const MString &nameOfCallingFunction, MInt pos=0) |
template<typename T > | |
static T | getSolverProperty (const MString name, const MInt solverId, const MString &nameOfCallingFunction, const T *default_value, MInt pos=0) |
template<typename T > | |
static T | getSolverProperty (const MString name, const MInt solverId, const MString &nameOfCallingFunction, MInt pos=0) |
Static Private Member Functions | |
template<typename T , typename F > | |
static T | getBasicPropertyImplicit (const MString &nameOfCallingFunction, const MString &name, MBool has_default, const T *defaultValue, MInt position, F &&f) |
Returns the value of the requested basic level property (implicit). More... | |
static MInt | getBasicPropertyOverloaded (const MString &nameOfCallingFunction, const MString &name, MBool has_default, const MInt *default_value, MInt pos) |
static MFloat | getBasicPropertyOverloaded (const MString &nameOfCallingFunction, const MString &name, MBool has_default, const MFloat *default_value, MInt pos) |
static MString | getBasicPropertyOverloaded (const MString &nameOfCallingFunction, const MString &name, MBool has_default, const MString *default_value, MInt pos) |
Returns the value of the requested basic property. overloaded. More... | |
static MBool | getBasicPropertyOverloaded (const MString &nameOfCallingFunction, const MString &name, MBool has_default, const MBool *default_value, MInt pos) |
template<typename T , typename F > | |
static T | getSolverPropertyImplicit (const MString &nameOfCallingFunction, const MString &name, const MInt solverId, MBool has_default, const T *defaultValue, MInt position, F &&f) |
Returns the value of the requested solver property (implicit). More... | |
static MInt | getSolverPropertyOverloaded (const MString &nameOfCallingFunction, const MString &name, const MInt solverId, MBool has_default, const MInt *default_value, MInt pos) |
static MFloat | getSolverPropertyOverloaded (const MString &nameOfCallingFunction, const MString &name, const MInt solverId, MBool has_default, const MFloat *default_value, MInt pos) |
static MString | getSolverPropertyOverloaded (const MString &nameOfCallingFunction, const MString &name, const MInt solverId, MBool has_default, const MString *default_value, MInt pos) |
Returns the value of the requested solver property. overloaded. More... | |
static MBool | getSolverPropertyOverloaded (const MString &nameOfCallingFunction, const MString &name, const MInt solverId, MBool has_default, const MBool *default_value, MInt pos) |
static MBool | isSameValue (const MFloat v1, const MFloat v2) |
static MBool | isSameValue (const MBool v1, const MBool v2) |
static MBool | isSameValue (const MInt v1, const MInt v2) |
static MBool | isSameValue (const MString v1, const MString v2) |
Static Private Attributes | |
static IONetcdf * | m_IONetcdf |
static IOToml * | m_IOToml |
static MString | m_name |
static MInt | m_noSolvers |
static propertyMap * | m_propertyMap |
static propertyMap * | m_propertyMapLowercase |
static zoneMap * | m_zoneMap |
static assembly * | m_assembly |
static std::pair< propertyMap::iterator, propertyMap::iterator > | m_pair |
static MString | m_propertyFileOutputName |
static MString | m_propertyFileText |
static MInt | m_fileType |
static MBool | m_checkingProperties |
This class manages the properties that are used in the MAIA. The functions and members are statical so that you can acces the properties from every where within the program. The class only stores the pointers to the property structs, and not the structs themselves. For storing those pointers a STL multimap is used with the names of the properties as keys. The class has two template functions for a more convienient useage. To get a basic property, simply call the getBasicProperty() function, with the property name. Furthermore, you can specify a default value and a the position, in case the property is an array. To get a solver specific property, simply call the getSolverProperty() function, with the property name and the solverId. Furthermore, you can specify a default value and a the position, in case the property is an array.
|
static |
Definition at line 453 of file context.cpp.
|
static |
Check the length of a given property, terminate if it does not match the given length.
Definition at line 559 of file context.cpp.
[in] | the | rank the partner cpu |
[in] | the | property list of the other cpu |
This function checks if local properties differ from the properties received from the children and stops the program if values differ.
Definition at line 1256 of file context.cpp.
|
static |
This method deletes the property structs. It runs over all elements of the propertyMap and zoneMap and deletes the individual structs. Finally the zoneMap and propertyMap are deleted.
Definition at line 418 of file context.cpp.
|
static |
This function communicates properties available in the property map in a tree-like structure and is called in environment->run().
Definition at line 773 of file context.cpp.
|
static |
Definition at line 1362 of file context.cpp.
|
inlinestatic |
Definition at line 149 of file context.h.
|
inlinestatic |
|
staticprivate |
This template function searchs for a certain property given as an argument (name). If the property exists, it will be returned. If the property does not exist, the default value will be returned (if one is given). If there is also no defaultValue, the code exits with an error.
Definition at line 126 of file context.cpp.
|
staticprivate |
Definition at line 227 of file context.cpp.
|
staticprivate |
Definition at line 212 of file context.cpp.
|
staticprivate |
Definition at line 197 of file context.cpp.
|
staticprivate |
The following 4 (one for MInt, MFloat, MString, MBool) functions provide a value for the template funtion getBasicProperty. They receive their value from the implicite function getBasicPropertyImplicit. For debugging 'MAIA_PRINT_PROPERTIES' can be defined in config.h. Each of the overloaded functions will than print the property name and corresponding value or default value to a file. This can extend the simulation time.
Definition at line 183 of file context.cpp.
|
inlinestatic |
Definition at line 168 of file context.h.
|
inlinestatic |
Definition at line 178 of file context.h.
|
staticprivate |
This template function searchs for a certain property of a certain solver given as an argument (name, solverId). If the property exists, it will be returned. If the property does not exist, the basic property will be returned. If also the basic property does not exist, the default value will be returned (if one is given). If there is also no defaultValue, the code exits with an error.
Definition at line 265 of file context.cpp.
|
staticprivate |
Definition at line 380 of file context.cpp.
|
staticprivate |
Definition at line 361 of file context.cpp.
|
staticprivate |
Definition at line 343 of file context.cpp.
|
staticprivate |
The following 4 (one for MInt, MFloat, MString, MBool) functions provide a value for the template funtion getSolverProperty. They receive their value from the implicite function getSolverPropertyImplicit
Definition at line 324 of file context.cpp.
|
static |
Use ts function if you want to create a new property list. If you want to load properties from file use the function readPropertyFile.
Definition at line 482 of file context.cpp.
|
static |
not yet activate, remove the comment
Definition at line 745 of file context.cpp.
|
static |
Definition at line 494 of file context.cpp.
|
static |
This function returns the number of elements of a property. If the property exists, it returns the value given by the function count(), which is implemented in property.cpp
Definition at line 538 of file context.cpp.
|
static |
This function returns the number of elements of a property. If the property exists, it returns its solverId
Definition at line 576 of file context.cpp.
[in] | the | rank of the processor to commuicate with |
This function receives the properties from a given cpu in the following order
At the end a list of of received properties is built and returned for further investigations.
Definition at line 866 of file context.cpp.
|
static |
[in] | the | rank of the processor to commuicate with |
This function sends the own properties to a cpu given by rank. The properties are sent in the following order
Definition at line 1052 of file context.cpp.
Definition at line 519 of file context.cpp.
|
static |
|
static |
This function closes the properties stream and writes all properties in the propertyMap to the same file including extra information like the number of accesses
Definition at line 600 of file context.cpp.
|
staticprivate |
|
staticprivate |
|
staticprivate |