X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8f9dca01ff99392fc22351aa153aa78a9aa72286..2fa31273f15799271677dad1a964997bc5a057f9:/examples/smpi/energy/energy.c diff --git a/examples/smpi/energy/energy.c b/examples/smpi/energy/energy.c index 6126811d47..9a733c9669 100644 --- a/examples/smpi/energy/energy.c +++ b/examples/smpi/energy/energy.c @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) { int rank; - int i; + unsigned long i; char buf[1024]; int err = MPI_Init(&argc, &argv); @@ -31,13 +31,12 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - int pstates = sg_host_get_nb_pstates(sg_host_self()); + unsigned long pstates = sg_host_get_nb_pstates(sg_host_self()); char *s = buf; size_t sz = sizeof buf; - size_t x = snprintf(s, sz, - "[%.6f] [rank %d] Pstates: %d; Powers: %.0f", - MPI_Wtime(), rank, pstates, sg_host_get_pstate_speed(sg_host_self(), 0)); + size_t x = snprintf(s, sz, "[%.6f] [rank %d] Pstates: %lu; Powers: %.0f", MPI_Wtime(), rank, pstates, + sg_host_get_pstate_speed(sg_host_self(), 0)); if (x < sz) { s += x; sz -= x; @@ -55,7 +54,7 @@ int main(int argc, char *argv[]) for (i = 0; i < pstates; i++) { sg_host_set_pstate(sg_host_self(), i); - fprintf(stderr, "[%.6f] [rank %d] Current pstate: %d; Current power: %.0f\n", MPI_Wtime(), rank, i, + fprintf(stderr, "[%.6f] [rank %d] Current pstate: %lu; Current power: %.0f\n", MPI_Wtime(), rank, i, sg_host_get_speed(sg_host_self())); SMPI_SAMPLE_FLOPS(1e9) {