Skip to content

fix: run module subprocess exit properly on failing - #826

Merged
Revathyvenugopal162 merged 30 commits into
mainfrom
fix/mpi-options
Jun 4, 2025
Merged

fix: run module subprocess exit properly on failing#826
Revathyvenugopal162 merged 30 commits into
mainfrom
fix/mpi-options

Conversation

@Revathyvenugopal162

@Revathyvenugopal162 Revathyvenugopal162 commented Jun 2, 2025

Copy link
Copy Markdown
Contributor

fix #591

output preview


(.venv) PS > python .\dyna_without_input.py
LS-DYNA completed with warnings or errors in the log.
Check the log file for details: <folder_name>\lsrun.out.txt

Additional info

  • The original subprocess.run() approach was unreliable in detecting LS-DYNA run failures because it used stderr=subprocess.PIPE, causing CalledProcessError.stderr to be None. This made it hard to capture and propagate meaningful error information.LS-DYNA doesn't print to stdout, so Popen(..., stdout=PIPE) just hangs.
  • Additionally, since LS-DYNA execution is long-running, a blocking subprocess call without feedback caused misleading behavior in long runs and potential hangs.
  • The script now uses subprocess.Popen() combined with polling to monitor lsrun.out.txt for errors/warnings, providing real-time detection and logging

@github-actions github-actions Bot added the fix Pull requests related to resolving problems or errors label Jun 2, 2025
Comment thread src/ansys/dyna/core/run/windows_runner.py Outdated
@Revathyvenugopal162 Revathyvenugopal162 changed the title fix: run module subprocess return fix: run module subprocess exit properly on failing Jun 4, 2025
@Revathyvenugopal162
Revathyvenugopal162 marked this pull request as ready for review June 4, 2025 14:04
@Revathyvenugopal162
Revathyvenugopal162 requested a review from a team as a code owner June 4, 2025 14:04
@Revathyvenugopal162
Revathyvenugopal162 enabled auto-merge (squash) June 4, 2025 14:45
@Revathyvenugopal162
Revathyvenugopal162 merged commit 57e71f4 into main Jun 4, 2025
@Revathyvenugopal162
Revathyvenugopal162 deleted the fix/mpi-options branch June 4, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests related to resolving problems or errors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run_dyna API doesn't exit on error

3 participants