Copyright Notice

 Copyright I.N.R.A. - C.N.R.S.
 emmanuel.courcelle@toulouse.inra.fr
 jerome.gouzy@toulouse.inra.fr
 This software is a computer program whose purpose is to help you run 
 your scripts on parallel computers.
 This software is governed by the CeCILL  license under French law and
 abiding by the rules of distribution of free software.  You can  use, 
 modify and/ or redistribute the software under the terms of the CeCILL
 license as circulated by CEA, CNRS and INRIA at the following URL
 http://www.cecill.info";
 As a counterpart to the access to the source code and  rights to copy,
 modify and redistribute granted by the license, users are provided only
 with a limited warranty  and the software's author,  the holder of the
 economic rights,  and the successive licensors  have only  limited
 liability.
 In this respect, the user's attention is drawn to the risks associated
 with loading,  using,  modifying and/or developing or reproducing the
 software by the user in light of its specific status of free software,
 that may mean  that it is complicated to manipulate,  and  that  also
 therefore means  that it is reserved for developers  and  experienced
 professionals having in-depth computer knowledge. Users are therefore
 encouraged to load and test the software's suitability as regards their
 requirements in conditions enabling the security of their systems and/or 
 data to be ensured and,  more generally, to use and operate it in the 
 same conditions as regards security.
 The fact that you are presently reading this means that you have had
 knowledge of the CeCILL license and that you accept its terms.


NAME

PARALOOP::SCHEDULER::Rsystem - Scheduler object for use with clusters without any batch system


Derives from...

PARALOOP::SCHEDULER::Scheduler


DESCRIPTION

This scheduler is used for a cluster, when there is no batch system installed: you have to distribute the jobs through remote commands (rsh or ssh).


CONFIGURATION FILE PARAMETERS

 PARALOOP_Scheduler        
     Rsystem
 PARALOOP_error_directory  
     The name of the error directory
 PARALOOP_Rsystem_nodes    
     The list of nodes constituting the cluster
 PARALOOP_Rsystem_rsh      
     The remote shell program (defaults to rsh)
 PARALOOP_Rsystem_tmp      
     The name of the temporary directory - SHOULD BE LOCAL TO EACH NODE


PUBLIC METHODS

 WhatParaloopScheduler
    my $msg=$obj->WhatParaloopScheduler()
 Parameters
    my $msg=$obj->Parameters()
 New
    my $obj = PARALOOP::Dummy->New(-params => $params, -log => $log);
 Submit
    my $job_id = $obj->Submit();
 RemTime
    my $rem_time = $obj->RemTime();
 JobId
    my $job_id = $obj->JobId();


METHODS AND SUBROUTINES - DETAILED DESCRIPTION

Function WhatParaloopScheduler

 Usage:    my $msg = PARALOOP::SCHEDULER::System::WhatParaloopScheduler()
        or my $msg = $obj->WhatParaloopScheduler()
 Function: Return some information (2 lines max) on the scheduler
           An object is NOT considered as a scheduler if this function is not implemented
 Arg:      none ($self is ignored)
 Return:   A message describing the plugin (1 or 2 lines)

Function Parameters

 Usage:    my $msg = PARALOOP::SCHEDULER::System::Parameters()
        or my $msg = $obj->Parameters()
 Function: Return the list of allowed parameters for this scheduler
           If your scheduler defines some parameters, it is good pratice adding this function,
                   to display those parameters when the --parameters switch of paraloop.pl is used.
                   However, this is not mandatory
 Arg:      none ($self is ignored)
 Return:   A message describing the scheduler parameters (1 line / parameter)

procedure _Init

 Usage:  CALLED BY UNIVERSAL::New
         my $obj = PARALOOP::Dummy->New(-params => $params, -log => $log);
 Access: private (use New instead)
 procedure: Init the object
 Return:   nothing
 Args:     -params = an object of class ParamParser (already initialized)
           -log    = an object of class Logger (already initialized)
 globals:  none

Procedure DESTROY

 Usage     Automatically called when the object is destroyed
 Function  Remove the temporary file, is it exists

Function Submit

 Usage:     &$obj->Submit()
 Function:  Run paraloop on another node
 Arg :      none
 Return:    The job Id, or 0 if there is no available node

Function JobId

 Usage:     my $job_id = $obj->JobId()
 Function:  Ask the system for the job id
            The variable $$ is returned
 Arg :      none
 Return : the job Id

Function __NextNode

 Usage:     &$obj->NextNode()
 Function:  return the name of the next "available" node
            return '' if no node is available (too much load)
 Arg :      none

Function __CheckNodes

 Usage:     my $o_nodes = &$obj->CheckNodes($file)
 Function:  return a ParamParser filled with the list of available nodes
            LOAD_xxx = The current load of the node xxx
            POWER_xxx= The 'power' (the highest, the more powerful) of the node
            Data are read from $file, if $file is more recent than 300 s (5 mn)
            If $file does not exist, or if it is too old, the nodes are checked through __rsh_bin
            return $o_nodes
 Arg :      none

Function __IncrNode

 Usage:     $node = &$obj->__IncrNode(\@nodes,'node3')
 Function:  return the name of the next node on the list
 Arg :      \@nodes Ref to an array of nodes
            $position The current node in the list
 Return:    The next node on the list, or $$nodes[0] if $position is not on the list

Function __IsAlive

 Usage:     if ($obj->__IsAlive($node)) ...
 Function:  return 1 if the node is alive
            We check the node with asking him its name
 Arg :      The name of the node to check
 Return:    1 if alive, 0 if dead

Function __PrintEnv

 Usage:     my $env = $obj->PrintEnv()
 Function:  For each environment variable starting with NAMESPACE,
            append to $env export ENV='$ENV{ENV}'
 Arg :      none
 Return :   $env

Function IsLaunched

 Usage:    If (&$obj->IsLaunched($job_id)==1)...
 Function: Check the presence of the job in the system
 Arg:      none
 Return:   0 ==> The job is not known by the system
           1 ==> The job is known (may be in different states: Run, Queue, etc)

Procedure KillJob

 Usage:    $obj->KillJob($job_id);
 Function: Kill the job passed by parameter
           Call qdel $job_id
 Arg:      job_id: the job Id to kill
 Return:   none

Procedure IoRedirect

 Usage:     &$obj->IoRedirect()
 Procedure: Redirect stdout and stderr to some file ($job_id.EO)
            We DO NOT close STDIN, because it will be impossible later to redirect STDOUT
                (I think there is due to a bug in perl...)
 Arg :      none
 Return:    none