Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Programming parallel

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

12-01-2010
11:16 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-01-2010
11:16 AM

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

3 REPLIES 3

12-01-2010
03:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-01-2010
03:01 PM

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.

12-02-2010
02:52 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2010
02:52 PM

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.

12-02-2010
05:29 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2010
05:29 PM

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.