From 051beaad28975c1deab4deaef9ab5b6b9529fdf3 Mon Sep 17 00:00:00 2001
From: Johannes Schumann <johannes.schumann@fau.de>
Date: Thu, 9 Sep 2021 14:41:49 +0200
Subject: [PATCH] Write jobcard to output directory for both run modes

---
 km3buu/ctrl.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/km3buu/ctrl.py b/km3buu/ctrl.py
index ebf63e2..d0dfe4b 100644
--- a/km3buu/ctrl.py
+++ b/km3buu/ctrl.py
@@ -79,6 +79,8 @@ def run_jobcard(jobcard, outdir, container=False):
         jobcard["neutrino_induced"]["FileNameflux"] = tmp_fluxfile
     with open(jobcard_fpath, "w") as f:
         f.write(str(jobcard))
+    with open(join(outdir, jobcard.filename), "w") as f:
+        f.write(str(jobcard))
     if container:
         check_singularity_version()
         log.info("Create temporary file for associated runscript")
@@ -92,8 +94,6 @@ def run_jobcard(jobcard, outdir, container=False):
             bind=[outdir, input_dir.name],
             return_result=True,
         )
-        with open(join(outdir, jobcard.filename), "w") as f:
-            f.write(str(jobcard))
         msg = output["message"]
         if isinstance(msg, str):
             log.info("GiBUU output:\n %s" % msg)
-- 
GitLab