[GE users] qsub -wd usage

Bart Willems b-willems at northwestern.edu
Sun Oct 26 01:31:37 BST 2008


    [ The following text is in the "iso-8859-1" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some special characters may be displayed incorrectly. ]

Hi Reuti,

thanks, this did the trick! Now I just need to copy any output in $TMPDIR
back to the directory were the source files were initially. Is there an
environment variable from which I can read what source directory the user
has set either with -cwd or -wd?

Thanks,
Bart

> Hi Bart,
>
> when you want to run in a scratch directory on a node, you only need
> the -wd option to locate the source files. This is the directory to
> which SGE will "cd" when the job starts (default is every user's
> home, unless you use the -cwd or -wd option). On the node you can use
> the $TMPDIR which is already created be SGE and is unique for every
> job (it's location is defined in the queue configuration, where you
> can replace /tmp with /scratch for your parth):
>
> #!/bin/sh
> #$ -wd /storage/bart/code/
> cp helloworld $TMPDIR
> cd $TMPDIR
> ./helloworld
>
> -- Reuti
>
>
> Am 26.10.2008 um 00:42 schrieb Bart Willems:
>
>> Hi All,
>>
>> I am trying to make our cluster users make use of local scratch space
>> instead of NFS storage while running their jobs. What I would like
>> to do
>> is something along the lines of the following job submission script:
>>
>> #!/bin/bash
>>
>> # This script should be submitted to the batch scheduler with the qsub
>> # command as "qsub <scriptname>".
>>
>> # Lines that begin with "#$" are interpreted by the batch scheduler
>> (SGE)
>> # as scheduling commands.
>>
>> # Use this shell as the default shell
>> #$ -S /bin/bash
>>
>> # Combine stdout and stderr of job
>> #$ -j y
>>
>> # Specify the requested cpu time
>> #$ -l h_cpu=00:10:00
>>
>> # Define source and working directories
>> SRCDIR=/storage/bart/code/
>> WRKDIR=/scratch/`whoami`/test
>>
>> # Create working directory
>> mkdir -p $WRKDIR
>>
>> # Change to working directory
>> cd $WRKDIR
>>
>> # Copy needed files to working directory.
>> cp $SRCDIR/helloworld .
>>
>> # run job from working directory
>> #$ -wd $WRKDIR
>>
>> # computational command to run
>> ./helloworld
>>
>>
>> At the end, I would evidently copy back all files from $WRKDIR to
>> $SRCDIR,
>> but I 'm not even getting that far. The two problems I seem to be
>> facing
>> are
>>
>> (1) the -wd option does not like to be followed by a variable
>> (2) the -wd option must be followed by a directory that already exists
>>
>> Eventually, I would like the working directory name WRKDIR to be
>> based on
>> the job_id to make sure that it 's unique, so I cannot make the
>> directories in advance.
>>
>> Does anyone have any suggestions on how to tackle this?
>>
>> Thanks,
>> Bart
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
>> For additional commands, e-mail: users-help at gridengine.sunsource.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
> For additional commands, e-mail: users-help at gridengine.sunsource.net
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list