Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Help a beginner in OpenMP

jenheta
초급자
460 조회수
Hi,

I have a piece of ancient Fortran code that has two independent subroutines. Both use a NxM matrix as input to compute two distinct things. In short,

PROGRAM ANCIENT
...
CALL METHOD1
CALL METHOD2
...
END

Is it possible (guess so) to use OpenMP to speed up this code without compromising portability ?
I realize this is a generic question so here is the real problem :

The real code is a in-house developed molecular dynamics code where METHOD1 computes intermolecular pairwise forces and METHOD2 does intramolecular ones. We would like to compute these forces in parallel to reduce simulation time.

Appreciate any suggestion.

Thanks,

Jen.


0 포인트
2 응답
rreis
새로운 기여자 I
460 조회수
Quoting - jenheta
Hi,

I have a piece of ancient Fortran code that has two independent subroutines. Both use a NxM matrix as input to compute two distinct things. In short,

PROGRAM ANCIENT
...
CALL METHOD1
CALL METHOD2
...
END

Is it possible (guess so) to use OpenMP to speed up this code without compromising portability ?
I realize this is a generic question so here is the real problem :

The real code is a in-house developed molecular dynamics code where METHOD1 computes intermolecular pairwise forces and METHOD2 does intramolecular ones. We would like to compute these forces in parallel to reduce simulation time.

Appreciate any suggestion.

Thanks,

Jen.



portability is maintened using OpenMP because it works as compiler indications. If you use a compiler that "understands" OpenMP and you turn it on by the corresponding compiler flag, it will use OpenMP. If not the code is unafected. You could check the several OpenMP tutorial existing on the web, if METHOD1 and METHOD2 are independent using OpenMP would seem trivial (I'm assuming complete independence. memory dependencies must be looked for and etc, etc). Maybe you can start reading a bit more on OpenMP here, for instance,

http://www.llnl.gov/computing/tutorials/openMP



0 포인트
roddur
초급자
460 조회수
One main thing you must keep in mind is each of the thread should be independent. For MD. this is usually the case, but all depends on the implimentation. I dont know what your METHOD1 and METHOD2 contains, but as a suggestion, you can check threading the force calculation first, as (if you succeed,) you will get HUGE time save and if you make any fault, it will reveal very quickly.
0 포인트
응답