hanswurst

368 Reputation

4 Badges

15 years, 101 days

MaplePrimes Activity


These are answers submitted by hanswurst

Thank you for trying it on your machine. Unfortunately I have to stick with Maple12. 

(I still don't see the error in the procedure above...)

I found the following in the maple-help:

"The Threads package provides user level commands for using threads in Maple. Threads allow for multiple paths of execution to be running at the same time. This can allow Maple to perform a greater number of computations per second when running on a multi-core machine."
 

If I use the example from the help:
MAdd := proc (s, e, threadnum)
local n, i, j, out, blocks, section;
n := e-s+1; out := table(); section := floor(n/threadnum);
blocks := [s, seq(section*i+s, i = 1 .. threadnum-1), e+1]; Threads:-Wait(seq(Threads:-Create(add(j[i], j[i] = blocks[i] .. blocks[i+1]-1), out[i]), i = 1 .. threadnum));
add(out[i], i = 1 .. threadnum)
end proc

and then call it MAdd(1, 10^7, 2) then
1. it is much slower than MAdd(1, 10^7, 1)
2. it only uses 1 core all the time!

How do I use many cores?

However: the second possibility (b) seems to create many problems: is it possible that Maple has Problems with two threads which call the same procedure (and thus use the same local variables??)

thanks I will try that.

Thanks for your replies. 

Unfortunately I only posess Maple12 and the Maplets-solution is interesting but kind of too "fancy" :-)

I think I will go with the ordinary "printf"-Solution without deleting it.

That works, thanks!

I see, so if it display "22sec" it doesn't mean it really did take 22 sec in real life.

Another question: does Maple automatically enhance user-written procedures such that many cores are used?

using 'unassign' seems to work though...

Yes indeed, but in my case it's rather the following:

> res := 0;
> id := Create(somefunctioncall, res);

which produces the error 'Error, invalid input: too many and/or wrong type of arguments passed to Threads:-Create; first unused argument is 0'

So: I want to overwrite the variable (-name) 'res'
 

ah, I just figured out that you have to call it the way

id1:= Create( bar(param1), res1);

so that should do it.

However: is it true, that when I creat 4 Threads and I've got a 4-core-CPU then all cores will be used?

Thanks for the kind and fast response. But how do you use more than one Inequality? The implicitplot immediately tries to interpret the second inequality as parameter range...

Well, now I installed xemacs for Windows. How do I instsall the MapleV-Plugin?

ah, thanks! I'm new to the forums so excuse my not finding those threads :-(

ah, thanks a lot!

Thanks for all those responses.

The problem is: I'm trying to plot a List of Polygons using the (old?) PLOT3D command in the fashion "PLOT3D(op(mylist))". You cannot add parameters there like axes=normal etc.

1 2 Page 2 of 2