From: navarro Date: Fri, 25 May 2012 12:16:40 +0000 (+0200) Subject: Remove bindings CXX from Simgrid X-Git-Tag: v3_8~668 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5d37103da397672aff379d7dc01186068bfc1498 Remove bindings CXX from Simgrid --- diff --git a/examples/cxx/autoDestination/BasicTask.cxx b/examples/cxx/autoDestination/BasicTask.cxx deleted file mode 100644 index 19cd54a77b..0000000000 --- a/examples/cxx/autoDestination/BasicTask.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "BasicTask.hpp" - -MSG_IMPLEMENT_DYNAMIC(BasicTask, Task) diff --git a/examples/cxx/autoDestination/BasicTask.hpp b/examples/cxx/autoDestination/BasicTask.hpp deleted file mode 100644 index 8e2866d7bf..0000000000 --- a/examples/cxx/autoDestination/BasicTask.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef BASIC_TASK_HPP -#define BASIC_TASK_HPP - -#include -using namespace SimGrid::Msg; - -class BasicTask : public Task -{ - MSG_DECLARE_DYNAMIC(BasicTask); -public: - - // Default constructor. - BasicTask() {} - - // Destructor - virtual ~BasicTask() - throw (MsgException) {} - BasicTask(const char* name, double computeDuration, double messageSize) - throw (InvalidArgumentException, NullPointerException) - :Task(name, computeDuration, messageSize){} - - /*virtual const BasicTask& operator = (const BasicTask& rTask) { - Task::operator=(rTask); - return *this; - }*/ -}; - -typedef BasicTask* BasicTaskPtr; - - -#endif // !BASIC_TASK_HPP diff --git a/examples/cxx/autoDestination/FinalizeTask.cxx b/examples/cxx/autoDestination/FinalizeTask.cxx deleted file mode 100644 index 0805537c9f..0000000000 --- a/examples/cxx/autoDestination/FinalizeTask.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "FinalizeTask.hpp" - -MSG_IMPLEMENT_DYNAMIC(FinalizeTask, Task) diff --git a/examples/cxx/autoDestination/FinalizeTask.hpp b/examples/cxx/autoDestination/FinalizeTask.hpp deleted file mode 100644 index 62f7adeeaa..0000000000 --- a/examples/cxx/autoDestination/FinalizeTask.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef FINALIZE_TASK_HPP -#define FINALIZE_TASK_HPP - -#include -using namespace SimGrid::Msg; - -class FinalizeTask : public Task -{ - MSG_DECLARE_DYNAMIC(FinalizeTask); -public: - - // Default constructor. - FinalizeTask() - throw (InvalidArgumentException, NullPointerException) - :Task("finalize", 0.0, 0.0){} - - // Destructor - virtual ~FinalizeTask() - throw (MsgException) {} - -}; - -#endif // !FINALIZE_TASK_HPP diff --git a/examples/cxx/autoDestination/Forwarder.cxx b/examples/cxx/autoDestination/Forwarder.cxx deleted file mode 100644 index 052bf87ef3..0000000000 --- a/examples/cxx/autoDestination/Forwarder.cxx +++ /dev/null @@ -1,60 +0,0 @@ -#include "Forwarder.hpp" -#include "BasicTask.hpp" -#include "FinalizeTask.hpp" - -#include -#include - -#include - -MSG_IMPLEMENT_DYNAMIC(Forwarder, Process) - -int Forwarder::main(int argc, char** argv) -{ - info("Hello"); - - int aliasCount = argc; - - int taskCount = 0; - - Task* taskReceived; - Task* finalizeTask; - BasicTask* basicTask; - - while(true) - { - taskReceived = Task::receive(); - - if(taskReceived->isInstanceOf("FinalizeTask")) - { - info("All tasks have been dispatched. Let's tell everybody the computation is over."); - - for (int i = 0; i < aliasCount; i++) - { - finalizeTask = new FinalizeTask(); - finalizeTask->send(argv[i]); - } - - delete taskReceived; - - break; - } - - basicTask = reinterpret_cast(taskReceived); - - info(TEXT_("Received \"") + TEXT_(basicTask->getName()) + TEXT_("\" ")); - - info(TEXT_("Sending \"") + TEXT_(basicTask->getName()) + TEXT_("\" to \"") + TEXT_(argv[taskCount % aliasCount])); - - basicTask->send(argv[taskCount % aliasCount]); - - taskCount++; - } - - - info("I'm done. See you!"); - - delete this; - - return 0; -} diff --git a/examples/cxx/autoDestination/Forwarder.hpp b/examples/cxx/autoDestination/Forwarder.hpp deleted file mode 100644 index b09b821635..0000000000 --- a/examples/cxx/autoDestination/Forwarder.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef FORWARDER_HPP -#define FORWARDER_HPP - -#include -using namespace SimGrid::Msg; - -class Forwarder : public Process -{ - MSG_DECLARE_DYNAMIC(Forwarder); - - public: - - // Default constructor. - Forwarder(){} - - // Destructor. - virtual ~Forwarder(){} - - int main(int argc, char** argv); - -}; - - -#endif // !FORWARDER_HPP diff --git a/examples/cxx/autoDestination/Main.cxx b/examples/cxx/autoDestination/Main.cxx deleted file mode 100644 index cf27e28bb6..0000000000 --- a/examples/cxx/autoDestination/Main.cxx +++ /dev/null @@ -1,12 +0,0 @@ -#include - -using namespace SimGrid::Msg; - -int -main(int argc, char* argv[]) -{ - Simulation s; - - return s.execute(argc, argv); - -} diff --git a/examples/cxx/autoDestination/Master.cxx b/examples/cxx/autoDestination/Master.cxx deleted file mode 100644 index 6abe58fa14..0000000000 --- a/examples/cxx/autoDestination/Master.cxx +++ /dev/null @@ -1,80 +0,0 @@ -#include "Master.hpp" -#include "BasicTask.hpp" -#include "FinalizeTask.hpp" - -#include -#include - -#include - -MSG_IMPLEMENT_DYNAMIC(Master, Process) - -int Master::main(int argc, char** argv) -{ - int taskCount; - double taskComputeSize; - double taskCommunicateSize; - - info("Hello"); - - info(TEXT_("argc=") + TEXT_(argc)); - - for (int i = 0; i< argc; i++) - info(TEXT_("argv:") + TEXT_(argv[i])); - - sscanf(argv[0],"%d", &taskCount); - sscanf(argv[1],"%lg", &taskComputeSize); - sscanf(argv[2],"%lg", &taskCommunicateSize); - - BasicTaskPtr* basicTasks = new BasicTaskPtr[taskCount]; - - for (int i = 0; i < taskCount; i++) - basicTasks[i] = new BasicTask((TEXT_("Task_") + TEXT_(i)), taskComputeSize, taskCommunicateSize); - - int aliasCount = argc - 3; - - char** aliases = (char**) calloc(aliasCount, sizeof(char*)); - - for(int i = 3; i < argc ; i++) - aliases[i - 3] = _strdup(argv[i]); - - info(TEXT_("Got ") + TEXT_(aliasCount) + TEXT_(" alias(es) :")); - - for (int i = 0; i < aliasCount; i++) - info(TEXT_("\t") + TEXT_(aliases[i])); - - info(TEXT_("Got ") + TEXT_(taskCount) + TEXT_(" task to process.")); - - for (int i = 0; i < taskCount; i++) - { - info(TEXT_("Sending \"") + TEXT_(basicTasks[i]->getName()) + TEXT_("\" to \"") + TEXT_(aliases[i % aliasCount]) + TEXT_("\"")); - - /*if((Host::currentHost().getName()).equals((aliases[i % aliasCount].split(":"))[0])) - info("Hey ! It's me ! "); - */ - - basicTasks[i]->send(aliases[i % aliasCount]); - } - - info("Send completed"); - - info("All tasks have been dispatched. Let's tell everybody the computation is over."); - - FinalizeTask* finalizeTask; - - for (int i = 0; i < aliasCount; i++) - { - finalizeTask = new FinalizeTask(); - finalizeTask->send(aliases[i]); - - } - - info("Goodbye now!"); - - delete[] basicTasks; - delete[] aliases; - - delete this; - - return 0; -} diff --git a/examples/cxx/autoDestination/Master.hpp b/examples/cxx/autoDestination/Master.hpp deleted file mode 100644 index b3e59ab7d6..0000000000 --- a/examples/cxx/autoDestination/Master.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef MASTER_HPP -#define MASTER_HPP - -#include -using namespace SimGrid::Msg; - -class Master : public Process -{ - MSG_DECLARE_DYNAMIC(Master); - - public: - - // Default constructor. - Master(){} - - // Destructor. - virtual ~Master(){} - - int main(int argc, char** argv); - -}; - -#endif // !MASTER_HPP diff --git a/examples/cxx/autoDestination/Slave.cxx b/examples/cxx/autoDestination/Slave.cxx deleted file mode 100644 index f0eb61151d..0000000000 --- a/examples/cxx/autoDestination/Slave.cxx +++ /dev/null @@ -1,47 +0,0 @@ -#include "Slave.hpp" -#include "FinalizeTask.hpp" -#include "BasicTask.hpp" - -#include -#include - -#include - -MSG_IMPLEMENT_DYNAMIC(Slave, Process) - -int Slave::main(int argc, char** argv) -{ - info("Hello"); - - Task* receivedTask; - BasicTask* basicTask; - - while(true) - { - receivedTask = Task::receive(); - - if(receivedTask->isInstanceOf("FinalizeTask")) - { - delete receivedTask; - break; - } - - basicTask = reinterpret_cast(receivedTask); - - info(TEXT_("Received \"") + TEXT_(basicTask->getName()) + TEXT_("\" ")); - - info(TEXT_("Processing \"") + TEXT_(basicTask->getName()) + TEXT_("\" ")); - - basicTask->execute(); - - info(TEXT_("\"") + TEXT_(basicTask->getName()) + TEXT_("\" done ")); - - delete basicTask; - } - - info("Received Finalize. I'm done. See you!"); - - delete this; - - return 0; -} diff --git a/examples/cxx/autoDestination/Slave.hpp b/examples/cxx/autoDestination/Slave.hpp deleted file mode 100644 index 1bb66a5236..0000000000 --- a/examples/cxx/autoDestination/Slave.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef SLAVE_HPP -#define SLAVE_HPP - -#include -using namespace SimGrid::Msg; - -class Slave : public Process -{ - MSG_DECLARE_DYNAMIC(Slave); - - public: - - // Default constructor. - Slave(){} - - // Destructor. - virtual ~Slave(){} - - int main(int argc, char** argv); - -}; - - -#endif // !SLAVE_HPP - diff --git a/examples/cxx/autoDestination/autoDestination.tesh b/examples/cxx/autoDestination/autoDestination.tesh deleted file mode 100644 index 856cbef940..0000000000 --- a/examples/cxx/autoDestination/autoDestination.tesh +++ /dev/null @@ -1,69 +0,0 @@ -$ autoDestination autoDestination_platform.xml autoDestination_deployment.xml -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Hello -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argc=8 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:5 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:50000 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:10 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:iRMX:Slave -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Casavant:Forwarder -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Bousquet:Slave -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Soucy:Slave -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Jackson:Forwarder -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Got 5 alias(es) : -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] iRMX:Slave -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Casavant:Forwarder -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Bousquet:Slave -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Soucy:Slave -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Jackson:Forwarder -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Got 5 task to process. -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Sending "Task_0" to "iRMX:Slave" -> [Jackson:Forwarder:(2) 0.000000] [cxx4msg/INFO] Hello -> [Casavant:Forwarder:(3) 0.000000] [cxx4msg/INFO] Hello -> [iRMX:Slave:(4) 0.000000] [cxx4msg/INFO] Hello -> [Bousquet:Slave:(5) 0.000000] [cxx4msg/INFO] Hello -> [Soucy:Slave:(6) 0.000000] [cxx4msg/INFO] Hello -> [Kuenning:Slave:(7) 0.000000] [cxx4msg/INFO] Hello -> [Browne:Slave:(8) 0.000000] [cxx4msg/INFO] Hello -> [Stephen:Slave:(9) 0.000000] [cxx4msg/INFO] Hello -> [Robert:Slave:(10) 0.000000] [cxx4msg/INFO] Hello -> [Sirois:Slave:(11) 0.000000] [cxx4msg/INFO] Hello -> [Monique:Slave:(12) 0.000000] [cxx4msg/INFO] Hello -> [Jacquelin:Master:(1) 0.234181] [cxx4msg/INFO] Sending "Task_1" to "Casavant:Forwarder" -> [iRMX:Slave:(4) 0.234181] [cxx4msg/INFO] Received "Task_0" -> [iRMX:Slave:(4) 0.234181] [cxx4msg/INFO] Processing "Task_0" -> [iRMX:Slave:(4) 0.234910] [cxx4msg/INFO] "Task_0" done -> [Jacquelin:Master:(1) 0.338591] [cxx4msg/INFO] Sending "Task_2" to "Bousquet:Slave" -> [Casavant:Forwarder:(3) 0.338591] [cxx4msg/INFO] Received "Task_1" -> [Casavant:Forwarder:(3) 0.338591] [cxx4msg/INFO] Sending "Task_1" to "Robert:Slave -> [Jacquelin:Master:(1) 0.416661] [cxx4msg/INFO] Sending "Task_3" to "Soucy:Slave" -> [Bousquet:Slave:(5) 0.416661] [cxx4msg/INFO] Received "Task_2" -> [Bousquet:Slave:(5) 0.416661] [cxx4msg/INFO] Processing "Task_2" -> [Bousquet:Slave:(5) 0.417826] [cxx4msg/INFO] "Task_2" done -> [Robert:Slave:(10) 0.454402] [cxx4msg/INFO] Received "Task_1" -> [Robert:Slave:(10) 0.454402] [cxx4msg/INFO] Processing "Task_1" -> [Robert:Slave:(10) 0.454766] [cxx4msg/INFO] "Task_1" done -> [Jacquelin:Master:(1) 0.527739] [cxx4msg/INFO] Sending "Task_4" to "Jackson:Forwarder" -> [Soucy:Slave:(6) 0.527739] [cxx4msg/INFO] Received "Task_3" -> [Soucy:Slave:(6) 0.527739] [cxx4msg/INFO] Processing "Task_3" -> [Soucy:Slave:(6) 0.528103] [cxx4msg/INFO] "Task_3" done -> [Jacquelin:Master:(1) 0.593252] [cxx4msg/INFO] Send completed -> [Jacquelin:Master:(1) 0.593252] [cxx4msg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Jackson:Forwarder:(2) 0.593252] [cxx4msg/INFO] Received "Task_4" -> [Jackson:Forwarder:(2) 0.593252] [cxx4msg/INFO] Sending "Task_4" to "Kuenning:Slave -> [Kuenning:Slave:(7) 0.593708] [cxx4msg/INFO] Received "Task_4" -> [Kuenning:Slave:(7) 0.593708] [cxx4msg/INFO] Processing "Task_4" -> [Kuenning:Slave:(7) 0.594291] [cxx4msg/INFO] "Task_4" done -> [iRMX:Slave:(4) 0.827199] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Casavant:Forwarder:(3) 0.931504] [cxx4msg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Bousquet:Slave:(5) 1.009496] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Robert:Slave:(10) 1.047200] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Sirois:Slave:(11) 1.086548] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Soucy:Slave:(6) 1.120464] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Casavant:Forwarder:(3) 1.154764] [cxx4msg/INFO] I'm done. See you! -> [Monique:Slave:(12) 1.154764] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 1.185911] [cxx4msg/INFO] Goodbye now! -> [Jackson:Forwarder:(2) 1.185911] [cxx4msg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Kuenning:Slave:(7) 1.186360] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Browne:Slave:(8) 1.325058] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jackson:Forwarder:(2) 1.532781] [cxx4msg/INFO] I'm done. See you! -> [Stephen:Slave:(9) 1.532781] [cxx4msg/INFO] Received Finalize. I'm done. See you! \ No newline at end of file diff --git a/examples/cxx/autoDestination/autoDestination_deployment.xml b/examples/cxx/autoDestination/autoDestination_deployment.xml deleted file mode 100644 index 09e39beddf..0000000000 --- a/examples/cxx/autoDestination/autoDestination_deployment.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/autoDestination/autoDestination_platform.xml b/examples/cxx/autoDestination/autoDestination_platform.xml deleted file mode 100644 index 6d476d1bec..0000000000 --- a/examples/cxx/autoDestination/autoDestination_platform.xml +++ /dev/null @@ -1,8298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/autoDestination/makefile b/examples/cxx/autoDestination/makefile deleted file mode 100644 index 12a9dd7962..0000000000 --- a/examples/cxx/autoDestination/makefile +++ /dev/null @@ -1,20 +0,0 @@ -CXX = g++ -PREFIX = /home/mcherier/com/loria/SimGridX -INCLUDES =-I$(PREFIX)/lib -I$(PREFIX)/examples/autoDestination -SRCDIR = $(PREFIX)/examples/autoDestination -CXXFLAGS = -Wall -pedantic -D_DEBUG $(INCLUDES) -LDFLAGS = -L$(PREFIX)/lib -LDLIBS = -lSimGridX - -PROG = autoDestination - -OBJECTS = BasicTask.o FinalizeTask.o Forwarder.o Slave.o Master.o Main.o - -all: $(OBJECTS) - $(CXX) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -o $(PROG) - -%.o: $(SRCDIR)/%.cxx - $(CXX) -c $(CXXFLAGS) $(SRCDIR)/$*.cxx - -clean: - rm *.o \ No newline at end of file diff --git a/examples/cxx/basic/BasicTask.cxx b/examples/cxx/basic/BasicTask.cxx deleted file mode 100644 index 19cd54a77b..0000000000 --- a/examples/cxx/basic/BasicTask.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "BasicTask.hpp" - -MSG_IMPLEMENT_DYNAMIC(BasicTask, Task) diff --git a/examples/cxx/basic/BasicTask.hpp b/examples/cxx/basic/BasicTask.hpp deleted file mode 100644 index e4ecb0762a..0000000000 --- a/examples/cxx/basic/BasicTask.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef BASIC_TASK_HPP -#define BASIC_TASK_HPP - -#include -using namespace SimGrid::Msg; - -class BasicTask : public Task -{ - MSG_DECLARE_DYNAMIC(BasicTask); -public: - - // Default constructor. - BasicTask() {} - - // Destructor - virtual ~BasicTask() - throw(MsgException) {} - BasicTask(const char* name, double computeDuration, double messageSize) - throw (InvalidArgumentException, NullPointerException) - :Task(name, computeDuration, messageSize){} -}; - -typedef BasicTask* BasicTaskPtr; - - -#endif // !BASIC_TASK_HPP diff --git a/examples/cxx/basic/FinalizeTask.cxx b/examples/cxx/basic/FinalizeTask.cxx deleted file mode 100644 index 0805537c9f..0000000000 --- a/examples/cxx/basic/FinalizeTask.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "FinalizeTask.hpp" - -MSG_IMPLEMENT_DYNAMIC(FinalizeTask, Task) diff --git a/examples/cxx/basic/FinalizeTask.hpp b/examples/cxx/basic/FinalizeTask.hpp deleted file mode 100644 index ad1b51e560..0000000000 --- a/examples/cxx/basic/FinalizeTask.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef FINALIZE_TASK_HPP -#define FINALIZE_TASK_HPP - -#include -using namespace SimGrid::Msg; - -class FinalizeTask : public Task -{ - MSG_DECLARE_DYNAMIC(FinalizeTask); -public: - - // Default constructor. - FinalizeTask() - throw (InvalidArgumentException, NullPointerException) - :Task("finalize", 0.0, 0.0){} - - // Destructor - virtual ~FinalizeTask() - throw(MsgException) {} - -}; - - - - -#endif // !FINALIZE_TASK_HPP diff --git a/examples/cxx/basic/Forwarder.cxx b/examples/cxx/basic/Forwarder.cxx deleted file mode 100644 index 368a5e4cab..0000000000 --- a/examples/cxx/basic/Forwarder.cxx +++ /dev/null @@ -1,69 +0,0 @@ -#include "Forwarder.hpp" -#include "BasicTask.hpp" -#include "FinalizeTask.hpp" -#include -#include - -#include - -MSG_IMPLEMENT_DYNAMIC(Forwarder, Process) - - -int Forwarder::main(int argc, char** argv) -{ - info("Hello"); - - int slavesCount = argc; - - Host* slaves = new Host[slavesCount]; - - for (int i = 0; i < argc; i++) - { - try - { - slaves[i] = Host::getByName(argv[i]); - } - catch (HostNotFoundException e) - { - error(TEXT_(e.toString())); - error("Buggy deployment file"); - exit(1); - } - } - - int taskCount = 0; - - while(true) - { - Task* t = Task::get(0); - - if(t->isInstanceOf("FinalizeTask")) - { - info("All tasks have been dispatched. Let's tell everybody the computation is over."); - - for (int cpt = 0; cpt< slavesCount; cpt++) - slaves[cpt].put(0, new FinalizeTask()); - - delete t; - - break; - } - - info(TEXT_("Received \"") + TEXT_(t->getName()) + TEXT_("\" ")); - - info(TEXT_("Sending \"") + TEXT_(t->getName()) + TEXT_("\" to \"") + TEXT_(slaves[taskCount % slavesCount].getName()) + TEXT_("\"")); - - slaves[taskCount % slavesCount].put(0, t); - - taskCount++; - } - - - info("I'm done. See you!"); - - delete[] slaves; - - delete this; - - return 0; -} diff --git a/examples/cxx/basic/Forwarder.hpp b/examples/cxx/basic/Forwarder.hpp deleted file mode 100644 index b09b821635..0000000000 --- a/examples/cxx/basic/Forwarder.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef FORWARDER_HPP -#define FORWARDER_HPP - -#include -using namespace SimGrid::Msg; - -class Forwarder : public Process -{ - MSG_DECLARE_DYNAMIC(Forwarder); - - public: - - // Default constructor. - Forwarder(){} - - // Destructor. - virtual ~Forwarder(){} - - int main(int argc, char** argv); - -}; - - -#endif // !FORWARDER_HPP diff --git a/examples/cxx/basic/Main.cxx b/examples/cxx/basic/Main.cxx deleted file mode 100644 index ae7324bed5..0000000000 --- a/examples/cxx/basic/Main.cxx +++ /dev/null @@ -1,13 +0,0 @@ -#include - -using namespace SimGrid::Msg; - -int -main(int argc, char* argv[]) -{ - Simulation s; - - return s.execute(argc, argv); - -} - diff --git a/examples/cxx/basic/Master.cxx b/examples/cxx/basic/Master.cxx deleted file mode 100644 index 9bf085eb4b..0000000000 --- a/examples/cxx/basic/Master.cxx +++ /dev/null @@ -1,106 +0,0 @@ -#include "Master.hpp" -#include "BasicTask.hpp" -#include "FinalizeTask.hpp" -#include -#include - -#include - -#include -using namespace std; - - -#ifndef BUFFMAX -#define BUFFMAX 260 -#endif - -MSG_IMPLEMENT_DYNAMIC(Master, Process) - -int Master::main(int argc, char** argv) -{ - int channel = 0; - - int numberOfTasks; - double taskComputeSize; - double taskCommunicateSize; - StringHelper s; - - if (argc < 3) - { - error("Master needs 3 arguments"); - exit(1); - } - - info("Hello"); - - int slaveCount = 0; - Host* slaves = NULL; - - - info( TEXT_("argc=") + TEXT_(argc)); - - for (int i = 0; i< argc; i++) - info(TEXT_("argv:") + TEXT_(argv[i])); - - sscanf(argv[0],"%d", &numberOfTasks); - - sscanf(argv[1],"%lg", &taskComputeSize); - - sscanf(argv[2],"%lg", &taskCommunicateSize); - - BasicTaskPtr* todo = new BasicTaskPtr[numberOfTasks]; - - for (int i = 0; i < numberOfTasks; i++) - todo[i] = new BasicTask((TEXT_("Task_") + TEXT_(i)), taskComputeSize, taskCommunicateSize); - - slaveCount = argc - 3; - slaves = new Host[slaveCount]; - - for(int i = 3; i < argc ; i++) - { - try - { - slaves[i-3] = Host::getByName(argv[i]); - } - - catch(HostNotFoundException e) - { - cerr << e.toString() <<". Stopping Now!" << endl; - exit(1); - } - } - - info(TEXT_("Got slave(s) :") + TEXT_(slaveCount)); - - for (int i = 0; i < slaveCount; i++) - info(TEXT_("\t") + TEXT_(slaves[i].getName())); - - info(TEXT_("Got ") + TEXT_(numberOfTasks) + TEXT_(" task to process.")); - - for (int i = 0; i < numberOfTasks; i++) - { - info(TEXT_("Sending \"") + TEXT_(todo[i]->getName()) + TEXT_("\" to \"") + TEXT_(slaves[i % slaveCount].getName()) + TEXT_("\"")); - - if(!strcmp(Host::currentHost().getName(), slaves[i % slaveCount].getName())) - info("Hey ! It's me ! "); - - slaves[i % slaveCount].put(channel, todo[i]); - } - - info("Send completed"); - - info("All tasks have been dispatched. Let's tell everybody the computation is over."); - - for (int i = 0; i < slaveCount; i++) - slaves[i].put(channel, new FinalizeTask()); - - delete[] todo; - delete[] slaves; - - info("Goodbye now!"); - - delete this; - - return 0; -} - diff --git a/examples/cxx/basic/Master.hpp b/examples/cxx/basic/Master.hpp deleted file mode 100644 index b3e59ab7d6..0000000000 --- a/examples/cxx/basic/Master.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef MASTER_HPP -#define MASTER_HPP - -#include -using namespace SimGrid::Msg; - -class Master : public Process -{ - MSG_DECLARE_DYNAMIC(Master); - - public: - - // Default constructor. - Master(){} - - // Destructor. - virtual ~Master(){} - - int main(int argc, char** argv); - -}; - -#endif // !MASTER_HPP diff --git a/examples/cxx/basic/Slave.cxx b/examples/cxx/basic/Slave.cxx deleted file mode 100644 index 02f45aab5f..0000000000 --- a/examples/cxx/basic/Slave.cxx +++ /dev/null @@ -1,43 +0,0 @@ -#include "Slave.hpp" -#include "FinalizeTask.hpp" -#include -#include - -#include -using namespace std; - -#include - -MSG_IMPLEMENT_DYNAMIC(Slave, Process) - -int Slave::main(int argc, char** argv) -{ - info("Hello");; - - while(true) - { - Task* t = Task::get(0); - - if(t->isInstanceOf("FinalizeTask")) - { - delete t; - break; - } - - info(TEXT_("Received \"") + TEXT_(t->getName()) + TEXT_("\" ")); - - info(TEXT_("Processing \"") + TEXT_(t->getName())); - - t->execute(); - - info(TEXT_("\"") + TEXT_(t->getName()) + TEXT_("\" done ")); - - delete t; - } - - info("Received Finalize. I'm done. See you!"); - - delete this; - - return 0; -} diff --git a/examples/cxx/basic/Slave.hpp b/examples/cxx/basic/Slave.hpp deleted file mode 100644 index d0a5607bcd..0000000000 --- a/examples/cxx/basic/Slave.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef SLAVE_HPP -#define SLAVE_HPP - -#include -using namespace SimGrid::Msg; - -class Slave : public Process -{ - MSG_DECLARE_DYNAMIC(Slave); - - public: - - // Default constructor. - Slave(){} - - // Destructor. - virtual ~Slave(){} - - int main(int argc, char** argv); - -}; - - -#endif // !SLAVE_HPP diff --git a/examples/cxx/basic/basic.tesh b/examples/cxx/basic/basic.tesh deleted file mode 100644 index ae85623cbe..0000000000 --- a/examples/cxx/basic/basic.tesh +++ /dev/null @@ -1,69 +0,0 @@ -$ basic basic_platform.xml basic_deployment.xml -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Hello -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argc=8 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:5 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:50000 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:10 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:iRMX -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Casavant -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Bousquet -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Soucy -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Jackson -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Got slave(s) :5 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] iRMX -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Casavant -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Bousquet -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Soucy -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Jackson -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Got 5 task to process. -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Sending "Task_0" to "iRMX" -> [Jackson:Forwarder:(2) 0.000000] [cxx4msg/INFO] Hello -> [Casavant:Forwarder:(3) 0.000000] [cxx4msg/INFO] Hello -> [iRMX:Slave:(4) 0.000000] [cxx4msg/INFO] Hello -> [Bousquet:Slave:(5) 0.000000] [cxx4msg/INFO] Hello -> [Soucy:Slave:(6) 0.000000] [cxx4msg/INFO] Hello -> [Kuenning:Slave:(7) 0.000000] [cxx4msg/INFO] Hello -> [Browne:Slave:(8) 0.000000] [cxx4msg/INFO] Hello -> [Stephen:Slave:(9) 0.000000] [cxx4msg/INFO] Hello -> [Robert:Slave:(10) 0.000000] [cxx4msg/INFO] Hello -> [Sirois:Slave:(11) 0.000000] [cxx4msg/INFO] Hello -> [Monique:Slave:(12) 0.000000] [cxx4msg/INFO] Hello -> [Jacquelin:Master:(1) 0.234181] [cxx4msg/INFO] Sending "Task_1" to "Casavant" -> [iRMX:Slave:(4) 0.234181] [cxx4msg/INFO] Received "Task_0" -> [iRMX:Slave:(4) 0.234181] [cxx4msg/INFO] Processing "Task_0 -> [iRMX:Slave:(4) 0.234910] [cxx4msg/INFO] "Task_0" done -> [Jacquelin:Master:(1) 0.338591] [cxx4msg/INFO] Sending "Task_2" to "Bousquet" -> [Casavant:Forwarder:(3) 0.338591] [cxx4msg/INFO] Received "Task_1" -> [Casavant:Forwarder:(3) 0.338591] [cxx4msg/INFO] Sending "Task_1" to "Robert" -> [Jacquelin:Master:(1) 0.416661] [cxx4msg/INFO] Sending "Task_3" to "Soucy" -> [Bousquet:Slave:(5) 0.416661] [cxx4msg/INFO] Received "Task_2" -> [Bousquet:Slave:(5) 0.416661] [cxx4msg/INFO] Processing "Task_2 -> [Bousquet:Slave:(5) 0.417826] [cxx4msg/INFO] "Task_2" done -> [Robert:Slave:(10) 0.454402] [cxx4msg/INFO] Received "Task_1" -> [Robert:Slave:(10) 0.454402] [cxx4msg/INFO] Processing "Task_1 -> [Robert:Slave:(10) 0.454766] [cxx4msg/INFO] "Task_1" done -> [Jacquelin:Master:(1) 0.527739] [cxx4msg/INFO] Sending "Task_4" to "Jackson" -> [Soucy:Slave:(6) 0.527739] [cxx4msg/INFO] Received "Task_3" -> [Soucy:Slave:(6) 0.527739] [cxx4msg/INFO] Processing "Task_3 -> [Soucy:Slave:(6) 0.528103] [cxx4msg/INFO] "Task_3" done -> [Jacquelin:Master:(1) 0.593252] [cxx4msg/INFO] Send completed -> [Jacquelin:Master:(1) 0.593252] [cxx4msg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Jackson:Forwarder:(2) 0.593252] [cxx4msg/INFO] Received "Task_4" -> [Jackson:Forwarder:(2) 0.593252] [cxx4msg/INFO] Sending "Task_4" to "Kuenning" -> [Kuenning:Slave:(7) 0.593708] [cxx4msg/INFO] Received "Task_4" -> [Kuenning:Slave:(7) 0.593708] [cxx4msg/INFO] Processing "Task_4 -> [Kuenning:Slave:(7) 0.594291] [cxx4msg/INFO] "Task_4" done -> [iRMX:Slave:(4) 0.827199] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Casavant:Forwarder:(3) 0.931504] [cxx4msg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Bousquet:Slave:(5) 1.009496] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Robert:Slave:(10) 1.047200] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Sirois:Slave:(11) 1.086548] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Soucy:Slave:(6) 1.120464] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Casavant:Forwarder:(3) 1.154764] [cxx4msg/INFO] I'm done. See you! -> [Monique:Slave:(12) 1.154764] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 1.185911] [cxx4msg/INFO] Goodbye now! -> [Jackson:Forwarder:(2) 1.185911] [cxx4msg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Kuenning:Slave:(7) 1.186360] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Browne:Slave:(8) 1.325058] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jackson:Forwarder:(2) 1.532781] [cxx4msg/INFO] I'm done. See you! -> [Stephen:Slave:(9) 1.532781] [cxx4msg/INFO] Received Finalize. I'm done. See you! \ No newline at end of file diff --git a/examples/cxx/basic/basic_deployment.xml b/examples/cxx/basic/basic_deployment.xml deleted file mode 100644 index fb5864b613..0000000000 --- a/examples/cxx/basic/basic_deployment.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/basic/basic_platform.xml b/examples/cxx/basic/basic_platform.xml deleted file mode 100644 index 6d476d1bec..0000000000 --- a/examples/cxx/basic/basic_platform.xml +++ /dev/null @@ -1,8298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/basic/makefile b/examples/cxx/basic/makefile deleted file mode 100644 index 37c9a283d5..0000000000 --- a/examples/cxx/basic/makefile +++ /dev/null @@ -1,20 +0,0 @@ -CXX = g++ -PREFIX = /home/mcherier/com/loria/SimGridX -INCLUDES =-I$(PREFIX)/lib -I$(PREFIX)/examples/basic -SRCDIR = $(PREFIX)/examples/basic -CXXFLAGS = -Wall -pedantic -D_DEBUG $(INCLUDES) -LDFLAGS = -L$(PREFIX)/lib -LDLIBS = -lSimGridX - -PROG = basic - -OBJECTS = BasicTask.o FinalizeTask.o Slave.o Forwarder.o Master.o Main.o - -all: $(OBJECTS) - $(CXX) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -o $(PROG) - -%.o: $(SRCDIR)/%.cxx - $(CXX) -c $(CXXFLAGS) $(SRCDIR)/$*.cxx - -clean: - rm *.o \ No newline at end of file diff --git a/examples/cxx/comm_time/CommTimeTask.cxx b/examples/cxx/comm_time/CommTimeTask.cxx deleted file mode 100644 index 889d4158d0..0000000000 --- a/examples/cxx/comm_time/CommTimeTask.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "CommTimeTask.hpp" - -MSG_IMPLEMENT_DYNAMIC(CommTimeTask, Task) diff --git a/examples/cxx/comm_time/CommTimeTask.hpp b/examples/cxx/comm_time/CommTimeTask.hpp deleted file mode 100644 index 87a6eeade6..0000000000 --- a/examples/cxx/comm_time/CommTimeTask.hpp +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef COMMTIME_TASK_HPP -#define COMMTIME_TASK_HPP - -#include -using namespace SimGrid::Msg; - -class CommTimeTask : public Task -{ - MSG_DECLARE_DYNAMIC(CommTimeTask); - -public: - - CommTimeTask() - :Task(NULL, 0.0, 0.0){} - - // Default constructor. - CommTimeTask(const char* name, double computeDuration, double messageSize) - throw (InvalidArgumentException, NullPointerException) - :Task(name, computeDuration, messageSize){} - - // Destructor - virtual ~CommTimeTask() - throw(MsgException){} - - void setTime(double timeVal) - { - this->timeVal = timeVal; - } - - double getTime() - { - return timeVal; - } - -private : - - double timeVal; -}; - -#endif // !COMMTIME_TASK_HPP diff --git a/examples/cxx/comm_time/FinalizeTask.cxx b/examples/cxx/comm_time/FinalizeTask.cxx deleted file mode 100644 index 0805537c9f..0000000000 --- a/examples/cxx/comm_time/FinalizeTask.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "FinalizeTask.hpp" - -MSG_IMPLEMENT_DYNAMIC(FinalizeTask, Task) diff --git a/examples/cxx/comm_time/FinalizeTask.hpp b/examples/cxx/comm_time/FinalizeTask.hpp deleted file mode 100644 index 162169d424..0000000000 --- a/examples/cxx/comm_time/FinalizeTask.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef FINALIZE_TASK_HPP -#define FINALIZE_TASK_HPP - -#include -using namespace SimGrid::Msg; - -class FinalizeTask : public Task -{ - MSG_DECLARE_DYNAMIC(FinalizeTask); -public: - - // Default constructor. - FinalizeTask() - throw (InvalidArgumentException, NullPointerException) - :Task("finalize", 0.0, 0.0){} - - // Destructor - virtual ~FinalizeTask() - throw(MsgException){} - -}; - -#endif // !FINALIZE_TASK_HPP - diff --git a/examples/cxx/comm_time/Main.cxx b/examples/cxx/comm_time/Main.cxx deleted file mode 100644 index 60dae829d2..0000000000 --- a/examples/cxx/comm_time/Main.cxx +++ /dev/null @@ -1,11 +0,0 @@ -#include - -using namespace SimGrid::Msg; - -int -main(int argc, char* argv[]) -{ - Simulation s; - - return s.execute(argc, argv); -} diff --git a/examples/cxx/comm_time/Master.cxx b/examples/cxx/comm_time/Master.cxx deleted file mode 100644 index 6eee1bb3c5..0000000000 --- a/examples/cxx/comm_time/Master.cxx +++ /dev/null @@ -1,83 +0,0 @@ -#include "Master.hpp" -#include "CommTimeTask.hpp" -#include "FinalizeTask.hpp" -#include -#include -#include - -#include - -MSG_IMPLEMENT_DYNAMIC(Master, Process) - -int Master::main(int argc, char** argv) -{ - int numberOfTasks; - double taskComputeSize; - double taskCommunicateSize; - - if (argc < 3) - { - error("Master needs 3 arguments"); - exit(1); - } - - info("Hello"); - - int slaveCount = 0; - Host* slaves = NULL; - - sscanf(argv[0],"%d", &numberOfTasks); - - sscanf(argv[1],"%lg", &taskComputeSize); - - sscanf(argv[2],"%lg", &taskCommunicateSize); - - - slaveCount = argc - 3; - slaves = new Host[slaveCount]; - - for(int i = 3; i < argc ; i++) - { - try - { - slaves[i-3] = Host::getByName(argv[i]); - } - - catch(HostNotFoundException e) - { - error(TEXT_(e.toString()) + TEXT_(". Stopping Now!")); - exit(1); - } - } - - info(TEXT_("Got slave(s) :" ) + TEXT_(slaveCount)); - - for (int i = 0; i < slaveCount; i++) - info(TEXT_("\t") + TEXT_(slaves[i].getName())); - - info(TEXT_("Got ") + TEXT_(numberOfTasks) + TEXT_(" task to process.")); - - - for (int i = 0; i < numberOfTasks; i++) - { - CommTimeTask* task = new CommTimeTask(TEXT_("Task_") + TEXT_(i), taskComputeSize, taskCommunicateSize); - task->setTime(getClock()); - slaves[i % slaveCount].put(0, task); - - } - - info("All tasks have been dispatched. Let's tell everybody the computation is over."); - - for (int i = 0; i < slaveCount; i++) - { - info(TEXT_("Finalize host ") + TEXT_(slaves[i].getName()) + TEXT_(" [") + TEXT_(i) + TEXT_("]")); - slaves[i].put(0, new FinalizeTask()); - } - - info("All finalize messages have been dispatched. Goodbye now!"); - - - delete[] slaves; - delete this; - return 0; -} diff --git a/examples/cxx/comm_time/Master.hpp b/examples/cxx/comm_time/Master.hpp deleted file mode 100644 index b3e59ab7d6..0000000000 --- a/examples/cxx/comm_time/Master.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef MASTER_HPP -#define MASTER_HPP - -#include -using namespace SimGrid::Msg; - -class Master : public Process -{ - MSG_DECLARE_DYNAMIC(Master); - - public: - - // Default constructor. - Master(){} - - // Destructor. - virtual ~Master(){} - - int main(int argc, char** argv); - -}; - -#endif // !MASTER_HPP diff --git a/examples/cxx/comm_time/Slave.cxx b/examples/cxx/comm_time/Slave.cxx deleted file mode 100644 index c604f41c96..0000000000 --- a/examples/cxx/comm_time/Slave.cxx +++ /dev/null @@ -1,45 +0,0 @@ -#include "Slave.hpp" -#include "FinalizeTask.hpp" -#include "CommTimeTask.hpp" -#include -#include -#include - -#include - -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(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; - -} diff --git a/examples/cxx/comm_time/Slave.hpp b/examples/cxx/comm_time/Slave.hpp deleted file mode 100644 index 9ec76bc1c0..0000000000 --- a/examples/cxx/comm_time/Slave.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SLAVE_HPP -#define SLAVE_HPP - -#include -using namespace SimGrid::Msg; - -class Slave : public Process -{ - MSG_DECLARE_DYNAMIC(Slave); - - public: - - // Default constructor. - Slave(){} - - // Destructor. - virtual ~Slave(){} - - int main(int argc, char** argv); - -}; - -#endif // !SLAVE_HPP diff --git a/examples/cxx/comm_time/comm_time.tesh b/examples/cxx/comm_time/comm_time.tesh deleted file mode 100644 index ca02a8409c..0000000000 --- a/examples/cxx/comm_time/comm_time.tesh +++ /dev/null @@ -1,86 +0,0 @@ -$ comm_time comm_time_platform.xml comm_time_deployment.xml -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Hello -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Got slave(s) :20 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] iRMX -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Bousquet -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Soucy -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Casavant -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Jackson -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Geoff -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Disney -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] McGee -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Gatien -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Laroche -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Tanguay -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Morin -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Ethernet -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Bellemarre -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Harry -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Olivier -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Boucherville -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Pointe_Claire -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Kansas -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] King -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Got 50000 task to process. -> [iRMX:Slave:(2) 0.000000] [cxx4msg/INFO] Hello -> [Bousquet:Slave:(3) 0.000000] [cxx4msg/INFO] Hello -> [Soucy:Slave:(4) 0.000000] [cxx4msg/INFO] Hello -> [Casavant:Slave:(5) 0.000000] [cxx4msg/INFO] Hello -> [Jackson:Slave:(6) 0.000000] [cxx4msg/INFO] Hello -> [Geoff:Slave:(7) 0.000000] [cxx4msg/INFO] Hello -> [Disney:Slave:(8) 0.000000] [cxx4msg/INFO] Hello -> [McGee:Slave:(9) 0.000000] [cxx4msg/INFO] Hello -> [Gatien:Slave:(10) 0.000000] [cxx4msg/INFO] Hello -> [Laroche:Slave:(11) 0.000000] [cxx4msg/INFO] Hello -> [Tanguay:Slave:(12) 0.000000] [cxx4msg/INFO] Hello -> [Morin:Slave:(13) 0.000000] [cxx4msg/INFO] Hello -> [Ethernet:Slave:(14) 0.000000] [cxx4msg/INFO] Hello -> [Bellemarre:Slave:(15) 0.000000] [cxx4msg/INFO] Hello -> [Harry:Slave:(16) 0.000000] [cxx4msg/INFO] Hello -> [Olivier:Slave:(17) 0.000000] [cxx4msg/INFO] Hello -> [Boucherville:Slave:(18) 0.000000] [cxx4msg/INFO] Hello -> [Pointe_Claire:Slave:(19) 0.000000] [cxx4msg/INFO] Hello -> [Kansas:Slave:(20) 0.000000] [cxx4msg/INFO] Hello -> [King:Slave:(21) 0.000000] [cxx4msg/INFO] Hello -> [Jacquelin:Master:(1) 5385.510565] [cxx4msg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Jacquelin:Master:(1) 5385.510565] [cxx4msg/INFO] Finalize host iRMX [0] -> [Jacquelin:Master:(1) 5385.744512] [cxx4msg/INFO] Finalize host Bousquet [1] -> [iRMX:Slave:(2) 5385.744512] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5385.822504] [cxx4msg/INFO] Finalize host Soucy [2] -> [Bousquet:Slave:(3) 5385.822504] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5385.933472] [cxx4msg/INFO] Finalize host Casavant [3] -> [Soucy:Slave:(4) 5385.933472] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.037777] [cxx4msg/INFO] Finalize host Jackson [4] -> [Casavant:Slave:(5) 5386.037777] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.103224] [cxx4msg/INFO] Finalize host Geoff [5] -> [Jackson:Slave:(6) 5386.103224] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.103634] [cxx4msg/INFO] Finalize host Disney [6] -> [Geoff:Slave:(7) 5386.103634] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.243798] [cxx4msg/INFO] Finalize host McGee [7] -> [Disney:Slave:(8) 5386.243798] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.312081] [cxx4msg/INFO] Finalize host Gatien [8] -> [McGee:Slave:(9) 5386.312081] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.410039] [cxx4msg/INFO] Finalize host Laroche [9] -> [Gatien:Slave:(10) 5386.410039] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.548443] [cxx4msg/INFO] Finalize host Tanguay [10] -> [Laroche:Slave:(11) 5386.548443] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.624602] [cxx4msg/INFO] Finalize host Morin [11] -> [Tanguay:Slave:(12) 5386.624602] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.767895] [cxx4msg/INFO] Finalize host Ethernet [12] -> [Morin:Slave:(13) 5386.767895] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.849385] [cxx4msg/INFO] Finalize host Bellemarre [13] -> [Ethernet:Slave:(14) 5386.849385] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5386.988558] [cxx4msg/INFO] Finalize host Harry [14] -> [Bellemarre:Slave:(15) 5386.988558] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5387.129807] [cxx4msg/INFO] Finalize host Olivier [15] -> [Harry:Slave:(16) 5387.129807] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5387.240138] [cxx4msg/INFO] Finalize host Boucherville [16] -> [Olivier:Slave:(17) 5387.240138] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5387.386104] [cxx4msg/INFO] Finalize host Pointe_Claire [17] -> [Boucherville:Slave:(18) 5387.386104] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5387.528570] [cxx4msg/INFO] Finalize host Kansas [18] -> [Pointe_Claire:Slave:(19) 5387.528570] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5387.597140] [cxx4msg/INFO] Finalize host King [19] -> [Kansas:Slave:(20) 5387.597140] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 5387.662613] [cxx4msg/INFO] All finalize messages have been dispatched. Goodbye now! -> [King:Slave:(21) 5387.662613] [cxx4msg/INFO] Received Finalize. I'm done. See you! \ No newline at end of file diff --git a/examples/cxx/comm_time/comm_time_deployment.xml b/examples/cxx/comm_time/comm_time_deployment.xml deleted file mode 100644 index 58af8f1bd4..0000000000 --- a/examples/cxx/comm_time/comm_time_deployment.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/comm_time/comm_time_platform.xml b/examples/cxx/comm_time/comm_time_platform.xml deleted file mode 100644 index 6d476d1bec..0000000000 --- a/examples/cxx/comm_time/comm_time_platform.xml +++ /dev/null @@ -1,8298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/comm_time/makefile b/examples/cxx/comm_time/makefile deleted file mode 100644 index 7f346037eb..0000000000 --- a/examples/cxx/comm_time/makefile +++ /dev/null @@ -1,20 +0,0 @@ -CXX = g++ -PREFIX = /home/mcherier/com/loria/SimGridX -INCLUDES =-I$(PREFIX)/lib -I$(PREFIX)/examples/comm_time -SRCDIR = $(PREFIX)/examples/comm_time -CXXFLAGS = -Wall -pedantic -D_DEBUG $(INCLUDES) -LDFLAGS = -L$(PREFIX)/lib -LDLIBS = -lSimGridX - -PROG = comm_time - -OBJECTS = CommTimeTask.o FinalizeTask.o Slave.o Master.o Main.o - -all: $(OBJECTS) - $(CXX) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -o $(PROG) - -%.o: $(SRCDIR)/%.cxx - $(CXX) -c $(CXXFLAGS) $(SRCDIR)/$*.cxx - -clean: - rm *.o \ No newline at end of file diff --git a/examples/cxx/explicitDestination/BasicTask.cxx b/examples/cxx/explicitDestination/BasicTask.cxx deleted file mode 100644 index 19cd54a77b..0000000000 --- a/examples/cxx/explicitDestination/BasicTask.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "BasicTask.hpp" - -MSG_IMPLEMENT_DYNAMIC(BasicTask, Task) diff --git a/examples/cxx/explicitDestination/BasicTask.hpp b/examples/cxx/explicitDestination/BasicTask.hpp deleted file mode 100644 index 4d5a728b56..0000000000 --- a/examples/cxx/explicitDestination/BasicTask.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef BASIC_TASK_HPP -#define BASIC_TASK_HPP - -#include -using namespace SimGrid::Msg; - -class BasicTask : public Task -{ - MSG_DECLARE_DYNAMIC(BasicTask); -public: - - // Default constructor. - BasicTask() {} - - // Destructor - virtual ~BasicTask() - throw(MsgException){} - BasicTask(const char* name, double computeDuration, double messageSize) - throw (InvalidArgumentException, NullPointerException) - :Task(name, computeDuration, messageSize){} - - /*virtual const BasicTask& operator = (const BasicTask& rTask) { - Task::operator=(rTask); - return *this; - }*/ -}; - -typedef BasicTask* BasicTaskPtr; - - -#endif // !BASIC_TASK_HPP diff --git a/examples/cxx/explicitDestination/FinalizeTask.cxx b/examples/cxx/explicitDestination/FinalizeTask.cxx deleted file mode 100644 index 0805537c9f..0000000000 --- a/examples/cxx/explicitDestination/FinalizeTask.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "FinalizeTask.hpp" - -MSG_IMPLEMENT_DYNAMIC(FinalizeTask, Task) diff --git a/examples/cxx/explicitDestination/FinalizeTask.hpp b/examples/cxx/explicitDestination/FinalizeTask.hpp deleted file mode 100644 index cda3683b36..0000000000 --- a/examples/cxx/explicitDestination/FinalizeTask.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef FINALIZE_TASK_HPP -#define FINALIZE_TASK_HPP - -#include -using namespace SimGrid::Msg; - -class FinalizeTask : public Task -{ - MSG_DECLARE_DYNAMIC(FinalizeTask); -public: - - // Default constructor. - FinalizeTask() - throw (InvalidArgumentException, NullPointerException) - :Task("finalize", 0.0, 0.0){} - - // Destructor - virtual ~FinalizeTask() - throw(MsgException){} - -}; - -#endif // !FINALIZE_TASK_HPP diff --git a/examples/cxx/explicitDestination/Forwarder.cxx b/examples/cxx/explicitDestination/Forwarder.cxx deleted file mode 100644 index 360db88bd1..0000000000 --- a/examples/cxx/explicitDestination/Forwarder.cxx +++ /dev/null @@ -1,61 +0,0 @@ -#include "Forwarder.hpp" -#include "BasicTask.hpp" -#include "FinalizeTask.hpp" - -#include -#include - -#include - - -MSG_IMPLEMENT_DYNAMIC(Forwarder, Process) - - -int Forwarder::main(int argc, char** argv) -{ - info("Hello"); - - int aliasCount = argc; - - int taskCount = 0; - - Task* taskReceived; - Task* finalizeTask; - BasicTask* basicTask; - - while(true) - { - taskReceived = Task::receive(Host::currentHost().getName()); - - if(taskReceived->isInstanceOf("FinalizeTask")) - { - info("All tasks have been dispatched. Let's tell everybody the computation is over."); - - for (int i = 0; i < aliasCount; i++) - { - finalizeTask = new FinalizeTask(); - finalizeTask->send(argv[i]); - } - - delete taskReceived; - - break; - } - - basicTask = reinterpret_cast(taskReceived); - - info(TEXT_("Received \"") + TEXT_(basicTask->getName()) + TEXT_("\" ")); - - info(TEXT_("Sending \"") + TEXT_(basicTask->getName()) + TEXT_("\" to \"") + TEXT_(argv[taskCount % aliasCount]) + TEXT_("\"")); - - basicTask->send(argv[taskCount % aliasCount]); - - taskCount++; - } - - - info("I'm done. See you!"); - - delete this; - return 0; -} diff --git a/examples/cxx/explicitDestination/Forwarder.hpp b/examples/cxx/explicitDestination/Forwarder.hpp deleted file mode 100644 index b09b821635..0000000000 --- a/examples/cxx/explicitDestination/Forwarder.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef FORWARDER_HPP -#define FORWARDER_HPP - -#include -using namespace SimGrid::Msg; - -class Forwarder : public Process -{ - MSG_DECLARE_DYNAMIC(Forwarder); - - public: - - // Default constructor. - Forwarder(){} - - // Destructor. - virtual ~Forwarder(){} - - int main(int argc, char** argv); - -}; - - -#endif // !FORWARDER_HPP diff --git a/examples/cxx/explicitDestination/Main.cxx b/examples/cxx/explicitDestination/Main.cxx deleted file mode 100644 index cf27e28bb6..0000000000 --- a/examples/cxx/explicitDestination/Main.cxx +++ /dev/null @@ -1,12 +0,0 @@ -#include - -using namespace SimGrid::Msg; - -int -main(int argc, char* argv[]) -{ - Simulation s; - - return s.execute(argc, argv); - -} diff --git a/examples/cxx/explicitDestination/Master.cxx b/examples/cxx/explicitDestination/Master.cxx deleted file mode 100644 index 33f1626965..0000000000 --- a/examples/cxx/explicitDestination/Master.cxx +++ /dev/null @@ -1,84 +0,0 @@ -#include "Master.hpp" -#include "BasicTask.hpp" -#include "FinalizeTask.hpp" - -#include -#include - -#include - -MSG_IMPLEMENT_DYNAMIC(Master, Process) - -int Master::main(int argc, char** argv) -{ - int taskCount; - double taskComputeSize; - double taskCommunicateSize; - - info("Hello"); - - - info(TEXT_("argc=") + TEXT_(argc)); - - for (int i = 0; i< argc; i++) - info(TEXT_("argv:") + TEXT_(argv[i])); - - sscanf(argv[0],"%d", &taskCount); - - sscanf(argv[1],"%lg", &taskComputeSize); - - sscanf(argv[2],"%lg", &taskCommunicateSize); - - BasicTaskPtr* basicTasks = new BasicTaskPtr[taskCount]; - - for (int i = 0; i < taskCount; i++) - basicTasks[i] = new BasicTask(TEXT_("Task_") + TEXT_(i), taskComputeSize, taskCommunicateSize); - - int aliasCount = argc - 3; - - char** aliases = (char**) calloc(aliasCount, sizeof(char*)); - - for(int i = 3; i < argc ; i++) - aliases[i - 3] = _strdup(argv[i]); - - info(TEXT_("Got ") + TEXT_(aliasCount) + TEXT_(" alias(es) :")); - - for (int i = 0; i < aliasCount; i++) - info(TEXT_("\t") + TEXT_(aliases[i])); - - info(TEXT_("Got ") + TEXT_(taskCount) + TEXT_(" task to process.")); - - for (int i = 0; i < taskCount; i++) - { - info(TEXT_("Sending \"") + TEXT_(basicTasks[i]->getName()) + TEXT_("\" to \"") + TEXT_(aliases[i % aliasCount]) + TEXT_("\"")); - - - /*if((Host::currentHost().getName()).equals((aliases[i % aliasCount].split(":"))[0])) - info("Hey ! It's me ! "); - */ - - basicTasks[i]->send(aliases[i % aliasCount]); - } - - info("Send completed"); - - info("All tasks have been dispatched. Let's tell everybody the computation is over."); - - FinalizeTask* finalizeTask; - - for (int i = 0; i < aliasCount; i++) - { - finalizeTask = new FinalizeTask(); - finalizeTask->send(aliases[i]); - - } - - info("Goodbye now!"); - - delete[] basicTasks; - delete[] aliases; - - delete this; - - return 0; -} diff --git a/examples/cxx/explicitDestination/Master.hpp b/examples/cxx/explicitDestination/Master.hpp deleted file mode 100644 index b3e59ab7d6..0000000000 --- a/examples/cxx/explicitDestination/Master.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef MASTER_HPP -#define MASTER_HPP - -#include -using namespace SimGrid::Msg; - -class Master : public Process -{ - MSG_DECLARE_DYNAMIC(Master); - - public: - - // Default constructor. - Master(){} - - // Destructor. - virtual ~Master(){} - - int main(int argc, char** argv); - -}; - -#endif // !MASTER_HPP diff --git a/examples/cxx/explicitDestination/Slave.cxx b/examples/cxx/explicitDestination/Slave.cxx deleted file mode 100644 index 03c14c6bae..0000000000 --- a/examples/cxx/explicitDestination/Slave.cxx +++ /dev/null @@ -1,45 +0,0 @@ -#include "Slave.hpp" -#include "FinalizeTask.hpp" -#include "BasicTask.hpp" - -#include -#include - -#include -using namespace std; - -MSG_IMPLEMENT_DYNAMIC(Slave, Process) - -int Slave::main(int argc, char** argv) -{ - info("Hello"); - - Task* receivedTask; - BasicTask* basicTask; - - while(true) - { - receivedTask = Task::receive(Host::currentHost().getName()); - - if(receivedTask->isInstanceOf("FinalizeTask")) - { - delete receivedTask; - break; - } - - basicTask = reinterpret_cast(receivedTask); - - info(TEXT_("Received \"") + TEXT_(basicTask->getName()) + TEXT_("\" ")); - - info(TEXT_("Processing \"") + TEXT_(basicTask->getName()) + TEXT_("\" ")); - basicTask->execute(); - info(TEXT_("\"") + TEXT_(basicTask->getName()) + TEXT_("\" done ")); - - delete basicTask; - } - - info("Received Finalize. I'm done. See you!"); - - delete this; - return 0; -} diff --git a/examples/cxx/explicitDestination/Slave.hpp b/examples/cxx/explicitDestination/Slave.hpp deleted file mode 100644 index d0a5607bcd..0000000000 --- a/examples/cxx/explicitDestination/Slave.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef SLAVE_HPP -#define SLAVE_HPP - -#include -using namespace SimGrid::Msg; - -class Slave : public Process -{ - MSG_DECLARE_DYNAMIC(Slave); - - public: - - // Default constructor. - Slave(){} - - // Destructor. - virtual ~Slave(){} - - int main(int argc, char** argv); - -}; - - -#endif // !SLAVE_HPP diff --git a/examples/cxx/explicitDestination/explicitDestination.tesh b/examples/cxx/explicitDestination/explicitDestination.tesh deleted file mode 100644 index b6eed28c97..0000000000 --- a/examples/cxx/explicitDestination/explicitDestination.tesh +++ /dev/null @@ -1,69 +0,0 @@ -$ explicitDestination explicitDestination_platform.xml explicitDestination_deployment.xml -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Hello -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argc=8 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:5 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:50000 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:10 -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:iRMX -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Casavant -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Bousquet -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Soucy -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] argv:Jackson -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Got 5 alias(es) : -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] iRMX -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Casavant -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Bousquet -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Soucy -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Jackson -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Got 5 task to process. -> [Jacquelin:Master:(1) 0.000000] [cxx4msg/INFO] Sending "Task_0" to "iRMX" -> [Jackson:Forwarder:(2) 0.000000] [cxx4msg/INFO] Hello -> [Casavant:Forwarder:(3) 0.000000] [cxx4msg/INFO] Hello -> [iRMX:Slave:(4) 0.000000] [cxx4msg/INFO] Hello -> [Bousquet:Slave:(5) 0.000000] [cxx4msg/INFO] Hello -> [Soucy:Slave:(6) 0.000000] [cxx4msg/INFO] Hello -> [Kuenning:Slave:(7) 0.000000] [cxx4msg/INFO] Hello -> [Browne:Slave:(8) 0.000000] [cxx4msg/INFO] Hello -> [Stephen:Slave:(9) 0.000000] [cxx4msg/INFO] Hello -> [Robert:Slave:(10) 0.000000] [cxx4msg/INFO] Hello -> [Sirois:Slave:(11) 0.000000] [cxx4msg/INFO] Hello -> [Monique:Slave:(12) 0.000000] [cxx4msg/INFO] Hello -> [Jacquelin:Master:(1) 0.234181] [cxx4msg/INFO] Sending "Task_1" to "Casavant" -> [iRMX:Slave:(4) 0.234181] [cxx4msg/INFO] Received "Task_0" -> [iRMX:Slave:(4) 0.234181] [cxx4msg/INFO] Processing "Task_0" -> [iRMX:Slave:(4) 0.234910] [cxx4msg/INFO] "Task_0" done -> [Jacquelin:Master:(1) 0.338591] [cxx4msg/INFO] Sending "Task_2" to "Bousquet" -> [Casavant:Forwarder:(3) 0.338591] [cxx4msg/INFO] Received "Task_1" -> [Casavant:Forwarder:(3) 0.338591] [cxx4msg/INFO] Sending "Task_1" to "Robert" -> [Jacquelin:Master:(1) 0.416661] [cxx4msg/INFO] Sending "Task_3" to "Soucy" -> [Bousquet:Slave:(5) 0.416661] [cxx4msg/INFO] Received "Task_2" -> [Bousquet:Slave:(5) 0.416661] [cxx4msg/INFO] Processing "Task_2" -> [Bousquet:Slave:(5) 0.417826] [cxx4msg/INFO] "Task_2" done -> [Robert:Slave:(10) 0.454402] [cxx4msg/INFO] Received "Task_1" -> [Robert:Slave:(10) 0.454402] [cxx4msg/INFO] Processing "Task_1" -> [Robert:Slave:(10) 0.454766] [cxx4msg/INFO] "Task_1" done -> [Jacquelin:Master:(1) 0.527739] [cxx4msg/INFO] Sending "Task_4" to "Jackson" -> [Soucy:Slave:(6) 0.527739] [cxx4msg/INFO] Received "Task_3" -> [Soucy:Slave:(6) 0.527739] [cxx4msg/INFO] Processing "Task_3" -> [Soucy:Slave:(6) 0.528103] [cxx4msg/INFO] "Task_3" done -> [Jacquelin:Master:(1) 0.593252] [cxx4msg/INFO] Send completed -> [Jacquelin:Master:(1) 0.593252] [cxx4msg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Jackson:Forwarder:(2) 0.593252] [cxx4msg/INFO] Received "Task_4" -> [Jackson:Forwarder:(2) 0.593252] [cxx4msg/INFO] Sending "Task_4" to "Kuenning" -> [Kuenning:Slave:(7) 0.593708] [cxx4msg/INFO] Received "Task_4" -> [Kuenning:Slave:(7) 0.593708] [cxx4msg/INFO] Processing "Task_4" -> [Kuenning:Slave:(7) 0.594291] [cxx4msg/INFO] "Task_4" done -> [iRMX:Slave:(4) 0.827199] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Casavant:Forwarder:(3) 0.931504] [cxx4msg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Bousquet:Slave:(5) 1.009496] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Robert:Slave:(10) 1.047200] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Sirois:Slave:(11) 1.086548] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Soucy:Slave:(6) 1.120464] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Casavant:Forwarder:(3) 1.154764] [cxx4msg/INFO] I'm done. See you! -> [Monique:Slave:(12) 1.154764] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jacquelin:Master:(1) 1.185911] [cxx4msg/INFO] Goodbye now! -> [Jackson:Forwarder:(2) 1.185911] [cxx4msg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Kuenning:Slave:(7) 1.186360] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Browne:Slave:(8) 1.325058] [cxx4msg/INFO] Received Finalize. I'm done. See you! -> [Jackson:Forwarder:(2) 1.532781] [cxx4msg/INFO] I'm done. See you! -> [Stephen:Slave:(9) 1.532781] [cxx4msg/INFO] Received Finalize. I'm done. See you! \ No newline at end of file diff --git a/examples/cxx/explicitDestination/explicitDestination_deployment.xml b/examples/cxx/explicitDestination/explicitDestination_deployment.xml deleted file mode 100644 index fb5864b613..0000000000 --- a/examples/cxx/explicitDestination/explicitDestination_deployment.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/explicitDestination/explicitDestination_platform.xml b/examples/cxx/explicitDestination/explicitDestination_platform.xml deleted file mode 100644 index 6d476d1bec..0000000000 --- a/examples/cxx/explicitDestination/explicitDestination_platform.xml +++ /dev/null @@ -1,8298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/explicitDestination/makefile b/examples/cxx/explicitDestination/makefile deleted file mode 100644 index ce084d02dd..0000000000 --- a/examples/cxx/explicitDestination/makefile +++ /dev/null @@ -1,20 +0,0 @@ -CXX = g++ -PREFIX = /home/mcherier/com/loria/SimGridX -INCLUDES =-I$(PREFIX)/lib -I$(PREFIX)/examples/explicitDestination -SRCDIR = $(PREFIX)/examples/explicitDestination -CXXFLAGS = -Wall -pedantic -D_DEBUG $(INCLUDES) -LDFLAGS = -L$(PREFIX)/lib -LDLIBS = -lSimGridX - -PROG = explicitDestination - -OBJECTS = BasicTask.o FinalizeTask.o Slave.o Forwarder.o Master.o Main.o - -all: $(OBJECTS) - $(CXX) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -o $(PROG) - -%.o: $(SRCDIR)/%.cxx - $(CXX) -c $(CXXFLAGS) $(SRCDIR)/$*.cxx - -clean: - rm *.o \ No newline at end of file diff --git a/examples/cxx/ping_pong/Main.cxx b/examples/cxx/ping_pong/Main.cxx deleted file mode 100644 index c9709012f5..0000000000 --- a/examples/cxx/ping_pong/Main.cxx +++ /dev/null @@ -1,13 +0,0 @@ -#include - -using namespace SimGrid::Msg; - -int -main(int argc, char* argv[]) -{ - Simulation s; - - return s.execute(argc, argv); - -} - diff --git a/examples/cxx/ping_pong/PingPongTask.cxx b/examples/cxx/ping_pong/PingPongTask.cxx deleted file mode 100644 index 93d1133c2b..0000000000 --- a/examples/cxx/ping_pong/PingPongTask.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "PingPongTask.hpp" - -MSG_IMPLEMENT_DYNAMIC(PingPongTask, Task) diff --git a/examples/cxx/ping_pong/PingPongTask.hpp b/examples/cxx/ping_pong/PingPongTask.hpp deleted file mode 100644 index 009429dfae..0000000000 --- a/examples/cxx/ping_pong/PingPongTask.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef PINGPONG_TASK_HPP -#define PINGPONG_TASK_HPP - -#include -using namespace SimGrid::Msg; - -class PingPongTask : public Task -{ - MSG_DECLARE_DYNAMIC(PingPongTask); - -public: - - PingPongTask() - :Task(NULL, 0.0, 0.0){} - - // Default constructor. - PingPongTask(const char* name, double computeDuration, double messageSize) - throw (InvalidArgumentException, NullPointerException) - :Task(name, computeDuration, messageSize){} - - // Destructor - virtual ~PingPongTask() - throw(MsgException){} - - void setTime(double timeVal) - { - this->timeVal = timeVal; - } - - double getTime() - { - return timeVal; - } - -private : - - double timeVal; -}; - - -#endif // !PINGPONG_TASK_HPP diff --git a/examples/cxx/ping_pong/Receiver.cxx b/examples/cxx/ping_pong/Receiver.cxx deleted file mode 100644 index 01471228c9..0000000000 --- a/examples/cxx/ping_pong/Receiver.cxx +++ /dev/null @@ -1,46 +0,0 @@ -#include "Receiver.hpp" -#include "PingPongTask.hpp" -#include -#include -#include - -#include - -MSG_IMPLEMENT_DYNAMIC(Receiver, Process) - -const double commSizeLat = 1; -const double commSizeBw = 100000000; - -int Receiver::main(int argc, char** argv) -{ - info("Hello"); - double communicationTime=0; - double time = getClock(); - StringHelper bw; - - info("Try to get a task"); - - PingPongTask* task = reinterpret_cast(Task::get(0)); - - double timeGot = getClock(); - double timeSent = task->getTime(); - - delete task; - - info(TEXT_("Got at time ") + TEXT_(timeGot)); - info(TEXT_("Was sent at time ") + TEXT_(timeSent)); - - time = timeSent; - - communicationTime = timeGot - time; - - info(TEXT_( "Communication time : ") + TEXT_(communicationTime)); - - info(TEXT_(" --- BW ") + bw.append(commSizeBw/communicationTime,"%07lf") + TEXT_(" ----")); - - info("Goodbye!"); - - delete this; - - return 0; -} diff --git a/examples/cxx/ping_pong/Receiver.hpp b/examples/cxx/ping_pong/Receiver.hpp deleted file mode 100644 index 13459734c9..0000000000 --- a/examples/cxx/ping_pong/Receiver.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef RECEIVER_HPP -#define RECEIVER_HPP - -#include -using namespace SimGrid::Msg; - -class Receiver : public Process -{ - MSG_DECLARE_DYNAMIC(Receiver); - - public: - - // Default constructor. - Receiver(){} - - // Destructor. - virtual ~Receiver(){} - - int main(int argc, char** argv); - -}; - - -#endif // !RECEIVER_HPP - diff --git a/examples/cxx/ping_pong/Sender.cxx b/examples/cxx/ping_pong/Sender.cxx deleted file mode 100644 index e5d79686ad..0000000000 --- a/examples/cxx/ping_pong/Sender.cxx +++ /dev/null @@ -1,63 +0,0 @@ -#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; - -} - diff --git a/examples/cxx/ping_pong/Sender.hpp b/examples/cxx/ping_pong/Sender.hpp deleted file mode 100644 index ae73a7d8a7..0000000000 --- a/examples/cxx/ping_pong/Sender.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef SENDER_HPP -#define SENDER_HPP - -#include -using namespace SimGrid::Msg; - -class Sender : public Process -{ - MSG_DECLARE_DYNAMIC(Sender); - - public: - - // Default constructor. - Sender(){} - - // Destructor. - virtual ~Sender(){} - - int main(int argc, char** argv); - -}; - - -#endif // !SENDER_HPP - diff --git a/examples/cxx/ping_pong/makefile b/examples/cxx/ping_pong/makefile deleted file mode 100644 index be78cd896e..0000000000 --- a/examples/cxx/ping_pong/makefile +++ /dev/null @@ -1,20 +0,0 @@ -CXX = g++ -PREFIX = /home/mcherier/com/loria/SimGridX -INCLUDES =-I$(PREFIX)/lib -I$(PREFIX)/examples/ping_pong -SRCDIR = $(PREFIX)/examples/ping_pong -CXXFLAGS = -Wall -pedantic -D_DEBUG $(INCLUDES) -LDFLAGS = -L$(PREFIX)/lib -LDLIBS = -lSimGridX - -PROG = ping_pong - -OBJECTS = PingPongTask.o Sender.o Receiver.o Main.o - -all: $(OBJECTS) - $(CXX) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -o $(PROG) - -%.o: $(SRCDIR)/%.cxx - $(CXX) -c $(CXXFLAGS) $(SRCDIR)/$*.cxx - -clean: - rm *.o \ No newline at end of file diff --git a/examples/cxx/ping_pong/ping_pong.tesh b/examples/cxx/ping_pong/ping_pong.tesh deleted file mode 100644 index 94f231b9a8..0000000000 --- a/examples/cxx/ping_pong/ping_pong.tesh +++ /dev/null @@ -1,12 +0,0 @@ -$ ping_pong ping_pong_platform.xml ping_pong_deployment.xml -> [Inmos:Sender:(1) 0.000000] [cxx4msg/INFO] Hello -> [Inmos:Sender:(1) 0.000000] [cxx4msg/INFO] Host count : 1 -> [Inmos:Sender:(1) 0.000000] [cxx4msg/INFO] Sender time : 0.000000 -> [Bellevue:Receiver:(2) 0.000000] [cxx4msg/INFO] Hello -> [Bellevue:Receiver:(2) 0.000000] [cxx4msg/INFO] Try to get a task -> [Inmos:Sender:(1) 0.001462] [cxx4msg/INFO] Goodbye! -> [Bellevue:Receiver:(2) 0.001462] [cxx4msg/INFO] Got at time 0.001462 -> [Bellevue:Receiver:(2) 0.001462] [cxx4msg/INFO] Was sent at time 0.000000 -> [Bellevue:Receiver:(2) 0.001462] [cxx4msg/INFO] Communication time : 0.001462 -> [Bellevue:Receiver:(2) 0.001462] [cxx4msg/INFO] --- BW 68415215833.890411 ---- -> [Bellevue:Receiver:(2) 0.001462] [cxx4msg/INFO] Goodbye! \ No newline at end of file diff --git a/examples/cxx/ping_pong/ping_pong_deployment.xml b/examples/cxx/ping_pong/ping_pong_deployment.xml deleted file mode 100644 index 1a190dd187..0000000000 --- a/examples/cxx/ping_pong/ping_pong_deployment.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/examples/cxx/ping_pong/ping_pong_platform.xml b/examples/cxx/ping_pong/ping_pong_platform.xml deleted file mode 100644 index e4da7f3118..0000000000 --- a/examples/cxx/ping_pong/ping_pong_platform.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/suspend/DreamMaster.cxx b/examples/cxx/suspend/DreamMaster.cxx deleted file mode 100644 index a4e58b32a7..0000000000 --- a/examples/cxx/suspend/DreamMaster.cxx +++ /dev/null @@ -1,54 +0,0 @@ -#include "DreamMaster.hpp" -#include "LazyGuy.hpp" -#include -#include -#include - -#include - - -MSG_IMPLEMENT_DYNAMIC(DreamMaster, Process) - -int DreamMaster::main(int argc, char** argv) -{ - - info("Hello"); - - info("Let's create a lazy guy."); - - - LazyGuy* lazy; - - try - { - Host currentHost = Host::currentHost(); - - info(TEXT_("Current host name : ") + TEXT_(currentHost.getName())); - - lazy = new LazyGuy(currentHost,"LazyGuy"); - - info("Let's wait a little bit..."); - - Process::sleep(10.0); - - info("Let's wake the lazy guy up! >:) "); - - lazy->resume(); - - - } - catch(HostNotFoundException e) - { - error(TEXT_(e.toString()) + TEXT_(". Stopping Now!")); - exit(1); - } - - //lazy->migrate(currentHost); - - info("OK, goodbye now."); - - delete this; - - return 0; - -} diff --git a/examples/cxx/suspend/DreamMaster.hpp b/examples/cxx/suspend/DreamMaster.hpp deleted file mode 100644 index aee6f2b465..0000000000 --- a/examples/cxx/suspend/DreamMaster.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef DREAMMASTER_HPP -#define DREAMMASTER_HPP - -#include -using namespace SimGrid::Msg; - -class DreamMaster : public Process -{ - MSG_DECLARE_DYNAMIC(DreamMaster); - - public: - - // Default constructor. - DreamMaster(){} - - // Destructor. - virtual ~DreamMaster(){} - - int main(int argc, char** argv); - -}; - - -#endif // !DREAMMASTER_HPP diff --git a/examples/cxx/suspend/LazyGuy.cxx b/examples/cxx/suspend/LazyGuy.cxx deleted file mode 100644 index c19db95719..0000000000 --- a/examples/cxx/suspend/LazyGuy.cxx +++ /dev/null @@ -1,25 +0,0 @@ -#include "LazyGuy.hpp" -#include - -#include - -// Not needed : DreamMaster directly constructs the object -// MSG_IMPLEMENT_DYNAMIC(LazyGuy, Process) - -int LazyGuy::main(int argc, char** argv) -{ - info("Hello !"); - - info("Nobody's watching me ? Let's go to sleep."); - - Process::currentProcess().suspend(); - - info("Uuuh ? Did somebody call me ?"); - - info("Mmmh, goodbye now."); - - delete this; - - return 0; -} - diff --git a/examples/cxx/suspend/LazyGuy.hpp b/examples/cxx/suspend/LazyGuy.hpp deleted file mode 100644 index edd278d94d..0000000000 --- a/examples/cxx/suspend/LazyGuy.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef LAZYGUY_HPP -#define LAZYGUY_HPP - -#include -using namespace SimGrid::Msg; - -class LazyGuy : public Process -{ - // Not needed : DreamMaster directly constructs the object - // MSG_DECLARE_DYNAMIC(LazyGuy); - - public: - - // Default constructor. - LazyGuy(){} - - // Destructor. - virtual ~LazyGuy(){} - - LazyGuy(const Host& rHost,const char* name) - throw(NullPointerException) - :Process(rHost, name){} - - int main(int argc, char** argv); - -}; - - -#endif // !LAZYGUY_HPP - diff --git a/examples/cxx/suspend/Main.cxx b/examples/cxx/suspend/Main.cxx deleted file mode 100644 index 5a0ad56a51..0000000000 --- a/examples/cxx/suspend/Main.cxx +++ /dev/null @@ -1,14 +0,0 @@ -#include - -using namespace SimGrid::Msg; - -int -main(int argc, char* argv[]) -{ - Simulation s; - - return s.execute(argc, argv); - -} - - diff --git a/examples/cxx/suspend/makefile b/examples/cxx/suspend/makefile deleted file mode 100644 index ff1bda6d7f..0000000000 --- a/examples/cxx/suspend/makefile +++ /dev/null @@ -1,20 +0,0 @@ -CXX = g++ -PREFIX = /home/mcherier/com/loria/SimGridX -INCLUDES =-I$(PREFIX)/lib -I$(PREFIX)/examples/suspend -SRCDIR = $(PREFIX)/examples/suspend -CXXFLAGS = -Wall -pedantic -D_DEBUG $(INCLUDES) -LDFLAGS = -L$(PREFIX)/lib -LDLIBS = -lSimGridX - -PROG = suspend - -OBJECTS = DreamMaster.o LazyGuy.o Main.o - -all: $(OBJECTS) - $(CXX) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -o $(PROG) - -%.o: $(SRCDIR)/%.cxx - $(CXX) -c $(CXXFLAGS) $(SRCDIR)/$*.cxx - -clean: - rm *.o \ No newline at end of file diff --git a/examples/cxx/suspend/suspend.tesh b/examples/cxx/suspend/suspend.tesh deleted file mode 100644 index bd9e29d10a..0000000000 --- a/examples/cxx/suspend/suspend.tesh +++ /dev/null @@ -1,11 +0,0 @@ -$ suspend suspend_platform.xml suspend_deployment.xml -> [Jacquelin:DreamMaster:(1) 0.000000] [cxx4msg/INFO] Hello -> [Jacquelin:DreamMaster:(1) 0.000000] [cxx4msg/INFO] Let's create a lazy guy. -> [Jacquelin:DreamMaster:(1) 0.000000] [cxx4msg/INFO] Current host name : Jacquelin -> [Jacquelin:DreamMaster:(1) 0.000000] [cxx4msg/INFO] Let's wait a little bit... -> [Jacquelin:LazyGuy:(2) 0.000000] [cxx4msg/INFO] Hello ! -> [Jacquelin:LazyGuy:(2) 0.000000] [cxx4msg/INFO] Nobody's watching me ? Let's go to sleep. -> [Jacquelin:DreamMaster:(1) 10.000000] [cxx4msg/INFO] Let's wake the lazy guy up! >:) -> [Jacquelin:DreamMaster:(1) 10.000000] [cxx4msg/INFO] OK, goodbye now. -> [Jacquelin:LazyGuy:(2) 10.000000] [cxx4msg/INFO] Uuuh ? Did somebody call me ? -> [Jacquelin:LazyGuy:(2) 10.000000] [cxx4msg/INFO] Mmmh, goodbye now. \ No newline at end of file diff --git a/examples/cxx/suspend/suspend_deployment.xml b/examples/cxx/suspend/suspend_deployment.xml deleted file mode 100644 index c685bcb2ca..0000000000 --- a/examples/cxx/suspend/suspend_deployment.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/examples/cxx/suspend/suspend_platform.xml b/examples/cxx/suspend/suspend_platform.xml deleted file mode 100644 index 6d476d1bec..0000000000 --- a/examples/cxx/suspend/suspend_platform.xml +++ /dev/null @@ -1,8298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/cxx/BadAllocException.cxx b/src/cxx/BadAllocException.cxx deleted file mode 100644 index 24d02793db..0000000000 --- a/src/cxx/BadAllocException.cxx +++ /dev/null @@ -1,74 +0,0 @@ -/* - * BadAllocationException.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* BadAllocationException member functions implementation. - */ - -#include - -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - - BadAllocException::BadAllocException() - { - this->reason = (char*) calloc(strlen("Not enough memory") + 1, sizeof(char)); - strcpy(this->reason, "Not enough memory"); - } - - - BadAllocException::BadAllocException(const BadAllocException& rBadAllocException) - { - const char* reason = rBadAllocException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - BadAllocException::BadAllocException(const char* objectName) - { - this->reason = (char*) calloc(strlen("Not enough memory to allocate ") + strlen(objectName) + 1, sizeof(char)); - sprintf(this->reason, "Not enough memory to allocate %s", objectName); - } - - - BadAllocException::~BadAllocException() - { - if(this->reason) - free(this->reason); - } - - const char* BadAllocException::toString(void) const - { - return (const char*)(this->reason); - } - - - const BadAllocException& BadAllocException::operator = (const BadAllocException& rBadAllocException) - { - const char* reason = rBadAllocException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/BadAllocException.hpp b/src/cxx/BadAllocException.hpp deleted file mode 100644 index 69221ce55c..0000000000 --- a/src/cxx/BadAllocException.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * BadAllocException.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_BADALLOCEXCEPTION_HPP -#define MSG_BADALLOCEXCEPTION_HPP - -#ifndef __cplusplus - #error BadAllocException.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT BadAllocException : public Exception - { - public: - - // Default constructor. - BadAllocException(); - - // Copy constructor. - BadAllocException(const BadAllocException& rBadAllocException); - - // This constructor takes the name of the object of the allocation failure. - BadAllocException(const char* objectName); - - // Destructor. - virtual ~BadAllocException(); - - // Operations. - - // Returns the reason of the exception : - // the message "Not enough memory to allocate : `object name'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const BadAllocException& operator = (const BadAllocException& rBadAllocException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_BADALLOCEXCEPTION_HPP - diff --git a/src/cxx/ClassNotFoundException.cxx b/src/cxx/ClassNotFoundException.cxx deleted file mode 100644 index 13887a293f..0000000000 --- a/src/cxx/ClassNotFoundException.cxx +++ /dev/null @@ -1,75 +0,0 @@ -/* - * ClassNotFoundException.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* ClassNotFoundException member functions implementation. - */ - -#include - -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - - ClassNotFoundException::ClassNotFoundException() - { - this->reason = (char*) calloc(strlen("Class not found : unknown") + 1, sizeof(char)); - strcpy(this->reason, "Class not found : unknown"); - } - - - ClassNotFoundException::ClassNotFoundException(const ClassNotFoundException& rClassNotFoundException) - { - const char* reason = rClassNotFoundException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - - ClassNotFoundException::ClassNotFoundException(const char* name) - { - this->reason = (char*) calloc(strlen("Class not found : ") + strlen(name) + 1, sizeof(char)); - sprintf(this->reason, "Class not found : %s", name); - } - - - ClassNotFoundException::~ClassNotFoundException() - { - if(this->reason) - free(this->reason); - } - - const char* ClassNotFoundException::toString(void) const - { - return (const char*)(this->reason); - } - - - const ClassNotFoundException& ClassNotFoundException::operator = (const ClassNotFoundException& rClassNotFoundException) - { - const char* reason = rClassNotFoundException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/ClassNotFoundException.hpp b/src/cxx/ClassNotFoundException.hpp deleted file mode 100644 index 36a77b95e9..0000000000 --- a/src/cxx/ClassNotFoundException.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * ClassNotFoundException.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_CLASSNOTFOUNDEXCEPTION_HPP -#define MSG_CLASSNOTFOUNDEXCEPTION_HPP - -#ifndef __cplusplus - #error ClassNotFoundException.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT ClassNotFoundException : public Exception - { - public: - - // Default constructor. - ClassNotFoundException(); - - // Copy constructor. - ClassNotFoundException(const ClassNotFoundException& rClassNotFoundException); - - // This constructor takes the name of the class not found. - ClassNotFoundException(const char* name); - - // Destructor. - virtual ~ClassNotFoundException(); - - // Operations. - - // Returns the reason of the exception : - // the message "Host not found `host name'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const ClassNotFoundException& operator = (const ClassNotFoundException& rClassNotFoundException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_CLASSNOTFOUNDEXCEPTION_HPP - diff --git a/src/cxx/Config.hpp b/src/cxx/Config.hpp deleted file mode 100644 index 2f9ed2de5d..0000000000 --- a/src/cxx/Config.hpp +++ /dev/null @@ -1,44 +0,0 @@ - -/* - * Config.hpp - * - * This file contains the declaration of the wrapper class of the native MSG task type. - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_CONFIG_HPP -#define MSG_CONFIG_HPP - -#ifndef __cplusplus - #error Config.hpp requires C++ compilation (use a .cxx suffix) -#endif - -namespace SimGrid -{ - namespace Msg - { - #if defined(WIN32) && !defined(__MINGW32__) - #if defined(SIMGRIDX_EXPORTS) - #define SIMGRIDX_EXPORT __declspec(dllexport) - #else - #define SIMGRIDX_EXPORT __declspec(dllimport) - #endif - #else - #define SIMGRIDX_EXPORT - #endif - } // namespace Msg -} // namespace SimGrid - -#ifndef WIN32 -#define _strdup strdup -#endif - -#endif // MSG_CONFIG_HPP - diff --git a/src/cxx/Exception.cxx b/src/cxx/Exception.cxx deleted file mode 100644 index c314f13f7c..0000000000 --- a/src/cxx/Exception.cxx +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Exception.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* Exception member functions implementation. - * The base class of all the types of exceptions of SimGrid::Msg. - */ - -#include - -namespace SimGrid -{ - namespace Msg - { - - Exception::Exception() - { - reason = "Unknown reason"; - } - - - Exception::Exception(const Exception& rException) - { - this->reason = rException.toString(); - } - - - Exception::Exception(const char* reason) - { - this->reason = reason; - } - - - Exception::~Exception() - { - // NOTHING TODO - } - - const char* Exception::toString(void) const - { - return this->reason; - } - - - const Exception& Exception::operator = (const Exception& rException) - { - this->reason = rException.toString(); - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/Exception.hpp b/src/cxx/Exception.hpp deleted file mode 100644 index 2fc3067809..0000000000 --- a/src/cxx/Exception.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Exception.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_EXCEPTION_HPP -#define MSG_EXCEPTION_HPP - -#ifndef __cplusplus - #error Exception.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT Exception - { - public: - - // Default constructor. - Exception(); - - // Copy constructor. - Exception(const Exception& rException); - - // This constructor takes the reason of the exception. - Exception(const char* reason); - - // Destructor. - virtual ~Exception(); - - // Operations. - - // Returns the reason of the exception. - const char* toString(void) const; - - // Operators. - - // Assignement. - const Exception& operator = (const Exception& rException); - - private : - - // Attributes. - - // The reason of the exceptions. - const char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_EXCEPTION_HPP - diff --git a/src/cxx/FileNotFoundException.cxx b/src/cxx/FileNotFoundException.cxx deleted file mode 100644 index 3ceec071a2..0000000000 --- a/src/cxx/FileNotFoundException.cxx +++ /dev/null @@ -1,75 +0,0 @@ -/* - * FileNotFoundException.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* FileNotFoundException member functions implementation. - */ - -#include - -#include -#include -#include - - -namespace SimGrid -{ - namespace Msg - { - - FileNotFoundException::FileNotFoundException() - { - this->reason = (char*) calloc(strlen("File not found") + 1, sizeof(char)); - strcpy(this->reason, "File not found"); - } - - - FileNotFoundException::FileNotFoundException(const FileNotFoundException& rFileNotFoundException) - { - const char* reason = rFileNotFoundException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - FileNotFoundException::FileNotFoundException(const char* file) - { - this->reason = (char*) calloc(strlen("File not found ") + strlen(file) + 1, sizeof(char)); - sprintf(this->reason, "File not found %s", file); - } - - - FileNotFoundException::~FileNotFoundException() - { - if(this->reason) - free(this->reason); - } - - const char* FileNotFoundException::toString(void) const - { - return (const char*)(this->reason); - } - - - const FileNotFoundException& FileNotFoundException::operator = (const FileNotFoundException& rFileNotFoundException) - { - const char* reason = rFileNotFoundException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/FileNotFoundException.hpp b/src/cxx/FileNotFoundException.hpp deleted file mode 100644 index 53a6247282..0000000000 --- a/src/cxx/FileNotFoundException.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * FileNotFoundException.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_FILENOTFOUND_HPP -#define MSG_FILENOTFOUND_HPP - -#ifndef __cplusplus - #error FileNotFoundException.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT FileNotFoundException : public Exception - { - public: - - // Default constructor. - FileNotFoundException(); - - // Copy constructor. - FileNotFoundException(const FileNotFoundException& rFileNotFoundException); - - // This constructor takes the name of the file. - FileNotFoundException(const char* file); - - // Destructor. - virtual ~FileNotFoundException(); - - // Operations. - - // Returns the reason of the exception : - // the message "File not found : `object name'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const FileNotFoundException& operator = (const FileNotFoundException& rFileNotFoundException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_MSGEXCEPTION_HPP - diff --git a/src/cxx/HostNotFoundException.cxx b/src/cxx/HostNotFoundException.cxx deleted file mode 100644 index 213ab12f40..0000000000 --- a/src/cxx/HostNotFoundException.cxx +++ /dev/null @@ -1,75 +0,0 @@ -/* - * HostNotFoundException.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* HostNotFoundException member functions implementation. - */ - -#include - -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - - HostNotFoundException::HostNotFoundException() - { - this->reason = (char*) calloc(strlen("Host not found : unknown") + 1, sizeof(char)); - strcpy(this->reason, "Host not found : unknown"); - } - - - HostNotFoundException::HostNotFoundException(const HostNotFoundException& rHostNotFoundException) - { - const char* reason = rHostNotFoundException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - - HostNotFoundException::HostNotFoundException(const char* name) - { - this->reason = (char*) calloc(strlen("Host not found : ") + strlen(name) + 1, sizeof(char)); - sprintf(this->reason, "Host not found : %s", name); - } - - - HostNotFoundException::~HostNotFoundException() - { - if(this->reason) - free(this->reason); - } - - const char* HostNotFoundException::toString(void) const - { - return (const char*)(this->reason); - } - - - const HostNotFoundException& HostNotFoundException::operator = (const HostNotFoundException& rHostNotFoundException) - { - const char* reason = rHostNotFoundException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/HostNotFoundException.hpp b/src/cxx/HostNotFoundException.hpp deleted file mode 100644 index c8458ba421..0000000000 --- a/src/cxx/HostNotFoundException.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * HostNotFoundException.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_HOSTNOTFOUNDEXCEPTION_HPP -#define MSG_HOSTNOTFOUNDEXCEPTION_HPP - -#ifndef __cplusplus - #error HostNotFoundException.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT HostNotFoundException : public Exception - { - public: - - // Default constructor. - HostNotFoundException(); - - // Copy constructor. - HostNotFoundException(const HostNotFoundException& rHostNotFoundException); - - // This constructor takes the name of the host not found. - HostNotFoundException(const char* name); - - // Destructor. - virtual ~HostNotFoundException(); - - // Operations. - - // Returns the reason of the exception : - // the message "Host not found `host name'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const HostNotFoundException& operator = (const HostNotFoundException& rHostNotFoundException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_HOSTNOTFOUNDEXCEPTION_HPP - - diff --git a/src/cxx/InvalidArgumentException.cxx b/src/cxx/InvalidArgumentException.cxx deleted file mode 100644 index c82d517d1e..0000000000 --- a/src/cxx/InvalidArgumentException.cxx +++ /dev/null @@ -1,76 +0,0 @@ -/* - * InvalidArgumentException.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* InvalidArgumentException member functions implementation. - */ - - -#include - -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - - InvalidArgumentException::InvalidArgumentException() - { - this->reason = (char*) calloc(strlen("Invalid argument : unknown") + 1, sizeof(char)); - strcpy(this->reason, "Invalid argument : unknown"); - } - - - InvalidArgumentException::InvalidArgumentException(const InvalidArgumentException& rInvalidArgumentException) - { - const char* reason = rInvalidArgumentException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - - InvalidArgumentException::InvalidArgumentException(const char* name) - { - this->reason = (char*) calloc(strlen("Invalid argument : ") + strlen(name) + 1, sizeof(char)); - sprintf(this->reason, "Invalid argument : %s", name); - } - - - InvalidArgumentException::~InvalidArgumentException() - { - if(this->reason) - free(this->reason); - } - - const char* InvalidArgumentException::toString(void) const - { - return (const char*)(this->reason); - } - - - const InvalidArgumentException& InvalidArgumentException::operator = (const InvalidArgumentException& rInvalidArgumentException) - { - const char* reason = rInvalidArgumentException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/InvalidArgumentException.hpp b/src/cxx/InvalidArgumentException.hpp deleted file mode 100644 index 5b779b57aa..0000000000 --- a/src/cxx/InvalidArgumentException.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * InvalidArgumentException.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_INVALIDARGUMENTEXCEPTION_HPP -#define MSG_INVALIDARGUMENTEXCEPTION_HPP - -#ifndef __cplusplus - #error InvalidArgumentException.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT InvalidArgumentException : public Exception - { - public: - - // Default constructor. - InvalidArgumentException(); - - // Copy constructor. - InvalidArgumentException(const InvalidArgumentException& rInvalidArgumentException); - - // This constructor takes the name of the invalid argument. - InvalidArgumentException(const char* name); - - // Destructor. - virtual ~InvalidArgumentException(); - - // Operations. - - // Returns the reason of the exception : - // the message "Invalid argument `argument name'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const InvalidArgumentException& operator = (const InvalidArgumentException& rInvalidArgumentException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_INVALIDARGUMENTEXCEPTION_HPP - diff --git a/src/cxx/LogicException.cxx b/src/cxx/LogicException.cxx deleted file mode 100644 index b911229cdf..0000000000 --- a/src/cxx/LogicException.cxx +++ /dev/null @@ -1,75 +0,0 @@ -/* - * LogicException.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* LogicException member functions implementation. - */ - -#include - -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - - LogicException::LogicException() - { - this->reason = (char*) calloc(strlen("Logic exception : no detail") + 1, sizeof(char)); - strcpy(this->reason, "Logic exception : no detail"); - } - - - LogicException::LogicException(const LogicException& rLogicException) - { - const char* reason = rLogicException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - - LogicException::LogicException(const char* detail) - { - this->reason = (char*) calloc(strlen("Logic exception : ") + strlen(detail) + 1, sizeof(char)); - sprintf(this->reason, "Logic exception : %s", detail); - } - - - LogicException::~LogicException() - { - if(this->reason) - free(this->reason); - } - - const char* LogicException::toString(void) const - { - return (const char*)(this->reason); - } - - - const LogicException& LogicException::operator = (const LogicException& rLogicException) - { - const char* reason = rLogicException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/LogicException.hpp b/src/cxx/LogicException.hpp deleted file mode 100644 index fb2ffd9c20..0000000000 --- a/src/cxx/LogicException.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * LogicException.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_LOGICEXCEPTION_HPP -#define MSG_LOGICEXCEPTION_HPP - -#ifndef __cplusplus - #error LogicException.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT LogicException : public Exception - { - public: - - // Default constructor. - LogicException(); - - // Copy constructor. - LogicException(const LogicException& rLogicException); - - // This constructor takes the detail of the logic exception. - LogicException(const char* detail); - - // Destructor. - virtual ~LogicException(); - - // Operations. - - // Returns the reason of the exception : - // the message "Logic exception `detail'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const LogicException& operator = (const LogicException& rLogicException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_INVALIDARGUMENTEXCEPTION_HPP - - diff --git a/src/cxx/Msg.cxx b/src/cxx/Msg.cxx deleted file mode 100644 index cb622f8baf..0000000000 --- a/src/cxx/Msg.cxx +++ /dev/null @@ -1,152 +0,0 @@ - -/* - * Msg.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* Msg functions implementation. - */ - - -#include -#include -#include - - -#include -#include - -#include -using std::cout; -using std::endl; -using std::streamsize; - -#include -using std::setprecision; -using std::setw; - - - -namespace SimGrid -{ - namespace Msg - { - #define SIMGRIDX_DEFAULT_CHANNEL_NUMBER ((int)10) - - void init(int argc, char** argv) - { - MSG_global_init(&argc,argv); - - if(getMaxChannelNumber() == 0) - setMaxChannelNumber(SIMGRIDX_DEFAULT_CHANNEL_NUMBER); - } - - void finalize(void) - throw (MsgException) - { - if(MSG_OK != MSG_clean()) - throw MsgException("MSG_clean() failed"); - - } - - void info(const StringHelper& s) - { - StringHelper clock; - - cout << "["; - cout << Host::currentHost().getName(); - cout << ":"; - cout << Process::currentProcess().getName(); - cout << ":("; - cout << Process::currentProcess().getPID(); - cout << ") " ; - cout << clock.append(getClock(), "%07lf"); - cout << "] [cxx4msg/INFO] "; - cout << s; - cout << endl; - } - - void info(const char* s) - { - StringHelper clock; - - cout << "["; - cout << Host::currentHost().getName(); - cout << ":"; - cout << Process::currentProcess().getName(); - cout << ":("; - cout << Process::currentProcess().getPID(); - cout << ") " ; - cout << clock.append(getClock(), "%07lf"); - cout << "] [cxx4msg/INFO] "; - cout << s; - cout << endl; - } - - void error(const StringHelper& s) - { - StringHelper clock; - - cout << "["; - cout << Host::currentHost().getName(); - cout << ":"; - cout << Process::currentProcess().getName(); - cout << ":("; - cout << Process::currentProcess().getPID(); - cout << ") " ; - cout << clock.append(getClock(), "%07lf"); - cout << "] [cxx4msg/ERROR] "; - cout << s; - cout << endl; - } - - void error(const char* s) - { - StringHelper clock; - - cout << "["; - cout << Host::currentHost().getName(); - cout << ":"; - cout << Process::currentProcess().getName(); - cout << ":("; - cout << Process::currentProcess().getPID(); - cout << ") " ; - cout << clock.append(getClock(), "%07lf"); - cout << "] [cxx4msg/ERROR] "; - cout << s; - cout << endl; - } - - double getClock(void) - { - return MSG_get_clock(); - } - - void setMaxChannelNumber(int number) - throw(InvalidArgumentException, LogicException) - { - if(msg_global->max_channel > 0) - throw LogicException("Max channel number already setted"); - - if(number < 0) - throw InvalidArgumentException("number"); - - msg_global->max_channel = number; - } - - int getMaxChannelNumber(void) - { - return msg_global->max_channel; - } - - } // namespace Msg - -} // namespace SimGrid - diff --git a/src/cxx/Msg.hpp b/src/cxx/Msg.hpp deleted file mode 100644 index 95095fb162..0000000000 --- a/src/cxx/Msg.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Msg.hpp - * - * This file contains the declaration of the wrapper class of the native MSG task type. - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_HPP -#define MSG_HPP - -// Compilation C++ recquise -#ifndef __cplusplus - #error Msg.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include -#include -#include - -#include - - -namespace SimGrid -{ - namespace Msg - { - class MsgException; - class InvalidArgumentException; - class LogicException; - - /*! \brief init() - Initialize MSG (This function must be called at the begining of each simulation). - * - * \param argv A list of arguments. - * \param argc The number of arguments of the list. - */ - SIMGRIDX_EXPORT void init(int argc, char** argv); - - /*! \brief finalize() - Finalize MSG (This function must be called at the end of each simulation). - * - * \exception If this function fails, it throws a exception describing the cause of the failure. - */ - SIMGRIDX_EXPORT void finalize(void) - throw (MsgException); - - /*! \brief info() - Display information (using xbt log format). - * - * \param s The information to display. - */ - SIMGRIDX_EXPORT void info(const StringHelper& s); - - SIMGRIDX_EXPORT void info(const char* s); - - SIMGRIDX_EXPORT void error(const StringHelper& s); - - SIMGRIDX_EXPORT void error(const char* s); - - - /*! \brief getClock() - Retrieve the simulation time - * - * \return The current simulation time. - */ - SIMGRIDX_EXPORT double getClock(void); - - - SIMGRIDX_EXPORT void setMaxChannelNumber(int number) - throw(InvalidArgumentException, LogicException); - - SIMGRIDX_EXPORT int getMaxChannelNumber(void); - - } // namespace Msg -} // namespace SimGrid - -#endif // !MSG_HPP diff --git a/src/cxx/MsgApplication.cxx b/src/cxx/MsgApplication.cxx deleted file mode 100644 index ff7b4ba233..0000000000 --- a/src/cxx/MsgApplication.cxx +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Application.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* Application member functions implementation. - */ - -#include - -#include - -#include -#include -#include - -#include - -#ifndef S_ISREG - #define S_ISREG(__mode) (((__mode) & S_IFMT) == S_IFREG) -#endif - -namespace SimGrid -{ - namespace Msg - { - - Application::Application() - { - this->file = NULL; - this->deployed = false; - } - - Application::Application(const Application& rApplication) - { - - this->file = rApplication.getFile(); - this->deployed = rApplication.isDeployed(); - } - - Application::Application(const char* file) - throw(NullPointerException, FileNotFoundException) - { - // check parameters - - if(!file) - throw NullPointerException("file"); - - struct stat statBuf = {0}; - - if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode)) - throw FileNotFoundException(file); - - this->file = file; - this->deployed = false; - } - - Application::~Application() - { - // NOTHING TODO - } - - void Application::deploy(const char* file) - throw(NullPointerException, FileNotFoundException, LogicException, MsgException) - { - // check logic - - if(this->deployed) - throw LogicException("application already deployed"); - - // check the parameters - - if(!file) - throw NullPointerException("file"); - - struct stat statBuf = {0}; - - if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode)) - throw FileNotFoundException(file); - - surf_parse_reset_parser(); - - // set the begin of the xml process element handler - surfxml_add_callback(STag_surfxml_process_cb_list, ApplicationHandler::onBeginProcess); - - // set the process arg handler - surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onProcessArg); - - // set the properties handler - surfxml_add_callback(STag_surfxml_prop_cb_list, ApplicationHandler::OnProperty); - - // set the end of the xml process element handler - surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::onEndProcess); - - surf_parse_open(file); - - // initialize the process factory used by the process handler to build the processes. - ApplicationHandler::onStartDocument(); - - if(surf_parse()) - throw MsgException("surf_parse() failed"); - - surf_parse_close(); - - // release the process factory - ApplicationHandler::onEndDocument(); - - this->file = file; - this->deployed = true; - } - - void Application::deploy(void) - throw(LogicException, MsgException) - { - // check logic - - if(this->deployed) - throw LogicException("application already deployed"); - - // check the parameters - if(!this->file) - throw LogicException("you must specify the xml file which describe the application\nuse Application::setFile()"); - - surf_parse_reset_parser(); - surfxml_add_callback(STag_surfxml_process_cb_list, ApplicationHandler::onBeginProcess); - surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onProcessArg); - surfxml_add_callback(STag_surfxml_prop_cb_list, ApplicationHandler::OnProperty); - surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::onEndProcess); - - // initialize the process factory used by the process handler to build the processes. - ApplicationHandler::onStartDocument(); - - surf_parse_open(file); - - if(surf_parse()) - throw MsgException("surf_parse() failed"); - - surf_parse_close(); - - this->deployed = true; - } - - bool Application::isDeployed(void) const - { - return this->deployed; - } - - void Application::setFile(const char* file) - throw (NullPointerException, FileNotFoundException, LogicException) - { - // check logic - - if(this->deployed) - throw LogicException("your are trying to change the file of an already deployed application"); - - // check parameters - - if(!file) - throw NullPointerException("file"); - - struct stat statBuf = {0}; - - if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode)) - throw FileNotFoundException("file (file not found)"); - - this->file = file; - - } - - const char* Application::getFile(void) const - { - return this->file; - } - - const Application& Application::operator = (const Application& rApplication) - throw(LogicException) - { - // check logic - - if(this->deployed) - throw LogicException("application already deployed"); - - this->file = rApplication.getFile(); - this->deployed = rApplication.isDeployed(); - - return *this; - } - } // namespace Msg -} // namespace SimGrid - - - diff --git a/src/cxx/MsgApplication.hpp b/src/cxx/MsgApplication.hpp deleted file mode 100644 index 925c1efe07..0000000000 --- a/src/cxx/MsgApplication.hpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Application.hpp - * - * This file contains the declaration of the wrapper class of the native MSG task type. - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_APPLICATION_HPP -#define MSG_APPLICATION_HPP - -#ifndef __cplusplus - #error Application.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - // Application wrapper class declaration. - class SIMGRIDX_EXPORT Application - { - public: - - /*! \brief Default constructor. - */ - Application(); - - /*! \brief Copy constructor. - */ - Application(const Application& rApplication); - - /* \brief A constructor which takes as parameter the xml file of the application. - * - * \exception If this constructor fails, it throws on of the exceptions described - * below: - * - * [NullPointerException] if the parameter file is NULL. - * - * [FileNotFoundException] if the file is not found. - */ - Application(const char* file) - throw(NullPointerException, FileNotFoundException); - - /*! \brief Destructor. - */ - virtual ~Application(); - - // Operations. - - /*! \brief Application::deploy() - deploy the appliction. - * - * \exception If this method fails, it throws an exception listed below: - * - * \exception [LogicException] if the xml file which describes the application - * is not yet specified or if the application is already - * deployed. - * [MsgException] if a internal exception occurs. - * - * \remark Before use this method, you must specify the xml file of the application to - * deploy. - * - * \see Application::setFile() - */ - - void deploy(void) - throw(LogicException, MsgException); - - /*! \brief Application::deploy() - Deploy the appliction. - * - * \return If successfuly the application is deployed. Otherwise - * the method throws an exception listed below. - * - * \exception [NullPointerException] if the parameter file is NULL. - * - * [FileNotFoundException] if the file is not found. - * - * [MsgException] if a internal exception occurs. - * - * [LogicException] if the application is already deployed. - * - * \ - */ - void deploy(const char* file) - throw(NullPointerException, FileNotFoundException, LogicException, MsgException); - - /*! \brief Application::isDeployed() - Tests if the application is deployed. - * - * \return This method returns true is the application is deployed. - * Otherwise the method returns false. - */ - bool isDeployed(void) const; - - - // Getters/setters - - /*! \brief Application::setFile() - this setter sets the value of the file of the application. - * - * \exception If this method fails, it throws on of the exceptions listed below: - * - * [NullPointerException] if the parameter file is NULL. - * - * [FileNotFoundException] if the file is not found. - - * [LogicException] if you try to set the value of the file of an - * application which is already deployed. - */ - void setFile(const char* file) - throw (NullPointerException, FileNotFoundException, LogicException); - - /*! \brief Application::getFile() - This getter returns the name of the xml file which describes the - * application of the simulation. - */ - const char* getFile(void) const; - - // Operators. - - /*! \brief Assignement operator. - * - * \exception [LogicException] if you try to assign an application already deployed. - */ - const Application& operator = (const Application& rApplication) - throw(LogicException); - - private: - // Attributes. - - // flag : if true the application was deployed. - bool deployed; - - // the xml file which describes the application of the simulation. - const char* file; - - }; - - } // namespace Msg -} // namespace SimGrid - -#endif // !MSG_APPLICATION_HPP - diff --git a/src/cxx/MsgApplicationHandler.cxx b/src/cxx/MsgApplicationHandler.cxx deleted file mode 100644 index dc70b2cd7f..0000000000 --- a/src/cxx/MsgApplicationHandler.cxx +++ /dev/null @@ -1,190 +0,0 @@ -/* - * ApplicationHandler.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* ApplicationHandler member functions implementation. - */ - - -#include -#include - -#include -#include - - - - - -#include - -#include -#include - - -namespace SimGrid -{ - namespace Msg - { - - ApplicationHandler::ProcessFactory* ApplicationHandler::processFactory = NULL; - - // Desable the default constructor, the copy constructor , the assignement operator - // and the destructor of this class. Assume that this class is static. - - // Default constructor. - ApplicationHandler::ApplicationHandler() - { - // NOTHING TODO - } - - // Copy constructor. - ApplicationHandler::ApplicationHandler(const ApplicationHandler& rApplicationHandler) - { - // NOTHING TODO - } - - // Destructor - ApplicationHandler::~ApplicationHandler() - { - // NOTHING TODO - } - - // Assignement operator. - const ApplicationHandler& ApplicationHandler::operator = (const ApplicationHandler& rApplicationHandler) - { - return *this; - } - - void ApplicationHandler::onStartDocument(void) - { - // instanciate the factory at the begining of the parsing - processFactory = new ProcessFactory(); - } - - void ApplicationHandler::onEndDocument(void) - { - // release the handler at the end of the parsing. - if(processFactory) - delete processFactory; - } - - void ApplicationHandler::onBeginProcess(void) - { - // set the process identity at the begin of the xml process element. - processFactory->setProcessIdentity(A_surfxml_process_host, A_surfxml_process_function); - } - - void ApplicationHandler::onProcessArg(void) - { - // register the argument of the current xml process element. - processFactory->registerProcessArg(A_surfxml_argument_value); - } - - void ApplicationHandler::OnProperty(void) - { - // set the property of the current xml process element. - processFactory->setProperty(A_surfxml_prop_id, A_surfxml_prop_value); - } - - void ApplicationHandler::onEndProcess(void) - { - // at the end of the xml process element create the wrapper process (of the native Msg process) - processFactory->createProcess(); - } - - ///////////////////////////////////////////////////////////////////////////////////////////////// - // Process factory connected member functions - - ApplicationHandler::ProcessFactory::ProcessFactory() - { - this->args = xbt_dynar_new(sizeof(char*),ApplicationHandler::ProcessFactory::freeCstr); - this->properties = NULL; // TODO instanciate the dictionary - this->hostName = NULL; - this->function = NULL; - } - - ApplicationHandler::ProcessFactory::~ProcessFactory() - { - xbt_dynar_free(&(this->args)); - } - - // create the cxx process wrapper. - void ApplicationHandler::ProcessFactory::createProcess() - throw (ClassNotFoundException, HostNotFoundException) - { - Host host; - Class* c; - Process* process; - - // try to dynamicaly create an instance of the process from its name (which is specified by the element function - // in the xml application file. - // if this static method fails, it throws an exception of the class ClassNotFoundException - c = Class::fromName(this->function); - process = reinterpret_cast(c->createObject()); - - // try to retrieve the host of the process from its name - // if this method fails, it throws an exception of the class HostNotFoundException - host = Host::getByName(this->hostName); - - // build the list of the arguments of the newly created process. - int argc = xbt_dynar_length(this->args); - - char** argv = (char**)calloc(argc, sizeof(char*)); - - for(int i = argc -1; i >= 0; i--) - xbt_dynar_pop(this->args, &(argv[i])); - - // finaly create the process (for more detail on the process creation see Process::create() - process->create(host, this->function , argc, argv); - - // TODO add the properties of the process - /*process->properties = this->properties; - this->properties = new Properties();*/ - } - - void ApplicationHandler::ProcessFactory::setProcessIdentity(const char* hostName, const char* function) - { - this->hostName = hostName; - this->function = function; - - /*if (!this->args->empty()) - this->args->clear(); - - if(!this->properties->empty()) - this->properties->clear();*/ - } - - // callback function used by the dynamic array to cleanup all of its elements. - void ApplicationHandler::ProcessFactory::freeCstr(void* cstr) - { - free(*(void**)cstr); - } - - void ApplicationHandler::ProcessFactory::registerProcessArg(const char* arg) - { - char* cstr = _strdup(arg); - xbt_dynar_push(this->args, &cstr); - } - - void ApplicationHandler::ProcessFactory::setProperty(const char* id, const char* value) - { - // TODO implement this function; - } - - const char* ApplicationHandler::ProcessFactory::getHostName(void) - { - return this->hostName; - } - - } // namespace Msg -} // namespace SimGrid - diff --git a/src/cxx/MsgApplicationHandler.hpp b/src/cxx/MsgApplicationHandler.hpp deleted file mode 100644 index 46c7c8ad41..0000000000 --- a/src/cxx/MsgApplicationHandler.hpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * ApplicationHandler.hpp - * - * This file contains the declaration of the wrapper class of the native MSG task type. - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_APPLICATION_HANDLER_HPP -#define MSG_APPLICATION_HANDLER_HPP - -// Compilation C++ recquise -#ifndef __cplusplus - #error ApplicationHandler.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include -#include - -#include -#include - -namespace SimGrid -{ - namespace Msg - { - class Process; - - // Declaration of the class ApplicationHandler (Singleton). - class SIMGRIDX_EXPORT ApplicationHandler - { - //friend Process; - - public: - - class ProcessFactory - { - public: - - // the list of the argument of the process to create. - xbt_dynar_t args; - // the properties of the process to create - xbt_dict_t properties; - - private: - - // the current host name parsed - const char* hostName; - // the name of the class of the process - const char* function; - - public : - - // Default constructor. - ProcessFactory(); - - // Copy constructor. - ProcessFactory(const ProcessFactory& rProcessFactory); - - // Destructor. - virtual ~ProcessFactory(); - - // Set the identity of the current process. - void setProcessIdentity(const char* hostName, const char* function); - - // Register an argument of the current process. - void registerProcessArg(const char* arg); - - // Set the property of the current process. - void setProperty(const char* id, const char* value); - - // Return the host name of the current process. - const char* getHostName(void); - - // Create the current process. - void createProcess(void) - throw (ClassNotFoundException, HostNotFoundException); - - static void freeCstr(void* cstr); - - }; - - private : - - // Desable the default constructor, the copy constructor , the assignement operator - // and the destructor of this class. Assume that this class is static. - - // Default constructor. - ApplicationHandler(); - - // Copy constructor. - ApplicationHandler(const ApplicationHandler& rApplicationHandler); - - // Destructor - virtual ~ApplicationHandler(); - - // Assignement operator. - const ApplicationHandler& operator = (const ApplicationHandler& rApplicationHandler); - - // the process factory used by the application handler. - static ProcessFactory* processFactory; - - - public: - - // Handle the begining of the parsing of the xml file describing the application. - static void onStartDocument(void); - - // Handle at the end of the parsing. - static void onEndDocument(void); - - // Handle the begining of the parsing of a xml process element. - static void onBeginProcess(void); - - // Handle the parsing of an argument of the current xml process element. - static void onProcessArg(void); - - // Handle the parsing of a property of the currnet xml process element. - static void OnProperty(void); - - // Handle the end of the parsing of a xml process element - static void onEndProcess(void); - }; - - } // namespace Msg -} // namespace SimGrid - -#endif // !MSG_APPLICATION_HANDLER_HPP - diff --git a/src/cxx/MsgEnvironment.cxx b/src/cxx/MsgEnvironment.cxx deleted file mode 100644 index 6bdbe33da7..0000000000 --- a/src/cxx/MsgEnvironment.cxx +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Environment.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* Environment member functions implementation. - */ - -#include - -#include - -#include -#include - -#include - -#ifndef S_ISREG - #define S_ISREG(__mode) (((__mode) & S_IFMT) == S_IFREG) -#endif - -namespace SimGrid -{ - namespace Msg - { - Environment::Environment() - { - this->file = NULL; - this->loaded = false; - } - - Environment::Environment(const Environment& rEnvironment) - { - this->file = rEnvironment.getFile(); - this->loaded = rEnvironment.isLoaded(); - } - - Environment::Environment(const char* file) - throw(NullPointerException, FileNotFoundException) - { - // check parameters - - if(!file) - throw NullPointerException("file (must not be NULL"); - - struct stat statBuf = {0}; - - if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode)) - throw FileNotFoundException("file (file not found)"); - - this->file = file; - this->loaded = false; - } - - Environment::~Environment() - { - // NOTHING TODO - } - - // Operations. - - void Environment::load(void) - throw(LogicException) - { - // check logic - - if(this->loaded) - throw LogicException("environement already loaded"); - - // check the parameters - if(!this->file) - throw LogicException("you must specify the xml file which describe the environment to load\nuse Environment::setFile()"); - - MSG_create_environment(file); - - this->loaded = true; - } - - void Environment::load(const char* file) - throw(NullPointerException, FileNotFoundException, LogicException) - { - // check logic - - if(this->loaded) - throw LogicException("environment already loaded"); - - // check the parameters - - if(!file) - throw NullPointerException("file"); - - struct stat statBuf = {0}; - - if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode)) - throw FileNotFoundException(file); - - MSG_create_environment(file); - - this->file = file; - this->loaded = true; - } - - bool Environment::isLoaded(void) const - { - return this->loaded; - } - - // Getters/setters - void Environment::setFile(const char* file) - throw(NullPointerException, FileNotFoundException, LogicException) - { - // check logic - - if(this->loaded) - throw LogicException("your are trying to change the file of an already loaded environment"); - - // check parameters - - if(!file) - throw NullPointerException("file (must not be NULL"); - - struct stat statBuf = {0}; - - if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode)) - throw FileNotFoundException("file (file not found)"); - - this->file = file; - } - - const char* Environment::getFile(void) const - { - return this->file; - } - - - const Environment& Environment::operator = (const Environment& rEnvironment) - throw(LogicException) - { - // check logic - - if(this->loaded) - throw LogicException("environment already loaded"); - - this->file = rEnvironment.getFile(); - this->loaded = rEnvironment.isLoaded(); - - return *this; - } - - } // namespace Msg -} // namespace SimGrid - diff --git a/src/cxx/MsgEnvironment.hpp b/src/cxx/MsgEnvironment.hpp deleted file mode 100644 index 8f8e0a0e28..0000000000 --- a/src/cxx/MsgEnvironment.hpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Environment.hpp - * - * This file contains the declaration of the wrapper class of the native MSG task type. - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_ENVIRONMENT_HPP -#define MSG_ENVIRONMENT_HPP - -#ifndef __cplusplus - #error Environment.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include -#include -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - class NullPointerException; - class FileNotFoundException; - class InvalidArgumentException; - class LogicException; - class MsgException; - - // Environment class wrapper declaration - class SIMGRIDX_EXPORT Environment - { - public: - - /*! \brief Default constructor. - */ - Environment(); - - /*! \brief Copy constructor. - */ - Environment(const Environment& rEnvironment); - - /*! \brief Constructor. - * - * \param file The xml file describing the environment of the simulation. - * - * \exception If this constructor fails, it throws one of the exception - * described below: - * - * [NullPointerException] if the parameter file is NULL. - * - * [FileNotFoundException] if the file is not found. - */ - Environment(const char* file) - throw(NullPointerException, FileNotFoundException); - - /*! \brief Destructor. - */ - virtual ~Environment(); - - // Operations. - - /*! brief Environment::load() - Load the environment of a simulation. - * - * \exception If this method fails, it throws the exception described below: - * - * [LogicException] if the file of the environment is not yet specified or - * if the environment is already loaded. - */ - void load(void) - throw(LogicException); - - /*! \brief Environment::load() - Load the environment of a simulation. - * - * \param file The xml file describing the environment of the simulation. - * - * \exception If this method fails, it throws one of the exceptions described below. - * - * [NullPointerException] if the parameter file is NULL. - * - * [FileNotFoundException] if the specified file is not found. - * - * [LogicException] if the environment is already loaded. - */ - void load(const char* file) - throw(NullPointerException, FileNotFoundException, LogicException); - - /*! \brief Environment::isLoaded() - Tests if an environment is loaded. - * - * \return If the environment is loaded, the method returns true. Otherwise the method - * returns false. - */ - bool isLoaded(void) const; - - // Getters/setters - /*! \brief Environment::setFile() - Sets the xml file of the environment. - * - * \param file The file describing the environment. - * - * \exception If the method fails, it throws one of the exceptions described below: - * - * [NullPointerException] if the parameter file is NULL. - * - * [FileNotFoundException] if the file is not found. - * - * [LogicException] if the environment is already loaded. - */ - void setFile(const char* file) - throw(NullPointerException, FileNotFoundException, LogicException); - - /*! \brief Environment::getFile() - Gets the xml file environment description. - * - * \return The xml file describing the environment. - * - */ - const char* getFile(void) const; - - // Operators. - - /*! \brief Assignment operator. - * - * \exception If this operator fails, it throws the exception described below: - * - * [LogicException] if you try to assign a loaded environment. - */ - const Environment& operator = (const Environment& rEnvironment) - throw(LogicException); - - private: - - // Attributes. - - // the xml file which describe the environment of the simulation. - const char* file; - - // flag : is true the environment of the simulation is loaded. - bool loaded; - }; - - } // namespace Msg -} // namespace SimGrid - - -#endif // !MSG_ENVIRONMENT_HPP - diff --git a/src/cxx/MsgException.cxx b/src/cxx/MsgException.cxx deleted file mode 100644 index 25c1ab2644..0000000000 --- a/src/cxx/MsgException.cxx +++ /dev/null @@ -1,74 +0,0 @@ -/* - * MsgException.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* MsgException member functions implementation. - */ - -#include - -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - - MsgException::MsgException() - { - this->reason = (char*) calloc(strlen("Internal exception : unknown reason") + 1, sizeof(char)); - strcpy(this->reason, "Internal exception : unknown reason"); - } - - - MsgException::MsgException(const MsgException& rMsgException) - { - const char* reason = rMsgException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - MsgException::MsgException(const char* reason) - { - this->reason = (char*) calloc(strlen("Internal exception : ") + strlen(reason) + 1, sizeof(char)); - sprintf(this->reason, "Invalid exception : %s", reason); - } - - - MsgException::~MsgException() - { - if(this->reason) - free(this->reason); - } - - const char* MsgException::toString(void) const - { - return (const char*)(this->reason); - } - - - const MsgException& MsgException::operator = (const MsgException& rMsgException) - { - const char* reason = rMsgException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/MsgException.hpp b/src/cxx/MsgException.hpp deleted file mode 100644 index b39fc12dd5..0000000000 --- a/src/cxx/MsgException.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * MsgException.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_MSGEXCEPTION_HPP -#define MSG_MSGEXCEPTION_HPP - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT MsgException : public Exception - { - public: - - // Default constructor. - MsgException(); - - // Copy constructor. - MsgException(const MsgException& rMsgException); - - // This constructor takes the reason of the exception. - MsgException(const char* reason); - - // Destructor. - virtual ~MsgException(); - - // Operations. - - // Returns the reason of the exception : - // the message "Internal exception `reason'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const MsgException& operator = (const MsgException& rMsgException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_MSGEXCEPTION_HPP - diff --git a/src/cxx/MsgHost.cxx b/src/cxx/MsgHost.cxx deleted file mode 100644 index e11e124ceb..0000000000 --- a/src/cxx/MsgHost.cxx +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Host.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* Host class member functions implementation. - */ - -#include -#include - -#include - -#include -#include - -#include -#include - -#include - -namespace SimGrid -{ - namespace Msg - { - Host::Host() - { - nativeHost = NULL; - data = NULL; - } - - Host::Host(const Host& rHost) - { - this->nativeHost = rHost.nativeHost; - this->data = rHost.getData(); - } - - Host::~Host() - { - // NOTHING TODO - } - - - Host& Host::getByName(const char* hostName) - throw(HostNotFoundException, NullPointerException, BadAllocException) - { - // check the parameters - if(!hostName) - throw NullPointerException("hostName"); - - m_host_t nativeHost = NULL; // native host. - Host* host = NULL; // wrapper host. - - if(!(nativeHost = MSG_get_host_by_name(hostName))) - throw HostNotFoundException(hostName); - - if(!nativeHost->data) - { // native host not associated yet with its wrapper - - // instanciate a new wrapper - if(!(host = new Host())) - throw BadAllocException(hostName); - - host->nativeHost = nativeHost; - - // the native host data field is set with its wrapper returned - nativeHost->data = (void*)host; - } - - // return the reference to cxx wrapper - return *((Host*)nativeHost->data); - } - - int Host::getNumber(void) - { - return MSG_get_host_number(); - } - - Host& Host::currentHost(void) - { - Host* host = NULL; - m_host_t nativeHost = MSG_host_self(); - - if(!nativeHost->data) - { - // the native host not yet associated with its wrapper - - // instanciate a new wrapper - host = new Host(); - - host->nativeHost = nativeHost; - - nativeHost->data = (void*)host; - } - else - { - host = (Host*)nativeHost->data; - } - - return *host; - } - - void Host::all(Host*** hosts, int* len) - throw(InvalidArgumentException, BadAllocException) - { - // check the parameters - if(!hosts) - throw InvalidArgumentException("hosts"); - - if(len < 0) - throw InvalidArgumentException("len parameter must be positive"); - - int count = xbt_fifo_size(msg_global->host); - - if(*len < count) - throw InvalidArgumentException("len parameter must be more than the number of installed host\n (use Host::getNumber() to get the number of hosts)"); - - int index; - m_host_t nativeHost; - Host* host; - - m_host_t* table = (m_host_t *)xbt_fifo_to_array(msg_global->host); - - for(index = 0; index < count; index++) - { - nativeHost = table[index]; - host = (Host*)(nativeHost->data); - - if(!host) - { - if(!(host = new Host())) - { - // release all allocated memory. - for(int i = 0; i < index; i++) - delete (*(hosts)[i]); - - throw BadAllocException("to fill the table of the hosts installed on your platform"); - } - - host->nativeHost = nativeHost; - nativeHost->data = (void*)host; - } - - (*hosts)[index] = host; - } - - *len = count; - } - - const char* Host::getName(void) const - { - return nativeHost->name; - } - - void Host::setData(void* data) - { - this->data = data; - } - - void* Host::getData(void) const - { - return this->data; - } - - int Host::getRunningTaskNumber(void) const - { - return MSG_get_host_msgload(nativeHost); - } - - double Host::getSpeed(void) const - { - return MSG_get_host_speed(nativeHost); - } - - bool Host::hasData(void) const - { - return (NULL != this->data); - } - - int Host::isAvailable(void) const - { - return SIMIX_host_get_state(nativeHost->simdata->smx_host); - } - - void Host::put(int channel, Task* task) - throw(MsgException, InvalidArgumentException) - { - // checks the parameters - if(channel < 0) - throw InvalidArgumentException("channel (must be more or equal to zero)"); - - if(MSG_OK != MSG_task_put_with_timeout(task->nativeTask, nativeHost, channel , -1.0)) - throw MsgException("MSG_task_put_with_timeout() failed"); - } - - void Host::put(int channel, Task* task, double timeout) - throw(MsgException, InvalidArgumentException) - { - // checks the parameters - if(channel < 0) - throw InvalidArgumentException("channel (must be more or equal to zero)"); - - if(timeout < 0.0 && timeout != -1.0) - throw InvalidArgumentException("timeout (must be more or equal to zero or equal to -1.0)"); - - - if(MSG_OK != MSG_task_put_with_timeout(task->nativeTask, nativeHost, channel , timeout)) - throw MsgException("MSG_task_put_with_timeout() failed"); - } - - void Host::putBounded(int channel, Task* task, double maxRate) - throw(MsgException, InvalidArgumentException) - { - // checks the parameters - if(channel < 0) - throw InvalidArgumentException("channel (must be more or equal to zero)"); - - if(maxRate < 0.0 && maxRate != -1.0) - throw InvalidArgumentException("maxRate (must be more or equal to zero or equal to -1.0)"); - - if(MSG_OK != MSG_task_put_bounded(task->nativeTask, nativeHost, channel, maxRate)) - throw MsgException("MSG_task_put_bounded() failed"); - } - - void Host::send(Task* task) - throw(MsgException, BadAllocException) - { - MSG_error_t rv; - - char* alias = (char*)calloc(strlen(this->getName())+ strlen(Process::currentProcess().getName()) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", this->getName(),Process::currentProcess().getName()); - - rv = MSG_task_send_with_timeout(task->nativeTask, alias, -1.0); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_send_with_timeout() failed"); - } - - void Host::send(const char* alias, Task* task) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - if(!alias) - throw InvalidArgumentException("alias (must not be NULL)"); - - if(MSG_OK != MSG_task_send_with_timeout(task->nativeTask, alias, -1.0)) - throw MsgException("MSG_task_send_with_timeout() failed"); - } - - void Host::send(Task* task, double timeout) - throw(InvalidArgumentException, BadAllocException, MsgException) - { - // check the parameters - if(timeout < 0 && timeout != -1.0) - throw InvalidArgumentException("timeout (must be positive or equal to zero or equal to -1.0)"); - - MSG_error_t rv; - - char* alias = (char*)calloc(strlen(this->getName()) + strlen(Process::currentProcess().getName()) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", this->getName(),Process::currentProcess().getName()); - - - rv = MSG_task_send_with_timeout(task->nativeTask, alias, timeout); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_send_with_timeout() failed"); - } - - void Host::send(const char* alias, Task* task, double timeout) - throw(InvalidArgumentException, MsgException) - { - // check the parameter - - if(!alias) - throw InvalidArgumentException("alias (must not be NULL)"); - - if(timeout < 0 && timeout != -1.0) - throw InvalidArgumentException("timeout (must be positive or equal to zero or equal to -1.0)"); - - if(MSG_OK != MSG_task_send_with_timeout(task->nativeTask, alias, timeout)) - throw MsgException("MSG_task_send_with_timeout() failed"); - } - - - void Host::sendBounded(Task* task, double maxRate) - throw(InvalidArgumentException, BadAllocException, MsgException) - { - if(maxRate < 0 && maxRate != -1.0) - throw InvalidArgumentException("maxRate (must be positive or equal to zero or equal to -1.0)"); - - MSG_error_t rv; - - char* alias = (char*)calloc(strlen(this->getName()) + strlen(Process::currentProcess().getName()) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", this->getName(),Process::currentProcess().getName()); - - rv = MSG_task_send_bounded(task->nativeTask, alias, maxRate); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_send_bounded() failed"); - } - - void Host::sendBounded(const char* alias, Task* task, double maxRate) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - if(!alias) - throw InvalidArgumentException("alias (must not be NULL)"); - - if(maxRate < 0 && maxRate != -1) - throw InvalidArgumentException("maxRate (must be positive or equal to zero or equal to -1.0)"); - - if(MSG_OK != MSG_task_send_bounded(task->nativeTask, alias, maxRate)) - throw MsgException("MSG_task_send_bounded() failed"); - - } - } // namspace Msg -} // namespace SimGrid - diff --git a/src/cxx/MsgHost.hpp b/src/cxx/MsgHost.hpp deleted file mode 100644 index c012513828..0000000000 --- a/src/cxx/MsgHost.hpp +++ /dev/null @@ -1,440 +0,0 @@ -/* - * Host.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ -#ifndef MSG_HOST_HPP -#define MSG_HOST_HPP - - -/*! \brief Host class declaration. - * - * An host instance represents a location (any possible place) where a process may run. - * Thus it is represented as a physical resource with computing capabilities, some - * mailboxes to enable running process to communicate with remote ones, and some private - * data that can be only accessed by local process. An instance of this class is always - * binded with the corresponding native host. All the native hosts are automaticaly created - * during the call of the static method Msg::createEnvironment(). This method takes as parameter - * the platform file which describes all elements of the platform (host, link, root..). - * You never need to create an host your self. - * - * The best way to get an host is to call the static method - * Host.getByName() which returns a reference. - * - * For example to get the instance of the host. If your platform - * file description contains an host named "Jacquelin" : - * - * \verbatim -using namespace SimGrid.Msg; - -Host jacquelin; - -try -{ - jacquelin = Host::getByName("Jacquelin"); -} -catch(HostNotFoundException e) -{ - cerr << e.toString(); -} -... -\endverbatim - * - */ - -#ifndef __cplusplus - #error Host.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -#include -#include -#include -#include -#include - - - -// namespace SimGrid::Msg -namespace SimGrid -{ - namespace Msg - { - class Task; - class Process; - - // Declaration of the class SimGrid::Msg::Host. - class SIMGRIDX_EXPORT Host // final class. - { - friend class Process; - friend class Task; - - // Desable the default constructor. - // The best way to get an host instance is to use the static method Host::getByName(). - - public : - - // Default constructor (desabled). - Host(); - - public: - - // Copy constructor (desabled). - Host(const Host& rHost); - - // Destructor (desable). - virtual ~Host(); - - // Operations - - /*! \brief Host::getByName() - returns an host by its name - * - * This static method returns a reference to the host instance associated - * with a native host of your platform. This is the best way to get a host. - * - * \param hostName The name of the host. - * - * \return If successful the method returns a reference to the instance - * associated with the native host having the name specified - * as parameter of your platform. Otherwise the method throws - * one of the exceptions detailed below. - * - * \exception [HostNotFoundException] if no host with the specified name - * was found. - * [InvalidArgumentException] if the hostName parameter is invalid (NULL). - * [BadAllocException] if there is not enough memory to allocate the host. - */ - static Host& getByName(const char* hostName) - throw(HostNotFoundException, NullPointerException, BadAllocException); - - /*! \brief Host::getNumber() - returns the number of the installed hosts. - * - * \return The number of hosts installed. - */ - static int getNumber(void); - - - /*! \brief Host::currentHost() - This static method returns the location on which the current - * process is executed. - * - * \return The host of the current process. - * - * \see Process::currentProcess(). - */ - static Host& currentHost(void); - - /*! \brief Host::all() - This static method retrieves all of the hosts of the installed platform. - * - * \param hosts A pointer to array of Host pointers that receives all the hosts of the platform. - * - * \param len A pointer to the length of the table of pointers. - * - * \return If successful the hosts table is filled and - * the parameter len is set with the number of hosts of the platform. - * Otherwise the method throw one of the exception described below. - * - * \exception [InvalidArgumentException] if the parameter hosts is invalid or - * if the parameter len is negative or - * less than the number of hosts installed - * on the current platform. - * [BadAllocException] If the method can't allocate memory to fill - * the table of hosts. - * - * - * \remark To get the number of hosts installed on your platform use the static method - * Host::getNumber(). - * - * \see Host::getNumber(). - * - *\verbatim - * // This example show how to use this method to get the list of hosts installed on your platform. - * - * using namespace SimGrid::Msg; - * using - * - * // (1) get the number of hosts. - * int number = Host::getNumber(); - * - * // (2) allocate the array that receives the list of hosts. - * HostPtr* ar = new HostPtr[number]; // HostPtr is defined as (typedef Host* HostPtr at the end of the - * // declaration of this class. - * - * // (3) call the method - * try - * { - * Host::all(&ar, &number); - * } - * catch(BadAllocException e) - * { - * cerr << e.toString() << endl; - * ... - * } - * catch(InvalidArgumentException e) - * { - * cerr << e.toString() << endl; - * .. - * } - * - * // (4) use the table of host (for example print all the name of all the hosts); - * - * for(int i = 0; i < number ; i++) - * cout << ar[i]->getName() << endl; - * - * ... - * - * // (5) release the allocate table - * - * delete[] ar; - * - */ - static void all(Host*** hosts /*in|out*/, int* len /*in|out*/) - throw(InvalidArgumentException, BadAllocException) ; - - /*! \brief Host::getName() - This method return the name of the Msg host object. - * - * \return The name of the host object. - */ - const char* getName(void) const; - - /*! \brief Host::setData() - Set the user data of an host object. - * - * \param data The user data to set. - */ - void setData(void* data); - - /*! \brief Host::getData() - Get the user data of a host object. - * - * \return The user data of the host object. - */ - void* getData(void) const; - - /*! \brief Host::hasData() - Test if an host object has some data. - * - * \return This method returns true if the host object has some user data. - * Otherwise the method returns false. - */ - bool hasData(void) const; - - /*! \brief Host::getRunningTaskNumber() - returns the number of tasks currently running on a host. - * - * \return The number of task currently running of the host object. - * - * \remark The external load is not taken in account. - */ - int getRunningTaskNumber(void) const; - - /*! \brief Host::getSpeed() - returns the speed of the processor of a host, - * regardless of the current load of the machine. - * - * \return The speed of the processor of the host in flops. - */ - double getSpeed(void) const; - - /*! \brief Host::isAvailable - tests if an host is availabled. - * - * \return Is the host is availabled the method returns - * 1. Otherwise the method returns 0. - */ - int isAvailable(void) const; - - /* ! \brief Host::put() - put a task on the given channel of a host . - * - * \param channel The channel where to put the task. - * \param rTask A refercence to the task object containing the native task to - * put on the channel specified by the parameter channel. - * - * \return If successful the task is puted on the specified channel. Otherwise - * the method throws one of the exceptions described below. - * - * \exception [MsgException] if an internal error occurs. - * [InvalidArgumentException] if the value of the channel specified as - * parameter is negative. - */ - void put(int channel, Task* task) - throw(MsgException, InvalidArgumentException); - - /* ! \brief Host::put() - put a task on the given channel of a host object (waiting at most timeout seconds). - * - * \param channel The channel where to put the task. - * \param rTask A refercence to the task object containing the native task to - * put on the channel specified by the parameter channel. - * \param timeout The timeout in seconds. - * - * \return If successful the task is puted on the specified channel. Otherwise - * the method throws one of the exceptions described below. - * - * \exception [MsgException] if an internal error occurs. - * [InvalidArgumentException] if the value of the channel specified as - * parameter is negative or if the timeout value - * is less than zero and différent of -1. - * - * \remark To specify no timeout set the timeout value with -1.0. - */ - void put(int channel, Task* task, double timeout) - throw(MsgException, InvalidArgumentException); - - /* ! \brief Host::putBounded() - put a task on the given channel of a host object (capping the emission rate to maxrate). - * - * \param channel The channel where to put the task. - * \param rTask A refercence to the task object containing the native task to - * put on the channel specified by the parameter channel. - * \param maxRate The maximum rate. - * - * \return If successful the task is puted on the specified channel. Otherwise - * the method throws one of the exceptions described below. - * - * \exception [MsgException] if an internal error occurs. - * [InvalidArgumentException] if the value of the channel specified as - * parameter is negative or if the maxRate parameter value - * is less than zero and différent of -1.0. - * - * \remark To specify no rate set the maxRate parameter value with -1.0. - */ - void putBounded(int channel, Task* task, double maxRate) - throw(MsgException, InvalidArgumentException); - - /* ! brief Host::send() - sends the given task to mailbox identified by the default alias. - * - * \param rTask A reference to the task object containing the native msg task to send. - * - * \return If successful the task is sended to the default mailbox. Otherwise the - * method throws one of the exceptions described below. - * - * \exception [BadAllocException] if there is not enough memory to allocate - * the default alias variable. - * [MsgException] if an internal error occurs. - */ - void send(Task* task) - throw(MsgException, BadAllocException); - - /* ! brief Host::send() - sends the given task to mailbox identified by the specified alias parameter. - * - * \param rTask A reference to the task object containing the native msg task to send. - * \param alias The alias of the mailbox where to send the task. - * - * \return If successful the task is sended to the default mailbox. Otherwise the - * method throws one of the exceptions described below. - * - * \exception [InvalidArgumentException] if alias parameter is invalid (NULL). - * [BadAllocException] if there is not enough memory to allocate - * the default alias variable. - * [MsgException] if an internal error occurs. - */ - void send(const char* alias, Task* task) - throw(InvalidArgumentException, MsgException); - - /* ! brief Host::send() - sends the given task to mailbox identified by the default alias - * (waiting at most timeout seconds). - * - * \param rTask A reference to the task object containing the native msg task to send. - * \param timeout The timeout value to wait for. - * - * \return If successful the task is sended to the default mailbox. Otherwise the - * method throws one of the exceptions described below. - * - * \exception [BadAllocException] if there is not enough memory to allocate - * the default alias variable. - * [InvalidArgumentException] if the timeout value is negative and different of - * -1.0. - * [MsgException] if an internal error occurs. - * - * \remark To specify no timeout set the timeout value with -1.0 or use the previous - * version of this method. - * - */ - void send(Task* task, double timeout) - throw(InvalidArgumentException, BadAllocException, MsgException); - - /* ! brief Host::send() - sends the given task to mailbox identified by the parameter alias - * (waiting at most timeout seconds). - * - * \param alias The alias of the mailbox to send the task. - * \param rTask A reference to the task object containing the native msg task to send. - * \param timeout The timeout value to wait for. - * - * \return If successful the task is sended to the default mailbox. Otherwise the - * method throws one of the exceptions described below. - * - * \exception [InvalidArgumentException] if the timeout value is negative and different of - * -1.0 or if the alias parameter is invalid (NULL). - * [MsgException] if an internal error occurs. - * - * \remark To specify no timeout set the timeout value with -1.0 or use the previous - * version of this method. - * - */ - void send(const char* alias, Task* task, double timeout) - throw(InvalidArgumentException, MsgException); - - /* ! brief Host::sendBounded() - sends the given task to mailbox associated to the default alias - * (capping the emission rate to maxRate). - * - * \param rTask A reference to the task object containing the native msg task to send. - * \param maxRate The maximum rate value. - * - * \return If successful the task is sended to the default mailbox. Otherwise the - * method throws one of the exceptions described below. - * - * \exception [InvalidArgumentException] if the maximum rate value is negative and different of - * -1.0. - * [MsgException] if an internal error occurs. - * [BadAllocException] if there is not enough memory to allocate - * the default alias variable. - * - * \remark To specify no rate set its value with -1.0. - * - */ - void sendBounded(Task* task, double maxRate) - throw(InvalidArgumentException, BadAllocException, MsgException); - - /* ! brief Host::sendBounded() - sends the given task to mailbox identified by the parameter alias - * (capping the emission rate to maxRate). - * - * \param alias The alias of the mailbox where to send the task. - * \param rTask A reference to the task object containing the native msg task to send. - * \param maxRate The maximum rate value. - * - * \return If successful the task is sended to the default mailbox. Otherwise the - * method throws one of the exceptions described below. - * - * \exception [InvalidArgumentException] if the maximum rate value is negative and different of - * -1.0 or if the alias parameter is invalid (NULL). - * [MsgException] if an internal error occurs. - * - * \remark To specify no rate set its value with -1.0. - * - */ - void sendBounded(const char* alias, Task* task, double maxRate) - throw(InvalidArgumentException, MsgException); - - protected: - // Attributes. - - /** - * This attribute represents the msg native host object. - * It is set automaticatly during the call of the static - * method Host::getByName(). - * - * \see Host::getByName(). - */ - m_host_t nativeHost; - - private: - /** - * User host data. - */ - void* data; - }; - - typedef Host* HostPtr; - } // namespace Msg -} // namespace SimGrid - -#endif // !MSG_HOST_HPP diff --git a/src/cxx/MsgProcess.cxx b/src/cxx/MsgProcess.cxx deleted file mode 100644 index d6b450473c..0000000000 --- a/src/cxx/MsgProcess.cxx +++ /dev/null @@ -1,677 +0,0 @@ -/* - * Process.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* Process member functions implementation. - */ - -#include - - -#include -#include -#include - -#include -#include - -#include -#include -#include - - - -namespace SimGrid -{ - namespace Msg - { - - MSG_IMPLEMENT_DYNAMIC(Process, Object) - - // Default constructor. - Process::Process() - { - this->nativeProcess = NULL; - } - - Process::Process(const char* hostName, const char* name) - throw(NullPointerException, HostNotFoundException, BadAllocException) - { - // check the parameters - - if(!name) - throw NullPointerException("name"); - - if(!hostName) - throw NullPointerException("hostName"); - - Host host = Host::getByName(hostName); - - create(host, name, 0, NULL); - } - - Process::Process(const Host& rHost, const char* name) - throw(NullPointerException) - { - if(!name) - throw NullPointerException("name"); - - create(rHost, name, 0, NULL); - } - - Process::Process(const Host& rHost, const char* name, int argc, char** argv) - throw(NullPointerException, InvalidArgumentException, LogicException) - { - - // check the parameters - - if(!name) - throw NullPointerException("name"); - - if(argc < 0) - throw InvalidArgumentException("argc (must be positive)"); - - if(!argc && argv) - throw LogicException("argv is not NULL but argc is zero"); - - if(argc && !argv) - throw LogicException("argv is NULL but argc is not zero"); - - create(rHost, name, argc, argv); - } - - Process::Process(const char* hostName, const char* name, int argc, char** argv) - throw(NullPointerException, InvalidArgumentException, LogicException, HostNotFoundException, BadAllocException) - { - // check the parameters - - if(!name) - throw NullPointerException("name"); - - if(!hostName) - throw NullPointerException("hostName"); - - if(argc < 0) - throw InvalidArgumentException("argc (must be positive)"); - - if(!argc && argv) - throw LogicException("argv is not NULL but argc is zero"); - - if(argc && !argv) - throw LogicException("argv is NULL but argc is not zero"); - - Host host = Host::getByName(hostName); - - create(host, name, argc, argv); - } - - int Process::killAll(int resetPID) - { - return MSG_process_killall(resetPID); - } - - void Process::suspend(void) - throw(MsgException) - { - if(MSG_OK != MSG_process_suspend(nativeProcess)) - throw MsgException("MSG_process_suspend() failed"); - } - - void Process::resume(void) - throw(MsgException) - { - if(MSG_OK != MSG_process_resume(nativeProcess)) - throw MsgException("MSG_process_resume() failed"); - } - - int Process::isSuspended(void) - { - return MSG_process_is_suspended(nativeProcess); - } - - Host& Process::getHost(void) - { - m_host_t nativeHost = MSG_process_get_host(nativeProcess); - - // return the reference to the Host object - return (*((Host*)nativeHost->data)); - } - - Process& Process::fromPID(int PID) - throw(ProcessNotFoundException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(PID < 1) - throw InvalidArgumentException("PID (the PID of the process to retrieve is less than 1)"); - - Process* process = NULL; - m_process_t nativeProcess = MSG_process_from_PID(PID); - - if(!nativeProcess) - throw ProcessNotFoundException(PID); - - process = Process::fromNativeProcess(nativeProcess); - - if(!process) - throw MsgException("Process::fromNativeProcess() failed"); - - return (*process); - } - - int Process::getPID(void) - { - return MSG_process_get_PID(nativeProcess); - } - - int Process::getPPID(void) - { - return MSG_process_get_PPID(nativeProcess); - } - - const char* Process::getName(void) const - { - return nativeProcess->name; - } - - Process& Process::currentProcess(void) - throw(MsgException) - { - Process* currentProcess = NULL; - m_process_t currentNativeProcess = MSG_process_self(); - - - if(!currentNativeProcess) - throw MsgException("MSG_process_self() failed"); - - currentProcess = Process::fromNativeProcess(currentNativeProcess); - - if(!currentProcess) - throw MsgException("Process::fromNativeProcess() failed"); - - return (*currentProcess); - } - - int Process::currentProcessPID(void) - { - return MSG_process_self_PID(); - } - - - int Process::currentProcessPPID(void) - { - return MSG_process_self_PPID(); - } - - void Process::migrate(const Host& rHost) - throw(MsgException) - { - if(MSG_OK != MSG_process_change_host(rHost.nativeHost)) - throw MsgException("MSG_process_change_host()"); - - } - - void Process::sleep(double seconds) - throw(InvalidArgumentException, MsgException) - { - // check the parameters. - if(seconds <= 0) - throw InvalidArgumentException("seconds (must not be less or equals to zero"); - - if(MSG_OK != MSG_process_sleep(seconds)) - throw MsgException("MSG_process_sleep()"); - - } - - void Process::putTask(const Host& rHost, int channel, Task* task) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - if(MSG_OK != MSG_task_put_with_timeout(task->nativeTask, rHost.nativeHost, channel, -1.0)) - throw MsgException("MSG_task_put_with_timeout()"); - } - - void Process::putTask(const Host& rHost, int channel, Task* task, double timeout) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - if(timeout < 0 && timeout != -1.0) - throw InvalidArgumentException("timeout (must not be less than zero and different of -1.0)"); - - if(MSG_OK != MSG_task_put_with_timeout(task->nativeTask, rHost.nativeHost, channel, timeout)) - throw MsgException("MSG_task_put_with_timeout() failed"); - } - - Task* Process::getTask(int channel) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - m_task_t nativeTask = NULL; - - if (MSG_OK != MSG_task_get_ext(&nativeTask, channel, -1.0, NULL)) - throw MsgException("MSG_task_get_ext() failed"); - - return (Task*)(nativeTask->data); - } - - Task* Process::getTask(int channel, double timeout) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - if(timeout < 0 && timeout != -1.0) - throw InvalidArgumentException("timeout (must not be less than zero and different of -1.0)"); - - m_task_t nativeTask = NULL; - - if (MSG_OK != MSG_task_get_ext(&nativeTask, channel, timeout, NULL)) - throw MsgException("MSG_task_get_ext() failed"); - - return (Task*)(nativeTask->data); - } - - Task* Process::getTask(int channel, const Host& rHost) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - m_task_t nativeTask = NULL; - - if (MSG_OK != MSG_task_get_ext(&nativeTask, channel, -1.0, rHost.nativeHost)) - throw MsgException("MSG_task_get_ext() failed"); - - return (Task*)(nativeTask->data); - } - - Task* Process::getTask(int channel, double timeout, const Host& rHost) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - if(timeout < 0 && timeout != -1.0) - throw InvalidArgumentException("timeout (must not be less than zero and different of -1.0)"); - - m_task_t nativeTask = NULL; - - if (MSG_OK != MSG_task_get_ext(&nativeTask, channel, timeout, rHost.nativeHost)) - throw MsgException("MSG_task_get_ext() failed"); - - return (Task*)(nativeTask->data); - } - - void Process::sendTask(const char* alias, Task* task, double timeout) - throw(NullPointerException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - if(timeout < 0 && timeout !=-1.0) - throw InvalidArgumentException("timeout (the timeout value must not be negative and different than -1.0)"); - - if(MSG_OK != MSG_task_send_with_timeout(task->nativeTask, alias ,timeout)) - throw MsgException("MSG_task_send_with_timeout()"); - - } - - void Process::sendTask(const char* alias, Task* task) - throw(NullPointerException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - if(MSG_OK != MSG_task_send_with_timeout(task->nativeTask, alias ,-1.0)) - throw MsgException("MSG_task_send_with_timeout()"); - } - - void Process::sendTask(Task* task) - throw(BadAllocException, MsgException) - { - char* alias = (char*)calloc( strlen(this->getHost().getName()) + strlen(nativeProcess->name) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName() ,nativeProcess->name); - - MSG_error_t rv = MSG_task_send_with_timeout(task->nativeTask, alias ,-1.0); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_send_with_timeout()"); - } - - void Process::sendTask(Task* task, double timeout) - throw(BadAllocException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(timeout < 0 && timeout !=-1.0) - throw InvalidArgumentException("timeout (the timeout value must not be negative and different than -1.0)"); - - char* alias = (char*)calloc( strlen(this->getHost().getName()) + strlen(nativeProcess->name) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName() ,nativeProcess->name); - - MSG_error_t rv = MSG_task_send_with_timeout(task->nativeTask, alias ,timeout); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_send_with_timeout()"); - } - - Task* Process::receiveTask(const char* alias) - throw(NullPointerException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException(alias); - - m_task_t nativeTask = NULL; - - if (MSG_OK != MSG_task_receive_ext(&nativeTask,alias, -1.0, NULL)) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - - Task* Process::receiveTask(void) - throw(BadAllocException, MsgException) - { - - char* alias = (char*)calloc( strlen(this->getHost().getName()) + strlen(nativeProcess->name) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName() ,nativeProcess->name); - - m_task_t nativeTask = NULL; - - MSG_error_t rv = MSG_task_receive_ext(&nativeTask, alias, -1.0, NULL); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - - Task* Process::receiveTask(const char* alias, double timeout) - throw(NullPointerException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - if(timeout < 0 && timeout !=-1.0) - throw InvalidArgumentException("timeout (the timeout value must not be negative and different than -1.0)"); - - m_task_t nativeTask = NULL; - - if(MSG_OK != MSG_task_receive_ext(&nativeTask, alias, timeout, NULL)) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - - Task* Process::receiveTask(double timeout) - throw(InvalidArgumentException, BadAllocException, MsgException) - { - // check the parameters - - if(timeout < 0 && timeout !=-1.0) - throw InvalidArgumentException("timeout (the timeout value must not be negative and different than -1.0)"); - - - char* alias = (char*)calloc( strlen(this->getHost().getName()) + strlen(nativeProcess->name) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName() ,nativeProcess->name); - - m_task_t nativeTask = NULL; - - MSG_error_t rv = MSG_task_receive_ext(&nativeTask, alias, timeout, NULL); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - - Task* Process::receiveTask(const char* alias, double timeout, const Host& rHost) - throw(NullPointerException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - if(timeout < 0 && timeout !=-1.0) - throw InvalidArgumentException("timeout (the timeout value must not be negative and different than -1.0)"); - - m_task_t nativeTask = NULL; - - if(MSG_OK != MSG_task_receive_ext(&nativeTask, alias, timeout, rHost.nativeHost)) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - - Task* Process::receiveTask(double timeout, const Host& rHost) - throw(BadAllocException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(timeout < 0 && timeout !=-1.0) - throw InvalidArgumentException("timeout (the timeout value must not be negative and different than -1.0)"); - - char* alias = (char*)calloc( strlen(this->getHost().getName()) + strlen(nativeProcess->name) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName() ,nativeProcess->name); - - m_task_t nativeTask = NULL; - - MSG_error_t rv = MSG_task_receive_ext(&nativeTask, alias, timeout, rHost.nativeHost); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - - Task* Process::receiveTask(const char* alias, const Host& rHost) - throw(NullPointerException, MsgException) - { - - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - m_task_t nativeTask = NULL; - - if(MSG_OK != MSG_task_receive_ext(&nativeTask, alias, -1.0, rHost.nativeHost)) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - Task* Process::receiveTask(const Host& rHost) - throw(BadAllocException, MsgException) - { - char* alias = (char*)calloc( strlen(this->getHost().getName()) + strlen(nativeProcess->name) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName() ,nativeProcess->name); - - m_task_t nativeTask = NULL; - - MSG_error_t rv = MSG_task_receive_ext(&nativeTask, alias, -1.0, rHost.nativeHost); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - void Process::create(const Host& rHost, const char* name, int argc, char** argv) - throw(InvalidArgumentException) - { - char alias[MAX_ALIAS_NAME + 1] = {0}; - msg_mailbox_t mailbox; - - - // try to retrieve the host where to create the process from its name - m_host_t nativeHost = rHost.nativeHost; - - if(!nativeHost) - throw InvalidArgumentException("rHost"); - - /* allocate the data of the simulation */ - this->nativeProcess = xbt_new0(s_m_process_t,1); - this->nativeProcess->simdata = xbt_new0(s_simdata_process_t,1); - this->nativeProcess->name = _strdup(name); - this->nativeProcess->simdata->m_host = nativeHost; - this->nativeProcess->simdata->PID = msg_global->PID++; - - // realloc the list of the arguments to add the pointer to this process instance at the end - if(argc) - { - argv = (char**)realloc(argv , (argc + 2) * sizeof(char*)); - } - else - { - argv = (char**)calloc(2 ,sizeof(char*)); - } - - // add the pointer to this instance at the end of the list of the arguments of the process - // so the static method Process::run() (passed as argument of the MSG function xbt_context_new()) - // can retrieve the concerned process object by the run - // so Process::run() can call the method main() of the good process - // for more detail see Process::run() method - argv[argc] = NULL; - argv[argc + 1] = (char*)this; - - this->nativeProcess->simdata->argc = argc; - this->nativeProcess->simdata->argv = argv; - - this->nativeProcess->simdata->s_process = SIMIX_process_create( - this->nativeProcess->name, - Process::run, - (void*)this->nativeProcess, - nativeHost->name, - argc, - argv, - NULL); - - if (SIMIX_process_self()) - {/* someone created me */ - this->nativeProcess->simdata->PPID = MSG_process_get_PID((m_process_t)SIMIX_process_self()->data); - } - else - { - this->nativeProcess->simdata->PPID = -1; - } - - this->nativeProcess->simdata->last_errno = MSG_OK; - - /* add the process to the list of the processes of the simulation */ - xbt_fifo_unshift(msg_global->process_list, this->nativeProcess); - - sprintf(alias,"%s:%s",(this->nativeProcess->simdata->m_host->simdata->smx_host)->name,this->nativeProcess->name); - - mailbox = MSG_mailbox_new(alias); - - MSG_mailbox_set_hostname(mailbox, this->nativeProcess->simdata->m_host->simdata->smx_host->name); - } - - Process* Process::fromNativeProcess(m_process_t nativeProcess) - { - return ((Process*)(nativeProcess->simdata->argv[nativeProcess->simdata->argc + 1])); - - } - - int Process::run(int argc, char** argv) - { - - // the last argument of the process is the pointer to the process to run - // for more detail see Process::create() method - return ((Process*)argv[argc + 1])->main(argc, argv); - - } - - int Process::main(int argc, char** argv) - { - throw LogicException("Process::main() not implemented"); - } - - /*void* Process::operator new(size_t size) - { - // TODO - } - - void Process::operator delete(void* p) - { - // TODO - }*/ - - } // namespace Msg - -} // namespace SimGrid - diff --git a/src/cxx/MsgProcess.hpp b/src/cxx/MsgProcess.hpp deleted file mode 100644 index 8ae0898eac..0000000000 --- a/src/cxx/MsgProcess.hpp +++ /dev/null @@ -1,617 +0,0 @@ -/* - * Process.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_PROCESS_HPP -#define MSG_PROCESS_HPP - -// Compilation C++ recquise -#ifndef __cplusplus - #error Process.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - class ApplicationHandler; - class Host; - class Task; - - // SimGrid::Msg::Process class declaration. - class SIMGRIDX_EXPORT Process : public Object - { - friend class ApplicationHandler::ProcessFactory; - - MSG_DECLARE_DYNAMIC(Process); - - public: - - // Disable the default constructor. - Process(); - - - /*! \brief Constructs a process from the name of the host and its name. - * - * \param hostName The host name of the process to create. - * \param name The name of the process to create. - * - * \exception If the constructor failed, it throws one of the exceptions described - * below: - * - * [NullPointerException] if the name of the process is NULL or if the - * name of the host is NULL. - * [HostNotFoundException] if the host is not found. - */ - Process(const char* hostName, const char* name) - throw(NullPointerException, HostNotFoundException, BadAllocException); - - /*! \brief Constructs a process from a reference to an host object and its name. - * - * \param rHost A reference to the host object representing the native - * MSG host where to create the process. - * \param name The name of the process to create. - * - * \exception If the constructor failed, it throws the exception described - * below: - * - * [NullPointerException] if the name of process is NULL. - */ - Process(const Host& rHost, const char* name) - throw(NullPointerException); - - /*! brief Construct a proces from reference to an host object and the name of the process. - * This constuctor takes also the list of the arguments of the process. - * - * \param host A reference to the host where to create the process. - * \param name The name of the process to create. - * \param argc The number of the arguments of the process to create. - * \param argv The list of arguments of the process to create. - * - * \exception If the constructor failed, it throws one of the exceptions described - * below: - * - * [NullPointerException] if the name of the host is NULL or - * if the name of the process is NULL. - * [InvalidArgumentException] if the value of the parameter argv is - * negative. - * [LogicException] if the parameter argv is NULL and the - * parameter argc is different than zero - * if the parameter argv is not NULL and - * the parameter argc is zero. - */ - Process(const Host& rHost, const char* name, int argc, char** argv) - throw(NullPointerException, InvalidArgumentException, LogicException); - - /*! brief Constructs a proces from the name of a host and the name of the process. - * This constuctor takes also the list of the arguments of the process. - * - * \param hostName The name of the host where to create the process. - * \param name The name of the process to create. - * \param argc The number of the arguments of the process to create. - * \param argv The list of arguments of the process to create. - * - * \exception If the constructor failed, it throws one of the exceptions described - * below: - * - * [NullPointerException] if the name of the process or if the name - * of the host is NULL. - * [InvalidArgumentException] if the value of the parameter argv is - * negative. - * [LogicException] if the parameter argv is NULL and the - * parameter argc is different than zero - * if the parameter argv is not NULL and - * the parameter argc is zero. - * [HostNotFoundException] if the specified host is no found. - */ - Process(const char* hostName, const char* name, int argc, char** argv) - throw(NullPointerException, InvalidArgumentException, LogicException, HostNotFoundException, BadAllocException); - - /*! \brief Process::killAll() - kill all the running processes of the simulation. - * - * \param resetPID Should we reset the PID numbers. A negative number means no reset - * and a positive number will be used to set the PID of the next newly - * created process. - * - * \return The static method returns the PID of the next created process. - */ - static int killAll(int resetPID); - - /*! \brief Process::suspend() - Suspend an MSG process. - * - * \excetpion If this method failed, it throws one the exception described below: - * - * [MsgException] if an internal exception occurs during the operation. - */ - void suspend(void) - throw(MsgException); - - - - /*! \brief Process::resume() - Resume the MSG process. - * - * \exception If this method failed, it throws the exception described below: - * - * [MsgException] if an internal exception occurs during the operation. - */ - void resume(void) - throw(MsgException); - - /*! \brief Process::isSuspend() - Tests if a process is suspended. - * - * \return This method returns 1 is the process is suspended. - * Otherwise the method returns 0. - */ - int isSuspended(void); - - /*! \brief Process::getHost() - Retrieves the host of a process object. - * - * \return The method returns a reference to the - * host of the process. - * - */ - Host& getHost(void); - - /*! \brief Process::fromPID() - Retrieves a process from its PID. - * - * \param PID The PID of the process to retrieve. - * - * \return If successful the method returns a reference to - * to process. Otherwise, the method throws one of - * the exceptions described below: - * - * \exception [ProcessNotFoundException] if the process is not found (no process with this PID). - * - * [InvalidArgumentException] if the parameter PID is less than 1. - * - * [MsgException] if a native error occurs during the operation. - */ - static Process& fromPID(int PID) - throw(ProcessNotFoundException, InvalidArgumentException, MsgException); - - /*! \brief Process::getPID() - Gets the PID of a process object. - * - * \return This method returns the PID of a process object. - */ - int getPID(void); - - /*! \brief Process::getPPID() - Gets the parent PID of a process object. - * - * \return This method returns the parent PID of a process object. - */ - int getPPID(void); - - /*! \brief Process::getName() - Gets the name of a process object. - * - * \return This method returns the name of a process object. - */ - const char* getName(void) const; - - /*! \brief Process::currentProcess() - Retrieves the current process. - * - * \return This method returns a reference to the current process. Otherwise - * the method throws the excepction described below: - * - * \exception [MsgException] if an internal exception occurs. - */ - static Process& currentProcess(void) - throw (MsgException); - - /*! \brief Process::currentProcessPID() - Retrieves the PID of the current process. - * - * \return This method returns the PID of the current process. - */ - static int currentProcessPID(void); - - /*! \brief Process::currentProcessPPID() - Retrieves the parent PID of the current process. - * - * \return This method returns the parent PID of the current process. - */ - static int currentProcessPPID(void); - - /*! \brief Process::migrate() - Migrate a process object to an another host. - * - * \param rHost A reference to the host to migrate the process to. - * - * \return If successful the method migrate the process to the specified - * host. Otherwise the method throws the exception described - * below: - * - * \exception [MsgException] if an internal exception occurs. - */ - void migrate(const Host& rHost) - throw(MsgException); - - /*! \brief Process::sleep() - Makes the current process sleep until time seconds have elapsed. - * - * \param seconds The number of seconds to sleep. - * - * \execption If this method failed, it throws one of the exceptions described - * below: - * - * [InvalidArgumentException] if the parameter seconds is - * less or equals to zero. - * - * [MsgException] if an internal exception occurs. - */ - static void sleep(double seconds) - throw(InvalidArgumentException, MsgException); - - /*! \brief Process::putTask() - This method puts a task on a given channel of a given host. - * - * \exception If this method failed, it throws one of the exceptions described - * below: - * - * [InvalidArgumentException] if the channel number is negative. - * - * [MsgException] if an internal exception occurs. - */ - void putTask(const Host& rHost, int channel, Task* task) - throw(InvalidArgumentException, MsgException); - - /*! \brief Process::putTask() - This method puts a task on a given channel of a given host (waiting at most given time). - * - * \exception If this method failed, it throws one of the exceptions described below: - * - * [MsgException] if an internal error occurs. - * - * [InvalidArgumentException] if the value of the channel specified as - * parameter is negative or if the timeout value - * is less than zero and différent of -1. - * - * \remark Set the timeout with -1.0 to disable it. - */ - void putTask(const Host& rHost, int channel, Task* task, double timeout) - throw(InvalidArgumentException, MsgException); - - /*! \brief Process::getTask() - Retrieves a task from a channel number (waiting at most given time). - * - * \param channel The number of the channel where to get the task. - * - * \return If successful the method returns a reference to - * the getted task. Otherwise the method throws one - * of the exceptions described below: - * - * \exception [InvalidArgumentException] if the channel number is negative. - * - * [MsgException] if an internal exception occurs. - */ - Task* getTask(int channel) - throw(InvalidArgumentException, MsgException); - - /*! \brief Process::taskGet() - Retrieves a task from a channel number (waiting at most given time). - * - * \param channel The number of the channel where to get the task. - * \param timeout The timeout value. - * - * \return If successful the method returns a reference to - * the getted task. Otherwise the method throws one - * of the exceptions described below: - * - * \exception [InvalidArgumentException] if the channel number is negative - * or if the timeout value is less than - * zero and different of -1.0. - * [MsgException] if an internal exception occurs. - */ - Task* getTask(int channel, double timeout) - throw(InvalidArgumentException, MsgException); - - /*! \brief Process::taskGet() - Retrieves a task from a channel number and a host. - * - * \param channel The number of the channel where to get the task. - * \param host The host of the channel to get the task. - * - * \return If successful the method returns a reference to - * the getted task. Otherwise the method throws one - * of the exceptions described below. - * - * \exception [InvalidArgumentException] if the channel number is negative. - * [MsgException] if an internal exception occurs. - */ - Task* getTask(int channel, const Host& rHost) - throw(InvalidArgumentException, MsgException); - - /*! \brief Process::taskGet() - Retrieves a task from a channel number and a host (waiting at most given time). - * - * \param channel The number of the channel where to get the task. - * \param timeout The timeout value. - * \param rHost The host owning the channel. - * - * \return If successful the method returns a reference to - * the getted task. Otherwise the method throws one - * of the exceptions described below: - * - * \exception [InvalidArgumentException] if the channel number is negative or - * if the timeout value is negative and different - * of -1.0. - * [MsgException] if an internal exception occurs. - * - * \remark Set the timeout with -1.0 to disable it. - */ - Task* getTask(int channel, double timeout, const Host& rHost) - throw(InvalidArgumentException, MsgException); - - /*! \brief Process::sendTask() - Sends the given task in the mailbox identified by the specified alias - * (waiting at most given time). - * - * \param alias The alias of the mailbox where to send the task. - * \param rTask A reference to the task object to send. - * \param timeout The timeout value. - * - * \exception If this method failed, it throws one of the exceptions described below: - * - * [NullPointerException] if the alias specified as parameter is NULL. - * - * [InvalidArgumentException] if the timeout value is negative and different than - * -1.0 - * [MsgException] if an internal exception occurs. - * - * \remark Set the timeout with -1.0 to disable it. - */ - void sendTask(const char* alias, Task* task, double timeout) - throw(NullPointerException, InvalidArgumentException, MsgException); - - /*! \brief Process::sendTask() - Sends the given task in the mailbox identified by the specified alias. - * - * \param alias The alias of the mailbox where to send the task. - * \param rTask A reference to the task object to send. - * - * \exception If this method failed, it throws one of the exceptions described below: - * - * [NullPointerException] if the alias parameter is NULL. - * - * [MsgException] if an internal exception occurs. - * - */ - void sendTask(const char* alias, Task* task) - throw(NullPointerException, MsgException); - - /*! \brief Process::sendTask() - Sends the given task in the mailbox identified by the default alias. - * - * \param rTask A reference to the task object to send. - * - * \exception If this method failed, it throws one of the exceptions described below: - * - * [BadAllocException] if there is not enough memory to build the default alias. - * - * [MsgException] if an internal exception occurs. - * - */ - void sendTask(Task* task) - throw(BadAllocException, MsgException); - - /*! \brief Process::sendTask() - Sends the given task in the mailbox identified by the default alias - * (waiting at most given time). - * - * \param rTask A reference to the task object to send. - * \param timeout The timeout value. - * - * \exception If this method failed, it throws one of the exceptions described below: - * - * [BadAllocException] if there is not enough memory to build the default alias. - * - * [InvalidArgumentException] if the timeout value is negative and different than -1.0. - * - * [MsgException] if an internal exception occurs. - * - * \remark set the timeout value with -1.0 to disable it. - */ - void sendTask(Task* task, double timeout) - throw(BadAllocException, InvalidArgumentException, MsgException); - - /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the alias specified as - * parameter. - * - * \param alias The alias of the mailbox where to retrieve the task. - * - * \return If succcessful, the method returns a task of the mailbox. Otherwise, the method - * throws one of the exceptions described below: - * - * \exception [NullPointerException] if the parameter alias is NULL. - * - * [MsgException] if an internal exception occurs. - */ - Task* receiveTask(const char* alias) - throw(NullPointerException, MsgException); - - /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the default alias. - * - * \return If succcessful, the method returns a task of the mailbox. Otherwise, the method - * throws one of the exceptions described below: - * - * \exception [BadAllocException] if there is not enough memory to build the alias. - * [MsgException] if an internal exception occurs. - */ - Task* receiveTask(void) - throw(BadAllocException, MsgException); - - /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the alias specified as - * parameter(waiting at most given time). - * - * \param alias The alias of the mailbox where to retrieve the task. - * \param timeout The timeout value. - * - * \return If succcessful, the method returns a task of the mailbox. Otherwise, the method - * throws one of the exceptions described below. - * - * \exception [InvalidArgumentException] if the timeout value is negative or different of -1.0. - * - * [NullPointerException] if the parameter alias is NULL. - * - * [MsgException] if an internal exception occurs. - */ - Task* receiveTask(const char* alias, double timeout) - throw(NullPointerException, InvalidArgumentException, MsgException); - - /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the default alias - * (waiting at most given time). - * - * \param timeout The timeout value. - * - * \return If succcessful, the method returns a task of the mailbox. Otherwise, the method - * throws one of the exceptions described below: - * - * \exception [InvalidArgumentException] if the timeout value is negative or different than -1.0. - * - * [BadAllocException] if there is not enough memory to build the alias. - * - * [MsgException] if an internal exception occurs. - */ - Task* receiveTask(double timeout) - throw(InvalidArgumentException, BadAllocException, MsgException); - - /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the alias specified as - * parameter located on a given host (waiting at most given time). - * - * \param alias The alias of the mailbox where to retrieve the task. - * \param timeout The timeout value. - * \param rHost A reference to the host object owning the mailbox. - * - * \return If succcessful, the method returns a task of the mailbox. Otherwise, the method - * throws one of the exceptions described below: - * - * \exception [InvalidArgumentException] if the timeout value is negative or different of -1.0. - * - * [NullPointerException] if the parameter alias is NULL. - * - * [MsgException] if an internal exception occurs. - */ - Task* receiveTask(const char* alias, double timeout, const Host& rHost) - throw(NullPointerException, InvalidArgumentException, MsgException); - - /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by default alias - * and located on a given host (waiting at most given time). - * - * \param timeout The timeout value. - * \param rHost A reference to the host object owning the mailbox. - * - * \return If succcessful, the method returns a task of the mailbox. Otherwise, the method - * throws one of the exceptions described below: - * - * \exception [InvalidArgumentException] if the timeout value is negative and different than -1.0. - * - * [BadAllocException] if there is not enough memory to build the default alias. - * - * [MsgException] if an internal exception occurs. - */ - Task* receiveTask(double timeout, const Host& rHost) - throw(BadAllocException, InvalidArgumentException, MsgException); - - /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the alias - * specified as parameter and located on a given host. - * - * \param alias The alias using to identify the mailbox from which to get the task. - * \param rHost A reference to the host object owning the mailbox. - * - * \return If succcessful, the method returns a task of the mailbox. Otherwise, the method - * throws one of the exceptions described below: - * - * \exception [NullPointerException] if the parameter alias is NULL. - * - * [MsgException] if an internal exception occurs. - */ - Task* receiveTask(const char* alias, const Host& rHost) - throw(NullPointerException, MsgException); - - /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by default alias - * and located on a given host. - * - * \param rHost A reference to the host object owning the mailbox. - * - * \return If succcessful, the method returns a task of the mailbox. Otherwise, the method - * throws one of the exceptions described below: - * - * \exception [BadAllocException] if there is not enough memory to build the alias. - * - * [MsgException] if an internal exception occurs. - */ - Task* receiveTask(const Host& rHost) - throw(BadAllocException, MsgException); - - - private: - - /* Process::create() - Creates a process on a given host. - * - * param rHost A reference to a host object where to create the process. - * param name The name of the process to create. - * param argc The number of argument to pass to the main function of the process. - * param argv The list of the arguments of the main function of the process. - * - * exception If this method failed, it throws one of the exceptions described below: - * - * [HostNotFoundException] if the host specified as parameter doesn't exist. - */ - void create(const Host& rHost, const char* name, int argc, char** argv) - throw(InvalidArgumentException); - - /* Process::fromNativeProcess() - Retrieves the process wrapper associated with a native process. - * - * \param nativeProcess The native process to get the wrapper. - * - * \return The wrapper associated with the native process specified as parameter. - */ - static Process* fromNativeProcess(m_process_t nativeProcess); - - - public: - - /* Process::run() - used to set the field code of the context of the process. - */ - static int run(int argc, char** argv); - - /*! \brief Process::main() - This virtual pure function is the main function of the process. - * You must override this function for each new class of process that you create. - * - * \param argc The number of parameters of the main function. - * \param argv The list of the parameter of the main function. - * - * \return The exit code of the main function. - */ - virtual int main(int argc, char** argv); - - // Operators. - - /* - // Override the operator new(). - void* operator new(size_t size); - - // Override the operator delete(). - void operator delete(void* p); - */ - - private: - - // Attributes. - - m_process_t nativeProcess; // pointer to the native msg process. - - }; - - } //namepace Msg - -} // namespace SimGrid - -#endif // !MSG_PROCESS_HPP - diff --git a/src/cxx/MsgSimulation.cxx b/src/cxx/MsgSimulation.cxx deleted file mode 100644 index ee08c4a4ae..0000000000 --- a/src/cxx/MsgSimulation.cxx +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Simulation.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* Simulation member functions implementation. - */ - - -#include -#include - -#include - -#include - - -#include - -namespace SimGrid -{ - namespace Msg - { - int Simulation::execute(int argc, char** argv) - { - if(argc < 3) - { - info("Usage: Msg platform_file deployment_file"); - return 1; - } - - // initialize the MSG simulator. Must be done before anything else (even logging). - init(argc, argv); - - // the environment to load - Environment env; - - // the application to deploy - Application app; - - - // try to load the environment described by the xml file (argv[1]) - try - { - env.load(argv[1]); - } - catch(FileNotFoundException e) - { - info(e.toString()); - finalize(); - return 1; - } - - // try to deploy the application described by the xml file deployment (argv[2]) - try - { - app.deploy(argv[2]); - } - catch(FileNotFoundException e) - { - info(e.toString()); - finalize(); - return 1; - } - - //try to run the simulation the given application on the given environment - try - { - run(); - } - catch(MsgException e) - { - info(e.toString()); - finalize(); - return 1; - } - - // finalize the MSG simulator - try - { - finalize(); - } - catch(MsgException e) - { - info(e.toString()); - return 1; - } - - return 0; - } - - void Simulation::run(void) - throw (MsgException) - { - if(MSG_OK != MSG_main()) - throw MsgException("MSG_main() failed"); - } - } // namespace Msg -} // namespace SimGrid - - diff --git a/src/cxx/MsgSimulation.hpp b/src/cxx/MsgSimulation.hpp deleted file mode 100644 index c2eeefbc61..0000000000 --- a/src/cxx/MsgSimulation.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Simulation.hpp - * - * This file contains the declaration of the wrapper class of the native MSG task type. - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_SIMULATION_HPP -#define MSG_SIMULATION_HPP - -#ifndef __cplusplus - #error Sumulation.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include -#include - -namespace SimGrid -{ - namespace Msg - { - class MsgException; - class FileNotFoundException; - - // Simulation class declaration. - class SIMGRIDX_EXPORT Simulation - { - public : - - Simulation(){}; - - Simulation(const Simulation& rSimulation); - - virtual ~Simulation(){}; - - // Operations. - - int execute(int argc, char** argv); - - private: - - void run(void) - throw (MsgException); - - - // Operators. - const Simulation& operator = (const Simulation& rSimulation); - }; - - } // namespace Msg -} // namespace SimGrid - -#endif // !MSG_SIMULATION_HPP - diff --git a/src/cxx/MsgTask.cxx b/src/cxx/MsgTask.cxx deleted file mode 100644 index 820e473483..0000000000 --- a/src/cxx/MsgTask.cxx +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Task.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* Task member functions implementation. - */ - -#include -#include - -#include - -#include -#include - -#include - -namespace SimGrid -{ - namespace Msg - { - - MSG_IMPLEMENT_DYNAMIC(Task, Object) - - Task::Task() - { - nativeTask = NULL; - } - - - Task::Task(const Task& rTask) - { - this->nativeTask = rTask.nativeTask; - } - - - Task::~Task() - throw(MsgException) - { - if(NULL != nativeTask) - if(MSG_OK != MSG_task_destroy(nativeTask)) - throw MsgException("MSG_task_destroy() failed"); - } - - - Task::Task(const char* name, double computeDuration, double messageSize) - throw(InvalidArgumentException, NullPointerException) - { - - if(computeDuration < 0) - throw InvalidArgumentException("computeDuration"); - - if(messageSize < 0) - throw InvalidArgumentException("messageSize"); - - if(!name) - throw NullPointerException("name"); - - // create the task - nativeTask = MSG_task_create(name, computeDuration, messageSize, NULL); - - nativeTask->data = (void*)this; - } - - Task::Task(const char* name, Host* hosts, double* computeDurations, double* messageSizes, int hostCount) - throw(NullPointerException, InvalidArgumentException) - { - // check the parameters - - if(!name) - throw NullPointerException("name"); - - if(!hosts) - throw NullPointerException("hosts"); - - if(!computeDurations) - throw NullPointerException("computeDurations"); - - if(!messageSizes) - throw NullPointerException("messageSizes"); - - if(!hostCount) - throw InvalidArgumentException("hostCount (must not be zero)"); - - - m_host_t* nativeHosts; - double* durations; - double* sizes; - - - nativeHosts = xbt_new0(m_host_t, hostCount); - durations = xbt_new0(double,hostCount); - sizes = xbt_new0(double, hostCount * hostCount); - - - for(int index = 0; index < hostCount; index++) - { - - nativeHosts[index] = hosts[index].nativeHost; - durations[index] = computeDurations[index]; - } - - for(int index = 0; index < hostCount*hostCount; index++) - sizes[index] = messageSizes[index]; - - - nativeTask = MSG_parallel_task_create(name, hostCount, nativeHosts, durations, sizes,NULL); - - - - this->nativeTask->data = (void*)this; - - } - - const char* Task::getName(void) const - { - return nativeTask->name; - } - - Process& Task::getSender(void) const - { - m_process_t nativeProcess = MSG_task_get_sender(nativeTask); - - return (*((Process*)(nativeProcess->data))); - } - - Host& Task::getSource(void) const - { - m_host_t nativeHost = MSG_task_get_source(nativeTask); - - return (*((Host*)(nativeHost->data))); - } - - double Task::getComputeDuration(void) const - { - return MSG_task_get_compute_duration(nativeTask); - } - - double Task::getRemainingDuration(void) const - { - return MSG_task_get_remaining_computation(nativeTask); - } - - void Task::setPriority(double priority) - throw(InvalidArgumentException) - { - // check the parameters - - if(priority < 0.0) - throw InvalidArgumentException("priority"); - - MSG_task_set_priority(nativeTask, priority); - } - - Task* Task::get(int channel) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - m_task_t nativeTask = NULL; - - if(MSG_OK != MSG_task_get_ext(&nativeTask, channel , -1.0, NULL)) - throw MsgException("MSG_task_get_ext() failed"); - - return ((Task*)(nativeTask->data)); - } - - Task* Task::get(int channel, const Host& rHost) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - m_task_t nativeTask = NULL; - - - if(MSG_OK != MSG_task_get_ext(&nativeTask, channel , -1.0, rHost.nativeHost)) - throw MsgException("MSG_task_get_ext() failed"); - - return (Task*)(nativeTask->data); - } - - Task* Task::get(int channel, double timeout, const Host& rHost) - throw(InvalidArgumentException, MsgException) - { - // check the parameters - - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - if(timeout < 0 && timeout !=-1.0) - throw InvalidArgumentException("timeout (must not be negative and different thant -1.0)"); - - m_task_t nativeTask = NULL; - - - if(MSG_OK != MSG_task_get_ext(&nativeTask, channel , timeout, rHost.nativeHost)) - throw MsgException("MSG_task_get_ext() failed"); - - return (Task*)(nativeTask->data); - } - - int Task::probe(int channel) - throw(InvalidArgumentException) - { - // check the parameters - - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - return MSG_task_Iprobe(channel); - } - - int Task::probe(int channel, const Host& rHost) - throw(InvalidArgumentException) - { - // check the parameters - - if(channel < 0) - throw InvalidArgumentException("channel (must not be negative)"); - - return MSG_task_probe_from_host(channel,rHost.nativeHost); - } - - void Task::execute(void) - throw(MsgException) - { - if(MSG_OK != MSG_task_execute(nativeTask)) - throw MsgException("MSG_task_execute() failed"); - } - - void Task::cancel(void) - throw(MsgException) - { - if(MSG_OK != MSG_task_cancel(nativeTask)) - throw MsgException("MSG_task_cancel() failed"); - } - - void Task::send(void) - throw(BadAllocException, MsgException) - { - char* alias = (char*)calloc(strlen(Process::currentProcess().getName()) + strlen(Host::currentHost().getName()) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName(), Process::currentProcess().getName()); - - MSG_error_t rv = MSG_task_send_with_timeout(nativeTask, alias, -1.0); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_send_with_timeout() failed"); - } - - void Task::send(const char* alias) - throw(NullPointerException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - if(MSG_OK != MSG_task_send_with_timeout(nativeTask, alias, -1.0)) - throw MsgException("MSG_task_send_with_timeout() failed"); - } - - void Task::send(double timeout) - throw(BadAllocException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(timeout < 0 && timeout != -1.0) - throw InvalidArgumentException("timeout (must not be negative and different than -1.0"); - - char* alias = (char*)calloc(strlen(Process::currentProcess().getName()) + strlen(Host::currentHost().getName()) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName(), Process::currentProcess().getName()); - - MSG_error_t rv = MSG_task_send_with_timeout(nativeTask, alias, timeout); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_send_with_timeout() failed"); - } - - void Task::send(const char* alias, double timeout) - throw(NullPointerException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - if(timeout < 0 && timeout != -1.0) - throw InvalidArgumentException("timeout (must not be negative and different than -1.0"); - - - if(MSG_OK != MSG_task_send_with_timeout(nativeTask, alias, timeout)) - throw MsgException("MSG_task_send_with_timeout() failed"); - } - - void Task::sendBounded(double maxRate) - throw(BadAllocException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(maxRate < 0 && maxRate != -1.0) - throw InvalidArgumentException("maxRate (must not be negative and different than -1.0"); - - char* alias = (char*)calloc(strlen(Process::currentProcess().getName()) + strlen(Host::currentHost().getName()) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName(), Process::currentProcess().getName()); - - MSG_error_t rv = MSG_task_send_bounded(nativeTask, alias, maxRate); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_send_bounded() failed"); - - } - - void Task::sendBounded(const char* alias, double maxRate) - throw(NullPointerException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(maxRate < 0 && maxRate != -1.0) - throw InvalidArgumentException("maxRate (must not be negative and different than -1.0"); - - if(!alias) - throw NullPointerException("alias"); - - if(MSG_OK != MSG_task_send_bounded(nativeTask, alias, maxRate)) - throw MsgException("MSG_task_send_bounded() failed"); - } - - Task* Task::receive(void) - throw(BadAllocException, MsgException) - { - char* alias = (char*)calloc(strlen(Process::currentProcess().getName()) + strlen(Host::currentHost().getName()) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName(), Process::currentProcess().getName()); - - m_task_t nativeTask = NULL; - - MSG_error_t rv = MSG_task_receive_ext(&nativeTask, alias, -1.0, NULL); - - free(alias); - - if(MSG_OK != rv) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - Task* Task::receive(const char* alias) - throw(NullPointerException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - m_task_t nativeTask = NULL; - - if(MSG_OK != MSG_task_receive_ext(&nativeTask, alias, -1.0, NULL)) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - Task* Task::receive(const char* alias, double timeout) - throw(NullPointerException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - if(timeout < 0 && timeout != -1.0) - throw InvalidArgumentException("timeout (must not be negative and differnt than -1.0)"); - - m_task_t nativeTask = NULL; - - if(MSG_OK != MSG_task_receive_ext(&nativeTask, alias, timeout, NULL)) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - Task* Task::receive(const char* alias, const Host& rHost) - throw(NullPointerException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - m_task_t nativeTask = NULL; - - if(MSG_OK != MSG_task_receive_ext(&nativeTask, alias, -1.0, rHost.nativeHost)) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - Task* Task::receive(const char* alias, double timeout, const Host& rHost) - throw(NullPointerException, InvalidArgumentException, MsgException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - if(timeout < 0 && timeout != -1.0) - throw InvalidArgumentException("timeout (must not be negative and differnt than -1.0)"); - - m_task_t nativeTask = NULL; - - - if(MSG_OK != MSG_task_receive_ext(&nativeTask, alias, timeout, rHost.nativeHost)) - throw MsgException("MSG_task_receive_ext() failed"); - - return (Task*)(nativeTask->data); - } - - int Task::listen(void) - throw(BadAllocException) - { - char* alias = (char*)calloc(strlen(Process::currentProcess().getName()) + strlen(Host::currentHost().getName()) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName(), Process::currentProcess().getName()); - - int rv = MSG_task_listen(alias); - - free(alias); - - return rv; - } - - int Task::listen(const char* alias) - throw(NullPointerException) - { - // check the parameters - - if(!alias) - throw NullPointerException("alias"); - - return MSG_task_listen(alias); - } - - int Task::listenFrom(void) - throw(BadAllocException) - { - char* alias = (char*)calloc(strlen(Process::currentProcess().getName()) + strlen(Host::currentHost().getName()) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName(), Process::currentProcess().getName()); - - int rv = MSG_task_listen_from(alias); - - free(alias); - - return rv; - } - - int Task::listenFrom(const char* alias) - throw(NullPointerException) - { - if(!alias) - throw NullPointerException("alias"); - - return MSG_task_listen_from(alias); - - } - - int Task::listenFromHost(const Host& rHost) - throw(BadAllocException) - { - char* alias = (char*)calloc(strlen(Process::currentProcess().getName()) + strlen(Host::currentHost().getName()) + 2, sizeof(char)); - - if(!alias) - throw BadAllocException("alias"); - - sprintf(alias,"%s:%s", Host::currentHost().getName(), Process::currentProcess().getName()); - - int rv = MSG_task_listen_from_host(alias, rHost.nativeHost); - - free(alias); - - return rv; - } - - int Task::listenFromHost(const char* alias, const Host& rHost) - throw(NullPointerException) - { - // check the parameters - if(!alias) - throw NullPointerException("alias"); - - return MSG_task_listen_from_host(alias, rHost.nativeHost); - } - - const Task& Task::operator = (const Task& rTask) - { - this->nativeTask = rTask.nativeTask; - return *this; - } - } // namespace Msg -} // namespace SimGrid - diff --git a/src/cxx/MsgTask.hpp b/src/cxx/MsgTask.hpp deleted file mode 100644 index e8bfd38d16..0000000000 --- a/src/cxx/MsgTask.hpp +++ /dev/null @@ -1,540 +0,0 @@ -/* - * Task.hpp - * - * This file contains the declaration of the wrapper class of the native MSG task type. - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_TASK_HPP -#define MSG_TASK_HPP - -// Compilation C++ recquise -#ifndef __cplusplus - #error Task.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -#include -#include -#include -#include -#include - -#include - -namespace SimGrid -{ - namespace Msg - { - class Process; - class Host; - - // SimGrid::Msg::Task wrapper class declaration. - class SIMGRIDX_EXPORT Task : public Object - { - MSG_DECLARE_DYNAMIC(Task); - - friend class Process; - friend class Host; - - protected: - // Default constructor. - Task(); - - public: - /*! \brief Copy constructor. - */ - Task(const Task& rTask); - - /*! \brief Destructor. - * - * \exception If the destructor failed, it throw the exception described below: - * - * [MsgException] if a native exception occurs. - */ - virtual ~Task() - throw(MsgException); - - /*! \brief Constructs an new task with the specified processing amount and amount - * of data needed. - * - * \param name Task's name - * \param computeDuration A value of the processing amount (in flop) needed to process the task. - * If 0, then it cannot be executed with the execute() method. - * This value has to be >= 0. - * \param messageSize A value of amount of data (in bytes) needed to transfert this task. - * If 0, then it cannot be transfered with the get() and put() methods. - * This value has to be >= 0. - * - * \exception If this method failed, it throws one of the exceptions described below: - * - * [InvalidArgumentException] if the parameter computeDuration or messageSize - * is negative. - * [NullPointerException] if the parameter name is NULL. - * - * [MsgException] if a internal exception occurs. - */ - Task(const char* name, double computeDuration, double messageSize) - throw (InvalidArgumentException, NullPointerException); - - /*! \Constructs an new parallel task with the specified processing amount and amount for each host - * implied. - * - * \param name The name of the parallel task. - * \param hosts The list of hosts implied by the parallel task. - * \param computeDurations The amount of operations to be performed by each host of \a hosts. - * \param messageSizes A matrix describing the amount of data to exchange between hosts. - * \hostCount The number of hosts implied in the parallel task. - * - * \exception If this method fails, it throws one of the exceptions described below: - * - * [NullPointerException] if the parameter name is NULL or - * if the parameter computeDurations is NULL or - * if the parameter messageSizes is NULL - * - * [InvalidArgumentException] if the parameter hostCount is negative or zero. - */ - Task(const char* name, Host* hosts, double* computeDurations, double* messageSizes, int hostCount) - throw(NullPointerException, InvalidArgumentException); - - - /*! \brief Task::getName() - Gets the names of the task. - * - * \return The name of the task. - */ - const char* getName(void) const; - - /*! \brief Task::getSender() - Gets the sender of the task. - * - * \return A reference to the sender of the task. - */ - Process& getSender(void) const; - - /*! \brief Task::getSource() - Gets the source of the task. - * - * \return A reference to the source of the task. - */ - Host& getSource(void) const; - - /*! \brief Task::getComputeDuration() - Get the computing amount of the task. - * - * \return The computing amount of the task. - */ - - double getComputeDuration(void) const; - - /*! \brief Task::getRemainingDuration() - Gets the remaining computation. - * - * \return The remining computation of the task. - */ - double getRemainingDuration(void) const; - - /*! \brief Task::setPrirority() - Sets the priority of the computation of the task. - * The priority doesn't affect the transfert rate. For example a - * priority of 2 will make the task receive two times more cpu than - * the other ones. - * - * \param priority The new priority of the task. - * - * execption If this method fails, it throws the exception described below: - * - * [InvalidArgumentException] if the parameter priority is negative. - */ - void setPriority(double priority) - throw(InvalidArgumentException); - - /*! \brief Task::get() - Gets a task from the specified channel of the host of the current process. - * - * \param channel The channel number to get the task. - * - * \return If successful the method returns the task. Otherwise the method throws one - * of the exceptions described below: - * - * \exception [InvalidArgumentException] if the channel parameter is negative. - * - * [MsgException] if an internal excpetion occurs. - */ - static Task* get(int channel) - throw(InvalidArgumentException, MsgException); - - /*! \brief Task::get() - Gets a task from the given channel number of the given host. - * - * \param channel The channel number. - * \param rHost A reference of the host owning the channel. - * - * \return If successful, the method returns the task. Otherwise the method - * throw one of the exceptions described below: - * - * \exception [InvalidArgumentException] if the channel number is negative. - * - * [MsgException] if an internal exception occurs. - */ - static Task* get(int channel, const Host& rHost) - throw(InvalidArgumentException, MsgException); - - /*! \brief Task::get() - Gets a task from the specified channel of the specified host - * (waiting at most given time). - * - * \param channel The channel number. - * \param timeout The timeout value. - * \param rHost A reference to the host owning the channel. - * - * \return If successful, the method returns the task. Otherwise the method returns - * one of the exceptions described below: - * - * \exception [InvalidArgumentException] if the channel number is negative or - * if the timeout value is negative and - * different than -1.0. - * [MsgException] if an internal exception occurs. - */ - static Task* get(int channel, double timeout, const Host& rHost) - throw(InvalidArgumentException, MsgException); - - /*! \brief Task::probe() - Probes whether there is a waiting task on the given channel of local host. - * - * \param channel The channel number. - * - * \return If there is a waiting task on the channel the method returns 1. Otherwise - * the method returns 0. - * - * \exception If this method fails, it throws the exception described below: - * - * [InvalidArgumentException] if the parameter channel is negative. - */ - static int probe(int channel) - throw(InvalidArgumentException); - - /*! \brief Task::probe() - Counts tasks waiting on the given channel of local host and sent by given host. - * - * \param channel The channel id. - * \param rHost A reference to the host that has sent the task. - * - * \return The number of tasks. - * - * \exception [InvalidArgumentException] if the parameter channel is negative. - */ - static int probe(int channel, const Host& rHost) - throw(InvalidArgumentException); - - /*! \brief Task::execute() - This method executes a task on the location on which the - * process is running. - * - * \exception If this method fails, it returns the exception described below: - * - * [MsgException] if an internal exception occurs. - */ - void execute(void) - throw(MsgException); - - /*! \brief Task::cancel() - This method cancels a task. - * - * \exception If this method fails, it returns the exception described below: - * - * [MsgException] if an internal exception occurs. - */ - void cancel(void) - throw(MsgException); - - /*! \brief Task::send() - Send the task on the mailbox identified by the default alias. - * - * \exception If this method failed, it returns one of the exceptions described - * below: - * - * [BadAllocException] if there is not enough memory to build the default alias. - * - * [MsgException] if an internal exception occurs. - */ - void send(void) - throw(BadAllocException, MsgException); - - /*! \brief Task::send() - Send the task on the mailbox identified by the given alias. - * - * \param alias The alias of the mailbox where to send the task. - * - * \exception If this method failed, it returns one of the exceptions described - * below: - * - * [NullPointerException] if there parameter alias is NULL. - * - * [MsgException] if an internal exception occurs. - */ - void send(const char* alias) - throw(NullPointerException, MsgException); - - /*! \brief Task::send() - Send the task on the mailbox identified by the default alias - * (waiting at most given time). - * - * \param timeout The timeout value. - * - * \exception If this method failed, it returns one of the exceptions described - * below: - * - * [BadAllocException] if there is not enough memory to build the default alias. - * - * [InvalidArgumentException] if the timeout value is negative or different -1.0. - * - * [MsgException] if an internal exception occurs. - */ - void send(double timeout) - throw(BadAllocException, InvalidArgumentException, MsgException); - - /*! \brief Task::send() - Send the task on the mailbox identified by a given alias - * (waiting at most given time). - * - * \param alias The alias of the mailbox where to send the task. - * \param timeout The timeout value. - * - * \exception If this method failed, it returns one of the exceptions described - * below: - * - * [NullPointerException] if alias parameter is NULL. - * - * [InvalidArgumentException] if the timeout value is negative or different -1.0. - * - * [MsgException] if an internal exception occurs. - */ - void send(const char* alias, double timeout) - throw(NullPointerException, InvalidArgumentException, MsgException); - - /*! \brief Task::sendBounded() - Sends the task on the mailbox identified by the default alias. - * (capping the emision rate to maxrate). - * - * \param maxRate The maximum rate value. - * - * \exception If this method failed, it throws one of the exceptions described below: - * - * [BadAllocException] if there is not enough memory to build the default alias. - * - * [InvalidArgumentException] if the parameter maxRate is negative and different - * than -1.0. - * - * [MsgException] if an internal exception occurs. - */ - void sendBounded(double maxRate) - throw(BadAllocException, InvalidArgumentException, MsgException); - - /*! \brief Task::sendBounded() - Sends the task on the mailbox identified by the given alias. - * (capping the emision rate to maxrate). - * - *\ param alias The alias of the mailbox where to send the task. - * \param maxRate The maximum rate value. - * - * \exception If this method failed, it throws one of the exceptions described below: - * - * [NullPointerException] if the alias parameter is NULL. - * - * [InvalidArgumentException] if the parameter maxRate is negative and different - * than -1.0. - * - * [MsgException] if an internal exception occurs. - */ - void sendBounded(const char* alias, double maxRate) - throw(NullPointerException, InvalidArgumentException, MsgException); - - - /*! \brief Task::receive() - Receives a task from the mailbox identified by the default alias (located - * on the local host). - * - * \return A reference to the task. - * - * \exception If this method failed, it throws one of the exception described below: - * - * [BadAllocException] if there is not enough memory to build the default alias. - * - * [MsgException] if an internal exception occurs. - */ - /*static Task& receive(void) - throw(BadAllocException, MsgException);*/ - - static Task* receive(void) - throw(BadAllocException, MsgException); - - /*! \brief Task::receive() - Receives a task from the mailbox identified by a given alias (located - * on the local host). - * - * \alias The alias of the mailbox. - * - * \return A reference to the task. - * - * \exception If this method failed, it throws one of the exception described below: - * - * [NullPointerException] if the alias parameter is NULL. - * - * [MsgException] if an internal exception occurs. - */ - /*static Task& receive(const char* alias) - throw(NullPointerException, MsgException);*/ - static Task* receive(const char* alias) - throw(NullPointerException, MsgException); - - /*! \brief Task::receive() - Receives a task from the mailbox identified by a given alias (located - * on the local host and waiting at most given time). - * - * \alias The alias of the mailbox. - * \timeout The timeout value. - * - * \return A reference to the task. - * - * \exception If this method failed, it throws one of the exception described below: - * - * [NullPointerException] if the alias parameter is NULL. - * - * [InvalidArgumentException] if the timeout value is negatif and different than - * -1.0. - * - * [MsgException] if an internal exception occurs. - */ - static Task* receive(const char* alias, double timeout) - throw(NullPointerException, InvalidArgumentException, MsgException); - - /*! \brief Task::receive() - Receives a task from the mailbox identified by a given alias located - * on the given host. - * - * \alias The alias of the mailbox. - * \rHost The location of the mailbox. - * - * \return A reference to the task. - * - * \exception If this method failed, it throws one of the exception described below: - * - * [NullPointerException] if the alias parameter is NULL. - * - * [MsgException] if an internal exception occurs. - */ - static Task* receive(const char* alias, const Host& rHost) - throw(NullPointerException, MsgException); - - /*! \brief Task::receive() - Receives a task from the mailbox identified by a given alias located - * on the given host (and waiting at most given time). - * - * \alias The alias of the mailbox. - * \timeout The timeout value. - * \rHost The location of the mailbox. - * - * \return A reference to the task. - * - * \exception If this method failed, it throws one of the exception described below: - * - * [NullPointerException] if the alias parameter is NULL. - * - * [InvalidArgumentException] if the timeout value is negatif and different than - * -1.0. - * - * [MsgException] if an internal exception occurs. - */ - static Task* receive(const char* alias, double timeout, const Host& rHost) - throw(NullPointerException, InvalidArgumentException, MsgException); - - /*! \brief Task::listen() - Listen whether there is a waiting task on the mailbox - * identified by the default alias of local host. - * - * \return If there is a waiting task on the mailbox the method returns true. - * Otherwise the method returns false. - * - * \exception If this method fails, it throws one of the exceptions described below: - * - * [BadAllocException] if there is not enough memory to build the default alias. - */ - static int listen(void) - throw(BadAllocException); - - /*! \brief Task::listen() - Listen whether there is a waiting task on the mailbox - * identified by the given alias of local host. - * - * \param alias The alias of the mailbox. - * - * \return If there is a waiting task on the mailbox the method returns 1. - * Otherwise the method returns 0. - * - * \exception If this method fails, it throws one of the exceptions described below: - * - * [NullPointerException] if the parameter alias is NULL. - */ - static int listen(const char* alias) - throw(NullPointerException); - - /*! \brief Task::listenFrom() - Tests whether there is a pending communication on the mailbox - * identified by the default alias, and who sent it. - * - * \return If there is a pending communication on the mailbox, the method returns - * the PID of it sender. Otherwise the method returns -1. - * - * \exception If this method fails, it throws the exception described below: - * - * [BadAllocException] if there is not enough memory to build the default - * alias. - */ - static int listenFrom(void) - throw(BadAllocException); - - /*! \brief Task::listenFrom() - Tests whether there is a pending communication on the mailbox - * identified by the specified alias, and who sent it. - * - * \alias The alias of the mailbox. - * - * \return If there is a pending communication on the mailbox, the method returns - * the PID of it sender. Otherwise the method returns -1. - * - * \exception If this method fails, it throws the exception described below: - * - * [NullPointerException] if the alias parameter is NULL. - */ - static int listenFrom(const char* alias) - throw(NullPointerException); - - /*! \brief Task::listenFromHost() - Tests whether there is a pending communication on the mailbox - * identified by the default alias and located on the host of the current process, and who sent it. - * - * \param rHost The location of the mailbox. - * - * \return If there is a pending communication on the mailbox, the method returns - * the PID of it sender. Otherwise the method returns -1. - * - * \exception If this method fails, it throws the exception described below: - * - * [BadAllocException] if there is not enough memory to build the default - * alias. - */ - static int listenFromHost(const Host& rHost) - throw(BadAllocException); - - /*! \brief Task::listenFromHost() - Tests whether there is a pending communication on the mailbox - * identified by the default alias and located on the host of the current process, and who sent it. - * - * \param rHost The location of the mailbox. - * - * \return If there is a pending communication on the mailbox, the method returns - * the PID of it sender. Otherwise the method returns -1. - * - * \exception If this method fails, it throws the exception described below: - * - * [BadAllocException] if there is not enough memory to build the default - * alias. - */ - static int listenFromHost(const char* alias, const Host& rHost) - throw(NullPointerException); - - virtual const Task& operator= (const Task& rTask); - - protected: - - // Attributes. - - m_task_t nativeTask; // the native MSG task. - }; - - } // namespace Msg -} // namespace SimGrid - -typedef Task* TaskPtr; - -#endif // §MSG_TASK_HPP - diff --git a/src/cxx/NullPointerException.cxx b/src/cxx/NullPointerException.cxx deleted file mode 100644 index df42ea3fa8..0000000000 --- a/src/cxx/NullPointerException.cxx +++ /dev/null @@ -1,75 +0,0 @@ -/* - * NullPointerException.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* NullPointerException member functions implementation. - */ - -#include - -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - - NullPointerException::NullPointerException() - { - this->reason = (char*) calloc(strlen("Null pointer : unknown") + 1, sizeof(char)); - strcpy(this->reason, "Null pointer : unknown"); - } - - - NullPointerException::NullPointerException(const NullPointerException& rNullPointerException) - { - const char* reason = rNullPointerException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - - NullPointerException::NullPointerException(const char* name) - { - this->reason = (char*) calloc(strlen("Null pointer : ") + strlen(name) + 1, sizeof(char)); - sprintf(this->reason, "Null pointer : %s", name); - } - - - NullPointerException::~NullPointerException() - { - if(this->reason) - free(this->reason); - } - - const char* NullPointerException::toString(void) const - { - return (const char*)(this->reason); - } - - - const NullPointerException& NullPointerException::operator = (const NullPointerException& rNullPointerException) - { - const char* reason = rNullPointerException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/NullPointerException.hpp b/src/cxx/NullPointerException.hpp deleted file mode 100644 index d23f8c68af..0000000000 --- a/src/cxx/NullPointerException.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * NullPointerException.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_NULLPOINTEREXCEPTION_HPP -#define MSG_NULLPOINTEREXCEPTION_HPP - -#ifndef __cplusplus - #error NullPointerException.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT NullPointerException : public Exception - { - public: - - // Default constructor. - NullPointerException(); - - // Copy constructor. - NullPointerException(const NullPointerException& rNullPointerException); - - // This constructor takes the name of the invalid argument. - NullPointerException(const char* name); - - // Destructor. - virtual ~NullPointerException(); - - // Operations. - - // Returns the reason of the exception : - // the message "Null pointer `pointer name'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const NullPointerException& operator = (const NullPointerException& rNullPointerException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_NULLPOINTEREXCEPTION_HPP - diff --git a/src/cxx/Object.cxx b/src/cxx/Object.cxx deleted file mode 100644 index b7ca4b46c8..0000000000 --- a/src/cxx/Object.cxx +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Object.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* SimGrid::Msg RTTI implementation. - */ - -#include -#include - -#include - - - - -DeclaringClasses* DeclaringClass::declaringClasses = NULL; - -namespace SimGrid -{ - namespace Msg - { - - // Generate static object constructor for class registration - void DeclareClass(Class* c) - { - MSG_DELCARING_CLASSES.lock(); - MSG_DELCARING_CLASSES.addHead(c); - MSG_DELCARING_CLASSES.unlock(); - } - } // namespace Msg -} // namespace SimGrid - -////////////////////////////////////////////////////////////////////////////// -// Implémentation des fonctions membre de la classe Class - -// true if the class is derived from base classe referenced -// by pBaseClass -bool Class::isDerivedFrom(const Class* baseClass) const -{ - const Class* cur = this; - - while(cur) - { - if(cur == baseClass) - return true; - - cur = cur->baseClass; - } - - return false; -} - -// Dynamic name lookup and creation -Class* Class::fromName(const char* name) -throw (ClassNotFoundException) -{ - Class* cur; - - MSG_DELCARING_CLASSES.lock(); - - for(cur = MSG_DELCARING_CLASSES.getHead(); cur; cur = cur->next) - { - if(!strcmp(name,cur->name)) - { - MSG_DELCARING_CLASSES.unlock(); - return cur; - } - } - - MSG_DELCARING_CLASSES.unlock(); - throw ClassNotFoundException(name); -} - - -Object* Class::createObject(const char* name) -{ - Class* c = fromName(name); - return c->createObject(); -} - - -////////////////////////////////////////////////////////////////////////////// -// Object members implementation - -// Special runtime-class structure for Object (no base class) -const struct Class Object::classObject = -{ - "Object", // name - sizeof(Object), // typeSize - NULL, // baseClass - NULL, // next - NULL // declaringClass -}; - - -////////////////////////////////////////////////////////////////////////////// -// DeclaringClasses members implementation -// - -DeclaringClasses::DeclaringClasses() -{ - head = NULL; - count = 0; -} - - -// Ajoute une nouvelle classe en tête de liste -void DeclaringClasses::addHead(Class* c) -{ - if(NULL != head) - c->next = head; - - head = c; - count++; -} - -// Retourne la tête de liste et la retire de la liste -Class* DeclaringClasses::removeHead(void) -{ - Class* c = NULL; - - if(NULL != head) - { - c = head; - head = head->next; - count--; - } - - return c; -} - -// Retire la classe pClasse de la liste, mais ne la détruit pas -bool DeclaringClasses::remove(Class* c) -{ - if(NULL == head) - return false; - - bool success = false; - - if(head == c) - { - head = c->next; - count--; - success = true; - } - else - { - Class* cur = head; - - while((NULL != cur) && (cur->next!= c)) - cur = cur->next; - - if(NULL != cur) - { - cur->next = c->next; - count--; - success = true; - } - } - - return success; -} - -bool Object::isInstanceOf(const char* className) -{ - Class* c = Class::fromName(className); - - return this->getClass()->isDerivedFrom(c); -} - - diff --git a/src/cxx/Object.hpp b/src/cxx/Object.hpp deleted file mode 100644 index fc89d91fa1..0000000000 --- a/src/cxx/Object.hpp +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Object.hpp - * - * This file contains the declaration of the wrapper class of the native MSG task type. - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ -#ifndef MSG_OBJECT_H -#define MSG_OBJECT_H - -// Compilation C++ recquise -#ifndef __cplusplus - #error Object.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -#include - -namespace SimGrid -{ - namespace Msg - { - ////////////////////////////////////////////////////////////////////////////// - // Macros - - // Returns the runtime class of the class_name object. - #define MSG_GET_CLASS(class_name) \ - ((Class*)(&class_name::class##class_name)) - - // Declare the class class_name as dynamic - #define MSG_DECLARE_DYNAMIC(class_name) \ - public: \ - static Class class##class_name; \ - virtual Class* getClass() const; \ - static Object* createObject() \ - - // The runtime class implementation. - #define MSG_IMPLEMENT_CLASS(class_name, base_class_name, pfn,class_init) \ - Class class_name::class##class_name = { \ - #class_name, sizeof(class class_name),pfn, \ - MSG_GET_CLASS(base_class_name), NULL,class_init}; \ - Class* class_name::getClass() const \ - { return MSG_GET_CLASS(class_name); } \ - - // CreateObject implementation. - #define MSG_IMPLEMENT_DYNAMIC(class_name, base_class_name) \ - Object* class_name::createObject() \ - { return (Object*)(new class_name); } \ - DeclaringClass _declaringClass_##class_name(MSG_GET_CLASS(class_name)); \ - MSG_IMPLEMENT_CLASS(class_name, base_class_name, \ - class_name::createObject, &_declaringClass_##class_name) \ - - ////////////////////////////////////////////////////////////////////////////// - // Classes declared in this file. - - class Object; // The msg object. - - ////////////////////////////////////////////////////////////////////////////// - // Structures declared in this files. - - struct Class; // used during the rtti operations - struct DeclaringClass; // used during the instances registration. - - - class DeclaringClasses; - - ////////////////////////////////////////////////////////////////////////////// - // Global functions - - // Used during the registration. - void DeclareClass(Class* c); - - ////////////////////////////////////////////////////////////////////////////// - // DeclaringClass - - struct SIMGRIDX_EXPORT DeclaringClass - { - // Constructor : add the runtime classe in the list. - DeclaringClass(Class* c); - - // Destructor - virtual ~DeclaringClass(void); - - // Attributes : - // the list of runtime classes. - static DeclaringClasses* declaringClasses; - }; - - #define MSG_DELCARING_CLASSES (*(DeclaringClass::declaringClasses)) - - - struct SIMGRIDX_EXPORT Class - { - - // Attributes - - const char* name; // class name. - size_t typeSize; // type size. - Object* (*createObjectFn)(void); // pointer to the create object function. - Class* baseClass; // the runtime class of the runtime class. - Class* next; // the next runtime class in the list. - const DeclaringClass* declaringClass; // used during the registration of the class. - - // Operations - - // Create the runtime class from its name. - static Class* fromName(const char* name) - throw (ClassNotFoundException); - - // Create an object from the name of the its class. - static Object* createObject(const char* name); - - // Create an instance of the class. - Object* createObject(void); - - // Return true is the class is dervived from the base class baseClass. - bool isDerivedFrom(const Class* baseClass) const; - - }; - - // Create an instance of the class. - inline Object* Class::createObject(void) - { - return (*createObjectFn)(); - } - - - class SIMGRIDX_EXPORT Object - { - public: - - // Default constructor. - Object(){} - - // Destructor. - virtual ~Object(){} - - // Operations. - - // Get the runtime class. - virtual Class* getClass(void) const; - - // Returns true if the class is derived from the class baseClass. Otherwise - // the method returns false. - bool isDerivedFrom(const Class* baseClass) const; - - // Returns true if the object is valid. Otherwise the method returns false. - virtual bool isValid(void) const; - - // Returns true is the object is an instance of the class specified as parameter. - bool isInstanceOf(const char* className); - - // Operators. - - // Attributes. - - // The runtime class. - static const Class classObject; - }; - - // inline member functions of the class Object. - - // Returns the runtime class of the object. - inline Class* Object::getClass(void) const - { - return MSG_GET_CLASS(Object); - } - - // Returns true if the class is derived from the class pBaseClass. Otherwise - // the method returns false. - inline bool Object::isDerivedFrom(const Class* baseClass) const - { - return (getClass()->isDerivedFrom(baseClass)); - } - - // Returns true if the object is valid. Otherwise the method returns false. - inline bool Object::isValid(void) const - { - // returns always true. - return true; - } - - - class DeclaringClasses - { - public: - - // Constructor. - DeclaringClasses(); - - // Destructor. - virtual ~DeclaringClasses(){} - - // Operations. - - // Add the class at the head of the list. - void addHead(Class* c); - - // Get the runtime class of the head of the list. - Class* getHead(void) const ; - - // Remove the class from the list (don't destroy it). - bool remove(Class* c); - - // Remove the head of the list. - Class* removeHead(void); - - // Return true if the list is empty. - - bool isEmpty(void) const; - - // Remove of the elements of the list. - void removeAll(void); - - // Get the number of classes in the list. - unsigned int getCount(void); - - void lock(void){} - - void unlock(void){} - - //Attributes - - // The head of the list. - Class* head; - - private: - - // Attributes - - // The number of elements of the list. - unsigned int count; - }; - - typedef Object* ObjectPtr; - - - // Constructor (Add the class in the list). - inline DeclaringClass::DeclaringClass(Class* c) - { - if(!declaringClasses) - declaringClasses = new DeclaringClasses(); - - DeclareClass(c); - } - - // Destructor. - inline DeclaringClass::~DeclaringClass() - { - /*if(NULL != declaringClasses) - delete declaringClasses; - - declaringClasses=NULL;*/ - - } - - // Returns the number of elements of the list. - inline unsigned int DeclaringClasses::getCount() - { - return count; - } - - // Returns the head of the list. - inline Class* DeclaringClasses::getHead() const - { - return head; - } - - // Returns true if the list is empty. Otherwise this function - // returns false. - inline bool DeclaringClasses::isEmpty() const - { - return(!head); - } - - // Removes all the elements of the list. - inline void DeclaringClasses::removeAll() - { - head = 0; - count=0; - } - - } // namespace Msg -} // namespace SimGrid - - -using namespace SimGrid::Msg; - -#define instanceOf(class_name) reinterpret_cast(Class::createObject(#class_name)) - -#endif // !MSG_OBJECT_H - diff --git a/src/cxx/OutOfBoundsException.cxx b/src/cxx/OutOfBoundsException.cxx deleted file mode 100644 index fe2570e526..0000000000 --- a/src/cxx/OutOfBoundsException.cxx +++ /dev/null @@ -1,81 +0,0 @@ -/* - * OutOfBoundsException.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* OutOfBoundsException member functions implementation. - */ - -#include - -#include -#include -#include - - -namespace SimGrid -{ - namespace Msg - { - - OutOfBoundsException::OutOfBoundsException() - { - this->reason = (char*) calloc(strlen("Out of bounds") + 1, sizeof(char)); - strcpy(this->reason, "Out of bounds"); - } - - - OutOfBoundsException::OutOfBoundsException(const OutOfBoundsException& rOutOfBoundsException) - { - const char* reason = rOutOfBoundsException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - OutOfBoundsException::OutOfBoundsException(int pos) - { - this->reason = (char*) calloc(strlen("Out of bounds ") + 21 + 1, sizeof(char)); - sprintf(this->reason, "Out of bounds %d", pos); - } - - OutOfBoundsException::OutOfBoundsException(int pos1, int pos2) - { - this->reason = (char*) calloc(strlen("Out of bounds ") + (2*21) + 1, sizeof(char)); - sprintf(this->reason, "Out of bounds %d : %d", pos1, pos2); - } - - - OutOfBoundsException::~OutOfBoundsException() - { - if(this->reason) - free(this->reason); - } - - const char* OutOfBoundsException::toString(void) const - { - return (const char*)(this->reason); - } - - - const OutOfBoundsException& OutOfBoundsException::operator = (const OutOfBoundsException& rOutOfBoundsException) - { - const char* reason = rOutOfBoundsException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/OutOfBoundsException.hpp b/src/cxx/OutOfBoundsException.hpp deleted file mode 100644 index 2b89c7b644..0000000000 --- a/src/cxx/OutOfBoundsException.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * OutOfBoundsException.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_OUTOFBOUNDSEXCEPTION_HPP -#define MSG_OUTOFBOUNDSEXCEPTION_HPP - -#ifndef __cplusplus - #error OutOfBoundsException.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT OutOfBoundsException : public Exception - { - public: - - // Default constructor. - OutOfBoundsException(); - - // Copy constructor. - OutOfBoundsException(const OutOfBoundsException& rOutOfBoundsException); - - // This constructor takes the position in the range. - OutOfBoundsException(int pos); - - OutOfBoundsException(int pos1, int pos2); - - // Destructor. - virtual ~OutOfBoundsException(); - - // Operations. - - // Returns the reason of the exception : - // the message "Out of bounds : `pos'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const OutOfBoundsException& operator = (const OutOfBoundsException& rOutOfBoundsException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_MSGEXCEPTION_HPP - diff --git a/src/cxx/ProcessNotFoundException.cxx b/src/cxx/ProcessNotFoundException.cxx deleted file mode 100644 index 1215b2a378..0000000000 --- a/src/cxx/ProcessNotFoundException.cxx +++ /dev/null @@ -1,81 +0,0 @@ -/* - * ProcessNotFoundException.cxx - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - - /* ProcessNotFoundException member functions implementation. - */ - -#include - -#include -#include -#include - -namespace SimGrid -{ - namespace Msg - { - - ProcessNotFoundException::ProcessNotFoundException() - { - this->reason = (char*) calloc(strlen("Host not found : unknown") + 1, sizeof(char)); - strcpy(this->reason, "Host not found : unknown"); - } - - - ProcessNotFoundException::ProcessNotFoundException(const ProcessNotFoundException& rProcessNotFoundException) - { - const char* reason = rProcessNotFoundException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - - ProcessNotFoundException::ProcessNotFoundException(int PID) - { - char buff[7] = {0}; - #ifdef WIN32 - _itoa(PID, buff, 10); - #else - sprintf(buff,"%d",PID); - #endif - this->reason = (char*) calloc(strlen("Process not found : ") + strlen(buff) + 1, sizeof(char)); - sprintf(this->reason, "Host not found : %s", buff); - } - - - ProcessNotFoundException::~ProcessNotFoundException() - { - if(this->reason) - free(this->reason); - } - - const char* ProcessNotFoundException::toString(void) const - { - return (const char*)(this->reason); - } - - - const ProcessNotFoundException& ProcessNotFoundException::operator = (const ProcessNotFoundException& rProcessNotFoundException) - { - const char* reason = rProcessNotFoundException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - diff --git a/src/cxx/ProcessNotFoundException.hpp b/src/cxx/ProcessNotFoundException.hpp deleted file mode 100644 index bdf56752b1..0000000000 --- a/src/cxx/ProcessNotFoundException.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * ProcessNotFoundException.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef MSG_PROCESSNOTFOUNDEXCEPTION_HPP -#define MSG_PROCESSNOTFOUNDEXCEPTION_HPP - -#ifndef __cplusplus - #error ProcessNotFoundException.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include - -namespace SimGrid -{ - namespace Msg - { - - class SIMGRIDX_EXPORT ProcessNotFoundException : public Exception - { - public: - - // Default constructor. - ProcessNotFoundException(); - - // Copy constructor. - ProcessNotFoundException(const ProcessNotFoundException& rProcessNotFoundException); - - // This constructor takes PID of the process. - ProcessNotFoundException(int PID); - - // Destructor. - virtual ~ProcessNotFoundException(); - - // Operations. - - // Returns the reason of the exception : - // the message "Process not found `PID'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const ProcessNotFoundException& operator = (const ProcessNotFoundException& rProcessNotFoundException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_PROCESSNOTFOUNDEXCEPTION_HPP diff --git a/src/cxx/StringHelper.cxx b/src/cxx/StringHelper.cxx deleted file mode 100644 index 60b3aebad7..0000000000 --- a/src/cxx/StringHelper.cxx +++ /dev/null @@ -1,825 +0,0 @@ -#include - -#include -#include -#include -#include - -#ifndef BUFF_MAX -#define BUFF_MAX ((size_t)260) -#endif // BUFF_MAX - - -// namespace SimGrid::Msg -namespace SimGrid -{ - namespace Msg - { - - #define DEFAULT_STRING_HELPER_CAPACITY ((int)128) - - - void StringHelper::init(void) - { - capacity = DEFAULT_STRING_HELPER_CAPACITY; - - if(!(content = (char*) calloc(capacity + 1, sizeof(char)))) - throw BadAllocException(); - - len = 0; - } - - // Default constructor - StringHelper::StringHelper() - { - init(); - } - - StringHelper::StringHelper(char c) - { - init(); - append(c); - - } - - StringHelper::StringHelper(char c, int n) - { - init(); - append(c, n); - } - - StringHelper::StringHelper(const char* cstr) - { - init(); - append(cstr); - } - - StringHelper::StringHelper(const char* cstr, int n) - { - init(); - append(cstr, n); - } - - StringHelper::StringHelper(const char* cstr, int pos, int n) - { - init(); - append(cstr, pos, n); - } - - StringHelper::StringHelper(const string& rstr) - { - init(); - append(rstr); - } - - StringHelper::StringHelper(const string& rstr, int n) - { - init(); - append(rstr, n); - } - - StringHelper::StringHelper(const string& rstr, int pos, int n) - { - init(); - append(rstr, pos, n); - } - - StringHelper::StringHelper(short si) - { - init(); - append(si); - } - - StringHelper::StringHelper(int i) - { - init(); - append(i); - } - - StringHelper::StringHelper(long l) - { - init(); - append(l); - } - - StringHelper::StringHelper(float f) - { - init(); - append(f); - } - - StringHelper::StringHelper(double d) - { - init(); - append(d); - } - - StringHelper::StringHelper(double d, const char* format) - { - char toAppend[BUFF_MAX + 1] = {0}; - - sprintf(toAppend,format,d); - - init(); - - append(toAppend); - } - - StringHelper::StringHelper(unsigned short usi) - { - init(); - append(usi); - } - - StringHelper::StringHelper(unsigned int ui) - { - init(); - append(ui); - } - - StringHelper::StringHelper(unsigned long ul) - { - init(); - append(ul); - } - - // Copy constructor - StringHelper::StringHelper(const StringHelper& rStringHelper) - { - if(this != &rStringHelper && rStringHelper.size()) - { - clear(); - append(rStringHelper.cstr()); - } - } - - // Destructor - StringHelper::~StringHelper() - { - if(content) - free(content); - } - - // Operations - - void StringHelper::clear(void) - { - if(len) - memset(content, 0, len); - - len = 0; - } - - bool StringHelper::empty(void) - { - return len == 0; - } - - StringHelper& StringHelper::append(unsigned char c) - { - if(capacity < len + 1) - { - int new_capacity = (capacity << 1) ; - - if(!(content = (char*) realloc(content, new_capacity))) - throw BadAllocException(); - - capacity = new_capacity; - } - - - content[len] = c; - len++; - - content[len] = '\0'; - - return *this; - } - - StringHelper& StringHelper::append(unsigned char c, int n) - { - if(n <=0) - throw InvalidArgumentException("n"); - - char* toAppend = (char*) calloc(n + 1, sizeof(char)); - - if(!toAppend) - throw BadAllocException(); - - memset(toAppend, c, n); - - append(toAppend); - - free(toAppend); - - return *this; - } - - - StringHelper& StringHelper::append(char c) - { - if(capacity < len + 1) - { - int new_capacity = (capacity << 1) ; - - if(!(content = (char*) realloc(content, new_capacity))) - throw BadAllocException(); - - capacity = new_capacity; - } - - - content[len] = c; - len++; - - content[len] = '\0'; - - return *this; - } - - StringHelper& StringHelper::append(char c, int n) - { - if(n <=0) - throw InvalidArgumentException("n"); - - char* toAppend = (char*) calloc(n + 1, sizeof(char)); - - if(!toAppend) - throw BadAllocException(); - - memset(toAppend, c, n); - - append(toAppend); - - free(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(const char* cstr) - { - if(!cstr) - throw NullPointerException("cstr"); - - int l = (int) strlen(cstr); - - if(capacity < len + l) - { - int new_capacity = (capacity << 1) < (len + l) ? (len + l) << 1 : capacity << 1; - - if(!(content = (char*) realloc(content, new_capacity))) - throw BadAllocException(); - - strcat(content, cstr); - - capacity = new_capacity; - } - else - { - strcat(content, cstr); - } - - len += l; - content[len] = '\0'; - - return *this; - - } - - StringHelper& StringHelper::append(const char* cstr, int n) - { - if(!cstr) - throw NullPointerException("cstr"); - - if(n <= 0) - throw InvalidArgumentException("n"); - - - int l = ((int) strlen(cstr)) * n; - - if(capacity < len + l) - { - int new_capacity = (capacity << 1) < (len + l) ? (len + l) << 1 : capacity << 1; - - if(!(content = (char*) realloc(content, new_capacity))) - throw BadAllocException(); - - for(int i = 0; i < n; i++) - strcat(content, cstr); - - capacity = new_capacity; - } - else - { - for(int i = 0; i < n; i++) - strcat(content, cstr); - } - - len += l; - content[len] = '\0'; - - return *this; - - } - - StringHelper& StringHelper::append(const char* cstr, int pos, int n) - { - if(!cstr) - throw NullPointerException("cstr"); - - if(n <= 0) - throw InvalidArgumentException("n"); - - if(pos < 0 || pos >= (int)strlen(cstr) ) - throw OutOfBoundsException(pos); - - if(pos + n >= (int)strlen(cstr)) - throw OutOfBoundsException(pos, n); - - - char* toAppend = (char*) calloc(n + 1, sizeof(char)); - - strncpy(toAppend, cstr + pos, n); - - append(toAppend); - - free(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(const string& rstr) - { - append(rstr.c_str()); - return *this; - } - - StringHelper& StringHelper::append(const string& rstr, int n) - { - if(rstr.empty()) - throw NullPointerException("rstr"); - - if(n <= 0) - throw InvalidArgumentException("n"); - - - int l = ((int) rstr.size()) * n; - - if(capacity < len + l) - { - int new_capacity = (capacity << 1) < (len + l) ? (len + l) << 1 : capacity << 1; - - if(!(content = (char*) realloc(content, new_capacity))) - throw BadAllocException(); - - for(int i = 0; i < n; i++) - strcat(content, rstr.c_str()); - - capacity = new_capacity; - } - else - { - for(int i = 0; i < n; i++) - strcat(content, rstr.c_str()); - } - - len += l; - content[len] = '\0'; - - return *this; - } - - StringHelper& StringHelper::append(const string& rstr, int pos, int n) - { - if(rstr.empty()) - throw InvalidArgumentException("rstr"); - - if(n <= 0) - throw InvalidArgumentException("n"); - - if(pos < 0 || pos >= (int) rstr.size() ) - throw OutOfBoundsException(pos); - - if(pos + n >= (int) rstr.size()) - throw OutOfBoundsException(pos, n); - - - char* toAppend = (char*) calloc(n + 1, sizeof(char)); - - strncpy(toAppend, rstr.c_str() + pos, n); - - append(toAppend); - - free(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(short si) - { - char toAppend[26] = {0}; - - sprintf(toAppend, "%hd",si); - - append(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(int i) - { - char toAppend[26] = {0}; - - sprintf(toAppend, "%d",i); - - append(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(long l) - { - char toAppend[26] = {0}; - - sprintf(toAppend, "%ld",l); - - append(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(float f) - { - char toAppend[26] = {0}; - - sprintf(toAppend, "%f",f); - - append(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(double d) - { - char toAppend[26] = {0}; - - sprintf(toAppend, "%#7lf",d); - - append(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(double d, const char* format) - { - char toAppend[BUFF_MAX + 1] = {0}; - - sprintf(toAppend, format, d); - - append(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(unsigned short usi) - { - char toAppend[26] = {0}; - - sprintf(toAppend, "%hu",usi); - - append(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(unsigned int ui) - { - char toAppend[26] = {0}; - - sprintf(toAppend, "%u",ui); - - append(toAppend); - - return *this; - } - - StringHelper& StringHelper::append(unsigned long ul) - { - char toAppend[26] = {0}; - - sprintf(toAppend, "%lu",ul); - - append(toAppend); - - return *this; - } - - const char& StringHelper::at(int pos) const - { - if(pos < 0 || pos >= len) - throw OutOfBoundsException(pos); - - return content[pos]; - } - - char& StringHelper::at(int pos) - { - if(pos < 0 || pos >= len) - throw OutOfBoundsException(pos); - - return content[pos]; - } - - const char* StringHelper::cstr(void) const - { - return (const char*)content; - } - - string& StringHelper::toString(void) - { - string* s = new string(); - s->append(content); - return *s; - } - - int StringHelper::size(void) const - { - return len; - } - - // Operators - - // Assignement - StringHelper& StringHelper::operator = (const StringHelper& rStringHelper) - { - - if(this !=&rStringHelper && rStringHelper.size()) - { - clear(); - append(rStringHelper.cstr()); - } - - return *this; - } - - StringHelper& StringHelper::operator = (const char* cstr) - { - clear(); - append(cstr); - return *this; - } - - StringHelper& StringHelper::operator = (const string& str) - { - clear(); - append(str); - return *this; - } - - StringHelper& StringHelper::operator = (short n) - { - clear(); - append(n); - return *this; - } - - StringHelper& StringHelper::operator = (int n) - { - clear(); - append(n); - return *this; - } - - StringHelper& StringHelper::operator = (long n) - { - clear(); - append(n); - return *this; - } - - StringHelper& StringHelper::operator = (float n) - { - clear(); - append(n); - return *this; - } - - StringHelper& StringHelper::operator = (double n) - { - clear(); - append(n); - return *this; - } - - StringHelper& StringHelper::operator = (unsigned short n) - { - clear(); - append(n); - return *this; - } - - StringHelper& StringHelper::operator = (unsigned int n) - { - clear(); - append(n); - return *this; - } - - StringHelper& StringHelper::operator = (unsigned long n) - { - clear(); - append(n); - return *this; - } - - char& StringHelper::operator[](int pos) - { - if(pos < 0 || pos >= len) - throw OutOfBoundsException(pos); - - return content[pos]; - } - - char StringHelper::operator[](int pos) const - { - if(pos < 0 || pos >= len) - throw OutOfBoundsException(pos); - - return content[pos]; - } - - StringHelper& StringHelper::operator += (short n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator += (int n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator += (long n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator += (float n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator += (double n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator += (unsigned short n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator += (unsigned int n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator += (unsigned long n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator += (const StringHelper& rStringHelper) - { - append(rStringHelper.content); - return *this; - } - - StringHelper& StringHelper::operator += (const string& rstr) - { - append(rstr.c_str()); - return *this; - } - - StringHelper& StringHelper::operator += (const char* cstr) - { - append(cstr); - return *this; - } - - StringHelper& StringHelper::operator += (char c) - { - append(c); - return *this; - } - - StringHelper& StringHelper::operator + (short n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator + (int n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator + (long n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator + (float n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator + (double n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator + (unsigned short n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator + (unsigned int n) - { - append(n); - return *this; - } - - StringHelper& StringHelper::operator + (unsigned long n) - { - append(n); - return *this; - } - - - StringHelper& StringHelper::operator + (const StringHelper& rStringHelper) - { - append(rStringHelper.content); - return *this; - } - - StringHelper& StringHelper::operator + (const string& rstr) - { - append(rstr.c_str()); - return *this; - } - - StringHelper& StringHelper::operator + (const char* cstr) - { - append(cstr); - return *this; - } - - StringHelper& StringHelper::operator + (char c) - { - append(c); - return *this; - } - - StringHelper::operator char *() - { - return content; - } - - StringHelper::operator const char *() - { - return content; - } - - ostream& operator<<(ostream& stream, const StringHelper& s) - { - stream << s.cstr(); - return stream; - } - - istream& operator<<(istream& stream, StringHelper& s) - { - char buff[256] = {0}; - - stream >> buff; - - s.append(buff); - - return stream; - } - - } // namespace Msg -} // namespace SimGrid - diff --git a/src/cxx/StringHelper.hpp b/src/cxx/StringHelper.hpp deleted file mode 100644 index ebf3a8b95b..0000000000 --- a/src/cxx/StringHelper.hpp +++ /dev/null @@ -1,246 +0,0 @@ -/* - * StringHelper.hpp - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - * - */ - -#ifndef STRING_HELPER_HPP -#define STRING_HELPER_HPP - - #ifndef __cplusplus - #error StringHelper.hpp requires C++ compilation (use a .cxx suffix) -#endif - -#include -using std::string; - -#include -using std::ostream; -using std::istream; - -#include - -// namespace SimGrid::Msg -namespace SimGrid -{ - namespace Msg - { - class SIMGRIDX_EXPORT StringHelper - { - public: - - // Default constructor - StringHelper(); - - StringHelper(unsigned char c); - - StringHelper(unsigned char c, int n); - - StringHelper(char c); - - StringHelper(char c, int n); - - StringHelper(const char* cstr); - - StringHelper(const char* cstr, int n); - - StringHelper(const char* cstr, int pos, int n); - - StringHelper(const string& rstr); - - StringHelper(const string& rstr, int n); - - StringHelper(const string& rstr, int pos, int n); - - StringHelper(short si); - - StringHelper(int i); - - StringHelper(long l); - - StringHelper(float f); - - StringHelper(double d); - - StringHelper(double d, const char* format); - - StringHelper(unsigned short usi); - - StringHelper(unsigned int ui); - - StringHelper(unsigned long ul); - - // Copy constructor - StringHelper(const StringHelper& rStringHelper); - - // Destructor - ~StringHelper(); - - // Operations - - StringHelper& append(unsigned char c); - - StringHelper& append(unsigned char c, int n); - - StringHelper& append(char c); - - StringHelper& append(char c, int n); - - StringHelper& append(const char* cstr); - - StringHelper& append(const char* cstr, int n); - - StringHelper& append(const char* cstr, int pos, int n); - - StringHelper& append(const string& rstr); - - StringHelper& append(const string& rstr, int n); - - StringHelper& append(const string& rstr, int pos, int n); - - StringHelper& append(short si); - - StringHelper& append(int i); - - StringHelper& append(long l); - - StringHelper& append(float f); - - StringHelper& append(double d); - - StringHelper& append(double d, const char* format); - - StringHelper& append(unsigned short usi); - - StringHelper& append(unsigned int ui); - - StringHelper& append(unsigned long ul); - - const char& at(int pos) const; - - char& at(int pos); - - const char* cstr(void) const; - - string& toString(void); - - int size(void) const; - - void clear(void); - - bool empty(void); - - // Operators - - // Assignement - StringHelper& operator = (const StringHelper& rStringHelper); - - StringHelper& operator = (const char* cstr); - - StringHelper& operator = (const string& str); - - StringHelper& operator = (short n); - - StringHelper& operator = (int n); - - StringHelper& operator = (long n); - - StringHelper& operator = (float n); - - StringHelper& operator = (double n); - - StringHelper& operator = (unsigned short n); - - StringHelper& operator = (unsigned int n); - - StringHelper& operator = (unsigned long n); - - char& operator[](int pos); - - char operator[](int pos) const; - - StringHelper& operator += (short n); - - StringHelper& operator += (int n); - - StringHelper& operator += (long n); - - StringHelper& operator += (float n); - - StringHelper& operator += (double n); - - StringHelper& operator += (unsigned short n); - - StringHelper& operator += (unsigned int n); - - StringHelper& operator += (unsigned long n); - - StringHelper& operator += (const StringHelper& rStringHelper); - - StringHelper& operator += (const string& rstr); - - StringHelper& operator += (const char* cstr); - - StringHelper& operator += (char c); - - StringHelper& operator + (short n); - - StringHelper& operator + (int n); - - StringHelper& operator + (long n); - - StringHelper& operator + (float n); - - StringHelper& operator + (double n); - - StringHelper& operator + (unsigned short n); - - StringHelper& operator + (unsigned int n); - - StringHelper& operator + (unsigned long n); - - StringHelper& operator + (const StringHelper& rStringHelper); - - StringHelper& operator + (const string& rstr); - - StringHelper& operator + (const char* cstr); - - StringHelper& operator + (char c); - - operator char *(); - - operator const char *(); - - friend SIMGRIDX_EXPORT ostream& operator<<(ostream& stream, const StringHelper& s); - - friend SIMGRIDX_EXPORT istream& operator<<(istream& stream, StringHelper& s); - - private: - - // Methods - void init(void); - - // Attributes - - char* content; - int capacity; - int len; - }; - - typedef class StringHelper* StringHelperPtr; - - #define TEXT_(___x) StringHelper((___x)) - - - } // namespace Msg -} // namespace SimGrid - - -#endif // !STRING_HELPER_HPP - diff --git a/src/cxx/makefile b/src/cxx/makefile deleted file mode 100644 index cc4994419a..0000000000 --- a/src/cxx/makefile +++ /dev/null @@ -1,20 +0,0 @@ -LIBNAME = libSimGridX -PREFIX = /home/mcherier/com/loria/SimGridX/lib -INCLUDEDIR = $(PREFIX)/ -SRCDIR = $(PREFIX)/ -OBJECTS = MsgApplication.o MsgApplicationHandler.o BadAllocException.o ClassNotFoundException.o MsgEnvironment.o Exception.o FileNotFoundException.o MsgHost.o HostNotFoundException.o \ - InvalidArgumentException.o LogicException.o Msg.o MsgException.o NullPointerException.o Object.o OutOfBoundsException.o MsgProcess.o ProcessNotFoundException.o MsgSimulation.o \ - StringHelper.o MsgTask.o -CXX = g++ -CXXFLAGS = -I$(INCLUDEDIR) -I/home/mcherier/svn/simgrid/include/ -I/home/mcherier/svn/simgrid/src/ -I/home/mcherier/svn/simgrid/src/include/ -D_DEBUG -DSIMGRIDX_EXPORTS -fPIC -Wall -ansi -pedantic - -all: $(OBJECTS) - $(CXX) $(OBJECTS) -shared -o $(LIBNAME).so -L/home/mquinson/simgrid-svn-pthread/src/.libs/ -lsimgrid - - -%.o: $(SRCDIR)/%.cxx - $(CXX) -c $(CXXFLAGS) $(SRCDIR)/$*.cxx - -clean: - rm *.o -