X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1282bea34802164b8173a518bcd379fd845bb684..6c5a944539f235e71f1fadb8568c093f96fcfe34:/examples/cxx/ping_pong/Sender.cxx diff --git a/examples/cxx/ping_pong/Sender.cxx b/examples/cxx/ping_pong/Sender.cxx index 8c3f364c86..e5d79686ad 100644 --- a/examples/cxx/ping_pong/Sender.cxx +++ b/examples/cxx/ping_pong/Sender.cxx @@ -1,62 +1,63 @@ -#include "Sender.hpp" -#include "PingPongTask.hpp" -#include -#include -#include - -#include -using namespace std; - -const double commSizeLat = 1; -const double commSizeBw = 100000000; - -MSG_IMPLEMENT_DYNAMIC(Sender, Process); - -int Sender::main(int argc, char** argv) -{ - info("Hello"); - - int hostCount = argc; - - info(TEXT_("Host count : ") + TEXT_(hostCount)); - - Host* hostTable = new Host[hostCount]; - double time; - double computeDuration = 0; - PingPongTask* task; - - for(int pos = 0; pos < argc ; pos++) - { - try - { - hostTable[pos] = Host::getByName(argv[pos]); - } - catch(HostNotFoundException e) - { - error(TEXT_(e.toString()) + TEXT_(". Stopping Now!")); - exit(1); - } - } - - for (int pos = 0; pos < hostCount; pos++) - { - time = getClock(); - - info(TEXT_("Sender time : ") + TEXT_(time)); - - task = new PingPongTask("no name",computeDuration,commSizeLat); - task->setTime(time); - - hostTable[pos].put(0,task); - } - - info("Goodbye!"); - - - delete[] hostTable; - - delete this; - - return 0; - -} \ No newline at end of file +#include "Sender.hpp" +#include "PingPongTask.hpp" +#include +#include +#include + +#include +using namespace std; + +const double commSizeLat = 1; +const double commSizeBw = 100000000; + +MSG_IMPLEMENT_DYNAMIC(Sender, Process) + +int Sender::main(int argc, char** argv) +{ + info("Hello"); + + int hostCount = argc; + + info(TEXT_("Host count : ") + TEXT_(hostCount)); + + Host* hostTable = new Host[hostCount]; + double time; + double computeDuration = 0; + PingPongTask* task; + + for(int pos = 0; pos < argc ; pos++) + { + try + { + hostTable[pos] = Host::getByName(argv[pos]); + } + catch(HostNotFoundException e) + { + error(TEXT_(e.toString()) + TEXT_(". Stopping Now!")); + exit(1); + } + } + + for (int pos = 0; pos < hostCount; pos++) + { + time = getClock(); + + info(TEXT_("Sender time : ") + TEXT_(time)); + + task = new PingPongTask("no name",computeDuration,commSizeLat); + task->setTime(time); + + hostTable[pos].put(0,task); + } + + info("Goodbye!"); + + + delete[] hostTable; + + delete this; + + return 0; + +} +