From d65d1121602ae06e7c9854a07099aaaa60f40bbd Mon Sep 17 00:00:00 2001 From: pini Date: Thu, 25 Mar 2010 09:56:12 +0000 Subject: [PATCH] Cleanup. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7363 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- examples/smpi/allreduce.c | 2 +- examples/smpi/alltoall2.c | 1 + examples/smpi/alltoall_basic.c | 6 +++--- examples/smpi/alltoallv.c | 2 +- examples/smpi/bcbench.c | 4 ++-- examples/smpi/mvmul.c | 1 + examples/smpi/pingpong.c | 2 +- examples/smpi/reduce.c | 2 +- examples/smpi/ring_c.c | 3 ++- examples/smpi/scatter.c | 4 ++-- examples/smpi/second.c | 3 ++- examples/smpi/sendrecv.c | 3 +-- examples/smpi/split.c | 5 +++-- 13 files changed, 21 insertions(+), 17 deletions(-) diff --git a/examples/smpi/allreduce.c b/examples/smpi/allreduce.c index eddb7252c4..83e6b10c0b 100644 --- a/examples/smpi/allreduce.c +++ b/examples/smpi/allreduce.c @@ -29,7 +29,7 @@ static int ibm_test(int rank, int size) int success = 1; #define MAXLEN 10000 - int root, i, j, k; + int root = 0, i, j, k; int out[MAXLEN]; int in[MAXLEN]; diff --git a/examples/smpi/alltoall2.c b/examples/smpi/alltoall2.c index 0b1c9180d6..a46f765dbb 100644 --- a/examples/smpi/alltoall2.c +++ b/examples/smpi/alltoall2.c @@ -79,4 +79,5 @@ int main( int argc, char *argv[] ) MPI_Barrier(MPI_COMM_WORLD); if(myself==0) printf("TEST COMPLETE\n"); MPI_Finalize(); + return EXIT_SUCCESS; } diff --git a/examples/smpi/alltoall_basic.c b/examples/smpi/alltoall_basic.c index 12bc44d800..2cb6f7d368 100644 --- a/examples/smpi/alltoall_basic.c +++ b/examples/smpi/alltoall_basic.c @@ -15,7 +15,7 @@ int main( int argc, char *argv[] ) int i; int *sb; int *rb; - int status, gstatus; + int status; MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD,&rank); @@ -45,8 +45,8 @@ int main( int argc, char *argv[] ) if (rank == 0) { - if (gstatus != 0) { - printf("all_to_all returned %d\n",gstatus);fflush(stdout); + if (status != 0) { + printf("all_to_all returned %d\n",status);fflush(stdout); } } free(sb); diff --git a/examples/smpi/alltoallv.c b/examples/smpi/alltoallv.c index 73b6d24148..5c3857ccb6 100644 --- a/examples/smpi/alltoallv.c +++ b/examples/smpi/alltoallv.c @@ -50,7 +50,7 @@ */ -void print_buffer_int(void *buf, int len, char *msg, int rank) +static void print_buffer_int(void *buf, int len, char *msg, int rank) { int tmp, *v; printf("**<%d> %s (#%d): ", rank, msg,len); diff --git a/examples/smpi/bcbench.c b/examples/smpi/bcbench.c index 214f88b765..b3b6a7b5be 100644 --- a/examples/smpi/bcbench.c +++ b/examples/smpi/bcbench.c @@ -15,10 +15,10 @@ int main(int argc, char *argv[]) { int size, rank; - int N, I; + int N; struct timeval *start_time, *stop_time; double seconds; - int i, j, k; + int i, j; char *buffer; int check; diff --git a/examples/smpi/mvmul.c b/examples/smpi/mvmul.c index 8706b8422b..dbaceb826a 100644 --- a/examples/smpi/mvmul.c +++ b/examples/smpi/mvmul.c @@ -1,5 +1,6 @@ #include #include +#include #include #define ITERATIONS 10 diff --git a/examples/smpi/pingpong.c b/examples/smpi/pingpong.c index 092423bb78..636c985221 100644 --- a/examples/smpi/pingpong.c +++ b/examples/smpi/pingpong.c @@ -5,7 +5,7 @@ #include #include -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { const int tag1 = 42, tag2= 43; /* Message tag */ int rank; diff --git a/examples/smpi/reduce.c b/examples/smpi/reduce.c index 25ae108206..85bfa1ee4b 100644 --- a/examples/smpi/reduce.c +++ b/examples/smpi/reduce.c @@ -24,7 +24,7 @@ * ENHANCEMENTS, OR MODIFICATIONS. * *************************************************************************** **/ -int ibm_test(int rank, int size) +static int ibm_test(int rank, int size) { int success = 1; #define MAXLEN 10000 diff --git a/examples/smpi/ring_c.c b/examples/smpi/ring_c.c index 773d74e16b..1d91408da2 100644 --- a/examples/smpi/ring_c.c +++ b/examples/smpi/ring_c.c @@ -8,7 +8,8 @@ */ #include -#include "mpi.h" +#include +#include int main(int argc, char *argv[]) { diff --git a/examples/smpi/scatter.c b/examples/smpi/scatter.c index 2f68c916d4..8833cea19f 100644 --- a/examples/smpi/scatter.c +++ b/examples/smpi/scatter.c @@ -24,7 +24,7 @@ #include #include -int ibm_test(int rank, int size) { +static int ibm_test(int rank, int size) { #define MAXLEN 10000 @@ -62,7 +62,7 @@ int ibm_test(int rank, int size) { /** * small test: the root sends a single distinct double to other processes **/ -int small_test( int rank, int size ) { +static int small_test( int rank, int size ) { int success=1; int retval; int sendcount=1; // one double to each process diff --git a/examples/smpi/second.c b/examples/smpi/second.c index 2c80d609e8..e34a2122bc 100644 --- a/examples/smpi/second.c +++ b/examples/smpi/second.c @@ -12,9 +12,10 @@ /* your hostfile, do 'mpirun -machinefile hostfile -np 4 first */ #include +#include #include -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { const int tag = 42; /* Message tag */ int id, ntasks, source_id, dest_id, err, i; diff --git a/examples/smpi/sendrecv.c b/examples/smpi/sendrecv.c index da30874b9a..3f3aeeef27 100644 --- a/examples/smpi/sendrecv.c +++ b/examples/smpi/sendrecv.c @@ -1,7 +1,7 @@ #include "mpi.h" #include -int test(int myid, int numprocs) { +static int test(int myid, int numprocs) { // The tags should match on the sender and receiver side. // The distinction between sendtag and recvtag is mainly // useful to make some other Recv or Send calls match the sendrecv. @@ -13,7 +13,6 @@ int test(int myid, int numprocs) { int left, right; int buffer[BUFLEN], buffer2[BUFLEN]; int i; - MPI_Request request; MPI_Status status; for (i=0;i