Initial Experience with OpenMP and C++

Initial Experience with OpenMP and C++

Postby Cuchulainn » Sat May 26, 2007 1:34 pm

We have now initial results on OpenMP and C++.



Design of a MC simulator based on design patterns for n-factor SDE using FD schemes for the paths. Then add us the C's to get the price.



The stress test was NTimeSteps = 6000, NSIM = 10000. The major work load was in SDE/RNG/FDM part (in practice NT is smaller), Predictor-Corrector used and a combination of compile-time(templates) and run-time data structures (STL vector). No virtual functions, yet.



We used a combination of loop-level and higher-level work-sharing pragmas.



The versions were:



V1: C++ initial code, sequential code no optimisation: 99 secs



V2: optimised code: 17 seconds

use list<vector> for storage and removed it (very expensive to allocate)

Also, improved BLAS routines and saxpy algorithms ('new' is expensive)



V3: adding OpenMP pragmas and RT routines, response time 4.3 seconds

This is quite promising, and it is on a duo-core machine. Quadcore would be better of course



(we tried to optimise the code using the 'orderted' and with static scheduling with chunk size 1. And the response time was........................

39,000 seconds (THIRTY NINE THOUSAND SECONDS)!) So just thowing parallel commands at existing code is no guarantee. That's why I think that up-front design is crucial, in particular load balancing.



Initial integration of OpenMP and MPI is not so easy. On the other hand, will it be needed with a 64-core machine?
User avatar
Cuchulainn
 
Posts: 676
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Return to MPI/OpenMP

Who is online

Users browsing this forum: No registered users and 2 guests