The following text included sections of batch command script from the sample batch file as well as documentation that explains what the batch file is doing.
The .xml file sets the machine requirements and provides information for the Velocity Scheduler to schedule the job. This section requires modification by the user.
mathematica.bat
The next section calls the setup script which sets system paths and other settings. This section should not be modified by the user.
REM --- Call setup file for Mathematica
call setup_mathematica.bat
The next section defines four variables. ROOTDIR is the folder for the job's input files (normally on H: under the user's home directory). OUTDIR is the folder for the job's output files, typically under ROOTDIR. IN_FILE is the name of the Mathematica script file; OUT_FILE is the name for the Mathematica output.
This section should be modified by the user.
REM --- Set variables ROOTDIR, OUTDIR, IN_FILE, OUT_FILE.
set ROOTDIR=\\tc.cornell.edu\tc\users\%USERNAME%\mathematica
set OUTDIR=%ROOTDIR%\output
mkdir %OUTDIR%
set IN_FILE=test.m
set OUT_FILE=test.out
The next section creates a folder on the T: disk (if it doesn't already exist), deletes any old files that are in that directory, and copies the files needed for the job from the user's ROOTDIR (normally on H:) to the T: disk folder. It also changes the current working directory to the T:. Having all input and output files on the T: drive can improve performance for many batch jobs, plus execution of this part of the batch script (the cpu intensive part) will not be vulnerable to any network outages. This section should not normally be modified by the user.
REM --- Create temp directory and copy input file(s) from ROOTDIR
del /Q T:\%USERNAME%
mkdir T:\%USERNAME%
cd /D T:\%USERNAME%
del /S /Q T:\%USERNAME%\*.*
copy %ROOTDIR%\%IN_FILE% T:\%USERNAME%\
The next section executes Mathematica from the T: drive. This section should not normally be modified by the user.
REM --- Execute Mathematica and run your script file
math.exe < %IN_FILE% > %OUT_FILE%
The next section copies all files from the T: folder back to OUTTDIR and cleans up the local temporary space. This section should not normally be modified by the user.
REM --- Copy the output file(s) back to the OUTDIR
copy /Y t:\%USERNAME%\%OUT_FILE% %OUTDIR%\
REM --- change to temp drive & directory, and clean up files from this job
cd /D T:\
rd /s /q T:\%USERNAME%
The "vsched -c" ends the batch job. If you want the node to still be available to you for a remote connection, then comment out the vsched -c line with "REM" -- remembering that the node will be allocated to you (and charged to your account) until you explicitly release the job or the time limit is exceed.
REM --- End the batch job
vsched -c