rmc.cpp

00001 // "rmc.cpp"
00002 
00003 // (c) OPAC Team, LIFL, August 2005
00004 
00005 /* 
00006    Contact: paradiseo-help@lists.gforge.inria.fr
00007 */
00008 
00009 #include "send.h"
00010 #include "worker.h"
00011 #include "schema.h"
00012 #include "comm.h"
00013 #include "scheduler.h"
00014 #include "../../core/peo_debug.h"
00015 
00016 static std :: vector <pthread_t *> ll_threads; /* Low level threads */
00017 
00018 void runRMC () {
00019 
00020   /* Worker(s) ? */
00021   for (unsigned i = 0; i < my_node -> num_workers; i ++) 
00022     addThread (new Worker, ll_threads);
00023 
00024   wakeUpCommunicator ();
00025 }
00026 
00027 void initRMC (int & __argc, char * * & __argv) {
00028 
00029   /* Communication */
00030   initCommunication ();
00031   addThread (new Communicator (& __argc, & __argv), ll_threads);
00032   waitNodeInitialization ();
00033   initSending ();
00034 
00035   /* Scheduler */
00036   if (isScheduleNode ())
00037     initScheduler ();
00038 
00040 }
00041 
00042 void finalizeRMC () {
00043 
00044   printDebugMessage ("before join threads RMC");
00045   joinThreads (ll_threads);
00046   printDebugMessage ("after join threads RMC");
00047 }

Generated on Thu Jul 5 13:43:30 2007 for ParadisEO-PEO by  doxygen 1.4.7