################################################################################
# Settings:
################################################################################

# pbsTools Settings:
commandString = 'matlab -nosplash -nojvm -r \'slave_matlabExample $ID\''
fileList = ('slave_matlabExample.m', 'setprod.m')

dryRun = 0
runLocation = 'local'
runType = 'batch'

nodes = 3*3*3
ppn = 'default'
verbose = 1
niceLevel = 20

################################################################################
# Run the job:
################################################################################

pt.runPBS(commandString, 
			fileList = fileList,
			dryRun = dryRun,
			runLocation = runLocation,
			runType = runType,
			nodes = nodes,
			ppn = ppn,
			verbose = verbose,
			niceLevel = niceLevel)
settingsDict = {}
for i in range(0,len(thetaVals)):
    settingsDict[i+1] = [rP,rN,corr,N,thetaVals[i],dt,nSims,maxY]

# Write out settings file:
settingsFileName = os.path.join(os.getcwd(),'jobSettings.settings')
pt.pickle(settingsDict, saveFileName = settingsFileName)

# Run PBS Job
pt.runPBS(pythonPath + 'python cythonOvershootSlave.py $ID',
          fileList = ['cythonOvershootSlave.py', settingsFileName, 'cythonOvershootSIP.so'],
          nodes=nodes,
          ppn=procsPerNode,
		  repspp=repsPerProc,
		  outputDir=outputDir,
          runLocation=runLocation,
		  runType=runType,
		  waitForSims=waitForSims,
          wallTime=wallTime,
		  dryRun=dryRun,
		  queue=queue,
		  wallTimeEstCount=wallTimeEstCount)