23 import os, logging,sys
26 if os.path.isdir(
'ush'):
27 sys.path.append(os.path.realpath(
'ush'))
32 def usage(message=None,logger=None):
33 print>>sys.stderr,
'''Sanity check failed: incorrect arguments:
34 psychoanalyst.py 18L HISTORY [conf files] [option arguments]
36 [conf files] - paths to *.conf files to parse after standard ones
37 [option arguments] - section.option=value arguments to set configuration
38 options in individual sections'''
39 if message
is not None:
40 logger.error(
'parse_launch_args says this: %s'%(str(message),))
44 logger=logging.getLogger(
'hwrf.psychoanalyst')
45 logger.info(
'HWRF Psychoanalyst: running HWRF sanity checks.')
47 if os.path.isdir(
'../parm'):
48 PARMhwrf=os.path.realpath(
'../parm')
49 logger.info(
'Assuming PARMhwrf = ../parm = %s'%(PARMhwrf,))
50 elif os.path.isdir(
'parm'):
51 PARMhwrf=os.path.realpath(
'parm')
52 logger.info(
'Assuming PARMhwrf = parm = %s'%(PARMhwrf,))
54 logger.error(
'Cannot guess PARMhwrf path. You should run this program from the ush directory or the directory above it.')
56 logger.info(
'Telling the hwrf.launcher to parse %s'%(
' '.join(sys.argv[1:])))
58 (case_root,parm,infiles,stid,moreopt)=\
60 sys.argv[1:],logger,usage,PARMhwrf=PARMhwrf)
62 logger.info(
'Calling hwrf.launcher.launch...')
65 logger.info(
'Run sanity checks.')
67 conf.timeless_sanity_check(logger=logger)
68 except Exception
as e:
69 logger.info(str(e),exc_info=
True)
71 logger.info(
'''Sanity check failed.
75 See earlier messages for details. Checklist for common errors:
77 1. Did you link the fix files?
78 2. Does your config.EXPT value match the installation directory name?
79 3. Did you run "make" and "make install" in the sorc directory?
80 4. Did you build and install, or link, the exec/hwrf_gsi?
82 The HWRF Psychoanalyist pronounces you insane. Fix problems and try again.'''
86 logger.info(
'Done. The HWRF Psychoanalyst pronounces you sane.')
88 if __name__==
'__main__': main()
Contains setup(), which initializes the produtil package.
def setup(ignore_hup=False, dbnalert_logger=None, jobname=None, cluster=None, send_dbn=None, thread_logger=False, thread_stack=2 **24, kwargs)
Initializes the produtil package.
def parse_launch_args
Parsed arguments to scripts that launch the HWRF system.
def launch
Initializes the directory structure for a new HWRF workflow.
Creates the initial HWRF directory structure, loads information into each job.