This script basically acts as a secretary, creating subdirectories, copying files, editing text, and submitting jobs in a coordinated fashion so that after the user configures just 2 text files, a single function call can result in thousands of computers working for days to weeks to calculate up to a combined 10-dimensional paramter scan. There are two steps to configuring MonsterScript.sh: configuring the input file and preparing the run files. An example input file can be found at Input_Examples/ParameterScan.inp which contains in-line documentation (see 10). Inside the working directory, one must place a properly configured ParameterScan.inp, libmctdhx.so, a binary executable file consistent with $binary defined inside ParameterScan.inp, and an input template consistent with $Input_Template defined inside ParameterScan.inp. Once these 4 files are properly configured and placed, the script is called by running
$MCTDHXDIR/MonsterScript.sh. The script scans up to 5 user defined relaxation parameters, runs them until convergence is detected and, if desired, automatically scans each relaxation with up to 5 user-defined propagation parameters. When running on a cluster, the script will automatically restart jobs if they finish, due to time constraints, before the calculation is complete. To circumvent job number restrictions on clusters, the script will build a series of runscripts that each simultaneously run many calculations in a single job, rather than a single computation per job.
A little under-the-hood knowledge is useful to to effectively use and debug MonsterScript.sh. The script initially calls $MCTDHXDIR/Computation_Scripts/ParameterScan_Propagation.sh
or $MCTDHXDIR/Comptuation_Scripts/ParameterScan_Relaxation.sh depending on the input file configuration, which then iterates through the corresponding parameter set. As the script loops through each parameter set, it calls either
$MCTDHXDIR/Scripts/IterateParameters.sh or $MCTDHXDIR/Scripts/IterateParameters_relax.sh which then perform the actual secretary functionality using about a dozen smaller scripts inside $MCTDHXDIR/Scripts. If it is determined that a new calculation must be run when using a cluster, a few lines are added to a runscript in the working directory called run#.sh for some number #. To avoid duplicate computations, a file in the computation directory is created called RunFlag, which is automatically deleted when the job runs out of time or the
computation is complete, via some code within the runscript. The runscript accumulates calculation jobs until the total number of nodes requested reaches a threshold defined by $MPMDNodes in ParameterScan.inp, and then it is submitted using (in most cases) a qsub command within either $MCTDHXDIR/Scripts/MPMDrun_relax.sh or $MCTDHXDIR/Scripts/MPMDrun_prop.sh on line 106. It is often useful to comment this line for testing purposes, as it will prevent the script from submitting any jobs, leaving it to only copy, move, and edit files. Directories with incomplete calculations are stored in files Relax_Array and Prop_Array*. Directories are removed from these files when their corresponding calculations are complete, triggering an end of the corresponding ParameterScan_*.sh function call when the array is empty.
When MonsterScript.sh is run without any arguments, all lingering runscripts, RunFlag's, and arrays are cleared. If the user wishes to keep these files, they must run MonsterScript.sh save.
Back to http://ultracold.org