Parallelization of the Phase Field Model: Difference between revisions
No edit summary |
No edit summary |
||
| Line 14: | Line 14: | ||
[[Image: Phasefield_flow_chart.jpg | frame | center]] |
[[Image: Phasefield_flow_chart.jpg | frame | center]] |
||
Starting from the serial c++ code, parallelization is done with OpenMP, MPI, and CUDA three approaches. In the following sections, we would like to show how to use these parallel codes in details. |
|||
== OpenMP code == |
|||
src/phasefield_omp.cpp contains our implementation of the OpenMP code. To compile the code, using cluster MC2 as an example, type |
|||
make phasefield build=R SYS=mc2_omp |
|||
You may check src/Makefile.base to look at the flags we set up for compiling OpenMP. Generally adding the specification of “-openmp” for icc compiler or “-fopenmp” for gcc compiler should make the computer to recognize OpenMP. |
|||
In this example, if the code is compiled successfully, the executable should be named as phasefield_mc2_omp in the bin/ folder. |
|||
You can specify the number of threads you want to use. For example if you want to have 8 threads for your simulation, you can type the following line in the command window (or include it in the PBS script) . |
|||
export OMP_NUM_THREADS = 8 |
|||
== MPI code == |
|||
Revision as of 04:53, 1 April 2015
Parallelization of the Phase Field Model
Yanming Wang and Wei Cai
A brief description
The basic formulation of the phase field model is described in the MSMSE 2014 paper. Base on this, a C++ serial code has been written under the MD++ framework. The below figure gives a flow chart of the phase field code, in order to clarify the codes’ structure.
Starting from the serial c++ code, parallelization is done with OpenMP, MPI, and CUDA three approaches. In the following sections, we would like to show how to use these parallel codes in details.
OpenMP code
src/phasefield_omp.cpp contains our implementation of the OpenMP code. To compile the code, using cluster MC2 as an example, type
make phasefield build=R SYS=mc2_omp
You may check src/Makefile.base to look at the flags we set up for compiling OpenMP. Generally adding the specification of “-openmp” for icc compiler or “-fopenmp” for gcc compiler should make the computer to recognize OpenMP.
In this example, if the code is compiled successfully, the executable should be named as phasefield_mc2_omp in the bin/ folder.
You can specify the number of threads you want to use. For example if you want to have 8 threads for your simulation, you can type the following line in the command window (or include it in the PBS script) .
export OMP_NUM_THREADS = 8
