source: trunk/CHANGES @ 367

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

changelog

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