
##------------------------------------------RUN_SIMULATION-----------------------------------------#

This python script generates several jobscripts and lua files based on the input parameters given 
in the parameter file (params.py). Jobs can also be submitted by specifying command in the 
params.py.
The parameters in the parameter file (params.py) are :

##*************************************************************************************************#
##------------------------------------PARAMETERS---------------------------------------------------#
##*************************************************************************************************#

## -------- Necessary parameters ------------------------------------------------------------------#
- path to lib           # Path to library;  default = 'lib' 
- path to exec          # Path to executable 

  # one of jobscript_template or lua_template has to be specified
- jobscript_template    # path to template file for generating jobscripts 
- lua_template          # path to template file for generating lua files
  # The template files should be named: <name>.template (eg quelea.template or gausspulse.template)

## -------- Varying parameters ------------------------------------------------------------------#
- job_params            # The parameters to be changed in the jobscript
- lua_params            # Parameters to be changed in the lua script

  # To vary parameters: Simply add the parameters to be varied as lists.
  # for example:-
  #To vary sigma and refinement level in lua script :

  lua_params = [ [ "sigma", 0.1,0.2],
                 ["refinement level",3,5]
               ]
  # 4 lua files get generated from the above input (all combinations of sigma & refinement level)
  # There is also an option to fix certain set of parameters with respect to each other. They can
  # be added as a tupple.
  # for example
  job_params = [  [ ( "NPROCS", "RunTime"  ),
                    (  "1", "10:00:00" ),
                    (  "4", "02:30:00" )],
                [ "NP_NODE",
                   1, 2, 3, 4, 5, 6, 7, 8
                ]
             ]
   # Here runtime is always coupled with NPROCS. The size of tupple can be varied and there
   # can be multiple tupples 

## -------- Other Parameters ------------------------------------------------------------------#
-submit_job               # Can be used to submit the jobs if set to 'True'
-sub_command              # command for job submission

-run_exec                 # Can be used to run the lua scripts generated locally
-run_command              # command for running the lua file

 




##*************************************************************************************************#
##------------------------------STEPS TO BE FOLLOWED-----------------------------------------------#
##*************************************************************************************************#

The following steps should be followed to run the script.

##-----If you just want to create job script and not vary parameters in the lua script-------------#

    - create a template file named <name>.template (eg quelea.template) in the directory "machines".
    - The template should be modified with the variables "${path_to_executable}$";
      and "${argument}$" at appropriate places in the template. See "quelia.template" for example.
      Other variables to be modified should be added in the "lua_params" list with corresponding
      changes made in the template file.
    - make changes in the parameter file (params.py). Add the necessary parameters and others as
      explained above.
    - Make sure that "lua_params" list is empty (please don't comment it out). 
    - Run the script ./run_simulation.py 
    - There is an potion to submit all the jobscripts generated.


##-----If you want to create a jobscript varying parameters in lua script ------------------------#

   - Follow the above procedure for the jobscript.
   - To vary parameters - copy the lua script inside the directory "config". Enter the path to lua 
     script in "lua_template" in the parameter file (params.py)
   - Now open the lua script and any parameter you need to modify in lua script should have an 
     argument starting with "${" and end with "}$". create a variable in the script.
   - Add the variables you created in lua script in to params.py (in the "lua_params" section). 
     Make sure the variable names put in lua file exactly matches the one put in params.list
   - Run the script using ./run_simulation.py
   - There is an option to run the script locally. 


