X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/137c0138d26b47cf57235d31777d554d9ce432f1..c5f8dbbcfb10a8a1c797d0fe1671d7f7698cf6cd:/examples/smpi/simple-execute/simple-execute.c diff --git a/examples/smpi/simple-execute/simple-execute.c b/examples/smpi/simple-execute/simple-execute.c index 1b5fb81cdd..f865162ae2 100644 --- a/examples/smpi/simple-execute/simple-execute.c +++ b/examples/smpi/simple-execute/simple-execute.c @@ -1,6 +1,6 @@ /* A simple example ping-pong program to test MPI_Send and MPI_Recv */ -/* Copyright (c) 2009-2021. The SimGrid Team. +/* Copyright (c) 2009-2023. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -33,19 +33,19 @@ int main(int argc, char *argv[]) MPI_Finalize(); exit(0); } - if (0 == rank) { + if (rank == 0) { printf("\n *** Ping-pong test (MPI_Send/MPI_Recv) ***\n\n"); - } - /* start ping-pong tests between several pairs */ - if ( rank == 0) { + /* start ping-pong tests between several pairs */ int dst = 1; printf("[%d] About to send 1st message '%d' to process [%d]\n", rank, msg, dst); MPI_Send(&msg, 1, MPI_INT, dst, tag1, MPI_COMM_WORLD); /* Inject five seconds of fake computation time */ - /* We are in a public file, not internal to simgrid, so _benched flavour is preferred, as it protects against accidental skip */ - /* smpi_execute_benched here is mostly equivalent to sleep, which is intercepted by smpi and turned into smpi_sleep */ + /* We are in a public file, not internal to SimGrid, so _benched flavour is preferred, as it protects against + * accidental skip */ + /* smpi_execute_benched here is mostly equivalent to sleep, which is intercepted by smpi and turned into smpi_sleep + */ /* Difference with sleep is only for energy consumption */ smpi_execute_benched(5.0); @@ -58,7 +58,8 @@ int main(int argc, char *argv[]) msg++; /* Inject 762.96 Mflops of computation time - Host Jupiter is 76.296Mf per second, so this should amount to 10s */ - /* We are in a public file, not internal to simgrid, so _benched flavour is preferred, as it protects against accidental skip */ + /* We are in a public file, not internal to SimGrid, so _benched flavour is preferred, as it protects against + * accidental skip */ smpi_execute_flops_benched(762960000); printf("[%d] After a nap, increment message's value to '%d'\n", rank, msg);