Skip to content

Commit b0a64bb

Browse files
committed
Cleanup of comments and indentation/white spaces.
1 parent b56a21e commit b0a64bb

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

mpi_test_suite.c

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
#include "config.h"
22

3+
#include <getopt.h>
34
#include <stdio.h>
4-
5-
#ifdef HAVE_UNISTD_H
6-
# include <unistd.h>
7-
#endif
8-
9-
#ifdef HAVE_GETOPT_H
10-
# include <getopt.h>
11-
#endif
5+
#include <stdlib.h>
6+
#include <unistd.h>
127

138
#include <mpi.h>
149

@@ -50,7 +45,7 @@ int tst_atomic = 0;
5045
tst_report_types tst_report = TST_REPORT_RUN;
5146
tst_mode_types tst_mode = TST_MODE_RELAXED;
5247
/*
53-
* Declaration of output_relevant data
48+
* Declaration of output relevant data
5449
* Do not remove or change the following without modifying tst_output.h!
5550
*/
5651
tst_output_stream tst_output;
@@ -198,8 +193,6 @@ int main (int argc, char * argv[])
198193
{
199194
char hostname[256];
200195
int delay;
201-
/* XXX INC stdlib.h CN Needs stdlib.h so we should check in configure script
202-
*/
203196
delay = atoi(start_delay_str);
204197
if (delay < 0) {
205198
printf ("Warning: Delay time should be greater than zero! Using no delay now.\n");
@@ -344,8 +337,7 @@ int main (int argc, char * argv[])
344337
num_tests = 0;
345338

346339
str = strtok (optarg, ",");
347-
while (str)
348-
{
340+
while (str) {
349341
/*
350342
* In case we find the magic word all, we reset the list as above.
351343
* In case we find a '^', deselect the test (test-class)
@@ -358,26 +350,25 @@ int main (int argc, char * argv[])
358350
tst_test_array[i] = i;
359351
num_tests++;
360352
}
361-
}
362-
else if ('^' == str[0])
363-
{
353+
}
354+
else if ('^' == str[0]) {
364355
char tmp_str[TST_DESCRIPTION_LEN+1];
365356

366357
INTERNAL_CHECK (if (strlen(str) > TST_DESCRIPTION_LEN) ERROR (EINVAL, "Name of test too long for negation"));
367358

368359
strncpy (tmp_str, &(str[1]), TST_DESCRIPTION_LEN);
369360
tst_test_deselect (tmp_str, tst_test_array, tst_test_array_max, &num_tests);
370-
}
371-
else if ('0' <= str[0] && '9' >= str[0])
372-
{
361+
}
362+
else if ('0' <= str[0] && '9' >= str[0]) {
373363
int tmp_test = atoi (str);
374364
if (0 > tmp_test || tst_test_array_max <= tmp_test)
375365
ERROR (EINVAL, "Specified test number out of range");
376366

377367
tst_test_array[num_tests++] = tmp_test;
378-
}
379-
else
368+
}
369+
else {
380370
tst_test_select (str, tst_test_array, tst_test_array_max, &num_tests);
371+
}
381372
str = strtok (NULL, ",");
382373
}
383374
tst_array_compress (tst_test_array, tst_test_array_max, &num_tests);
@@ -476,7 +467,7 @@ int main (int argc, char * argv[])
476467
int tmp_test_type = atoi (str);
477468
if (0 > tmp_test_type || tst_type_array_max <= tmp_test_type)
478469
ERROR (EINVAL, "Specified type number out of range");
479-
470+
480471
tst_type_array[num_types++] = tmp_test_type;
481472
}
482473
else
@@ -641,8 +632,9 @@ int main (int argc, char * argv[])
641632
MPI_Barrier (MPI_COMM_WORLD);
642633
}
643634

644-
if (tst_global_rank == 0)
635+
if (tst_global_rank == 0) {
645636
tst_test_print_failed ();
637+
}
646638

647639
/*
648640
* XXX Disable for Thread Checker test, as we free twice???
@@ -658,7 +650,7 @@ int main (int argc, char * argv[])
658650
*/
659651

660652
time_stop = MPI_Wtime ();
661-
tst_output_printf (DEBUG_LOG, TST_REPORT_FULL, "(Rank:%d) Overall time taken:%f\n",
653+
tst_output_printf (DEBUG_LOG, TST_REPORT_FULL, "(Rank:%d) Overall time taken:%lf\n",
662654
tst_global_rank, time_stop - time_start);
663655
tst_output_printf (DEBUG_LOG, TST_REPORT_FULL, "(Rank:%d) Going to MPI_Finalize\n",
664656
tst_global_rank);

0 commit comments

Comments
 (0)