|
PROGRAM LIBRARY JINRLIBSplit - a parallel implementation of the numerical solution |
|
Language: C++ The Split program calculates solutions of a system of algebraic equations of the form by splitting in parallel, using the MPI technique. The parallel algorithm is described in detail in [1]. The calculations presented in [2-4] demonstrate a significant reduction in the calculation time in parallel mode, which allowed us to successfully conduct a numerical study of the system of polaron equations where the partition algorithm was used within the implicit finite difference numerical scheme. The procedure is called simultaneously by all MPI processes involved in solving the problem: Input:
- A, B, C, D are the double type arrays containing coefficients of the system of equations (1).
Each MPI process performs calculations and provides values of X in its segment of the system (1);
- m1 - index of placement of the first segment equation in arrays A, B, C, D, X in each MPI process; - m2 - index of placement of the last segment equation in arrays A, B, C, D, X in each MPI process. Output:
X - the double type array containing a segment of solutions of a system (1) calculated by each MPI process.
The values of the m1 and m2 indexes are different for each MPI process, they also determine the size of the segment assigned to this process. Limitations of this version:
1. number of MPI-processes <= 50;
2. m2-m1 >= 2 for all segments. Note that the effect of parallelism is noticeable if system (1) has a large dimension, and the number of equations in the system is significantly greater than the number of MPI processes involved in the calculation. To use the Split procedure, the user must do the following:
- connect the MPI library;
- initialize MPI using the MPI_Init function; - determine the splitting of the system of equations into segments (see the example test.cpp, fragment "processes Markup"); - fill in the input arrays A,B,C,D on each process; - upload results from the output array X, if necessary, collecting all the fragments of results in a single array; - terminate MPI mode using the MPI_Finalize function. The program archive contains:
1. procedure file Split.cpp;
2. test program test.cpp for the system of 10 equations; 3. file test.txt of coefficients A,B,C,D of the system 10 equations input parameters for the test example; 4. outcome files for the cases of 1,2, and 3 MPI-processes; 5. Preprint [1] in the file Preprint_P11-2015-19.pdf. Download program archive. References:
|