exitst = os.system('./TwoDProblem -i ' + runFileName + ' > /dev/null') #exitst = os.system('./TwoDProblem -i '+runFileName+' | grep "Final keff"') if exitst != 0: print 'TwoDProblem run failed with exit status', exitst exit() os.system('rm ' + runFileName) #store flux if storeFlux: curPath = os.getcwd() if not os.path.isdir(curPath + '/store_flux'): os.system('mkdir store_flux') os.system('mv flux.out store_flux/') #collect k value newdata = ie.storeOutput() if newdata < 0: print 'WARNING: negative k found!' print ' ', kx, '=', cx, ' |', ky, '=', cy, ' | k =', newdata print ' Excluding data point.' continue x.append(cx) y.append(cy) datapts += [newdata] totruns += 1 if totruns % (totalSamples / 10.) == 0: print 'Completed', totruns, 'samples,', totruns / ( time.time() - starttime), 'samples/sec' curTime = time.time() doplots(x, y, datapts, kx, ky) if totruns >= totalSamples:
runDict = sampler.giveSample() histories['nRun'].append(total_runs) for key in runDict.keys(): try: histories[key].append(runDict[key]) except IndexError: histories[key] = [runDict[key]] histories['varVals'].append(runDict['varVals']) #get input file name, write input file inp_file = ie.writeInput(templateFile, runDict['varVals'], total_runs) #run file os.system('./TwoDProblem -i ' + inp_file + ' > /dev/null') os.system('rm ' + inp_file) histories['soln'].append(ie.storeOutput()) #build backend backendTypes = input_file('Backend/active', '').split(' ') for beType in backendTypes: if beType in ['plot2D']: backend = be.Plotter2D() cprvarsX = input_file('Output/Plot2D/xvars', '').split(' ') cprvarsY = input_file('Output/Plot2D/yvars', '').split(' ') for i in range(len(xvars)): backend.compareVars(cprvarsX[i], cprvarsY[i], histories) plt.show() #TODO elif beType in ['ROM', 'rom']: pass elif backendType in ['CSV', 'csv']:
exitst = os.system('./TwoDProblem -i '+runFileName+' > /dev/null') #exitst = os.system('./TwoDProblem -i '+runFileName+' | grep "Final keff"') if exitst != 0: print 'TwoDProblem run failed with exit status',exitst exit() os.system('rm '+runFileName) #store flux if storeFlux: curPath = os.getcwd() if not os.path.isdir(curPath + '/store_flux'): os.system('mkdir store_flux') os.system('mv flux.out store_flux/') #collect k value newdata = ie.storeOutput() if newdata < 0: print 'WARNING: negative k found!' print ' ',kx,'=',cx,' |',ky,'=',cy,' | k =',newdata print ' Excluding data point.' continue x.append(cx) y.append(cy) datapts+=[newdata] totruns+=1 if totruns % (totalSamples/10.) == 0: print 'Completed',totruns,'samples,',totruns/(time.time()-starttime),'samples/sec' curTime=time.time() doplots(x,y,datapts,kx,ky) if totruns>=totalSamples: converged = True