[torqueusers] TORQUE DRMAA implementation

Guillaume Alleon guillaume.alleon at laposte.net
Wed Nov 30 23:42:48 MST 2005


Bernard Li a écrit :

>Please keep the list posted on your progress.
>
>Thanks,
>
>Bernard 
>
>  
>
oky I have now a raw perl module using using a kind of one to one 
mapping that
is attached.
It would help if you can provide an perl example of typical PERL actions 
- I am
not an expert ...

Guillaume

PS: Probably we should move this discussion to the dev mailing list ;-)

-------------- next part --------------
# This file was automatically generated by SWIG
package drmaa;
require Exporter;
require DynaLoader;
@ISA = qw(Exporter DynaLoader);
package drmaac;
bootstrap drmaa;
package drmaa;
@EXPORT = qw( );

# ---------- BASE METHODS -------------

package drmaa;

sub TIEHASH {
    my ($classname,$obj) = @_;
    return bless $obj, $classname;
}

sub CLEAR { }

sub FIRSTKEY { }

sub NEXTKEY { }

sub FETCH {
    my ($self,$field) = @_;
    my $member_func = "swig_${field}_get";
    $self->$member_func();
}

sub STORE {
    my ($self,$field,$newval) = @_;
    my $member_func = "swig_${field}_set";
    $self->$member_func($newval);
}

sub this {
    my $ptr = shift;
    return tied(%$ptr);
}


# ------- FUNCTION WRAPPERS --------

package drmaa;

*drmaa_get_next_attr_value = *drmaac::drmaa_get_next_attr_value;
*drmaa_get_next_job_id = *drmaac::drmaa_get_next_job_id;
*add_attr_name = *drmaac::add_attr_name;
*drmaa_release_attr_names = *drmaac::drmaa_release_attr_names;
*drmaa_release_attr_values = *drmaac::drmaa_release_attr_values;
*drmaa_release_job_ids = *drmaac::drmaa_release_job_ids;
*drmaa_init = *drmaac::drmaa_init;
*drmaa_exit = *drmaac::drmaa_exit;
*drmaa_allocate_job_template = *drmaac::drmaa_allocate_job_template;
*drmaa_delete_job_template = *drmaac::drmaa_delete_job_template;
*drmaa_set_attribute = *drmaac::drmaa_set_attribute;
*drmaa_get_attribute = *drmaac::drmaa_get_attribute;
*drmaa_set_vector_attribute = *drmaac::drmaa_set_vector_attribute;
*drmaa_get_vector_attribute = *drmaac::drmaa_get_vector_attribute;
*drmaa_get_attribute_names = *drmaac::drmaa_get_attribute_names;
*drmaa_get_vector_attribute_names = *drmaac::drmaa_get_vector_attribute_names;
*addAttrop = *drmaac::addAttrop;
*addAttrop_v = *drmaac::addAttrop_v;
*drmaa_run_job = *drmaac::drmaa_run_job;
*drmaa_run_bulk_jobs = *drmaac::drmaa_run_bulk_jobs;
*drmaa_control = *drmaac::drmaa_control;
*drmaa_synchronize = *drmaac::drmaa_synchronize;
*drmaa_wait = *drmaac::drmaa_wait;
*drmaa_wifexited = *drmaac::drmaa_wifexited;
*drmaa_wexitstatus = *drmaac::drmaa_wexitstatus;
*drmaa_wifsignaled = *drmaac::drmaa_wifsignaled;
*drmaa_wtermsig = *drmaac::drmaa_wtermsig;
*drmaa_wcoredump = *drmaac::drmaa_wcoredump;
*drmaa_wifaborted = *drmaac::drmaa_wifaborted;
*drmaa_job_ps = *drmaac::drmaa_job_ps;
*drmaa_strerror = *drmaac::drmaa_strerror;
*drmaa_get_contact = *drmaac::drmaa_get_contact;
*drmaa_version = *drmaac::drmaa_version;
*drmaa_get_DRM_system = *drmaac::drmaa_get_DRM_system;

############# Class : drmaa::drmaa_attr_names_s ##############

package drmaa::drmaa_attr_names_s;
@ISA = qw( drmaa );
%OWNER = ();
%ITERATORS = ();
*swig_attr_name_get = *drmaac::drmaa_attr_names_s_attr_name_get;
*swig_attr_name_set = *drmaac::drmaa_attr_names_s_attr_name_set;
*swig_next_get = *drmaac::drmaa_attr_names_s_next_get;
*swig_next_set = *drmaac::drmaa_attr_names_s_next_set;
*swig_iterator_get = *drmaac::drmaa_attr_names_s_iterator_get;
*swig_iterator_set = *drmaac::drmaa_attr_names_s_iterator_set;
sub new {
    my $pkg = shift;
    my $self = drmaac::new_drmaa_attr_names_s(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        drmaac::delete_drmaa_attr_names_s($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : drmaa::drmaa_attr_values_s ##############

package drmaa::drmaa_attr_values_s;
@ISA = qw( drmaa );
%OWNER = ();
%ITERATORS = ();
*swig_attr_value_get = *drmaac::drmaa_attr_values_s_attr_value_get;
*swig_attr_value_set = *drmaac::drmaa_attr_values_s_attr_value_set;
*swig_next_get = *drmaac::drmaa_attr_values_s_next_get;
*swig_next_set = *drmaac::drmaa_attr_values_s_next_set;
*swig_iterator_get = *drmaac::drmaa_attr_values_s_iterator_get;
*swig_iterator_set = *drmaac::drmaa_attr_values_s_iterator_set;
sub new {
    my $pkg = shift;
    my $self = drmaac::new_drmaa_attr_values_s(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        drmaac::delete_drmaa_attr_values_s($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : drmaa::drmaa_job_ids_s ##############

package drmaa::drmaa_job_ids_s;
@ISA = qw( drmaa );
%OWNER = ();
%ITERATORS = ();
*swig_job_ids_get = *drmaac::drmaa_job_ids_s_job_ids_get;
*swig_job_ids_set = *drmaac::drmaa_job_ids_s_job_ids_set;
*swig_next_get = *drmaac::drmaa_job_ids_s_next_get;
*swig_next_set = *drmaac::drmaa_job_ids_s_next_set;
*swig_iterator_get = *drmaac::drmaa_job_ids_s_iterator_get;
*swig_iterator_set = *drmaac::drmaa_job_ids_s_iterator_set;
sub new {
    my $pkg = shift;
    my $self = drmaac::new_drmaa_job_ids_s(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        drmaac::delete_drmaa_job_ids_s($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : drmaa::drmaa_job_template_s ##############

package drmaa::drmaa_job_template_s;
@ISA = qw( drmaa );
%OWNER = ();
%ITERATORS = ();
*swig__attr_names_get = *drmaac::drmaa_job_template_s__attr_names_get;
*swig__attr_names_set = *drmaac::drmaa_job_template_s__attr_names_set;
*swig__attr_v_names_get = *drmaac::drmaa_job_template_s__attr_v_names_get;
*swig__attr_v_names_set = *drmaac::drmaa_job_template_s__attr_v_names_set;
*swig__attr_values_get = *drmaac::drmaa_job_template_s__attr_values_get;
*swig__attr_values_set = *drmaac::drmaa_job_template_s__attr_values_set;
*swig__attr_v_values_get = *drmaac::drmaa_job_template_s__attr_v_values_get;
*swig__attr_v_values_set = *drmaac::drmaa_job_template_s__attr_v_values_set;
sub new {
    my $pkg = shift;
    my $self = drmaac::new_drmaa_job_template_s(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        drmaac::delete_drmaa_job_template_s($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


# ------- VARIABLE STUBS --------

package drmaa;

1;


More information about the torqueusers mailing list