Skip to content

Commit 7622b7f

Browse files
committed
fix mpi race conditions, add the VTK hex to the message
1 parent 5167ec1 commit 7622b7f

3 files changed

Lines changed: 30 additions & 11 deletions

File tree

Common/src/grid_movement/CSurfaceMovement.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,14 @@ void CSurfaceMovement::SetParametricCoord(CGeometry* geometry, CConfig* config,
778778
SU2_MPI::Error("The FFD box '" + FFDBox->GetTag() +
779779
"' is not properly defined. The first 4 points must be listed counter\n"
780780
"clockwise, such that applying the right-hand rule results in a vector into the box.\n"
781-
"This is according to the VTK hexahedron ordering. The CCW convention also applies in 2D.",
781+
"This is according to the VTK hexahedron ordering:\n"
782+
" 7 +----+ 6 \n"
783+
" /| /| \n"
784+
" 4 +----+5| \n"
785+
" |3+--|-+ 2 \n"
786+
" |/ |/ \n"
787+
" 0 +----+ 1 \n"
788+
"The CCW convention also applies in 2D, where only the bottom face is specified.",
782789
CURRENT_FUNCTION);
783790
}
784791

TestCases/py_wrapper/custom_heat_flux/run_ad.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,12 @@ def RunPrimal(size):
103103
Returns the final average boundary temperature.
104104
"""
105105
comm = MPI.COMM_WORLD
106+
rank = comm.Get_rank()
106107

107-
with open('config_unsteady.cfg', 'w') as f:
108-
f.write(common_settings.replace('__SIZE__', str(size)) + primal_settings)
108+
if rank == 0:
109+
with open('config_unsteady.cfg', 'w') as f:
110+
f.write(common_settings.replace('__SIZE__', str(size)) + primal_settings)
111+
comm.Barrier()
109112

110113
# Initialize the primal driver of SU2, this includes solver preprocessing.
111114
try:
@@ -154,9 +157,12 @@ def RunAdjoint(size):
154157
size of the domain and to the initial temperature.
155158
"""
156159
comm = MPI.COMM_WORLD
160+
rank = comm.Get_rank()
157161

158-
with open('config_unsteady_ad.cfg', 'w') as f:
159-
f.write(common_settings.replace('__SIZE__', str(size)) + adjoint_settings)
162+
if rank == 0:
163+
with open('config_unsteady_ad.cfg', 'w') as f:
164+
f.write(common_settings.replace('__SIZE__', str(size)) + adjoint_settings)
165+
comm.Barrier()
160166

161167
# Initialize the adjoint driver of SU2, this includes solver preprocessing.
162168
try:

TestCases/py_wrapper/custom_load_fea/run_ad.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,13 @@ def RunPrimal(density, peak_load, height):
117117
Returns the time average objective function.
118118
"""
119119
comm = MPI.COMM_WORLD
120+
rank = comm.Get_rank()
120121

121-
with open('config_unsteady.cfg', 'w') as f:
122-
f.write(common_settings.replace('__DENSITY__', str(density)).replace('__HEIGHT__', str(height)) +
123-
primal_settings)
122+
if rank == 0:
123+
with open('config_unsteady.cfg', 'w') as f:
124+
f.write(common_settings.replace('__DENSITY__', str(density)).replace('__HEIGHT__', str(height)) +
125+
primal_settings)
126+
comm.Barrier()
124127

125128
# Initialize the primal driver of SU2, this includes solver preprocessing.
126129
try:
@@ -155,10 +158,13 @@ def RunAdjoint(density, peak_load, height):
155158
load, to the material density, and to the beam height.
156159
"""
157160
comm = MPI.COMM_WORLD
161+
rank = comm.Get_rank()
158162

159-
with open('config_unsteady_ad.cfg', 'w') as f:
160-
f.write(common_settings.replace('__DENSITY__', str(density)).replace('__HEIGHT__', str(height)) +
161-
adjoint_settings)
163+
if rank == 0:
164+
with open('config_unsteady_ad.cfg', 'w') as f:
165+
f.write(common_settings.replace('__DENSITY__', str(density)).replace('__HEIGHT__', str(height)) +
166+
adjoint_settings)
167+
comm.Barrier()
162168

163169
# Initialize the adjoint driver of SU2, this includes solver preprocessing.
164170
try:

0 commit comments

Comments
 (0)