Alert.png The wiki is deprecated and due to be decommissioned by the end of September 2022.
The content is being migrated to other supports, new updates will be ignored and lost.
If needed you can get in touch with EGI SDIS team using operations @ egi.eu.

Tools/Manuals/TS122

From EGIWiki
< Tools
Revision as of 10:12, 18 September 2011 by Aesch (talk | contribs) (Created page with '{{TOC_right}} Category:FAQ ------ Back to Administration FAQ ------ = How to let jobs run in local scratch space on the WN = Today there…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Back to Administration FAQ


How to let jobs run in local scratch space on the WN

Today there is no commonly accepted environment variable to identify the scratch space for jobs to use on the WN. Therefore the site needs to ensure the job starts in the right place.

CREAM and WMS solution

For a CREAM CE and for jobs submitted to an LCG-CE via a gLite WMS the site admin can easily control the desired behavior by defining the GLITE_LOCAL_CUSTOMIZATION_DIR environment variable on the WN (e.g. in an extra script in /etc/profile.d) and creating the necessary scripts in the corresponding directory as explained here.

For example, the cp_1.sh script could contain something like this:

cd /scratch
my_local_job_dir=`mktemp -d job-XXXXXXXX`

if [ "X$my_local_job_dir" != X ]
then
    cd "$my_local_job_dir"
    my_local_job_dir=`/bin/pwd`
fi

And cp_3.sh then could contain this:

if [ "X$my_local_job_dir" != X ]
then
    cd "$my_local_job_dir" && cd .. && /bin/rm -r "$my_local_job_dir"
fi

However, beware that the job may get killed before it executes cp_3.sh, so the admin should also create a daily or hourly cron job that cleans up any stale job directories.

Torque solution

For Torque one can use its "tmpdir" feature instead and let Torque handle the whole thing, which then would cover all uses of the batch system, not just CREAM or WMS job submission:

http://www.adaptivecomputing.com/download/resources/docs/torque/pdf/TORQUE_Administrator%27s_Guide.pdf

But watch out for this problem in the 2.4 series:

http://comments.gmane.org/gmane.comp.clustering.torque.user/10384