Commit 7a3136f6 authored by Pierre Augier's avatar Pierre Augier
Browse files

Run pythran in verbose mode when transonic is run in verbose mode

parent 4309e536a32c
Pipeline #22594 passed with stage
in 10 minutes and 12 seconds
...@@ -28,6 +28,7 @@ import hashlib ...@@ -28,6 +28,7 @@ import hashlib
import sys import sys
import os import os
from datetime import datetime from datetime import datetime
import logging
from transonic import mpi from transonic import mpi
from transonic.mpi import Path, PathSeq from transonic.mpi import Path, PathSeq
...@@ -161,6 +162,11 @@ class SchedulerPopen: ...@@ -161,6 +162,11 @@ class SchedulerPopen:
if logger.is_enable_for("debug"): if logger.is_enable_for("debug"):
update_flags("-v") update_flags("-v")
if logger.getEffectiveLevel() <= logging.INFO:
env = dict(os.environ, TRANSONIC_DEBUG="1")
else:
env = None
words_command = [ words_command = [
sys.executable, sys.executable,
"-m", "-m",
...@@ -182,13 +188,18 @@ class SchedulerPopen: ...@@ -182,13 +188,18 @@ class SchedulerPopen:
process = None process = None
if mpi.rank == 0: if mpi.rank == 0:
stdout = stderr = subprocess.PIPE if logger.getEffectiveLevel() <= logging.INFO:
stdout = stderr = None
else:
stdout = stderr = subprocess.PIPE
process = subprocess.Popen( process = subprocess.Popen(
words_command, words_command,
cwd=cwd, cwd=cwd,
stdout=stdout, stdout=stdout,
stderr=stderr, stderr=stderr,
universal_newlines=True, universal_newlines=True,
env=env,
) )
process = mpi.ShellProcessMPI(process) process = mpi.ShellProcessMPI(process)
......
...@@ -131,12 +131,7 @@ def main(): ...@@ -131,12 +131,7 @@ def main():
path_tmp.with_suffix(".pxd").unlink() path_tmp.with_suffix(".pxd").unlink()
path_tmp.unlink() path_tmp.unlink()
if path_out.exists(): def log_completed_process():
print(f"File {path_out.absolute()} created by {backend}")
else:
logger.error(
f"Error! File {path_out.absolute()} has not been created by {backend}"
)
try: try:
completed_process completed_process
except NameError: except NameError:
...@@ -150,6 +145,16 @@ def main(): ...@@ -150,6 +145,16 @@ def main():
logger.error( logger.error(
f"{backend.capitalize()} stderr:\n{completed_process.stderr}" f"{backend.capitalize()} stderr:\n{completed_process.stderr}"
) )
if path_out.exists():
print(f"File {path_out.absolute()} created by {backend}")
if os.getenv("TRANSONIC_DEBUG"):
log_completed_process()
else:
logger.error(
f"Error! File {path_out.absolute()} has not been created by {backend}"
)
log_completed_process()
sys.exit(1) sys.exit(1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment