Skip to main content
1-Visitor
April 17, 2012
Question

Multithreading questions

  • April 17, 2012
  • 4 replies
  • 4505 views

We are looking into the multithreading feature in Mathcad Prime 2.0 and are wondering how people are using it?

One question we have is if you ever had need to calculate sequentially rather than by using multithreading (more than one calculation can run in parallel.).

Can you supply any examples showing where running the calculations sequentially is desirable?

Thanks,

Mona

4 replies

19-Tanzanite
April 17, 2012

Can you supply any examples showing where running the calculations sequentially is desirable?

Well, if one calculation depends on the result of another calculation then clearly they have to be run sequentially. If the two calculations are independent of each other I can't imagine why there would be any benefit to running them sequentially rather then in parallel, but I am no expert on parallel programming.

19-Tanzanite
April 17, 2012

I agree with Richard's comment in general. The only other situation I can think of where one might be wary of running in parallel is if one is using the inbuilt timer to time the calculations. Unless one could ensure the final call to the time function was indeed the final call, the apparent times could be very misleading.

Alan

19-Tanzanite
April 17, 2012

When multithreaded do the calculations have access to the same memory space, or are the two memory spaces independent? If they only have access to the same memory space then it's conceivable that each calculation might require so much memory that only one can be run at one time.

mzeftel1-VisitorAuthor
1-Visitor
April 17, 2012

Richard,


I think it depends on the computer, but this is not my area of expertise.

Mona

1-Visitor
April 17, 2012

I can honestly say I have never needed or believe I'll need a multithreading feature.

Mike

19-Tanzanite
April 17, 2012
I can honestly say I have never needed or believe I'll need a multithreading feature.

You don't have any worksheets that you would like to run faster?

1-Visitor
April 17, 2012

I can't honestly say I have. I do have a few cofferdam worksheets which have a few Integrations and solve blocks which could work a little quicker I suppose, but don't bother me too much.

Mike

1-Visitor
April 17, 2012

Mona, could you give an example of calculations that have benefits while using hyperthreading? I'm no expert on this but if I understood correctly Mathcad always has worked sequentially before Prime. I'm unsure on how Mathcad Prime uses hyperthreading, so if an example could be made available it would make a few things clearer (at least for me).

19-Tanzanite
April 17, 2012

As a very simple example, suppose you have three calculations. Calculations one and two are independent of each other, but calculation three depends on the results of both one and two. Currently, you run one, then two (or two, then one), then three. With multithreading you run one and two in parallel, then you run three.

1-Visitor
April 19, 2012

Thanks Richard, so far I understood hyperthreading, the question however is how Mathcad Prime is built to make use of the hyperthreading capabilities of the hardware we are using.

As far as I know, Mathcad works through its worksheet from left to right and from top to bottom. I also tend to split up my applications into GUI-sheets and the formulae which are located in worksheets that are referenced.

In these formulae I use a lot of functions and not many intermediate results, that has its consequences in terms of memory management. So I would guess that before calculating, Mathcad Prime screens and breaks down the statements in the worksheet and divides the work over different threads. The thing is whether the old way of working - which is quite straightforward in my humble opinion - still is better in terms of calculation speed or not. All functions reside in RAM, so when I call a function in the GUI worksheet, Mathcad then should recalculate the result over different threads, right?

I'm not sure whether Mathcad Prime indeed does a screening or not. Therefore I would like to know what PTC envisioned while developing Prime to use hyperthreading and how I can write worksheets that make maximum use of this hyperthreading in order to maximize performance. Does the user have such an influence?? Again, I'm just guessing here.

In other words, what does Mathcad do with hyperthreading and how can we influence/measure that in terms of performance?