Skip to content

Commit

Permalink
fix all printf format incompatibilities
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhammond committed Dec 27, 2015
1 parent 22c8150 commit 397df4c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions MPIRMA/Synch_p2p/p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ int main(int argc, char ** argv)
m = atol(*++argv);
n = atol(*++argv);
if (m < 1 || n < 1){
printf("ERROR: grid dimensions must be positive: %d, %d \n", m, n);
printf("ERROR: grid dimensions must be positive: %ld, %ld \n", m, n);
error = 1;
goto ENDOFTESTS;
}

if (m<Num_procs) {
printf("ERROR: First grid dimension %d smaller than number of ranks %d\n",
printf("ERROR: First grid dimension %ld smaller than number of ranks %d\n",
m, Num_procs);
error = 1;
goto ENDOFTESTS;
Expand Down Expand Up @@ -191,7 +191,7 @@ int main(int argc, char ** argv)
MPI_Win_create(vector, total_length*sizeof(double), sizeof(double), rma_winfo, MPI_COMM_WORLD, &rma_win);
/* MPI_Win_allocate(total_length*sizeof(double), sizeof(double), rma_winfo, MPI_COMM_WORLD, (void *) &vector, &rma_win); */
if (vector == NULL) {
printf("Could not allocate space for grid slice of %d by %d points",
printf("Could not allocate space for grid slice of %ld by %ld points",
segment_size, n);
printf(" on rank %d\n", my_ID);
error = 1;
Expand Down
6 changes: 3 additions & 3 deletions MPIRMA/Transpose/transpose.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ int main(int argc, char ** argv)

order = atol(*++argv);
if (order < Num_procs) {
printf("ERROR: matrix order %d should at least # procs %d\n",
printf("ERROR: matrix order %ld should at least # procs %d\n",
order, Num_procs);
error = 1; goto ENDOFTESTS;
}
if (order%Num_procs) {
printf("ERROR: matrix order %d should be divisible by # procs %d\n",
printf("ERROR: matrix order %ld should be divisible by # procs %d\n",
order, Num_procs);
error = 1; goto ENDOFTESTS;
}
Expand All @@ -214,7 +214,7 @@ int main(int argc, char ** argv)

if (my_ID == root) {
printf("Number of ranks = %d\n", Num_procs);
printf("Matrix order = %d\n", order);
printf("Matrix order = %ld\n", order);
printf("Number of iterations = %d\n", iterations);
if ((Tile_order > 0) && (Tile_order < order))
printf("Tile size = %d\n", Tile_order);
Expand Down
4 changes: 2 additions & 2 deletions MPISHM/Stencil/stencil.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ int main(int argc, char ** argv) {
}

if (2*RADIUS +1 > 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);
error = 1;
goto ENDOFTESTS;
}
Expand Down Expand Up @@ -325,7 +325,7 @@ int main(int argc, char ** argv) {

if (my_ID == root) {
printf("Number of ranks = %d\n", Num_procs);
printf("Grid size = %d\n", n);
printf("Grid size = %ld\n", n);
printf("Radius of stencil = %d\n", RADIUS);
printf("Tiles in x/y-direction = %d/%d\n", Num_procsx, Num_procsy);
printf("Tiles per shared memory domain = %d\n", group_size);
Expand Down
6 changes: 3 additions & 3 deletions MPISHM/Synch_p2p/p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ int main(int argc, char ** argv)
m = atol(*++argv);
n = atol(*++argv);
if (m < 1 || n < 1){
printf("ERROR: grid dimensions must be positive: %d, %d \n", m, n);
printf("ERROR: grid dimensions must be positive: %ld, %ld \n", m, n);
error = 1;
goto ENDOFTESTS;
}

if (m<Num_procs) {
printf("ERROR: First grid dimension %d smaller than number of ranks %d\n",
printf("ERROR: First grid dimension %ld smaller than number of ranks %d\n",
m, Num_procs);
error = 1;
goto ENDOFTESTS;
Expand Down Expand Up @@ -209,7 +209,7 @@ int main(int argc, char ** argv)
MPI_Win_allocate_shared(total_length*sizeof(double), sizeof(double),
rma_winfo, shm_comm, (void *) &vector, &shm_win);
if (vector == NULL) {
printf("Could not allocate space for grid slice of %d by %d points",
printf("Could not allocate space for grid slice of %ld by %ld points",
segment_size, n);
printf(" on rank %d\n", my_ID);
error = 1;
Expand Down
6 changes: 3 additions & 3 deletions MPISHM/Transpose/transpose.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ int main(int argc, char ** argv)

order = atol(*++argv);
if (order < Num_procs) {
printf("ERROR: matrix order %d should at least # procs %d\n",
printf("ERROR: matrix order %ld should at least # procs %d\n",
order, Num_procs);
error = 1; goto ENDOFTESTS;
}

if (order%Num_procs) {
printf("ERROR: matrix order %d should be divisible by # procs %d\n",
printf("ERROR: matrix order %ld should be divisible by # procs %d\n",
order, Num_procs);
error = 1; goto ENDOFTESTS;
}
Expand All @@ -197,7 +197,7 @@ int main(int argc, char ** argv)
if (my_ID == root) {
printf("Number of ranks = %d\n", Num_procs);
printf("Rank group size = %d\n", group_size);
printf("Matrix order = %d\n", order);
printf("Matrix order = %ld\n", order);
printf("Number of iterations = %d\n", iterations);
if ((Tile_order > 0) && (Tile_order < order))
printf("Tile size = %d\n", Tile_order);
Expand Down

0 comments on commit 397df4c

Please sign in to comment.