- Hello ,

I have created a program that computes a

(rather complicated) function f defined over

the integers. I noticed that when trying to

compute the values of f(i) for i=1 to N (say)

ocaml does it more quickly if we open several

sessions and in each we ask ocaml to compute

f(i) for i in interval I_k, where we have

partitioned [1,N] into several intervals I_k,

rather than asking him directly to compute

f(i) for i in [1,N].

Now is there a way to make this division

directly in just one session without having

to repeat the same instruction several times ?

thanks in advance for any kind of help.

Ewan

______________________________________________________________________

Yahoo! Mail: 6MB, anti-spam e antivĂrus gratuito! Crie sua conta agora:

http://mail.yahoo.com.br - On Tue, Nov 18, 2003 at 03:42:06AM -0300, Marco Pedeira wrote:
>

Very odd.

> Hello ,

>

> I have created a program that computes a

> (rather complicated) function f defined over

> the integers. I noticed that when trying to

> compute the values of f(i) for i=1 to N (say)

> ocaml does it more quickly if we open several

> sessions and in each we ask ocaml to compute

> f(i) for i in interval I_k, where we have

> partitioned [1,N] into several intervals I_k,

> rather than asking him directly to compute

> f(i) for i in [1,N].

> Now is there a way to make this division

> directly in just one session without having

> to repeat the same instruction several times ?

> thanks in advance for any kind of help.

Is it an SMP machine? Each subtask might be being assigned to separate

processors when you run them individually.

Is the machine swapping during the calculation? (Try 'vmstat 1' and

have a look at the si/so fields).

Anyway, it sounds like you need to be using threads.

Rich.

--

Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj

Merjis Ltd. http://www.merjis.com/ - improving website return on investment

MAKE+ is a sane replacement for GNU autoconf/automake. One script compiles,

RPMs, pkgs etc. Linux, BSD, Solaris. http://www.annexia.org/freeware/makeplus/