From ed7ee0c1a6bbecc8bdd5ef19bf1968ad0eda0b26 Mon Sep 17 00:00:00 2001
From: Brandon Rodriguez <brodriguez8774@gmail.com>
Date: Sat, 20 Feb 2021 12:33:11 -0500
Subject: [PATCH] Improve output display and update acceptable arg ranges

---
 src/main.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/src/main.c b/src/main.c
index 08cf764..bf05352 100644
--- a/src/main.c
+++ b/src/main.c
@@ -108,10 +108,14 @@ int main(int argc, char* argv[]) {
         gettimeofday(&end_time, NULL);
         elapsed_time = end_time.tv_sec - start_time.tv_sec;
 
-        printf("Elapsed Time: %g s.\n", elapsed_time);
+        printf("Total Loads: %i\n", total_loads);
+        printf("Seconds Per Load: %i\n", seconds_per_load);
+        printf("\n");
+        printf("Elapsed Time: %g s\n", elapsed_time);
         printf("Expected Time: %i s\n", expected_time_lapse);
-        printf("Efficiency (expected time / actual time): %g%%", ((expected_time_lapse / elapsed_time) * 100));
+        printf("Efficiency (expected time / actual time): %g%%\n", ((expected_time_lapse / elapsed_time) * 100));
 
+        printf("\n");
         printf("\n");
         printf("Terminating program.\n");
     }
@@ -142,11 +146,11 @@ void validate_args(int argc, char* argv[]) {
             exit(1);
         }
 
-        // Validate "total_loads" value. Should be between 100 and 10,000.
+        // Validate "total_loads" value. Should be between 100 and 1,000,000.
         total_loads = strtol(argv[2], NULL, 10);
-        if ((total_loads < 10) || (total_loads > 10000)) {
+        if ((total_loads < 10) || (total_loads > 1000000)) {
             if (process_rank == 0) {
-                printf("Arg2 (total_loads) should be int between 10 and 10,000.\n");
+                printf("Arg2 (total_loads) should be int between 10 and 1,000,000.\n");
                 printf("\n");
                 printf("Terminating program.\n");
             }
@@ -194,11 +198,11 @@ void display_max_types() {
  * Entry point for running various Load Balancing schemes.
  */
 void run_program() {
-    if (process_rank == 0) {
-        printf("Running core program logic.\n");
-        printf("\n");
-        printf("\n");
-    }
+    // if (process_rank == 0) {
+    //     printf("Running core program logic.\n");
+    //     printf("\n");
+    //     printf("\n");
+    // }
 
     // Wait for all processes to synchronize.
     MPI_Barrier(MPI_COMM_WORLD);
@@ -217,9 +221,9 @@ void run_program() {
     // Wait for all processes to synchronize.
     MPI_Barrier(MPI_COMM_WORLD);
 
-    if (process_rank == 0) {
-        printf("\n");
-        printf("\n");
-        printf("Core program logic complete.\n");
-    }
+    // if (process_rank == 0) {
+    //     printf("\n");
+    //     printf("\n");
+    //     printf("Core program logic complete.\n");
+    // }
 }
-- 
GitLab