Skip to content

Commit a6c3152

Browse files
authored
Merge pull request #5 from cniethammer/general-code-cleanup
General code cleanup
2 parents dcfe551 + 4947448 commit a6c3152

File tree

8 files changed

+11
-37
lines changed

8 files changed

+11
-37
lines changed

one-sided/tst_get_with_fence.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
* Date: Oct 14th 2003
1313
*/
1414

15-
//#include "config.h"
16-
//#ifdef HAVE_MPI2_ONESIDE
17-
1815
#include <mpi.h>
1916
#include "mpi_test_suite.h"
2017

@@ -128,5 +125,3 @@ int tst_get_with_fence_alltoall_cleanup (struct tst_env * env)
128125
return 0;
129126
}
130127

131-
//#endif
132-

one-sided/tst_get_with_lock.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
1414
*/
1515

16-
//#include "config.h"
17-
//#ifdef HAVE_MPI2_ONESIDE
18-
1916
#include <mpi.h>
2017
#include "mpi_test_suite.h"
2118

@@ -131,5 +128,4 @@ int tst_get_with_lock_alltoall_cleanup (struct tst_env * env)
131128

132129
return 0;
133130
}
134-
//#endif
135131

one-sided/tst_get_with_post.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
* Date: Oct 14th 2003
1313
*/
1414

15-
//#include "config.h"
16-
//#ifdef HAVE_MPI2_ONESIDE
17-
1815
#include <mpi.h>
1916
#include "mpi_test_suite.h"
2017

@@ -161,4 +158,4 @@ int tst_get_with_post_alltoall_cleanup (struct tst_env * env)
161158

162159
return 0;
163160
}
164-
//#endif
161+

one-sided/tst_put_with_fence.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
1414
*/
1515

16-
//#include "config.h"
17-
//#ifdef HAVE_MPI2_ONESIDE
18-
1916
#include <mpi.h>
2017
#include "mpi_test_suite.h"
2118

@@ -131,4 +128,4 @@ int tst_put_with_fence_alltoall_cleanup (struct tst_env * env)
131128

132129
return 0;
133130
}
134-
//#endif
131+

one-sided/tst_put_with_lock.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
33
*/
44

5-
//#include "config.h"
6-
//#ifdef HAVE_MPI2_ONESIDE
7-
85
#include <mpi.h>
96
#include "mpi_test_suite.h"
107

@@ -123,4 +120,4 @@ int tst_put_with_lock_alltoall_cleanup (struct tst_env * env)
123120

124121
return 0;
125122
}
126-
//#endif
123+

one-sided/tst_put_with_post.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//#include "config.h"
2-
//#ifdef HAVE_MPI2_ONESIDE
31

42
#include <mpi.h>
53
#include "mpi_test_suite.h"
@@ -148,4 +146,3 @@ int tst_put_with_post_alltoall_cleanup (struct tst_env * env)
148146
return 0;
149147
}
150148

151-
//#endif

tst_output.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const char * tst_reports[] = {
3333
};
3434

3535
#ifdef HAVE_MPI2_THREADS
36-
extern int num_threads;
3736
extern int tst_thread_running (void);
3837
#endif
3938

@@ -73,16 +72,6 @@ tst_output_types tst_output_init(tst_output_stream * output, int rank,
7372
}
7473
#endif
7574

76-
/* Check if stream type uses a file and get the name of this file */
77-
if (type == TST_OUTPUT_TYPE_LOGFILE) {
78-
va_start(arglist, type);
79-
fname = va_arg (arglist, char *);
80-
sprintf (output->filename,"R%d_", tst_output_global_rank);
81-
freelen = 255 - strlen(output->filename);
82-
strncat (output->filename, fname, freelen);
83-
va_end (arglist);
84-
}
85-
8675
/* Now do the initialisation for the different stream types */
8776
switch (type) {
8877
case TST_OUTPUT_TYPE_STDERR:
@@ -92,6 +81,11 @@ tst_output_types tst_output_init(tst_output_stream * output, int rank,
9281
output->streamptr = stdout;
9382
break;
9483
case TST_OUTPUT_TYPE_LOGFILE:
84+
va_start(arglist, type);
85+
fname = va_arg (arglist, char *);
86+
snprintf(output->filename, TST_OUTPUT_FILENAME_MAX, "R%d_%s",
87+
tst_output_global_rank, fname);
88+
va_end (arglist);
9589
output->streamptr = fopen(output->filename, "w+");
9690
if (output->streamptr == NULL) {
9791
fprintf (stderr, "Error opening stream: Could not open output file.");

tst_output.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <stdio.h>
66
#include <stdarg.h>
77

8-
#include "./config.h"
8+
#include "config.h"
99

1010

1111
#define DEBUG_REPORT_TYPE TST_REPORT_MAX
@@ -33,10 +33,11 @@ typedef enum {
3333
} tst_report_types;
3434

3535

36+
#define TST_OUTPUT_FILENAME_MAX 256
3637
typedef struct {
3738
FILE * streamptr; /**< Pointer on the stream */
3839
tst_output_types type;
39-
char filename[256]; /**< Filename if stream writes to file */
40+
char filename[TST_OUTPUT_FILENAME_MAX]; /**< Filename if stream writes to file */
4041
tst_report_types level;
4142
int rank; /**< MPI rank responsible for output */
4243
int isopen; /**< open status: 1 if open */

0 commit comments

Comments
 (0)