def getprocessorinfo(): try: name = os.uname()[1] except: import platform name = platform.uname()[1] from petsc4py.PETSc import COMM_WORLD rank = COMM_WORLD.getRank() return (rank, name)
def _repr_latex_(self): # don't print if we aren't process 0 # this causes there to still be some awkward white space, # but at least it doesn't print the tex a zillion times if COMM_WORLD.getRank() != 0: return '' return '$' + self.build_tex(signs='-') + '$'
def getprocessorinfo(): from petsc4py.PETSc import COMM_WORLD rank = COMM_WORLD.getRank() name = os.uname()[1] return (rank, name)