用python在天河二號上面提交作業的時候遇到了如下錯誤,自己沒有搞明白問題出在哪里,來請教大家。可以有償解決,謝謝!
Traceback (most recent call last):
File "/BIGDATA1/hwrf/hwrfrun/scripts/exhwrf_init.py", line 89, in <module>
main()
File "/BIGDATA1/hwrf/hwrfrun/scripts/exhwrf_init.py", line 73, in main
init.run_through_anl()
File "/BIGDATA1/hwrf/hwrfrun/ush/hwrf/init.py", line 559, in run_through_anl
self.geogrid.run()
File "/BIGDATA1/hwrf/hwrfrun/ush/hwrf/wps.py", line 637, in run
produtil.run.checkrun(cmd,logger=logger)
File "/BIGDATA1/hwrf/hwrfrun/ush/produtil/run.py", line 415, in checkrun
raise ExitStatusException('%s: non-zero exit status'%(repr(arg),),r)
ExitStatusException: exe('/usr/bin/srun')['--export=ALL','--cpu_bind=core','--distribution=block:block','/BIGDATA1/hwrf/hwrfrun/sorc/WPSV3/geogrid.exe'].out('geogrid.log',append=False): non-zero exit status (returncode=1)
11/20 20:53:40Z NONAME-CRITICAL: HWRF init is aborting: exe('/usr/bin/srun')['--export=ALL','--cpu_bind=core','--distribution=block:block','/BIGDATA1/hwrf/hwrfrun/sorc/WPSV3/geogrid.exe'].out('geogrid.log',append=False): non-zero exit status (returncode=1)
run.py :
def checkrun(arg,logger=None,**kwargs):
"""!This is a simple wrapper round run that raises
ExitStatusException if the program exit status is non-zero.
@param arg the produtil.prog.Runner to execute (output of
exe(), bigexe() or mpirun()
@param logger a logging.Logger to log messages
@param kwargs The optional run=[] argument can provide a different
list of acceptable exit statuses."""
r=run(arg,logger=logger)
if kwargs is not None and 'ret' in kwargs:
if not r in kwargs['ret']:
raise ExitStatusException('%s: unexpected exit status'%(repr(arg),),r)
elif not r==0:
raise ExitStatusException('%s: non-zero exit status'%(repr(arg),),r) #第415行
return r
wps.py:
class Geogrid(WPSTask):
.....
def run(self):
"""!Copies inputs, links fix files, runs geogrid and delivers
results."""
logger=self.log()
try:
produtil.fileop.makedirs(self.outdir)
with NamedDir(self.location) as dir:
logger.info('Geogrid running in directory: '+os.getcwd())
assert(not re.match('\A/tmp',os.getcwd()))
for f in glob.glob('geo*'):
try:
produtil.fileop.remove_file(f,logger=logger)
except(EnvironmentError) as e:
logger.warning('%s: did not remove file, but '
'continuing anyway'%(f,))
self.link_fix(geog_data=https://bbs.csdn.net/topics/True,table='GEOGRID.TBL')
with open('namelist.wps', 'w') as f:
f.write(self.make_namelist())
prog = self.getexe('hwrf_geogrid')
log = self._section + '.log'
cmd = produtil.run.mpirun(produtil.run.mpi(prog),
allranks=True)
if self.redirect: cmd=cmd > log
logger.info('%s command: %s'%(self.taskname, repr(cmd),))
produtil.run.checkrun(cmd,logger=logger) #第635行
findme="Successful completion"
geogrid_log=None
for glog in ( 'geogrid.log', 'geogrid.log.0000',
'geogrid.log.00000' ):
if os.path.exists(glog):
geogrid_log=glog
else:
logger.info('%s: does not exist.'%(glog,))
if geogrid_log is None:
msg='WPS Geogrid failed: could not find geogrid log file.'
logger.error(msg)
self.state=FAILED
raise GeogridNoLog(msg)
logger.info('%s: will check for %s'%(geogrid_log,findme))
if not check_last_lines(geogrid_log,findme):
raise WPSError('%s: did not find "%s"'
%(geogrid_log,findme))
self.deliver_products(keep=False,relink=True)
init.py:
class HWRFInit(HWRFTask):
......
def run_through_anl(self):
"""!Runs the following jobs, if they are enabled: geogrid,
ungrib, metgrid, init-length prep_hybrid, init-length real_nmm
and wrfanl."""
self.log().warning('run_through_anl')
if 'geogrid' in self.__dict__:
set_ecflow_label('status','[geogrid] process terrain')
self.geogrid.run() #第559行
set_ecflow_label('status','[ungrib] process parent GRIB')
self.ungrib.run()
set_ecflow_label('status','[metgrid] interpolate horizontally')
self.metgrid.run()
if 'prep' in self.__dict__:
set_ecflow_label('status','[prep] process parent spectral')
for i in xrange(len(self.ibdytimes)):
t=self.ibdytimes[i]
if t>self.initlen: break
self.prep.run_ipiece(i)
set_ecflow_label('status','[realinit] make wrfinput file')
self.realinit.run()
set_ecflow_label('status','[runwrfanl] make wrfanl files')
self.runwrfanl.run()
set_ecflow_label('status','Passed through anl.')
uj5u.com熱心網友回復:
csdn有個東西叫代碼框,直接復制還是python這種語言,很難看清的。uj5u.com熱心網友回復:
而且我在用手機刷,看的更辛苦。
uj5u.com熱心網友回復:
腳本太長了,有沒有辦法上傳整個腳本呢?run.py
def checkrun(arg,logger=None,**kwargs):
"""!This is a simple wrapper round run that raises
ExitStatusException if the program exit status is non-zero.
@param arg the produtil.prog.Runner to execute (output of
exe(), bigexe() or mpirun()
@param logger a logging.Logger to log messages
@param kwargs The optional run=[] argument can provide a different
list of acceptable exit statuses."""
r=run(arg,logger=logger)
if kwargs is not None and 'ret' in kwargs:
if not r in kwargs['ret']:
raise ExitStatusException('%s: unexpected exit status'%(repr(arg),),r)
elif not r==0:
raise ExitStatusException('%s: non-zero exit status'%(repr(arg),),r) #第415行
return r
wps.py
class Geogrid(WPSTask):
.....
def run(self):
"""!Copies inputs, links fix files, runs geogrid and delivers
results."""
logger=self.log()
try:
produtil.fileop.makedirs(self.outdir)
with NamedDir(self.location) as dir:
logger.info('Geogrid running in directory: '+os.getcwd())
assert(not re.match('\A/tmp',os.getcwd()))
for f in glob.glob('geo*'):
try:
produtil.fileop.remove_file(f,logger=logger)
except(EnvironmentError) as e:
logger.warning('%s: did not remove file, but '
'continuing anyway'%(f,))
self.link_fix(geog_data=https://bbs.csdn.net/topics/True,table='GEOGRID.TBL')
with open('namelist.wps', 'w') as f:
f.write(self.make_namelist())
prog = self.getexe('hwrf_geogrid')
log = self._section + '.log'
cmd = produtil.run.mpirun(produtil.run.mpi(prog),
allranks=True)
if self.redirect: cmd=cmd > log
logger.info('%s command: %s'%(self.taskname, repr(cmd),))
produtil.run.checkrun(cmd,logger=logger) #第635行
findme="Successful completion"
geogrid_log=None
for glog in ( 'geogrid.log', 'geogrid.log.0000',
'geogrid.log.00000' ):
if os.path.exists(glog):
geogrid_log=glog
else:
logger.info('%s: does not exist.'%(glog,))
if geogrid_log is None:
msg='WPS Geogrid failed: could not find geogrid log file.'
logger.error(msg)
self.state=FAILED
raise GeogridNoLog(msg)
logger.info('%s: will check for %s'%(geogrid_log,findme))
if not check_last_lines(geogrid_log,findme):
raise WPSError('%s: did not find "%s"'
%(geogrid_log,findme))
self.deliver_products(keep=False,relink=True)
init.py
class HWRFInit(HWRFTask):
......
def run_through_anl(self):
"""!Runs the following jobs, if they are enabled: geogrid,
ungrib, metgrid, init-length prep_hybrid, init-length real_nmm
and wrfanl."""
self.log().warning('run_through_anl')
if 'geogrid' in self.__dict__:
set_ecflow_label('status','[geogrid] process terrain')
self.geogrid.run() #第559行
set_ecflow_label('status','[ungrib] process parent GRIB')
self.ungrib.run()
set_ecflow_label('status','[metgrid] interpolate horizontally')
self.metgrid.run()
if 'prep' in self.__dict__:
set_ecflow_label('status','[prep] process parent spectral')
for i in xrange(len(self.ibdytimes)):
t=self.ibdytimes[i]
if t>self.initlen: break
self.prep.run_ipiece(i)
set_ecflow_label('status','[realinit] make wrfinput file')
self.realinit.run()
set_ecflow_label('status','[runwrfanl] make wrfanl files')
self.runwrfanl.run()
set_ecflow_label('status','Passed through anl.')
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/126292.html
上一篇:scrapy中無法呼叫函式
