feat: Error reporting at the end of the simulatiuon #3929
feat: Error reporting at the end of the simulatiuon #3929
Conversation
…/catch in main)": remove useless try/catch
…y spaces. The previous condition checked whether an argument was present and whether the option was immediately followed by a value like -test"value", which excluded valid cases like -test "value" et -test "value".
… an exception and not an error
…hry/create-yaml-file-and-structure
…sufficient id usage
…to feat/dudes/warning-report
…S-DEV/GEOS into refactor/dudes/error-context
MelReyCG
left a comment
There was a problem hiding this comment.
Preliminary review.
It seems like you're not based on the right branch, you can base it on the "centralization" PR.
Can you comment or split your data processing code? (The one in initializeEnvironment.cpp)
| /** | ||
| * @enum Type | ||
| * Enum listing the different types of possibleLogPart | ||
| */ | ||
| enum class Type | ||
| { | ||
| MeshGeneration, | ||
| NumericalMethods, | ||
| ImportFields, | ||
| Timestep, | ||
| }; |
There was a problem hiding this comment.
I'm really not into having this at this level of the application.
Maybe a (bi-)map given at ProblemManager level would be better.
| * Store contextual information about the error that occurred and assign it a priority | ||
| * default is 0 | ||
| */ | ||
| struct ErrorContext |
| * @brief Hierarchical storage of message statistics | ||
| * Structure: LogPart -> MsgType -> SourceLocation -> Statistics | ||
| */ | ||
| stdMap< LogPart::Type, stdMap< MsgType, stdMap< MsgStatistics::LocationKey, MsgStatistics > > > m_messageCounts; |
There was a problem hiding this comment.
stdMap< std::tuple< LogPart::Type, MsgType, MsgStatistics::LocationKey >, MsgStatistics >?
There was a problem hiding this comment.
A struct can be nice too! (better for lisibility)
| } | ||
|
|
||
| // Allows to know how much data each rank will send | ||
| MpiWrapper::gather( &numValues, 1, recvCounts.data(), 1, 0, MPI_COMM_GEOS ); |
There was a problem hiding this comment.
I have the feeling that all of that data processing should be kept in the LogHistory class, not here.
| LogPart numericalMethodLog( EnumStrings< LogPart::Type >::toString( LogPart::Type::NumericalMethods ), MpiWrapper::commRank() == 0 ); | ||
| numericalMethodLog.begin(); | ||
| applyNumericalMethods(); | ||
| GEOS_WARNING( "plouf" ); |
…to feat/dudes/warning-report
| struct MsgStatistics | ||
| { | ||
| /// Key identifying the source location | ||
| using LocationKey = std::pair< std::array< char, 200 >, integer >; |
There was a problem hiding this comment.
todo: change to variable size string
| buffer_unit_type * local_buffer_logPart = new buffer_unit_type[ sizeof(LogPart::Type) ](); | ||
| buffer_unit_type * local_buffer_logPart_cpy = local_buffer_logPart; |
There was a problem hiding this comment.
| buffer_unit_type * local_buffer_logPart = new buffer_unit_type[ sizeof(LogPart::Type) ](); | |
| buffer_unit_type * local_buffer_logPart_cpy = local_buffer_logPart; | |
| buffer_unit_type * local_buffer_logPart = new buffer_unit_type[ sizeof(LogPart::Type) ](); | |
| buffer_unit_type * local_buffer_logPart_iter = local_buffer_logPart; |
and reset iterator when needed
- camel case
Will be merged after : #3902
Located after MemoryStatsOutput :
Ex :