Recently, i found that the compilation results by SMP and DMP are different, as shown in following two screenshots. Though i am not familiar with parallel computation, i guess it may result from the difference of grammars for SMP and DMP.
I hope someone can tell me what differences between SMP and DMP should we pay attention to when writing the source code and how to modify my code for SMP.
Thanks! source code.zip (15.9 KB)
SMP (Shared Memory Parallelism) and DMP (Distributed Memory Parallelism) are two different ways to write and run the code in parallel. They both require special attention, especially when doing summation and I/O. Here the SMP build fails because you have not defined if sum_force is a private or shared variable. If you are not familiar with SMP or DMP programming, you will need to spend some time learning how to write parallel code before attempting to modify the source code.
Thank you, Dr. Dietiker. Can you please recommend some reference materials to me? I am new to parallel computation, especially for SMP and DMP programming.