source: trunk/CHANGES

Last change on this file was 323, checked in by bas, 5 months ago

Added some documentation and improve some error handeling

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