X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0e9c0448c6566825b170b98ecff716b098bda10e..c2cc479144a1b0e0194761b429832c7608ee087d:/examples/smpi/NAS/EP/ep.c diff --git a/examples/smpi/NAS/EP/ep.c b/examples/smpi/NAS/EP/ep.c index 961422af26..569c2f21df 100644 --- a/examples/smpi/NAS/EP/ep.c +++ b/examples/smpi/NAS/EP/ep.c @@ -6,7 +6,7 @@ #include "mpi.h" #include "npbparams.h" -#include "randlc.h" +#include "simgrid/instr.h" //TRACE_ #ifndef CLASS #define CLASS 'S' @@ -15,7 +15,6 @@ #define true 1 #define false 0 - //---NOTE : all the timers function have been modified to // avoid global timers (privatize these). // ----------------------- timers --------------------- @@ -140,6 +139,8 @@ double *x = (double *) malloc (2*nk*sizeof(double)); double *q = (double *) malloc (nq*sizeof(double)); + TRACE_smpi_set_category ("start"); + MPI_Init( &argc, &argv ); MPI_Comm_size( MPI_COMM_WORLD, &no_nodes); MPI_Comm_rank( MPI_COMM_WORLD, &node); @@ -156,7 +157,7 @@ * point print statement (internal file) */ fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark"); - sprintf(size,"%d",pow(2,m+1)); + sprintf(size,"%d",(int)pow(2,m+1)); //size = size.replace('.', ' '); fprintf(stdout," Number of random numbers generated: %s\n",size); fprintf(stdout," Number of active processes: %d\n",no_nodes); @@ -205,6 +206,8 @@ */ MPI_Barrier( MPI_COMM_WORLD ); + TRACE_smpi_set_category ("ep"); + timer_clear(&(elapsed[1])); timer_clear(&(elapsed[2])); timer_clear(&(elapsed[3])); @@ -332,6 +335,8 @@ timer_stop(2,elapsed,start); } + TRACE_smpi_set_category ("finalize"); + //int MPI_Allreduce(void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); sx = x[0]; //FIXME : x[0] or x[1] => x[0] because fortran starts with 1 @@ -397,13 +402,13 @@ Mops = (pow(2.0, m+1))/tm/1000; fprintf(stdout,"EP Benchmark Results:\n"); - fprintf(stdout,"CPU Time=%d\n",tm); + fprintf(stdout,"CPU Time=%d\n",(int) tm); fprintf(stdout,"N = 2^%d\n",m); - fprintf(stdout,"No. Gaussain Pairs =%d\n",gc); - fprintf(stdout,"Sum = %f %ld\n",sx,sy); + fprintf(stdout,"No. Gaussain Pairs =%d\n",(int) gc); + fprintf(stdout,"Sum = %f %ld\n",sx,(long) sy); fprintf(stdout,"Count:"); for(i = 0; i < nq; i++) { - fprintf(stdout,"%d\t %ld\n",i,q[i]); + fprintf(stdout,"%d\t %ld\n",i,(long) q[i]); } /*