From 5d810c1bd2600d26727fbe8da752a430d2ee36a1 Mon Sep 17 00:00:00 2001
From: "Peter W. Draper" <p.w.draper@durham.ac.uk>
Date: Fri, 28 Apr 2023 16:08:06 +0100
Subject: [PATCH] Fix range issue, handling of scale factor and tidy up
 formatting

---
 swiftmpifakestepsim.c | 10 ++++------
 swiftmpistepsim.c     | 25 ++++++++++---------------
 2 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/swiftmpifakestepsim.c b/swiftmpifakestepsim.c
index d14d853..2ded9e0 100644
--- a/swiftmpifakestepsim.c
+++ b/swiftmpifakestepsim.c
@@ -103,7 +103,7 @@ static void *inject_thread(void *arg) {
     log->nr_tests = 0;
     log->tsum = 0.0;
     log->tmax = 0;
-    log->tmin = INT_MAX;
+    log->tmin = LONG_MAX;
     log->endtic = 0;
     log->injtic = getticks();
 
@@ -175,7 +175,7 @@ static void queue_runner(struct mpiuse_log_entry **logs, int volatile *nr_logs,
   /* Global MPI_Test statistics. */
   int lncalls = 0;
   double lsum = 0.0;
-  ticks lmint = INT_MAX;
+  ticks lmint = LONG_MAX;
   ticks lmaxt = 0;
 
   /* We loop while new requests are being injected and we still have requests
@@ -532,10 +532,8 @@ int main(int argc, char *argv[]) {
   if (myrank == 0) {
     message("Start of MPI tests");
     message("==================");
-    if (verbose) {
-      if (datacheck)
-        message("checking data pattern on send and recv completion");
-    }
+    if (datacheck)
+      message("Checking data pattern on send and recv completion");
   }
 
   /* Make three threads, one for injecting tasks and two to check for
diff --git a/swiftmpistepsim.c b/swiftmpistepsim.c
index c0bf1d7..318e634 100644
--- a/swiftmpistepsim.c
+++ b/swiftmpistepsim.c
@@ -159,7 +159,7 @@ static void *inject_thread(void *arg) {
     log->nr_tests = 0;
     log->tsum = 0.0;
     log->tmax = 0;
-    log->tmin = INT_MAX;
+    log->tmin = LONG_MAX;
     log->endtic = 0;
     log->injtic = getticks();
 
@@ -243,7 +243,7 @@ static void queue_runner(struct mpiuse_log_entry **logs, int volatile *nr_logs,
   /* Global MPI_Test statistics. */
   int lncalls = 0;
   double lsum = 0.0;
-  ticks lmint = INT_MAX;
+  ticks lmint = LONG_MAX;
   ticks lmaxt = 0;
 
   /* We loop while new requests are being injected and we still have requests
@@ -466,6 +466,7 @@ int main(int argc, char *argv[]) {
         break;
       case 'c':
         messagescale = atof(optarg);
+        break;
       case 's':
         messagesize = atoll(optarg);
         break;
@@ -506,20 +507,14 @@ int main(int argc, char *argv[]) {
   clocks_set_cpufreq(0);
   if (myrank == 0) {
     message("Start of MPI tests");
-    if (messagesize > 0) {
-      message(" ");
-      message("  Using fixed message size of %zd", messagesize);
-    }
     message("==================");
-    if (messagescale != 1.0f) {
-      message(" ");
-      message("  Using message scale of %f", messagescale);
-    }
-    if (verbose) {
-      if (!usetics) message("using fast untimed injections");
-      if (datacheck)
-        message("checking data pattern on send and recv completion");
-    }
+    if (messagesize > 0)
+      message("Using fixed message size of %zd", messagesize);
+    if (messagescale != 1.0f)
+      message("Using message scale of %f", messagescale);
+    if (!usetics) message("Using fast untimed injections");
+    if (datacheck)
+      message("Checking data pattern on send and recv completion");
   }
 
   /* Make three threads, one for injecting tasks and two to check for
-- 
GitLab