All pastes #1718827 Raw Edit

naromero

public text v1 · immutable
#1718827 ·published 2009-12-17 22:50 UTC
rendered paste body
Index: hs_operators.py===================================================================--- hs_operators.py	(revision 5648)+++ hs_operators.py	(working copy)@@ -23,10 +23,10 @@     nblocks = 1     async = True     hermitian = True-    blacs = False+    blacs = True      def __init__(self, bd, gd, world, kpt_comm, nblocks=None, async=None, hermitian=None,-                 blacs=None): # XXX blacs+                 blacs=None):         self.bd = bd         self.gd = gd         self.world = world@@ -43,7 +43,11 @@             self.hermitian = hermitian         if blacs is not None:             self.blacs = blacs-+        if blacs:+            print 'made it here'+            from gpaw.blacs import BlacsBandDescriptor+            self.bbd = BlacsBandDescriptor(self.world, self.gd, self.bd, self.kpt_comm)+      def allocate_work_arrays(self, dtype):         """This is a little complicated, but let's look at the facts. @@ -77,6 +81,7 @@         ngroups = self.bd.comm.size         nbands = self.bd.nbands         mynbands = self.bd.mynbands+        bbd = self.bbd         if ngroups == 1 and self.nblocks == 1:             self.work1_xG = self.gd.zeros(mynbands, dtype)         else:@@ -98,9 +103,10 @@         if not self.blacs:             self.A_nn = np.zeros((nbands, nbands), dtype)         else:-            from gpaw.blacs import BlacsBandDescriptor-            bd = BlacsBandDescriptor(self.world, self.gd, self.bd, self.kpt_comm) +            self.A_Nn = bbd.Nndescriptor.zeros(dtype=dtype)+            self.A_nn = bbd.nndescriptor.zeros(dtype=dtype)  +     def estimate_memory(self, mem, dtype):         ngroups = self.bd.comm.size         mynbands = self.bd.mynbands@@ -417,13 +423,13 @@         if B == 1:             return A_NN -        if domain_comm.rank == 0:-            self.bd.matrix_assembly(A_qnn, A_NN, self.hermitian)-        # Because of the amount of communication involved, we need to-        # be syncronized up to this point.           -        band_comm.barrier()-        domain_comm.barrier()-        return A_NN+        if not self.blacs:+            if domain_comm.rank == 0:+                self.bd.matrix_assembly(A_qnn, A_NN, self.hermitian)+                return A_NN+        else:+            self.bd.full_blockwise_assign(A_qnn, A_Nn, band_comm.rank)+            return A_Nn              def matrix_multiply(self, C_NN, psit_nG, P_ani=None):         """Calculate new linear combinations of wave functions.