source: trunk/CHANGES @ 340

Last change on this file since 340 was 340, checked in by bas, 9 years ago

added release.json file for freecode.club
and updated CHANGEs file

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