py9mrg

45 Reputation

2 Badges

18 years, 319 days

MaplePrimes Activity


These are replies submitted by py9mrg

Brilliant, thanks very much!

Thank you very very much! Not only does the effect not happen anymore, but also one single cycle of my loop is now much faster than it was so my code is now running faster than it ever has. Sorry to be a pain, but.... I don't know what the subtleties of this garbage collection function are however, so I am wondering how far can I push this? I notice that when I use the command you kindly gave me the memory useage goes up quite alot. Which is fine by me considering my code is now much faster. As I understand it what you have done is to slow down the frequency that maple does it's garbage collection routine, which obviously increases the amount of memory it uses as there is more garbage lurking about? Does this mean that if I experiment with increasing it further my code will continue to get faster until I get to my RAM limit at which point I will be using my harddisk more and it will slow down again? In other words if I increase gcfreq until I am just inside my RAM limit then this will be the maximum possible speed I will be able to get my code to function by changing garbage collection? Thank you again for all your help.
Thank you very much for your help. I have tried your datatype suggestions but this doesn't make any difference, and the other things in the for loop take up such a small fraction of the computation time that they cannot be causing the problem either. It is definitely a little weird as yesterday I ran it identically to before and the effect did not happen. But then I tried it this morning and it was there again. I have gone through all my processes and performance and there is nothing stealing memory or cpu time, as well as the fact that the first time round the loop always goes at the speed it should, but only subsequent times take ages and then they each stay about a constant time as opposed to going up and down. It really confuses me as I can't see what is causing it. Still it might give me an excuse to order a new computer at work as maybe I am just getting too close to my RAM limit (although task manager says that I am not, and anyway each time round the loop should use the same amount of memory so it should be a problem the first time too) and it still seems to happen when I use my own computer at home which has double the memory as well. Thanks again.
Thank you very very much for that. It has speeded up those processes incredibly, and as a result my model now runs much much much faster than it did! Thank you again. Martyn
First of all thank you both very much for your input. Basically what I am trying to do is to combine four square matrices, usually, of order ~ 256x256 into one ~512x512 matrix (although sometimes I just need to stack two of these together, but in general I do the first thing). The reason for doing this is that I have written an optical modelling code that requires me to construct the initial smaller matrices which represent individual electric and magnetic field boundary conditions. I then want to do simple matrix operations on the resulting matrices, nothing particularly extreme just simple addition and multiplication as well as solving Ax=b using LinearSolve, in order to match these conditions. I have tried writing simple for loops that copy the individual [i,j] entries across into a pre-initialized larger matrix, although this is slightly quicker it still seems to take an inordinate amount of time. If there is a better way of combining them or if my calculations can be done without combining the matrices at all then that would certainly speed things up. My result would indeed only contain floating point numbers although as I mentioned they would definitely be complex and often beyond hardware precision and exponent. Thank you again, Martyn
Page 1 of 1