Top Banner
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
21

Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al. OASIS Team INRIA -- CNRS - I3S.

Dec 26, 2015

Download

Documents

Julian Charles
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

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

Page 2: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale2

Introduction

Page 3: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale3

Introduction - Matlab

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

Page 4: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

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

Page 5: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

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

Page 6: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

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

Page 7: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

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

Page 8: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale8

ProActive context

Page 9: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

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)

Page 10: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale10

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

relationships • The Scheduler runs only one task

per node

Page 11: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

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>

Page 12: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale12

Scilab integration

Page 13: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale13

Scilab integration - Principles

• Integration with the ProActive Scheduler

• Schedule workflow of Scilab tasks

• Transfer results between tasks

Page 14: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale14

Scilab integration - Example

Page 15: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale15

Matlab integration

Page 16: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale16

Matlab integration - Principles

• Scilab extension functionalities

• Integration with the Matlab environment

Page 17: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

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 ]

Page 18: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale18

Matlab integration - API

• PAconnect(<scheduler-url>)

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

Page 19: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

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

Page 20: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

Fabien Viale20

Demonstration : application to finance

• Longstaff Schwarz method for American Put Option

• Pure matlab code (no financial toolkit)

Page 21: Fabien Viale 1 Matlab & Scilab Applications to Finance Fabien Viale, Denis Caromel, et al.  OASIS Team INRIA -- CNRS - I3S.

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 ?