• No se han encontrado resultados

RES Users Tutorial

N/A
N/A
Protected

Academic year: 2023

Share "RES Users Tutorial"

Copied!
25
0
0

Texto completo

(1)

GRIDSs / COMPSs Tutorial

Enric Tejedor, Daniele Lezzi, Rosa M. Badia

{enric.tejedor,daniele.lezzi,rosa.m.badia}@bsc.es

RES Users Tutorial

September 20, 2010

(2)

Tutorial Outline

Overview of GRIDSs/COMPSs, first example. 12:00 -14:00

1. Objective and overview

2. Programming model: A sample code (Java and C) 3. Configuration, compilation and execution

4. Monitoring and Debugging

5. Migration from GRIDSs to COMPSs

Break 14:00-15:00

Programming examples, Hands-on. 15:00 – 17:00

(3)

RES Users Tutorial September 20, 2010

1

1. Objective and overview

2. Programming model: a sample code (Java and C) 3. Configuration, compilation and execution

4. Monitoring and Debugging

5. Migration from GRIDSs to COMPSs

Overview of GRIDSs/COMPSs

(4)

GRIDSs/COMPSs Objective

• Reduce the development complexity of Grid/Cluster applications to the minimum

• Writing an application for a computational Grid may be as easy as writing a sequential application

• Target applications: composed of tasks, most of them repetitive

• Granularity of the tasks of the level of simulations or programs

• Data objects are files

(5)

RES Users Tutorial September 20, 2010

...

for (i=0; i<N; i++){

T1 (data1, data2);

T2 (data4, data5);

T3 (data2, data5, data6);

T4 (data7, data8);

T5 (data6, data8, data9);

} ...

Sequential Application

T10 T20

T30 T40

T50

T11 T21

T31 T41

T51

T12

Resource 1 Resource 2 Resource 3

Resource N . . .

Task graph creation based on data precedence

Task selection + parameters direction (input, output, inout)

Scheduling, data transfer, task execution Synchronization,

results transfer

Parallel Resources (cluster, grid)

GRIDSs/COMPSs – Overview

3

(6)

GRIDSs/COMPSs – Overview - Runtime features

• Common features:

• Data dependency analysis

• Data renaming

• Data transfer

• Task scheduling

Other

• Shared disks management

• Checkpointing

• Resource management

• Results collection

• Fault tolerance

(7)

RES Users Tutorial September 20, 2010

Input/output files

GRIDSs/COMPSs – Overview - Behaviour

for (int i = 0; i < MAXITER; i++) {

newBWd = GenerateRandom();

subst (referenceCFG, newBWd, newCFG);

dimemas (newCFG, traceFile, DimemasOUT);

post (newBWd, DimemasOUT, FinalOUT);

if(i % 3 == 0) Display(FinalOUT);

}

5

(8)

GRIDSs/COMPSs – Overview - Behaviour

Subst

DIMEMAS

EXTRACT

Subst

DIMEMAS

EXTRACT

Subst

DIMEMAS

EXTRACT Subst

DIMEMAS

EXTRACT

Subst

DIMEMAS

EXTRACT Subst

DIMEMAS

EXTRACT Subst

DIMEMAS

EXTRACT

Display

Display

Grid

(9)

RES Users Tutorial September 20, 2010

EXTRACT

EXTRACT

GRIDSs/COMPSs – Overview - Behaviour

Subst

DIMEMAS

Subst

DIMEMAS

Subst

DIMEMAS

EXTRACT Subst

DIMEMAS

EXTRACT

Subst

DIMEMAS

EXTRACT Subst

DIMEMAS

EXTRACT Subst

DIMEMAS

EXTRACT

Display

Display

Grid

7

(10)

public static void main(String[] args) { String counterFile = args[0];

int initialValue = args[1];

initializeCounter(counter, initialValue);

SimpleImpl.increment(counterFile);

printCounter(counter);

}

Java application Java applicationJava application Java application

Programming model – Java – Sequential code

public static void increment(String counterFile) { int value = readCounter(counterFile);

Subroutine Subroutine Subroutine Subroutine

(11)

RES Users Tutorial September 20, 2010

Programming model – Java – Task selection

public interface SimpleItf {

@ClassName(“SimpleImpl") void increment(

@ParamMetadata(type = Type.FILE, direction = Direction.INOUT) String counterFile

);

}

Parameter metadata Implementation

Java interface Java interface Java interface Java interface

9

(12)

public static void main(String[] args) { String counterFile = args[0];

int initialValue = Integer.parseInt(args[1]);

initializeCounter(counter, initialValue);

SimpleImpl.increment(counterFile);

printCounter(counter);

}

Java application Java applicationJava application Java application NO CHANGES!

NO CHANGES!NO CHANGES!

NO CHANGES!

Programming model – Java – Final app code

(13)

RES Users Tutorial September 20, 2010

int main(int argc, char **argv) { char *counter_file = argv[1];

int init_value = atoi(argv[2]);

initialize_counter(counter_file, init_value);

increment(counter_file);

print_counter(counter_file);

return 0;

}

C main C main C main C main

application code application code application code application code

Programming model – C – Sequential code

11 void increment(char *counter_file) {

int value = read_counter(counter_file);

value++;

write_counter(counter_file);

}

Subroutine Subroutine Subroutine Subroutine

(14)

Programming model – Java – Task selection

interface SIMPLE {

void increment(inout File counter_file);

};

Parameter metadata

IDL file IDL fileIDL file IDL file

(15)

RES Users Tutorial September 20, 2010

int main(int argc, char **argv) { char *counter_file = argv[1];

int init_value = atoi(argv[2]);

initialize_counter(counter_file, init_value);

GS_On(PRJ_FILE, RES_FILE, MASTER_DIR, APPNAME);

increment(counter_file);

GS_Off(0);

print_counter(counter_file);

return 0;

}

Programming model – C – Final code

13 C application

C application C application C application + API calls + API calls + API calls + API calls

(16)

Configuration – Java and C

• Environment variables

• export JAVA_HOME=/opt/ibm/java-ppc-60

• export IT_HOME=/gpfs/apps/COMPSs

• export CLASSPATH=.:$IT_HOME/integratedtoolkit/lib/IT.jar

• export GS_HOME=$IT_HOME/bindinglib

• export PATH=$PATH:$GS_HOME/bin

• export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GS_HOME/lib:

$JAVA_HOME/jre/lib/ppc64/classic

(17)

RES Users Tutorial September 20, 2010

Compilation – Java

15

user@node:~/app_dir> $JAVA_HOME/bin/javac *.java

• Main app code: Simple.java

• Annotated interface: SimpleItf.java

• Subroutine implementation: SimpleImpl.java

(18)

Compilation – C

user@node:~/app_dir> gsbuild build all simple

• Main app code: simple.cc

• IDL file: simple.idl

• Subroutine implementation: simple-functions.c

(19)

RES Users Tutorial September 20, 2010

Execution – Java and C

17

user@node:~/app_dir> $JAVA_HOME/bin/javac *.java

• Main app code: Simple.java

• Annotated interface: SimpleItf.java

• Subroutine implementation: SimpleImpl.java

(20)

Monitoring and debugging

It.log

Tasks log

(21)

RES Users Tutorial September 20, 2010

Migration GRIDSs -> COMPSs

17

• TODO: DANIELE

(22)

BREAK

(23)

RES Users Tutorial September 20, 2010

Hands-on: Programming examples

17

Matmul: C

• HMMER: Java

(24)

Tracing and performance analysis

• COMPSs can generate post-mortem traces of the distributed execution of the application

• Master + workers, tasks + file transfers

• Useful for analysis and diagnosis

(25)

RES Users Tutorial September 20, 2010

Thank you!

Questions?

25

Referencias

Documento similar

Tb_TarjetaEDO fecha_notificacion : Date id_paciente : String id_medico : String nombre_institucion : String tipo_diagnostico : String id_tarjeta : String id_unidadsalud :

Descripción: Devuelve el valor del atributo fecha Nombre: Get_Paciente (): string.. Descripción: Devuelve el valor del

After a general review of how the presence of background fluxes leads to 4d BF couplings (section 6.1), we study the ap- pearance of discrete gauge symmetries when there is only

Individual circadian preference, shift work, and risk of medication errors: a cross-sectional web survey among Italian midwives. Int J Environ Res Public

The purpose of this work is to consider type II compactifications where open strings modes (and in particular Wilson lines) enter the potential generated by fluxes on equal footing

in the first one [79] we describe the type IIA physical realization of the unoriented topological string introduced by Walcher, describe its M-theory lift, and show that it allows

In other words, different supercritical string theories living in different spacetime dimensions are connected to each other via a process of tachyon condensation.. Tachyon

In this thesis, we consider the embedding of inflation in Type IIB string theory, with the inflaton given by the position modulus of a D7-brane, an open string.. The inflaton