projects
/
paralleljobs.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7eb9198
)
-s also shows number of running jobs
author
Stefan Huber <shuber@sthu.org>
Wed, 8 May 2013 13:05:56 +0000
(15:05 +0200)
committer
Stefan Huber <shuber@sthu.org>
Wed, 8 May 2013 13:05:56 +0000
(15:05 +0200)
paralleljobs.py
patch
|
blob
|
history
diff --git
a/paralleljobs.py
b/paralleljobs.py
index 6a1da0df60929f5aa29367fc1f5c06c1a0bc9b45..535921c758b70c6bd09707e05a50ff31cdd9281d 100755
(executable)
--- a/
paralleljobs.py
+++ b/
paralleljobs.py
@@
-23,6
+23,9
@@
def printStatusInfo(conn):
c.execute("SELECT count(id) FROM jobs WHERE done=1;")
nodone, = c.fetchone()
c.execute("SELECT count(id) FROM jobs WHERE done=1;")
nodone, = c.fetchone()
+ c.execute("SELECT count(id) FROM jobs WHERE started=1;")
+ nostarted, = c.fetchone()
+
c.execute("SELECT sum(workloadestm) FROM jobs WHERE done=1;")
wldone, = c.fetchone()
if wldone == None:
c.execute("SELECT sum(workloadestm) FROM jobs WHERE done=1;")
wldone, = c.fetchone()
if wldone == None:
@@
-36,8
+39,8
@@
def printStatusInfo(conn):
perdone = 100.0*float(nodone)/float(nototal)
perwl = 100.0*float(wldone)/float(wltotal)
perdone = 100.0*float(nodone)/float(nototal)
perwl = 100.0*float(wldone)/float(wltotal)
- print("%d (%.1f%%) of %d jobs
done. %.1f%% of the workload finished
." % \
- (nodone, perdone, nototal, perwl))
+ print("%d (%.1f%%) of %d jobs
and %.1f%% of the workload done. %d jobs are running
." % \
+ (nodone, perdone, nototal, perwl
, nostarted-nodone
))
def createPropertiesTable(conn, propdef):
conn.execute("BEGIN EXCLUSIVE")
def createPropertiesTable(conn, propdef):
conn.execute("BEGIN EXCLUSIVE")
@@
-152,29
+155,29
@@
def usage():
"""Print usage text of this program"""
print("""
"""Print usage text of this program"""
print("""
-Take the jobs defined in
jobs table of the given database and process one job
+Take the jobs defined in
the jobs table of the given database and process one
after the other. Multiple instances may be launched against the same database.
Usage:
after the other. Multiple instances may be launched against the same database.
Usage:
- {0} [OPTIONS] [COMMANDS] -d
database
+ {0} [OPTIONS] [COMMANDS] -d
DB
{0} -h
COMMANDS:
{0} -h
COMMANDS:
- -c
cmdfn add jobs from the file with list of commands
+ -c
FILE add each line as a job resp. job's command to DB
-h print this text
-h print this text
- -s print
progres
s information
+ -s print
statu
s information
-w do work and process jobs
OPTIONS:
-w do work and process jobs
OPTIONS:
- -d
database
the database to process
- -n
num
in -w mode, only process num-many jobs
- -p
cols-def
create properties table with SQL column spec
+ -d
DB
the database to process
+ -n
NUM
in -w mode, only process num-many jobs
+ -p
COL-DEF
create properties table with SQL column spec
-v verbose output
Commands may be combined in one call of {0}.
A list of jobs may be importet line-by-line from a file using the -c option.
-v verbose output
Commands may be combined in one call of {0}.
A list of jobs may be importet line-by-line from a file using the -c option.
-Every job may output to stdout or stderr
a string
of the form
+Every job may output to stdout or stderr
one or more strings
of the form
DB-PROPERTIES: {{ "key": "value", "key2": 1.23, "key3": True }}
It is assumed that a table 'properties' exists with the columns jobid, key,
key2, and key3. The corresponding values are inserted into this table. Using
DB-PROPERTIES: {{ "key": "value", "key2": 1.23, "key3": True }}
It is assumed that a table 'properties' exists with the columns jobid, key,
key2, and key3. The corresponding values are inserted into this table. Using
@@
-183,7
+186,7
@@
column definitions in SQL style.
The jobs table also contains a 'workloadestm' column that is used when
estimating the finished workload so far. The entries default to 1 and may be
The jobs table also contains a 'workloadestm' column that is used when
estimating the finished workload so far. The entries default to 1 and may be
-
set externally
.
+
adjusted
.
Examples:
# create cmds.sh with jobs
Examples:
# create cmds.sh with jobs