topic Re: Programming parallel in PTC Mathcad
https://community.ptc.com/t5/PTC-Mathcad/Programming-parallel/m-p/243676#M94960
<HTML><HEAD></HEAD><BODY><P>Mathcad does not support parallel processing.</P><P></P><P>Your worksheet is very inefficient though, and you could speed it up a lot.</P><P></P><P>First, when you call Vectorincog0 you create a 10,000,000 element matrix, RefleEEK1S. Then when you call Vectorincog1 you create another 10,000,000 element matrix, RefleEHK1S. You do this 8 times in all, which means you are sucking up a huge amount of memory. This is not necessary, because these huge matrices are just intermediate results. All you get from them is the sums of the columns, and then you don't need them any more. If you put the summations inside the programs then when the program exits the memory for the matrices will be freed.</P><P></P><P>You can also speed up the operation where you first subtract two of the matrices, and then sum the columns. You already summed the columns. So split out the multiplcation step when you do those sums, and then replace the matrix sum with a vector sum (this will of course be necessary if you move the sums to within the programs)</P><P></P><P>Second, each program calls lsolve 10,000,000 times. You do this 8 times, but the call is exactly the same every time! Call it once, not 8 times, and create the solution matrices. Then just access the matrces. Your programs also call some combination of the functions ke, kh, fhm and fem 10,000,000 times (in some cases they call the same function twice, with the same arguments!), and the identical calls are repeated in more than one program. Call them once each and create matrices of the solutions, then access the matrices. If you call all of these functions only once, rather then multiple times (especially lsolve) you should get a huge speed improvement.</P><P></P><P>My inclination would be to create one program that creates all 8 vectors. Then when the program exits the memory used to store the lsolve, ke, kh, fhm, and fem matrices will be freed. If you do that then do not create different matrices, RefleEEK1S, RefleEHK1S, etc inside the program. Create only one matrix, and overwrite it.</P></BODY></HTML>Wed, 01 Dec 2010 20:01:13 GMTRichardJ2010-12-01T20:01:13ZProgramming parallel
https://community.ptc.com/t5/PTC-Mathcad/Programming-parallel/m-p/243675#M94959
Hi community,Thank you for your help in previuos discussions .I work with mathcad 14 and my computer is fast. In this moment I have a problem, because I have a programm (lsolve) with 8x8, but i need only the firts four components of this system.My programm works for more six hours,Thu, 03 May 2018 19:09:39 GMThttps://community.ptc.com/t5/PTC-Mathcad/Programming-parallel/m-p/243675#M94959mfduqued2018-05-03T19:09:39ZRe: Programming parallel
https://community.ptc.com/t5/PTC-Mathcad/Programming-parallel/m-p/243676#M94960
<HTML><HEAD></HEAD><BODY><P>Mathcad does not support parallel processing.</P><P></P><P>Your worksheet is very inefficient though, and you could speed it up a lot.</P><P></P><P>First, when you call Vectorincog0 you create a 10,000,000 element matrix, RefleEEK1S. Then when you call Vectorincog1 you create another 10,000,000 element matrix, RefleEHK1S. You do this 8 times in all, which means you are sucking up a huge amount of memory. This is not necessary, because these huge matrices are just intermediate results. All you get from them is the sums of the columns, and then you don't need them any more. If you put the summations inside the programs then when the program exits the memory for the matrices will be freed.</P><P></P><P>You can also speed up the operation where you first subtract two of the matrices, and then sum the columns. You already summed the columns. So split out the multiplcation step when you do those sums, and then replace the matrix sum with a vector sum (this will of course be necessary if you move the sums to within the programs)</P><P></P><P>Second, each program calls lsolve 10,000,000 times. You do this 8 times, but the call is exactly the same every time! Call it once, not 8 times, and create the solution matrices. Then just access the matrces. Your programs also call some combination of the functions ke, kh, fhm and fem 10,000,000 times (in some cases they call the same function twice, with the same arguments!), and the identical calls are repeated in more than one program. Call them once each and create matrices of the solutions, then access the matrices. If you call all of these functions only once, rather then multiple times (especially lsolve) you should get a huge speed improvement.</P><P></P><P>My inclination would be to create one program that creates all 8 vectors. Then when the program exits the memory used to store the lsolve, ke, kh, fhm, and fem matrices will be freed. If you do that then do not create different matrices, RefleEEK1S, RefleEHK1S, etc inside the program. Create only one matrix, and overwrite it.</P></BODY></HTML>Wed, 01 Dec 2010 20:01:13 GMThttps://community.ptc.com/t5/PTC-Mathcad/Programming-parallel/m-p/243676#M94960RichardJ2010-12-01T20:01:13ZRe: Programming parallel
https://community.ptc.com/t5/PTC-Mathcad/Programming-parallel/m-p/243677#M94961
<HTML><HEAD></HEAD><BODY><P>Mr. Jackson.</P><P></P><P><BR />Thank you for your suggestion.</P><P></P><P><BR />In this moment I changed my program and don't do lsolve 8 times, but I have a problem yet.</P><P></P><P><BR />My program overwrites the intermediate results, but it doesn't finish.</P><P></P><P><BR />Why My program doesn't finish together it overwrites the intermediate results?, I need a big resolution (ne=2500 and nq=4500)</P><P></P><P><BR />Thank you for your time, and your help.</P></BODY></HTML>Thu, 02 Dec 2010 19:52:44 GMThttps://community.ptc.com/t5/PTC-Mathcad/Programming-parallel/m-p/243677#M94961mfduqued2010-12-02T19:52:44ZRe: Programming parallel
https://community.ptc.com/t5/PTC-Mathcad/Programming-parallel/m-p/243678#M94962
<HTML><HEAD></HEAD><BODY><P>Mr. Jackson</P><P></P><P>In this moment, I think That my problem was solved.</P><P></P><P>I write the functions and after my program overwrite Them.</P><P></P><P>I generate my data tonight That for to check my file works again and attach my file with the solution.</P><P></P><P>Thanks for your suggestion.</P></BODY></HTML>Thu, 02 Dec 2010 22:29:00 GMThttps://community.ptc.com/t5/PTC-Mathcad/Programming-parallel/m-p/243678#M94962mfduqued2010-12-02T22:29:00Z