Ganga 3 CLIP Tutorial Jakub T. Moscicki ARDA/LHCb Ganga Tutorial, April 2005.

Slides:



Advertisements
Similar presentations
Python Mini-Course University of Oklahoma Department of Psychology Day 2 – Lesson 8 Fruitful Functions 05/02/09 Python Mini-Course: Day 2 - Lesson 8 1.
Advertisements

GANGA Overview Germán Carrera, Alfredo Solano (CNB/CSIC) EMBRACE COURSE Monday 19th of February to Friday 23th. CNB-CSIC Madrid.
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.
Python programs How can I run a program? Input and output.
Introduction to Python Lecture 1. CS 484 – Artificial Intelligence2 Big Picture Language Features Python is interpreted Not compiled Object-oriented language.
COMPE 111 Introduction to Computer Engineering Programming in Python Atılım University
2006 GIS Jam: ArcGIS Python Scripting
By Zeng Sheng Liu. os - provides dozens of functions for interacting with the operating system >>> import os >>> os.system('time 0:02') 0 >>> os.getcwd()
Builtins, namespaces, functions. There are objects that are predefined in Python Python built-ins When you use something without defining it, it means.
Introduction to Programming Workshop 1 PHYS1101 Discovery Skills in Physics Dr. Nigel Dipper Room 125d
By: Joshua O’Donoghue. Operating System Interface In order to interact with the operating system in python you will want to become familiar with the OS.
Introduction to Programming Workshop 2 PHYS1101 Discovery Skills in Physics Dr. Nigel Dipper Room 125d
Python Modules An Introduction. Introduction A module is a file containing Python definitions and statements. The file name is the module name with the.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
Distributed Analysis using Ganga I.Ideas behind Ganga II.Getting started III.Running ATLAS applications Distributed Analysis Tutorial ATLAS Computing &
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 6 Value-Returning.
H3D API Training  Part 3.1: Python – Quick overview.
Introduction to Python September 26, /10/ Bioinformatics Languages Low-level, compiled languages: C, C++, Java… Pros: performance Cons:
Python – Part 3 Functions 1. Function Calls Function – A named sequence of statements that performs a computation – Name – Sequence of statements “call”
Course A201: Introduction to Programming 11/04/2010.
Job handling in Ganga Jakub T. Moscicki ARDA/LHCb GANGA-DIRAC Meeting, June, 2005.
Functions. Built-in functions You’ve used several functions already >>> len("ATGGTCA")‏ 7 >>> abs(-6)‏ 6 >>> float("3.1415")‏ >>>
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Introduction to Computing Using Python for loop / def- ining a new function  Execution control structures ( if, for, function call)  def -ining a new.
CSC 110 Using Python [Reading: chapter 1] CSC 110 B 1.
Counter-Controlled Loops CSIS 1595: Fundamentals of Programming and Problem Solving 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.
9/21/2015BCHB Edwards Python Data Structures: Lists BCHB Lecture 6.
Ganga 4 Basics - Tutorial Jakub T. Moscicki ARDA/LHCb Ganga Tutorial, November 2005.
INFSO-RI Enabling Grids for E-sciencE Ganga 4 – The Ganga Evolution Andrew Maier.
Ganga 4 Basics - Tutorial Jakub T. Moscicki ARDA/LHCb Ganga Tutorial, September 2006.
Last Week Modules Save functions to a file, e.g., filename.py The file filename.py is a module We can use the functions in filename.py by importing it.
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.
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.
Python Basics  Functions  Loops  Recursion. Built-in functions >>> type (32) >>> int(‘32’) 32  From math >>>import math >>> degrees = 45 >>> radians.
Xi Wang Yang Zhang. 1. Easy to learn 2. Clean and readable codes 3. A lot of useful packages, especially for web scraping and text mining 4. Growing popularity.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
12. MODULES Rocky K. C. Chang November 6, 2015 (Based on from Charles Dierbach. Introduction to Computer Science Using Python and William F. Punch and.
Loops and Simple Functions COSC Review: While Loops Typically used when the number of times the loop will execute is indefinite Typically used when.
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.
LECTURE 2 Python Basics. MODULES So, we just put together our first real Python program. Let’s say we store this program in a file called fib.py. We have.
By: Aradhya Malhotra.  To interact with the OS in python you will want to become familiar with the OS module  The command “import os” is used for this.
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.
 Python for-statements can be treated the same as for-each loops in Java Syntax: for variable in listOrstring: body statements Example) x = "string"
Functions with Arguments and Return Values, Oh My! CS303E: Elements of Computers and Programming.
Geant4 GRID production Sangwan Kim, Vu Trong Hieu, AD At KISTI.
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.
PYTHON PROGRAMMING. WHAT IS PYTHON?  Python is a high-level language.  Interpreted  Object oriented (use of classes and objects)  Standard library.
Job Management Beijing, 13-15/11/2013. Overview Beijing, /11/2013 DIRAC Tutorial2  DIRAC JDL  DIRAC Commands  Tutorial Exercises  What do you.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Lecture III Syntax ● Statements ● Output ● Variables ● Conditions ● Loops ● List Comprehension ● Function Calls ● Modules.
Intro to Python Programming – Part II
Engineering Innovation Center
Data Analysis using Python-I
More Loop Examples Functions and Parameters
gLite Job Management Christos Theodosiou
Python Basics with Jupyter Notebook
Python Modules.
Unit 1: Intro Lesson 4: Output.
The Python interpreter
def-ining a function A function as an execution control structure
Python Modules.
Presentation transcript:

Ganga 3 CLIP Tutorial Jakub T. Moscicki ARDA/LHCb Ganga Tutorial, April 2005

Ganga Tutorial, April Contents Quick introduction to Python  Statements, variables, functions  Modules, classes, objects Basics of Ganga Scripting Interface  simple executable jobs  Simple DaVinci jobs  Job Registry and looping

Ganga Tutorial, April Python Website:  Excelent Python Tutorial:  Documentation:  How to start on lxplus at CERN (python 2.2) % python Python (#1, Jan , 21:26:22) >>> ^D % Python Quickstart

Ganga Tutorial, April x = 2 print x*3 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) Statements, Variables

Ganga Tutorial, April print range(10) 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]) Functions

Ganga Tutorial, April import sys print sys.argv sys.exit(-1) import os print os.environ['HOME'] from os import environ from os import * import math, cmath Modules

Ganga Tutorial, April # user defined classes a = MyClass(2,3) a.my_method(1) #built-in classes: for example strings s = "hello at the tutorial" s.split() s.count('a') s.upper() dir(s) Classes and Objects

Ganga Tutorial, April Start Ganga in text mode: % ganga -t >>> from Ganga.CLIP import * Job Objects and Job Registry j = Job() print j print j.application print j.backend print jobs print jobs[1] Ganga Scripting

Ganga Tutorial, April Jobs Job { status = 'new', name = '', stdout = None, stderr = None, directory = '/afs/cern.ch/user/k/kuba/myGangaJobs/Job ', exitcode = None, id = 7, application = Executable { outputfiles = [], inputfiles = [], parameters = [], exe = '/afs/cern.ch/user/k/kuba' }, backend = Local { id = None }

Ganga Tutorial, April j = Job() j.application.exe = '/bin/hostname' j.name = "MyTest" print j j.submit() print j.status print j.directory+'/output' ### open new terminal and inspect output % cat OUTPUTDIR/std.out Basic Job Submission

Ganga Tutorial, April for i in range(5): j = Job(exe="/bin/echo", parameters=["hello ",str(i)]) for j in jobs: print j.id, j.directory print j.submit() Jobs in a loop

Ganga Tutorial, April j = Job(application="DaVinci") print j j.submit() Default DaVinci Job Submission

Ganga Tutorial, April Questions? Practical exercises Questions?