source: trunk/CHANGES @ 317

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

some more documentation for the new pbsmon option

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