Repository navigation
Stop on failed output writes, and fix the output write time and size #3028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,6 +122,12 @@ class CParallelDataSorter{ | |
| void PrepareSendBuffers(std::vector<unsigned long>& globalID); | ||
|
|
||
| public: | ||
| /*! | ||
| * \brief Stop with an error if count * entries does not fit in an int (node IDs and MPI counts are int). | ||
| * \param[in] count - Number of items. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: |
||
| * \param[in] entries - Number of int entries per item. | ||
| */ | ||
| static void CheckIntCount(unsigned long count, unsigned long entries = 1); | ||
|
|
||
| /*! | ||
| * \brief Constructor | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,12 @@ | |
| #include "../../../include/output/filewriter/CParallelDataSorter.hpp" | ||
| #include <cassert> | ||
| #include <numeric> | ||
| #include <limits> | ||
|
|
||
| void CParallelDataSorter::CheckIntCount(unsigned long count, unsigned long entries) { | ||
| if (entries && count > static_cast<unsigned long>(std::numeric_limits<int>::max()) / entries) | ||
| SU2_MPI::Error("Output exceeds the supported 32-bit node ID or MPI count range", CURRENT_FUNCTION); | ||
| } | ||
|
|
||
| CParallelDataSorter::CParallelDataSorter(CConfig *config, const vector<string> &valFieldNames) : | ||
| rank(SU2_MPI::GetRank()), | ||
|
|
@@ -240,6 +246,8 @@ void CParallelDataSorter::SortOutputData() { | |
| } | ||
|
|
||
| void CParallelDataSorter::PrepareSendBuffers(std::vector<unsigned long>& globalID){ | ||
| CheckIntCount(nGlobalPointBeforeSort); | ||
| CheckIntCount(nLocalPointsBeforeSort); | ||
|
|
||
| unsigned long iPoint; | ||
| unsigned short iProcessor; | ||
|
|
@@ -281,7 +289,9 @@ void CParallelDataSorter::PrepareSendBuffers(std::vector<unsigned long>& globalI | |
| if ((ii != rank) && (nPoint_Send[ii+1] > 0)) nSends++; | ||
| if ((ii != rank) && (nPoint_Recv[ii+1] > 0)) nRecvs++; | ||
|
|
||
| CheckIntCount(static_cast<unsigned long>(nPoint_Send[ii]) + nPoint_Send[ii+1], 1); | ||
| nPoint_Send[ii+1] += nPoint_Send[ii]; | ||
| CheckIntCount(static_cast<unsigned long>(nPoint_Recv[ii]) + nPoint_Recv[ii+1], 1); | ||
| nPoint_Recv[ii+1] += nPoint_Recv[ii]; | ||
| } | ||
|
|
||
|
|
@@ -378,6 +388,7 @@ void CParallelDataSorter::SetTotalElements(){ | |
|
|
||
| nElemGlobal = std::accumulate(nElemPerTypeGlobal.begin(), nElemPerTypeGlobal.end(), 0ul); | ||
| nElem = std::accumulate(nElemPerType.begin(), nElemPerType.end(), 0ul); | ||
| CheckIntCount(nElemGlobal); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Large meshes are rejected although the global element count is never stored as an int.
Example: a tet mesh with 2.3e9 elements and ~4e8 nodes fits everywhere it matters, but this check aborts the run at its first output. Suggestion: drop the global element check, and check only the per-rank element/connectivity counts and the global node count. |
||
|
|
||
| nConn = 0; | ||
| nConnGlobal = 0; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-existing, but this PR now feeds the result into the bandwidth report.
DetermineFilesize(line 86) returns-1cast tounsigned longwhenstatfails. That value now reachesUpdateBandwidth. For example, a build without TecIO that asks forTECPLOT_BINARYwrites no file, so the file size becomes ~1.8e19 and the reported bandwidth is absurd.Suggestion: return 0 (or report the error) when
statfails.