The following steps are for an example to submit a job for neural-net fit to 'N' number of kinematic settings in the data set (where N is an integer reflects to the range of kinematic settings which you will input in the sbatch command to submit the job).


1. Make sure that Prof. Keller has added you to both the spin and spinquest groups in Rivanna.
2. Copy the sample files from the following Rivanna folder "/project/ptgroup/ANN_scripts/Rivanna_test_code_for_ANN"
      $ cd  /project/ptgroup/ANN_scripts/Rivanna_test_code_for_ANN

Here are the list of file that you need to have in your work directory:

Definitions
                      BHDVCStf.py
                      Lorentz_Vector.py
                      TVA1_UU.py
Data file →  dvcs_xs_May-2021_342_sets.csv
Main file → Full_ML_fit_evaluation_Set2.py
Job submission file → Job.slurm

3. Change the path(s) in the following files
    3.1) Highlighted line in "Job.slurm" file (please see below) with the correct path of 'your files'
          
   
   3.2) Similarly update the paths on "Full_ML_fit_evaluation_Set2.py" file
           Line numbers → 22, 31, 154
 

4. (This step is not necessary to check the code running, but to speed up the testing) For a quick test, you can change the "number of samples" to a small number to test (in other words "number of replicas") which is in line number 115: 'numSamples = 1000'

5. Run the following commands on your terminal
       $ module load anaconda/2020.11-py3.8
       $ module load singularity/3.7.1
       $ cp $CONTAINERDIR/tensorflow-2.1.0-py37.sif /home/$USER
       $ module load tensorflow/2.1.0-py37
 (make sure that you have  the same module loads included in your Job.slurm file

6. Run the following command
      $ sbatch --array=0-14 Job.slurm
   Note: Here 0-14 means the number of kinematic settings that you want to run in parallel (this is parallelization of local fits), and as a part of the output you will see Results#.csv (where # is an integer number) files which contain distributions of Compton Form Factors (CFFs) from each (individual) local fit.



-------------------------------------------------- check below for earlier/previous  instructions-------------------------------------------


(updated in December 2020)
------------------------------


Here are some recent instructions for running jobs on Rivanna (by Nick & Ishara):


1. Make sure that Prof. Keller has added you to both the spin and spinquest groups in Rivanna.  Without both groups, you will not be able to gain access to the system. There are two ways of accessing Rivanna (https://www.rc.virginia.edu/userinfo/rivanna/login/); you can follow either step (2) or step (3) mentioned below.


The files you need for this particular example, can be found in the following links (make sure to modify the path in the files, with the appropriate one).
https://github.com/extraction-tools/ANN/tree/master/Rivanna_Example_Code
or
https://myuva.sharepoint.com/:f:/r/sites/as-physics-poltar/Shared%20Documents/ANN%20Extraction/Generic_Example_Files?csf=1&web=1&e=olyqru

or you can copy the files from the following Rivanna folder
/project/ptgroup/ANN_scripts/Rivanna_test_code_for_ANN


2. Web-based Access  (Click on "Launch OpenOndemand" > You will need your UVA computing ID and password to log in)

          Note: please check the anaconda module available on Rivanna and replace that version with the first line in the code-snippet above.

     module load singularity/3.7.1
     module load tensorflow/2.1.0-py37
cp $CONTAINERDIR/tensorflow-2.1.0-py37.sif /home/$USER 


3. Secure Shell Access:


4. Once the job is started, you will see a job ID in your Rivanna terminal. You can monitor the progress of your job by navigating the the "Jobs" page on your web browser (see fig 1 above). 

5. The results of the replicas will be in your home directory of Rivanna under the name Results(0-14).csv.  These can be sent back to your local system for analysis with the scp command or downloading via the OpenOnDemand