Hello,

I am starting to work on quite big application which uses Fortran and C++. The aim is to obtain multi-level parallelization. Since I am starting to work with OpenMp I would like to ask for advice concerning application design.

The application works as follows starting from the lowest level:

1. Fortran modules/subroutines for calculation parameters of single elements in network

2. C++ code - calls Fortran subroutines/modules and the results of calculations are next used to calculate some other stuff.

So for example we have network elements A, B, C (implemented in Fortran) and C++ code which calculate parameters of network: A(x1) + B(x1) + C(x1) + A(x2) + B(x2)

Calculations goes as follows:

1. Calculate results for A,B,C separately

2. Combine results and calculate final result using C++

The parallelization should be applied both for A,B,C (fortran code) and in C++ to call calculation for A(x1), A(x2), B(x1), B(x2), C(x1) simultaneously (so we obtain multilevel parallelization)

My questions is as follows:

Since, elements A,B,C are written in old F77 and uses a lot of common blocks - direct parallelization seems to be difficult - so is it a good idea to rework F77 code using OOP from F2008 standard just to have all variables private. This I guess should be enough to be able to call A(x1) and A(x2) simultaneously from C++. Or there is another approach (since there is a lot of common blocks I am not sure if I will be able to apply threadprivate in all required places and be sure that all works properly...)

Best,

Adam