User Tools

Site Tools


runnersc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
runnersc [2016/04/22 12:52] – [Sample Batch Scripts] wsirunnersc [2022/07/21 06:59] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Running Jobs at NERSC ======
  
 +===== Logging on to NERSC =====
 +
 +  $ ssh simonw@cori.nersc.gov
 +  
 +Use the home directory to store data, but don't run codes here as space is limited.
 +See [[compilenersc|Compiling Codes at NERSC]]
 +
 +Use the scratch directory to compile and run codes, but don't use scratch as longterm storage.
 +
 +  $ cd $SCRATCH
 +  
 +There is a long-term storage solution called HPSS: http://www.nersc.gov/users/storage-and-file-systems/hpss/
 +
 +===== Sample Batch Scripts =====
 +Save a batch script as a separate file (e.g. mybatch ). Submit with
 +  $ sbatch mybatch
 +  
 +Before launching a multi-hour run, use a debug script to make sure you set everything up right. Only one debug run can be active at once, time-limit is 30 minutes.
 +
 +**Debug Script**
 +  #!/bin/bash -l
 +  
 +  #SBATCH -p debug     
 +  #SBATCH -N 64        
 +  #SBATCH -t 00:20:00  
 +  #SBATCH -J my_job    
 +  
 +  srun -n 2048 ./mycode.exe
 +
 +
 +**Regular batch script**
 +  #!/bin/bash -l
 +  
 +  #SBATCH -p regular 
 +  #SBATCH -N 2 
 +  #SBATCH -t 00:30:00
 +  
 +  cd $SLURM_SUBMIT_DIR   # optional, since this is the default behavior
 +  srun -n 64 ./my_executable
 +  
 +Use the account number m2560 (default acct) for runs. 
 +
 +===== Submitting a Job =====
 +
 +  sbatch mybatch_script
 +===== Checking Job Status =====
 +Check your job status
 +  $ sqs
 +
 +Cancel a job
 +  $ scancel jobid
 +
 +Alter options for currently queued job (does not work on running jobs)
 +  $ scontrol update jobid=jobid partition=new_partition timelimiit=timelimit qos=normal
 +===== More Information =====
 +http://www.nersc.gov/users/computational-systems/cori/running-jobs/