Www.egi.eu EGI-InSPIRE RI-261323 EGI-InSPIRE www.egi.eu EGI-InSPIRE RI-261323 Ejecución con MPI e interactividad en el Grid Ejercicios Prácticos 1.

Slides:



Advertisements
Similar presentations
EGEE is a project funded by the European Union under contract IST EGEE Tutorial Turin, January Hands on Job Services.
Advertisements

SARA Reken- en NetwerkdienstenToPoS | 3 juni 2007 More efficient job submission Evert Lammerts SARA Computing and Networking Services High Performance.
INFSO-RI Enabling Grids for E-sciencE Workload Management System and Job Description Language.
The Grid Constantinos Kourouyiannis Ξ Architecture Group.
EDGI European Desktop Grid Initiative gLite job submission to EDGI EDGI is supported by the FP7 Capacities Programme under contract nr RI
SEE-GRID-SCI User Interface (UI) Installation and Configuration Branimir Ackovic Institute of Physics Serbia The SEE-GRID-SCI.
Riccardo Bruno, INFN.CT Sevilla, 10-14/09/2007 GENIUS Exercises.
MPI support in gLite Enol Fernández CSIC. EMI INFSO-RI CREAM/WMS MPI-Start MPI on the Grid Submission/Allocation – Definition of job characteristics.
Special Jobs Claudio Cherubino INFN - Catania. 2 MPI jobs on gLite DAG Job Collection Parametric jobs Outline.
Basic Grid Job Submission Alessandra Forti 28 March 2006.
FESR Consorzio COMETA - Progetto PI2S2 Using MPI to run parallel jobs on the Grid Marcello Iacono Manno Consorzio COMETA
EGEE-II INFSO-RI Enabling Grids for E-sciencE EGEE and gLite are registered trademarks Supporting MPI applications on the EGEE Grid.
FP6−2004−Infrastructures−6-SSA E-infrastructure shared between Europe and Latin America Special Jobs Matias Zabaljauregui UNLP.
Enabling Grids for E-sciencE gLite training at Sinaia '06 Victor Penso Kilian Schwarz GSI Darmstadt Germany.
The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) WMPROXY API Python & C++ Diego Scardaci
The gLite API – PART I Giuseppe LA ROCCA INFN Catania ACGRID-II School 2-14 November 2009 Kuala Lumpur - Malaysia.
The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) MPI Applications with the Grid Engine Riccardo Rotondo
INFSO-RI Enabling Grids for E-sciencE GILDA Praticals GILDA Tutors INFN Catania ICTP/INFM-Democritos Workshop on Porting Scientific.
GRID Computing: Ifrastructure, Development and Usage in Bulgaria M. Dechev, G. Petrov, E. Atanassov.
:: ::::: ::::: ::::: ::::: ::::: ::::: ::::: ::::: ::::: ::::: ::::: :: GridKA School 2009 MPI on Grids 1 MPI On Grids September 3 rd, GridKA School 2009.
1 HeMoLab - Porting HeMoLab's SolverGP to EELA glite Grid Environment FINAL REPORT Ramon Gomes Costa - Paulo Ziemer.
Enabling Grids for E-sciencE Workload Management System on gLite middleware Matthieu Reichstadt CNRS/IN2P3 ACGRID School, Hanoi (Vietnam)
Nadia LAJILI User Interface User Interface 4 Février 2002.
The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) GISELA Additional Services Diego Scardaci
Group 1 : Grid Computing Laboratory of Information Technology Supervisors: Alexander Ujhinsky Nikolay Kutovskiy.
E-science grid facility for Europe and Latin America gLite MPI Tutorial for Grid School Daniel Alberto Burbano Sefair, Universidad de Los.
MPI Applications in the Interactive European Grid Dr. Isabel Campos Plasencia Instituto de Física de Cantabria, IFCA (Santander) Consejo Superior de Investigaciones.
EGEE-III INFSO-RI Enabling Grids for E-sciencE Feb. 06, Introduction to High Performance and Grid Computing Faculty of Sciences,
Jan 31, 2006 SEE-GRID Nis Training Session Hands-on V: Standard Grid Usage Dušan Vudragović SCL and ATLAS group Institute of Physics, Belgrade.
Job Management DIRAC Project. Overview  DIRAC JDL  DIRAC Commands  Tutorial Exercises  What do you have learned? KEK 10/2012DIRAC Tutorial.
Satellital Image Clasification with neural networks Step implemented – Final Report Susana Arias, Héctor Gómez UNIVERSIDAD TÉCNICA PARTICULAR DE LOJA ECUADOR.
E-science grid facility for Europe and Latin America MAVs-Study Biologically Inspired, Super Maneuverable, Flapping Wing Micro-Air-Vehicles.
FP7-INFRA Enabling Grids for E-sciencE EGEE Induction Grid training for users, Institute of Physics Belgrade, Serbia Sep. 19, 2008.
INFSO-RI Enabling Grids for E-sciencE Αthanasia Asiki Computing Systems Laboratory, National Technical.
Enabling Grids for E-sciencE Workload Management System on gLite middleware - commands Matthieu Reichstadt CNRS/IN2P3 ACGRID School, Hanoi.
EGEE-II INFSO-RI Enabling Grids for E-sciencE Workload management in gLite 3.x - MPI P. Nenkova, IPP-BAS, Sofia, Bulgaria Some of.
INFSO-RI Enabling Grids for E-sciencE Job Submission Tutorial (material from INFN Catania)
INFSO-RI Enabling Grids for E-sciencE Job Description Language (JDL) Giuseppe La Rocca INFN First gLite tutorial on GILDA Catania,
INFSO-RI Enabling Grids for E-sciencE GILDA Praticals Giuseppe La Rocca INFN – Catania gLite Tutorial at the EGEE User Forum CERN.
Enabling Grids for E-sciencE Sofia, 17 March 2009 INFSO-RI Introduction to Grid Computing, EGEE and Bulgarian Grid Initiatives –
EGEE-II INFSO-RI Enabling Grids for E-sciencE EGEE and gLite are registered trademarks WMS tricks & tips – further scripting Giuseppe.
User Interface UI TP: UI User Interface installation & configuration.
LCG2 Tutorial Viet Tran Institute of Informatics Slovakia.
Satellital Image Clasification with neural networks Susana Arias, Héctor Gómez UNIVERSIDAD TÉCNICA PARTICULAR DE LOJA ECUADOR
EGI-InSPIRE RI EGI-InSPIRE EGI-InSPIRE RI Parallel jobs with MPI Hands-on tutorial Enol Fernández del Castillo Instituto.
Advanced gLite job management Paschalis Korosoglou, AUTH/GRNET EPIKH Application Porting School 2011 Beijing, China Paschalis Korosoglou,
The Finite Difference Time Domain Method FDTD By Dr. Haythem H. Abdullah Researcher at ERI, Electronics Research Institute, Microwave Engineering Dept.
LA 4 CHAIN GISELA EPIKH School SPECFEM3D on Science Gateway.
Introduction to Computing Element HsiKai Wang Academia Sinica Grid Computing Center, Taiwan.
FESR Consorzio COMETA - Progetto PI2S2 Using MPI to run parallel jobs on the Grid Marcello Iacono Manno Consorzio Cometa
Enabling Grids for E-sciencE Work Load Management & Simple Job Submission Practical Shu-Ting Liao APROC, ASGC EGEE Tutorial.
Create an script to print “hello world” in an output file with also the information of an input file. The input file should be previously register in the.
Parallel jobs with MPI and hands on tutorial Enol Fernández del Castillo Instituto de Física de Cantabria.
The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) Special Topics: MPI jobs Maha Dessokey (
The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) Indian Institute of Technology Kharagpur EPIKH Workshop Kolkata,
The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) How to Run MPI-enabled Applications on the EUMEDGRID Infrastructure.
Stephen Childs Trinity College Dublin
Job Management Exercises
MPI Applications with the Grid Engine
Advanced Topics: MPI jobs
gLite MPI Job Amina KHEDIMI CERIST
Special jobs with the gLite WMS
MPI Applications with the Grid Engine
Special Topics: MPI jobs
5. Job Submission Grid Computing.
Job Management with DATA
login: clermont-ferrandxx password: GridCLExx
Certificates Usage and Simple Job Submission
gLite Job Management Christos Theodosiou
Testing the EGI-DRIHM TestBed
Presentation transcript:

EGI-InSPIRE RI EGI-InSPIRE EGI-InSPIRE RI Ejecución con MPI e interactividad en el Grid Ejercicios Prácticos 1

EGI-InSPIRE RI Download the examples wget examples.tgzhttp://devel.ifca.es/~enol/mpi- examples.tgz tar xzf mpi-examples.tgz 2

EGI-InSPIRE RI Finding where to run (I) Sites publish in their tags: MPI-START (if they have mpi-start installed) Then for each MPI flavour supported: – – - – - - And interconnect info (optional and mostly absent): –MPI- –Interconnects: Ethernet, Infiniband, SCI, Myrinet 3

EGI-InSPIRE RI Finding where to run (II) 4 $ lcg-info –vo biomed --list-ce --query 'Tag=MPICH2’ -- CE: ce-02.roma3.infn.it:8443/cream-pbs-grid -- CE: ce-grid.obspm.fr:2119/jobmanager-pbs-biomed -….. $ lcg-info --vo biomed --list-ce --query 'Tag=OPENMPI-1.4.4' -CE: ce01.kallisto.hellasgrid.gr:2119/jobmanager-pbs-biomed -CE: cream01.kallisto.hellasgrid.gr:8443/cream-pbs-biomed -CE: egeece01.ifca.es:2119/jobmanager-sge-biomed -CE: egeece02.ifca.es:2119/jobmanager-sge-biomed -CE: egeece03.ifca.es:2119/jobmanager-sge-biomed -CE: gridce01.ifca.es:8443/cream-sge-biomed -CE: gridce02.ifca.es:8443/cream-sge-biomed -CE: ngiescream.i3m.upv.es:8443/cream-pbs-biomed $ lcg-info –vo biomed --list-ce --query 'Tag=MPICH2’ -- CE: ce-02.roma3.infn.it:8443/cream-pbs-grid -- CE: ce-grid.obspm.fr:2119/jobmanager-pbs-biomed -….. $ lcg-info --vo biomed --list-ce --query 'Tag=OPENMPI-1.4.4' -CE: ce01.kallisto.hellasgrid.gr:2119/jobmanager-pbs-biomed -CE: cream01.kallisto.hellasgrid.gr:8443/cream-pbs-biomed -CE: egeece01.ifca.es:2119/jobmanager-sge-biomed -CE: egeece02.ifca.es:2119/jobmanager-sge-biomed -CE: egeece03.ifca.es:2119/jobmanager-sge-biomed -CE: gridce01.ifca.es:8443/cream-sge-biomed -CE: gridce02.ifca.es:8443/cream-sge-biomed -CE: ngiescream.i3m.upv.es:8443/cream-pbs-biomed

EGI-InSPIRE RI Finding where to run (III) 5 $ lcg-info --vo biomed --list-ce --query 'Tag=MPI-INFINIBAND' - CE: ce.reef.man.poznan.pl:2119/jobmanager-pbs-biomed - CE: ce002.ipp.acad.bg:2119/jobmanager-pbs-biomed - CE: cr1.ipp.acad.bg:8443/cream-pbs-biomed -CE: creamce.reef.man.poznan.pl:8443/cream-pbs-biomed $ lcg-info --vo biomed --list-ce --query 'Tag=OPENMPI,Tag=MPI- START,Tag=MPI-ETHERNET' - CE: glite.univ.kiev.ua:2119/jobmanager-pbs-grid - CE: glite.univ.kiev.ua:8443/cream-pbs-grid - CE: grid-lab-ce.ii.edu.mk:2119/jobmanager-pbs-biomed $ lcg-info --vo biomed --list-ce --query 'Tag=MPI-INFINIBAND' - CE: ce.reef.man.poznan.pl:2119/jobmanager-pbs-biomed - CE: ce002.ipp.acad.bg:2119/jobmanager-pbs-biomed - CE: cr1.ipp.acad.bg:8443/cream-pbs-biomed -CE: creamce.reef.man.poznan.pl:8443/cream-pbs-biomed $ lcg-info --vo biomed --list-ce --query 'Tag=OPENMPI,Tag=MPI- START,Tag=MPI-ETHERNET' - CE: glite.univ.kiev.ua:2119/jobmanager-pbs-grid - CE: glite.univ.kiev.ua:8443/cream-pbs-grid - CE: grid-lab-ce.ii.edu.mk:2119/jobmanager-pbs-biomed

EGI-InSPIRE RI Finding where to run (IV) Use the JDL requirements to match to sites supporting your needs: 6 Requirements = Member("MPI-START", other.GlueHostApplicationSoftwareRunTimeEnvironment) && Member("OPENMPI", other.GlueHostApplicationSoftwareRunTimeEnvironment); Requirements = Member("MPI-START", other.GlueHostApplicationSoftwareRunTimeEnvironment) && Member("OPENMPI", other.GlueHostApplicationSoftwareRunTimeEnvironment);

EGI-InSPIRE RI Parallel job.jdl 7 JobType = "Normal"; nodeNumber = 4; Executable = "starter.sh"; Arguments = "hello.sh OPENMPI"; InputSandbox = {"starter.sh", "hello.sh"}; StdOutput = "std.out"; StdError = "std.err"; OutputSandbox = {"std.out","std.err"}; Requirements = Member("MPI-START”, other.GlueHostApplicationSoftwareRunTimeEnvironment) && Member("OPENMPI”, other.GlueHostApplicationSoftwareRunTimeEnvironment); JobType = "Normal"; nodeNumber = 4; Executable = "starter.sh"; Arguments = "hello.sh OPENMPI"; InputSandbox = {"starter.sh", "hello.sh"}; StdOutput = "std.out"; StdError = "std.err"; OutputSandbox = {"std.out","std.err"}; Requirements = Member("MPI-START”, other.GlueHostApplicationSoftwareRunTimeEnvironment) && Member("OPENMPI”, other.GlueHostApplicationSoftwareRunTimeEnvironment); Basic example

EGI-InSPIRE RI starter.sh EGI UF. Vilnius, Apr #!/bin/bash MY_EXECUTABLE=$1 MPI_FLAVOR=$2 # Convert flavor to lowercase for passing to mpi-start. MPI_FLAVOR_LOWER=`echo $MPI_FLAVOR | tr '[:upper:]' '[:lower:]'` # Pull out the correct paths for the requested flavor. eval MPI_PATH=`printenv MPI_${MPI_FLAVOR}_PATH` # Ensure the prefix is correctly set. Don't rely on the defaults. eval I2G_${MPI_FLAVOR}_PREFIX=$MPI_PATH export I2G_${MPI_FLAVOR}_PREFIX # Touch the executable. It exist must for the shared file system check. # If it does not, then mpi-start may try to distribute the executable # when it shouldn't. touch $MY_EXECUTABLE chmod +x $MY_EXECUTABLE # Setup for mpi-start. export I2G_MPI_APPLICATION=$MY_EXECUTABLE export I2G_MPI_TYPE=$MPI_FLAVOR_LOWER #export I2G_MPI_APPLICATION_ARGS="./ 0 0 1" # optional hooks #export I2G_MPI_PRE_RUN_HOOK=hooks.sh #export I2G_MPI_POST_RUN_HOOK=hooks.sh # If these are set then you will get more debugging information. #export I2G_MPI_START_VERBOSE=1 #export I2G_MPI_START_TRACE=1 #export I2G_MPI_START_DEBUG=1 # Invoke mpi-start. $I2G_MPI_START #!/bin/bash MY_EXECUTABLE=$1 MPI_FLAVOR=$2 # Convert flavor to lowercase for passing to mpi-start. MPI_FLAVOR_LOWER=`echo $MPI_FLAVOR | tr '[:upper:]' '[:lower:]'` # Pull out the correct paths for the requested flavor. eval MPI_PATH=`printenv MPI_${MPI_FLAVOR}_PATH` # Ensure the prefix is correctly set. Don't rely on the defaults. eval I2G_${MPI_FLAVOR}_PREFIX=$MPI_PATH export I2G_${MPI_FLAVOR}_PREFIX # Touch the executable. It exist must for the shared file system check. # If it does not, then mpi-start may try to distribute the executable # when it shouldn't. touch $MY_EXECUTABLE chmod +x $MY_EXECUTABLE # Setup for mpi-start. export I2G_MPI_APPLICATION=$MY_EXECUTABLE export I2G_MPI_TYPE=$MPI_FLAVOR_LOWER #export I2G_MPI_APPLICATION_ARGS="./ 0 0 1" # optional hooks #export I2G_MPI_PRE_RUN_HOOK=hooks.sh #export I2G_MPI_POST_RUN_HOOK=hooks.sh # If these are set then you will get more debugging information. #export I2G_MPI_START_VERBOSE=1 #export I2G_MPI_START_TRACE=1 #export I2G_MPI_START_DEBUG=1 # Invoke mpi-start. $I2G_MPI_START

EGI-InSPIRE RI hello.sh 9 #!/bin/bash echo "hello world from `hostname`” #!/bin/bash echo "hello world from `hostname`”

EGI-InSPIRE RI List-match EGI UF. Vilnius, Apr $ glite-wms-job-list-match -a job.jdl Connecting to the service ========================================================================== COMPUTING ELEMENT IDs LIST The following CE(s) matching your job requirements have been found: *CEId* - gridce01.ifca.es:2119/jobmanager-sge-ngifor - ngiesce.i3m.upv.es:2119/jobmanager-pbs-ngies - ce2.egee.cesga.es:2119/jobmanager-lcgsge-GRID_ngifor ========================================================================== $ glite-wms-job-list-match -a job.jdl Connecting to the service ========================================================================== COMPUTING ELEMENT IDs LIST The following CE(s) matching your job requirements have been found: *CEId* - gridce01.ifca.es:2119/jobmanager-sge-ngifor - ngiesce.i3m.upv.es:2119/jobmanager-pbs-ngies - ce2.egee.cesga.es:2119/jobmanager-lcgsge-GRID_ngifor ==========================================================================

EGI-InSPIRE RI Submission EGI UF. Vilnius, Apr $ glite-wms-job-submit –a job.jdl Connecting to the service ====================== glite-wms-job-submit Success ====================== The job has been successfully submitted to the WMProxy Your job identifier is: ========================================================================== $ glite-wms-job-submit –a job.jdl Connecting to the service ====================== glite-wms-job-submit Success ====================== The job has been successfully submitted to the WMProxy Your job identifier is: ========================================================================== glite-wms-job-status YFzrgHBhQ ======================= glite-wms-job-status Success ===================== BOOKKEEPING INFORMATION: Status info for the Job : Current Status: Running Status Reason: Job successfully submitted to Globus Destination: gridce01.ifca.es:2119/jobmanager-sge-ngifor Submitted: Wed Apr 6 10:12: CEST ========================================================================== glite-wms-job-status YFzrgHBhQ ======================= glite-wms-job-status Success ===================== BOOKKEEPING INFORMATION: Status info for the Job : Current Status: Running Status Reason: Job successfully submitted to Globus Destination: gridce01.ifca.es:2119/jobmanager-sge-ngifor Submitted: Wed Apr 6 10:12: CEST ==========================================================================

EGI-InSPIRE RI Output 12 $ glite-wms-job-output --dir./ YFzrgHBhQ Connecting to the service ================================================================================ JOB GET OUTPUT OUTCOME Output sandbox files for the job: have been successfully retrieved and stored in the directory: /gpfs/csic_projects/grid/tmp/jobOutput/enol_q5BP68lwwUH4-YFzrgHBhQ ================================================================================ $ cat /gpfs/csic_projects/grid/tmp/jobOutput/enol_q5BP68lwwUH4-YFzrgHBhQ/* hello world from gcsic142wn $ glite-wms-job-output --dir./ YFzrgHBhQ Connecting to the service ================================================================================ JOB GET OUTPUT OUTCOME Output sandbox files for the job: have been successfully retrieved and stored in the directory: /gpfs/csic_projects/grid/tmp/jobOutput/enol_q5BP68lwwUH4-YFzrgHBhQ ================================================================================ $ cat /gpfs/csic_projects/grid/tmp/jobOutput/enol_q5BP68lwwUH4-YFzrgHBhQ/* hello world from gcsic142wn

EGI-InSPIRE RI … things may go wrong Errors happen frequently, we need a way to figure out what went wrong Use the MPI-START debugging variables: –Basic information: I2G_MPI_START_VERBOSE=1 –Debug information: I2G_MPI_START_DEBUG=1 –Full trace of the execution (normally too much, but useful for mpi-start developers) I2G_MPI_START_TRACE=1 Set them in the starter.sh or in the JDL: Environment = {“I2G_MPI_START_VERBOSE=1”,…} EGI UF. Vilnius, Apr

EGI-InSPIRE RI Debugging output: job-debug.jdl 14 ************************************************************************ UID = ngifor080 HOST = gcsic177wn DATE = Tue Jul 6 12:07:15 CEST 2010 VERSION = ************************************************************************ mpi-start [DEBUG ]: dump configuration mpi-start [DEBUG ]: => I2G_MPI_APPLICATION=hello.sh mpi-start [DEBUG ]: => I2G_MPI_APPLICATION_ARGS= mpi-start [DEBUG ]: => I2G_MPI_TYPE=openmpi […] mpi-start [INFO ]: search for scheduler mpi-start [DEBUG ]: source /opt/i2g/bin/../etc/mpi-start/lsf.scheduler mpi-start [DEBUG ]: checking for scheduler support : sge mpi-start [DEBUG ]: checking for $PE_HOSTFILE mpi-start [INFO ]: activate support for sge mpi-start [DEBUG ]: convert PE_HOSTFILE into standard format mpi-start [DEBUG ]: dump machinefile: mpi-start [DEBUG ]: => gcsic177wn.ifca.es mpi-start [DEBUG ]: starting with 4 processes. ************************************************************************ UID = ngifor080 HOST = gcsic177wn DATE = Tue Jul 6 12:07:15 CEST 2010 VERSION = ************************************************************************ mpi-start [DEBUG ]: dump configuration mpi-start [DEBUG ]: => I2G_MPI_APPLICATION=hello.sh mpi-start [DEBUG ]: => I2G_MPI_APPLICATION_ARGS= mpi-start [DEBUG ]: => I2G_MPI_TYPE=openmpi […] mpi-start [INFO ]: search for scheduler mpi-start [DEBUG ]: source /opt/i2g/bin/../etc/mpi-start/lsf.scheduler mpi-start [DEBUG ]: checking for scheduler support : sge mpi-start [DEBUG ]: checking for $PE_HOSTFILE mpi-start [INFO ]: activate support for sge mpi-start [DEBUG ]: convert PE_HOSTFILE into standard format mpi-start [DEBUG ]: dump machinefile: mpi-start [DEBUG ]: => gcsic177wn.ifca.es mpi-start [DEBUG ]: starting with 4 processes.

EGI-InSPIRE RI A more real MPI job: cpi 1.Compile your application $ mpicc cpi.c –o cpi 2.Change your JDL: InputSandbox = {"starter.sh", "cpi"}; Arguments = "cpi OPENMPI”; 3.Submit 15

EGI-InSPIRE RI Output 16 $ glite-wms-job-output --dir./ /3hXhJD3eRRgiSLPqW3vSKghttps://wms01.ncg.ingrid.pt Connecting to the service ================================================================================ JOB GET OUTPUT OUTCOME Output sandbox files for the job: have been successfully retrieved and stored in the directory: /home/enol/tests/eciencia/cpi/enol_3hXhJD3eRRgiSLPqW3vSKg ================================================================================ $ cat /home/enol/tests/eciencia/cpi/enol_3hXhJD3eRRgiSLPqW3vSKg/* Process 3 on gcsic093wn: n=1 Process 2 on gcsic091wn: n=1 Process 1 on gcsic091wn: n=1 Process 0 on gcsic026wn: n=1 Using intervals pi is approximately , Error is wall clock time = $ glite-wms-job-output --dir./ /3hXhJD3eRRgiSLPqW3vSKghttps://wms01.ncg.ingrid.pt Connecting to the service ================================================================================ JOB GET OUTPUT OUTCOME Output sandbox files for the job: have been successfully retrieved and stored in the directory: /home/enol/tests/eciencia/cpi/enol_3hXhJD3eRRgiSLPqW3vSKg ================================================================================ $ cat /home/enol/tests/eciencia/cpi/enol_3hXhJD3eRRgiSLPqW3vSKg/* Process 3 on gcsic093wn: n=1 Process 2 on gcsic091wn: n=1 Process 1 on gcsic091wn: n=1 Process 0 on gcsic026wn: n=1 Using intervals pi is approximately , Error is wall clock time =

EGI-InSPIRE RI Remote compilation What if your binary does not match the site environment? Remote compilation is needed Mpi-start hooks can help here! 17

EGI-InSPIRE RI Compilation using hooks 18 #!/bin/sh pre_run_hook () { # Compile the program. echo "Compiling ${I2G_MPI_APPLICATION}" # Actually compile the program. cmd="mpicc ${MPI_MPICC_OPTS} -o ${I2G_MPI_APPLICATION} ${I2G_MPI_APPLICATION}.c" $cmd if [ ! $? -eq 0 ]; then echo "Error compiling program. Exiting..." return 1 fi # Everything's OK. echo "Successfully compiled ${I2G_MPI_APPLICATION}" return 0 } #!/bin/sh pre_run_hook () { # Compile the program. echo "Compiling ${I2G_MPI_APPLICATION}" # Actually compile the program. cmd="mpicc ${MPI_MPICC_OPTS} -o ${I2G_MPI_APPLICATION} ${I2G_MPI_APPLICATION}.c" $cmd if [ ! $? -eq 0 ]; then echo "Error compiling program. Exiting..." return 1 fi # Everything's OK. echo "Successfully compiled ${I2G_MPI_APPLICATION}" return 0 }

EGI-InSPIRE RI Compilation using hooks 19 JobType = "Normal"; nodeNumber = 4; Executable = "starter.sh"; Arguments = ”cpi OPENMPI"; InputSandbox = {"starter.sh", “cpi.c”, “hooks.sh”}; StdOutput = "std.out"; StdError = "std.err"; OutputSandbox = {"std.out","std.err"}; Requirements = Member("MPI-START”, other.GlueHostApplicationSoftwareRunTimeEnvironment) && Member("OPENMPI”, other.GlueHostApplicationSoftwareRunTimeEnvironment); Environment = {“I2G_MPI_PRE_RUN_HOOK=hooks.sh”}; JobType = "Normal"; nodeNumber = 4; Executable = "starter.sh"; Arguments = ”cpi OPENMPI"; InputSandbox = {"starter.sh", “cpi.c”, “hooks.sh”}; StdOutput = "std.out"; StdError = "std.err"; OutputSandbox = {"std.out","std.err"}; Requirements = Member("MPI-START”, other.GlueHostApplicationSoftwareRunTimeEnvironment) && Member("OPENMPI”, other.GlueHostApplicationSoftwareRunTimeEnvironment); Environment = {“I2G_MPI_PRE_RUN_HOOK=hooks.sh”};

EGI-InSPIRE RI Compilation using hooks 20 […] mpi-start [DEBUG ]: Try to run pre hooks at hooks.sh mpi-start [DEBUG ]: call pre_run hook Compiling cpi Successfully compiled cpi […] =[START]======================================================== […] pi is approximately , Error is wall clock time = =[FINISHED]====================================================== […] mpi-start [DEBUG ]: Try to run pre hooks at hooks.sh mpi-start [DEBUG ]: call pre_run hook Compiling cpi Successfully compiled cpi […] =[START]======================================================== […] pi is approximately , Error is wall clock time = =[FINISHED]======================================================

EGI-InSPIRE RI Getting ouput using hooks 21 #!/bin/sh export OUTPUT_PATTERN="host_*.txt" export OUTPUT_ARCHIVE=myout.tgz # the first paramter is the name of a host in the copy_from_remote_node() { if [[ $1 == `hostname` || $1 == 'hostname -f' || $1 == "localhost" ]]; then echo "skip local host" return 1 fi CMD="scp –r $1:\"$PWD/$OUTPUT_PATTERN\".” $CMD } post_run_hook () { echo "post_run_hook called" if [ "x$MPI_START_SHARED_FS" == "x0" -a "x$MPI_SHARED_HOME" != "xyes" ] ; then echo "gather output from remote hosts" mpi_start_foreach_host copy_from_remote_node fi echo "pack the data" tar cvzf $OUTPUT_ARCHIVE $OUTPUT_PATTERN return 0 } #!/bin/sh export OUTPUT_PATTERN="host_*.txt" export OUTPUT_ARCHIVE=myout.tgz # the first paramter is the name of a host in the copy_from_remote_node() { if [[ $1 == `hostname` || $1 == 'hostname -f' || $1 == "localhost" ]]; then echo "skip local host" return 1 fi CMD="scp –r $1:\"$PWD/$OUTPUT_PATTERN\".” $CMD } post_run_hook () { echo "post_run_hook called" if [ "x$MPI_START_SHARED_FS" == "x0" -a "x$MPI_SHARED_HOME" != "xyes" ] ; then echo "gather output from remote hosts" mpi_start_foreach_host copy_from_remote_node fi echo "pack the data" tar cvzf $OUTPUT_ARCHIVE $OUTPUT_PATTERN return 0 }

EGI-InSPIRE RI Getting ouput using hooks 22 JobType = "Normal"; nodeNumber = 4; Executable = "starter.sh"; Arguments = ”cpi2 OPENMPI"; InputSandbox = {"starter.sh", “cpi2.c”, “hooks.sh”}; StdOutput = "std.out"; StdError = "std.err"; OutputSandbox = {"std.out","std.err"}; Requirements = Member("MPI-START”, other.GlueHostApplicationSoftwareRunTimeEnvironment) && Member("OPENMPI”, other.GlueHostApplicationSoftwareRunTimeEnvironment); Environment = {“I2G_MPI_PRE_RUN_HOOK=hooks.sh”, “I2G_MPI_PRE_RUN_HOOK=hooks.sh”}; JobType = "Normal"; nodeNumber = 4; Executable = "starter.sh"; Arguments = ”cpi2 OPENMPI"; InputSandbox = {"starter.sh", “cpi2.c”, “hooks.sh”}; StdOutput = "std.out"; StdError = "std.err"; OutputSandbox = {"std.out","std.err"}; Requirements = Member("MPI-START”, other.GlueHostApplicationSoftwareRunTimeEnvironment) && Member("OPENMPI”, other.GlueHostApplicationSoftwareRunTimeEnvironment); Environment = {“I2G_MPI_PRE_RUN_HOOK=hooks.sh”, “I2G_MPI_PRE_RUN_HOOK=hooks.sh”};

EGI-InSPIRE RI Getting ouput using hooks 23 […] mpi-start [DEBUG ]: Try to run post hooks at hooks.sh mpi-start [DEBUG ]: call post-run hook post_run_hook called pack the data host_0.txt host_1.txt host_2.txt host_3.txt […] mpi-start [DEBUG ]: Try to run post hooks at hooks.sh mpi-start [DEBUG ]: call post-run hook post_run_hook called pack the data host_0.txt host_1.txt host_2.txt host_3.txt

EGI-InSPIRE RI ETHERNET v. INFINIBAND IMBenchmark 24 Compare the bandwidht and latency of two different interconnects imb.jdl  Ethernet imb-INF.jdl  INFINIBAND Compare the bandwidht and latency of two different interconnects imb.jdl  Ethernet imb-INF.jdl  INFINIBAND # # Benchmarking PingPong # #processes = 2 # ( 6 additional processes waiting in MPI_Barrier) # #bytes #repetitions t[usec] Mbytes/sec # # Benchmarking PingPong # #processes = 2 # ( 6 additional processes waiting in MPI_Barrier) # #bytes #repetitions t[usec] Mbytes/sec #!/bin/sh pre_run_hook () { echo "Compilation of the code" tar xzvf imb.tar.gz cd src gmake ls -lrt cp IMB-MPI1../. cd.. } #!/bin/sh pre_run_hook () { echo "Compilation of the code" tar xzvf imb.tar.gz cd src gmake ls -lrt cp IMB-MPI1../. cd.. } # # Benchmarking PingPong # #processes = 2 # ( 6 additional processes waiting in MPI_Barrier) # #bytes #repetitions t[usec] Mbytes/sec # # Benchmarking PingPong # #processes = 2 # ( 6 additional processes waiting in MPI_Barrier) # #bytes #repetitions t[usec] Mbytes/sec

EGI-InSPIRE RI Compiling & Using the Storage Element 25 The Exercise SE_hooks: 1. Compiles the code “testprogram.tgz” 2. Executes the parallel MPI code on Grid resources 3. Copies the output to a Storage Element. This is important when the output is too large to be brought to the user in the Sandbox (>50 MB) #!/bin/sh export OUTPUT_PATTERN=L8 export OUTPUT_ARCHIVE=resultado.tar.gz export OUTPUT_HOST=srm01.ncg.ingrid.pt export OUTPUT_SE=lfn:/grid/biomed/tutorial-Valencia export OUTPUT_VO=biomed pre_run_hook () { echo "Compilation of the code" tar xzvf testprogram.tgz cd o3parallel make ls -lrt cp o3sg_8../. cd.. } #!/bin/sh export OUTPUT_PATTERN=L8 export OUTPUT_ARCHIVE=resultado.tar.gz export OUTPUT_HOST=srm01.ncg.ingrid.pt export OUTPUT_SE=lfn:/grid/biomed/tutorial-Valencia export OUTPUT_VO=biomed pre_run_hook () { echo "Compilation of the code" tar xzvf testprogram.tgz cd o3parallel make ls -lrt cp o3sg_8../. cd.. } testprogram_hooks.sh DEFINITION OF ENVIRONMENT VARIABLES COMPILATION OF THE SOURCES

EGI-InSPIRE RI Compiling & Using the Storage Element 26 Copies the output to a Storage Element. This is important when the output is too large to be brought to the user in the Sandbox (>50 MB) testprogram_hooks.sh # the first parameter is the name of a host in the copy_from_remote_node() { if [[ $1 == `hostname` || $1 == 'hostname -f' || $1 == "localhost" ]]; then echo "skip local host" return 1 fi # pack data CMD="scp -r $1:\"$PWD/$OUTPUT_PATTERN\"." echo $CMD $CMD } post_run_hook () { echo "post_run_hook called" if [ "x$MPI_START_SHARED_FS" == "x0" ] ; then echo "gather output from remote hosts" mpi_start_foreach_host copy_from_remote_node fi echo "pack the data" tar cvzf $OUTPUT_ARCHIVE $OUTPUT_PATTERN echo "delete old file if it is thre" lcg-del --vo $OUTPUT_VO -a lfn:/grid/$OUTPUT_VO/$OUTPUT_ARCHIVE echo "upload the data" lcg-cr --vo $OUTPUT_VO -d $OUTPUT_HOST -l $OUTPUT_SE/$OUTPUT_ARCHIVE file://$PWD/$OUTPUT_ARCHIVE return 0 } # the first parameter is the name of a host in the copy_from_remote_node() { if [[ $1 == `hostname` || $1 == 'hostname -f' || $1 == "localhost" ]]; then echo "skip local host" return 1 fi # pack data CMD="scp -r $1:\"$PWD/$OUTPUT_PATTERN\"." echo $CMD $CMD } post_run_hook () { echo "post_run_hook called" if [ "x$MPI_START_SHARED_FS" == "x0" ] ; then echo "gather output from remote hosts" mpi_start_foreach_host copy_from_remote_node fi echo "pack the data" tar cvzf $OUTPUT_ARCHIVE $OUTPUT_PATTERN echo "delete old file if it is thre" lcg-del --vo $OUTPUT_VO -a lfn:/grid/$OUTPUT_VO/$OUTPUT_ARCHIVE echo "upload the data" lcg-cr --vo $OUTPUT_VO -d $OUTPUT_HOST -l $OUTPUT_SE/$OUTPUT_ARCHIVE file://$PWD/$OUTPUT_ARCHIVE return 0 }

EGI-InSPIRE RI Interactive Job: getting a shell  Start i2glogin in one shell of the UI Everyone should use a different TCP port between and i2glogin waits for the connection to be established... Build a JDL for an interactive JOB  Submit the job in another shell of the UI JobType = "normal"; Executable = "i2glogin"; Arguments = "-r -p 20784: t -c /bin/sh"; STDOUTPUT = "std.out"; STDERROR = "std.err"; InputSandbox = {"i2glogin"}; OutputSandbox = {"std.err", "std.out"};  Submit your JOB in a 2nd UI terminal... Port:IP of the machine expecting the connection ~]$./i2glogin -p p 20784: ~]$ glite-wms-job-submit -a interactive.jdl

EGI-InSPIRE RI MPI interactive JOB 28 JobType = "Normal"; nodeNumber = 2; Executable = "starter.sh"; Arguments = "IMB-MPI1 OPENMPI"; InputSandbox = {"imb.tar.gz", "imb_hooks.sh", "starter.sh", "i2glogin.64"}; StdOutput = "std.out"; StdError = "std.err"; OutputSandbox = {"std.out","std.err"}; Requirements = Member("MPI-START", other.GlueHostApplicationSoftwareRunTimeEnvironment) && Member("OPENMPI", other.GlueHostApplicationSoftwareRunTimeEnvironment); Environment = {"I2G_MPI_PRE_RUN_HOOK=imb_hooks.sh", "I2G_MPI_PRECOMMAND='./i2glogin.64 -r -p 20717: t -c'"}; Rank = 0; JobType = "Normal"; nodeNumber = 2; Executable = "starter.sh"; Arguments = "IMB-MPI1 OPENMPI"; InputSandbox = {"imb.tar.gz", "imb_hooks.sh", "starter.sh", "i2glogin.64"}; StdOutput = "std.out"; StdError = "std.err"; OutputSandbox = {"std.out","std.err"}; Requirements = Member("MPI-START", other.GlueHostApplicationSoftwareRunTimeEnvironment) && Member("OPENMPI", other.GlueHostApplicationSoftwareRunTimeEnvironment); Environment = {"I2G_MPI_PRE_RUN_HOOK=imb_hooks.sh", "I2G_MPI_PRECOMMAND='./i2glogin.64 -r -p 20717: t -c'"}; Rank = 0; Needs the adition of “i2glogin as PRECOMMAND using I2G_MPI_PRECOMMAND mpi-interactive.jdl

EGI-InSPIRE RI MPI interactive JOB 29 The PRECOMMAND needs to have execution permissions in the starter.sh if [ "x$I2G_MPI_PRECOMMAND" != "x" ] ; then PRE=`mktemp` cat > $PRE << EOF #!/bin/bash ARGS="\$*" set `echo $I2G_MPI_PRECOMMAND` chmod +x \$1 exec $I2G_MPI_PRECOMMAND "\$ARGS" EOF export I2G_MPI_PRECOMMAND=$PRE chmod +x $PRE fi if [ "x$I2G_MPI_PRECOMMAND" != "x" ] ; then PRE=`mktemp` cat > $PRE << EOF #!/bin/bash ARGS="\$*" set `echo $I2G_MPI_PRECOMMAND` chmod +x \$1 exec $I2G_MPI_PRECOMMAND "\$ARGS" EOF export I2G_MPI_PRECOMMAND=$PRE chmod +x $PRE fi glite-wms-job-submit -a -r ngiescream.i3m.upv.es:8443/cream-pbs-biomed mpi-interactive.jdl starter.sh

EGI-InSPIRE RI More information MPI-Start: –Documentation: EGI MPI-Start installation and configuration: – Start_Installation_and_Configurationhttps://wiki.egi.eu/wiki/MAN03_MPI- Start_Installation_and_Configuration TCG MPI wiki: 30