GFAL Grid File Access Library Annamaria Muoio INFN Catania I Corso di formazione INFN su aspetti pratici dell'integrazione di applicazioni in GRID Martina Franca, 13/11/2007 www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 1 http://grid.infn.it/ SUMMARY • This presentation covers the following points: – – – – – – – GFAL Overview GFAL Available APIs GFAL C API Overview GFAL Java API Overview GFAL C API Practical (hands on session) GFAL Java API Practical (hands on session) GFAL References. www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 2 http://grid.infn.it/ GFAL: Introduction • What is GFAL? – It stands for Grid File Access Library! – Grid storage interactions today require using some existing software components: – The file catalog services to locate valid replicas of files in order to • Download them to the user local machine • Copy them from a SE to another one • Make job running on the worker node able to access and manage files stored on remote storage element. – The SRM to ensure: • Files existence on disk or disk pool (they are recalled from mass storage if necessary) • Space allocation on disk for new files (they are possibly migrated to mass storage later) www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 3 http://grid.infn.it/ GFAL: Main features • The GFAL Features – Hides interactions to the SRM to the end user – Provides a Posix-like interface for File I/O Operation – Based on shared libraries (both threaded e unthreaded version) – Needs only one header file (gfal_api.h) to write C applications – Supports following protocols : file for local access nfs-like dcap, gsidcap and kdcap for dCache access protocol rfio for CASTOR/DPM access protocol. – Access to SRMs in secure mode, i.e. using a valid Grid proxy obtained by voms-proxy-init command. www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 4 http://grid.infn.it/ GFAL: File Names • GFAL works with all Grid types name: – Logical File Name (LFN) lfn:baud/testgfal15 – Grid Unique IDentifier (GUID) guid:2cd59291-7ae7-4778-af6d-b1f423719441 – File Replica (SURL) srm://wacdr002d.cern.ch:8443/castor/cern.ch/user/b/baud/testgf al – Transport file name (TURL). rfio:////castor/cern.ch/user/b/baud/testgfal15 www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 5 http://grid.infn.it/ GFAL: Environment • Auxiliary linked libraries – – – – libcgsi_plugin_gsoap_2.3 libglobus_gss api_gsi_gcc32dbg libglobus_gss_assist_gcc32dbg. • Environment Variables – – – – – – LCG_GFAL_VO LCG_GFAL_INFOSYS LCG_CATALOG_TYPE LCG_RFIO_TYPE LFC_HOST LD_LIBRARY_PATH www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 6 http://grid.infn.it/ GFAL: Available API • C API – The header file gfal_api.h needs to be included in the application source code to get the prototype of the functions. – The function names are obtained by prepending gfal_ to the Posix names, for example gfal_open, gfal_read, gfal_close ... – The argument lists and the values returned by the functions are identical. – The variable errno is set to the Posix Error Codes in the case of failure. www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 7 http://grid.infn.it/ GFAL: Available API • Java API (C API Wrapper) – It provides three main Java Objects that need to be imported in the java applications in order to hide the underlying C functions. GFalFile : to handle and read/write files GFalDirectory : to handle and manage directories (create, delete, list) GFalUtilities : to manage file (rename, stat, lstat, delete) www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 8 http://grid.infn.it/ GFAL Java API • GFAL API are available for C/C++ programmers • We wrote a wrapper around the C APIs using Java Native Interface and a the Java APIs on top of it • More information can be found here: www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 9 http://grid.infn.it/ GFAL References • Examples in gLite3 User Guide (Appendix F) – https://edms.cern.ch/file/722398//gLite-3-UserGuide.pdf • GFAL C API Description: – http://grid-deployment.web.cern.ch/griddeployment/documentation/LFC_DPM/gfal/html/ www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 10 http://grid.infn.it/ www.ccr.infn.it Evento, Luogo, Data odierna - 11 http://grid.infn.it/ Hands on http://repository.gs.ba.infn.it/twiki/bin/view/GILDA/APIGFAL http://repository.gs.ba.infn.it/twiki/bin/view/GILDA/APICGFAL http://repository.gs.ba.infn.it/twiki/bin/view/GILDA/UsingGFAL www.ccr.infn.it I Corso di formazione INFN su aspetti pratici dell'integrazione, Martina Franca, 13/11/2007 - 12 http://grid.infn.it/