COSC 6374 Parallel Computation. Debugging MPI applications. Edgar Gabriel. Spring 2008

Similar documents
COSC 4397 Parallel Computation. Debugging and Performance Analysis of Parallel MPI Applications

Performance Metrics (I)

COSC 6374 Parallel Computation. Analytical Modeling of Parallel Programs (I) Edgar Gabriel Fall Execution Time

COSC 6385 Computer Architecture. - Homework

COSC 6374 Parallel Computation. Edgar Gabriel Fall Each student should deliver Source code (.c file) Documentation (.pdf,.doc,.tex or.

Parallel Debugging with TotalView BSC-CNS

Debugging with TotalView

STARTING THE DDT DEBUGGER ON MIO, AUN, & MC2. (Mouse over to the left to see thumbnails of all of the slides)

Using a Linux System 6

Introduction to Joker Cyber Infrastructure Architecture Team CIA.NMSU.EDU

Debugging. John Lockman Texas Advanced Computing Center

Guillimin HPC Users Meeting July 14, 2016

Distributed Memory Programming With MPI Computer Lab Exercises

Testing and Debugging C Programming and Software Tools. N.C. State Department of Computer Science

DDT: A visual, parallel debugger on Ra

C++ for Everyone, 2e, Cay Horstmann, Copyright 2012 John Wiley and Sons, Inc. All rights reserved. Using a Debugger WE5.

Welcome. HRSK Practical on Debugging, Zellescher Weg 12 Willers-Bau A106 Tel

TotalView. Debugging Tool Presentation. Josip Jakić

IBM PSSC Montpellier Customer Center. Content

COSC 6385 Computer Architecture - Project

Debugging with GDB and DDT

Beginner's Guide for UK IBM systems

Allinea DDT Debugger. Dan Mazur, McGill HPC March 5,

Batch Systems & Parallel Application Launchers Running your jobs on an HPC machine

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

SCALABLE HYBRID PROTOTYPE

Problem Set 1: Unix Commands 1

Batch Systems. Running your jobs on an HPC machine

Working on the NewRiver Cluster

DEBUGGING ON FERMI PREPARING A DEBUGGABLE APPLICATION GDB. GDB on front-end nodes

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

Debugging with GDB and DDT

Computing with the Moore Cluster

Scientific Programming in C IX. Debugging

Understanding the Program Run

Slurm basics. Summer Kickstart June slide 1 of 49

Jackson State University Department of Computer Science CSC / Advanced Information Security Spring 2013 Lab Project # 5

Introduction to SLURM on the High Performance Cluster at the Center for Computational Research

How to run applications on Aziz supercomputer. Mohammad Rafi System Administrator Fujitsu Technology Solutions

MIC Lab Parallel Computing on Stampede

Computer Labs: Debugging

Introduction to Parallel Programming. Martin Čuma Center for High Performance Computing University of Utah

We first learn one useful option of gcc. Copy the following C source file to your

Module 4: Working with MPI

The Unix Shell & Shell Scripts

Introduction to GALILEO

A Hands-On Tutorial: RNA Sequencing Using High-Performance Computing

Batch Systems. Running calculations on HPC resources

Working with Shell Scripting. Daniel Balagué

Part One: The Files. C MPI Slurm Tutorial - Hello World. Introduction. Hello World! hello.tar. The files, summary. Output Files, summary

The GPU-Cluster. Sandra Wienke Rechen- und Kommunikationszentrum (RZ) Fotos: Christian Iwainsky

Debugging Intel Xeon Phi KNC Tutorial

Parallel Debugging. ª Objective. ª Contents. ª Learn the basics of debugging parallel programs

12. Debugging. Overview. COMP1917: Computing 1. Developing Programs. The Programming Cycle. Programming cycle. Do-it-yourself debugging

Introduction to Parallel Programming. Martin Čuma Center for High Performance Computing University of Utah

Using a debugger. Segmentation fault? GDB to the rescue!

Project 5 Handling Bit Arrays and Pointers in C

Binghamton University. CS-220 Spring C Debugging Basics. No relevant text

High Performance Beowulf Cluster Environment User Manual

EE 355 Lab 3 - Algorithms & Control Structures

TOS Test Center (TTC)

RWTH GPU-Cluster. Sandra Wienke March Rechen- und Kommunikationszentrum (RZ) Fotos: Christian Iwainsky

Getting Started with TotalView on Beacon

Laboratory 1 Semester 1 11/12

Docker task in HPC Pack

Exercises: Abel/Colossus and SLURM

Your code must have been compiled with the -g compiler option. Example:

Introduction to UBELIX

Introduction to RCC. September 14, 2016 Research Computing Center

1. Getting started with GPUs and the DAS-4 For information about the DAS-4 supercomputer, please go to:

Xeon Phi Native Mode - Sharpen Exercise

Introduction to RCC. January 18, 2017 Research Computing Center

LAB. Preparing for Stampede: Programming Heterogeneous Many-Core Supercomputers

Hands-on. MPI basic exercises

Working with Basic Linux. Daniel Balagué

Intel MPI Cluster Edition on Graham A First Look! Doug Roberts

Lab 9 Loops, Debugging

Lab 1 Introduction to UNIX and C

DDT Debugging Techniques

Introduction to Parallel Programming. Martin Čuma Center for High Performance Computing University of Utah

Debugging and profiling of MPI programs

Introduction to SLURM & SLURM batch scripts

Using the Debugger. Michael Jantz Dr. Prasad Kulkarni

Calcul intensif et Stockage de Masse. CÉCI/CISM HPC training sessions Use of Matlab on the clusters

Submitting and running jobs on PlaFRIM2 Redouane Bouchouirbat

Xeon Phi Native Mode - Sharpen Exercise

Calcul intensif et Stockage de Masse. CÉCI/CISM HPC training sessions

CRUK cluster practical sessions (SLURM) Part I processes & scripts

For Dr Landau s PHYS8602 course

Debugging Techniques. CEFET Engineering Week

HPC Workshop. Nov. 9, 2018 James Coyle, PhD Dir. Of High Perf. Computing

Compilation and Parallel Start

Development in code_aster Debugging a code_aster execution

Lab 1 Introduction to UNIX and C

RHRK-Seminar. High Performance Computing with the Cluster Elwetritsch - II. Course instructor : Dr. Josef Schüle, RHRK

Programming Studio #9 ECE 190

Using the Command Line

Hands-on Workshop on How To Debug Codes at the Institute

Table of Contents. Table of Contents Job Manager for remote execution of QuantumATK scripts. A single remote machine

NOTE: From the engineering network, users may login directly to the desired computer server using the SSH connection.

Transcription:

COSC 6374 Parallel Computation Debugging MPI applications Spring 2008 How to use a cluster A cluster usually consists of a front-end node and compute nodes Name of the front-end node: shark.cs.uh.edu You can login to the front end node using ssh (from windows or linux machines) using the login name and the password assigned to you. The front end node is supposed to be there for editing, and compiling - not for running jobs! If 42 users would run their jobs on the same processor, everything would stall!!!!! Remember, that each node consists of two cores -> number of nodes to allocate = number of processes you want to run / 2 1

How to use a cluster (II) Once your code is correct and you would like to do the measurements: You have to submit a batch job The command you need is srun, e.g. srun N 2 -batch./parallel.sh The file parallel.sh has to be executable, e.g. chmod +x parallel.sh Your job goes into a queue, and will be executed as soon as a node is available. You can check the status of your job with squeue parallell.sh #! /bin/bash source./.bashrc # replace <my working directory> with your working # directory cd <my working directory> # replace <my parallel application> with the name of # your executable. mpirun -np 4./<my parallel application> exit 2

How to use a cluster (III) The output of squeue gives you a job-id for your job Once your job finishes, you will have a file called slurm-<jobid>.out in your home directory, which contains all the output of your printf statements etc. Notes How to use a cluster such as shark http://pstl.cs.uh.edu/resources.html If you need hints on how to use a UNIX/Linux machine through ssh: http://www.cs.uh.edu/~gabriel/cosc4397_s06/parco_08_introductionunix.pdf Ask the TA if you have problems! 3

Debugging sequential applications Several ways how to debug a sequential application: printf() statements in the source code Works, works reliably, painful to remove afterwards assert() statements check for a certain value of a variable. If the expression is false, the application aborts. only active, if the macro NDEBUG is defined Setting in the source #define NDEBUG 1 Compiling with the flag DNEDBUG=1 #include <assert.h> void open_record(char *record_name) { assert (record_name!=null); Edgar } Gabriel Using a debugger For a source file to be visible in the debugger, you have to compile the source code with the g option, e.g. gabriel@salmon>mpicc g o test test.c Avoid using optimization flags, such as O3 when you would like to debug the code Two types of debugger Command line debugger, such as gdb Graphical debuggers, such as ddd (which is a GUI to gdb) 4

Load application into the debugger Start app. Debugger points to the problem Show source code of app. 9 Show the value of a variable when the problem occurred gdb commands Setting breakpoints: debugger stops execution at the specified line. Example (gdb) break errexample.c:10 (gdb) break myfunct Stepping through the source code (gdb) next (skips subroutines/functions) (gdb) step (enters subroutines/functions) Continue execution (not step by step anymore) (gdb) cont Quit debugger (gdb) quit 5

Debugging a parallel application Some debuggers for parallel applications available (e.g. totalview, ddt) Unfortunately expensive products You can still use printf and assert Output from several processes will be mixed you should put the rank of the process in front of each printf statement gdb or ddd still useable You have to choose which process you would like to debug Please be aware, that ddd or gdb can only see processes on the local machine 6

Debugging a parallel application (II) Hints for parallel debugging Try to find the lowest number of processes for which the problem still occurs Try to execute the application on a single node If the problem does not show up on a single node, you will have to run the application on multiple nodes and login to the node, where the problem occurs Introduce a sleep () statement in your application to have time to attach with a debugger Attaching to a process Menu File Bullet: attach to processes Choose the PID which you would like to debug 7

Debugging parallel applications (III) Some MPI libraries support the startup of a debugger in the mpirun command, including Open MPI mpirun np 2 ddd./colltest - Starts one ddd session per process - Not useful for large numbers of processes An exercise for you: Calculating prime numbers A prime number is a positive integer evenly divisible by exactly two positive integers: 1 and itself. Sometimes, two consecutive odd numbers are both prime numbers (e.g. 5 and 7, or 11 and 13). 1. Write a parallel program to determine, for all integers less then 100,000,000 the number of times that two consecutive odd integers are both prime numbers 2. Measure the execution time for the code on 1, 2, 4 and 8 processors. 3. Determine the parallel speedup and the parallel efficiency of your code on the shark cluster for the 2, 4, and 8 processor cases. 8