PBS.3pm

Langue: en

Autres versions - même langue

Version: 2007-05-24 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

PBS - Perl extension for PBS

SYNOPSIS

   use PBS;
 
   my $con=PBS::pbs_connect("");
   my $status=PBS::pbs_statnode($con, undef, [qw/state np ntype status/], undef);
 
   foreach (@{$status}) {
       print $_->{name}, "\n";
       foreach (@{$_->{attribs}}) {
          print "     ",$_->{name},
                $_->{resource} ? (".", $_->{resource}) : "",
                " = ",$_->{value}, "\n";
       }
       print "\n";
   }
   PBS::pbs_disconnect($con);
 
 

ABSTRACT

Perl wrapper extension for the PBS libraries. The API is almost exactly the same as the original C API, except that this modules handles the linked lists for you. See the scripts in the demos directory.

DESCRIPTION

Perl wrapper extension for the PBS libraries (as from OpenPBS or Torque). This allows you to stat jobs, stat nodes, submit jobs, alter jobs, etc. all directly from Perl. Specifally, the "ifl", "rpp", and "rm" interfaces are supported; but the "rpp" interface is untested. Support for the "tm" API may come in a future version.

struct attrl

Several functions in the C API accept a linked list of "struct attrl". In its place, this module allows you to instead pass a simple scalar, a reference to an array, or a reference to a hash. If you pass a simple scalar, it is interpreted as a single "name" in the struct. If you pass in an array ref, it is interpreted as a list of "name" in the linked list. If you pass a hash ref, it is interpreted as a list of "name" and "value" in the list. If any "name" contains a ``.'', it is split as a "name" and "resource" (similar to the output of "qstat -f"). For example, the following should demonstrate:
    $attrl="job_state"; # passes a single struct
 
    # passes two structs, the second has "resource" set to "nodect"
    @attrl=qw/job_state Resource_List.nodect";
 
    # passes two structs, the second has a value
    %attrl = ( jobs_state => "", Resource_List.walltime => "100:00:00";
 
 

struct attrlop

Implemented exactly like "struct attrl" above.

struct batch_state

Several functions return a linked list of "struct batch_status". In its place, this module returns a reference to an array. The array is a list of hash refs of "attrl" structures. The "attribs" value points to another array refs. The easiest way to demostrate this is to look at the sample code in the demos directory, or use Data::Dumper.

The name and resource members in the attrl list are munged together in the same fashion.

EXPORT

None by default.

To get a list of export tags, type:
   perl -MPBS -MData::Dumper -e 'print Dumper(\%PBS::EXPORT_TAGS)'

At the time of this writing, this includes:

     monitor => [qw[pbs_connect pbs_default pbs_statjob pbs_disconnect
                    pbs_statque pbs_statserver pbs_statnode]],
     manager => [qw[pbs_deljob pbs_geterrmsg pbs_holdjob pbs_locjob
                    pbs_manager pbs_movejob pbs_msgjob pbs_orderjob
                    pbs_rerunjob pbs_rlsjob pbs_runjob pbs_selectjob
                    pbs_sigjob pbs_submit pbs_terminate]],
     resc    => [qw[pbs_rescquery pbs_rescreserve pbs_rescrelease
                    totpool usepool]],
     rm      => [qw[openrm closerm downrm configrm addreq allreq
                    getreq flushreq activereq fullresp]],
     rpp     => [qw[rpp_open rpp_bind rpp_poll rpp_io rpp_read rpp_write
                    rpp_close rpp_getaddr rpp_flush rpp_shutdown rpp_terminate
                    rpp_rcommit rpp_wcommit rpp_skip rpp_eom rpp_getc rpp_putc
                    netaddr crc rpp_fd rpp_dbprt ]],
 
 

All symbols inside EXPORT_TAGS are also in EXPORT_OK.

BUGS

The entire API is not yet implemented and/or documented.

SEE ALSO

See pbs_ifl.h for a list of functions, structs, and constants. All PBS manpages. "PBS::rm(3pm)", "PBS::rpp(3pm)"

AUTHOR

Garrick Staples, <garrick@usc.edu> Copyright 2004, 2005, 2006 by Garrick Staples

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.