Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Programming parallel


Programming parallel

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, Can I work with programming parallel?. Where do I get information about this topic?, Does mathcad 14 work with programming parallel?

Thanks for your suggestions.

PD: I attach my file, thank you


Mathcad does not support parallel processing.

Your worksheet is very inefficient though, and you could speed it up a lot.

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.

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)

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.

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.

Mr. Jackson.

Thank you for your suggestion.

In this moment I changed my program and don't do lsolve 8 times, but I have a problem yet.

My program overwrites the intermediate results, but it doesn't finish.

Why My program doesn't finish together it overwrites the intermediate results?, I need a big resolution (ne=2500 and nq=4500)

Thank you for your time, and your help.

Mr. Jackson

In this moment, I think That my problem was solved.

I write the functions and after my program overwrite Them.

I generate my data tonight That for to check my file works again and attach my file with the solution.

Thanks for your suggestion.

Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."