Ronan

827 Reputation

14 Badges

11 years, 207 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are replies submitted by Ronan

@acer  I am using an I7-7700 4.8Ghz 64G ram on Win10. Maple 2019.0. For some reason I can't upload the maple files so it is pdfs.

I am aware of the timing variations you mentioned.

threadthingm_10million.pdf

 

threadthingm_100million.pdf

I like Threads:-Seq because it is simple for me to understand.

 

@tomleslie Sorry for the delay in replying to you.

Attached is a pdf of the worksheet run for 100million. 430secs parallel.!!!!

Lately I cant seem to upload maple documents. Just get a failed message.

 

 

speedUP4-1.pdf

@TechnicalSupport 

A couple of potentially relevant points might be. Using microsoft edge and I have File history switched on.

@acer Well the computer is nearly 2 years old, an i7-7700 4 core 4.2Gh overclocked to 4.8Gh 

kernelopts(numcpus)   8

ssystem("processor full");              [-1, ""]

How did the example run for you? The point here is with a simpler calculation using smaller numbers (that don't require much if any on the arbitrary precision routines) oddly the parallel processing was slower. With much larger numbers parallel is  it is significently faster.


I have attached the worksheet with simplified calculation. Look for the #s at end of lines to see changes. 

#
# Using the fastest sequential code I cam up with
# with nelems=10000000. Takes about 55 secs on my
# machine
#
  restart;
  nelems := 10000000: #also test 100,000,000 i.e 10x bigger
  n := 700;#374894756873546859847556:
  op(n):
  A := Array(1 .. 4, 1 .. nelems):
  length(n):
  st := time[real]():
  A[1,1..nelems]:= Array([seq( i*n, i=1..nelems)]): #was i^10*n   now i*n
  A[2,1..nelems]:= Array([seq( length(A[1, i])-1, i=1..nelems)]):
  A[3,1..nelems]:= Array([seq(iquo(A[1,i], 10^(A[2, i]-2)),i=1..nelems)]):
  A[4,1..nelems]:= Array([seq(irem(A[1,i],1000),i=1..nelems)]):
  time[real]() - st;
  A:
  A[1, -2];
  A[2, -2];
  A[3, -2];
  A[4, -2];

700

 

15.767

 

6999999300

 

9

 

699

 

300

(1)

#
# Parallelize the above across four tasks, Takes about
# 23 secs on my machine, so a speed up of 2.5X on the
# above sequential code
#
  restart;
  nelems := 10000000:
  n := 700;#374894756873546859847556:
  op(n):
  length(n):
  st := time():
  doTask:=proc(sv, nv)
               local rng:=nv-sv+1,
                     B:=Array(1..4,1..nv-sv+1),
                     i :
               B[1,1..rng]:= Array([seq( (sv-1+i)*n, i=1..rng)]):# was (sv-1+i)^10*n  now  (sv-1+i)*n
               B[2,1..rng]:= Array([seq( length(B[1, i])-1, i=1..rng)]):
               B[3,1..rng]:= Array([seq(iquo(B[1,i], 10^(B[2, i]-2)),i=1..rng)]):
               B[4,1..rng]:= Array([seq(irem(B[1,i],1000),i=1..nv-sv+1)]):
               return B;
         end proc:
  time() - st;
  contTask:=proc( V,W,X,Y )
                  return copy(ArrayTools:-Concatenate(2, V, W, X, Y)):
           end proc:
                  
  setupTask:=proc(n)
                  Threads:-Task:-Continue
                  ( contTask,
                    Task=[doTask, 1, n/4 ],
                    Task=[doTask, n/4+1, n/2],
                    Task=[doTask, n/2+1, 3*n/4],
                    Task=[doTask, 3*n/4+1, n]
                  );
            end proc:

  st := time[real]():
  A:=Threads:-Task:-Start( setupTask, nelems):
  time[real]() - st;
  A[1, -2];
  A[2, -2];
  A[3, -2];
  A[4, -2];

 

700

 

0.

 

23.518

 

6999999300

 

9

 

699

 

300

(2)

interface(rtablesize=10);

[10, 10]

(3)

 


 

Download speedUP3_but.mw

@tomleslie 

@tomleslie Thank you. Very imperssive. I have run two sets of tests.

1st set

nelems 100,000,000

n=374894756873546859847556 

timings 

non parallel 1570secs

parallel 520secs

2nd test

nelems=100,000,000

n=700

and I simplified the major calculation to i*n instead of i^10*n

non parallel 392secs That shows how cpu intensive opreating on large numbers is.

parallel 705secs. That was a surprise. I tested it twice

Now I have never dealt with parallel code before. I see you break up n into 4 sections. So I would presume one has to tell the system what to parallel and pick that carefully. I will look in the programming guide to get some basic understanding.

 

 

@tomleslie That is much faster. Glad you could get rig of convert to string. checked times using time[real]() 1000,000 took<3secs.

100,000,000 just over 1500secs. Cpu is maixing out but most of that seems to be multiplying very large numbers. Reduced the size of numbers by setting n=7. and just i*n.  Cpu usage dropped to between 30-50% on 4 core i7. Have some sort of other bug where suddenly produces iquo 1/100 error. Will check that again tonight.

@Carl Love  Yes I am experimenting. I have never really bothered about the efficiency of data structures before, just wasn't an issue. From reading in the programming guide The understanding I have is that each time a set or list is added too, it is copied, so uses more memory an time. It my case I only have one of each element no repetitions so sets seemed a good choice. The Mutable sets because the data structure is not copied when adding new elements. Due to the bug in Mutable sets I moved to arrays. These seem good but you have to sort them to get the elements in order, all positive integers btw. Some of the arrays have grown to millions of elements. I also use lists when generating the difference between each successive element because a) there are repetitions and b) one of your answers at the weekend used ListTools:-PartialSum. Interestingly these difference lists do not get extended once they are made.
 In all cases when I am extending an Array (or set/list) the extended version is given a seperate name.

I do welcome your suggestions.

 

 

@Joe Riel Apart from testing in the next release/service pack, does Maple publish a list of bug fixes? For example as I use Solidworks, with every service pack a list of bug fixes is posted on the website.

@Joe Riel I was not aware of these. Could save me a lot of inefficiency as I am not expert in programming techniques.

@Carl Love That is certainly concise. works very well. Could this type of method be used to to apply the elements of a list to a single number as I have done below? 
 

restart

GRP5 := [12, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 2, 4, 6, 2, 10, 2, 4, 2, 12, 10, 2, 4, 2, 4, 6, 2, 6, 4, 6, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 6, 8, 6, 10, 2, 4, 6, 2, 6, 6, 4, 2, 4, 6, 2, 6, 4, 2, 6, 10, 2, 10, 2, 4, 2, 4, 6, 8, 4, 2, 4, 12, 2, 6, 4, 2, 6, 4, 6, 12, 2, 4, 2, 4, 8, 6, 4, 6, 2, 4, 6, 2, 6, 10, 2, 4, 6, 2, 6, 4, 2, 4, 2, 10, 2, 10, 2, 4, 6, 6, 2, 6, 6, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 6, 4, 8, 6, 4, 6, 2, 4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 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 12, 6, 4, 6, 2, 4, 6, 2, 12, 4, 2, 4, 8, 6, 4, 2, 4, 2, 10, 2, 10, 6, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 10, 6, 8, 6, 4, 2, 4, 8, 6, 4, 6, 2, 4, 6, 2, 6, 6, 6, 4, 6, 2, 6, 4, 2, 4, 2, 10, 12, 2, 4, 2, 10, 2, 6, 4, 2, 4, 6, 6, 2, 10, 2, 6, 4, 14, 4, 2, 4, 2, 4, 8, 6, 4, 6, 2, 4, 6, 2, 6, 6, 4, 2, 4, 6, 2, 6, 4, 2, 4, 12]

(1)

S := {13}; sn := 0; for i in GRP5 do sn := sn+i; S := `union`(S, {13+13*sn}) end do; S

{13, 169, 221, 247, 299, 377, 403, 481, 533, 559, 611, 689, 767, 793, 871, 923, 949, 1027, 1079, 1157, 1261, 1313, 1339, 1391, 1417, 1469, 1651, 1703, 1781, 1807, 1937, 1963, 2041, 2119, 2171, 2197, 2249, 2327, 2353, 2483, 2509, 2561, 2587, 2743, 2873, 2899, 2951, 2977, 3029, 3107, 3133, 3211, 3263, 3341, 3419, 3497, 3523, 3601, 3653, 3679, 3757, 3809, 3887, 3991, 4043, 4069, 4121, 4199, 4303, 4381, 4511, 4537, 4589, 4667, 4693, 4771, 4849, 4901, 4927, 4979, 5057, 5083, 5161, 5213, 5239, 5317, 5447, 5473, 5603, 5629, 5681, 5707, 5759, 5837, 5941, 5993, 6019, 6071, 6227, 6253, 6331, 6383, 6409, 6487, 6539, 6617, 6773, 6799, 6851, 6877, 6929, 7033, 7111, 7163, 7241, 7267, 7319, 7397, 7423, 7501, 7631, 7657, 7709, 7787, 7813, 7891, 7943, 7969, 8021, 8047, 8177, 8203, 8333, 8359, 8411, 8489, 8567, 8593, 8671, 8749, 8801, 8879, 8957, 8983, 9061, 9113, 9139, 9217, 9269, 9347, 9451, 9503, 9529, 9607, 9659, 9763, 9841, 9893, 9971, 9997, 10049, 10127, 10231, 10309, 10361, 10387, 10517, 10543, 10621, 10673, 10699, 10751, 10777, 10907, 10933, 11063, 11089, 11141, 11167, 11219, 11323, 11401, 11453, 11479, 11531, 11609, 11687, 11713, 11791, 11843, 11947, 11999, 12077, 12181, 12233, 12259, 12311, 12337, 12389, 12493, 12571, 12623, 12701, 12779, 12857, 12883, 12961, 13039, 13091, 13117, 13169, 13247, 13273, 13351, 13403, 13429, 13481, 13507, 13637, 13663, 13793, 13819, 13897, 13949, 14027, 14053, 14131, 14183, 14209, 14261, 14339, 14417, 14521, 14573, 14599, 14677, 14807, 14911, 14963, 14989, 15041, 15067, 15119, 15223, 15353, 15431, 15457, 15509, 15613, 15691, 15769, 15821, 15847, 15899, 15977, 16003, 16081, 16133, 16211, 16237, 16367, 16393, 16523, 16549, 16601, 16627, 16679, 16757, 16783, 16861, 16913, 16939, 16991, 17069, 17147, 17173, 17251, 17329, 17407, 17459, 17537, 17641, 17693, 17719, 17771, 17797, 17849, 17953, 18031, 18083, 18187, 18239, 18317, 18343, 18421, 18499, 18551, 18577, 18629, 18707, 18811, 18863, 18889, 18941, 18967, 19097, 19123, 19253, 19279, 19331, 19357, 19409, 19487, 19513, 19643, 19669, 19721, 19799, 19903, 19981, 20033, 20059, 20137, 20189, 20267, 20371, 20423, 20501, 20527, 20579, 20683, 20761, 20813, 20891, 20917, 20969, 21047, 21073, 21151, 21229, 21281, 21359, 21437, 21463, 21541, 21619, 21671, 21697, 21827, 21853, 21983, 22009, 22061, 22087, 22139, 22217, 22243, 22321, 22373, 22399, 22529, 22607, 22633, 22711, 22763, 22789, 22867, 22919, 22997, 23101, 23153, 23179, 23231, 23257, 23413, 23491, 23543, 23621, 23647, 23699, 23777, 23803, 23959, 24011, 24037, 24089, 24193, 24271, 24323, 24349, 24401, 24427, 24557, 24583, 24713, 24791, 24817, 24869, 24947, 24973, 25051, 25103, 25129, 25181, 25259, 25337, 25363, 25441, 25493, 25519, 25649, 25727, 25831, 25909, 25961, 25987, 26039, 26143, 26221, 26273, 26351, 26377, 26429, 26507, 26533, 26611, 26689, 26767, 26819, 26897, 26923, 27001, 27053, 27079, 27131, 27157, 27287, 27443, 27469, 27521, 27547, 27677, 27703, 27781, 27833, 27859, 27911, 27989, 28067, 28093, 28223, 28249, 28327, 28379, 28561, 28613, 28639, 28691, 28717, 28769, 28873, 28951, 29003, 29081, 29107, 29159, 29237, 29263, 29341, 29419, 29471, 29497, 29549, 29627, 29653, 29731, 29783, 29809, 29861, 30017}
``

(2)

``


 

Download difference_table.mw

@Kitonum  That is basicially what I started off with. you code is far neater than so nice to learn a new way. Actually what the code is really about behind the scene is predicting Sterling numbers.

 Yes, there was I question I was going  answer too. It involved Laplace transforms. Possibly it was  youself, and another that answered before me so I didn't post. I don't often get to post answers. I was going to ask you how you debugged it. I found the issue myself too but wanted to know better ways of zeroing in on the problem. Also out of curiosity using Groebnier Basis, there was a more extensive solution that produced all the real solutions. Was going to post the next day but gone!

Maybe if a question is answered the poster unless they have some level of status should not be able to delete it without appealing to an administrator.


The new context panel is a great idea along with the plot builder.

There are some improvements that would make this really great.

Plot Builder needs to remember it’s settings. If the document is re executed the plot comes up empty and all settings are lost.

It would be good to combine Explore with Plot Builder so if you have functions like y=a x^2+b x +c you could set sliders for a,b,c.  The old plot builder (upto 2016) had this function.

At present Explore disappears when the document is re executed

First 8 9 10 11 12 13 14 Last Page 10 of 20