comparison bin/plinks.py @ 11:b0d9fe66ce8a

give up on mpiexec_mpt
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Tue, 25 Feb 2020 18:33:22 +0000
parents a33db8e3f51c
children 3bc1d24363a1
comparison
equal deleted inserted replaced
10:a33db8e3f51c 11:b0d9fe66ce8a
17 try: 17 try:
18 (links,limited)=run(f) 18 (links,limited)=run(f)
19 if limited: 19 if limited:
20 print("%s\t%s\tProcessing limited after timeout"%( 20 print("%s\t%s\tProcessing limited after timeout"%(
21 datetime.now().isoformat(),fno),file=bf) 21 datetime.now().isoformat(),fno),file=bf)
22 bf.flush()
22 if bool(links) and (links.get('scrape',False) or 23 if bool(links) and (links.get('scrape',False) or
23 links.get('annot',False)): 24 links.get('annot',False)):
24 gf+=1 25 gf+=1
25 with open('links_%s_%s'%(tarnum,fno),'w') as of: 26 with open('links_%s_%s'%(tarnum,fno),'w') as of:
26 for k in links.keys(): 27 for k in links.keys():
28 print("%s\t%s"%(k,l),file=of) 29 print("%s\t%s"%(k,l),file=of)
29 except Exception as e: 30 except Exception as e:
30 if str(e)=='Unexpected EOF': 31 if str(e)=='Unexpected EOF':
31 print("%s:\t%s\t%s\t%s"%(datetime.now().isoformat(), 32 print("%s:\t%s\t%s\t%s"%(datetime.now().isoformat(),
32 tarnum,fno,e),file=bf) 33 tarnum,fno,e),file=bf)
34 bf.flush()
33 else: 35 else:
34 print("%s: "%(datetime.now().isoformat()),end='',file=bf) 36 print("%s: "%(datetime.now().isoformat()),end='',file=bf)
35 traceback.print_exc(file=bf) 37 traceback.print_exc(file=bf)
36 38 bf.flush()
37 if (path.exists('/dev/shm/stopJob')): 39 if path.exists('stopJob'):
38 print("%s: Quiting early: %s %s"%(datetime.now().isoformat(),tarnum,fno), 40 print("%s: Quiting early: %s %s"%(datetime.now().isoformat(),tarnum,fno),
39 file=sys.stderr) 41 file=sys.stderr)
42 sys.stderr.flush()
40 exit(1) 43 exit(1)
41 now=datetime.now().isoformat() 44 now=datetime.now().isoformat()
42 print('%s: exiting from %s having found %s files with links out of %s'%(now, 45 print('%s: exiting from %s having found %s files with links out of %s'%(now,
43 tarnum, 46 tarnum,
44 gf, 47 gf,