def plotBandStructure(filename, zero=None): print 'plotBandStructure' from CalcTroll.Core.Submission.Workflow import WORKFLOW gnubands = WORKFLOW.host().utilities().get('gnubands') dirname = os.path.dirname(filename) if gnubands is None: raise Exception siesta_bands = filename gnuplot_bands = join(dirname, 'gnuplot.bands') xv_file = join(dirname, 'siesta.XV') assert os.path.exists(siesta_bands) cmd = '%s %s >%s'%(gnubands, siesta_bands, gnuplot_bands) os.system(cmd) i = 0 while (not os.path.exists(gnuplot_bands)): time.sleep(1) i += 1 print 'sleep' plot = bandStructurePlot(siesta_bands, gnuplot_bands, zero=zero) os.remove(gnuplot_bands) return plot
from CalcTroll.Core.Submission.Workflow import WORKFLOW from CalcTrollInterface import submit from CalcTroll.API import DEFAULT host = WORKFLOW.host() parser = host.submitParser() kwargs = vars(parser.parse_args()) host.submit(**kwargs)
def setHost(self, host): if host is DEFAULT: from CalcTroll.Core.Submission.Workflow import WORKFLOW host = WORKFLOW.host() self.__host = host