When a
user submits a job, the job directory is a temporary timestamped directory that is created. Job
input files and output files are placed in this directory. In your submission template, you can
create a field to allow users to customize the location of their own job directory. When users
specify their own job directory, no temporary directory is created and users can see their job
directory in Job details view.
Before you begin
Requirements:
- Your submission template must have the status Unpublished so that changes can be made.
- The type of field in the submission template must be Input Text or
File Path Selection and must have the ID OUTPUT_FILE_LOCATION.
- Users must have the operating system permissions of read and execute for the directories they
specify. If users specify a directory for which they have no read or execute permission, job
submission will fail.
- The directory specified by the user must be an absolute path on the web server.
- The environment variables $HOME and $USER can be used in the specified directory path.
Important: Custom job directories will not be purged when automatic data purge is
performed by the system. Users will need to manually manage their custom job directories and files.
Procedure
- In the Workload tab, select
, and click the submission template you want to modify.
The modification window is displayed.
-
Click Add to add a field and select the field type File Path
Selection or Input Text.
- In the field definition, enter the field ID OUTPUT_FILE_LOCATION.
- Add help text for your field to indicate to users that they must have read and execute
access to directories they specify or job submission will fail and any other additional information
you may want to communicate.
- Click Save to exit the modification window.
- Click Save to save your changes.
- Select the Submission Script tab and modify your submission
script.
- Check that your submission script has the CWD_OPT line.
By default, all built-in submission templates have this line in the submission script.
If you created a custom submission template, check that the submission script has this line and
add it to your script if needed.
CWD_OPT="-cwd \"$OUTPUT_FILE_LOCATION\""
- Add ${CWD_OPT} to the JOB_RESULT line
right after the bsub command.
For example:
JOB_RESULT=`/bin/sh -c "bsub ${CWD_OPT} ${LSF_OPT} ${ADVANCED_OPT} ${LIMITS_OPT} ${CUSTOMIZE_OPT} ${JOB_COMMAND} 2>&1"`
Note: Depending on your submission template, the JOB_RESULT line
may differ from the example. Ensure that ${CWD_OPT} is immediately after the
bsub command.
- Click Save to save your application.
- Click Publish to publish your application.
- Test your configuration.
- Select Workload and click New to submit
a job to the application that you just modified.
- Specify the job directory location in your new field.
- Submit the job.
The job directory that is created should be the one you specified.