Ganga 4 Basics - Tutorial Jakub T. Moscicki ARDA/LHCb Ganga Tutorial, September 2006.

Slides:



Advertisements
Similar presentations
Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
Advertisements

GANGA Overview Germán Carrera, Alfredo Solano (CNB/CSIC) EMBRACE COURSE Monday 19th of February to Friday 23th. CNB-CSIC Madrid.
Computing Lectures Introduction to Ganga 1 Ganga: Introduction Object Orientated Interactive Job Submission System –Written in python –Based on the concept.
GRID INTEROPERABILITY USING GANGA Soonwook Hwang (KISTI) YoonKee Lee and EunSung Kim (Seoul National Uniersity) KISTI-CCIN2P3 FKPPL Workshop December 1,
EGEE-II INFSO-RI Enabling Grids for E-sciencE EGEE and gLite are registered trademarks Introduction to GANGA Hurng-Chun Lee 27 Feb.
PHP (2) – Functions, Arrays, Databases, and sessions.
Israel Cluster Structure. Outline The local cluster Local analysis on the cluster –Program location –Storage –Interactive analysis & batch analysis –PBS.
Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
DIRAC API DIRAC Project. Overview  DIRAC API  Why APIs are important?  Why advanced users prefer APIs?  How it is done?  What is local mode what.
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
Python quick start guide
GETTING STARTED ON THE GRID: W. G. SCOTT (RAL/PPD) RAL PHYSICS MEETING TUES 15 MAY GENERATED 10K SAMPLES IN EACH CHANNEL ON LXPLUS (IN 2006) SIMULATED/DIGITISDED.
Introduction to Python Lecture 1. CS 484 – Artificial Intelligence2 Big Picture Language Features Python is interpreted Not compiled Object-oriented language.
The ATLAS Production System. The Architecture ATLAS Production Database Eowyn Lexor Lexor-CondorG Oracle SQL queries Dulcinea NorduGrid Panda OSGLCG The.
Ganga 3 CLIP Tutorial Jakub T. Moscicki ARDA/LHCb Ganga Tutorial, April 2005.
© 2012 LogiGear Corporation. All Rights Reserved Robot framework.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
An Introduction to Unix Shell Scripting
Introduction to Programming Workshop 1 PHYS1101 Discovery Skills in Physics Dr. Nigel Dipper Room 125d
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
Distributed Analysis using Ganga I.Ideas behind Ganga II.Getting started III.Running ATLAS applications Distributed Analysis Tutorial ATLAS Computing &
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Belle MC Production on Grid 2 nd Open Meeting of the SuperKEKB Collaboration Soft/Comp session 17 March, 2009 Hideyuki Nakazawa National Central University.
Linux Operations and Administration
Job handling in Ganga Jakub T. Moscicki ARDA/LHCb GANGA-DIRAC Meeting, June, 2005.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Ganga A quick tutorial Asterios Katsifodimos Trainer, University of Cyprus Nicosia, Feb 16, 2009.
Enabling Grids for E-sciencE EGEE-III INFSO-RI Using DIANE for astrophysics applications Ladislav Hluchy, Viet Tran Institute of Informatics Slovak.
7 1 User-Defined Functions CGI/Perl Programming By Diane Zak.
Chapter 0 Getting Started. Objectives Understand the basic structure of a C++ program including: – Comments – Preprocessor instructions – Main function.
Introducing Python CS 4320, SPRING Resources We will be following the Python tutorialPython tutorial These notes will cover the following sections.
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
Functions CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Introduction to Ganga Karl Harrison (University of Cambridge) ATLAS Distributed Analysis Tutorial Milano, 5-6 February 2007
Job Management DIRAC Project. Overview  DIRAC JDL  DIRAC Commands  Tutorial Exercises  What do you have learned? KEK 10/2012DIRAC Tutorial.
You Need an Interpreter!. Closing the GAP Thus far, we’ve been struggling to speak to computers in “their” language, maybe its time we spoke to them in.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Ganga 4 Basics - Tutorial Jakub T. Moscicki ARDA/LHCb Ganga Tutorial, November 2005.
Introduction to Taverna Online and Interaction service Aleksandra Pawlik University of Manchester.
INFSO-RI Enabling Grids for E-sciencE Ganga 4 – The Ganga Evolution Andrew Maier.
EGEE-II INFSO-RI Enabling Grids for E-sciencE EGEE and gLite are registered trademarks Ganga Tutorial From: Jakub T. Moscicki (CERN)
2. WRITING SIMPLE PROGRAMS Rocky K. C. Chang September 10, 2015 (Adapted from John Zelle’s slides)
EGEE-II INFSO-RI Enabling Grids for E-sciencE EGEE and gLite are registered trademarks Ganga User Interface EGEE Review Jakub Moscicki.
1 DIRAC Job submission A.Tsaregorodtsev, CPPM, Marseille LHCb-ATLAS GANGA Workshop, 21 April 2004.
Ganga Core: Status Jakub T. Moscicki ARDA/LHCb LHCb Software Week, September, 2005.
K. Harrison CERN, 22nd September 2004 GANGA: ADA USER INTERFACE - Ganga release status - Job-Options Editor - Python support for AJDL - Job Builder - Python.
Distributed Data Analysis with GANGA (Tutorial) Alexander Zaytsev Budker Institute of Nuclear Physics (BudkerINP), Novosibirsk On the basis of GANGA EGEE.
Using Ganga for physics analysis Karl Harrison (University of Cambridge) ATLAS Distributed Analysis Tutorial Milano, 5-6 February 2007
2 June 20061/17 Getting started with Ganga K.Harrison University of Cambridge Tutorial on Distributed Analysis with Ganga CERN, 2.
ATLAS-specific functionality in Ganga - Requirements for distributed analysis - ATLAS considerations - DIAL submission from Ganga - Graphical interfaces.
INFSO-RI Enabling Grids for E-sciencE Using of GANGA interface for Athena applications A. Zalite / PNPI.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
K. Harrison CERN, 21st February 2005 GANGA: ADA USER INTERFACE - Ganga release Python client for ADA - ADA job builder - Ganga release Conclusions.
CSx 4091 – Python Programming Spring 2013 Lecture L2 – Introduction to Python Page 1 Help: To get help, type in the following in the interpreter: Welcome.
INFSO-RI Enabling Grids for E-sciencE Ganga 4 Technical Overview Jakub T. Moscicki, CERN.
A GANGA tutorial Professor Roger W.L. Jones Lancaster University.
Ganga: LHCb analysis on the grid (*)‏ A. Sarti (*)For dummies.... like me! I am assuming a basic knowledge of LHCb Gaudi applications. However, even if.
Job Management Beijing, 13-15/11/2013. Overview Beijing, /11/2013 DIRAC Tutorial2  DIRAC JDL  DIRAC Commands  Tutorial Exercises  What do you.
Seven things you should know about Ganga K. Harrison (University of Cambridge) Distributed Analysis Tutorial ATLAS Software & Computing Workshop, CERN,
Grid User Interface:Ganga Farida Fassi Master de Physique Informatique Rabat, Maroc th, May, 2011.
Distrubuited Analysis using GANGA
CS1010: Intro Workshop.
Python: Experiencing IDLE, writing simple programs
Jakub T. Moscicki (KUBA) CERN
Using SQL*Plus.
Presentation transcript:

Ganga 4 Basics - Tutorial Jakub T. Moscicki ARDA/LHCb Ganga Tutorial, September 2006

Ganga Tutorial, April Contents What is Ganga  7 things to know about Ganga from K.Harrison Setup and running for the first time Quick introduction to Python Simple Operations in Interactive Text Shell Copying jobs and submitting to other backends Scripting interface Shipping files Splitting

Ganga Tutorial, April What is Ganga? AtlasPROD DIAL DIRAC LCG2 gLite localhost LSF submit, kill get output update status store & retrieve job definition prepare, configure Ganga4 Job scripts Gaudi Athena AtlasPROD DIAL DIRAC LCG2 gLite localhost LSF

Ganga Tutorial, April Ganga Web Site:  Ganga Tutorial Bug reports Ganga is based on Python 2.2  Python Website:  Excellent Python Tutorial: Other resources:  IPython page: Documentation

Ganga Tutorial, April Setting up Ganga ATLAS tutorial instructions! Note: we are using a beta version – new release by the end of this month % ganga *** Welcome to Ganga *** Version: Ganga beta7 Documentation and support: Type help() or help('index') for online help. You will be asked few questions. Answer “yes” by pressing ENTER. GRID certificate: type your password or press Control-D several times. To quit press Control-D at the interactive prompt In[1]: ^D Do you really want to exit ([y]/n)? %

Ganga Tutorial, April Ganga Text Prompt Ganga is based on python 2.2 and has an enhanced python prompt (IPython):  python programming/scripting var = 5 print var*10  easy access to the shell commands !less ~/.gangarc # personal config file !pwd  history  TAB completion it works on keywords, variables, objects, try: –va  many more features

Ganga Tutorial, April x = 2 print x*3 # you may also skip print if x==2: print "yes, x==2" # NOTE INITIAL SPACES! alist = [1,2,3] for y in alist: print y print len(alist) # built-in function len help(len) Python: Statements, Variables

Ganga Tutorial, April print range(11) help(range) def square(v): return v*v print square(x) alist = [1,2,3] for i in range(len(alist)): alist[i] = square(alist[i]) blist = [square(x) for x in alist] Python: Functions

Ganga Tutorial, April import sys print sys.argv import os print os.environ['HOME'] from os import environ from os import * import math, cmath print math.cos(math.pi) v =(1+1j) print v*v math.log(-1) # exception Python: Modules

Ganga Tutorial, April # standard library & user classes import random r = random.Random() r.choice([1,2,3,4]) r.randint(30,40) #built-in classes: for example strings s = "hello at the tutorial" # double quotes s.split() s.count('a') s.upper() dir(s) if 'tut' in s: print 'tut is in ',s print '-'*20 # single quotes Python: Classes and Objects

Ganga Tutorial, April # file objects f = file('/etc/password') lines = f.readlines() print len(lines) # writing files f2 = file('testfile','w') print >> f2, “this is a test”,20*'-' f2.close() !cat testfile NOTE: Ganga defines a special class File. Do not confuse File and file! Python: files

Ganga Tutorial, April Job Objects and Job Registry [In:] jobs [In:] Job() [In:] jobs [In:] j = jobs[1] [In:] print j.application [In:] print j.backend # job registry: a list of all your jobs [In:] jobs [In:] jobs[1] Ganga Scripting

Ganga Tutorial, April Jobs Job ( status = 'new', inputdir = '/afs/cern.ch/user/k/kuba/gangadir/workspace/Local/2/input/', name = '', outputdir = '/afs/cern.ch/user/k/kuba/gangadir/workspace/Local/2/output/', outputsandbox = [], id = 2, application = Executable ( exe = '/bin/hostname', env = {}, args = [] ), inputdata = None, inputsandbox = [ ], backend = Local ( exitcode = None, id = None )

Ganga Tutorial, April [In:] j = Job() [In:] j.application.exe = '/bin/hostname' [In:] j.name = "MyTest" [In:] print j [In:] j.submit() # wait until job is completed and look # at the output directory [In:] print j.status [In:] print j.outputdir [In:] !ls $j.outputdir [In:] !cat $j.outputdir/stdout # the ! and $ syntax is IPython – you # cannot do it in normal python # it is useful for interactive work # instead of mouse copy-paste Basic Job Submission

Ganga Tutorial, April # once a job is submitted you cannot modify # it. if you want to submit a new job you # should create a new job object [In:] j2 = j.copy() [In:] j2.backend = LSF() [In:] j2.submit() # if you have GRID certificate you can try [In:] j3 = j.copy() [In:] j3.backend = LCG() [In:] j3.submit() # print jobs to see all your jobs More submission

Ganga Tutorial, April # see predefined plugins # (only some combinations supported) list_plugins() help('index') # submission in a loop for i in range(5): j = Job() j.application.exe="/bin/echo" j.application.args=["hello ",str(i)]) print j.id, j.inputdir print j.submit() More ideas

Ganga Tutorial, April # For frequently used jobs – use templates! t = JobTemplate(j) print templates j = Job(t) # Create a new job from t # Other useful methods j.kill() j.remove() # Removes the output as well! for j in jobs: j.kill() jobs.clean() # Faster! Deletes ALL jobs. More Ideas (2)

Ganga Tutorial, April export(j,'myjob') # press ^D to quit ganga cat myjob ganga submit myjob ganga query *restart ganga* load('myjob') Scripting possibilities

Ganga Tutorial, April j = Job() j.application.exe=File('spy') j.outputsandbox = ['*.txt'] j.submit() Do not confuse File with file! Shipping files

Ganga Tutorial, April Prime number crunching:  cryptography (also Grid certificates)  you break the key by factoring large integers into prime numbers Application setup:  we have 15 tables with 1M primes each the files are downloaded from a web server  we have a “prime_factor.py” script which scans the table and returns the factors it finds: [(p1,n1),(p2,n2),...,(pk,nk)] so that product of pow(pi,ni) = the number Splitting Demo

Ganga Tutorial, April Job 1:  find all primes factors of among the first million primes j = Job() j.application.exe=File('prime_factor.py') j.application.args =[' ', ' j.outputsandbox=['*.dat'] j.submit() cat $j.outputdir/*.dat execfile('primes.py') # load helper functions for primes check_prime_job(j) Splitting Demo

Ganga Tutorial, April Job 2: find more factors using 5 tables j = j.copy() split_prime_job(j,5) Exercise:  find all primes of: Notes:  you cannot not crack real codes this way ;-)  instead of the Web server one could/should use a Grid SE Splitting Demo

Ganga Tutorial, April Try: ganga -h to see options Have a look also in the config file: ~/.gangarc Hints and Pitfalls

Ganga Tutorial, April Questions? Practical exercises Questions?