-#include "Slave.hpp"\r
-#include "FinalizeTask.hpp"\r
-#include "CommTimeTask.hpp"\r
-#include <Host.hpp>\r
-#include <HostNotFoundException.hpp>\r
-#include <Msg.hpp>\r
-\r
-#include <iostream>\r
-using namespace std;\r
-\r
-MSG_IMPLEMENT_DYNAMIC(Slave, Process);\r
-\r
-int Slave::main(int argc, char** argv)\r
-{\r
- cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Hello I'm " << getName() << " on " << getHost().getName() << "!" << endl;\r
- \r
- while(true) \r
- {\r
- double time1 = getClock(); \r
- Task* t = Task::get(0); \r
- double time2 = getClock();\r
- \r
- if(t->isInstanceOf("FinalizeTask")) \r
- {\r
- delete t;\r
- break;\r
- }\r
- \r
- CommTimeTask* task = reinterpret_cast<CommTimeTask*>(t);\r
- \r
- if(time1 < task->getTime())\r
- time1 = task->getTime();\r
- \r
- // cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Processing \"" << task->getName() << "\" " << getHost().getName() << " (Communication time : " << (time2 - time1) << ")" << endl;\r
- \r
- task->execute();\r
- \r
- delete task;\r
- }\r
- \r
- cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Received Finalize. I'm done. See you!" << endl;\r
-\r
- return 0;\r
- \r
-}
\ No newline at end of file
+#include "Slave.hpp"
+#include "FinalizeTask.hpp"
+#include "CommTimeTask.hpp"
+#include <MsgHost.hpp>
+#include <HostNotFoundException.hpp>
+#include <Msg.hpp>
+
+#include <Msg.hpp>
+
+MSG_IMPLEMENT_DYNAMIC(Slave, Process)
+
+int Slave::main(int argc, char** argv)
+{
+ info("Hello");
+
+ while(true)
+ {
+ double time1 = getClock();
+ Task* t = Task::get(0);
+ double time2 = getClock();
+
+ if(t->isInstanceOf("FinalizeTask"))
+ {
+ delete t;
+ break;
+ }
+
+ CommTimeTask* task = reinterpret_cast<CommTimeTask*>(t);
+
+ if(time1 < task->getTime())
+ time1 = task->getTime();
+
+ //info(TEXT_("Processing \"") + TEXT_(task->getName()) + TEXT_("\" ") + TEXT_(getHost().getName()) + TEXT_(" (Communication time : ") + TEXT_((time2 - time1)) + TEXT_(")"));
+
+ task->execute();
+
+ delete task;
+ }
+
+ info(TEXT_("Received Finalize. I'm done. See you!"));
+
+ delete this;
+ return 0;
+
+}