source: trunk/CHANGES @ 358

Last change on this file since 358 was 358, checked in by martijk, 6 years ago

added basic compatibilty with python 3

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