yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #07817
[Branch ~yade-dev/yade/trunk] Rev 2899: Fix file-creation error in yade-batch, when name of log-file is longer, than 255 symbols. The nam...
------------------------------------------------------------
revno: 2899
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: yade
timestamp: Thu 2011-07-21 15:36:28 +0200
message:
Fix file-creation error in yade-batch, when name of log-file is longer, than 255 symbols. The name cuts off now.
modified:
core/main/yade-batch.in
--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'core/main/yade-batch.in'
--- core/main/yade-batch.in 2011-04-07 12:19:45 +0000
+++ core/main/yade-batch.in 2011-07-21 13:36:28 +0000
@@ -419,6 +419,10 @@
if not script:
raise ValueError('When only batch table is given without script to run, it must contain !SCRIPT column with simulation to be run.')
logFile=logFormat.replace('$',script).replace('%',str(l)).replace('@',params[l]['description'])
+
+ if (len(logFile)>230): #For very long files, to prevent system errors.
+ logFile = logFile[0:230]+'_'+str(l)+logFile[-4:] #l is added to prevent name duplications.
+
if nCores>maxJobs:
if opts.forceThreads:
logging.info('Forcing job #%d to use only %d cores (max available) instead of %d requested'%(i,maxJobs,nCores))