Changeset 20103
- Timestamp:
- 05/02/07 08:21:06 (2 years ago)
- Files:
-
- juggler/trunk/modules/gadgeteer/cluster/ClusterManager.cpp (modified) (4 diffs)
- juggler/trunk/modules/gadgeteer/cluster/ClusterManager.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/AbstractNetworkManager.cpp (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/plugins/ApplicationDataManager/ApplicationDataManager.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
juggler/trunk/modules/gadgeteer/cluster/ClusterManager.cpp
r20074 r20103 153 153 ClusterManager::ClusterManager() 154 154 : mClusterActive( false ) 155 , mClusterReady( false )156 155 , mClusterStarted( false ) 157 156 , mIsMaster(false) … … 224 223 if (mIsMaster) 225 224 { 226 std::cout << "XXX: ClusterManager::start() MASTER" << std::endl;227 225 if (NULL == mClusterElement.get()) 228 226 { … … 251 249 (*itr)->send(cfg_pkt); 252 250 } 253 std::cout << "Before barrier" << std::endl;254 251 sendEndBlocksAndSignalUpdate(0); 255 std::cout << "After barrier" << std::endl;256 //while(true)257 //{;}258 // Wait for all needed configuration.259 // Connect to all nodes.260 252 } 261 253 else if (mIsSlave) 262 254 { 263 std::cout << "XXX: ClusterManager::start() SLAVE" << std::endl;264 255 // Start listening on known port for connections. 265 256 mClusterNetwork->waitForConnection(); 266 std::cout << "Before barrier" << std::endl;267 257 sendEndBlocksAndSignalUpdate(0); 268 std::cout << "After barrier" << std::endl;269 //while(true)270 //{;}271 258 } 272 259 } … … 274 261 bool ClusterManager::isClusterReady() 275 262 { 276 // -If the cluster is active and not ready277 // -If a StartBarrier jccl::ConfigElement does not exist278 // -Warn the user and set cluster ready279 // -Get new value of mClusterReady from asking all plugins280 // -Return the new mClusterReady281 282 vpr::Guard<vpr::Mutex> ready_guard( mClusterReadyLock );283 263 vpr::Guard<vpr::Mutex> active_guard( mClusterActiveLock ); 284 264 285 if ( mClusterActive && !mClusterReady ) 286 { 287 if ( !jccl::ConfigManager::instance()->hasElementType( "start_barrier_plugin" ) ) 288 { 289 vprDEBUG(gadgetDBG_RIM, vprDBG_WARNING_LVL) 290 << clrOutBOLD(clrCYAN, "NOTE:") << std::endl << vprDEBUG_FLUSH; 291 vprDEBUG_NEXT(gadgetDBG_RIM, vprDBG_WARNING_LVL) 292 << "The start_barrier_plugin config element does not exist.\n" 293 << vprDEBUG_FLUSH; 294 vprDEBUG_NEXT(gadgetDBG_RIM, vprDBG_WARNING_LVL) 295 << "If your application depends on each node starting at the " 296 << "same time,\n" << vprDEBUG_FLUSH; 297 vprDEBUG_NEXT(gadgetDBG_RIM, vprDBG_WARNING_LVL) 298 << "then you should load and configure the Start Barrier " 299 << "Plug-in.\n" << vprDEBUG_FLUSH; 300 301 mClusterReady = true; 302 } 303 } 265 const std::string window_type("display_window"); 266 bool pending_windows = false; 267 //bool pending_windows = jccl::ConfigManager::instance()->isElementTypeInPendingList(window_type); 268 304 269 // Lock it here so that we can avoid confusion in pluginsReady() 305 270 vpr::Guard<vpr::Mutex> guard( mPluginsLock ); 306 return( mClusterReady&& pluginsReady() );271 return( !pending_windows && pluginsReady() ); 307 272 } 308 273 juggler/trunk/modules/gadgeteer/cluster/ClusterManager.h
r20079 r20103 266 266 267 267 /** 268 * Change the ready state of the ClusterManager.269 */270 void setClusterReady( const bool ready )271 {272 vpr::Guard<vpr::Mutex> guard( mClusterReadyLock );273 274 vprDEBUG( gadgetDBG_RIM, vprDBG_CONFIG_LVL )275 << clrOutBOLD( clrCYAN, "[ClusterManager]" )276 << " Cluster is ready." << std::endl << vprDEBUG_FLUSH;277 278 mClusterReady = ready;279 }280 281 /**282 268 * Output the current status of the cluster. 283 269 */ … … 351 337 bool mClusterActive; /**< Flag informing us if this app is running on a cluster. */ 352 338 353 vpr::Mutex mClusterReadyLock; /**< Lock on ClusterReady bool.*/354 bool mClusterReady; /**< Flag set true when all dependancies are satisfied. */355 356 339 bool mClusterStarted; /**< If the cluster has already started. */ 357 340 juggler/trunk/modules/gadgeteer/gadget/AbstractNetworkManager.cpp
r20078 r20103 296 296 { 297 297 // -Set New State 298 if (node == NULL) 299 { 300 return; 301 } 302 298 vprASSERT(NULL != node.get() && "Can't have a NULL node."); 303 299 node->setUpdated( true ); 304 300 return; 305 301 } 306 else if (packet->getPacketType() == cluster::Header::RIM_CONNECTION_REQ ||307 packet->getPacketType() == cluster::Header::RIM_CONNECTION_ACK)308 {309 //handleLocalPacket(packet, node);310 311 vprDEBUG( gadgetDBG_NET_MGR, vprDBG_CRITICAL_LVL )312 << clrOutBOLD( clrRED, "[ERROR] " )313 << "RIM_CONNECTION_REQ & RIM_CONNECTION_ACK data packet types are depreciated."314 << std::endl << vprDEBUG_FLUSH;315 return;316 }317 302 318 303 vpr::GUID handler_guid = packet->getPluginId(); 319 320 304 PacketHandler* temp_handler = getHandlerByGUID( handler_guid ); 321 305 juggler/trunk/modules/gadgeteer/plugins/ApplicationDataManager/ApplicationDataManager.cpp
r20074 r20103 30 30 31 31 #include <cluster/ClusterManager.h> 32 #include <gadget/AbstractNetworkManager.h>33 32 #include <gadget/Node.h> 34 33 #include <gadget/Util/Debug.h>
