From d097c5f10377b71caf2e45c955579d2360cc4535 Mon Sep 17 00:00:00 2001 From: Shane Snyder Date: Tue, 8 Dec 2015 14:00:48 -0600 Subject: [PATCH] move compression buffer alloc to shutdown time --- darshan-runtime/darshan-core.h | 2 +- darshan-runtime/lib/darshan-core.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/darshan-runtime/darshan-core.h b/darshan-runtime/darshan-core.h index 652c189..2ebf8b9 100644 --- a/darshan-runtime/darshan-core.h +++ b/darshan-runtime/darshan-core.h @@ -48,7 +48,7 @@ struct darshan_core_runtime struct darshan_core_record_ref *rec_hash; int rec_count; struct darshan_core_module* mod_array[DARSHAN_MAX_MODS]; - char comp_buf[DARSHAN_COMP_BUF_SIZE]; + char *comp_buf; double wtime_offset; char *trailing_data; }; diff --git a/darshan-runtime/lib/darshan-core.c b/darshan-runtime/lib/darshan-core.c index a216a49..b876b3c 100644 --- a/darshan-runtime/lib/darshan-core.c +++ b/darshan-runtime/lib/darshan-core.c @@ -282,6 +282,13 @@ void darshan_core_shutdown() final_core = darshan_core; darshan_core = NULL; + final_core->comp_buf = malloc(DARSHAN_COMP_BUF_SIZE); + if(!(final_core->comp_buf)) + { + darshan_core_cleanup(final_core); + return; + } + /* we also need to set which modules were registered on this process and * call into those modules and give them a chance to perform any necessary * pre-shutdown steps. -- 2.26.2