diff --git a/.travis.yml b/.travis.yml index 122fc091e..203af5518 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,10 +36,12 @@ matrix: env: PRK_TARGET=allupc UPC_IMPL=bupc GASNET_CONDUIT=udp + PRK_FLAGS="-Wc,-O3" - os: osx env: PRK_TARGET=allupc UPC_IMPL=bupc GASNET_CONDUIT=smp + PRK_FLAGS="-Wc,-O3" # Mac issue with thread_t (see https://github.com/humairakamal/fgmpi/pull/1) - os: osx env: PRK_TARGET=allfgmpi @@ -57,11 +59,13 @@ matrix: - env: PRK_TARGET=allupc UPC_IMPL=bupc GASNET_CONDUIT=ofi + PRK_FLAGS="-Wc,-O3" # UPC over MPICH on Mac hangs - may be async progress issue - os: osx env: PRK_TARGET=allupc UPC_IMPL=bupc GASNET_CONDUIT=mpi + PRK_FLAGS="-Wc,-O3" # probably because of old GCC (4.6) - os: linux compiler: gcc @@ -126,15 +130,19 @@ env: - PRK_TARGET=allupc UPC_IMPL=bupc GASNET_CONDUIT=mpi + PRK_FLAGS="-Wc,-O3" - PRK_TARGET=allupc UPC_IMPL=bupc GASNET_CONDUIT=ofi + PRK_FLAGS="-Wc,-O3" - PRK_TARGET=allupc UPC_IMPL=bupc GASNET_CONDUIT=smp + PRK_FLAGS="-Wc,-O3" - PRK_TARGET=allupc UPC_IMPL=bupc GASNET_CONDUIT=udp + PRK_FLAGS="-Wc,-O3" - PRK_TARGET=allupc UPC_IMPL=gupc - PRK_TARGET=allampi diff --git a/Makefile b/Makefile index fdc781f22..261071d22 100644 --- a/Makefile +++ b/Makefile @@ -38,11 +38,13 @@ ifndef matrix_rank matrix_rank=5 endif -ifndef default_opt_flags - default_opt_flags=-O3 +ifndef PRK_FLAGS + PRK_FLAGS=-O3 endif -default: +default: allserial allopenmp allmpi + +help: @echo "Usage: \"make all\" (re-)builds all targets" @echo " \"make allserial\" (re-)builds all serial targets" @echo " \"make allopenmp\" (re-)builds all OpenMP targets" @@ -72,117 +74,117 @@ alldarwin: allserial allopenmp allmpi1 allfgmpi allmpiopenmp allmpirma allshmem allfreaks: allcharm++ allampi allgrappa allmpi1: - cd MPI1/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPI1/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPI1/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPI1/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPI1/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPI1/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPI1/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPI1/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPI1/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPI1/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(default_opt_flags)" \ + cd MPI1/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPI1/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPI1/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPI1/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPI1/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPI1/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPI1/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPI1/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPI1/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPI1/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" \ "MATRIX_RANK = $(matrix_rank)" \ "NUMBER_OF_FUNCTIONS = $(number_of_functions)" allampi: - cd AMPI/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd AMPI/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd AMPI/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd AMPI/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd AMPI/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd AMPI/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd AMPI/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd AMPI/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd AMPI/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd AMPI/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(default_opt_flags)" \ + cd AMPI/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd AMPI/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd AMPI/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd AMPI/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd AMPI/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd AMPI/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd AMPI/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd AMPI/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd AMPI/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd AMPI/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" \ "MATRIX_RANK = $(matrix_rank)" \ "NUMBER_OF_FUNCTIONS = $(number_of_functions)" allfgmpi: cd scripts/small; $(MAKE) -f Makefile_FG_MPI runfgmpi cd scripts/wide; $(MAKE) -f Makefile_FG_MPI runfgmpi - cd FG_MPI/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd FG_MPI/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd FG_MPI/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd FG_MPI/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd FG_MPI/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd FG_MPI/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd FG_MPI/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd FG_MPI/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd FG_MPI/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd FG_MPI/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(default_opt_flags)" \ + cd FG_MPI/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd FG_MPI/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd FG_MPI/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd FG_MPI/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd FG_MPI/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd FG_MPI/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd FG_MPI/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd FG_MPI/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd FG_MPI/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd FG_MPI/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" \ "MATRIX_RANK = $(matrix_rank)" \ "NUMBER_OF_FUNCTIONS = $(number_of_functions)" allmpiopenmp: - cd MPIOPENMP/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPIOPENMP/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPIOPENMP/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPIOPENMP/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPIOPENMP/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPIOPENMP/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPIOPENMP/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPIOPENMP/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" allmpiomp: allmpiopenmp allmpirma: - cd MPIRMA/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPIRMA/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPIRMA/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPIRMA/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPIRMA/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPIRMA/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" allshmem: - cd SHMEM/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd SHMEM/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd SHMEM/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd SHMEM/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd SHMEM/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd SHMEM/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" allmpishm: - cd MPISHM/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPISHM/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd MPISHM/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPISHM/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPISHM/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd MPISHM/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" allmpi: allmpi1 allmpiomp allmpirma allmpishm allupc: - cd UPC/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd UPC/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd UPC/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd UPC/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd UPC/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd UPC/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" allpgas: allshmem allupc allmpirma allopenmp: - cd OPENMP/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/RefCount_shared; $(MAKE) shared "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/RefCount_private; $(MAKE) private "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd OPENMP/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(default_opt_flags)" \ + cd OPENMP/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/RefCount_shared; $(MAKE) shared "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/RefCount_private; $(MAKE) private "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd OPENMP/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" \ "MATRIX_RANK = $(matrix_rank)" \ "NUMBER_OF_FUNCTIONS = $(number_of_functions)" allcharm++: - cd CHARM++/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd CHARM++/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd CHARM++/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd CHARM++/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd CHARM++/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd CHARM++/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" allgrappa: - cd GRAPPA/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd GRAPPA/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd GRAPPA/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd GRAPPA/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd GRAPPA/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd GRAPPA/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" allserial: - cd SERIAL/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd SERIAL/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd SERIAL/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd SERIAL/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd SERIAL/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd SERIAL/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd SERIAL/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd SERIAL/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" - cd SERIAL/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(default_opt_flags)" \ + cd SERIAL/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd SERIAL/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd SERIAL/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd SERIAL/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd SERIAL/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd SERIAL/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd SERIAL/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd SERIAL/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" + cd SERIAL/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(PRK_FLAGS)" \ "MATRIX_RANK = $(matrix_rank)" \ "NUMBER_OF_FUNCTIONS = $(number_of_functions)" cd SERIAL/PIC; $(MAKE) pic "DEFAULT_OPT_FLAGS = $(default_opt_flags)" diff --git a/OPENMP/DGEMM/dgemm.c b/OPENMP/DGEMM/dgemm.c index 7f0805ed9..cd7fe666f 100755 --- a/OPENMP/DGEMM/dgemm.c +++ b/OPENMP/DGEMM/dgemm.c @@ -87,7 +87,7 @@ HISTORY: Written by Rob Van der Wijngaart, September 2006. #define forder (1.0*order) -main(int argc, char **argv){ +int main(int argc, char **argv){ int iter, i,ii,j,jj,k,kk,ig,jg,kg; /* dummies */ int iterations; /* number of times the multiplication is done */ @@ -167,7 +167,7 @@ main(int argc, char **argv){ #pragma omp parallel private (i,j,k,ii,jj,kk,ig,jg,kg,iter) { - double *AA, *BB, *CC; + double *AA=NULL, *BB=NULL, *CC=NULL; if (block > 0) { /* matrix blocks for local temporary copies */ diff --git a/OPENMP/Nstream/nstream.c b/OPENMP/Nstream/nstream.c index ab3142119..1299294be 100755 --- a/OPENMP/Nstream/nstream.c +++ b/OPENMP/Nstream/nstream.c @@ -230,8 +230,11 @@ int main(int argc, char **argv) } bail_out(num_error); + /* FIXME Use OpenMP 4 via _Pragma */ #pragma omp for +#ifdef __INTEL_COMPILER #pragma vector always +#endif for (j=0; j= 1 : %d \n",vector_length); + printf("ERROR: vector length must be >= 1 : %ld \n",vector_length); exit(EXIT_FAILURE); } @@ -195,7 +195,7 @@ int main(int argc, char ** argv) } else { printf("Number of threads = %d\n",nthread_input); - printf("Vector length = %d\n", vector_length); + printf("Vector length = %ld\n", vector_length); printf("Reduction algorithm = %s\n", algorithm); printf("Number of iterations = %d\n", iterations); } diff --git a/SERIAL/Branch/branch.c b/SERIAL/Branch/branch.c index 4a56d8fed..bcb5c5c0c 100755 --- a/SERIAL/Branch/branch.c +++ b/SERIAL/Branch/branch.c @@ -145,7 +145,7 @@ int main(int argc, char ** argv) total_ref; /* computed and stored verification values */ int * RESTRICT vector; int * RESTRICT index; - int factor = -1; + /* UNUSED int factor = -1; */ /********************************************************************************** ** process and test input parameters @@ -169,7 +169,7 @@ int main(int argc, char ** argv) vector_length = atol(*++argv); if (vector_length < 1){ - printf("ERROR: loop length must be >= 1 : %d \n",vector_length); + printf("ERROR: loop length must be >= 1 : %ld \n",vector_length); exit(EXIT_FAILURE); } @@ -214,13 +214,17 @@ int main(int argc, char ** argv) case VECTOR_STOP: /* condition vector[index[i]]>0 inhibits vectorization */ for (iter=0; iter0) vector[i] -= 2*vector[i]; else vector[i] -= 2*aux; } +#ifdef __INTEL_COMPILER #pragma vector always +#endif for (i=0; i0) vector[i] -= 2*vector[i]; @@ -232,13 +236,17 @@ int main(int argc, char ** argv) case VECTOR_GO: /* condition aux>0 allows vectorization */ for (iter=0; iter0) vector[i] -= 2*vector[i]; else vector[i] -= 2*aux; } +#ifdef __INTEL_COMPILER #pragma vector always +#endif for (i=0; i0) vector[i] -= 2*vector[i]; @@ -250,13 +258,17 @@ int main(int argc, char ** argv) case NO_VECTOR: /* condition aux>0 allows vectorization, but indirect indexing inbibits it */ for (iter=0; iter0) vector[i] -= 2*vector[index[i]]; else vector[i] -= 2*aux; } +#ifdef __INTEL_COMPILER #pragma vector always +#endif for (i=0; i0) vector[i] -= 2*vector[index[i]]; @@ -286,7 +298,9 @@ int main(int argc, char ** argv) case VECTOR_STOP: case VECTOR_GO: for (iter=0; iter0) - printf("Blocking factor = %d\n", block); + printf("Blocking factor = %ld\n", block); else printf("No blocking\n"); printf("Number of iterations = %d\n", iterations); diff --git a/SERIAL/Nstream/nstream.c b/SERIAL/Nstream/nstream.c index 831d83cb8..14c5160d3 100755 --- a/SERIAL/Nstream/nstream.c +++ b/SERIAL/Nstream/nstream.c @@ -206,7 +206,9 @@ int main(int argc, char **argv) printf("Offset = %ld\n", offset); printf("Number of iterations = %d\n", iterations); +#ifdef __INTEL_COMPILER #pragma vector always +#endif for (j=0; j n) { - printf("ERROR: Stencil radius %d exceeds grid size %d\n", RADIUS, n); + printf("ERROR: Stencil radius %d exceeds grid size %ld\n", RADIUS, n); exit(EXIT_FAILURE); } /* make sure the vector space can be represented */ total_length = n*n*sizeof(DTYPE); - if (total_length/n != n*sizeof(DTYPE)) { - printf("ERROR: Space for %d x %d grid cannot be represented; ", n, n); + if (total_length/n != n*(signed)sizeof(DTYPE)) { + printf("ERROR: Space for %ld x %ld grid cannot be represented; ", n, n); exit(EXIT_FAILURE); } @@ -181,7 +181,7 @@ int main(int argc, char ** argv) { norm = (DTYPE) 0.0; f_active_points = (DTYPE) (n-2*RADIUS)*(DTYPE) (n-2*RADIUS); - printf("Grid size = %d\n", n); + printf("Grid size = %ld\n", n); printf("Radius of stencil = %d\n", RADIUS); #ifdef STAR printf("Type of stencil = star\n"); @@ -208,6 +208,8 @@ int main(int argc, char ** argv) { for (j=RADIUS; j