VM2D 1.14
Vortex methods for 2D flows simulation
Loading...
Searching...
No Matches
Parallel.h
Go to the documentation of this file.
1/*--------------------------------*- VM2D -*-----------------*---------------*\
2| ## ## ## ## #### ##### | | Version 1.14 |
3| ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2026/03/06 |
4| ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------*
5| #### ## ## ## ## ## | Open Source Code |
6| ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D |
7| |
8| Copyright (C) 2017-2026 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova |
9*-----------------------------------------------------------------------------*
10| File name: parallel.h |
11| Info: Source code of VM2D |
12| |
13| This file is part of VM2D. |
14| VM2D is free software: you can redistribute it and/or modify it |
15| under the terms of the GNU General Public License as published by |
16| the Free Software Foundation, either version 3 of the License, or |
17| (at your option) any later version. |
18| |
19| VM2D is distributed in the hope that it will be useful, but WITHOUT |
20| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
21| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
22| for more details. |
23| |
24| You should have received a copy of the GNU General Public License |
25| along with VM2D. If not, see <http://www.gnu.org/licenses/>. |
26\*---------------------------------------------------------------------------*/
27
28
40#ifndef PARALLEL_H
41#define PARALLEL_H
42
43#include <vector>
44#ifdef USE_MPI
45 #include "mpi.h"
46#endif
47
48namespace VMlib
49{
50
57 struct parProp
58 {
60 std::vector<int> len;
61
63 std::vector<int> disp;
64
66 int myLen;
67
69 int myDisp;
70
73 };
74
75
87 {
88 public:
90#ifdef USE_MPI
91 MPI_Comm commWork;
92#else
94#endif
95
98
101
107 parProp SplitMPIone(size_t n, bool bcastAll = false) const;
108
114 parProp SplitMPI(size_t n, bool bcastAll = false) const;
115
116 };
117
118}//namespace VMlib
119
120#endif
int nProcWork
Число процессоров, решающих конкретную задачу
Definition Parallel.h:100
parProp SplitMPI(size_t n, bool bcastAll=false) const
Распределение задач по процессорам
Definition Parallel.cpp:97
int myidWork
Локальный номер процессора, решающего конкретную задачу
Definition Parallel.h:97
int commWork
Коммуникатор для решения конкретной задачи
Definition Parallel.h:93
parProp SplitMPIone(size_t n, bool bcastAll=false) const
Распределение задач по процессорам
Definition Parallel.cpp:45
Стрктура, содержащая параметры исполнения задачи в параллельном MPI-режиме
Definition Parallel.h:58
int myLen
Число витков, предназначенное текущему процессору
Definition Parallel.h:66
std::vector< int > disp
Список, определяющий номер витка цикла, с которого должен начинать работу данный процессор
Definition Parallel.h:63
std::vector< int > len
Список из чисел витков циклов, предназначенных для каждого процессора
Definition Parallel.h:60
int myDisp
Индекс первого витка из числа витков, предназначенных текущему процессору
Definition Parallel.h:69
int totalLen
Общее число витков, разделенное между всеми процессорами
Definition Parallel.h:72