Ver Fonte

Cluster modifications

Mark Mine há 23 anos atrás
pai
commit
b76d70668c
2 ficheiros alterados com 11 adições e 11 exclusões
  1. 9 7
      direct/src/cluster/ClusterClient.py
  2. 2 4
      direct/src/cluster/ClusterServer.py

+ 9 - 7
direct/src/cluster/ClusterClient.py

@@ -6,6 +6,7 @@ from ClusterConfig import *
 import DirectNotifyGlobal
 import DirectObject
 import Task
+import os
 
 class ClusterClient(DirectObject.DirectObject):
     notify = DirectNotifyGlobal.directNotify.newCategory("ClusterClient")
@@ -13,27 +14,28 @@ class ClusterClient(DirectObject.DirectObject):
 
     def __init__(self, configList, clusterSyncFlag):
         # First start up servers using direct daemon
-        clusterDaemonClient = base.config.GetString(
-            'cluster-daemon-client', 'localhost')
+        # What is the name of the client machine?
+        clusterDaemonClient = os.popen('uname -n').read()
+        clusterDaemonClient.replace('\n', '')
+        # What daemon port are we using to communicate between client/servers
         clusterDaemonPort = base.config.GetInt(
             'cluster-daemon-port', CLUSTER_DAEMON_PORT)
+        # Create a daemon
         self.daemon = DirectD()
-        print 'LISTEN'
+        # Start listening for the response
         self.daemon.listenTo(clusterDaemonPort)
+        # Contact server daemons and start up remote server application
         for serverConfig in configList:
             serverCommand = (SERVER_STARTUP_STRING %
                              (serverConfig.serverPort,
                               clusterSyncFlag,
                               clusterDaemonClient,
                               clusterDaemonPort))
-            print 'BOOTSTRAP', serverCommand
             self.daemon.clientReady(serverConfig.serverName,
                                     clusterDaemonPort,
                                     serverCommand)
-        print 'WAITING'
         if not self.daemon.waitForServers(len(configList)):
-            print 'ERROR'
-        print 'DONE'
+            print 'Cluster Client, no response from servers'
         self.qcm=QueuedConnectionManager()
         self.serverList = []
         self.msgHandler = ClusterMsgHandler(ClusterClient.MGR_NUM, self.notify)

+ 2 - 4
direct/src/cluster/ClusterServer.py

@@ -21,8 +21,8 @@ class ClusterServer(DirectObject.DirectObject):
     MSG_NUM = 2000000
 
     def __init__(self,cameraJig,camera):
-        global clusterServerPort, clusterSyncFlag, clusterDaemonClient, clusterDaemonPort
-        print clusterServerPort, clusterSyncFlag, clusterDaemonClient, clusterDaemonPort
+        global clusterServerPort, clusterSyncFlag
+        global clusterDaemonClient, clusterDaemonPort
         # Store information about the cluster's camera
         self.cameraJig = cameraJig
         self.camera = camera
@@ -52,7 +52,6 @@ class ClusterServer(DirectObject.DirectObject):
         if clusterSyncFlag:
             self.startSwapCoordinator()
             base.win.setSync(1)
-        print 'DAEMON'
         # Send verification of startup to client
         self.daemon = DirectD()
         # These must be passed in as bootstrap arguments and stored in
@@ -65,7 +64,6 @@ class ClusterServer(DirectObject.DirectObject):
             clusterDaemonPort
         except NameError:
             clusterDaemonPort = CLUSTER_DAEMON_PORT
-        print 'SERVER READY'
         self.daemon.serverReady(clusterDaemonClient, clusterDaemonPort)
 
     def startListenerPollTask(self):