Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al. OASIS...

21
Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al. http://ProActive.ObjectWeb.org OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis, IUF 1. Introduction / Principles 2. ProActive context 3. Scilab integration 4. Matlab integration 5. Application to Finance

Transcript of Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al. OASIS...

Fabien Viale1

Matlab & ScilabApplications to Finance

Fabien Viale, Denis Caromel, et al.http://ProActive.ObjectWeb.org

OASIS TeamINRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis, IUF

1. Introduction / Principles2. ProActive context3. Scilab integration4. Matlab integration5. Application to Finance

Fabien Viale2

Introduction

Fabien Viale3

Introduction - Matlab

• Leading numerical computing environment• Used by more than one million people• Interactive mathematical shell => Matlab Language• Expensive

Fabien Viale4

Introduction - Scilab

• Open source alternative to Matlab• Used by many industrial and research projects• Interactive mathematical shell => similar syntax with Matlab, not

100% compatible.• Free

Fabien Viale5

Introduction - ProActive

• Open source middleware for the Grid• Used by many industrial and research projects• Powerful and standardized (ETSI) deployment framework• Tools for the grid : Scheduler, Resource Manager, IC2D Monitoring,

Timit

Fabien Viale6

Introduction – State of the Art (quick)

Name Licence type

Parameters , return values , user function

definition

Type of jobs Deployment Notes

Matlab // computing toolbox

Proprietary Any matlab Coarse grained + MPI + Data //

LSF, PBS, Torque, SGE

Requires NFS for I/O

Star P Proprietary Any matlab Coarse grained + Data //

Requires NFS for I/O

Paralize Open source Numeric/string arrays , built-in

only

Coarse grained Client / Server Uses NFS for cummunication

PLab Open source Any matlab Coarse grained One level rsh or ssh

dormant

Only one //Scilab : Scilab PVM

Fabien Viale7

Introduction - Motivations & Challenges

• Motivations :– Use grid infrastructure as resources for Matlab & Scilab

– Allow users to remain in their familiar environment

– Easily run Matlab & Scilab code in parallel

– Seamless retrieval of results

• Challenges :– Heterogeneous environment

– Matlab not open source

– Non-extensive list of features in Scilab

Fabien Viale8

ProActive context

Fabien Viale9

Scheduler – Resource ManagerScheduler :

• controls user access ; task submission, results retrieval.• Manages jobs pending queue.• Manages job’s workflow.

Resource Manager :

• Deploys and monitor resources (nodes)• Make nodes available for the scheduler (with resource selection)

Fabien Viale10

Jobs & tasks• A job contains several tasks• Tasks can have dependency

relationships • The Scheduler runs only one task

per node

Fabien Viale11

Introduction – Job definition<?xml version="1.0" encoding="UTF-8"?> <job xmlns="urn:proactive:jobdescriptor:0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:proactive:jobdescriptor:0.9 http://proactive.inria.fr/schemas/jobdescriptor/0.9/schedulerjob.xsd" name="job_nativ" priority="normal" logFile="${EXEC_PATH}/nativTask.log"> <description>Will execute 2 native C tasks</description> <variables> <variable name="EXEC_PATH" value="[working_dir]"/> </variables> <taskFlow> <task name="task1" preciousResult="true"> <description>Will display 10 dots every 1s</description> <nativeExecutable> <staticCommand value="${EXEC_PATH}/nativTask"> <arguments> <argument value="1"/> </arguments> </staticCommand> </nativeExecutable> </task> <task name="task2" preciousResult="true"> <description>Will display 10 dots every 2s</description> <depends> <task ref="task1"/> </depends> <nativeExecutable> <staticCommand value="${EXEC_PATH}/nativTask"> <arguments> <argument value="2"/> </arguments> </staticCommand> </nativeExecutable> </task> </taskFlow> </job>

Fabien Viale12

Scilab integration

Fabien Viale13

Scilab integration - Principles

• Integration with the ProActive Scheduler

• Schedule workflow of Scilab tasks

• Transfer results between tasks

Fabien Viale14

Scilab integration - Example

Fabien Viale15

Matlab integration

Fabien Viale16

Matlab integration - Principles

• Scilab extension functionalities

• Integration with the Matlab environment

Fabien Viale17

How does it work ?

Proxy

Scheduler

Resource

ManagerCluster

Desktop

Nodes

Nodes

login

deploy

> PAsolve({arg1..argn}, @myfunc)

Convert to textual / submit job

Select resources

Create engines

Matlab

Run tasks

Receive results

ans = [ 1 2.354 0 7 ]

Fabien Viale18

Matlab integration - API

• PAconnect(<scheduler-url>)

• PAsolve({arg1, … argn}, @function, [‘-debug’])

Fabien Viale19

Introduction – State of the Art (quick)

Name Licence type

Parameters , return values , user function

definition

Type of jobs Deployment Notes

Matlab // computing toolbox

Proprietary Any matlab Coarse grained + MPI + Data //

LSF, PBS, Torque, SGE

Requires NFS for I/O

Star P Proprietary Any matlab Coarse grained + Data //

Requires NFS for I/O

Paralize Open source Numeric/string arrays , built-in

only

Coarse grained Client / Server Uses NFS for cummunication

PLab Open source Any matlab Coarse grained One level rsh or ssh, without

password

dormant

ProActive Open source Any matlab Coarse grained LSF, PBS, SGE, RSH,

SSH, Bridges

Requires NFS for I/O

Fabien Viale20

Demonstration : application to finance

• Longstaff Schwarz method for American Put Option

• Pure matlab code (no financial toolkit)

Fabien Viale21

Conclusion / Future Work

• For Scilab, integration with the ProActive Scheduler, useful for doing batch jobs– Lacks a complete integration with Scilab

• For Matlab, an easy to use/configure Parallel Matlab toolkit– Dependant on NFS => Automatic File Transfer

– Automatic licencing control

– Only for coarse-grained problems => SPMD extension

– Blocks Matlab execution => Asynchronous PAsolve

• Questions ?