24 USE iso_c_binding,
ONLY: c_f_pointer, c_ptr
31 USE mcl,
ONLY: mcl_initialize, mcl_is_initialized, mcl_abort
34#include "../base/base_uses.f90"
38#if defined(__parallel) && defined(__MPI_F08)
39#define MPI_DATA_TYPE TYPE(MPI_Datatype)
40#define MPI_COMM_TYPE TYPE(MPI_Comm)
41#define MPI_REQUEST_TYPE TYPE(MPI_Request)
42#define MPI_WIN_TYPE TYPE(MPI_Win)
43#define MPI_FILE_TYPE TYPE(MPI_File)
44#define MPI_INFO_TYPE TYPE(MPI_Info)
45#define MPI_STATUS_TYPE TYPE(MPI_Status)
46#define MPI_GROUP_TYPE TYPE(MPI_Group)
47#define MPI_STATUS_EXTRACT(X) %X
48#define MPI_GET_COMP %mpi_val
50#define MPI_DATA_TYPE INTEGER
51#define MPI_COMM_TYPE INTEGER
52#define MPI_REQUEST_TYPE INTEGER
53#define MPI_WIN_TYPE INTEGER
54#define MPI_FILE_TYPE INTEGER
55#define MPI_INFO_TYPE INTEGER
56#define MPI_STATUS_TYPE INTEGER, DIMENSION(MPI_STATUS_SIZE)
57#define MPI_GROUP_TYPE INTEGER
58#define MPI_STATUS_EXTRACT(X) (X)
62#if defined(__parallel)
76#if defined(__parallel)
77 LOGICAL,
PARAMETER :: cp2k_is_parallel = .true.
78 INTEGER,
PARAMETER,
PUBLIC :: mp_any_tag = mpi_any_tag
79 INTEGER,
PARAMETER,
PUBLIC :: mp_any_source = mpi_any_source
80 mpi_comm_type,
PARAMETER :: mp_comm_null_handle = mpi_comm_null
81 mpi_comm_type,
PARAMETER :: mp_comm_self_handle = mpi_comm_self
82 mpi_comm_type,
PARAMETER :: mp_comm_world_handle = mpi_comm_world
83 mpi_request_type,
PARAMETER :: mp_request_null_handle = mpi_request_null
84 mpi_win_type,
PARAMETER :: mp_win_null_handle = mpi_win_null
85 mpi_file_type,
PARAMETER :: mp_file_null_handle = mpi_file_null
86 mpi_info_type,
PARAMETER :: mp_info_null_handle = mpi_info_null
87 mpi_data_type,
PARAMETER :: mp_datatype_null_handle = mpi_datatype_null
88 INTEGER,
PARAMETER,
PUBLIC :: mp_status_size = mpi_status_size
89 INTEGER,
PARAMETER,
PUBLIC :: mp_proc_null = mpi_proc_null
91 INTEGER(KIND=MPI_ADDRESS_KIND),
PARAMETER,
PRIVATE :: mp_max_memory_size = huge(int(1, kind=
int_4))
93 INTEGER,
PARAMETER,
PUBLIC :: mp_max_library_version_string = mpi_max_library_version_string
95 INTEGER,
PARAMETER,
PUBLIC :: file_offset = mpi_offset_kind
96 INTEGER,
PARAMETER,
PUBLIC :: address_kind = mpi_address_kind
97 INTEGER,
PARAMETER,
PUBLIC :: file_amode_create = mpi_mode_create
98 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdonly = mpi_mode_rdonly
99 INTEGER,
PARAMETER,
PUBLIC :: file_amode_wronly = mpi_mode_wronly
100 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdwr = mpi_mode_rdwr
101 INTEGER,
PARAMETER,
PUBLIC :: file_amode_excl = mpi_mode_excl
102 INTEGER,
PARAMETER,
PUBLIC :: file_amode_append = mpi_mode_append
104 LOGICAL,
PARAMETER :: cp2k_is_parallel = .false.
105 INTEGER,
PARAMETER,
PUBLIC :: mp_any_tag = -1
106 INTEGER,
PARAMETER,
PUBLIC :: mp_any_source = -2
107 mpi_comm_type,
PARAMETER :: mp_comm_null_handle = -3
108 mpi_comm_type,
PARAMETER :: mp_comm_self_handle = -11
109 mpi_comm_type,
PARAMETER :: mp_comm_world_handle = -12
110 mpi_request_type,
PARAMETER :: mp_request_null_handle = -4
111 mpi_win_type,
PARAMETER :: mp_win_null_handle = -5
112 mpi_file_type,
PARAMETER :: mp_file_null_handle = -6
113 mpi_info_type,
PARAMETER :: mp_info_null_handle = -7
114 mpi_data_type,
PARAMETER :: mp_datatype_null_handle = -8
115 INTEGER,
PARAMETER,
PUBLIC :: mp_status_size = -9
116 INTEGER,
PARAMETER,
PUBLIC :: mp_proc_null = -10
117 INTEGER,
PARAMETER,
PUBLIC :: mp_max_library_version_string = 1
119 INTEGER,
PARAMETER,
PUBLIC :: file_offset =
int_8
120 INTEGER,
PARAMETER,
PUBLIC :: address_kind =
int_8
121 INTEGER,
PARAMETER,
PUBLIC :: file_amode_create = 1
122 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdonly = 2
123 INTEGER,
PARAMETER,
PUBLIC :: file_amode_wronly = 4
124 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdwr = 8
125 INTEGER,
PARAMETER,
PUBLIC :: file_amode_excl = 64
126 INTEGER,
PARAMETER,
PUBLIC :: file_amode_append = 128
134 CHARACTER(LEN=*),
PARAMETER,
PRIVATE :: modulen =
'message_passing'
137 INTEGER,
PRIVATE,
SAVE :: debug_comm_count
152 mpi_comm_type,
PRIVATE,
SAVE :: mimic_comm_world
157 mpi_comm_type :: handle = mp_comm_null_handle
161 INTEGER,
PUBLIC :: mepos = -1, source = -1, num_pe = -1
164 PROCEDURE, pass, non_overridable :: set_handle => mp_comm_type_set_handle
165 PROCEDURE, pass, non_overridable :: get_handle => mp_comm_type_get_handle
167 PROCEDURE,
PRIVATE, pass, non_overridable :: mp_comm_op_eq
168 PROCEDURE,
PRIVATE, pass, non_overridable :: mp_comm_op_neq
169 generic,
PUBLIC ::
operator(==) => mp_comm_op_eq
170 generic,
PUBLIC ::
operator(/=) => mp_comm_op_neq
172 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: &
173 mp_sendrecv_i, mp_sendrecv_l, mp_sendrecv_r, mp_sendrecv_d, &
174 mp_sendrecv_c, mp_sendrecv_z, &
175 mp_sendrecv_iv, mp_sendrecv_im2, mp_sendrecv_im3, mp_sendrecv_im4, &
176 mp_sendrecv_lv, mp_sendrecv_lm2, mp_sendrecv_lm3, mp_sendrecv_lm4, &
177 mp_sendrecv_rv, mp_sendrecv_rm2, mp_sendrecv_rm3, mp_sendrecv_rm4, &
178 mp_sendrecv_dv, mp_sendrecv_dm2, mp_sendrecv_dm3, mp_sendrecv_dm4, &
179 mp_sendrecv_cv, mp_sendrecv_cm2, mp_sendrecv_cm3, mp_sendrecv_cm4, &
180 mp_sendrecv_zv, mp_sendrecv_zm2, mp_sendrecv_zm3, mp_sendrecv_zm4
181 generic,
PUBLIC :: sendrecv => mp_sendrecv_i, mp_sendrecv_l, &
182 mp_sendrecv_r, mp_sendrecv_d, mp_sendrecv_c, mp_sendrecv_z, &
183 mp_sendrecv_iv, mp_sendrecv_im2, mp_sendrecv_im3, mp_sendrecv_im4, &
184 mp_sendrecv_lv, mp_sendrecv_lm2, mp_sendrecv_lm3, mp_sendrecv_lm4, &
185 mp_sendrecv_rv, mp_sendrecv_rm2, mp_sendrecv_rm3, mp_sendrecv_rm4, &
186 mp_sendrecv_dv, mp_sendrecv_dm2, mp_sendrecv_dm3, mp_sendrecv_dm4, &
187 mp_sendrecv_cv, mp_sendrecv_cm2, mp_sendrecv_cm3, mp_sendrecv_cm4, &
188 mp_sendrecv_zv, mp_sendrecv_zm2, mp_sendrecv_zm3, mp_sendrecv_zm4
190 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_minloc_iv, &
191 mp_minloc_lv, mp_minloc_rv, mp_minloc_dv
192 generic,
PUBLIC :: minloc => mp_minloc_iv, &
193 mp_minloc_lv, mp_minloc_rv, mp_minloc_dv
195 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_maxloc_iv, &
196 mp_maxloc_lv, mp_maxloc_rv, mp_maxloc_dv
197 generic,
PUBLIC :: maxloc => mp_maxloc_iv, &
198 mp_maxloc_lv, mp_maxloc_rv, mp_maxloc_dv
200 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_shift_im, mp_shift_i, &
201 mp_shift_lm, mp_shift_l, mp_shift_rm, mp_shift_r, &
202 mp_shift_dm, mp_shift_d, mp_shift_cm, mp_shift_c, &
203 mp_shift_zm, mp_shift_z
204 generic,
PUBLIC :: shift => mp_shift_im, mp_shift_i, &
205 mp_shift_lm, mp_shift_l, mp_shift_rm, mp_shift_r, &
206 mp_shift_dm, mp_shift_d, mp_shift_cm, mp_shift_c, &
207 mp_shift_zm, mp_shift_z
209 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_bcast_i, mp_bcast_iv, mp_bcast_im, mp_bcast_i3, &
210 mp_bcast_l, mp_bcast_lv, mp_bcast_lm, mp_bcast_l3, &
211 mp_bcast_r, mp_bcast_rv, mp_bcast_rm, mp_bcast_r3, &
212 mp_bcast_d, mp_bcast_dv, mp_bcast_dm, mp_bcast_d3, &
213 mp_bcast_c, mp_bcast_cv, mp_bcast_cm, mp_bcast_c3, &
214 mp_bcast_z, mp_bcast_zv, mp_bcast_zm, mp_bcast_z3, &
215 mp_bcast_b, mp_bcast_bv, mp_bcast_av, mp_bcast_am, &
216 mp_bcast_i_src, mp_bcast_iv_src, mp_bcast_im_src, mp_bcast_i3_src, &
217 mp_bcast_l_src, mp_bcast_lv_src, mp_bcast_lm_src, mp_bcast_l3_src, &
218 mp_bcast_r_src, mp_bcast_rv_src, mp_bcast_rm_src, mp_bcast_r3_src, &
219 mp_bcast_d_src, mp_bcast_dv_src, mp_bcast_dm_src, mp_bcast_d3_src, &
220 mp_bcast_c_src, mp_bcast_cv_src, mp_bcast_cm_src, mp_bcast_c3_src, &
221 mp_bcast_z_src, mp_bcast_zv_src, mp_bcast_zm_src, mp_bcast_z3_src, &
222 mp_bcast_b_src, mp_bcast_bv_src, mp_bcast_av_src, mp_bcast_am_src
223 generic,
PUBLIC :: bcast => mp_bcast_i, mp_bcast_iv, mp_bcast_im, mp_bcast_i3, &
224 mp_bcast_l, mp_bcast_lv, mp_bcast_lm, mp_bcast_l3, &
225 mp_bcast_r, mp_bcast_rv, mp_bcast_rm, mp_bcast_r3, &
226 mp_bcast_d, mp_bcast_dv, mp_bcast_dm, mp_bcast_d3, &
227 mp_bcast_c, mp_bcast_cv, mp_bcast_cm, mp_bcast_c3, &
228 mp_bcast_z, mp_bcast_zv, mp_bcast_zm, mp_bcast_z3, &
229 mp_bcast_b, mp_bcast_bv, mp_bcast_av, mp_bcast_am, &
230 mp_bcast_i_src, mp_bcast_iv_src, mp_bcast_im_src, mp_bcast_i3_src, &
231 mp_bcast_l_src, mp_bcast_lv_src, mp_bcast_lm_src, mp_bcast_l3_src, &
232 mp_bcast_r_src, mp_bcast_rv_src, mp_bcast_rm_src, mp_bcast_r3_src, &
233 mp_bcast_d_src, mp_bcast_dv_src, mp_bcast_dm_src, mp_bcast_d3_src, &
234 mp_bcast_c_src, mp_bcast_cv_src, mp_bcast_cm_src, mp_bcast_c3_src, &
235 mp_bcast_z_src, mp_bcast_zv_src, mp_bcast_zm_src, mp_bcast_z3_src, &
236 mp_bcast_b_src, mp_bcast_bv_src, mp_bcast_av_src, mp_bcast_am_src
238 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_ibcast_i, mp_ibcast_iv, &
239 mp_ibcast_l, mp_ibcast_lv, mp_ibcast_r, mp_ibcast_rv, &
240 mp_ibcast_d, mp_ibcast_dv, mp_ibcast_c, mp_ibcast_cv, &
241 mp_ibcast_z, mp_ibcast_zv
242 generic,
PUBLIC :: ibcast => mp_ibcast_i, mp_ibcast_iv, &
243 mp_ibcast_l, mp_ibcast_lv, mp_ibcast_r, mp_ibcast_rv, &
244 mp_ibcast_d, mp_ibcast_dv, mp_ibcast_c, mp_ibcast_cv, &
245 mp_ibcast_z, mp_ibcast_zv
247 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: &
248 mp_sum_i, mp_sum_iv, mp_sum_im, mp_sum_im3, mp_sum_im4, &
249 mp_sum_l, mp_sum_lv, mp_sum_lm, mp_sum_lm3, mp_sum_lm4, &
250 mp_sum_r, mp_sum_rv, mp_sum_rm, mp_sum_rm3, mp_sum_rm4, &
251 mp_sum_d, mp_sum_dv, mp_sum_dm, mp_sum_dm3, mp_sum_dm4, &
252 mp_sum_c, mp_sum_cv, mp_sum_cm, mp_sum_cm3, mp_sum_cm4, &
253 mp_sum_z, mp_sum_zv, mp_sum_zm, mp_sum_zm3, mp_sum_zm4, &
254 mp_sum_root_iv, mp_sum_root_im, mp_sum_root_lv, mp_sum_root_lm, &
255 mp_sum_root_rv, mp_sum_root_rm, mp_sum_root_dv, mp_sum_root_dm, &
256 mp_sum_root_cv, mp_sum_root_cm, mp_sum_root_zv, mp_sum_root_zm, &
258 generic,
PUBLIC :: sum => mp_sum_i, mp_sum_iv, mp_sum_im, mp_sum_im3, mp_sum_im4, &
259 mp_sum_l, mp_sum_lv, mp_sum_lm, mp_sum_lm3, mp_sum_lm4, &
260 mp_sum_r, mp_sum_rv, mp_sum_rm, mp_sum_rm3, mp_sum_rm4, &
261 mp_sum_d, mp_sum_dv, mp_sum_dm, mp_sum_dm3, mp_sum_dm4, &
262 mp_sum_c, mp_sum_cv, mp_sum_cm, mp_sum_cm3, mp_sum_cm4, &
263 mp_sum_z, mp_sum_zv, mp_sum_zm, mp_sum_zm3, mp_sum_zm4, &
264 mp_sum_root_iv, mp_sum_root_im, mp_sum_root_lv, mp_sum_root_lm, &
265 mp_sum_root_rv, mp_sum_root_rm, mp_sum_root_dv, mp_sum_root_dm, &
266 mp_sum_root_cv, mp_sum_root_cm, mp_sum_root_zv, mp_sum_root_zm, &
269 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_isum_iv, &
270 mp_isum_lv, mp_isum_rv, mp_isum_dv, mp_isum_cv, &
271 mp_isum_zv, mp_isum_bv
272 generic,
PUBLIC ::
isum => mp_isum_iv, &
273 mp_isum_lv, mp_isum_rv, mp_isum_dv, mp_isum_cv, &
274 mp_isum_zv, mp_isum_bv
276 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_sum_partial_im, &
277 mp_sum_partial_lm, mp_sum_partial_rm, mp_sum_partial_dm, &
278 mp_sum_partial_cm, mp_sum_partial_zm
279 generic,
PUBLIC :: sum_partial => mp_sum_partial_im, &
280 mp_sum_partial_lm, mp_sum_partial_rm, mp_sum_partial_dm, &
281 mp_sum_partial_cm, mp_sum_partial_zm
283 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_max_i, mp_max_iv, &
284 mp_max_l, mp_max_lv, mp_max_r, mp_max_rv, &
285 mp_max_d, mp_max_dv, mp_max_c, mp_max_cv, &
286 mp_max_z, mp_max_zv, mp_max_root_i, mp_max_root_l, &
287 mp_max_root_r, mp_max_root_d, mp_max_root_c, mp_max_root_z, &
288 mp_max_root_im, mp_max_root_lm, mp_max_root_rm, mp_max_root_dm, &
289 mp_max_root_cm, mp_max_root_zm
290 generic,
PUBLIC :: max => mp_max_i, mp_max_iv, &
291 mp_max_l, mp_max_lv, mp_max_r, mp_max_rv, &
292 mp_max_d, mp_max_dv, mp_max_c, mp_max_cv, &
293 mp_max_z, mp_max_zv, mp_max_root_i, mp_max_root_l, &
294 mp_max_root_r, mp_max_root_d, mp_max_root_c, mp_max_root_z, &
295 mp_max_root_im, mp_max_root_lm, mp_max_root_rm, mp_max_root_dm, &
296 mp_max_root_cm, mp_max_root_zm
298 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_min_i, mp_min_iv, &
299 mp_min_l, mp_min_lv, mp_min_r, mp_min_rv, &
300 mp_min_d, mp_min_dv, mp_min_c, mp_min_cv, &
302 generic,
PUBLIC :: min => mp_min_i, mp_min_iv, &
303 mp_min_l, mp_min_lv, mp_min_r, mp_min_rv, &
304 mp_min_d, mp_min_dv, mp_min_c, mp_min_cv, &
307 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: &
308 mp_sum_scatter_iv, mp_sum_scatter_lv, mp_sum_scatter_rv, &
309 mp_sum_scatter_dv, mp_sum_scatter_cv, mp_sum_scatter_zv
310 generic,
PUBLIC :: sum_scatter => &
311 mp_sum_scatter_iv, mp_sum_scatter_lv, mp_sum_scatter_rv, &
312 mp_sum_scatter_dv, mp_sum_scatter_cv, mp_sum_scatter_zv
314 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_prod_r, mp_prod_d, mp_prod_c, mp_prod_z
315 generic,
PUBLIC :: prod => mp_prod_r, mp_prod_d, mp_prod_c, mp_prod_z
317 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_gather_i, mp_gather_iv, mp_gather_im, &
318 mp_gather_l, mp_gather_lv, mp_gather_lm, &
319 mp_gather_r, mp_gather_rv, mp_gather_rm, &
320 mp_gather_d, mp_gather_dv, mp_gather_dm, &
321 mp_gather_c, mp_gather_cv, mp_gather_cm, &
322 mp_gather_z, mp_gather_zv, mp_gather_zm, &
323 mp_gather_i_src, mp_gather_iv_src, mp_gather_im_src, &
324 mp_gather_l_src, mp_gather_lv_src, mp_gather_lm_src, &
325 mp_gather_r_src, mp_gather_rv_src, mp_gather_rm_src, &
326 mp_gather_d_src, mp_gather_dv_src, mp_gather_dm_src, &
327 mp_gather_c_src, mp_gather_cv_src, mp_gather_cm_src, &
328 mp_gather_z_src, mp_gather_zv_src, mp_gather_zm_src
329 generic,
PUBLIC :: gather => mp_gather_i, mp_gather_iv, mp_gather_im, &
330 mp_gather_l, mp_gather_lv, mp_gather_lm, &
331 mp_gather_r, mp_gather_rv, mp_gather_rm, &
332 mp_gather_d, mp_gather_dv, mp_gather_dm, &
333 mp_gather_c, mp_gather_cv, mp_gather_cm, &
334 mp_gather_z, mp_gather_zv, mp_gather_zm, &
335 mp_gather_i_src, mp_gather_iv_src, mp_gather_im_src, &
336 mp_gather_l_src, mp_gather_lv_src, mp_gather_lm_src, &
337 mp_gather_r_src, mp_gather_rv_src, mp_gather_rm_src, &
338 mp_gather_d_src, mp_gather_dv_src, mp_gather_dm_src, &
339 mp_gather_c_src, mp_gather_cv_src, mp_gather_cm_src, &
340 mp_gather_z_src, mp_gather_zv_src, mp_gather_zm_src
342 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_gatherv_iv, &
343 mp_gatherv_lv, mp_gatherv_rv, mp_gatherv_dv, &
344 mp_gatherv_cv, mp_gatherv_zv, mp_gatherv_lm2, mp_gatherv_rm2, &
345 mp_gatherv_dm2, mp_gatherv_cm2, mp_gatherv_zm2, mp_gatherv_iv_src, &
346 mp_gatherv_lv_src, mp_gatherv_rv_src, mp_gatherv_dv_src, &
347 mp_gatherv_cv_src, mp_gatherv_zv_src, mp_gatherv_lm2_src, mp_gatherv_rm2_src, &
348 mp_gatherv_dm2_src, mp_gatherv_cm2_src, mp_gatherv_zm2_src
349 generic,
PUBLIC :: gatherv => mp_gatherv_iv, &
350 mp_gatherv_lv, mp_gatherv_rv, mp_gatherv_dv, &
351 mp_gatherv_cv, mp_gatherv_zv, mp_gatherv_lm2, mp_gatherv_rm2, &
352 mp_gatherv_dm2, mp_gatherv_cm2, mp_gatherv_zm2, mp_gatherv_iv_src, &
353 mp_gatherv_lv_src, mp_gatherv_rv_src, mp_gatherv_dv_src, &
354 mp_gatherv_cv_src, mp_gatherv_zv_src, mp_gatherv_lm2_src, mp_gatherv_rm2_src, &
355 mp_gatherv_dm2_src, mp_gatherv_cm2_src, mp_gatherv_zm2_src
357 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_igatherv_iv, &
358 mp_igatherv_lv, mp_igatherv_rv, mp_igatherv_dv, &
359 mp_igatherv_cv, mp_igatherv_zv
360 generic,
PUBLIC :: igatherv => mp_igatherv_iv, &
361 mp_igatherv_lv, mp_igatherv_rv, mp_igatherv_dv, &
362 mp_igatherv_cv, mp_igatherv_zv
364 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_allgather_i, mp_allgather_i2, &
365 mp_allgather_i12, mp_allgather_i23, mp_allgather_i34, &
366 mp_allgather_i22, mp_allgather_l, mp_allgather_l2, &
367 mp_allgather_l12, mp_allgather_l23, mp_allgather_l34, &
368 mp_allgather_l22, mp_allgather_r, mp_allgather_r2, &
369 mp_allgather_r12, mp_allgather_r23, mp_allgather_r34, &
370 mp_allgather_r22, mp_allgather_d, mp_allgather_d2, &
371 mp_allgather_d12, mp_allgather_d23, mp_allgather_d34, &
372 mp_allgather_d22, mp_allgather_c, mp_allgather_c2, &
373 mp_allgather_c12, mp_allgather_c23, mp_allgather_c34, &
374 mp_allgather_c22, mp_allgather_z, mp_allgather_z2, &
375 mp_allgather_z12, mp_allgather_z23, mp_allgather_z34, &
377 generic,
PUBLIC :: allgather => mp_allgather_i, mp_allgather_i2, &
378 mp_allgather_i12, mp_allgather_i23, mp_allgather_i34, &
379 mp_allgather_i22, mp_allgather_l, mp_allgather_l2, &
380 mp_allgather_l12, mp_allgather_l23, mp_allgather_l34, &
381 mp_allgather_l22, mp_allgather_r, mp_allgather_r2, &
382 mp_allgather_r12, mp_allgather_r23, mp_allgather_r34, &
383 mp_allgather_r22, mp_allgather_d, mp_allgather_d2, &
384 mp_allgather_d12, mp_allgather_d23, mp_allgather_d34, &
385 mp_allgather_d22, mp_allgather_c, mp_allgather_c2, &
386 mp_allgather_c12, mp_allgather_c23, mp_allgather_c34, &
387 mp_allgather_c22, mp_allgather_z, mp_allgather_z2, &
388 mp_allgather_z12, mp_allgather_z23, mp_allgather_z34, &
391 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_allgatherv_iv, mp_allgatherv_lv, &
392 mp_allgatherv_rv, mp_allgatherv_dv, mp_allgatherv_cv, mp_allgatherv_zv, &
393 mp_allgatherv_im2, mp_allgatherv_lm2, mp_allgatherv_rm2, &
394 mp_allgatherv_dm2, mp_allgatherv_cm2, mp_allgatherv_zm2
395 generic,
PUBLIC :: allgatherv => mp_allgatherv_iv, mp_allgatherv_lv, &
396 mp_allgatherv_rv, mp_allgatherv_dv, mp_allgatherv_cv, mp_allgatherv_zv, &
397 mp_allgatherv_im2, mp_allgatherv_lm2, mp_allgatherv_rm2, &
398 mp_allgatherv_dm2, mp_allgatherv_cm2, mp_allgatherv_zm2
400 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iallgather_i, mp_iallgather_l, &
401 mp_iallgather_r, mp_iallgather_d, mp_iallgather_c, mp_iallgather_z, &
402 mp_iallgather_i11, mp_iallgather_l11, mp_iallgather_r11, mp_iallgather_d11, &
403 mp_iallgather_c11, mp_iallgather_z11, mp_iallgather_i13, mp_iallgather_l13, &
404 mp_iallgather_r13, mp_iallgather_d13, mp_iallgather_c13, mp_iallgather_z13, &
405 mp_iallgather_i22, mp_iallgather_l22, mp_iallgather_r22, mp_iallgather_d22, &
406 mp_iallgather_c22, mp_iallgather_z22, mp_iallgather_i24, mp_iallgather_l24, &
407 mp_iallgather_r24, mp_iallgather_d24, mp_iallgather_c24, mp_iallgather_z24, &
408 mp_iallgather_i33, mp_iallgather_l33, mp_iallgather_r33, mp_iallgather_d33, &
409 mp_iallgather_c33, mp_iallgather_z33
410 generic,
PUBLIC :: iallgather => mp_iallgather_i, mp_iallgather_l, &
411 mp_iallgather_r, mp_iallgather_d, mp_iallgather_c, mp_iallgather_z, &
412 mp_iallgather_i11, mp_iallgather_l11, mp_iallgather_r11, mp_iallgather_d11, &
413 mp_iallgather_c11, mp_iallgather_z11, mp_iallgather_i13, mp_iallgather_l13, &
414 mp_iallgather_r13, mp_iallgather_d13, mp_iallgather_c13, mp_iallgather_z13, &
415 mp_iallgather_i22, mp_iallgather_l22, mp_iallgather_r22, mp_iallgather_d22, &
416 mp_iallgather_c22, mp_iallgather_z22, mp_iallgather_i24, mp_iallgather_l24, &
417 mp_iallgather_r24, mp_iallgather_d24, mp_iallgather_c24, mp_iallgather_z24, &
418 mp_iallgather_i33, mp_iallgather_l33, mp_iallgather_r33, mp_iallgather_d33, &
419 mp_iallgather_c33, mp_iallgather_z33
421 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iallgatherv_iv, mp_iallgatherv_iv2, &
422 mp_iallgatherv_lv, mp_iallgatherv_lv2, mp_iallgatherv_rv, mp_iallgatherv_rv2, &
423 mp_iallgatherv_dv, mp_iallgatherv_dv2, mp_iallgatherv_cv, mp_iallgatherv_cv2, &
424 mp_iallgatherv_zv, mp_iallgatherv_zv2
425 generic,
PUBLIC :: iallgatherv => mp_iallgatherv_iv, mp_iallgatherv_iv2, &
426 mp_iallgatherv_lv, mp_iallgatherv_lv2, mp_iallgatherv_rv, mp_iallgatherv_rv2, &
427 mp_iallgatherv_dv, mp_iallgatherv_dv2, mp_iallgatherv_cv, mp_iallgatherv_cv2, &
428 mp_iallgatherv_zv, mp_iallgatherv_zv2
430 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_scatter_iv, mp_scatter_lv, &
431 mp_scatter_rv, mp_scatter_dv, mp_scatter_cv, mp_scatter_zv
432 generic,
PUBLIC :: scatter => mp_scatter_iv, mp_scatter_lv, &
433 mp_scatter_rv, mp_scatter_dv, mp_scatter_cv, mp_scatter_zv
435 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iscatter_i, mp_iscatter_l, &
436 mp_iscatter_r, mp_iscatter_d, mp_iscatter_c, mp_iscatter_z, &
437 mp_iscatter_iv2, mp_iscatter_lv2, mp_iscatter_rv2, mp_iscatter_dv2, &
438 mp_iscatter_cv2, mp_iscatter_zv2
439 generic,
PUBLIC :: iscatter => mp_iscatter_i, mp_iscatter_l, &
440 mp_iscatter_r, mp_iscatter_d, mp_iscatter_c, mp_iscatter_z, &
441 mp_iscatter_iv2, mp_iscatter_lv2, mp_iscatter_rv2, mp_iscatter_dv2, &
442 mp_iscatter_cv2, mp_iscatter_zv2
444 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iscatterv_iv, mp_iscatterv_lv, &
445 mp_iscatterv_rv, mp_iscatterv_dv, mp_iscatterv_cv, mp_iscatterv_zv
446 generic,
PUBLIC :: iscatterv => mp_iscatterv_iv, mp_iscatterv_lv, &
447 mp_iscatterv_rv, mp_iscatterv_dv, mp_iscatterv_cv, mp_iscatterv_zv
449 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_alltoall_i, mp_alltoall_i22, mp_alltoall_i33, &
450 mp_alltoall_i44, mp_alltoall_i55, mp_alltoall_i45, mp_alltoall_i34, &
451 mp_alltoall_i11v, mp_alltoall_i22v, mp_alltoall_i54, &
452 mp_alltoall_l, mp_alltoall_l22, mp_alltoall_l33, &
453 mp_alltoall_l44, mp_alltoall_l55, mp_alltoall_l45, mp_alltoall_l34, &
454 mp_alltoall_l11v, mp_alltoall_l22v, mp_alltoall_l54, &
455 mp_alltoall_r, mp_alltoall_r22, mp_alltoall_r33, &
456 mp_alltoall_r44, mp_alltoall_r55, mp_alltoall_r45, mp_alltoall_r34, &
457 mp_alltoall_r11v, mp_alltoall_r22v, mp_alltoall_r54, &
458 mp_alltoall_d, mp_alltoall_d22, mp_alltoall_d33, &
459 mp_alltoall_d44, mp_alltoall_d55, mp_alltoall_d45, mp_alltoall_d34, &
460 mp_alltoall_d11v, mp_alltoall_d22v, mp_alltoall_d54, &
461 mp_alltoall_c, mp_alltoall_c22, mp_alltoall_c33, &
462 mp_alltoall_c44, mp_alltoall_c55, mp_alltoall_c45, mp_alltoall_c34, &
463 mp_alltoall_c11v, mp_alltoall_c22v, mp_alltoall_c54, &
464 mp_alltoall_z, mp_alltoall_z22, mp_alltoall_z33, &
465 mp_alltoall_z44, mp_alltoall_z55, mp_alltoall_z45, mp_alltoall_z34, &
466 mp_alltoall_z11v, mp_alltoall_z22v, mp_alltoall_z54
467 generic,
PUBLIC :: alltoall => mp_alltoall_i, mp_alltoall_i22, mp_alltoall_i33, &
468 mp_alltoall_i44, mp_alltoall_i55, mp_alltoall_i45, mp_alltoall_i34, &
469 mp_alltoall_i11v, mp_alltoall_i22v, mp_alltoall_i54, &
470 mp_alltoall_l, mp_alltoall_l22, mp_alltoall_l33, &
471 mp_alltoall_l44, mp_alltoall_l55, mp_alltoall_l45, mp_alltoall_l34, &
472 mp_alltoall_l11v, mp_alltoall_l22v, mp_alltoall_l54, &
473 mp_alltoall_r, mp_alltoall_r22, mp_alltoall_r33, &
474 mp_alltoall_r44, mp_alltoall_r55, mp_alltoall_r45, mp_alltoall_r34, &
475 mp_alltoall_r11v, mp_alltoall_r22v, mp_alltoall_r54, &
476 mp_alltoall_d, mp_alltoall_d22, mp_alltoall_d33, &
477 mp_alltoall_d44, mp_alltoall_d55, mp_alltoall_d45, mp_alltoall_d34, &
478 mp_alltoall_d11v, mp_alltoall_d22v, mp_alltoall_d54, &
479 mp_alltoall_c, mp_alltoall_c22, mp_alltoall_c33, &
480 mp_alltoall_c44, mp_alltoall_c55, mp_alltoall_c45, mp_alltoall_c34, &
481 mp_alltoall_c11v, mp_alltoall_c22v, mp_alltoall_c54, &
482 mp_alltoall_z, mp_alltoall_z22, mp_alltoall_z33, &
483 mp_alltoall_z44, mp_alltoall_z55, mp_alltoall_z45, mp_alltoall_z34, &
484 mp_alltoall_z11v, mp_alltoall_z22v, mp_alltoall_z54
486 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_send_i, mp_send_iv, mp_send_im2, mp_send_im3, &
487 mp_send_l, mp_send_lv, mp_send_lm2, mp_send_lm3, &
488 mp_send_r, mp_send_rv, mp_send_rm2, mp_send_rm3, &
489 mp_send_d, mp_send_dv, mp_send_dm2, mp_send_dm3, &
490 mp_send_c, mp_send_cv, mp_send_cm2, mp_send_cm3, &
491 mp_send_z, mp_send_zv, mp_send_zm2, mp_send_zm3
492 generic,
PUBLIC :: send => mp_send_i, mp_send_iv, mp_send_im2, mp_send_im3, &
493 mp_send_l, mp_send_lv, mp_send_lm2, mp_send_lm3, &
494 mp_send_r, mp_send_rv, mp_send_rm2, mp_send_rm3, &
495 mp_send_d, mp_send_dv, mp_send_dm2, mp_send_dm3, &
496 mp_send_c, mp_send_cv, mp_send_cm2, mp_send_cm3, &
497 mp_send_z, mp_send_zv, mp_send_zm2, mp_send_zm3
499 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_recv_i, mp_recv_iv, mp_recv_im2, mp_recv_im3, &
500 mp_recv_l, mp_recv_lv, mp_recv_lm2, mp_recv_lm3, &
501 mp_recv_r, mp_recv_rv, mp_recv_rm2, mp_recv_rm3, &
502 mp_recv_d, mp_recv_dv, mp_recv_dm2, mp_recv_dm3, &
503 mp_recv_c, mp_recv_cv, mp_recv_cm2, mp_recv_cm3, &
504 mp_recv_z, mp_recv_zv, mp_recv_zm2, mp_recv_zm3
505 generic,
PUBLIC :: recv => mp_recv_i, mp_recv_iv, mp_recv_im2, mp_recv_im3, &
506 mp_recv_l, mp_recv_lv, mp_recv_lm2, mp_recv_lm3, &
507 mp_recv_r, mp_recv_rv, mp_recv_rm2, mp_recv_rm3, &
508 mp_recv_d, mp_recv_dv, mp_recv_dm2, mp_recv_dm3, &
509 mp_recv_c, mp_recv_cv, mp_recv_cm2, mp_recv_cm3, &
510 mp_recv_z, mp_recv_zv, mp_recv_zm2, mp_recv_zm3
512 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_isendrecv_i, mp_isendrecv_iv, &
513 mp_isendrecv_l, mp_isendrecv_lv, mp_isendrecv_r, mp_isendrecv_rv, &
514 mp_isendrecv_d, mp_isendrecv_dv, mp_isendrecv_c, mp_isendrecv_cv, &
515 mp_isendrecv_z, mp_isendrecv_zv
516 generic,
PUBLIC :: isendrecv => mp_isendrecv_i, mp_isendrecv_iv, &
517 mp_isendrecv_l, mp_isendrecv_lv, mp_isendrecv_r, mp_isendrecv_rv, &
518 mp_isendrecv_d, mp_isendrecv_dv, mp_isendrecv_c, mp_isendrecv_cv, &
519 mp_isendrecv_z, mp_isendrecv_zv
521 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_isend_iv, mp_isend_im2, mp_isend_im3, mp_isend_im4, &
522 mp_isend_lv, mp_isend_lm2, mp_isend_lm3, mp_isend_lm4, &
523 mp_isend_rv, mp_isend_rm2, mp_isend_rm3, mp_isend_rm4, &
524 mp_isend_dv, mp_isend_dm2, mp_isend_dm3, mp_isend_dm4, &
525 mp_isend_cv, mp_isend_cm2, mp_isend_cm3, mp_isend_cm4, &
526 mp_isend_zv, mp_isend_zm2, mp_isend_zm3, mp_isend_zm4, &
527 mp_isend_bv, mp_isend_bm3, mp_isend_custom
528 generic,
PUBLIC :: isend => mp_isend_iv, mp_isend_im2, mp_isend_im3, mp_isend_im4, &
529 mp_isend_lv, mp_isend_lm2, mp_isend_lm3, mp_isend_lm4, &
530 mp_isend_rv, mp_isend_rm2, mp_isend_rm3, mp_isend_rm4, &
531 mp_isend_dv, mp_isend_dm2, mp_isend_dm3, mp_isend_dm4, &
532 mp_isend_cv, mp_isend_cm2, mp_isend_cm3, mp_isend_cm4, &
533 mp_isend_zv, mp_isend_zm2, mp_isend_zm3, mp_isend_zm4, &
534 mp_isend_bv, mp_isend_bm3, mp_isend_custom
536 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_irecv_iv, mp_irecv_im2, mp_irecv_im3, mp_irecv_im4, &
537 mp_irecv_lv, mp_irecv_lm2, mp_irecv_lm3, mp_irecv_lm4, &
538 mp_irecv_rv, mp_irecv_rm2, mp_irecv_rm3, mp_irecv_rm4, &
539 mp_irecv_dv, mp_irecv_dm2, mp_irecv_dm3, mp_irecv_dm4, &
540 mp_irecv_cv, mp_irecv_cm2, mp_irecv_cm3, mp_irecv_cm4, &
541 mp_irecv_zv, mp_irecv_zm2, mp_irecv_zm3, mp_irecv_zm4, &
542 mp_irecv_bv, mp_irecv_bm3, mp_irecv_custom
543 generic,
PUBLIC :: irecv => mp_irecv_iv, mp_irecv_im2, mp_irecv_im3, mp_irecv_im4, &
544 mp_irecv_lv, mp_irecv_lm2, mp_irecv_lm3, mp_irecv_lm4, &
545 mp_irecv_rv, mp_irecv_rm2, mp_irecv_rm3, mp_irecv_rm4, &
546 mp_irecv_dv, mp_irecv_dm2, mp_irecv_dm3, mp_irecv_dm4, &
547 mp_irecv_cv, mp_irecv_cm2, mp_irecv_cm3, mp_irecv_cm4, &
548 mp_irecv_zv, mp_irecv_zm2, mp_irecv_zm3, mp_irecv_zm4, &
549 mp_irecv_bv, mp_irecv_bm3, mp_irecv_custom
551 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: probe => mp_probe
553 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: sync => mp_sync
554 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: isync => mp_isync
556 PROCEDURE,
PUBLIC, pass(comm1), non_overridable :: compare => mp_comm_compare
557 PROCEDURE,
PUBLIC, pass(comm1), non_overridable :: rank_compare => mp_rank_compare
559 PROCEDURE,
PUBLIC, pass(comm2), non_overridable :: from_dup => mp_comm_dup
560 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: mp_comm_free
561 generic,
PUBLIC :: free => mp_comm_free
563 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: mp_comm_init
564 generic,
PUBLIC :: init => mp_comm_init
566 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: get_size => mp_comm_size
567 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: get_rank => mp_comm_rank
568 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: get_ndims => mp_comm_get_ndims
569 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: is_source => mp_comm_is_source
572 PROCEDURE,
PRIVATE, pass(sub_comm), non_overridable :: mp_comm_split, mp_comm_split_direct
573 generic,
PUBLIC :: from_split => mp_comm_split, mp_comm_split_direct
574 PROCEDURE,
PUBLIC, pass(mp_new_comm), non_overridable :: from_reordering => mp_reordering
575 PROCEDURE,
PUBLIC, pass(comm_new), non_overridable :: mp_comm_assign
576 generic,
PUBLIC ::
ASSIGNMENT(=) => mp_comm_assign
579 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_tag_ub
580 generic,
PUBLIC :: get_tag_ub => mp_comm_get_tag_ub
581 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_host_rank
582 generic,
PUBLIC :: get_host_rank => mp_comm_get_host_rank
583 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_io_rank
584 generic,
PUBLIC :: get_io_rank => mp_comm_get_io_rank
585 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_wtime_is_global
586 generic,
PUBLIC :: get_wtime_is_global => mp_comm_get_wtime_is_global
591 mpi_request_type :: handle = mp_request_null_handle
593 PROCEDURE,
PUBLIC, non_overridable :: set_handle => mp_request_type_set_handle
594 PROCEDURE,
PUBLIC, non_overridable :: get_handle => mp_request_type_get_handle
595 PROCEDURE,
PRIVATE, non_overridable :: mp_request_op_eq
596 PROCEDURE,
PRIVATE, non_overridable :: mp_request_op_neq
597 generic,
PUBLIC ::
OPERATOR(==) => mp_request_op_eq
598 generic,
PUBLIC ::
OPERATOR(/=) => mp_request_op_neq
600 PROCEDURE,
PUBLIC, pass(request), non_overridable :: test => mp_test_1
602 PROCEDURE,
PUBLIC, pass(request), non_overridable :: wait => mp_wait
607 mpi_win_type :: handle = mp_win_null_handle
609 PROCEDURE,
PUBLIC, non_overridable :: set_handle => mp_win_type_set_handle
610 PROCEDURE,
PUBLIC, non_overridable :: get_handle => mp_win_type_get_handle
611 PROCEDURE,
PRIVATE, non_overridable :: mp_win_op_eq
612 PROCEDURE,
PRIVATE, non_overridable :: mp_win_op_neq
613 generic,
PUBLIC ::
OPERATOR(==) => mp_win_op_eq
614 generic,
PUBLIC ::
OPERATOR(/=) => mp_win_op_neq
616 PROCEDURE,
PRIVATE, pass(win), non_overridable :: mp_win_create_iv, mp_win_create_lv, &
617 mp_win_create_rv, mp_win_create_dv, mp_win_create_cv, mp_win_create_zv
618 generic,
PUBLIC :: create => mp_win_create_iv, mp_win_create_lv, &
619 mp_win_create_rv, mp_win_create_dv, mp_win_create_cv, mp_win_create_zv
621 PROCEDURE,
PRIVATE, pass(win), non_overridable :: mp_rget_iv, mp_rget_lv, &
622 mp_rget_rv, mp_rget_dv, mp_rget_cv, mp_rget_zv
623 generic,
PUBLIC :: rget => mp_rget_iv, mp_rget_lv, &
624 mp_rget_rv, mp_rget_dv, mp_rget_cv, mp_rget_zv
626 PROCEDURE,
PUBLIC, pass(win), non_overridable :: free => mp_win_free
627 PROCEDURE,
PUBLIC, pass(win_new), non_overridable :: mp_win_assign
628 generic,
PUBLIC ::
ASSIGNMENT(=) => mp_win_assign
630 PROCEDURE,
PUBLIC, pass(win), non_overridable :: lock_all => mp_win_lock_all
631 PROCEDURE,
PUBLIC, pass(win), non_overridable :: unlock_all => mp_win_unlock_all
632 PROCEDURE,
PUBLIC, pass(win), non_overridable :: flush_all => mp_win_flush_all
637 mpi_file_type :: handle = mp_file_null_handle
639 PROCEDURE,
PUBLIC, non_overridable :: set_handle => mp_file_type_set_handle
640 PROCEDURE,
PUBLIC, non_overridable :: get_handle => mp_file_type_get_handle
641 PROCEDURE,
PRIVATE, non_overridable :: mp_file_op_eq
642 PROCEDURE,
PRIVATE, non_overridable :: mp_file_op_neq
643 generic,
PUBLIC ::
OPERATOR(==) => mp_file_op_eq
644 generic,
PUBLIC ::
OPERATOR(/=) => mp_file_op_neq
646 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_write_at_ch, mp_file_write_at_chv, &
647 mp_file_write_at_i, mp_file_write_at_iv, mp_file_write_at_r, mp_file_write_at_rv, &
648 mp_file_write_at_d, mp_file_write_at_dv, mp_file_write_at_c, mp_file_write_at_cv, &
649 mp_file_write_at_z, mp_file_write_at_zv, mp_file_write_at_l, mp_file_write_at_lv
650 generic,
PUBLIC :: write_at => mp_file_write_at_ch, mp_file_write_at_chv, &
651 mp_file_write_at_i, mp_file_write_at_iv, mp_file_write_at_r, mp_file_write_at_rv, &
652 mp_file_write_at_d, mp_file_write_at_dv, mp_file_write_at_c, mp_file_write_at_cv, &
653 mp_file_write_at_z, mp_file_write_at_zv, mp_file_write_at_l, mp_file_write_at_lv
655 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_write_at_all_ch, mp_file_write_at_all_chv, &
656 mp_file_write_at_all_i, mp_file_write_at_all_iv, mp_file_write_at_all_l, mp_file_write_at_all_lv, &
657 mp_file_write_at_all_r, mp_file_write_at_all_rv, mp_file_write_at_all_d, mp_file_write_at_all_dv, &
658 mp_file_write_at_all_c, mp_file_write_at_all_cv, mp_file_write_at_all_z, mp_file_write_at_all_zv
659 generic,
PUBLIC :: write_at_all => mp_file_write_at_all_ch, mp_file_write_at_all_chv, &
660 mp_file_write_at_all_i, mp_file_write_at_all_iv, mp_file_write_at_all_l, mp_file_write_at_all_lv, &
661 mp_file_write_at_all_r, mp_file_write_at_all_rv, mp_file_write_at_all_d, mp_file_write_at_all_dv, &
662 mp_file_write_at_all_c, mp_file_write_at_all_cv, mp_file_write_at_all_z, mp_file_write_at_all_zv
664 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_read_at_ch, mp_file_read_at_chv, &
665 mp_file_read_at_i, mp_file_read_at_iv, mp_file_read_at_r, mp_file_read_at_rv, &
666 mp_file_read_at_d, mp_file_read_at_dv, mp_file_read_at_c, mp_file_read_at_cv, &
667 mp_file_read_at_z, mp_file_read_at_zv, mp_file_read_at_l, mp_file_read_at_lv
668 generic,
PUBLIC :: read_at => mp_file_read_at_ch, mp_file_read_at_chv, &
669 mp_file_read_at_i, mp_file_read_at_iv, mp_file_read_at_r, mp_file_read_at_rv, &
670 mp_file_read_at_d, mp_file_read_at_dv, mp_file_read_at_c, mp_file_read_at_cv, &
671 mp_file_read_at_z, mp_file_read_at_zv, mp_file_read_at_l, mp_file_read_at_lv
673 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_read_at_all_ch, mp_file_read_at_all_chv, &
674 mp_file_read_at_all_i, mp_file_read_at_all_iv, mp_file_read_at_all_l, mp_file_read_at_all_lv, &
675 mp_file_read_at_all_r, mp_file_read_at_all_rv, mp_file_read_at_all_d, mp_file_read_at_all_dv, &
676 mp_file_read_at_all_c, mp_file_read_at_all_cv, mp_file_read_at_all_z, mp_file_read_at_all_zv
677 generic,
PUBLIC :: read_at_all => mp_file_read_at_all_ch, mp_file_read_at_all_chv, &
678 mp_file_read_at_all_i, mp_file_read_at_all_iv, mp_file_read_at_all_l, mp_file_read_at_all_lv, &
679 mp_file_read_at_all_r, mp_file_read_at_all_rv, mp_file_read_at_all_d, mp_file_read_at_all_dv, &
680 mp_file_read_at_all_c, mp_file_read_at_all_cv, mp_file_read_at_all_z, mp_file_read_at_all_zv
682 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: open => mp_file_open
683 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: close => mp_file_close
684 PROCEDURE,
PRIVATE, pass(fh_new), non_overridable :: mp_file_assign
685 generic,
PUBLIC ::
ASSIGNMENT(=) => mp_file_assign
687 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: get_size => mp_file_get_size
688 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: get_position => mp_file_get_position
690 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: read_all => mp_file_read_all_chv
691 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: write_all => mp_file_write_all_chv
696 mpi_info_type :: handle = mp_info_null_handle
698 PROCEDURE, NON_OVERRIDABLE :: set_handle => mp_info_type_set_handle
699 PROCEDURE, non_overridable :: get_handle => mp_info_type_get_handle
700 PROCEDURE,
PRIVATE, non_overridable :: mp_info_op_eq
701 PROCEDURE,
PRIVATE, non_overridable :: mp_info_op_neq
702 generic,
PUBLIC ::
OPERATOR(==) => mp_info_op_eq
703 generic,
PUBLIC ::
OPERATOR(/=) => mp_info_op_neq
707 INTEGER,
DIMENSION(:),
ALLOCATABLE,
PUBLIC :: mepos_cart, num_pe_cart
708 LOGICAL,
DIMENSION(:),
ALLOCATABLE,
PUBLIC :: periodic
710 PROCEDURE,
PUBLIC, pass(comm_cart), non_overridable :: create => mp_cart_create
711 PROCEDURE,
PUBLIC, pass(sub_comm), non_overridable :: from_sub => mp_cart_sub
713 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: get_info_cart => mp_cart_get
715 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: coords => mp_cart_coords
716 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: rank_cart => mp_cart_rank
732 LOGICAL :: owns_group = .true.
733 INTEGER :: ref_count = -1
735 PROCEDURE,
PUBLIC, pass(para_env), non_overridable :: retain => mp_para_env_retain
736 PROCEDURE,
PUBLIC, pass(para_env), non_overridable :: is_valid => mp_para_env_is_valid
769 LOGICAL :: owns_group = .true.
770 INTEGER :: ref_count = -1
772 PROCEDURE,
PUBLIC, pass(cart), non_overridable :: retain => mp_para_cart_retain
773 PROCEDURE,
PUBLIC, pass(cart), non_overridable :: is_valid => mp_para_cart_is_valid
785#if !defined(__parallel)
787 INTEGER,
PARAMETER,
PRIVATE :: mp_comm_default_handle = 1
804 PUBLIC :: cp2k_is_parallel
837 MODULE PROCEDURE mp_waitall_1, mp_waitall_2
841 MODULE PROCEDURE mp_testall_tv
845 MODULE PROCEDURE mp_testany_1, mp_testany_2
848 INTERFACE mp_type_free
849 MODULE PROCEDURE mp_type_free_m, mp_type_free_v
857 MODULE PROCEDURE mp_allocate_i, &
866 MODULE PROCEDURE mp_deallocate_i, &
875 MODULE PROCEDURE mp_type_make_struct
876 MODULE PROCEDURE mp_type_make_i, mp_type_make_l, &
877 mp_type_make_r, mp_type_make_d, &
878 mp_type_make_c, mp_type_make_z
881 INTERFACE mp_alloc_mem
882 MODULE PROCEDURE mp_alloc_mem_i, mp_alloc_mem_l, &
883 mp_alloc_mem_d, mp_alloc_mem_z, &
884 mp_alloc_mem_r, mp_alloc_mem_c
887 INTERFACE mp_free_mem
888 MODULE PROCEDURE mp_free_mem_i, mp_free_mem_l, &
889 mp_free_mem_d, mp_free_mem_z, &
890 mp_free_mem_r, mp_free_mem_c
894 TYPE mp_indexing_meta_type
895 INTEGER,
DIMENSION(:),
POINTER :: index => null(), chunks => null()
896 END TYPE mp_indexing_meta_type
899 mpi_data_type :: type_handle = mp_datatype_null_handle
900 INTEGER :: length = -1
901#if defined(__parallel)
902 INTEGER(kind=mpi_address_kind) :: base = -1
904 INTEGER(kind=int_4),
DIMENSION(:),
POINTER :: data_i => null()
905 INTEGER(kind=int_8),
DIMENSION(:),
POINTER :: data_l => null()
906 REAL(kind=
real_4),
DIMENSION(:),
POINTER :: data_r => null()
907 REAL(kind=
real_8),
DIMENSION(:),
POINTER :: data_d => null()
908 COMPLEX(kind=real_4),
DIMENSION(:),
POINTER :: data_c => null()
909 COMPLEX(kind=real_8),
DIMENSION(:),
POINTER :: data_z => null()
911 INTEGER :: vector_descriptor(2) = -1
912 LOGICAL :: has_indexing = .false.
913 TYPE(mp_indexing_meta_type) :: index_descriptor = mp_indexing_meta_type()
916 TYPE mp_file_indexing_meta_type
917 INTEGER,
DIMENSION(:),
POINTER :: index => null()
918 INTEGER(kind=file_offset), &
919 DIMENSION(:),
POINTER :: chunks => null()
920 END TYPE mp_file_indexing_meta_type
923 mpi_data_type :: type_handle = mp_datatype_null_handle
924 INTEGER :: length = -1
925 LOGICAL :: has_indexing = .false.
926 TYPE(mp_file_indexing_meta_type) :: index_descriptor = mp_file_indexing_meta_type()
930 INTEGER,
PARAMETER ::
intlen = bit_size(0)/8
931 INTEGER,
PARAMETER :: reallen = 8
932 INTEGER,
PARAMETER :: loglen = bit_size(0)/8
933 INTEGER,
PARAMETER :: charlen = 1
939 LOGICAL FUNCTION mp_comm_op_eq(comm1, comm2)
941#if defined(__parallel) && defined(__MPI_F08)
942 mp_comm_op_eq = (comm1%handle%mpi_val == comm2%handle%mpi_val)
944 mp_comm_op_eq = (comm1%handle == comm2%handle)
946 END FUNCTION mp_comm_op_eq
948 LOGICAL FUNCTION mp_comm_op_neq(comm1, comm2)
950#if defined(__parallel) && defined(__MPI_F08)
951 mp_comm_op_neq = (comm1%handle%mpi_val /= comm2%handle%mpi_val)
953 mp_comm_op_neq = (comm1%handle /= comm2%handle)
955 END FUNCTION mp_comm_op_neq
957 ELEMENTAL IMPURE SUBROUTINE mp_comm_type_set_handle(this, handle , ndims)
959 INTEGER,
INTENT(IN) :: handle
960 INTEGER,
INTENT(IN),
OPTIONAL :: ndims
962#if defined(__parallel) && defined(__MPI_F08)
963 this%handle%mpi_val = handle
970 IF (.NOT.
PRESENT(ndims)) &
971 CALL cp_abort(__location__, &
972 "Setup of a cartesian communicator requires information on the number of dimensions!")
974 IF (
PRESENT(ndims)) this%ndims = ndims
977 END SUBROUTINE mp_comm_type_set_handle
979 ELEMENTAL FUNCTION mp_comm_type_get_handle(this)
RESULT(handle)
983#if defined(__parallel) && defined(__MPI_F08)
984 handle = this%handle%mpi_val
988 END FUNCTION mp_comm_type_get_handle
989 LOGICAL FUNCTION mp_request_op_eq(request1, request2)
991#if defined(__parallel) && defined(__MPI_F08)
992 mp_request_op_eq = (request1%handle%mpi_val == request2%handle%mpi_val)
994 mp_request_op_eq = (request1%handle == request2%handle)
996 END FUNCTION mp_request_op_eq
998 LOGICAL FUNCTION mp_request_op_neq(request1, request2)
1000#if defined(__parallel) && defined(__MPI_F08)
1001 mp_request_op_neq = (request1%handle%mpi_val /= request2%handle%mpi_val)
1003 mp_request_op_neq = (request1%handle /= request2%handle)
1005 END FUNCTION mp_request_op_neq
1007 ELEMENTAL SUBROUTINE mp_request_type_set_handle(this, handle )
1009 INTEGER,
INTENT(IN) :: handle
1011#if defined(__parallel) && defined(__MPI_F08)
1012 this%handle%mpi_val = handle
1014 this%handle = handle
1018 END SUBROUTINE mp_request_type_set_handle
1020 ELEMENTAL FUNCTION mp_request_type_get_handle(this)
RESULT(handle)
1024#if defined(__parallel) && defined(__MPI_F08)
1025 handle = this%handle%mpi_val
1027 handle = this%handle
1029 END FUNCTION mp_request_type_get_handle
1030 LOGICAL FUNCTION mp_win_op_eq(win1, win2)
1032#if defined(__parallel) && defined(__MPI_F08)
1033 mp_win_op_eq = (win1%handle%mpi_val == win2%handle%mpi_val)
1035 mp_win_op_eq = (win1%handle == win2%handle)
1037 END FUNCTION mp_win_op_eq
1039 LOGICAL FUNCTION mp_win_op_neq(win1, win2)
1041#if defined(__parallel) && defined(__MPI_F08)
1042 mp_win_op_neq = (win1%handle%mpi_val /= win2%handle%mpi_val)
1044 mp_win_op_neq = (win1%handle /= win2%handle)
1046 END FUNCTION mp_win_op_neq
1048 ELEMENTAL SUBROUTINE mp_win_type_set_handle(this, handle )
1050 INTEGER,
INTENT(IN) :: handle
1052#if defined(__parallel) && defined(__MPI_F08)
1053 this%handle%mpi_val = handle
1055 this%handle = handle
1059 END SUBROUTINE mp_win_type_set_handle
1061 ELEMENTAL FUNCTION mp_win_type_get_handle(this)
RESULT(handle)
1065#if defined(__parallel) && defined(__MPI_F08)
1066 handle = this%handle%mpi_val
1068 handle = this%handle
1070 END FUNCTION mp_win_type_get_handle
1071 LOGICAL FUNCTION mp_file_op_eq(file1, file2)
1073#if defined(__parallel) && defined(__MPI_F08)
1074 mp_file_op_eq = (file1%handle%mpi_val == file2%handle%mpi_val)
1076 mp_file_op_eq = (file1%handle == file2%handle)
1078 END FUNCTION mp_file_op_eq
1080 LOGICAL FUNCTION mp_file_op_neq(file1, file2)
1082#if defined(__parallel) && defined(__MPI_F08)
1083 mp_file_op_neq = (file1%handle%mpi_val /= file2%handle%mpi_val)
1085 mp_file_op_neq = (file1%handle /= file2%handle)
1087 END FUNCTION mp_file_op_neq
1089 ELEMENTAL SUBROUTINE mp_file_type_set_handle(this, handle )
1091 INTEGER,
INTENT(IN) :: handle
1093#if defined(__parallel) && defined(__MPI_F08)
1094 this%handle%mpi_val = handle
1096 this%handle = handle
1100 END SUBROUTINE mp_file_type_set_handle
1102 ELEMENTAL FUNCTION mp_file_type_get_handle(this)
RESULT(handle)
1106#if defined(__parallel) && defined(__MPI_F08)
1107 handle = this%handle%mpi_val
1109 handle = this%handle
1111 END FUNCTION mp_file_type_get_handle
1112 LOGICAL FUNCTION mp_info_op_eq(info1, info2)
1114#if defined(__parallel) && defined(__MPI_F08)
1115 mp_info_op_eq = (info1%handle%mpi_val == info2%handle%mpi_val)
1117 mp_info_op_eq = (info1%handle == info2%handle)
1119 END FUNCTION mp_info_op_eq
1121 LOGICAL FUNCTION mp_info_op_neq(info1, info2)
1123#if defined(__parallel) && defined(__MPI_F08)
1124 mp_info_op_neq = (info1%handle%mpi_val /= info2%handle%mpi_val)
1126 mp_info_op_neq = (info1%handle /= info2%handle)
1128 END FUNCTION mp_info_op_neq
1130 ELEMENTAL SUBROUTINE mp_info_type_set_handle(this, handle )
1132 INTEGER,
INTENT(IN) :: handle
1134#if defined(__parallel) && defined(__MPI_F08)
1135 this%handle%mpi_val = handle
1137 this%handle = handle
1141 END SUBROUTINE mp_info_type_set_handle
1143 ELEMENTAL FUNCTION mp_info_type_get_handle(this)
RESULT(handle)
1147#if defined(__parallel) && defined(__MPI_F08)
1148 handle = this%handle%mpi_val
1150 handle = this%handle
1152 END FUNCTION mp_info_type_get_handle
1154 FUNCTION mp_comm_get_tag_ub(comm)
RESULT(tag_ub)
1158#if defined(__parallel)
1161 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1163 CALL mpi_comm_get_attr(comm%handle, mpi_tag_ub, attrval, flag, ierr)
1164 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_tag_ub")
1165 IF (.NOT. flag)
THEN
1166 CALL cp_warn(__location__,
"Upper bound of tags not available! "// &
1167 "Only the guaranteed minimum of 32767 is used.")
1170 tag_ub = int(attrval, kind=kind(tag_ub))
1176 END FUNCTION mp_comm_get_tag_ub
1178 FUNCTION mp_comm_get_host_rank(comm)
RESULT(host_rank)
1180 INTEGER :: host_rank
1182#if defined(__parallel)
1185 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1187 CALL mpi_comm_get_attr(comm%handle, mpi_host, attrval, flag, ierr)
1188 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_host_rank")
1189 IF (.NOT. flag) cpabort(
"Host process rank not available!")
1190 host_rank = int(attrval, kind=kind(host_rank))
1195 END FUNCTION mp_comm_get_host_rank
1197 FUNCTION mp_comm_get_io_rank(comm)
RESULT(io_rank)
1201#if defined(__parallel)
1204 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1206 CALL mpi_comm_get_attr(comm%handle, mpi_io, attrval, flag, ierr)
1207 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_io_rank")
1208 IF (.NOT. flag) cpabort(
"IO rank not available!")
1209 io_rank = int(attrval, kind=kind(io_rank))
1214 END FUNCTION mp_comm_get_io_rank
1216 FUNCTION mp_comm_get_wtime_is_global(comm)
RESULT(wtime_is_global)
1218 LOGICAL :: wtime_is_global
1220#if defined(__parallel)
1223 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1225 CALL mpi_comm_get_attr(comm%handle, mpi_tag_ub, attrval, flag, ierr)
1226 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_wtime_is_global")
1227 IF (.NOT. flag) cpabort(
"Synchronization state of WTIME not available!")
1228 wtime_is_global = (attrval == 1_mpi_address_kind)
1231 wtime_is_global = .true.
1233 END FUNCTION mp_comm_get_wtime_is_global
1245#if defined(__parallel)
1246 INTEGER :: ierr, provided_tsl
1248 INTEGER :: mimic_handle
1252#if defined(__DLAF) || defined(__OPENPMD)
1255 CALL mpi_init_thread(mpi_thread_multiple, provided_tsl, ierr)
1256 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_init_thread @ mp_world_init")
1257 IF (provided_tsl < mpi_thread_multiple)
THEN
1258 CALL mp_stop(0,
"MPI library does not support the requested level of threading (MPI_THREAD_MULTIPLE),"// &
1259 " required by DLA-Future/openPMD-api. Build CP2K without DLA-Future and openPMD-api.")
1262 CALL mpi_init_thread(mpi_thread_serialized, provided_tsl, ierr)
1263 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_init_thread @ mp_world_init")
1264 IF (provided_tsl < mpi_thread_serialized)
THEN
1265 CALL mp_stop(0,
"MPI library does not support the requested level of threading (MPI_THREAD_SERIALIZED).")
1269 CALL mpi_comm_set_errhandler(mpi_comm_world, mpi_errors_return, ierr)
1270 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_set_errhandler @ mp_world_init")
1272 debug_comm_count = 1
1275 mimic_handle = mp_comm%get_handle()
1276 CALL mcl_initialize(mimic_handle)
1277 CALL mp_comm%set_handle(mimic_handle)
1278#if defined(__MPI_F08)
1279 mimic_comm_world%mpi_val = mimic_handle
1281 mimic_comm_world = mimic_handle
1299 SUBROUTINE mp_reordering(mp_comm, mp_new_comm, ranks_order)
1302 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: ranks_order
1304 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_reordering'
1306 INTEGER :: handle, ierr
1307#if defined(__parallel)
1308 mpi_group_type :: newgroup, oldgroup
1311 CALL mp_timeset(routinen, handle)
1313#if defined(__parallel)
1315 CALL mpi_comm_group(mp_comm%handle, oldgroup, ierr)
1316 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_reordering")
1317 CALL mpi_group_incl(oldgroup,
SIZE(ranks_order), ranks_order, newgroup, ierr)
1318 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_incl @ mp_reordering")
1320 CALL mpi_comm_create(mp_comm%handle, newgroup, mp_new_comm%handle, ierr)
1321 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_create @ mp_reordering")
1323 CALL mpi_group_free(oldgroup, ierr)
1324 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_free @ mp_reordering")
1325 CALL mpi_group_free(newgroup, ierr)
1326 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_free @ mp_reordering")
1331 mark_used(ranks_order)
1332 mp_new_comm%handle = mp_comm_default_handle
1334 debug_comm_count = debug_comm_count + 1
1335 CALL mp_new_comm%init()
1336 CALL mp_timestop(handle)
1337 END SUBROUTINE mp_reordering
1346 CHARACTER(LEN=default_string_length) :: debug_comm_count_char
1347#if defined(__parallel)
1350 CALL mpi_barrier(mimic_comm_world, ierr)
1352 CALL mpi_barrier(mpi_comm_world, ierr)
1357 debug_comm_count = debug_comm_count - 1
1358#if defined(__parallel)
1359 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_barrier @ mp_world_finalize")
1361 IF (debug_comm_count /= 0)
THEN
1364 WRITE (unit=debug_comm_count_char, fmt=
'(I2)') debug_comm_count
1365 CALL cp_abort(__location__,
"mp_world_finalize: assert failed:"// &
1366 " leaking communicators "//adjustl(trim(debug_comm_count_char)))
1368#if defined(__parallel)
1369 CALL mpi_finalize(ierr)
1370 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_finalize @ mp_world_finalize")
1384 LOGICAL :: mcl_initialized
1389#if !defined(__NO_ABORT)
1390#if defined(__parallel)
1392 CALL mcl_is_initialized(mcl_initialized)
1393 IF (mcl_initialized)
CALL mcl_abort(1, ierr)
1395 CALL mpi_abort(mpi_comm_world, 1, ierr)
1411 SUBROUTINE mp_stop(ierr, prg_code)
1412 INTEGER,
INTENT(IN) :: ierr
1413 CHARACTER(LEN=*),
INTENT(IN) :: prg_code
1415#if defined(__parallel)
1416 INTEGER :: istat, len
1417 CHARACTER(LEN=MPI_MAX_ERROR_STRING) :: error_string
1418 CHARACTER(LEN=MPI_MAX_ERROR_STRING + 512) :: full_error
1420 CHARACTER(LEN=512) :: full_error
1423#if defined(__parallel)
1424 CALL mpi_error_string(ierr, error_string, len, istat)
1425 WRITE (full_error,
'(A,I0,A)')
' MPI error ', ierr,
' in '//trim(prg_code)//
' : '//error_string(1:len)
1427 WRITE (full_error,
'(A,I0,A)')
' MPI error (!?) ', ierr,
' in '//trim(prg_code)
1432 END SUBROUTINE mp_stop
1438 SUBROUTINE mp_sync(comm)
1441 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sync'
1443 INTEGER :: handle, ierr
1446 CALL mp_timeset(routinen, handle)
1448#if defined(__parallel)
1449 CALL mpi_barrier(comm%handle, ierr)
1450 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_barrier @ mp_sync")
1455 CALL mp_timestop(handle)
1457 END SUBROUTINE mp_sync
1464 SUBROUTINE mp_isync(comm, request)
1468 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isync'
1470 INTEGER :: handle, ierr
1473 CALL mp_timeset(routinen, handle)
1475#if defined(__parallel)
1476 CALL mpi_ibarrier(comm%handle, request%handle, ierr)
1477 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibarrier @ mp_isync")
1483 CALL mp_timestop(handle)
1485 END SUBROUTINE mp_isync
1492 SUBROUTINE mp_comm_rank(taskid, comm)
1494 INTEGER,
INTENT(OUT) :: taskid
1497 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_rank'
1500#if defined(__parallel)
1504 CALL mp_timeset(routinen, handle)
1506#if defined(__parallel)
1507 CALL mpi_comm_rank(comm%handle, taskid, ierr)
1508 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ mp_comm_rank")
1513 CALL mp_timestop(handle)
1515 END SUBROUTINE mp_comm_rank
1522 SUBROUTINE mp_comm_size(numtask, comm)
1524 INTEGER,
INTENT(OUT) :: numtask
1527 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_size'
1530#if defined(__parallel)
1534 CALL mp_timeset(routinen, handle)
1536#if defined(__parallel)
1537 CALL mpi_comm_size(comm%handle, numtask, ierr)
1538 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ mp_comm_size")
1543 CALL mp_timestop(handle)
1545 END SUBROUTINE mp_comm_size
1555 SUBROUTINE mp_cart_get(comm, dims, task_coor, periods)
1558 INTEGER,
INTENT(OUT),
OPTIONAL :: dims(comm%ndims), task_coor(comm%ndims)
1559 LOGICAL,
INTENT(out),
OPTIONAL :: periods(comm%ndims)
1561 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_get'
1564#if defined(__parallel)
1566 INTEGER :: my_dims(comm%ndims), my_task_coor(comm%ndims)
1567 LOGICAL :: my_periods(comm%ndims)
1570 CALL mp_timeset(routinen, handle)
1572#if defined(__parallel)
1573 CALL mpi_cart_get(comm%handle, comm%ndims, my_dims, my_periods, my_task_coor, ierr)
1574 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_get @ mp_cart_get")
1575 IF (
PRESENT(dims)) dims = my_dims
1576 IF (
PRESENT(task_coor)) task_coor = my_task_coor
1577 IF (
PRESENT(periods)) periods = my_periods
1580 IF (
PRESENT(task_coor)) task_coor = 0
1581 IF (
PRESENT(dims)) dims = 1
1582 IF (
PRESENT(periods)) periods = .false.
1584 CALL mp_timestop(handle)
1586 END SUBROUTINE mp_cart_get
1588 INTEGER ELEMENTAL function mp_comm_get_ndims(comm)
1591 mp_comm_get_ndims = comm%ndims
1603 SUBROUTINE mp_cart_create(comm_old, ndims, dims, comm_cart)
1606 INTEGER,
INTENT(IN) :: ndims
1607 INTEGER,
INTENT(INOUT) :: dims(ndims)
1610 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_create'
1612 INTEGER :: handle, ierr
1613#if defined(__parallel)
1614 LOGICAL,
DIMENSION(1:ndims) :: period
1619 CALL mp_timeset(routinen, handle)
1621 comm_cart%handle = comm_old%handle
1622#if defined(__parallel)
1624 IF (any(dims == 0))
CALL mpi_dims_create(comm_old%num_pe, ndims, dims, ierr)
1625 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_dims_create @ mp_cart_create")
1632 CALL mpi_cart_create(comm_old%handle, ndims, dims, period, reorder, comm_cart%handle, &
1634 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_create @ mp_cart_create")
1635 CALL add_perf(perf_id=1, count=1)
1638 comm_cart%handle = mp_comm_default_handle
1640 comm_cart%ndims = ndims
1641 debug_comm_count = debug_comm_count + 1
1642 CALL comm_cart%init()
1643 CALL mp_timestop(handle)
1645 END SUBROUTINE mp_cart_create
1653 SUBROUTINE mp_cart_coords(comm, rank, coords)
1656 INTEGER,
INTENT(IN) :: rank
1657 INTEGER,
DIMENSION(:),
INTENT(OUT) :: coords
1659 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_coords'
1661 INTEGER :: handle, ierr, m
1664 CALL mp_timeset(routinen, handle)
1667#if defined(__parallel)
1668 CALL mpi_cart_coords(comm%handle, rank, m, coords, ierr)
1669 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_coords @ mp_cart_coords")
1675 CALL mp_timestop(handle)
1677 END SUBROUTINE mp_cart_coords
1685 FUNCTION mp_comm_compare(comm1, comm2)
RESULT(res)
1690 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_compare'
1693#if defined(__parallel)
1694 INTEGER :: ierr, iout
1697 CALL mp_timeset(routinen, handle)
1700#if defined(__parallel)
1701 CALL mpi_comm_compare(comm1%handle, comm2%handle, iout, ierr)
1702 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_compare @ mp_comm_compare")
1706 CASE (mpi_congruent)
1713 cpabort(
"Unknown comparison state of the communicators!")
1719 CALL mp_timestop(handle)
1721 END FUNCTION mp_comm_compare
1729 SUBROUTINE mp_cart_sub(comm, rdim, sub_comm)
1732 LOGICAL,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: rdim
1735 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_sub'
1738#if defined(__parallel)
1742 CALL mp_timeset(routinen, handle)
1744#if defined(__parallel)
1745 CALL mpi_cart_sub(comm%handle, rdim, sub_comm%handle, ierr)
1746 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_sub @ mp_cart_sub")
1750 sub_comm%handle = mp_comm_default_handle
1752 sub_comm%ndims = count(rdim)
1753 debug_comm_count = debug_comm_count + 1
1754 CALL sub_comm%init()
1755 CALL mp_timestop(handle)
1757 END SUBROUTINE mp_cart_sub
1763 SUBROUTINE mp_comm_free(comm)
1767 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_free'
1770 LOGICAL :: free_comm
1771#if defined(__parallel)
1779 IF (comm%ref_count <= 0) &
1780 cpabort(
"para_env%ref_count <= 0")
1781 comm%ref_count = comm%ref_count - 1
1782 IF (comm%ref_count <= 0)
THEN
1783 free_comm = comm%owns_group
1787 IF (comm%ref_count <= 0) &
1788 cpabort(
"para_cart%ref_count <= 0")
1789 comm%ref_count = comm%ref_count - 1
1790 IF (comm%ref_count <= 0)
THEN
1791 free_comm = comm%owns_group
1795 CALL mp_timeset(routinen, handle)
1798#if defined(__parallel)
1799 CALL mpi_comm_free(comm%handle, ierr)
1800 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_free @ mp_comm_free")
1802 comm%handle = mp_comm_null_handle
1804 debug_comm_count = debug_comm_count - 1
1809 DEALLOCATE (comm%periodic, comm%mepos_cart, comm%num_pe_cart)
1812 CALL mp_timestop(handle)
1814 END SUBROUTINE mp_comm_free
1821 ELEMENTAL LOGICAL FUNCTION mp_para_env_is_valid(para_env)
1824 mp_para_env_is_valid = para_env%ref_count > 0
1826 END FUNCTION mp_para_env_is_valid
1832 ELEMENTAL SUBROUTINE mp_para_env_retain(para_env)
1835 para_env%ref_count = para_env%ref_count + 1
1837 END SUBROUTINE mp_para_env_retain
1844 ELEMENTAL LOGICAL FUNCTION mp_para_cart_is_valid(cart)
1847 mp_para_cart_is_valid = cart%ref_count > 0
1849 END FUNCTION mp_para_cart_is_valid
1855 ELEMENTAL SUBROUTINE mp_para_cart_retain(cart)
1858 cart%ref_count = cart%ref_count + 1
1860 END SUBROUTINE mp_para_cart_retain
1867 SUBROUTINE mp_comm_dup(comm1, comm2)
1872 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_dup'
1875#if defined(__parallel)
1879 CALL mp_timeset(routinen, handle)
1881#if defined(__parallel)
1882 CALL mpi_comm_dup(comm1%handle, comm2%handle, ierr)
1883 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_dup @ mp_comm_dup")
1886 comm2%handle = mp_comm_default_handle
1888 comm2%ndims = comm1%ndims
1889 debug_comm_count = debug_comm_count + 1
1891 CALL mp_timestop(handle)
1893 END SUBROUTINE mp_comm_dup
1900 ELEMENTAL IMPURE SUBROUTINE mp_comm_assign(comm_new, comm_old)
1904 comm_new%handle = comm_old%handle
1905 comm_new%ndims = comm_old%ndims
1906 CALL comm_new%init(.false.)
1914 ELEMENTAL LOGICAL FUNCTION mp_comm_is_source(comm)
1917 mp_comm_is_source = comm%source == comm%mepos
1919 END FUNCTION mp_comm_is_source
1925 ELEMENTAL IMPURE SUBROUTINE mp_comm_init(comm, owns_group)
1927 LOGICAL,
INTENT(IN),
OPTIONAL :: owns_group
1929 IF (comm%handle mpi_get_comp /= mp_comm_null_handle mpi_get_comp)
THEN
1931 CALL comm%get_size(comm%num_pe)
1932 CALL comm%get_rank(comm%mepos)
1937 IF (
ALLOCATED(comm%periodic))
DEALLOCATE (comm%periodic)
1938 IF (
ALLOCATED(comm%mepos_cart))
DEALLOCATE (comm%mepos_cart)
1939 IF (
ALLOCATED(comm%num_pe_cart))
DEALLOCATE (comm%num_pe_cart)
1941 associate(ndims => comm%ndims)
1943 ALLOCATE (comm%periodic(ndims), comm%mepos_cart(ndims), &
1944 comm%num_pe_cart(ndims))
1948 comm%periodic = .false.
1949 IF (comm%handle mpi_get_comp /= mp_comm_null_handle mpi_get_comp)
THEN
1950 CALL comm%get_info_cart(comm%num_pe_cart, comm%mepos_cart, &
1957 IF (
PRESENT(owns_group)) comm%owns_group = owns_group
1960 IF (
PRESENT(owns_group)) comm%owns_group = owns_group
1978 IF (
ASSOCIATED(para_env)) &
1979 cpabort(
"The passed para_env must not be associated!")
1981 para_env%mp_comm_type = group
1982 CALL para_env%init()
1999 IF (
ASSOCIATED(para_env))
THEN
2000 CALL para_env%free()
2001 IF (.NOT. para_env%is_valid())
DEALLOCATE (para_env)
2016 IF (
ASSOCIATED(cart)) &
2017 cpabort(
"The passed para_cart must not be associated!")
2019 cart%mp_cart_type = group
2032 IF (
ASSOCIATED(cart))
THEN
2034 IF (.NOT. cart%is_valid())
DEALLOCATE (cart)
2045 SUBROUTINE mp_rank_compare(comm1, comm2, rank)
2048 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rank
2050 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rank_compare'
2053#if defined(__parallel)
2054 INTEGER :: i, ierr, n, n1, n2
2055 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: rin
2056 mpi_group_type :: g1, g2
2059 CALL mp_timeset(routinen, handle)
2062#if defined(__parallel)
2063 CALL mpi_comm_size(comm1%handle, n1, ierr)
2064 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ mp_rank_compare")
2065 CALL mpi_comm_size(comm2%handle, n2, ierr)
2066 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ mp_rank_compare")
2068 CALL mpi_comm_group(comm1%handle, g1, ierr)
2069 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_rank_compare")
2070 CALL mpi_comm_group(comm2%handle, g2, ierr)
2071 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_rank_compare")
2072 ALLOCATE (rin(0:n - 1), stat=ierr)
2074 cpabort(
"allocate @ mp_rank_compare")
2078 CALL mpi_group_translate_ranks(g1, n, rin, g2, rank, ierr)
2079 IF (ierr /= 0)
CALL mp_stop(ierr, &
2080 "mpi_group_translate_rank @ mp_rank_compare")
2081 CALL mpi_group_free(g1, ierr)
2083 cpabort(
"group_free @ mp_rank_compare")
2084 CALL mpi_group_free(g2, ierr)
2086 cpabort(
"group_free @ mp_rank_compare")
2092 CALL mp_timestop(handle)
2094 END SUBROUTINE mp_rank_compare
2103 INTEGER,
INTENT(IN) :: nodes
2104 INTEGER,
DIMENSION(:),
INTENT(INOUT) :: dims
2106 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_dims_create'
2108 INTEGER :: handle, ndim
2109#if defined(__parallel)
2113 CALL mp_timeset(routinen, handle)
2116#if defined(__parallel)
2117 IF (any(dims == 0))
CALL mpi_dims_create(nodes, ndim, dims, ierr)
2118 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_dims_create @ mp_dims_create")
2123 CALL mp_timestop(handle)
2133 SUBROUTINE mp_cart_rank(comm, pos, rank)
2135 INTEGER,
DIMENSION(:),
INTENT(IN) :: pos
2136 INTEGER,
INTENT(OUT) :: rank
2138 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_rank'
2141#if defined(__parallel)
2145 CALL mp_timeset(routinen, handle)
2147#if defined(__parallel)
2148 CALL mpi_cart_rank(comm%handle, pos, rank, ierr)
2149 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_rank @ mp_cart_rank")
2155 CALL mp_timestop(handle)
2157 END SUBROUTINE mp_cart_rank
2168 SUBROUTINE mp_wait(request)
2171 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_wait'
2174#if defined(__parallel)
2178 CALL mp_timeset(routinen, handle)
2180#if defined(__parallel)
2182 CALL mpi_wait(request%handle, mpi_status_ignore, ierr)
2183 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_wait @ mp_wait")
2185 CALL add_perf(perf_id=9, count=1)
2187 request%handle = mp_request_null_handle
2189 CALL mp_timestop(handle)
2190 END SUBROUTINE mp_wait
2201 SUBROUTINE mp_waitall_1(requests)
2204 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_waitall_1'
2207#if defined(__parallel)
2208 INTEGER :: count, ierr
2211 CALL mp_timeset(routinen, handle)
2212#if defined(__parallel)
2213 count =
SIZE(requests)
2214 CALL mpi_waitall_internal(count, requests, ierr)
2215 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitall @ mp_waitall_1")
2216 CALL add_perf(perf_id=9, count=1)
2220 CALL mp_timestop(handle)
2221 END SUBROUTINE mp_waitall_1
2230 SUBROUTINE mp_waitall_2(requests)
2233 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_waitall_2'
2236#if defined(__parallel)
2237 INTEGER :: count, ierr
2240 CALL mp_timeset(routinen, handle)
2241#if defined(__parallel)
2242 count =
SIZE(requests)
2243 CALL mpi_waitall_internal(count, requests, ierr)
2244 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitall @ mp_waitall_2")
2245 CALL add_perf(perf_id=9, count=1)
2249 CALL mp_timestop(handle)
2250 END SUBROUTINE mp_waitall_2
2260#if defined(__parallel)
2261 SUBROUTINE mpi_waitall_internal(count, array_of_requests, ierr)
2262 INTEGER,
INTENT(in) :: count
2263 TYPE(
mp_request_type),
DIMENSION(count),
INTENT(inout) :: array_of_requests
2264 INTEGER,
INTENT(out) :: ierr
2266 mpi_request_type,
ALLOCATABLE,
DIMENSION(:),
TARGET :: request_handles
2268 ALLOCATE (request_handles(count), source=array_of_requests(1:count)%handle)
2269 CALL mpi_waitall(count, request_handles, mpi_statuses_ignore, ierr)
2270 array_of_requests(1:count)%handle = request_handles(:)
2271 DEALLOCATE (request_handles)
2273 END SUBROUTINE mpi_waitall_internal
2286 INTEGER,
INTENT(out) :: completed
2288 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_waitany'
2291#if defined(__parallel)
2292 INTEGER :: count, ierr
2293 mpi_request_type,
ALLOCATABLE,
DIMENSION(:) :: request_handles
2296 CALL mp_timeset(routinen, handle)
2298#if defined(__parallel)
2299 count =
SIZE(requests)
2301 ALLOCATE (request_handles(count), source=requests(1:count)%handle)
2303 CALL mpi_waitany(count, request_handles, completed, mpi_status_ignore, ierr)
2304 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitany @ mp_waitany")
2307 requests(1:count)%handle = request_handles(:)
2308 DEALLOCATE (request_handles)
2309 CALL add_perf(perf_id=9, count=1)
2314 CALL mp_timestop(handle)
2326 FUNCTION mp_testall_tv(requests)
RESULT(flag)
2330#if defined(__parallel)
2332 LOGICAL,
DIMENSION(:),
POINTER :: flags
2337#if defined(__parallel)
2338 ALLOCATE (flags(
SIZE(requests)))
2339 DO i = 1,
SIZE(requests)
2340 CALL mpi_test(requests(i)%handle, flags(i), mpi_status_ignore, ierr)
2341 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testall @ mp_testall_tv")
2342 flag = flag .AND. flags(i)
2348 END FUNCTION mp_testall_tv
2358 FUNCTION mp_test_1(request)
RESULT(flag)
2362#if defined(__parallel)
2365 CALL mpi_test(request%handle, flag, mpi_status_ignore, ierr)
2366 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_test @ mp_test_1")
2371 END FUNCTION mp_test_1
2382 SUBROUTINE mp_testany_1(requests, completed, flag)
2384 INTEGER,
INTENT(out),
OPTIONAL :: completed
2385 LOGICAL,
INTENT(out),
OPTIONAL :: flag
2387#if defined(__parallel)
2388 INTEGER :: completed_l, count, ierr
2391 count =
SIZE(requests)
2393 CALL mpi_testany_internal(count, requests, completed_l, flag_l, mpi_status_ignore, ierr)
2394 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testany_1 @ mp_testany")
2396 IF (
PRESENT(completed)) completed = completed_l
2397 IF (
PRESENT(flag)) flag = flag_l
2400 IF (
PRESENT(completed)) completed = 1
2401 IF (
PRESENT(flag)) flag = .true.
2403 END SUBROUTINE mp_testany_1
2414 SUBROUTINE mp_testany_2(requests, completed, flag)
2416 INTEGER,
INTENT(out),
OPTIONAL :: completed
2417 LOGICAL,
INTENT(out),
OPTIONAL :: flag
2419#if defined(__parallel)
2420 INTEGER :: completed_l, count, ierr
2423 count =
SIZE(requests)
2425 CALL mpi_testany_internal(count, requests, completed_l, flag_l, mpi_status_ignore, ierr)
2426 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testany_2 @ mp_testany")
2428 IF (
PRESENT(completed)) completed = completed_l
2429 IF (
PRESENT(flag)) flag = flag_l
2432 IF (
PRESENT(completed)) completed = 1
2433 IF (
PRESENT(flag)) flag = .true.
2435 END SUBROUTINE mp_testany_2
2448#if defined(__parallel)
2449 SUBROUTINE mpi_testany_internal(count, array_of_requests, index, flag, status, ierr)
2450 INTEGER,
INTENT(in) :: count
2451 TYPE(
mp_request_type),
DIMENSION(count),
INTENT(inout) :: array_of_requests
2452 INTEGER,
INTENT(out) :: index
2453 LOGICAL,
INTENT(out) :: flag
2454 mpi_status_type,
INTENT(out) :: status
2455 INTEGER,
INTENT(out) :: ierr
2457 mpi_request_type,
ALLOCATABLE,
DIMENSION(:) :: request_handles
2459 ALLOCATE (request_handles(count), source=array_of_requests(1:count)%handle)
2460 CALL mpi_testany(count, request_handles, index, flag, status, ierr)
2461 array_of_requests(1:count)%handle = request_handles(:)
2462 DEALLOCATE (request_handles)
2464 END SUBROUTINE mpi_testany_internal
2476 SUBROUTINE mp_comm_split_direct(comm, sub_comm, color, key)
2479 INTEGER,
INTENT(in) :: color
2480 INTEGER,
INTENT(in),
OPTIONAL :: key
2482 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_comm_split_direct'
2485#if defined(__parallel)
2486 INTEGER :: ierr, my_key
2489 CALL mp_timeset(routinen, handle)
2491#if defined(__parallel)
2493 IF (
PRESENT(key)) my_key = key
2494 CALL mpi_comm_split(comm%handle, color, my_key, sub_comm%handle, ierr)
2495 IF (ierr /= mpi_success)
CALL mp_stop(ierr, routinen)
2496 CALL add_perf(perf_id=10, count=1)
2498 sub_comm%handle = mp_comm_default_handle
2503 debug_comm_count = debug_comm_count + 1
2504 CALL sub_comm%init()
2505 CALL mp_timestop(handle)
2507 END SUBROUTINE mp_comm_split_direct
2531 SUBROUTINE mp_comm_split(comm, sub_comm, ngroups, group_distribution, &
2532 subgroup_min_size, n_subgroups, group_partition, stride)
2535 INTEGER,
INTENT(out) :: ngroups
2536 INTEGER,
DIMENSION(0:),
INTENT(INOUT) :: group_distribution
2537 INTEGER,
INTENT(in),
OPTIONAL :: subgroup_min_size, &
2539 INTEGER,
DIMENSION(0:),
INTENT(IN),
OPTIONAL :: group_partition
2540 INTEGER,
OPTIONAL,
INTENT(IN) :: stride
2542 CHARACTER(LEN=*),
PARAMETER :: routineN =
'mp_comm_split', &
2543 routinep = modulen//
':'//routinen
2545 INTEGER :: handle, mepos, nnodes
2546#if defined(__parallel)
2547 INTEGER :: color, i, ierr, j, k, &
2548 my_subgroup_min_size, &
2549 istride, local_stride, irank
2550 INTEGER,
DIMENSION(:),
ALLOCATABLE :: rank_permutation
2553 CALL mp_timeset(routinen, handle)
2557 IF (.NOT.
PRESENT(subgroup_min_size) .AND. .NOT.
PRESENT(n_subgroups))
THEN
2558 cpabort(routinep//
" missing arguments")
2560 IF (
PRESENT(subgroup_min_size) .AND.
PRESENT(n_subgroups))
THEN
2561 cpabort(routinep//
" too many arguments")
2564 CALL comm%get_size(nnodes)
2565 CALL comm%get_rank(mepos)
2567 IF (ubound(group_distribution, 1) /= nnodes - 1)
THEN
2568 cpabort(routinep//
" group_distribution wrong bounds")
2571#if defined(__parallel)
2572 IF (
PRESENT(subgroup_min_size))
THEN
2573 IF (subgroup_min_size < 0 .OR. subgroup_min_size > nnodes)
THEN
2574 cpabort(routinep//
" subgroup_min_size too small or too large")
2576 ngroups = nnodes/subgroup_min_size
2577 my_subgroup_min_size = subgroup_min_size
2579 IF (n_subgroups <= 0)
THEN
2580 cpabort(routinep//
" n_subgroups too small")
2582 IF (nnodes/n_subgroups > 0)
THEN
2583 ngroups = n_subgroups
2587 my_subgroup_min_size = nnodes/ngroups
2593 ALLOCATE (rank_permutation(0:nnodes - 1))
2595 IF (
PRESENT(stride)) local_stride = stride
2597 DO istride = 1, local_stride
2598 DO irank = istride - 1, nnodes - 1, local_stride
2599 rank_permutation(k) = irank
2604 DO i = 0, nnodes - 1
2605 group_distribution(rank_permutation(i)) = min(i/my_subgroup_min_size, ngroups - 1)
2608 IF (
PRESENT(group_partition))
THEN
2609 IF (all(group_partition > 0) .AND. (sum(group_partition) == nnodes) .AND. (ngroups ==
SIZE(group_partition)))
THEN
2611 DO i = 0,
SIZE(group_partition) - 1
2612 DO j = 1, group_partition(i)
2613 group_distribution(rank_permutation(k)) = i
2621 DEALLOCATE (rank_permutation)
2622 color = group_distribution(mepos)
2623 CALL mpi_comm_split(comm%handle, color, 0, sub_comm%handle, ierr)
2624 IF (ierr /= mpi_success)
CALL mp_stop(ierr,
"in "//routinep//
" split")
2626 CALL add_perf(perf_id=10, count=1)
2628 sub_comm%handle = mp_comm_default_handle
2629 group_distribution(0) = 0
2633 mark_used(group_partition)
2635 debug_comm_count = debug_comm_count + 1
2636 CALL sub_comm%init()
2637 CALL mp_timestop(handle)
2639 END SUBROUTINE mp_comm_split
2652 SUBROUTINE mp_probe(source, comm, tag)
2653 INTEGER,
INTENT(INOUT) :: source
2655 INTEGER,
INTENT(OUT) :: tag
2657 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_probe'
2660#if defined(__parallel)
2662 mpi_status_type :: status_single
2668 CALL mp_timeset(routinen, handle)
2670#if defined(__parallel)
2673 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_probe @ mp_probe")
2674 source = status_single mpi_status_extract(mpi_source)
2675 tag = status_single mpi_status_extract(mpi_tag)
2678 CALL mpi_iprobe(source,
mp_any_tag, comm%handle, flag, status_single, ierr)
2679 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iprobe @ mp_probe")
2680 IF (flag .EQV. .false.)
THEN
2684 tag = status_single mpi_status_extract(mpi_tag)
2692 CALL mp_timestop(handle)
2693 END SUBROUTINE mp_probe
2705 SUBROUTINE mp_bcast_b(msg, source, comm)
2706 LOGICAL,
INTENT(INOUT) :: msg
2707 INTEGER,
INTENT(IN) :: source
2710 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_b'
2713#if defined(__parallel)
2714 INTEGER :: ierr, msglen
2717 CALL mp_timeset(routinen, handle)
2719#if defined(__parallel)
2721 CALL mpi_bcast(msg, msglen, mpi_logical, source, comm%handle, ierr)
2722 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2723 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2729 CALL mp_timestop(handle)
2730 END SUBROUTINE mp_bcast_b
2738 SUBROUTINE mp_bcast_b_src(msg, comm)
2739 LOGICAL,
INTENT(INOUT) :: msg
2742 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_b_src'
2745#if defined(__parallel)
2746 INTEGER :: ierr, msglen
2749 CALL mp_timeset(routinen, handle)
2751#if defined(__parallel)
2753 CALL mpi_bcast(msg, msglen, mpi_logical, comm%source, comm%handle, ierr)
2754 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2755 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2760 CALL mp_timestop(handle)
2761 END SUBROUTINE mp_bcast_b_src
2769 SUBROUTINE mp_bcast_bv(msg, source, comm)
2770 LOGICAL,
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
2771 INTEGER,
INTENT(IN) :: source
2774 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_bv'
2777#if defined(__parallel)
2778 INTEGER :: ierr, msglen
2781 CALL mp_timeset(routinen, handle)
2783#if defined(__parallel)
2785 CALL mpi_bcast(msg, msglen, mpi_logical, source, comm%handle, ierr)
2786 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2787 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2793 CALL mp_timestop(handle)
2794 END SUBROUTINE mp_bcast_bv
2801 SUBROUTINE mp_bcast_bv_src(msg, comm)
2802 LOGICAL,
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
2805 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_bv_src'
2808#if defined(__parallel)
2809 INTEGER :: ierr, msglen
2812 CALL mp_timeset(routinen, handle)
2814#if defined(__parallel)
2816 CALL mpi_bcast(msg, msglen, mpi_logical, comm%source, comm%handle, ierr)
2817 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2818 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2823 CALL mp_timestop(handle)
2824 END SUBROUTINE mp_bcast_bv_src
2840 SUBROUTINE mp_isend_bv(msgin, dest, comm, request, tag)
2841 LOGICAL,
DIMENSION(:),
INTENT(IN) :: msgin
2842 INTEGER,
INTENT(IN) :: dest
2845 INTEGER,
INTENT(in),
OPTIONAL :: tag
2847 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_isend_bv'
2850#if defined(__parallel)
2851 INTEGER :: ierr, msglen, my_tag
2855 CALL mp_timeset(routinen, handle)
2857#if defined(__parallel)
2858#if !defined(__GNUC__) || __GNUC__ >= 9
2859 cpassert(is_contiguous(msgin))
2863 IF (
PRESENT(tag)) my_tag = tag
2865 msglen =
SIZE(msgin, 1)
2866 IF (msglen > 0)
THEN
2867 CALL mpi_isend(msgin(1), msglen, mpi_logical, dest, my_tag, &
2868 comm%handle, request%handle, ierr)
2870 CALL mpi_isend(foo, msglen, mpi_logical, dest, my_tag, &
2871 comm%handle, request%handle, ierr)
2873 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
2875 CALL add_perf(perf_id=11, count=1, msg_size=msglen*loglen)
2877 cpabort(
"mp_isend called in non parallel case")
2884 CALL mp_timestop(handle)
2885 END SUBROUTINE mp_isend_bv
2901 SUBROUTINE mp_irecv_bv(msgout, source, comm, request, tag)
2902 LOGICAL,
DIMENSION(:),
INTENT(INOUT) :: msgout
2903 INTEGER,
INTENT(IN) :: source
2906 INTEGER,
INTENT(in),
OPTIONAL :: tag
2908 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_irecv_bv'
2911#if defined(__parallel)
2912 INTEGER :: ierr, msglen, my_tag
2916 CALL mp_timeset(routinen, handle)
2918#if defined(__parallel)
2919#if !defined(__GNUC__) || __GNUC__ >= 9
2920 cpassert(is_contiguous(msgout))
2924 IF (
PRESENT(tag)) my_tag = tag
2926 msglen =
SIZE(msgout, 1)
2927 IF (msglen > 0)
THEN
2928 CALL mpi_irecv(msgout(1), msglen, mpi_logical, source, my_tag, &
2929 comm%handle, request%handle, ierr)
2931 CALL mpi_irecv(foo, msglen, mpi_logical, source, my_tag, &
2932 comm%handle, request%handle, ierr)
2934 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
2936 CALL add_perf(perf_id=12, count=1, msg_size=msglen*loglen)
2938 cpabort(
"mp_irecv called in non parallel case")
2945 CALL mp_timestop(handle)
2946 END SUBROUTINE mp_irecv_bv
2962 SUBROUTINE mp_isend_bm3(msgin, dest, comm, request, tag)
2963 LOGICAL,
DIMENSION(:, :, :),
INTENT(INOUT) :: msgin
2964 INTEGER,
INTENT(IN) :: dest
2967 INTEGER,
INTENT(in),
OPTIONAL :: tag
2969 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_isend_bm3'
2972#if defined(__parallel)
2973 INTEGER :: ierr, msglen, my_tag
2977 CALL mp_timeset(routinen, handle)
2979#if defined(__parallel)
2980#if !defined(__GNUC__) || __GNUC__ >= 9
2981 cpassert(is_contiguous(msgin))
2985 IF (
PRESENT(tag)) my_tag = tag
2987 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
2988 IF (msglen > 0)
THEN
2989 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_logical, dest, my_tag, &
2990 comm%handle, request%handle, ierr)
2992 CALL mpi_isend(foo, msglen, mpi_logical, dest, my_tag, &
2993 comm%handle, request%handle, ierr)
2995 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
2997 CALL add_perf(perf_id=11, count=1, msg_size=msglen*loglen)
2999 cpabort(
"mp_isend called in non parallel case")
3006 CALL mp_timestop(handle)
3007 END SUBROUTINE mp_isend_bm3
3023 SUBROUTINE mp_irecv_bm3(msgout, source, comm, request, tag)
3024 LOGICAL,
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
3025 INTEGER,
INTENT(IN) :: source
3028 INTEGER,
INTENT(in),
OPTIONAL :: tag
3030 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_irecv_bm3'
3033#if defined(__parallel)
3034 INTEGER :: ierr, msglen, my_tag
3038 CALL mp_timeset(routinen, handle)
3040#if defined(__parallel)
3041#if !defined(__GNUC__) || __GNUC__ >= 9
3042 cpassert(is_contiguous(msgout))
3046 IF (
PRESENT(tag)) my_tag = tag
3048 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
3049 IF (msglen > 0)
THEN
3050 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_logical, source, my_tag, &
3051 comm%handle, request%handle, ierr)
3053 CALL mpi_irecv(foo, msglen, mpi_logical, source, my_tag, &
3054 comm%handle, request%handle, ierr)
3056 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
3058 CALL add_perf(perf_id=12, count=1, msg_size=msglen*loglen)
3060 cpabort(
"mp_irecv called in non parallel case")
3068 CALL mp_timestop(handle)
3069 END SUBROUTINE mp_irecv_bm3
3077 SUBROUTINE mp_bcast_av(msg, source, comm)
3078 CHARACTER(LEN=*),
INTENT(INOUT) :: msg
3079 INTEGER,
INTENT(IN) :: source
3082 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_av'
3085#if defined(__parallel)
3086 INTEGER :: ierr, msglen
3089 CALL mp_timeset(routinen, handle)
3091#if defined(__parallel)
3092 msglen = len(msg)*charlen
3093 IF (comm%mepos /= source) msg =
""
3094 CALL mpi_bcast(msg, msglen, mpi_character, source, comm%handle, ierr)
3095 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3096 CALL add_perf(perf_id=2, count=1, msg_size=msglen)
3102 CALL mp_timestop(handle)
3103 END SUBROUTINE mp_bcast_av
3110 SUBROUTINE mp_bcast_av_src(msg, comm)
3111 CHARACTER(LEN=*),
INTENT(INOUT) :: msg
3114 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_av_src'
3117#if defined(__parallel)
3118 INTEGER :: ierr, msglen
3121 CALL mp_timeset(routinen, handle)
3123#if defined(__parallel)
3124 msglen = len(msg)*charlen
3125 IF (.NOT. comm%is_source()) msg =
""
3126 CALL mpi_bcast(msg, msglen, mpi_character, comm%source, comm%handle, ierr)
3127 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3128 CALL add_perf(perf_id=2, count=1, msg_size=msglen)
3133 CALL mp_timestop(handle)
3134 END SUBROUTINE mp_bcast_av_src
3142 SUBROUTINE mp_bcast_am(msg, source, comm)
3143 CHARACTER(LEN=*),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3144 INTEGER,
INTENT(IN) :: source
3147 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_am'
3150#if defined(__parallel)
3151 INTEGER :: ierr, msglen
3154 CALL mp_timeset(routinen, handle)
3156#if defined(__parallel)
3157 msglen =
SIZE(msg)*len(msg(1))*charlen
3158 IF (comm%mepos /= source) msg =
""
3159 CALL mpi_bcast(msg, msglen, mpi_character, source, comm%handle, ierr)
3160 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3161 CALL add_perf(perf_id=2, count=1, msg_size=msglen)
3167 CALL mp_timestop(handle)
3168 END SUBROUTINE mp_bcast_am
3170 SUBROUTINE mp_bcast_am_src(msg, comm)
3171 CHARACTER(LEN=*),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3174 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_am_src'
3177#if defined(__parallel)
3178 INTEGER :: ierr, msglen
3181 CALL mp_timeset(routinen, handle)
3183#if defined(__parallel)
3184 msglen =
SIZE(msg)*len(msg(1))*charlen
3185 IF (.NOT. comm%is_source()) msg =
""
3186 CALL mpi_bcast(msg, msglen, mpi_character, comm%source, comm%handle, ierr)
3187 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3188 CALL add_perf(perf_id=2, count=1, msg_size=msglen)
3193 CALL mp_timestop(handle)
3194 END SUBROUTINE mp_bcast_am_src
3206 SUBROUTINE mp_minloc_dv(msg, comm)
3207 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3210 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_minloc_dv'
3213#if defined(__parallel)
3214 INTEGER :: ierr, msglen
3215 REAL(kind=real_8),
ALLOCATABLE :: res(:)
3218 IF (
"d" ==
"l" .AND. real_8 == int_8)
THEN
3219 cpabort(
"Minimal location not available with long integers @ "//routinen)
3221 CALL mp_timeset(routinen, handle)
3223#if defined(__parallel)
3225 ALLOCATE (res(1:msglen), stat=ierr)
3227 cpabort(
"allocate @ "//routinen)
3228 CALL mpi_allreduce(msg, res, msglen/2, mpi_2double_precision, mpi_minloc, comm%handle, ierr)
3229 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3232 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
3237 CALL mp_timestop(handle)
3238 END SUBROUTINE mp_minloc_dv
3250 SUBROUTINE mp_minloc_iv(msg, comm)
3251 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3254 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_minloc_iv'
3257#if defined(__parallel)
3258 INTEGER :: ierr, msglen
3259 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
3262 IF (
"i" ==
"l" .AND. int_4 == int_8)
THEN
3263 cpabort(
"Minimal location not available with long integers @ "//routinen)
3265 CALL mp_timeset(routinen, handle)
3267#if defined(__parallel)
3269 ALLOCATE (res(1:msglen))
3270 CALL mpi_allreduce(msg, res, msglen/2, mpi_2integer, mpi_minloc, comm%handle, ierr)
3271 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3274 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
3279 CALL mp_timestop(handle)
3280 END SUBROUTINE mp_minloc_iv
3292 SUBROUTINE mp_minloc_lv(msg, comm)
3293 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3296 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_minloc_lv'
3299#if defined(__parallel)
3300 INTEGER :: ierr, msglen
3301 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
3304 IF (
"l" ==
"l" .AND. int_8 == int_8)
THEN
3305 cpabort(
"Minimal location not available with long integers @ "//routinen)
3307 CALL mp_timeset(routinen, handle)
3309#if defined(__parallel)
3311 ALLOCATE (res(1:msglen))
3312 CALL mpi_allreduce(msg, res, msglen/2, mpi_integer8, mpi_minloc, comm%handle, ierr)
3313 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3316 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
3321 CALL mp_timestop(handle)
3322 END SUBROUTINE mp_minloc_lv
3334 SUBROUTINE mp_minloc_rv(msg, comm)
3335 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3338 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_minloc_rv'
3341#if defined(__parallel)
3342 INTEGER :: ierr, msglen
3343 REAL(kind=real_4),
ALLOCATABLE :: res(:)
3346 IF (
"r" ==
"l" .AND. real_4 == int_8)
THEN
3347 cpabort(
"Minimal location not available with long integers @ "//routinen)
3349 CALL mp_timeset(routinen, handle)
3351#if defined(__parallel)
3353 ALLOCATE (res(1:msglen))
3354 CALL mpi_allreduce(msg, res, msglen/2, mpi_2real, mpi_minloc, comm%handle, ierr)
3355 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3358 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
3363 CALL mp_timestop(handle)
3364 END SUBROUTINE mp_minloc_rv
3376 SUBROUTINE mp_maxloc_dv(msg, comm)
3377 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3380 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_maxloc_dv'
3383#if defined(__parallel)
3384 INTEGER :: ierr, msglen
3385 REAL(kind=real_8),
ALLOCATABLE :: res(:)
3388 IF (
"d" ==
"l" .AND. real_8 == int_8)
THEN
3389 cpabort(
"Maximal location not available with long integers @ "//routinen)
3391 CALL mp_timeset(routinen, handle)
3393#if defined(__parallel)
3395 ALLOCATE (res(1:msglen))
3396 CALL mpi_allreduce(msg, res, msglen/2, mpi_2double_precision, mpi_maxloc, comm%handle, ierr)
3397 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3400 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
3405 CALL mp_timestop(handle)
3406 END SUBROUTINE mp_maxloc_dv
3418 SUBROUTINE mp_maxloc_iv(msg, comm)
3419 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3422 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_maxloc_iv'
3425#if defined(__parallel)
3426 INTEGER :: ierr, msglen
3427 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
3430 IF (
"i" ==
"l" .AND. int_4 == int_8)
THEN
3431 cpabort(
"Maximal location not available with long integers @ "//routinen)
3433 CALL mp_timeset(routinen, handle)
3435#if defined(__parallel)
3437 ALLOCATE (res(1:msglen))
3438 CALL mpi_allreduce(msg, res, msglen/2, mpi_2integer, mpi_maxloc, comm%handle, ierr)
3439 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3442 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
3447 CALL mp_timestop(handle)
3448 END SUBROUTINE mp_maxloc_iv
3460 SUBROUTINE mp_maxloc_lv(msg, comm)
3461 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3464 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_maxloc_lv'
3467#if defined(__parallel)
3468 INTEGER :: ierr, msglen
3469 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
3472 IF (
"l" ==
"l" .AND. int_8 == int_8)
THEN
3473 cpabort(
"Maximal location not available with long integers @ "//routinen)
3475 CALL mp_timeset(routinen, handle)
3477#if defined(__parallel)
3479 ALLOCATE (res(1:msglen))
3480 CALL mpi_allreduce(msg, res, msglen/2, mpi_integer8, mpi_maxloc, comm%handle, ierr)
3481 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3484 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
3489 CALL mp_timestop(handle)
3490 END SUBROUTINE mp_maxloc_lv
3502 SUBROUTINE mp_maxloc_rv(msg, comm)
3503 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3506 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_maxloc_rv'
3509#if defined(__parallel)
3510 INTEGER :: ierr, msglen
3511 REAL(kind=real_4),
ALLOCATABLE :: res(:)
3514 IF (
"r" ==
"l" .AND. real_4 == int_8)
THEN
3515 cpabort(
"Maximal location not available with long integers @ "//routinen)
3517 CALL mp_timeset(routinen, handle)
3519#if defined(__parallel)
3521 ALLOCATE (res(1:msglen))
3522 CALL mpi_allreduce(msg, res, msglen/2, mpi_2real, mpi_maxloc, comm%handle, ierr)
3523 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3526 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
3531 CALL mp_timestop(handle)
3532 END SUBROUTINE mp_maxloc_rv
3542 SUBROUTINE mp_sum_b(msg, comm)
3543 LOGICAL,
INTENT(INOUT) :: msg
3546 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_sum_b'
3549#if defined(__parallel)
3550 INTEGER :: ierr, msglen
3553 CALL mp_timeset(routinen, handle)
3554#if defined(__parallel)
3556 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, ierr)
3557 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3562 CALL mp_timestop(handle)
3563 END SUBROUTINE mp_sum_b
3573 SUBROUTINE mp_sum_bv(msg, comm)
3574 LOGICAL,
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: msg
3577 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_sum_bv'
3580#if defined(__parallel)
3581 INTEGER :: ierr, msglen
3584 CALL mp_timeset(routinen, handle)
3585#if defined(__parallel)
3587 IF (msglen > 0)
THEN
3588 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, ierr)
3589 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3595 CALL mp_timestop(handle)
3596 END SUBROUTINE mp_sum_bv
3607 SUBROUTINE mp_isum_bv(msg, comm, request)
3608 LOGICAL,
DIMENSION(:),
INTENT(INOUT) :: msg
3612 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_isum_bv'
3615#if defined(__parallel)
3616 INTEGER :: ierr, msglen
3619 CALL mp_timeset(routinen, handle)
3620#if defined(__parallel)
3622#if !defined(__GNUC__) || __GNUC__ >= 9
3623 cpassert(is_contiguous(msg))
3626 IF (msglen > 0)
THEN
3627 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, request%handle, ierr)
3628 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3637 CALL mp_timestop(handle)
3638 END SUBROUTINE mp_isum_bv
3648 CHARACTER(len=*),
INTENT(OUT) :: version
3649 INTEGER,
INTENT(OUT) :: resultlen
3651#if defined(__parallel)
3657#if defined(__parallel)
3659 CALL mpi_get_library_version(version, resultlen, ierr)
3660 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_get_library_version @ mp_get_library_version")
3680 SUBROUTINE mp_file_open(groupid, fh, filepath, amode_status, info)
3683 CHARACTER(len=*),
INTENT(IN) :: filepath
3684 INTEGER,
INTENT(IN) :: amode_status
3687#if defined(__parallel)
3689 mpi_info_type :: my_info
3691 CHARACTER(LEN=10) :: fstatus, fposition
3692 INTEGER :: amode, handle, istat
3693 LOGICAL :: exists, is_open
3696#if defined(__parallel)
3698 my_info = mpi_info_null
3699 IF (
PRESENT(info)) my_info = info%handle
3700 CALL mpi_file_open(groupid%handle, filepath, amode_status, my_info, fh%handle, ierr)
3701 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3702 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_open")
3706 amode = amode_status
3708 fposition =
"APPEND"
3711 fposition =
"REWIND"
3722 INQUIRE (unit=handle, exist=exists, opened=is_open, iostat=istat)
3723 IF (exists .AND. (.NOT. is_open) .AND. (istat == 0))
EXIT
3725 OPEN (unit=handle, file=filepath, status=fstatus, access=
"STREAM", position=fposition)
3728 END SUBROUTINE mp_file_open
3739 CHARACTER(len=*),
INTENT(IN) :: filepath
3742#if defined(__parallel)
3744 mpi_info_type :: my_info
3748 my_info = mpi_info_null
3749 IF (
PRESENT(info)) my_info = info%handle
3750 INQUIRE (file=filepath, exist=exists)
3751 IF (exists)
CALL mpi_file_delete(filepath, my_info, ierr)
3752 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_delete")
3770 SUBROUTINE mp_file_close(fh)
3773#if defined(__parallel)
3777 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3778 CALL mpi_file_close(fh%handle, ierr)
3779 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_close")
3782 fh%handle = mp_file_null_handle
3784 END SUBROUTINE mp_file_close
3786 SUBROUTINE mp_file_assign(fh_new, fh_old)
3790 fh_new%handle = fh_old%handle
3804 SUBROUTINE mp_file_get_size(fh, file_size)
3806 INTEGER(kind=file_offset),
INTENT(OUT) :: file_size
3808#if defined(__parallel)
3812#if defined(__parallel)
3814 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3815 CALL mpi_file_get_size(fh%handle, file_size, ierr)
3816 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_get_size")
3818 INQUIRE (unit=fh%handle, size=file_size)
3820 END SUBROUTINE mp_file_get_size
3832 SUBROUTINE mp_file_get_position(fh, pos)
3834 INTEGER(kind=file_offset),
INTENT(OUT) :: pos
3836#if defined(__parallel)
3840#if defined(__parallel)
3842 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3843 CALL mpi_file_get_position(fh%handle, pos, ierr)
3844 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_get_position")
3846 INQUIRE (unit=fh%handle, pos=pos)
3848 END SUBROUTINE mp_file_get_position
3861 SUBROUTINE mp_file_write_at_chv(fh, offset, msg, msglen)
3862 CHARACTER,
CONTIGUOUS,
INTENT(IN) :: msg(:)
3864 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
3865 INTEGER(kind=file_offset),
INTENT(IN) :: offset
3867#if defined(__parallel)
3868 INTEGER :: ierr, msg_len
3871#if defined(__parallel)
3873 IF (
PRESENT(msglen)) msg_len = msglen
3874 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
3876 cpabort(
"mpi_file_write_at_chv @ mp_file_write_at_chv")
3879 WRITE (unit=fh%handle, pos=offset + 1) msg
3881 END SUBROUTINE mp_file_write_at_chv
3889 SUBROUTINE mp_file_write_at_ch(fh, offset, msg)
3890 CHARACTER(LEN=*),
INTENT(IN) :: msg
3892 INTEGER(kind=file_offset),
INTENT(IN) :: offset
3894#if defined(__parallel)
3898#if defined(__parallel)
3899 CALL mpi_file_write_at(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
3901 cpabort(
"mpi_file_write_at_ch @ mp_file_write_at_ch")
3903 WRITE (unit=fh%handle, pos=offset + 1) msg
3905 END SUBROUTINE mp_file_write_at_ch
3917 SUBROUTINE mp_file_write_at_all_chv(fh, offset, msg, msglen)
3918 CHARACTER,
CONTIGUOUS,
INTENT(IN) :: msg(:)
3920 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
3921 INTEGER(kind=file_offset),
INTENT(IN) :: offset
3923#if defined(__parallel)
3924 INTEGER :: ierr, msg_len
3927#if defined(__parallel)
3929 IF (
PRESENT(msglen)) msg_len = msglen
3930 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
3932 cpabort(
"mpi_file_write_at_all_chv @ mp_file_write_at_all_chv")
3935 WRITE (unit=fh%handle, pos=offset + 1) msg
3937 END SUBROUTINE mp_file_write_at_all_chv
3945 SUBROUTINE mp_file_write_at_all_ch(fh, offset, msg)
3946 CHARACTER(LEN=*),
INTENT(IN) :: msg
3948 INTEGER(kind=file_offset),
INTENT(IN) :: offset
3950#if defined(__parallel)
3954#if defined(__parallel)
3955 CALL mpi_file_write_at_all(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
3957 cpabort(
"mpi_file_write_at_all_ch @ mp_file_write_at_all_ch")
3959 WRITE (unit=fh%handle, pos=offset + 1) msg
3961 END SUBROUTINE mp_file_write_at_all_ch
3974 SUBROUTINE mp_file_read_at_chv(fh, offset, msg, msglen)
3975 CHARACTER,
CONTIGUOUS,
INTENT(OUT) :: msg(:)
3977 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
3978 INTEGER(kind=file_offset),
INTENT(IN) :: offset
3980#if defined(__parallel)
3981 INTEGER :: ierr, msg_len
3984#if defined(__parallel)
3986 IF (
PRESENT(msglen)) msg_len = msglen
3987 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
3989 cpabort(
"mpi_file_read_at_chv @ mp_file_read_at_chv")
3992 READ (unit=fh%handle, pos=offset + 1) msg
3994 END SUBROUTINE mp_file_read_at_chv
4002 SUBROUTINE mp_file_read_at_ch(fh, offset, msg)
4003 CHARACTER(LEN=*),
INTENT(OUT) :: msg
4005 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4007#if defined(__parallel)
4011#if defined(__parallel)
4012 CALL mpi_file_read_at(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4014 cpabort(
"mpi_file_read_at_ch @ mp_file_read_at_ch")
4016 READ (unit=fh%handle, pos=offset + 1) msg
4018 END SUBROUTINE mp_file_read_at_ch
4030 SUBROUTINE mp_file_read_at_all_chv(fh, offset, msg, msglen)
4031 CHARACTER,
INTENT(OUT) :: msg(:)
4033 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
4034 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4036#if defined(__parallel)
4037 INTEGER :: ierr, msg_len
4040#if defined(__parallel)
4042 IF (
PRESENT(msglen)) msg_len = msglen
4043 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4045 cpabort(
"mpi_file_read_at_all_chv @ mp_file_read_at_all_chv")
4048 READ (unit=fh%handle, pos=offset + 1) msg
4050 END SUBROUTINE mp_file_read_at_all_chv
4058 SUBROUTINE mp_file_read_at_all_ch(fh, offset, msg)
4059 CHARACTER(LEN=*),
INTENT(OUT) :: msg
4061 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4063#if defined(__parallel)
4067#if defined(__parallel)
4068 CALL mpi_file_read_at_all(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4070 cpabort(
"mpi_file_read_at_all_ch @ mp_file_read_at_all_ch")
4072 READ (unit=fh%handle, pos=offset + 1) msg
4074 END SUBROUTINE mp_file_read_at_all_ch
4086 INTEGER,
INTENT(OUT) :: type_size
4088#if defined(__parallel)
4092 CALL mpi_type_size(type_descriptor%type_handle, type_size, ierr)
4094 cpabort(
"mpi_type_size failed @ mp_type_size")
4096 SELECT CASE (type_descriptor%type_handle)
4098 type_size = real_4_size
4100 type_size = real_8_size
4102 type_size = 2*real_4_size
4104 type_size = 2*real_8_size
4116 FUNCTION mp_type_make_struct(subtypes, &
4117 vector_descriptor, index_descriptor) &
4118 result(type_descriptor)
4120 DIMENSION(:),
INTENT(IN) :: subtypes
4121 INTEGER,
DIMENSION(2),
INTENT(IN), &
4122 OPTIONAL :: vector_descriptor
4123 TYPE(mp_indexing_meta_type), &
4124 INTENT(IN),
OPTIONAL :: index_descriptor
4127 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_struct'
4130 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: lengths
4131#if defined(__parallel)
4133 INTEGER(kind=mpi_address_kind), &
4134 ALLOCATABLE,
DIMENSION(:) :: displacements
4135#if defined(__MPI_F08)
4137 EXTERNAL :: mpi_get_address
4140 mpi_data_type,
ALLOCATABLE,
DIMENSION(:) :: old_types
4143 type_descriptor%length = 1
4144#if defined(__parallel)
4146 CALL mpi_get_address(mpi_bottom, type_descriptor%base, ierr)
4148 cpabort(
"MPI_get_address @ "//routinen)
4149 ALLOCATE (displacements(n))
4151 type_descriptor%vector_descriptor(1:2) = 1
4152 type_descriptor%has_indexing = .false.
4153 ALLOCATE (type_descriptor%subtype(n))
4154 type_descriptor%subtype(:) = subtypes(:)
4155 ALLOCATE (lengths(n), old_types(n))
4156 DO i = 1,
SIZE(subtypes)
4157#if defined(__parallel)
4158 displacements(i) = subtypes(i)%base
4160 old_types(i) = subtypes(i)%type_handle
4161 lengths(i) = subtypes(i)%length
4163#if defined(__parallel)
4164 CALL mpi_type_create_struct(n, &
4165 lengths, displacements, old_types, &
4166 type_descriptor%type_handle, ierr)
4168 cpabort(
"MPI_Type_create_struct @ "//routinen)
4169 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
4171 cpabort(
"MPI_Type_commit @ "//routinen)
4173 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
4174 cpabort(routinen//
" Vectors and indices NYI")
4176 END FUNCTION mp_type_make_struct
4182 RECURSIVE SUBROUTINE mp_type_free_m(type_descriptor)
4185 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_free_m'
4187 INTEGER :: handle, i
4188#if defined(__parallel)
4192 CALL mp_timeset(routinen, handle)
4196 IF (
ASSOCIATED(type_descriptor%subtype))
THEN
4197 DO i = 1,
SIZE(type_descriptor%subtype)
4198 CALL mp_type_free_m(type_descriptor%subtype(i))
4200 DEALLOCATE (type_descriptor%subtype)
4202#if defined(__parallel)
4204 CALL mpi_type_free(type_descriptor%type_handle, ierr)
4206 cpabort(
"MPI_Type_free @ "//routinen)
4209 CALL mp_timestop(handle)
4211 END SUBROUTINE mp_type_free_m
4217 SUBROUTINE mp_type_free_v(type_descriptors)
4219 INTENT(inout) :: type_descriptors
4223 DO i = 1,
SIZE(type_descriptors)
4224 CALL mp_type_free(type_descriptors(i))
4227 END SUBROUTINE mp_type_free_v
4238 result(type_descriptor)
4239 INTEGER,
INTENT(IN) :: count
4240 INTEGER,
DIMENSION(1:count), &
4241 INTENT(IN),
TARGET :: lengths
4242 INTEGER(kind=file_offset), &
4243 DIMENSION(1:count),
INTENT(in),
TARGET :: displs
4246 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_hindexed_make_chv'
4248 INTEGER :: ierr, handle
4251 CALL mp_timeset(routinen, handle)
4253#if defined(__parallel)
4254 CALL mpi_type_create_hindexed(count, lengths, int(displs, kind=
address_kind), mpi_character, &
4255 type_descriptor%type_handle, ierr)
4257 cpabort(
"MPI_Type_create_hindexed @ "//routinen)
4258 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
4260 cpabort(
"MPI_Type_commit @ "//routinen)
4262 type_descriptor%type_handle = 68
4264 type_descriptor%length = count
4265 type_descriptor%has_indexing = .true.
4266 type_descriptor%index_descriptor%index => lengths
4267 type_descriptor%index_descriptor%chunks => displs
4269 CALL mp_timestop(handle)
4283 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4286 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_set_view_chv'
4289#if defined(__parallel)
4293 CALL mp_timeset(routinen, handle)
4295#if defined(__parallel)
4297 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4298 CALL mpi_file_set_view(fh%handle, offset, mpi_character, &
4299 type_descriptor%type_handle,
"native", mpi_info_null, ierr)
4300 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_set_view")
4305 mark_used(type_descriptor)
4308 CALL mp_timestop(handle)
4323 SUBROUTINE mp_file_read_all_chv(fh, msglen, ndims, buffer, type_descriptor)
4325 INTEGER,
INTENT(IN) :: msglen
4326 INTEGER,
INTENT(IN) :: ndims
4327 CHARACTER(LEN=msglen),
DIMENSION(ndims),
INTENT(INOUT) :: buffer
4329 INTENT(IN),
OPTIONAL :: type_descriptor
4331 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_read_all_chv'
4334#if defined(__parallel)
4340 CALL mp_timeset(routinen, handle)
4342#if defined(__parallel)
4344 mark_used(type_descriptor)
4345 CALL mpi_file_read_all(fh%handle, buffer, ndims*msglen, mpi_character, mpi_status_ignore, ierr)
4346 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_read_all")
4347 CALL add_perf(perf_id=28, count=1, msg_size=ndims*msglen)
4351 IF (.NOT.
PRESENT(type_descriptor)) &
4352 CALL cp_abort(__location__, &
4353 "Container for mp_file_descriptor_type must be present in serial call.")
4354 IF (.NOT. type_descriptor%has_indexing) &
4355 CALL cp_abort(__location__, &
4356 "File view has not been set in mp_file_descriptor_type.")
4359 READ (fh%handle, pos=type_descriptor%index_descriptor%chunks(i)) buffer(i)
4363 CALL mp_timestop(handle)
4365 END SUBROUTINE mp_file_read_all_chv
4378 SUBROUTINE mp_file_write_all_chv(fh, msglen, ndims, buffer, type_descriptor)
4380 INTEGER,
INTENT(IN) :: msglen
4381 INTEGER,
INTENT(IN) :: ndims
4382 CHARACTER(LEN=msglen),
DIMENSION(ndims),
INTENT(IN) :: buffer
4384 INTENT(IN),
OPTIONAL :: type_descriptor
4386 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_write_all_chv'
4389#if defined(__parallel)
4395 CALL mp_timeset(routinen, handle)
4397#if defined(__parallel)
4398 mark_used(type_descriptor)
4399 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4400 CALL mpi_file_write_all(fh%handle, buffer, ndims*msglen, mpi_character, mpi_status_ignore, ierr)
4401 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_write_all")
4402 CALL add_perf(perf_id=28, count=1, msg_size=ndims*msglen)
4406 IF (.NOT.
PRESENT(type_descriptor)) &
4407 CALL cp_abort(__location__, &
4408 "Container for mp_file_descriptor_type must be present in serial call.")
4409 IF (.NOT. type_descriptor%has_indexing) &
4410 CALL cp_abort(__location__, &
4411 "File view has not been set in mp_file_descriptor_type.")
4414 WRITE (fh%handle, pos=type_descriptor%index_descriptor%chunks(i)) buffer(i)
4418 CALL mp_timestop(handle)
4420 END SUBROUTINE mp_file_write_all_chv
4430 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_type_free'
4433#if defined(__parallel)
4437 CALL mp_timeset(routinen, handle)
4439#if defined(__parallel)
4440 CALL mpi_type_free(type_descriptor%type_handle, ierr)
4442 cpabort(
"MPI_Type_free @ "//routinen)
4444#if defined(__parallel) && defined(__MPI_F08)
4445 type_descriptor%type_handle%mpi_val = -1
4447 type_descriptor%type_handle = -1
4449 type_descriptor%length = -1
4450 IF (type_descriptor%has_indexing)
THEN
4451 NULLIFY (type_descriptor%index_descriptor%index)
4452 NULLIFY (type_descriptor%index_descriptor%chunks)
4453 type_descriptor%has_indexing = .false.
4456 CALL mp_timestop(handle)
4474 LOGICAL,
INTENT(INOUT) :: mpi_io, replace
4475 INTEGER,
INTENT(OUT) :: amode
4476 CHARACTER(len=*),
INTENT(IN) :: form, action, status, position
4479#if defined(__parallel)
4484 CASE (
"UNFORMATTED")
4487 cpabort(
"Unknown MPI file form requested.")
4490 SELECT CASE (action)
4493 SELECT CASE (status)
4500 SELECT CASE (position)
4504 CASE (
"REWIND",
"ASIS")
4507 cpabort(
"Unknown MPI file position requested.")
4510 SELECT CASE (position)
4514 CASE (
"REWIND",
"ASIS")
4517 cpabort(
"Unknown MPI file position requested.")
4527 cpabort(
"Unknown MPI file status requested.")
4531 SELECT CASE (status)
4533 cpabort(
"Cannot read from 'NEW' file.")
4535 cpabort(
"Illegal status 'REPLACE' for read.")
4536 CASE (
"UNKNOWN",
"OLD")
4542 cpabort(
"Unknown MPI file status requested.")
4546 SELECT CASE (status)
4553 SELECT CASE (position)
4557 CASE (
"REWIND",
"ASIS")
4560 cpabort(
"Unknown MPI file position requested.")
4563 SELECT CASE (position)
4567 CASE (
"REWIND",
"ASIS")
4570 cpabort(
"Unknown MPI file position requested.")
4580 cpabort(
"Unknown MPI file status requested.")
4583 cpabort(
"Unknown MPI file action requested.")
4604 SUBROUTINE mp_isend_custom(msgin, dest, comm, request, tag)
4606 INTEGER,
INTENT(IN) :: dest
4609 INTEGER,
INTENT(in),
OPTIONAL :: tag
4611 INTEGER :: ierr, my_tag
4616#if defined(__parallel)
4617 IF (
PRESENT(tag)) my_tag = tag
4619 CALL mpi_isend(mpi_bottom, 1, msgin%type_handle, dest, my_tag, &
4620 comm%handle, request%handle, ierr)
4621 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ mp_isend_custom")
4629 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
4631 END SUBROUTINE mp_isend_custom
4641 SUBROUTINE mp_irecv_custom(msgout, source, comm, request, tag)
4643 INTEGER,
INTENT(IN) :: source
4646 INTEGER,
INTENT(in),
OPTIONAL :: tag
4648 INTEGER :: ierr, my_tag
4653#if defined(__parallel)
4654 IF (
PRESENT(tag)) my_tag = tag
4656 CALL mpi_irecv(mpi_bottom, 1, msgout%type_handle, source, my_tag, &
4657 comm%handle, request%handle, ierr)
4658 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ mp_irecv_custom")
4666 cpabort(
"mp_irecv called in non parallel case")
4668 END SUBROUTINE mp_irecv_custom
4674 SUBROUTINE mp_win_free(win)
4677 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_free'
4680#if defined(__parallel)
4684 CALL mp_timeset(routinen, handle)
4686#if defined(__parallel)
4688 CALL mpi_win_free(win%handle, ierr)
4689 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_free @ "//routinen)
4691 CALL add_perf(perf_id=21, count=1)
4693 win%handle = mp_win_null_handle
4695 CALL mp_timestop(handle)
4696 END SUBROUTINE mp_win_free
4698 SUBROUTINE mp_win_assign(win_new, win_old)
4702 win_new%handle = win_old%handle
4704 END SUBROUTINE mp_win_assign
4710 SUBROUTINE mp_win_flush_all(win)
4713 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_flush_all'
4715 INTEGER :: handle, ierr
4718 CALL mp_timeset(routinen, handle)
4720#if defined(__parallel)
4721 CALL mpi_win_flush_all(win%handle, ierr)
4722 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_flush_all @ "//routinen)
4726 CALL mp_timestop(handle)
4727 END SUBROUTINE mp_win_flush_all
4733 SUBROUTINE mp_win_lock_all(win)
4736 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_lock_all'
4738 INTEGER :: handle, ierr
4741 CALL mp_timeset(routinen, handle)
4743#if defined(__parallel)
4745 CALL mpi_win_lock_all(mpi_mode_nocheck, win%handle, ierr)
4746 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_lock_all @ "//routinen)
4748 CALL add_perf(perf_id=19, count=1)
4752 CALL mp_timestop(handle)
4753 END SUBROUTINE mp_win_lock_all
4759 SUBROUTINE mp_win_unlock_all(win)
4762 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_unlock_all'
4764 INTEGER :: handle, ierr
4767 CALL mp_timeset(routinen, handle)
4769#if defined(__parallel)
4771 CALL mpi_win_unlock_all(win%handle, ierr)
4772 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_unlock_all @ "//routinen)
4774 CALL add_perf(perf_id=19, count=1)
4778 CALL mp_timestop(handle)
4779 END SUBROUTINE mp_win_unlock_all
4786 SUBROUTINE mp_timeset(routineN, handle)
4787 CHARACTER(len=*),
INTENT(IN) :: routinen
4788 INTEGER,
INTENT(OUT) :: handle
4791 CALL timeset(routinen, handle)
4792 END SUBROUTINE mp_timeset
4798 SUBROUTINE mp_timestop(handle)
4799 INTEGER,
INTENT(IN) :: handle
4802 CALL timestop(handle)
4803 END SUBROUTINE mp_timestop
4816 SUBROUTINE mp_shift_im(msg, comm, displ_in)
4818 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
4820 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
4822 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_im'
4824 INTEGER :: handle, ierror
4825#if defined(__parallel)
4826 INTEGER :: displ, left, &
4827 msglen, myrank, nprocs, &
4832 CALL mp_timeset(routinen, handle)
4834#if defined(__parallel)
4835 CALL mpi_comm_rank(comm%handle, myrank, ierror)
4836 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
4837 CALL mpi_comm_size(comm%handle, nprocs, ierror)
4838 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
4839 IF (
PRESENT(displ_in))
THEN
4844 right =
modulo(myrank + displ, nprocs)
4845 left =
modulo(myrank - displ, nprocs)
4848 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer, right, tag, left, tag, &
4849 comm%handle, mpi_status_ignore, ierror)
4850 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
4851 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_4_size)
4857 CALL mp_timestop(handle)
4859 END SUBROUTINE mp_shift_im
4872 SUBROUTINE mp_shift_i (msg, comm, displ_in)
4874 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
4876 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
4878 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_i'
4880 INTEGER :: handle, ierror
4881#if defined(__parallel)
4882 INTEGER :: displ, left, &
4883 msglen, myrank, nprocs, &
4888 CALL mp_timeset(routinen, handle)
4890#if defined(__parallel)
4891 CALL mpi_comm_rank(comm%handle, myrank, ierror)
4892 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
4893 CALL mpi_comm_size(comm%handle, nprocs, ierror)
4894 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
4895 IF (
PRESENT(displ_in))
THEN
4900 right =
modulo(myrank + displ, nprocs)
4901 left =
modulo(myrank - displ, nprocs)
4904 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer, right, tag, left, &
4905 tag, comm%handle, mpi_status_ignore, ierror)
4906 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
4907 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_4_size)
4913 CALL mp_timestop(handle)
4915 END SUBROUTINE mp_shift_i
4936 SUBROUTINE mp_alltoall_i11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
4938 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
4939 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
4940 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
4941 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
4944 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i11v'
4947#if defined(__parallel)
4948 INTEGER :: ierr, msglen
4953 CALL mp_timeset(routinen, handle)
4955#if defined(__parallel)
4956 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer, &
4957 rb, rcount, rdispl, mpi_integer, comm%handle, ierr)
4958 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
4959 msglen = sum(scount) + sum(rcount)
4960 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
4967 rb(rdispl(1) + i) = sb(sdispl(1) + i)
4970 CALL mp_timestop(handle)
4972 END SUBROUTINE mp_alltoall_i11v
4987 SUBROUTINE mp_alltoall_i22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
4989 INTEGER(KIND=int_4),
DIMENSION(:, :), &
4990 INTENT(IN),
CONTIGUOUS :: sb
4991 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
4992 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS, &
4994 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
4997 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i22v'
5000#if defined(__parallel)
5001 INTEGER :: ierr, msglen
5004 CALL mp_timeset(routinen, handle)
5006#if defined(__parallel)
5007 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer, &
5008 rb, rcount, rdispl, mpi_integer, comm%handle, ierr)
5009 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
5010 msglen = sum(scount) + sum(rcount)
5011 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*int_4_size)
5020 CALL mp_timestop(handle)
5022 END SUBROUTINE mp_alltoall_i22v
5039 SUBROUTINE mp_alltoall_i (sb, rb, count, comm)
5041 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
5042 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
5043 INTEGER,
INTENT(IN) :: count
5046 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i'
5049#if defined(__parallel)
5050 INTEGER :: ierr, msglen, np
5053 CALL mp_timeset(routinen, handle)
5055#if defined(__parallel)
5056 CALL mpi_alltoall(sb, count, mpi_integer, &
5057 rb, count, mpi_integer, comm%handle, ierr)
5058 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5059 CALL mpi_comm_size(comm%handle, np, ierr)
5060 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5062 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5068 CALL mp_timestop(handle)
5070 END SUBROUTINE mp_alltoall_i
5080 SUBROUTINE mp_alltoall_i22(sb, rb, count, comm)
5082 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
5083 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
5084 INTEGER,
INTENT(IN) :: count
5087 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i22'
5090#if defined(__parallel)
5091 INTEGER :: ierr, msglen, np
5094 CALL mp_timeset(routinen, handle)
5096#if defined(__parallel)
5097 CALL mpi_alltoall(sb, count, mpi_integer, &
5098 rb, count, mpi_integer, comm%handle, ierr)
5099 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5100 CALL mpi_comm_size(comm%handle, np, ierr)
5101 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5102 msglen = 2*
SIZE(sb)*np
5103 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5109 CALL mp_timestop(handle)
5111 END SUBROUTINE mp_alltoall_i22
5121 SUBROUTINE mp_alltoall_i33(sb, rb, count, comm)
5123 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
5124 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
5125 INTEGER,
INTENT(IN) :: count
5128 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i33'
5131#if defined(__parallel)
5132 INTEGER :: ierr, msglen, np
5135 CALL mp_timeset(routinen, handle)
5137#if defined(__parallel)
5138 CALL mpi_alltoall(sb, count, mpi_integer, &
5139 rb, count, mpi_integer, comm%handle, ierr)
5140 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5141 CALL mpi_comm_size(comm%handle, np, ierr)
5142 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5144 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5150 CALL mp_timestop(handle)
5152 END SUBROUTINE mp_alltoall_i33
5162 SUBROUTINE mp_alltoall_i44(sb, rb, count, comm)
5164 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5166 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5168 INTEGER,
INTENT(IN) :: count
5171 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i44'
5174#if defined(__parallel)
5175 INTEGER :: ierr, msglen, np
5178 CALL mp_timeset(routinen, handle)
5180#if defined(__parallel)
5181 CALL mpi_alltoall(sb, count, mpi_integer, &
5182 rb, count, mpi_integer, comm%handle, ierr)
5183 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5184 CALL mpi_comm_size(comm%handle, np, ierr)
5185 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5187 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5193 CALL mp_timestop(handle)
5195 END SUBROUTINE mp_alltoall_i44
5205 SUBROUTINE mp_alltoall_i55(sb, rb, count, comm)
5207 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
5209 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
5211 INTEGER,
INTENT(IN) :: count
5214 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i55'
5217#if defined(__parallel)
5218 INTEGER :: ierr, msglen, np
5221 CALL mp_timeset(routinen, handle)
5223#if defined(__parallel)
5224 CALL mpi_alltoall(sb, count, mpi_integer, &
5225 rb, count, mpi_integer, comm%handle, ierr)
5226 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5227 CALL mpi_comm_size(comm%handle, np, ierr)
5228 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5230 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5236 CALL mp_timestop(handle)
5238 END SUBROUTINE mp_alltoall_i55
5249 SUBROUTINE mp_alltoall_i45(sb, rb, count, comm)
5251 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5253 INTEGER(KIND=int_4), &
5254 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
5255 INTEGER,
INTENT(IN) :: count
5258 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i45'
5261#if defined(__parallel)
5262 INTEGER :: ierr, msglen, np
5265 CALL mp_timeset(routinen, handle)
5267#if defined(__parallel)
5268 CALL mpi_alltoall(sb, count, mpi_integer, &
5269 rb, count, mpi_integer, comm%handle, ierr)
5270 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5271 CALL mpi_comm_size(comm%handle, np, ierr)
5272 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5274 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5278 rb = reshape(sb, shape(rb))
5280 CALL mp_timestop(handle)
5282 END SUBROUTINE mp_alltoall_i45
5293 SUBROUTINE mp_alltoall_i34(sb, rb, count, comm)
5295 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
5297 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5299 INTEGER,
INTENT(IN) :: count
5302 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i34'
5305#if defined(__parallel)
5306 INTEGER :: ierr, msglen, np
5309 CALL mp_timeset(routinen, handle)
5311#if defined(__parallel)
5312 CALL mpi_alltoall(sb, count, mpi_integer, &
5313 rb, count, mpi_integer, comm%handle, ierr)
5314 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5315 CALL mpi_comm_size(comm%handle, np, ierr)
5316 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5318 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5322 rb = reshape(sb, shape(rb))
5324 CALL mp_timestop(handle)
5326 END SUBROUTINE mp_alltoall_i34
5337 SUBROUTINE mp_alltoall_i54(sb, rb, count, comm)
5339 INTEGER(KIND=int_4), &
5340 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
5341 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5343 INTEGER,
INTENT(IN) :: count
5346 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i54'
5349#if defined(__parallel)
5350 INTEGER :: ierr, msglen, np
5353 CALL mp_timeset(routinen, handle)
5355#if defined(__parallel)
5356 CALL mpi_alltoall(sb, count, mpi_integer, &
5357 rb, count, mpi_integer, comm%handle, ierr)
5358 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5359 CALL mpi_comm_size(comm%handle, np, ierr)
5360 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5362 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5366 rb = reshape(sb, shape(rb))
5368 CALL mp_timestop(handle)
5370 END SUBROUTINE mp_alltoall_i54
5381 SUBROUTINE mp_send_i (msg, dest, tag, comm)
5382 INTEGER(KIND=int_4),
INTENT(IN) :: msg
5383 INTEGER,
INTENT(IN) :: dest, tag
5386 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_i'
5389#if defined(__parallel)
5390 INTEGER :: ierr, msglen
5393 CALL mp_timeset(routinen, handle)
5395#if defined(__parallel)
5397 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5398 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5399 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5406 cpabort(
"not in parallel mode")
5408 CALL mp_timestop(handle)
5409 END SUBROUTINE mp_send_i
5419 SUBROUTINE mp_send_iv(msg, dest, tag, comm)
5420 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
5421 INTEGER,
INTENT(IN) :: dest, tag
5424 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_iv'
5427#if defined(__parallel)
5428 INTEGER :: ierr, msglen
5431 CALL mp_timeset(routinen, handle)
5433#if defined(__parallel)
5435 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5436 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5437 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5444 cpabort(
"not in parallel mode")
5446 CALL mp_timestop(handle)
5447 END SUBROUTINE mp_send_iv
5457 SUBROUTINE mp_send_im2(msg, dest, tag, comm)
5458 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
5459 INTEGER,
INTENT(IN) :: dest, tag
5462 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_im2'
5465#if defined(__parallel)
5466 INTEGER :: ierr, msglen
5469 CALL mp_timeset(routinen, handle)
5471#if defined(__parallel)
5473 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5474 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5475 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5482 cpabort(
"not in parallel mode")
5484 CALL mp_timestop(handle)
5485 END SUBROUTINE mp_send_im2
5495 SUBROUTINE mp_send_im3(msg, dest, tag, comm)
5496 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
5497 INTEGER,
INTENT(IN) :: dest, tag
5500 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
5503#if defined(__parallel)
5504 INTEGER :: ierr, msglen
5507 CALL mp_timeset(routinen, handle)
5509#if defined(__parallel)
5511 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5512 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5513 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5520 cpabort(
"not in parallel mode")
5522 CALL mp_timestop(handle)
5523 END SUBROUTINE mp_send_im3
5534 SUBROUTINE mp_recv_i (msg, source, tag, comm)
5535 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5536 INTEGER,
INTENT(INOUT) :: source, tag
5539 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_i'
5542#if defined(__parallel)
5543 INTEGER :: ierr, msglen
5544 mpi_status_type :: status
5547 CALL mp_timeset(routinen, handle)
5549#if defined(__parallel)
5552 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5553 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5555 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5556 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5557 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5558 source = status mpi_status_extract(mpi_source)
5559 tag = status mpi_status_extract(mpi_tag)
5567 cpabort(
"not in parallel mode")
5569 CALL mp_timestop(handle)
5570 END SUBROUTINE mp_recv_i
5580 SUBROUTINE mp_recv_iv(msg, source, tag, comm)
5581 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5582 INTEGER,
INTENT(INOUT) :: source, tag
5585 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_iv'
5588#if defined(__parallel)
5589 INTEGER :: ierr, msglen
5590 mpi_status_type :: status
5593 CALL mp_timeset(routinen, handle)
5595#if defined(__parallel)
5598 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5599 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5601 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5602 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5603 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5604 source = status mpi_status_extract(mpi_source)
5605 tag = status mpi_status_extract(mpi_tag)
5613 cpabort(
"not in parallel mode")
5615 CALL mp_timestop(handle)
5616 END SUBROUTINE mp_recv_iv
5626 SUBROUTINE mp_recv_im2(msg, source, tag, comm)
5627 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
5628 INTEGER,
INTENT(INOUT) :: source, tag
5631 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_im2'
5634#if defined(__parallel)
5635 INTEGER :: ierr, msglen
5636 mpi_status_type :: status
5639 CALL mp_timeset(routinen, handle)
5641#if defined(__parallel)
5644 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5645 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5647 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5648 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5649 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5650 source = status mpi_status_extract(mpi_source)
5651 tag = status mpi_status_extract(mpi_tag)
5659 cpabort(
"not in parallel mode")
5661 CALL mp_timestop(handle)
5662 END SUBROUTINE mp_recv_im2
5672 SUBROUTINE mp_recv_im3(msg, source, tag, comm)
5673 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
5674 INTEGER,
INTENT(INOUT) :: source, tag
5677 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_im3'
5680#if defined(__parallel)
5681 INTEGER :: ierr, msglen
5682 mpi_status_type :: status
5685 CALL mp_timeset(routinen, handle)
5687#if defined(__parallel)
5690 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5691 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5693 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5694 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5695 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5696 source = status mpi_status_extract(mpi_source)
5697 tag = status mpi_status_extract(mpi_tag)
5705 cpabort(
"not in parallel mode")
5707 CALL mp_timestop(handle)
5708 END SUBROUTINE mp_recv_im3
5718 SUBROUTINE mp_bcast_i (msg, source, comm)
5719 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5720 INTEGER,
INTENT(IN) :: source
5723 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i'
5726#if defined(__parallel)
5727 INTEGER :: ierr, msglen
5730 CALL mp_timeset(routinen, handle)
5732#if defined(__parallel)
5734 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
5735 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5736 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5742 CALL mp_timestop(handle)
5743 END SUBROUTINE mp_bcast_i
5752 SUBROUTINE mp_bcast_i_src(msg, comm)
5753 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5756 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i_src'
5759#if defined(__parallel)
5760 INTEGER :: ierr, msglen
5763 CALL mp_timeset(routinen, handle)
5765#if defined(__parallel)
5767 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
5768 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5769 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5774 CALL mp_timestop(handle)
5775 END SUBROUTINE mp_bcast_i_src
5785 SUBROUTINE mp_ibcast_i (msg, source, comm, request)
5786 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5787 INTEGER,
INTENT(IN) :: source
5791 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_i'
5794#if defined(__parallel)
5795 INTEGER :: ierr, msglen
5798 CALL mp_timeset(routinen, handle)
5800#if defined(__parallel)
5802 CALL mpi_ibcast(msg, msglen, mpi_integer, source, comm%handle, request%handle, ierr)
5803 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
5804 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_4_size)
5811 CALL mp_timestop(handle)
5812 END SUBROUTINE mp_ibcast_i
5821 SUBROUTINE mp_bcast_iv(msg, source, comm)
5822 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5823 INTEGER,
INTENT(IN) :: source
5826 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_iv'
5829#if defined(__parallel)
5830 INTEGER :: ierr, msglen
5833 CALL mp_timeset(routinen, handle)
5835#if defined(__parallel)
5837 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
5838 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5839 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5845 CALL mp_timestop(handle)
5846 END SUBROUTINE mp_bcast_iv
5854 SUBROUTINE mp_bcast_iv_src(msg, comm)
5855 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5858 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_iv_src'
5861#if defined(__parallel)
5862 INTEGER :: ierr, msglen
5865 CALL mp_timeset(routinen, handle)
5867#if defined(__parallel)
5869 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
5870 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5871 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5876 CALL mp_timestop(handle)
5877 END SUBROUTINE mp_bcast_iv_src
5886 SUBROUTINE mp_ibcast_iv(msg, source, comm, request)
5887 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
5888 INTEGER,
INTENT(IN) :: source
5892 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_iv'
5895#if defined(__parallel)
5896 INTEGER :: ierr, msglen
5899 CALL mp_timeset(routinen, handle)
5901#if defined(__parallel)
5902#if !defined(__GNUC__) || __GNUC__ >= 9
5903 cpassert(is_contiguous(msg))
5906 CALL mpi_ibcast(msg, msglen, mpi_integer, source, comm%handle, request%handle, ierr)
5907 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
5908 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_4_size)
5915 CALL mp_timestop(handle)
5916 END SUBROUTINE mp_ibcast_iv
5925 SUBROUTINE mp_bcast_im(msg, source, comm)
5926 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
5927 INTEGER,
INTENT(IN) :: source
5930 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_im'
5933#if defined(__parallel)
5934 INTEGER :: ierr, msglen
5937 CALL mp_timeset(routinen, handle)
5939#if defined(__parallel)
5941 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
5942 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5943 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5949 CALL mp_timestop(handle)
5950 END SUBROUTINE mp_bcast_im
5959 SUBROUTINE mp_bcast_im_src(msg, comm)
5960 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
5963 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_im_src'
5966#if defined(__parallel)
5967 INTEGER :: ierr, msglen
5970 CALL mp_timeset(routinen, handle)
5972#if defined(__parallel)
5974 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
5975 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5976 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5981 CALL mp_timestop(handle)
5982 END SUBROUTINE mp_bcast_im_src
5991 SUBROUTINE mp_bcast_i3(msg, source, comm)
5992 INTEGER(KIND=int_4),
CONTIGUOUS :: msg(:, :, :)
5993 INTEGER,
INTENT(IN) :: source
5996 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i3'
5999#if defined(__parallel)
6000 INTEGER :: ierr, msglen
6003 CALL mp_timeset(routinen, handle)
6005#if defined(__parallel)
6007 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
6008 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6009 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6015 CALL mp_timestop(handle)
6016 END SUBROUTINE mp_bcast_i3
6025 SUBROUTINE mp_bcast_i3_src(msg, comm)
6026 INTEGER(KIND=int_4),
CONTIGUOUS :: msg(:, :, :)
6029 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i3_src'
6032#if defined(__parallel)
6033 INTEGER :: ierr, msglen
6036 CALL mp_timeset(routinen, handle)
6038#if defined(__parallel)
6040 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
6041 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6042 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6047 CALL mp_timestop(handle)
6048 END SUBROUTINE mp_bcast_i3_src
6057 SUBROUTINE mp_sum_i (msg, comm)
6058 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6061 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_i'
6064#if defined(__parallel)
6065 INTEGER :: ierr, msglen
6068 CALL mp_timeset(routinen, handle)
6070#if defined(__parallel)
6072 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6073 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6074 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6079 CALL mp_timestop(handle)
6080 END SUBROUTINE mp_sum_i
6088 SUBROUTINE mp_sum_iv(msg, comm)
6089 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6092 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_iv'
6095#if defined(__parallel)
6096 INTEGER :: ierr, msglen
6099 CALL mp_timeset(routinen, handle)
6101#if defined(__parallel)
6103 IF (msglen > 0)
THEN
6104 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6105 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6107 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6112 CALL mp_timestop(handle)
6113 END SUBROUTINE mp_sum_iv
6121 SUBROUTINE mp_isum_iv(msg, comm, request)
6122 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6126 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_iv'
6129#if defined(__parallel)
6130 INTEGER :: ierr, msglen
6133 CALL mp_timeset(routinen, handle)
6135#if defined(__parallel)
6136#if !defined(__GNUC__) || __GNUC__ >= 9
6137 cpassert(is_contiguous(msg))
6140 IF (msglen > 0)
THEN
6141 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, request%handle, ierr)
6142 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
6146 CALL add_perf(perf_id=23, count=1, msg_size=msglen*int_4_size)
6152 CALL mp_timestop(handle)
6153 END SUBROUTINE mp_isum_iv
6161 SUBROUTINE mp_sum_im(msg, comm)
6162 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6165 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im'
6168#if defined(__parallel)
6169 INTEGER,
PARAMETER :: max_msg = 2**25
6170 INTEGER :: ierr, m1, msglen, step, msglensum
6173 CALL mp_timeset(routinen, handle)
6175#if defined(__parallel)
6177 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
6179 DO m1 = lbound(msg, 2), ubound(msg, 2), step
6180 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
6181 msglensum = msglensum + msglen
6182 IF (msglen > 0)
THEN
6183 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6184 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6187 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_4_size)
6192 CALL mp_timestop(handle)
6193 END SUBROUTINE mp_sum_im
6201 SUBROUTINE mp_sum_im3(msg, comm)
6202 INTEGER(KIND=int_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
6205 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im3'
6208#if defined(__parallel)
6209 INTEGER :: ierr, msglen
6212 CALL mp_timeset(routinen, handle)
6214#if defined(__parallel)
6216 IF (msglen > 0)
THEN
6217 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6218 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6220 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6225 CALL mp_timestop(handle)
6226 END SUBROUTINE mp_sum_im3
6234 SUBROUTINE mp_sum_im4(msg, comm)
6235 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
6238 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im4'
6241#if defined(__parallel)
6242 INTEGER :: ierr, msglen
6245 CALL mp_timeset(routinen, handle)
6247#if defined(__parallel)
6249 IF (msglen > 0)
THEN
6250 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6251 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6253 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6258 CALL mp_timestop(handle)
6259 END SUBROUTINE mp_sum_im4
6271 SUBROUTINE mp_sum_root_iv(msg, root, comm)
6272 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6273 INTEGER,
INTENT(IN) :: root
6276 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_iv'
6279#if defined(__parallel)
6280 INTEGER :: ierr, m1, msglen, taskid
6281 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
6284 CALL mp_timeset(routinen, handle)
6286#if defined(__parallel)
6288 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6289 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6290 IF (msglen > 0)
THEN
6293 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_sum, &
6294 root, comm%handle, ierr)
6295 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6296 IF (taskid == root)
THEN
6301 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6307 CALL mp_timestop(handle)
6308 END SUBROUTINE mp_sum_root_iv
6319 SUBROUTINE mp_sum_root_im(msg, root, comm)
6320 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6321 INTEGER,
INTENT(IN) :: root
6324 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
6327#if defined(__parallel)
6328 INTEGER :: ierr, m1, m2, msglen, taskid
6329 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:, :)
6332 CALL mp_timeset(routinen, handle)
6334#if defined(__parallel)
6336 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6337 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6338 IF (msglen > 0)
THEN
6341 ALLOCATE (res(m1, m2))
6342 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_sum, root, comm%handle, ierr)
6343 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6344 IF (taskid == root)
THEN
6349 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6355 CALL mp_timestop(handle)
6356 END SUBROUTINE mp_sum_root_im
6364 SUBROUTINE mp_sum_partial_im(msg, res, comm)
6365 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
6366 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
6369 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_im'
6372#if defined(__parallel)
6373 INTEGER :: ierr, msglen, taskid
6376 CALL mp_timeset(routinen, handle)
6378#if defined(__parallel)
6380 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6381 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6382 IF (msglen > 0)
THEN
6383 CALL mpi_scan(msg, res, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6384 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
6386 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6392 CALL mp_timestop(handle)
6393 END SUBROUTINE mp_sum_partial_im
6403 SUBROUTINE mp_max_i (msg, comm)
6404 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6407 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_i'
6410#if defined(__parallel)
6411 INTEGER :: ierr, msglen
6414 CALL mp_timeset(routinen, handle)
6416#if defined(__parallel)
6418 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_max, comm%handle, ierr)
6419 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6420 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6425 CALL mp_timestop(handle)
6426 END SUBROUTINE mp_max_i
6436 SUBROUTINE mp_max_root_i (msg, root, comm)
6437 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6438 INTEGER,
INTENT(IN) :: root
6441 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_i'
6444#if defined(__parallel)
6445 INTEGER :: ierr, msglen
6446 INTEGER(KIND=int_4) :: res
6449 CALL mp_timeset(routinen, handle)
6451#if defined(__parallel)
6453 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_max, root, comm%handle, ierr)
6454 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6455 IF (root == comm%mepos) msg = res
6456 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6462 CALL mp_timestop(handle)
6463 END SUBROUTINE mp_max_root_i
6473 SUBROUTINE mp_max_iv(msg, comm)
6474 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6477 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_iv'
6480#if defined(__parallel)
6481 INTEGER :: ierr, msglen
6484 CALL mp_timeset(routinen, handle)
6486#if defined(__parallel)
6488 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_max, comm%handle, ierr)
6489 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6490 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6495 CALL mp_timestop(handle)
6496 END SUBROUTINE mp_max_iv
6506 SUBROUTINE mp_max_root_im(msg, root, comm)
6507 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6511 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_im'
6514#if defined(__parallel)
6515 INTEGER :: ierr, msglen
6516 INTEGER(KIND=int_4) :: res(size(msg, 1), size(msg, 2))
6519 CALL mp_timeset(routinen, handle)
6521#if defined(__parallel)
6523 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_max, root, comm%handle, ierr)
6524 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6525 IF (root == comm%mepos) msg = res
6526 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6532 CALL mp_timestop(handle)
6533 END SUBROUTINE mp_max_root_im
6543 SUBROUTINE mp_min_i (msg, comm)
6544 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6547 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_i'
6550#if defined(__parallel)
6551 INTEGER :: ierr, msglen
6554 CALL mp_timeset(routinen, handle)
6556#if defined(__parallel)
6558 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_min, comm%handle, ierr)
6559 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6560 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6565 CALL mp_timestop(handle)
6566 END SUBROUTINE mp_min_i
6578 SUBROUTINE mp_min_iv(msg, comm)
6579 INTEGER(KIND=int_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
6582 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_iv'
6585#if defined(__parallel)
6586 INTEGER :: ierr, msglen
6589 CALL mp_timeset(routinen, handle)
6591#if defined(__parallel)
6593 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_min, comm%handle, ierr)
6594 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6595 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6600 CALL mp_timestop(handle)
6601 END SUBROUTINE mp_min_iv
6611 SUBROUTINE mp_prod_i (msg, comm)
6612 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6615 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_i'
6618#if defined(__parallel)
6619 INTEGER :: ierr, msglen
6622 CALL mp_timeset(routinen, handle)
6624#if defined(__parallel)
6626 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_prod, comm%handle, ierr)
6627 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6628 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6633 CALL mp_timestop(handle)
6634 END SUBROUTINE mp_prod_i
6645 SUBROUTINE mp_scatter_iv(msg_scatter, msg, root, comm)
6646 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
6647 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
6648 INTEGER,
INTENT(IN) :: root
6651 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_iv'
6654#if defined(__parallel)
6655 INTEGER :: ierr, msglen
6658 CALL mp_timeset(routinen, handle)
6660#if defined(__parallel)
6662 CALL mpi_scatter(msg_scatter, msglen, mpi_integer, msg, &
6663 msglen, mpi_integer, root, comm%handle, ierr)
6664 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
6665 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
6671 CALL mp_timestop(handle)
6672 END SUBROUTINE mp_scatter_iv
6682 SUBROUTINE mp_iscatter_i (msg_scatter, msg, root, comm, request)
6683 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:)
6684 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6685 INTEGER,
INTENT(IN) :: root
6689 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_i'
6692#if defined(__parallel)
6693 INTEGER :: ierr, msglen
6696 CALL mp_timeset(routinen, handle)
6698#if defined(__parallel)
6699#if !defined(__GNUC__) || __GNUC__ >= 9
6700 cpassert(is_contiguous(msg_scatter))
6703 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer, msg, &
6704 msglen, mpi_integer, root, comm%handle, request%handle, ierr)
6705 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
6706 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6710 msg = msg_scatter(1)
6713 CALL mp_timestop(handle)
6714 END SUBROUTINE mp_iscatter_i
6724 SUBROUTINE mp_iscatter_iv2(msg_scatter, msg, root, comm, request)
6725 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:, :)
6726 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6727 INTEGER,
INTENT(IN) :: root
6731 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_iv2'
6734#if defined(__parallel)
6735 INTEGER :: ierr, msglen
6738 CALL mp_timeset(routinen, handle)
6740#if defined(__parallel)
6741#if !defined(__GNUC__) || __GNUC__ >= 9
6742 cpassert(is_contiguous(msg_scatter))
6745 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer, msg, &
6746 msglen, mpi_integer, root, comm%handle, request%handle, ierr)
6747 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
6748 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6752 msg(:) = msg_scatter(:, 1)
6755 CALL mp_timestop(handle)
6756 END SUBROUTINE mp_iscatter_iv2
6766 SUBROUTINE mp_iscatterv_iv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
6767 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:)
6768 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
6769 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6770 INTEGER,
INTENT(IN) :: recvcount, root
6774 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_iv'
6777#if defined(__parallel)
6781 CALL mp_timeset(routinen, handle)
6783#if defined(__parallel)
6784#if !defined(__GNUC__) || __GNUC__ >= 9
6785 cpassert(is_contiguous(msg_scatter))
6786 cpassert(is_contiguous(msg))
6787 cpassert(is_contiguous(sendcounts))
6788 cpassert(is_contiguous(displs))
6790 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_integer, msg, &
6791 recvcount, mpi_integer, root, comm%handle, request%handle, ierr)
6792 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
6793 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6795 mark_used(sendcounts)
6797 mark_used(recvcount)
6800 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
6803 CALL mp_timestop(handle)
6804 END SUBROUTINE mp_iscatterv_iv
6815 SUBROUTINE mp_gather_i (msg, msg_gather, root, comm)
6816 INTEGER(KIND=int_4),
INTENT(IN) :: msg
6817 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
6818 INTEGER,
INTENT(IN) :: root
6821 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_i'
6824#if defined(__parallel)
6825 INTEGER :: ierr, msglen
6828 CALL mp_timeset(routinen, handle)
6830#if defined(__parallel)
6832 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
6833 msglen, mpi_integer, root, comm%handle, ierr)
6834 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
6835 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
6841 CALL mp_timestop(handle)
6842 END SUBROUTINE mp_gather_i
6852 SUBROUTINE mp_gather_i_src(msg, msg_gather, comm)
6853 INTEGER(KIND=int_4),
INTENT(IN) :: msg
6854 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
6857 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_i_src'
6860#if defined(__parallel)
6861 INTEGER :: ierr, msglen
6864 CALL mp_timeset(routinen, handle)
6866#if defined(__parallel)
6868 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
6869 msglen, mpi_integer, comm%source, comm%handle, ierr)
6870 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
6871 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
6876 CALL mp_timestop(handle)
6877 END SUBROUTINE mp_gather_i_src
6891 SUBROUTINE mp_gather_iv(msg, msg_gather, root, comm)
6892 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
6893 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
6894 INTEGER,
INTENT(IN) :: root
6897 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_iv'
6900#if defined(__parallel)
6901 INTEGER :: ierr, msglen
6904 CALL mp_timeset(routinen, handle)
6906#if defined(__parallel)
6908 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
6909 msglen, mpi_integer, root, comm%handle, ierr)
6910 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
6911 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
6917 CALL mp_timestop(handle)
6918 END SUBROUTINE mp_gather_iv
6931 SUBROUTINE mp_gather_iv_src(msg, msg_gather, comm)
6932 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
6933 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
6936 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_iv_src'
6939#if defined(__parallel)
6940 INTEGER :: ierr, msglen
6943 CALL mp_timeset(routinen, handle)
6945#if defined(__parallel)
6947 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
6948 msglen, mpi_integer, comm%source, comm%handle, ierr)
6949 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
6950 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
6955 CALL mp_timestop(handle)
6956 END SUBROUTINE mp_gather_iv_src
6970 SUBROUTINE mp_gather_im(msg, msg_gather, root, comm)
6971 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
6972 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
6973 INTEGER,
INTENT(IN) :: root
6976 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_im'
6979#if defined(__parallel)
6980 INTEGER :: ierr, msglen
6983 CALL mp_timeset(routinen, handle)
6985#if defined(__parallel)
6987 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
6988 msglen, mpi_integer, root, comm%handle, ierr)
6989 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
6990 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
6996 CALL mp_timestop(handle)
6997 END SUBROUTINE mp_gather_im
7010 SUBROUTINE mp_gather_im_src(msg, msg_gather, comm)
7011 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
7012 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
7015 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_im_src'
7018#if defined(__parallel)
7019 INTEGER :: ierr, msglen
7022 CALL mp_timeset(routinen, handle)
7024#if defined(__parallel)
7026 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7027 msglen, mpi_integer, comm%source, comm%handle, ierr)
7028 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7029 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7034 CALL mp_timestop(handle)
7035 END SUBROUTINE mp_gather_im_src
7052 SUBROUTINE mp_gatherv_iv(sendbuf, recvbuf, recvcounts, displs, root, comm)
7054 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7055 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7056 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7057 INTEGER,
INTENT(IN) :: root
7060 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_iv'
7063#if defined(__parallel)
7064 INTEGER :: ierr, sendcount
7067 CALL mp_timeset(routinen, handle)
7069#if defined(__parallel)
7070 sendcount =
SIZE(sendbuf)
7071 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7072 recvbuf, recvcounts, displs, mpi_integer, &
7073 root, comm%handle, ierr)
7074 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7075 CALL add_perf(perf_id=4, &
7077 msg_size=sendcount*int_4_size)
7079 mark_used(recvcounts)
7082 recvbuf(1 + displs(1):) = sendbuf
7084 CALL mp_timestop(handle)
7085 END SUBROUTINE mp_gatherv_iv
7101 SUBROUTINE mp_gatherv_iv_src(sendbuf, recvbuf, recvcounts, displs, comm)
7103 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7104 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7105 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7108 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_iv_src'
7111#if defined(__parallel)
7112 INTEGER :: ierr, sendcount
7115 CALL mp_timeset(routinen, handle)
7117#if defined(__parallel)
7118 sendcount =
SIZE(sendbuf)
7119 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7120 recvbuf, recvcounts, displs, mpi_integer, &
7121 comm%source, comm%handle, ierr)
7122 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7123 CALL add_perf(perf_id=4, &
7125 msg_size=sendcount*int_4_size)
7127 mark_used(recvcounts)
7129 recvbuf(1 + displs(1):) = sendbuf
7131 CALL mp_timestop(handle)
7132 END SUBROUTINE mp_gatherv_iv_src
7149 SUBROUTINE mp_gatherv_im2(sendbuf, recvbuf, recvcounts, displs, root, comm)
7151 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7152 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7153 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7154 INTEGER,
INTENT(IN) :: root
7157 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_im2'
7160#if defined(__parallel)
7161 INTEGER :: ierr, sendcount
7164 CALL mp_timeset(routinen, handle)
7166#if defined(__parallel)
7167 sendcount =
SIZE(sendbuf)
7168 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7169 recvbuf, recvcounts, displs, mpi_integer, &
7170 root, comm%handle, ierr)
7171 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7172 CALL add_perf(perf_id=4, &
7174 msg_size=sendcount*int_4_size)
7176 mark_used(recvcounts)
7179 recvbuf(:, 1 + displs(1):) = sendbuf
7181 CALL mp_timestop(handle)
7182 END SUBROUTINE mp_gatherv_im2
7198 SUBROUTINE mp_gatherv_im2_src(sendbuf, recvbuf, recvcounts, displs, comm)
7200 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7201 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7202 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7205 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_im2_src'
7208#if defined(__parallel)
7209 INTEGER :: ierr, sendcount
7212 CALL mp_timeset(routinen, handle)
7214#if defined(__parallel)
7215 sendcount =
SIZE(sendbuf)
7216 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7217 recvbuf, recvcounts, displs, mpi_integer, &
7218 comm%source, comm%handle, ierr)
7219 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7220 CALL add_perf(perf_id=4, &
7222 msg_size=sendcount*int_4_size)
7224 mark_used(recvcounts)
7226 recvbuf(:, 1 + displs(1):) = sendbuf
7228 CALL mp_timestop(handle)
7229 END SUBROUTINE mp_gatherv_im2_src
7246 SUBROUTINE mp_igatherv_iv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
7247 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
7248 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
7249 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7250 INTEGER,
INTENT(IN) :: sendcount, root
7254 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_iv'
7257#if defined(__parallel)
7261 CALL mp_timeset(routinen, handle)
7263#if defined(__parallel)
7264#if !defined(__GNUC__) || __GNUC__ >= 9
7265 cpassert(is_contiguous(sendbuf))
7266 cpassert(is_contiguous(recvbuf))
7267 cpassert(is_contiguous(recvcounts))
7268 cpassert(is_contiguous(displs))
7270 CALL mpi_igatherv(sendbuf, sendcount, mpi_integer, &
7271 recvbuf, recvcounts, displs, mpi_integer, &
7272 root, comm%handle, request%handle, ierr)
7273 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7274 CALL add_perf(perf_id=24, &
7276 msg_size=sendcount*int_4_size)
7278 mark_used(sendcount)
7279 mark_used(recvcounts)
7282 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
7285 CALL mp_timestop(handle)
7286 END SUBROUTINE mp_igatherv_iv
7299 SUBROUTINE mp_allgather_i (msgout, msgin, comm)
7300 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7301 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
7304 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i'
7307#if defined(__parallel)
7308 INTEGER :: ierr, rcount, scount
7311 CALL mp_timeset(routinen, handle)
7313#if defined(__parallel)
7316 CALL mpi_allgather(msgout, scount, mpi_integer, &
7317 msgin, rcount, mpi_integer, &
7319 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7324 CALL mp_timestop(handle)
7325 END SUBROUTINE mp_allgather_i
7338 SUBROUTINE mp_allgather_i2(msgout, msgin, comm)
7339 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7340 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7343 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i2'
7346#if defined(__parallel)
7347 INTEGER :: ierr, rcount, scount
7350 CALL mp_timeset(routinen, handle)
7352#if defined(__parallel)
7355 CALL mpi_allgather(msgout, scount, mpi_integer, &
7356 msgin, rcount, mpi_integer, &
7358 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7363 CALL mp_timestop(handle)
7364 END SUBROUTINE mp_allgather_i2
7377 SUBROUTINE mp_iallgather_i (msgout, msgin, comm, request)
7378 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7379 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
7383 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i'
7386#if defined(__parallel)
7387 INTEGER :: ierr, rcount, scount
7390 CALL mp_timeset(routinen, handle)
7392#if defined(__parallel)
7393#if !defined(__GNUC__) || __GNUC__ >= 9
7394 cpassert(is_contiguous(msgin))
7398 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7399 msgin, rcount, mpi_integer, &
7400 comm%handle, request%handle, ierr)
7401 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7407 CALL mp_timestop(handle)
7408 END SUBROUTINE mp_iallgather_i
7423 SUBROUTINE mp_allgather_i12(msgout, msgin, comm)
7424 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
7425 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7428 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i12'
7431#if defined(__parallel)
7432 INTEGER :: ierr, rcount, scount
7435 CALL mp_timeset(routinen, handle)
7437#if defined(__parallel)
7438 scount =
SIZE(msgout(:))
7440 CALL mpi_allgather(msgout, scount, mpi_integer, &
7441 msgin, rcount, mpi_integer, &
7443 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7446 msgin(:, 1) = msgout(:)
7448 CALL mp_timestop(handle)
7449 END SUBROUTINE mp_allgather_i12
7459 SUBROUTINE mp_allgather_i23(msgout, msgin, comm)
7460 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
7461 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
7464 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i23'
7467#if defined(__parallel)
7468 INTEGER :: ierr, rcount, scount
7471 CALL mp_timeset(routinen, handle)
7473#if defined(__parallel)
7474 scount =
SIZE(msgout(:, :))
7476 CALL mpi_allgather(msgout, scount, mpi_integer, &
7477 msgin, rcount, mpi_integer, &
7479 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7482 msgin(:, :, 1) = msgout(:, :)
7484 CALL mp_timestop(handle)
7485 END SUBROUTINE mp_allgather_i23
7495 SUBROUTINE mp_allgather_i34(msgout, msgin, comm)
7496 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
7497 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
7500 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i34'
7503#if defined(__parallel)
7504 INTEGER :: ierr, rcount, scount
7507 CALL mp_timeset(routinen, handle)
7509#if defined(__parallel)
7510 scount =
SIZE(msgout(:, :, :))
7512 CALL mpi_allgather(msgout, scount, mpi_integer, &
7513 msgin, rcount, mpi_integer, &
7515 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7518 msgin(:, :, :, 1) = msgout(:, :, :)
7520 CALL mp_timestop(handle)
7521 END SUBROUTINE mp_allgather_i34
7531 SUBROUTINE mp_allgather_i22(msgout, msgin, comm)
7532 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
7533 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7536 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i22'
7539#if defined(__parallel)
7540 INTEGER :: ierr, rcount, scount
7543 CALL mp_timeset(routinen, handle)
7545#if defined(__parallel)
7546 scount =
SIZE(msgout(:, :))
7548 CALL mpi_allgather(msgout, scount, mpi_integer, &
7549 msgin, rcount, mpi_integer, &
7551 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7554 msgin(:, :) = msgout(:, :)
7556 CALL mp_timestop(handle)
7557 END SUBROUTINE mp_allgather_i22
7568 SUBROUTINE mp_iallgather_i11(msgout, msgin, comm, request)
7569 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
7570 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
7574 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i11'
7577#if defined(__parallel)
7578 INTEGER :: ierr, rcount, scount
7581 CALL mp_timeset(routinen, handle)
7583#if defined(__parallel)
7584#if !defined(__GNUC__) || __GNUC__ >= 9
7585 cpassert(is_contiguous(msgout))
7586 cpassert(is_contiguous(msgin))
7588 scount =
SIZE(msgout(:))
7590 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7591 msgin, rcount, mpi_integer, &
7592 comm%handle, request%handle, ierr)
7593 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7599 CALL mp_timestop(handle)
7600 END SUBROUTINE mp_iallgather_i11
7611 SUBROUTINE mp_iallgather_i13(msgout, msgin, comm, request)
7612 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
7613 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :)
7617 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i13'
7620#if defined(__parallel)
7621 INTEGER :: ierr, rcount, scount
7624 CALL mp_timeset(routinen, handle)
7626#if defined(__parallel)
7627#if !defined(__GNUC__) || __GNUC__ >= 9
7628 cpassert(is_contiguous(msgout))
7629 cpassert(is_contiguous(msgin))
7632 scount =
SIZE(msgout(:))
7634 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7635 msgin, rcount, mpi_integer, &
7636 comm%handle, request%handle, ierr)
7637 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7640 msgin(:, 1, 1) = msgout(:)
7643 CALL mp_timestop(handle)
7644 END SUBROUTINE mp_iallgather_i13
7655 SUBROUTINE mp_iallgather_i22(msgout, msgin, comm, request)
7656 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :)
7657 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :)
7661 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i22'
7664#if defined(__parallel)
7665 INTEGER :: ierr, rcount, scount
7668 CALL mp_timeset(routinen, handle)
7670#if defined(__parallel)
7671#if !defined(__GNUC__) || __GNUC__ >= 9
7672 cpassert(is_contiguous(msgout))
7673 cpassert(is_contiguous(msgin))
7676 scount =
SIZE(msgout(:, :))
7678 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7679 msgin, rcount, mpi_integer, &
7680 comm%handle, request%handle, ierr)
7681 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7684 msgin(:, :) = msgout(:, :)
7687 CALL mp_timestop(handle)
7688 END SUBROUTINE mp_iallgather_i22
7699 SUBROUTINE mp_iallgather_i24(msgout, msgin, comm, request)
7700 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :)
7701 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :, :)
7705 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i24'
7708#if defined(__parallel)
7709 INTEGER :: ierr, rcount, scount
7712 CALL mp_timeset(routinen, handle)
7714#if defined(__parallel)
7715#if !defined(__GNUC__) || __GNUC__ >= 9
7716 cpassert(is_contiguous(msgout))
7717 cpassert(is_contiguous(msgin))
7720 scount =
SIZE(msgout(:, :))
7722 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7723 msgin, rcount, mpi_integer, &
7724 comm%handle, request%handle, ierr)
7725 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7728 msgin(:, :, 1, 1) = msgout(:, :)
7731 CALL mp_timestop(handle)
7732 END SUBROUTINE mp_iallgather_i24
7743 SUBROUTINE mp_iallgather_i33(msgout, msgin, comm, request)
7744 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :, :)
7745 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :)
7749 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i33'
7752#if defined(__parallel)
7753 INTEGER :: ierr, rcount, scount
7756 CALL mp_timeset(routinen, handle)
7758#if defined(__parallel)
7759#if !defined(__GNUC__) || __GNUC__ >= 9
7760 cpassert(is_contiguous(msgout))
7761 cpassert(is_contiguous(msgin))
7764 scount =
SIZE(msgout(:, :, :))
7766 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7767 msgin, rcount, mpi_integer, &
7768 comm%handle, request%handle, ierr)
7769 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7772 msgin(:, :, :) = msgout(:, :, :)
7775 CALL mp_timestop(handle)
7776 END SUBROUTINE mp_iallgather_i33
7795 SUBROUTINE mp_allgatherv_iv(msgout, msgin, rcount, rdispl, comm)
7796 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
7797 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
7798 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
7801 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_iv'
7804#if defined(__parallel)
7805 INTEGER :: ierr, scount
7808 CALL mp_timeset(routinen, handle)
7810#if defined(__parallel)
7811 scount =
SIZE(msgout)
7812 CALL mpi_allgatherv(msgout, scount, mpi_integer, msgin, rcount, &
7813 rdispl, mpi_integer, comm%handle, ierr)
7814 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
7821 CALL mp_timestop(handle)
7822 END SUBROUTINE mp_allgatherv_iv
7841 SUBROUTINE mp_allgatherv_im2(msgout, msgin, rcount, rdispl, comm)
7842 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
7843 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
7844 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
7847 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_iv'
7850#if defined(__parallel)
7851 INTEGER :: ierr, scount
7854 CALL mp_timeset(routinen, handle)
7856#if defined(__parallel)
7857 scount =
SIZE(msgout)
7858 CALL mpi_allgatherv(msgout, scount, mpi_integer, msgin, rcount, &
7859 rdispl, mpi_integer, comm%handle, ierr)
7860 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
7867 CALL mp_timestop(handle)
7868 END SUBROUTINE mp_allgatherv_im2
7887 SUBROUTINE mp_iallgatherv_iv(msgout, msgin, rcount, rdispl, comm, request)
7888 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
7889 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
7890 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
7894 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_iv'
7897#if defined(__parallel)
7898 INTEGER :: ierr, scount, rsize
7901 CALL mp_timeset(routinen, handle)
7903#if defined(__parallel)
7904#if !defined(__GNUC__) || __GNUC__ >= 9
7905 cpassert(is_contiguous(msgout))
7906 cpassert(is_contiguous(msgin))
7907 cpassert(is_contiguous(rcount))
7908 cpassert(is_contiguous(rdispl))
7911 scount =
SIZE(msgout)
7912 rsize =
SIZE(rcount)
7913 CALL mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, &
7914 rdispl, comm, request, ierr)
7915 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
7923 CALL mp_timestop(handle)
7924 END SUBROUTINE mp_iallgatherv_iv
7943 SUBROUTINE mp_iallgatherv_iv2(msgout, msgin, rcount, rdispl, comm, request)
7944 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
7945 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
7946 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
7950 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_iv2'
7953#if defined(__parallel)
7954 INTEGER :: ierr, scount, rsize
7957 CALL mp_timeset(routinen, handle)
7959#if defined(__parallel)
7960#if !defined(__GNUC__) || __GNUC__ >= 9
7961 cpassert(is_contiguous(msgout))
7962 cpassert(is_contiguous(msgin))
7963 cpassert(is_contiguous(rcount))
7964 cpassert(is_contiguous(rdispl))
7967 scount =
SIZE(msgout)
7968 rsize =
SIZE(rcount)
7969 CALL mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, &
7970 rdispl, comm, request, ierr)
7971 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
7979 CALL mp_timestop(handle)
7980 END SUBROUTINE mp_iallgatherv_iv2
7991#if defined(__parallel)
7992 SUBROUTINE mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
7993 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
7994 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
7995 INTEGER,
INTENT(IN) :: rsize
7996 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
7999 INTEGER,
INTENT(INOUT) :: ierr
8001 CALL mpi_iallgatherv(msgout, scount, mpi_integer, msgin, rcount, &
8002 rdispl, mpi_integer, comm%handle, request%handle, ierr)
8004 END SUBROUTINE mp_iallgatherv_iv_internal
8015 SUBROUTINE mp_sum_scatter_iv(msgout, msgin, rcount, comm)
8016 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
8017 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
8018 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
8021 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_iv'
8024#if defined(__parallel)
8028 CALL mp_timeset(routinen, handle)
8030#if defined(__parallel)
8031 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_integer, mpi_sum, &
8033 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
8035 CALL add_perf(perf_id=3, count=1, &
8036 msg_size=rcount(1)*2*int_4_size)
8040 msgin = msgout(:, 1)
8042 CALL mp_timestop(handle)
8043 END SUBROUTINE mp_sum_scatter_iv
8054 SUBROUTINE mp_sendrecv_i (msgin, dest, msgout, source, comm, tag)
8055 INTEGER(KIND=int_4),
INTENT(IN) :: msgin
8056 INTEGER,
INTENT(IN) :: dest
8057 INTEGER(KIND=int_4),
INTENT(OUT) :: msgout
8058 INTEGER,
INTENT(IN) :: source
8060 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8062 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_i'
8065#if defined(__parallel)
8066 INTEGER :: ierr, msglen_in, msglen_out, &
8070 CALL mp_timeset(routinen, handle)
8072#if defined(__parallel)
8077 IF (
PRESENT(tag))
THEN
8081 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8082 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8083 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8084 CALL add_perf(perf_id=7, count=1, &
8085 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8093 CALL mp_timestop(handle)
8094 END SUBROUTINE mp_sendrecv_i
8105 SUBROUTINE mp_sendrecv_iv(msgin, dest, msgout, source, comm, tag)
8106 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
8107 INTEGER,
INTENT(IN) :: dest
8108 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
8109 INTEGER,
INTENT(IN) :: source
8111 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8113 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_iv'
8116#if defined(__parallel)
8117 INTEGER :: ierr, msglen_in, msglen_out, &
8121 CALL mp_timeset(routinen, handle)
8123#if defined(__parallel)
8124 msglen_in =
SIZE(msgin)
8125 msglen_out =
SIZE(msgout)
8128 IF (
PRESENT(tag))
THEN
8132 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8133 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8134 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8135 CALL add_perf(perf_id=7, count=1, &
8136 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8144 CALL mp_timestop(handle)
8145 END SUBROUTINE mp_sendrecv_iv
8157 SUBROUTINE mp_sendrecv_im2(msgin, dest, msgout, source, comm, tag)
8158 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
8159 INTEGER,
INTENT(IN) :: dest
8160 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
8161 INTEGER,
INTENT(IN) :: source
8163 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8165 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im2'
8168#if defined(__parallel)
8169 INTEGER :: ierr, msglen_in, msglen_out, &
8173 CALL mp_timeset(routinen, handle)
8175#if defined(__parallel)
8176 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
8177 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
8180 IF (
PRESENT(tag))
THEN
8184 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8185 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8186 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8187 CALL add_perf(perf_id=7, count=1, &
8188 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8196 CALL mp_timestop(handle)
8197 END SUBROUTINE mp_sendrecv_im2
8208 SUBROUTINE mp_sendrecv_im3(msgin, dest, msgout, source, comm, tag)
8209 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
8210 INTEGER,
INTENT(IN) :: dest
8211 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
8212 INTEGER,
INTENT(IN) :: source
8214 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8216 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im3'
8219#if defined(__parallel)
8220 INTEGER :: ierr, msglen_in, msglen_out, &
8224 CALL mp_timeset(routinen, handle)
8226#if defined(__parallel)
8227 msglen_in =
SIZE(msgin)
8228 msglen_out =
SIZE(msgout)
8231 IF (
PRESENT(tag))
THEN
8235 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8236 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8237 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8238 CALL add_perf(perf_id=7, count=1, &
8239 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8247 CALL mp_timestop(handle)
8248 END SUBROUTINE mp_sendrecv_im3
8259 SUBROUTINE mp_sendrecv_im4(msgin, dest, msgout, source, comm, tag)
8260 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
8261 INTEGER,
INTENT(IN) :: dest
8262 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
8263 INTEGER,
INTENT(IN) :: source
8265 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8267 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im4'
8270#if defined(__parallel)
8271 INTEGER :: ierr, msglen_in, msglen_out, &
8275 CALL mp_timeset(routinen, handle)
8277#if defined(__parallel)
8278 msglen_in =
SIZE(msgin)
8279 msglen_out =
SIZE(msgout)
8282 IF (
PRESENT(tag))
THEN
8286 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8287 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8288 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8289 CALL add_perf(perf_id=7, count=1, &
8290 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8298 CALL mp_timestop(handle)
8299 END SUBROUTINE mp_sendrecv_im4
8316 SUBROUTINE mp_isendrecv_i (msgin, dest, msgout, source, comm, send_request, &
8318 INTEGER(KIND=int_4),
INTENT(IN) :: msgin
8319 INTEGER,
INTENT(IN) :: dest
8320 INTEGER(KIND=int_4),
INTENT(INOUT) :: msgout
8321 INTEGER,
INTENT(IN) :: source
8324 INTEGER,
INTENT(in),
OPTIONAL :: tag
8326 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_i'
8329#if defined(__parallel)
8330 INTEGER :: ierr, my_tag
8333 CALL mp_timeset(routinen, handle)
8335#if defined(__parallel)
8337 IF (
PRESENT(tag)) my_tag = tag
8339 CALL mpi_irecv(msgout, 1, mpi_integer, source, my_tag, &
8340 comm%handle, recv_request%handle, ierr)
8341 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8343 CALL mpi_isend(msgin, 1, mpi_integer, dest, my_tag, &
8344 comm%handle, send_request%handle, ierr)
8345 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8347 CALL add_perf(perf_id=8, count=1, msg_size=2*int_4_size)
8357 CALL mp_timestop(handle)
8358 END SUBROUTINE mp_isendrecv_i
8377 SUBROUTINE mp_isendrecv_iv(msgin, dest, msgout, source, comm, send_request, &
8379 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: msgin
8380 INTEGER,
INTENT(IN) :: dest
8381 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
8382 INTEGER,
INTENT(IN) :: source
8385 INTEGER,
INTENT(in),
OPTIONAL :: tag
8387 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_iv'
8390#if defined(__parallel)
8391 INTEGER :: ierr, msglen, my_tag
8392 INTEGER(KIND=int_4) :: foo
8395 CALL mp_timeset(routinen, handle)
8397#if defined(__parallel)
8398#if !defined(__GNUC__) || __GNUC__ >= 9
8399 cpassert(is_contiguous(msgout))
8400 cpassert(is_contiguous(msgin))
8404 IF (
PRESENT(tag)) my_tag = tag
8406 msglen =
SIZE(msgout, 1)
8407 IF (msglen > 0)
THEN
8408 CALL mpi_irecv(msgout(1), msglen, mpi_integer, source, my_tag, &
8409 comm%handle, recv_request%handle, ierr)
8411 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8412 comm%handle, recv_request%handle, ierr)
8414 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8416 msglen =
SIZE(msgin, 1)
8417 IF (msglen > 0)
THEN
8418 CALL mpi_isend(msgin(1), msglen, mpi_integer, dest, my_tag, &
8419 comm%handle, send_request%handle, ierr)
8421 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8422 comm%handle, send_request%handle, ierr)
8424 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8426 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
8427 CALL add_perf(perf_id=8, count=1, msg_size=msglen*int_4_size)
8437 CALL mp_timestop(handle)
8438 END SUBROUTINE mp_isendrecv_iv
8453 SUBROUTINE mp_isend_iv(msgin, dest, comm, request, tag)
8454 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: msgin
8455 INTEGER,
INTENT(IN) :: dest
8458 INTEGER,
INTENT(in),
OPTIONAL :: tag
8460 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_iv'
8462 INTEGER :: handle, ierr
8463#if defined(__parallel)
8464 INTEGER :: msglen, my_tag
8465 INTEGER(KIND=int_4) :: foo(1)
8468 CALL mp_timeset(routinen, handle)
8470#if defined(__parallel)
8471#if !defined(__GNUC__) || __GNUC__ >= 9
8472 cpassert(is_contiguous(msgin))
8475 IF (
PRESENT(tag)) my_tag = tag
8477 msglen =
SIZE(msgin)
8478 IF (msglen > 0)
THEN
8479 CALL mpi_isend(msgin(1), msglen, mpi_integer, dest, my_tag, &
8480 comm%handle, request%handle, ierr)
8482 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8483 comm%handle, request%handle, ierr)
8485 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8487 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8496 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8498 CALL mp_timestop(handle)
8499 END SUBROUTINE mp_isend_iv
8516 SUBROUTINE mp_isend_im2(msgin, dest, comm, request, tag)
8517 INTEGER(KIND=int_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
8518 INTEGER,
INTENT(IN) :: dest
8521 INTEGER,
INTENT(in),
OPTIONAL :: tag
8523 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im2'
8525 INTEGER :: handle, ierr
8526#if defined(__parallel)
8527 INTEGER :: msglen, my_tag
8528 INTEGER(KIND=int_4) :: foo(1)
8531 CALL mp_timeset(routinen, handle)
8533#if defined(__parallel)
8534#if !defined(__GNUC__) || __GNUC__ >= 9
8535 cpassert(is_contiguous(msgin))
8539 IF (
PRESENT(tag)) my_tag = tag
8541 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
8542 IF (msglen > 0)
THEN
8543 CALL mpi_isend(msgin(1, 1), msglen, mpi_integer, dest, my_tag, &
8544 comm%handle, request%handle, ierr)
8546 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8547 comm%handle, request%handle, ierr)
8549 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8551 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8560 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8562 CALL mp_timestop(handle)
8563 END SUBROUTINE mp_isend_im2
8582 SUBROUTINE mp_isend_im3(msgin, dest, comm, request, tag)
8583 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
8584 INTEGER,
INTENT(IN) :: dest
8587 INTEGER,
INTENT(in),
OPTIONAL :: tag
8589 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im3'
8591 INTEGER :: handle, ierr
8592#if defined(__parallel)
8593 INTEGER :: msglen, my_tag
8594 INTEGER(KIND=int_4) :: foo(1)
8597 CALL mp_timeset(routinen, handle)
8599#if defined(__parallel)
8600#if !defined(__GNUC__) || __GNUC__ >= 9
8601 cpassert(is_contiguous(msgin))
8605 IF (
PRESENT(tag)) my_tag = tag
8607 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
8608 IF (msglen > 0)
THEN
8609 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_integer, dest, my_tag, &
8610 comm%handle, request%handle, ierr)
8612 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8613 comm%handle, request%handle, ierr)
8615 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8617 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8626 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8628 CALL mp_timestop(handle)
8629 END SUBROUTINE mp_isend_im3
8645 SUBROUTINE mp_isend_im4(msgin, dest, comm, request, tag)
8646 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
8647 INTEGER,
INTENT(IN) :: dest
8650 INTEGER,
INTENT(in),
OPTIONAL :: tag
8652 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im4'
8654 INTEGER :: handle, ierr
8655#if defined(__parallel)
8656 INTEGER :: msglen, my_tag
8657 INTEGER(KIND=int_4) :: foo(1)
8660 CALL mp_timeset(routinen, handle)
8662#if defined(__parallel)
8663#if !defined(__GNUC__) || __GNUC__ >= 9
8664 cpassert(is_contiguous(msgin))
8668 IF (
PRESENT(tag)) my_tag = tag
8670 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
8671 IF (msglen > 0)
THEN
8672 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_integer, dest, my_tag, &
8673 comm%handle, request%handle, ierr)
8675 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8676 comm%handle, request%handle, ierr)
8678 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8680 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8689 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8691 CALL mp_timestop(handle)
8692 END SUBROUTINE mp_isend_im4
8708 SUBROUTINE mp_irecv_iv(msgout, source, comm, request, tag)
8709 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
8710 INTEGER,
INTENT(IN) :: source
8713 INTEGER,
INTENT(in),
OPTIONAL :: tag
8715 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_iv'
8718#if defined(__parallel)
8719 INTEGER :: ierr, msglen, my_tag
8720 INTEGER(KIND=int_4) :: foo(1)
8723 CALL mp_timeset(routinen, handle)
8725#if defined(__parallel)
8726#if !defined(__GNUC__) || __GNUC__ >= 9
8727 cpassert(is_contiguous(msgout))
8731 IF (
PRESENT(tag)) my_tag = tag
8733 msglen =
SIZE(msgout)
8734 IF (msglen > 0)
THEN
8735 CALL mpi_irecv(msgout(1), msglen, mpi_integer, source, my_tag, &
8736 comm%handle, request%handle, ierr)
8738 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8739 comm%handle, request%handle, ierr)
8741 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8743 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
8745 cpabort(
"mp_irecv called in non parallel case")
8752 CALL mp_timestop(handle)
8753 END SUBROUTINE mp_irecv_iv
8770 SUBROUTINE mp_irecv_im2(msgout, source, comm, request, tag)
8771 INTEGER(KIND=int_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
8772 INTEGER,
INTENT(IN) :: source
8775 INTEGER,
INTENT(in),
OPTIONAL :: tag
8777 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im2'
8780#if defined(__parallel)
8781 INTEGER :: ierr, msglen, my_tag
8782 INTEGER(KIND=int_4) :: foo(1)
8785 CALL mp_timeset(routinen, handle)
8787#if defined(__parallel)
8788#if !defined(__GNUC__) || __GNUC__ >= 9
8789 cpassert(is_contiguous(msgout))
8793 IF (
PRESENT(tag)) my_tag = tag
8795 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
8796 IF (msglen > 0)
THEN
8797 CALL mpi_irecv(msgout(1, 1), msglen, mpi_integer, source, my_tag, &
8798 comm%handle, request%handle, ierr)
8800 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8801 comm%handle, request%handle, ierr)
8803 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8805 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
8812 cpabort(
"mp_irecv called in non parallel case")
8814 CALL mp_timestop(handle)
8815 END SUBROUTINE mp_irecv_im2
8833 SUBROUTINE mp_irecv_im3(msgout, source, comm, request, tag)
8834 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
8835 INTEGER,
INTENT(IN) :: source
8838 INTEGER,
INTENT(in),
OPTIONAL :: tag
8840 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im3'
8843#if defined(__parallel)
8844 INTEGER :: ierr, msglen, my_tag
8845 INTEGER(KIND=int_4) :: foo(1)
8848 CALL mp_timeset(routinen, handle)
8850#if defined(__parallel)
8851#if !defined(__GNUC__) || __GNUC__ >= 9
8852 cpassert(is_contiguous(msgout))
8856 IF (
PRESENT(tag)) my_tag = tag
8858 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
8859 IF (msglen > 0)
THEN
8860 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_integer, source, my_tag, &
8861 comm%handle, request%handle, ierr)
8863 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8864 comm%handle, request%handle, ierr)
8866 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
8868 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
8875 cpabort(
"mp_irecv called in non parallel case")
8877 CALL mp_timestop(handle)
8878 END SUBROUTINE mp_irecv_im3
8894 SUBROUTINE mp_irecv_im4(msgout, source, comm, request, tag)
8895 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
8896 INTEGER,
INTENT(IN) :: source
8899 INTEGER,
INTENT(in),
OPTIONAL :: tag
8901 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im4'
8904#if defined(__parallel)
8905 INTEGER :: ierr, msglen, my_tag
8906 INTEGER(KIND=int_4) :: foo(1)
8909 CALL mp_timeset(routinen, handle)
8911#if defined(__parallel)
8912#if !defined(__GNUC__) || __GNUC__ >= 9
8913 cpassert(is_contiguous(msgout))
8917 IF (
PRESENT(tag)) my_tag = tag
8919 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
8920 IF (msglen > 0)
THEN
8921 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_integer, source, my_tag, &
8922 comm%handle, request%handle, ierr)
8924 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8925 comm%handle, request%handle, ierr)
8927 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
8929 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
8936 cpabort(
"mp_irecv called in non parallel case")
8938 CALL mp_timestop(handle)
8939 END SUBROUTINE mp_irecv_im4
8951 SUBROUTINE mp_win_create_iv(base, comm, win)
8952 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
8956 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_iv'
8959#if defined(__parallel)
8961 INTEGER(kind=mpi_address_kind) :: len
8962 INTEGER(KIND=int_4) :: foo(1)
8965 CALL mp_timeset(routinen, handle)
8967#if defined(__parallel)
8969 len =
SIZE(base)*int_4_size
8971 CALL mpi_win_create(base(1), len, int_4_size, mpi_info_null, comm%handle, win%handle, ierr)
8973 CALL mpi_win_create(foo, len, int_4_size, mpi_info_null, comm%handle, win%handle, ierr)
8975 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
8977 CALL add_perf(perf_id=20, count=1)
8981 win%handle = mp_win_null_handle
8983 CALL mp_timestop(handle)
8984 END SUBROUTINE mp_win_create_iv
8996 SUBROUTINE mp_rget_iv(base, source, win, win_data, myproc, disp, request, &
8997 origin_datatype, target_datatype)
8998 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
8999 INTEGER,
INTENT(IN) :: source
9001 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: win_data
9002 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
9006 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_iv'
9009#if defined(__parallel)
9010 INTEGER :: ierr, len, &
9011 origin_len, target_len
9012 LOGICAL :: do_local_copy
9013 INTEGER(kind=mpi_address_kind) :: disp_aint
9014 mpi_data_type :: handle_origin_datatype, handle_target_datatype
9017 CALL mp_timeset(routinen, handle)
9019#if defined(__parallel)
9022 IF (
PRESENT(disp))
THEN
9023 disp_aint = int(disp, kind=mpi_address_kind)
9025 handle_origin_datatype = mpi_integer
9027 IF (
PRESENT(origin_datatype))
THEN
9028 handle_origin_datatype = origin_datatype%type_handle
9031 handle_target_datatype = mpi_integer
9033 IF (
PRESENT(target_datatype))
THEN
9034 handle_target_datatype = target_datatype%type_handle
9038 do_local_copy = .false.
9039 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
9040 IF (myproc .EQ. source) do_local_copy = .true.
9042 IF (do_local_copy)
THEN
9044 base(:) = win_data(disp_aint + 1:disp_aint + len)
9049 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
9050 target_len, handle_target_datatype, win%handle, request%handle, ierr)
9056 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
9058 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*int_4_size)
9063 mark_used(origin_datatype)
9064 mark_used(target_datatype)
9068 IF (
PRESENT(disp))
THEN
9069 base(:) = win_data(disp + 1:disp +
SIZE(base))
9071 base(:) = win_data(:
SIZE(base))
9075 CALL mp_timestop(handle)
9076 END SUBROUTINE mp_rget_iv
9085 FUNCTION mp_type_indexed_make_i (count, lengths, displs) &
9086 result(type_descriptor)
9087 INTEGER,
INTENT(IN) :: count
9088 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
9091 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_i'
9094#if defined(__parallel)
9098 CALL mp_timeset(routinen, handle)
9100#if defined(__parallel)
9101 CALL mpi_type_indexed(count, lengths, displs, mpi_integer, &
9102 type_descriptor%type_handle, ierr)
9104 cpabort(
"MPI_Type_Indexed @ "//routinen)
9105 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
9107 cpabort(
"MPI_Type_commit @ "//routinen)
9109 type_descriptor%type_handle = 17
9111 type_descriptor%length = count
9112 NULLIFY (type_descriptor%subtype)
9113 type_descriptor%vector_descriptor(1:2) = 1
9114 type_descriptor%has_indexing = .true.
9115 type_descriptor%index_descriptor%index => lengths
9116 type_descriptor%index_descriptor%chunks => displs
9118 CALL mp_timestop(handle)
9120 END FUNCTION mp_type_indexed_make_i
9129 SUBROUTINE mp_allocate_i (DATA, len, stat)
9130 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
9131 INTEGER,
INTENT(IN) :: len
9132 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9134 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_i'
9136 INTEGER :: handle, ierr
9138 CALL mp_timeset(routinen, handle)
9140#if defined(__parallel)
9142 CALL mp_alloc_mem(
DATA, len, stat=ierr)
9143 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
9144 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
9145 CALL add_perf(perf_id=15, count=1)
9147 ALLOCATE (
DATA(len), stat=ierr)
9148 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
9149 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
9151 IF (
PRESENT(stat)) stat = ierr
9152 CALL mp_timestop(handle)
9153 END SUBROUTINE mp_allocate_i
9161 SUBROUTINE mp_deallocate_i (DATA, stat)
9162 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
9163 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9165 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_i'
9168#if defined(__parallel)
9172 CALL mp_timeset(routinen, handle)
9174#if defined(__parallel)
9175 CALL mp_free_mem(
DATA, ierr)
9176 IF (
PRESENT(stat))
THEN
9179 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
9182 CALL add_perf(perf_id=15, count=1)
9185 IF (
PRESENT(stat)) stat = 0
9187 CALL mp_timestop(handle)
9188 END SUBROUTINE mp_deallocate_i
9201 SUBROUTINE mp_file_write_at_iv(fh, offset, msg, msglen)
9202 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
9204 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9205 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9208#if defined(__parallel)
9213 IF (
PRESENT(msglen)) msg_len = msglen
9214#if defined(__parallel)
9215 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9217 cpabort(
"mpi_file_write_at_iv @ mp_file_write_at_iv")
9219 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9221 END SUBROUTINE mp_file_write_at_iv
9229 SUBROUTINE mp_file_write_at_i (fh, offset, msg)
9230 INTEGER(KIND=int_4),
INTENT(IN) :: msg
9232 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9234#if defined(__parallel)
9238 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9240 cpabort(
"mpi_file_write_at_i @ mp_file_write_at_i")
9242 WRITE (unit=fh%handle, pos=offset + 1) msg
9244 END SUBROUTINE mp_file_write_at_i
9256 SUBROUTINE mp_file_write_at_all_iv(fh, offset, msg, msglen)
9257 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
9259 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9260 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9263#if defined(__parallel)
9268 IF (
PRESENT(msglen)) msg_len = msglen
9269#if defined(__parallel)
9270 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9272 cpabort(
"mpi_file_write_at_all_iv @ mp_file_write_at_all_iv")
9274 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9276 END SUBROUTINE mp_file_write_at_all_iv
9284 SUBROUTINE mp_file_write_at_all_i (fh, offset, msg)
9285 INTEGER(KIND=int_4),
INTENT(IN) :: msg
9287 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9289#if defined(__parallel)
9293 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9295 cpabort(
"mpi_file_write_at_all_i @ mp_file_write_at_all_i")
9297 WRITE (unit=fh%handle, pos=offset + 1) msg
9299 END SUBROUTINE mp_file_write_at_all_i
9312 SUBROUTINE mp_file_read_at_iv(fh, offset, msg, msglen)
9313 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
9315 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9316 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9319#if defined(__parallel)
9324 IF (
PRESENT(msglen)) msg_len = msglen
9325#if defined(__parallel)
9326 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9328 cpabort(
"mpi_file_read_at_iv @ mp_file_read_at_iv")
9330 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9332 END SUBROUTINE mp_file_read_at_iv
9340 SUBROUTINE mp_file_read_at_i (fh, offset, msg)
9341 INTEGER(KIND=int_4),
INTENT(OUT) :: msg
9343 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9345#if defined(__parallel)
9349 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9351 cpabort(
"mpi_file_read_at_i @ mp_file_read_at_i")
9353 READ (unit=fh%handle, pos=offset + 1) msg
9355 END SUBROUTINE mp_file_read_at_i
9367 SUBROUTINE mp_file_read_at_all_iv(fh, offset, msg, msglen)
9368 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
9370 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9371 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9374#if defined(__parallel)
9379 IF (
PRESENT(msglen)) msg_len = msglen
9380#if defined(__parallel)
9381 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9383 cpabort(
"mpi_file_read_at_all_iv @ mp_file_read_at_all_iv")
9385 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9387 END SUBROUTINE mp_file_read_at_all_iv
9395 SUBROUTINE mp_file_read_at_all_i (fh, offset, msg)
9396 INTEGER(KIND=int_4),
INTENT(OUT) :: msg
9398 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9400#if defined(__parallel)
9404 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9406 cpabort(
"mpi_file_read_at_all_i @ mp_file_read_at_all_i")
9408 READ (unit=fh%handle, pos=offset + 1) msg
9410 END SUBROUTINE mp_file_read_at_all_i
9419 FUNCTION mp_type_make_i (ptr, &
9420 vector_descriptor, index_descriptor) &
9421 result(type_descriptor)
9422 INTEGER(KIND=int_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
9423 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
9424 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
9427 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_i'
9429#if defined(__parallel)
9431#if defined(__MPI_F08)
9433 EXTERNAL :: mpi_get_address
9437 NULLIFY (type_descriptor%subtype)
9438 type_descriptor%length =
SIZE(ptr)
9439#if defined(__parallel)
9440 type_descriptor%type_handle = mpi_integer
9441 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
9443 cpabort(
"MPI_Get_address @ "//routinen)
9445 type_descriptor%type_handle = 17
9447 type_descriptor%vector_descriptor(1:2) = 1
9448 type_descriptor%has_indexing = .false.
9449 type_descriptor%data_i => ptr
9450 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
9451 cpabort(routinen//
": Vectors and indices NYI")
9453 END FUNCTION mp_type_make_i
9462 SUBROUTINE mp_alloc_mem_i (DATA, len, stat)
9463 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
9464 INTEGER,
INTENT(IN) :: len
9465 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9467#if defined(__parallel)
9468 INTEGER :: size, ierr, length, &
9470 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
9471 TYPE(c_ptr) :: mp_baseptr
9472 mpi_info_type :: mp_info
9474 length = max(len, 1)
9475 CALL mpi_type_size(mpi_integer,
size, ierr)
9476 mp_size = int(length, kind=mpi_address_kind)*
size
9477 IF (mp_size .GT. mp_max_memory_size)
THEN
9478 cpabort(
"MPI cannot allocate more than 2 GiByte")
9480 mp_info = mpi_info_null
9481 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
9482 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
9483 IF (
PRESENT(stat)) stat = mp_res
9485 INTEGER :: length, mystat
9486 length = max(len, 1)
9487 IF (
PRESENT(stat))
THEN
9488 ALLOCATE (
DATA(length), stat=mystat)
9491 ALLOCATE (
DATA(length))
9494 END SUBROUTINE mp_alloc_mem_i
9502 SUBROUTINE mp_free_mem_i (DATA, stat)
9503 INTEGER(KIND=int_4),
DIMENSION(:), &
9504 POINTER, asynchronous :: data
9505 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9507#if defined(__parallel)
9509 CALL mpi_free_mem(
DATA, mp_res)
9510 IF (
PRESENT(stat)) stat = mp_res
9513 IF (
PRESENT(stat)) stat = 0
9515 END SUBROUTINE mp_free_mem_i
9527 SUBROUTINE mp_shift_lm(msg, comm, displ_in)
9529 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
9531 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
9533 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_lm'
9535 INTEGER :: handle, ierror
9536#if defined(__parallel)
9537 INTEGER :: displ, left, &
9538 msglen, myrank, nprocs, &
9543 CALL mp_timeset(routinen, handle)
9545#if defined(__parallel)
9546 CALL mpi_comm_rank(comm%handle, myrank, ierror)
9547 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
9548 CALL mpi_comm_size(comm%handle, nprocs, ierror)
9549 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
9550 IF (
PRESENT(displ_in))
THEN
9555 right =
modulo(myrank + displ, nprocs)
9556 left =
modulo(myrank - displ, nprocs)
9559 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer8, right, tag, left, tag, &
9560 comm%handle, mpi_status_ignore, ierror)
9561 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
9562 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_8_size)
9568 CALL mp_timestop(handle)
9570 END SUBROUTINE mp_shift_lm
9583 SUBROUTINE mp_shift_l (msg, comm, displ_in)
9585 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
9587 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
9589 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_l'
9591 INTEGER :: handle, ierror
9592#if defined(__parallel)
9593 INTEGER :: displ, left, &
9594 msglen, myrank, nprocs, &
9599 CALL mp_timeset(routinen, handle)
9601#if defined(__parallel)
9602 CALL mpi_comm_rank(comm%handle, myrank, ierror)
9603 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
9604 CALL mpi_comm_size(comm%handle, nprocs, ierror)
9605 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
9606 IF (
PRESENT(displ_in))
THEN
9611 right =
modulo(myrank + displ, nprocs)
9612 left =
modulo(myrank - displ, nprocs)
9615 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer8, right, tag, left, &
9616 tag, comm%handle, mpi_status_ignore, ierror)
9617 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
9618 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_8_size)
9624 CALL mp_timestop(handle)
9626 END SUBROUTINE mp_shift_l
9647 SUBROUTINE mp_alltoall_l11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
9649 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
9650 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
9651 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
9652 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
9655 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l11v'
9658#if defined(__parallel)
9659 INTEGER :: ierr, msglen
9664 CALL mp_timeset(routinen, handle)
9666#if defined(__parallel)
9667 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer8, &
9668 rb, rcount, rdispl, mpi_integer8, comm%handle, ierr)
9669 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
9670 msglen = sum(scount) + sum(rcount)
9671 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9678 rb(rdispl(1) + i) = sb(sdispl(1) + i)
9681 CALL mp_timestop(handle)
9683 END SUBROUTINE mp_alltoall_l11v
9698 SUBROUTINE mp_alltoall_l22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
9700 INTEGER(KIND=int_8),
DIMENSION(:, :), &
9701 INTENT(IN),
CONTIGUOUS :: sb
9702 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
9703 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS, &
9705 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
9708 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l22v'
9711#if defined(__parallel)
9712 INTEGER :: ierr, msglen
9715 CALL mp_timeset(routinen, handle)
9717#if defined(__parallel)
9718 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer8, &
9719 rb, rcount, rdispl, mpi_integer8, comm%handle, ierr)
9720 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
9721 msglen = sum(scount) + sum(rcount)
9722 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*int_8_size)
9731 CALL mp_timestop(handle)
9733 END SUBROUTINE mp_alltoall_l22v
9750 SUBROUTINE mp_alltoall_l (sb, rb, count, comm)
9752 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
9753 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
9754 INTEGER,
INTENT(IN) :: count
9757 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l'
9760#if defined(__parallel)
9761 INTEGER :: ierr, msglen, np
9764 CALL mp_timeset(routinen, handle)
9766#if defined(__parallel)
9767 CALL mpi_alltoall(sb, count, mpi_integer8, &
9768 rb, count, mpi_integer8, comm%handle, ierr)
9769 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9770 CALL mpi_comm_size(comm%handle, np, ierr)
9771 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9773 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9779 CALL mp_timestop(handle)
9781 END SUBROUTINE mp_alltoall_l
9791 SUBROUTINE mp_alltoall_l22(sb, rb, count, comm)
9793 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
9794 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
9795 INTEGER,
INTENT(IN) :: count
9798 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l22'
9801#if defined(__parallel)
9802 INTEGER :: ierr, msglen, np
9805 CALL mp_timeset(routinen, handle)
9807#if defined(__parallel)
9808 CALL mpi_alltoall(sb, count, mpi_integer8, &
9809 rb, count, mpi_integer8, comm%handle, ierr)
9810 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9811 CALL mpi_comm_size(comm%handle, np, ierr)
9812 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9813 msglen = 2*
SIZE(sb)*np
9814 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9820 CALL mp_timestop(handle)
9822 END SUBROUTINE mp_alltoall_l22
9832 SUBROUTINE mp_alltoall_l33(sb, rb, count, comm)
9834 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
9835 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
9836 INTEGER,
INTENT(IN) :: count
9839 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l33'
9842#if defined(__parallel)
9843 INTEGER :: ierr, msglen, np
9846 CALL mp_timeset(routinen, handle)
9848#if defined(__parallel)
9849 CALL mpi_alltoall(sb, count, mpi_integer8, &
9850 rb, count, mpi_integer8, comm%handle, ierr)
9851 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9852 CALL mpi_comm_size(comm%handle, np, ierr)
9853 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9855 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9861 CALL mp_timestop(handle)
9863 END SUBROUTINE mp_alltoall_l33
9873 SUBROUTINE mp_alltoall_l44(sb, rb, count, comm)
9875 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
9877 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
9879 INTEGER,
INTENT(IN) :: count
9882 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l44'
9885#if defined(__parallel)
9886 INTEGER :: ierr, msglen, np
9889 CALL mp_timeset(routinen, handle)
9891#if defined(__parallel)
9892 CALL mpi_alltoall(sb, count, mpi_integer8, &
9893 rb, count, mpi_integer8, comm%handle, ierr)
9894 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9895 CALL mpi_comm_size(comm%handle, np, ierr)
9896 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9898 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9904 CALL mp_timestop(handle)
9906 END SUBROUTINE mp_alltoall_l44
9916 SUBROUTINE mp_alltoall_l55(sb, rb, count, comm)
9918 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
9920 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
9922 INTEGER,
INTENT(IN) :: count
9925 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l55'
9928#if defined(__parallel)
9929 INTEGER :: ierr, msglen, np
9932 CALL mp_timeset(routinen, handle)
9934#if defined(__parallel)
9935 CALL mpi_alltoall(sb, count, mpi_integer8, &
9936 rb, count, mpi_integer8, comm%handle, ierr)
9937 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9938 CALL mpi_comm_size(comm%handle, np, ierr)
9939 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9941 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9947 CALL mp_timestop(handle)
9949 END SUBROUTINE mp_alltoall_l55
9960 SUBROUTINE mp_alltoall_l45(sb, rb, count, comm)
9962 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
9964 INTEGER(KIND=int_8), &
9965 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
9966 INTEGER,
INTENT(IN) :: count
9969 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l45'
9972#if defined(__parallel)
9973 INTEGER :: ierr, msglen, np
9976 CALL mp_timeset(routinen, handle)
9978#if defined(__parallel)
9979 CALL mpi_alltoall(sb, count, mpi_integer8, &
9980 rb, count, mpi_integer8, comm%handle, ierr)
9981 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9982 CALL mpi_comm_size(comm%handle, np, ierr)
9983 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9985 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9989 rb = reshape(sb, shape(rb))
9991 CALL mp_timestop(handle)
9993 END SUBROUTINE mp_alltoall_l45
10004 SUBROUTINE mp_alltoall_l34(sb, rb, count, comm)
10006 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
10008 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10010 INTEGER,
INTENT(IN) :: count
10013 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l34'
10016#if defined(__parallel)
10017 INTEGER :: ierr, msglen, np
10020 CALL mp_timeset(routinen, handle)
10022#if defined(__parallel)
10023 CALL mpi_alltoall(sb, count, mpi_integer8, &
10024 rb, count, mpi_integer8, comm%handle, ierr)
10025 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10026 CALL mpi_comm_size(comm%handle, np, ierr)
10027 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10028 msglen = 2*count*np
10029 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10033 rb = reshape(sb, shape(rb))
10035 CALL mp_timestop(handle)
10037 END SUBROUTINE mp_alltoall_l34
10048 SUBROUTINE mp_alltoall_l54(sb, rb, count, comm)
10050 INTEGER(KIND=int_8), &
10051 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
10052 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10054 INTEGER,
INTENT(IN) :: count
10057 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l54'
10060#if defined(__parallel)
10061 INTEGER :: ierr, msglen, np
10064 CALL mp_timeset(routinen, handle)
10066#if defined(__parallel)
10067 CALL mpi_alltoall(sb, count, mpi_integer8, &
10068 rb, count, mpi_integer8, comm%handle, ierr)
10069 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10070 CALL mpi_comm_size(comm%handle, np, ierr)
10071 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10072 msglen = 2*count*np
10073 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10077 rb = reshape(sb, shape(rb))
10079 CALL mp_timestop(handle)
10081 END SUBROUTINE mp_alltoall_l54
10092 SUBROUTINE mp_send_l (msg, dest, tag, comm)
10093 INTEGER(KIND=int_8),
INTENT(IN) :: msg
10094 INTEGER,
INTENT(IN) :: dest, tag
10097 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_l'
10100#if defined(__parallel)
10101 INTEGER :: ierr, msglen
10104 CALL mp_timeset(routinen, handle)
10106#if defined(__parallel)
10108 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10109 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10110 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10117 cpabort(
"not in parallel mode")
10119 CALL mp_timestop(handle)
10120 END SUBROUTINE mp_send_l
10130 SUBROUTINE mp_send_lv(msg, dest, tag, comm)
10131 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
10132 INTEGER,
INTENT(IN) :: dest, tag
10135 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_lv'
10138#if defined(__parallel)
10139 INTEGER :: ierr, msglen
10142 CALL mp_timeset(routinen, handle)
10144#if defined(__parallel)
10146 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10147 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10148 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10155 cpabort(
"not in parallel mode")
10157 CALL mp_timestop(handle)
10158 END SUBROUTINE mp_send_lv
10168 SUBROUTINE mp_send_lm2(msg, dest, tag, comm)
10169 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
10170 INTEGER,
INTENT(IN) :: dest, tag
10173 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_lm2'
10176#if defined(__parallel)
10177 INTEGER :: ierr, msglen
10180 CALL mp_timeset(routinen, handle)
10182#if defined(__parallel)
10184 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10185 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10186 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10193 cpabort(
"not in parallel mode")
10195 CALL mp_timestop(handle)
10196 END SUBROUTINE mp_send_lm2
10206 SUBROUTINE mp_send_lm3(msg, dest, tag, comm)
10207 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
10208 INTEGER,
INTENT(IN) :: dest, tag
10211 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
10214#if defined(__parallel)
10215 INTEGER :: ierr, msglen
10218 CALL mp_timeset(routinen, handle)
10220#if defined(__parallel)
10222 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10223 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10224 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10231 cpabort(
"not in parallel mode")
10233 CALL mp_timestop(handle)
10234 END SUBROUTINE mp_send_lm3
10245 SUBROUTINE mp_recv_l (msg, source, tag, comm)
10246 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10247 INTEGER,
INTENT(INOUT) :: source, tag
10250 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_l'
10253#if defined(__parallel)
10254 INTEGER :: ierr, msglen
10255 mpi_status_type :: status
10258 CALL mp_timeset(routinen, handle)
10260#if defined(__parallel)
10263 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10264 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10266 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10267 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10268 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10269 source = status mpi_status_extract(mpi_source)
10270 tag = status mpi_status_extract(mpi_tag)
10278 cpabort(
"not in parallel mode")
10280 CALL mp_timestop(handle)
10281 END SUBROUTINE mp_recv_l
10291 SUBROUTINE mp_recv_lv(msg, source, tag, comm)
10292 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10293 INTEGER,
INTENT(INOUT) :: source, tag
10296 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lv'
10299#if defined(__parallel)
10300 INTEGER :: ierr, msglen
10301 mpi_status_type :: status
10304 CALL mp_timeset(routinen, handle)
10306#if defined(__parallel)
10309 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10310 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10312 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10313 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10314 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10315 source = status mpi_status_extract(mpi_source)
10316 tag = status mpi_status_extract(mpi_tag)
10324 cpabort(
"not in parallel mode")
10326 CALL mp_timestop(handle)
10327 END SUBROUTINE mp_recv_lv
10337 SUBROUTINE mp_recv_lm2(msg, source, tag, comm)
10338 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10339 INTEGER,
INTENT(INOUT) :: source, tag
10342 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lm2'
10345#if defined(__parallel)
10346 INTEGER :: ierr, msglen
10347 mpi_status_type :: status
10350 CALL mp_timeset(routinen, handle)
10352#if defined(__parallel)
10355 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10356 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10358 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10359 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10360 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10361 source = status mpi_status_extract(mpi_source)
10362 tag = status mpi_status_extract(mpi_tag)
10370 cpabort(
"not in parallel mode")
10372 CALL mp_timestop(handle)
10373 END SUBROUTINE mp_recv_lm2
10383 SUBROUTINE mp_recv_lm3(msg, source, tag, comm)
10384 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
10385 INTEGER,
INTENT(INOUT) :: source, tag
10388 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lm3'
10391#if defined(__parallel)
10392 INTEGER :: ierr, msglen
10393 mpi_status_type :: status
10396 CALL mp_timeset(routinen, handle)
10398#if defined(__parallel)
10401 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10402 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10404 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10405 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10406 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10407 source = status mpi_status_extract(mpi_source)
10408 tag = status mpi_status_extract(mpi_tag)
10416 cpabort(
"not in parallel mode")
10418 CALL mp_timestop(handle)
10419 END SUBROUTINE mp_recv_lm3
10429 SUBROUTINE mp_bcast_l (msg, source, comm)
10430 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10431 INTEGER,
INTENT(IN) :: source
10434 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l'
10437#if defined(__parallel)
10438 INTEGER :: ierr, msglen
10441 CALL mp_timeset(routinen, handle)
10443#if defined(__parallel)
10445 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10446 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10447 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10453 CALL mp_timestop(handle)
10454 END SUBROUTINE mp_bcast_l
10463 SUBROUTINE mp_bcast_l_src(msg, comm)
10464 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10467 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l_src'
10470#if defined(__parallel)
10471 INTEGER :: ierr, msglen
10474 CALL mp_timeset(routinen, handle)
10476#if defined(__parallel)
10478 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10479 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10480 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10485 CALL mp_timestop(handle)
10486 END SUBROUTINE mp_bcast_l_src
10496 SUBROUTINE mp_ibcast_l (msg, source, comm, request)
10497 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10498 INTEGER,
INTENT(IN) :: source
10502 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_l'
10505#if defined(__parallel)
10506 INTEGER :: ierr, msglen
10509 CALL mp_timeset(routinen, handle)
10511#if defined(__parallel)
10513 CALL mpi_ibcast(msg, msglen, mpi_integer8, source, comm%handle, request%handle, ierr)
10514 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
10515 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_8_size)
10522 CALL mp_timestop(handle)
10523 END SUBROUTINE mp_ibcast_l
10532 SUBROUTINE mp_bcast_lv(msg, source, comm)
10533 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10534 INTEGER,
INTENT(IN) :: source
10537 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lv'
10540#if defined(__parallel)
10541 INTEGER :: ierr, msglen
10544 CALL mp_timeset(routinen, handle)
10546#if defined(__parallel)
10548 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10549 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10550 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10556 CALL mp_timestop(handle)
10557 END SUBROUTINE mp_bcast_lv
10565 SUBROUTINE mp_bcast_lv_src(msg, comm)
10566 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10569 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lv_src'
10572#if defined(__parallel)
10573 INTEGER :: ierr, msglen
10576 CALL mp_timeset(routinen, handle)
10578#if defined(__parallel)
10580 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10581 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10582 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10587 CALL mp_timestop(handle)
10588 END SUBROUTINE mp_bcast_lv_src
10597 SUBROUTINE mp_ibcast_lv(msg, source, comm, request)
10598 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
10599 INTEGER,
INTENT(IN) :: source
10603 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_lv'
10606#if defined(__parallel)
10607 INTEGER :: ierr, msglen
10610 CALL mp_timeset(routinen, handle)
10612#if defined(__parallel)
10613#if !defined(__GNUC__) || __GNUC__ >= 9
10614 cpassert(is_contiguous(msg))
10617 CALL mpi_ibcast(msg, msglen, mpi_integer8, source, comm%handle, request%handle, ierr)
10618 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
10619 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_8_size)
10626 CALL mp_timestop(handle)
10627 END SUBROUTINE mp_ibcast_lv
10636 SUBROUTINE mp_bcast_lm(msg, source, comm)
10637 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10638 INTEGER,
INTENT(IN) :: source
10641 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lm'
10644#if defined(__parallel)
10645 INTEGER :: ierr, msglen
10648 CALL mp_timeset(routinen, handle)
10650#if defined(__parallel)
10652 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10653 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10654 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10660 CALL mp_timestop(handle)
10661 END SUBROUTINE mp_bcast_lm
10670 SUBROUTINE mp_bcast_lm_src(msg, comm)
10671 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10674 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lm_src'
10677#if defined(__parallel)
10678 INTEGER :: ierr, msglen
10681 CALL mp_timeset(routinen, handle)
10683#if defined(__parallel)
10685 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10686 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10687 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10692 CALL mp_timestop(handle)
10693 END SUBROUTINE mp_bcast_lm_src
10702 SUBROUTINE mp_bcast_l3(msg, source, comm)
10703 INTEGER(KIND=int_8),
CONTIGUOUS :: msg(:, :, :)
10704 INTEGER,
INTENT(IN) :: source
10707 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l3'
10710#if defined(__parallel)
10711 INTEGER :: ierr, msglen
10714 CALL mp_timeset(routinen, handle)
10716#if defined(__parallel)
10718 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10719 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10720 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10726 CALL mp_timestop(handle)
10727 END SUBROUTINE mp_bcast_l3
10736 SUBROUTINE mp_bcast_l3_src(msg, comm)
10737 INTEGER(KIND=int_8),
CONTIGUOUS :: msg(:, :, :)
10740 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l3_src'
10743#if defined(__parallel)
10744 INTEGER :: ierr, msglen
10747 CALL mp_timeset(routinen, handle)
10749#if defined(__parallel)
10751 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10752 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10753 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10758 CALL mp_timestop(handle)
10759 END SUBROUTINE mp_bcast_l3_src
10768 SUBROUTINE mp_sum_l (msg, comm)
10769 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10772 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_l'
10775#if defined(__parallel)
10776 INTEGER :: ierr, msglen
10779 CALL mp_timeset(routinen, handle)
10781#if defined(__parallel)
10783 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
10784 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
10785 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
10790 CALL mp_timestop(handle)
10791 END SUBROUTINE mp_sum_l
10799 SUBROUTINE mp_sum_lv(msg, comm)
10800 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10803 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lv'
10806#if defined(__parallel)
10807 INTEGER :: ierr, msglen
10810 CALL mp_timeset(routinen, handle)
10812#if defined(__parallel)
10814 IF (msglen > 0)
THEN
10815 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
10816 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
10818 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
10823 CALL mp_timestop(handle)
10824 END SUBROUTINE mp_sum_lv
10832 SUBROUTINE mp_isum_lv(msg, comm, request)
10833 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
10837 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_lv'
10840#if defined(__parallel)
10841 INTEGER :: ierr, msglen
10844 CALL mp_timeset(routinen, handle)
10846#if defined(__parallel)
10847#if !defined(__GNUC__) || __GNUC__ >= 9
10848 cpassert(is_contiguous(msg))
10851 IF (msglen > 0)
THEN
10852 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, request%handle, ierr)
10853 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
10857 CALL add_perf(perf_id=23, count=1, msg_size=msglen*int_8_size)
10863 CALL mp_timestop(handle)
10864 END SUBROUTINE mp_isum_lv
10872 SUBROUTINE mp_sum_lm(msg, comm)
10873 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10876 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm'
10879#if defined(__parallel)
10880 INTEGER,
PARAMETER :: max_msg = 2**25
10881 INTEGER :: ierr, m1, msglen, step, msglensum
10884 CALL mp_timeset(routinen, handle)
10886#if defined(__parallel)
10888 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
10890 DO m1 = lbound(msg, 2), ubound(msg, 2), step
10891 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
10892 msglensum = msglensum + msglen
10893 IF (msglen > 0)
THEN
10894 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
10895 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
10898 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_8_size)
10903 CALL mp_timestop(handle)
10904 END SUBROUTINE mp_sum_lm
10912 SUBROUTINE mp_sum_lm3(msg, comm)
10913 INTEGER(KIND=int_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
10916 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm3'
10919#if defined(__parallel)
10920 INTEGER :: ierr, msglen
10923 CALL mp_timeset(routinen, handle)
10925#if defined(__parallel)
10927 IF (msglen > 0)
THEN
10928 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
10929 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
10931 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
10936 CALL mp_timestop(handle)
10937 END SUBROUTINE mp_sum_lm3
10945 SUBROUTINE mp_sum_lm4(msg, comm)
10946 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
10949 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm4'
10952#if defined(__parallel)
10953 INTEGER :: ierr, msglen
10956 CALL mp_timeset(routinen, handle)
10958#if defined(__parallel)
10960 IF (msglen > 0)
THEN
10961 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
10962 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
10964 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
10969 CALL mp_timestop(handle)
10970 END SUBROUTINE mp_sum_lm4
10982 SUBROUTINE mp_sum_root_lv(msg, root, comm)
10983 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10984 INTEGER,
INTENT(IN) :: root
10987 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_lv'
10990#if defined(__parallel)
10991 INTEGER :: ierr, m1, msglen, taskid
10992 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
10995 CALL mp_timeset(routinen, handle)
10997#if defined(__parallel)
10999 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11000 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11001 IF (msglen > 0)
THEN
11004 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_sum, &
11005 root, comm%handle, ierr)
11006 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11007 IF (taskid == root)
THEN
11012 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11018 CALL mp_timestop(handle)
11019 END SUBROUTINE mp_sum_root_lv
11030 SUBROUTINE mp_sum_root_lm(msg, root, comm)
11031 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11032 INTEGER,
INTENT(IN) :: root
11035 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
11038#if defined(__parallel)
11039 INTEGER :: ierr, m1, m2, msglen, taskid
11040 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:, :)
11043 CALL mp_timeset(routinen, handle)
11045#if defined(__parallel)
11047 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11048 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11049 IF (msglen > 0)
THEN
11052 ALLOCATE (res(m1, m2))
11053 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_sum, root, comm%handle, ierr)
11054 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11055 IF (taskid == root)
THEN
11060 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11066 CALL mp_timestop(handle)
11067 END SUBROUTINE mp_sum_root_lm
11075 SUBROUTINE mp_sum_partial_lm(msg, res, comm)
11076 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11077 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
11080 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_lm'
11083#if defined(__parallel)
11084 INTEGER :: ierr, msglen, taskid
11087 CALL mp_timeset(routinen, handle)
11089#if defined(__parallel)
11091 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11092 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11093 IF (msglen > 0)
THEN
11094 CALL mpi_scan(msg, res, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11095 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
11097 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11103 CALL mp_timestop(handle)
11104 END SUBROUTINE mp_sum_partial_lm
11114 SUBROUTINE mp_max_l (msg, comm)
11115 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11118 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_l'
11121#if defined(__parallel)
11122 INTEGER :: ierr, msglen
11125 CALL mp_timeset(routinen, handle)
11127#if defined(__parallel)
11129 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_max, comm%handle, ierr)
11130 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11131 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11136 CALL mp_timestop(handle)
11137 END SUBROUTINE mp_max_l
11147 SUBROUTINE mp_max_root_l (msg, root, comm)
11148 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11149 INTEGER,
INTENT(IN) :: root
11152 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_l'
11155#if defined(__parallel)
11156 INTEGER :: ierr, msglen
11157 INTEGER(KIND=int_8) :: res
11160 CALL mp_timeset(routinen, handle)
11162#if defined(__parallel)
11164 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_max, root, comm%handle, ierr)
11165 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11166 IF (root == comm%mepos) msg = res
11167 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11173 CALL mp_timestop(handle)
11174 END SUBROUTINE mp_max_root_l
11184 SUBROUTINE mp_max_lv(msg, comm)
11185 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
11188 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_lv'
11191#if defined(__parallel)
11192 INTEGER :: ierr, msglen
11195 CALL mp_timeset(routinen, handle)
11197#if defined(__parallel)
11199 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_max, comm%handle, ierr)
11200 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11201 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11206 CALL mp_timestop(handle)
11207 END SUBROUTINE mp_max_lv
11217 SUBROUTINE mp_max_root_lm(msg, root, comm)
11218 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11222 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_lm'
11225#if defined(__parallel)
11226 INTEGER :: ierr, msglen
11227 INTEGER(KIND=int_8) :: res(size(msg, 1), size(msg, 2))
11230 CALL mp_timeset(routinen, handle)
11232#if defined(__parallel)
11234 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_max, root, comm%handle, ierr)
11235 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11236 IF (root == comm%mepos) msg = res
11237 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11243 CALL mp_timestop(handle)
11244 END SUBROUTINE mp_max_root_lm
11254 SUBROUTINE mp_min_l (msg, comm)
11255 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11258 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_l'
11261#if defined(__parallel)
11262 INTEGER :: ierr, msglen
11265 CALL mp_timeset(routinen, handle)
11267#if defined(__parallel)
11269 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_min, comm%handle, ierr)
11270 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11271 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11276 CALL mp_timestop(handle)
11277 END SUBROUTINE mp_min_l
11289 SUBROUTINE mp_min_lv(msg, comm)
11290 INTEGER(KIND=int_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
11293 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_lv'
11296#if defined(__parallel)
11297 INTEGER :: ierr, msglen
11300 CALL mp_timeset(routinen, handle)
11302#if defined(__parallel)
11304 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_min, comm%handle, ierr)
11305 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11306 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11311 CALL mp_timestop(handle)
11312 END SUBROUTINE mp_min_lv
11322 SUBROUTINE mp_prod_l (msg, comm)
11323 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11326 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_l'
11329#if defined(__parallel)
11330 INTEGER :: ierr, msglen
11333 CALL mp_timeset(routinen, handle)
11335#if defined(__parallel)
11337 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_prod, comm%handle, ierr)
11338 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11339 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11344 CALL mp_timestop(handle)
11345 END SUBROUTINE mp_prod_l
11356 SUBROUTINE mp_scatter_lv(msg_scatter, msg, root, comm)
11357 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
11358 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
11359 INTEGER,
INTENT(IN) :: root
11362 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_lv'
11365#if defined(__parallel)
11366 INTEGER :: ierr, msglen
11369 CALL mp_timeset(routinen, handle)
11371#if defined(__parallel)
11373 CALL mpi_scatter(msg_scatter, msglen, mpi_integer8, msg, &
11374 msglen, mpi_integer8, root, comm%handle, ierr)
11375 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
11376 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11382 CALL mp_timestop(handle)
11383 END SUBROUTINE mp_scatter_lv
11393 SUBROUTINE mp_iscatter_l (msg_scatter, msg, root, comm, request)
11394 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:)
11395 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11396 INTEGER,
INTENT(IN) :: root
11400 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_l'
11403#if defined(__parallel)
11404 INTEGER :: ierr, msglen
11407 CALL mp_timeset(routinen, handle)
11409#if defined(__parallel)
11410#if !defined(__GNUC__) || __GNUC__ >= 9
11411 cpassert(is_contiguous(msg_scatter))
11414 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer8, msg, &
11415 msglen, mpi_integer8, root, comm%handle, request%handle, ierr)
11416 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
11417 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11421 msg = msg_scatter(1)
11424 CALL mp_timestop(handle)
11425 END SUBROUTINE mp_iscatter_l
11435 SUBROUTINE mp_iscatter_lv2(msg_scatter, msg, root, comm, request)
11436 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:, :)
11437 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
11438 INTEGER,
INTENT(IN) :: root
11442 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_lv2'
11445#if defined(__parallel)
11446 INTEGER :: ierr, msglen
11449 CALL mp_timeset(routinen, handle)
11451#if defined(__parallel)
11452#if !defined(__GNUC__) || __GNUC__ >= 9
11453 cpassert(is_contiguous(msg_scatter))
11456 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer8, msg, &
11457 msglen, mpi_integer8, root, comm%handle, request%handle, ierr)
11458 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
11459 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11463 msg(:) = msg_scatter(:, 1)
11466 CALL mp_timestop(handle)
11467 END SUBROUTINE mp_iscatter_lv2
11477 SUBROUTINE mp_iscatterv_lv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
11478 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:)
11479 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
11480 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
11481 INTEGER,
INTENT(IN) :: recvcount, root
11485 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_lv'
11488#if defined(__parallel)
11492 CALL mp_timeset(routinen, handle)
11494#if defined(__parallel)
11495#if !defined(__GNUC__) || __GNUC__ >= 9
11496 cpassert(is_contiguous(msg_scatter))
11497 cpassert(is_contiguous(msg))
11498 cpassert(is_contiguous(sendcounts))
11499 cpassert(is_contiguous(displs))
11501 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_integer8, msg, &
11502 recvcount, mpi_integer8, root, comm%handle, request%handle, ierr)
11503 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
11504 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11506 mark_used(sendcounts)
11508 mark_used(recvcount)
11511 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
11514 CALL mp_timestop(handle)
11515 END SUBROUTINE mp_iscatterv_lv
11526 SUBROUTINE mp_gather_l (msg, msg_gather, root, comm)
11527 INTEGER(KIND=int_8),
INTENT(IN) :: msg
11528 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11529 INTEGER,
INTENT(IN) :: root
11532 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_l'
11535#if defined(__parallel)
11536 INTEGER :: ierr, msglen
11539 CALL mp_timeset(routinen, handle)
11541#if defined(__parallel)
11543 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11544 msglen, mpi_integer8, root, comm%handle, ierr)
11545 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11546 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11550 msg_gather(1) = msg
11552 CALL mp_timestop(handle)
11553 END SUBROUTINE mp_gather_l
11563 SUBROUTINE mp_gather_l_src(msg, msg_gather, comm)
11564 INTEGER(KIND=int_8),
INTENT(IN) :: msg
11565 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11568 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_l_src'
11571#if defined(__parallel)
11572 INTEGER :: ierr, msglen
11575 CALL mp_timeset(routinen, handle)
11577#if defined(__parallel)
11579 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11580 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11581 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11582 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11585 msg_gather(1) = msg
11587 CALL mp_timestop(handle)
11588 END SUBROUTINE mp_gather_l_src
11602 SUBROUTINE mp_gather_lv(msg, msg_gather, root, comm)
11603 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
11604 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11605 INTEGER,
INTENT(IN) :: root
11608 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lv'
11611#if defined(__parallel)
11612 INTEGER :: ierr, msglen
11615 CALL mp_timeset(routinen, handle)
11617#if defined(__parallel)
11619 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11620 msglen, mpi_integer8, root, comm%handle, ierr)
11621 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11622 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11628 CALL mp_timestop(handle)
11629 END SUBROUTINE mp_gather_lv
11642 SUBROUTINE mp_gather_lv_src(msg, msg_gather, comm)
11643 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
11644 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11647 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lv_src'
11650#if defined(__parallel)
11651 INTEGER :: ierr, msglen
11654 CALL mp_timeset(routinen, handle)
11656#if defined(__parallel)
11658 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11659 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11660 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11661 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11666 CALL mp_timestop(handle)
11667 END SUBROUTINE mp_gather_lv_src
11681 SUBROUTINE mp_gather_lm(msg, msg_gather, root, comm)
11682 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11683 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
11684 INTEGER,
INTENT(IN) :: root
11687 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lm'
11690#if defined(__parallel)
11691 INTEGER :: ierr, msglen
11694 CALL mp_timeset(routinen, handle)
11696#if defined(__parallel)
11698 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11699 msglen, mpi_integer8, root, comm%handle, ierr)
11700 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11701 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11707 CALL mp_timestop(handle)
11708 END SUBROUTINE mp_gather_lm
11721 SUBROUTINE mp_gather_lm_src(msg, msg_gather, comm)
11722 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11723 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
11726 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lm_src'
11729#if defined(__parallel)
11730 INTEGER :: ierr, msglen
11733 CALL mp_timeset(routinen, handle)
11735#if defined(__parallel)
11737 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11738 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11739 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11740 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11745 CALL mp_timestop(handle)
11746 END SUBROUTINE mp_gather_lm_src
11763 SUBROUTINE mp_gatherv_lv(sendbuf, recvbuf, recvcounts, displs, root, comm)
11765 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
11766 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
11767 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
11768 INTEGER,
INTENT(IN) :: root
11771 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lv'
11774#if defined(__parallel)
11775 INTEGER :: ierr, sendcount
11778 CALL mp_timeset(routinen, handle)
11780#if defined(__parallel)
11781 sendcount =
SIZE(sendbuf)
11782 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
11783 recvbuf, recvcounts, displs, mpi_integer8, &
11784 root, comm%handle, ierr)
11785 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
11786 CALL add_perf(perf_id=4, &
11788 msg_size=sendcount*int_8_size)
11790 mark_used(recvcounts)
11793 recvbuf(1 + displs(1):) = sendbuf
11795 CALL mp_timestop(handle)
11796 END SUBROUTINE mp_gatherv_lv
11812 SUBROUTINE mp_gatherv_lv_src(sendbuf, recvbuf, recvcounts, displs, comm)
11814 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
11815 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
11816 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
11819 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lv_src'
11822#if defined(__parallel)
11823 INTEGER :: ierr, sendcount
11826 CALL mp_timeset(routinen, handle)
11828#if defined(__parallel)
11829 sendcount =
SIZE(sendbuf)
11830 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
11831 recvbuf, recvcounts, displs, mpi_integer8, &
11832 comm%source, comm%handle, ierr)
11833 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
11834 CALL add_perf(perf_id=4, &
11836 msg_size=sendcount*int_8_size)
11838 mark_used(recvcounts)
11840 recvbuf(1 + displs(1):) = sendbuf
11842 CALL mp_timestop(handle)
11843 END SUBROUTINE mp_gatherv_lv_src
11860 SUBROUTINE mp_gatherv_lm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
11862 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
11863 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
11864 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
11865 INTEGER,
INTENT(IN) :: root
11868 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lm2'
11871#if defined(__parallel)
11872 INTEGER :: ierr, sendcount
11875 CALL mp_timeset(routinen, handle)
11877#if defined(__parallel)
11878 sendcount =
SIZE(sendbuf)
11879 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
11880 recvbuf, recvcounts, displs, mpi_integer8, &
11881 root, comm%handle, ierr)
11882 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
11883 CALL add_perf(perf_id=4, &
11885 msg_size=sendcount*int_8_size)
11887 mark_used(recvcounts)
11890 recvbuf(:, 1 + displs(1):) = sendbuf
11892 CALL mp_timestop(handle)
11893 END SUBROUTINE mp_gatherv_lm2
11909 SUBROUTINE mp_gatherv_lm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
11911 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
11912 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
11913 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
11916 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lm2_src'
11919#if defined(__parallel)
11920 INTEGER :: ierr, sendcount
11923 CALL mp_timeset(routinen, handle)
11925#if defined(__parallel)
11926 sendcount =
SIZE(sendbuf)
11927 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
11928 recvbuf, recvcounts, displs, mpi_integer8, &
11929 comm%source, comm%handle, ierr)
11930 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
11931 CALL add_perf(perf_id=4, &
11933 msg_size=sendcount*int_8_size)
11935 mark_used(recvcounts)
11937 recvbuf(:, 1 + displs(1):) = sendbuf
11939 CALL mp_timestop(handle)
11940 END SUBROUTINE mp_gatherv_lm2_src
11957 SUBROUTINE mp_igatherv_lv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
11958 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
11959 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
11960 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
11961 INTEGER,
INTENT(IN) :: sendcount, root
11965 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_lv'
11968#if defined(__parallel)
11972 CALL mp_timeset(routinen, handle)
11974#if defined(__parallel)
11975#if !defined(__GNUC__) || __GNUC__ >= 9
11976 cpassert(is_contiguous(sendbuf))
11977 cpassert(is_contiguous(recvbuf))
11978 cpassert(is_contiguous(recvcounts))
11979 cpassert(is_contiguous(displs))
11981 CALL mpi_igatherv(sendbuf, sendcount, mpi_integer8, &
11982 recvbuf, recvcounts, displs, mpi_integer8, &
11983 root, comm%handle, request%handle, ierr)
11984 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
11985 CALL add_perf(perf_id=24, &
11987 msg_size=sendcount*int_8_size)
11989 mark_used(sendcount)
11990 mark_used(recvcounts)
11993 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
11996 CALL mp_timestop(handle)
11997 END SUBROUTINE mp_igatherv_lv
12010 SUBROUTINE mp_allgather_l (msgout, msgin, comm)
12011 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12012 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
12015 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l'
12018#if defined(__parallel)
12019 INTEGER :: ierr, rcount, scount
12022 CALL mp_timeset(routinen, handle)
12024#if defined(__parallel)
12027 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12028 msgin, rcount, mpi_integer8, &
12030 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12035 CALL mp_timestop(handle)
12036 END SUBROUTINE mp_allgather_l
12049 SUBROUTINE mp_allgather_l2(msgout, msgin, comm)
12050 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12051 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12054 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l2'
12057#if defined(__parallel)
12058 INTEGER :: ierr, rcount, scount
12061 CALL mp_timeset(routinen, handle)
12063#if defined(__parallel)
12066 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12067 msgin, rcount, mpi_integer8, &
12069 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12074 CALL mp_timestop(handle)
12075 END SUBROUTINE mp_allgather_l2
12088 SUBROUTINE mp_iallgather_l (msgout, msgin, comm, request)
12089 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12090 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12094 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l'
12097#if defined(__parallel)
12098 INTEGER :: ierr, rcount, scount
12101 CALL mp_timeset(routinen, handle)
12103#if defined(__parallel)
12104#if !defined(__GNUC__) || __GNUC__ >= 9
12105 cpassert(is_contiguous(msgin))
12109 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12110 msgin, rcount, mpi_integer8, &
12111 comm%handle, request%handle, ierr)
12112 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12118 CALL mp_timestop(handle)
12119 END SUBROUTINE mp_iallgather_l
12134 SUBROUTINE mp_allgather_l12(msgout, msgin, comm)
12135 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
12136 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12139 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l12'
12142#if defined(__parallel)
12143 INTEGER :: ierr, rcount, scount
12146 CALL mp_timeset(routinen, handle)
12148#if defined(__parallel)
12149 scount =
SIZE(msgout(:))
12151 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12152 msgin, rcount, mpi_integer8, &
12154 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12157 msgin(:, 1) = msgout(:)
12159 CALL mp_timestop(handle)
12160 END SUBROUTINE mp_allgather_l12
12170 SUBROUTINE mp_allgather_l23(msgout, msgin, comm)
12171 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
12172 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
12175 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l23'
12178#if defined(__parallel)
12179 INTEGER :: ierr, rcount, scount
12182 CALL mp_timeset(routinen, handle)
12184#if defined(__parallel)
12185 scount =
SIZE(msgout(:, :))
12187 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12188 msgin, rcount, mpi_integer8, &
12190 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12193 msgin(:, :, 1) = msgout(:, :)
12195 CALL mp_timestop(handle)
12196 END SUBROUTINE mp_allgather_l23
12206 SUBROUTINE mp_allgather_l34(msgout, msgin, comm)
12207 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
12208 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
12211 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l34'
12214#if defined(__parallel)
12215 INTEGER :: ierr, rcount, scount
12218 CALL mp_timeset(routinen, handle)
12220#if defined(__parallel)
12221 scount =
SIZE(msgout(:, :, :))
12223 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12224 msgin, rcount, mpi_integer8, &
12226 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12229 msgin(:, :, :, 1) = msgout(:, :, :)
12231 CALL mp_timestop(handle)
12232 END SUBROUTINE mp_allgather_l34
12242 SUBROUTINE mp_allgather_l22(msgout, msgin, comm)
12243 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
12244 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12247 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l22'
12250#if defined(__parallel)
12251 INTEGER :: ierr, rcount, scount
12254 CALL mp_timeset(routinen, handle)
12256#if defined(__parallel)
12257 scount =
SIZE(msgout(:, :))
12259 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12260 msgin, rcount, mpi_integer8, &
12262 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12265 msgin(:, :) = msgout(:, :)
12267 CALL mp_timestop(handle)
12268 END SUBROUTINE mp_allgather_l22
12279 SUBROUTINE mp_iallgather_l11(msgout, msgin, comm, request)
12280 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12281 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12285 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l11'
12288#if defined(__parallel)
12289 INTEGER :: ierr, rcount, scount
12292 CALL mp_timeset(routinen, handle)
12294#if defined(__parallel)
12295#if !defined(__GNUC__) || __GNUC__ >= 9
12296 cpassert(is_contiguous(msgout))
12297 cpassert(is_contiguous(msgin))
12299 scount =
SIZE(msgout(:))
12301 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12302 msgin, rcount, mpi_integer8, &
12303 comm%handle, request%handle, ierr)
12304 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12310 CALL mp_timestop(handle)
12311 END SUBROUTINE mp_iallgather_l11
12322 SUBROUTINE mp_iallgather_l13(msgout, msgin, comm, request)
12323 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12324 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :)
12328 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l13'
12331#if defined(__parallel)
12332 INTEGER :: ierr, rcount, scount
12335 CALL mp_timeset(routinen, handle)
12337#if defined(__parallel)
12338#if !defined(__GNUC__) || __GNUC__ >= 9
12339 cpassert(is_contiguous(msgout))
12340 cpassert(is_contiguous(msgin))
12343 scount =
SIZE(msgout(:))
12345 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12346 msgin, rcount, mpi_integer8, &
12347 comm%handle, request%handle, ierr)
12348 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12351 msgin(:, 1, 1) = msgout(:)
12354 CALL mp_timestop(handle)
12355 END SUBROUTINE mp_iallgather_l13
12366 SUBROUTINE mp_iallgather_l22(msgout, msgin, comm, request)
12367 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :)
12368 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :)
12372 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l22'
12375#if defined(__parallel)
12376 INTEGER :: ierr, rcount, scount
12379 CALL mp_timeset(routinen, handle)
12381#if defined(__parallel)
12382#if !defined(__GNUC__) || __GNUC__ >= 9
12383 cpassert(is_contiguous(msgout))
12384 cpassert(is_contiguous(msgin))
12387 scount =
SIZE(msgout(:, :))
12389 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12390 msgin, rcount, mpi_integer8, &
12391 comm%handle, request%handle, ierr)
12392 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12395 msgin(:, :) = msgout(:, :)
12398 CALL mp_timestop(handle)
12399 END SUBROUTINE mp_iallgather_l22
12410 SUBROUTINE mp_iallgather_l24(msgout, msgin, comm, request)
12411 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :)
12412 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :, :)
12416 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l24'
12419#if defined(__parallel)
12420 INTEGER :: ierr, rcount, scount
12423 CALL mp_timeset(routinen, handle)
12425#if defined(__parallel)
12426#if !defined(__GNUC__) || __GNUC__ >= 9
12427 cpassert(is_contiguous(msgout))
12428 cpassert(is_contiguous(msgin))
12431 scount =
SIZE(msgout(:, :))
12433 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12434 msgin, rcount, mpi_integer8, &
12435 comm%handle, request%handle, ierr)
12436 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12439 msgin(:, :, 1, 1) = msgout(:, :)
12442 CALL mp_timestop(handle)
12443 END SUBROUTINE mp_iallgather_l24
12454 SUBROUTINE mp_iallgather_l33(msgout, msgin, comm, request)
12455 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :, :)
12456 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :)
12460 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l33'
12463#if defined(__parallel)
12464 INTEGER :: ierr, rcount, scount
12467 CALL mp_timeset(routinen, handle)
12469#if defined(__parallel)
12470#if !defined(__GNUC__) || __GNUC__ >= 9
12471 cpassert(is_contiguous(msgout))
12472 cpassert(is_contiguous(msgin))
12475 scount =
SIZE(msgout(:, :, :))
12477 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12478 msgin, rcount, mpi_integer8, &
12479 comm%handle, request%handle, ierr)
12480 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12483 msgin(:, :, :) = msgout(:, :, :)
12486 CALL mp_timestop(handle)
12487 END SUBROUTINE mp_iallgather_l33
12506 SUBROUTINE mp_allgatherv_lv(msgout, msgin, rcount, rdispl, comm)
12507 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
12508 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12509 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12512 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_lv'
12515#if defined(__parallel)
12516 INTEGER :: ierr, scount
12519 CALL mp_timeset(routinen, handle)
12521#if defined(__parallel)
12522 scount =
SIZE(msgout)
12523 CALL mpi_allgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12524 rdispl, mpi_integer8, comm%handle, ierr)
12525 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
12532 CALL mp_timestop(handle)
12533 END SUBROUTINE mp_allgatherv_lv
12552 SUBROUTINE mp_allgatherv_lm2(msgout, msgin, rcount, rdispl, comm)
12553 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
12554 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
12555 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12558 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_lv'
12561#if defined(__parallel)
12562 INTEGER :: ierr, scount
12565 CALL mp_timeset(routinen, handle)
12567#if defined(__parallel)
12568 scount =
SIZE(msgout)
12569 CALL mpi_allgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12570 rdispl, mpi_integer8, comm%handle, ierr)
12571 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
12578 CALL mp_timestop(handle)
12579 END SUBROUTINE mp_allgatherv_lm2
12598 SUBROUTINE mp_iallgatherv_lv(msgout, msgin, rcount, rdispl, comm, request)
12599 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12600 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12601 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12605 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_lv'
12608#if defined(__parallel)
12609 INTEGER :: ierr, scount, rsize
12612 CALL mp_timeset(routinen, handle)
12614#if defined(__parallel)
12615#if !defined(__GNUC__) || __GNUC__ >= 9
12616 cpassert(is_contiguous(msgout))
12617 cpassert(is_contiguous(msgin))
12618 cpassert(is_contiguous(rcount))
12619 cpassert(is_contiguous(rdispl))
12622 scount =
SIZE(msgout)
12623 rsize =
SIZE(rcount)
12624 CALL mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, &
12625 rdispl, comm, request, ierr)
12626 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
12634 CALL mp_timestop(handle)
12635 END SUBROUTINE mp_iallgatherv_lv
12654 SUBROUTINE mp_iallgatherv_lv2(msgout, msgin, rcount, rdispl, comm, request)
12655 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12656 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12657 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
12661 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_lv2'
12664#if defined(__parallel)
12665 INTEGER :: ierr, scount, rsize
12668 CALL mp_timeset(routinen, handle)
12670#if defined(__parallel)
12671#if !defined(__GNUC__) || __GNUC__ >= 9
12672 cpassert(is_contiguous(msgout))
12673 cpassert(is_contiguous(msgin))
12674 cpassert(is_contiguous(rcount))
12675 cpassert(is_contiguous(rdispl))
12678 scount =
SIZE(msgout)
12679 rsize =
SIZE(rcount)
12680 CALL mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, &
12681 rdispl, comm, request, ierr)
12682 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
12690 CALL mp_timestop(handle)
12691 END SUBROUTINE mp_iallgatherv_lv2
12702#if defined(__parallel)
12703 SUBROUTINE mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
12704 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
12705 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12706 INTEGER,
INTENT(IN) :: rsize
12707 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
12710 INTEGER,
INTENT(INOUT) :: ierr
12712 CALL mpi_iallgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12713 rdispl, mpi_integer8, comm%handle, request%handle, ierr)
12715 END SUBROUTINE mp_iallgatherv_lv_internal
12726 SUBROUTINE mp_sum_scatter_lv(msgout, msgin, rcount, comm)
12727 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
12728 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12729 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
12732 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_lv'
12735#if defined(__parallel)
12739 CALL mp_timeset(routinen, handle)
12741#if defined(__parallel)
12742 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_integer8, mpi_sum, &
12744 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
12746 CALL add_perf(perf_id=3, count=1, &
12747 msg_size=rcount(1)*2*int_8_size)
12751 msgin = msgout(:, 1)
12753 CALL mp_timestop(handle)
12754 END SUBROUTINE mp_sum_scatter_lv
12765 SUBROUTINE mp_sendrecv_l (msgin, dest, msgout, source, comm, tag)
12766 INTEGER(KIND=int_8),
INTENT(IN) :: msgin
12767 INTEGER,
INTENT(IN) :: dest
12768 INTEGER(KIND=int_8),
INTENT(OUT) :: msgout
12769 INTEGER,
INTENT(IN) :: source
12771 INTEGER,
INTENT(IN),
OPTIONAL :: tag
12773 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_l'
12776#if defined(__parallel)
12777 INTEGER :: ierr, msglen_in, msglen_out, &
12781 CALL mp_timeset(routinen, handle)
12783#if defined(__parallel)
12788 IF (
PRESENT(tag))
THEN
12792 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
12793 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
12794 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
12795 CALL add_perf(perf_id=7, count=1, &
12796 msg_size=(msglen_in + msglen_out)*int_8_size/2)
12804 CALL mp_timestop(handle)
12805 END SUBROUTINE mp_sendrecv_l
12816 SUBROUTINE mp_sendrecv_lv(msgin, dest, msgout, source, comm, tag)
12817 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
12818 INTEGER,
INTENT(IN) :: dest
12819 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
12820 INTEGER,
INTENT(IN) :: source
12822 INTEGER,
INTENT(IN),
OPTIONAL :: tag
12824 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lv'
12827#if defined(__parallel)
12828 INTEGER :: ierr, msglen_in, msglen_out, &
12832 CALL mp_timeset(routinen, handle)
12834#if defined(__parallel)
12835 msglen_in =
SIZE(msgin)
12836 msglen_out =
SIZE(msgout)
12839 IF (
PRESENT(tag))
THEN
12843 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
12844 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
12845 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
12846 CALL add_perf(perf_id=7, count=1, &
12847 msg_size=(msglen_in + msglen_out)*int_8_size/2)
12855 CALL mp_timestop(handle)
12856 END SUBROUTINE mp_sendrecv_lv
12868 SUBROUTINE mp_sendrecv_lm2(msgin, dest, msgout, source, comm, tag)
12869 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
12870 INTEGER,
INTENT(IN) :: dest
12871 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
12872 INTEGER,
INTENT(IN) :: source
12874 INTEGER,
INTENT(IN),
OPTIONAL :: tag
12876 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm2'
12879#if defined(__parallel)
12880 INTEGER :: ierr, msglen_in, msglen_out, &
12884 CALL mp_timeset(routinen, handle)
12886#if defined(__parallel)
12887 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
12888 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
12891 IF (
PRESENT(tag))
THEN
12895 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
12896 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
12897 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
12898 CALL add_perf(perf_id=7, count=1, &
12899 msg_size=(msglen_in + msglen_out)*int_8_size/2)
12907 CALL mp_timestop(handle)
12908 END SUBROUTINE mp_sendrecv_lm2
12919 SUBROUTINE mp_sendrecv_lm3(msgin, dest, msgout, source, comm, tag)
12920 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
12921 INTEGER,
INTENT(IN) :: dest
12922 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
12923 INTEGER,
INTENT(IN) :: source
12925 INTEGER,
INTENT(IN),
OPTIONAL :: tag
12927 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm3'
12930#if defined(__parallel)
12931 INTEGER :: ierr, msglen_in, msglen_out, &
12935 CALL mp_timeset(routinen, handle)
12937#if defined(__parallel)
12938 msglen_in =
SIZE(msgin)
12939 msglen_out =
SIZE(msgout)
12942 IF (
PRESENT(tag))
THEN
12946 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
12947 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
12948 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
12949 CALL add_perf(perf_id=7, count=1, &
12950 msg_size=(msglen_in + msglen_out)*int_8_size/2)
12958 CALL mp_timestop(handle)
12959 END SUBROUTINE mp_sendrecv_lm3
12970 SUBROUTINE mp_sendrecv_lm4(msgin, dest, msgout, source, comm, tag)
12971 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
12972 INTEGER,
INTENT(IN) :: dest
12973 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
12974 INTEGER,
INTENT(IN) :: source
12976 INTEGER,
INTENT(IN),
OPTIONAL :: tag
12978 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm4'
12981#if defined(__parallel)
12982 INTEGER :: ierr, msglen_in, msglen_out, &
12986 CALL mp_timeset(routinen, handle)
12988#if defined(__parallel)
12989 msglen_in =
SIZE(msgin)
12990 msglen_out =
SIZE(msgout)
12993 IF (
PRESENT(tag))
THEN
12997 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
12998 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
12999 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13000 CALL add_perf(perf_id=7, count=1, &
13001 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13009 CALL mp_timestop(handle)
13010 END SUBROUTINE mp_sendrecv_lm4
13027 SUBROUTINE mp_isendrecv_l (msgin, dest, msgout, source, comm, send_request, &
13029 INTEGER(KIND=int_8),
INTENT(IN) :: msgin
13030 INTEGER,
INTENT(IN) :: dest
13031 INTEGER(KIND=int_8),
INTENT(INOUT) :: msgout
13032 INTEGER,
INTENT(IN) :: source
13035 INTEGER,
INTENT(in),
OPTIONAL :: tag
13037 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_l'
13040#if defined(__parallel)
13041 INTEGER :: ierr, my_tag
13044 CALL mp_timeset(routinen, handle)
13046#if defined(__parallel)
13048 IF (
PRESENT(tag)) my_tag = tag
13050 CALL mpi_irecv(msgout, 1, mpi_integer8, source, my_tag, &
13051 comm%handle, recv_request%handle, ierr)
13052 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13054 CALL mpi_isend(msgin, 1, mpi_integer8, dest, my_tag, &
13055 comm%handle, send_request%handle, ierr)
13056 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13058 CALL add_perf(perf_id=8, count=1, msg_size=2*int_8_size)
13068 CALL mp_timestop(handle)
13069 END SUBROUTINE mp_isendrecv_l
13088 SUBROUTINE mp_isendrecv_lv(msgin, dest, msgout, source, comm, send_request, &
13090 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: msgin
13091 INTEGER,
INTENT(IN) :: dest
13092 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
13093 INTEGER,
INTENT(IN) :: source
13096 INTEGER,
INTENT(in),
OPTIONAL :: tag
13098 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_lv'
13101#if defined(__parallel)
13102 INTEGER :: ierr, msglen, my_tag
13103 INTEGER(KIND=int_8) :: foo
13106 CALL mp_timeset(routinen, handle)
13108#if defined(__parallel)
13109#if !defined(__GNUC__) || __GNUC__ >= 9
13110 cpassert(is_contiguous(msgout))
13111 cpassert(is_contiguous(msgin))
13115 IF (
PRESENT(tag)) my_tag = tag
13117 msglen =
SIZE(msgout, 1)
13118 IF (msglen > 0)
THEN
13119 CALL mpi_irecv(msgout(1), msglen, mpi_integer8, source, my_tag, &
13120 comm%handle, recv_request%handle, ierr)
13122 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13123 comm%handle, recv_request%handle, ierr)
13125 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13127 msglen =
SIZE(msgin, 1)
13128 IF (msglen > 0)
THEN
13129 CALL mpi_isend(msgin(1), msglen, mpi_integer8, dest, my_tag, &
13130 comm%handle, send_request%handle, ierr)
13132 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13133 comm%handle, send_request%handle, ierr)
13135 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13137 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
13138 CALL add_perf(perf_id=8, count=1, msg_size=msglen*int_8_size)
13148 CALL mp_timestop(handle)
13149 END SUBROUTINE mp_isendrecv_lv
13164 SUBROUTINE mp_isend_lv(msgin, dest, comm, request, tag)
13165 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: msgin
13166 INTEGER,
INTENT(IN) :: dest
13169 INTEGER,
INTENT(in),
OPTIONAL :: tag
13171 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lv'
13173 INTEGER :: handle, ierr
13174#if defined(__parallel)
13175 INTEGER :: msglen, my_tag
13176 INTEGER(KIND=int_8) :: foo(1)
13179 CALL mp_timeset(routinen, handle)
13181#if defined(__parallel)
13182#if !defined(__GNUC__) || __GNUC__ >= 9
13183 cpassert(is_contiguous(msgin))
13186 IF (
PRESENT(tag)) my_tag = tag
13188 msglen =
SIZE(msgin)
13189 IF (msglen > 0)
THEN
13190 CALL mpi_isend(msgin(1), msglen, mpi_integer8, dest, my_tag, &
13191 comm%handle, request%handle, ierr)
13193 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13194 comm%handle, request%handle, ierr)
13196 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13198 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13207 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13209 CALL mp_timestop(handle)
13210 END SUBROUTINE mp_isend_lv
13227 SUBROUTINE mp_isend_lm2(msgin, dest, comm, request, tag)
13228 INTEGER(KIND=int_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
13229 INTEGER,
INTENT(IN) :: dest
13232 INTEGER,
INTENT(in),
OPTIONAL :: tag
13234 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm2'
13236 INTEGER :: handle, ierr
13237#if defined(__parallel)
13238 INTEGER :: msglen, my_tag
13239 INTEGER(KIND=int_8) :: foo(1)
13242 CALL mp_timeset(routinen, handle)
13244#if defined(__parallel)
13245#if !defined(__GNUC__) || __GNUC__ >= 9
13246 cpassert(is_contiguous(msgin))
13250 IF (
PRESENT(tag)) my_tag = tag
13252 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
13253 IF (msglen > 0)
THEN
13254 CALL mpi_isend(msgin(1, 1), msglen, mpi_integer8, dest, my_tag, &
13255 comm%handle, request%handle, ierr)
13257 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13258 comm%handle, request%handle, ierr)
13260 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13262 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13271 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13273 CALL mp_timestop(handle)
13274 END SUBROUTINE mp_isend_lm2
13293 SUBROUTINE mp_isend_lm3(msgin, dest, comm, request, tag)
13294 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
13295 INTEGER,
INTENT(IN) :: dest
13298 INTEGER,
INTENT(in),
OPTIONAL :: tag
13300 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm3'
13302 INTEGER :: handle, ierr
13303#if defined(__parallel)
13304 INTEGER :: msglen, my_tag
13305 INTEGER(KIND=int_8) :: foo(1)
13308 CALL mp_timeset(routinen, handle)
13310#if defined(__parallel)
13311#if !defined(__GNUC__) || __GNUC__ >= 9
13312 cpassert(is_contiguous(msgin))
13316 IF (
PRESENT(tag)) my_tag = tag
13318 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
13319 IF (msglen > 0)
THEN
13320 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_integer8, dest, my_tag, &
13321 comm%handle, request%handle, ierr)
13323 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13324 comm%handle, request%handle, ierr)
13326 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13328 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13337 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13339 CALL mp_timestop(handle)
13340 END SUBROUTINE mp_isend_lm3
13356 SUBROUTINE mp_isend_lm4(msgin, dest, comm, request, tag)
13357 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
13358 INTEGER,
INTENT(IN) :: dest
13361 INTEGER,
INTENT(in),
OPTIONAL :: tag
13363 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm4'
13365 INTEGER :: handle, ierr
13366#if defined(__parallel)
13367 INTEGER :: msglen, my_tag
13368 INTEGER(KIND=int_8) :: foo(1)
13371 CALL mp_timeset(routinen, handle)
13373#if defined(__parallel)
13374#if !defined(__GNUC__) || __GNUC__ >= 9
13375 cpassert(is_contiguous(msgin))
13379 IF (
PRESENT(tag)) my_tag = tag
13381 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
13382 IF (msglen > 0)
THEN
13383 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_integer8, dest, my_tag, &
13384 comm%handle, request%handle, ierr)
13386 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13387 comm%handle, request%handle, ierr)
13389 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13391 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13400 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13402 CALL mp_timestop(handle)
13403 END SUBROUTINE mp_isend_lm4
13419 SUBROUTINE mp_irecv_lv(msgout, source, comm, request, tag)
13420 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
13421 INTEGER,
INTENT(IN) :: source
13424 INTEGER,
INTENT(in),
OPTIONAL :: tag
13426 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lv'
13429#if defined(__parallel)
13430 INTEGER :: ierr, msglen, my_tag
13431 INTEGER(KIND=int_8) :: foo(1)
13434 CALL mp_timeset(routinen, handle)
13436#if defined(__parallel)
13437#if !defined(__GNUC__) || __GNUC__ >= 9
13438 cpassert(is_contiguous(msgout))
13442 IF (
PRESENT(tag)) my_tag = tag
13444 msglen =
SIZE(msgout)
13445 IF (msglen > 0)
THEN
13446 CALL mpi_irecv(msgout(1), msglen, mpi_integer8, source, my_tag, &
13447 comm%handle, request%handle, ierr)
13449 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13450 comm%handle, request%handle, ierr)
13452 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13454 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13456 cpabort(
"mp_irecv called in non parallel case")
13463 CALL mp_timestop(handle)
13464 END SUBROUTINE mp_irecv_lv
13481 SUBROUTINE mp_irecv_lm2(msgout, source, comm, request, tag)
13482 INTEGER(KIND=int_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
13483 INTEGER,
INTENT(IN) :: source
13486 INTEGER,
INTENT(in),
OPTIONAL :: tag
13488 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm2'
13491#if defined(__parallel)
13492 INTEGER :: ierr, msglen, my_tag
13493 INTEGER(KIND=int_8) :: foo(1)
13496 CALL mp_timeset(routinen, handle)
13498#if defined(__parallel)
13499#if !defined(__GNUC__) || __GNUC__ >= 9
13500 cpassert(is_contiguous(msgout))
13504 IF (
PRESENT(tag)) my_tag = tag
13506 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
13507 IF (msglen > 0)
THEN
13508 CALL mpi_irecv(msgout(1, 1), msglen, mpi_integer8, source, my_tag, &
13509 comm%handle, request%handle, ierr)
13511 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13512 comm%handle, request%handle, ierr)
13514 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13516 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13523 cpabort(
"mp_irecv called in non parallel case")
13525 CALL mp_timestop(handle)
13526 END SUBROUTINE mp_irecv_lm2
13544 SUBROUTINE mp_irecv_lm3(msgout, source, comm, request, tag)
13545 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
13546 INTEGER,
INTENT(IN) :: source
13549 INTEGER,
INTENT(in),
OPTIONAL :: tag
13551 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm3'
13554#if defined(__parallel)
13555 INTEGER :: ierr, msglen, my_tag
13556 INTEGER(KIND=int_8) :: foo(1)
13559 CALL mp_timeset(routinen, handle)
13561#if defined(__parallel)
13562#if !defined(__GNUC__) || __GNUC__ >= 9
13563 cpassert(is_contiguous(msgout))
13567 IF (
PRESENT(tag)) my_tag = tag
13569 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
13570 IF (msglen > 0)
THEN
13571 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_integer8, source, my_tag, &
13572 comm%handle, request%handle, ierr)
13574 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13575 comm%handle, request%handle, ierr)
13577 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
13579 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13586 cpabort(
"mp_irecv called in non parallel case")
13588 CALL mp_timestop(handle)
13589 END SUBROUTINE mp_irecv_lm3
13605 SUBROUTINE mp_irecv_lm4(msgout, source, comm, request, tag)
13606 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
13607 INTEGER,
INTENT(IN) :: source
13610 INTEGER,
INTENT(in),
OPTIONAL :: tag
13612 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm4'
13615#if defined(__parallel)
13616 INTEGER :: ierr, msglen, my_tag
13617 INTEGER(KIND=int_8) :: foo(1)
13620 CALL mp_timeset(routinen, handle)
13622#if defined(__parallel)
13623#if !defined(__GNUC__) || __GNUC__ >= 9
13624 cpassert(is_contiguous(msgout))
13628 IF (
PRESENT(tag)) my_tag = tag
13630 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
13631 IF (msglen > 0)
THEN
13632 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_integer8, source, my_tag, &
13633 comm%handle, request%handle, ierr)
13635 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13636 comm%handle, request%handle, ierr)
13638 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
13640 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13647 cpabort(
"mp_irecv called in non parallel case")
13649 CALL mp_timestop(handle)
13650 END SUBROUTINE mp_irecv_lm4
13662 SUBROUTINE mp_win_create_lv(base, comm, win)
13663 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
13667 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_lv'
13670#if defined(__parallel)
13672 INTEGER(kind=mpi_address_kind) :: len
13673 INTEGER(KIND=int_8) :: foo(1)
13676 CALL mp_timeset(routinen, handle)
13678#if defined(__parallel)
13680 len =
SIZE(base)*int_8_size
13682 CALL mpi_win_create(base(1), len, int_8_size, mpi_info_null, comm%handle, win%handle, ierr)
13684 CALL mpi_win_create(foo, len, int_8_size, mpi_info_null, comm%handle, win%handle, ierr)
13686 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
13688 CALL add_perf(perf_id=20, count=1)
13692 win%handle = mp_win_null_handle
13694 CALL mp_timestop(handle)
13695 END SUBROUTINE mp_win_create_lv
13707 SUBROUTINE mp_rget_lv(base, source, win, win_data, myproc, disp, request, &
13708 origin_datatype, target_datatype)
13709 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
13710 INTEGER,
INTENT(IN) :: source
13712 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: win_data
13713 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
13717 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_lv'
13720#if defined(__parallel)
13721 INTEGER :: ierr, len, &
13722 origin_len, target_len
13723 LOGICAL :: do_local_copy
13724 INTEGER(kind=mpi_address_kind) :: disp_aint
13725 mpi_data_type :: handle_origin_datatype, handle_target_datatype
13728 CALL mp_timeset(routinen, handle)
13730#if defined(__parallel)
13733 IF (
PRESENT(disp))
THEN
13734 disp_aint = int(disp, kind=mpi_address_kind)
13736 handle_origin_datatype = mpi_integer8
13738 IF (
PRESENT(origin_datatype))
THEN
13739 handle_origin_datatype = origin_datatype%type_handle
13742 handle_target_datatype = mpi_integer8
13744 IF (
PRESENT(target_datatype))
THEN
13745 handle_target_datatype = target_datatype%type_handle
13749 do_local_copy = .false.
13750 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
13751 IF (myproc .EQ. source) do_local_copy = .true.
13753 IF (do_local_copy)
THEN
13755 base(:) = win_data(disp_aint + 1:disp_aint + len)
13760 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
13761 target_len, handle_target_datatype, win%handle, request%handle, ierr)
13767 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
13769 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*int_8_size)
13774 mark_used(origin_datatype)
13775 mark_used(target_datatype)
13779 IF (
PRESENT(disp))
THEN
13780 base(:) = win_data(disp + 1:disp +
SIZE(base))
13782 base(:) = win_data(:
SIZE(base))
13786 CALL mp_timestop(handle)
13787 END SUBROUTINE mp_rget_lv
13796 FUNCTION mp_type_indexed_make_l (count, lengths, displs) &
13797 result(type_descriptor)
13798 INTEGER,
INTENT(IN) :: count
13799 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
13802 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_l'
13805#if defined(__parallel)
13809 CALL mp_timeset(routinen, handle)
13811#if defined(__parallel)
13812 CALL mpi_type_indexed(count, lengths, displs, mpi_integer8, &
13813 type_descriptor%type_handle, ierr)
13815 cpabort(
"MPI_Type_Indexed @ "//routinen)
13816 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
13818 cpabort(
"MPI_Type_commit @ "//routinen)
13820 type_descriptor%type_handle = 19
13822 type_descriptor%length = count
13823 NULLIFY (type_descriptor%subtype)
13824 type_descriptor%vector_descriptor(1:2) = 1
13825 type_descriptor%has_indexing = .true.
13826 type_descriptor%index_descriptor%index => lengths
13827 type_descriptor%index_descriptor%chunks => displs
13829 CALL mp_timestop(handle)
13831 END FUNCTION mp_type_indexed_make_l
13840 SUBROUTINE mp_allocate_l (DATA, len, stat)
13841 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
13842 INTEGER,
INTENT(IN) :: len
13843 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
13845 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_l'
13847 INTEGER :: handle, ierr
13849 CALL mp_timeset(routinen, handle)
13851#if defined(__parallel)
13853 CALL mp_alloc_mem(
DATA, len, stat=ierr)
13854 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
13855 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
13856 CALL add_perf(perf_id=15, count=1)
13858 ALLOCATE (
DATA(len), stat=ierr)
13859 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
13860 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
13862 IF (
PRESENT(stat)) stat = ierr
13863 CALL mp_timestop(handle)
13864 END SUBROUTINE mp_allocate_l
13872 SUBROUTINE mp_deallocate_l (DATA, stat)
13873 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
13874 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
13876 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_l'
13879#if defined(__parallel)
13883 CALL mp_timeset(routinen, handle)
13885#if defined(__parallel)
13886 CALL mp_free_mem(
DATA, ierr)
13887 IF (
PRESENT(stat))
THEN
13890 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
13893 CALL add_perf(perf_id=15, count=1)
13896 IF (
PRESENT(stat)) stat = 0
13898 CALL mp_timestop(handle)
13899 END SUBROUTINE mp_deallocate_l
13912 SUBROUTINE mp_file_write_at_lv(fh, offset, msg, msglen)
13913 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
13915 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
13916 INTEGER(kind=file_offset),
INTENT(IN) :: offset
13919#if defined(__parallel)
13923 msg_len =
SIZE(msg)
13924 IF (
PRESENT(msglen)) msg_len = msglen
13925#if defined(__parallel)
13926 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
13928 cpabort(
"mpi_file_write_at_lv @ mp_file_write_at_lv")
13930 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
13932 END SUBROUTINE mp_file_write_at_lv
13940 SUBROUTINE mp_file_write_at_l (fh, offset, msg)
13941 INTEGER(KIND=int_8),
INTENT(IN) :: msg
13943 INTEGER(kind=file_offset),
INTENT(IN) :: offset
13945#if defined(__parallel)
13949 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
13951 cpabort(
"mpi_file_write_at_l @ mp_file_write_at_l")
13953 WRITE (unit=fh%handle, pos=offset + 1) msg
13955 END SUBROUTINE mp_file_write_at_l
13967 SUBROUTINE mp_file_write_at_all_lv(fh, offset, msg, msglen)
13968 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
13970 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
13971 INTEGER(kind=file_offset),
INTENT(IN) :: offset
13974#if defined(__parallel)
13978 msg_len =
SIZE(msg)
13979 IF (
PRESENT(msglen)) msg_len = msglen
13980#if defined(__parallel)
13981 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
13983 cpabort(
"mpi_file_write_at_all_lv @ mp_file_write_at_all_lv")
13985 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
13987 END SUBROUTINE mp_file_write_at_all_lv
13995 SUBROUTINE mp_file_write_at_all_l (fh, offset, msg)
13996 INTEGER(KIND=int_8),
INTENT(IN) :: msg
13998 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14000#if defined(__parallel)
14004 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14006 cpabort(
"mpi_file_write_at_all_l @ mp_file_write_at_all_l")
14008 WRITE (unit=fh%handle, pos=offset + 1) msg
14010 END SUBROUTINE mp_file_write_at_all_l
14023 SUBROUTINE mp_file_read_at_lv(fh, offset, msg, msglen)
14024 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
14026 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14027 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14030#if defined(__parallel)
14034 msg_len =
SIZE(msg)
14035 IF (
PRESENT(msglen)) msg_len = msglen
14036#if defined(__parallel)
14037 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14039 cpabort(
"mpi_file_read_at_lv @ mp_file_read_at_lv")
14041 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14043 END SUBROUTINE mp_file_read_at_lv
14051 SUBROUTINE mp_file_read_at_l (fh, offset, msg)
14052 INTEGER(KIND=int_8),
INTENT(OUT) :: msg
14054 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14056#if defined(__parallel)
14060 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14062 cpabort(
"mpi_file_read_at_l @ mp_file_read_at_l")
14064 READ (unit=fh%handle, pos=offset + 1) msg
14066 END SUBROUTINE mp_file_read_at_l
14078 SUBROUTINE mp_file_read_at_all_lv(fh, offset, msg, msglen)
14079 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
14081 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14082 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14085#if defined(__parallel)
14089 msg_len =
SIZE(msg)
14090 IF (
PRESENT(msglen)) msg_len = msglen
14091#if defined(__parallel)
14092 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14094 cpabort(
"mpi_file_read_at_all_lv @ mp_file_read_at_all_lv")
14096 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14098 END SUBROUTINE mp_file_read_at_all_lv
14106 SUBROUTINE mp_file_read_at_all_l (fh, offset, msg)
14107 INTEGER(KIND=int_8),
INTENT(OUT) :: msg
14109 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14111#if defined(__parallel)
14115 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14117 cpabort(
"mpi_file_read_at_all_l @ mp_file_read_at_all_l")
14119 READ (unit=fh%handle, pos=offset + 1) msg
14121 END SUBROUTINE mp_file_read_at_all_l
14130 FUNCTION mp_type_make_l (ptr, &
14131 vector_descriptor, index_descriptor) &
14132 result(type_descriptor)
14133 INTEGER(KIND=int_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
14134 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
14135 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
14138 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_l'
14140#if defined(__parallel)
14142#if defined(__MPI_F08)
14144 EXTERNAL :: mpi_get_address
14148 NULLIFY (type_descriptor%subtype)
14149 type_descriptor%length =
SIZE(ptr)
14150#if defined(__parallel)
14151 type_descriptor%type_handle = mpi_integer8
14152 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
14154 cpabort(
"MPI_Get_address @ "//routinen)
14156 type_descriptor%type_handle = 19
14158 type_descriptor%vector_descriptor(1:2) = 1
14159 type_descriptor%has_indexing = .false.
14160 type_descriptor%data_l => ptr
14161 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
14162 cpabort(routinen//
": Vectors and indices NYI")
14164 END FUNCTION mp_type_make_l
14173 SUBROUTINE mp_alloc_mem_l (DATA, len, stat)
14174 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
14175 INTEGER,
INTENT(IN) :: len
14176 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14178#if defined(__parallel)
14179 INTEGER :: size, ierr, length, &
14181 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
14182 TYPE(c_ptr) :: mp_baseptr
14183 mpi_info_type :: mp_info
14185 length = max(len, 1)
14186 CALL mpi_type_size(mpi_integer8,
size, ierr)
14187 mp_size = int(length, kind=mpi_address_kind)*
size
14188 IF (mp_size .GT. mp_max_memory_size)
THEN
14189 cpabort(
"MPI cannot allocate more than 2 GiByte")
14191 mp_info = mpi_info_null
14192 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
14193 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
14194 IF (
PRESENT(stat)) stat = mp_res
14196 INTEGER :: length, mystat
14197 length = max(len, 1)
14198 IF (
PRESENT(stat))
THEN
14199 ALLOCATE (
DATA(length), stat=mystat)
14202 ALLOCATE (
DATA(length))
14205 END SUBROUTINE mp_alloc_mem_l
14213 SUBROUTINE mp_free_mem_l (DATA, stat)
14214 INTEGER(KIND=int_8),
DIMENSION(:), &
14215 POINTER, asynchronous :: data
14216 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14218#if defined(__parallel)
14220 CALL mpi_free_mem(
DATA, mp_res)
14221 IF (
PRESENT(stat)) stat = mp_res
14224 IF (
PRESENT(stat)) stat = 0
14226 END SUBROUTINE mp_free_mem_l
14238 SUBROUTINE mp_shift_dm(msg, comm, displ_in)
14240 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
14242 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
14244 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_dm'
14246 INTEGER :: handle, ierror
14247#if defined(__parallel)
14248 INTEGER :: displ, left, &
14249 msglen, myrank, nprocs, &
14254 CALL mp_timeset(routinen, handle)
14256#if defined(__parallel)
14257 CALL mpi_comm_rank(comm%handle, myrank, ierror)
14258 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
14259 CALL mpi_comm_size(comm%handle, nprocs, ierror)
14260 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
14261 IF (
PRESENT(displ_in))
THEN
14266 right =
modulo(myrank + displ, nprocs)
14267 left =
modulo(myrank - displ, nprocs)
14270 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_precision, right, tag, left, tag, &
14271 comm%handle, mpi_status_ignore, ierror)
14272 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
14273 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_8_size)
14277 mark_used(displ_in)
14279 CALL mp_timestop(handle)
14281 END SUBROUTINE mp_shift_dm
14294 SUBROUTINE mp_shift_d (msg, comm, displ_in)
14296 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
14298 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
14300 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_d'
14302 INTEGER :: handle, ierror
14303#if defined(__parallel)
14304 INTEGER :: displ, left, &
14305 msglen, myrank, nprocs, &
14310 CALL mp_timeset(routinen, handle)
14312#if defined(__parallel)
14313 CALL mpi_comm_rank(comm%handle, myrank, ierror)
14314 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
14315 CALL mpi_comm_size(comm%handle, nprocs, ierror)
14316 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
14317 IF (
PRESENT(displ_in))
THEN
14322 right =
modulo(myrank + displ, nprocs)
14323 left =
modulo(myrank - displ, nprocs)
14326 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_precision, right, tag, left, &
14327 tag, comm%handle, mpi_status_ignore, ierror)
14328 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
14329 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_8_size)
14333 mark_used(displ_in)
14335 CALL mp_timestop(handle)
14337 END SUBROUTINE mp_shift_d
14358 SUBROUTINE mp_alltoall_d11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
14360 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
14361 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
14362 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
14363 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
14366 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d11v'
14369#if defined(__parallel)
14370 INTEGER :: ierr, msglen
14375 CALL mp_timeset(routinen, handle)
14377#if defined(__parallel)
14378 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_precision, &
14379 rb, rcount, rdispl, mpi_double_precision, comm%handle, ierr)
14380 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
14381 msglen = sum(scount) + sum(rcount)
14382 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14388 DO i = 1, rcount(1)
14389 rb(rdispl(1) + i) = sb(sdispl(1) + i)
14392 CALL mp_timestop(handle)
14394 END SUBROUTINE mp_alltoall_d11v
14409 SUBROUTINE mp_alltoall_d22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
14411 REAL(kind=real_8),
DIMENSION(:, :), &
14412 INTENT(IN),
CONTIGUOUS :: sb
14413 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
14414 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS, &
14415 INTENT(INOUT) :: rb
14416 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
14419 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d22v'
14422#if defined(__parallel)
14423 INTEGER :: ierr, msglen
14426 CALL mp_timeset(routinen, handle)
14428#if defined(__parallel)
14429 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_precision, &
14430 rb, rcount, rdispl, mpi_double_precision, comm%handle, ierr)
14431 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
14432 msglen = sum(scount) + sum(rcount)
14433 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*real_8_size)
14442 CALL mp_timestop(handle)
14444 END SUBROUTINE mp_alltoall_d22v
14461 SUBROUTINE mp_alltoall_d (sb, rb, count, comm)
14463 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
14464 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
14465 INTEGER,
INTENT(IN) :: count
14468 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d'
14471#if defined(__parallel)
14472 INTEGER :: ierr, msglen, np
14475 CALL mp_timeset(routinen, handle)
14477#if defined(__parallel)
14478 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14479 rb, count, mpi_double_precision, comm%handle, ierr)
14480 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14481 CALL mpi_comm_size(comm%handle, np, ierr)
14482 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14483 msglen = 2*count*np
14484 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14490 CALL mp_timestop(handle)
14492 END SUBROUTINE mp_alltoall_d
14502 SUBROUTINE mp_alltoall_d22(sb, rb, count, comm)
14504 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
14505 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
14506 INTEGER,
INTENT(IN) :: count
14509 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d22'
14512#if defined(__parallel)
14513 INTEGER :: ierr, msglen, np
14516 CALL mp_timeset(routinen, handle)
14518#if defined(__parallel)
14519 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14520 rb, count, mpi_double_precision, comm%handle, ierr)
14521 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14522 CALL mpi_comm_size(comm%handle, np, ierr)
14523 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14524 msglen = 2*
SIZE(sb)*np
14525 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14531 CALL mp_timestop(handle)
14533 END SUBROUTINE mp_alltoall_d22
14543 SUBROUTINE mp_alltoall_d33(sb, rb, count, comm)
14545 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
14546 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
14547 INTEGER,
INTENT(IN) :: count
14550 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d33'
14553#if defined(__parallel)
14554 INTEGER :: ierr, msglen, np
14557 CALL mp_timeset(routinen, handle)
14559#if defined(__parallel)
14560 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14561 rb, count, mpi_double_precision, comm%handle, ierr)
14562 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14563 CALL mpi_comm_size(comm%handle, np, ierr)
14564 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14565 msglen = 2*count*np
14566 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14572 CALL mp_timestop(handle)
14574 END SUBROUTINE mp_alltoall_d33
14584 SUBROUTINE mp_alltoall_d44(sb, rb, count, comm)
14586 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14588 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14590 INTEGER,
INTENT(IN) :: count
14593 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d44'
14596#if defined(__parallel)
14597 INTEGER :: ierr, msglen, np
14600 CALL mp_timeset(routinen, handle)
14602#if defined(__parallel)
14603 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14604 rb, count, mpi_double_precision, comm%handle, ierr)
14605 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14606 CALL mpi_comm_size(comm%handle, np, ierr)
14607 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14608 msglen = 2*count*np
14609 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14615 CALL mp_timestop(handle)
14617 END SUBROUTINE mp_alltoall_d44
14627 SUBROUTINE mp_alltoall_d55(sb, rb, count, comm)
14629 REAL(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
14631 REAL(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
14633 INTEGER,
INTENT(IN) :: count
14636 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d55'
14639#if defined(__parallel)
14640 INTEGER :: ierr, msglen, np
14643 CALL mp_timeset(routinen, handle)
14645#if defined(__parallel)
14646 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14647 rb, count, mpi_double_precision, comm%handle, ierr)
14648 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14649 CALL mpi_comm_size(comm%handle, np, ierr)
14650 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14651 msglen = 2*count*np
14652 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14658 CALL mp_timestop(handle)
14660 END SUBROUTINE mp_alltoall_d55
14671 SUBROUTINE mp_alltoall_d45(sb, rb, count, comm)
14673 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14675 REAL(kind=real_8), &
14676 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
14677 INTEGER,
INTENT(IN) :: count
14680 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d45'
14683#if defined(__parallel)
14684 INTEGER :: ierr, msglen, np
14687 CALL mp_timeset(routinen, handle)
14689#if defined(__parallel)
14690 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14691 rb, count, mpi_double_precision, comm%handle, ierr)
14692 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14693 CALL mpi_comm_size(comm%handle, np, ierr)
14694 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14695 msglen = 2*count*np
14696 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14700 rb = reshape(sb, shape(rb))
14702 CALL mp_timestop(handle)
14704 END SUBROUTINE mp_alltoall_d45
14715 SUBROUTINE mp_alltoall_d34(sb, rb, count, comm)
14717 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
14719 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14721 INTEGER,
INTENT(IN) :: count
14724 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d34'
14727#if defined(__parallel)
14728 INTEGER :: ierr, msglen, np
14731 CALL mp_timeset(routinen, handle)
14733#if defined(__parallel)
14734 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14735 rb, count, mpi_double_precision, comm%handle, ierr)
14736 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14737 CALL mpi_comm_size(comm%handle, np, ierr)
14738 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14739 msglen = 2*count*np
14740 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14744 rb = reshape(sb, shape(rb))
14746 CALL mp_timestop(handle)
14748 END SUBROUTINE mp_alltoall_d34
14759 SUBROUTINE mp_alltoall_d54(sb, rb, count, comm)
14761 REAL(kind=real_8), &
14762 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
14763 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14765 INTEGER,
INTENT(IN) :: count
14768 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d54'
14771#if defined(__parallel)
14772 INTEGER :: ierr, msglen, np
14775 CALL mp_timeset(routinen, handle)
14777#if defined(__parallel)
14778 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14779 rb, count, mpi_double_precision, comm%handle, ierr)
14780 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14781 CALL mpi_comm_size(comm%handle, np, ierr)
14782 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14783 msglen = 2*count*np
14784 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14788 rb = reshape(sb, shape(rb))
14790 CALL mp_timestop(handle)
14792 END SUBROUTINE mp_alltoall_d54
14803 SUBROUTINE mp_send_d (msg, dest, tag, comm)
14804 REAL(kind=real_8),
INTENT(IN) :: msg
14805 INTEGER,
INTENT(IN) :: dest, tag
14808 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_d'
14811#if defined(__parallel)
14812 INTEGER :: ierr, msglen
14815 CALL mp_timeset(routinen, handle)
14817#if defined(__parallel)
14819 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
14820 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
14821 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
14828 cpabort(
"not in parallel mode")
14830 CALL mp_timestop(handle)
14831 END SUBROUTINE mp_send_d
14841 SUBROUTINE mp_send_dv(msg, dest, tag, comm)
14842 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
14843 INTEGER,
INTENT(IN) :: dest, tag
14846 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_dv'
14849#if defined(__parallel)
14850 INTEGER :: ierr, msglen
14853 CALL mp_timeset(routinen, handle)
14855#if defined(__parallel)
14857 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
14858 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
14859 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
14866 cpabort(
"not in parallel mode")
14868 CALL mp_timestop(handle)
14869 END SUBROUTINE mp_send_dv
14879 SUBROUTINE mp_send_dm2(msg, dest, tag, comm)
14880 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
14881 INTEGER,
INTENT(IN) :: dest, tag
14884 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_dm2'
14887#if defined(__parallel)
14888 INTEGER :: ierr, msglen
14891 CALL mp_timeset(routinen, handle)
14893#if defined(__parallel)
14895 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
14896 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
14897 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
14904 cpabort(
"not in parallel mode")
14906 CALL mp_timestop(handle)
14907 END SUBROUTINE mp_send_dm2
14917 SUBROUTINE mp_send_dm3(msg, dest, tag, comm)
14918 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
14919 INTEGER,
INTENT(IN) :: dest, tag
14922 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
14925#if defined(__parallel)
14926 INTEGER :: ierr, msglen
14929 CALL mp_timeset(routinen, handle)
14931#if defined(__parallel)
14933 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
14934 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
14935 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
14942 cpabort(
"not in parallel mode")
14944 CALL mp_timestop(handle)
14945 END SUBROUTINE mp_send_dm3
14956 SUBROUTINE mp_recv_d (msg, source, tag, comm)
14957 REAL(kind=real_8),
INTENT(INOUT) :: msg
14958 INTEGER,
INTENT(INOUT) :: source, tag
14961 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_d'
14964#if defined(__parallel)
14965 INTEGER :: ierr, msglen
14966 mpi_status_type :: status
14969 CALL mp_timeset(routinen, handle)
14971#if defined(__parallel)
14974 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
14975 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
14977 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
14978 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
14979 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
14980 source = status mpi_status_extract(mpi_source)
14981 tag = status mpi_status_extract(mpi_tag)
14989 cpabort(
"not in parallel mode")
14991 CALL mp_timestop(handle)
14992 END SUBROUTINE mp_recv_d
15002 SUBROUTINE mp_recv_dv(msg, source, tag, comm)
15003 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15004 INTEGER,
INTENT(INOUT) :: source, tag
15007 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dv'
15010#if defined(__parallel)
15011 INTEGER :: ierr, msglen
15012 mpi_status_type :: status
15015 CALL mp_timeset(routinen, handle)
15017#if defined(__parallel)
15020 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15021 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15023 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15024 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15025 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15026 source = status mpi_status_extract(mpi_source)
15027 tag = status mpi_status_extract(mpi_tag)
15035 cpabort(
"not in parallel mode")
15037 CALL mp_timestop(handle)
15038 END SUBROUTINE mp_recv_dv
15048 SUBROUTINE mp_recv_dm2(msg, source, tag, comm)
15049 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15050 INTEGER,
INTENT(INOUT) :: source, tag
15053 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dm2'
15056#if defined(__parallel)
15057 INTEGER :: ierr, msglen
15058 mpi_status_type :: status
15061 CALL mp_timeset(routinen, handle)
15063#if defined(__parallel)
15066 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15067 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15069 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15070 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15071 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15072 source = status mpi_status_extract(mpi_source)
15073 tag = status mpi_status_extract(mpi_tag)
15081 cpabort(
"not in parallel mode")
15083 CALL mp_timestop(handle)
15084 END SUBROUTINE mp_recv_dm2
15094 SUBROUTINE mp_recv_dm3(msg, source, tag, comm)
15095 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
15096 INTEGER,
INTENT(INOUT) :: source, tag
15099 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dm3'
15102#if defined(__parallel)
15103 INTEGER :: ierr, msglen
15104 mpi_status_type :: status
15107 CALL mp_timeset(routinen, handle)
15109#if defined(__parallel)
15112 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15113 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15115 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15116 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15117 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15118 source = status mpi_status_extract(mpi_source)
15119 tag = status mpi_status_extract(mpi_tag)
15127 cpabort(
"not in parallel mode")
15129 CALL mp_timestop(handle)
15130 END SUBROUTINE mp_recv_dm3
15140 SUBROUTINE mp_bcast_d (msg, source, comm)
15141 REAL(kind=real_8),
INTENT(INOUT) :: msg
15142 INTEGER,
INTENT(IN) :: source
15145 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d'
15148#if defined(__parallel)
15149 INTEGER :: ierr, msglen
15152 CALL mp_timeset(routinen, handle)
15154#if defined(__parallel)
15156 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15157 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15158 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15164 CALL mp_timestop(handle)
15165 END SUBROUTINE mp_bcast_d
15174 SUBROUTINE mp_bcast_d_src(msg, comm)
15175 REAL(kind=real_8),
INTENT(INOUT) :: msg
15178 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d_src'
15181#if defined(__parallel)
15182 INTEGER :: ierr, msglen
15185 CALL mp_timeset(routinen, handle)
15187#if defined(__parallel)
15189 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15190 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15191 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15196 CALL mp_timestop(handle)
15197 END SUBROUTINE mp_bcast_d_src
15207 SUBROUTINE mp_ibcast_d (msg, source, comm, request)
15208 REAL(kind=real_8),
INTENT(INOUT) :: msg
15209 INTEGER,
INTENT(IN) :: source
15213 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_d'
15216#if defined(__parallel)
15217 INTEGER :: ierr, msglen
15220 CALL mp_timeset(routinen, handle)
15222#if defined(__parallel)
15224 CALL mpi_ibcast(msg, msglen, mpi_double_precision, source, comm%handle, request%handle, ierr)
15225 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
15226 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_8_size)
15233 CALL mp_timestop(handle)
15234 END SUBROUTINE mp_ibcast_d
15243 SUBROUTINE mp_bcast_dv(msg, source, comm)
15244 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15245 INTEGER,
INTENT(IN) :: source
15248 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dv'
15251#if defined(__parallel)
15252 INTEGER :: ierr, msglen
15255 CALL mp_timeset(routinen, handle)
15257#if defined(__parallel)
15259 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15260 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15261 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15267 CALL mp_timestop(handle)
15268 END SUBROUTINE mp_bcast_dv
15276 SUBROUTINE mp_bcast_dv_src(msg, comm)
15277 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15280 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dv_src'
15283#if defined(__parallel)
15284 INTEGER :: ierr, msglen
15287 CALL mp_timeset(routinen, handle)
15289#if defined(__parallel)
15291 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15292 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15293 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15298 CALL mp_timestop(handle)
15299 END SUBROUTINE mp_bcast_dv_src
15308 SUBROUTINE mp_ibcast_dv(msg, source, comm, request)
15309 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
15310 INTEGER,
INTENT(IN) :: source
15314 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_dv'
15317#if defined(__parallel)
15318 INTEGER :: ierr, msglen
15321 CALL mp_timeset(routinen, handle)
15323#if defined(__parallel)
15324#if !defined(__GNUC__) || __GNUC__ >= 9
15325 cpassert(is_contiguous(msg))
15328 CALL mpi_ibcast(msg, msglen, mpi_double_precision, source, comm%handle, request%handle, ierr)
15329 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
15330 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_8_size)
15337 CALL mp_timestop(handle)
15338 END SUBROUTINE mp_ibcast_dv
15347 SUBROUTINE mp_bcast_dm(msg, source, comm)
15348 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15349 INTEGER,
INTENT(IN) :: source
15352 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dm'
15355#if defined(__parallel)
15356 INTEGER :: ierr, msglen
15359 CALL mp_timeset(routinen, handle)
15361#if defined(__parallel)
15363 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15364 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15365 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15371 CALL mp_timestop(handle)
15372 END SUBROUTINE mp_bcast_dm
15381 SUBROUTINE mp_bcast_dm_src(msg, comm)
15382 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15385 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dm_src'
15388#if defined(__parallel)
15389 INTEGER :: ierr, msglen
15392 CALL mp_timeset(routinen, handle)
15394#if defined(__parallel)
15396 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15397 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15398 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15403 CALL mp_timestop(handle)
15404 END SUBROUTINE mp_bcast_dm_src
15413 SUBROUTINE mp_bcast_d3(msg, source, comm)
15414 REAL(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
15415 INTEGER,
INTENT(IN) :: source
15418 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d3'
15421#if defined(__parallel)
15422 INTEGER :: ierr, msglen
15425 CALL mp_timeset(routinen, handle)
15427#if defined(__parallel)
15429 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15430 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15431 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15437 CALL mp_timestop(handle)
15438 END SUBROUTINE mp_bcast_d3
15447 SUBROUTINE mp_bcast_d3_src(msg, comm)
15448 REAL(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
15451 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d3_src'
15454#if defined(__parallel)
15455 INTEGER :: ierr, msglen
15458 CALL mp_timeset(routinen, handle)
15460#if defined(__parallel)
15462 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15463 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15464 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15469 CALL mp_timestop(handle)
15470 END SUBROUTINE mp_bcast_d3_src
15479 SUBROUTINE mp_sum_d (msg, comm)
15480 REAL(kind=real_8),
INTENT(INOUT) :: msg
15483 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_d'
15486#if defined(__parallel)
15487 INTEGER :: ierr, msglen
15490 CALL mp_timeset(routinen, handle)
15492#if defined(__parallel)
15494 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15495 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15496 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15501 CALL mp_timestop(handle)
15502 END SUBROUTINE mp_sum_d
15510 SUBROUTINE mp_sum_dv(msg, comm)
15511 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15514 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dv'
15517#if defined(__parallel)
15518 INTEGER :: ierr, msglen
15521 CALL mp_timeset(routinen, handle)
15523#if defined(__parallel)
15525 IF (msglen > 0)
THEN
15526 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15527 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15529 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15534 CALL mp_timestop(handle)
15535 END SUBROUTINE mp_sum_dv
15543 SUBROUTINE mp_isum_dv(msg, comm, request)
15544 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
15548 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_dv'
15551#if defined(__parallel)
15552 INTEGER :: ierr, msglen
15555 CALL mp_timeset(routinen, handle)
15557#if defined(__parallel)
15558#if !defined(__GNUC__) || __GNUC__ >= 9
15559 cpassert(is_contiguous(msg))
15562 IF (msglen > 0)
THEN
15563 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, request%handle, ierr)
15564 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
15568 CALL add_perf(perf_id=23, count=1, msg_size=msglen*real_8_size)
15574 CALL mp_timestop(handle)
15575 END SUBROUTINE mp_isum_dv
15583 SUBROUTINE mp_sum_dm(msg, comm)
15584 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15587 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm'
15590#if defined(__parallel)
15591 INTEGER,
PARAMETER :: max_msg = 2**25
15592 INTEGER :: ierr, m1, msglen, step, msglensum
15595 CALL mp_timeset(routinen, handle)
15597#if defined(__parallel)
15599 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
15601 DO m1 = lbound(msg, 2), ubound(msg, 2), step
15602 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
15603 msglensum = msglensum + msglen
15604 IF (msglen > 0)
THEN
15605 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15606 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15609 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_8_size)
15614 CALL mp_timestop(handle)
15615 END SUBROUTINE mp_sum_dm
15623 SUBROUTINE mp_sum_dm3(msg, comm)
15624 REAL(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
15627 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm3'
15630#if defined(__parallel)
15631 INTEGER :: ierr, msglen
15634 CALL mp_timeset(routinen, handle)
15636#if defined(__parallel)
15638 IF (msglen > 0)
THEN
15639 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15640 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15642 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15647 CALL mp_timestop(handle)
15648 END SUBROUTINE mp_sum_dm3
15656 SUBROUTINE mp_sum_dm4(msg, comm)
15657 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
15660 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm4'
15663#if defined(__parallel)
15664 INTEGER :: ierr, msglen
15667 CALL mp_timeset(routinen, handle)
15669#if defined(__parallel)
15671 IF (msglen > 0)
THEN
15672 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15673 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15675 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15680 CALL mp_timestop(handle)
15681 END SUBROUTINE mp_sum_dm4
15693 SUBROUTINE mp_sum_root_dv(msg, root, comm)
15694 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15695 INTEGER,
INTENT(IN) :: root
15698 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_dv'
15701#if defined(__parallel)
15702 INTEGER :: ierr, m1, msglen, taskid
15703 REAL(kind=real_8),
ALLOCATABLE :: res(:)
15706 CALL mp_timeset(routinen, handle)
15708#if defined(__parallel)
15710 CALL mpi_comm_rank(comm%handle, taskid, ierr)
15711 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
15712 IF (msglen > 0)
THEN
15715 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_sum, &
15716 root, comm%handle, ierr)
15717 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
15718 IF (taskid == root)
THEN
15723 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15729 CALL mp_timestop(handle)
15730 END SUBROUTINE mp_sum_root_dv
15741 SUBROUTINE mp_sum_root_dm(msg, root, comm)
15742 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15743 INTEGER,
INTENT(IN) :: root
15746 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
15749#if defined(__parallel)
15750 INTEGER :: ierr, m1, m2, msglen, taskid
15751 REAL(kind=real_8),
ALLOCATABLE :: res(:, :)
15754 CALL mp_timeset(routinen, handle)
15756#if defined(__parallel)
15758 CALL mpi_comm_rank(comm%handle, taskid, ierr)
15759 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
15760 IF (msglen > 0)
THEN
15763 ALLOCATE (res(m1, m2))
15764 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_sum, root, comm%handle, ierr)
15765 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
15766 IF (taskid == root)
THEN
15771 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15777 CALL mp_timestop(handle)
15778 END SUBROUTINE mp_sum_root_dm
15786 SUBROUTINE mp_sum_partial_dm(msg, res, comm)
15787 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
15788 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
15791 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_dm'
15794#if defined(__parallel)
15795 INTEGER :: ierr, msglen, taskid
15798 CALL mp_timeset(routinen, handle)
15800#if defined(__parallel)
15802 CALL mpi_comm_rank(comm%handle, taskid, ierr)
15803 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
15804 IF (msglen > 0)
THEN
15805 CALL mpi_scan(msg, res, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15806 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
15808 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15814 CALL mp_timestop(handle)
15815 END SUBROUTINE mp_sum_partial_dm
15825 SUBROUTINE mp_max_d (msg, comm)
15826 REAL(kind=real_8),
INTENT(INOUT) :: msg
15829 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_d'
15832#if defined(__parallel)
15833 INTEGER :: ierr, msglen
15836 CALL mp_timeset(routinen, handle)
15838#if defined(__parallel)
15840 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_max, comm%handle, ierr)
15841 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15842 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15847 CALL mp_timestop(handle)
15848 END SUBROUTINE mp_max_d
15858 SUBROUTINE mp_max_root_d (msg, root, comm)
15859 REAL(kind=real_8),
INTENT(INOUT) :: msg
15860 INTEGER,
INTENT(IN) :: root
15863 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_d'
15866#if defined(__parallel)
15867 INTEGER :: ierr, msglen
15868 REAL(kind=real_8) :: res
15871 CALL mp_timeset(routinen, handle)
15873#if defined(__parallel)
15875 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_max, root, comm%handle, ierr)
15876 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
15877 IF (root == comm%mepos) msg = res
15878 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15884 CALL mp_timestop(handle)
15885 END SUBROUTINE mp_max_root_d
15895 SUBROUTINE mp_max_dv(msg, comm)
15896 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15899 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_dv'
15902#if defined(__parallel)
15903 INTEGER :: ierr, msglen
15906 CALL mp_timeset(routinen, handle)
15908#if defined(__parallel)
15910 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_max, comm%handle, ierr)
15911 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15912 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15917 CALL mp_timestop(handle)
15918 END SUBROUTINE mp_max_dv
15928 SUBROUTINE mp_max_root_dm(msg, root, comm)
15929 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15933 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_dm'
15936#if defined(__parallel)
15937 INTEGER :: ierr, msglen
15938 REAL(kind=real_8) :: res(
SIZE(msg, 1),
SIZE(msg, 2))
15941 CALL mp_timeset(routinen, handle)
15943#if defined(__parallel)
15945 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_max, root, comm%handle, ierr)
15946 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15947 IF (root == comm%mepos) msg = res
15948 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15954 CALL mp_timestop(handle)
15955 END SUBROUTINE mp_max_root_dm
15965 SUBROUTINE mp_min_d (msg, comm)
15966 REAL(kind=real_8),
INTENT(INOUT) :: msg
15969 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_d'
15972#if defined(__parallel)
15973 INTEGER :: ierr, msglen
15976 CALL mp_timeset(routinen, handle)
15978#if defined(__parallel)
15980 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_min, comm%handle, ierr)
15981 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15982 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15987 CALL mp_timestop(handle)
15988 END SUBROUTINE mp_min_d
16000 SUBROUTINE mp_min_dv(msg, comm)
16001 REAL(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
16004 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_dv'
16007#if defined(__parallel)
16008 INTEGER :: ierr, msglen
16011 CALL mp_timeset(routinen, handle)
16013#if defined(__parallel)
16015 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_min, comm%handle, ierr)
16016 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16017 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16022 CALL mp_timestop(handle)
16023 END SUBROUTINE mp_min_dv
16033 SUBROUTINE mp_prod_d (msg, comm)
16034 REAL(kind=real_8),
INTENT(INOUT) :: msg
16037 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_d'
16040#if defined(__parallel)
16041 INTEGER :: ierr, msglen
16044 CALL mp_timeset(routinen, handle)
16046#if defined(__parallel)
16048 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_prod, comm%handle, ierr)
16049 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16050 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16055 CALL mp_timestop(handle)
16056 END SUBROUTINE mp_prod_d
16067 SUBROUTINE mp_scatter_dv(msg_scatter, msg, root, comm)
16068 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
16069 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
16070 INTEGER,
INTENT(IN) :: root
16073 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_dv'
16076#if defined(__parallel)
16077 INTEGER :: ierr, msglen
16080 CALL mp_timeset(routinen, handle)
16082#if defined(__parallel)
16084 CALL mpi_scatter(msg_scatter, msglen, mpi_double_precision, msg, &
16085 msglen, mpi_double_precision, root, comm%handle, ierr)
16086 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
16087 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16093 CALL mp_timestop(handle)
16094 END SUBROUTINE mp_scatter_dv
16104 SUBROUTINE mp_iscatter_d (msg_scatter, msg, root, comm, request)
16105 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:)
16106 REAL(kind=real_8),
INTENT(INOUT) :: msg
16107 INTEGER,
INTENT(IN) :: root
16111 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_d'
16114#if defined(__parallel)
16115 INTEGER :: ierr, msglen
16118 CALL mp_timeset(routinen, handle)
16120#if defined(__parallel)
16121#if !defined(__GNUC__) || __GNUC__ >= 9
16122 cpassert(is_contiguous(msg_scatter))
16125 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_precision, msg, &
16126 msglen, mpi_double_precision, root, comm%handle, request%handle, ierr)
16127 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
16128 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16132 msg = msg_scatter(1)
16135 CALL mp_timestop(handle)
16136 END SUBROUTINE mp_iscatter_d
16146 SUBROUTINE mp_iscatter_dv2(msg_scatter, msg, root, comm, request)
16147 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:, :)
16148 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
16149 INTEGER,
INTENT(IN) :: root
16153 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_dv2'
16156#if defined(__parallel)
16157 INTEGER :: ierr, msglen
16160 CALL mp_timeset(routinen, handle)
16162#if defined(__parallel)
16163#if !defined(__GNUC__) || __GNUC__ >= 9
16164 cpassert(is_contiguous(msg_scatter))
16167 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_precision, msg, &
16168 msglen, mpi_double_precision, root, comm%handle, request%handle, ierr)
16169 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
16170 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16174 msg(:) = msg_scatter(:, 1)
16177 CALL mp_timestop(handle)
16178 END SUBROUTINE mp_iscatter_dv2
16188 SUBROUTINE mp_iscatterv_dv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
16189 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:)
16190 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
16191 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
16192 INTEGER,
INTENT(IN) :: recvcount, root
16196 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_dv'
16199#if defined(__parallel)
16203 CALL mp_timeset(routinen, handle)
16205#if defined(__parallel)
16206#if !defined(__GNUC__) || __GNUC__ >= 9
16207 cpassert(is_contiguous(msg_scatter))
16208 cpassert(is_contiguous(msg))
16209 cpassert(is_contiguous(sendcounts))
16210 cpassert(is_contiguous(displs))
16212 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_double_precision, msg, &
16213 recvcount, mpi_double_precision, root, comm%handle, request%handle, ierr)
16214 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
16215 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16217 mark_used(sendcounts)
16219 mark_used(recvcount)
16222 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
16225 CALL mp_timestop(handle)
16226 END SUBROUTINE mp_iscatterv_dv
16237 SUBROUTINE mp_gather_d (msg, msg_gather, root, comm)
16238 REAL(kind=real_8),
INTENT(IN) :: msg
16239 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16240 INTEGER,
INTENT(IN) :: root
16243 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_d'
16246#if defined(__parallel)
16247 INTEGER :: ierr, msglen
16250 CALL mp_timeset(routinen, handle)
16252#if defined(__parallel)
16254 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16255 msglen, mpi_double_precision, root, comm%handle, ierr)
16256 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16257 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16261 msg_gather(1) = msg
16263 CALL mp_timestop(handle)
16264 END SUBROUTINE mp_gather_d
16274 SUBROUTINE mp_gather_d_src(msg, msg_gather, comm)
16275 REAL(kind=real_8),
INTENT(IN) :: msg
16276 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16279 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_d_src'
16282#if defined(__parallel)
16283 INTEGER :: ierr, msglen
16286 CALL mp_timeset(routinen, handle)
16288#if defined(__parallel)
16290 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16291 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16292 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16293 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16296 msg_gather(1) = msg
16298 CALL mp_timestop(handle)
16299 END SUBROUTINE mp_gather_d_src
16313 SUBROUTINE mp_gather_dv(msg, msg_gather, root, comm)
16314 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
16315 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16316 INTEGER,
INTENT(IN) :: root
16319 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dv'
16322#if defined(__parallel)
16323 INTEGER :: ierr, msglen
16326 CALL mp_timeset(routinen, handle)
16328#if defined(__parallel)
16330 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16331 msglen, mpi_double_precision, root, comm%handle, ierr)
16332 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16333 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16339 CALL mp_timestop(handle)
16340 END SUBROUTINE mp_gather_dv
16353 SUBROUTINE mp_gather_dv_src(msg, msg_gather, comm)
16354 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
16355 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16358 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dv_src'
16361#if defined(__parallel)
16362 INTEGER :: ierr, msglen
16365 CALL mp_timeset(routinen, handle)
16367#if defined(__parallel)
16369 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16370 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16371 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16372 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16377 CALL mp_timestop(handle)
16378 END SUBROUTINE mp_gather_dv_src
16392 SUBROUTINE mp_gather_dm(msg, msg_gather, root, comm)
16393 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
16394 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
16395 INTEGER,
INTENT(IN) :: root
16398 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dm'
16401#if defined(__parallel)
16402 INTEGER :: ierr, msglen
16405 CALL mp_timeset(routinen, handle)
16407#if defined(__parallel)
16409 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16410 msglen, mpi_double_precision, root, comm%handle, ierr)
16411 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16412 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16418 CALL mp_timestop(handle)
16419 END SUBROUTINE mp_gather_dm
16432 SUBROUTINE mp_gather_dm_src(msg, msg_gather, comm)
16433 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
16434 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
16437 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dm_src'
16440#if defined(__parallel)
16441 INTEGER :: ierr, msglen
16444 CALL mp_timeset(routinen, handle)
16446#if defined(__parallel)
16448 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16449 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16450 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16451 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16456 CALL mp_timestop(handle)
16457 END SUBROUTINE mp_gather_dm_src
16474 SUBROUTINE mp_gatherv_dv(sendbuf, recvbuf, recvcounts, displs, root, comm)
16476 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16477 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16478 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16479 INTEGER,
INTENT(IN) :: root
16482 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dv'
16485#if defined(__parallel)
16486 INTEGER :: ierr, sendcount
16489 CALL mp_timeset(routinen, handle)
16491#if defined(__parallel)
16492 sendcount =
SIZE(sendbuf)
16493 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16494 recvbuf, recvcounts, displs, mpi_double_precision, &
16495 root, comm%handle, ierr)
16496 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16497 CALL add_perf(perf_id=4, &
16499 msg_size=sendcount*real_8_size)
16501 mark_used(recvcounts)
16504 recvbuf(1 + displs(1):) = sendbuf
16506 CALL mp_timestop(handle)
16507 END SUBROUTINE mp_gatherv_dv
16523 SUBROUTINE mp_gatherv_dv_src(sendbuf, recvbuf, recvcounts, displs, comm)
16525 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16526 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16527 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16530 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dv_src'
16533#if defined(__parallel)
16534 INTEGER :: ierr, sendcount
16537 CALL mp_timeset(routinen, handle)
16539#if defined(__parallel)
16540 sendcount =
SIZE(sendbuf)
16541 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16542 recvbuf, recvcounts, displs, mpi_double_precision, &
16543 comm%source, comm%handle, ierr)
16544 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16545 CALL add_perf(perf_id=4, &
16547 msg_size=sendcount*real_8_size)
16549 mark_used(recvcounts)
16551 recvbuf(1 + displs(1):) = sendbuf
16553 CALL mp_timestop(handle)
16554 END SUBROUTINE mp_gatherv_dv_src
16571 SUBROUTINE mp_gatherv_dm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
16573 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16574 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16575 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16576 INTEGER,
INTENT(IN) :: root
16579 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dm2'
16582#if defined(__parallel)
16583 INTEGER :: ierr, sendcount
16586 CALL mp_timeset(routinen, handle)
16588#if defined(__parallel)
16589 sendcount =
SIZE(sendbuf)
16590 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16591 recvbuf, recvcounts, displs, mpi_double_precision, &
16592 root, comm%handle, ierr)
16593 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16594 CALL add_perf(perf_id=4, &
16596 msg_size=sendcount*real_8_size)
16598 mark_used(recvcounts)
16601 recvbuf(:, 1 + displs(1):) = sendbuf
16603 CALL mp_timestop(handle)
16604 END SUBROUTINE mp_gatherv_dm2
16620 SUBROUTINE mp_gatherv_dm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
16622 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16623 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16624 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16627 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dm2_src'
16630#if defined(__parallel)
16631 INTEGER :: ierr, sendcount
16634 CALL mp_timeset(routinen, handle)
16636#if defined(__parallel)
16637 sendcount =
SIZE(sendbuf)
16638 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16639 recvbuf, recvcounts, displs, mpi_double_precision, &
16640 comm%source, comm%handle, ierr)
16641 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16642 CALL add_perf(perf_id=4, &
16644 msg_size=sendcount*real_8_size)
16646 mark_used(recvcounts)
16648 recvbuf(:, 1 + displs(1):) = sendbuf
16650 CALL mp_timestop(handle)
16651 END SUBROUTINE mp_gatherv_dm2_src
16668 SUBROUTINE mp_igatherv_dv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
16669 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
16670 REAL(kind=real_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
16671 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16672 INTEGER,
INTENT(IN) :: sendcount, root
16676 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_dv'
16679#if defined(__parallel)
16683 CALL mp_timeset(routinen, handle)
16685#if defined(__parallel)
16686#if !defined(__GNUC__) || __GNUC__ >= 9
16687 cpassert(is_contiguous(sendbuf))
16688 cpassert(is_contiguous(recvbuf))
16689 cpassert(is_contiguous(recvcounts))
16690 cpassert(is_contiguous(displs))
16692 CALL mpi_igatherv(sendbuf, sendcount, mpi_double_precision, &
16693 recvbuf, recvcounts, displs, mpi_double_precision, &
16694 root, comm%handle, request%handle, ierr)
16695 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16696 CALL add_perf(perf_id=24, &
16698 msg_size=sendcount*real_8_size)
16700 mark_used(sendcount)
16701 mark_used(recvcounts)
16704 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
16707 CALL mp_timestop(handle)
16708 END SUBROUTINE mp_igatherv_dv
16721 SUBROUTINE mp_allgather_d (msgout, msgin, comm)
16722 REAL(kind=real_8),
INTENT(IN) :: msgout
16723 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
16726 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d'
16729#if defined(__parallel)
16730 INTEGER :: ierr, rcount, scount
16733 CALL mp_timeset(routinen, handle)
16735#if defined(__parallel)
16738 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
16739 msgin, rcount, mpi_double_precision, &
16741 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16746 CALL mp_timestop(handle)
16747 END SUBROUTINE mp_allgather_d
16760 SUBROUTINE mp_allgather_d2(msgout, msgin, comm)
16761 REAL(kind=real_8),
INTENT(IN) :: msgout
16762 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
16765 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d2'
16768#if defined(__parallel)
16769 INTEGER :: ierr, rcount, scount
16772 CALL mp_timeset(routinen, handle)
16774#if defined(__parallel)
16777 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
16778 msgin, rcount, mpi_double_precision, &
16780 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16785 CALL mp_timestop(handle)
16786 END SUBROUTINE mp_allgather_d2
16799 SUBROUTINE mp_iallgather_d (msgout, msgin, comm, request)
16800 REAL(kind=real_8),
INTENT(IN) :: msgout
16801 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
16805 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d'
16808#if defined(__parallel)
16809 INTEGER :: ierr, rcount, scount
16812 CALL mp_timeset(routinen, handle)
16814#if defined(__parallel)
16815#if !defined(__GNUC__) || __GNUC__ >= 9
16816 cpassert(is_contiguous(msgin))
16820 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
16821 msgin, rcount, mpi_double_precision, &
16822 comm%handle, request%handle, ierr)
16823 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16829 CALL mp_timestop(handle)
16830 END SUBROUTINE mp_iallgather_d
16845 SUBROUTINE mp_allgather_d12(msgout, msgin, comm)
16846 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
16847 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
16850 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d12'
16853#if defined(__parallel)
16854 INTEGER :: ierr, rcount, scount
16857 CALL mp_timeset(routinen, handle)
16859#if defined(__parallel)
16860 scount =
SIZE(msgout(:))
16862 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
16863 msgin, rcount, mpi_double_precision, &
16865 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16868 msgin(:, 1) = msgout(:)
16870 CALL mp_timestop(handle)
16871 END SUBROUTINE mp_allgather_d12
16881 SUBROUTINE mp_allgather_d23(msgout, msgin, comm)
16882 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
16883 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
16886 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d23'
16889#if defined(__parallel)
16890 INTEGER :: ierr, rcount, scount
16893 CALL mp_timeset(routinen, handle)
16895#if defined(__parallel)
16896 scount =
SIZE(msgout(:, :))
16898 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
16899 msgin, rcount, mpi_double_precision, &
16901 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16904 msgin(:, :, 1) = msgout(:, :)
16906 CALL mp_timestop(handle)
16907 END SUBROUTINE mp_allgather_d23
16917 SUBROUTINE mp_allgather_d34(msgout, msgin, comm)
16918 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
16919 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
16922 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d34'
16925#if defined(__parallel)
16926 INTEGER :: ierr, rcount, scount
16929 CALL mp_timeset(routinen, handle)
16931#if defined(__parallel)
16932 scount =
SIZE(msgout(:, :, :))
16934 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
16935 msgin, rcount, mpi_double_precision, &
16937 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16940 msgin(:, :, :, 1) = msgout(:, :, :)
16942 CALL mp_timestop(handle)
16943 END SUBROUTINE mp_allgather_d34
16953 SUBROUTINE mp_allgather_d22(msgout, msgin, comm)
16954 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
16955 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
16958 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d22'
16961#if defined(__parallel)
16962 INTEGER :: ierr, rcount, scount
16965 CALL mp_timeset(routinen, handle)
16967#if defined(__parallel)
16968 scount =
SIZE(msgout(:, :))
16970 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
16971 msgin, rcount, mpi_double_precision, &
16973 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16976 msgin(:, :) = msgout(:, :)
16978 CALL mp_timestop(handle)
16979 END SUBROUTINE mp_allgather_d22
16990 SUBROUTINE mp_iallgather_d11(msgout, msgin, comm, request)
16991 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
16992 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
16996 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d11'
16999#if defined(__parallel)
17000 INTEGER :: ierr, rcount, scount
17003 CALL mp_timeset(routinen, handle)
17005#if defined(__parallel)
17006#if !defined(__GNUC__) || __GNUC__ >= 9
17007 cpassert(is_contiguous(msgout))
17008 cpassert(is_contiguous(msgin))
17010 scount =
SIZE(msgout(:))
17012 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17013 msgin, rcount, mpi_double_precision, &
17014 comm%handle, request%handle, ierr)
17015 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17021 CALL mp_timestop(handle)
17022 END SUBROUTINE mp_iallgather_d11
17033 SUBROUTINE mp_iallgather_d13(msgout, msgin, comm, request)
17034 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17035 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
17039 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d13'
17042#if defined(__parallel)
17043 INTEGER :: ierr, rcount, scount
17046 CALL mp_timeset(routinen, handle)
17048#if defined(__parallel)
17049#if !defined(__GNUC__) || __GNUC__ >= 9
17050 cpassert(is_contiguous(msgout))
17051 cpassert(is_contiguous(msgin))
17054 scount =
SIZE(msgout(:))
17056 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17057 msgin, rcount, mpi_double_precision, &
17058 comm%handle, request%handle, ierr)
17059 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17062 msgin(:, 1, 1) = msgout(:)
17065 CALL mp_timestop(handle)
17066 END SUBROUTINE mp_iallgather_d13
17077 SUBROUTINE mp_iallgather_d22(msgout, msgin, comm, request)
17078 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :)
17079 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :)
17083 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d22'
17086#if defined(__parallel)
17087 INTEGER :: ierr, rcount, scount
17090 CALL mp_timeset(routinen, handle)
17092#if defined(__parallel)
17093#if !defined(__GNUC__) || __GNUC__ >= 9
17094 cpassert(is_contiguous(msgout))
17095 cpassert(is_contiguous(msgin))
17098 scount =
SIZE(msgout(:, :))
17100 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17101 msgin, rcount, mpi_double_precision, &
17102 comm%handle, request%handle, ierr)
17103 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17106 msgin(:, :) = msgout(:, :)
17109 CALL mp_timestop(handle)
17110 END SUBROUTINE mp_iallgather_d22
17121 SUBROUTINE mp_iallgather_d24(msgout, msgin, comm, request)
17122 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :)
17123 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :, :)
17127 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d24'
17130#if defined(__parallel)
17131 INTEGER :: ierr, rcount, scount
17134 CALL mp_timeset(routinen, handle)
17136#if defined(__parallel)
17137#if !defined(__GNUC__) || __GNUC__ >= 9
17138 cpassert(is_contiguous(msgout))
17139 cpassert(is_contiguous(msgin))
17142 scount =
SIZE(msgout(:, :))
17144 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17145 msgin, rcount, mpi_double_precision, &
17146 comm%handle, request%handle, ierr)
17147 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17150 msgin(:, :, 1, 1) = msgout(:, :)
17153 CALL mp_timestop(handle)
17154 END SUBROUTINE mp_iallgather_d24
17165 SUBROUTINE mp_iallgather_d33(msgout, msgin, comm, request)
17166 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :, :)
17167 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
17171 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d33'
17174#if defined(__parallel)
17175 INTEGER :: ierr, rcount, scount
17178 CALL mp_timeset(routinen, handle)
17180#if defined(__parallel)
17181#if !defined(__GNUC__) || __GNUC__ >= 9
17182 cpassert(is_contiguous(msgout))
17183 cpassert(is_contiguous(msgin))
17186 scount =
SIZE(msgout(:, :, :))
17188 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17189 msgin, rcount, mpi_double_precision, &
17190 comm%handle, request%handle, ierr)
17191 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17194 msgin(:, :, :) = msgout(:, :, :)
17197 CALL mp_timestop(handle)
17198 END SUBROUTINE mp_iallgather_d33
17217 SUBROUTINE mp_allgatherv_dv(msgout, msgin, rcount, rdispl, comm)
17218 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
17219 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17220 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17223 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_dv'
17226#if defined(__parallel)
17227 INTEGER :: ierr, scount
17230 CALL mp_timeset(routinen, handle)
17232#if defined(__parallel)
17233 scount =
SIZE(msgout)
17234 CALL mpi_allgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17235 rdispl, mpi_double_precision, comm%handle, ierr)
17236 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
17243 CALL mp_timestop(handle)
17244 END SUBROUTINE mp_allgatherv_dv
17263 SUBROUTINE mp_allgatherv_dm2(msgout, msgin, rcount, rdispl, comm)
17264 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
17265 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
17266 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17269 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_dv'
17272#if defined(__parallel)
17273 INTEGER :: ierr, scount
17276 CALL mp_timeset(routinen, handle)
17278#if defined(__parallel)
17279 scount =
SIZE(msgout)
17280 CALL mpi_allgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17281 rdispl, mpi_double_precision, comm%handle, ierr)
17282 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
17289 CALL mp_timestop(handle)
17290 END SUBROUTINE mp_allgatherv_dm2
17309 SUBROUTINE mp_iallgatherv_dv(msgout, msgin, rcount, rdispl, comm, request)
17310 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17311 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17312 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17316 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_dv'
17319#if defined(__parallel)
17320 INTEGER :: ierr, scount, rsize
17323 CALL mp_timeset(routinen, handle)
17325#if defined(__parallel)
17326#if !defined(__GNUC__) || __GNUC__ >= 9
17327 cpassert(is_contiguous(msgout))
17328 cpassert(is_contiguous(msgin))
17329 cpassert(is_contiguous(rcount))
17330 cpassert(is_contiguous(rdispl))
17333 scount =
SIZE(msgout)
17334 rsize =
SIZE(rcount)
17335 CALL mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, &
17336 rdispl, comm, request, ierr)
17337 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
17345 CALL mp_timestop(handle)
17346 END SUBROUTINE mp_iallgatherv_dv
17365 SUBROUTINE mp_iallgatherv_dv2(msgout, msgin, rcount, rdispl, comm, request)
17366 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17367 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17368 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
17372 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_dv2'
17375#if defined(__parallel)
17376 INTEGER :: ierr, scount, rsize
17379 CALL mp_timeset(routinen, handle)
17381#if defined(__parallel)
17382#if !defined(__GNUC__) || __GNUC__ >= 9
17383 cpassert(is_contiguous(msgout))
17384 cpassert(is_contiguous(msgin))
17385 cpassert(is_contiguous(rcount))
17386 cpassert(is_contiguous(rdispl))
17389 scount =
SIZE(msgout)
17390 rsize =
SIZE(rcount)
17391 CALL mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, &
17392 rdispl, comm, request, ierr)
17393 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
17401 CALL mp_timestop(handle)
17402 END SUBROUTINE mp_iallgatherv_dv2
17413#if defined(__parallel)
17414 SUBROUTINE mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
17415 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
17416 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17417 INTEGER,
INTENT(IN) :: rsize
17418 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
17421 INTEGER,
INTENT(INOUT) :: ierr
17423 CALL mpi_iallgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17424 rdispl, mpi_double_precision, comm%handle, request%handle, ierr)
17426 END SUBROUTINE mp_iallgatherv_dv_internal
17437 SUBROUTINE mp_sum_scatter_dv(msgout, msgin, rcount, comm)
17438 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
17439 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17440 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
17443 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_dv'
17446#if defined(__parallel)
17450 CALL mp_timeset(routinen, handle)
17452#if defined(__parallel)
17453 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_double_precision, mpi_sum, &
17455 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
17457 CALL add_perf(perf_id=3, count=1, &
17458 msg_size=rcount(1)*2*real_8_size)
17462 msgin = msgout(:, 1)
17464 CALL mp_timestop(handle)
17465 END SUBROUTINE mp_sum_scatter_dv
17476 SUBROUTINE mp_sendrecv_d (msgin, dest, msgout, source, comm, tag)
17477 REAL(kind=real_8),
INTENT(IN) :: msgin
17478 INTEGER,
INTENT(IN) :: dest
17479 REAL(kind=real_8),
INTENT(OUT) :: msgout
17480 INTEGER,
INTENT(IN) :: source
17482 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17484 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_d'
17487#if defined(__parallel)
17488 INTEGER :: ierr, msglen_in, msglen_out, &
17492 CALL mp_timeset(routinen, handle)
17494#if defined(__parallel)
17499 IF (
PRESENT(tag))
THEN
17503 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17504 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17505 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17506 CALL add_perf(perf_id=7, count=1, &
17507 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17515 CALL mp_timestop(handle)
17516 END SUBROUTINE mp_sendrecv_d
17527 SUBROUTINE mp_sendrecv_dv(msgin, dest, msgout, source, comm, tag)
17528 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
17529 INTEGER,
INTENT(IN) :: dest
17530 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
17531 INTEGER,
INTENT(IN) :: source
17533 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17535 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dv'
17538#if defined(__parallel)
17539 INTEGER :: ierr, msglen_in, msglen_out, &
17543 CALL mp_timeset(routinen, handle)
17545#if defined(__parallel)
17546 msglen_in =
SIZE(msgin)
17547 msglen_out =
SIZE(msgout)
17550 IF (
PRESENT(tag))
THEN
17554 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17555 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17556 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17557 CALL add_perf(perf_id=7, count=1, &
17558 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17566 CALL mp_timestop(handle)
17567 END SUBROUTINE mp_sendrecv_dv
17579 SUBROUTINE mp_sendrecv_dm2(msgin, dest, msgout, source, comm, tag)
17580 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
17581 INTEGER,
INTENT(IN) :: dest
17582 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
17583 INTEGER,
INTENT(IN) :: source
17585 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17587 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm2'
17590#if defined(__parallel)
17591 INTEGER :: ierr, msglen_in, msglen_out, &
17595 CALL mp_timeset(routinen, handle)
17597#if defined(__parallel)
17598 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
17599 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
17602 IF (
PRESENT(tag))
THEN
17606 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17607 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17608 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17609 CALL add_perf(perf_id=7, count=1, &
17610 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17618 CALL mp_timestop(handle)
17619 END SUBROUTINE mp_sendrecv_dm2
17630 SUBROUTINE mp_sendrecv_dm3(msgin, dest, msgout, source, comm, tag)
17631 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
17632 INTEGER,
INTENT(IN) :: dest
17633 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
17634 INTEGER,
INTENT(IN) :: source
17636 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17638 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm3'
17641#if defined(__parallel)
17642 INTEGER :: ierr, msglen_in, msglen_out, &
17646 CALL mp_timeset(routinen, handle)
17648#if defined(__parallel)
17649 msglen_in =
SIZE(msgin)
17650 msglen_out =
SIZE(msgout)
17653 IF (
PRESENT(tag))
THEN
17657 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17658 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17659 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17660 CALL add_perf(perf_id=7, count=1, &
17661 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17669 CALL mp_timestop(handle)
17670 END SUBROUTINE mp_sendrecv_dm3
17681 SUBROUTINE mp_sendrecv_dm4(msgin, dest, msgout, source, comm, tag)
17682 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
17683 INTEGER,
INTENT(IN) :: dest
17684 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
17685 INTEGER,
INTENT(IN) :: source
17687 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17689 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm4'
17692#if defined(__parallel)
17693 INTEGER :: ierr, msglen_in, msglen_out, &
17697 CALL mp_timeset(routinen, handle)
17699#if defined(__parallel)
17700 msglen_in =
SIZE(msgin)
17701 msglen_out =
SIZE(msgout)
17704 IF (
PRESENT(tag))
THEN
17708 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17709 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17710 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17711 CALL add_perf(perf_id=7, count=1, &
17712 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17720 CALL mp_timestop(handle)
17721 END SUBROUTINE mp_sendrecv_dm4
17738 SUBROUTINE mp_isendrecv_d (msgin, dest, msgout, source, comm, send_request, &
17740 REAL(kind=real_8),
INTENT(IN) :: msgin
17741 INTEGER,
INTENT(IN) :: dest
17742 REAL(kind=real_8),
INTENT(INOUT) :: msgout
17743 INTEGER,
INTENT(IN) :: source
17746 INTEGER,
INTENT(in),
OPTIONAL :: tag
17748 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_d'
17751#if defined(__parallel)
17752 INTEGER :: ierr, my_tag
17755 CALL mp_timeset(routinen, handle)
17757#if defined(__parallel)
17759 IF (
PRESENT(tag)) my_tag = tag
17761 CALL mpi_irecv(msgout, 1, mpi_double_precision, source, my_tag, &
17762 comm%handle, recv_request%handle, ierr)
17763 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
17765 CALL mpi_isend(msgin, 1, mpi_double_precision, dest, my_tag, &
17766 comm%handle, send_request%handle, ierr)
17767 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
17769 CALL add_perf(perf_id=8, count=1, msg_size=2*real_8_size)
17779 CALL mp_timestop(handle)
17780 END SUBROUTINE mp_isendrecv_d
17799 SUBROUTINE mp_isendrecv_dv(msgin, dest, msgout, source, comm, send_request, &
17801 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
17802 INTEGER,
INTENT(IN) :: dest
17803 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
17804 INTEGER,
INTENT(IN) :: source
17807 INTEGER,
INTENT(in),
OPTIONAL :: tag
17809 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_dv'
17812#if defined(__parallel)
17813 INTEGER :: ierr, msglen, my_tag
17814 REAL(kind=real_8) :: foo
17817 CALL mp_timeset(routinen, handle)
17819#if defined(__parallel)
17820#if !defined(__GNUC__) || __GNUC__ >= 9
17821 cpassert(is_contiguous(msgout))
17822 cpassert(is_contiguous(msgin))
17826 IF (
PRESENT(tag)) my_tag = tag
17828 msglen =
SIZE(msgout, 1)
17829 IF (msglen > 0)
THEN
17830 CALL mpi_irecv(msgout(1), msglen, mpi_double_precision, source, my_tag, &
17831 comm%handle, recv_request%handle, ierr)
17833 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
17834 comm%handle, recv_request%handle, ierr)
17836 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
17838 msglen =
SIZE(msgin, 1)
17839 IF (msglen > 0)
THEN
17840 CALL mpi_isend(msgin(1), msglen, mpi_double_precision, dest, my_tag, &
17841 comm%handle, send_request%handle, ierr)
17843 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
17844 comm%handle, send_request%handle, ierr)
17846 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
17848 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
17849 CALL add_perf(perf_id=8, count=1, msg_size=msglen*real_8_size)
17859 CALL mp_timestop(handle)
17860 END SUBROUTINE mp_isendrecv_dv
17875 SUBROUTINE mp_isend_dv(msgin, dest, comm, request, tag)
17876 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
17877 INTEGER,
INTENT(IN) :: dest
17880 INTEGER,
INTENT(in),
OPTIONAL :: tag
17882 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dv'
17884 INTEGER :: handle, ierr
17885#if defined(__parallel)
17886 INTEGER :: msglen, my_tag
17887 REAL(kind=real_8) :: foo(1)
17890 CALL mp_timeset(routinen, handle)
17892#if defined(__parallel)
17893#if !defined(__GNUC__) || __GNUC__ >= 9
17894 cpassert(is_contiguous(msgin))
17897 IF (
PRESENT(tag)) my_tag = tag
17899 msglen =
SIZE(msgin)
17900 IF (msglen > 0)
THEN
17901 CALL mpi_isend(msgin(1), msglen, mpi_double_precision, dest, my_tag, &
17902 comm%handle, request%handle, ierr)
17904 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
17905 comm%handle, request%handle, ierr)
17907 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
17909 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
17918 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
17920 CALL mp_timestop(handle)
17921 END SUBROUTINE mp_isend_dv
17938 SUBROUTINE mp_isend_dm2(msgin, dest, comm, request, tag)
17939 REAL(kind=real_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
17940 INTEGER,
INTENT(IN) :: dest
17943 INTEGER,
INTENT(in),
OPTIONAL :: tag
17945 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm2'
17947 INTEGER :: handle, ierr
17948#if defined(__parallel)
17949 INTEGER :: msglen, my_tag
17950 REAL(kind=real_8) :: foo(1)
17953 CALL mp_timeset(routinen, handle)
17955#if defined(__parallel)
17956#if !defined(__GNUC__) || __GNUC__ >= 9
17957 cpassert(is_contiguous(msgin))
17961 IF (
PRESENT(tag)) my_tag = tag
17963 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
17964 IF (msglen > 0)
THEN
17965 CALL mpi_isend(msgin(1, 1), msglen, mpi_double_precision, dest, my_tag, &
17966 comm%handle, request%handle, ierr)
17968 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
17969 comm%handle, request%handle, ierr)
17971 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
17973 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
17982 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
17984 CALL mp_timestop(handle)
17985 END SUBROUTINE mp_isend_dm2
18004 SUBROUTINE mp_isend_dm3(msgin, dest, comm, request, tag)
18005 REAL(kind=real_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
18006 INTEGER,
INTENT(IN) :: dest
18009 INTEGER,
INTENT(in),
OPTIONAL :: tag
18011 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm3'
18013 INTEGER :: handle, ierr
18014#if defined(__parallel)
18015 INTEGER :: msglen, my_tag
18016 REAL(kind=real_8) :: foo(1)
18019 CALL mp_timeset(routinen, handle)
18021#if defined(__parallel)
18022#if !defined(__GNUC__) || __GNUC__ >= 9
18023 cpassert(is_contiguous(msgin))
18027 IF (
PRESENT(tag)) my_tag = tag
18029 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
18030 IF (msglen > 0)
THEN
18031 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_double_precision, dest, my_tag, &
18032 comm%handle, request%handle, ierr)
18034 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18035 comm%handle, request%handle, ierr)
18037 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18039 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18048 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18050 CALL mp_timestop(handle)
18051 END SUBROUTINE mp_isend_dm3
18067 SUBROUTINE mp_isend_dm4(msgin, dest, comm, request, tag)
18068 REAL(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
18069 INTEGER,
INTENT(IN) :: dest
18072 INTEGER,
INTENT(in),
OPTIONAL :: tag
18074 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm4'
18076 INTEGER :: handle, ierr
18077#if defined(__parallel)
18078 INTEGER :: msglen, my_tag
18079 REAL(kind=real_8) :: foo(1)
18082 CALL mp_timeset(routinen, handle)
18084#if defined(__parallel)
18085#if !defined(__GNUC__) || __GNUC__ >= 9
18086 cpassert(is_contiguous(msgin))
18090 IF (
PRESENT(tag)) my_tag = tag
18092 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
18093 IF (msglen > 0)
THEN
18094 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_double_precision, dest, my_tag, &
18095 comm%handle, request%handle, ierr)
18097 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18098 comm%handle, request%handle, ierr)
18100 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18102 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18111 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18113 CALL mp_timestop(handle)
18114 END SUBROUTINE mp_isend_dm4
18130 SUBROUTINE mp_irecv_dv(msgout, source, comm, request, tag)
18131 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
18132 INTEGER,
INTENT(IN) :: source
18135 INTEGER,
INTENT(in),
OPTIONAL :: tag
18137 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dv'
18140#if defined(__parallel)
18141 INTEGER :: ierr, msglen, my_tag
18142 REAL(kind=real_8) :: foo(1)
18145 CALL mp_timeset(routinen, handle)
18147#if defined(__parallel)
18148#if !defined(__GNUC__) || __GNUC__ >= 9
18149 cpassert(is_contiguous(msgout))
18153 IF (
PRESENT(tag)) my_tag = tag
18155 msglen =
SIZE(msgout)
18156 IF (msglen > 0)
THEN
18157 CALL mpi_irecv(msgout(1), msglen, mpi_double_precision, source, my_tag, &
18158 comm%handle, request%handle, ierr)
18160 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18161 comm%handle, request%handle, ierr)
18163 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18165 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18167 cpabort(
"mp_irecv called in non parallel case")
18174 CALL mp_timestop(handle)
18175 END SUBROUTINE mp_irecv_dv
18192 SUBROUTINE mp_irecv_dm2(msgout, source, comm, request, tag)
18193 REAL(kind=real_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
18194 INTEGER,
INTENT(IN) :: source
18197 INTEGER,
INTENT(in),
OPTIONAL :: tag
18199 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm2'
18202#if defined(__parallel)
18203 INTEGER :: ierr, msglen, my_tag
18204 REAL(kind=real_8) :: foo(1)
18207 CALL mp_timeset(routinen, handle)
18209#if defined(__parallel)
18210#if !defined(__GNUC__) || __GNUC__ >= 9
18211 cpassert(is_contiguous(msgout))
18215 IF (
PRESENT(tag)) my_tag = tag
18217 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
18218 IF (msglen > 0)
THEN
18219 CALL mpi_irecv(msgout(1, 1), msglen, mpi_double_precision, source, my_tag, &
18220 comm%handle, request%handle, ierr)
18222 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18223 comm%handle, request%handle, ierr)
18225 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18227 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18234 cpabort(
"mp_irecv called in non parallel case")
18236 CALL mp_timestop(handle)
18237 END SUBROUTINE mp_irecv_dm2
18255 SUBROUTINE mp_irecv_dm3(msgout, source, comm, request, tag)
18256 REAL(kind=real_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
18257 INTEGER,
INTENT(IN) :: source
18260 INTEGER,
INTENT(in),
OPTIONAL :: tag
18262 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm3'
18265#if defined(__parallel)
18266 INTEGER :: ierr, msglen, my_tag
18267 REAL(kind=real_8) :: foo(1)
18270 CALL mp_timeset(routinen, handle)
18272#if defined(__parallel)
18273#if !defined(__GNUC__) || __GNUC__ >= 9
18274 cpassert(is_contiguous(msgout))
18278 IF (
PRESENT(tag)) my_tag = tag
18280 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
18281 IF (msglen > 0)
THEN
18282 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_double_precision, source, my_tag, &
18283 comm%handle, request%handle, ierr)
18285 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18286 comm%handle, request%handle, ierr)
18288 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
18290 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18297 cpabort(
"mp_irecv called in non parallel case")
18299 CALL mp_timestop(handle)
18300 END SUBROUTINE mp_irecv_dm3
18316 SUBROUTINE mp_irecv_dm4(msgout, source, comm, request, tag)
18317 REAL(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
18318 INTEGER,
INTENT(IN) :: source
18321 INTEGER,
INTENT(in),
OPTIONAL :: tag
18323 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm4'
18326#if defined(__parallel)
18327 INTEGER :: ierr, msglen, my_tag
18328 REAL(kind=real_8) :: foo(1)
18331 CALL mp_timeset(routinen, handle)
18333#if defined(__parallel)
18334#if !defined(__GNUC__) || __GNUC__ >= 9
18335 cpassert(is_contiguous(msgout))
18339 IF (
PRESENT(tag)) my_tag = tag
18341 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
18342 IF (msglen > 0)
THEN
18343 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_double_precision, source, my_tag, &
18344 comm%handle, request%handle, ierr)
18346 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18347 comm%handle, request%handle, ierr)
18349 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
18351 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18358 cpabort(
"mp_irecv called in non parallel case")
18360 CALL mp_timestop(handle)
18361 END SUBROUTINE mp_irecv_dm4
18373 SUBROUTINE mp_win_create_dv(base, comm, win)
18374 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
18378 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_dv'
18381#if defined(__parallel)
18383 INTEGER(kind=mpi_address_kind) :: len
18384 REAL(kind=real_8) :: foo(1)
18387 CALL mp_timeset(routinen, handle)
18389#if defined(__parallel)
18391 len =
SIZE(base)*real_8_size
18393 CALL mpi_win_create(base(1), len, real_8_size, mpi_info_null, comm%handle, win%handle, ierr)
18395 CALL mpi_win_create(foo, len, real_8_size, mpi_info_null, comm%handle, win%handle, ierr)
18397 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
18399 CALL add_perf(perf_id=20, count=1)
18403 win%handle = mp_win_null_handle
18405 CALL mp_timestop(handle)
18406 END SUBROUTINE mp_win_create_dv
18418 SUBROUTINE mp_rget_dv(base, source, win, win_data, myproc, disp, request, &
18419 origin_datatype, target_datatype)
18420 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
18421 INTEGER,
INTENT(IN) :: source
18423 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: win_data
18424 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
18428 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_dv'
18431#if defined(__parallel)
18432 INTEGER :: ierr, len, &
18433 origin_len, target_len
18434 LOGICAL :: do_local_copy
18435 INTEGER(kind=mpi_address_kind) :: disp_aint
18436 mpi_data_type :: handle_origin_datatype, handle_target_datatype
18439 CALL mp_timeset(routinen, handle)
18441#if defined(__parallel)
18444 IF (
PRESENT(disp))
THEN
18445 disp_aint = int(disp, kind=mpi_address_kind)
18447 handle_origin_datatype = mpi_double_precision
18449 IF (
PRESENT(origin_datatype))
THEN
18450 handle_origin_datatype = origin_datatype%type_handle
18453 handle_target_datatype = mpi_double_precision
18455 IF (
PRESENT(target_datatype))
THEN
18456 handle_target_datatype = target_datatype%type_handle
18460 do_local_copy = .false.
18461 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
18462 IF (myproc .EQ. source) do_local_copy = .true.
18464 IF (do_local_copy)
THEN
18466 base(:) = win_data(disp_aint + 1:disp_aint + len)
18471 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
18472 target_len, handle_target_datatype, win%handle, request%handle, ierr)
18478 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
18480 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*real_8_size)
18485 mark_used(origin_datatype)
18486 mark_used(target_datatype)
18490 IF (
PRESENT(disp))
THEN
18491 base(:) = win_data(disp + 1:disp +
SIZE(base))
18493 base(:) = win_data(:
SIZE(base))
18497 CALL mp_timestop(handle)
18498 END SUBROUTINE mp_rget_dv
18508 result(type_descriptor)
18509 INTEGER,
INTENT(IN) :: count
18510 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
18513 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_d'
18516#if defined(__parallel)
18520 CALL mp_timeset(routinen, handle)
18522#if defined(__parallel)
18523 CALL mpi_type_indexed(count, lengths, displs, mpi_double_precision, &
18524 type_descriptor%type_handle, ierr)
18526 cpabort(
"MPI_Type_Indexed @ "//routinen)
18527 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
18529 cpabort(
"MPI_Type_commit @ "//routinen)
18531 type_descriptor%type_handle = 3
18533 type_descriptor%length = count
18534 NULLIFY (type_descriptor%subtype)
18535 type_descriptor%vector_descriptor(1:2) = 1
18536 type_descriptor%has_indexing = .true.
18537 type_descriptor%index_descriptor%index => lengths
18538 type_descriptor%index_descriptor%chunks => displs
18540 CALL mp_timestop(handle)
18551 SUBROUTINE mp_allocate_d (DATA, len, stat)
18552 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
18553 INTEGER,
INTENT(IN) :: len
18554 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
18556 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_d'
18558 INTEGER :: handle, ierr
18560 CALL mp_timeset(routinen, handle)
18562#if defined(__parallel)
18564 CALL mp_alloc_mem(
DATA, len, stat=ierr)
18565 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
18566 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
18567 CALL add_perf(perf_id=15, count=1)
18569 ALLOCATE (
DATA(len), stat=ierr)
18570 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
18571 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
18573 IF (
PRESENT(stat)) stat = ierr
18574 CALL mp_timestop(handle)
18575 END SUBROUTINE mp_allocate_d
18583 SUBROUTINE mp_deallocate_d (DATA, stat)
18584 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
18585 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
18587 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_d'
18590#if defined(__parallel)
18594 CALL mp_timeset(routinen, handle)
18596#if defined(__parallel)
18597 CALL mp_free_mem(
DATA, ierr)
18598 IF (
PRESENT(stat))
THEN
18601 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
18604 CALL add_perf(perf_id=15, count=1)
18607 IF (
PRESENT(stat)) stat = 0
18609 CALL mp_timestop(handle)
18610 END SUBROUTINE mp_deallocate_d
18623 SUBROUTINE mp_file_write_at_dv(fh, offset, msg, msglen)
18624 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
18626 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18627 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18630#if defined(__parallel)
18634 msg_len =
SIZE(msg)
18635 IF (
PRESENT(msglen)) msg_len = msglen
18636#if defined(__parallel)
18637 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18639 cpabort(
"mpi_file_write_at_dv @ mp_file_write_at_dv")
18641 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18643 END SUBROUTINE mp_file_write_at_dv
18651 SUBROUTINE mp_file_write_at_d (fh, offset, msg)
18652 REAL(kind=real_8),
INTENT(IN) :: msg
18654 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18656#if defined(__parallel)
18660 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18662 cpabort(
"mpi_file_write_at_d @ mp_file_write_at_d")
18664 WRITE (unit=fh%handle, pos=offset + 1) msg
18666 END SUBROUTINE mp_file_write_at_d
18678 SUBROUTINE mp_file_write_at_all_dv(fh, offset, msg, msglen)
18679 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
18681 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18682 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18685#if defined(__parallel)
18689 msg_len =
SIZE(msg)
18690 IF (
PRESENT(msglen)) msg_len = msglen
18691#if defined(__parallel)
18692 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18694 cpabort(
"mpi_file_write_at_all_dv @ mp_file_write_at_all_dv")
18696 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18698 END SUBROUTINE mp_file_write_at_all_dv
18706 SUBROUTINE mp_file_write_at_all_d (fh, offset, msg)
18707 REAL(kind=real_8),
INTENT(IN) :: msg
18709 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18711#if defined(__parallel)
18715 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18717 cpabort(
"mpi_file_write_at_all_d @ mp_file_write_at_all_d")
18719 WRITE (unit=fh%handle, pos=offset + 1) msg
18721 END SUBROUTINE mp_file_write_at_all_d
18734 SUBROUTINE mp_file_read_at_dv(fh, offset, msg, msglen)
18735 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
18737 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18738 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18741#if defined(__parallel)
18745 msg_len =
SIZE(msg)
18746 IF (
PRESENT(msglen)) msg_len = msglen
18747#if defined(__parallel)
18748 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18750 cpabort(
"mpi_file_read_at_dv @ mp_file_read_at_dv")
18752 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18754 END SUBROUTINE mp_file_read_at_dv
18762 SUBROUTINE mp_file_read_at_d (fh, offset, msg)
18763 REAL(kind=real_8),
INTENT(OUT) :: msg
18765 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18767#if defined(__parallel)
18771 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18773 cpabort(
"mpi_file_read_at_d @ mp_file_read_at_d")
18775 READ (unit=fh%handle, pos=offset + 1) msg
18777 END SUBROUTINE mp_file_read_at_d
18789 SUBROUTINE mp_file_read_at_all_dv(fh, offset, msg, msglen)
18790 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
18792 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18793 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18796#if defined(__parallel)
18800 msg_len =
SIZE(msg)
18801 IF (
PRESENT(msglen)) msg_len = msglen
18802#if defined(__parallel)
18803 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18805 cpabort(
"mpi_file_read_at_all_dv @ mp_file_read_at_all_dv")
18807 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18809 END SUBROUTINE mp_file_read_at_all_dv
18817 SUBROUTINE mp_file_read_at_all_d (fh, offset, msg)
18818 REAL(kind=real_8),
INTENT(OUT) :: msg
18820 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18822#if defined(__parallel)
18826 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18828 cpabort(
"mpi_file_read_at_all_d @ mp_file_read_at_all_d")
18830 READ (unit=fh%handle, pos=offset + 1) msg
18832 END SUBROUTINE mp_file_read_at_all_d
18841 FUNCTION mp_type_make_d (ptr, &
18842 vector_descriptor, index_descriptor) &
18843 result(type_descriptor)
18844 REAL(kind=real_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
18845 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
18846 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
18849 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_d'
18851#if defined(__parallel)
18853#if defined(__MPI_F08)
18855 EXTERNAL :: mpi_get_address
18859 NULLIFY (type_descriptor%subtype)
18860 type_descriptor%length =
SIZE(ptr)
18861#if defined(__parallel)
18862 type_descriptor%type_handle = mpi_double_precision
18863 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
18865 cpabort(
"MPI_Get_address @ "//routinen)
18867 type_descriptor%type_handle = 3
18869 type_descriptor%vector_descriptor(1:2) = 1
18870 type_descriptor%has_indexing = .false.
18871 type_descriptor%data_d => ptr
18872 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
18873 cpabort(routinen//
": Vectors and indices NYI")
18875 END FUNCTION mp_type_make_d
18884 SUBROUTINE mp_alloc_mem_d (DATA, len, stat)
18885 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
18886 INTEGER,
INTENT(IN) :: len
18887 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
18889#if defined(__parallel)
18890 INTEGER :: size, ierr, length, &
18892 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
18893 TYPE(c_ptr) :: mp_baseptr
18894 mpi_info_type :: mp_info
18896 length = max(len, 1)
18897 CALL mpi_type_size(mpi_double_precision,
size, ierr)
18898 mp_size = int(length, kind=mpi_address_kind)*
size
18899 IF (mp_size .GT. mp_max_memory_size)
THEN
18900 cpabort(
"MPI cannot allocate more than 2 GiByte")
18902 mp_info = mpi_info_null
18903 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
18904 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
18905 IF (
PRESENT(stat)) stat = mp_res
18907 INTEGER :: length, mystat
18908 length = max(len, 1)
18909 IF (
PRESENT(stat))
THEN
18910 ALLOCATE (
DATA(length), stat=mystat)
18913 ALLOCATE (
DATA(length))
18916 END SUBROUTINE mp_alloc_mem_d
18924 SUBROUTINE mp_free_mem_d (DATA, stat)
18925 REAL(kind=real_8),
DIMENSION(:), &
18926 POINTER, asynchronous ::
DATA
18927 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
18929#if defined(__parallel)
18931 CALL mpi_free_mem(
DATA, mp_res)
18932 IF (
PRESENT(stat)) stat = mp_res
18935 IF (
PRESENT(stat)) stat = 0
18937 END SUBROUTINE mp_free_mem_d
18949 SUBROUTINE mp_shift_rm(msg, comm, displ_in)
18951 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
18953 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
18955 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_rm'
18957 INTEGER :: handle, ierror
18958#if defined(__parallel)
18959 INTEGER :: displ, left, &
18960 msglen, myrank, nprocs, &
18965 CALL mp_timeset(routinen, handle)
18967#if defined(__parallel)
18968 CALL mpi_comm_rank(comm%handle, myrank, ierror)
18969 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
18970 CALL mpi_comm_size(comm%handle, nprocs, ierror)
18971 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
18972 IF (
PRESENT(displ_in))
THEN
18977 right =
modulo(myrank + displ, nprocs)
18978 left =
modulo(myrank - displ, nprocs)
18981 CALL mpi_sendrecv_replace(msg, msglen, mpi_real, right, tag, left, tag, &
18982 comm%handle, mpi_status_ignore, ierror)
18983 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
18984 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_4_size)
18988 mark_used(displ_in)
18990 CALL mp_timestop(handle)
18992 END SUBROUTINE mp_shift_rm
19005 SUBROUTINE mp_shift_r (msg, comm, displ_in)
19007 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
19009 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
19011 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_r'
19013 INTEGER :: handle, ierror
19014#if defined(__parallel)
19015 INTEGER :: displ, left, &
19016 msglen, myrank, nprocs, &
19021 CALL mp_timeset(routinen, handle)
19023#if defined(__parallel)
19024 CALL mpi_comm_rank(comm%handle, myrank, ierror)
19025 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
19026 CALL mpi_comm_size(comm%handle, nprocs, ierror)
19027 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
19028 IF (
PRESENT(displ_in))
THEN
19033 right =
modulo(myrank + displ, nprocs)
19034 left =
modulo(myrank - displ, nprocs)
19037 CALL mpi_sendrecv_replace(msg, msglen, mpi_real, right, tag, left, &
19038 tag, comm%handle, mpi_status_ignore, ierror)
19039 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
19040 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_4_size)
19044 mark_used(displ_in)
19046 CALL mp_timestop(handle)
19048 END SUBROUTINE mp_shift_r
19069 SUBROUTINE mp_alltoall_r11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
19071 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
19072 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
19073 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
19074 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
19077 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r11v'
19080#if defined(__parallel)
19081 INTEGER :: ierr, msglen
19086 CALL mp_timeset(routinen, handle)
19088#if defined(__parallel)
19089 CALL mpi_alltoallv(sb, scount, sdispl, mpi_real, &
19090 rb, rcount, rdispl, mpi_real, comm%handle, ierr)
19091 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
19092 msglen = sum(scount) + sum(rcount)
19093 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19099 DO i = 1, rcount(1)
19100 rb(rdispl(1) + i) = sb(sdispl(1) + i)
19103 CALL mp_timestop(handle)
19105 END SUBROUTINE mp_alltoall_r11v
19120 SUBROUTINE mp_alltoall_r22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
19122 REAL(kind=real_4),
DIMENSION(:, :), &
19123 INTENT(IN),
CONTIGUOUS :: sb
19124 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
19125 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS, &
19126 INTENT(INOUT) :: rb
19127 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
19130 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r22v'
19133#if defined(__parallel)
19134 INTEGER :: ierr, msglen
19137 CALL mp_timeset(routinen, handle)
19139#if defined(__parallel)
19140 CALL mpi_alltoallv(sb, scount, sdispl, mpi_real, &
19141 rb, rcount, rdispl, mpi_real, comm%handle, ierr)
19142 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
19143 msglen = sum(scount) + sum(rcount)
19144 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*real_4_size)
19153 CALL mp_timestop(handle)
19155 END SUBROUTINE mp_alltoall_r22v
19172 SUBROUTINE mp_alltoall_r (sb, rb, count, comm)
19174 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
19175 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
19176 INTEGER,
INTENT(IN) :: count
19179 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r'
19182#if defined(__parallel)
19183 INTEGER :: ierr, msglen, np
19186 CALL mp_timeset(routinen, handle)
19188#if defined(__parallel)
19189 CALL mpi_alltoall(sb, count, mpi_real, &
19190 rb, count, mpi_real, comm%handle, ierr)
19191 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19192 CALL mpi_comm_size(comm%handle, np, ierr)
19193 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19194 msglen = 2*count*np
19195 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19201 CALL mp_timestop(handle)
19203 END SUBROUTINE mp_alltoall_r
19213 SUBROUTINE mp_alltoall_r22(sb, rb, count, comm)
19215 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
19216 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
19217 INTEGER,
INTENT(IN) :: count
19220 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r22'
19223#if defined(__parallel)
19224 INTEGER :: ierr, msglen, np
19227 CALL mp_timeset(routinen, handle)
19229#if defined(__parallel)
19230 CALL mpi_alltoall(sb, count, mpi_real, &
19231 rb, count, mpi_real, comm%handle, ierr)
19232 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19233 CALL mpi_comm_size(comm%handle, np, ierr)
19234 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19235 msglen = 2*
SIZE(sb)*np
19236 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19242 CALL mp_timestop(handle)
19244 END SUBROUTINE mp_alltoall_r22
19254 SUBROUTINE mp_alltoall_r33(sb, rb, count, comm)
19256 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
19257 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
19258 INTEGER,
INTENT(IN) :: count
19261 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r33'
19264#if defined(__parallel)
19265 INTEGER :: ierr, msglen, np
19268 CALL mp_timeset(routinen, handle)
19270#if defined(__parallel)
19271 CALL mpi_alltoall(sb, count, mpi_real, &
19272 rb, count, mpi_real, comm%handle, ierr)
19273 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19274 CALL mpi_comm_size(comm%handle, np, ierr)
19275 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19276 msglen = 2*count*np
19277 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19283 CALL mp_timestop(handle)
19285 END SUBROUTINE mp_alltoall_r33
19295 SUBROUTINE mp_alltoall_r44(sb, rb, count, comm)
19297 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19299 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19301 INTEGER,
INTENT(IN) :: count
19304 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r44'
19307#if defined(__parallel)
19308 INTEGER :: ierr, msglen, np
19311 CALL mp_timeset(routinen, handle)
19313#if defined(__parallel)
19314 CALL mpi_alltoall(sb, count, mpi_real, &
19315 rb, count, mpi_real, comm%handle, ierr)
19316 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19317 CALL mpi_comm_size(comm%handle, np, ierr)
19318 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19319 msglen = 2*count*np
19320 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19326 CALL mp_timestop(handle)
19328 END SUBROUTINE mp_alltoall_r44
19338 SUBROUTINE mp_alltoall_r55(sb, rb, count, comm)
19340 REAL(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
19342 REAL(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
19344 INTEGER,
INTENT(IN) :: count
19347 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r55'
19350#if defined(__parallel)
19351 INTEGER :: ierr, msglen, np
19354 CALL mp_timeset(routinen, handle)
19356#if defined(__parallel)
19357 CALL mpi_alltoall(sb, count, mpi_real, &
19358 rb, count, mpi_real, comm%handle, ierr)
19359 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19360 CALL mpi_comm_size(comm%handle, np, ierr)
19361 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19362 msglen = 2*count*np
19363 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19369 CALL mp_timestop(handle)
19371 END SUBROUTINE mp_alltoall_r55
19382 SUBROUTINE mp_alltoall_r45(sb, rb, count, comm)
19384 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19386 REAL(kind=real_4), &
19387 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
19388 INTEGER,
INTENT(IN) :: count
19391 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r45'
19394#if defined(__parallel)
19395 INTEGER :: ierr, msglen, np
19398 CALL mp_timeset(routinen, handle)
19400#if defined(__parallel)
19401 CALL mpi_alltoall(sb, count, mpi_real, &
19402 rb, count, mpi_real, comm%handle, ierr)
19403 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19404 CALL mpi_comm_size(comm%handle, np, ierr)
19405 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19406 msglen = 2*count*np
19407 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19411 rb = reshape(sb, shape(rb))
19413 CALL mp_timestop(handle)
19415 END SUBROUTINE mp_alltoall_r45
19426 SUBROUTINE mp_alltoall_r34(sb, rb, count, comm)
19428 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
19430 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19432 INTEGER,
INTENT(IN) :: count
19435 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r34'
19438#if defined(__parallel)
19439 INTEGER :: ierr, msglen, np
19442 CALL mp_timeset(routinen, handle)
19444#if defined(__parallel)
19445 CALL mpi_alltoall(sb, count, mpi_real, &
19446 rb, count, mpi_real, comm%handle, ierr)
19447 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19448 CALL mpi_comm_size(comm%handle, np, ierr)
19449 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19450 msglen = 2*count*np
19451 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19455 rb = reshape(sb, shape(rb))
19457 CALL mp_timestop(handle)
19459 END SUBROUTINE mp_alltoall_r34
19470 SUBROUTINE mp_alltoall_r54(sb, rb, count, comm)
19472 REAL(kind=real_4), &
19473 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
19474 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19476 INTEGER,
INTENT(IN) :: count
19479 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r54'
19482#if defined(__parallel)
19483 INTEGER :: ierr, msglen, np
19486 CALL mp_timeset(routinen, handle)
19488#if defined(__parallel)
19489 CALL mpi_alltoall(sb, count, mpi_real, &
19490 rb, count, mpi_real, comm%handle, ierr)
19491 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19492 CALL mpi_comm_size(comm%handle, np, ierr)
19493 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19494 msglen = 2*count*np
19495 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19499 rb = reshape(sb, shape(rb))
19501 CALL mp_timestop(handle)
19503 END SUBROUTINE mp_alltoall_r54
19514 SUBROUTINE mp_send_r (msg, dest, tag, comm)
19515 REAL(kind=real_4),
INTENT(IN) :: msg
19516 INTEGER,
INTENT(IN) :: dest, tag
19519 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_r'
19522#if defined(__parallel)
19523 INTEGER :: ierr, msglen
19526 CALL mp_timeset(routinen, handle)
19528#if defined(__parallel)
19530 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19531 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19532 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19539 cpabort(
"not in parallel mode")
19541 CALL mp_timestop(handle)
19542 END SUBROUTINE mp_send_r
19552 SUBROUTINE mp_send_rv(msg, dest, tag, comm)
19553 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
19554 INTEGER,
INTENT(IN) :: dest, tag
19557 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_rv'
19560#if defined(__parallel)
19561 INTEGER :: ierr, msglen
19564 CALL mp_timeset(routinen, handle)
19566#if defined(__parallel)
19568 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19569 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19570 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19577 cpabort(
"not in parallel mode")
19579 CALL mp_timestop(handle)
19580 END SUBROUTINE mp_send_rv
19590 SUBROUTINE mp_send_rm2(msg, dest, tag, comm)
19591 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
19592 INTEGER,
INTENT(IN) :: dest, tag
19595 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_rm2'
19598#if defined(__parallel)
19599 INTEGER :: ierr, msglen
19602 CALL mp_timeset(routinen, handle)
19604#if defined(__parallel)
19606 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19607 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19608 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19615 cpabort(
"not in parallel mode")
19617 CALL mp_timestop(handle)
19618 END SUBROUTINE mp_send_rm2
19628 SUBROUTINE mp_send_rm3(msg, dest, tag, comm)
19629 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
19630 INTEGER,
INTENT(IN) :: dest, tag
19633 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
19636#if defined(__parallel)
19637 INTEGER :: ierr, msglen
19640 CALL mp_timeset(routinen, handle)
19642#if defined(__parallel)
19644 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19645 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19646 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19653 cpabort(
"not in parallel mode")
19655 CALL mp_timestop(handle)
19656 END SUBROUTINE mp_send_rm3
19667 SUBROUTINE mp_recv_r (msg, source, tag, comm)
19668 REAL(kind=real_4),
INTENT(INOUT) :: msg
19669 INTEGER,
INTENT(INOUT) :: source, tag
19672 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_r'
19675#if defined(__parallel)
19676 INTEGER :: ierr, msglen
19677 mpi_status_type :: status
19680 CALL mp_timeset(routinen, handle)
19682#if defined(__parallel)
19685 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19686 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19688 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19689 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19690 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19691 source = status mpi_status_extract(mpi_source)
19692 tag = status mpi_status_extract(mpi_tag)
19700 cpabort(
"not in parallel mode")
19702 CALL mp_timestop(handle)
19703 END SUBROUTINE mp_recv_r
19713 SUBROUTINE mp_recv_rv(msg, source, tag, comm)
19714 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
19715 INTEGER,
INTENT(INOUT) :: source, tag
19718 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rv'
19721#if defined(__parallel)
19722 INTEGER :: ierr, msglen
19723 mpi_status_type :: status
19726 CALL mp_timeset(routinen, handle)
19728#if defined(__parallel)
19731 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19732 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19734 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19735 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19736 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19737 source = status mpi_status_extract(mpi_source)
19738 tag = status mpi_status_extract(mpi_tag)
19746 cpabort(
"not in parallel mode")
19748 CALL mp_timestop(handle)
19749 END SUBROUTINE mp_recv_rv
19759 SUBROUTINE mp_recv_rm2(msg, source, tag, comm)
19760 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
19761 INTEGER,
INTENT(INOUT) :: source, tag
19764 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rm2'
19767#if defined(__parallel)
19768 INTEGER :: ierr, msglen
19769 mpi_status_type :: status
19772 CALL mp_timeset(routinen, handle)
19774#if defined(__parallel)
19777 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19778 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19780 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19781 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19782 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19783 source = status mpi_status_extract(mpi_source)
19784 tag = status mpi_status_extract(mpi_tag)
19792 cpabort(
"not in parallel mode")
19794 CALL mp_timestop(handle)
19795 END SUBROUTINE mp_recv_rm2
19805 SUBROUTINE mp_recv_rm3(msg, source, tag, comm)
19806 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
19807 INTEGER,
INTENT(INOUT) :: source, tag
19810 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rm3'
19813#if defined(__parallel)
19814 INTEGER :: ierr, msglen
19815 mpi_status_type :: status
19818 CALL mp_timeset(routinen, handle)
19820#if defined(__parallel)
19823 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19824 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19826 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19827 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19828 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19829 source = status mpi_status_extract(mpi_source)
19830 tag = status mpi_status_extract(mpi_tag)
19838 cpabort(
"not in parallel mode")
19840 CALL mp_timestop(handle)
19841 END SUBROUTINE mp_recv_rm3
19851 SUBROUTINE mp_bcast_r (msg, source, comm)
19852 REAL(kind=real_4),
INTENT(INOUT) :: msg
19853 INTEGER,
INTENT(IN) :: source
19856 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r'
19859#if defined(__parallel)
19860 INTEGER :: ierr, msglen
19863 CALL mp_timeset(routinen, handle)
19865#if defined(__parallel)
19867 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
19868 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
19869 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
19875 CALL mp_timestop(handle)
19876 END SUBROUTINE mp_bcast_r
19885 SUBROUTINE mp_bcast_r_src(msg, comm)
19886 REAL(kind=real_4),
INTENT(INOUT) :: msg
19889 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r_src'
19892#if defined(__parallel)
19893 INTEGER :: ierr, msglen
19896 CALL mp_timeset(routinen, handle)
19898#if defined(__parallel)
19900 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
19901 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
19902 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
19907 CALL mp_timestop(handle)
19908 END SUBROUTINE mp_bcast_r_src
19918 SUBROUTINE mp_ibcast_r (msg, source, comm, request)
19919 REAL(kind=real_4),
INTENT(INOUT) :: msg
19920 INTEGER,
INTENT(IN) :: source
19924 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_r'
19927#if defined(__parallel)
19928 INTEGER :: ierr, msglen
19931 CALL mp_timeset(routinen, handle)
19933#if defined(__parallel)
19935 CALL mpi_ibcast(msg, msglen, mpi_real, source, comm%handle, request%handle, ierr)
19936 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
19937 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_4_size)
19944 CALL mp_timestop(handle)
19945 END SUBROUTINE mp_ibcast_r
19954 SUBROUTINE mp_bcast_rv(msg, source, comm)
19955 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
19956 INTEGER,
INTENT(IN) :: source
19959 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rv'
19962#if defined(__parallel)
19963 INTEGER :: ierr, msglen
19966 CALL mp_timeset(routinen, handle)
19968#if defined(__parallel)
19970 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
19971 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
19972 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
19978 CALL mp_timestop(handle)
19979 END SUBROUTINE mp_bcast_rv
19987 SUBROUTINE mp_bcast_rv_src(msg, comm)
19988 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
19991 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rv_src'
19994#if defined(__parallel)
19995 INTEGER :: ierr, msglen
19998 CALL mp_timeset(routinen, handle)
20000#if defined(__parallel)
20002 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20003 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20004 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20009 CALL mp_timestop(handle)
20010 END SUBROUTINE mp_bcast_rv_src
20019 SUBROUTINE mp_ibcast_rv(msg, source, comm, request)
20020 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
20021 INTEGER,
INTENT(IN) :: source
20025 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_rv'
20028#if defined(__parallel)
20029 INTEGER :: ierr, msglen
20032 CALL mp_timeset(routinen, handle)
20034#if defined(__parallel)
20035#if !defined(__GNUC__) || __GNUC__ >= 9
20036 cpassert(is_contiguous(msg))
20039 CALL mpi_ibcast(msg, msglen, mpi_real, source, comm%handle, request%handle, ierr)
20040 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
20041 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_4_size)
20048 CALL mp_timestop(handle)
20049 END SUBROUTINE mp_ibcast_rv
20058 SUBROUTINE mp_bcast_rm(msg, source, comm)
20059 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20060 INTEGER,
INTENT(IN) :: source
20063 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rm'
20066#if defined(__parallel)
20067 INTEGER :: ierr, msglen
20070 CALL mp_timeset(routinen, handle)
20072#if defined(__parallel)
20074 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20075 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20076 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20082 CALL mp_timestop(handle)
20083 END SUBROUTINE mp_bcast_rm
20092 SUBROUTINE mp_bcast_rm_src(msg, comm)
20093 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20096 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rm_src'
20099#if defined(__parallel)
20100 INTEGER :: ierr, msglen
20103 CALL mp_timeset(routinen, handle)
20105#if defined(__parallel)
20107 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20108 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20109 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20114 CALL mp_timestop(handle)
20115 END SUBROUTINE mp_bcast_rm_src
20124 SUBROUTINE mp_bcast_r3(msg, source, comm)
20125 REAL(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
20126 INTEGER,
INTENT(IN) :: source
20129 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r3'
20132#if defined(__parallel)
20133 INTEGER :: ierr, msglen
20136 CALL mp_timeset(routinen, handle)
20138#if defined(__parallel)
20140 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20141 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20142 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20148 CALL mp_timestop(handle)
20149 END SUBROUTINE mp_bcast_r3
20158 SUBROUTINE mp_bcast_r3_src(msg, comm)
20159 REAL(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
20162 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r3_src'
20165#if defined(__parallel)
20166 INTEGER :: ierr, msglen
20169 CALL mp_timeset(routinen, handle)
20171#if defined(__parallel)
20173 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20174 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20175 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20180 CALL mp_timestop(handle)
20181 END SUBROUTINE mp_bcast_r3_src
20190 SUBROUTINE mp_sum_r (msg, comm)
20191 REAL(kind=real_4),
INTENT(INOUT) :: msg
20194 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_r'
20197#if defined(__parallel)
20198 INTEGER :: ierr, msglen
20201 CALL mp_timeset(routinen, handle)
20203#if defined(__parallel)
20205 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20206 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20207 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20212 CALL mp_timestop(handle)
20213 END SUBROUTINE mp_sum_r
20221 SUBROUTINE mp_sum_rv(msg, comm)
20222 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20225 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rv'
20228#if defined(__parallel)
20229 INTEGER :: ierr, msglen
20232 CALL mp_timeset(routinen, handle)
20234#if defined(__parallel)
20236 IF (msglen > 0)
THEN
20237 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20238 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20240 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20245 CALL mp_timestop(handle)
20246 END SUBROUTINE mp_sum_rv
20254 SUBROUTINE mp_isum_rv(msg, comm, request)
20255 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
20259 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_rv'
20262#if defined(__parallel)
20263 INTEGER :: ierr, msglen
20266 CALL mp_timeset(routinen, handle)
20268#if defined(__parallel)
20269#if !defined(__GNUC__) || __GNUC__ >= 9
20270 cpassert(is_contiguous(msg))
20273 IF (msglen > 0)
THEN
20274 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, request%handle, ierr)
20275 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
20279 CALL add_perf(perf_id=23, count=1, msg_size=msglen*real_4_size)
20285 CALL mp_timestop(handle)
20286 END SUBROUTINE mp_isum_rv
20294 SUBROUTINE mp_sum_rm(msg, comm)
20295 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20298 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm'
20301#if defined(__parallel)
20302 INTEGER,
PARAMETER :: max_msg = 2**25
20303 INTEGER :: ierr, m1, msglen, step, msglensum
20306 CALL mp_timeset(routinen, handle)
20308#if defined(__parallel)
20310 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
20312 DO m1 = lbound(msg, 2), ubound(msg, 2), step
20313 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
20314 msglensum = msglensum + msglen
20315 IF (msglen > 0)
THEN
20316 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_real, mpi_sum, comm%handle, ierr)
20317 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20320 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_4_size)
20325 CALL mp_timestop(handle)
20326 END SUBROUTINE mp_sum_rm
20334 SUBROUTINE mp_sum_rm3(msg, comm)
20335 REAL(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
20338 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm3'
20341#if defined(__parallel)
20342 INTEGER :: ierr, msglen
20345 CALL mp_timeset(routinen, handle)
20347#if defined(__parallel)
20349 IF (msglen > 0)
THEN
20350 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20351 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20353 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20358 CALL mp_timestop(handle)
20359 END SUBROUTINE mp_sum_rm3
20367 SUBROUTINE mp_sum_rm4(msg, comm)
20368 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
20371 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm4'
20374#if defined(__parallel)
20375 INTEGER :: ierr, msglen
20378 CALL mp_timeset(routinen, handle)
20380#if defined(__parallel)
20382 IF (msglen > 0)
THEN
20383 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20384 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20386 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20391 CALL mp_timestop(handle)
20392 END SUBROUTINE mp_sum_rm4
20404 SUBROUTINE mp_sum_root_rv(msg, root, comm)
20405 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20406 INTEGER,
INTENT(IN) :: root
20409 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rv'
20412#if defined(__parallel)
20413 INTEGER :: ierr, m1, msglen, taskid
20414 REAL(kind=real_4),
ALLOCATABLE :: res(:)
20417 CALL mp_timeset(routinen, handle)
20419#if defined(__parallel)
20421 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20422 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20423 IF (msglen > 0)
THEN
20426 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_sum, &
20427 root, comm%handle, ierr)
20428 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20429 IF (taskid == root)
THEN
20434 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20440 CALL mp_timestop(handle)
20441 END SUBROUTINE mp_sum_root_rv
20452 SUBROUTINE mp_sum_root_rm(msg, root, comm)
20453 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20454 INTEGER,
INTENT(IN) :: root
20457 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
20460#if defined(__parallel)
20461 INTEGER :: ierr, m1, m2, msglen, taskid
20462 REAL(kind=real_4),
ALLOCATABLE :: res(:, :)
20465 CALL mp_timeset(routinen, handle)
20467#if defined(__parallel)
20469 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20470 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20471 IF (msglen > 0)
THEN
20474 ALLOCATE (res(m1, m2))
20475 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_sum, root, comm%handle, ierr)
20476 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20477 IF (taskid == root)
THEN
20482 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20488 CALL mp_timestop(handle)
20489 END SUBROUTINE mp_sum_root_rm
20497 SUBROUTINE mp_sum_partial_rm(msg, res, comm)
20498 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
20499 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
20502 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_rm'
20505#if defined(__parallel)
20506 INTEGER :: ierr, msglen, taskid
20509 CALL mp_timeset(routinen, handle)
20511#if defined(__parallel)
20513 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20514 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20515 IF (msglen > 0)
THEN
20516 CALL mpi_scan(msg, res, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20517 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
20519 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20525 CALL mp_timestop(handle)
20526 END SUBROUTINE mp_sum_partial_rm
20536 SUBROUTINE mp_max_r (msg, comm)
20537 REAL(kind=real_4),
INTENT(INOUT) :: msg
20540 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_r'
20543#if defined(__parallel)
20544 INTEGER :: ierr, msglen
20547 CALL mp_timeset(routinen, handle)
20549#if defined(__parallel)
20551 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_max, comm%handle, ierr)
20552 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20553 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20558 CALL mp_timestop(handle)
20559 END SUBROUTINE mp_max_r
20569 SUBROUTINE mp_max_root_r (msg, root, comm)
20570 REAL(kind=real_4),
INTENT(INOUT) :: msg
20571 INTEGER,
INTENT(IN) :: root
20574 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_r'
20577#if defined(__parallel)
20578 INTEGER :: ierr, msglen
20579 REAL(kind=real_4) :: res
20582 CALL mp_timeset(routinen, handle)
20584#if defined(__parallel)
20586 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_max, root, comm%handle, ierr)
20587 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20588 IF (root == comm%mepos) msg = res
20589 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20595 CALL mp_timestop(handle)
20596 END SUBROUTINE mp_max_root_r
20606 SUBROUTINE mp_max_rv(msg, comm)
20607 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20610 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_rv'
20613#if defined(__parallel)
20614 INTEGER :: ierr, msglen
20617 CALL mp_timeset(routinen, handle)
20619#if defined(__parallel)
20621 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_max, comm%handle, ierr)
20622 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20623 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20628 CALL mp_timestop(handle)
20629 END SUBROUTINE mp_max_rv
20639 SUBROUTINE mp_max_root_rm(msg, root, comm)
20640 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20644 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_rm'
20647#if defined(__parallel)
20648 INTEGER :: ierr, msglen
20649 REAL(kind=real_4) :: res(
SIZE(msg, 1),
SIZE(msg, 2))
20652 CALL mp_timeset(routinen, handle)
20654#if defined(__parallel)
20656 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_max, root, comm%handle, ierr)
20657 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20658 IF (root == comm%mepos) msg = res
20659 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20665 CALL mp_timestop(handle)
20666 END SUBROUTINE mp_max_root_rm
20676 SUBROUTINE mp_min_r (msg, comm)
20677 REAL(kind=real_4),
INTENT(INOUT) :: msg
20680 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_r'
20683#if defined(__parallel)
20684 INTEGER :: ierr, msglen
20687 CALL mp_timeset(routinen, handle)
20689#if defined(__parallel)
20691 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_min, comm%handle, ierr)
20692 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20693 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20698 CALL mp_timestop(handle)
20699 END SUBROUTINE mp_min_r
20711 SUBROUTINE mp_min_rv(msg, comm)
20712 REAL(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
20715 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_rv'
20718#if defined(__parallel)
20719 INTEGER :: ierr, msglen
20722 CALL mp_timeset(routinen, handle)
20724#if defined(__parallel)
20726 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_min, comm%handle, ierr)
20727 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20728 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20733 CALL mp_timestop(handle)
20734 END SUBROUTINE mp_min_rv
20744 SUBROUTINE mp_prod_r (msg, comm)
20745 REAL(kind=real_4),
INTENT(INOUT) :: msg
20748 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_r'
20751#if defined(__parallel)
20752 INTEGER :: ierr, msglen
20755 CALL mp_timeset(routinen, handle)
20757#if defined(__parallel)
20759 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_prod, comm%handle, ierr)
20760 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20761 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20766 CALL mp_timestop(handle)
20767 END SUBROUTINE mp_prod_r
20778 SUBROUTINE mp_scatter_rv(msg_scatter, msg, root, comm)
20779 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
20780 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
20781 INTEGER,
INTENT(IN) :: root
20784 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_rv'
20787#if defined(__parallel)
20788 INTEGER :: ierr, msglen
20791 CALL mp_timeset(routinen, handle)
20793#if defined(__parallel)
20795 CALL mpi_scatter(msg_scatter, msglen, mpi_real, msg, &
20796 msglen, mpi_real, root, comm%handle, ierr)
20797 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
20798 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
20804 CALL mp_timestop(handle)
20805 END SUBROUTINE mp_scatter_rv
20815 SUBROUTINE mp_iscatter_r (msg_scatter, msg, root, comm, request)
20816 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:)
20817 REAL(kind=real_4),
INTENT(INOUT) :: msg
20818 INTEGER,
INTENT(IN) :: root
20822 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_r'
20825#if defined(__parallel)
20826 INTEGER :: ierr, msglen
20829 CALL mp_timeset(routinen, handle)
20831#if defined(__parallel)
20832#if !defined(__GNUC__) || __GNUC__ >= 9
20833 cpassert(is_contiguous(msg_scatter))
20836 CALL mpi_iscatter(msg_scatter, msglen, mpi_real, msg, &
20837 msglen, mpi_real, root, comm%handle, request%handle, ierr)
20838 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
20839 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
20843 msg = msg_scatter(1)
20846 CALL mp_timestop(handle)
20847 END SUBROUTINE mp_iscatter_r
20857 SUBROUTINE mp_iscatter_rv2(msg_scatter, msg, root, comm, request)
20858 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:, :)
20859 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
20860 INTEGER,
INTENT(IN) :: root
20864 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_rv2'
20867#if defined(__parallel)
20868 INTEGER :: ierr, msglen
20871 CALL mp_timeset(routinen, handle)
20873#if defined(__parallel)
20874#if !defined(__GNUC__) || __GNUC__ >= 9
20875 cpassert(is_contiguous(msg_scatter))
20878 CALL mpi_iscatter(msg_scatter, msglen, mpi_real, msg, &
20879 msglen, mpi_real, root, comm%handle, request%handle, ierr)
20880 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
20881 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
20885 msg(:) = msg_scatter(:, 1)
20888 CALL mp_timestop(handle)
20889 END SUBROUTINE mp_iscatter_rv2
20899 SUBROUTINE mp_iscatterv_rv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
20900 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:)
20901 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
20902 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
20903 INTEGER,
INTENT(IN) :: recvcount, root
20907 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_rv'
20910#if defined(__parallel)
20914 CALL mp_timeset(routinen, handle)
20916#if defined(__parallel)
20917#if !defined(__GNUC__) || __GNUC__ >= 9
20918 cpassert(is_contiguous(msg_scatter))
20919 cpassert(is_contiguous(msg))
20920 cpassert(is_contiguous(sendcounts))
20921 cpassert(is_contiguous(displs))
20923 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_real, msg, &
20924 recvcount, mpi_real, root, comm%handle, request%handle, ierr)
20925 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
20926 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
20928 mark_used(sendcounts)
20930 mark_used(recvcount)
20933 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
20936 CALL mp_timestop(handle)
20937 END SUBROUTINE mp_iscatterv_rv
20948 SUBROUTINE mp_gather_r (msg, msg_gather, root, comm)
20949 REAL(kind=real_4),
INTENT(IN) :: msg
20950 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
20951 INTEGER,
INTENT(IN) :: root
20954 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_r'
20957#if defined(__parallel)
20958 INTEGER :: ierr, msglen
20961 CALL mp_timeset(routinen, handle)
20963#if defined(__parallel)
20965 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
20966 msglen, mpi_real, root, comm%handle, ierr)
20967 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
20968 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
20972 msg_gather(1) = msg
20974 CALL mp_timestop(handle)
20975 END SUBROUTINE mp_gather_r
20985 SUBROUTINE mp_gather_r_src(msg, msg_gather, comm)
20986 REAL(kind=real_4),
INTENT(IN) :: msg
20987 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
20990 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_r_src'
20993#if defined(__parallel)
20994 INTEGER :: ierr, msglen
20997 CALL mp_timeset(routinen, handle)
20999#if defined(__parallel)
21001 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21002 msglen, mpi_real, comm%source, comm%handle, ierr)
21003 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21004 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21007 msg_gather(1) = msg
21009 CALL mp_timestop(handle)
21010 END SUBROUTINE mp_gather_r_src
21024 SUBROUTINE mp_gather_rv(msg, msg_gather, root, comm)
21025 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
21026 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21027 INTEGER,
INTENT(IN) :: root
21030 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rv'
21033#if defined(__parallel)
21034 INTEGER :: ierr, msglen
21037 CALL mp_timeset(routinen, handle)
21039#if defined(__parallel)
21041 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21042 msglen, mpi_real, root, comm%handle, ierr)
21043 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21044 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21050 CALL mp_timestop(handle)
21051 END SUBROUTINE mp_gather_rv
21064 SUBROUTINE mp_gather_rv_src(msg, msg_gather, comm)
21065 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
21066 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21069 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rv_src'
21072#if defined(__parallel)
21073 INTEGER :: ierr, msglen
21076 CALL mp_timeset(routinen, handle)
21078#if defined(__parallel)
21080 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21081 msglen, mpi_real, comm%source, comm%handle, ierr)
21082 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21083 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21088 CALL mp_timestop(handle)
21089 END SUBROUTINE mp_gather_rv_src
21103 SUBROUTINE mp_gather_rm(msg, msg_gather, root, comm)
21104 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
21105 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
21106 INTEGER,
INTENT(IN) :: root
21109 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rm'
21112#if defined(__parallel)
21113 INTEGER :: ierr, msglen
21116 CALL mp_timeset(routinen, handle)
21118#if defined(__parallel)
21120 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21121 msglen, mpi_real, root, comm%handle, ierr)
21122 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21123 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21129 CALL mp_timestop(handle)
21130 END SUBROUTINE mp_gather_rm
21143 SUBROUTINE mp_gather_rm_src(msg, msg_gather, comm)
21144 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
21145 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
21148 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rm_src'
21151#if defined(__parallel)
21152 INTEGER :: ierr, msglen
21155 CALL mp_timeset(routinen, handle)
21157#if defined(__parallel)
21159 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21160 msglen, mpi_real, comm%source, comm%handle, ierr)
21161 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21162 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21167 CALL mp_timestop(handle)
21168 END SUBROUTINE mp_gather_rm_src
21185 SUBROUTINE mp_gatherv_rv(sendbuf, recvbuf, recvcounts, displs, root, comm)
21187 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21188 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21189 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21190 INTEGER,
INTENT(IN) :: root
21193 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rv'
21196#if defined(__parallel)
21197 INTEGER :: ierr, sendcount
21200 CALL mp_timeset(routinen, handle)
21202#if defined(__parallel)
21203 sendcount =
SIZE(sendbuf)
21204 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21205 recvbuf, recvcounts, displs, mpi_real, &
21206 root, comm%handle, ierr)
21207 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21208 CALL add_perf(perf_id=4, &
21210 msg_size=sendcount*real_4_size)
21212 mark_used(recvcounts)
21215 recvbuf(1 + displs(1):) = sendbuf
21217 CALL mp_timestop(handle)
21218 END SUBROUTINE mp_gatherv_rv
21234 SUBROUTINE mp_gatherv_rv_src(sendbuf, recvbuf, recvcounts, displs, comm)
21236 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21237 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21238 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21241 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rv_src'
21244#if defined(__parallel)
21245 INTEGER :: ierr, sendcount
21248 CALL mp_timeset(routinen, handle)
21250#if defined(__parallel)
21251 sendcount =
SIZE(sendbuf)
21252 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21253 recvbuf, recvcounts, displs, mpi_real, &
21254 comm%source, comm%handle, ierr)
21255 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21256 CALL add_perf(perf_id=4, &
21258 msg_size=sendcount*real_4_size)
21260 mark_used(recvcounts)
21262 recvbuf(1 + displs(1):) = sendbuf
21264 CALL mp_timestop(handle)
21265 END SUBROUTINE mp_gatherv_rv_src
21282 SUBROUTINE mp_gatherv_rm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
21284 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21285 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21286 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21287 INTEGER,
INTENT(IN) :: root
21290 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rm2'
21293#if defined(__parallel)
21294 INTEGER :: ierr, sendcount
21297 CALL mp_timeset(routinen, handle)
21299#if defined(__parallel)
21300 sendcount =
SIZE(sendbuf)
21301 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21302 recvbuf, recvcounts, displs, mpi_real, &
21303 root, comm%handle, ierr)
21304 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21305 CALL add_perf(perf_id=4, &
21307 msg_size=sendcount*real_4_size)
21309 mark_used(recvcounts)
21312 recvbuf(:, 1 + displs(1):) = sendbuf
21314 CALL mp_timestop(handle)
21315 END SUBROUTINE mp_gatherv_rm2
21331 SUBROUTINE mp_gatherv_rm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
21333 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21334 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21335 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21338 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rm2_src'
21341#if defined(__parallel)
21342 INTEGER :: ierr, sendcount
21345 CALL mp_timeset(routinen, handle)
21347#if defined(__parallel)
21348 sendcount =
SIZE(sendbuf)
21349 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21350 recvbuf, recvcounts, displs, mpi_real, &
21351 comm%source, comm%handle, ierr)
21352 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21353 CALL add_perf(perf_id=4, &
21355 msg_size=sendcount*real_4_size)
21357 mark_used(recvcounts)
21359 recvbuf(:, 1 + displs(1):) = sendbuf
21361 CALL mp_timestop(handle)
21362 END SUBROUTINE mp_gatherv_rm2_src
21379 SUBROUTINE mp_igatherv_rv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
21380 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
21381 REAL(kind=real_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
21382 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21383 INTEGER,
INTENT(IN) :: sendcount, root
21387 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_rv'
21390#if defined(__parallel)
21394 CALL mp_timeset(routinen, handle)
21396#if defined(__parallel)
21397#if !defined(__GNUC__) || __GNUC__ >= 9
21398 cpassert(is_contiguous(sendbuf))
21399 cpassert(is_contiguous(recvbuf))
21400 cpassert(is_contiguous(recvcounts))
21401 cpassert(is_contiguous(displs))
21403 CALL mpi_igatherv(sendbuf, sendcount, mpi_real, &
21404 recvbuf, recvcounts, displs, mpi_real, &
21405 root, comm%handle, request%handle, ierr)
21406 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21407 CALL add_perf(perf_id=24, &
21409 msg_size=sendcount*real_4_size)
21411 mark_used(sendcount)
21412 mark_used(recvcounts)
21415 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
21418 CALL mp_timestop(handle)
21419 END SUBROUTINE mp_igatherv_rv
21432 SUBROUTINE mp_allgather_r (msgout, msgin, comm)
21433 REAL(kind=real_4),
INTENT(IN) :: msgout
21434 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
21437 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r'
21440#if defined(__parallel)
21441 INTEGER :: ierr, rcount, scount
21444 CALL mp_timeset(routinen, handle)
21446#if defined(__parallel)
21449 CALL mpi_allgather(msgout, scount, mpi_real, &
21450 msgin, rcount, mpi_real, &
21452 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21457 CALL mp_timestop(handle)
21458 END SUBROUTINE mp_allgather_r
21471 SUBROUTINE mp_allgather_r2(msgout, msgin, comm)
21472 REAL(kind=real_4),
INTENT(IN) :: msgout
21473 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
21476 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r2'
21479#if defined(__parallel)
21480 INTEGER :: ierr, rcount, scount
21483 CALL mp_timeset(routinen, handle)
21485#if defined(__parallel)
21488 CALL mpi_allgather(msgout, scount, mpi_real, &
21489 msgin, rcount, mpi_real, &
21491 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21496 CALL mp_timestop(handle)
21497 END SUBROUTINE mp_allgather_r2
21510 SUBROUTINE mp_iallgather_r (msgout, msgin, comm, request)
21511 REAL(kind=real_4),
INTENT(IN) :: msgout
21512 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
21516 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r'
21519#if defined(__parallel)
21520 INTEGER :: ierr, rcount, scount
21523 CALL mp_timeset(routinen, handle)
21525#if defined(__parallel)
21526#if !defined(__GNUC__) || __GNUC__ >= 9
21527 cpassert(is_contiguous(msgin))
21531 CALL mpi_iallgather(msgout, scount, mpi_real, &
21532 msgin, rcount, mpi_real, &
21533 comm%handle, request%handle, ierr)
21534 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21540 CALL mp_timestop(handle)
21541 END SUBROUTINE mp_iallgather_r
21556 SUBROUTINE mp_allgather_r12(msgout, msgin, comm)
21557 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
21558 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
21561 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r12'
21564#if defined(__parallel)
21565 INTEGER :: ierr, rcount, scount
21568 CALL mp_timeset(routinen, handle)
21570#if defined(__parallel)
21571 scount =
SIZE(msgout(:))
21573 CALL mpi_allgather(msgout, scount, mpi_real, &
21574 msgin, rcount, mpi_real, &
21576 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21579 msgin(:, 1) = msgout(:)
21581 CALL mp_timestop(handle)
21582 END SUBROUTINE mp_allgather_r12
21592 SUBROUTINE mp_allgather_r23(msgout, msgin, comm)
21593 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
21594 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
21597 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r23'
21600#if defined(__parallel)
21601 INTEGER :: ierr, rcount, scount
21604 CALL mp_timeset(routinen, handle)
21606#if defined(__parallel)
21607 scount =
SIZE(msgout(:, :))
21609 CALL mpi_allgather(msgout, scount, mpi_real, &
21610 msgin, rcount, mpi_real, &
21612 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21615 msgin(:, :, 1) = msgout(:, :)
21617 CALL mp_timestop(handle)
21618 END SUBROUTINE mp_allgather_r23
21628 SUBROUTINE mp_allgather_r34(msgout, msgin, comm)
21629 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
21630 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
21633 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r34'
21636#if defined(__parallel)
21637 INTEGER :: ierr, rcount, scount
21640 CALL mp_timeset(routinen, handle)
21642#if defined(__parallel)
21643 scount =
SIZE(msgout(:, :, :))
21645 CALL mpi_allgather(msgout, scount, mpi_real, &
21646 msgin, rcount, mpi_real, &
21648 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21651 msgin(:, :, :, 1) = msgout(:, :, :)
21653 CALL mp_timestop(handle)
21654 END SUBROUTINE mp_allgather_r34
21664 SUBROUTINE mp_allgather_r22(msgout, msgin, comm)
21665 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
21666 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
21669 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r22'
21672#if defined(__parallel)
21673 INTEGER :: ierr, rcount, scount
21676 CALL mp_timeset(routinen, handle)
21678#if defined(__parallel)
21679 scount =
SIZE(msgout(:, :))
21681 CALL mpi_allgather(msgout, scount, mpi_real, &
21682 msgin, rcount, mpi_real, &
21684 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21687 msgin(:, :) = msgout(:, :)
21689 CALL mp_timestop(handle)
21690 END SUBROUTINE mp_allgather_r22
21701 SUBROUTINE mp_iallgather_r11(msgout, msgin, comm, request)
21702 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
21703 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
21707 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r11'
21710#if defined(__parallel)
21711 INTEGER :: ierr, rcount, scount
21714 CALL mp_timeset(routinen, handle)
21716#if defined(__parallel)
21717#if !defined(__GNUC__) || __GNUC__ >= 9
21718 cpassert(is_contiguous(msgout))
21719 cpassert(is_contiguous(msgin))
21721 scount =
SIZE(msgout(:))
21723 CALL mpi_iallgather(msgout, scount, mpi_real, &
21724 msgin, rcount, mpi_real, &
21725 comm%handle, request%handle, ierr)
21726 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
21732 CALL mp_timestop(handle)
21733 END SUBROUTINE mp_iallgather_r11
21744 SUBROUTINE mp_iallgather_r13(msgout, msgin, comm, request)
21745 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
21746 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
21750 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r13'
21753#if defined(__parallel)
21754 INTEGER :: ierr, rcount, scount
21757 CALL mp_timeset(routinen, handle)
21759#if defined(__parallel)
21760#if !defined(__GNUC__) || __GNUC__ >= 9
21761 cpassert(is_contiguous(msgout))
21762 cpassert(is_contiguous(msgin))
21765 scount =
SIZE(msgout(:))
21767 CALL mpi_iallgather(msgout, scount, mpi_real, &
21768 msgin, rcount, mpi_real, &
21769 comm%handle, request%handle, ierr)
21770 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
21773 msgin(:, 1, 1) = msgout(:)
21776 CALL mp_timestop(handle)
21777 END SUBROUTINE mp_iallgather_r13
21788 SUBROUTINE mp_iallgather_r22(msgout, msgin, comm, request)
21789 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :)
21790 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :)
21794 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r22'
21797#if defined(__parallel)
21798 INTEGER :: ierr, rcount, scount
21801 CALL mp_timeset(routinen, handle)
21803#if defined(__parallel)
21804#if !defined(__GNUC__) || __GNUC__ >= 9
21805 cpassert(is_contiguous(msgout))
21806 cpassert(is_contiguous(msgin))
21809 scount =
SIZE(msgout(:, :))
21811 CALL mpi_iallgather(msgout, scount, mpi_real, &
21812 msgin, rcount, mpi_real, &
21813 comm%handle, request%handle, ierr)
21814 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
21817 msgin(:, :) = msgout(:, :)
21820 CALL mp_timestop(handle)
21821 END SUBROUTINE mp_iallgather_r22
21832 SUBROUTINE mp_iallgather_r24(msgout, msgin, comm, request)
21833 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :)
21834 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :, :)
21838 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r24'
21841#if defined(__parallel)
21842 INTEGER :: ierr, rcount, scount
21845 CALL mp_timeset(routinen, handle)
21847#if defined(__parallel)
21848#if !defined(__GNUC__) || __GNUC__ >= 9
21849 cpassert(is_contiguous(msgout))
21850 cpassert(is_contiguous(msgin))
21853 scount =
SIZE(msgout(:, :))
21855 CALL mpi_iallgather(msgout, scount, mpi_real, &
21856 msgin, rcount, mpi_real, &
21857 comm%handle, request%handle, ierr)
21858 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
21861 msgin(:, :, 1, 1) = msgout(:, :)
21864 CALL mp_timestop(handle)
21865 END SUBROUTINE mp_iallgather_r24
21876 SUBROUTINE mp_iallgather_r33(msgout, msgin, comm, request)
21877 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :, :)
21878 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
21882 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r33'
21885#if defined(__parallel)
21886 INTEGER :: ierr, rcount, scount
21889 CALL mp_timeset(routinen, handle)
21891#if defined(__parallel)
21892#if !defined(__GNUC__) || __GNUC__ >= 9
21893 cpassert(is_contiguous(msgout))
21894 cpassert(is_contiguous(msgin))
21897 scount =
SIZE(msgout(:, :, :))
21899 CALL mpi_iallgather(msgout, scount, mpi_real, &
21900 msgin, rcount, mpi_real, &
21901 comm%handle, request%handle, ierr)
21902 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
21905 msgin(:, :, :) = msgout(:, :, :)
21908 CALL mp_timestop(handle)
21909 END SUBROUTINE mp_iallgather_r33
21928 SUBROUTINE mp_allgatherv_rv(msgout, msgin, rcount, rdispl, comm)
21929 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
21930 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
21931 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
21934 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_rv'
21937#if defined(__parallel)
21938 INTEGER :: ierr, scount
21941 CALL mp_timeset(routinen, handle)
21943#if defined(__parallel)
21944 scount =
SIZE(msgout)
21945 CALL mpi_allgatherv(msgout, scount, mpi_real, msgin, rcount, &
21946 rdispl, mpi_real, comm%handle, ierr)
21947 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
21954 CALL mp_timestop(handle)
21955 END SUBROUTINE mp_allgatherv_rv
21974 SUBROUTINE mp_allgatherv_rm2(msgout, msgin, rcount, rdispl, comm)
21975 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
21976 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
21977 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
21980 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_rv'
21983#if defined(__parallel)
21984 INTEGER :: ierr, scount
21987 CALL mp_timeset(routinen, handle)
21989#if defined(__parallel)
21990 scount =
SIZE(msgout)
21991 CALL mpi_allgatherv(msgout, scount, mpi_real, msgin, rcount, &
21992 rdispl, mpi_real, comm%handle, ierr)
21993 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
22000 CALL mp_timestop(handle)
22001 END SUBROUTINE mp_allgatherv_rm2
22020 SUBROUTINE mp_iallgatherv_rv(msgout, msgin, rcount, rdispl, comm, request)
22021 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
22022 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
22023 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
22027 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_rv'
22030#if defined(__parallel)
22031 INTEGER :: ierr, scount, rsize
22034 CALL mp_timeset(routinen, handle)
22036#if defined(__parallel)
22037#if !defined(__GNUC__) || __GNUC__ >= 9
22038 cpassert(is_contiguous(msgout))
22039 cpassert(is_contiguous(msgin))
22040 cpassert(is_contiguous(rcount))
22041 cpassert(is_contiguous(rdispl))
22044 scount =
SIZE(msgout)
22045 rsize =
SIZE(rcount)
22046 CALL mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, &
22047 rdispl, comm, request, ierr)
22048 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
22056 CALL mp_timestop(handle)
22057 END SUBROUTINE mp_iallgatherv_rv
22076 SUBROUTINE mp_iallgatherv_rv2(msgout, msgin, rcount, rdispl, comm, request)
22077 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
22078 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
22079 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
22083 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_rv2'
22086#if defined(__parallel)
22087 INTEGER :: ierr, scount, rsize
22090 CALL mp_timeset(routinen, handle)
22092#if defined(__parallel)
22093#if !defined(__GNUC__) || __GNUC__ >= 9
22094 cpassert(is_contiguous(msgout))
22095 cpassert(is_contiguous(msgin))
22096 cpassert(is_contiguous(rcount))
22097 cpassert(is_contiguous(rdispl))
22100 scount =
SIZE(msgout)
22101 rsize =
SIZE(rcount)
22102 CALL mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, &
22103 rdispl, comm, request, ierr)
22104 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
22112 CALL mp_timestop(handle)
22113 END SUBROUTINE mp_iallgatherv_rv2
22124#if defined(__parallel)
22125 SUBROUTINE mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
22126 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
22127 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22128 INTEGER,
INTENT(IN) :: rsize
22129 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
22132 INTEGER,
INTENT(INOUT) :: ierr
22134 CALL mpi_iallgatherv(msgout, scount, mpi_real, msgin, rcount, &
22135 rdispl, mpi_real, comm%handle, request%handle, ierr)
22137 END SUBROUTINE mp_iallgatherv_rv_internal
22148 SUBROUTINE mp_sum_scatter_rv(msgout, msgin, rcount, comm)
22149 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
22150 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22151 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
22154 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_rv'
22157#if defined(__parallel)
22161 CALL mp_timeset(routinen, handle)
22163#if defined(__parallel)
22164 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_real, mpi_sum, &
22166 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
22168 CALL add_perf(perf_id=3, count=1, &
22169 msg_size=rcount(1)*2*real_4_size)
22173 msgin = msgout(:, 1)
22175 CALL mp_timestop(handle)
22176 END SUBROUTINE mp_sum_scatter_rv
22187 SUBROUTINE mp_sendrecv_r (msgin, dest, msgout, source, comm, tag)
22188 REAL(kind=real_4),
INTENT(IN) :: msgin
22189 INTEGER,
INTENT(IN) :: dest
22190 REAL(kind=real_4),
INTENT(OUT) :: msgout
22191 INTEGER,
INTENT(IN) :: source
22193 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22195 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_r'
22198#if defined(__parallel)
22199 INTEGER :: ierr, msglen_in, msglen_out, &
22203 CALL mp_timeset(routinen, handle)
22205#if defined(__parallel)
22210 IF (
PRESENT(tag))
THEN
22214 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22215 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22216 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22217 CALL add_perf(perf_id=7, count=1, &
22218 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22226 CALL mp_timestop(handle)
22227 END SUBROUTINE mp_sendrecv_r
22238 SUBROUTINE mp_sendrecv_rv(msgin, dest, msgout, source, comm, tag)
22239 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
22240 INTEGER,
INTENT(IN) :: dest
22241 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
22242 INTEGER,
INTENT(IN) :: source
22244 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22246 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rv'
22249#if defined(__parallel)
22250 INTEGER :: ierr, msglen_in, msglen_out, &
22254 CALL mp_timeset(routinen, handle)
22256#if defined(__parallel)
22257 msglen_in =
SIZE(msgin)
22258 msglen_out =
SIZE(msgout)
22261 IF (
PRESENT(tag))
THEN
22265 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22266 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22267 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22268 CALL add_perf(perf_id=7, count=1, &
22269 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22277 CALL mp_timestop(handle)
22278 END SUBROUTINE mp_sendrecv_rv
22290 SUBROUTINE mp_sendrecv_rm2(msgin, dest, msgout, source, comm, tag)
22291 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
22292 INTEGER,
INTENT(IN) :: dest
22293 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
22294 INTEGER,
INTENT(IN) :: source
22296 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22298 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm2'
22301#if defined(__parallel)
22302 INTEGER :: ierr, msglen_in, msglen_out, &
22306 CALL mp_timeset(routinen, handle)
22308#if defined(__parallel)
22309 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
22310 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
22313 IF (
PRESENT(tag))
THEN
22317 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22318 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22319 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22320 CALL add_perf(perf_id=7, count=1, &
22321 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22329 CALL mp_timestop(handle)
22330 END SUBROUTINE mp_sendrecv_rm2
22341 SUBROUTINE mp_sendrecv_rm3(msgin, dest, msgout, source, comm, tag)
22342 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
22343 INTEGER,
INTENT(IN) :: dest
22344 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
22345 INTEGER,
INTENT(IN) :: source
22347 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22349 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm3'
22352#if defined(__parallel)
22353 INTEGER :: ierr, msglen_in, msglen_out, &
22357 CALL mp_timeset(routinen, handle)
22359#if defined(__parallel)
22360 msglen_in =
SIZE(msgin)
22361 msglen_out =
SIZE(msgout)
22364 IF (
PRESENT(tag))
THEN
22368 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22369 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22370 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22371 CALL add_perf(perf_id=7, count=1, &
22372 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22380 CALL mp_timestop(handle)
22381 END SUBROUTINE mp_sendrecv_rm3
22392 SUBROUTINE mp_sendrecv_rm4(msgin, dest, msgout, source, comm, tag)
22393 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
22394 INTEGER,
INTENT(IN) :: dest
22395 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
22396 INTEGER,
INTENT(IN) :: source
22398 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22400 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm4'
22403#if defined(__parallel)
22404 INTEGER :: ierr, msglen_in, msglen_out, &
22408 CALL mp_timeset(routinen, handle)
22410#if defined(__parallel)
22411 msglen_in =
SIZE(msgin)
22412 msglen_out =
SIZE(msgout)
22415 IF (
PRESENT(tag))
THEN
22419 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22420 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22421 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22422 CALL add_perf(perf_id=7, count=1, &
22423 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22431 CALL mp_timestop(handle)
22432 END SUBROUTINE mp_sendrecv_rm4
22449 SUBROUTINE mp_isendrecv_r (msgin, dest, msgout, source, comm, send_request, &
22451 REAL(kind=real_4),
INTENT(IN) :: msgin
22452 INTEGER,
INTENT(IN) :: dest
22453 REAL(kind=real_4),
INTENT(INOUT) :: msgout
22454 INTEGER,
INTENT(IN) :: source
22457 INTEGER,
INTENT(in),
OPTIONAL :: tag
22459 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_r'
22462#if defined(__parallel)
22463 INTEGER :: ierr, my_tag
22466 CALL mp_timeset(routinen, handle)
22468#if defined(__parallel)
22470 IF (
PRESENT(tag)) my_tag = tag
22472 CALL mpi_irecv(msgout, 1, mpi_real, source, my_tag, &
22473 comm%handle, recv_request%handle, ierr)
22474 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
22476 CALL mpi_isend(msgin, 1, mpi_real, dest, my_tag, &
22477 comm%handle, send_request%handle, ierr)
22478 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22480 CALL add_perf(perf_id=8, count=1, msg_size=2*real_4_size)
22490 CALL mp_timestop(handle)
22491 END SUBROUTINE mp_isendrecv_r
22510 SUBROUTINE mp_isendrecv_rv(msgin, dest, msgout, source, comm, send_request, &
22512 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
22513 INTEGER,
INTENT(IN) :: dest
22514 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
22515 INTEGER,
INTENT(IN) :: source
22518 INTEGER,
INTENT(in),
OPTIONAL :: tag
22520 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_rv'
22523#if defined(__parallel)
22524 INTEGER :: ierr, msglen, my_tag
22525 REAL(kind=real_4) :: foo
22528 CALL mp_timeset(routinen, handle)
22530#if defined(__parallel)
22531#if !defined(__GNUC__) || __GNUC__ >= 9
22532 cpassert(is_contiguous(msgout))
22533 cpassert(is_contiguous(msgin))
22537 IF (
PRESENT(tag)) my_tag = tag
22539 msglen =
SIZE(msgout, 1)
22540 IF (msglen > 0)
THEN
22541 CALL mpi_irecv(msgout(1), msglen, mpi_real, source, my_tag, &
22542 comm%handle, recv_request%handle, ierr)
22544 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
22545 comm%handle, recv_request%handle, ierr)
22547 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
22549 msglen =
SIZE(msgin, 1)
22550 IF (msglen > 0)
THEN
22551 CALL mpi_isend(msgin(1), msglen, mpi_real, dest, my_tag, &
22552 comm%handle, send_request%handle, ierr)
22554 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22555 comm%handle, send_request%handle, ierr)
22557 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22559 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
22560 CALL add_perf(perf_id=8, count=1, msg_size=msglen*real_4_size)
22570 CALL mp_timestop(handle)
22571 END SUBROUTINE mp_isendrecv_rv
22586 SUBROUTINE mp_isend_rv(msgin, dest, comm, request, tag)
22587 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
22588 INTEGER,
INTENT(IN) :: dest
22591 INTEGER,
INTENT(in),
OPTIONAL :: tag
22593 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rv'
22595 INTEGER :: handle, ierr
22596#if defined(__parallel)
22597 INTEGER :: msglen, my_tag
22598 REAL(kind=real_4) :: foo(1)
22601 CALL mp_timeset(routinen, handle)
22603#if defined(__parallel)
22604#if !defined(__GNUC__) || __GNUC__ >= 9
22605 cpassert(is_contiguous(msgin))
22608 IF (
PRESENT(tag)) my_tag = tag
22610 msglen =
SIZE(msgin)
22611 IF (msglen > 0)
THEN
22612 CALL mpi_isend(msgin(1), msglen, mpi_real, dest, my_tag, &
22613 comm%handle, request%handle, ierr)
22615 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22616 comm%handle, request%handle, ierr)
22618 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22620 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22629 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22631 CALL mp_timestop(handle)
22632 END SUBROUTINE mp_isend_rv
22649 SUBROUTINE mp_isend_rm2(msgin, dest, comm, request, tag)
22650 REAL(kind=real_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
22651 INTEGER,
INTENT(IN) :: dest
22654 INTEGER,
INTENT(in),
OPTIONAL :: tag
22656 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm2'
22658 INTEGER :: handle, ierr
22659#if defined(__parallel)
22660 INTEGER :: msglen, my_tag
22661 REAL(kind=real_4) :: foo(1)
22664 CALL mp_timeset(routinen, handle)
22666#if defined(__parallel)
22667#if !defined(__GNUC__) || __GNUC__ >= 9
22668 cpassert(is_contiguous(msgin))
22672 IF (
PRESENT(tag)) my_tag = tag
22674 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
22675 IF (msglen > 0)
THEN
22676 CALL mpi_isend(msgin(1, 1), msglen, mpi_real, dest, my_tag, &
22677 comm%handle, request%handle, ierr)
22679 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22680 comm%handle, request%handle, ierr)
22682 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22684 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22693 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22695 CALL mp_timestop(handle)
22696 END SUBROUTINE mp_isend_rm2
22715 SUBROUTINE mp_isend_rm3(msgin, dest, comm, request, tag)
22716 REAL(kind=real_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
22717 INTEGER,
INTENT(IN) :: dest
22720 INTEGER,
INTENT(in),
OPTIONAL :: tag
22722 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm3'
22724 INTEGER :: handle, ierr
22725#if defined(__parallel)
22726 INTEGER :: msglen, my_tag
22727 REAL(kind=real_4) :: foo(1)
22730 CALL mp_timeset(routinen, handle)
22732#if defined(__parallel)
22733#if !defined(__GNUC__) || __GNUC__ >= 9
22734 cpassert(is_contiguous(msgin))
22738 IF (
PRESENT(tag)) my_tag = tag
22740 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
22741 IF (msglen > 0)
THEN
22742 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_real, dest, my_tag, &
22743 comm%handle, request%handle, ierr)
22745 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22746 comm%handle, request%handle, ierr)
22748 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22750 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22759 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22761 CALL mp_timestop(handle)
22762 END SUBROUTINE mp_isend_rm3
22778 SUBROUTINE mp_isend_rm4(msgin, dest, comm, request, tag)
22779 REAL(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
22780 INTEGER,
INTENT(IN) :: dest
22783 INTEGER,
INTENT(in),
OPTIONAL :: tag
22785 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm4'
22787 INTEGER :: handle, ierr
22788#if defined(__parallel)
22789 INTEGER :: msglen, my_tag
22790 REAL(kind=real_4) :: foo(1)
22793 CALL mp_timeset(routinen, handle)
22795#if defined(__parallel)
22796#if !defined(__GNUC__) || __GNUC__ >= 9
22797 cpassert(is_contiguous(msgin))
22801 IF (
PRESENT(tag)) my_tag = tag
22803 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
22804 IF (msglen > 0)
THEN
22805 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_real, dest, my_tag, &
22806 comm%handle, request%handle, ierr)
22808 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22809 comm%handle, request%handle, ierr)
22811 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22813 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22822 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22824 CALL mp_timestop(handle)
22825 END SUBROUTINE mp_isend_rm4
22841 SUBROUTINE mp_irecv_rv(msgout, source, comm, request, tag)
22842 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
22843 INTEGER,
INTENT(IN) :: source
22846 INTEGER,
INTENT(in),
OPTIONAL :: tag
22848 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rv'
22851#if defined(__parallel)
22852 INTEGER :: ierr, msglen, my_tag
22853 REAL(kind=real_4) :: foo(1)
22856 CALL mp_timeset(routinen, handle)
22858#if defined(__parallel)
22859#if !defined(__GNUC__) || __GNUC__ >= 9
22860 cpassert(is_contiguous(msgout))
22864 IF (
PRESENT(tag)) my_tag = tag
22866 msglen =
SIZE(msgout)
22867 IF (msglen > 0)
THEN
22868 CALL mpi_irecv(msgout(1), msglen, mpi_real, source, my_tag, &
22869 comm%handle, request%handle, ierr)
22871 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
22872 comm%handle, request%handle, ierr)
22874 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
22876 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
22878 cpabort(
"mp_irecv called in non parallel case")
22885 CALL mp_timestop(handle)
22886 END SUBROUTINE mp_irecv_rv
22903 SUBROUTINE mp_irecv_rm2(msgout, source, comm, request, tag)
22904 REAL(kind=real_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
22905 INTEGER,
INTENT(IN) :: source
22908 INTEGER,
INTENT(in),
OPTIONAL :: tag
22910 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm2'
22913#if defined(__parallel)
22914 INTEGER :: ierr, msglen, my_tag
22915 REAL(kind=real_4) :: foo(1)
22918 CALL mp_timeset(routinen, handle)
22920#if defined(__parallel)
22921#if !defined(__GNUC__) || __GNUC__ >= 9
22922 cpassert(is_contiguous(msgout))
22926 IF (
PRESENT(tag)) my_tag = tag
22928 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
22929 IF (msglen > 0)
THEN
22930 CALL mpi_irecv(msgout(1, 1), msglen, mpi_real, source, my_tag, &
22931 comm%handle, request%handle, ierr)
22933 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
22934 comm%handle, request%handle, ierr)
22936 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
22938 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
22945 cpabort(
"mp_irecv called in non parallel case")
22947 CALL mp_timestop(handle)
22948 END SUBROUTINE mp_irecv_rm2
22966 SUBROUTINE mp_irecv_rm3(msgout, source, comm, request, tag)
22967 REAL(kind=real_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
22968 INTEGER,
INTENT(IN) :: source
22971 INTEGER,
INTENT(in),
OPTIONAL :: tag
22973 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm3'
22976#if defined(__parallel)
22977 INTEGER :: ierr, msglen, my_tag
22978 REAL(kind=real_4) :: foo(1)
22981 CALL mp_timeset(routinen, handle)
22983#if defined(__parallel)
22984#if !defined(__GNUC__) || __GNUC__ >= 9
22985 cpassert(is_contiguous(msgout))
22989 IF (
PRESENT(tag)) my_tag = tag
22991 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
22992 IF (msglen > 0)
THEN
22993 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_real, source, my_tag, &
22994 comm%handle, request%handle, ierr)
22996 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
22997 comm%handle, request%handle, ierr)
22999 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
23001 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23008 cpabort(
"mp_irecv called in non parallel case")
23010 CALL mp_timestop(handle)
23011 END SUBROUTINE mp_irecv_rm3
23027 SUBROUTINE mp_irecv_rm4(msgout, source, comm, request, tag)
23028 REAL(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
23029 INTEGER,
INTENT(IN) :: source
23032 INTEGER,
INTENT(in),
OPTIONAL :: tag
23034 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm4'
23037#if defined(__parallel)
23038 INTEGER :: ierr, msglen, my_tag
23039 REAL(kind=real_4) :: foo(1)
23042 CALL mp_timeset(routinen, handle)
23044#if defined(__parallel)
23045#if !defined(__GNUC__) || __GNUC__ >= 9
23046 cpassert(is_contiguous(msgout))
23050 IF (
PRESENT(tag)) my_tag = tag
23052 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
23053 IF (msglen > 0)
THEN
23054 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_real, source, my_tag, &
23055 comm%handle, request%handle, ierr)
23057 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23058 comm%handle, request%handle, ierr)
23060 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
23062 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23069 cpabort(
"mp_irecv called in non parallel case")
23071 CALL mp_timestop(handle)
23072 END SUBROUTINE mp_irecv_rm4
23084 SUBROUTINE mp_win_create_rv(base, comm, win)
23085 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
23089 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_rv'
23092#if defined(__parallel)
23094 INTEGER(kind=mpi_address_kind) :: len
23095 REAL(kind=real_4) :: foo(1)
23098 CALL mp_timeset(routinen, handle)
23100#if defined(__parallel)
23102 len =
SIZE(base)*real_4_size
23104 CALL mpi_win_create(base(1), len, real_4_size, mpi_info_null, comm%handle, win%handle, ierr)
23106 CALL mpi_win_create(foo, len, real_4_size, mpi_info_null, comm%handle, win%handle, ierr)
23108 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
23110 CALL add_perf(perf_id=20, count=1)
23114 win%handle = mp_win_null_handle
23116 CALL mp_timestop(handle)
23117 END SUBROUTINE mp_win_create_rv
23129 SUBROUTINE mp_rget_rv(base, source, win, win_data, myproc, disp, request, &
23130 origin_datatype, target_datatype)
23131 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
23132 INTEGER,
INTENT(IN) :: source
23134 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: win_data
23135 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
23139 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_rv'
23142#if defined(__parallel)
23143 INTEGER :: ierr, len, &
23144 origin_len, target_len
23145 LOGICAL :: do_local_copy
23146 INTEGER(kind=mpi_address_kind) :: disp_aint
23147 mpi_data_type :: handle_origin_datatype, handle_target_datatype
23150 CALL mp_timeset(routinen, handle)
23152#if defined(__parallel)
23155 IF (
PRESENT(disp))
THEN
23156 disp_aint = int(disp, kind=mpi_address_kind)
23158 handle_origin_datatype = mpi_real
23160 IF (
PRESENT(origin_datatype))
THEN
23161 handle_origin_datatype = origin_datatype%type_handle
23164 handle_target_datatype = mpi_real
23166 IF (
PRESENT(target_datatype))
THEN
23167 handle_target_datatype = target_datatype%type_handle
23171 do_local_copy = .false.
23172 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
23173 IF (myproc .EQ. source) do_local_copy = .true.
23175 IF (do_local_copy)
THEN
23177 base(:) = win_data(disp_aint + 1:disp_aint + len)
23182 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
23183 target_len, handle_target_datatype, win%handle, request%handle, ierr)
23189 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
23191 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*real_4_size)
23196 mark_used(origin_datatype)
23197 mark_used(target_datatype)
23201 IF (
PRESENT(disp))
THEN
23202 base(:) = win_data(disp + 1:disp +
SIZE(base))
23204 base(:) = win_data(:
SIZE(base))
23208 CALL mp_timestop(handle)
23209 END SUBROUTINE mp_rget_rv
23219 result(type_descriptor)
23220 INTEGER,
INTENT(IN) :: count
23221 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
23224 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_r'
23227#if defined(__parallel)
23231 CALL mp_timeset(routinen, handle)
23233#if defined(__parallel)
23234 CALL mpi_type_indexed(count, lengths, displs, mpi_real, &
23235 type_descriptor%type_handle, ierr)
23237 cpabort(
"MPI_Type_Indexed @ "//routinen)
23238 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
23240 cpabort(
"MPI_Type_commit @ "//routinen)
23242 type_descriptor%type_handle = 1
23244 type_descriptor%length = count
23245 NULLIFY (type_descriptor%subtype)
23246 type_descriptor%vector_descriptor(1:2) = 1
23247 type_descriptor%has_indexing = .true.
23248 type_descriptor%index_descriptor%index => lengths
23249 type_descriptor%index_descriptor%chunks => displs
23251 CALL mp_timestop(handle)
23262 SUBROUTINE mp_allocate_r (DATA, len, stat)
23263 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23264 INTEGER,
INTENT(IN) :: len
23265 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23267 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_r'
23269 INTEGER :: handle, ierr
23271 CALL mp_timeset(routinen, handle)
23273#if defined(__parallel)
23275 CALL mp_alloc_mem(
DATA, len, stat=ierr)
23276 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
23277 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
23278 CALL add_perf(perf_id=15, count=1)
23280 ALLOCATE (
DATA(len), stat=ierr)
23281 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
23282 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
23284 IF (
PRESENT(stat)) stat = ierr
23285 CALL mp_timestop(handle)
23286 END SUBROUTINE mp_allocate_r
23294 SUBROUTINE mp_deallocate_r (DATA, stat)
23295 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23296 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23298 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_r'
23301#if defined(__parallel)
23305 CALL mp_timeset(routinen, handle)
23307#if defined(__parallel)
23308 CALL mp_free_mem(
DATA, ierr)
23309 IF (
PRESENT(stat))
THEN
23312 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
23315 CALL add_perf(perf_id=15, count=1)
23318 IF (
PRESENT(stat)) stat = 0
23320 CALL mp_timestop(handle)
23321 END SUBROUTINE mp_deallocate_r
23334 SUBROUTINE mp_file_write_at_rv(fh, offset, msg, msglen)
23335 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
23337 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23338 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23341#if defined(__parallel)
23345 msg_len =
SIZE(msg)
23346 IF (
PRESENT(msglen)) msg_len = msglen
23347#if defined(__parallel)
23348 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23350 cpabort(
"mpi_file_write_at_rv @ mp_file_write_at_rv")
23352 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23354 END SUBROUTINE mp_file_write_at_rv
23362 SUBROUTINE mp_file_write_at_r (fh, offset, msg)
23363 REAL(kind=real_4),
INTENT(IN) :: msg
23365 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23367#if defined(__parallel)
23371 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23373 cpabort(
"mpi_file_write_at_r @ mp_file_write_at_r")
23375 WRITE (unit=fh%handle, pos=offset + 1) msg
23377 END SUBROUTINE mp_file_write_at_r
23389 SUBROUTINE mp_file_write_at_all_rv(fh, offset, msg, msglen)
23390 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
23392 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23393 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23396#if defined(__parallel)
23400 msg_len =
SIZE(msg)
23401 IF (
PRESENT(msglen)) msg_len = msglen
23402#if defined(__parallel)
23403 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23405 cpabort(
"mpi_file_write_at_all_rv @ mp_file_write_at_all_rv")
23407 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23409 END SUBROUTINE mp_file_write_at_all_rv
23417 SUBROUTINE mp_file_write_at_all_r (fh, offset, msg)
23418 REAL(kind=real_4),
INTENT(IN) :: msg
23420 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23422#if defined(__parallel)
23426 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23428 cpabort(
"mpi_file_write_at_all_r @ mp_file_write_at_all_r")
23430 WRITE (unit=fh%handle, pos=offset + 1) msg
23432 END SUBROUTINE mp_file_write_at_all_r
23445 SUBROUTINE mp_file_read_at_rv(fh, offset, msg, msglen)
23446 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
23448 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23449 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23452#if defined(__parallel)
23456 msg_len =
SIZE(msg)
23457 IF (
PRESENT(msglen)) msg_len = msglen
23458#if defined(__parallel)
23459 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23461 cpabort(
"mpi_file_read_at_rv @ mp_file_read_at_rv")
23463 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23465 END SUBROUTINE mp_file_read_at_rv
23473 SUBROUTINE mp_file_read_at_r (fh, offset, msg)
23474 REAL(kind=real_4),
INTENT(OUT) :: msg
23476 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23478#if defined(__parallel)
23482 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23484 cpabort(
"mpi_file_read_at_r @ mp_file_read_at_r")
23486 READ (unit=fh%handle, pos=offset + 1) msg
23488 END SUBROUTINE mp_file_read_at_r
23500 SUBROUTINE mp_file_read_at_all_rv(fh, offset, msg, msglen)
23501 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
23503 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23504 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23507#if defined(__parallel)
23511 msg_len =
SIZE(msg)
23512 IF (
PRESENT(msglen)) msg_len = msglen
23513#if defined(__parallel)
23514 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23516 cpabort(
"mpi_file_read_at_all_rv @ mp_file_read_at_all_rv")
23518 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23520 END SUBROUTINE mp_file_read_at_all_rv
23528 SUBROUTINE mp_file_read_at_all_r (fh, offset, msg)
23529 REAL(kind=real_4),
INTENT(OUT) :: msg
23531 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23533#if defined(__parallel)
23537 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23539 cpabort(
"mpi_file_read_at_all_r @ mp_file_read_at_all_r")
23541 READ (unit=fh%handle, pos=offset + 1) msg
23543 END SUBROUTINE mp_file_read_at_all_r
23552 FUNCTION mp_type_make_r (ptr, &
23553 vector_descriptor, index_descriptor) &
23554 result(type_descriptor)
23555 REAL(kind=real_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
23556 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
23557 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
23560 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_r'
23562#if defined(__parallel)
23564#if defined(__MPI_F08)
23566 EXTERNAL :: mpi_get_address
23570 NULLIFY (type_descriptor%subtype)
23571 type_descriptor%length =
SIZE(ptr)
23572#if defined(__parallel)
23573 type_descriptor%type_handle = mpi_real
23574 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
23576 cpabort(
"MPI_Get_address @ "//routinen)
23578 type_descriptor%type_handle = 1
23580 type_descriptor%vector_descriptor(1:2) = 1
23581 type_descriptor%has_indexing = .false.
23582 type_descriptor%data_r => ptr
23583 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
23584 cpabort(routinen//
": Vectors and indices NYI")
23586 END FUNCTION mp_type_make_r
23595 SUBROUTINE mp_alloc_mem_r (DATA, len, stat)
23596 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23597 INTEGER,
INTENT(IN) :: len
23598 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23600#if defined(__parallel)
23601 INTEGER :: size, ierr, length, &
23603 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
23604 TYPE(c_ptr) :: mp_baseptr
23605 mpi_info_type :: mp_info
23607 length = max(len, 1)
23608 CALL mpi_type_size(mpi_real,
size, ierr)
23609 mp_size = int(length, kind=mpi_address_kind)*
size
23610 IF (mp_size .GT. mp_max_memory_size)
THEN
23611 cpabort(
"MPI cannot allocate more than 2 GiByte")
23613 mp_info = mpi_info_null
23614 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
23615 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
23616 IF (
PRESENT(stat)) stat = mp_res
23618 INTEGER :: length, mystat
23619 length = max(len, 1)
23620 IF (
PRESENT(stat))
THEN
23621 ALLOCATE (
DATA(length), stat=mystat)
23624 ALLOCATE (
DATA(length))
23627 END SUBROUTINE mp_alloc_mem_r
23635 SUBROUTINE mp_free_mem_r (DATA, stat)
23636 REAL(kind=real_4),
DIMENSION(:), &
23637 POINTER, asynchronous ::
DATA
23638 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23640#if defined(__parallel)
23642 CALL mpi_free_mem(
DATA, mp_res)
23643 IF (
PRESENT(stat)) stat = mp_res
23646 IF (
PRESENT(stat)) stat = 0
23648 END SUBROUTINE mp_free_mem_r
23660 SUBROUTINE mp_shift_zm(msg, comm, displ_in)
23662 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
23664 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
23666 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_zm'
23668 INTEGER :: handle, ierror
23669#if defined(__parallel)
23670 INTEGER :: displ, left, &
23671 msglen, myrank, nprocs, &
23676 CALL mp_timeset(routinen, handle)
23678#if defined(__parallel)
23679 CALL mpi_comm_rank(comm%handle, myrank, ierror)
23680 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
23681 CALL mpi_comm_size(comm%handle, nprocs, ierror)
23682 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
23683 IF (
PRESENT(displ_in))
THEN
23688 right =
modulo(myrank + displ, nprocs)
23689 left =
modulo(myrank - displ, nprocs)
23692 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_complex, right, tag, left, tag, &
23693 comm%handle, mpi_status_ignore, ierror)
23694 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
23695 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_8_size))
23699 mark_used(displ_in)
23701 CALL mp_timestop(handle)
23703 END SUBROUTINE mp_shift_zm
23716 SUBROUTINE mp_shift_z (msg, comm, displ_in)
23718 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
23720 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
23722 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_z'
23724 INTEGER :: handle, ierror
23725#if defined(__parallel)
23726 INTEGER :: displ, left, &
23727 msglen, myrank, nprocs, &
23732 CALL mp_timeset(routinen, handle)
23734#if defined(__parallel)
23735 CALL mpi_comm_rank(comm%handle, myrank, ierror)
23736 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
23737 CALL mpi_comm_size(comm%handle, nprocs, ierror)
23738 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
23739 IF (
PRESENT(displ_in))
THEN
23744 right =
modulo(myrank + displ, nprocs)
23745 left =
modulo(myrank - displ, nprocs)
23748 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_complex, right, tag, left, &
23749 tag, comm%handle, mpi_status_ignore, ierror)
23750 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
23751 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_8_size))
23755 mark_used(displ_in)
23757 CALL mp_timestop(handle)
23759 END SUBROUTINE mp_shift_z
23780 SUBROUTINE mp_alltoall_z11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
23782 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
23783 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
23784 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
23785 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
23788 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z11v'
23791#if defined(__parallel)
23792 INTEGER :: ierr, msglen
23797 CALL mp_timeset(routinen, handle)
23799#if defined(__parallel)
23800 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_complex, &
23801 rb, rcount, rdispl, mpi_double_complex, comm%handle, ierr)
23802 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
23803 msglen = sum(scount) + sum(rcount)
23804 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
23810 DO i = 1, rcount(1)
23811 rb(rdispl(1) + i) = sb(sdispl(1) + i)
23814 CALL mp_timestop(handle)
23816 END SUBROUTINE mp_alltoall_z11v
23831 SUBROUTINE mp_alltoall_z22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
23833 COMPLEX(kind=real_8),
DIMENSION(:, :), &
23834 INTENT(IN),
CONTIGUOUS :: sb
23835 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
23836 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS, &
23837 INTENT(INOUT) :: rb
23838 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
23841 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z22v'
23844#if defined(__parallel)
23845 INTEGER :: ierr, msglen
23848 CALL mp_timeset(routinen, handle)
23850#if defined(__parallel)
23851 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_complex, &
23852 rb, rcount, rdispl, mpi_double_complex, comm%handle, ierr)
23853 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
23854 msglen = sum(scount) + sum(rcount)
23855 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*(2*real_8_size))
23864 CALL mp_timestop(handle)
23866 END SUBROUTINE mp_alltoall_z22v
23883 SUBROUTINE mp_alltoall_z (sb, rb, count, comm)
23885 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
23886 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
23887 INTEGER,
INTENT(IN) :: count
23890 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z'
23893#if defined(__parallel)
23894 INTEGER :: ierr, msglen, np
23897 CALL mp_timeset(routinen, handle)
23899#if defined(__parallel)
23900 CALL mpi_alltoall(sb, count, mpi_double_complex, &
23901 rb, count, mpi_double_complex, comm%handle, ierr)
23902 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
23903 CALL mpi_comm_size(comm%handle, np, ierr)
23904 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
23905 msglen = 2*count*np
23906 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
23912 CALL mp_timestop(handle)
23914 END SUBROUTINE mp_alltoall_z
23924 SUBROUTINE mp_alltoall_z22(sb, rb, count, comm)
23926 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
23927 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
23928 INTEGER,
INTENT(IN) :: count
23931 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z22'
23934#if defined(__parallel)
23935 INTEGER :: ierr, msglen, np
23938 CALL mp_timeset(routinen, handle)
23940#if defined(__parallel)
23941 CALL mpi_alltoall(sb, count, mpi_double_complex, &
23942 rb, count, mpi_double_complex, comm%handle, ierr)
23943 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
23944 CALL mpi_comm_size(comm%handle, np, ierr)
23945 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
23946 msglen = 2*
SIZE(sb)*np
23947 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
23953 CALL mp_timestop(handle)
23955 END SUBROUTINE mp_alltoall_z22
23965 SUBROUTINE mp_alltoall_z33(sb, rb, count, comm)
23967 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
23968 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
23969 INTEGER,
INTENT(IN) :: count
23972 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z33'
23975#if defined(__parallel)
23976 INTEGER :: ierr, msglen, np
23979 CALL mp_timeset(routinen, handle)
23981#if defined(__parallel)
23982 CALL mpi_alltoall(sb, count, mpi_double_complex, &
23983 rb, count, mpi_double_complex, comm%handle, ierr)
23984 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
23985 CALL mpi_comm_size(comm%handle, np, ierr)
23986 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
23987 msglen = 2*count*np
23988 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
23994 CALL mp_timestop(handle)
23996 END SUBROUTINE mp_alltoall_z33
24006 SUBROUTINE mp_alltoall_z44(sb, rb, count, comm)
24008 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24010 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24012 INTEGER,
INTENT(IN) :: count
24015 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z44'
24018#if defined(__parallel)
24019 INTEGER :: ierr, msglen, np
24022 CALL mp_timeset(routinen, handle)
24024#if defined(__parallel)
24025 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24026 rb, count, mpi_double_complex, comm%handle, ierr)
24027 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24028 CALL mpi_comm_size(comm%handle, np, ierr)
24029 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24030 msglen = 2*count*np
24031 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24037 CALL mp_timestop(handle)
24039 END SUBROUTINE mp_alltoall_z44
24049 SUBROUTINE mp_alltoall_z55(sb, rb, count, comm)
24051 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
24053 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
24055 INTEGER,
INTENT(IN) :: count
24058 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z55'
24061#if defined(__parallel)
24062 INTEGER :: ierr, msglen, np
24065 CALL mp_timeset(routinen, handle)
24067#if defined(__parallel)
24068 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24069 rb, count, mpi_double_complex, comm%handle, ierr)
24070 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24071 CALL mpi_comm_size(comm%handle, np, ierr)
24072 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24073 msglen = 2*count*np
24074 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24080 CALL mp_timestop(handle)
24082 END SUBROUTINE mp_alltoall_z55
24093 SUBROUTINE mp_alltoall_z45(sb, rb, count, comm)
24095 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24097 COMPLEX(kind=real_8), &
24098 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
24099 INTEGER,
INTENT(IN) :: count
24102 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z45'
24105#if defined(__parallel)
24106 INTEGER :: ierr, msglen, np
24109 CALL mp_timeset(routinen, handle)
24111#if defined(__parallel)
24112 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24113 rb, count, mpi_double_complex, comm%handle, ierr)
24114 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24115 CALL mpi_comm_size(comm%handle, np, ierr)
24116 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24117 msglen = 2*count*np
24118 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24122 rb = reshape(sb, shape(rb))
24124 CALL mp_timestop(handle)
24126 END SUBROUTINE mp_alltoall_z45
24137 SUBROUTINE mp_alltoall_z34(sb, rb, count, comm)
24139 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
24141 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24143 INTEGER,
INTENT(IN) :: count
24146 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z34'
24149#if defined(__parallel)
24150 INTEGER :: ierr, msglen, np
24153 CALL mp_timeset(routinen, handle)
24155#if defined(__parallel)
24156 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24157 rb, count, mpi_double_complex, comm%handle, ierr)
24158 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24159 CALL mpi_comm_size(comm%handle, np, ierr)
24160 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24161 msglen = 2*count*np
24162 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24166 rb = reshape(sb, shape(rb))
24168 CALL mp_timestop(handle)
24170 END SUBROUTINE mp_alltoall_z34
24181 SUBROUTINE mp_alltoall_z54(sb, rb, count, comm)
24183 COMPLEX(kind=real_8), &
24184 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
24185 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24187 INTEGER,
INTENT(IN) :: count
24190 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z54'
24193#if defined(__parallel)
24194 INTEGER :: ierr, msglen, np
24197 CALL mp_timeset(routinen, handle)
24199#if defined(__parallel)
24200 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24201 rb, count, mpi_double_complex, comm%handle, ierr)
24202 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24203 CALL mpi_comm_size(comm%handle, np, ierr)
24204 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24205 msglen = 2*count*np
24206 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24210 rb = reshape(sb, shape(rb))
24212 CALL mp_timestop(handle)
24214 END SUBROUTINE mp_alltoall_z54
24225 SUBROUTINE mp_send_z (msg, dest, tag, comm)
24226 COMPLEX(kind=real_8),
INTENT(IN) :: msg
24227 INTEGER,
INTENT(IN) :: dest, tag
24230 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_z'
24233#if defined(__parallel)
24234 INTEGER :: ierr, msglen
24237 CALL mp_timeset(routinen, handle)
24239#if defined(__parallel)
24241 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24242 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24243 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24250 cpabort(
"not in parallel mode")
24252 CALL mp_timestop(handle)
24253 END SUBROUTINE mp_send_z
24263 SUBROUTINE mp_send_zv(msg, dest, tag, comm)
24264 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
24265 INTEGER,
INTENT(IN) :: dest, tag
24268 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_zv'
24271#if defined(__parallel)
24272 INTEGER :: ierr, msglen
24275 CALL mp_timeset(routinen, handle)
24277#if defined(__parallel)
24279 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24280 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24281 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24288 cpabort(
"not in parallel mode")
24290 CALL mp_timestop(handle)
24291 END SUBROUTINE mp_send_zv
24301 SUBROUTINE mp_send_zm2(msg, dest, tag, comm)
24302 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
24303 INTEGER,
INTENT(IN) :: dest, tag
24306 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_zm2'
24309#if defined(__parallel)
24310 INTEGER :: ierr, msglen
24313 CALL mp_timeset(routinen, handle)
24315#if defined(__parallel)
24317 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24318 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24319 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24326 cpabort(
"not in parallel mode")
24328 CALL mp_timestop(handle)
24329 END SUBROUTINE mp_send_zm2
24339 SUBROUTINE mp_send_zm3(msg, dest, tag, comm)
24340 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
24341 INTEGER,
INTENT(IN) :: dest, tag
24344 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
24347#if defined(__parallel)
24348 INTEGER :: ierr, msglen
24351 CALL mp_timeset(routinen, handle)
24353#if defined(__parallel)
24355 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24356 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24357 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24364 cpabort(
"not in parallel mode")
24366 CALL mp_timestop(handle)
24367 END SUBROUTINE mp_send_zm3
24378 SUBROUTINE mp_recv_z (msg, source, tag, comm)
24379 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24380 INTEGER,
INTENT(INOUT) :: source, tag
24383 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_z'
24386#if defined(__parallel)
24387 INTEGER :: ierr, msglen
24388 mpi_status_type :: status
24391 CALL mp_timeset(routinen, handle)
24393#if defined(__parallel)
24396 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24397 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24399 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24400 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24401 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24402 source = status mpi_status_extract(mpi_source)
24403 tag = status mpi_status_extract(mpi_tag)
24411 cpabort(
"not in parallel mode")
24413 CALL mp_timestop(handle)
24414 END SUBROUTINE mp_recv_z
24424 SUBROUTINE mp_recv_zv(msg, source, tag, comm)
24425 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24426 INTEGER,
INTENT(INOUT) :: source, tag
24429 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zv'
24432#if defined(__parallel)
24433 INTEGER :: ierr, msglen
24434 mpi_status_type :: status
24437 CALL mp_timeset(routinen, handle)
24439#if defined(__parallel)
24442 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24443 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24445 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24446 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24447 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24448 source = status mpi_status_extract(mpi_source)
24449 tag = status mpi_status_extract(mpi_tag)
24457 cpabort(
"not in parallel mode")
24459 CALL mp_timestop(handle)
24460 END SUBROUTINE mp_recv_zv
24470 SUBROUTINE mp_recv_zm2(msg, source, tag, comm)
24471 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
24472 INTEGER,
INTENT(INOUT) :: source, tag
24475 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zm2'
24478#if defined(__parallel)
24479 INTEGER :: ierr, msglen
24480 mpi_status_type :: status
24483 CALL mp_timeset(routinen, handle)
24485#if defined(__parallel)
24488 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24489 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24491 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24492 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24493 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24494 source = status mpi_status_extract(mpi_source)
24495 tag = status mpi_status_extract(mpi_tag)
24503 cpabort(
"not in parallel mode")
24505 CALL mp_timestop(handle)
24506 END SUBROUTINE mp_recv_zm2
24516 SUBROUTINE mp_recv_zm3(msg, source, tag, comm)
24517 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
24518 INTEGER,
INTENT(INOUT) :: source, tag
24521 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zm3'
24524#if defined(__parallel)
24525 INTEGER :: ierr, msglen
24526 mpi_status_type :: status
24529 CALL mp_timeset(routinen, handle)
24531#if defined(__parallel)
24534 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24535 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24537 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24538 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24539 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24540 source = status mpi_status_extract(mpi_source)
24541 tag = status mpi_status_extract(mpi_tag)
24549 cpabort(
"not in parallel mode")
24551 CALL mp_timestop(handle)
24552 END SUBROUTINE mp_recv_zm3
24562 SUBROUTINE mp_bcast_z (msg, source, comm)
24563 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24564 INTEGER,
INTENT(IN) :: source
24567 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z'
24570#if defined(__parallel)
24571 INTEGER :: ierr, msglen
24574 CALL mp_timeset(routinen, handle)
24576#if defined(__parallel)
24578 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
24579 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24580 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24586 CALL mp_timestop(handle)
24587 END SUBROUTINE mp_bcast_z
24596 SUBROUTINE mp_bcast_z_src(msg, comm)
24597 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24600 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z_src'
24603#if defined(__parallel)
24604 INTEGER :: ierr, msglen
24607 CALL mp_timeset(routinen, handle)
24609#if defined(__parallel)
24611 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
24612 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24613 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24618 CALL mp_timestop(handle)
24619 END SUBROUTINE mp_bcast_z_src
24629 SUBROUTINE mp_ibcast_z (msg, source, comm, request)
24630 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24631 INTEGER,
INTENT(IN) :: source
24635 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_z'
24638#if defined(__parallel)
24639 INTEGER :: ierr, msglen
24642 CALL mp_timeset(routinen, handle)
24644#if defined(__parallel)
24646 CALL mpi_ibcast(msg, msglen, mpi_double_complex, source, comm%handle, request%handle, ierr)
24647 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
24648 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_8_size))
24655 CALL mp_timestop(handle)
24656 END SUBROUTINE mp_ibcast_z
24665 SUBROUTINE mp_bcast_zv(msg, source, comm)
24666 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24667 INTEGER,
INTENT(IN) :: source
24670 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zv'
24673#if defined(__parallel)
24674 INTEGER :: ierr, msglen
24677 CALL mp_timeset(routinen, handle)
24679#if defined(__parallel)
24681 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
24682 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24683 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24689 CALL mp_timestop(handle)
24690 END SUBROUTINE mp_bcast_zv
24698 SUBROUTINE mp_bcast_zv_src(msg, comm)
24699 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24702 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zv_src'
24705#if defined(__parallel)
24706 INTEGER :: ierr, msglen
24709 CALL mp_timeset(routinen, handle)
24711#if defined(__parallel)
24713 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
24714 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24715 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24720 CALL mp_timestop(handle)
24721 END SUBROUTINE mp_bcast_zv_src
24730 SUBROUTINE mp_ibcast_zv(msg, source, comm, request)
24731 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
24732 INTEGER,
INTENT(IN) :: source
24736 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_zv'
24739#if defined(__parallel)
24740 INTEGER :: ierr, msglen
24743 CALL mp_timeset(routinen, handle)
24745#if defined(__parallel)
24746#if !defined(__GNUC__) || __GNUC__ >= 9
24747 cpassert(is_contiguous(msg))
24750 CALL mpi_ibcast(msg, msglen, mpi_double_complex, source, comm%handle, request%handle, ierr)
24751 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
24752 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_8_size))
24759 CALL mp_timestop(handle)
24760 END SUBROUTINE mp_ibcast_zv
24769 SUBROUTINE mp_bcast_zm(msg, source, comm)
24770 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
24771 INTEGER,
INTENT(IN) :: source
24774 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zm'
24777#if defined(__parallel)
24778 INTEGER :: ierr, msglen
24781 CALL mp_timeset(routinen, handle)
24783#if defined(__parallel)
24785 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
24786 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24787 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24793 CALL mp_timestop(handle)
24794 END SUBROUTINE mp_bcast_zm
24803 SUBROUTINE mp_bcast_zm_src(msg, comm)
24804 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
24807 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zm_src'
24810#if defined(__parallel)
24811 INTEGER :: ierr, msglen
24814 CALL mp_timeset(routinen, handle)
24816#if defined(__parallel)
24818 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
24819 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24820 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24825 CALL mp_timestop(handle)
24826 END SUBROUTINE mp_bcast_zm_src
24835 SUBROUTINE mp_bcast_z3(msg, source, comm)
24836 COMPLEX(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
24837 INTEGER,
INTENT(IN) :: source
24840 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z3'
24843#if defined(__parallel)
24844 INTEGER :: ierr, msglen
24847 CALL mp_timeset(routinen, handle)
24849#if defined(__parallel)
24851 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
24852 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24853 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24859 CALL mp_timestop(handle)
24860 END SUBROUTINE mp_bcast_z3
24869 SUBROUTINE mp_bcast_z3_src(msg, comm)
24870 COMPLEX(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
24873 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z3_src'
24876#if defined(__parallel)
24877 INTEGER :: ierr, msglen
24880 CALL mp_timeset(routinen, handle)
24882#if defined(__parallel)
24884 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
24885 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24886 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24891 CALL mp_timestop(handle)
24892 END SUBROUTINE mp_bcast_z3_src
24901 SUBROUTINE mp_sum_z (msg, comm)
24902 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24905 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_z'
24908#if defined(__parallel)
24909 INTEGER :: ierr, msglen
24912 CALL mp_timeset(routinen, handle)
24914#if defined(__parallel)
24916 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
24917 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
24918 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
24923 CALL mp_timestop(handle)
24924 END SUBROUTINE mp_sum_z
24932 SUBROUTINE mp_sum_zv(msg, comm)
24933 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24936 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zv'
24939#if defined(__parallel)
24940 INTEGER :: ierr, msglen
24943 CALL mp_timeset(routinen, handle)
24945#if defined(__parallel)
24947 IF (msglen > 0)
THEN
24948 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
24949 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
24951 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
24956 CALL mp_timestop(handle)
24957 END SUBROUTINE mp_sum_zv
24965 SUBROUTINE mp_isum_zv(msg, comm, request)
24966 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
24970 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_zv'
24973#if defined(__parallel)
24974 INTEGER :: ierr, msglen
24977 CALL mp_timeset(routinen, handle)
24979#if defined(__parallel)
24980#if !defined(__GNUC__) || __GNUC__ >= 9
24981 cpassert(is_contiguous(msg))
24984 IF (msglen > 0)
THEN
24985 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, request%handle, ierr)
24986 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
24990 CALL add_perf(perf_id=23, count=1, msg_size=msglen*(2*real_8_size))
24996 CALL mp_timestop(handle)
24997 END SUBROUTINE mp_isum_zv
25005 SUBROUTINE mp_sum_zm(msg, comm)
25006 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25009 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm'
25012#if defined(__parallel)
25013 INTEGER,
PARAMETER :: max_msg = 2**25
25014 INTEGER :: ierr, m1, msglen, step, msglensum
25017 CALL mp_timeset(routinen, handle)
25019#if defined(__parallel)
25021 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
25023 DO m1 = lbound(msg, 2), ubound(msg, 2), step
25024 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
25025 msglensum = msglensum + msglen
25026 IF (msglen > 0)
THEN
25027 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25028 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25031 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_8_size))
25036 CALL mp_timestop(handle)
25037 END SUBROUTINE mp_sum_zm
25045 SUBROUTINE mp_sum_zm3(msg, comm)
25046 COMPLEX(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
25049 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm3'
25052#if defined(__parallel)
25053 INTEGER :: ierr, msglen
25056 CALL mp_timeset(routinen, handle)
25058#if defined(__parallel)
25060 IF (msglen > 0)
THEN
25061 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25062 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25064 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25069 CALL mp_timestop(handle)
25070 END SUBROUTINE mp_sum_zm3
25078 SUBROUTINE mp_sum_zm4(msg, comm)
25079 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
25082 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm4'
25085#if defined(__parallel)
25086 INTEGER :: ierr, msglen
25089 CALL mp_timeset(routinen, handle)
25091#if defined(__parallel)
25093 IF (msglen > 0)
THEN
25094 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25095 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25097 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25102 CALL mp_timestop(handle)
25103 END SUBROUTINE mp_sum_zm4
25115 SUBROUTINE mp_sum_root_zv(msg, root, comm)
25116 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25117 INTEGER,
INTENT(IN) :: root
25120 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_zv'
25123#if defined(__parallel)
25124 INTEGER :: ierr, m1, msglen, taskid
25125 COMPLEX(kind=real_8),
ALLOCATABLE :: res(:)
25128 CALL mp_timeset(routinen, handle)
25130#if defined(__parallel)
25132 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25133 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25134 IF (msglen > 0)
THEN
25137 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_sum, &
25138 root, comm%handle, ierr)
25139 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25140 IF (taskid == root)
THEN
25145 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25151 CALL mp_timestop(handle)
25152 END SUBROUTINE mp_sum_root_zv
25163 SUBROUTINE mp_sum_root_zm(msg, root, comm)
25164 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25165 INTEGER,
INTENT(IN) :: root
25168 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
25171#if defined(__parallel)
25172 INTEGER :: ierr, m1, m2, msglen, taskid
25173 COMPLEX(kind=real_8),
ALLOCATABLE :: res(:, :)
25176 CALL mp_timeset(routinen, handle)
25178#if defined(__parallel)
25180 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25181 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25182 IF (msglen > 0)
THEN
25185 ALLOCATE (res(m1, m2))
25186 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_sum, root, comm%handle, ierr)
25187 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25188 IF (taskid == root)
THEN
25193 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25199 CALL mp_timestop(handle)
25200 END SUBROUTINE mp_sum_root_zm
25208 SUBROUTINE mp_sum_partial_zm(msg, res, comm)
25209 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
25210 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
25213 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_zm'
25216#if defined(__parallel)
25217 INTEGER :: ierr, msglen, taskid
25220 CALL mp_timeset(routinen, handle)
25222#if defined(__parallel)
25224 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25225 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25226 IF (msglen > 0)
THEN
25227 CALL mpi_scan(msg, res, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25228 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
25230 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25236 CALL mp_timestop(handle)
25237 END SUBROUTINE mp_sum_partial_zm
25247 SUBROUTINE mp_max_z (msg, comm)
25248 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25251 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_z'
25254#if defined(__parallel)
25255 INTEGER :: ierr, msglen
25258 CALL mp_timeset(routinen, handle)
25260#if defined(__parallel)
25262 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_max, comm%handle, ierr)
25263 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25264 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25269 CALL mp_timestop(handle)
25270 END SUBROUTINE mp_max_z
25280 SUBROUTINE mp_max_root_z (msg, root, comm)
25281 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25282 INTEGER,
INTENT(IN) :: root
25285 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_z'
25288#if defined(__parallel)
25289 INTEGER :: ierr, msglen
25290 COMPLEX(kind=real_8) :: res
25293 CALL mp_timeset(routinen, handle)
25295#if defined(__parallel)
25297 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_max, root, comm%handle, ierr)
25298 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25299 IF (root == comm%mepos) msg = res
25300 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25306 CALL mp_timestop(handle)
25307 END SUBROUTINE mp_max_root_z
25317 SUBROUTINE mp_max_zv(msg, comm)
25318 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25321 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_zv'
25324#if defined(__parallel)
25325 INTEGER :: ierr, msglen
25328 CALL mp_timeset(routinen, handle)
25330#if defined(__parallel)
25332 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_max, comm%handle, ierr)
25333 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25334 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25339 CALL mp_timestop(handle)
25340 END SUBROUTINE mp_max_zv
25350 SUBROUTINE mp_max_root_zm(msg, root, comm)
25351 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25355 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_zm'
25358#if defined(__parallel)
25359 INTEGER :: ierr, msglen
25360 COMPLEX(kind=real_8) :: res(size(msg, 1), size(msg, 2))
25363 CALL mp_timeset(routinen, handle)
25365#if defined(__parallel)
25367 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_max, root, comm%handle, ierr)
25368 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25369 IF (root == comm%mepos) msg = res
25370 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25376 CALL mp_timestop(handle)
25377 END SUBROUTINE mp_max_root_zm
25387 SUBROUTINE mp_min_z (msg, comm)
25388 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25391 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_z'
25394#if defined(__parallel)
25395 INTEGER :: ierr, msglen
25398 CALL mp_timeset(routinen, handle)
25400#if defined(__parallel)
25402 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_min, comm%handle, ierr)
25403 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25404 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25409 CALL mp_timestop(handle)
25410 END SUBROUTINE mp_min_z
25422 SUBROUTINE mp_min_zv(msg, comm)
25423 COMPLEX(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
25426 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_zv'
25429#if defined(__parallel)
25430 INTEGER :: ierr, msglen
25433 CALL mp_timeset(routinen, handle)
25435#if defined(__parallel)
25437 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_min, comm%handle, ierr)
25438 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25439 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25444 CALL mp_timestop(handle)
25445 END SUBROUTINE mp_min_zv
25455 SUBROUTINE mp_prod_z (msg, comm)
25456 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25459 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_z'
25462#if defined(__parallel)
25463 INTEGER :: ierr, msglen
25466 CALL mp_timeset(routinen, handle)
25468#if defined(__parallel)
25470 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_prod, comm%handle, ierr)
25471 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25472 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25477 CALL mp_timestop(handle)
25478 END SUBROUTINE mp_prod_z
25489 SUBROUTINE mp_scatter_zv(msg_scatter, msg, root, comm)
25490 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
25491 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
25492 INTEGER,
INTENT(IN) :: root
25495 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_zv'
25498#if defined(__parallel)
25499 INTEGER :: ierr, msglen
25502 CALL mp_timeset(routinen, handle)
25504#if defined(__parallel)
25506 CALL mpi_scatter(msg_scatter, msglen, mpi_double_complex, msg, &
25507 msglen, mpi_double_complex, root, comm%handle, ierr)
25508 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
25509 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25515 CALL mp_timestop(handle)
25516 END SUBROUTINE mp_scatter_zv
25526 SUBROUTINE mp_iscatter_z (msg_scatter, msg, root, comm, request)
25527 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:)
25528 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25529 INTEGER,
INTENT(IN) :: root
25533 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_z'
25536#if defined(__parallel)
25537 INTEGER :: ierr, msglen
25540 CALL mp_timeset(routinen, handle)
25542#if defined(__parallel)
25543#if !defined(__GNUC__) || __GNUC__ >= 9
25544 cpassert(is_contiguous(msg_scatter))
25547 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_complex, msg, &
25548 msglen, mpi_double_complex, root, comm%handle, request%handle, ierr)
25549 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
25550 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
25554 msg = msg_scatter(1)
25557 CALL mp_timestop(handle)
25558 END SUBROUTINE mp_iscatter_z
25568 SUBROUTINE mp_iscatter_zv2(msg_scatter, msg, root, comm, request)
25569 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:, :)
25570 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
25571 INTEGER,
INTENT(IN) :: root
25575 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_zv2'
25578#if defined(__parallel)
25579 INTEGER :: ierr, msglen
25582 CALL mp_timeset(routinen, handle)
25584#if defined(__parallel)
25585#if !defined(__GNUC__) || __GNUC__ >= 9
25586 cpassert(is_contiguous(msg_scatter))
25589 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_complex, msg, &
25590 msglen, mpi_double_complex, root, comm%handle, request%handle, ierr)
25591 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
25592 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
25596 msg(:) = msg_scatter(:, 1)
25599 CALL mp_timestop(handle)
25600 END SUBROUTINE mp_iscatter_zv2
25610 SUBROUTINE mp_iscatterv_zv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
25611 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:)
25612 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
25613 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
25614 INTEGER,
INTENT(IN) :: recvcount, root
25618 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_zv'
25621#if defined(__parallel)
25625 CALL mp_timeset(routinen, handle)
25627#if defined(__parallel)
25628#if !defined(__GNUC__) || __GNUC__ >= 9
25629 cpassert(is_contiguous(msg_scatter))
25630 cpassert(is_contiguous(msg))
25631 cpassert(is_contiguous(sendcounts))
25632 cpassert(is_contiguous(displs))
25634 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_double_complex, msg, &
25635 recvcount, mpi_double_complex, root, comm%handle, request%handle, ierr)
25636 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
25637 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
25639 mark_used(sendcounts)
25641 mark_used(recvcount)
25644 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
25647 CALL mp_timestop(handle)
25648 END SUBROUTINE mp_iscatterv_zv
25659 SUBROUTINE mp_gather_z (msg, msg_gather, root, comm)
25660 COMPLEX(kind=real_8),
INTENT(IN) :: msg
25661 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25662 INTEGER,
INTENT(IN) :: root
25665 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_z'
25668#if defined(__parallel)
25669 INTEGER :: ierr, msglen
25672 CALL mp_timeset(routinen, handle)
25674#if defined(__parallel)
25676 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25677 msglen, mpi_double_complex, root, comm%handle, ierr)
25678 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25679 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25683 msg_gather(1) = msg
25685 CALL mp_timestop(handle)
25686 END SUBROUTINE mp_gather_z
25696 SUBROUTINE mp_gather_z_src(msg, msg_gather, comm)
25697 COMPLEX(kind=real_8),
INTENT(IN) :: msg
25698 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25701 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_z_src'
25704#if defined(__parallel)
25705 INTEGER :: ierr, msglen
25708 CALL mp_timeset(routinen, handle)
25710#if defined(__parallel)
25712 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25713 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25714 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25715 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25718 msg_gather(1) = msg
25720 CALL mp_timestop(handle)
25721 END SUBROUTINE mp_gather_z_src
25735 SUBROUTINE mp_gather_zv(msg, msg_gather, root, comm)
25736 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
25737 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25738 INTEGER,
INTENT(IN) :: root
25741 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zv'
25744#if defined(__parallel)
25745 INTEGER :: ierr, msglen
25748 CALL mp_timeset(routinen, handle)
25750#if defined(__parallel)
25752 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25753 msglen, mpi_double_complex, root, comm%handle, ierr)
25754 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25755 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25761 CALL mp_timestop(handle)
25762 END SUBROUTINE mp_gather_zv
25775 SUBROUTINE mp_gather_zv_src(msg, msg_gather, comm)
25776 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
25777 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25780 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zv_src'
25783#if defined(__parallel)
25784 INTEGER :: ierr, msglen
25787 CALL mp_timeset(routinen, handle)
25789#if defined(__parallel)
25791 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25792 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25793 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25794 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25799 CALL mp_timestop(handle)
25800 END SUBROUTINE mp_gather_zv_src
25814 SUBROUTINE mp_gather_zm(msg, msg_gather, root, comm)
25815 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
25816 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
25817 INTEGER,
INTENT(IN) :: root
25820 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zm'
25823#if defined(__parallel)
25824 INTEGER :: ierr, msglen
25827 CALL mp_timeset(routinen, handle)
25829#if defined(__parallel)
25831 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25832 msglen, mpi_double_complex, root, comm%handle, ierr)
25833 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25834 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25840 CALL mp_timestop(handle)
25841 END SUBROUTINE mp_gather_zm
25854 SUBROUTINE mp_gather_zm_src(msg, msg_gather, comm)
25855 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
25856 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
25859 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zm_src'
25862#if defined(__parallel)
25863 INTEGER :: ierr, msglen
25866 CALL mp_timeset(routinen, handle)
25868#if defined(__parallel)
25870 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25871 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25872 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25873 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25878 CALL mp_timestop(handle)
25879 END SUBROUTINE mp_gather_zm_src
25896 SUBROUTINE mp_gatherv_zv(sendbuf, recvbuf, recvcounts, displs, root, comm)
25898 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
25899 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
25900 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
25901 INTEGER,
INTENT(IN) :: root
25904 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zv'
25907#if defined(__parallel)
25908 INTEGER :: ierr, sendcount
25911 CALL mp_timeset(routinen, handle)
25913#if defined(__parallel)
25914 sendcount =
SIZE(sendbuf)
25915 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
25916 recvbuf, recvcounts, displs, mpi_double_complex, &
25917 root, comm%handle, ierr)
25918 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
25919 CALL add_perf(perf_id=4, &
25921 msg_size=sendcount*(2*real_8_size))
25923 mark_used(recvcounts)
25926 recvbuf(1 + displs(1):) = sendbuf
25928 CALL mp_timestop(handle)
25929 END SUBROUTINE mp_gatherv_zv
25945 SUBROUTINE mp_gatherv_zv_src(sendbuf, recvbuf, recvcounts, displs, comm)
25947 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
25948 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
25949 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
25952 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zv_src'
25955#if defined(__parallel)
25956 INTEGER :: ierr, sendcount
25959 CALL mp_timeset(routinen, handle)
25961#if defined(__parallel)
25962 sendcount =
SIZE(sendbuf)
25963 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
25964 recvbuf, recvcounts, displs, mpi_double_complex, &
25965 comm%source, comm%handle, ierr)
25966 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
25967 CALL add_perf(perf_id=4, &
25969 msg_size=sendcount*(2*real_8_size))
25971 mark_used(recvcounts)
25973 recvbuf(1 + displs(1):) = sendbuf
25975 CALL mp_timestop(handle)
25976 END SUBROUTINE mp_gatherv_zv_src
25993 SUBROUTINE mp_gatherv_zm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
25995 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
25996 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
25997 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
25998 INTEGER,
INTENT(IN) :: root
26001 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zm2'
26004#if defined(__parallel)
26005 INTEGER :: ierr, sendcount
26008 CALL mp_timeset(routinen, handle)
26010#if defined(__parallel)
26011 sendcount =
SIZE(sendbuf)
26012 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26013 recvbuf, recvcounts, displs, mpi_double_complex, &
26014 root, comm%handle, ierr)
26015 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26016 CALL add_perf(perf_id=4, &
26018 msg_size=sendcount*(2*real_8_size))
26020 mark_used(recvcounts)
26023 recvbuf(:, 1 + displs(1):) = sendbuf
26025 CALL mp_timestop(handle)
26026 END SUBROUTINE mp_gatherv_zm2
26042 SUBROUTINE mp_gatherv_zm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
26044 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26045 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26046 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26049 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zm2_src'
26052#if defined(__parallel)
26053 INTEGER :: ierr, sendcount
26056 CALL mp_timeset(routinen, handle)
26058#if defined(__parallel)
26059 sendcount =
SIZE(sendbuf)
26060 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26061 recvbuf, recvcounts, displs, mpi_double_complex, &
26062 comm%source, comm%handle, ierr)
26063 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26064 CALL add_perf(perf_id=4, &
26066 msg_size=sendcount*(2*real_8_size))
26068 mark_used(recvcounts)
26070 recvbuf(:, 1 + displs(1):) = sendbuf
26072 CALL mp_timestop(handle)
26073 END SUBROUTINE mp_gatherv_zm2_src
26090 SUBROUTINE mp_igatherv_zv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
26091 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
26092 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
26093 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26094 INTEGER,
INTENT(IN) :: sendcount, root
26098 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_zv'
26101#if defined(__parallel)
26105 CALL mp_timeset(routinen, handle)
26107#if defined(__parallel)
26108#if !defined(__GNUC__) || __GNUC__ >= 9
26109 cpassert(is_contiguous(sendbuf))
26110 cpassert(is_contiguous(recvbuf))
26111 cpassert(is_contiguous(recvcounts))
26112 cpassert(is_contiguous(displs))
26114 CALL mpi_igatherv(sendbuf, sendcount, mpi_double_complex, &
26115 recvbuf, recvcounts, displs, mpi_double_complex, &
26116 root, comm%handle, request%handle, ierr)
26117 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26118 CALL add_perf(perf_id=24, &
26120 msg_size=sendcount*(2*real_8_size))
26122 mark_used(sendcount)
26123 mark_used(recvcounts)
26126 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
26129 CALL mp_timestop(handle)
26130 END SUBROUTINE mp_igatherv_zv
26143 SUBROUTINE mp_allgather_z (msgout, msgin, comm)
26144 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26145 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
26148 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z'
26151#if defined(__parallel)
26152 INTEGER :: ierr, rcount, scount
26155 CALL mp_timeset(routinen, handle)
26157#if defined(__parallel)
26160 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26161 msgin, rcount, mpi_double_complex, &
26163 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26168 CALL mp_timestop(handle)
26169 END SUBROUTINE mp_allgather_z
26182 SUBROUTINE mp_allgather_z2(msgout, msgin, comm)
26183 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26184 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26187 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z2'
26190#if defined(__parallel)
26191 INTEGER :: ierr, rcount, scount
26194 CALL mp_timeset(routinen, handle)
26196#if defined(__parallel)
26199 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26200 msgin, rcount, mpi_double_complex, &
26202 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26207 CALL mp_timestop(handle)
26208 END SUBROUTINE mp_allgather_z2
26221 SUBROUTINE mp_iallgather_z (msgout, msgin, comm, request)
26222 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26223 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26227 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z'
26230#if defined(__parallel)
26231 INTEGER :: ierr, rcount, scount
26234 CALL mp_timeset(routinen, handle)
26236#if defined(__parallel)
26237#if !defined(__GNUC__) || __GNUC__ >= 9
26238 cpassert(is_contiguous(msgin))
26242 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26243 msgin, rcount, mpi_double_complex, &
26244 comm%handle, request%handle, ierr)
26245 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26251 CALL mp_timestop(handle)
26252 END SUBROUTINE mp_iallgather_z
26267 SUBROUTINE mp_allgather_z12(msgout, msgin, comm)
26268 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
26269 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26272 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z12'
26275#if defined(__parallel)
26276 INTEGER :: ierr, rcount, scount
26279 CALL mp_timeset(routinen, handle)
26281#if defined(__parallel)
26282 scount =
SIZE(msgout(:))
26284 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26285 msgin, rcount, mpi_double_complex, &
26287 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26290 msgin(:, 1) = msgout(:)
26292 CALL mp_timestop(handle)
26293 END SUBROUTINE mp_allgather_z12
26303 SUBROUTINE mp_allgather_z23(msgout, msgin, comm)
26304 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
26305 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
26308 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z23'
26311#if defined(__parallel)
26312 INTEGER :: ierr, rcount, scount
26315 CALL mp_timeset(routinen, handle)
26317#if defined(__parallel)
26318 scount =
SIZE(msgout(:, :))
26320 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26321 msgin, rcount, mpi_double_complex, &
26323 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26326 msgin(:, :, 1) = msgout(:, :)
26328 CALL mp_timestop(handle)
26329 END SUBROUTINE mp_allgather_z23
26339 SUBROUTINE mp_allgather_z34(msgout, msgin, comm)
26340 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
26341 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
26344 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z34'
26347#if defined(__parallel)
26348 INTEGER :: ierr, rcount, scount
26351 CALL mp_timeset(routinen, handle)
26353#if defined(__parallel)
26354 scount =
SIZE(msgout(:, :, :))
26356 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26357 msgin, rcount, mpi_double_complex, &
26359 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26362 msgin(:, :, :, 1) = msgout(:, :, :)
26364 CALL mp_timestop(handle)
26365 END SUBROUTINE mp_allgather_z34
26375 SUBROUTINE mp_allgather_z22(msgout, msgin, comm)
26376 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
26377 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26380 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z22'
26383#if defined(__parallel)
26384 INTEGER :: ierr, rcount, scount
26387 CALL mp_timeset(routinen, handle)
26389#if defined(__parallel)
26390 scount =
SIZE(msgout(:, :))
26392 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26393 msgin, rcount, mpi_double_complex, &
26395 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26398 msgin(:, :) = msgout(:, :)
26400 CALL mp_timestop(handle)
26401 END SUBROUTINE mp_allgather_z22
26412 SUBROUTINE mp_iallgather_z11(msgout, msgin, comm, request)
26413 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26414 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26418 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z11'
26421#if defined(__parallel)
26422 INTEGER :: ierr, rcount, scount
26425 CALL mp_timeset(routinen, handle)
26427#if defined(__parallel)
26428#if !defined(__GNUC__) || __GNUC__ >= 9
26429 cpassert(is_contiguous(msgout))
26430 cpassert(is_contiguous(msgin))
26432 scount =
SIZE(msgout(:))
26434 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26435 msgin, rcount, mpi_double_complex, &
26436 comm%handle, request%handle, ierr)
26437 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26443 CALL mp_timestop(handle)
26444 END SUBROUTINE mp_iallgather_z11
26455 SUBROUTINE mp_iallgather_z13(msgout, msgin, comm, request)
26456 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26457 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
26461 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z13'
26464#if defined(__parallel)
26465 INTEGER :: ierr, rcount, scount
26468 CALL mp_timeset(routinen, handle)
26470#if defined(__parallel)
26471#if !defined(__GNUC__) || __GNUC__ >= 9
26472 cpassert(is_contiguous(msgout))
26473 cpassert(is_contiguous(msgin))
26476 scount =
SIZE(msgout(:))
26478 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26479 msgin, rcount, mpi_double_complex, &
26480 comm%handle, request%handle, ierr)
26481 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26484 msgin(:, 1, 1) = msgout(:)
26487 CALL mp_timestop(handle)
26488 END SUBROUTINE mp_iallgather_z13
26499 SUBROUTINE mp_iallgather_z22(msgout, msgin, comm, request)
26500 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :)
26501 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :)
26505 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z22'
26508#if defined(__parallel)
26509 INTEGER :: ierr, rcount, scount
26512 CALL mp_timeset(routinen, handle)
26514#if defined(__parallel)
26515#if !defined(__GNUC__) || __GNUC__ >= 9
26516 cpassert(is_contiguous(msgout))
26517 cpassert(is_contiguous(msgin))
26520 scount =
SIZE(msgout(:, :))
26522 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26523 msgin, rcount, mpi_double_complex, &
26524 comm%handle, request%handle, ierr)
26525 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26528 msgin(:, :) = msgout(:, :)
26531 CALL mp_timestop(handle)
26532 END SUBROUTINE mp_iallgather_z22
26543 SUBROUTINE mp_iallgather_z24(msgout, msgin, comm, request)
26544 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :)
26545 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :, :)
26549 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z24'
26552#if defined(__parallel)
26553 INTEGER :: ierr, rcount, scount
26556 CALL mp_timeset(routinen, handle)
26558#if defined(__parallel)
26559#if !defined(__GNUC__) || __GNUC__ >= 9
26560 cpassert(is_contiguous(msgout))
26561 cpassert(is_contiguous(msgin))
26564 scount =
SIZE(msgout(:, :))
26566 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26567 msgin, rcount, mpi_double_complex, &
26568 comm%handle, request%handle, ierr)
26569 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26572 msgin(:, :, 1, 1) = msgout(:, :)
26575 CALL mp_timestop(handle)
26576 END SUBROUTINE mp_iallgather_z24
26587 SUBROUTINE mp_iallgather_z33(msgout, msgin, comm, request)
26588 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :, :)
26589 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
26593 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z33'
26596#if defined(__parallel)
26597 INTEGER :: ierr, rcount, scount
26600 CALL mp_timeset(routinen, handle)
26602#if defined(__parallel)
26603#if !defined(__GNUC__) || __GNUC__ >= 9
26604 cpassert(is_contiguous(msgout))
26605 cpassert(is_contiguous(msgin))
26608 scount =
SIZE(msgout(:, :, :))
26610 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26611 msgin, rcount, mpi_double_complex, &
26612 comm%handle, request%handle, ierr)
26613 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26616 msgin(:, :, :) = msgout(:, :, :)
26619 CALL mp_timestop(handle)
26620 END SUBROUTINE mp_iallgather_z33
26639 SUBROUTINE mp_allgatherv_zv(msgout, msgin, rcount, rdispl, comm)
26640 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
26641 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
26642 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
26645 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_zv'
26648#if defined(__parallel)
26649 INTEGER :: ierr, scount
26652 CALL mp_timeset(routinen, handle)
26654#if defined(__parallel)
26655 scount =
SIZE(msgout)
26656 CALL mpi_allgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
26657 rdispl, mpi_double_complex, comm%handle, ierr)
26658 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
26665 CALL mp_timestop(handle)
26666 END SUBROUTINE mp_allgatherv_zv
26685 SUBROUTINE mp_allgatherv_zm2(msgout, msgin, rcount, rdispl, comm)
26686 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
26687 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
26688 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
26691 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_zv'
26694#if defined(__parallel)
26695 INTEGER :: ierr, scount
26698 CALL mp_timeset(routinen, handle)
26700#if defined(__parallel)
26701 scount =
SIZE(msgout)
26702 CALL mpi_allgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
26703 rdispl, mpi_double_complex, comm%handle, ierr)
26704 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
26711 CALL mp_timestop(handle)
26712 END SUBROUTINE mp_allgatherv_zm2
26731 SUBROUTINE mp_iallgatherv_zv(msgout, msgin, rcount, rdispl, comm, request)
26732 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26733 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26734 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
26738 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_zv'
26741#if defined(__parallel)
26742 INTEGER :: ierr, scount, rsize
26745 CALL mp_timeset(routinen, handle)
26747#if defined(__parallel)
26748#if !defined(__GNUC__) || __GNUC__ >= 9
26749 cpassert(is_contiguous(msgout))
26750 cpassert(is_contiguous(msgin))
26751 cpassert(is_contiguous(rcount))
26752 cpassert(is_contiguous(rdispl))
26755 scount =
SIZE(msgout)
26756 rsize =
SIZE(rcount)
26757 CALL mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, &
26758 rdispl, comm, request, ierr)
26759 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
26767 CALL mp_timestop(handle)
26768 END SUBROUTINE mp_iallgatherv_zv
26787 SUBROUTINE mp_iallgatherv_zv2(msgout, msgin, rcount, rdispl, comm, request)
26788 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26789 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26790 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
26794 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_zv2'
26797#if defined(__parallel)
26798 INTEGER :: ierr, scount, rsize
26801 CALL mp_timeset(routinen, handle)
26803#if defined(__parallel)
26804#if !defined(__GNUC__) || __GNUC__ >= 9
26805 cpassert(is_contiguous(msgout))
26806 cpassert(is_contiguous(msgin))
26807 cpassert(is_contiguous(rcount))
26808 cpassert(is_contiguous(rdispl))
26811 scount =
SIZE(msgout)
26812 rsize =
SIZE(rcount)
26813 CALL mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, &
26814 rdispl, comm, request, ierr)
26815 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
26823 CALL mp_timestop(handle)
26824 END SUBROUTINE mp_iallgatherv_zv2
26835#if defined(__parallel)
26836 SUBROUTINE mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
26837 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
26838 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
26839 INTEGER,
INTENT(IN) :: rsize
26840 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
26843 INTEGER,
INTENT(INOUT) :: ierr
26845 CALL mpi_iallgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
26846 rdispl, mpi_double_complex, comm%handle, request%handle, ierr)
26848 END SUBROUTINE mp_iallgatherv_zv_internal
26859 SUBROUTINE mp_sum_scatter_zv(msgout, msgin, rcount, comm)
26860 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
26861 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
26862 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
26865 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_zv'
26868#if defined(__parallel)
26872 CALL mp_timeset(routinen, handle)
26874#if defined(__parallel)
26875 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_double_complex, mpi_sum, &
26877 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
26879 CALL add_perf(perf_id=3, count=1, &
26880 msg_size=rcount(1)*2*(2*real_8_size))
26884 msgin = msgout(:, 1)
26886 CALL mp_timestop(handle)
26887 END SUBROUTINE mp_sum_scatter_zv
26898 SUBROUTINE mp_sendrecv_z (msgin, dest, msgout, source, comm, tag)
26899 COMPLEX(kind=real_8),
INTENT(IN) :: msgin
26900 INTEGER,
INTENT(IN) :: dest
26901 COMPLEX(kind=real_8),
INTENT(OUT) :: msgout
26902 INTEGER,
INTENT(IN) :: source
26904 INTEGER,
INTENT(IN),
OPTIONAL :: tag
26906 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_z'
26909#if defined(__parallel)
26910 INTEGER :: ierr, msglen_in, msglen_out, &
26914 CALL mp_timeset(routinen, handle)
26916#if defined(__parallel)
26921 IF (
PRESENT(tag))
THEN
26925 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
26926 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
26927 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
26928 CALL add_perf(perf_id=7, count=1, &
26929 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
26937 CALL mp_timestop(handle)
26938 END SUBROUTINE mp_sendrecv_z
26949 SUBROUTINE mp_sendrecv_zv(msgin, dest, msgout, source, comm, tag)
26950 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
26951 INTEGER,
INTENT(IN) :: dest
26952 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
26953 INTEGER,
INTENT(IN) :: source
26955 INTEGER,
INTENT(IN),
OPTIONAL :: tag
26957 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zv'
26960#if defined(__parallel)
26961 INTEGER :: ierr, msglen_in, msglen_out, &
26965 CALL mp_timeset(routinen, handle)
26967#if defined(__parallel)
26968 msglen_in =
SIZE(msgin)
26969 msglen_out =
SIZE(msgout)
26972 IF (
PRESENT(tag))
THEN
26976 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
26977 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
26978 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
26979 CALL add_perf(perf_id=7, count=1, &
26980 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
26988 CALL mp_timestop(handle)
26989 END SUBROUTINE mp_sendrecv_zv
27001 SUBROUTINE mp_sendrecv_zm2(msgin, dest, msgout, source, comm, tag)
27002 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
27003 INTEGER,
INTENT(IN) :: dest
27004 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
27005 INTEGER,
INTENT(IN) :: source
27007 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27009 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm2'
27012#if defined(__parallel)
27013 INTEGER :: ierr, msglen_in, msglen_out, &
27017 CALL mp_timeset(routinen, handle)
27019#if defined(__parallel)
27020 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
27021 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
27024 IF (
PRESENT(tag))
THEN
27028 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27029 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27030 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27031 CALL add_perf(perf_id=7, count=1, &
27032 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27040 CALL mp_timestop(handle)
27041 END SUBROUTINE mp_sendrecv_zm2
27052 SUBROUTINE mp_sendrecv_zm3(msgin, dest, msgout, source, comm, tag)
27053 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
27054 INTEGER,
INTENT(IN) :: dest
27055 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
27056 INTEGER,
INTENT(IN) :: source
27058 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27060 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm3'
27063#if defined(__parallel)
27064 INTEGER :: ierr, msglen_in, msglen_out, &
27068 CALL mp_timeset(routinen, handle)
27070#if defined(__parallel)
27071 msglen_in =
SIZE(msgin)
27072 msglen_out =
SIZE(msgout)
27075 IF (
PRESENT(tag))
THEN
27079 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27080 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27081 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27082 CALL add_perf(perf_id=7, count=1, &
27083 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27091 CALL mp_timestop(handle)
27092 END SUBROUTINE mp_sendrecv_zm3
27103 SUBROUTINE mp_sendrecv_zm4(msgin, dest, msgout, source, comm, tag)
27104 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
27105 INTEGER,
INTENT(IN) :: dest
27106 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
27107 INTEGER,
INTENT(IN) :: source
27109 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27111 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm4'
27114#if defined(__parallel)
27115 INTEGER :: ierr, msglen_in, msglen_out, &
27119 CALL mp_timeset(routinen, handle)
27121#if defined(__parallel)
27122 msglen_in =
SIZE(msgin)
27123 msglen_out =
SIZE(msgout)
27126 IF (
PRESENT(tag))
THEN
27130 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27131 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27132 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27133 CALL add_perf(perf_id=7, count=1, &
27134 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27142 CALL mp_timestop(handle)
27143 END SUBROUTINE mp_sendrecv_zm4
27160 SUBROUTINE mp_isendrecv_z (msgin, dest, msgout, source, comm, send_request, &
27162 COMPLEX(kind=real_8),
INTENT(IN) :: msgin
27163 INTEGER,
INTENT(IN) :: dest
27164 COMPLEX(kind=real_8),
INTENT(INOUT) :: msgout
27165 INTEGER,
INTENT(IN) :: source
27168 INTEGER,
INTENT(in),
OPTIONAL :: tag
27170 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_z'
27173#if defined(__parallel)
27174 INTEGER :: ierr, my_tag
27177 CALL mp_timeset(routinen, handle)
27179#if defined(__parallel)
27181 IF (
PRESENT(tag)) my_tag = tag
27183 CALL mpi_irecv(msgout, 1, mpi_double_complex, source, my_tag, &
27184 comm%handle, recv_request%handle, ierr)
27185 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27187 CALL mpi_isend(msgin, 1, mpi_double_complex, dest, my_tag, &
27188 comm%handle, send_request%handle, ierr)
27189 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27191 CALL add_perf(perf_id=8, count=1, msg_size=2*(2*real_8_size))
27201 CALL mp_timestop(handle)
27202 END SUBROUTINE mp_isendrecv_z
27221 SUBROUTINE mp_isendrecv_zv(msgin, dest, msgout, source, comm, send_request, &
27223 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
27224 INTEGER,
INTENT(IN) :: dest
27225 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
27226 INTEGER,
INTENT(IN) :: source
27229 INTEGER,
INTENT(in),
OPTIONAL :: tag
27231 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_zv'
27234#if defined(__parallel)
27235 INTEGER :: ierr, msglen, my_tag
27236 COMPLEX(kind=real_8) :: foo
27239 CALL mp_timeset(routinen, handle)
27241#if defined(__parallel)
27242#if !defined(__GNUC__) || __GNUC__ >= 9
27243 cpassert(is_contiguous(msgout))
27244 cpassert(is_contiguous(msgin))
27248 IF (
PRESENT(tag)) my_tag = tag
27250 msglen =
SIZE(msgout, 1)
27251 IF (msglen > 0)
THEN
27252 CALL mpi_irecv(msgout(1), msglen, mpi_double_complex, source, my_tag, &
27253 comm%handle, recv_request%handle, ierr)
27255 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27256 comm%handle, recv_request%handle, ierr)
27258 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27260 msglen =
SIZE(msgin, 1)
27261 IF (msglen > 0)
THEN
27262 CALL mpi_isend(msgin(1), msglen, mpi_double_complex, dest, my_tag, &
27263 comm%handle, send_request%handle, ierr)
27265 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27266 comm%handle, send_request%handle, ierr)
27268 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27270 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
27271 CALL add_perf(perf_id=8, count=1, msg_size=msglen*(2*real_8_size))
27281 CALL mp_timestop(handle)
27282 END SUBROUTINE mp_isendrecv_zv
27297 SUBROUTINE mp_isend_zv(msgin, dest, comm, request, tag)
27298 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
27299 INTEGER,
INTENT(IN) :: dest
27302 INTEGER,
INTENT(in),
OPTIONAL :: tag
27304 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zv'
27306 INTEGER :: handle, ierr
27307#if defined(__parallel)
27308 INTEGER :: msglen, my_tag
27309 COMPLEX(kind=real_8) :: foo(1)
27312 CALL mp_timeset(routinen, handle)
27314#if defined(__parallel)
27315#if !defined(__GNUC__) || __GNUC__ >= 9
27316 cpassert(is_contiguous(msgin))
27319 IF (
PRESENT(tag)) my_tag = tag
27321 msglen =
SIZE(msgin)
27322 IF (msglen > 0)
THEN
27323 CALL mpi_isend(msgin(1), msglen, mpi_double_complex, dest, my_tag, &
27324 comm%handle, request%handle, ierr)
27326 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27327 comm%handle, request%handle, ierr)
27329 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27331 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27340 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27342 CALL mp_timestop(handle)
27343 END SUBROUTINE mp_isend_zv
27360 SUBROUTINE mp_isend_zm2(msgin, dest, comm, request, tag)
27361 COMPLEX(kind=real_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
27362 INTEGER,
INTENT(IN) :: dest
27365 INTEGER,
INTENT(in),
OPTIONAL :: tag
27367 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm2'
27369 INTEGER :: handle, ierr
27370#if defined(__parallel)
27371 INTEGER :: msglen, my_tag
27372 COMPLEX(kind=real_8) :: foo(1)
27375 CALL mp_timeset(routinen, handle)
27377#if defined(__parallel)
27378#if !defined(__GNUC__) || __GNUC__ >= 9
27379 cpassert(is_contiguous(msgin))
27383 IF (
PRESENT(tag)) my_tag = tag
27385 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
27386 IF (msglen > 0)
THEN
27387 CALL mpi_isend(msgin(1, 1), msglen, mpi_double_complex, dest, my_tag, &
27388 comm%handle, request%handle, ierr)
27390 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27391 comm%handle, request%handle, ierr)
27393 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27395 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27404 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27406 CALL mp_timestop(handle)
27407 END SUBROUTINE mp_isend_zm2
27426 SUBROUTINE mp_isend_zm3(msgin, dest, comm, request, tag)
27427 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
27428 INTEGER,
INTENT(IN) :: dest
27431 INTEGER,
INTENT(in),
OPTIONAL :: tag
27433 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm3'
27435 INTEGER :: handle, ierr
27436#if defined(__parallel)
27437 INTEGER :: msglen, my_tag
27438 COMPLEX(kind=real_8) :: foo(1)
27441 CALL mp_timeset(routinen, handle)
27443#if defined(__parallel)
27444#if !defined(__GNUC__) || __GNUC__ >= 9
27445 cpassert(is_contiguous(msgin))
27449 IF (
PRESENT(tag)) my_tag = tag
27451 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
27452 IF (msglen > 0)
THEN
27453 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_double_complex, dest, my_tag, &
27454 comm%handle, request%handle, ierr)
27456 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27457 comm%handle, request%handle, ierr)
27459 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27461 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27470 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27472 CALL mp_timestop(handle)
27473 END SUBROUTINE mp_isend_zm3
27489 SUBROUTINE mp_isend_zm4(msgin, dest, comm, request, tag)
27490 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
27491 INTEGER,
INTENT(IN) :: dest
27494 INTEGER,
INTENT(in),
OPTIONAL :: tag
27496 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm4'
27498 INTEGER :: handle, ierr
27499#if defined(__parallel)
27500 INTEGER :: msglen, my_tag
27501 COMPLEX(kind=real_8) :: foo(1)
27504 CALL mp_timeset(routinen, handle)
27506#if defined(__parallel)
27507#if !defined(__GNUC__) || __GNUC__ >= 9
27508 cpassert(is_contiguous(msgin))
27512 IF (
PRESENT(tag)) my_tag = tag
27514 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
27515 IF (msglen > 0)
THEN
27516 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_double_complex, dest, my_tag, &
27517 comm%handle, request%handle, ierr)
27519 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27520 comm%handle, request%handle, ierr)
27522 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27524 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27533 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27535 CALL mp_timestop(handle)
27536 END SUBROUTINE mp_isend_zm4
27552 SUBROUTINE mp_irecv_zv(msgout, source, comm, request, tag)
27553 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
27554 INTEGER,
INTENT(IN) :: source
27557 INTEGER,
INTENT(in),
OPTIONAL :: tag
27559 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zv'
27562#if defined(__parallel)
27563 INTEGER :: ierr, msglen, my_tag
27564 COMPLEX(kind=real_8) :: foo(1)
27567 CALL mp_timeset(routinen, handle)
27569#if defined(__parallel)
27570#if !defined(__GNUC__) || __GNUC__ >= 9
27571 cpassert(is_contiguous(msgout))
27575 IF (
PRESENT(tag)) my_tag = tag
27577 msglen =
SIZE(msgout)
27578 IF (msglen > 0)
THEN
27579 CALL mpi_irecv(msgout(1), msglen, mpi_double_complex, source, my_tag, &
27580 comm%handle, request%handle, ierr)
27582 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27583 comm%handle, request%handle, ierr)
27585 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27587 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27589 cpabort(
"mp_irecv called in non parallel case")
27596 CALL mp_timestop(handle)
27597 END SUBROUTINE mp_irecv_zv
27614 SUBROUTINE mp_irecv_zm2(msgout, source, comm, request, tag)
27615 COMPLEX(kind=real_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
27616 INTEGER,
INTENT(IN) :: source
27619 INTEGER,
INTENT(in),
OPTIONAL :: tag
27621 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm2'
27624#if defined(__parallel)
27625 INTEGER :: ierr, msglen, my_tag
27626 COMPLEX(kind=real_8) :: foo(1)
27629 CALL mp_timeset(routinen, handle)
27631#if defined(__parallel)
27632#if !defined(__GNUC__) || __GNUC__ >= 9
27633 cpassert(is_contiguous(msgout))
27637 IF (
PRESENT(tag)) my_tag = tag
27639 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
27640 IF (msglen > 0)
THEN
27641 CALL mpi_irecv(msgout(1, 1), msglen, mpi_double_complex, source, my_tag, &
27642 comm%handle, request%handle, ierr)
27644 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27645 comm%handle, request%handle, ierr)
27647 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27649 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27656 cpabort(
"mp_irecv called in non parallel case")
27658 CALL mp_timestop(handle)
27659 END SUBROUTINE mp_irecv_zm2
27677 SUBROUTINE mp_irecv_zm3(msgout, source, comm, request, tag)
27678 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
27679 INTEGER,
INTENT(IN) :: source
27682 INTEGER,
INTENT(in),
OPTIONAL :: tag
27684 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm3'
27687#if defined(__parallel)
27688 INTEGER :: ierr, msglen, my_tag
27689 COMPLEX(kind=real_8) :: foo(1)
27692 CALL mp_timeset(routinen, handle)
27694#if defined(__parallel)
27695#if !defined(__GNUC__) || __GNUC__ >= 9
27696 cpassert(is_contiguous(msgout))
27700 IF (
PRESENT(tag)) my_tag = tag
27702 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
27703 IF (msglen > 0)
THEN
27704 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_double_complex, source, my_tag, &
27705 comm%handle, request%handle, ierr)
27707 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27708 comm%handle, request%handle, ierr)
27710 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
27712 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27719 cpabort(
"mp_irecv called in non parallel case")
27721 CALL mp_timestop(handle)
27722 END SUBROUTINE mp_irecv_zm3
27738 SUBROUTINE mp_irecv_zm4(msgout, source, comm, request, tag)
27739 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
27740 INTEGER,
INTENT(IN) :: source
27743 INTEGER,
INTENT(in),
OPTIONAL :: tag
27745 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm4'
27748#if defined(__parallel)
27749 INTEGER :: ierr, msglen, my_tag
27750 COMPLEX(kind=real_8) :: foo(1)
27753 CALL mp_timeset(routinen, handle)
27755#if defined(__parallel)
27756#if !defined(__GNUC__) || __GNUC__ >= 9
27757 cpassert(is_contiguous(msgout))
27761 IF (
PRESENT(tag)) my_tag = tag
27763 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
27764 IF (msglen > 0)
THEN
27765 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_double_complex, source, my_tag, &
27766 comm%handle, request%handle, ierr)
27768 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27769 comm%handle, request%handle, ierr)
27771 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
27773 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27780 cpabort(
"mp_irecv called in non parallel case")
27782 CALL mp_timestop(handle)
27783 END SUBROUTINE mp_irecv_zm4
27795 SUBROUTINE mp_win_create_zv(base, comm, win)
27796 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
27800 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_zv'
27803#if defined(__parallel)
27805 INTEGER(kind=mpi_address_kind) :: len
27806 COMPLEX(kind=real_8) :: foo(1)
27809 CALL mp_timeset(routinen, handle)
27811#if defined(__parallel)
27813 len =
SIZE(base)*(2*real_8_size)
27815 CALL mpi_win_create(base(1), len, (2*real_8_size), mpi_info_null, comm%handle, win%handle, ierr)
27817 CALL mpi_win_create(foo, len, (2*real_8_size), mpi_info_null, comm%handle, win%handle, ierr)
27819 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
27821 CALL add_perf(perf_id=20, count=1)
27825 win%handle = mp_win_null_handle
27827 CALL mp_timestop(handle)
27828 END SUBROUTINE mp_win_create_zv
27840 SUBROUTINE mp_rget_zv(base, source, win, win_data, myproc, disp, request, &
27841 origin_datatype, target_datatype)
27842 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
27843 INTEGER,
INTENT(IN) :: source
27845 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: win_data
27846 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
27850 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_zv'
27853#if defined(__parallel)
27854 INTEGER :: ierr, len, &
27855 origin_len, target_len
27856 LOGICAL :: do_local_copy
27857 INTEGER(kind=mpi_address_kind) :: disp_aint
27858 mpi_data_type :: handle_origin_datatype, handle_target_datatype
27861 CALL mp_timeset(routinen, handle)
27863#if defined(__parallel)
27866 IF (
PRESENT(disp))
THEN
27867 disp_aint = int(disp, kind=mpi_address_kind)
27869 handle_origin_datatype = mpi_double_complex
27871 IF (
PRESENT(origin_datatype))
THEN
27872 handle_origin_datatype = origin_datatype%type_handle
27875 handle_target_datatype = mpi_double_complex
27877 IF (
PRESENT(target_datatype))
THEN
27878 handle_target_datatype = target_datatype%type_handle
27882 do_local_copy = .false.
27883 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
27884 IF (myproc .EQ. source) do_local_copy = .true.
27886 IF (do_local_copy)
THEN
27888 base(:) = win_data(disp_aint + 1:disp_aint + len)
27893 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
27894 target_len, handle_target_datatype, win%handle, request%handle, ierr)
27900 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
27902 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*(2*real_8_size))
27907 mark_used(origin_datatype)
27908 mark_used(target_datatype)
27912 IF (
PRESENT(disp))
THEN
27913 base(:) = win_data(disp + 1:disp +
SIZE(base))
27915 base(:) = win_data(:
SIZE(base))
27919 CALL mp_timestop(handle)
27920 END SUBROUTINE mp_rget_zv
27930 result(type_descriptor)
27931 INTEGER,
INTENT(IN) :: count
27932 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
27935 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_z'
27938#if defined(__parallel)
27942 CALL mp_timeset(routinen, handle)
27944#if defined(__parallel)
27945 CALL mpi_type_indexed(count, lengths, displs, mpi_double_complex, &
27946 type_descriptor%type_handle, ierr)
27948 cpabort(
"MPI_Type_Indexed @ "//routinen)
27949 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
27951 cpabort(
"MPI_Type_commit @ "//routinen)
27953 type_descriptor%type_handle = 7
27955 type_descriptor%length = count
27956 NULLIFY (type_descriptor%subtype)
27957 type_descriptor%vector_descriptor(1:2) = 1
27958 type_descriptor%has_indexing = .true.
27959 type_descriptor%index_descriptor%index => lengths
27960 type_descriptor%index_descriptor%chunks => displs
27962 CALL mp_timestop(handle)
27973 SUBROUTINE mp_allocate_z (DATA, len, stat)
27974 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
27975 INTEGER,
INTENT(IN) :: len
27976 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
27978 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_z'
27980 INTEGER :: handle, ierr
27982 CALL mp_timeset(routinen, handle)
27984#if defined(__parallel)
27986 CALL mp_alloc_mem(
DATA, len, stat=ierr)
27987 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
27988 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
27989 CALL add_perf(perf_id=15, count=1)
27991 ALLOCATE (
DATA(len), stat=ierr)
27992 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
27993 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
27995 IF (
PRESENT(stat)) stat = ierr
27996 CALL mp_timestop(handle)
27997 END SUBROUTINE mp_allocate_z
28005 SUBROUTINE mp_deallocate_z (DATA, stat)
28006 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
28007 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28009 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_z'
28012#if defined(__parallel)
28016 CALL mp_timeset(routinen, handle)
28018#if defined(__parallel)
28019 CALL mp_free_mem(
DATA, ierr)
28020 IF (
PRESENT(stat))
THEN
28023 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
28026 CALL add_perf(perf_id=15, count=1)
28029 IF (
PRESENT(stat)) stat = 0
28031 CALL mp_timestop(handle)
28032 END SUBROUTINE mp_deallocate_z
28045 SUBROUTINE mp_file_write_at_zv(fh, offset, msg, msglen)
28046 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
28048 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28049 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28052#if defined(__parallel)
28056 msg_len =
SIZE(msg)
28057 IF (
PRESENT(msglen)) msg_len = msglen
28058#if defined(__parallel)
28059 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28061 cpabort(
"mpi_file_write_at_zv @ mp_file_write_at_zv")
28063 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28065 END SUBROUTINE mp_file_write_at_zv
28073 SUBROUTINE mp_file_write_at_z (fh, offset, msg)
28074 COMPLEX(kind=real_8),
INTENT(IN) :: msg
28076 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28078#if defined(__parallel)
28082 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28084 cpabort(
"mpi_file_write_at_z @ mp_file_write_at_z")
28086 WRITE (unit=fh%handle, pos=offset + 1) msg
28088 END SUBROUTINE mp_file_write_at_z
28100 SUBROUTINE mp_file_write_at_all_zv(fh, offset, msg, msglen)
28101 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
28103 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28104 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28107#if defined(__parallel)
28111 msg_len =
SIZE(msg)
28112 IF (
PRESENT(msglen)) msg_len = msglen
28113#if defined(__parallel)
28114 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28116 cpabort(
"mpi_file_write_at_all_zv @ mp_file_write_at_all_zv")
28118 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28120 END SUBROUTINE mp_file_write_at_all_zv
28128 SUBROUTINE mp_file_write_at_all_z (fh, offset, msg)
28129 COMPLEX(kind=real_8),
INTENT(IN) :: msg
28131 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28133#if defined(__parallel)
28137 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28139 cpabort(
"mpi_file_write_at_all_z @ mp_file_write_at_all_z")
28141 WRITE (unit=fh%handle, pos=offset + 1) msg
28143 END SUBROUTINE mp_file_write_at_all_z
28156 SUBROUTINE mp_file_read_at_zv(fh, offset, msg, msglen)
28157 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
28159 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28160 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28163#if defined(__parallel)
28167 msg_len =
SIZE(msg)
28168 IF (
PRESENT(msglen)) msg_len = msglen
28169#if defined(__parallel)
28170 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28172 cpabort(
"mpi_file_read_at_zv @ mp_file_read_at_zv")
28174 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28176 END SUBROUTINE mp_file_read_at_zv
28184 SUBROUTINE mp_file_read_at_z (fh, offset, msg)
28185 COMPLEX(kind=real_8),
INTENT(OUT) :: msg
28187 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28189#if defined(__parallel)
28193 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28195 cpabort(
"mpi_file_read_at_z @ mp_file_read_at_z")
28197 READ (unit=fh%handle, pos=offset + 1) msg
28199 END SUBROUTINE mp_file_read_at_z
28211 SUBROUTINE mp_file_read_at_all_zv(fh, offset, msg, msglen)
28212 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
28214 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28215 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28218#if defined(__parallel)
28222 msg_len =
SIZE(msg)
28223 IF (
PRESENT(msglen)) msg_len = msglen
28224#if defined(__parallel)
28225 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28227 cpabort(
"mpi_file_read_at_all_zv @ mp_file_read_at_all_zv")
28229 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28231 END SUBROUTINE mp_file_read_at_all_zv
28239 SUBROUTINE mp_file_read_at_all_z (fh, offset, msg)
28240 COMPLEX(kind=real_8),
INTENT(OUT) :: msg
28242 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28244#if defined(__parallel)
28248 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28250 cpabort(
"mpi_file_read_at_all_z @ mp_file_read_at_all_z")
28252 READ (unit=fh%handle, pos=offset + 1) msg
28254 END SUBROUTINE mp_file_read_at_all_z
28263 FUNCTION mp_type_make_z (ptr, &
28264 vector_descriptor, index_descriptor) &
28265 result(type_descriptor)
28266 COMPLEX(kind=real_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
28267 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
28268 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
28271 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_z'
28273#if defined(__parallel)
28275#if defined(__MPI_F08)
28277 EXTERNAL :: mpi_get_address
28281 NULLIFY (type_descriptor%subtype)
28282 type_descriptor%length =
SIZE(ptr)
28283#if defined(__parallel)
28284 type_descriptor%type_handle = mpi_double_complex
28285 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
28287 cpabort(
"MPI_Get_address @ "//routinen)
28289 type_descriptor%type_handle = 7
28291 type_descriptor%vector_descriptor(1:2) = 1
28292 type_descriptor%has_indexing = .false.
28293 type_descriptor%data_z => ptr
28294 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
28295 cpabort(routinen//
": Vectors and indices NYI")
28297 END FUNCTION mp_type_make_z
28306 SUBROUTINE mp_alloc_mem_z (DATA, len, stat)
28307 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
28308 INTEGER,
INTENT(IN) :: len
28309 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28311#if defined(__parallel)
28312 INTEGER :: size, ierr, length, &
28314 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
28315 TYPE(c_ptr) :: mp_baseptr
28316 mpi_info_type :: mp_info
28318 length = max(len, 1)
28319 CALL mpi_type_size(mpi_double_complex,
size, ierr)
28320 mp_size = int(length, kind=mpi_address_kind)*
size
28321 IF (mp_size .GT. mp_max_memory_size)
THEN
28322 cpabort(
"MPI cannot allocate more than 2 GiByte")
28324 mp_info = mpi_info_null
28325 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
28326 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
28327 IF (
PRESENT(stat)) stat = mp_res
28329 INTEGER :: length, mystat
28330 length = max(len, 1)
28331 IF (
PRESENT(stat))
THEN
28332 ALLOCATE (
DATA(length), stat=mystat)
28335 ALLOCATE (
DATA(length))
28338 END SUBROUTINE mp_alloc_mem_z
28346 SUBROUTINE mp_free_mem_z (DATA, stat)
28347 COMPLEX(kind=real_8),
DIMENSION(:), &
28348 POINTER, asynchronous :: data
28349 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28351#if defined(__parallel)
28353 CALL mpi_free_mem(
DATA, mp_res)
28354 IF (
PRESENT(stat)) stat = mp_res
28357 IF (
PRESENT(stat)) stat = 0
28359 END SUBROUTINE mp_free_mem_z
28371 SUBROUTINE mp_shift_cm(msg, comm, displ_in)
28373 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
28375 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
28377 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_cm'
28379 INTEGER :: handle, ierror
28380#if defined(__parallel)
28381 INTEGER :: displ, left, &
28382 msglen, myrank, nprocs, &
28387 CALL mp_timeset(routinen, handle)
28389#if defined(__parallel)
28390 CALL mpi_comm_rank(comm%handle, myrank, ierror)
28391 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
28392 CALL mpi_comm_size(comm%handle, nprocs, ierror)
28393 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
28394 IF (
PRESENT(displ_in))
THEN
28399 right =
modulo(myrank + displ, nprocs)
28400 left =
modulo(myrank - displ, nprocs)
28403 CALL mpi_sendrecv_replace(msg, msglen, mpi_complex, right, tag, left, tag, &
28404 comm%handle, mpi_status_ignore, ierror)
28405 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
28406 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_4_size))
28410 mark_used(displ_in)
28412 CALL mp_timestop(handle)
28414 END SUBROUTINE mp_shift_cm
28427 SUBROUTINE mp_shift_c (msg, comm, displ_in)
28429 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
28431 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
28433 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_c'
28435 INTEGER :: handle, ierror
28436#if defined(__parallel)
28437 INTEGER :: displ, left, &
28438 msglen, myrank, nprocs, &
28443 CALL mp_timeset(routinen, handle)
28445#if defined(__parallel)
28446 CALL mpi_comm_rank(comm%handle, myrank, ierror)
28447 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
28448 CALL mpi_comm_size(comm%handle, nprocs, ierror)
28449 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
28450 IF (
PRESENT(displ_in))
THEN
28455 right =
modulo(myrank + displ, nprocs)
28456 left =
modulo(myrank - displ, nprocs)
28459 CALL mpi_sendrecv_replace(msg, msglen, mpi_complex, right, tag, left, &
28460 tag, comm%handle, mpi_status_ignore, ierror)
28461 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
28462 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_4_size))
28466 mark_used(displ_in)
28468 CALL mp_timestop(handle)
28470 END SUBROUTINE mp_shift_c
28491 SUBROUTINE mp_alltoall_c11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
28493 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
28494 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
28495 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
28496 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
28499 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c11v'
28502#if defined(__parallel)
28503 INTEGER :: ierr, msglen
28508 CALL mp_timeset(routinen, handle)
28510#if defined(__parallel)
28511 CALL mpi_alltoallv(sb, scount, sdispl, mpi_complex, &
28512 rb, rcount, rdispl, mpi_complex, comm%handle, ierr)
28513 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
28514 msglen = sum(scount) + sum(rcount)
28515 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28521 DO i = 1, rcount(1)
28522 rb(rdispl(1) + i) = sb(sdispl(1) + i)
28525 CALL mp_timestop(handle)
28527 END SUBROUTINE mp_alltoall_c11v
28542 SUBROUTINE mp_alltoall_c22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
28544 COMPLEX(kind=real_4),
DIMENSION(:, :), &
28545 INTENT(IN),
CONTIGUOUS :: sb
28546 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
28547 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS, &
28548 INTENT(INOUT) :: rb
28549 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
28552 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c22v'
28555#if defined(__parallel)
28556 INTEGER :: ierr, msglen
28559 CALL mp_timeset(routinen, handle)
28561#if defined(__parallel)
28562 CALL mpi_alltoallv(sb, scount, sdispl, mpi_complex, &
28563 rb, rcount, rdispl, mpi_complex, comm%handle, ierr)
28564 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
28565 msglen = sum(scount) + sum(rcount)
28566 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*(2*real_4_size))
28575 CALL mp_timestop(handle)
28577 END SUBROUTINE mp_alltoall_c22v
28594 SUBROUTINE mp_alltoall_c (sb, rb, count, comm)
28596 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
28597 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
28598 INTEGER,
INTENT(IN) :: count
28601 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c'
28604#if defined(__parallel)
28605 INTEGER :: ierr, msglen, np
28608 CALL mp_timeset(routinen, handle)
28610#if defined(__parallel)
28611 CALL mpi_alltoall(sb, count, mpi_complex, &
28612 rb, count, mpi_complex, comm%handle, ierr)
28613 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28614 CALL mpi_comm_size(comm%handle, np, ierr)
28615 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28616 msglen = 2*count*np
28617 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28623 CALL mp_timestop(handle)
28625 END SUBROUTINE mp_alltoall_c
28635 SUBROUTINE mp_alltoall_c22(sb, rb, count, comm)
28637 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
28638 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
28639 INTEGER,
INTENT(IN) :: count
28642 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c22'
28645#if defined(__parallel)
28646 INTEGER :: ierr, msglen, np
28649 CALL mp_timeset(routinen, handle)
28651#if defined(__parallel)
28652 CALL mpi_alltoall(sb, count, mpi_complex, &
28653 rb, count, mpi_complex, comm%handle, ierr)
28654 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28655 CALL mpi_comm_size(comm%handle, np, ierr)
28656 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28657 msglen = 2*
SIZE(sb)*np
28658 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28664 CALL mp_timestop(handle)
28666 END SUBROUTINE mp_alltoall_c22
28676 SUBROUTINE mp_alltoall_c33(sb, rb, count, comm)
28678 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
28679 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
28680 INTEGER,
INTENT(IN) :: count
28683 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c33'
28686#if defined(__parallel)
28687 INTEGER :: ierr, msglen, np
28690 CALL mp_timeset(routinen, handle)
28692#if defined(__parallel)
28693 CALL mpi_alltoall(sb, count, mpi_complex, &
28694 rb, count, mpi_complex, comm%handle, ierr)
28695 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28696 CALL mpi_comm_size(comm%handle, np, ierr)
28697 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28698 msglen = 2*count*np
28699 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28705 CALL mp_timestop(handle)
28707 END SUBROUTINE mp_alltoall_c33
28717 SUBROUTINE mp_alltoall_c44(sb, rb, count, comm)
28719 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28721 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28723 INTEGER,
INTENT(IN) :: count
28726 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c44'
28729#if defined(__parallel)
28730 INTEGER :: ierr, msglen, np
28733 CALL mp_timeset(routinen, handle)
28735#if defined(__parallel)
28736 CALL mpi_alltoall(sb, count, mpi_complex, &
28737 rb, count, mpi_complex, comm%handle, ierr)
28738 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28739 CALL mpi_comm_size(comm%handle, np, ierr)
28740 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28741 msglen = 2*count*np
28742 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28748 CALL mp_timestop(handle)
28750 END SUBROUTINE mp_alltoall_c44
28760 SUBROUTINE mp_alltoall_c55(sb, rb, count, comm)
28762 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
28764 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
28766 INTEGER,
INTENT(IN) :: count
28769 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c55'
28772#if defined(__parallel)
28773 INTEGER :: ierr, msglen, np
28776 CALL mp_timeset(routinen, handle)
28778#if defined(__parallel)
28779 CALL mpi_alltoall(sb, count, mpi_complex, &
28780 rb, count, mpi_complex, comm%handle, ierr)
28781 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28782 CALL mpi_comm_size(comm%handle, np, ierr)
28783 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28784 msglen = 2*count*np
28785 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28791 CALL mp_timestop(handle)
28793 END SUBROUTINE mp_alltoall_c55
28804 SUBROUTINE mp_alltoall_c45(sb, rb, count, comm)
28806 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28808 COMPLEX(kind=real_4), &
28809 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
28810 INTEGER,
INTENT(IN) :: count
28813 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c45'
28816#if defined(__parallel)
28817 INTEGER :: ierr, msglen, np
28820 CALL mp_timeset(routinen, handle)
28822#if defined(__parallel)
28823 CALL mpi_alltoall(sb, count, mpi_complex, &
28824 rb, count, mpi_complex, comm%handle, ierr)
28825 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28826 CALL mpi_comm_size(comm%handle, np, ierr)
28827 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28828 msglen = 2*count*np
28829 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28833 rb = reshape(sb, shape(rb))
28835 CALL mp_timestop(handle)
28837 END SUBROUTINE mp_alltoall_c45
28848 SUBROUTINE mp_alltoall_c34(sb, rb, count, comm)
28850 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
28852 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28854 INTEGER,
INTENT(IN) :: count
28857 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c34'
28860#if defined(__parallel)
28861 INTEGER :: ierr, msglen, np
28864 CALL mp_timeset(routinen, handle)
28866#if defined(__parallel)
28867 CALL mpi_alltoall(sb, count, mpi_complex, &
28868 rb, count, mpi_complex, comm%handle, ierr)
28869 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28870 CALL mpi_comm_size(comm%handle, np, ierr)
28871 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28872 msglen = 2*count*np
28873 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28877 rb = reshape(sb, shape(rb))
28879 CALL mp_timestop(handle)
28881 END SUBROUTINE mp_alltoall_c34
28892 SUBROUTINE mp_alltoall_c54(sb, rb, count, comm)
28894 COMPLEX(kind=real_4), &
28895 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
28896 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28898 INTEGER,
INTENT(IN) :: count
28901 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c54'
28904#if defined(__parallel)
28905 INTEGER :: ierr, msglen, np
28908 CALL mp_timeset(routinen, handle)
28910#if defined(__parallel)
28911 CALL mpi_alltoall(sb, count, mpi_complex, &
28912 rb, count, mpi_complex, comm%handle, ierr)
28913 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28914 CALL mpi_comm_size(comm%handle, np, ierr)
28915 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28916 msglen = 2*count*np
28917 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28921 rb = reshape(sb, shape(rb))
28923 CALL mp_timestop(handle)
28925 END SUBROUTINE mp_alltoall_c54
28936 SUBROUTINE mp_send_c (msg, dest, tag, comm)
28937 COMPLEX(kind=real_4),
INTENT(IN) :: msg
28938 INTEGER,
INTENT(IN) :: dest, tag
28941 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_c'
28944#if defined(__parallel)
28945 INTEGER :: ierr, msglen
28948 CALL mp_timeset(routinen, handle)
28950#if defined(__parallel)
28952 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
28953 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
28954 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
28961 cpabort(
"not in parallel mode")
28963 CALL mp_timestop(handle)
28964 END SUBROUTINE mp_send_c
28974 SUBROUTINE mp_send_cv(msg, dest, tag, comm)
28975 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
28976 INTEGER,
INTENT(IN) :: dest, tag
28979 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_cv'
28982#if defined(__parallel)
28983 INTEGER :: ierr, msglen
28986 CALL mp_timeset(routinen, handle)
28988#if defined(__parallel)
28990 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
28991 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
28992 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
28999 cpabort(
"not in parallel mode")
29001 CALL mp_timestop(handle)
29002 END SUBROUTINE mp_send_cv
29012 SUBROUTINE mp_send_cm2(msg, dest, tag, comm)
29013 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
29014 INTEGER,
INTENT(IN) :: dest, tag
29017 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_cm2'
29020#if defined(__parallel)
29021 INTEGER :: ierr, msglen
29024 CALL mp_timeset(routinen, handle)
29026#if defined(__parallel)
29028 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29029 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29030 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29037 cpabort(
"not in parallel mode")
29039 CALL mp_timestop(handle)
29040 END SUBROUTINE mp_send_cm2
29050 SUBROUTINE mp_send_cm3(msg, dest, tag, comm)
29051 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
29052 INTEGER,
INTENT(IN) :: dest, tag
29055 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
29058#if defined(__parallel)
29059 INTEGER :: ierr, msglen
29062 CALL mp_timeset(routinen, handle)
29064#if defined(__parallel)
29066 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29067 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29068 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29075 cpabort(
"not in parallel mode")
29077 CALL mp_timestop(handle)
29078 END SUBROUTINE mp_send_cm3
29089 SUBROUTINE mp_recv_c (msg, source, tag, comm)
29090 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29091 INTEGER,
INTENT(INOUT) :: source, tag
29094 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_c'
29097#if defined(__parallel)
29098 INTEGER :: ierr, msglen
29099 mpi_status_type :: status
29102 CALL mp_timeset(routinen, handle)
29104#if defined(__parallel)
29107 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29108 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29110 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29111 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29112 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29113 source = status mpi_status_extract(mpi_source)
29114 tag = status mpi_status_extract(mpi_tag)
29122 cpabort(
"not in parallel mode")
29124 CALL mp_timestop(handle)
29125 END SUBROUTINE mp_recv_c
29135 SUBROUTINE mp_recv_cv(msg, source, tag, comm)
29136 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29137 INTEGER,
INTENT(INOUT) :: source, tag
29140 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cv'
29143#if defined(__parallel)
29144 INTEGER :: ierr, msglen
29145 mpi_status_type :: status
29148 CALL mp_timeset(routinen, handle)
29150#if defined(__parallel)
29153 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29154 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29156 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29157 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29158 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29159 source = status mpi_status_extract(mpi_source)
29160 tag = status mpi_status_extract(mpi_tag)
29168 cpabort(
"not in parallel mode")
29170 CALL mp_timestop(handle)
29171 END SUBROUTINE mp_recv_cv
29181 SUBROUTINE mp_recv_cm2(msg, source, tag, comm)
29182 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29183 INTEGER,
INTENT(INOUT) :: source, tag
29186 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cm2'
29189#if defined(__parallel)
29190 INTEGER :: ierr, msglen
29191 mpi_status_type :: status
29194 CALL mp_timeset(routinen, handle)
29196#if defined(__parallel)
29199 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29200 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29202 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29203 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29204 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29205 source = status mpi_status_extract(mpi_source)
29206 tag = status mpi_status_extract(mpi_tag)
29214 cpabort(
"not in parallel mode")
29216 CALL mp_timestop(handle)
29217 END SUBROUTINE mp_recv_cm2
29227 SUBROUTINE mp_recv_cm3(msg, source, tag, comm)
29228 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
29229 INTEGER,
INTENT(INOUT) :: source, tag
29232 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cm3'
29235#if defined(__parallel)
29236 INTEGER :: ierr, msglen
29237 mpi_status_type :: status
29240 CALL mp_timeset(routinen, handle)
29242#if defined(__parallel)
29245 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29246 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29248 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29249 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29250 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29251 source = status mpi_status_extract(mpi_source)
29252 tag = status mpi_status_extract(mpi_tag)
29260 cpabort(
"not in parallel mode")
29262 CALL mp_timestop(handle)
29263 END SUBROUTINE mp_recv_cm3
29273 SUBROUTINE mp_bcast_c (msg, source, comm)
29274 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29275 INTEGER,
INTENT(IN) :: source
29278 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c'
29281#if defined(__parallel)
29282 INTEGER :: ierr, msglen
29285 CALL mp_timeset(routinen, handle)
29287#if defined(__parallel)
29289 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29290 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29291 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29297 CALL mp_timestop(handle)
29298 END SUBROUTINE mp_bcast_c
29307 SUBROUTINE mp_bcast_c_src(msg, comm)
29308 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29311 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c_src'
29314#if defined(__parallel)
29315 INTEGER :: ierr, msglen
29318 CALL mp_timeset(routinen, handle)
29320#if defined(__parallel)
29322 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29323 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29324 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29329 CALL mp_timestop(handle)
29330 END SUBROUTINE mp_bcast_c_src
29340 SUBROUTINE mp_ibcast_c (msg, source, comm, request)
29341 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29342 INTEGER,
INTENT(IN) :: source
29346 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_c'
29349#if defined(__parallel)
29350 INTEGER :: ierr, msglen
29353 CALL mp_timeset(routinen, handle)
29355#if defined(__parallel)
29357 CALL mpi_ibcast(msg, msglen, mpi_complex, source, comm%handle, request%handle, ierr)
29358 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
29359 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_4_size))
29366 CALL mp_timestop(handle)
29367 END SUBROUTINE mp_ibcast_c
29376 SUBROUTINE mp_bcast_cv(msg, source, comm)
29377 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29378 INTEGER,
INTENT(IN) :: source
29381 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cv'
29384#if defined(__parallel)
29385 INTEGER :: ierr, msglen
29388 CALL mp_timeset(routinen, handle)
29390#if defined(__parallel)
29392 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29393 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29394 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29400 CALL mp_timestop(handle)
29401 END SUBROUTINE mp_bcast_cv
29409 SUBROUTINE mp_bcast_cv_src(msg, comm)
29410 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29413 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cv_src'
29416#if defined(__parallel)
29417 INTEGER :: ierr, msglen
29420 CALL mp_timeset(routinen, handle)
29422#if defined(__parallel)
29424 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29425 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29426 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29431 CALL mp_timestop(handle)
29432 END SUBROUTINE mp_bcast_cv_src
29441 SUBROUTINE mp_ibcast_cv(msg, source, comm, request)
29442 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
29443 INTEGER,
INTENT(IN) :: source
29447 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_cv'
29450#if defined(__parallel)
29451 INTEGER :: ierr, msglen
29454 CALL mp_timeset(routinen, handle)
29456#if defined(__parallel)
29457#if !defined(__GNUC__) || __GNUC__ >= 9
29458 cpassert(is_contiguous(msg))
29461 CALL mpi_ibcast(msg, msglen, mpi_complex, source, comm%handle, request%handle, ierr)
29462 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
29463 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_4_size))
29470 CALL mp_timestop(handle)
29471 END SUBROUTINE mp_ibcast_cv
29480 SUBROUTINE mp_bcast_cm(msg, source, comm)
29481 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29482 INTEGER,
INTENT(IN) :: source
29485 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cm'
29488#if defined(__parallel)
29489 INTEGER :: ierr, msglen
29492 CALL mp_timeset(routinen, handle)
29494#if defined(__parallel)
29496 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29497 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29498 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29504 CALL mp_timestop(handle)
29505 END SUBROUTINE mp_bcast_cm
29514 SUBROUTINE mp_bcast_cm_src(msg, comm)
29515 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29518 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cm_src'
29521#if defined(__parallel)
29522 INTEGER :: ierr, msglen
29525 CALL mp_timeset(routinen, handle)
29527#if defined(__parallel)
29529 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29530 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29531 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29536 CALL mp_timestop(handle)
29537 END SUBROUTINE mp_bcast_cm_src
29546 SUBROUTINE mp_bcast_c3(msg, source, comm)
29547 COMPLEX(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
29548 INTEGER,
INTENT(IN) :: source
29551 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c3'
29554#if defined(__parallel)
29555 INTEGER :: ierr, msglen
29558 CALL mp_timeset(routinen, handle)
29560#if defined(__parallel)
29562 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29563 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29564 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29570 CALL mp_timestop(handle)
29571 END SUBROUTINE mp_bcast_c3
29580 SUBROUTINE mp_bcast_c3_src(msg, comm)
29581 COMPLEX(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
29584 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c3_src'
29587#if defined(__parallel)
29588 INTEGER :: ierr, msglen
29591 CALL mp_timeset(routinen, handle)
29593#if defined(__parallel)
29595 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29596 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29597 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29602 CALL mp_timestop(handle)
29603 END SUBROUTINE mp_bcast_c3_src
29612 SUBROUTINE mp_sum_c (msg, comm)
29613 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29616 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_c'
29619#if defined(__parallel)
29620 INTEGER :: ierr, msglen
29623 CALL mp_timeset(routinen, handle)
29625#if defined(__parallel)
29627 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29628 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29629 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29634 CALL mp_timestop(handle)
29635 END SUBROUTINE mp_sum_c
29643 SUBROUTINE mp_sum_cv(msg, comm)
29644 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29647 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cv'
29650#if defined(__parallel)
29651 INTEGER :: ierr, msglen
29654 CALL mp_timeset(routinen, handle)
29656#if defined(__parallel)
29658 IF (msglen > 0)
THEN
29659 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29660 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29662 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29667 CALL mp_timestop(handle)
29668 END SUBROUTINE mp_sum_cv
29676 SUBROUTINE mp_isum_cv(msg, comm, request)
29677 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
29681 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_cv'
29684#if defined(__parallel)
29685 INTEGER :: ierr, msglen
29688 CALL mp_timeset(routinen, handle)
29690#if defined(__parallel)
29691#if !defined(__GNUC__) || __GNUC__ >= 9
29692 cpassert(is_contiguous(msg))
29695 IF (msglen > 0)
THEN
29696 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, request%handle, ierr)
29697 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
29701 CALL add_perf(perf_id=23, count=1, msg_size=msglen*(2*real_4_size))
29707 CALL mp_timestop(handle)
29708 END SUBROUTINE mp_isum_cv
29716 SUBROUTINE mp_sum_cm(msg, comm)
29717 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29720 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm'
29723#if defined(__parallel)
29724 INTEGER,
PARAMETER :: max_msg = 2**25
29725 INTEGER :: ierr, m1, msglen, step, msglensum
29728 CALL mp_timeset(routinen, handle)
29730#if defined(__parallel)
29732 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
29734 DO m1 = lbound(msg, 2), ubound(msg, 2), step
29735 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
29736 msglensum = msglensum + msglen
29737 IF (msglen > 0)
THEN
29738 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29739 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29742 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_4_size))
29747 CALL mp_timestop(handle)
29748 END SUBROUTINE mp_sum_cm
29756 SUBROUTINE mp_sum_cm3(msg, comm)
29757 COMPLEX(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
29760 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm3'
29763#if defined(__parallel)
29764 INTEGER :: ierr, msglen
29767 CALL mp_timeset(routinen, handle)
29769#if defined(__parallel)
29771 IF (msglen > 0)
THEN
29772 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29773 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29775 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29780 CALL mp_timestop(handle)
29781 END SUBROUTINE mp_sum_cm3
29789 SUBROUTINE mp_sum_cm4(msg, comm)
29790 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
29793 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm4'
29796#if defined(__parallel)
29797 INTEGER :: ierr, msglen
29800 CALL mp_timeset(routinen, handle)
29802#if defined(__parallel)
29804 IF (msglen > 0)
THEN
29805 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29806 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29808 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29813 CALL mp_timestop(handle)
29814 END SUBROUTINE mp_sum_cm4
29826 SUBROUTINE mp_sum_root_cv(msg, root, comm)
29827 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29828 INTEGER,
INTENT(IN) :: root
29831 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_cv'
29834#if defined(__parallel)
29835 INTEGER :: ierr, m1, msglen, taskid
29836 COMPLEX(kind=real_4),
ALLOCATABLE :: res(:)
29839 CALL mp_timeset(routinen, handle)
29841#if defined(__parallel)
29843 CALL mpi_comm_rank(comm%handle, taskid, ierr)
29844 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
29845 IF (msglen > 0)
THEN
29848 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_sum, &
29849 root, comm%handle, ierr)
29850 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
29851 IF (taskid == root)
THEN
29856 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29862 CALL mp_timestop(handle)
29863 END SUBROUTINE mp_sum_root_cv
29874 SUBROUTINE mp_sum_root_cm(msg, root, comm)
29875 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29876 INTEGER,
INTENT(IN) :: root
29879 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
29882#if defined(__parallel)
29883 INTEGER :: ierr, m1, m2, msglen, taskid
29884 COMPLEX(kind=real_4),
ALLOCATABLE :: res(:, :)
29887 CALL mp_timeset(routinen, handle)
29889#if defined(__parallel)
29891 CALL mpi_comm_rank(comm%handle, taskid, ierr)
29892 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
29893 IF (msglen > 0)
THEN
29896 ALLOCATE (res(m1, m2))
29897 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_sum, root, comm%handle, ierr)
29898 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
29899 IF (taskid == root)
THEN
29904 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29910 CALL mp_timestop(handle)
29911 END SUBROUTINE mp_sum_root_cm
29919 SUBROUTINE mp_sum_partial_cm(msg, res, comm)
29920 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
29921 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
29924 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_cm'
29927#if defined(__parallel)
29928 INTEGER :: ierr, msglen, taskid
29931 CALL mp_timeset(routinen, handle)
29933#if defined(__parallel)
29935 CALL mpi_comm_rank(comm%handle, taskid, ierr)
29936 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
29937 IF (msglen > 0)
THEN
29938 CALL mpi_scan(msg, res, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29939 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
29941 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29947 CALL mp_timestop(handle)
29948 END SUBROUTINE mp_sum_partial_cm
29958 SUBROUTINE mp_max_c (msg, comm)
29959 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29962 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_c'
29965#if defined(__parallel)
29966 INTEGER :: ierr, msglen
29969 CALL mp_timeset(routinen, handle)
29971#if defined(__parallel)
29973 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_max, comm%handle, ierr)
29974 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29975 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29980 CALL mp_timestop(handle)
29981 END SUBROUTINE mp_max_c
29991 SUBROUTINE mp_max_root_c (msg, root, comm)
29992 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29993 INTEGER,
INTENT(IN) :: root
29996 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_c'
29999#if defined(__parallel)
30000 INTEGER :: ierr, msglen
30001 COMPLEX(kind=real_4) :: res
30004 CALL mp_timeset(routinen, handle)
30006#if defined(__parallel)
30008 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_max, root, comm%handle, ierr)
30009 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
30010 IF (root == comm%mepos) msg = res
30011 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30017 CALL mp_timestop(handle)
30018 END SUBROUTINE mp_max_root_c
30028 SUBROUTINE mp_max_cv(msg, comm)
30029 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
30032 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_cv'
30035#if defined(__parallel)
30036 INTEGER :: ierr, msglen
30039 CALL mp_timeset(routinen, handle)
30041#if defined(__parallel)
30043 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_max, comm%handle, ierr)
30044 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30045 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30050 CALL mp_timestop(handle)
30051 END SUBROUTINE mp_max_cv
30061 SUBROUTINE mp_max_root_cm(msg, root, comm)
30062 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30066 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_cm'
30069#if defined(__parallel)
30070 INTEGER :: ierr, msglen
30071 COMPLEX(kind=real_4) :: res(size(msg, 1), size(msg, 2))
30074 CALL mp_timeset(routinen, handle)
30076#if defined(__parallel)
30078 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_max, root, comm%handle, ierr)
30079 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30080 IF (root == comm%mepos) msg = res
30081 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30087 CALL mp_timestop(handle)
30088 END SUBROUTINE mp_max_root_cm
30098 SUBROUTINE mp_min_c (msg, comm)
30099 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30102 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_c'
30105#if defined(__parallel)
30106 INTEGER :: ierr, msglen
30109 CALL mp_timeset(routinen, handle)
30111#if defined(__parallel)
30113 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_min, comm%handle, ierr)
30114 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30115 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30120 CALL mp_timestop(handle)
30121 END SUBROUTINE mp_min_c
30133 SUBROUTINE mp_min_cv(msg, comm)
30134 COMPLEX(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
30137 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_cv'
30140#if defined(__parallel)
30141 INTEGER :: ierr, msglen
30144 CALL mp_timeset(routinen, handle)
30146#if defined(__parallel)
30148 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_min, comm%handle, ierr)
30149 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30150 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30155 CALL mp_timestop(handle)
30156 END SUBROUTINE mp_min_cv
30166 SUBROUTINE mp_prod_c (msg, comm)
30167 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30170 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_c'
30173#if defined(__parallel)
30174 INTEGER :: ierr, msglen
30177 CALL mp_timeset(routinen, handle)
30179#if defined(__parallel)
30181 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_prod, comm%handle, ierr)
30182 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30183 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30188 CALL mp_timestop(handle)
30189 END SUBROUTINE mp_prod_c
30200 SUBROUTINE mp_scatter_cv(msg_scatter, msg, root, comm)
30201 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
30202 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
30203 INTEGER,
INTENT(IN) :: root
30206 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_cv'
30209#if defined(__parallel)
30210 INTEGER :: ierr, msglen
30213 CALL mp_timeset(routinen, handle)
30215#if defined(__parallel)
30217 CALL mpi_scatter(msg_scatter, msglen, mpi_complex, msg, &
30218 msglen, mpi_complex, root, comm%handle, ierr)
30219 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
30220 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30226 CALL mp_timestop(handle)
30227 END SUBROUTINE mp_scatter_cv
30237 SUBROUTINE mp_iscatter_c (msg_scatter, msg, root, comm, request)
30238 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:)
30239 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30240 INTEGER,
INTENT(IN) :: root
30244 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_c'
30247#if defined(__parallel)
30248 INTEGER :: ierr, msglen
30251 CALL mp_timeset(routinen, handle)
30253#if defined(__parallel)
30254#if !defined(__GNUC__) || __GNUC__ >= 9
30255 cpassert(is_contiguous(msg_scatter))
30258 CALL mpi_iscatter(msg_scatter, msglen, mpi_complex, msg, &
30259 msglen, mpi_complex, root, comm%handle, request%handle, ierr)
30260 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
30261 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
30265 msg = msg_scatter(1)
30268 CALL mp_timestop(handle)
30269 END SUBROUTINE mp_iscatter_c
30279 SUBROUTINE mp_iscatter_cv2(msg_scatter, msg, root, comm, request)
30280 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:, :)
30281 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
30282 INTEGER,
INTENT(IN) :: root
30286 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_cv2'
30289#if defined(__parallel)
30290 INTEGER :: ierr, msglen
30293 CALL mp_timeset(routinen, handle)
30295#if defined(__parallel)
30296#if !defined(__GNUC__) || __GNUC__ >= 9
30297 cpassert(is_contiguous(msg_scatter))
30300 CALL mpi_iscatter(msg_scatter, msglen, mpi_complex, msg, &
30301 msglen, mpi_complex, root, comm%handle, request%handle, ierr)
30302 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
30303 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
30307 msg(:) = msg_scatter(:, 1)
30310 CALL mp_timestop(handle)
30311 END SUBROUTINE mp_iscatter_cv2
30321 SUBROUTINE mp_iscatterv_cv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
30322 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:)
30323 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
30324 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
30325 INTEGER,
INTENT(IN) :: recvcount, root
30329 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_cv'
30332#if defined(__parallel)
30336 CALL mp_timeset(routinen, handle)
30338#if defined(__parallel)
30339#if !defined(__GNUC__) || __GNUC__ >= 9
30340 cpassert(is_contiguous(msg_scatter))
30341 cpassert(is_contiguous(msg))
30342 cpassert(is_contiguous(sendcounts))
30343 cpassert(is_contiguous(displs))
30345 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_complex, msg, &
30346 recvcount, mpi_complex, root, comm%handle, request%handle, ierr)
30347 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
30348 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
30350 mark_used(sendcounts)
30352 mark_used(recvcount)
30355 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
30358 CALL mp_timestop(handle)
30359 END SUBROUTINE mp_iscatterv_cv
30370 SUBROUTINE mp_gather_c (msg, msg_gather, root, comm)
30371 COMPLEX(kind=real_4),
INTENT(IN) :: msg
30372 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30373 INTEGER,
INTENT(IN) :: root
30376 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_c'
30379#if defined(__parallel)
30380 INTEGER :: ierr, msglen
30383 CALL mp_timeset(routinen, handle)
30385#if defined(__parallel)
30387 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30388 msglen, mpi_complex, root, comm%handle, ierr)
30389 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30390 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30394 msg_gather(1) = msg
30396 CALL mp_timestop(handle)
30397 END SUBROUTINE mp_gather_c
30407 SUBROUTINE mp_gather_c_src(msg, msg_gather, comm)
30408 COMPLEX(kind=real_4),
INTENT(IN) :: msg
30409 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30412 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_c_src'
30415#if defined(__parallel)
30416 INTEGER :: ierr, msglen
30419 CALL mp_timeset(routinen, handle)
30421#if defined(__parallel)
30423 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30424 msglen, mpi_complex, comm%source, comm%handle, ierr)
30425 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30426 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30429 msg_gather(1) = msg
30431 CALL mp_timestop(handle)
30432 END SUBROUTINE mp_gather_c_src
30446 SUBROUTINE mp_gather_cv(msg, msg_gather, root, comm)
30447 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
30448 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30449 INTEGER,
INTENT(IN) :: root
30452 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cv'
30455#if defined(__parallel)
30456 INTEGER :: ierr, msglen
30459 CALL mp_timeset(routinen, handle)
30461#if defined(__parallel)
30463 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30464 msglen, mpi_complex, root, comm%handle, ierr)
30465 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30466 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30472 CALL mp_timestop(handle)
30473 END SUBROUTINE mp_gather_cv
30486 SUBROUTINE mp_gather_cv_src(msg, msg_gather, comm)
30487 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
30488 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30491 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cv_src'
30494#if defined(__parallel)
30495 INTEGER :: ierr, msglen
30498 CALL mp_timeset(routinen, handle)
30500#if defined(__parallel)
30502 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30503 msglen, mpi_complex, comm%source, comm%handle, ierr)
30504 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30505 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30510 CALL mp_timestop(handle)
30511 END SUBROUTINE mp_gather_cv_src
30525 SUBROUTINE mp_gather_cm(msg, msg_gather, root, comm)
30526 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
30527 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
30528 INTEGER,
INTENT(IN) :: root
30531 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cm'
30534#if defined(__parallel)
30535 INTEGER :: ierr, msglen
30538 CALL mp_timeset(routinen, handle)
30540#if defined(__parallel)
30542 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30543 msglen, mpi_complex, root, comm%handle, ierr)
30544 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30545 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30551 CALL mp_timestop(handle)
30552 END SUBROUTINE mp_gather_cm
30565 SUBROUTINE mp_gather_cm_src(msg, msg_gather, comm)
30566 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
30567 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
30570 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cm_src'
30573#if defined(__parallel)
30574 INTEGER :: ierr, msglen
30577 CALL mp_timeset(routinen, handle)
30579#if defined(__parallel)
30581 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30582 msglen, mpi_complex, comm%source, comm%handle, ierr)
30583 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30584 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30589 CALL mp_timestop(handle)
30590 END SUBROUTINE mp_gather_cm_src
30607 SUBROUTINE mp_gatherv_cv(sendbuf, recvbuf, recvcounts, displs, root, comm)
30609 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30610 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30611 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30612 INTEGER,
INTENT(IN) :: root
30615 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cv'
30618#if defined(__parallel)
30619 INTEGER :: ierr, sendcount
30622 CALL mp_timeset(routinen, handle)
30624#if defined(__parallel)
30625 sendcount =
SIZE(sendbuf)
30626 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30627 recvbuf, recvcounts, displs, mpi_complex, &
30628 root, comm%handle, ierr)
30629 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30630 CALL add_perf(perf_id=4, &
30632 msg_size=sendcount*(2*real_4_size))
30634 mark_used(recvcounts)
30637 recvbuf(1 + displs(1):) = sendbuf
30639 CALL mp_timestop(handle)
30640 END SUBROUTINE mp_gatherv_cv
30656 SUBROUTINE mp_gatherv_cv_src(sendbuf, recvbuf, recvcounts, displs, comm)
30658 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30659 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30660 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30663 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cv_src'
30666#if defined(__parallel)
30667 INTEGER :: ierr, sendcount
30670 CALL mp_timeset(routinen, handle)
30672#if defined(__parallel)
30673 sendcount =
SIZE(sendbuf)
30674 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30675 recvbuf, recvcounts, displs, mpi_complex, &
30676 comm%source, comm%handle, ierr)
30677 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30678 CALL add_perf(perf_id=4, &
30680 msg_size=sendcount*(2*real_4_size))
30682 mark_used(recvcounts)
30684 recvbuf(1 + displs(1):) = sendbuf
30686 CALL mp_timestop(handle)
30687 END SUBROUTINE mp_gatherv_cv_src
30704 SUBROUTINE mp_gatherv_cm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
30706 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30707 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30708 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30709 INTEGER,
INTENT(IN) :: root
30712 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cm2'
30715#if defined(__parallel)
30716 INTEGER :: ierr, sendcount
30719 CALL mp_timeset(routinen, handle)
30721#if defined(__parallel)
30722 sendcount =
SIZE(sendbuf)
30723 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30724 recvbuf, recvcounts, displs, mpi_complex, &
30725 root, comm%handle, ierr)
30726 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30727 CALL add_perf(perf_id=4, &
30729 msg_size=sendcount*(2*real_4_size))
30731 mark_used(recvcounts)
30734 recvbuf(:, 1 + displs(1):) = sendbuf
30736 CALL mp_timestop(handle)
30737 END SUBROUTINE mp_gatherv_cm2
30753 SUBROUTINE mp_gatherv_cm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
30755 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30756 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30757 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30760 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cm2_src'
30763#if defined(__parallel)
30764 INTEGER :: ierr, sendcount
30767 CALL mp_timeset(routinen, handle)
30769#if defined(__parallel)
30770 sendcount =
SIZE(sendbuf)
30771 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30772 recvbuf, recvcounts, displs, mpi_complex, &
30773 comm%source, comm%handle, ierr)
30774 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30775 CALL add_perf(perf_id=4, &
30777 msg_size=sendcount*(2*real_4_size))
30779 mark_used(recvcounts)
30781 recvbuf(:, 1 + displs(1):) = sendbuf
30783 CALL mp_timestop(handle)
30784 END SUBROUTINE mp_gatherv_cm2_src
30801 SUBROUTINE mp_igatherv_cv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
30802 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
30803 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
30804 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30805 INTEGER,
INTENT(IN) :: sendcount, root
30809 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_cv'
30812#if defined(__parallel)
30816 CALL mp_timeset(routinen, handle)
30818#if defined(__parallel)
30819#if !defined(__GNUC__) || __GNUC__ >= 9
30820 cpassert(is_contiguous(sendbuf))
30821 cpassert(is_contiguous(recvbuf))
30822 cpassert(is_contiguous(recvcounts))
30823 cpassert(is_contiguous(displs))
30825 CALL mpi_igatherv(sendbuf, sendcount, mpi_complex, &
30826 recvbuf, recvcounts, displs, mpi_complex, &
30827 root, comm%handle, request%handle, ierr)
30828 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30829 CALL add_perf(perf_id=24, &
30831 msg_size=sendcount*(2*real_4_size))
30833 mark_used(sendcount)
30834 mark_used(recvcounts)
30837 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
30840 CALL mp_timestop(handle)
30841 END SUBROUTINE mp_igatherv_cv
30854 SUBROUTINE mp_allgather_c (msgout, msgin, comm)
30855 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
30856 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
30859 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c'
30862#if defined(__parallel)
30863 INTEGER :: ierr, rcount, scount
30866 CALL mp_timeset(routinen, handle)
30868#if defined(__parallel)
30871 CALL mpi_allgather(msgout, scount, mpi_complex, &
30872 msgin, rcount, mpi_complex, &
30874 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
30879 CALL mp_timestop(handle)
30880 END SUBROUTINE mp_allgather_c
30893 SUBROUTINE mp_allgather_c2(msgout, msgin, comm)
30894 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
30895 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
30898 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c2'
30901#if defined(__parallel)
30902 INTEGER :: ierr, rcount, scount
30905 CALL mp_timeset(routinen, handle)
30907#if defined(__parallel)
30910 CALL mpi_allgather(msgout, scount, mpi_complex, &
30911 msgin, rcount, mpi_complex, &
30913 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
30918 CALL mp_timestop(handle)
30919 END SUBROUTINE mp_allgather_c2
30932 SUBROUTINE mp_iallgather_c (msgout, msgin, comm, request)
30933 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
30934 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
30938 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c'
30941#if defined(__parallel)
30942 INTEGER :: ierr, rcount, scount
30945 CALL mp_timeset(routinen, handle)
30947#if defined(__parallel)
30948#if !defined(__GNUC__) || __GNUC__ >= 9
30949 cpassert(is_contiguous(msgin))
30953 CALL mpi_iallgather(msgout, scount, mpi_complex, &
30954 msgin, rcount, mpi_complex, &
30955 comm%handle, request%handle, ierr)
30956 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
30962 CALL mp_timestop(handle)
30963 END SUBROUTINE mp_iallgather_c
30978 SUBROUTINE mp_allgather_c12(msgout, msgin, comm)
30979 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
30980 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
30983 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c12'
30986#if defined(__parallel)
30987 INTEGER :: ierr, rcount, scount
30990 CALL mp_timeset(routinen, handle)
30992#if defined(__parallel)
30993 scount =
SIZE(msgout(:))
30995 CALL mpi_allgather(msgout, scount, mpi_complex, &
30996 msgin, rcount, mpi_complex, &
30998 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31001 msgin(:, 1) = msgout(:)
31003 CALL mp_timestop(handle)
31004 END SUBROUTINE mp_allgather_c12
31014 SUBROUTINE mp_allgather_c23(msgout, msgin, comm)
31015 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
31016 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
31019 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c23'
31022#if defined(__parallel)
31023 INTEGER :: ierr, rcount, scount
31026 CALL mp_timeset(routinen, handle)
31028#if defined(__parallel)
31029 scount =
SIZE(msgout(:, :))
31031 CALL mpi_allgather(msgout, scount, mpi_complex, &
31032 msgin, rcount, mpi_complex, &
31034 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31037 msgin(:, :, 1) = msgout(:, :)
31039 CALL mp_timestop(handle)
31040 END SUBROUTINE mp_allgather_c23
31050 SUBROUTINE mp_allgather_c34(msgout, msgin, comm)
31051 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
31052 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
31055 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c34'
31058#if defined(__parallel)
31059 INTEGER :: ierr, rcount, scount
31062 CALL mp_timeset(routinen, handle)
31064#if defined(__parallel)
31065 scount =
SIZE(msgout(:, :, :))
31067 CALL mpi_allgather(msgout, scount, mpi_complex, &
31068 msgin, rcount, mpi_complex, &
31070 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31073 msgin(:, :, :, 1) = msgout(:, :, :)
31075 CALL mp_timestop(handle)
31076 END SUBROUTINE mp_allgather_c34
31086 SUBROUTINE mp_allgather_c22(msgout, msgin, comm)
31087 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
31088 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
31091 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c22'
31094#if defined(__parallel)
31095 INTEGER :: ierr, rcount, scount
31098 CALL mp_timeset(routinen, handle)
31100#if defined(__parallel)
31101 scount =
SIZE(msgout(:, :))
31103 CALL mpi_allgather(msgout, scount, mpi_complex, &
31104 msgin, rcount, mpi_complex, &
31106 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31109 msgin(:, :) = msgout(:, :)
31111 CALL mp_timestop(handle)
31112 END SUBROUTINE mp_allgather_c22
31123 SUBROUTINE mp_iallgather_c11(msgout, msgin, comm, request)
31124 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31125 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31129 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c11'
31132#if defined(__parallel)
31133 INTEGER :: ierr, rcount, scount
31136 CALL mp_timeset(routinen, handle)
31138#if defined(__parallel)
31139#if !defined(__GNUC__) || __GNUC__ >= 9
31140 cpassert(is_contiguous(msgout))
31141 cpassert(is_contiguous(msgin))
31143 scount =
SIZE(msgout(:))
31145 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31146 msgin, rcount, mpi_complex, &
31147 comm%handle, request%handle, ierr)
31148 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31154 CALL mp_timestop(handle)
31155 END SUBROUTINE mp_iallgather_c11
31166 SUBROUTINE mp_iallgather_c13(msgout, msgin, comm, request)
31167 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31168 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
31172 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c13'
31175#if defined(__parallel)
31176 INTEGER :: ierr, rcount, scount
31179 CALL mp_timeset(routinen, handle)
31181#if defined(__parallel)
31182#if !defined(__GNUC__) || __GNUC__ >= 9
31183 cpassert(is_contiguous(msgout))
31184 cpassert(is_contiguous(msgin))
31187 scount =
SIZE(msgout(:))
31189 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31190 msgin, rcount, mpi_complex, &
31191 comm%handle, request%handle, ierr)
31192 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31195 msgin(:, 1, 1) = msgout(:)
31198 CALL mp_timestop(handle)
31199 END SUBROUTINE mp_iallgather_c13
31210 SUBROUTINE mp_iallgather_c22(msgout, msgin, comm, request)
31211 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :)
31212 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :)
31216 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c22'
31219#if defined(__parallel)
31220 INTEGER :: ierr, rcount, scount
31223 CALL mp_timeset(routinen, handle)
31225#if defined(__parallel)
31226#if !defined(__GNUC__) || __GNUC__ >= 9
31227 cpassert(is_contiguous(msgout))
31228 cpassert(is_contiguous(msgin))
31231 scount =
SIZE(msgout(:, :))
31233 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31234 msgin, rcount, mpi_complex, &
31235 comm%handle, request%handle, ierr)
31236 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31239 msgin(:, :) = msgout(:, :)
31242 CALL mp_timestop(handle)
31243 END SUBROUTINE mp_iallgather_c22
31254 SUBROUTINE mp_iallgather_c24(msgout, msgin, comm, request)
31255 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :)
31256 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :, :)
31260 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c24'
31263#if defined(__parallel)
31264 INTEGER :: ierr, rcount, scount
31267 CALL mp_timeset(routinen, handle)
31269#if defined(__parallel)
31270#if !defined(__GNUC__) || __GNUC__ >= 9
31271 cpassert(is_contiguous(msgout))
31272 cpassert(is_contiguous(msgin))
31275 scount =
SIZE(msgout(:, :))
31277 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31278 msgin, rcount, mpi_complex, &
31279 comm%handle, request%handle, ierr)
31280 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31283 msgin(:, :, 1, 1) = msgout(:, :)
31286 CALL mp_timestop(handle)
31287 END SUBROUTINE mp_iallgather_c24
31298 SUBROUTINE mp_iallgather_c33(msgout, msgin, comm, request)
31299 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :, :)
31300 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
31304 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c33'
31307#if defined(__parallel)
31308 INTEGER :: ierr, rcount, scount
31311 CALL mp_timeset(routinen, handle)
31313#if defined(__parallel)
31314#if !defined(__GNUC__) || __GNUC__ >= 9
31315 cpassert(is_contiguous(msgout))
31316 cpassert(is_contiguous(msgin))
31319 scount =
SIZE(msgout(:, :, :))
31321 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31322 msgin, rcount, mpi_complex, &
31323 comm%handle, request%handle, ierr)
31324 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31327 msgin(:, :, :) = msgout(:, :, :)
31330 CALL mp_timestop(handle)
31331 END SUBROUTINE mp_iallgather_c33
31350 SUBROUTINE mp_allgatherv_cv(msgout, msgin, rcount, rdispl, comm)
31351 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
31352 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
31353 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
31356 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_cv'
31359#if defined(__parallel)
31360 INTEGER :: ierr, scount
31363 CALL mp_timeset(routinen, handle)
31365#if defined(__parallel)
31366 scount =
SIZE(msgout)
31367 CALL mpi_allgatherv(msgout, scount, mpi_complex, msgin, rcount, &
31368 rdispl, mpi_complex, comm%handle, ierr)
31369 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
31376 CALL mp_timestop(handle)
31377 END SUBROUTINE mp_allgatherv_cv
31396 SUBROUTINE mp_allgatherv_cm2(msgout, msgin, rcount, rdispl, comm)
31397 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
31398 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
31399 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
31402 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_cv'
31405#if defined(__parallel)
31406 INTEGER :: ierr, scount
31409 CALL mp_timeset(routinen, handle)
31411#if defined(__parallel)
31412 scount =
SIZE(msgout)
31413 CALL mpi_allgatherv(msgout, scount, mpi_complex, msgin, rcount, &
31414 rdispl, mpi_complex, comm%handle, ierr)
31415 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
31422 CALL mp_timestop(handle)
31423 END SUBROUTINE mp_allgatherv_cm2
31442 SUBROUTINE mp_iallgatherv_cv(msgout, msgin, rcount, rdispl, comm, request)
31443 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31444 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31445 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
31449 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_cv'
31452#if defined(__parallel)
31453 INTEGER :: ierr, scount, rsize
31456 CALL mp_timeset(routinen, handle)
31458#if defined(__parallel)
31459#if !defined(__GNUC__) || __GNUC__ >= 9
31460 cpassert(is_contiguous(msgout))
31461 cpassert(is_contiguous(msgin))
31462 cpassert(is_contiguous(rcount))
31463 cpassert(is_contiguous(rdispl))
31466 scount =
SIZE(msgout)
31467 rsize =
SIZE(rcount)
31468 CALL mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, &
31469 rdispl, comm, request, ierr)
31470 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
31478 CALL mp_timestop(handle)
31479 END SUBROUTINE mp_iallgatherv_cv
31498 SUBROUTINE mp_iallgatherv_cv2(msgout, msgin, rcount, rdispl, comm, request)
31499 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31500 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31501 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
31505 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_cv2'
31508#if defined(__parallel)
31509 INTEGER :: ierr, scount, rsize
31512 CALL mp_timeset(routinen, handle)
31514#if defined(__parallel)
31515#if !defined(__GNUC__) || __GNUC__ >= 9
31516 cpassert(is_contiguous(msgout))
31517 cpassert(is_contiguous(msgin))
31518 cpassert(is_contiguous(rcount))
31519 cpassert(is_contiguous(rdispl))
31522 scount =
SIZE(msgout)
31523 rsize =
SIZE(rcount)
31524 CALL mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, &
31525 rdispl, comm, request, ierr)
31526 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
31534 CALL mp_timestop(handle)
31535 END SUBROUTINE mp_iallgatherv_cv2
31546#if defined(__parallel)
31547 SUBROUTINE mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
31548 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
31549 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
31550 INTEGER,
INTENT(IN) :: rsize
31551 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
31554 INTEGER,
INTENT(INOUT) :: ierr
31556 CALL mpi_iallgatherv(msgout, scount, mpi_complex, msgin, rcount, &
31557 rdispl, mpi_complex, comm%handle, request%handle, ierr)
31559 END SUBROUTINE mp_iallgatherv_cv_internal
31570 SUBROUTINE mp_sum_scatter_cv(msgout, msgin, rcount, comm)
31571 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
31572 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
31573 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
31576 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_cv'
31579#if defined(__parallel)
31583 CALL mp_timeset(routinen, handle)
31585#if defined(__parallel)
31586 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_complex, mpi_sum, &
31588 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
31590 CALL add_perf(perf_id=3, count=1, &
31591 msg_size=rcount(1)*2*(2*real_4_size))
31595 msgin = msgout(:, 1)
31597 CALL mp_timestop(handle)
31598 END SUBROUTINE mp_sum_scatter_cv
31609 SUBROUTINE mp_sendrecv_c (msgin, dest, msgout, source, comm, tag)
31610 COMPLEX(kind=real_4),
INTENT(IN) :: msgin
31611 INTEGER,
INTENT(IN) :: dest
31612 COMPLEX(kind=real_4),
INTENT(OUT) :: msgout
31613 INTEGER,
INTENT(IN) :: source
31615 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31617 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_c'
31620#if defined(__parallel)
31621 INTEGER :: ierr, msglen_in, msglen_out, &
31625 CALL mp_timeset(routinen, handle)
31627#if defined(__parallel)
31632 IF (
PRESENT(tag))
THEN
31636 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31637 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31638 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31639 CALL add_perf(perf_id=7, count=1, &
31640 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31648 CALL mp_timestop(handle)
31649 END SUBROUTINE mp_sendrecv_c
31660 SUBROUTINE mp_sendrecv_cv(msgin, dest, msgout, source, comm, tag)
31661 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
31662 INTEGER,
INTENT(IN) :: dest
31663 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
31664 INTEGER,
INTENT(IN) :: source
31666 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31668 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cv'
31671#if defined(__parallel)
31672 INTEGER :: ierr, msglen_in, msglen_out, &
31676 CALL mp_timeset(routinen, handle)
31678#if defined(__parallel)
31679 msglen_in =
SIZE(msgin)
31680 msglen_out =
SIZE(msgout)
31683 IF (
PRESENT(tag))
THEN
31687 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31688 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31689 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31690 CALL add_perf(perf_id=7, count=1, &
31691 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31699 CALL mp_timestop(handle)
31700 END SUBROUTINE mp_sendrecv_cv
31712 SUBROUTINE mp_sendrecv_cm2(msgin, dest, msgout, source, comm, tag)
31713 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
31714 INTEGER,
INTENT(IN) :: dest
31715 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
31716 INTEGER,
INTENT(IN) :: source
31718 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31720 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm2'
31723#if defined(__parallel)
31724 INTEGER :: ierr, msglen_in, msglen_out, &
31728 CALL mp_timeset(routinen, handle)
31730#if defined(__parallel)
31731 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
31732 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
31735 IF (
PRESENT(tag))
THEN
31739 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31740 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31741 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31742 CALL add_perf(perf_id=7, count=1, &
31743 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31751 CALL mp_timestop(handle)
31752 END SUBROUTINE mp_sendrecv_cm2
31763 SUBROUTINE mp_sendrecv_cm3(msgin, dest, msgout, source, comm, tag)
31764 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
31765 INTEGER,
INTENT(IN) :: dest
31766 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
31767 INTEGER,
INTENT(IN) :: source
31769 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31771 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm3'
31774#if defined(__parallel)
31775 INTEGER :: ierr, msglen_in, msglen_out, &
31779 CALL mp_timeset(routinen, handle)
31781#if defined(__parallel)
31782 msglen_in =
SIZE(msgin)
31783 msglen_out =
SIZE(msgout)
31786 IF (
PRESENT(tag))
THEN
31790 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31791 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31792 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31793 CALL add_perf(perf_id=7, count=1, &
31794 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31802 CALL mp_timestop(handle)
31803 END SUBROUTINE mp_sendrecv_cm3
31814 SUBROUTINE mp_sendrecv_cm4(msgin, dest, msgout, source, comm, tag)
31815 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
31816 INTEGER,
INTENT(IN) :: dest
31817 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
31818 INTEGER,
INTENT(IN) :: source
31820 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31822 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm4'
31825#if defined(__parallel)
31826 INTEGER :: ierr, msglen_in, msglen_out, &
31830 CALL mp_timeset(routinen, handle)
31832#if defined(__parallel)
31833 msglen_in =
SIZE(msgin)
31834 msglen_out =
SIZE(msgout)
31837 IF (
PRESENT(tag))
THEN
31841 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31842 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31843 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31844 CALL add_perf(perf_id=7, count=1, &
31845 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31853 CALL mp_timestop(handle)
31854 END SUBROUTINE mp_sendrecv_cm4
31871 SUBROUTINE mp_isendrecv_c (msgin, dest, msgout, source, comm, send_request, &
31873 COMPLEX(kind=real_4),
INTENT(IN) :: msgin
31874 INTEGER,
INTENT(IN) :: dest
31875 COMPLEX(kind=real_4),
INTENT(INOUT) :: msgout
31876 INTEGER,
INTENT(IN) :: source
31879 INTEGER,
INTENT(in),
OPTIONAL :: tag
31881 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_c'
31884#if defined(__parallel)
31885 INTEGER :: ierr, my_tag
31888 CALL mp_timeset(routinen, handle)
31890#if defined(__parallel)
31892 IF (
PRESENT(tag)) my_tag = tag
31894 CALL mpi_irecv(msgout, 1, mpi_complex, source, my_tag, &
31895 comm%handle, recv_request%handle, ierr)
31896 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
31898 CALL mpi_isend(msgin, 1, mpi_complex, dest, my_tag, &
31899 comm%handle, send_request%handle, ierr)
31900 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
31902 CALL add_perf(perf_id=8, count=1, msg_size=2*(2*real_4_size))
31912 CALL mp_timestop(handle)
31913 END SUBROUTINE mp_isendrecv_c
31932 SUBROUTINE mp_isendrecv_cv(msgin, dest, msgout, source, comm, send_request, &
31934 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
31935 INTEGER,
INTENT(IN) :: dest
31936 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
31937 INTEGER,
INTENT(IN) :: source
31940 INTEGER,
INTENT(in),
OPTIONAL :: tag
31942 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_cv'
31945#if defined(__parallel)
31946 INTEGER :: ierr, msglen, my_tag
31947 COMPLEX(kind=real_4) :: foo
31950 CALL mp_timeset(routinen, handle)
31952#if defined(__parallel)
31953#if !defined(__GNUC__) || __GNUC__ >= 9
31954 cpassert(is_contiguous(msgout))
31955 cpassert(is_contiguous(msgin))
31959 IF (
PRESENT(tag)) my_tag = tag
31961 msglen =
SIZE(msgout, 1)
31962 IF (msglen > 0)
THEN
31963 CALL mpi_irecv(msgout(1), msglen, mpi_complex, source, my_tag, &
31964 comm%handle, recv_request%handle, ierr)
31966 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
31967 comm%handle, recv_request%handle, ierr)
31969 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
31971 msglen =
SIZE(msgin, 1)
31972 IF (msglen > 0)
THEN
31973 CALL mpi_isend(msgin(1), msglen, mpi_complex, dest, my_tag, &
31974 comm%handle, send_request%handle, ierr)
31976 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
31977 comm%handle, send_request%handle, ierr)
31979 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
31981 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
31982 CALL add_perf(perf_id=8, count=1, msg_size=msglen*(2*real_4_size))
31992 CALL mp_timestop(handle)
31993 END SUBROUTINE mp_isendrecv_cv
32008 SUBROUTINE mp_isend_cv(msgin, dest, comm, request, tag)
32009 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
32010 INTEGER,
INTENT(IN) :: dest
32013 INTEGER,
INTENT(in),
OPTIONAL :: tag
32015 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cv'
32017 INTEGER :: handle, ierr
32018#if defined(__parallel)
32019 INTEGER :: msglen, my_tag
32020 COMPLEX(kind=real_4) :: foo(1)
32023 CALL mp_timeset(routinen, handle)
32025#if defined(__parallel)
32026#if !defined(__GNUC__) || __GNUC__ >= 9
32027 cpassert(is_contiguous(msgin))
32030 IF (
PRESENT(tag)) my_tag = tag
32032 msglen =
SIZE(msgin)
32033 IF (msglen > 0)
THEN
32034 CALL mpi_isend(msgin(1), msglen, mpi_complex, dest, my_tag, &
32035 comm%handle, request%handle, ierr)
32037 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32038 comm%handle, request%handle, ierr)
32040 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32042 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32051 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32053 CALL mp_timestop(handle)
32054 END SUBROUTINE mp_isend_cv
32071 SUBROUTINE mp_isend_cm2(msgin, dest, comm, request, tag)
32072 COMPLEX(kind=real_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
32073 INTEGER,
INTENT(IN) :: dest
32076 INTEGER,
INTENT(in),
OPTIONAL :: tag
32078 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm2'
32080 INTEGER :: handle, ierr
32081#if defined(__parallel)
32082 INTEGER :: msglen, my_tag
32083 COMPLEX(kind=real_4) :: foo(1)
32086 CALL mp_timeset(routinen, handle)
32088#if defined(__parallel)
32089#if !defined(__GNUC__) || __GNUC__ >= 9
32090 cpassert(is_contiguous(msgin))
32094 IF (
PRESENT(tag)) my_tag = tag
32096 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
32097 IF (msglen > 0)
THEN
32098 CALL mpi_isend(msgin(1, 1), msglen, mpi_complex, dest, my_tag, &
32099 comm%handle, request%handle, ierr)
32101 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32102 comm%handle, request%handle, ierr)
32104 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32106 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32115 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32117 CALL mp_timestop(handle)
32118 END SUBROUTINE mp_isend_cm2
32137 SUBROUTINE mp_isend_cm3(msgin, dest, comm, request, tag)
32138 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
32139 INTEGER,
INTENT(IN) :: dest
32142 INTEGER,
INTENT(in),
OPTIONAL :: tag
32144 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm3'
32146 INTEGER :: handle, ierr
32147#if defined(__parallel)
32148 INTEGER :: msglen, my_tag
32149 COMPLEX(kind=real_4) :: foo(1)
32152 CALL mp_timeset(routinen, handle)
32154#if defined(__parallel)
32155#if !defined(__GNUC__) || __GNUC__ >= 9
32156 cpassert(is_contiguous(msgin))
32160 IF (
PRESENT(tag)) my_tag = tag
32162 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
32163 IF (msglen > 0)
THEN
32164 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_complex, dest, my_tag, &
32165 comm%handle, request%handle, ierr)
32167 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32168 comm%handle, request%handle, ierr)
32170 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32172 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32181 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32183 CALL mp_timestop(handle)
32184 END SUBROUTINE mp_isend_cm3
32200 SUBROUTINE mp_isend_cm4(msgin, dest, comm, request, tag)
32201 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
32202 INTEGER,
INTENT(IN) :: dest
32205 INTEGER,
INTENT(in),
OPTIONAL :: tag
32207 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm4'
32209 INTEGER :: handle, ierr
32210#if defined(__parallel)
32211 INTEGER :: msglen, my_tag
32212 COMPLEX(kind=real_4) :: foo(1)
32215 CALL mp_timeset(routinen, handle)
32217#if defined(__parallel)
32218#if !defined(__GNUC__) || __GNUC__ >= 9
32219 cpassert(is_contiguous(msgin))
32223 IF (
PRESENT(tag)) my_tag = tag
32225 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
32226 IF (msglen > 0)
THEN
32227 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_complex, dest, my_tag, &
32228 comm%handle, request%handle, ierr)
32230 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32231 comm%handle, request%handle, ierr)
32233 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32235 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32244 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32246 CALL mp_timestop(handle)
32247 END SUBROUTINE mp_isend_cm4
32263 SUBROUTINE mp_irecv_cv(msgout, source, comm, request, tag)
32264 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
32265 INTEGER,
INTENT(IN) :: source
32268 INTEGER,
INTENT(in),
OPTIONAL :: tag
32270 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cv'
32273#if defined(__parallel)
32274 INTEGER :: ierr, msglen, my_tag
32275 COMPLEX(kind=real_4) :: foo(1)
32278 CALL mp_timeset(routinen, handle)
32280#if defined(__parallel)
32281#if !defined(__GNUC__) || __GNUC__ >= 9
32282 cpassert(is_contiguous(msgout))
32286 IF (
PRESENT(tag)) my_tag = tag
32288 msglen =
SIZE(msgout)
32289 IF (msglen > 0)
THEN
32290 CALL mpi_irecv(msgout(1), msglen, mpi_complex, source, my_tag, &
32291 comm%handle, request%handle, ierr)
32293 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32294 comm%handle, request%handle, ierr)
32296 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32298 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32300 cpabort(
"mp_irecv called in non parallel case")
32307 CALL mp_timestop(handle)
32308 END SUBROUTINE mp_irecv_cv
32325 SUBROUTINE mp_irecv_cm2(msgout, source, comm, request, tag)
32326 COMPLEX(kind=real_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
32327 INTEGER,
INTENT(IN) :: source
32330 INTEGER,
INTENT(in),
OPTIONAL :: tag
32332 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm2'
32335#if defined(__parallel)
32336 INTEGER :: ierr, msglen, my_tag
32337 COMPLEX(kind=real_4) :: foo(1)
32340 CALL mp_timeset(routinen, handle)
32342#if defined(__parallel)
32343#if !defined(__GNUC__) || __GNUC__ >= 9
32344 cpassert(is_contiguous(msgout))
32348 IF (
PRESENT(tag)) my_tag = tag
32350 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
32351 IF (msglen > 0)
THEN
32352 CALL mpi_irecv(msgout(1, 1), msglen, mpi_complex, source, my_tag, &
32353 comm%handle, request%handle, ierr)
32355 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32356 comm%handle, request%handle, ierr)
32358 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32360 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32367 cpabort(
"mp_irecv called in non parallel case")
32369 CALL mp_timestop(handle)
32370 END SUBROUTINE mp_irecv_cm2
32388 SUBROUTINE mp_irecv_cm3(msgout, source, comm, request, tag)
32389 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
32390 INTEGER,
INTENT(IN) :: source
32393 INTEGER,
INTENT(in),
OPTIONAL :: tag
32395 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm3'
32398#if defined(__parallel)
32399 INTEGER :: ierr, msglen, my_tag
32400 COMPLEX(kind=real_4) :: foo(1)
32403 CALL mp_timeset(routinen, handle)
32405#if defined(__parallel)
32406#if !defined(__GNUC__) || __GNUC__ >= 9
32407 cpassert(is_contiguous(msgout))
32411 IF (
PRESENT(tag)) my_tag = tag
32413 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
32414 IF (msglen > 0)
THEN
32415 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_complex, source, my_tag, &
32416 comm%handle, request%handle, ierr)
32418 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32419 comm%handle, request%handle, ierr)
32421 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
32423 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32430 cpabort(
"mp_irecv called in non parallel case")
32432 CALL mp_timestop(handle)
32433 END SUBROUTINE mp_irecv_cm3
32449 SUBROUTINE mp_irecv_cm4(msgout, source, comm, request, tag)
32450 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
32451 INTEGER,
INTENT(IN) :: source
32454 INTEGER,
INTENT(in),
OPTIONAL :: tag
32456 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm4'
32459#if defined(__parallel)
32460 INTEGER :: ierr, msglen, my_tag
32461 COMPLEX(kind=real_4) :: foo(1)
32464 CALL mp_timeset(routinen, handle)
32466#if defined(__parallel)
32467#if !defined(__GNUC__) || __GNUC__ >= 9
32468 cpassert(is_contiguous(msgout))
32472 IF (
PRESENT(tag)) my_tag = tag
32474 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
32475 IF (msglen > 0)
THEN
32476 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_complex, source, my_tag, &
32477 comm%handle, request%handle, ierr)
32479 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32480 comm%handle, request%handle, ierr)
32482 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
32484 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32491 cpabort(
"mp_irecv called in non parallel case")
32493 CALL mp_timestop(handle)
32494 END SUBROUTINE mp_irecv_cm4
32506 SUBROUTINE mp_win_create_cv(base, comm, win)
32507 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
32511 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_cv'
32514#if defined(__parallel)
32516 INTEGER(kind=mpi_address_kind) :: len
32517 COMPLEX(kind=real_4) :: foo(1)
32520 CALL mp_timeset(routinen, handle)
32522#if defined(__parallel)
32524 len =
SIZE(base)*(2*real_4_size)
32526 CALL mpi_win_create(base(1), len, (2*real_4_size), mpi_info_null, comm%handle, win%handle, ierr)
32528 CALL mpi_win_create(foo, len, (2*real_4_size), mpi_info_null, comm%handle, win%handle, ierr)
32530 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
32532 CALL add_perf(perf_id=20, count=1)
32536 win%handle = mp_win_null_handle
32538 CALL mp_timestop(handle)
32539 END SUBROUTINE mp_win_create_cv
32551 SUBROUTINE mp_rget_cv(base, source, win, win_data, myproc, disp, request, &
32552 origin_datatype, target_datatype)
32553 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
32554 INTEGER,
INTENT(IN) :: source
32556 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: win_data
32557 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
32561 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_cv'
32564#if defined(__parallel)
32565 INTEGER :: ierr, len, &
32566 origin_len, target_len
32567 LOGICAL :: do_local_copy
32568 INTEGER(kind=mpi_address_kind) :: disp_aint
32569 mpi_data_type :: handle_origin_datatype, handle_target_datatype
32572 CALL mp_timeset(routinen, handle)
32574#if defined(__parallel)
32577 IF (
PRESENT(disp))
THEN
32578 disp_aint = int(disp, kind=mpi_address_kind)
32580 handle_origin_datatype = mpi_complex
32582 IF (
PRESENT(origin_datatype))
THEN
32583 handle_origin_datatype = origin_datatype%type_handle
32586 handle_target_datatype = mpi_complex
32588 IF (
PRESENT(target_datatype))
THEN
32589 handle_target_datatype = target_datatype%type_handle
32593 do_local_copy = .false.
32594 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
32595 IF (myproc .EQ. source) do_local_copy = .true.
32597 IF (do_local_copy)
THEN
32599 base(:) = win_data(disp_aint + 1:disp_aint + len)
32604 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
32605 target_len, handle_target_datatype, win%handle, request%handle, ierr)
32611 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
32613 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*(2*real_4_size))
32618 mark_used(origin_datatype)
32619 mark_used(target_datatype)
32623 IF (
PRESENT(disp))
THEN
32624 base(:) = win_data(disp + 1:disp +
SIZE(base))
32626 base(:) = win_data(:
SIZE(base))
32630 CALL mp_timestop(handle)
32631 END SUBROUTINE mp_rget_cv
32641 result(type_descriptor)
32642 INTEGER,
INTENT(IN) :: count
32643 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
32646 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_c'
32649#if defined(__parallel)
32653 CALL mp_timeset(routinen, handle)
32655#if defined(__parallel)
32656 CALL mpi_type_indexed(count, lengths, displs, mpi_complex, &
32657 type_descriptor%type_handle, ierr)
32659 cpabort(
"MPI_Type_Indexed @ "//routinen)
32660 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
32662 cpabort(
"MPI_Type_commit @ "//routinen)
32664 type_descriptor%type_handle = 5
32666 type_descriptor%length = count
32667 NULLIFY (type_descriptor%subtype)
32668 type_descriptor%vector_descriptor(1:2) = 1
32669 type_descriptor%has_indexing = .true.
32670 type_descriptor%index_descriptor%index => lengths
32671 type_descriptor%index_descriptor%chunks => displs
32673 CALL mp_timestop(handle)
32684 SUBROUTINE mp_allocate_c (DATA, len, stat)
32685 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
32686 INTEGER,
INTENT(IN) :: len
32687 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
32689 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_c'
32691 INTEGER :: handle, ierr
32693 CALL mp_timeset(routinen, handle)
32695#if defined(__parallel)
32697 CALL mp_alloc_mem(
DATA, len, stat=ierr)
32698 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
32699 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
32700 CALL add_perf(perf_id=15, count=1)
32702 ALLOCATE (
DATA(len), stat=ierr)
32703 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
32704 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
32706 IF (
PRESENT(stat)) stat = ierr
32707 CALL mp_timestop(handle)
32708 END SUBROUTINE mp_allocate_c
32716 SUBROUTINE mp_deallocate_c (DATA, stat)
32717 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
32718 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
32720 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_c'
32723#if defined(__parallel)
32727 CALL mp_timeset(routinen, handle)
32729#if defined(__parallel)
32730 CALL mp_free_mem(
DATA, ierr)
32731 IF (
PRESENT(stat))
THEN
32734 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
32737 CALL add_perf(perf_id=15, count=1)
32740 IF (
PRESENT(stat)) stat = 0
32742 CALL mp_timestop(handle)
32743 END SUBROUTINE mp_deallocate_c
32756 SUBROUTINE mp_file_write_at_cv(fh, offset, msg, msglen)
32757 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
32759 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
32760 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32763#if defined(__parallel)
32767 msg_len =
SIZE(msg)
32768 IF (
PRESENT(msglen)) msg_len = msglen
32769#if defined(__parallel)
32770 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
32772 cpabort(
"mpi_file_write_at_cv @ mp_file_write_at_cv")
32774 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
32776 END SUBROUTINE mp_file_write_at_cv
32784 SUBROUTINE mp_file_write_at_c (fh, offset, msg)
32785 COMPLEX(kind=real_4),
INTENT(IN) :: msg
32787 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32789#if defined(__parallel)
32793 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
32795 cpabort(
"mpi_file_write_at_c @ mp_file_write_at_c")
32797 WRITE (unit=fh%handle, pos=offset + 1) msg
32799 END SUBROUTINE mp_file_write_at_c
32811 SUBROUTINE mp_file_write_at_all_cv(fh, offset, msg, msglen)
32812 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
32814 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
32815 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32818#if defined(__parallel)
32822 msg_len =
SIZE(msg)
32823 IF (
PRESENT(msglen)) msg_len = msglen
32824#if defined(__parallel)
32825 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
32827 cpabort(
"mpi_file_write_at_all_cv @ mp_file_write_at_all_cv")
32829 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
32831 END SUBROUTINE mp_file_write_at_all_cv
32839 SUBROUTINE mp_file_write_at_all_c (fh, offset, msg)
32840 COMPLEX(kind=real_4),
INTENT(IN) :: msg
32842 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32844#if defined(__parallel)
32848 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
32850 cpabort(
"mpi_file_write_at_all_c @ mp_file_write_at_all_c")
32852 WRITE (unit=fh%handle, pos=offset + 1) msg
32854 END SUBROUTINE mp_file_write_at_all_c
32867 SUBROUTINE mp_file_read_at_cv(fh, offset, msg, msglen)
32868 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
32870 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
32871 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32874#if defined(__parallel)
32878 msg_len =
SIZE(msg)
32879 IF (
PRESENT(msglen)) msg_len = msglen
32880#if defined(__parallel)
32881 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
32883 cpabort(
"mpi_file_read_at_cv @ mp_file_read_at_cv")
32885 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
32887 END SUBROUTINE mp_file_read_at_cv
32895 SUBROUTINE mp_file_read_at_c (fh, offset, msg)
32896 COMPLEX(kind=real_4),
INTENT(OUT) :: msg
32898 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32900#if defined(__parallel)
32904 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
32906 cpabort(
"mpi_file_read_at_c @ mp_file_read_at_c")
32908 READ (unit=fh%handle, pos=offset + 1) msg
32910 END SUBROUTINE mp_file_read_at_c
32922 SUBROUTINE mp_file_read_at_all_cv(fh, offset, msg, msglen)
32923 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
32925 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
32926 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32929#if defined(__parallel)
32933 msg_len =
SIZE(msg)
32934 IF (
PRESENT(msglen)) msg_len = msglen
32935#if defined(__parallel)
32936 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
32938 cpabort(
"mpi_file_read_at_all_cv @ mp_file_read_at_all_cv")
32940 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
32942 END SUBROUTINE mp_file_read_at_all_cv
32950 SUBROUTINE mp_file_read_at_all_c (fh, offset, msg)
32951 COMPLEX(kind=real_4),
INTENT(OUT) :: msg
32953 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32955#if defined(__parallel)
32959 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
32961 cpabort(
"mpi_file_read_at_all_c @ mp_file_read_at_all_c")
32963 READ (unit=fh%handle, pos=offset + 1) msg
32965 END SUBROUTINE mp_file_read_at_all_c
32974 FUNCTION mp_type_make_c (ptr, &
32975 vector_descriptor, index_descriptor) &
32976 result(type_descriptor)
32977 COMPLEX(kind=real_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
32978 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
32979 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
32982 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_c'
32984#if defined(__parallel)
32986#if defined(__MPI_F08)
32988 EXTERNAL :: mpi_get_address
32992 NULLIFY (type_descriptor%subtype)
32993 type_descriptor%length =
SIZE(ptr)
32994#if defined(__parallel)
32995 type_descriptor%type_handle = mpi_complex
32996 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
32998 cpabort(
"MPI_Get_address @ "//routinen)
33000 type_descriptor%type_handle = 5
33002 type_descriptor%vector_descriptor(1:2) = 1
33003 type_descriptor%has_indexing = .false.
33004 type_descriptor%data_c => ptr
33005 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
33006 cpabort(routinen//
": Vectors and indices NYI")
33008 END FUNCTION mp_type_make_c
33017 SUBROUTINE mp_alloc_mem_c (DATA, len, stat)
33018 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
33019 INTEGER,
INTENT(IN) :: len
33020 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
33022#if defined(__parallel)
33023 INTEGER :: size, ierr, length, &
33025 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
33026 TYPE(c_ptr) :: mp_baseptr
33027 mpi_info_type :: mp_info
33029 length = max(len, 1)
33030 CALL mpi_type_size(mpi_complex,
size, ierr)
33031 mp_size = int(length, kind=mpi_address_kind)*
size
33032 IF (mp_size .GT. mp_max_memory_size)
THEN
33033 cpabort(
"MPI cannot allocate more than 2 GiByte")
33035 mp_info = mpi_info_null
33036 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
33037 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
33038 IF (
PRESENT(stat)) stat = mp_res
33040 INTEGER :: length, mystat
33041 length = max(len, 1)
33042 IF (
PRESENT(stat))
THEN
33043 ALLOCATE (
DATA(length), stat=mystat)
33046 ALLOCATE (
DATA(length))
33049 END SUBROUTINE mp_alloc_mem_c
33057 SUBROUTINE mp_free_mem_c (DATA, stat)
33058 COMPLEX(kind=real_4),
DIMENSION(:), &
33059 POINTER, asynchronous :: data
33060 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
33062#if defined(__parallel)
33064 CALL mpi_free_mem(
DATA, mp_res)
33065 IF (
PRESENT(stat)) stat = mp_res
33068 IF (
PRESENT(stat)) stat = 0
33070 END SUBROUTINE mp_free_mem_c
static int isum(const int n, const int input[n])
Private routine for computing the sum of the given integers.
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
Defines the basic variable types.
integer, parameter, public int_8
integer, parameter, public dp
integer, parameter, public int_4_size
integer, parameter, public default_string_length
integer, parameter, public real_8_size
integer, parameter, public int_8_size
integer, parameter, public real_4_size
integer, parameter, public real_4
integer, parameter, public real_8
integer, parameter, public int_4
Machine interface based on Fortran 2003 and POSIX.
subroutine, public m_abort()
Can be used to get a nice core.
Interface to the message passing library MPI.
type(mp_comm_type), parameter, public mp_comm_null
integer, parameter, public mp_comm_unequal
logical, save, public mp_collect_timings
subroutine, public mp_dims_create(nodes, dims)
wrapper to MPI_Dims_create
subroutine, public mp_para_env_create(para_env, group)
creates a new para environment
integer, parameter intlen
type(mp_file_descriptor_type) function, public mp_file_type_hindexed_make_chv(count, lengths, displs)
Creates an indexed MPI type for arrays of strings using bytes for spacing (hindexed type)
subroutine, public mp_world_init(mp_comm)
initializes the system default communicator
integer, parameter, public file_amode_rdwr
subroutine, public mp_para_cart_create(cart, group)
creates a cart (multidimensional parallel environment)
subroutine, public mp_file_type_free(type_descriptor)
Releases the type used for MPI I/O.
integer, parameter, public mp_any_tag
integer, parameter, public file_amode_wronly
integer, parameter, public mpi_character_size
integer, parameter, public mp_comm_ident
type(mp_type_descriptor_type) function, public mp_type_indexed_make_z(count, lengths, displs)
...
subroutine, public mp_abort()
globally stops all tasks this is intended to be low level, most of CP2K should call cp_abort()
type(mp_type_descriptor_type) function, public mp_type_indexed_make_r(count, lengths, displs)
...
type(mp_comm_type), parameter, public mp_comm_world
integer, parameter, public file_amode_create
subroutine, public mp_para_env_release(para_env)
releases the para object (to be called when you don't want anymore the shared copy of this object)
type(mp_comm_type), parameter, public mp_comm_self
integer, parameter, public mp_comm_congruent
subroutine, public mp_para_cart_release(cart)
releases the given cart
type(mp_type_descriptor_type) function, public mp_type_indexed_make_d(count, lengths, displs)
...
integer, parameter, public mp_comm_compare_default
subroutine, public mp_world_finalize()
finalizes the system default communicator
subroutine, public mp_file_delete(filepath, info)
Deletes a file. Auxiliary routine to emulate 'replace' action for mp_file_open. Only the master proce...
integer, parameter, public mp_comm_similar
type(mp_file_type), parameter, public mp_file_null
integer, parameter, public mp_any_source
type(mp_type_descriptor_type) function, public mp_type_indexed_make_c(count, lengths, displs)
...
type(mp_info_type), parameter, public mp_info_null
type(mp_win_type), parameter, public mp_win_null
integer, parameter, public file_amode_append
subroutine, public mp_get_library_version(version, resultlen)
Get Version of the MPI Library (MPI 3)
integer, parameter, public address_kind
subroutine, public mp_file_get_amode(mpi_io, replace, amode, form, action, status, position)
(parallel) Utility routine to determine MPI file access mode based on variables
integer, parameter, public file_amode_rdonly
subroutine, public mp_waitany(requests, completed)
waits for completion of any of the given requests
integer, parameter, public file_amode_excl
type(mp_request_type), parameter, public mp_request_null
subroutine, public mp_file_type_set_view_chv(fh, offset, type_descriptor)
Uses a previously created indexed MPI character type to tell the MPI processes how to partition (set_...
subroutine, public mp_type_size(type_descriptor, type_size)
Returns the size of a data type in bytes.
integer, parameter, public mpi_integer_size
Defines all routines to deal with the performance of MPI routines.
subroutine, public rm_mp_perf_env()
...
subroutine, public add_perf(perf_id, count, msg_size)
adds the performance informations of one call
subroutine, public add_mp_perf_env(perf_env)
start and stop the performance indicators for every call to start there has to be (exactly) one call ...
represent a multidimensional parallel environment
represent a pointer to a para env (to build arrays)
stores all the informations relevant to an mpi environment