Skip to content
Snippets Groups Projects
Commit ed7ee0c1 authored by Brandon Rodriguez's avatar Brandon Rodriguez
Browse files

Improve output display and update acceptable arg ranges

parent 2d3e8dfe
Branches
No related merge requests found
...@@ -108,10 +108,14 @@ int main(int argc, char* argv[]) { ...@@ -108,10 +108,14 @@ int main(int argc, char* argv[]) {
gettimeofday(&end_time, NULL); gettimeofday(&end_time, NULL);
elapsed_time = end_time.tv_sec - start_time.tv_sec; 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("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("\n");
printf("Terminating program.\n"); printf("Terminating program.\n");
} }
...@@ -142,11 +146,11 @@ void validate_args(int argc, char* argv[]) { ...@@ -142,11 +146,11 @@ void validate_args(int argc, char* argv[]) {
exit(1); 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); 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) { 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("\n");
printf("Terminating program.\n"); printf("Terminating program.\n");
} }
...@@ -194,11 +198,11 @@ void display_max_types() { ...@@ -194,11 +198,11 @@ void display_max_types() {
* Entry point for running various Load Balancing schemes. * Entry point for running various Load Balancing schemes.
*/ */
void run_program() { void run_program() {
if (process_rank == 0) { // if (process_rank == 0) {
printf("Running core program logic.\n"); // printf("Running core program logic.\n");
printf("\n"); // printf("\n");
printf("\n"); // printf("\n");
} // }
// Wait for all processes to synchronize. // Wait for all processes to synchronize.
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
...@@ -217,9 +221,9 @@ void run_program() { ...@@ -217,9 +221,9 @@ void run_program() {
// Wait for all processes to synchronize. // Wait for all processes to synchronize.
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
if (process_rank == 0) { // if (process_rank == 0) {
printf("\n"); // printf("\n");
printf("\n"); // printf("\n");
printf("Core program logic complete.\n"); // printf("Core program logic complete.\n");
} // }
} }
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