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
import sys
import os
from datetime import datetime
import logging
from transonic import mpi
from transonic.mpi import Path, PathSeq
......@@ -161,6 +162,11 @@ class SchedulerPopen:
if logger.is_enable_for("debug"):
update_flags("-v")
if logger.getEffectiveLevel() <= logging.INFO:
env = dict(os.environ, TRANSONIC_DEBUG="1")
else:
env = None
words_command = [
sys.executable,
"-m",
......@@ -182,13 +188,18 @@ class SchedulerPopen:
process = None
if mpi.rank == 0:
if logger.getEffectiveLevel() <= logging.INFO:
stdout = stderr = None
else:
stdout = stderr = subprocess.PIPE
process = subprocess.Popen(
words_command,
cwd=cwd,
stdout=stdout,
stderr=stderr,
universal_newlines=True,
env=env,
)
process = mpi.ShellProcessMPI(process)
......
......@@ -131,12 +131,7 @@ def main():
path_tmp.with_suffix(".pxd").unlink()
path_tmp.unlink()
if path_out.exists():
print(f"File {path_out.absolute()} created by {backend}")
else:
logger.error(
f"Error! File {path_out.absolute()} has not been created by {backend}"
)
def log_completed_process():
try:
completed_process
except NameError:
......@@ -150,6 +145,16 @@ def main():
logger.error(
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)
......
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