JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for TB-SUPPORT Archives


TB-SUPPORT Archives

TB-SUPPORT Archives


TB-SUPPORT@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

TB-SUPPORT Home

TB-SUPPORT Home

TB-SUPPORT  March 2003

TB-SUPPORT March 2003

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: Using /tmp on the WN for i/o sandbox.

From:

Steve Traylen <[log in to unmask]>

Reply-To:

Testbed Support for GridPP member institutes <[log in to unmask]>

Date:

Fri, 14 Mar 2003 16:33:56 +0000

Content-Type:

MULTIPART/MIXED

Parts/Attachments:

Parts/Attachments

TEXT/PLAIN (85 lines) , globus-script-pbs-submit (1 lines)


The attachment this time.

  Steve
On Fri, 14 Mar 2003, Steve Traylen wrote:

> Presently the working directory for jobs where the sandbox
> is fetched to is in /home/wpsix001
>
> Since it is the pbs job that does this fetching this
> can be done on the WNs local disk instead.
>
> Obviously this makes a lot of sense if all your nodes are
> identical so you have just as much space on the WNs to
> share amongst 1 or 2 jobs rather than every user.
>
> Also network trafic is reduced. Since doing this here the
> CE's harddisk light is no longer on a constant red.
>
> You problably do not want to do this if you are short
> of space on the WN's disk of course.
>
> The file to be replaced is
> /opt/globus/libexec/globus-script-pbs-submit
> on the CE.
>
> This is the script that builds a wrapper script for the incoming
> job and pipes that into PBS.
>
> I have attached the replacement file.
> The extra lines in there are.
>
> #SMT next line
> grami_directory=/tmp/$USER$grami_directory
>
> and
>
> #SMT next 3 lines
> echo "if [ ! -d $grami_directory ]; then" >> $PBS_JOB_SCRIPT
> echo "   /bin/mkdir -p $grami_directory" >> $PBS_JOB_SCRIPT
> echo "fi" >> $PBS_JOB_SCRIPT
>
> The default tmpwatch is for /tmp is 240 hours and
> that must not be shorter than your wall_max_times for
> any queue.
>
>     Steve
>
>
>
>
>
>
>   Steve
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Steve Traylen
> [log in to unmask]
> http://www.gridpp.ac.uk/
>

--
Steve Traylen
[log in to unmask]
http://www.gridpp.ac.uk/



#! /bin/sh -f # # Globus Job Manager PBS interface script for submitting a job # # This script builds a shell job script which is supplied as input # to the PBS qsub command. The script is built based on information # obtained from a file passed as the script's argument. This file # contains a list of environment variables which are set by way # of "sourcing" the file from this script. The evironment variables # set as a result of this action are then used to characterize the # user's job request. Once the job script has been submitted the # PBS job id is appended to the file passed as an argument to this # script to be used by other scripts at a later time. # The temporary job script is created for the submission and then removed # at the end of this script. . ${GLOBUS_LOCATION}/libexec/globus-script-initializer globus_source ${libexecdir}/globus-gram-protocol-constants.sh globus_source ${libexecdir}/globus-sh-tools.sh globus_source ${libexecdir}/globus-gram-job-manager-tools.sh qsub=${GLOBUS_GRAM_JOB_MANAGER_QSUB-qsub} qstat=${GLOBUS_GRAM_JOB_MANAGER_QSTAT-qstat} awk=${GLOBUS_SH_AWK-awk} mpirun=${GLOBUS_GRAM_JOB_MANAGER_MPIRUN-mpirun} rm=${GLOBUS_SH_RM-rm} # File name to be used for temporary job script PBS_JOB_SCRIPT="${local_tmpdir}/pbs_job_script."$$ PBS_JOB_OUT="${PBS_JOB_SCRIPT}.out" PBS_JOB_ERR="${PBS_JOB_SCRIPT}.err" is_cluster=false arg_file=$1 # M&E Save content of arg_file for future reference MaEdate=`date +%y%m%d%H%M%S` MandElog=/tmp/globus-script-pbs-submit.log.$MaEdate.$$ echo ============ $arg_file ============ > $MandElog cat $arg_file >> $MandElog # Check for the argument file. If it does not exist # then return with an error immediately if [ ! -f $arg_file ] ; then echo GRAM_SCRIPT_ERROR:$GLOBUS_GRAM_PROTOCOL_ERROR_BAD_SCRIPT_ARG_FILE exit 1 fi # Source the argument file to set environment variables # defining all the job arguments . $arg_file # M&E Change grami_directory to a local dir (/tmp for the moment) # This will be replaced with a localization script grami_directory=/tmp$grami_directory echo === grami_directory is now $grami_directory >> $MandElog # If a logfile name has been defined then activate debug mode if [ $grami_logfile = "/dev/null" ] ; then DEBUG_ECHO=: else DEBUG_ECHO=echo fi # Write initial debug information to logfile $DEBUG_ECHO in gram_script_pbs_submit >> $grami_logfile $DEBUG_ECHO "" >> $grami_logfile $DEBUG_ECHO ============================================ >> $grami_logfile $DEBUG_ECHO "JM_SCRIPT: ====argument file contents====" >> $grami_logfile if [ "$DEBUG_ECHO" = "echo" ] ; then cat $arg_file >> $grami_logfile fi $DEBUG_ECHO "JM_SCRIPT: ====argument file contents====" >> $grami_logfile $DEBUG_ECHO "" # The following several lines of code can be used to perform 2 # additional error checks prior to job submission. The first check is # for the existance of the directory which the user requested # be the working directory. If it does not exist the script # returns an error and the job is not submitted. The second check # is for existance of the file requested by the user to be used for # stdin. If the file does not exist the scripts returns an error and # the job is not submitted. # # These checks are only valid if performed on the file system to be used # by the host on which the job will run. But, this file system may not # be shared with host from which the job is submitted. Therefore, the # check does not make sense. If however the host from which the job # will be submitted (i.e. the host running the globus gatekeeper) # shares file systems with all the hosts which may potentially # run the job these checks can be used. In order to have the job # manager perform these checks the following 2 sections of code # should *not* be commented out. # Check for existance of directory # Check for non supported parameters here. That is, if any of the RSL parameters # which PBS can not support have been requested return an error. $DEBUG_ECHO testing for unsupported parameters >> $grami_logfile $DEBUG_ECHO testing for queue attribute specification >> $grami_logfile if [ ! -z "${grami_queue}" ]; then $DEBUG_ECHO testing for existance of PBS queue [$grami_queue] >> $grami_logfile status=`${qstat} -Q $grami_queue` if (test "$?" -eq "0") then $DEBUG_ECHO PBS queue [$grami_queue] found >> $grami_logfile else $DEBUG_ECHO PBS queue [$grami_queue] DOES NOT exist; exiting with exit code 1 >> $grami_logfile echo GRAM_SCRIPT_ERROR:$GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_QUEUE exit 1 fi else $DEBUG_ECHO no queue attribute specified >> $grami_logfile fi # Determine job request type # 4 jobtypes exist pbs jobtype # ----------------- ------------------- # jobtype 0 = mpi -----> mpi # jobtype 1 = single -----> single # jobtype 2 = multiple -----> multiple # jobtype 3 = condor -----> ERROR $DEBUG_ECHO "JM_SCRIPT: testing jobtype" >> $grami_logfile if [ $grami_job_type = "0" ] ; then pbs_jobtype="mpi" elif [ $grami_job_type = "1" ] ; then pbs_jobtype="single" elif [ $grami_job_type = "2" ] ; then pbs_jobtype="multiple" elif [ $grami_job_type = "3" ] ; then $DEBUG_ECHO "JM_SCRIPT: ERROR: jobtype parameter not supported " >> $grami_logfile echo "GRAM_SCRIPT_ERROR:$GLOBUS_GRAM_PROTOCOL_ERROR_JOBTYPE_NOT_SUPPORTED" exit 1 else $DEBUG_ECHO "JM_SCRIPT: error: invalid jobtype parameter" >> $grami_logfile echo GRAM_SCRIPT_ERROR:$GLOBUS_GRAM_PROTOCOL_ERROR_INVALID_JOBTYPE exit 1 fi # Determining per process cpu time limit # This uses max_cpu_time, or if max_cpu_time is not set, it will use # max_time, which will be deprecated in 1.2 $DEBUG_ECHO testing for per process cpu time limit >> $grami_logfile if [ $grami_max_cpu_time -eq 0 ] ; then # if not set, try max_time which will be deprecated in 1.2 if [ $grami_max_time -eq 0 ] ; then cpu_time=0 $DEBUG_ECHO No per process cpu time specified, using [queue default] per process cpu time >> $grami_logfile else cpu_time="$grami_max_time" $DEBUG_ECHO using max_time, [$cpu_time] minutes, for max per process cpu time >> $grami_logfile fi else cpu_time="$grami_max_cpu_time" $DEBUG_ECHO using max_cpu_time, [$cpu_time] minutes, for max per process cpu time >> $grami_logfile fi # Determining process wall time limit (since processes all run at the same # time, the wall time should be the time needed for the longest process to # complete) $DEBUG_ECHO testing for process wall time limit >> $grami_logfile if [ $grami_max_wall_time -eq 0 ] ; then wall_time=0 $DEBUG_ECHO No process wall time specified, using [queue default] process wall time >> $grami_logfile else wall_time="$grami_max_wall_time" $DEBUG_ECHO using [$wall_time] minutes for max wall time >> $grami_logfile fi # Start building job script $DEBUG_ECHO starting to build PBS job script >> $grami_logfile echo "# PBS batch job script built by Globus job manager" > $PBS_JOB_SCRIPT echo "" >> $PBS_JOB_SCRIPT if [ ! -z "${grami_queue}" ] ; then echo "#PBS -q $grami_queue" >> $PBS_JOB_SCRIPT fi if [ ! -z "${grami_project}" ] ; then echo "#PBS -A $grami_project" >> $PBS_JOB_SCRIPT fi if [ $cpu_time -ne 0 ] ; then if [ $pbs_jobtype = "multiple" ] ; then total_cput=`expr "$cpu_time" \* "$grami_count"` else total_cput=$cpu_time fi echo "#PBS -l pcput=$cpu_time:00" >> $PBS_JOB_SCRIPT echo "#PBS -l cput=$total_cput:00" >> $PBS_JOB_SCRIPT fi if [ $wall_time -ne 0 ] ; then echo "#PBS -l walltime=$wall_time:00" >> $PBS_JOB_SCRIPT fi # User must specify per executable memory. If job type is multiple # we run multiple instances of the executable an need to multiply # memory size by nprocs. if [ "${grami_max_memory}" -ne 0 ] ; then if [ $pbs_jobtype = "multiple" ] ; then max_memory=`expr "$grami_max_memory" \* "$grami_count"` else max_memory=$grami_max_memory fi echo "#PBS -l mem=${max_memory}mb" >> $PBS_JOB_SCRIPT fi echo "#PBS -o $grami_stdout" >> $PBS_JOB_SCRIPT echo "#PBS -e $grami_stderr" >> $PBS_JOB_SCRIPT echo "#PBS -l ncpus=$grami_count" >> $PBS_JOB_SCRIPT # Uncomment the following lines if your pbs allows node count specification #if [ $grami_host_count -ne 0 ] ; then # echo "#PBS -l nodes=$grami_host_count" >> $PBS_JOB_SCRIPT #fi # Check for environment variables # #loop through all the environment variables. Variables and values are seperate #arguments. While assembling var/value pairs add the specific syntax #required for this scheduling system. # new_grami_env="" if [ ! -z "${grami_env}" ] ; then eval set -- ${grami_env} x=0 while [ "$#" -ne 0 ]; do if [ $x = 0 ] ; then new_grami_env="${new_grami_env}$1" x=1 else x=0 new_grami_env="${new_grami_env}=$1," fi shift done fi echo "#PBS -v $new_grami_env" >> $PBS_JOB_SCRIPT new_grami_args="" if [ ! -z "${grami_args}" ] ; then eval set -- ${grami_args} new_grami_args="$*" fi # Determine directory to be used as working directory echo "" >> $PBS_JOB_SCRIPT echo "# Changing to directory as requested by user" >> $PBS_JOB_SCRIPT # M&E Create the local directory if needed echo "" >> $PBS_JOB_SCRIPT echo "if [ ! -d $grami_directory ]; then" >> $PBS_JOB_SCRIPT echo " /bin/mkdir $grami_directory" >> $PBS_JOB_SCRIPT echo "fi" >> $PBS_JOB_SCRIPT echo "" >> $PBS_JOB_SCRIPT echo "cd $grami_directory" >> $PBS_JOB_SCRIPT # Determining job request type echo "" >> $PBS_JOB_SCRIPT echo "# Executing job as requested by user" >> $PBS_JOB_SCRIPT echo "" >> $PBS_JOB_SCRIPT if [ $pbs_jobtype = "mpi" ] ; then if ${is_cluster} ; then echo "${mpirun} -np $grami_count "\ "-machinefile \$PBS_NODEFILE "\ "$grami_program $new_grami_args "\ < $grami_stdin" >> $PBS_JOB_SCRIPT else echo "${mpirun} -np $grami_count "\ "$grami_program $new_grami_args "\ < $grami_stdin" >> $PBS_JOB_SCRIPT fi elif [ $pbs_jobtype = "multiple" ] ; then if ${is_cluster} ; then echo 'counter=1' >> $PBS_JOB_SCRIPT; echo 'hosts=`cat $PBS_NODEFILE`' >> $PBS_JOB_SCRIPT; echo 'for host in $hosts; do' >> $PBS_JOB_SCRIPT; echo ' /usr/bin/rsh $host "'"cd $grami_directory; $pbs_new_grami_env $grami_program $new_grami_args < $grami_stdin "'"&' >> $PBS_JOB_SCRIPT; echo ' counter=`expr $counter + 1`' >> $PBS_JOB_SCRIPT; echo 'done' >> $PBS_JOB_SCRIPT echo 'wait' >> $PBS_JOB_SCRIPT else counter=0 while (test "$counter" -lt "$grami_count") do echo "$grami_program $new_grami_args < $grami_stdin &" \ >> $PBS_JOB_SCRIPT counter=`expr $counter + 1` done echo "wait" >> $PBS_JOB_SCRIPT; fi else echo "$grami_program $new_grami_args < $grami_stdin" >> $PBS_JOB_SCRIPT fi if ${is_cluster} ; then echo "#ctrans nfs_in ${grami_directory}" >> $PBS_JOB_SCRIPT echo "#ctrans nfs_out ${grami_directory}" >> $PBS_JOB_SCRIPT fi $DEBUG_ECHO PBS job script successfully built >> $grami_logfile $DEBUG_ECHO submitting PBS job script >> $grami_logfile # M&E Save job script for future reference echo "====== $PBS_JOB_SCRIPT ======" >> $MandElog cat $PBS_JOB_SCRIPT >> $MandElog # Execute qsub command ${qsub} < $PBS_JOB_SCRIPT 1>$PBS_JOB_OUT 2>$PBS_JOB_ERR if (test "$?" -eq "0") then job_id=`cat $PBS_JOB_OUT | awk '{split($0,field,".");print field[1]"."field[2]}'` if [ "${job_id}" = "" ] ; then $DEBUG_ECHO "job *NOT* submitted successfully!" >> $grami_logfile $DEBUG_ECHO "failed getting the pbs jobid for the job!" >> $grami_logfile echo "GRAM_SCRIPT_ERROR:$GLOBUS_GRAM_PROTOCOL_ERROR_GETTING_JOBID" else echo "grami_job_id=$job_id" >> $arg_file echo "GRAM_SCRIPT_JOB_ID:$job_id" $DEBUG_ECHO "job submitted successfully!" >> $grami_logfile $DEBUG_ECHO "returning job state: 1" >> $grami_logfile echo "GRAM_SCRIPT_JOB_ID:"$job_id echo "GRAM_SCRIPT_SUCCESS:"$GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING # Remove temporary job script file ${rm} -f $PBS_JOB_SCRIPT $PBS_JOB_OUT $PBS_JOB_ERR $DEBUG_ECHO "exiting gram_script_pbs_submit\n\n" >> $grami_logfile exit 0 fi else $DEBUG_ECHO "job *NOT* submitted successfully!" >> $grami_logfile echo "GRAM_SCRIPT_ERROR:$GLOBUS_GRAM_PROTOCOL_ERROR_JOB_EXECUTION_FAILED" exit 0 fi # We got problems if we get this far. echo "" >> ${grami_stderr} echo "-------- output from scheduler submission --------" >> ${grami_stderr} cat ${PBS_JOB_ERR} >> ${grami_stderr} echo "--------------------------------------------------" >> ${grami_stderr} echo "" >> ${grami_stderr} # Remove temporary job script file ${rm} $PBS_JOB_SCRIPT $PBS_JOB_OUT $PBS_JOB_ERR $DEBUG_ECHO "exiting gram_script_pbs_submit" >> $grami_logfile $DEBUG_ECHO "" >> $grami_logfile $DEBUG_ECHO "" >> $grami_logfile exit 1

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

May 2024
April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager