Ignore:
Timestamp:
May 30, 2012, 11:18:20 AM (9 years ago)
Author:
g7moreau
Message:
  • Add optin --kill and --transmit for signal handling
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oarutils/oar-parexec

    r49 r75  
    1616use Cwd qw( getcwd );
    1717
    18 my $file  = '';
    19 my $dir      = '';
    20 my $cmd      = '';
    21 my $logtrace = '';
     18my $file;
     19my $dir;
     20my $cmd;
     21my $logtrace;
    2222my $verbose;
    23 my $job_np = 1;
    24 my $nodefile = $ENV{OAR_NODE_FILE} || '';
     23my $job_np        = 1;
     24my $nodefile      = $ENV{OAR_NODE_FILE} || '';
    2525my $masterio;
    2626my $switchio;
    2727my $help;
    28 my $oarsh = 'oarsh -q -T';
     28my $oarsh          = 'oarsh -q -T';
     29my $sig_transmit;
     30my $sig_checkpoint = 'USR2';
    2931
    3032Getopt::Long::GetOptions(
     
    4042   'masterio=s' => \$masterio,
    4143   'switchio'   => \$switchio,
     44   'transmit'   => \$sig_transmit,
     45   'kill=s'     => \$sig_checkpoint,
    4246   ) || pod2usage(-verbose => 0);
    4347pod2usage(-verbose => 2) if $help;
     
    141145# OAR checkpoint and default signal SIGUSR2
    142146my $oar_checkpoint = new Coro::Semaphore 0;
    143 $SIG{USR2} = sub {
     147$SIG{$sig_checkpoint} = sub {
    144148   print "warning: receive checkpoint at "
    145149      . time
     
    147151      if $verbose;
    148152   $oar_checkpoint->up();
     153   kill $sig_checkpoint => keys %scheduled if $sig_transmit;
    149154   };
    150155
Note: See TracChangeset for help on using the changeset viewer.