[GRASS-dev] GRASS_BATCH_JOB and GISRCRC

Markus Neteler neteler at osgeo.org
Thu Aug 28 05:49:01 EDT 2008


On Thu, Aug 28, 2008 at 1:10 AM, Glynn Clements
<glynn at gclements.plus.com> wrote:
> Markus Neteler wrote:
>
>> >> I would like to submit the following change to facilitate the use
>> >> of GRASS on clusters/in parallel jobs:
>> >>
>> >>
>> >> Index: lib/init/init.sh
>> >> ===================================================================
>> >> --- lib/init/init.sh    (revision 33097)
>> >> +++ lib/init/init.sh    (working copy)
>> >> @@ -159,7 +159,11 @@
>> >>  export GIS_LOCK
>> >>
>> >>  # Set the global grassrc file
>> >> -GISRCRC="$HOME/.grassrc6"
>> >> +if [ -n "$GRASS_BATCH_JOB" ] ; then
>> >> +       GISRCRC="$HOME/.grassrc6.`uname -n`"
>> >> +else
>> >> +       GISRCRC="$HOME/.grassrc6"
>> >> +fi
>> >>
>> >>  # Set the session grassrc file
>> >>  if [ "$MINGW" ] ; then
>> >>
...
> Hmm. Are you confusing $GISRCRC and $GISRC? The former is the
> persistent ~/.grassrc6 (etc) file, the latter is the per-session copy
> which Init.sh puts into /tmp/grass6-<user>-pid and which is actually
> used by the programs.

Yes. I meant ~/.grassrc6. Possibly I am lagging behind for some years
as I used GRASS 6.3.old there :). Now I am switching to GRASS 6.4 for my
cluster calculations and have to solve this problem.

So indeed I should modify
## use TMPDIR if it exists, otherwise /tmp
#tmp=${TMPDIR-/tmp}
#tmp="$tmp/grass6-$USER-$GIS_LOCK"
tmp=/tmp/grass6-$USER-$GIS_LOCK
(umask 077 && mkdir "$tmp") || {
    echo "Cannot create temporary directory! Exiting." 1>&2
    exit 1
}
GISRC="$tmp/gisrc"
export GISRC

Or no modifications needed at all? Mhh, probably I am really confusing things
and everything just works out of the box. Will test the next days.

Markus


More information about the grass-dev mailing list