Exemplo n.º 1
0
################################################################################

# Write a "settings" file:
myUUID = uuid.uuid4()
output = Popen(['git tag | tail -n 1'],stdout=PIPE, shell=True).communicate()
gitVersion = output[0][:-1]
totalLength = 1
for parameter in settings: 
	thisSetting = settings[parameter]
	totalLength *= len(thisSetting)
fOutSet = open(os.getcwd() + saveResultDir + '/' + quickName + '_' + str(myUUID) + '.settings','w')	
pickle.dump((settings, FD, numberOfJobs, gitVersion),fOutSet)
fOutSet.close()

# Display settings:
analysisTools.printSettings(quickName, saveResultDir)

# Run the job:
if runType == 'localCluster' or runType == 'dualCore':
	import pp, math, ppUWTools
	from time import sleep
	
	# Define a helper routine to pass through with pp package:
	def DDMOU_help(settings, FD, perLoc, tempResultDir, quickName, totalUUID, procNum):
		try:
		 	DDMCube.DDMOU(settings, FD, perLoc, tempResultDir, quickName, totalUUID)
			return '   Sub-simulation ' + str(procNum + 1) + ' Complete'
		except: sys.exit(-1)

	if runType == 'dualCore':
		ppservers=()
Exemplo n.º 2
0
# Beginning computation:
quickName = quickNamePrefix + '-' + quickNameSuffix
numberOfJobs = [simsPerRep, simsPerRep*repsPerProc*procsPerNode*nodes]

# Write a "settings" file:
myUUID = uuid.uuid4()
gitVersion = 'None'
totalLength = 1
for parameter in settings: 
	thisSetting = settings[parameter]
	totalLength *= len(thisSetting)
settingsFileName = join(os.getcwd(), saveResultDir, quickName + '_' + str(myUUID) + '.settings')
pt.pickle((settings, FD, numberOfJobs, gitVersion), saveFileName = settingsFileName)

# Display settings:
at.printSettings(quickName, saveResultDir = saveResultDir)

# Run the job:
tBegin = time.mktime(time.localtime())
pt.runPBS(pythonPath + 'python DDMCube_Slave.py',
          fileList = ['DDMCube_Slave.py', settingsFileName, 'DDMCube.so'],
          nodes=nodes,
          ppn=procsPerNode,
		  repspp=repsPerProc,
		  outputDir=outputDir,
          runLocation=runLocation,
		  runType=runType,
		  waitForSims=waitForSims,
          wallTime=wallTime,
		  dryRun=dryRun,
		  queue=queue,