Mobile Resource Guarantees for Grid Applications Stephen Gilmore Grids and Applied Language Theory Workshop National e-Science Centre 16th October 2003 Stephen Gilmore Mobile Resource Guarantees for Grid Applications — GALT’03 16th October 2003 3 Overview • The Mobile Resource Guarantees project has developed a framework for predicting resource consumption (space or time) of programs and expressing this as a proof about the program. – Proofs are unforgeable; – proof checking is easy even if proof generation is hard; – the properties in question are modest. • Potential applications of the MRG technology include global computing applications where users wish to protect against (potentially) harmful downloaded code and resource-sharing systems where service providers wish to optimise utilisation of high-performance systems. Stephen Gilmore Mobile Resource Guarantees for Grid Applications — GALT’03 16th October 2003 3 Resource-bounded mobile code Machine A Machine B proof checker source code program Resource policy r Code c with certificate p compiler resource typechecker Stephen Gilmore resource manager p ⇒c ` r virtual machine certificate generator Mobile Resource Guarantees for Grid Applications — GALT’03 Runs code c 16th October 2003 4 Sites and personnel LFCS, University of Edinburgh Ludwig-Maximilians-Universität, München David Aspinall, Stephen Gilmore, Don Sannella, Ian Stark Martin Hofmann (& Roberto Amadio) Lennart Beringer, Kenneth MacKenzie Michal Konečný, Alberto Momigliano Hans-Wolfgang Loidl, Olha Shkaravska Robert Atkey, Brian Campbell, Allan Clark, Panagiota Karadmitriou Laura Korte, Matthew Prowse, Nicholas Wolverson, . . . Steffen Jost, . . . Type systems for resource bounded programming and compilation (RESBND project) Stephen Gilmore Mobile Resource Guarantees for Grid Applications — GALT’03 16th October 2003 5 MRG technology • The MRG technology consists of programming languages; type systems for the languages; logics for expressing statements of resource consumption; and proof technology for proving these statements. – Camelot, a high-level functional programming language with objects and resource control; – Grail, a strongly-typed intermediate language which is the target language of the Camelot compiler and is interconvertible with Java byte code; – A cost model, a formal semantics for byte code execution which tracks execution time and space allocation; – A byte code logic allowing the expression of costs, embedded in a generic proof system (Isabelle). Stephen Gilmore Mobile Resource Guarantees for Grid Applications — GALT’03 16th October 2003 6 Camelot: functions with resource control (* A function to increment a list in-place *) let incList l = match l with [] -> [] | (h::t)@a -> (h + 1)::(incList t)@a (* A function to sum a list and de-allocate it *) let sumList l = match l with [] -> 0 | (h::t)@ -> h + (sumList t) Stephen Gilmore Mobile Resource Guarantees for Grid Applications — GALT’03 16th October 2003 7 Grail: analysable byte-code method public static int sumList (List l) = let fun f sumList(List l) = if l = null[List] then f 0() else f 1(l) (* Base case: the list is empty *) fun f 0() = 0 (* Step case: the list is non-empty *) fun f 1(List l) = let val h = getfield l <int List.hd> val t = getfield l <List List.tl> val () = invokestatic <void List.free (List)> (l) val res = invokestatic <int Lists2.sumList (List)> (t) in add h res end in f sumList(l) end Stephen Gilmore Mobile Resource Guarantees for Grid Applications — GALT’03 16th October 2003 8 MRG and e-Science: From Kilobytes to Petabytes • Camelot and Grail programs can run in very resource-constrained environments such as the KVM. What is the relevance to Grids? • Grid service providers need to schedule competing requests for access to resources. A specification language for resources exists (RSL) which could be an MRG compiler output. • The use of mobile code technology seems a good match for Grids. With 25Kb of code and 1Pb of sky survey data it is infeasible to ship the data to the code. • There are projects which have supported scientific programming in functional languages (e.g. Psicho). An alternative would be to transfer the MRGtechnology to Java or Java-like languages (ESC/Java, SpecialJ, and Pizza). Stephen Gilmore Mobile Resource Guarantees for Grid Applications — GALT’03 16th October 2003 9 Pointers RESBND Type Systems for Resource Bounded Programming and Compilation http://www.dcs.ed.ac.uk/home/resbnd/ MRG Mobile Resource Guarantees http://www.dcs.ed.ac.uk/home/mrg/ ReQueST Resource Quantification in e-Science Technologies http://homepages.inf.ed.ac.uk/stg/grants/REQUEST/ Stephen Gilmore Mobile Resource Guarantees for Grid Applications — GALT’03 16th October 2003