Skip to content
Snippets Groups Projects
Commit c5f4297d authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Formatting

parent d22af55a
No related branches found
No related tags found
No related merge requests found
......@@ -182,7 +182,8 @@ void mpiuse_dump_logs(int nranks, const char *dumpfile) {
fd = fopen(dumpfile, "w");
/* Header. */
fprintf(fd, "# logticin logtic injtic endtic dtic step rank otherrank itype "
fprintf(fd,
"# logticin logtic injtic endtic dtic step rank otherrank itype "
" isubtype tag size nr_tests tsum tmin tmax\n");
fclose(fd);
}
......@@ -208,22 +209,21 @@ void mpiuse_dump_logs(int nranks, const char *dumpfile) {
for (size_t k = 0; k < nlogs; k++) {
struct mpiuse_log_entry *log = &mpiuse_log[k];
if (log->rank == myrank && log->endtic > 0) {
fprintf(fd, "%lld %.4f %.4f %.4f %.6f %d %d %d %d %d %d %zd %d %.4f %.6f %.6f\n",
log->tic,
clocks_from_ticks(log->tic),
clocks_from_ticks(log->injtic - clocks_start_ticks),
clocks_from_ticks(log->endtic - clocks_start_ticks),
clocks_from_ticks(log->endtic - log->injtic),
log->step, log->rank,
log->otherrank, log->type, log->subtype, log->tag, log->size,
log->nr_tests, clocks_from_ticks(log->tsum),
fprintf(fd,
"%lld %.4f %.4f %.4f %.6f %d %d %d %d %d %d %zd %d %.4f %.6f "
"%.6f\n",
log->tic, clocks_from_ticks(log->tic),
clocks_from_ticks(log->injtic - clocks_start_ticks),
clocks_from_ticks(log->endtic - clocks_start_ticks),
clocks_from_ticks(log->endtic - log->injtic), log->step,
log->rank, log->otherrank, log->type, log->subtype, log->tag,
log->size, log->nr_tests, clocks_from_ticks(log->tsum),
clocks_from_ticks(log->tmin), clocks_from_ticks(log->tmax));
}
}
fclose(fd);
}
}
}
/**
......
......@@ -17,12 +17,12 @@
*
******************************************************************************/
#include <limits.h>
#include <mpi.h>
#include <pthread.h>
#include <unistd.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "atomic.h"
#include "clocks.h"
......@@ -353,7 +353,8 @@ static void pick_logs(void) {
* @brief usage help.
*/
static void usage(char *argv[]) {
fprintf(stderr, "Usage: %s [-vf] SWIFT_mpiuse-log-file.dat logfile.dat\n", argv[0]);
fprintf(stderr, "Usage: %s [-vf] SWIFT_mpiuse-log-file.dat logfile.dat\n",
argv[0]);
fprintf(stderr, " options: -v verbose, -f fast injections\n");
fflush(stderr);
}
......@@ -382,11 +383,15 @@ int main(int argc, char *argv[]) {
int opt;
while ((opt = getopt(argc, argv, "vf")) != -1) {
switch (opt) {
case 'f': usetics = 0; break;
case 'v': verbose = 1; break;
default:
if (myrank == 0) usage(argv);
return 1;
case 'f':
usetics = 0;
break;
case 'v':
verbose = 1;
break;
default:
if (myrank == 0) usage(argv);
return 1;
}
}
if (optind >= argc - 1) {
......@@ -394,7 +399,7 @@ int main(int argc, char *argv[]) {
return 1;
}
char *infile = argv[optind];
char *logfile = argv[optind+1];
char *logfile = argv[optind + 1];
/* Now we read the SWIFT MPI logger output that defines the communcations
* we will undertake and the time differences between injections into the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment