Last change
on this file since 234 was
234,
checked in by garonne, 18 years ago
|
Màj
|
-
Property svn:executable set to
*
|
File size:
918 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | #----------------------------------# |
---|
3 | # -- Author: V.Garonne |
---|
4 | # -- Date: 08/25/2006 |
---|
5 | # -- Name: tbroadcast |
---|
6 | # -- Description: main program |
---|
7 | #----------------------------------# |
---|
8 | |
---|
9 | import os |
---|
10 | import sys |
---|
11 | import string |
---|
12 | |
---|
13 | from tbroadcast import Scheduler |
---|
14 | |
---|
15 | if __name__ == '__main__': |
---|
16 | |
---|
17 | if len(sys.argv) ==1 : |
---|
18 | print 'Usage : > tbroadcast [-nb=<num_worker>] <command>' |
---|
19 | sys.exit(-1) |
---|
20 | |
---|
21 | num_worker = 20 |
---|
22 | for arg in sys.argv: |
---|
23 | if arg[0]=='-': |
---|
24 | if string.split(arg,'=')[0] == '-nb': |
---|
25 | num_worker = int (string.split(arg,'=')[1]) |
---|
26 | else: |
---|
27 | command = arg |
---|
28 | |
---|
29 | # we create a pool of num_worker worker threads |
---|
30 | #print 'num_worker', num_worker , command |
---|
31 | master = Scheduler (num_worker=num_worker) |
---|
32 | master.execute_all (command) |
---|
33 | |
---|
34 | sys.exit(-1); |
---|
35 | #--------- EoF --------# |
---|
Note: See
TracBrowser
for help on using the repository browser.