scripts now report status even when running in background

This commit is contained in:
P.M. Sutter 2013-02-15 13:48:04 -06:00
parent e13d5b6173
commit 3a12e32f2c

View file

@ -235,6 +235,7 @@ for thisSubSample in sorted(subSamples, reverse=True):
if args.script or args.all: if args.script or args.all:
print " Doing subsample", thisSubSample, "scripts" print " Doing subsample", thisSubSample, "scripts"
sys.stdout.flush()
setName = prefix+"ss"+str(thisSubSample) setName = prefix+"ss"+str(thisSubSample)
if dataFormat == "multidark": if dataFormat == "multidark":
subSampleToUse = 1.0 subSampleToUse = 1.0
@ -264,9 +265,11 @@ for thisSubSample in sorted(subSamples, reverse=True):
if args.subsample or args.all: if args.subsample or args.all:
print " Doing subsample", thisSubSample print " Doing subsample", thisSubSample
sys.stdout.flush()
for (iRedshift, redshift) in enumerate(redshifts): for (iRedshift, redshift) in enumerate(redshifts):
print " redshift", redshift print " redshift", redshift
sys.stdout.flush()
if dataFormat == "multidark": if dataFormat == "multidark":
# reuse previous subamples in order to: # reuse previous subamples in order to:
@ -341,6 +344,7 @@ if (args.script or args.all) and haloFileBase != "":
for minHaloMass in minHaloMasses: for minHaloMass in minHaloMasses:
print " Doing halo script", minHaloMass print " Doing halo script", minHaloMass
sys.stdout.flush()
# estimate number of halos to get density # estimate number of halos to get density
if haloFileDummy == '': if haloFileDummy == '':
@ -371,12 +375,15 @@ if (args.script or args.all) and haloFileBase != "":
if (args.halos or args.all) and haloFileBase != "": if (args.halos or args.all) and haloFileBase != "":
print " Doing halos" print " Doing halos"
sys.stdout.flush()
for minHaloMass in minHaloMasses: for minHaloMass in minHaloMasses:
print " min halo mass = ", minHaloMass print " min halo mass = ", minHaloMass
sys.stdout.flush()
for (iRedshift, redshift) in enumerate(redshifts): for (iRedshift, redshift) in enumerate(redshifts):
print " z = ", redshift print " z = ", redshift
sys.stdout.flush()
if haloFileDummy == '': if haloFileDummy == '':
dataFile = catalogDir+haloFileBase+fileNums[iRedshift] dataFile = catalogDir+haloFileBase+fileNums[iRedshift]
@ -463,6 +470,7 @@ root_filename {workDir}/hod
if (args.script or args.all) and haloFileBase != "": if (args.script or args.all) and haloFileBase != "":
print " Doing HOD scripts" print " Doing HOD scripts"
sys.stdout.flush()
for thisHod in hodParmList: for thisHod in hodParmList:
print " ", thisHod['name'] print " ", thisHod['name']
setName = prefix+"hod_"+thisHod['name'] setName = prefix+"hod_"+thisHod['name']
@ -475,10 +483,13 @@ if (args.script or args.all) and haloFileBase != "":
if (args.hod or args.all) and haloFileBase != "": if (args.hod or args.all) and haloFileBase != "":
print " Doing HOD" print " Doing HOD"
sys.stdout.flush()
for thisHod in hodParmList: for thisHod in hodParmList:
print " ", thisHod['name'] print " ", thisHod['name']
sys.stdout.flush()
for (iRedshift, redshift) in enumerate(redshifts): for (iRedshift, redshift) in enumerate(redshifts):
print " z = ", redshift print " z = ", redshift
sys.stdout.flush()
parFileName = "./hod.par" parFileName = "./hod.par"
parFile = open(parFileName, 'w') parFile = open(parFileName, 'w')