source: trunk/CHANGES @ 316

Last change on this file since 316 was 316, checked in by bas, 10 years ago

Dennis Stam:

  • fixed docdir error, closes #39
  • added a new option to examples/new_rack_pbsmon.py -p/--property
  • improved the autoconf setup
  • Property svn:keywords set to Id
File size: 23.2 KB
Line 
1=========== 4.4.1
2 * new_rack_pbsmon.py: Added option -p/--property to filter on torque node properties
3 Requested by: Willem Vermin and Wim Rijks
4 Author: Dennis Stam
5
6 * Fixed docdir bug in configure.in and Makefile.in, closes #39
7 Author: Dennis Stam
8
9=========== 4.4.0
10 * Drop support for versions older then 2.4
11 Author: Bas van der Vlies
12
13 * Added support for torque version >= 4.2
14 Author: Bas van der Vlies
15
16 * rewrote setup.py.in
17 Inspired by: stijn dot deweirdt at ugent dot be
18 Author: Bas van der Vlies
19
20 * docdir is now configurable, closes #37
21 Author: jens dot timmerman add ugent dot be
22 Applied by: Bas van der Vlies
23
24 * The swig development environment to generate the pbs_python package
25   is now available at:
26    - svn co https://oss.trac.surfsara.nl/pbs_python/svn/devel
27
28=========== 4.3.7
29 * pbs_jobmonitor/pbs_joblogin ported to torque 2.5 to fix jobarrays
30  Author: Willem Vermin (SURFsara)
31  Applied by: Bas van der Vlies
32 
33=========== 4.3.6
34 * Modified sara_nodes.py and new_rack_pbsmon.py so:
35   - We using argparse instead of OptionParser
36   - Changed the print statement to an print function which will work with Python 2.5+
37   - Removed module PBSAdvancedParser.py
38   Author: Dennis Stam
39
40=========== 4.3.5
41 * PBSQuery bugfix, parsing of node status line with multiple EVENT: settings
42   was wrong
43   Author: Bas van der Vlies
44
45 * Added an example how to make use of the EVENT status message:
46    - examples/pbs_script.sh
47   Author: Bas van der Vlies
48
49 * implemented __nonzero__ for PBS dictionary, closes #33, eg:
50    status = getjob(id)
51    if status:
52        do something
53    else:
54        no job
55  Author: Bas van der Vlies
56
57 * PBSQuery bugfix. getjob() can now handle short jobname, eg:
58    * p.getjob('6073545')
59
60   Author: Willem Vermin (SARA) & Bas van der Vlies
61
62 * added an example: pbs_jobmonitor shows the output of top
63   -u user on the node
64    - one cycle of top
65    - user: the user the job belongs to
66
67   renamed as pbs_joblogin logs in to the node as the user
68   who invokes this script (os.getenv('USER'))
69
70   Author: Willem Vermin (SARA)
71 
72=========== 4.3.3
73 * New generated files for pbs_wrap.c and pbs.py to support python 3.X versions
74   Reported by: Steve Traylen <steve dot traylen add cern dot ch>
75   Author: Bas van der Vlies
76
77 * Fixed AdvancedParser when using 01-12 range the zero was not appended.
78   Reported by: Ramon Bastiaans
79   Author: Dennis Stam
80
81 * examples/sara_nodes.py: Catch the PBSQuery error if we can not make a
82   connection with the batch server and exit the program.
83   Author: Bas van der Vlies
84
85 * Remove the debian dependency on AdvancedParser. We now have
86   our own PBSAdvanceParser so it does not conflict with other SARA
87   packages.
88   Reported by: Ramon Bastiaans (SARA)
89   Fixed by: Bas van der Vlies
90
91 * Make pbs_torque only dependend on libtorque instead of torque and adjusted
92   the maintainer of the package, closes #30
93   Reported by: Guillermo Marcus  <guillermo dot marcus add@gmail dot com>
94   Fixed by: Bas van der Vlies
95   
96=========== 4.3.0
97 * new_rack_pbsmon.py: For backward compatibility added -a/--all option.
98   Has the same functionality as -s/--summary
99   Author: Bas van der Vlies
100
101 * Added some license info to debian package and include GPL and LGPL 3.0
102   files.
103   Suggested by: W. Trevor King <wking at drexel dot edu>
104
105 * PBSQuery.py: Added support for new feature in node status field:
106    * message=EVENT:<key=value:>+
107    * message=ERROR <text>
108
109  Added the following syntax for node:
110        * node['error']
111    * node['event']
112
113  eg: node: n1
114    state = free
115    np = 8
116    properties = ib,switch1,highmem
117    ntype = cluster
118    jobs = 0/567403.sara.nl, 1/567403.sara.nl
119    status = ..,loadave=0.00,message=EVENT:sample.time=1288864220.003:cputotals.user=0:iconnect.pktout=0,netload=3487600394,state=free,...
120
121  example code:
122        p = PBSQuery()
123    node = p.getnode(n1)
124    print node.event['sample.time']
125    print node['event']['sample.time']
126
127   Requested by: Roy Dragseth <roy dot dragseth add uit dotno>
128   Author: Bas van der Vlies
129
130=========== 4.2.0
131 * Updated LICENSE file to LGPLV3. Thanks to Justin Bronder
132   (jsbronder add gentoo dot org) for the information and
133   explanation.
134
135 * examples/pbsmon.py. Patched so it also works for torque 2.5
136   Author: Stijn De Weirdt stijn dot deweirdt at ugent dot be
137   Applied by: Bas van der Vlies
138
139 * setup.py.in changed determine which torque version is installed
140   so we also support snapshots.
141   Author: Mark Roberts ( mark at gingergeeks dot co dot uk)
142   Applied by: Bas van der Vlies
143
144 * PBSQuery:
145   - get_nodes function for jobs now works for old and new datastructure and
146     gives correct results if unique=True
147     Reported by + idea for patch: Shunjie Lau (eijnuhs add gmail dot com)
148     Author: Bas van der Vlies
149
150 * Added AdvanceParser module. new_rack_pbsmon.py and sara_nodes.py make use of
151   this module
152   Author: Dennis Stam (Dennis dot Stam at sara dot nl)
153
154 * examples/new_rack_pbsmon.py:
155     - Better specification for node expression
156     - added a new option -l/--list to list the state of a nodes and which job
157       is running on it, eg:
158             new_rack_pbsmon.py - l gb-r[1-3]n[3-6] gb-r4[n1-20]
159
160   Authors: Dennis Stam & Bas van der Vlies
161   Applied by: Bas van der Vlies
162
163 * examples/sara_nodes.py:
164   An utility to set/clear notes for multiple nodes, see ..
165   Author: Dennis Stam (Dennis dot Stam at sara dot nl)
166
167 * setup.py.in:
168   Added support for runtime-libraries when torque is installed in a non-default
169   location, closes #22
170   Author: Mattias (slabanja at chalmers dot se)
171   Applied by: Bas van der Vlies
172
173 * Changed build system for debian
174   Authors: Dennis Stam & Bas van der Vlies
175
176=========== 4.1.2
177 * examples/new_rack_pbsmon.py now uses the new PBSQuery data
178   structure.
179   Author: Bas van der Vlies
180
181 * PBSQuery:
182     - fixed and error in get_jobs function for nodes. Did not
183       support new data structure and uniq did not work.
184       Authors: Shunjie Lau <eijnuhs at gmail dot com> and Bas van der Vlies
185
186=========== 4.1.0
187 * Delete function pbs.version() replaced by
188    * pbs.version
189        This is a string variable
190    * pbs.version_info
191        Is a tuple variable. So we can use it in scripts
192
193   This analogue with sys module, closes #20
194
195   Requested by: Dennis Stam ( Dennis dot Stam add sara dot nl )
196   Author: Bas van der Vlies
197
198 * More robust make/configure/setup.py
199   Reported by:
200        - Saidi, Yacine <saidi add linmpi dot mpg dot de>
201        - Shunjie Lau <eijnuhs add gmail dot com>
202   Author: Bas van der Vlies
203
204
205 * Only use the pbs_wrap.c and pbs.py 2.4 version for torque version 2.4.7 and higher.
206   Reported by: Saidi, Yacine <saidi add linmpi dot mpg dot de>
207   Author: Bas van der Vlies
208   
209=========== 4.0.2
210  * Quick fix so we do not get any undefined symbols. Forgot to
211    add the torque library when we compile the package.
212    Reported by: Shunjie Lau ( eijnuhs add gmail dot com)
213    Author: Bas van der Vlies
214
215=========== 4.0.1
216  * Fixed a bug in setting the right library path  for compiling.
217    Reported by: Chad Vizino ( vizino add psc dot edu )
218    Author: Bas van der Vlies
219   
220=========== 4.0.0
221  * pbs.py added some new functions for 2.4 version:
222    - pbs_fbserver(void);
223    - pbs_get_server_list(void);
224    - pbs_sigjobasync(int connect, char *job_id, char *signal, char *extend);
225    - pbs_alterjob_async(int connect, char *job_id, struct attrl *ATTRL, char *extend);
226    - pbs_checkpointjob(int connect, char *job_id, char *extend);
227    - log_ext(int,char *,char *,int);
228    - log_init(char *, char *);
229    - log_remove_old(char *,unsigned long);
230
231    Note: version 2.1.X is still supported
232
233  * autotools environment
234    - Added support for finding pbs-config (borrowed for mpiexec source)
235    - Detecting which version of torque is installed
236    - only support installations that have pbs-config installed.
237    - Removed old code for installations that do not a have pbs-config
238      installed.
239
240  * PBSQuery.py
241    - There was a bug in the new data interface (Resource_List for jobs)
242      Reported & Patch by: Mark Roberts ( mark at gingergeeks dot co dot uk)
243      Applied by with some minor changes: Bas van der Vlies
244
245    - The new data structure is the default. You can switch back to the old
246      one with:
247            p = PBSQuery()
248            p.old_data_structure()
249
250      Author: Bas van der Vlies
251
252   * examples/ha_server.py
253     An example how to use the High Availabilty torque functions
254     Author: Bas van der Vlies & Mark Roberts ( mark at gingergeeks dot co dot uk )
255
256=========== 3.6.0
257  * pbs, new generated pbs_wrap.c, pbs.py fixes a bug in pbs_runjob()
258    Reported by: Dennis Stam
259    Fixed by: Bas van der Vlies
260
261=========== 3.5.0
262  * PBSQuery
263        The class functions of node, job and queue support old and new data
264        structure.
265
266        Changed the behaviour of the new data stucture, We can use it as
267        dictionary and as class attribute, this is equivalent, eg:
268          - print node['np'] and print node.np
269
270        for a node we parse the 'status' line and split on '=' char, You now can
271        use these statements, eg
272          - print node.status.arch     (node['status'].arch or node['status']['arch'])
273          - print node.status.nsession
274
275        for a job we parse the 'Variable_List' line and split on '=' char, You now can
276        use the statements, eg:
277          - print job.Variable_List.PBS_O_WORKDIR
278          - print job.Variable_List.PBS_O_HOME
279
280        For more info see examples/new_interface.py
281
282    Author: Bas van der Vlies
283
284 * new_rack_pbsmon.py
285        Rewrite to new data structure and automatically determine how many nodes
286        and racks cluster has and skip printing of empty racks (default), use -w/--wide
287        for old behaviour.
288
289   Author: Bas van der Vlies
290
291
292=========== 3.2.0
293        - PBSQuery:
294          New data structure. In the old structure it is a dictionary
295          with a value and the value is a string. This is changed
296          that dictionary values are now of type list or dictionary depends
297          on the value of the keyword, eg for a node:
298            - np = 2:
299              * node['np'] = [ '2' ] 
300
301            - properties = cores2, mem4gb, parallel
302              * node['properties'] = [ 'cores2', 'mem4gb', 'parallel' ]
303
304            - status = arch=x86_64,sessions=22599,,size=70627864kb, ...
305              * node['status']['arch'] = [ 'x86_64' ]
306              * node['status']['sessions'] = [ '222599' ]
307              * ...
308
309         The data structure is activated by the function:
310          * new_data_structure()
311
312        In a future release it will be come the default.
313        example:
314                p = PBSQuery()
315                p.new_data_structure()
316
317                nodes = p.getnodes()
318                print nodes.np, nodes['np']
319
320        Author: Bas van der Vlies
321
322        - PBSQuery
323          For old and new data structure we now can use another syntax:
324           * node['np'] and node.np are equivalent
325
326          This new syntax works for all keywords.
327
328        Author: Bas van der Vlies
329
330        - Added iter object for job, node, queue and server objects, eg:
331          node = p.getnode('gb-r1n1')
332          print node.name
333          for attrib in node:
334                print '%\t%s = %s' %(attrib, node[attrib])
335        Author: Bas van der Vlies
336
337        - fixed an error in getnode, getqueue and getjob, return empty
338          dictionary if not found
339        Author: Bas van der Vlies
340       
341        - New build system for rpm packages, make -f Makefile.rpm
342          Author: Michel Jouvin <jouvin add lal dot in2p3 dot fr>
343
344        Applied: Bas van der Vlies
345
346=========== 3.0.1
347        - PBSQuery
348                * Removed a testing code line
349                Reported By: sam @ vpac dot org
350                Fixed by: Bas van der Vlies
351
352=========== 3.0.0
353        - PBSQuery
354                * Cleaned up some old lines of code which didn't do anything.
355                * Changed the returnvalue of getqueue, getnode and getjob. Now
356                  they return an instance of the object, instead of a dict.
357                  This is API change so we bumped the version to 3.0.0
358                * Now the getnode-function accepts the short name as well as
359                  the long name as an argument.
360
361                Author: Sil Westerveld <Sil.Westerveld@sara.nl>
362
363        - pbs.py, _pbs.so, PBSQuery.py
364                * Fixed a memory leak when used in daemon mode
365                Author: Bas van der Vlies <basv@sara.nl>
366
367=========== 2.9.8
368        - pbs_python.spec file patch added libdir and python defines so it
369          will build for RHEL5.1/CentOS 5.1
370          by        : Michael Sternberg <sternberg add anl dot gov>
371          applied by: Bas van der Vlies
372
373        - Updated the header files for pbs_python. So it can use some new
374          defines variables/defines, eg:
375                * ATTR_NODE_status
376                * ATTR_NODE_note
377                * ...
378          Added by: Dennis Stam <dennis.stam@sara.nl>, Bas van der Vlies
379
380        - Two new functions to log.h:
381                log_roll(int size);
382                log_size(void);
383          Added by: Bas van der Vlies
384
385        - We now have proper destructors (free memory) in SWIG for attrl and
386          attropl attributes.
387          Added by: Bas van der Vlies
388
389        - PBSQuery
390                * Added getnodes_with_property() function. This will get all nodes with
391                  a certain property, eg:
392                   - get all nodes with property 'cores8' and return all attributes:
393                      getnodes_with_property('cores8')
394               
395                   - get all nodes with property 'cores2' and only return the
396                     attributes 'state' and 'properties':
397                      attrl = [ 'state', 'properties' ]
398                      getnodes_with_property('cores2', attrl)
399               
400                     Only for torque version > 2.1.0
401             
402                Added by: Bas van der Vlies
403
404                * Added to class node the function
405                 - get_jobs(self, unique=None)
406                   Returns a list of the currently running job-id('s) on the node.
407                Added by: Sil Westerveld <Sil.Westerveld@sara.nl>
408
409                * Added get_server_name() function.
410                  This will return the PBS-server's name.
411                Added by: Sil Westerveld <Sil.Westerveld@sara.nl>
412
413                * Added to class _PBSobject the function
414                  - uniq(self, list)
415                    Filters out unique items of a list.
416                Added by: Sil Westerveld <Sil.Westerveld@sara.nl>
417
418                * Added to class job the function
419                  - get_nodes(self, unique=None)
420                    Returns a list of the nodes which run the job.
421                Added by: Sil Westerveld <Sil.Westerveld@sara.nl>
422
423=========== Version 2.9.4
424        -  Function pbs.pbs_geterrmsg does not exits any more is
425           replaced by pbs.error():
426                errno, text = pbs.error()
427                print errno, text
428           Reported by: pk at q-leap dot com
429           Fixed by   : Bas van der Vlies
430
431        - PBSQuery.py
432           * Added get_version() for server class, returns the version of
433             the batch server
434             Added by    : Bas van der Vlies
435
436           * Added get_nodes() for job class, returns a list of nodes on
437             which the job is run
438             Added by    : Bas van der Vlies
439
440           * PBSQuery.py rewrite make use of UserDict module.
441             Suggested by: Ramon Bastiaans
442             Fixed by    : Bas van der Vlies
443
444=========== Version 2.9.2
445        - The function pbs_rescquery() did not work. Fixed it
446        - The function avail(), did not work fixed it
447        - The functions pbs_rescreserve and pbs_rescrelease did not work
448          fixed it
449
450        - Fixed a bug in new_rack_pbsmon.py. Counting of serial
451          nodes was wrong and state down has topmost priority
452
453=========== Version 2.9.0
454        - Added support for new torque build system 2.1.0
455        - Added new_rack_pbsmon.py
456          Authors: Walter de Jong & Bas van der Vlies
457
458=========== Version 2.8.2
459
460Configure has a new option:
461        --with-pbsdir=PATH
462
463If set it will use PATH specified as argument to
464find the pbs/torque libraries. If unset it will use
465some useful defaults to find the libaries.
466Suggested by: Troy Baer
467
468PBSQuery.py:
469        - If we can not make a connection with the server
470          then raise an exception and let the programmer
471          decides what to do.
472
473pbs_python.spec:
474        - It can now handle mode bits
475          Author: Martin Pels from SARA
476       
477=========== Version 2.8.0
478
479setup.py:
480        - Added /usr/lib to PBS_LIB_DIR
481
482pbs.py:
483        - Added new function "pbs.error()". This function checks if
484          an error has occured with a pbs function, eg:
485            task_id = pbs.pbs_submit(c, attrl, "A.tsk", 'NULL', 'NULL')
486            error_number, err_txt = pbs.error()
487            if error_number:
488                print error_number, err_txt
489
490          prints the following message if script A.tsk does not exists:
491            15042 (qsub) cannot access script file
492
493pbs_python.spec:
494        - to make rpm packages from the source package, initial version
495        Author: Martin Pels from SARA
496
497README:
498        - Now requires python 2.1 and higher
499        - Explain how to build DEBIAN package
500
501=========== Version 2.7.10
502
503PBSQuery.py:
504        Fixed an error. You always got all resources from eg nodes
505        even when you supplied an attribute list where you only
506        requested the 'state' of the node.
507
508        Updated the inline python documentation
509
510=========== Version 2.7.9
511
512Fixed an error the previous version was in DEBUG mode. So
513you get an lot undesired output on the screen.
514
515debian package now also generated a package with the write
516version info.
517
518=========== Version 2.7.8
519
520Setup.py:
521        Can also handle ROCKS installations + the version
522        info is now the same as pbs.py
523        Thanks to: Roy Dragseth
524
525=========== Version 2.7.7
526
527PBSQuery module:
528  It can now be used in daemon programs. The pbs_server closes
529  the connection after an certain amount of time. This is fixed,
530  before every query there is an new connection and if the query
531  is finished the connection is closed.
532 
533=========== Version 2.7.6
534
535Now setup.py can also handle old Oscar Installations.
536Thanks To: Robin Humble
537
538Fixed an print statement fix in new_interface.py:
539Thanks To: Robin Humble
540
541Made some improvements for PBSQuery module:
542        - Updated the documentation
543        - Added the has_key() function to all
544          PBSObjects. So that the behaviour is similar to
545          an dictionary
546          Suggested By: Ramon Bastiaans
547       
548=========== Version 2.7.5
549 Added PBSQuery module.  This module requires pbs.py and it a simple module
550 for querying the pbs server. The documentation is in the module. Use for
551 example ipython to read it.
552
553 Written By: Roy Dragseth
554             Bas van der Vlies
555
556 eg: ( see also examples/new_interface.py)
557
558 from PBSQuery import PBSQuery
559 p = PBSQuery()
560
561 jobs = p.getjobs()
562 for name, job in jobs.items()
563        print job
564
565=========== Version 2.7.4
566 New versions fixes an bug in function pbs.pbs_statnode().
567 Reported by: Keith Poirier
568
569 Configure support:
570 Contributed By: Yaroslav Halchenko
571
572 Debian package support:
573 Contributed By: Yaroslav Halchenko
574
575 Added Support for Debuging the interface, You must edit pbs_wrap.c
576 and search for SARA_DEBUG:
577        #define SARA_DEBUG 1
578 Implemented by: Ramon Bastiaans
579
580 examples/pbsmon.py:
581        - Fixed an error when regex fails to determine node number,
582          no status was displayed
583        - It will now display and 'j' if the node is free for the batch
584          system and a job runs on the node (SMP-systems).
585 Changed by: Bas van der Vlies
586
587 examples/rack_pbsmon.py:
588        - An pbsmon that display node info per rack
589        - Edit the rack_pbsmon.py to adjust the values. It requires
590          that hostname contains rack and node id's,
591          eg: gb-r<number>n<number>
592 Contributed by: Walter de Jong
593
594=========== Version 2.7.3
595 The name SPBS is changed to the new name TORQUE (Tera-scale Open-source
596 Resource and QUEing manager).
597
598 The interface support OPENPBS and TORQUE.
599
600=========== Version 2.7.2
601 Some minor changes to include files. Now the Scalable PBS keywords
602 are also supported ( server attribute names: node_ping_rate and
603 node_check_rate). This does not interfere with the openpbs software.
604
605 pbsmon.py could not handle an one node cluster. Fixed it.
606
607=========== Version 2.7
608 Forgot to wrap the pbs_statfree() function. So we could not free
609 allocated memory from functions that return 'struct batch_status *'
610 like pbs_statjob().
611
612 pbsmon.py can now handle 2 and 3 digit hostnames. Patch supplied by
613 Daniel Olson
614
615=========== Version 2.6.1
616 Setup.py now checks if all openpbs libraries are installed to compile the
617 package.
618
619=========== Version 2.6
620
621 Fixed a bug in the pbs python module. Forgot to map the pbs_statjob()
622 function. This bug prevented to pass 'struct attrl' variables to this
623 function. Thanks to Evelyn Shiu for reporting this bug.
624
625
626=========== Version 2.5
627 Added the OpenPbs logging functions (log.h and liblog.a). There
628 is an example in the examples directory: logpbs.py
629
630 Fixed a bug in examples/resmom_info.py used the default port for
631 pbs_resmon if getservbyname fails.
632
633 Fixed a bug in resmom code. If the user has no permissions to query
634 the pbs_mom daemon a empty string is returned. Now we check for
635 the empty string. So we do not get a python exception.
636
637 Fixed a bug in setup.py forgot the exit statement when we did not
638 find the pbs libraries.
639
640=========== Version 2.3
641 Bugfix in the pbsnodes-a.py. Forgot to import the sys module.
642
643 Removed some obsolete code.
644
645 As for now we make use of the distutils module. So the package
646 is automatically compiled and installed in proper directories, usage:
647    python setup.py install
648 This requires that the package 'distutils' must be installed. As for
649 version 1.6 and higher it is in the distribution.
650
651 Added a function that prints the pbs python interface version. So we
652 can check if we have the right interface version:
653 import pbs
654 print pbs.version()
655 
656
657=========== Version 2.2
658
659In this release we can query the pbs_mom daemon with the aid of
660resource management functions:
661   pbs.openrm()
662   pbs.closerm()
663   pbs.downrm()
664   pbs.configrm()
665   pbs.addreq()
666   pbs.allreq()
667   pbs.flushreq()
668   pbs.activereq()
669   pbs.fullresp()
670   pbs.getreq()
671
672There is also a python function:
673   pbs.get_mom_values(id, [list]):
674     id   - connection id of pbs.openrm(node-name, port-number)
675     list - Is a optional paramter. A list of resource keywords
676
677   If 'list' is not supplied then this function will get the values
678   for the standard resource keywords, eg uname, loadave, .. + 'arch'
679   depended keywords. The arch feature is only implemented for linux,
680   but it can easily be ported to other oses.
681
682   if 'list' is supplied then we only fetch values for the keywords
683   that are in the list.
684
685   The function returns a dictonary. The keys are the resource keywords.
686
687   See 'resmom_info.py' for a example of this new feature.
688
689=========== Version 2.0
690
691The previous version was a simple interface above the PBS C API LIB.  This
692interface has gone a major changes. The most noticeable change is  that
693the functions accept/return Python lists instead of C-lists.  So you can now
694use standard Python syntax for manipulating Python lists. If you are familar
695with the Python syntax then you will appreciate this new interface.
696
697NOTE:
698  This interface is NOT compatible with the old one
699
700Here are some guidelines to convert your code to the new one:
701
702The constructors for the struct has gone a major change:
703  old code:
704    temp = pbs.new_attrl();
705    attrl_p = pbs.attrlPtr(temp)
706    attrl_p.name = 'state'
707
708  new_code:
709     attr_l = pbs.new_attrl(1)   // Creates a list of attrl structs length 1
710     attr_l[0].name = 'state'
711
712
713The pbs_stat functions returns Python lists instead of C-lists. There is
714NO next field anymore:
715  old_code:
716    temp = pbs.new_attrl();
717    attrl_p = pbs.attrlPtr(temp)
718    attrl_p.this = 'NULL'
719
720    nodes = pbs.pbs_statnode(con, "", attrl_p, "NULL")
721
722    while nodes.this != 'NULL':
723      print nodes.name
724
725      node_attrl = nodes.attribs
726      while node_attrl.this != 'NULL':
727        print '\t', node_attrl.name, '=', node_attrl.value
728        node_attrl = node_attrl.next
729
730    nodes = nodes.next
731
732
733  new_code:
734    nodes = pbs.pbs_statnode(con, "", "NULL", "NULL")
735    for node in nodes:
736      print node.name
737      for attrib in node.attribs:
738        print '\t', attrib.name, '=', attrib.value
739
740Another advantage is you can use the print statement to show the
741connect of attrl and attropl classes:
742   attr_l = pbs.new_attrl(2)
743   attr_l[0].name = 'bas'
744   attr_l[0].value = 'van der Vlies'
745
746   print  attr_l[0]
747   >> (bas,,van der Vlies)
748   
749I hope these examples illustrate the changes. If you specify a wrong type
750for a function then function wil raise a Python exception.
Note: See TracBrowser for help on using the repository browser.