python脚本在超算上提交作业时出错

weixin_45907705 2019-11-20 09:34:30
用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=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.')
...全文
397 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
WilliamHuangSt 2019-11-21
  • 打赏
  • 举报
回复
引用 1 楼 WilliamHuangSt的回复:
csdn有个东西叫代码框,直接复制还是python这种语言,很难看清的。
而且我在用手机刷,看的更辛苦。
WilliamHuangSt 2019-11-21
  • 打赏
  • 举报
回复
csdn有个东西叫代码框,直接复制还是python这种语言,很难看清的。
weixin_45907705 2019-11-21
  • 打赏
  • 举报
回复
脚本太长了,有没有办法上传整个脚本呢?
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=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.')

37,743

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • WuKongSecurity@BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧