def launch(host, nprocs, ppn, method, part, bank, rtime, vdir, extra_args=None): """ Launch helper. """ msg = "[%s: opening engine" % host if not part is None: msg += " on %s" % part msg += "]" print msg nnodes = int(math.ceil(float(nprocs) / float(ppn))) ehost = host if host == hostname(False): ehost = "localhost" args = ["-l", method] if not method == "serial": args.extend(["-np", str(nprocs)]) if not vdir is None: args.extend(["-dir", vdir]) if not part is None: args.extend(["-nn", str(nnodes), "-p", part]) if not extra_args is None: args.extend(extra_args) if method == "msub/srun": rtime = str(rtime) if rtime.count(":") == 0: rtime += ":00" args.extend(["-b", bank, "-t", rtime]) if visit.OpenComputeEngine(ehost, args) != 1: raise VisItException("Failed to open compute engine on %s." % host) return visit.GetEngineList()[0]
def SetupPhase2(): phase2 = visit.MachineProfile() phase2.SetTunnelSSH(1) phase2.SetUserName('tml') phase2.SetDirectory( '/gpfs/stfc/local/HCP084/bwm06/shared/visit2_10_0.linux-x86_64') phase2.SetActiveProfile(1) phase2.SetHost('phase2.wonder.hartree.stfc.ac.uk') phase2.SetClientHostDetermination(2) lp2 = SetupSerialLauncher() phase2.AddLaunchProfiles(lp2) phase2.SetActiveProfile(0) ce = visit.OpenComputeEngine(phase2) return phase2
def __init__(self): visContextAbstract.__init__(self) self._plotWindow = PlotWindow(1) self._asynchTaskManager = AsynchTaskManager(self._plotWindow) self._databaseName = None self._variable = None self._defaultOperatorAxis = 0 # 0=x, 1=y, 2=z self._defaultOperatorPercent = 50 self._defaultOperatorProject2d = False self._currentOperator = None # None, "Slice", "Clip" self._currentPlot = None # None, ("Pseudocolor", varName) self._operatorEnabled = False self._operatorAxis = self._defaultOperatorAxis self._operatorPercent = self._defaultOperatorPercent self._operatorProject2d = self._defaultOperatorProject2d self._defaultPseudoColorAttributes = self._getDefaultPseudoColorAttributes() self._pseudocolorAttributes = self._defaultPseudoColorAttributes self._pickMode = 0 # 0 = pickMode off 1 = pickMode on # self._vcellProxy = VCellProxyHandler() #visit.SuppressMessages(2) #visit.SuppressQueryOutputOn() #visQt.QtGui.QDockWidget().setWidget(visit.pyside_support.GetOtherWindow("Pick")) #pw = visit.pyside_support.GetOtherWindow("Pick") #pw.installEventFilter(SuppressWindow()) #print(pw.__class__.__name__) self._pickDockWidget = visQt.QtGui.QDockWidget() self._pickDockWidget.setWidget(visit.pyside_support.GetOtherWindow("Pick")) self._infoWindowDockWidget = visQt.QtGui.QDockWidget() self._infoWindowDockWidget.setWidget(visit.pyside_support.GetOtherWindow("Information")) self.setPickMode(1) # # Start ComputeEngine explicitly to avoid setup dialog later when opening first database # #visit.OpenComputeEngine("localhost",("-np","1","-nn","1")) visit.OpenComputeEngine("localhost",("-serial"))