2 #include "FinalizeTask.hpp"
\r
3 #include "CommTimeTask.hpp"
\r
5 #include <HostNotFoundException.hpp>
\r
11 MSG_IMPLEMENT_DYNAMIC(Slave, Process);
\r
13 int Slave::main(int argc, char** argv)
\r
15 cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Hello I'm " << getName() << " on " << getHost().getName() << "!" << endl;
\r
19 double time1 = getClock();
\r
20 Task* t = Task::get(0);
\r
21 double time2 = getClock();
\r
23 if(t->isInstanceOf("FinalizeTask"))
\r
29 CommTimeTask* task = reinterpret_cast<CommTimeTask*>(t);
\r
31 if(time1 < task->getTime())
\r
32 time1 = task->getTime();
\r
34 // cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Processing \"" << task->getName() << "\" " << getHost().getName() << " (Communication time : " << (time2 - time1) << ")" << endl;
\r
41 cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Received Finalize. I'm done. See you!" << endl;
\r