def solve(self, arg):
        """ Executes an iterative solver """
        system = self._system
        #print "START", system.name

        system.rhs_buf[:] = arg[:]
        system.sol_buf[:] = system.sol_vec.array[:]
        options = self.options
        system = self._system

        norm0, norm = 1.0, 1.0
        counter = 0
        if self.options.iprint > 0:
            self.print_norm(self.ln_string, counter, norm, norm0)

        while counter < options.maxiter and norm > options.atol and \
              norm/norm0 > options.rtol:

            if system.mode == 'forward':
                #print "Start Forward", system.name, system; sys.stdout.flush()
                for subsystem in system.subsystems(local=True):
                    #print subsystem.name; sys.stdout.flush()
                    #print "Z1", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()
                    system.scatter('du', 'dp', subsystem=subsystem)
                    #print "Z2", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()
                    system.rhs_vec.array[:] = 0.0
                    subsystem.applyJ(system.flat_vars.keys())
                    system.rhs_vec.array[:] *= -1.0
                    system.rhs_vec.array[:] += system.rhs_buf[:]
                    sub_options = options if subsystem.options is None \
                                          else subsystem.options
                    #print "Z4", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()
                    subsystem.solve_linear(sub_options)
                    #print "Z5", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array
                    #print subsystem.name, system.rhs_vec.array, system.sol_vec.array; sys.stdout.flush()

                #print "End", system.name; sys.stdout.flush()
            elif system.mode == 'adjoint':
                #print "Start Adjoint", system.name, system; sys.stdout.flush()

                rev_systems = [item for item in reversed(list(system.subsystems(local=True)))]

                for subsystem in rev_systems:
                    #print "Outer", subsystem.name; sys.stdout.flush()
                    system.sol_buf[:] = system.rhs_buf[:]

                    # Instead of a double loop, we can use the graph to only
                    # call applyJ on the component behind us. This led to a
                    # nice speedup.
                    succs = [str(node) for node in system.graph.successors(subsystem.node)]

                    for subsystem2 in rev_systems:
                        if subsystem2.name in succs:
                            #print "Inner", subsystem2.name; sys.stdout.flush()
                            system.rhs_vec.array[:] = 0.0
                            args = subsystem.flat_vars.keys()
                            #print "Z1", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()
                            subsystem2.applyJ(args)
                            #print "Z2", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()
                            system.scatter('du', 'dp', subsystem=subsystem2)
                            #print subsystem2.name, subsystem2.vec['dp'].keys(), subsystem2.vec['du'].keys()
                            #print "Z3", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()
                            system.sol_buf[:] -= system.rhs_vec.array[:]
                            system.vec['dp'].array[:] = 0.0
                            #print "Z4", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()
                    system.rhs_vec.array[:] = system.sol_buf[:]
                    #print "Z5", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()

                    subsystem.solve_linear(options)
                    #print "Z6", system.vec['du'].array, system.vec['dp'].array, system.vec['df'].array; sys.stdout.flush()

            norm = self._norm()
            counter += 1
            if 0 > self.options.iprint:
                self.print_norm(self.ln_string, counter, norm, norm0)

        #print 'return', options.parent.name, np.linalg.norm(system.rhs_vec.array), system.rhs_vec.array
        #print 'Linear solution vec', system.sol_vec.array; sys.stdout.flush()
        if len(system.vec['dp'].array) == 0:
            psys = system._parent_system
            #print "pZZ", psys.vec['du'].array, psys.vec['dp'].array, psys.vec['df'].array; sys.stdout.flush()

        return system.sol_vec.array
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/linearsolver.py/LinearGS.solve/swapped operands of `>`