#!/bin/bash submission_gen_params () { cat < proxy.pem <<__END__" cat $X509_USER_PROXY echo "__END__" echo -e "\nexport X509_USER_PROXY=proxy.pem" echo -e "chmod 600 proxy.pem\n" echo "wget $PORTABLE_CLIENT_URL" echo "tar -xf ${PORTABLE_CLIENT_URL##*/}" echo -e "cd arc-client && . setup.sh && cd .. \n" while [ -n "${!f_var}" ]; do f_location_var="${f2_base}${f_idx}" eval URL$((f_idx+1))_NAME="${!f_var}" eval URL$((f_idx+1))="${!f_location_var}" echo "arccp ${!f_location_var} ${!f_var}" f_idx=$((f_idx+1)) f_var="${f1_base}${f_idx}" done chmod +x $EXECUTABLE echo -e "#Pre-exec section ended\n" } create_post_exec () { local f1_base="OUTPUT_FILES_NAME_" local f2_base="OUTPUT_FILES_LOCATION_" f_url="" f_idx=0 f_var="${f1_base}${f_idx}" while [ -n "${!f_var}" ]; do f_location_var="${f2_base}${f_idx}" echo "arccp ${!f_var} ${!f_location_var}" f_idx=$((f_idx+1)) f_var="${f1_base}${f_idx}" done } grid_job_submit () { local jdfile=$1 local jobid_file=$2 local exec_file=$3 if [ -z "$PBS_LOCAL" ]; then if [ -z "$PBS_SUBMIT_HOST" -o -z "$PBS_SUBMIT_USER" ]; then echo_r "FATAL: PBS submission host and credentials are not configured!" exit 1 fi PBS_SUBMIT_PORT=${PBS_SUBMIT_PORT:-22} echo_g "Sending executable to the PBS cluster." scp -P $PBS_SUBMIT_PORT $jdfile $CONDOR_SUBMIT_USER@$CONDOR_SUBMIT_HOST:~ echo_g "Submitting PBS job." ssh $PBS_SUBMIT_USER@$PBS_SUBMIT_HOST -p $PBS_SUBMIT_PORT "qsub $jdfile" else echo_g "Submitting PBS job." qsub $jdfile fi # no MDS portal connection with pilots submission export DISABLEPORTAL=1 } grid_job_kill () { local jobid_file=$1 echo "INFO: Job removal is not yet supported by PBS interface" }