Hi, Wolfgang!

  Thanks for an answer! I thought about something like that but did
  not expect the results to be so much different.

  If its possible could you explain the use of new approach to
  multithreading on the example of tutorial 8? For my current needs
  (have to go to conference in 2 weeks hehe) its all I need.

Regards,
Slawa

Friday, August 14, 2009, 20:12, you wrote:


>>    I have the following problem with multi-threading. I've followed
>>    tutorial 9 and changed my program completely in the same way - I
>>    use multi-threading to speed up the assembly procedure. Everything
>>    compiles and runs well with 1 or 2 threads. But when I run this
>>    problem on our cluster node with 8 cores/threads solution is different!

WB> If you assemble linear systems with threads, you can't control the order in
WB> which contributions from individual cells are added to the global matrix,
WB> i.e. matrix entry A_{ij} may be

WB>   A_{ij}^{K1} + A_{ij}^{K2} + A_{ij}^{K3}

WB> (where the three parts are contributions from three different cells), or

WB>   A_{ij}^{K1} + A_{ij}^{K3} + A_{ij}^{K2}

WB> for example. Mathematically speaking this shouldn't matter, but because
WB> floating point arithmetic is not commutative, it does matter in practice.

WB> One way around this is to cast to lower precision, i.e. when you copy to the
WB> global matrix, you should do something like this:
WB>             system_matrix.add (local_dof_indices[i],
WB>                                local_dof_indices[j],
WB>                                (float)cell_matrix(i,j));
WB> Note the cast in the last line. This is neither elegant nor guaranteed to
WB> always work, but it seems to work most of the time.

WB> That said, in the current development version of deal.II (post 6.2), we 
have a
WB> much more elegant way to do all this. Take a look here:
WB>   http://dealii.org/developer/doxygen/deal.II/group__threads.html

WB> That approach completely avoids this problem by making sure that everything
WB> always happen in exactly the same order.

WB> Best
WB>  W.




-- 
Best regards,                                       17.08.2009
Svyatoslav Gladkov, Kharkov, UKRAINE                17:09

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to