1 #include "Sender.hpp"
\r
2 #include "PingPongTask.hpp"
\r
4 #include <HostNotFoundException.hpp>
\r
10 const double commSizeLat = 1;
\r
11 const double commSizeBw = 100000000;
\r
13 MSG_IMPLEMENT_DYNAMIC(Sender, Process);
\r
15 int Sender::main(int argc, char** argv)
\r
17 cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Hello I'm " << getName() << " on " << getHost().getName() << "!" << endl;
\r
19 int hostCount = argc;
\r
21 cout <<"[" << getName() << ":" << getHost().getName() << "] " << "host count : " << hostCount << endl;
\r
23 Host* hostTable = new Host[hostCount];
\r
25 double computeDuration = 0;
\r
28 for(int pos = 0; pos < argc ; pos++)
\r
32 hostTable[pos] = Host::getByName(argv[pos]);
\r
34 catch(HostNotFoundException e)
\r
36 cerr << e.toString() <<". Stopping Now!" << endl;
\r
41 for (int pos = 0; pos < hostCount; pos++)
\r
45 cout <<"[" << getName() << ":" << getHost().getName() << "] " << "sender time : " << time << endl;
\r
47 task = new PingPongTask("no name",computeDuration,commSizeLat);
\r
48 task->setTime(time);
\r
50 hostTable[pos].put(0,task);
\r
53 cout <<"[" << getName() << ":" << getHost().getName() << "] " << "goodbye!" << endl;
\r