[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: data structure for simulation

From: Francesco Potorti`
Subject: Re: data structure for simulation
Date: Wed, 18 Mar 2009 15:37:19 +0100

>> The general problem is that I am trying to find a good and simple way to
>> use a cluster for Montecarlo simulation.  Ideally, I'd like to do that
>> from inside Octave, without resorting to an external program like a bash
>> script.
>Maybe I can help with that. I have a function of the form
># montecarlo.m: generates a specified number of replications of a function's
>output and
># writes them to a user-specified output file.
># USAGE: montecarlo(f, f_args, reps, outfile, nslaves, n_pooled,  n_returns,
># IMPORTANT: f should return a row vector of output from feval(f,f_args)
># For normal evaluation on one machine, only the first 4 arguments are
># * Arg 1: (required) the function that generates a row vector of output
># * Arg 2: (required) the arguments of the function, in a cell
># * Arg 3: (required) the number of replications to generate
># * Arg 4: (required) the output file name
># * Arg 5: (optional) number of compute nodes for parallel runs
># * Arg 6 (optional) number of replications to be pooled together before
>they are sent
># back to the master node.
># * Arg 7 (optional) the number of columns of the output returned by f. When
>f is very costly
># to evaluate, use this to get a parallel run started immediately. Otherwise
>single run must
># be finished before the size is determined. This is bad, since many nodes
>will be idle.
># * Arg 8 (optional) verbose: 1 for on, 0 for off
># * Arg 9 (optional) 0/1 switch controlling debug mode, off by default.
>This will Monte Carlo any function that takes arguments as a cell, and
>writes output as a row vector. I think that in most cases a wrapper can be
>written to satisfy this requirement. To do this in parallel, you must have
>MPITB installed. I can provide more details if you're interested.

That would be very good, more than I expected :)

To be true, when I had written "simple" I meant that no recompilation of
Octave was needed, and no fiddling with external libraries :(

The fact is, Montecarlo is a very particular and simple case of parallel
execution, which could be done by using Octave's popen command, fread,
fwrite and little else, all in a .m file without the help of external
libraries, taking Juroslav's parcellfun as a starting point.  If I am
not oversimplifying things...

Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]