MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / interact

Method interact

python/__console.py:37–50  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35 return False
36
37 def interact(self):
38 import sys
39 self.write("MPI Shell\n")
40 self.write("================\n")
41 self.write("Use pprint(str) to print with MPI ranks\n\n")
42 self.runsource("from ngmpi import *\n")
43 self.runsource("pprint=lambda p='':print('Process ' + str(ngmpi.Rank()) + '\\n'+str(p)+'\\n')\n")
44 self.locals.update(locals())
45 self.locals.update(globals())
46 sys.ps1 = "MPI >>> "
47 sys.ps2 = "MPI ... "
48 code.InteractiveConsole.interact(self,'')
49 sys.ps1 = ">>> "
50 sys.ps2 = "... "
51 def Barrier(self):
52 source = 'ngmpi.Barrier()'
53 ngmpi.SendCommand('ngs_py '+source)

Callers 2

MpiShellFunction · 0.95
startConsoleFunction · 0.80

Calls 1

runsourceMethod · 0.95

Tested by

no test coverage detected