From a22b03b11ef56bce6f5621ba7a746727fdfb08f2 Mon Sep 17 00:00:00 2001
From: Soichiro Morisaki <soichiro.morisaki@ligo.org>
Date: Mon, 10 Apr 2023 21:28:12 +0900
Subject: [PATCH] gwcelery/tasks/inference.py: reduce the number of uploaded
 log files for rapidpe failure

---
 CHANGES.rst                 |  3 ++-
 gwcelery/tasks/inference.py | 10 ++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/CHANGES.rst b/CHANGES.rst
index bee62616f..35a1ec63a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -25,7 +25,8 @@ Changelog
 -   Update rapidpe-rift-pipe to 0.0.12. Using mchirp and q as the coordinates for 
     the rectilinear intrinsic grid. Updated accounting_group to 
     ligo.dev.o4.cbc.pe.lalinferencerapid and added accouting_group_user. Added an 
-    option to map the events to an injection.
+    option to map the events to an injection. Uploading only  a selected set of log files 
+    to gracedb. 
 
 -   Prevent alternative collating method for O3 replay and MDC events with INTEGRAL.
 
diff --git a/gwcelery/tasks/inference.py b/gwcelery/tasks/inference.py
index 43fc604a0..f9f9cdd15 100644
--- a/gwcelery/tasks/inference.py
+++ b/gwcelery/tasks/inference.py
@@ -545,8 +545,14 @@ def job_error_notification(request, exc, traceback,
             message=f'The {analysis} condor job failed.'
         )
 
-    # upload all the .log, .err, and .out files
-    for filename in ['*.log', '*.err', '*.out']:
+    if analysis == "rapidpe":
+        to_upload = [
+            'event_all_iterations.dag.lib.err',
+            'marginalize_extrinsic_parameters_iteration_*.dag.lib.err'
+        ]
+    else:
+        to_upload = ['*.log', '*.err', '*.out']
+    for filename in to_upload:
         tasks = []
         for path in _find_paths_from_name(rundir, filename):
             with open(path, 'rb') as f:
-- 
GitLab