Skip to content

Commit 5e4ecea

Browse files
authored
Merge branch 'develop' into bugfix/su2py-run-command-stderr-deadlock
2 parents c456cd1 + f27b335 commit 5e4ecea

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

SU2_PY/OptimalPropeller.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,29 +344,29 @@ def write_external_file(CTrs, CPrs):
344344
# Automatically plot the computed propeller performance.
345345

346346
pl.figure(1)
347-
pl.plot(r, dCt_optimal, "r", markersize=4, label="$\\frac{dCT}{d\overline{r}}$")
348-
pl.plot(r, dCp, "k", markersize=4, label="$\\frac{dCP}{d\overline{r}}$")
347+
pl.plot(r, dCt_optimal, "r", markersize=4, label=r"$\frac{dCT}{d\overline{r}}$")
348+
pl.plot(r, dCp, "k", markersize=4, label=r"$\frac{dCP}{d\overline{r}}$")
349349
pl.grid(True)
350350
pl.legend(numpoints=3)
351-
pl.xlabel("$\overline{r}$")
351+
pl.xlabel(r"$\overline{r}$")
352352
pl.ylabel("")
353353
pl.title("Load Distribution")
354354

355355
pl.figure(2)
356-
pl.plot(chi, a_optimal, "r", markersize=4, label="$a$")
357-
pl.plot(chi, ap_optimal, "k", markersize=4, label="$a^1$")
356+
pl.plot(chi, a_optimal, "r", markersize=4, label=r"$a$")
357+
pl.plot(chi, ap_optimal, "k", markersize=4, label=r"$a^1$")
358358
pl.grid(True)
359359
pl.legend(numpoints=3)
360-
pl.xlabel("$\chi$")
360+
pl.xlabel(r"$\chi$")
361361
pl.ylabel("")
362362
pl.title("Interference Factors")
363363

364364
if prandtl_correction:
365365
pl.figure(3)
366366
pl.plot(r, F, "k", markersize=4)
367367
pl.grid(True)
368-
pl.xlabel("$\overline{r}$")
369-
pl.ylabel("$F(\overline{r})$")
368+
pl.xlabel(r"$\overline{r}$")
369+
pl.ylabel(r"$F(\overline{r})$")
370370
pl.title("Tip Loss Prandtl Correction Function")
371371

372372
pl.show()

SU2_PY/SU2/run/interface.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,17 @@ def run_command(Command):
271271

272272
# Avoid potential deadlocks when a child process writes heavily to stderr:
273273
# read stderr via communicate() while streaming stdout to the console.
274+
# Use communicate() to continuously drain stderr and avoid deadlocks if the
275+
# subprocess writes a lot of output to stderr.
274276
proc = subprocess.Popen(
275277
Command, shell=True, stdout=sys.stdout, stderr=subprocess.PIPE
276278
)
277279
_, stderr = proc.communicate()
278280

279281
return_code = proc.returncode
280282
message = (stderr or b"").decode(errors="replace")
283+
return_code = proc.returncode
284+
message = stderr.decode(errors="replace")
281285

282286
if return_code < 0:
283287
message = "SU2 process was terminated by signal '%s'\n%s" % (

SU2_PY/parallel_computation_fsi.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ def parallel_computation(filename, partitions=0, compute=True):
102102
config.SOLUTION_FILENAME = config.RESTART_FILENAME
103103
elif config.SOLVER == "FLUID_STRUCTURE_INTERACTION":
104104
config.SOLUTION_FILENAME = config.RESTART_FILENAME
105-
config.SOLUTION_FILENAME = config.RESTART_FILENAME
106105

107106
info = SU2.run.merge(config)
108107
state.update(info)

0 commit comments

Comments
 (0)