Batch Scripts for RA & Mio

Similar documents
Ra - Batch Scripts. Timothy H. Kaiser, Ph.D. tkaiser@mines.edu

Job Scheduling with Moab Cluster Suite

Quick Tutorial for Portable Batch System (PBS)

Resource Management and Job Scheduling

Job scheduler details

Miami University RedHawk Cluster Working with batch jobs on the Cluster

Hodor and Bran - Job Scheduling and PBS Scripts

SLURM: Resource Management and Job Scheduling Software. Advanced Computing Center for Research and Education

PBS Tutorial. Fangrui Ma Universit of Nebraska-Lincoln. October 26th, 2007

SLURM: Resource Management and Job Scheduling Software. Advanced Computing Center for Research and Education

RA MPI Compilers Debuggers Profiling. March 25, 2009

Introduction to Running Hadoop on the High Performance Clusters at the Center for Computational Research

NYUAD HPC Center Running Jobs

Linux für bwgrid. Sabine Richling, Heinz Kredel. Universitätsrechenzentrum Heidelberg Rechenzentrum Universität Mannheim. 27.

TORQUE Administrator s Guide. version 2.3

Tutorial: Using WestGrid. Drew Leske Compute Canada/WestGrid Site Lead University of Victoria

Work Environment. David Tur HPC Expert. HPC Users Training September, 18th 2015

Maui Administrator's Guide

Grid 101. Grid 101. Josh Hegie.

Introduction to Sun Grid Engine (SGE)

Running applications on the Cray XC30 4/12/2015

NEC HPC-Linux-Cluster

Parallel Debugging with DDT

Using WestGrid. Patrick Mann, Manager, Technical Operations Jan.15, 2014

Using Parallel Computing to Run Multiple Jobs

Introduction to SDSC systems and data analytics software packages "

Getting Started with HPC

Guillimin HPC Users Meeting. Bryan Caron

High-Performance Reservoir Risk Assessment (Jacta Cluster)

Job Scheduling Explained More than you ever want to know about how jobs get scheduled on WestGrid systems...

Running on Blue Gene/Q at Argonne Leadership Computing Facility (ALCF)

1.0. User Manual For HPC Cluster at GIKI. Volume. Ghulam Ishaq Khan Institute of Engineering Sciences & Technology

Caltech Center for Advanced Computing Research System Guide: MRI2 Cluster (zwicky) January 2014

How To Run A Cluster On A Linux Server On A Pcode (Amd64) On A Microsoft Powerbook On A Macbook 2 (Amd32)

The Moab Scheduler. Dan Mazur, McGill HPC Aug 23, 2013

Installing and running COMSOL on a Linux cluster

Grid Engine Basics. Table of Contents. Grid Engine Basics Version 1. (Formerly: Sun Grid Engine)

HPC at IU Overview. Abhinav Thota Research Technologies Indiana University

High Performance Computing Facility Specifications, Policies and Usage. Supercomputer Project. Bibliotheca Alexandrina

Batch Systems. provide a mechanism for submitting, launching, and tracking jobs on a shared resource

Using the Yale HPC Clusters

Introduction to the SGE/OGS batch-queuing system

PBS Professional 12.1

Debugging and Profiling Lab. Carlos Rosales, Kent Milfeld and Yaakoub Y. El Kharma

Grid Engine 6. Troubleshooting. BioTeam Inc.

TORQUE Resource Manager

Manual for using Super Computing Resources

User s Manual

Submitting and Running Jobs on the Cray XT5

The Asterope compute cluster

The SUN ONE Grid Engine BATCH SYSTEM

Grid Engine Users Guide p1 Edition

The RWTH Compute Cluster Environment

PBS Professional User s Guide. PBS Works is a division of

Streamline Computing Linux Cluster User Training. ( Nottingham University)

The CNMS Computer Cluster

GRID Computing: CAS Style

HOD Scheduler. Table of contents

Martinos Center Compute Clusters

Parallel Computing using MATLAB Distributed Compute Server ZORRO HPC

Beyond Windows: Using the Linux Servers and the Grid

OLCF Best Practices (and More) Bill Renaud OLCF User Assistance Group

Altair. PBS Pro. User Guide 5.4. for UNIX, Linux, and Windows

An Introduction to High Performance Computing in the Department

How To Run A Steady Case On A Creeper

SGE Roll: Users Guide. Version Edition

A High Performance Computing Scheduling and Resource Management Primer

8/15/2014. Best (and more) General Information. Staying Informed. Staying Informed. Staying Informed-System Status

Efficient cluster computing

HPCC - Hrothgar Getting Started User Guide MPI Programming

HPC system startup manual (version 1.30)

Technical Support. Copyright notice does not imply publication. For more information, contact Altair at: Web:

Introduction to Sun Grid Engine 5.3

An introduction to compute resources in Biostatistics. Chris Scheller

Introduction to Grid Engine

Submitting batch jobs Slurm on ecgate. Xavi Abellan User Support Section

Batch Job Analysis to Improve the Success Rate in HPC

PBS Professional 11.1

Parallel Programming for Multi-Core, Distributed Systems, and GPUs Exercises

PBSPro scheduling. PBS overview Qsub command: resource requests. Queues a7ribu8on. Fairshare. Backfill Jobs submission.

High Performance Computing with Sun Grid Engine on the HPSCC cluster. Fernando J. Pineda

Job Scheduler Daemon Configuration Guide

To connect to the cluster, simply use a SSH or SFTP client to connect to:

Introduction to Linux and Cluster Basics for the CCR General Computing Cluster

Batch Job Management with Torque/OpenPBS

Parallel Processing using the LOTUS cluster

SLURM Workload Manager

Sun Grid Engine, a new scheduler for EGEE

High Performance Computing

User s Guide. Introduction

MFCF Grad Session 2015

Transcription:

Batch Scripts for RA & Mio Timothy H. Kaiser, Ph.D. tkaiser@mines.edu 1

Jobs are Run via a Batch System Ra and Mio are shared resources Purpose: Give fair access to all users Have control over where jobs are run Set limits on times and processor counts Allow exclusive access to nodes while you own them 2

Batch Systems Create a script that describes: What you want to do What resources (# nodes) you want How long you want the resources Submit you script to the queuing system Wait for some time for your job to start Resources Time required Your job runs and you get your output 3

Typical Batch System You might hear of Torque, Moab, or PBS. For our purposes they are the same Marketing pitch from the web page: Our Workload Manager is a policy-based job scheduler and event engine that enables utility-based computing for clusters. Moab Workload Manager combines intelligent scheduling of resources with advanced reservations to process jobs on the right resources at the right time. It also provides flexible policy and event engines that process workloads faster and in line with set business requirements and priorities. 4

RA - Mio Differences msub is only on RA (historical reasons) On Mio the command is qsub but we recommend that you alias msub=qsub qsub is on RA but you should not normally use it On RA your scripts must contain an account 5

A Simple Script for a MPI job!/bin/bash #PBS -l nodes=1:ppn=8 #PBS -l walltime=02:00:00 #PBS -N testio #PBS -A account #PBS -o stdout #PBS -e stderr #PBS -V #PBS -m abe #PBS -M tkaiser@mines.edu #---------------------- cd $PBS_O_WORKDIR mpiexec -n 8 c_ex00 Scripts contain normal shell commands and comments designated with a # that are interpreted by PBS On RA you must specify an account 6

Running and monitoring jobs [tkaiser@ra ~/mydir]$ msub mpmd Use msub (qsub) to submit the job qstat to see its status (Q,R,C) qdel to kill the job if needed 8452 [tkaiser@ra ~/mydir]$ qstat 8452 Job id Name User Time Use S Queue ------------------ -------------- ------------- -------- - ----- 8452.ra testio tkaiser 0 R SHORT [tkaiser@ra ~/mydir]$ [tkaiser@ra ~/mydir]$ [tkaiser@ra ~/mydir]$ qstat -u tkaiser Job id Name User Time Use S Queue ------------------ -------------- ------------- -------- - ----- 8452.ra testio tkaiser 0 R SHORT [tkaiser@ra ~/mydir]$ [tkaiser@ra ~/mydir]$ [tkaiser@ra ~/mydir]$ qdel 8452 7

A Simple Script for a MPI job Command #!/bin/bash #PBS -l nodes=1:ppn=8 #PBS -l walltime=02:00:00 #PBS -N testio #PBS -o stdout #PBS -e stderr #PBS -A account #PBS -V #PBS -m abe #PBS -M tkaiser@mines.edu Comment We will run this job using the "Bash" shell We want 1 node with 8 processors for a total of 8 processors We will run for up to 2 hours The name of our job is testio Standard output from our program will go to a file stdout Error output from our program will go to a file stderr An account is required on RA - from your PI Very important! Exports all environment variables from the submitting shell into the batch shell. Send mail on abort, begin, end use n to suppress Where to send email to (cell phone?) #---------------------- Not important. Just a separator line. cd $PBS_O_WORKDIR mpiexec -n 8 c_ex00 Very important! Go to directory $PBS_O_WORKDIR which is the directory which is where our script resides Run the MPI program c_ex00 on 8 computing cores. 8

Another example #!/bin/tcsh #PBS -l nodes=2:ppn=8 #PBS -l walltime=00:20:00 #PBS -N testio #PBS -o out.$pbs_jobid [tkaiser@ra ~/mpmd]$ cat fulllist #PBS -e err.$pbs_jobid compute-9-9.local #PBS -A support compute-9-9.local compute-9-9.local #PBS -m n compute-9-9.local #PBS -M tkaiser@mines.edu compute-9-9.local #PBS -V compute-9-9.local cat $PBS_NODEFILE > fulllist compute-9-9.local sort -u $PBS_NODEFILE > shortlist compute-9-9.local cd $PBS_O_WORKDIR compute-9-8.local mpiexec -np 16 $PBS_O_WORKDIR/c_ex01 compute-9-8.local compute-9-8.local compute-9-8.local compute-9-8.local compute-9-8.local compute-9-8.local compute-9-8.local [tkaiser@ra ~/mpmd]$ cat shortlist compute-9-8.local compute-9-9.local [tkaiser@ra ~/mpmd]$ ls err* out* err.8453.ra.mines.edu out.8453.ra.mines.edu 9

[ra]$ nsort --help A Useful Utility! A utility for returning a uniquely sorted list of nodes for a parallel application. TYPICAL USAGE WITHIN A PBS SCRIPT nsort $PBS_NODEFILE > shortlist AUTHOR! Timothy H. Kaiser! tkaiser@mines.edu! Colorado School of Mines! July 18, 2008 LOCATION! /lustre/home/apps/utility/nsort Replaces using the Unix sort utility 10

Using MVAPICH2 11

Issues Likes full paths to applications Need to shut it down Need to manually start an MPI daemon 12

Your script becomes #!/bin/tcsh #PBS -l nodes=2:ppn=8 #PBS -l walltime=00:20:00 #PBS -N testio #PBS -o out.$pbs_jobid #PBS -e err.$pbs_jobid #PBS -m n #PBS -M tkaiser@mines.edu #PBS -V cd $PBS_O_WORKDIR These numbers should match nsort $PBS_NODEFILE > shortlist mpdboot --totalnum=2 --file=shortlist mpiexec -np 16 $PBS_O_WORKDIR/c_ex01 mpdallexit mpdboot starts MPI mpdallexit stops it 13

From the Documentation sort $PBS_NODEFILE uniq -c awk '{printf "%s:%s\n",$1,$2}' > mpd.nodes mpdboot -f mpd.hosts -n [NUM NODES REQUESTED]... mpdallexit 14

Not normally needed 15 #PBS -l More Script notes Used to specify resource requests Can have multiple per -l lines per script #PBS -l nodes=2:ppn=8:fat Ra has 16 Gbyte and 32 Gbyte nodes Specify the 32 Gbyte nodes #PBS -l naccesspolicy=singlejob Grant exclusive access to a node

PBS Variables Variable PBS_JOBID PBS_O_WORKDIR PBS_NNODES PBS_NODEFILE PBS_O_HOME PBS_JOBNAME PBS_QUEUE PBS_MOMPORT PBS_O_HOST PBS_O_LANG PBS_O_LOGNAME PBS_O_PATH PBS_O_SHELL PBS_JOBCOOKIE PBS_TASKNUM PBS_NODENUM Meaning unique PBS job ID jobs submission directory number of nodes requested file with list of allocated nodes home dir of submitting user user specified job name job queue active port for mom daemon host of currently running job language variable for job name of submitting user path to executables used in job script script shell job cookie number of tasks requested (see pbsdsh) node offset number (see pbsdsh) 16

Where s my Output? Standard Error and Standard Out don t show up until after your job is completed Output is temporarily stored in /tmp on your nodes You can ssh to your nodes and see your output Looking into changing this behavior, or at least make it optional You can pipe output to a file: mpiexec myjob > myjob.$pbs_jobid 17

Useful Torque Commands Command canceljob checkjob mdiag mjobctl mrsvctl mshow msub releasehold releaseres sethold showq showres showstart showstate cancel job Description provide detailed status report for specified job provide diagnostic reports for resources, workload, and scheduling control and modify job create, control and modify reservations displays various diagnostic messages about the system and job queues submit a job (Don t use qsub) release job defers and holds release reservations set job holds show queued jobs show existing reservations show estimates of when job can/will start show current state of resources http://www.clusterresources.com/products/mwm/docs/a.gcommandoverview.shtml 18

Other Commands canceljob changeparam checkjob checknode diagnose mcredctl mdiag mjobctl mnodectl mrmctl mrsvctl mschedctl mshow mshow -a msub releasehold releaseres resetstats runjob sethold setqos setres setspri showbf showconfig showq showres showstart showstate showstats showstats -f cancel job change in memory parameter settings provide detailed status report for specified job provide detailed status report for specified node provide diagnostic report for various aspects of resources, workload, and scheduling controls various aspects about the credential objects within Moab provide diagnostic reports for resources, workload, and scheduling control and modify job control and modify nodes query and control resource managers create, control and modify reservations modify scheduler state and behavior displays various diagnostic messages about the system and job queues query and show available system resources scheduler job submission release job defers and holds release reservations reset scheduler statistics force a job to run immediately set job holds modify job QOS settings set an admin/user reservation adjust job/system priority of job show current resource availability show current scheduler configuration show queued jobs show existing reservations show estimates of when job can/will start show current state of resources show usage statistics show various tables of scheduling/system performance 19

Useful Torque commands Command tracejob pbsnodes qalter qdel qhold qrls qrun qsig qstat pbsdsh qsub Description trace job actions and states recorded in TORQUE logs view/modify batch status of compute nodes modify queued batch jobs delete/cancel batch jobs hold batch jobs release batch job holds start a batch job send a signal to a batch job view queues and jobs launch tasks within a parallel job submit a job (Don t use) http://www.clusterresources.com/torquedocs21/a.acommands.shtml 20

Torque commands momctl pbsdsh pbsnodes qalter qchkpt qdel qhold qmgr qrerun qrls qrun qsig qstat qsub qterm tracejob manage/diagnose MOM (node execution) daemon launch tasks within a parallel job view/modify batch status of compute nodes modify queued batch jobs checkpoint batch jobs delete/cancel batch jobs hold batch jobs manage policies and other batch configuration rerun a batch job release batch job holds start a batch job send a signal to a batch job view queues and jobs submit jobs (Don t use except for interactive runs) shutdown pbs server daemon trace job actions and states recorded in TORQUE logs 21

Topics to be Covered Running less than N tasks per node OpenMP Large memory per task Multi Program Multi Data Bag of task using PBS Lots of tricks Staging data 22

Running Interactive 23

Interactive Runs It is possible to grab a collection of nodes and run parallel interactively Nodes are yours until you quit Might be useful during development Running a number of small parallel jobs Required (almost) for running parallel debuggers 24

Multistep Process Ask for the nodes using qsub qsub -q INTERACTIVE -A support -I -V -l nodes=1 You are automatically Logged on to the nodes you are given Go to your working directory Run your job(s) Logout to release your nodes Ignore: cp: cannot stat `/opt/torque/mom_priv/jobs/73156.ra.local.sc': No such file or directory Don t abuse it, lest you be shot. 25

Example [tkaiser@ra ~/guide]$qsub -q INTERACTIVE -I -V -l nodes=1 -l naccesspolicy=singlejob qsub: waiting for job 1280.ra.mines.edu to start qsub: job 1280.ra.mines.edu ready [tkaiser@compute-9-8 ~]$cd guide [tkaiser@compute-9-8 ~/guide]$mpirun -n 4 c_ex00 Hello from 0 of 4 on compute-9-8.local Hello from 1 of 4 on compute-9-8.local Hello from 2 of 4 on compute-9-8.local Hello from 3 of 4 on compute-9-8.local [tkaiser@compute-9-8 ~/guide]$ [tkaiser@compute-9-8 ~/guide]$mpirun -n 16 c_ex00 Hello from 1 of 16 on compute-9-8.local Hello from 0 of 16 on compute-9-8.local Hello from 3 of 16 on compute-9-8.local Hello from 4 of 16 on compute-9-8.local...... Hello from 15 of 16 on compute-9-8.local Hello from 2 of 16 on compute-9-8.local Hello from 6 of 16 on compute-9-8.local [tkaiser@compute-9-8 ~/guide]$ [tkaiser@compute-9-8 ~/guide]$exit logout Ensures exclusive access qsub: job 1280.ra.mines.edu completed [tkaiser@ra ~/guide]$ 26

Challenge Take the example that we ran yesterday Have process 0 sent an integer, 12345, to process 1 Both processes print out their ID and the integer All other processes just print ID Compile using mpicc or mpif90 27

Challenge Modify your run script Put output into a stamped file Send you email when it is done Run on 8 and 16 cores Run interactively on 2, 4, and 7 cores 28