Towards Automatic Generation of Master-Worker Applications for Grid Environments

Towards Automatic Generation of Master-Worker Applications for Grid Environments Philip Chan College of Computer Studies De La Salle University 2401 T...
0 downloads 0 Views 167KB Size
Towards Automatic Generation of Master-Worker Applications for Grid Environments Philip Chan College of Computer Studies De La Salle University 2401 Taft Avenue, Manila [email protected]

ABSTRACT This paper presents an approach for the development of grid-aware master-worker parallel applications using simple transformation of sequential code and template-based code generation. This approach requires the programmer to annotate the sequential program indicating which section(s) form the master-worker computation. A strategy is presented to transform a sequential for-loop into a masterworker program using a program template and generation of support functions for sending and receiving work units and results. It also describes how this template may be extended to incorporate code to deal with the dynamic grid environment. Keywords: master programming.

1

worker

paradigm,

and

parallel

Introduction

With the emergence of the Internet, a network computing system of global proportions has become a reality. This global-scale network is providing the platform that makes it possible for users to harness an enormous amount of computation power, employing possibly tens of millions of computing systems worldwide. Recently, the term “grid” [8] was defined as a single unified computing environment built by networking a geographically dispersed of computing resources, e.g., supercomputers, servers, storage systems, data sources and other special devices. We are all too familiar with the idea of household appliances and office equipment drawing electricity from the electric power grid. Likewise, it is envisioned that users will be able to draw compute cycles, data, storage capacity from the computational grid in a seamless and transparent manner. Numerous international efforts [1] are currently underway to address various design and implementation issues in developing ideal grid environments. These various initiatives aim to build the necessary infrastructure to provide users access to the diverse resources on a grid in a seamless and transparent manner. These include: Globus

[7][13], Legion [17][19], Condor [20][21][6], UNICORE [1], Ninf [28][25], Globe [30], and Nimrod/G [3]. Other projects focus on providing technologies that support the development of grid applications, including: NetSolve [4][22], EveryWare toolkit [35][7], and Piranha [12].

1.1 The Master-Worker Paradigm The master-worker paradigm is a simple and wellunderstood parallel programming paradigm. In this paradigm, the parallel application consists of a master and multiple workers. The master is responsible for the decomposition of the computational data into work units and the distribution of these to the workers. Workers receive these work units, process them and send the result(s) to the master. The master gathers all the results to produce the overall result for the entire parallel application. Although simple, this paradigm is very effective for a wide range of applications. Furthermore, it has been established that it lends naturally to grid environments because of low synchronization requirements and large grain size [15]. However, building a master-worker parallel application directly on top of message passing systems like PVM or MPI is a non-trivial task. For instance, in addition to dealing with the computational aspects of the problem, the programmer has to write the necessary code that deal with the communication and coordination between the master and the workers. And since the application is expected to execute on a dynamic grid environment, the programmer has to incorporate the code to consider the availability of computing resources.

1.2 An Approach to Master-Worker Parallel Program Development Grid users who wish to develop master-worker applications would use an environment if: (a) it supports rapid and easy development of straightforward master-worker applications;

(b) it does not require learning an entirely new programming language, or a new set of functions;

necessary code for spawning a set of worker processes.

(c) it supports direct translation from sequential code with no changes (user intervention); and

(b) We replace the for-loop with a similar loop for distributing the work units (i.e., actual parameters) to the workers and collecting results from them. This loop terminates when all work units are dispatched and the master has received all results.

(d) it leverages existing infrastructures for message passing, resource management, etc. In fact, we believe that it would be ideal if the parallel programmer need not write any code that deals with issues such as communication, task creation, and processor availability/failures. In this paper, we introduce an approach towards this ideal scenario. This approach involves the development of master-worker applications using simple code transformation and generation. It allows the programmer to derive a master-worker application from a sequential version of the program. This requires the development of a programming support tool that will generate all relevant code to deal with message passing and resource management by invoking services provided by the underlying grid infrastructure.

2

General Design Considerations

Consider a simple sequential loop below: for (i=0; i

Suggest Documents