• No results found

Advanced Operating Systems CS428

N/A
N/A
Protected

Academic year: 2021

Share "Advanced Operating Systems CS428"

Copied!
18
0
0

Loading.... (view fulltext now)

Full text

(1)

Advanced Operating Systems CS428

Lecture TEN

Semester I, 2009-10

Graham Ellis NUI Galway, Ireland

(2)

DIY Parallelism

(3)

DIY Parallelism

MPI is useful for C and Fortran programming.

When using higher-level computational software (such as GAP, Singular, Macaulay, GBParis, Cocoa, ...) with no in-built functions for parallelism the user could develop her/his own ”message passing interface” for parallel computing.

(4)

DIY Parallelism

MPI is useful for C and Fortran programming.

When using higher-level computational software (such as GAP, Singular, Macaulay, GBParis, Cocoa, ...) with no in-built functions for parallelism the user could develop her/his own ”message passing interface” for parallel computing.

(5)

Brief description of HAP

(6)

Brief description of HAP

HAP is aimed at computations in algebraic topology (see here). It is distributed with GAP and loaded by typing the following command at the GAP prompt.

(7)

Brief description of HAP

HAP is aimed at computations in algebraic topology (see here). It is distributed with GAP and loaded by typing the following command at the GAP prompt.

gap> LoadPackage("hap");

Many computations in algebraic topology require significant memory and significant cpu time.

(8)

Parallel computation using HAP

To help with large computations the user can start one or more copies of GAP as new processes. The following starts the new processes on the local machine.

(9)

Parallel computation using HAP

To help with large computations the user can start one or more copies of GAP as new processes. The following starts the new processes on the local machine.

gap> s:=ChildProcess();

The following starts the new process on a remote machine. gap> t:=ChildProcess(alberti.nuigalway.ie);

(10)

Parallel computation using HAP

To help with large computations the user can start one or more copies of GAP as new processes. The following starts the new processes on the local machine.

gap> s:=ChildProcess();

The following starts the new process on a remote machine. gap> t:=ChildProcess(alberti.nuigalway.ie); The core functions for handling child processes in HAP are described here.

(11)

Parallel computation using HAP

To help with large computations the user can start one or more copies of GAP as new processes. The following starts the new processes on the local machine.

gap> s:=ChildProcess();

The following starts the new process on a remote machine. gap> t:=ChildProcess(alberti.nuigalway.ie); The core functions for handling child processes in HAP are described here.

(12)

Load balancing in HAP: ParallelList

In GAP the command List(L,f); inputs a list Land a function f. It returns the list obtained by applying fto each element inL.

(13)

Load balancing in HAP: ParallelList

In GAP the command List(L,f); inputs a list Land a function f. It returns the list obtained by applying fto each element inL. The HAP command ParallelList(L,"f",S);inputs a list L, a string name "f"for a function fand a listSof child processes. It returns the list obtained by applyingfto each element in L.

(14)

Load balancing in HAP: ParallelList

In GAP the command List(L,f); inputs a list Land a function f. It returns the list obtained by applying fto each element inL. The HAP command ParallelList(L,"f",S);inputs a list L, a string name "f"for a function fand a listSof child processes. It returns the list obtained by applyingfto each element in L. ParallelList(L,"f",S);runs through the elements of the listL and, for each element x, waits until some process inSis available for computation; it then requests this process to compute f(x).

(15)

Load balancing in HAP: ParallelList

In GAP the command List(L,f); inputs a list Land a function f. It returns the list obtained by applying fto each element inL. The HAP command ParallelList(L,"f",S);inputs a list L, a string name "f"for a function fand a listSof child processes. It returns the list obtained by applyingfto each element in L. ParallelList(L,"f",S);runs through the elements of the listL and, for each element x, waits until some process inSis available for computation; it then requests this process to compute f(x). The same simple algorithm is used in post offices to deal with a queues of people. The algorithm achieves an optimal load balance.

(16)

Passing complicated data types in HAP

One limitation to MPI is that it is not easy to pass complicated data types from one process to another. Only basic data types (integers, floating point number, ...) can be passed easily.

(17)

Passing complicated data types in HAP

One limitation to MPI is that it is not easy to pass complicated data types from one process to another. Only basic data types (integers, floating point number, ...) can be passed easily. In HAP the function HAPPrintTo("file",X)can be used to write a complicated data type to a file. The function

HAPRead("file",X)can be used to read the data type into GAP. These two functions can be used to transport complicated data types between processes.

(18)

Passing complicated data types in HAP

One limitation to MPI is that it is not easy to pass complicated data types from one process to another. Only basic data types (integers, floating point number, ...) can be passed easily. In HAP the function HAPPrintTo("file",X)can be used to write a complicated data type to a file. The function

HAPRead("file",X)can be used to read the data type into GAP. These two functions can be used to transport complicated data types between processes.

References

Related documents

[r]

[r]

[r]

Create a compiler SCAA for subset, S of the desired language, L using language "A" and that compiler runs on machine A.. Compile LCSA using the compiler SCAA to

Customer Shows basic customer record information, account aging, and provides access to site directions, customer notes, and sales notes.. Invoices Displays a list of

In this review, the research carried out using various ion-exchange resin-like adsorbents including modified clays, lignocellulosic biomasses, chitosan and its derivatives, microbial

providing an electrical field between said poles with a second polarity for a second time duration,. 15 whereby said second polarity is opposite to said

Opening regular labour migration pathways as a pathway to reduce irregular migration is based on the assumption of a re-routing effect whereby migrants who would otherwise arrive