Skip to content

Commit 69f7911

Browse files
authored
Fix initial inlet profile writing for MPI (#1786)
* marker profiles for all mpi * added MPI Barrier
1 parent 2f6e267 commit 69f7911

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

SU2_CFD/src/CMarkerProfileReaderFVM.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ CMarkerProfileReaderFVM::CMarkerProfileReaderFVM(CGeometry *val_geometry,
6161
if (profile_file.fail()) {
6262
MergeProfileMarkers();
6363
WriteMarkerProfileTemplate();
64+
SU2_MPI::Barrier(SU2_MPI::GetComm());
6465
} else {
6566
ReadMarkerProfile();
6667
}
@@ -202,7 +203,7 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() {
202203
unsigned long iVertex, iMarker;
203204
unsigned long Buffer_Send_nPoin[1], *Buffer_Recv_nPoin = nullptr;
204205
unsigned long nLocalPoint = 0, MaxLocalPoint = 0;
205-
206+
unsigned long maxProfiles = 0;
206207
unsigned long index, iChar;
207208

208209
char str_buf[MAX_STRING_SIZE];
@@ -237,6 +238,7 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() {
237238
SU2_MPI::Gather(&Buffer_Send_nPoin, 1, MPI_UNSIGNED_LONG,
238239
Buffer_Recv_nPoin, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm());
239240
SU2_MPI::Allreduce(&nLocalPoint, &MaxLocalPoint, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm());
241+
SU2_MPI::Allreduce(&numberOfProfiles, &maxProfiles, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm());
240242

241243
/*--- Send and Recv buffers. ---*/
242244

@@ -268,8 +270,8 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() {
268270
nGlobal_InletPoint += Buffer_Recv_nPoin[iProcessor];
269271
}
270272

271-
profileCoords.resize(numberOfProfiles);
272-
for (iMarker = 0; iMarker < numberOfProfiles; iMarker++) {
273+
profileCoords.resize(maxProfiles);
274+
for (iMarker = 0; iMarker < maxProfiles; iMarker++) {
273275
profileCoords[iMarker].resize(dimension);
274276
}
275277

SU2_CFD/src/output/CFlowOutput.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ void CFlowOutput::SetAnalyzeSurface(const CSolver* const*solver, const CGeometry
197197
if (config->GetMarker_All_Analyze(iMarker) == YES) {
198198

199199
for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) {
200+
200201
iPoint = geometry->vertex[iMarker][iVertex]->GetNode();
201202

202203
if (geometry->nodes->GetDomain(iPoint)) {

0 commit comments

Comments
 (0)