From 5a829068a7926fc10da4e2f9d625ed7f17a23e8c Mon Sep 17 00:00:00 2001
From: Utz-Uwe Haus <uhaus@cray.com>
Date: Thu, 18 Feb 2021 11:48:28 +0100
Subject: [PATCH] add CDO buffer debugging in failed GFS writes

---
 transport/gfs.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/transport/gfs.c b/transport/gfs.c
index bf1c2b16..a8844e5d 100644
--- a/transport/gfs.c
+++ b/transport/gfs.c
@@ -69,7 +69,7 @@ mstro_transport_gfs_src_execute(mstro_cdo src, Mstro__Pool__TransferTicket* tick
 
 	FILE *f = NULL;
 	char* path = ticket->gfs->path;
-	INFO("Path src app will use for transport: %s\n", path);
+	DEBUG("Path src app will use for transport: %s\n", path);
 	if (path == NULL) {
 		ERR("Ticket for GFS transport does not contain a path\n");
 		return MSTRO_INVARG;
@@ -83,8 +83,8 @@ mstro_transport_gfs_src_execute(mstro_cdo src, Mstro__Pool__TransferTicket* tick
 	}
 
 	if (fwrite(dl.data, sizeof(char), dl.len/sizeof(char), f) != dl.len) {
-		ERR("Partial write on %s for GFS transport (errno: %d -- %s)\n",
-                    path, errno, strerror(errno));
+		ERR("Partial write on %s (buf: %p) for GFS transport (errno: %d -- %s)\n",
+                    path, dl.data, errno, strerror(errno));
 		return MSTRO_FAIL;
 	}
 
@@ -94,7 +94,7 @@ mstro_transport_gfs_src_execute(mstro_cdo src, Mstro__Pool__TransferTicket* tick
 		return MSTRO_FAIL;
 	}
 
-	INFO("src app successfully executed transport CDO %s\n",
+	DEBUG("src app successfully executed transport CDO %s\n",
              src->name);
 	return MSTRO_OK;
 }
@@ -129,11 +129,11 @@ mstro_transport_gfs_dst_execute(mstro_cdo dst,
   /* data is the raw-ptr or freshly allocated, CDO attribute is correct */
   FILE *f = NULL;
   char* path = ticket->gfs->path;
-  INFO("Path src app will use for transport: %s\n", path);
   if (path == NULL) {
     ERR("Ticket for GFS transport does not contain a path\n");
     return MSTRO_INVARG;
   }
+  DEBUG("Path dst app will use for transport: %s\n", path);
   f = fopen(path,"rb");
   if (f == NULL) {
     ERR("Failed to open %s for GFS transport: %d (%s)\n",
@@ -176,7 +176,7 @@ mstro_transport_gfs_dst_execute(mstro_cdo dst,
   /*   abort(); */
   /* }     */
   
-  INFO("dst app successfully executed transport CDO %s\n", dst->name);
+  DEBUG("dst app successfully executed transport CDO %s\n", dst->name);
 
   if (! (ticket->gfs->keep_file)) {
     int s = unlink(ticket->gfs->path);
@@ -184,7 +184,7 @@ mstro_transport_gfs_dst_execute(mstro_cdo dst,
       WARN("Couldn't unlink file used for gfs transfer (%s): %d (%s)\n",
            ticket->gfs->path, s, strerror(s));
     } else {
-      INFO("Removed the transfer file from GFS\n");
+      DEBUG("Removed the transfer file\n");
     }
   }
 
-- 
GitLab