Commit bea59af0 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Add dump of MPI logs when the dumper thread is enabled

Useful to see these as well
parent 8fafd68b
......@@ -72,6 +72,7 @@
#include "logger_io.h"
#include "map.h"
#include "memuse.h"
#include "mpiuse.h"
#include "minmax.h"
#include "outputlist.h"
#include "parallel_io.h"
......@@ -3405,6 +3406,11 @@ static void *engine_dumper_poll(void *p) {
memuse_log_dump_error(e->nodeID);
#endif
#if defined(SWIFT_MPIUSE_REPORTS) && defined(WITH_MPI)
/* Dump the MPI interactions in the step. */
mpiuse_log_dump_error(e->nodeID);
#endif
/* Add more interesting diagnostics. */
scheduler_dump_queues(e);
......
......@@ -351,4 +351,17 @@ void mpiuse_log_dump(const char *filename, ticks stepticks) {
// clocks_getunit());
}
/**
* @brief dump the log for using the given rank to generate a standard
* name for the output. Used when exiting in error.
*
* @param rank the rank exiting in error.
*/
void mpiuse_log_dump_error(int rank) {
char filename[60];
sprintf(filename, "mpiuse-error-report-rank%d.txt", rank);
mpiuse_log_dump(filename, clocks_start_ticks);
}
#endif /* defined(SWIFT_MPIUSE_REPORTS) && defined(WITH_MPI) */
......@@ -33,6 +33,7 @@
void mpiuse_log_dump(const char *filename, ticks stepticks);
void mpiuse_log_allocation(int type, int subtype, void *ptr, int activation,
size_t size, int otherrank, int tag);
void mpiuse_log_dump_error(int rank);
#else
/* No-op when not reporting. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment