Skip to content

Commit

Permalink
add trickleStream code for future use; update SED file locations; cha…
Browse files Browse the repository at this point in the history
…nge scratch to pscratch (persistent scratch)
  • Loading branch information
TomGlanzman committed Nov 14, 2016
1 parent 01143c7 commit 12fbf51
Show file tree
Hide file tree
Showing 5 changed files with 765 additions and 12 deletions.
4 changes: 2 additions & 2 deletions workflows/TW-phoSim-r3/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
PHOSIMCLEANUP = True

## SED files (from DM stack)
#SEDLIB = '/nfs/farm/g/desc/u1/LSST_Stack_2016-02-23/lsstsw/stack/Linux64/sims_sed_library/2016.01.26'
SEDLIB = '/lustre/ki/pfs/fermi_scratch/lsst/phosim/sims_sed_library/2016.01.26'
PHOSIMSEDS = '/lustre/ki/pfs/fermi_scratch/lsst/phosim/sims_sed_library'

#SEDLIB = '/nfs/farm/g/lsst/u1/software/redhat6-x86_64-64bit-gcc44/DMstack/v12_0/opt/lsst/sims_sed_library'

## Twinkles UW-FATBOY cache location
Expand Down
10 changes: 5 additions & 5 deletions workflows/TW-phoSim-r3/phoSimPrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
## Generate instanceCatalog on-the-fly

## Create scratch directory in (persistent) /lustre, if necessary.
## File path = PHOSIMSCRATCH (defined in config.py)
## File path = PHOSIMPSCRATCH (defined in config.py)

if not os.path.exists(PHOSIMSCRATCH): os.makedirs(PHOSIMSCRATCH)
if not os.path.exists(PHOSIMPSCRATCH): os.makedirs(PHOSIMPSCRATCH)

## generate instance catalog and SED files for phoSim

# generatePhosimInput.py obsHistID [options]
destIC = os.path.join(PHOSIMSCRATCH,'instanceCatalog.txt')
destSEDdir = PHOSIMSCRATCH
destIC = os.path.join(PHOSIMPSCRATCH,'instanceCatalog.txt')
destSEDdir = PHOSIMPSCRATCH
obsHistID = os.getenv('TW_OBSHISTID')
cacheDir = TW_CACHEDIR
opssimDir = TW_OPSSIMDIR
Expand Down Expand Up @@ -58,7 +58,7 @@
pass

## Protect scratch directory: rwxr-sr-t
cmd = 'chmod -R 3755 '+PHOSIMSCRATCH
cmd = 'chmod -R 3755 '+PHOSIMPSCRATCH
print 'Protect scratch directory\n',cmd

rc2 = os.system(cmd)
Expand Down
13 changes: 8 additions & 5 deletions workflows/TW-phoSim-r3/runPhoSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

log.info('Entering runPhoSim.py')

print 'PHOSIMSCRATCH = ',PHOSIMSCRATCH
print 'PHOSIMPSCRATCH = ',PHOSIMPSCRATCH

## ################################# DEBUG ############################
#sys.exit(1)
Expand Down Expand Up @@ -66,10 +66,10 @@

prep = setupPhoSimInput(icFile) ###########
#prep.inputRoot = PHOSIMIN
prep.inputRoot = PHOSIMSCRATCH
prep.inputRoot = PHOSIMPSCRATCH
prep.phosimInstDir = PHOSIMINST
prep.SEDlib = SEDLIB
prep.scratch = PHOSIMSCRATCH
prep.SEDlib = PHOSIMSEDS
prep.scratch = PHOSIMPSCRATCH
prep.refCF = PHOSIMCF ## cmd file template may require editing
prep.persistentScratch = True ## dynamically generated instance catalog + SEDs
prep.cleanupFlag = False ## DEBUG - keep contents of scratch (/lustre)
Expand Down Expand Up @@ -115,7 +115,8 @@

## Prepare phoSim command
log.info('Prepare phoSim command')
cmd = 'time '+PHOSIMINST+'/phosim.py '+ic+' -c '+cFile+' -s '+sensor+' '+PHOSIMOPTS+' --sed '+seds+' -w '+workDir+' -o '+outDir
cmd = PHOSIMINST+'/phosim.py '+ic+' -c '+cFile+' -s '+sensor+' '+PHOSIMOPTS+' --sed '+seds+' -w '+workDir+' -o '+outDir
#cmd = 'time '+PHOSIMINST+'/phosim.py '+ic+' -c '+cFile+' -s '+sensor+' '+PHOSIMOPTS+' --sed '+seds+' -w '+workDir+' -o '+outDir
#cmd = 'time '+PHOSIMINST+'/phosim.py '+ic+' -c '+cFile+' -s '+sensor+' '+PHOSIMOPTS+' -w '+workDir+' -o '+outDir
print 'cmd = ',cmd
sys.stdout.flush()
Expand All @@ -137,6 +138,8 @@
print 'phoSim rc = ',rc,', type(rc) = ',type(rc)
if len(yak[1]) > 0:
print '\n\n$WARNING: phoSim stderr output:\n',yak[1]
print 'TERMINATING...'
sys.exit(1)
# if rc == 0:
# print '\nphoSim returned error output but a zero return code...setting rc=1'
# rc = 1
Expand Down
Loading

0 comments on commit 12fbf51

Please sign in to comment.