Commit 414e54d1 authored by robl's avatar robl
Browse files

tighten up a few things to let this test build under --enable-strict

parent 815dc88b
...@@ -10,10 +10,14 @@ ...@@ -10,10 +10,14 @@
#define NUM_OBJS 4 #define NUM_OBJS 4
#define OBJ_SIZE 1048576 #define OBJ_SIZE 1048576
extern char *optarg;
extern int optind, opterr, optopt;
char *prog = NULL; char *prog = NULL;
int debug = 0; int debug = 0;
void static void
Usage( int line ) { Usage( int line ) {
int rank; int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_rank(MPI_COMM_WORLD, &rank);
...@@ -27,13 +31,13 @@ Usage( int line ) { ...@@ -27,13 +31,13 @@ Usage( int line ) {
exit( 0 ); exit( 0 );
} }
void static void
fatal_error( int mpi_ret, MPI_Status *mpi_stat, char *msg ) { fatal_error( int mpi_ret, MPI_Status *mpi_stat, char *msg ) {
fprintf( stderr, "Fatal error %s: %d\n", msg, mpi_ret ); fprintf( stderr, "Fatal error %s: %d\n", msg, mpi_ret );
MPI_Abort( MPI_COMM_WORLD, -1 ); MPI_Abort( MPI_COMM_WORLD, -1 );
} }
void static void
print_hints( int rank, MPI_File *mfh ) { print_hints( int rank, MPI_File *mfh ) {
MPI_Info info; MPI_Info info;
int nkeys; int nkeys;
...@@ -57,20 +61,20 @@ print_hints( int rank, MPI_File *mfh ) { ...@@ -57,20 +61,20 @@ print_hints( int rank, MPI_File *mfh ) {
MPI_Barrier( MPI_COMM_WORLD ); MPI_Barrier( MPI_COMM_WORLD );
} }
void static void
fill_buffer( char *buffer, int bufsize, int rank, MPI_Offset offset ) { fill_buffer( char *buffer, int bufsize, int rank, MPI_Offset offset ) {
memset( (void*)buffer, 0, bufsize ); memset( (void*)buffer, 0, bufsize );
snprintf( buffer, bufsize, "Hello from %d at %lld\n", rank, offset ); snprintf( buffer, bufsize, "Hello from %d at %lld\n", rank, offset );
} }
MPI_Offset static MPI_Offset
get_offset( int rank, int num_objs, int obj_size, int which_obj ) { get_offset( int rank, int num_objs, int obj_size, int which_obj ) {
MPI_Offset offset; MPI_Offset offset;
offset = (MPI_Offset)rank * num_objs * obj_size + which_obj * obj_size; offset = (MPI_Offset)rank * num_objs * obj_size + which_obj * obj_size;
return offset; return offset;
} }
void static void
write_file( char *target, int rank, MPI_Info *info ) { write_file( char *target, int rank, MPI_Info *info ) {
MPI_File wfh; MPI_File wfh;
MPI_Status mpi_stat; MPI_Status mpi_stat;
...@@ -106,7 +110,7 @@ write_file( char *target, int rank, MPI_Info *info ) { ...@@ -106,7 +110,7 @@ write_file( char *target, int rank, MPI_Info *info ) {
if ( debug ) printf( "%d wrote file %s\n", rank, target ); if ( debug ) printf( "%d wrote file %s\n", rank, target );
} }
int static int
reduce_corruptions( int corrupt_blocks ) { reduce_corruptions( int corrupt_blocks ) {
int mpi_ret; int mpi_ret;
int sum; int sum;
...@@ -118,7 +122,7 @@ reduce_corruptions( int corrupt_blocks ) { ...@@ -118,7 +122,7 @@ reduce_corruptions( int corrupt_blocks ) {
return sum; return sum;
} }
void static void
read_file( char *target, int rank, MPI_Info *info, int *corrupt_blocks ) { read_file( char *target, int rank, MPI_Info *info, int *corrupt_blocks ) {
MPI_File rfh; MPI_File rfh;
MPI_Status mpi_stat; MPI_Status mpi_stat;
...@@ -162,7 +166,7 @@ read_file( char *target, int rank, MPI_Info *info, int *corrupt_blocks ) { ...@@ -162,7 +166,7 @@ read_file( char *target, int rank, MPI_Info *info, int *corrupt_blocks ) {
} }
void static void
set_hints( MPI_Info *info ) { set_hints( MPI_Info *info ) {
MPI_Info_set( *info, "romio_cb_write", "enable" ); MPI_Info_set( *info, "romio_cb_write", "enable" );
MPI_Info_set( *info, "romio_no_indep_rw", "1" ); MPI_Info_set( *info, "romio_no_indep_rw", "1" );
...@@ -193,7 +197,6 @@ set_hints( MPI_Info *info, char *hints ) { ...@@ -193,7 +197,6 @@ set_hints( MPI_Info *info, char *hints ) {
int int
main( int argc, char *argv[] ) { main( int argc, char *argv[] ) {
int nproc = 1, rank = 0; int nproc = 1, rank = 0;
char myname[256];
char *target = NULL; char *target = NULL;
int c; int c;
MPI_Info info; MPI_Info info;
......
Markdown is supported
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