[cig-commits] r7602 - mc/3D/CitcomS/trunk/CitcomS

hlin at geodynamics.org hlin at geodynamics.org
Thu Jul 5 13:49:14 PDT 2007


Author: hlin
Date: 2007-07-05 13:49:14 -0700 (Thu, 05 Jul 2007)
New Revision: 7602

Modified:
   mc/3D/CitcomS/trunk/CitcomS/MultiCoupledApp.py
Log:


Modified: mc/3D/CitcomS/trunk/CitcomS/MultiCoupledApp.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/MultiCoupledApp.py	2007-07-04 15:48:59 UTC (rev 7601)
+++ mc/3D/CitcomS/trunk/CitcomS/MultiCoupledApp.py	2007-07-05 20:49:14 UTC (rev 7602)
@@ -18,51 +18,84 @@
 
     def __init__(self, name="MultiCoupledCitcomS"):
         BaseApplication.__init__(self, name)
-        '''
+        
         self.solver = None
         self.solverCommunicator = None 
+
+        #list of communicators used to pass imformation between solvers
         self.myPlus = [] 
         self.remotePlus = [] 
 
         self.comm = None 
         self.rank = 0
         self.nodes = 0
-        '''
+        
 
         
         return
 
     def getNodes(self):
         # csolver requires nproc1 CPUs to run
+        s1 = self.inventory.csolver.inventory.mesher.inventory
+        nproc1 = s1.nproc_surf * s1.nprocx * s1.nprocy * s1.nprocz
 
         # esolver1 requires nproc2 CPUs to run
+        s2 = self.inventory.esolver1.inventory.mesher.inventory
+        nproc2 = s2.nproc_surf * s2.nprocx * s2.nprocy * s2.nprocz
 
         # esolver2 requires nproc3 CPUs to run
-
+        s3 = self.inventory.esolver2.inventory.mecher.inventory
+        nproc3 = s3.nproc_surf * s3.nprox * s3.nprocy * s3.nprocz
+        
         return nproc1 + nproc2 + nproc3
 
     def initialize(self):
-        '''
+        
         layout = self.inventory.layout
         layout.initialize(self)
 
         seelf.findLayout(layout)
 
         self.comtroller.initialize(self)
-        '''
+        
 
         return
 
     def findLayout(self, layout):
 
         if layout.ccomm:
-        #This process belongs to the containing solver
+            # This process belongs to the containing solver
+            self.controller = self.inventory.ccontroller
+            self.solver = self.inventory.csolver
+            self.coupler = self.inventory.ccoupler
+            self.solverCommunicator = layout.ccomm
+            #self.myPlus = layout.ccommPlus
+            #self.remotePlus = layout.ecommPlus
+  
+        elif layout.ecomm1:
+            # This process belongs to the embedded solver
+            self.controller = self.inventory.econtroller
+            self.solver = self.inventory.esolver
+            self.coupler = self.inventory.ecoupler
+            self.solverCommunicator = layout.ecomm1
+            #self.myPlus = layout.ecommPlus
+            #self.remotePlus = layout.ccommPlus
+ 
 
-        if layout.ecomm1:
-        #This process belongs to the embedded solver1
-        
-        if layout.ecomm2:
-        #This process belongs to the embedded solver2
+        elif layout.ecomm2:
+            # This process belongs to the embedded solver
+            self.controller = self.inventory.econtroller
+            self.solver = self.inventory.esolver
+            self.coupler = self.inventory.ecoupler
+            self.solverCommunicator = layout.ecomm2
+            #self.myPlus = layout.ecommPlus
+            #self.remotePlus = layout.ccommPlus
+     
+        else:
+            # This process doesn't belong to any solver
+            import journal
+            journal.warning(self.name).log("node '%d' is an orphan"
+                                           % layout.rank)
 
         self.comm = layout.comm
         self.rank = layout.rank
@@ -83,8 +116,32 @@
         import Solver
         import Coupler
         import Layout
+        ccontroller = pyre.inventory.facility(name="ccontroller",
+                                              factory=Controller.controller,
+                                              args=("ccontroller","ccontroller"))
+        econtroller = pyre.inventory.facility(name="econtroller",
+                                              factory=Controller.controller,
+                                              args=("econtroller","econtroller"))
+        ccoupler = pyre.inventory.facility("ccoupler",
+                                           factory=Coupler.containingcoupler,
+                                           args=("ccoupler","ccoupler"))
+        ecoupler = pyre.inventory.facility("ecoupler",
+                                           factory=Coupler.embeddedcoupler,
+                                           args=("ecoupler","ecoupler"))
 
-        ## pyre.inventory stuff
+        csolver = pyre.inventory.facility("csolver",
+                                          factory=Solver.coupledFullSolver,
+                                          args=("csolver", "csolver"))
+        esolver = pyre.inventory.facility("esolver",
+                                       factory=Solver.coupledRegionalSolver,
+                                       args=("esolver", "esolver"))
 
+        layout = pyre.inventory.facility("layout", factory=Layout.Layout,
+                                         args=("layout", "layout"))
+
+        steps = pyre.inventory.int("steps", default=1)
+
+
+        
 # End of file
         



More information about the cig-commits mailing list