Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pyoptsparse/pySNOPT/pySNOPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
pySNOPT - A variation of the pySNOPT wrapper specifically designed to
work with sparse optimization problems.
"""

# Standard Python modules
import datetime
import os
import re
import sys
import time
from typing import Any, Dict, Optional, Tuple

Expand Down Expand Up @@ -259,6 +261,9 @@ def __call__(
self.startTime = time.time()
self.callCounter = 0
self.storeSens = storeSens
# flush the output streams
sys.stdout.flush()
sys.stderr.flush()

# Store the starting time if the keyword timeLimit is given:
self.timeLimit = timeLimit
Expand Down Expand Up @@ -513,6 +518,8 @@ def __call__(
"pi": pi,
}

self._on_flushFiles()

else: # We are not on the root process so go into waiting loop:
self._waitLoop()
restartDict = None
Expand Down Expand Up @@ -559,10 +566,7 @@ def _userfg_wrap(self, mode, nnJac, x, fobj, gobj, fcon, gcon, nState, cu, iu, r
elif fail == 2:
mode = -2

# Flush the files to the buffer for all the people who like to
# monitor the residual
snopt.pyflush(self.getOption("iPrint"))
snopt.pyflush(self.getOption("iSumm"))
self._on_flushFiles()

# Check if we've exceeded the timeLimit
if self.timeLimit is not None:
Expand Down