Skip to content

Commit 1e741b7

Browse files
committed
Fix some printf warnings
1 parent 98ed360 commit 1e741b7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Testing/H5FDdsmReceiver_cwrite_sread_bw.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
2727
RecvBytes = Bytes * dsmManager->GetUpdateNumPieces();
2828
MBytes = RecvBytes / (1024.0 * 1024.0);
2929

30-
if (numRemoteParticles * nRemoteProcs - numParticles * dsmManager->GetUpdateNumPieces() < 0) {
30+
if (numRemoteParticles * nRemoteProcs < numParticles * dsmManager->GetUpdateNumPieces()) {
3131
if (dsmManager->GetUpdatePiece() == 0) fprintf(stderr, "Cannot receive, too many tuples/proc!\n");
3232
fflush(stderr);
3333
receiverFinalize(dsmManager, &comm);
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
3737

3838
if (dsmManager->GetUpdatePiece() == 0) {
3939
printf("# Receiving from DSM ");
40-
printf("%lu particles/proc (%d x %d) -- %lf MB\n",
40+
printf("%llu particles/proc (%d x %d) -- %lf MB\n",
4141
numParticles, NUM_DATASETS, DIM_DATASETS, MBytes);
4242
printf("%-*s%*s", 10, "# NumProcs", 20, "Bandwidth (MB/s)");
4343
if (dsmManager->GetDsmBuffer()->GetDsmType() == H5FD_DSM_TYPE_BLOCK_CYCLIC ||
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
7272
printf("%-*d%*.*f", 10, dsmManager->GetUpdateNumPieces(), 20, 2, bandwidth);
7373
if (dsmManager->GetDsmBuffer()->GetDsmType() == H5FD_DSM_TYPE_BLOCK_CYCLIC
7474
|| dsmManager->GetDsmBuffer()->GetDsmType() == H5FD_DSM_TYPE_BLOCK_RANDOM) {
75-
printf("%*ld", 20, dsmManager->GetDsmBuffer()->GetBlockLength());
75+
printf("%*lld", 20, dsmManager->GetDsmBuffer()->GetBlockLength());
7676
}
7777
printf("\n");
7878
fflush(stdout);

Testing/H5FDdsmSender_cwrite_bw.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int main(int argc, char **argv)
5454

5555
if (dsmManager->GetUpdatePiece() == 0) {
5656
if (type == 0) printf("# Writing to DSM "); else printf("# Writing to Disk ");
57-
printf("%lu particles/proc (%d dataset(s) of dim %d) -- %lf MB\n",
57+
printf("%llu particles/proc (%d dataset(s) of dim %d) -- %lf MB\n",
5858
numParticles, NUM_DATASETS, DIM_DATASETS, MBytes);
5959
printf("%-*s%*s", 10, "# NumProcs", 20, "Bandwidth (MB/s)");
6060
if (dsmManager->GetDsmBuffer()->GetDsmType() == H5FD_DSM_TYPE_BLOCK_CYCLIC ||
@@ -102,7 +102,7 @@ int main(int argc, char **argv)
102102
printf("%-*d%*.*f", 10, dsmManager->GetUpdateNumPieces(), 20, 2, bandwidth);
103103
if (dsmManager->GetDsmBuffer()->GetDsmType() == H5FD_DSM_TYPE_BLOCK_CYCLIC
104104
|| dsmManager->GetDsmBuffer()->GetDsmType() == H5FD_DSM_TYPE_BLOCK_RANDOM) {
105-
printf("%*ld", 20, dsmManager->GetDsmBuffer()->GetBlockLength());
105+
printf("%*lld", 20, dsmManager->GetDsmBuffer()->GetBlockLength());
106106
}
107107
printf("\n");
108108
fflush(stdout);

Testing/H5FDdsmTest.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ H5FDdsmFloat64 TestParticleRead(H5FDdsmConstString filename, H5FDdsmUInt64 ntupl
297297
for (H5FDdsmUInt64 j = 0; j < ncomponents; j++) {
298298
if ((doublearray[ncomponents * i + j] != static_cast<H5FDdsmFloat64>
299299
(i + start + step_increment)) && (fail_count < 10)) {
300-
fprintf(stderr," doublearray[%lu] is %lf, should be %lf\n", ncomponents * i + j,
300+
fprintf(stderr," doublearray[%llu] is %lf, should be %lf\n", ncomponents * i + j,
301301
doublearray[ncomponents * i + j], static_cast<H5FDdsmFloat64>(i + start + step_increment));
302302
fail_count++;
303303
}
@@ -562,11 +562,11 @@ void senderInit(int argc, char* argv[], H5FDdsmManager *dsmManager, MPI_Comm *co
562562
remoteMB = dsmManager->GetDsmBuffer()->GetTotalLength() / (1024.0 * 1024.0);
563563
numServers = dsmManager->GetDsmBuffer()->GetEndServerId() - dsmManager->GetDsmBuffer()->GetStartServerId() + 1;
564564
if (rank == 0) {
565-
printf("# DSM server memory size is: %lf MBytes (%lu Bytes)\n", remoteMB,
565+
printf("# DSM server memory size is: %lf MBytes (%llu Bytes)\n", remoteMB,
566566
dsmManager->GetDsmBuffer()->GetTotalLength());
567567
printf("# DSM server process count: %u\n", numServers);
568568
if (dsmManager->GetDsmBuffer()->GetDsmType() == H5FD_DSM_TYPE_BLOCK_CYCLIC) {
569-
printf("# Block size: %lu Bytes\n", dsmManager->GetDsmBuffer()->GetBlockLength());
569+
printf("# Block size: %llu Bytes\n", dsmManager->GetDsmBuffer()->GetBlockLength());
570570
}
571571
}
572572
}

0 commit comments

Comments
 (0)