Feature request (was "parallel cell executing and wxmaxima")



Hello,

it seems to me that whenever some kind of parallelism is discussed then
only the highly complicated form of automated parallelism is considered.
While just providing some thread-primitives seems to me much simpler and
much more useful.

If I would implement something (but I don't :-(), then I would start with
something like implementing

evaluate_parallel(L),

where L is a list of expressions, to be evaluated independently,
while the return value is the list of evaluation results.
The variable
  max_cores
with default value 1 governs the number of threads to be created.
If max_cores=inf, then for every expression in L a thread is created.

This just assumes that there is no interaction between the different
computations. It is up to the user to make sure that this is the case.

This would be a simple starting point to experiment with threads.
If these can not be implemented with the existing Lisps, then my
intuitive feeling would be that everything else is hopeless.

After having the above simplest form, one could then consider

evaluate_parallel(L,V),

where V is a list of variables to be used for communication between
the threads (the above form has V = []): for these variables reads
and writes are guaranteed to be atomic, so that the different threads
can use them without the danger of undefined behaviour.
Perhaps only integer variables (or even just boolean) might be allowed here.

Such facilities, which could be further extended, would allow basic
thread-programming at Maxima level, and I would find that useful.
To start with, one could use it for teaching semaphores and the like.
And, of course, harder computations could exploit it.

It seems that such facilities would also solve the original problem,
that parallel execution of "cells" (don't know what that precisely is,
but I assume it can be represented as the evaluation of expressions):
the user "knows" (so well, that's life) what's in the cells, and thus
likely even the simple first form evaluate_parallel(L) would do the job.

Just to be helpful for those who want to implement something here for
Maxima.

Best

Oliver

On Sat, Jun 09, 2012 at 04:51:49PM -0400, Richard Hennessy wrote:
> My original post is a feature request.  There is nothing wrong with
> that.
> 
> -----Original Message----- From: Richard Hennessy Sent: Saturday,
> June 09, 2012 4:45 PM To: Richard Fateman ; Maxima List Subject: Re:
> [Maxima] parallel cell executing and wxmaxima
> 
> I think it should be done by someone who has experience with
> multi-core HPC's, like mainframes(, maybe.) They have been around
> for longer that multi-core PC's.   I don't have such experience,
> perhaps someone who does could step up. I don't think I could do it
> right.
> 
> Rich
>