Task Farming on HPCx David Henty HPCx Applications Support

Slides:



Advertisements
Similar presentations
Turing Machines January 2003 Part 2:. 2 TM Recap We have seen how an abstract TM can be built to implement any computable algorithm TM has components:
Advertisements

NGS computation services: API's,
NGS computation services: APIs and.
Practical techniques & Examples
Resource Management §A resource can be a logical, such as a shared file, or physical, such as a CPU (a node of the distributed system). One of the functions.
© 2007 IBM Corporation IBM Global Engineering Solutions IBM Blue Gene/P Job Submission.
1 Chapter 1 Why Parallel Computing? An Introduction to Parallel Programming Peter Pacheco.
Setting up of condor scheduler on computing cluster Raman Sehgal NPD-BARC.
MPI Program Structure Self Test with solution. Self Test 1.How would you modify "Hello World" so that only even-numbered processors print the greeting.
Day 10 Threads. Threads and Processes  Process is seen as two entities Unit of resource allocation (process or task) Unit of dispatch or scheduling (thread.
Scientific Programming OpenM ulti- P rocessing M essage P assing I nterface.
Reference: Message Passing Fundamentals.
DISTRIBUTED AND HIGH-PERFORMANCE COMPUTING CHAPTER 7: SHARED MEMORY PARALLEL PROGRAMMING.
Introduction to MPI. What is Message Passing Interface (MPI)?  Portable standard for communication  Processes can communicate through messages.  Each.
Processes CSCI 444/544 Operating Systems Fall 2008.
Parallel Programming Models and Paradigms
The new The new MONARC Simulation Framework Iosif Legrand  California Institute of Technology.
Operating Systems CS208. What is Operating System? It is a program. It is the first piece of software to run after the system boots. It coordinates the.
INPUT/OUTPUT ORGANIZATION INTERRUPTS CS147 Summer 2001 Professor: Sin-Min Lee Presented by: Jing Chen.
AstroBEAR Parallelization Options. Areas With Room For Improvement Ghost Zone Resolution MPI Load-Balancing Re-Gridding Algorithm Upgrading MPI Library.
Fundamentals of Python: From First Programs Through Data Structures
1 MPI-2 and Threads. 2 What are Threads? l Executing program (process) is defined by »Address space »Program Counter l Threads are multiple program counters.
Parallel Programming Using Basic MPI Presented by Timothy H. Kaiser, Ph.D. San Diego Supercomputer Center Presented by Timothy H. Kaiser, Ph.D. San Diego.
Introduction to Symmetric Multiprocessors Süha TUNA Bilişim Enstitüsü UHeM Yaz Çalıştayı
ADLB Update Recent and Current Adventures with the Asynchronous Dynamic Load Balancing Library Rusty Lusk Mathematics and Computer Science Division Argonne.
Reference: / Parallel Programming Paradigm Yeni Herdiyeni Dept of Computer Science, IPB.
ICOM 5995: Performance Instrumentation and Visualization for High Performance Computer Systems Lecture 9 October 30, 2002 Nayda G. Santiago.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Tools and Utilities for parallel and serial codes in ENEA-GRID environment CRESCO Project: Salvatore Raia SubProject I.2 C.R. ENEA-Portici. 11/12/2007.
The Pipeline Processing Framework LSST Applications Meeting IPAC Feb. 19, 2008 Raymond Plante National Center for Supercomputing Applications.
FINAL MPX DELIVERABLE Due when you schedule your interview and presentation.
Threads, Thread management & Resource Management.
Bigben Pittsburgh Supercomputing Center J. Ray Scott
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
Chapter 101 Multiprocessor and Real- Time Scheduling Chapter 10.
April 26, CSE8380 Parallel and Distributed Processing Presentation Hong Yue Department of Computer Science & Engineering Southern Methodist University.
Hybrid MPI and OpenMP Parallel Programming
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Message Passing Programming Model AMANO, Hideharu Textbook pp. 140-147.
Enabling Grids for E-sciencE EGEE-III INFSO-RI Using DIANE for astrophysics applications Ladislav Hluchy, Viet Tran Institute of Informatics Slovak.
PARALLEL APPLICATIONS EE 524/CS 561 Kishore Dhaveji 01/09/2000.
A. Freise FINESSE + FINESSE + future plans and work in progress Andreas Freise 22nd July 2006.
Introduction to OpenMP Eric Aubanel Advanced Computational Research Laboratory Faculty of Computer Science, UNB Fredericton, New Brunswick.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Threaded Programming Lecture 2: Introduction to OpenMP.
1 Chapter 2.5 : Threads Process concept  Process concept  Process scheduling  Process scheduling  Interprocess communication  Interprocess communication.
1 HPCI Presentation Kulathep Charoenpornwattana. March 12, Outline Parallel programming with MPI Running MPI applications on Azul & Itanium Running.
Globus Grid Tutorial Part 2: Running Programs Across Multiple Resources.
3/12/2013Computer Engg, IIT(BHU)1 MPI-1. MESSAGE PASSING INTERFACE A message passing library specification Extended message-passing model Not a language.
NGS computation services: APIs and.
Parallel Computing Presented by Justin Reschke
Advanced topics Cluster Training Center for Simulation and Modeling September 4, 2015.
1/50 University of Turkish Aeronautical Association Computer Engineering Department Ceng 541 Introduction to Parallel Computing Dr. Tansel Dökeroğlu
NUMA Control for Hybrid Applications Kent Milfeld TACC May 5, 2015.
Lecturer 3: Processes multithreaded Operating System Concepts Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess.
Processes Chapter 3. Processes in Distributed Systems Processes and threads –Introduction to threads –Distinction between threads and processes Threads.
How to link a test to a launcher (in this case a shell launcher)
Running R in parallel — principles and practice
The University of Adelaide, School of Computer Science
Introduction to Operating System (OS)
CRESCO Project: Salvatore Raia
NGS computation services: APIs and Parallel Jobs
Operation System Program 4
Introduction to parallelism and the Message Passing Interface
Chapter 4: Threads & Concurrency
Overview of Workflows: Why Use Them?
CS510 Operating System Foundations
Quick Tutorial on MPICH for NIC-Cluster
MapReduce: Simplified Data Processing on Large Clusters
Presentation transcript:

Task Farming on HPCx David Henty HPCx Applications Support

220 July 2005HPCx User Group What is Task Farming? Many independent programs (tasks) running at once –each task can be serial or parallel –“independent” means they don’t communicate directly Common approach for using cycles in a loosely- connected cluster –how does it relate to HPCx and Capability Computing? Often needed for pre or post-processing Tasks may contribute to a single, larger calculation –parameter searches or optimisation –enhanced statistical sampling –ensemble modelling

320 July 2005HPCx User Group Classical Task Farm A single parallel code (eg written in MPI) –one process is designated as the controller –the rest are workers ControllerWorker 1Worker 2Worker 3Worker 4 input output

420 July 2005HPCx User Group Characteristics Pros –load balanced for sufficiently many tasks –can use all of HPCx (using MPI) Cons –must write a new parallel code –potential waste of a CPU if controller is not busy –each task must be serial, ie use a single CPU Approach –find an existing task farm harness on the WWW

520 July 2005HPCx User Group Shared Counter Tasks are numbered 1, 2,... maxTask –shared counter requires no CPU time Worker 1Worker 2Worker 3Worker 4Worker 5 Counter output output output 6

620 July 2005HPCx User Group Characteristics Pros –load-balanced –don’t have to designate a special controller Cons –very much a shared-memory model –easy to scale up to a frame (32 CPUs) with OpenMP –harder to scale to all of HPCx –need to write a new parallel program

720 July 2005HPCx User Group Task Farming Existing Code Imagine you have a pre-compiled executable –and you simply want to run P copies on P processors –common in parameter searching or ensemble studies –can be done via poe but is non-portable Possible to launch a simple MPI harness –each process does nothing but run the executable –easy to do via “system(commandstring)” Have written a general-purpose harness –called taskfarm –see /usr/local/packages/bin/

820 July 2005HPCx User Group Controlling the Task Farm Need to allow the tasks to do different things –each task assigned unique MPI rank: 0, 1, 2,..., P-2, P-1 –I have hijacked the C “%d” printf syntax taskfarm “echo hello from task %d” –command string is run as-is on each processor –except with %d replaced by the MPI rank On 3 CPUs: hello from task 0 hello from task 1 hello from task 2

920 July 2005HPCx User Group Verbose Mode taskfarm -v "echo hello from task %d" taskfarm: called with 5 arguments: echo hello from task %d taskfarm: process 0 executing "echo hello from task 0“ taskfarm: process 1 executing "echo hello from task 1" taskfarm: process 2 executing "echo hello from task 2" hello from task 0 hello from task 1 hello from task 2 taskfarm: return code on process 0 is 0 taskfarm: return code on process 1 is 0 taskfarm: return code on process 2 is 0 Could also report where task is running –ie the name of the HPCx frame

1020 July 2005HPCx User Group Use in Practice Need tasks to use different input and output files taskfarm "cd rundir%d; serialjob output.log" –or taskfarm "serialjob output.%d.log” Pros –no new coding, and taskfarm also relatively portable Cons –no load balancing: single job per run Extensions –do more tasks than CPUs, aiming for load balance? –dedicated controller makes this potentially messy

1120 July 2005HPCx User Group Implement Shared Counter in MPI-2 Could be accessed as a library function: do task = gettask() if (task.ge. 0) then call serialjob(task) end if while (task.ge. 0) –or via an extended harness taskfarm -n 150 “serialjob output.%d.log” Would run serial jobs on all available processors until all 150 had been completed –potential for load-balancing with more tasks than processors –work in progress!

1220 July 2005HPCx User Group Multiple Parallel MPI Jobs What is the issue in HPCx? –poe picks up number of MPI processes directly from the Loadleveler script –can only have a single global MPI job running at once Cannot do mpirun mpijob -nproc 32 & wait –unlike on many other systems like Sun, T3E, Altix,...

1320 July 2005HPCx User Group Using taskfarm taskfarm is a harness implemented in MPI –cannot use it to run MPI jobs –but can run jobs parallelised with some other method, eg threads To run 4 copies of a 32-way OpenMP job: – export OMP_NUM_THREADS=32 – taskfarm "openmpjob output.%d.log" Controlling the OpenMP parallelism –how to ensure that each OpenMP job runs on a separate frame? –need to select 4 MPI tasks but place only one on each node cpus=4 tasks_per_node=1

1420 July 2005HPCx User Group Real Example: MOLPRO An ab-initio quantum chemistry package –parallelised using the Global Array (GA) Tools library –on HPCx, normal version of GA Tools uses LAPI LAPI requires poe: same problems for taskfarm as with MPI But... –there is an alternative implementation of GA Tools –uses the TCMSG messaging library... –which is implemented using Unix sockets,not MPI Not efficient over the switch –but probably fine on a node, ie up to 32 processors

1520 July 2005HPCx User Group Running MOLPRO as Parallel Taskfarm TCMSG parallelism specified on command line –to run 6 MOLPRO jobs each using 16 CPUs ie 2 jobs per frame on a total of 3 frames cpus=6 tasks_per_node=2 taskfarm “molpro -n 16 output.%d.out” Completely analogous to taskfarming OpenMP jobs MOLPRO can now be used to solve many different problems simultaneously –which may not individually scale very well

1620 July 2005HPCx User Group Multiple Parallel MPI Jobs So far have seen ways of running the following (where simple means no load balancing) –general serial task farm requiring new parallel code –simple serial task farm of existing program(s) potential for general serial task farm of existing program(s) –simple parallel (non-MPI) task farms with existing program(s) What about task farming parallel MPI jobs? –eg four 64-way MPI jobs in a 256 CPU partition –requires some changes to source code –but potentially not very much

1720 July 2005HPCx User Group Communicator Splitting (Almost) every MPI routine takes a communicator –usually MPI_COMM_WORLD but can be a subset of processes call MPI_Init(ierr) comm = MPI_COMM_WORLD call MPI_Comm_size(comm,...) call MPI_Comm_rank(comm,...) if (rank.eq. 0) & write(*,*) 'Hello world‘ ! now do the work... call MPI_Finalize(ierr) call MPI_Init(ierr) bigcomm = MPI_COMM_WORLD comm = split(bigcomm,4) call MPI_Comm_size(comm,...) call MPI_Comm_rank(comm,...) if (rank.eq. 0) & write(*,*) 'Hello world' ! now do the work... call MPI_Finalize(ierr)

1820 July 2005HPCx User Group Issues Each group of 64 processors lives in its own world –each has ranks 0 – 63 and its own master, rank = 0 –must never directly reference MPI_COMM_WORLD Need to allow for different input and output files –use different directories for minimum code changes –can arrange for each parallel task to run in a different directory using clever scripts How to split the communicator appropriately? –can be done by hand with MPI_Comm_split –the MPH library gives users some help If you’re interested, submit a query!

1920 July 2005HPCx User Group Summary Like any parallel computer, HPCx can run parallel taskfarm programs written by hand However, usual request are: –multiple runs of existing serial program –multiple runs of existing parallel program These can both be done with the taskfarm harness –limitations on tasks’ parallelism (must be non-MPI) –currently no load-balancing Task farming MPI code requires source changes –but can be quite straightforward in many cases –eg ensemble modelling with Unified Model