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

Attempt to synchronize old and new times for better comparison

Still have a problem keeping up with the initial injections
parent e7aa1b62
No related branches found
No related tags found
No related merge requests found
...@@ -204,15 +204,18 @@ void mpiuse_dump_logs(int nranks, const char *dumpfile) { ...@@ -204,15 +204,18 @@ void mpiuse_dump_logs(int nranks, const char *dumpfile) {
fd = fopen(dumpfile, "a"); fd = fopen(dumpfile, "a");
/* And append our logs. Note log->tic is not necessarily from this /* And append our logs. Note log->tic is not necessarily from this
machine, so the conversion to ms may be suspect. */ * machine, so the conversion to ms may be suspect. We also rebase a
* version to match the expected injection times for this new run. */
size_t nlogs = mpiuse_log_count; size_t nlogs = mpiuse_log_count;
ticks basetics = 0;
for (size_t k = 0; k < nlogs; k++) { for (size_t k = 0; k < nlogs; k++) {
struct mpiuse_log_entry *log = &mpiuse_log[k]; struct mpiuse_log_entry *log = &mpiuse_log[k];
if (log->rank == myrank && log->endtic > 0) { if (log->rank == myrank && log->endtic > 0) {
if (basetics == 0) basetics = log->tic;
fprintf(fd, fprintf(fd,
"%lld %.4f %.4f %.4f %.6f %d %d %d %d %d %d %zd %d %.4f %.6f " "%lld %.4f %.4f %.4f %.6f %d %d %d %d %d %d %zd %d %.4f %.6f "
"%.6f\n", "%.6f\n",
log->tic, clocks_from_ticks(log->tic), log->tic, clocks_from_ticks(log->tic - basetics),
clocks_from_ticks(log->injtic - clocks_start_ticks), clocks_from_ticks(log->injtic - clocks_start_ticks),
clocks_from_ticks(log->endtic - clocks_start_ticks), clocks_from_ticks(log->endtic - clocks_start_ticks),
clocks_from_ticks(log->endtic - log->injtic), log->step, clocks_from_ticks(log->endtic - log->injtic), log->step,
......
...@@ -80,6 +80,8 @@ static void *inject_thread(void *arg) { ...@@ -80,6 +80,8 @@ static void *inject_thread(void *arg) {
ticks basetic = reqs_queue[0]->tic; ticks basetic = reqs_queue[0]->tic;
ticks looptics = 0; ticks looptics = 0;
double deadtime = 0.0; double deadtime = 0.0;
struct timespec sleep;
sleep.tv_sec = 0;
while (ind_req < nr_reqs) { while (ind_req < nr_reqs) {
struct mpiuse_log_entry *log = reqs_queue[ind_req]; struct mpiuse_log_entry *log = reqs_queue[ind_req];
...@@ -96,8 +98,6 @@ static void *inject_thread(void *arg) { ...@@ -96,8 +98,6 @@ static void *inject_thread(void *arg) {
* ticks of the log file into nanoseconds, that requires the original * ticks of the log file into nanoseconds, that requires the original
* CPU frequency. */ * CPU frequency. */
if (dt > looptics) { if (dt > looptics) {
struct timespec sleep;
sleep.tv_sec = 0;
/* Remember to be fair and remove the looptics, then convert to /* Remember to be fair and remove the looptics, then convert to
* nanoseconds. */ * nanoseconds. */
...@@ -149,12 +149,11 @@ static void *inject_thread(void *arg) { ...@@ -149,12 +149,11 @@ static void *inject_thread(void *arg) {
ind_req++; ind_req++;
/* Set looptics on the first pass. Assumes MPI_Isend and MPI_Irecv are /* Set looptics on the first pass. Assumes MPI_Isend and MPI_Irecv are
* equally timed. Note we include a nanosleep, they are slow, and a fudge * equally timed. Note we include a nanosleep, they are slow. */
* factor. */
if (looptics == 0 && usetics) { if (looptics == 0 && usetics) {
sleep.tv_nsec = 1; sleep.tv_nsec = 1;
nanosleep(&sleep, NULL); nanosleep(&sleep, NULL);
looptics = (getticks() - starttics) * 2; looptics = (getticks() - starttics);
if (verbose) if (verbose)
message("injection loop took %.3f %s.", clocks_from_ticks(looptics), message("injection loop took %.3f %s.", clocks_from_ticks(looptics),
clocks_getunit()); clocks_getunit());
...@@ -352,6 +351,12 @@ static void pick_logs(void) { ...@@ -352,6 +351,12 @@ static void pick_logs(void) {
/* Sort into increasing time. */ /* Sort into increasing time. */
qsort(reqs_queue, nr_reqs, sizeof(struct mpiuse_log_entry *), cmp_logs); qsort(reqs_queue, nr_reqs, sizeof(struct mpiuse_log_entry *), cmp_logs);
/* Check. */
for (int k = 0; k < nr_reqs - 1; k++) {
if (reqs_queue[k]->tic > reqs_queue[k+1]->tic)
message("reqs_queue: %lld > %lld", reqs_queue[k]->tic, reqs_queue[k+1]->tic);
}
} }
/** /**
...@@ -426,7 +431,8 @@ int main(int argc, char *argv[]) { ...@@ -426,7 +431,8 @@ int main(int argc, char *argv[]) {
/* Each rank requires its own queue, so extract them. */ /* Each rank requires its own queue, so extract them. */
pick_logs(); pick_logs();
/* Time to start time. */ /* Time to start time. Try to make it synchronous across the ranks. */
MPI_Barrier(MPI_COMM_WORLD);
clocks_set_cpufreq(0); clocks_set_cpufreq(0);
if (myrank == 0) { if (myrank == 0) {
message("Start of MPI tests"); message("Start of MPI tests");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment