The following text shows the commands in the sample batch script (available for download from here), along with a description of what each section is doing.
Sections in red may require some customization by the user, with items in red bold italics ALWAYS needing customization for the individual user name or folder/file names. Black sections would not normally need any modification.
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.
<?xml version="1.0" ?>
<!-- Sample XML Job File -->
<job>
<nodes>1</nodes>
<minutes>20</minutes>
<type>batch</type>
<affiliation>serial</affiliation>
<run>\\tc.cornell.edu\tc\users\your_userid\fluentserial.bat</run>
</job>
This first section calls the Fluent setup script which alters the system path and other settings. This section should not be modified by the user.
@echo off
REM Sample batch file for a Fluent 6.3.26 serial job
@echo on
REM --- Call setup file for Fluent
call setup_fluent.bat
The next section defines four variables; for more information on these variables see the CTC Software page on Fluent. FLUENT_VERSION can be 2d, 3d, 2ddp, or 3ddp. This section should be modified by the user.
REM --- Set FLUENT_VERSION, ROOTDIR, IN_FILE, and OUT_FILE_1 variables.
REM --- (If more than one output file, create variables OUT_FILE_2, etc.)
set FLUENT_VERSION=2d
set ROOTDIR=\\tc.cornell.edu\tc\Users\%USERNAME%
set IN_FILE=inputfile
set OUT_FILE_1=outputfile
REM ---> uncomment if needed ---> OUT_FILE_2=datafile.dat
The next section moves the files from the user's ROOTDIR to the local temporary directory (on the T: drive) and deletes any old output files. This section should not normally be modified by the user (unless there are extra output files to delete).
REM --- Create, or delete and re-create, a clean user directory on T:
if exist T:\%USERNAME% del /S /Q T:\%USERNAME%
if exist T:\%USERNAME%\NUL rmdir /S /Q T:\%USERNAME%
mkdir T:\%USERNAME%
cd /D T:\%USERNAME%
REM --- Copy the input files from ROOTDIR.
copy %ROOTDIR%\* T:\%USERNAME%\
REM --- Fluent will stall with no output if %OUT_FILE_n% is present.
del /Q T:\%USERNAME%\%OUT_FILE_1%
REM ---> uncomment if needed ---> del /Q T:\%USERNAME%\%OUT_FILE_2%
The next line runs fluent and specifies the input file. This section should not normally be modified by the user.
REM --- Execute Fluent; best to specify full path name for input script file
REM --- NOTE: script is assumed to contain output filename(s) without path
fluent %FLUENT_VERSION% -g -i T:\%USERNAME%\%IN_FILE%
The next line executes a loop that checks to see if Fluent is still active, so that the job does not end before Fluent is done executing. The variable PULIST_NAME was set by the call to setup_fluent.bat at the beginning of this file. This section should not be modified by the user.
REM --- Check to see if Fluent is finished
:loops
call sleep 30
pslist.exe | find "%PULIST_NAME%" && goto loops
The next section copies the output file back to the user's ROOTDIR and cleans up the local temporary space. This section should not normally be modified by the user (unless there are extra output files to copy).
REM --- Copy the output file(s) back to ROOTDIR.
REM --- (Add extra copy commands if there is more than a single output file.)
REM --- Overwrite any pre-existing output file(s)
copy /Y T:\%USERNAME%\%OUT_FILE_1% %ROOTDIR%\
REM ---> uncomment if needed ---> copy /Y T:\%USERNAME%\%OUT_FILE_2% %ROOTDIR%\
REM --- Clean up files from this job
cd /D T:\
rmdir /S /Q T:\%USERNAME%
This last line returns the batch node to the batch system.
REM --- End the job
vsched -c