Monte Carlo (MC) Generation Instructions for SpinQuest Simulations on Rivanna

https://www.cs.rice.edu/~vo9/deeplearning/2019/slides/Rivanna.pdf

Step 1: Logging Into Rivanna

  1. Navigate to the Rivanna login page: Rivanna OpenOnDemand.
  2. Use your credentials to log in.
  3. Once logged in, create a folder to submit your jobs from on /project/ptgroup/Your Named

Step 2: Setting Up an Interactive Session via Code Server

  1. Access the Interactive Apps tab on the dashboard.
  2. From the left-hand menu, select Code Server under Servers.
  3. Configure the following settings in the Code Server tab:
  • Partition: Standard
  • Number of Hours: adjust based on your needs
  • Number of Cores: 1
  • Allocation: spinquest_standard
  • Working Directory: Specify your project folder or leave it as the default $HOME

       4. Click Launch to start the interactive session.

       5. Once the session starts, you will see a link to access the Code Server. Click on it to open a Visual Studio Code environment in your browser.

Visual Representation:


Step 3: Setting Up Your Folder(If not already done so in step 1)

  1. In the Code Server terminal, create a directory for your work:
  • bash:

           cd /project/ptgroup/

           mkdir YourFolderName

           cd YourFolderName

       2. Copy the necessary scripts from the MC_Generation directory:

  • bash:

           rsync -av --exclude scratch /project/ptgroup/work/MC_Generation/DY_Target_script

           Or to make it easier use the copy function that is included on the Rivanna UI.

       3. Confirm that your folder contains the required files:

  • .C files (e.g., C)
  • Configuration files (.cfg)
  • Job submission scripts (sh, grid.slurm)
  • Add a README file to document the purpose of the scripts.

Step 4: Setting Up the Environment

  1. In the Code Server terminal, navigate to your job folder:
  • bash:

           cd /project/ptgroup/YourFolderName

       2. Source the environment for E1039 geometry:

  • bash:

           source /project/ptgroup/spinquest/this-e1039.sh

       3. Confirm the environment is active by running root and checking for no errors.

Step 5: Submitting Jobs

  1. Edit jobscript.sh to configure:
  • jobname: The name of your job.
  • njobs: Number of jobs.
  • nevents: Number of events per job (maximum: 10,000).

       2. Submit your jobs:

  • bash:

          ./jobscript.sh <OutputFolderName> <NumberOfJobs> <NumberOfEventsPerJob>

          ie. (./jobscript.sh DY_Target_1M 1 10000)

      3. Check job Status using:

  • “Active Jobs” tab in OpenOnDemand.

Step 6: Merging and Storing Output Files

  1. Merge your output files:
  • bash:

          cd /project/ptgroup/script

          ./merge_mc_prod.sh /scratch/<your_MC_output_file_location>

      2. Copy the merged .root file to the storage location:

  • cp merged_trackQA.root /project/ptgroup/spinquest/MC_storage/<Channel>_<VertexOrigin>_<NumberOfAcceptedEvents>.root

           ie. cp merged_trackQA.root

          /project/ptgroup/spinquest/MC_storage/DY_Target_1M.root

  • Another way to do this is by using the copy/move function on Rivanna(easier to navigate using this method)


Step 7: Accessing ROOT Files via Web Browser

  1. Open a terminal on your local machine and run the following commands:

      2. In your web browser, navigate to:

          To the link that is generated on the terminal

      3.  The ROOT graphical interface will open. Use this interface to explore and analyze .root files.

         ie. 

         


       Additional Information:

  1. After generating the files:
  • Navigate to "/project/ptgroup/script"  and then implement the following command (this script by-default will skip bad-files/corrupted-files/etc.)
    $ ./merge_mc_prod.sh /scratch/<your_MC_output_file_location>

    This will create a folder inside /project/ptgrpup/spinquest/MC_merge_files" with the same name as your MC_output_folder
  1. Copy the "merged_trackQA.root or merged_trackQA_v2.root" file from the folder that you've newly generated by ./merge_mc_prod.sh and copy it to "/project/ptgroup/spinquest/MC_storage" location. Rename the file into <Channel>_<Vertex Origin>_<Number of accepted event>.root. for example: JPsi_Dump_300K.root
  2. Use the Code Server interface for all terminal and coding activities, as it simplifies navigation and interaction with Rivanna.
  3. Document all scripts and outputs in the directory’s README for reproducibility and team collaboration.
  4. For issues, check the logs (slurm.out and slurm.err) in your job directories.


  • No labels