#!/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 "$CONDOR_SUBMIT_HOST" -o -z "$CONDOR_SUBMIT_USER" ]; then echo_r "FATAL: Condor submission host and credentials are not configured!" exit 1 fi CONDOR_SUBMIT_PORT=${CONDOR_SUBMIT_PORT:-22} echo_g "Sending executable to the HTCondor." scp -P $CONDOR_SUBMIT_PORT $jdfile $exec_file $CONDOR_SUBMIT_USER@$CONDOR_SUBMIT_HOST:~ jdstr=$( cat $jdfile ) echo_g "Starting job." ssh $CONDOR_SUBMIT_USER@$CONDOR_SUBMIT_HOST -p $CONDOR_SUBMIT_PORT "condor_submit $jdfile" # 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 MolDynSub HTCondor interface" }