400 Reputation

6 Badges

7 years, 266 days

MaplePrimes Activity

These are replies submitted by emendes

My wish has to do with Grid and Threads packages:

1) Efficient usage of memory -   Once a grid command finishes the memory allocated should return to Maple (I am not sure whether this is possible or not). There is a post in the list showing that, in some calculations using Grid, Maple hangs for no apparent reason.

2) A clear explanation in the help files (examples) on which variables should be Grid:-Set and which don't.  (Although I have received help from tops users on the list and from maple support, the answers are not the same in some cases).

3) CodeTools:-ThreadSafetyCheck - Some of the functions that are threadsafe checked by this command causes Maple to hang.  Is the list of threadsafe functions updated?  

@Kitonum Many thanks.   I can't believe I have missed allsolutions.   

@nm Many thanks.   The problem I am experiencing is definitely very similar to what you have described but there is a twist.  In my case, even though I left the job running overnight, maple did not move to the next iteration.  Perhaps I will have to wait longer to see if Maple goes to the next iteration, but I don't have the patience.  I wrote the code having in mind this issue, so it is very easy for me to kill the job and restart it from where it stopped.    

Another issue that bothers me is Grid memory demand.  From one iteration to the next, Grid does not seem to release the memory used in the previous iteration and demands probably the same amount of memory on top of the used one. That forces me to again kill the job and restart it from where it stopped. 


@nm and @Carl Love I have a similar problem when I use Grid with timelimit to be sure that Maple won't get stuck in any of the calculations.   Somehow Maple hangs in one of the loop iterations without any warning (all 36 cpus go from 100% to 0% and the allocated memory sits there until I kill the job - I am using the command line instead of the usual interface).   If the job starts from scratch there is a good chance that Maple will hang at the same point (the job takes two or three days to finish so I cannot be 100% sure).  Fortunately, the job can be started from the previous iteration and, when it does  Maple won't hang at the same point. 

Maple 2020.1 on Linux (with plenty of memory left).   

@Carl Love Many many thanks.  Thanks to you and @acer the part of try-catch in my code is working as intended (and much faster).   However, I am still struggling with Grid demands for memory.  

@acer Many thanks.  I think I have now a better understanding of how to use try-catch

@Carl Love Many many thanks.  I wasn't sure of when finally should be used.  Now I know that I didn't need it at all.   Thanks.   

Would catch: #any other error be the answer for the errors I mentioned in my answer to @acer?  

Just to be sure, if I have the following sequence of commands

  .... #line 1
  .... #line2
  .... #line3 

  ... #line4
end try:

1) If there is an error, catch will caught it, right?  

2) If there is an error in line 2 for instance, all commands in line3 to line 4 will not be evaluated, right? 

If the answer is yes to both questions, I am making things more complicated than they are. 


@acer Thank you for the clear explanation.   I am trying to follow all suggestions given in your reply.  

Please bear with me a little longer.  Could you send some examples of what you meant by "one or more flags, ...,  etc.", please? 

Although I have added more catchStrings to catch

catch "time expired", "does not exist", "invalid input":

some errors were not caught: 

Error, (in PolynomialSystemSolvers:-PseudoResultant) at offset 3101 in `RootOf.m`, time expired

Error, (in SolveTools:-MakeSolutions) at offset 3 in `:-40706.m`, time expired


I guess that answers your question, that is,  the error message upon time-out does not always begin with "time expired".  How to deal with it?  



@Carl Love You are right.  Thanks.   Last question: infolevel[Grid:Seq]:=3:  shows quite a few messages but infolevel[Threads-Seq]:=3 does not.  What am I missing?  

@Carl Love Many thanks for the clear explanation.  

Unfortunately, Threads does not work after Grid in the examples I am running (I will try the option of saving the results to a file and call the procedure in a separate mpl-file).  As for Grid I need some help. If I change seq to Grid:-Seq in both cases, Maple issues an error msg.  If I change the internal seq, memory goes up to the roof.  



@Carl Love Many many thanks. I wonder if you could spare some time to explain the procedures.  

  1. Why do I need [seq]?  (The brackets ?)
  2. local _?  
  3. ^+?  

Can Threads or Grid be used here?   As you know I have problems using Threads after Grid (Maple keeps evaluating forever).   I had to use Grid before using the procedures given above (PolynomialSystem is part of the previous calculation).  


@Carl Love Many thanks. I made a mistake and there is no case where the commands above don't give me the same results.

Thanks for the newbie tip.  

It is a pity that Threads cannot be used in this case.  Grid demands for memory are amazing.  

@Carl Love Many thanks.  I don't remember why I had to go for the more elaborate version, but I will certainly test has. Do you have an idea on how to find the number of solutions?  

has as pointed out is too restrictive.  I had to go back and use ormap.




@Carl Love Thanks.  I will do that and check if there is any change as far as memory usage is concerned.  I wish Maple could give us detailed documentation (with more examples) on Grid.  

@Carl Love If that is the case, should I issue Grid:-Set(arg1) just once?  How about the Grid-Set for the other arguments?  I started by not using Grid-Set for any of the arguments.   My impression that once you call Grid-Seq, Maple will allocate the memory anyway (I could be completely mistaken).   

4 5 6 7 8 9 10 Last Page 6 of 19