Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence compiler warnings 2 #44

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a357508
main returns int (C89)
jeffhammond Jan 15, 2016
ffb0dde
silence pragma and uninit warnings
jeffhammond Jan 15, 2016
cd963f0
silence format warnings
jeffhammond Jan 15, 2016
130d1cf
silence uninit warning
jeffhammond Jan 15, 2016
521b17c
stencil Wformat, Wsigned/unsigned, Wunint
jeffhammond Jan 15, 2016
dc4a4f8
transpose silent
jeffhammond Jan 15, 2016
c0e1355
signed/unsigned compare fix
jeffhammond Jan 15, 2016
d8bec40
silence warnings; some of this should be resolved with different inte…
jeffhammond Jan 15, 2016
64f91b4
preprocess conditionalize Intel pragma
jeffhammond Jan 15, 2016
ec915a1
silence warnings
jeffhammond Jan 15, 2016
9389669
we need OpenMP4 instead of Intel SIMD
jeffhammond Jan 15, 2016
3444828
silence format warnings
jeffhammond Jan 15, 2016
5425f53
rename default_opt_flags to PRK_FLAGS since preprocessor macros shoul…
jeffhammond Jan 15, 2016
1ba6b11
turn on OCD compiler flags
jeffhammond Jan 15, 2016
8c77e22
drop down to C99 since C11 not supported by Travis compilers
jeffhammond Jan 15, 2016
d6138b7
fix more Wformat [ci skip]
jeffhammond Jan 15, 2016
86855f0
reorder make targets in order of success likelihood; rename charm++ t…
jeffhammond Jan 15, 2016
e3ba0aa
fix format warnings
jeffhammond Jan 15, 2016
9dac396
size_t is %zu
jeffhammond Jan 15, 2016
ae4c54d
long long int is %lld, although %ll may be valid too
jeffhammond Jan 15, 2016
6bb2bfb
format fix
jeffhammond Jan 15, 2016
b60bae1
format fix
jeffhammond Jan 15, 2016
00f2177
protect developer pragma warning
jeffhammond Jan 15, 2016
92172ac
format fixes
jeffhammond Jan 15, 2016
18e40b4
dos2unix and compiler warning silencing
jeffhammond Jan 15, 2016
62f2714
silence compiler warnings
jeffhammond Jan 15, 2016
1b9794f
silence compiler warnings
jeffhammond Jan 15, 2016
8e732a5
remove unused status
jeffhammond Jan 15, 2016
1955fde
remove unused variables
jeffhammond Jan 15, 2016
123c227
protect sometimes unused variables
jeffhammond Jan 15, 2016
1ef29ab
silence unused; use C99 in OPENMP/RefCount_private/private.c
jeffhammond Jan 15, 2016
f1817c8
unused variable fixing
jeffhammond Jan 15, 2016
c359d73
fix compiler warnings
jeffhammond Jan 15, 2016
b9ddec7
fix compiler warnings
jeffhammond Jan 15, 2016
698d42a
silence more compiler warnings
jeffhammond Jan 15, 2016
b3afe35
silence more compiler warnings
jeffhammond Jan 15, 2016
d184cf8
silence compiler warnings by initializing to trivial values
jeffhammond Jan 15, 2016
b37be92
initialize variables to trivial values to silence compiler warnings
jeffhammond Jan 15, 2016
38ffbad
abs->fabs
jeffhammond Jan 15, 2016
16b1434
abs->fabs
jeffhammond Jan 15, 2016
9d94b8d
silent compiler warnings
jeffhammond Jan 15, 2016
b7451df
silent compiler warnings
jeffhammond Jan 15, 2016
2489363
silence compiler warnings
jeffhammond Jan 15, 2016
1ad24c4
C99-ification; promote a lot of int to size_t
jeffhammond Jan 15, 2016
1417b52
more warning silence
jeffhammond Jan 15, 2016
1623028
more warning silence
jeffhammond Jan 15, 2016
d1adb87
more warning silence
jeffhammond Jan 15, 2016
cb53541
more warning silence
jeffhammond Jan 15, 2016
7833c82
disable unused vars
jeffhammond Jan 15, 2016
4e7db87
C99-ify transpose
jeffhammond Jan 16, 2016
3114ea1
silence uninit
jeffhammond Jan 18, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,23 @@ addons:
#- clang-3.8
env:
# Order by likelihood of failing...
- PRK_TARGET=allupc
UPC_IMPL=bupc
GASNET_CONDUIT=mpi
- PRK_TARGET=allupc
UPC_IMPL=bupc
GASNET_CONDUIT=ofi
- PRK_TARGET=allupc
UPC_IMPL=bupc
GASNET_CONDUIT=smp
- PRK_TARGET=allupc
UPC_IMPL=bupc
GASNET_CONDUIT=udp
- PRK_TARGET=allupc
UPC_IMPL=gupc
- PRK_TARGET=allampi
- PRK_TARGET=allcharm++
- PRK_TARGET=allfgmpi
# - PRK_TARGET=allupc
# UPC_IMPL=bupc
# GASNET_CONDUIT=mpi
# - PRK_TARGET=allupc
# UPC_IMPL=bupc
# GASNET_CONDUIT=ofi
# - PRK_TARGET=allupc
# UPC_IMPL=bupc
# GASNET_CONDUIT=smp
# - PRK_TARGET=allupc
# UPC_IMPL=bupc
# GASNET_CONDUIT=udp
# - PRK_TARGET=allupc
# UPC_IMPL=gupc
# - PRK_TARGET=allampi
# - PRK_TARGET=allcharm++
# - PRK_TARGET=allfgmpi
- PRK_TARGET=allshmem
- PRK_TARGET=allmpirma
- PRK_TARGET=allmpishm
Expand All @@ -138,6 +138,8 @@ install:
before_script:
- pwd
script:
# This is going to cause most of our tests to fail!
- export PRK_FLAGS="-O3 -Wall -Wextra -Wformat -Werror -pedantic -std=c99"
- sh ./travis/build-run-prk.sh $TRAVIS_ROOT $PRK_TARGET
after_failure:
- echo "Sad panda"
Expand Down
2 changes: 1 addition & 1 deletion AMPI/Synch_p2p/p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ int main(int argc, char ** argv)
/* verify correctness, using top right value */
corner_val = (double) ((iterations+1)*(m+n-2));
if (my_ID == final) {
if (abs(ARRAY(end,n-1)-corner_val)/corner_val >= epsilon) {
if (fabs(ARRAY(end,n-1)-corner_val)/corner_val >= epsilon) {
printf("ERROR: checksum %lf does not match verification value %lf\n",
ARRAY(end,n-1), corner_val);
error = 1;
Expand Down
2 changes: 1 addition & 1 deletion FG_MPI/Synch_p2p/p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ int mymain(int argc, char ** argv)
/* verify correctness, using top right value */
corner_val = (double) ((iterations+1)*(m+n-2));
if (my_ID == final) {
if (abs(ARRAY(end,n-1)-corner_val)/corner_val >= epsilon) {
if (fabs(ARRAY(end,n-1)-corner_val)/corner_val >= epsilon) {
printf("ERROR: checksum %lf does not match verification value %lf\n",
ARRAY(end,n-1), corner_val);
error = 1;
Expand Down
23 changes: 21 additions & 2 deletions MPI1/Branch/branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ HISTORY: Written by Rob Van der Wijngaart, May 2006.
#define INS_HEAVY 99
#define WITH_BRANCHES 1
#define WITHOUT_BRANCHES 0
#define MONKEY_BANANA -1

extern int fill_vec(int *vector, int vector_length, int iterations, int branch,
int *nfunc, int *rank);
Expand All @@ -144,13 +145,12 @@ int main(int argc, char ** argv)
int iterations; /* number of times the branching loop is executed */
int i, iter, aux; /* dummies */
int error = 0; /* error flag */
char *branch_type;
char *branch_type="";
int total=0,
total_sum,
total_ref; /* computed and stored verification values */
int btype;
int * RESTRICT vector, * RESTRICT index;
int factor = -1;

/*********************************************************************
** Initialize the MPI environment
Expand Down Expand Up @@ -197,6 +197,7 @@ int main(int argc, char ** argv)
printf("Wrong branch type: %s; choose vector_stop, vector_go, ", branch_type);
printf("no_vector, or ins_heavy\n");
error = 1;
btype = MONKEY_BANANA;
goto ENDOFTESTS;
}
ENDOFTESTS:;
Expand Down Expand Up @@ -239,13 +240,17 @@ int main(int argc, char ** argv)

case VECTOR_STOP:
for (iter=0; iter<iterations; iter+=2) {
#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (i=0; i<vector_length; i++) {
aux = -(3 - (i&7));
if (vector[index[i]]>0) vector[i] -= 2*vector[i];
else vector[i] -= 2*aux;
}
#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (i=0; i<vector_length; i++) {
aux = (3 - (i&7));
if (vector[index[i]]>0) vector[i] -= 2*vector[i];
Expand All @@ -256,13 +261,17 @@ int main(int argc, char ** argv)

case VECTOR_GO:
for (iter=0; iter<iterations; iter+=2) {
#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (i=0; i<vector_length; i++) {
aux = -(3 - (i&7));
if (aux>0) vector[i] -= 2*vector[i];
else vector[i] -= 2*aux;
}
#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (i=0; i<vector_length; i++) {
aux = (3 - (i&7));
if (aux>0) vector[i] -= 2*vector[i];
Expand All @@ -273,13 +282,17 @@ int main(int argc, char ** argv)

case NO_VECTOR:
for (iter=0; iter<iterations; iter+=2) {
#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (i=0; i<vector_length; i++) {
aux = -(3 - (i&7));
if (aux>0) vector[i] -= 2*vector[index[i]];
else vector[i] -= 2*aux;
}
#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (i=0; i<vector_length; i++) {
aux = (3 - (i&7));
if (aux>0) vector[i] -= 2*vector[index[i]];
Expand Down Expand Up @@ -311,7 +324,9 @@ int main(int argc, char ** argv)
case VECTOR_STOP:
case VECTOR_GO:
for (iter=0; iter<iterations; iter+=2) {
#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (i=0; i<vector_length; i++) {
aux = -(3-(i&7));
vector[i] -= (vector[i] + aux);
Expand All @@ -325,12 +340,16 @@ int main(int argc, char ** argv)

case NO_VECTOR:
for (iter=0; iter<iterations; iter+=2) {
#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (i=0; i<vector_length; i++) {
aux = -(3-(i&7));
vector[i] -= (vector[index[i]]+aux);
}
#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (i=0; i<vector_length; i++) {
aux = (3-(i&7));
vector[i] -= (vector[index[i]]+aux);
Expand Down
3 changes: 1 addition & 2 deletions MPI1/DGEMM/dgemm.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ MPI_Comm comm_row, /* Communicator for this row of nodes */
comm_col; /* Communicator for this column of nodes */
{
int myrow, mycol, /* my row and column index */
nprow, npcol, /* number of node rows and columns */
i, j, kk, updt, /* misc. index variables */
kk, updt, /* misc. index variables */
currow, curcol, /* index of row and column that hold current
row and column, resp., for rank-1 update*/
ii, jj; /* local index (on currow and curcol, resp.)
Expand Down
6 changes: 5 additions & 1 deletion MPI1/Nstream/nstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ int main(int argc, char **argv)
double scalar; /* constant used in Triad operation */
int iterations; /* number of times vector loop gets repeated */
long int length, /* vector length per rank */
total_length, /* total vector length */
total_length=0, /* total vector length */
offset; /* offset between vectors a and b, and b and c */
double bytes; /* memory IO size */
size_t space; /* memory used for a single vector */
Expand Down Expand Up @@ -213,7 +213,9 @@ int main(int argc, char **argv)
printf("Number of iterations = %d\n", iterations);
}

#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (j=0; j<length; j++) {
a[j] = 0.0;
b[j] = 2.0;
Expand All @@ -232,7 +234,9 @@ int main(int argc, char **argv)
local_nstream_time = wtime();
}

#ifdef __INTEL_COMPILER
#pragma vector always
#endif
for (j=0; j<length; j++) a[j] += b[j]+scalar*c[j];

} /* end iterations */
Expand Down
7 changes: 3 additions & 4 deletions MPI1/Random/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ int main(int argc, char **argv) {
int *senddispls; /* successive displacements in send buffer */
int *recvdispls; /* successive dispalcemetns in receive buffer */
u64Int * RESTRICT Table; /* (pseudo-)randomly accessed array */
double random_time, /* timing parameters */
avgtime = 0.0;
double random_time=0.0; /* timing parameters */
int Num_procs, /* rank parameters */
my_ID, /* rank of calling rank */
root=0; /* ID of master rank */
Expand All @@ -194,7 +193,7 @@ int main(int argc, char **argv) {

#ifdef LONG_IS_64BITS
if (sizeof(long) != 8) {
printf("ERROR: Makefile says \"long\" is 8 bytes, but it is %d bytes\n",
printf("ERROR: Makefile says \"long\" is 8 bytes, but it is %zu bytes\n",
sizeof(long));
exit(EXIT_FAILURE);
}
Expand Down Expand Up @@ -288,7 +287,7 @@ int main(int argc, char **argv) {
/* even though the table size can be represented, computing the space
required for the table may lead to overflow */
tablespace = (size_t) loctablesize*sizeof(u64Int);
if ((tablespace/sizeof(u64Int)) != loctablesize || tablespace <=0) {
if ((tablespace/((signed)sizeof(u64Int))) != loctablesize || tablespace <=0) {
printf("ERROR: Cannot represent space for table on this system; ");
printf("reduce log2 tablesize\n");
error = 1;
Expand Down
10 changes: 6 additions & 4 deletions MPI1/Sparse/sparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ int main(int argc, char **argv){
int lsize; /* logarithmic linear size of grid */
int lsize2; /* logarithmic size of grid */
int size; /* linear size of grid */
s64Int size2; /* matrix order (=total # points in grid) */
u64Int size2; /* matrix order (=total # points in grid) */
int radius, /* stencil parameters */
stencil_size;
s64Int row, col, first, last; /* dummies */
u64Int i, j; /* dummies */
int i, j; /* dummies */
int iterations; /* number of times the multiplication is done */

s64Int elm; /* sequence number of matrix nonzero */
Expand All @@ -112,7 +112,7 @@ int main(int argc, char **argv){
jend,
nrows,
row_offset;
s64Int nent; /* number of nonzero entries */
u64Int nent; /* number of nonzero entries */
double sparsity; /* fraction of non-zeroes in matrix */
double local_sparse_time,/* timing parameters */
sparse_time,
Expand Down Expand Up @@ -248,7 +248,7 @@ int main(int argc, char **argv){

matrix = (double *) malloc(matrix_space);
if (!matrix) {
printf("ERROR: rank %d could not allocate space for sparse matrix: "FSTR64U"\n",
printf("ERROR: rank %d could not allocate space for sparse matrix: %zu\n",
my_ID, matrix_space);
error = 1;
}
Expand Down Expand Up @@ -358,7 +358,9 @@ int main(int argc, char **argv){
/* do the actual matrix multiplication */
for (row=0; row<nrows; row++) {
first = stencil_size*row; last = first+stencil_size-1;
#ifdef __INTEL_COMPILER
#pragma simd reduction(+:temp)
#endif
for (temp=0.0,col=first; col<=last; col++) {
temp += matrix[col]*vector[colIndex[col]];
}
Expand Down
20 changes: 10 additions & 10 deletions MPI1/Stencil/stencil.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,25 @@ HISTORY: - Written by Rob Van der Wijngaart, November 2006.
int main(int argc, char ** argv) {

int Num_procs; /* number of ranks */
int Num_procsx, Num_procsy; /* number of ranks in each coord direction */
int Num_procsx=0, Num_procsy=0; /* number of ranks in each coord direction */
int my_ID; /* MPI rank */
int my_IDx, my_IDy; /* coordinates of rank in rank grid */
int right_nbr; /* global rank of right neighboring tile */
int left_nbr; /* global rank of left neighboring tile */
int top_nbr; /* global rank of top neighboring tile */
int bottom_nbr; /* global rank of bottom neighboring tile */
DTYPE *top_buf_out; /* communication buffer */
DTYPE *top_buf_in; /* " " */
DTYPE *bottom_buf_out; /* " " */
DTYPE *bottom_buf_in; /* " " */
DTYPE *right_buf_out; /* " " */
DTYPE *right_buf_in; /* " " */
DTYPE *left_buf_out; /* " " */
DTYPE *left_buf_in; /* " " */
DTYPE *top_buf_out=NULL; /* communication buffer */
DTYPE *top_buf_in=NULL; /* " " */
DTYPE *bottom_buf_out=NULL; /* " " */
DTYPE *bottom_buf_in=NULL; /* " " */
DTYPE *right_buf_out=NULL; /* " " */
DTYPE *right_buf_in=NULL; /* " " */
DTYPE *left_buf_out=NULL; /* " " */
DTYPE *left_buf_in=NULL; /* " " */
int root = 0;
int n, width, height;/* linear global and local grid dimension */
long nsquare; /* total number of grid points */
int i, j, ii, jj, kk, it, jt, iter, leftover; /* dummies */
int i, j, ii, jj, kk, iter, leftover; /* dummies */
int istart, iend; /* bounds of grid tile assigned to calling rank */
int jstart, jend; /* bounds of grid tile assigned to calling rank */
DTYPE norm, /* L1 norm of solution */
Expand Down
4 changes: 2 additions & 2 deletions MPI1/Synch_p2p/p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int main(int argc, char ** argv)
avgtime;
double epsilon = 1.e-8; /* error tolerance */
double corner_val; /* verification value at top right corner of grid */
int i, j, jj, iter, ID;/* dummies */
int i, j, jj, iter;/* dummies */
int iterations; /* number of times to run the pipeline algorithm */
long start, end; /* start and end of grid slice owned by calling rank */
long segment_size; /* size of x-dimension of grid owned by calling rank */
Expand Down Expand Up @@ -292,7 +292,7 @@ int main(int argc, char ** argv)
/* verify correctness, using top right value */
corner_val = (double) ((iterations+1)*(m+n-2));
if (my_ID == final) {
if (abs(ARRAY(end,n-1)-corner_val)/corner_val >= epsilon) {
if (fabs(ARRAY(end,n-1)-corner_val)/corner_val >= epsilon) {
printf("ERROR: checksum %lf does not match verification value %lf\n",
ARRAY(end,n-1), corner_val);
error = 1;
Expand Down
6 changes: 3 additions & 3 deletions MPI1/Transpose/transpose.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ int main(int argc, char ** argv)
int error; /* error flag */
double *A_p; /* original matrix column block */
double *B_p; /* transposed matrix column block */
double *Work_in_p; /* workspace for the transpose function */
double *Work_out_p; /* workspace for the transpose function */
double *Work_in_p=NULL; /* workspace for the transpose function */
double *Work_out_p=NULL; /* workspace for the transpose function */
double abserr, /* absolute error */
abserr_tot; /* aggregate absolute error */
double epsilon = 1.e-8; /* error tolerance */
Expand Down Expand Up @@ -326,7 +326,7 @@ int main(int argc, char ** argv)
for (it=i; it<MIN(Block_order,i+Tile_order); it++)
for (jt=j; jt<MIN(Block_order,j+Tile_order);jt++) {
Work_out(jt,it) = A(it,jt);
A(it,jt) += 1,0;
A(it,jt) += 1.0;
}
}

Expand Down
Loading