Carl Love

Carl Love

28055 Reputation

25 Badges

13 years, 3 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

If Acer's Answer solves your problem, great. If not, tell me the size of your worksheet (the saved .mw file) in bytes.

@pake Adding 100,000 integers is still too small a task. Use 10 million integers. Also, the number of tasks that can actually be run in parallel (that is, running at exactly the same time) is processor dependent and given by kernelopts(numcpus). It's likely to be 1, 2, 4, or 8. It's not a problem if you ask for more tasks in parallel; the operating system handles the scheduling. But this will limit your speedup-factor expectation. If your numcpus is 1, there's no practical point in trying parallel processing, although measuring the slowdown factor that it causes is still interesting.

Since you think that the task size is irrelevant, I suggest that you measure the overhead by making your addproc a procedure that does nothing:

addproc:= proc() end proc;

@pake The computer's processor (or chip) model is more important than the operating system, in particular the number of "cores". Use the Maple command kernelopts(numcpus) to see how many simultaneous threads can run on each of your computers.

Also, as pointed out in the Answer below, your basic task of adding the integers from 1 to 1000 is much too small for this test. Change that to about 10,000,000 and reduce the number of iterations of the outer loops.

@vv Your solution leads to the very unusual situation that the definition of a module procedure depends on a global variable and if that global variable changes---even after the module is loaded---then the module export will change. It's not a bug per se, but I think that it's bug prone.

@vv But the divisors of a^b can be easily determined from the divisors of a.

@taro You should think of LL as a matrix which contains only the z-values. So, there are 12 z-values laid out in a 3 x 4 grid.

@Mitterrand Perhaps there is a bug with the limits in your version of Maple which has subsequently been corrected? If I re-execute your worksheet, I don't get 0. I get the same result as shown by Kitonum below.

@Kitonum Why gpwr:= gpwr*(g mod p) rather than the original gpwr:= gpwr*g mod p? I think that the original is correct.

@Jjjones98 It is common for respondents on MaplePrimes to end their example commands with semicolons because that used to be required for single-command input. These terminal semicolons are not parts of the commands and are not meant to be included when those commands are used as subexpressions in other expressions. So, remove the internal semicolon.

@Jjjones98 But vv's is a procedure, not a direct command.

@Kitonum I didn't mean to give the impression that one couldn't animate a plot3d. However, it was pretty clear to me that the OP wanted a 2D animation. This is afterall the equation of a wave moving through a one-dimensional object, a string.

@st0812 You can export a Maple worksheets as a PDF. Use "Export as" from the File menu. This will include the code, text, results, and graphics, and it'll be viewable by anyone, regardless of whether they have Maple.

@st0812 To animate that, change plot3d to plot.

@rstellian Here's another way, which I like better because it makes it clear that you're trying to pad x with leading zeros so that it's the same length as X:

scm:= (X::posint, x::posint)-> nprintf("%0*d", length(X), x):

Also, I changed ilog10 to length in the Answer above.

@Preben Alsholm The button only appears on posts (questions, answers, replies) that have no responses and whose authors have 10 or fewer reputation points. It has always been that way, ever since the spam button has existed.

First 344 345 346 347 348 349 350 Last Page 346 of 709