From 1c502c3dacee3bee3b00577ea4be330432b71d91 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 26 Jul 2024 17:16:36 +0100 Subject: [PATCH] Add i/o aggregator check --- src/lb_data.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lb_data.c b/src/lb_data.c index 6834e2bb..15e33486 100644 --- a/src/lb_data.c +++ b/src/lb_data.c @@ -169,6 +169,17 @@ int lb_data_create(pe_t * pe, cs_t * cs, const lb_data_options_t * options, if (ifail != 0) pe_fatal(pe, "lb_data: bad i/o output decomposition\n"); } + /* Run the aggregator here and now in an attempt to make sure we + * don't suffer an oom at the point of output */ + + { + io_impl_t * io = NULL; + int ifail = io_impl_create(&obj->output, &io); + if (ifail != 0) pe_exit(pe, "lb_data.c: error in aggregator creation\n"); + lb_io_aggr_pack(obj, io->aggr); + io->impl->free(&io); + } + *lb = obj; return 0;