diff --git a/mcxtrace-comps/misc/MCPL_output.comp b/mcxtrace-comps/misc/MCPL_output.comp index 9a78f3f0c..2678595b9 100644 --- a/mcxtrace-comps/misc/MCPL_output.comp +++ b/mcxtrace-comps/misc/MCPL_output.comp @@ -348,6 +348,15 @@ SAVE FINALLY %{ +#ifdef USE_MPI + if (merge_mpi && mpi_node_count > 1) { + mcpl_close_outfile(outputfile); + } else { + mcpl_closeandgzip_outfile(outputfile); + } +#else + mcpl_closeandgzip_outfile(outputfile); +#endif #ifdef USE_MPI MPI_Barrier(MPI_COMM_WORLD); MPI_MASTER( @@ -390,15 +399,6 @@ FINALLY } ); #endif -#ifdef USE_MPI - if (merge_mpi && mpi_node_count > 1) { - mcpl_close_outfile(outputfile); - } else { - mcpl_closeandgzip_outfile(outputfile); - } -#else - mcpl_closeandgzip_outfile(outputfile); -#endif %} MCDISPLAY