require 5.004;

###############################################################################
# CCS
#
# UNTESTED
#
#    Based on 3.0 CCS port by Achim Streit at Paderborn
#
###############################################################################

# If you are using Perl 5.004 or later, then use the FindBin lines. Otherwise
# you will need to pass the TSI installation directory on the command line
# using "-I" or modify the line below
#use lib "<install directory>";

use FindBin qw($Bin)
  ;    # determines dynamically the directory containing this script
   # and from there the module files (which are installed in the same directory)
use lib $FindBin::Bin;
use strict;

use SharedConfiguration qw(configure_common startup);
$main::tsi_props = shift || "./tsi.properties";
configure_common();

# The TSI code is split into a number of Perl modules to
# allow for easier maintenance. This file contains batch system or
# operating system specific options, while the SharedConfiguration.pm
# the common settings. You should review both files.

# BSS/OS SPECIFIC CONFIGURATION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

# Where to find the CCS commands used by the TSI

my $ccs_bin_dir = "/usr/local/ccs/bin/LINUX";

$main::submit_cmd = "$ccs_bin_dir/ccsalloc";

$main::abort_cmd =
  "$ccs_bin_dir/ccskill";    # delete a job from CCS, returning stdout/stderr
$main::cancel_cmd =
  "$ccs_bin_dir/ccskill";    # delete a job from CCS, deleting stdout/stderr

# Do we do anything in response to a hold?
$main::site_sez_no_holds = 1;    # 0 => holding allowed

$main::hold_cmd   = "NOT_AVAILABLE_IN_CCS";   # suspend execution of a batch job
$main::freeze_cmd = "NOT_AVAILABLE_IN_CCS"
  ;    # suspend execution and release resources of a batch job (optional)
$main::resume_cmd = "NOT_AVAILABLE_IN_CCS";    # resume execution of a batch job

$main::qstat_cmd =
  "$ccs_bin_dir/ccsinfo -q";    # show _all_ jobs on CCS submitted by TSI

# Set the child process SHELL variable to use the shell always used
# by the NJS (user tasks with different shells are grandchildren)
# Do not change from sh, but its location might change #? is tcsh working??
$ENV{SHELL} = "/usr/bin/tcsh";

# The path from a setuid script is not the correct user path and
# this line should be enabled with a suitable path for user level
# scripts. This line is a minimal set and should be extended with
# any site specific values, particularly those needed for CCS to
# work correctly (note that "interesting" scripts are run in batch mode
# and so CCS should ensure that a proper environment is set for these.
# This line just needs to get the scripts into a batch subsystem.)
#
# Disabling this line passes the TSI user's PATH to the user.
$ENV{PATH} = "/usr/local/ccs/bin:/usr/local/ccs/bin/LINUX:$ENV{PATH}";

# Add any other site required environment variables here or, if they
# are xlogin specific values in the becomeuser sub.
$ENV{CCS}                 = "/usr/local/ccs";
$ENV{CCS_ARCH}            = "LINUX";
$ENV{CCS_UI_DEF_RESOURCE} = "PSC2";
$ENV{CCS_UI_DEF_PROJECT}  = "UNICORE+";

$main::my_os = "ccs";

# END OF CONFIGURATION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

startup();

#
#                   Copyright (c) Fujitsu Ltd 2000 - 2004
#
#                Use and distribution is subject a License.
# A copy was supplied with the distribution (see documentation or the jar file).
#
# This product includes software developed by Fujitsu Limited (http://www.fujitsu.com).
