emendes

465 Reputation

6 Badges

8 years, 239 days

MaplePrimes Activity


These are replies submitted by emendes

@Carl Love Is solve threadsafe?  

@Carl Love As you said in one of earlier posts solve is not threadsafe so the use of Grid.   

I had to change Threads:-Map[2] to map2 to get the code working.  Somehow Threads:-Map won't work after Grid:Seq.   

 

@Carl Love Somehow the first line of the code gets stuck after the use of Grid:-Seq.   It works if I save L1 and L2 to a m-file and run the two lines of code in a new worksheet.  

@Carl Love Thanks.  Does creating another variable, T1,  cause memory issues?   

@nm Thanks.  I've already tried that but it does not make much difference when searching huge lists.   

@Joe Riel Many thanks.

@Joe Riel Thank you.   Please help me out. Somehow I always use list in my procedures.  Since the procedure shown above is used after a series of calculations, would the use of array still be recommended?   Converting from one type to another type is time and memory consuming, right?   

@acer Many thanks.  They seem to pretty fast. I will do some testing and will let you know.  

@acer Many thanks for pointing them out.   They both work for me.   My question is: would they cope with a list of 80 million elements?  

 

I have just checked both commands using a list of 500,000 elements and they are pretty fast.  

@acer Thanks.  I mean the size of the partition is fixed for all partitions, except for possibly the last one.  In the original code chunk was misspelled in all instances and the code works.  

@Carl Love Many thanks.  Although nchunk is the size of the partition, your solution works for me too.  

@acer Many thanks.   I should have thought of that but I didn't.  I hope they fix that in the next version of the manual.  

@nm Many thanks.   In the question above I did miss the first double quotes but unfortunately, I didn't miss them in the command line so the question still stands.  

 

@Carl Love Many thanks.  I guess I won't be able to use Thread since proc1 uses basically solve

Where do I find that a Maple command is threadsafe?   

My problem:

for n from 5 to 7 from 1 do
   ans:=CodeTools:-Usage([Threads:-Seq(proc1(arg1[i],arg2,arg3,arg4)),i=1..nops(arg1))])
   .....
   arg1:=...
end do:

Only arg1 changes.

The loop only works for n=5 (first value).   On the second iteration, Maple returns an error msg.

Error, (in priqueue:-extract) mismatched multiple assignment of 2 variables on the left side and 1 values on the right side

 

 

@Carl Love Thank you.   Indeed it is faster than the previous version.   

First 7 8 9 10 11 12 13 Last Page 9 of 21