.. _running_simulations: =================== Running Simulations =================== .. contents:: In this section: :local: :depth: 2 This section presents the fundamental concepts for processing jobs on GridUnesp, from environment preparation to execution monitoring. .. important:: The server **access.grid.unesp.br** is exclusively for access and preparation. **NEVER run simulations directly on access.** Always use the queue system (SLURM) to submit jobs to the processing nodes. Basic Workflow ============== .. raw:: html The typical workflow on GridUnesp follows these steps: 1. **Access** the access server (``ssh``) 2. **Prepare** your files and scripts in ``/home/`` 3. **Submit** the job with ``sbatch`` 4. **Monitor** execution with ``squeue`` 5. **Retrieve** results after completion First Job: Simple Example ========================= Let's create a test job that simply displays the date and waits 60 seconds. **Step 1: Create the submission script** .. code-block:: bash :caption: first_job.sh #!/bin/bash #SBATCH -t 5:00 # Maximum time: 5 minutes date sleep 60 **Step 2: Submit the job** .. code-block:: bash sbatch first_job.sh **Step 3: Check the status** .. code-block:: bash squeue -u $USER **Step 4: View the result** .. code-block:: bash cat slurm-*.out .. note:: The output file follows the pattern ``slurm-JOBID.out``. .. _monitoring_jobs: Monitoring Jobs =============== squeue command -------------- .. code-block:: bash # View all jobs squeue -a # View only your jobs squeue -u $USER # View jobs in detailed format squeue -u $USER -o "%.18i %.9P %.8j %.8u %.2t %.10M %.6D %R" **Job states:** - **PD** (PENDING): Waiting for resources - **R** (RUNNING): Running - **CG** (COMPLETING): Finishing - **F** (FAILED): Failed - **TO** (TIMEOUT): Exceeded time limit **Example output:** .. code-block:: text JOBID PARTITION NAME USER ST TIME NODES NODELIST 2848879 short vulcano.sh spock R 0:09 1 node011 2841620 long crucio.sh vader R 10:02:40 1 node018 scontrol command ---------------- To get full details of a job: .. code-block:: bash scontrol show job JOBID **Example partial output:** .. code-block:: text JobId=2848879 JobName=vulcano.sh UserId=spock(11992) GroupId=enterprise(11006) JobState=RUNNING RunTime=00:00:18 TimeLimit=00:05:00 NodeList=node011 Command=/home/spock/vulcano.sh scancel command --------------- To cancel a job: .. code-block:: bash scancel JOBID To cancel all your jobs: .. code-block:: bash scancel -u $USER .. _basic_queue_system: Queue System (Partitions) ========================= GridUnesp organizes jobs into partitions based on maximum execution time: .. list-table:: Available partitions :header-rows: 1 :widths: 20 30 50 * - Partition - Limit - Recommended use * - **short** - 24 hours - Tests, quick jobs (default) * - **medium** - 7 days - Medium-duration simulations * - **long** - 30 days - Long simulations * - **gpu** - 24 hours - Exclusively for the GPU server .. important:: - If not specified, the job goes to the **short** partition with a 24h limit - When the limit is reached, the job is **automatically cancelled** (TIMEOUT) - Always specify a **realistic** time (shorter jobs have priority) Specifying time: .. code-block:: bash #SBATCH -t 30:00 # 30 minutes #SBATCH -t 12:00:00 # 12 hours #SBATCH -t 2-12:00:00 # 2 days and 12 hours #SBATCH -t 30-00:00:00 # 30 days .. _storage_info: File Systems ============ During execution, jobs use different storage areas: .. list-table:: Mount points :header-rows: 1 :widths: 20 20 60 * - Location - Capacity - Use * - ``/home/`` - 120 TB - Job preparation (accessible from access server) * - ``/tmp/`` - ~180 GB/node - Single-node jobs (fast, temporary) * - ``/store/`` - 7 TB - Multi-node jobs and large files .. tip:: See :ref:`storage_guide` for details on how to optimize the use of each area. Basic Command Summary ===================== .. list-table:: Essential commands :header-rows: 1 :widths: 30 70 * - Command - Description * - ``sbatch script.sh`` - Submit job * - ``squeue -u $USER`` - View your jobs * - ``scancel JOBID`` - Cancel job * - ``scontrol show job JOBID`` - Job details * - ``sacct -j JOBID`` - Job history (after completion) .. seealso:: - :ref:`improving_submission_script` - More configuration options - :ref:`monitoring_jobs` - Advanced monitoring - :ref:`priority_policy` - How priority works - :ref:`best_practices` - Usage recommendations