mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
print how long run has left
This commit is contained in:
parent
ae98425c21
commit
039dcdf0cc
1 changed files with 5 additions and 3 deletions
|
@ -624,7 +624,7 @@ def build_cmds(args):
|
||||||
# fi
|
# fi
|
||||||
# }
|
# }
|
||||||
|
|
||||||
def summarizeTileCounts(devs):
|
def summarizeTileCounts(devs, endTime):
|
||||||
data = [dev.getTilesCount() for dev in devs]
|
data = [dev.getTilesCount() for dev in devs]
|
||||||
nDevs = len(data)
|
nDevs = len(data)
|
||||||
totalTiles = 0
|
totalTiles = 0
|
||||||
|
@ -647,7 +647,8 @@ def summarizeTileCounts(devs):
|
||||||
|
|
||||||
fmtData[2]['data'].append('{:{width}d}'.format(tupl[2], width=colWidth))
|
fmtData[2]['data'].append('{:{width}d}'.format(tupl[2], width=colWidth))
|
||||||
|
|
||||||
print('devs left: {}; tiles left: {}'.format(nDevs, totalTiles))
|
print('')
|
||||||
|
print('devs left: {}; tiles left: {}; {}/{}'.format(nDevs, totalTiles, datetime.datetime.now(), endTime ))
|
||||||
fmt = '{head:>%d} {data}' % headWidth
|
fmt = '{head:>%d} {data}' % headWidth
|
||||||
for datum in fmtData: datum['data'] = ' '.join(datum['data'])
|
for datum in fmtData: datum['data'] = ' '.join(datum['data'])
|
||||||
for datum in fmtData:
|
for datum in fmtData:
|
||||||
|
@ -659,6 +660,7 @@ def countCores():
|
||||||
def run_cmds(args, devs):
|
def run_cmds(args, devs):
|
||||||
nCores = countCores()
|
nCores = countCores()
|
||||||
endTime = datetime.datetime.now() + datetime.timedelta(seconds = args.TIMEOUT)
|
endTime = datetime.datetime.now() + datetime.timedelta(seconds = args.TIMEOUT)
|
||||||
|
print('will run until', endTime)
|
||||||
LOOPCOUNT = 0
|
LOOPCOUNT = 0
|
||||||
|
|
||||||
while len(devs) > 0:
|
while len(devs) > 0:
|
||||||
|
@ -670,7 +672,7 @@ def run_cmds(args, devs):
|
||||||
break
|
break
|
||||||
|
|
||||||
LOOPCOUNT += 1
|
LOOPCOUNT += 1
|
||||||
if 0 == LOOPCOUNT % 20: summarizeTileCounts(devs)
|
if 0 == LOOPCOUNT % 20: summarizeTileCounts(devs, endTime)
|
||||||
|
|
||||||
dev = random.choice(devs)
|
dev = random.choice(devs)
|
||||||
if not dev.running():
|
if not dev.running():
|
||||||
|
|
Loading…
Reference in a new issue