Last change
on this file since 319 was
309,
checked in by bas, 9 years ago
|
Checkin the pbs swig development files
|
-
Property svn:executable set to
*
|
File size:
1.3 KB
|
Line | |
---|
1 | #!/usr/bin/python |
---|
2 | # |
---|
3 | import sys |
---|
4 | import pbs |
---|
5 | |
---|
6 | def test_init(): |
---|
7 | print 'Test init' |
---|
8 | t = pbs.new_attropl(1) |
---|
9 | print type(t) |
---|
10 | print str(t) |
---|
11 | |
---|
12 | w = pbs.new_attropl(2) |
---|
13 | print type(w) |
---|
14 | |
---|
15 | def test_getitem(): |
---|
16 | print 'Test getitem' |
---|
17 | w = pbs.new_attropl(2) |
---|
18 | b = w[0] |
---|
19 | c = w[1] |
---|
20 | |
---|
21 | b.name = 'bas' |
---|
22 | b.value = 'vlies' |
---|
23 | b.op = pbs.INCR; |
---|
24 | print type(b) |
---|
25 | print 'b', str(b) |
---|
26 | |
---|
27 | c.name = 'cbassssssssssss' |
---|
28 | c.value = 'cvlies' |
---|
29 | c.op = pbs.DECR |
---|
30 | print type(c) |
---|
31 | print 'c', str(c), repr(c) |
---|
32 | |
---|
33 | def test_loop(): |
---|
34 | print 'Loop' |
---|
35 | w = pbs.new_attropl(2) |
---|
36 | w[0].name = 'bas' |
---|
37 | w[0].value = 'man' |
---|
38 | |
---|
39 | w[1].name = 'jaap' |
---|
40 | w[1].value = 'man' |
---|
41 | |
---|
42 | for i in w: |
---|
43 | print i.name |
---|
44 | |
---|
45 | |
---|
46 | test_init() |
---|
47 | test_getitem() |
---|
48 | test_loop() |
---|
49 | |
---|
50 | print "Testing" |
---|
51 | pbs_server = pbs.pbs_default() |
---|
52 | con = pbs.pbs_connect(pbs_server) |
---|
53 | |
---|
54 | z = pbs.new_attropl(2) |
---|
55 | z[0].name = pbs.ATTR_u |
---|
56 | z[0].value = 'a403vink,zuidema' |
---|
57 | z[0].op = pbs.EQ |
---|
58 | |
---|
59 | z[1].name = pbs.ATTR_N |
---|
60 | z[1].value = 'runRollCV' |
---|
61 | z[1].op = pbs.EQ |
---|
62 | |
---|
63 | q = pbs.new_attropl(1) |
---|
64 | q[0].name = pbs.ATTR_u |
---|
65 | q[0].value = 'zuidema' |
---|
66 | q[0].op = pbs.EQ |
---|
67 | |
---|
68 | |
---|
69 | combine = z + q |
---|
70 | jobs = pbs.pbs_selectjob(con, z, "NULL") |
---|
71 | |
---|
72 | print type(jobs) |
---|
73 | for i in jobs: |
---|
74 | print i |
---|
75 | |
---|
76 | |
---|
77 | #print 'bla' |
---|
78 | #print pbs.ptrvalue(jobs,0) |
---|
79 | #if pbs.ptrvalue(jobs,0) == 'NULL': |
---|
80 | # print 'yes' |
---|
81 | # sys.exit(1) |
---|
82 | #print pbs.ptrvalue(jobs,1) |
---|
83 | #print pbs.ptrvalue(jobs,2) |
---|
84 | #print pbs.ptrvalue(jobs,3) |
---|
85 | |
---|
Note: See
TracBrowser
for help on using the repository browser.