#!/usr/bin/perl

# ============================================================================
#
# Name    :  swarm1.pl   
#
# Purpose :  Start SWARM1 BPE process for a particular session
#
# Author  :  F. Christiansen
# Created :  2008-05-20
#
# ============================================================================
use lib $ENV{BPE};
use startBPE;
use bpe_util;

# Check arguments
# ---------------
if (@ARGV != 2 or lc($ARGV[0]) eq "-h") {
  die "\n  Start SWARM1 MOD BPE process for a particular session\n".
      "\n  Usage: swarm1.pl [-h] yyyy ssss\n".
      "\n  yyyy : 4-digit (or 2-digit) year".
      "\n  ssss : 4-character session".
      "\n  -h   : Display this help text\n\n" }

# Create startBPE object
# ----------------------
$bpe = new startBPE();

# Redefine mandatory variables
# ----------------------------
$$bpe{PCF_FILE}     = "SWARM1";
$$bpe{CPU_FILE}     = "USER";
$$bpe{BPE_CAMPAIGN} = "SWARM1";
$$bpe{YEAR}         = $ARGV[0];
$$bpe{SESSION}      = $ARGV[1];
$$bpe{SYSOUT}       = "SWARM1";
$$bpe{STATUS}       = "SWARM1.RUN";
$$bpe{TASKID}       = "SW";

# Reset CPU file
# --------------
$bpe->resetCPU();

# Start BPE process
# -----------------
print "\nSWARM1 BPE process started on ".timstr(localtime(time))."\n";
$bpe->run();

# BPE process finished
# --------------------
print "SWARM1 BPE process finished on ".timstr(localtime(time))."\n\n";

__END__ 

