24 USE iso_c_binding,
ONLY: c_f_pointer, &
33#include "../base/base_uses.f90"
37#if defined(__parallel) && defined(__MPI_F08)
38#define MPI_DATA_TYPE TYPE(MPI_Datatype)
39#define MPI_COMM_TYPE TYPE(MPI_Comm)
40#define MPI_REQUEST_TYPE TYPE(MPI_Request)
41#define MPI_WIN_TYPE TYPE(MPI_Win)
42#define MPI_FILE_TYPE TYPE(MPI_File)
43#define MPI_INFO_TYPE TYPE(MPI_Info)
44#define MPI_STATUS_TYPE TYPE(MPI_Status)
45#define MPI_GROUP_TYPE TYPE(MPI_Group)
46#define MPI_STATUS_EXTRACT(X) %X
47#define MPI_GET_COMP %mpi_val
49#define MPI_DATA_TYPE INTEGER
50#define MPI_COMM_TYPE INTEGER
51#define MPI_REQUEST_TYPE INTEGER
52#define MPI_WIN_TYPE INTEGER
53#define MPI_FILE_TYPE INTEGER
54#define MPI_INFO_TYPE INTEGER
55#define MPI_STATUS_TYPE INTEGER, DIMENSION(MPI_STATUS_SIZE)
56#define MPI_GROUP_TYPE INTEGER
57#define MPI_STATUS_EXTRACT(X) (X)
61#if defined(__parallel)
63 USE mpi_f08,
ONLY: mpi_allgather, mpi_allgatherv, mpi_alloc_mem, mpi_allreduce, mpi_alltoall, mpi_alltoallv, mpi_bcast, &
64 mpi_cart_coords, mpi_cart_create, mpi_cart_get, mpi_cart_rank, mpi_cart_sub, mpi_dims_create, mpi_file_close, &
65 mpi_file_get_size, mpi_file_open, mpi_file_read_at_all, mpi_file_read_at, mpi_file_write_at_all, &
66 mpi_file_write_at, mpi_free_mem, mpi_gather, mpi_gatherv, mpi_get_address, mpi_group_translate_ranks, mpi_irecv, &
67 mpi_isend, mpi_recv, mpi_reduce, mpi_reduce_scatter, mpi_rget, mpi_scatter, mpi_send, &
68 mpi_sendrecv, mpi_sendrecv_replace, mpi_testany, mpi_waitall, mpi_waitany, mpi_win_create, mpi_comm_get_attr, &
69 mpi_ibcast, mpi_any_tag, mpi_any_source, mpi_address_kind, mpi_thread_serialized, mpi_errors_return, mpi_comm_world, &
71 mpi_thread_multiple, &
73 mpi_comm_self, mpi_comm_null, mpi_info_null, mpi_request_null, mpi_request, mpi_comm, mpi_group, &
74 mpi_status_ignore, mpi_info, mpi_file, mpi_success, &
75 mpi_tag_ub, mpi_host, mpi_io, mpi_wtime_is_global, mpi_logical, &
76 mpi_status, mpi_lor, mpi_2real, mpi_real, mpi_maxloc, mpi_integer8, mpi_bottom, &
77 mpi_iscatter, mpi_iscatterv, mpi_gatherv, mpi_igatherv, mpi_iallgather, &
78 mpi_iallgatherv, mpi_status, mpi_comm_type_shared, mpi_integer, mpi_minloc, mpi_2double_precision, &
79 mpi_file, mpi_minloc, mpi_integer, mpi_sum, mpi_scan, &
80 mpi_2integer, mpi_in_place, mpi_max, mpi_min, mpi_prod, mpi_iallreduce, mpi_double_precision, &
81 mpi_error_string, mpi_double_complex, mpi_complex, mpi_type_size, mpi_file_write_all, &
82 mpi_max_error_string, mpi_datatype, mpi_offset_kind, mpi_win, mpi_mode_rdonly, mpi_mode_rdwr, &
83 mpi_mode_wronly, mpi_mode_create, mpi_mode_append, mpi_mode_excl, mpi_max_library_version_string, &
84 mpi_win_null, mpi_file_null, mpi_datatype_null, mpi_character, mpi_mode_nocheck, &
85 mpi_status_size, mpi_proc_null, mpi_unequal, mpi_similar, mpi_ident, mpi_congruent
115#if defined(__parallel)
116 LOGICAL,
PARAMETER :: cp2k_is_parallel = .true.
117 INTEGER,
PARAMETER,
PUBLIC :: mp_any_tag = mpi_any_tag
118 INTEGER,
PARAMETER,
PUBLIC :: mp_any_source = mpi_any_source
119 mpi_comm_type,
PARAMETER :: mp_comm_null_handle = mpi_comm_null
120 mpi_comm_type,
PARAMETER :: mp_comm_self_handle = mpi_comm_self
121 mpi_comm_type,
PARAMETER :: mp_comm_world_handle = mpi_comm_world
122 mpi_request_type,
PARAMETER :: mp_request_null_handle = mpi_request_null
123 mpi_win_type,
PARAMETER :: mp_win_null_handle = mpi_win_null
124 mpi_file_type,
PARAMETER :: mp_file_null_handle = mpi_file_null
125 mpi_info_type,
PARAMETER :: mp_info_null_handle = mpi_info_null
126 mpi_data_type,
PARAMETER :: mp_datatype_null_handle = mpi_datatype_null
127 INTEGER,
PARAMETER,
PUBLIC :: mp_status_size = mpi_status_size
128 INTEGER,
PARAMETER,
PUBLIC :: mp_proc_null = mpi_proc_null
130 INTEGER(KIND=MPI_ADDRESS_KIND),
PARAMETER,
PRIVATE :: mp_max_memory_size = huge(int(1, kind=
int_4))
132 INTEGER,
PARAMETER,
PUBLIC :: mp_max_library_version_string = mpi_max_library_version_string
134 INTEGER,
PARAMETER,
PUBLIC :: file_offset = mpi_offset_kind
135 INTEGER,
PARAMETER,
PUBLIC :: address_kind = mpi_address_kind
136 INTEGER,
PARAMETER,
PUBLIC :: file_amode_create = mpi_mode_create
137 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdonly = mpi_mode_rdonly
138 INTEGER,
PARAMETER,
PUBLIC :: file_amode_wronly = mpi_mode_wronly
139 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdwr = mpi_mode_rdwr
140 INTEGER,
PARAMETER,
PUBLIC :: file_amode_excl = mpi_mode_excl
141 INTEGER,
PARAMETER,
PUBLIC :: file_amode_append = mpi_mode_append
143 LOGICAL,
PARAMETER :: cp2k_is_parallel = .false.
144 INTEGER,
PARAMETER,
PUBLIC :: mp_any_tag = -1
145 INTEGER,
PARAMETER,
PUBLIC :: mp_any_source = -2
146 mpi_comm_type,
PARAMETER :: mp_comm_null_handle = -3
147 mpi_comm_type,
PARAMETER :: mp_comm_self_handle = -11
148 mpi_comm_type,
PARAMETER :: mp_comm_world_handle = -12
149 mpi_request_type,
PARAMETER :: mp_request_null_handle = -4
150 mpi_win_type,
PARAMETER :: mp_win_null_handle = -5
151 mpi_file_type,
PARAMETER :: mp_file_null_handle = -6
152 mpi_info_type,
PARAMETER :: mp_info_null_handle = -7
153 mpi_data_type,
PARAMETER :: mp_datatype_null_handle = -8
154 INTEGER,
PARAMETER,
PUBLIC :: mp_status_size = -9
155 INTEGER,
PARAMETER,
PUBLIC :: mp_proc_null = -10
156 INTEGER,
PARAMETER,
PUBLIC :: mp_max_library_version_string = 1
158 INTEGER,
PARAMETER,
PUBLIC :: file_offset =
int_8
159 INTEGER,
PARAMETER,
PUBLIC :: address_kind =
int_8
160 INTEGER,
PARAMETER,
PUBLIC :: file_amode_create = 1
161 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdonly = 2
162 INTEGER,
PARAMETER,
PUBLIC :: file_amode_wronly = 4
163 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdwr = 8
164 INTEGER,
PARAMETER,
PUBLIC :: file_amode_excl = 64
165 INTEGER,
PARAMETER,
PUBLIC :: file_amode_append = 128
173 CHARACTER(LEN=*),
PARAMETER,
PRIVATE :: modulen =
'message_passing'
176 INTEGER,
PRIVATE,
SAVE :: debug_comm_count
191 mpi_comm_type :: handle = mp_comm_null_handle
195 INTEGER,
PUBLIC :: mepos = -1, source = -1, num_pe = -1
198 PROCEDURE, pass, non_overridable :: set_handle => mp_comm_type_set_handle
199 PROCEDURE, pass, non_overridable :: get_handle => mp_comm_type_get_handle
201 PROCEDURE,
PRIVATE, pass, non_overridable :: mp_comm_op_eq
202 PROCEDURE,
PRIVATE, pass, non_overridable :: mp_comm_op_neq
203 generic,
PUBLIC ::
operator(==) => mp_comm_op_eq
204 generic,
PUBLIC ::
operator(/=) => mp_comm_op_neq
206 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: &
207 mp_sendrecv_i, mp_sendrecv_l, mp_sendrecv_r, mp_sendrecv_d, &
208 mp_sendrecv_c, mp_sendrecv_z, &
209 mp_sendrecv_iv, mp_sendrecv_im2, mp_sendrecv_im3, mp_sendrecv_im4, &
210 mp_sendrecv_lv, mp_sendrecv_lm2, mp_sendrecv_lm3, mp_sendrecv_lm4, &
211 mp_sendrecv_rv, mp_sendrecv_rm2, mp_sendrecv_rm3, mp_sendrecv_rm4, &
212 mp_sendrecv_dv, mp_sendrecv_dm2, mp_sendrecv_dm3, mp_sendrecv_dm4, &
213 mp_sendrecv_cv, mp_sendrecv_cm2, mp_sendrecv_cm3, mp_sendrecv_cm4, &
214 mp_sendrecv_zv, mp_sendrecv_zm2, mp_sendrecv_zm3, mp_sendrecv_zm4
215 generic,
PUBLIC :: sendrecv => mp_sendrecv_i, mp_sendrecv_l, &
216 mp_sendrecv_r, mp_sendrecv_d, mp_sendrecv_c, mp_sendrecv_z, &
217 mp_sendrecv_iv, mp_sendrecv_im2, mp_sendrecv_im3, mp_sendrecv_im4, &
218 mp_sendrecv_lv, mp_sendrecv_lm2, mp_sendrecv_lm3, mp_sendrecv_lm4, &
219 mp_sendrecv_rv, mp_sendrecv_rm2, mp_sendrecv_rm3, mp_sendrecv_rm4, &
220 mp_sendrecv_dv, mp_sendrecv_dm2, mp_sendrecv_dm3, mp_sendrecv_dm4, &
221 mp_sendrecv_cv, mp_sendrecv_cm2, mp_sendrecv_cm3, mp_sendrecv_cm4, &
222 mp_sendrecv_zv, mp_sendrecv_zm2, mp_sendrecv_zm3, mp_sendrecv_zm4
224 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_minloc_iv, &
225 mp_minloc_lv, mp_minloc_rv, mp_minloc_dv
226 generic,
PUBLIC :: minloc => mp_minloc_iv, &
227 mp_minloc_lv, mp_minloc_rv, mp_minloc_dv
229 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_maxloc_iv, &
230 mp_maxloc_lv, mp_maxloc_rv, mp_maxloc_dv
231 generic,
PUBLIC :: maxloc => mp_maxloc_iv, &
232 mp_maxloc_lv, mp_maxloc_rv, mp_maxloc_dv
234 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_shift_im, mp_shift_i, &
235 mp_shift_lm, mp_shift_l, mp_shift_rm, mp_shift_r, &
236 mp_shift_dm, mp_shift_d, mp_shift_cm, mp_shift_c, &
237 mp_shift_zm, mp_shift_z
238 generic,
PUBLIC :: shift => mp_shift_im, mp_shift_i, &
239 mp_shift_lm, mp_shift_l, mp_shift_rm, mp_shift_r, &
240 mp_shift_dm, mp_shift_d, mp_shift_cm, mp_shift_c, &
241 mp_shift_zm, mp_shift_z
243 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_bcast_i, mp_bcast_iv, mp_bcast_im, mp_bcast_i3, &
244 mp_bcast_l, mp_bcast_lv, mp_bcast_lm, mp_bcast_l3, &
245 mp_bcast_r, mp_bcast_rv, mp_bcast_rm, mp_bcast_r3, &
246 mp_bcast_d, mp_bcast_dv, mp_bcast_dm, mp_bcast_d3, &
247 mp_bcast_c, mp_bcast_cv, mp_bcast_cm, mp_bcast_c3, &
248 mp_bcast_z, mp_bcast_zv, mp_bcast_zm, mp_bcast_z3, &
249 mp_bcast_b, mp_bcast_bv, mp_bcast_av, mp_bcast_am, &
250 mp_bcast_i_src, mp_bcast_iv_src, mp_bcast_im_src, mp_bcast_i3_src, &
251 mp_bcast_l_src, mp_bcast_lv_src, mp_bcast_lm_src, mp_bcast_l3_src, &
252 mp_bcast_r_src, mp_bcast_rv_src, mp_bcast_rm_src, mp_bcast_r3_src, &
253 mp_bcast_d_src, mp_bcast_dv_src, mp_bcast_dm_src, mp_bcast_d3_src, &
254 mp_bcast_c_src, mp_bcast_cv_src, mp_bcast_cm_src, mp_bcast_c3_src, &
255 mp_bcast_z_src, mp_bcast_zv_src, mp_bcast_zm_src, mp_bcast_z3_src, &
256 mp_bcast_b_src, mp_bcast_bv_src, mp_bcast_av_src, mp_bcast_am_src
257 generic,
PUBLIC :: bcast => mp_bcast_i, mp_bcast_iv, mp_bcast_im, mp_bcast_i3, &
258 mp_bcast_l, mp_bcast_lv, mp_bcast_lm, mp_bcast_l3, &
259 mp_bcast_r, mp_bcast_rv, mp_bcast_rm, mp_bcast_r3, &
260 mp_bcast_d, mp_bcast_dv, mp_bcast_dm, mp_bcast_d3, &
261 mp_bcast_c, mp_bcast_cv, mp_bcast_cm, mp_bcast_c3, &
262 mp_bcast_z, mp_bcast_zv, mp_bcast_zm, mp_bcast_z3, &
263 mp_bcast_b, mp_bcast_bv, mp_bcast_av, mp_bcast_am, &
264 mp_bcast_i_src, mp_bcast_iv_src, mp_bcast_im_src, mp_bcast_i3_src, &
265 mp_bcast_l_src, mp_bcast_lv_src, mp_bcast_lm_src, mp_bcast_l3_src, &
266 mp_bcast_r_src, mp_bcast_rv_src, mp_bcast_rm_src, mp_bcast_r3_src, &
267 mp_bcast_d_src, mp_bcast_dv_src, mp_bcast_dm_src, mp_bcast_d3_src, &
268 mp_bcast_c_src, mp_bcast_cv_src, mp_bcast_cm_src, mp_bcast_c3_src, &
269 mp_bcast_z_src, mp_bcast_zv_src, mp_bcast_zm_src, mp_bcast_z3_src, &
270 mp_bcast_b_src, mp_bcast_bv_src, mp_bcast_av_src, mp_bcast_am_src
272 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_ibcast_i, mp_ibcast_iv, &
273 mp_ibcast_l, mp_ibcast_lv, mp_ibcast_r, mp_ibcast_rv, &
274 mp_ibcast_d, mp_ibcast_dv, mp_ibcast_c, mp_ibcast_cv, &
275 mp_ibcast_z, mp_ibcast_zv
276 generic,
PUBLIC :: ibcast => mp_ibcast_i, mp_ibcast_iv, &
277 mp_ibcast_l, mp_ibcast_lv, mp_ibcast_r, mp_ibcast_rv, &
278 mp_ibcast_d, mp_ibcast_dv, mp_ibcast_c, mp_ibcast_cv, &
279 mp_ibcast_z, mp_ibcast_zv
281 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: &
282 mp_sum_i, mp_sum_iv, mp_sum_im, mp_sum_im3, mp_sum_im4, &
283 mp_sum_l, mp_sum_lv, mp_sum_lm, mp_sum_lm3, mp_sum_lm4, &
284 mp_sum_r, mp_sum_rv, mp_sum_rm, mp_sum_rm3, mp_sum_rm4, &
285 mp_sum_d, mp_sum_dv, mp_sum_dm, mp_sum_dm3, mp_sum_dm4, &
286 mp_sum_c, mp_sum_cv, mp_sum_cm, mp_sum_cm3, mp_sum_cm4, &
287 mp_sum_z, mp_sum_zv, mp_sum_zm, mp_sum_zm3, mp_sum_zm4, &
288 mp_sum_root_iv, mp_sum_root_im, mp_sum_root_lv, mp_sum_root_lm, &
289 mp_sum_root_rv, mp_sum_root_rm, mp_sum_root_dv, mp_sum_root_dm, &
290 mp_sum_root_cv, mp_sum_root_cm, mp_sum_root_zv, mp_sum_root_zm, &
292 generic,
PUBLIC :: sum => mp_sum_i, mp_sum_iv, mp_sum_im, mp_sum_im3, mp_sum_im4, &
293 mp_sum_l, mp_sum_lv, mp_sum_lm, mp_sum_lm3, mp_sum_lm4, &
294 mp_sum_r, mp_sum_rv, mp_sum_rm, mp_sum_rm3, mp_sum_rm4, &
295 mp_sum_d, mp_sum_dv, mp_sum_dm, mp_sum_dm3, mp_sum_dm4, &
296 mp_sum_c, mp_sum_cv, mp_sum_cm, mp_sum_cm3, mp_sum_cm4, &
297 mp_sum_z, mp_sum_zv, mp_sum_zm, mp_sum_zm3, mp_sum_zm4, &
298 mp_sum_root_iv, mp_sum_root_im, mp_sum_root_lv, mp_sum_root_lm, &
299 mp_sum_root_rv, mp_sum_root_rm, mp_sum_root_dv, mp_sum_root_dm, &
300 mp_sum_root_cv, mp_sum_root_cm, mp_sum_root_zv, mp_sum_root_zm, &
303 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_isum_iv, &
304 mp_isum_lv, mp_isum_rv, mp_isum_dv, mp_isum_cv, &
305 mp_isum_zv, mp_isum_bv
306 generic,
PUBLIC ::
isum => mp_isum_iv, &
307 mp_isum_lv, mp_isum_rv, mp_isum_dv, mp_isum_cv, &
308 mp_isum_zv, mp_isum_bv
310 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_sum_partial_im, &
311 mp_sum_partial_lm, mp_sum_partial_rm, mp_sum_partial_dm, &
312 mp_sum_partial_cm, mp_sum_partial_zm
313 generic,
PUBLIC :: sum_partial => mp_sum_partial_im, &
314 mp_sum_partial_lm, mp_sum_partial_rm, mp_sum_partial_dm, &
315 mp_sum_partial_cm, mp_sum_partial_zm
317 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_max_i, mp_max_iv, &
318 mp_max_l, mp_max_lv, mp_max_r, mp_max_rv, &
319 mp_max_d, mp_max_dv, mp_max_c, mp_max_cv, &
320 mp_max_z, mp_max_zv, mp_max_root_i, mp_max_root_l, &
321 mp_max_root_r, mp_max_root_d, mp_max_root_c, mp_max_root_z, &
322 mp_max_root_im, mp_max_root_lm, mp_max_root_rm, mp_max_root_dm, &
323 mp_max_root_cm, mp_max_root_zm
324 generic,
PUBLIC :: max => mp_max_i, mp_max_iv, &
325 mp_max_l, mp_max_lv, mp_max_r, mp_max_rv, &
326 mp_max_d, mp_max_dv, mp_max_c, mp_max_cv, &
327 mp_max_z, mp_max_zv, mp_max_root_i, mp_max_root_l, &
328 mp_max_root_r, mp_max_root_d, mp_max_root_c, mp_max_root_z, &
329 mp_max_root_im, mp_max_root_lm, mp_max_root_rm, mp_max_root_dm, &
330 mp_max_root_cm, mp_max_root_zm
332 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_min_i, mp_min_iv, &
333 mp_min_l, mp_min_lv, mp_min_r, mp_min_rv, &
334 mp_min_d, mp_min_dv, mp_min_c, mp_min_cv, &
336 generic,
PUBLIC :: min => mp_min_i, mp_min_iv, &
337 mp_min_l, mp_min_lv, mp_min_r, mp_min_rv, &
338 mp_min_d, mp_min_dv, mp_min_c, mp_min_cv, &
341 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: &
342 mp_sum_scatter_iv, mp_sum_scatter_lv, mp_sum_scatter_rv, &
343 mp_sum_scatter_dv, mp_sum_scatter_cv, mp_sum_scatter_zv
344 generic,
PUBLIC :: sum_scatter => &
345 mp_sum_scatter_iv, mp_sum_scatter_lv, mp_sum_scatter_rv, &
346 mp_sum_scatter_dv, mp_sum_scatter_cv, mp_sum_scatter_zv
348 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_prod_r, mp_prod_d, mp_prod_c, mp_prod_z
349 generic,
PUBLIC :: prod => mp_prod_r, mp_prod_d, mp_prod_c, mp_prod_z
351 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_gather_i, mp_gather_iv, mp_gather_im, &
352 mp_gather_l, mp_gather_lv, mp_gather_lm, &
353 mp_gather_r, mp_gather_rv, mp_gather_rm, &
354 mp_gather_d, mp_gather_dv, mp_gather_dm, &
355 mp_gather_c, mp_gather_cv, mp_gather_cm, &
356 mp_gather_z, mp_gather_zv, mp_gather_zm, &
357 mp_gather_i_src, mp_gather_iv_src, mp_gather_im_src, &
358 mp_gather_l_src, mp_gather_lv_src, mp_gather_lm_src, &
359 mp_gather_r_src, mp_gather_rv_src, mp_gather_rm_src, &
360 mp_gather_d_src, mp_gather_dv_src, mp_gather_dm_src, &
361 mp_gather_c_src, mp_gather_cv_src, mp_gather_cm_src, &
362 mp_gather_z_src, mp_gather_zv_src, mp_gather_zm_src
363 generic,
PUBLIC :: gather => mp_gather_i, mp_gather_iv, mp_gather_im, &
364 mp_gather_l, mp_gather_lv, mp_gather_lm, &
365 mp_gather_r, mp_gather_rv, mp_gather_rm, &
366 mp_gather_d, mp_gather_dv, mp_gather_dm, &
367 mp_gather_c, mp_gather_cv, mp_gather_cm, &
368 mp_gather_z, mp_gather_zv, mp_gather_zm, &
369 mp_gather_i_src, mp_gather_iv_src, mp_gather_im_src, &
370 mp_gather_l_src, mp_gather_lv_src, mp_gather_lm_src, &
371 mp_gather_r_src, mp_gather_rv_src, mp_gather_rm_src, &
372 mp_gather_d_src, mp_gather_dv_src, mp_gather_dm_src, &
373 mp_gather_c_src, mp_gather_cv_src, mp_gather_cm_src, &
374 mp_gather_z_src, mp_gather_zv_src, mp_gather_zm_src
376 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_gatherv_iv, &
377 mp_gatherv_lv, mp_gatherv_rv, mp_gatherv_dv, &
378 mp_gatherv_cv, mp_gatherv_zv, mp_gatherv_lm2, mp_gatherv_rm2, &
379 mp_gatherv_dm2, mp_gatherv_cm2, mp_gatherv_zm2, mp_gatherv_iv_src, &
380 mp_gatherv_lv_src, mp_gatherv_rv_src, mp_gatherv_dv_src, &
381 mp_gatherv_cv_src, mp_gatherv_zv_src, mp_gatherv_lm2_src, mp_gatherv_rm2_src, &
382 mp_gatherv_dm2_src, mp_gatherv_cm2_src, mp_gatherv_zm2_src
383 generic,
PUBLIC :: gatherv => mp_gatherv_iv, &
384 mp_gatherv_lv, mp_gatherv_rv, mp_gatherv_dv, &
385 mp_gatherv_cv, mp_gatherv_zv, mp_gatherv_lm2, mp_gatherv_rm2, &
386 mp_gatherv_dm2, mp_gatherv_cm2, mp_gatherv_zm2, mp_gatherv_iv_src, &
387 mp_gatherv_lv_src, mp_gatherv_rv_src, mp_gatherv_dv_src, &
388 mp_gatherv_cv_src, mp_gatherv_zv_src, mp_gatherv_lm2_src, mp_gatherv_rm2_src, &
389 mp_gatherv_dm2_src, mp_gatherv_cm2_src, mp_gatherv_zm2_src
391 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_igatherv_iv, &
392 mp_igatherv_lv, mp_igatherv_rv, mp_igatherv_dv, &
393 mp_igatherv_cv, mp_igatherv_zv
394 generic,
PUBLIC :: igatherv => mp_igatherv_iv, &
395 mp_igatherv_lv, mp_igatherv_rv, mp_igatherv_dv, &
396 mp_igatherv_cv, mp_igatherv_zv
398 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_allgather_i, mp_allgather_i2, &
399 mp_allgather_i12, mp_allgather_i23, mp_allgather_i34, &
400 mp_allgather_i22, mp_allgather_l, mp_allgather_l2, &
401 mp_allgather_l12, mp_allgather_l23, mp_allgather_l34, &
402 mp_allgather_l22, mp_allgather_r, mp_allgather_r2, &
403 mp_allgather_r12, mp_allgather_r23, mp_allgather_r34, &
404 mp_allgather_r22, mp_allgather_d, mp_allgather_d2, &
405 mp_allgather_d12, mp_allgather_d23, mp_allgather_d34, &
406 mp_allgather_d22, mp_allgather_c, mp_allgather_c2, &
407 mp_allgather_c12, mp_allgather_c23, mp_allgather_c34, &
408 mp_allgather_c22, mp_allgather_z, mp_allgather_z2, &
409 mp_allgather_z12, mp_allgather_z23, mp_allgather_z34, &
411 generic,
PUBLIC :: allgather => mp_allgather_i, mp_allgather_i2, &
412 mp_allgather_i12, mp_allgather_i23, mp_allgather_i34, &
413 mp_allgather_i22, mp_allgather_l, mp_allgather_l2, &
414 mp_allgather_l12, mp_allgather_l23, mp_allgather_l34, &
415 mp_allgather_l22, mp_allgather_r, mp_allgather_r2, &
416 mp_allgather_r12, mp_allgather_r23, mp_allgather_r34, &
417 mp_allgather_r22, mp_allgather_d, mp_allgather_d2, &
418 mp_allgather_d12, mp_allgather_d23, mp_allgather_d34, &
419 mp_allgather_d22, mp_allgather_c, mp_allgather_c2, &
420 mp_allgather_c12, mp_allgather_c23, mp_allgather_c34, &
421 mp_allgather_c22, mp_allgather_z, mp_allgather_z2, &
422 mp_allgather_z12, mp_allgather_z23, mp_allgather_z34, &
425 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_allgatherv_iv, mp_allgatherv_lv, &
426 mp_allgatherv_rv, mp_allgatherv_dv, mp_allgatherv_cv, mp_allgatherv_zv, &
427 mp_allgatherv_im2, mp_allgatherv_lm2, mp_allgatherv_rm2, &
428 mp_allgatherv_dm2, mp_allgatherv_cm2, mp_allgatherv_zm2
429 generic,
PUBLIC :: allgatherv => mp_allgatherv_iv, mp_allgatherv_lv, &
430 mp_allgatherv_rv, mp_allgatherv_dv, mp_allgatherv_cv, mp_allgatherv_zv, &
431 mp_allgatherv_im2, mp_allgatherv_lm2, mp_allgatherv_rm2, &
432 mp_allgatherv_dm2, mp_allgatherv_cm2, mp_allgatherv_zm2
434 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iallgather_i, mp_iallgather_l, &
435 mp_iallgather_r, mp_iallgather_d, mp_iallgather_c, mp_iallgather_z, &
436 mp_iallgather_i11, mp_iallgather_l11, mp_iallgather_r11, mp_iallgather_d11, &
437 mp_iallgather_c11, mp_iallgather_z11, mp_iallgather_i13, mp_iallgather_l13, &
438 mp_iallgather_r13, mp_iallgather_d13, mp_iallgather_c13, mp_iallgather_z13, &
439 mp_iallgather_i22, mp_iallgather_l22, mp_iallgather_r22, mp_iallgather_d22, &
440 mp_iallgather_c22, mp_iallgather_z22, mp_iallgather_i24, mp_iallgather_l24, &
441 mp_iallgather_r24, mp_iallgather_d24, mp_iallgather_c24, mp_iallgather_z24, &
442 mp_iallgather_i33, mp_iallgather_l33, mp_iallgather_r33, mp_iallgather_d33, &
443 mp_iallgather_c33, mp_iallgather_z33
444 generic,
PUBLIC :: iallgather => mp_iallgather_i, mp_iallgather_l, &
445 mp_iallgather_r, mp_iallgather_d, mp_iallgather_c, mp_iallgather_z, &
446 mp_iallgather_i11, mp_iallgather_l11, mp_iallgather_r11, mp_iallgather_d11, &
447 mp_iallgather_c11, mp_iallgather_z11, mp_iallgather_i13, mp_iallgather_l13, &
448 mp_iallgather_r13, mp_iallgather_d13, mp_iallgather_c13, mp_iallgather_z13, &
449 mp_iallgather_i22, mp_iallgather_l22, mp_iallgather_r22, mp_iallgather_d22, &
450 mp_iallgather_c22, mp_iallgather_z22, mp_iallgather_i24, mp_iallgather_l24, &
451 mp_iallgather_r24, mp_iallgather_d24, mp_iallgather_c24, mp_iallgather_z24, &
452 mp_iallgather_i33, mp_iallgather_l33, mp_iallgather_r33, mp_iallgather_d33, &
453 mp_iallgather_c33, mp_iallgather_z33
455 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iallgatherv_iv, mp_iallgatherv_iv2, &
456 mp_iallgatherv_lv, mp_iallgatherv_lv2, mp_iallgatherv_rv, mp_iallgatherv_rv2, &
457 mp_iallgatherv_dv, mp_iallgatherv_dv2, mp_iallgatherv_cv, mp_iallgatherv_cv2, &
458 mp_iallgatherv_zv, mp_iallgatherv_zv2
459 generic,
PUBLIC :: iallgatherv => mp_iallgatherv_iv, mp_iallgatherv_iv2, &
460 mp_iallgatherv_lv, mp_iallgatherv_lv2, mp_iallgatherv_rv, mp_iallgatherv_rv2, &
461 mp_iallgatherv_dv, mp_iallgatherv_dv2, mp_iallgatherv_cv, mp_iallgatherv_cv2, &
462 mp_iallgatherv_zv, mp_iallgatherv_zv2
464 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_scatter_iv, mp_scatter_lv, &
465 mp_scatter_rv, mp_scatter_dv, mp_scatter_cv, mp_scatter_zv
466 generic,
PUBLIC :: scatter => mp_scatter_iv, mp_scatter_lv, &
467 mp_scatter_rv, mp_scatter_dv, mp_scatter_cv, mp_scatter_zv
469 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iscatter_i, mp_iscatter_l, &
470 mp_iscatter_r, mp_iscatter_d, mp_iscatter_c, mp_iscatter_z, &
471 mp_iscatter_iv2, mp_iscatter_lv2, mp_iscatter_rv2, mp_iscatter_dv2, &
472 mp_iscatter_cv2, mp_iscatter_zv2
473 generic,
PUBLIC :: iscatter => mp_iscatter_i, mp_iscatter_l, &
474 mp_iscatter_r, mp_iscatter_d, mp_iscatter_c, mp_iscatter_z, &
475 mp_iscatter_iv2, mp_iscatter_lv2, mp_iscatter_rv2, mp_iscatter_dv2, &
476 mp_iscatter_cv2, mp_iscatter_zv2
478 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iscatterv_iv, mp_iscatterv_lv, &
479 mp_iscatterv_rv, mp_iscatterv_dv, mp_iscatterv_cv, mp_iscatterv_zv
480 generic,
PUBLIC :: iscatterv => mp_iscatterv_iv, mp_iscatterv_lv, &
481 mp_iscatterv_rv, mp_iscatterv_dv, mp_iscatterv_cv, mp_iscatterv_zv
483 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_alltoall_i, mp_alltoall_i22, mp_alltoall_i33, &
484 mp_alltoall_i44, mp_alltoall_i55, mp_alltoall_i45, mp_alltoall_i34, &
485 mp_alltoall_i11v, mp_alltoall_i22v, mp_alltoall_i54, &
486 mp_alltoall_l, mp_alltoall_l22, mp_alltoall_l33, &
487 mp_alltoall_l44, mp_alltoall_l55, mp_alltoall_l45, mp_alltoall_l34, &
488 mp_alltoall_l11v, mp_alltoall_l22v, mp_alltoall_l54, &
489 mp_alltoall_r, mp_alltoall_r22, mp_alltoall_r33, &
490 mp_alltoall_r44, mp_alltoall_r55, mp_alltoall_r45, mp_alltoall_r34, &
491 mp_alltoall_r11v, mp_alltoall_r22v, mp_alltoall_r54, &
492 mp_alltoall_d, mp_alltoall_d22, mp_alltoall_d33, &
493 mp_alltoall_d44, mp_alltoall_d55, mp_alltoall_d45, mp_alltoall_d34, &
494 mp_alltoall_d11v, mp_alltoall_d22v, mp_alltoall_d54, &
495 mp_alltoall_c, mp_alltoall_c22, mp_alltoall_c33, &
496 mp_alltoall_c44, mp_alltoall_c55, mp_alltoall_c45, mp_alltoall_c34, &
497 mp_alltoall_c11v, mp_alltoall_c22v, mp_alltoall_c54, &
498 mp_alltoall_z, mp_alltoall_z22, mp_alltoall_z33, &
499 mp_alltoall_z44, mp_alltoall_z55, mp_alltoall_z45, mp_alltoall_z34, &
500 mp_alltoall_z11v, mp_alltoall_z22v, mp_alltoall_z54
501 generic,
PUBLIC :: alltoall => mp_alltoall_i, mp_alltoall_i22, mp_alltoall_i33, &
502 mp_alltoall_i44, mp_alltoall_i55, mp_alltoall_i45, mp_alltoall_i34, &
503 mp_alltoall_i11v, mp_alltoall_i22v, mp_alltoall_i54, &
504 mp_alltoall_l, mp_alltoall_l22, mp_alltoall_l33, &
505 mp_alltoall_l44, mp_alltoall_l55, mp_alltoall_l45, mp_alltoall_l34, &
506 mp_alltoall_l11v, mp_alltoall_l22v, mp_alltoall_l54, &
507 mp_alltoall_r, mp_alltoall_r22, mp_alltoall_r33, &
508 mp_alltoall_r44, mp_alltoall_r55, mp_alltoall_r45, mp_alltoall_r34, &
509 mp_alltoall_r11v, mp_alltoall_r22v, mp_alltoall_r54, &
510 mp_alltoall_d, mp_alltoall_d22, mp_alltoall_d33, &
511 mp_alltoall_d44, mp_alltoall_d55, mp_alltoall_d45, mp_alltoall_d34, &
512 mp_alltoall_d11v, mp_alltoall_d22v, mp_alltoall_d54, &
513 mp_alltoall_c, mp_alltoall_c22, mp_alltoall_c33, &
514 mp_alltoall_c44, mp_alltoall_c55, mp_alltoall_c45, mp_alltoall_c34, &
515 mp_alltoall_c11v, mp_alltoall_c22v, mp_alltoall_c54, &
516 mp_alltoall_z, mp_alltoall_z22, mp_alltoall_z33, &
517 mp_alltoall_z44, mp_alltoall_z55, mp_alltoall_z45, mp_alltoall_z34, &
518 mp_alltoall_z11v, mp_alltoall_z22v, mp_alltoall_z54
520 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_send_i, mp_send_iv, mp_send_im2, mp_send_im3, &
521 mp_send_l, mp_send_lv, mp_send_lm2, mp_send_lm3, &
522 mp_send_r, mp_send_rv, mp_send_rm2, mp_send_rm3, &
523 mp_send_d, mp_send_dv, mp_send_dm2, mp_send_dm3, &
524 mp_send_c, mp_send_cv, mp_send_cm2, mp_send_cm3, &
525 mp_send_z, mp_send_zv, mp_send_zm2, mp_send_zm3
526 generic,
PUBLIC :: send => mp_send_i, mp_send_iv, mp_send_im2, mp_send_im3, &
527 mp_send_l, mp_send_lv, mp_send_lm2, mp_send_lm3, &
528 mp_send_r, mp_send_rv, mp_send_rm2, mp_send_rm3, &
529 mp_send_d, mp_send_dv, mp_send_dm2, mp_send_dm3, &
530 mp_send_c, mp_send_cv, mp_send_cm2, mp_send_cm3, &
531 mp_send_z, mp_send_zv, mp_send_zm2, mp_send_zm3
533 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_recv_i, mp_recv_iv, mp_recv_im2, mp_recv_im3, &
534 mp_recv_l, mp_recv_lv, mp_recv_lm2, mp_recv_lm3, &
535 mp_recv_r, mp_recv_rv, mp_recv_rm2, mp_recv_rm3, &
536 mp_recv_d, mp_recv_dv, mp_recv_dm2, mp_recv_dm3, &
537 mp_recv_c, mp_recv_cv, mp_recv_cm2, mp_recv_cm3, &
538 mp_recv_z, mp_recv_zv, mp_recv_zm2, mp_recv_zm3
539 generic,
PUBLIC :: recv => mp_recv_i, mp_recv_iv, mp_recv_im2, mp_recv_im3, &
540 mp_recv_l, mp_recv_lv, mp_recv_lm2, mp_recv_lm3, &
541 mp_recv_r, mp_recv_rv, mp_recv_rm2, mp_recv_rm3, &
542 mp_recv_d, mp_recv_dv, mp_recv_dm2, mp_recv_dm3, &
543 mp_recv_c, mp_recv_cv, mp_recv_cm2, mp_recv_cm3, &
544 mp_recv_z, mp_recv_zv, mp_recv_zm2, mp_recv_zm3
546 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_isendrecv_i, mp_isendrecv_iv, &
547 mp_isendrecv_l, mp_isendrecv_lv, mp_isendrecv_r, mp_isendrecv_rv, &
548 mp_isendrecv_d, mp_isendrecv_dv, mp_isendrecv_c, mp_isendrecv_cv, &
549 mp_isendrecv_z, mp_isendrecv_zv
550 generic,
PUBLIC :: isendrecv => mp_isendrecv_i, mp_isendrecv_iv, &
551 mp_isendrecv_l, mp_isendrecv_lv, mp_isendrecv_r, mp_isendrecv_rv, &
552 mp_isendrecv_d, mp_isendrecv_dv, mp_isendrecv_c, mp_isendrecv_cv, &
553 mp_isendrecv_z, mp_isendrecv_zv
555 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_isend_iv, mp_isend_im2, mp_isend_im3, mp_isend_im4, &
556 mp_isend_lv, mp_isend_lm2, mp_isend_lm3, mp_isend_lm4, &
557 mp_isend_rv, mp_isend_rm2, mp_isend_rm3, mp_isend_rm4, &
558 mp_isend_dv, mp_isend_dm2, mp_isend_dm3, mp_isend_dm4, &
559 mp_isend_cv, mp_isend_cm2, mp_isend_cm3, mp_isend_cm4, &
560 mp_isend_zv, mp_isend_zm2, mp_isend_zm3, mp_isend_zm4, &
561 mp_isend_bv, mp_isend_bm3, mp_isend_custom
562 generic,
PUBLIC :: isend => mp_isend_iv, mp_isend_im2, mp_isend_im3, mp_isend_im4, &
563 mp_isend_lv, mp_isend_lm2, mp_isend_lm3, mp_isend_lm4, &
564 mp_isend_rv, mp_isend_rm2, mp_isend_rm3, mp_isend_rm4, &
565 mp_isend_dv, mp_isend_dm2, mp_isend_dm3, mp_isend_dm4, &
566 mp_isend_cv, mp_isend_cm2, mp_isend_cm3, mp_isend_cm4, &
567 mp_isend_zv, mp_isend_zm2, mp_isend_zm3, mp_isend_zm4, &
568 mp_isend_bv, mp_isend_bm3, mp_isend_custom
570 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_irecv_iv, mp_irecv_im2, mp_irecv_im3, mp_irecv_im4, &
571 mp_irecv_lv, mp_irecv_lm2, mp_irecv_lm3, mp_irecv_lm4, &
572 mp_irecv_rv, mp_irecv_rm2, mp_irecv_rm3, mp_irecv_rm4, &
573 mp_irecv_dv, mp_irecv_dm2, mp_irecv_dm3, mp_irecv_dm4, &
574 mp_irecv_cv, mp_irecv_cm2, mp_irecv_cm3, mp_irecv_cm4, &
575 mp_irecv_zv, mp_irecv_zm2, mp_irecv_zm3, mp_irecv_zm4, &
576 mp_irecv_bv, mp_irecv_bm3, mp_irecv_custom
577 generic,
PUBLIC :: irecv => mp_irecv_iv, mp_irecv_im2, mp_irecv_im3, mp_irecv_im4, &
578 mp_irecv_lv, mp_irecv_lm2, mp_irecv_lm3, mp_irecv_lm4, &
579 mp_irecv_rv, mp_irecv_rm2, mp_irecv_rm3, mp_irecv_rm4, &
580 mp_irecv_dv, mp_irecv_dm2, mp_irecv_dm3, mp_irecv_dm4, &
581 mp_irecv_cv, mp_irecv_cm2, mp_irecv_cm3, mp_irecv_cm4, &
582 mp_irecv_zv, mp_irecv_zm2, mp_irecv_zm3, mp_irecv_zm4, &
583 mp_irecv_bv, mp_irecv_bm3, mp_irecv_custom
585 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: probe => mp_probe
587 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: sync => mp_sync
588 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: isync => mp_isync
590 PROCEDURE,
PUBLIC, pass(comm1), non_overridable :: compare => mp_comm_compare
591 PROCEDURE,
PUBLIC, pass(comm1), non_overridable :: rank_compare => mp_rank_compare
593 PROCEDURE,
PUBLIC, pass(comm2), non_overridable :: from_dup => mp_comm_dup
594 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: mp_comm_free
595 generic,
PUBLIC :: free => mp_comm_free
597 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: mp_comm_init
598 generic,
PUBLIC :: init => mp_comm_init
600 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: get_size => mp_comm_size
601 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: get_rank => mp_comm_rank
602 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: get_ndims => mp_comm_get_ndims
603 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: is_source => mp_comm_is_source
606 PROCEDURE,
PRIVATE, pass(sub_comm), non_overridable :: mp_comm_split, mp_comm_split_direct
607 generic,
PUBLIC :: from_split => mp_comm_split, mp_comm_split_direct
608 PROCEDURE,
PUBLIC, pass(mp_new_comm), non_overridable :: from_reordering => mp_reordering
609 PROCEDURE,
PUBLIC, pass(comm_new), non_overridable :: mp_comm_assign
610 generic,
PUBLIC ::
ASSIGNMENT(=) => mp_comm_assign
613 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_tag_ub
614 generic,
PUBLIC :: get_tag_ub => mp_comm_get_tag_ub
615 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_host_rank
616 generic,
PUBLIC :: get_host_rank => mp_comm_get_host_rank
617 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_io_rank
618 generic,
PUBLIC :: get_io_rank => mp_comm_get_io_rank
619 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_wtime_is_global
620 generic,
PUBLIC :: get_wtime_is_global => mp_comm_get_wtime_is_global
625 mpi_request_type :: handle = mp_request_null_handle
627 PROCEDURE,
PUBLIC, non_overridable :: set_handle => mp_request_type_set_handle
628 PROCEDURE,
PUBLIC, non_overridable :: get_handle => mp_request_type_get_handle
629 PROCEDURE,
PRIVATE, non_overridable :: mp_request_op_eq
630 PROCEDURE,
PRIVATE, non_overridable :: mp_request_op_neq
631 generic,
PUBLIC ::
OPERATOR(==) => mp_request_op_eq
632 generic,
PUBLIC ::
OPERATOR(/=) => mp_request_op_neq
634 PROCEDURE,
PUBLIC, pass(request), non_overridable :: test => mp_test_1
636 PROCEDURE,
PUBLIC, pass(request), non_overridable :: wait => mp_wait
641 mpi_win_type :: handle = mp_win_null_handle
643 PROCEDURE,
PUBLIC, non_overridable :: set_handle => mp_win_type_set_handle
644 PROCEDURE,
PUBLIC, non_overridable :: get_handle => mp_win_type_get_handle
645 PROCEDURE,
PRIVATE, non_overridable :: mp_win_op_eq
646 PROCEDURE,
PRIVATE, non_overridable :: mp_win_op_neq
647 generic,
PUBLIC ::
OPERATOR(==) => mp_win_op_eq
648 generic,
PUBLIC ::
OPERATOR(/=) => mp_win_op_neq
650 PROCEDURE,
PRIVATE, pass(win), non_overridable :: mp_win_create_iv, mp_win_create_lv, &
651 mp_win_create_rv, mp_win_create_dv, mp_win_create_cv, mp_win_create_zv
652 generic,
PUBLIC :: create => mp_win_create_iv, mp_win_create_lv, &
653 mp_win_create_rv, mp_win_create_dv, mp_win_create_cv, mp_win_create_zv
655 PROCEDURE,
PRIVATE, pass(win), non_overridable :: mp_rget_iv, mp_rget_lv, &
656 mp_rget_rv, mp_rget_dv, mp_rget_cv, mp_rget_zv
657 generic,
PUBLIC :: rget => mp_rget_iv, mp_rget_lv, &
658 mp_rget_rv, mp_rget_dv, mp_rget_cv, mp_rget_zv
660 PROCEDURE,
PUBLIC, pass(win), non_overridable :: free => mp_win_free
661 PROCEDURE,
PUBLIC, pass(win_new), non_overridable :: mp_win_assign
662 generic,
PUBLIC ::
ASSIGNMENT(=) => mp_win_assign
664 PROCEDURE,
PUBLIC, pass(win), non_overridable :: lock_all => mp_win_lock_all
665 PROCEDURE,
PUBLIC, pass(win), non_overridable :: unlock_all => mp_win_unlock_all
666 PROCEDURE,
PUBLIC, pass(win), non_overridable :: flush_all => mp_win_flush_all
671 mpi_file_type :: handle = mp_file_null_handle
673 PROCEDURE,
PUBLIC, non_overridable :: set_handle => mp_file_type_set_handle
674 PROCEDURE,
PUBLIC, non_overridable :: get_handle => mp_file_type_get_handle
675 PROCEDURE,
PRIVATE, non_overridable :: mp_file_op_eq
676 PROCEDURE,
PRIVATE, non_overridable :: mp_file_op_neq
677 generic,
PUBLIC ::
OPERATOR(==) => mp_file_op_eq
678 generic,
PUBLIC ::
OPERATOR(/=) => mp_file_op_neq
680 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_write_at_ch, mp_file_write_at_chv, &
681 mp_file_write_at_i, mp_file_write_at_iv, mp_file_write_at_r, mp_file_write_at_rv, &
682 mp_file_write_at_d, mp_file_write_at_dv, mp_file_write_at_c, mp_file_write_at_cv, &
683 mp_file_write_at_z, mp_file_write_at_zv, mp_file_write_at_l, mp_file_write_at_lv
684 generic,
PUBLIC :: write_at => mp_file_write_at_ch, mp_file_write_at_chv, &
685 mp_file_write_at_i, mp_file_write_at_iv, mp_file_write_at_r, mp_file_write_at_rv, &
686 mp_file_write_at_d, mp_file_write_at_dv, mp_file_write_at_c, mp_file_write_at_cv, &
687 mp_file_write_at_z, mp_file_write_at_zv, mp_file_write_at_l, mp_file_write_at_lv
689 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_write_at_all_ch, mp_file_write_at_all_chv, &
690 mp_file_write_at_all_i, mp_file_write_at_all_iv, mp_file_write_at_all_l, mp_file_write_at_all_lv, &
691 mp_file_write_at_all_r, mp_file_write_at_all_rv, mp_file_write_at_all_d, mp_file_write_at_all_dv, &
692 mp_file_write_at_all_c, mp_file_write_at_all_cv, mp_file_write_at_all_z, mp_file_write_at_all_zv
693 generic,
PUBLIC :: write_at_all => mp_file_write_at_all_ch, mp_file_write_at_all_chv, &
694 mp_file_write_at_all_i, mp_file_write_at_all_iv, mp_file_write_at_all_l, mp_file_write_at_all_lv, &
695 mp_file_write_at_all_r, mp_file_write_at_all_rv, mp_file_write_at_all_d, mp_file_write_at_all_dv, &
696 mp_file_write_at_all_c, mp_file_write_at_all_cv, mp_file_write_at_all_z, mp_file_write_at_all_zv
698 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_read_at_ch, mp_file_read_at_chv, &
699 mp_file_read_at_i, mp_file_read_at_iv, mp_file_read_at_r, mp_file_read_at_rv, &
700 mp_file_read_at_d, mp_file_read_at_dv, mp_file_read_at_c, mp_file_read_at_cv, &
701 mp_file_read_at_z, mp_file_read_at_zv, mp_file_read_at_l, mp_file_read_at_lv
702 generic,
PUBLIC :: read_at => mp_file_read_at_ch, mp_file_read_at_chv, &
703 mp_file_read_at_i, mp_file_read_at_iv, mp_file_read_at_r, mp_file_read_at_rv, &
704 mp_file_read_at_d, mp_file_read_at_dv, mp_file_read_at_c, mp_file_read_at_cv, &
705 mp_file_read_at_z, mp_file_read_at_zv, mp_file_read_at_l, mp_file_read_at_lv
707 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_read_at_all_ch, mp_file_read_at_all_chv, &
708 mp_file_read_at_all_i, mp_file_read_at_all_iv, mp_file_read_at_all_l, mp_file_read_at_all_lv, &
709 mp_file_read_at_all_r, mp_file_read_at_all_rv, mp_file_read_at_all_d, mp_file_read_at_all_dv, &
710 mp_file_read_at_all_c, mp_file_read_at_all_cv, mp_file_read_at_all_z, mp_file_read_at_all_zv
711 generic,
PUBLIC :: read_at_all => mp_file_read_at_all_ch, mp_file_read_at_all_chv, &
712 mp_file_read_at_all_i, mp_file_read_at_all_iv, mp_file_read_at_all_l, mp_file_read_at_all_lv, &
713 mp_file_read_at_all_r, mp_file_read_at_all_rv, mp_file_read_at_all_d, mp_file_read_at_all_dv, &
714 mp_file_read_at_all_c, mp_file_read_at_all_cv, mp_file_read_at_all_z, mp_file_read_at_all_zv
716 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: open => mp_file_open
717 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: close => mp_file_close
718 PROCEDURE,
PRIVATE, pass(fh_new), non_overridable :: mp_file_assign
719 generic,
PUBLIC ::
ASSIGNMENT(=) => mp_file_assign
721 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: get_size => mp_file_get_size
722 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: get_position => mp_file_get_position
724 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: read_all => mp_file_read_all_chv
725 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: write_all => mp_file_write_all_chv
730 mpi_info_type :: handle = mp_info_null_handle
732 PROCEDURE, NON_OVERRIDABLE :: set_handle => mp_info_type_set_handle
733 PROCEDURE, non_overridable :: get_handle => mp_info_type_get_handle
734 PROCEDURE,
PRIVATE, non_overridable :: mp_info_op_eq
735 PROCEDURE,
PRIVATE, non_overridable :: mp_info_op_neq
736 generic,
PUBLIC ::
OPERATOR(==) => mp_info_op_eq
737 generic,
PUBLIC ::
OPERATOR(/=) => mp_info_op_neq
741 INTEGER,
DIMENSION(:),
ALLOCATABLE,
PUBLIC :: mepos_cart, num_pe_cart
742 LOGICAL,
DIMENSION(:),
ALLOCATABLE,
PUBLIC :: periodic
744 PROCEDURE,
PUBLIC, pass(comm_cart), non_overridable :: create => mp_cart_create
745 PROCEDURE,
PUBLIC, pass(sub_comm), non_overridable :: from_sub => mp_cart_sub
747 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: get_info_cart => mp_cart_get
749 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: coords => mp_cart_coords
750 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: rank_cart => mp_cart_rank
766 LOGICAL :: owns_group = .true.
767 INTEGER :: ref_count = -1
769 PROCEDURE,
PUBLIC, pass(para_env), non_overridable :: retain => mp_para_env_retain
770 PROCEDURE,
PUBLIC, pass(para_env), non_overridable :: is_valid => mp_para_env_is_valid
803 LOGICAL :: owns_group = .true.
804 INTEGER :: ref_count = -1
806 PROCEDURE,
PUBLIC, pass(cart), non_overridable :: retain => mp_para_cart_retain
807 PROCEDURE,
PUBLIC, pass(cart), non_overridable :: is_valid => mp_para_cart_is_valid
819#if !defined(__parallel)
821 INTEGER,
PARAMETER,
PRIVATE :: mp_comm_default_handle = 1
838 PUBLIC :: cp2k_is_parallel
871 MODULE PROCEDURE mp_waitall_1, mp_waitall_2
875 MODULE PROCEDURE mp_testall_tv
879 MODULE PROCEDURE mp_testany_1, mp_testany_2
882 INTERFACE mp_type_free
883 MODULE PROCEDURE mp_type_free_m, mp_type_free_v
891 MODULE PROCEDURE mp_allocate_i, &
900 MODULE PROCEDURE mp_deallocate_i, &
909 MODULE PROCEDURE mp_type_make_struct
910 MODULE PROCEDURE mp_type_make_i, mp_type_make_l, &
911 mp_type_make_r, mp_type_make_d, &
912 mp_type_make_c, mp_type_make_z
915 INTERFACE mp_alloc_mem
916 MODULE PROCEDURE mp_alloc_mem_i, mp_alloc_mem_l, &
917 mp_alloc_mem_d, mp_alloc_mem_z, &
918 mp_alloc_mem_r, mp_alloc_mem_c
921 INTERFACE mp_free_mem
922 MODULE PROCEDURE mp_free_mem_i, mp_free_mem_l, &
923 mp_free_mem_d, mp_free_mem_z, &
924 mp_free_mem_r, mp_free_mem_c
928 TYPE mp_indexing_meta_type
929 INTEGER,
DIMENSION(:),
POINTER :: index => null(), chunks => null()
930 END TYPE mp_indexing_meta_type
933 mpi_data_type :: type_handle = mp_datatype_null_handle
934 INTEGER :: length = -1
935#if defined(__parallel)
936 INTEGER(kind=mpi_address_kind) :: base = -1
938 INTEGER(kind=int_4),
DIMENSION(:),
POINTER :: data_i => null()
939 INTEGER(kind=int_8),
DIMENSION(:),
POINTER :: data_l => null()
940 REAL(kind=
real_4),
DIMENSION(:),
POINTER :: data_r => null()
941 REAL(kind=
real_8),
DIMENSION(:),
POINTER :: data_d => null()
942 COMPLEX(kind=real_4),
DIMENSION(:),
POINTER :: data_c => null()
943 COMPLEX(kind=real_8),
DIMENSION(:),
POINTER :: data_z => null()
945 INTEGER :: vector_descriptor(2) = -1
946 LOGICAL :: has_indexing = .false.
947 TYPE(mp_indexing_meta_type) :: index_descriptor = mp_indexing_meta_type()
950 TYPE mp_file_indexing_meta_type
951 INTEGER,
DIMENSION(:),
POINTER :: index => null()
952 INTEGER(kind=file_offset), &
953 DIMENSION(:),
POINTER :: chunks => null()
954 END TYPE mp_file_indexing_meta_type
957 mpi_data_type :: type_handle = mp_datatype_null_handle
958 INTEGER :: length = -1
959 LOGICAL :: has_indexing = .false.
960 TYPE(mp_file_indexing_meta_type) :: index_descriptor = mp_file_indexing_meta_type()
964 INTEGER,
PARAMETER ::
intlen = bit_size(0)/8
965 INTEGER,
PARAMETER :: reallen = 8
966 INTEGER,
PARAMETER :: loglen = bit_size(0)/8
967 INTEGER,
PARAMETER :: charlen = 1
973 LOGICAL FUNCTION mp_comm_op_eq(comm1, comm2)
975#if defined(__parallel) && defined(__MPI_F08)
976 mp_comm_op_eq = (comm1%handle%mpi_val == comm2%handle%mpi_val)
978 mp_comm_op_eq = (comm1%handle == comm2%handle)
980 END FUNCTION mp_comm_op_eq
982 LOGICAL FUNCTION mp_comm_op_neq(comm1, comm2)
984#if defined(__parallel) && defined(__MPI_F08)
985 mp_comm_op_neq = (comm1%handle%mpi_val /= comm2%handle%mpi_val)
987 mp_comm_op_neq = (comm1%handle /= comm2%handle)
989 END FUNCTION mp_comm_op_neq
991 ELEMENTAL IMPURE SUBROUTINE mp_comm_type_set_handle(this, handle , ndims)
993 INTEGER,
INTENT(IN) :: handle
994 INTEGER,
INTENT(IN),
OPTIONAL :: ndims
996#if defined(__parallel) && defined(__MPI_F08)
997 this%handle%mpi_val = handle
1004 IF (.NOT.
PRESENT(ndims)) &
1005 CALL cp_abort(__location__, &
1006 "Setup of a cartesian communicator requires information on the number of dimensions!")
1008 IF (
PRESENT(ndims)) this%ndims = ndims
1011 END SUBROUTINE mp_comm_type_set_handle
1013 ELEMENTAL FUNCTION mp_comm_type_get_handle(this)
RESULT(handle)
1017#if defined(__parallel) && defined(__MPI_F08)
1018 handle = this%handle%mpi_val
1020 handle = this%handle
1022 END FUNCTION mp_comm_type_get_handle
1023 LOGICAL FUNCTION mp_request_op_eq(request1, request2)
1025#if defined(__parallel) && defined(__MPI_F08)
1026 mp_request_op_eq = (request1%handle%mpi_val == request2%handle%mpi_val)
1028 mp_request_op_eq = (request1%handle == request2%handle)
1030 END FUNCTION mp_request_op_eq
1032 LOGICAL FUNCTION mp_request_op_neq(request1, request2)
1034#if defined(__parallel) && defined(__MPI_F08)
1035 mp_request_op_neq = (request1%handle%mpi_val /= request2%handle%mpi_val)
1037 mp_request_op_neq = (request1%handle /= request2%handle)
1039 END FUNCTION mp_request_op_neq
1041 ELEMENTAL SUBROUTINE mp_request_type_set_handle(this, handle )
1043 INTEGER,
INTENT(IN) :: handle
1045#if defined(__parallel) && defined(__MPI_F08)
1046 this%handle%mpi_val = handle
1048 this%handle = handle
1052 END SUBROUTINE mp_request_type_set_handle
1054 ELEMENTAL FUNCTION mp_request_type_get_handle(this)
RESULT(handle)
1058#if defined(__parallel) && defined(__MPI_F08)
1059 handle = this%handle%mpi_val
1061 handle = this%handle
1063 END FUNCTION mp_request_type_get_handle
1064 LOGICAL FUNCTION mp_win_op_eq(win1, win2)
1066#if defined(__parallel) && defined(__MPI_F08)
1067 mp_win_op_eq = (win1%handle%mpi_val == win2%handle%mpi_val)
1069 mp_win_op_eq = (win1%handle == win2%handle)
1071 END FUNCTION mp_win_op_eq
1073 LOGICAL FUNCTION mp_win_op_neq(win1, win2)
1075#if defined(__parallel) && defined(__MPI_F08)
1076 mp_win_op_neq = (win1%handle%mpi_val /= win2%handle%mpi_val)
1078 mp_win_op_neq = (win1%handle /= win2%handle)
1080 END FUNCTION mp_win_op_neq
1082 ELEMENTAL SUBROUTINE mp_win_type_set_handle(this, handle )
1084 INTEGER,
INTENT(IN) :: handle
1086#if defined(__parallel) && defined(__MPI_F08)
1087 this%handle%mpi_val = handle
1089 this%handle = handle
1093 END SUBROUTINE mp_win_type_set_handle
1095 ELEMENTAL FUNCTION mp_win_type_get_handle(this)
RESULT(handle)
1099#if defined(__parallel) && defined(__MPI_F08)
1100 handle = this%handle%mpi_val
1102 handle = this%handle
1104 END FUNCTION mp_win_type_get_handle
1105 LOGICAL FUNCTION mp_file_op_eq(file1, file2)
1107#if defined(__parallel) && defined(__MPI_F08)
1108 mp_file_op_eq = (file1%handle%mpi_val == file2%handle%mpi_val)
1110 mp_file_op_eq = (file1%handle == file2%handle)
1112 END FUNCTION mp_file_op_eq
1114 LOGICAL FUNCTION mp_file_op_neq(file1, file2)
1116#if defined(__parallel) && defined(__MPI_F08)
1117 mp_file_op_neq = (file1%handle%mpi_val /= file2%handle%mpi_val)
1119 mp_file_op_neq = (file1%handle /= file2%handle)
1121 END FUNCTION mp_file_op_neq
1123 ELEMENTAL SUBROUTINE mp_file_type_set_handle(this, handle )
1125 INTEGER,
INTENT(IN) :: handle
1127#if defined(__parallel) && defined(__MPI_F08)
1128 this%handle%mpi_val = handle
1130 this%handle = handle
1134 END SUBROUTINE mp_file_type_set_handle
1136 ELEMENTAL FUNCTION mp_file_type_get_handle(this)
RESULT(handle)
1140#if defined(__parallel) && defined(__MPI_F08)
1141 handle = this%handle%mpi_val
1143 handle = this%handle
1145 END FUNCTION mp_file_type_get_handle
1146 LOGICAL FUNCTION mp_info_op_eq(info1, info2)
1148#if defined(__parallel) && defined(__MPI_F08)
1149 mp_info_op_eq = (info1%handle%mpi_val == info2%handle%mpi_val)
1151 mp_info_op_eq = (info1%handle == info2%handle)
1153 END FUNCTION mp_info_op_eq
1155 LOGICAL FUNCTION mp_info_op_neq(info1, info2)
1157#if defined(__parallel) && defined(__MPI_F08)
1158 mp_info_op_neq = (info1%handle%mpi_val /= info2%handle%mpi_val)
1160 mp_info_op_neq = (info1%handle /= info2%handle)
1162 END FUNCTION mp_info_op_neq
1164 ELEMENTAL SUBROUTINE mp_info_type_set_handle(this, handle )
1166 INTEGER,
INTENT(IN) :: handle
1168#if defined(__parallel) && defined(__MPI_F08)
1169 this%handle%mpi_val = handle
1171 this%handle = handle
1175 END SUBROUTINE mp_info_type_set_handle
1177 ELEMENTAL FUNCTION mp_info_type_get_handle(this)
RESULT(handle)
1181#if defined(__parallel) && defined(__MPI_F08)
1182 handle = this%handle%mpi_val
1184 handle = this%handle
1186 END FUNCTION mp_info_type_get_handle
1188 FUNCTION mp_comm_get_tag_ub(comm)
RESULT(tag_ub)
1192#if defined(__parallel)
1195 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1197 CALL mpi_comm_get_attr(comm%handle, mpi_tag_ub, attrval, flag, ierr)
1198 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_tag_ub")
1199 IF (.NOT. flag) cpabort(
"Upper bound of tags not available!")
1200 tag_ub = int(attrval, kind=kind(tag_ub))
1205 END FUNCTION mp_comm_get_tag_ub
1207 FUNCTION mp_comm_get_host_rank(comm)
RESULT(host_rank)
1209 INTEGER :: host_rank
1211#if defined(__parallel)
1214 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1216 CALL mpi_comm_get_attr(comm%handle, mpi_host, attrval, flag, ierr)
1217 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_host_rank")
1218 IF (.NOT. flag) cpabort(
"Host process rank not available!")
1219 host_rank = int(attrval, kind=kind(host_rank))
1224 END FUNCTION mp_comm_get_host_rank
1226 FUNCTION mp_comm_get_io_rank(comm)
RESULT(io_rank)
1230#if defined(__parallel)
1233 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1235 CALL mpi_comm_get_attr(comm%handle, mpi_io, attrval, flag, ierr)
1236 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_io_rank")
1237 IF (.NOT. flag) cpabort(
"IO rank not available!")
1238 io_rank = int(attrval, kind=kind(io_rank))
1243 END FUNCTION mp_comm_get_io_rank
1245 FUNCTION mp_comm_get_wtime_is_global(comm)
RESULT(wtime_is_global)
1247 LOGICAL :: wtime_is_global
1249#if defined(__parallel)
1252 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1254 CALL mpi_comm_get_attr(comm%handle, mpi_tag_ub, attrval, flag, ierr)
1255 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_wtime_is_global")
1256 IF (.NOT. flag) cpabort(
"Synchronization state of WTIME not available!")
1257 wtime_is_global = (attrval == 1_mpi_address_kind)
1260 wtime_is_global = .true.
1262 END FUNCTION mp_comm_get_wtime_is_global
1274#if defined(__parallel)
1279#if defined(__NO_MPI_THREAD_SUPPORT_CHECK)
1297 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_init @ mp_world_init")
1319 CALL mpi_comm_set_errhandler(mpi_comm_world, mpi_errors_return, ierr)
1320 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_set_errhandler @ mp_world_init")
1322 debug_comm_count = 1
1339 SUBROUTINE mp_reordering(mp_comm, mp_new_comm, ranks_order)
1342 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: ranks_order
1344 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_reordering'
1346 INTEGER :: handle, ierr
1347#if defined(__parallel)
1348 mpi_group_type :: newgroup, oldgroup
1351 CALL mp_timeset(routinen, handle)
1353#if defined(__parallel)
1355 CALL mpi_comm_group(mp_comm%handle, oldgroup, ierr)
1356 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_reordering")
1357 CALL mpi_group_incl(oldgroup,
SIZE(ranks_order), ranks_order, newgroup, ierr)
1358 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_incl @ mp_reordering")
1360 CALL mpi_comm_create(mp_comm%handle, newgroup, mp_new_comm%handle, ierr)
1361 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_create @ mp_reordering")
1363 CALL mpi_group_free(oldgroup, ierr)
1364 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_free @ mp_reordering")
1365 CALL mpi_group_free(newgroup, ierr)
1366 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_free @ mp_reordering")
1371 mark_used(ranks_order)
1372 mp_new_comm%handle = mp_comm_default_handle
1374 debug_comm_count = debug_comm_count + 1
1375 CALL mp_new_comm%init()
1376 CALL mp_timestop(handle)
1377 END SUBROUTINE mp_reordering
1386 CHARACTER(LEN=default_string_length) :: debug_comm_count_char
1387#if defined(__parallel)
1389 CALL mpi_barrier(mpi_comm_world, ierr)
1393 debug_comm_count = debug_comm_count - 1
1394#if defined(__parallel)
1395 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_barrier @ mp_world_finalize")
1397 IF (debug_comm_count /= 0)
THEN
1400 WRITE (unit=debug_comm_count_char, fmt=
'(I2)') debug_comm_count
1401 CALL cp_abort(__location__,
"mp_world_finalize: assert failed:"// &
1402 " leaking communicators "//adjustl(trim(debug_comm_count_char)))
1404#if defined(__parallel)
1405 CALL mpi_finalize(ierr)
1406 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_finalize @ mp_world_finalize")
1422#if !defined(__NO_ABORT)
1423#if defined(__parallel)
1424 CALL mpi_abort(mpi_comm_world, 1, ierr)
1440 SUBROUTINE mp_stop(ierr, prg_code)
1441 INTEGER,
INTENT(IN) :: ierr
1442 CHARACTER(LEN=*),
INTENT(IN) :: prg_code
1444#if defined(__parallel)
1445 INTEGER :: istat, len
1446 CHARACTER(LEN=MPI_MAX_ERROR_STRING) :: error_string
1447 CHARACTER(LEN=MPI_MAX_ERROR_STRING + 512) :: full_error
1449 CHARACTER(LEN=512) :: full_error
1452#if defined(__parallel)
1453 CALL mpi_error_string(ierr, error_string, len, istat)
1454 WRITE (full_error,
'(A,I0,A)')
' MPI error ', ierr,
' in '//trim(prg_code)//
' : '//error_string(1:len)
1456 WRITE (full_error,
'(A,I0,A)')
' MPI error (!?) ', ierr,
' in '//trim(prg_code)
1461 END SUBROUTINE mp_stop
1467 SUBROUTINE mp_sync(comm)
1470 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sync'
1472 INTEGER :: handle, ierr
1475 CALL mp_timeset(routinen, handle)
1477#if defined(__parallel)
1478 CALL mpi_barrier(comm%handle, ierr)
1479 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_barrier @ mp_sync")
1484 CALL mp_timestop(handle)
1486 END SUBROUTINE mp_sync
1493 SUBROUTINE mp_isync(comm, request)
1497 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isync'
1499 INTEGER :: handle, ierr
1502 CALL mp_timeset(routinen, handle)
1504#if defined(__parallel)
1505 CALL mpi_ibarrier(comm%handle, request%handle, ierr)
1506 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibarrier @ mp_isync")
1512 CALL mp_timestop(handle)
1514 END SUBROUTINE mp_isync
1521 SUBROUTINE mp_comm_rank(taskid, comm)
1523 INTEGER,
INTENT(OUT) :: taskid
1526 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_rank'
1529#if defined(__parallel)
1533 CALL mp_timeset(routinen, handle)
1535#if defined(__parallel)
1536 CALL mpi_comm_rank(comm%handle, taskid, ierr)
1537 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ mp_comm_rank")
1542 CALL mp_timestop(handle)
1544 END SUBROUTINE mp_comm_rank
1551 SUBROUTINE mp_comm_size(numtask, comm)
1553 INTEGER,
INTENT(OUT) :: numtask
1556 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_size'
1559#if defined(__parallel)
1563 CALL mp_timeset(routinen, handle)
1565#if defined(__parallel)
1566 CALL mpi_comm_size(comm%handle, numtask, ierr)
1567 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ mp_comm_size")
1572 CALL mp_timestop(handle)
1574 END SUBROUTINE mp_comm_size
1584 SUBROUTINE mp_cart_get(comm, dims, task_coor, periods)
1587 INTEGER,
INTENT(OUT),
OPTIONAL :: dims(comm%ndims), task_coor(comm%ndims)
1588 LOGICAL,
INTENT(out),
OPTIONAL :: periods(comm%ndims)
1590 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_get'
1593#if defined(__parallel)
1595 INTEGER :: my_dims(comm%ndims), my_task_coor(comm%ndims)
1596 LOGICAL :: my_periods(comm%ndims)
1599 CALL mp_timeset(routinen, handle)
1601#if defined(__parallel)
1602 CALL mpi_cart_get(comm%handle, comm%ndims, my_dims, my_periods, my_task_coor, ierr)
1603 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_get @ mp_cart_get")
1604 IF (
PRESENT(dims)) dims = my_dims
1605 IF (
PRESENT(task_coor)) task_coor = my_task_coor
1606 IF (
PRESENT(periods)) periods = my_periods
1609 IF (
PRESENT(task_coor)) task_coor = 0
1610 IF (
PRESENT(dims)) dims = 1
1611 IF (
PRESENT(periods)) periods = .false.
1613 CALL mp_timestop(handle)
1615 END SUBROUTINE mp_cart_get
1617 INTEGER ELEMENTAL function mp_comm_get_ndims(comm)
1620 mp_comm_get_ndims = comm%ndims
1632 SUBROUTINE mp_cart_create(comm_old, ndims, dims, comm_cart)
1635 INTEGER,
INTENT(IN) :: ndims
1636 INTEGER,
INTENT(INOUT) :: dims(ndims)
1639 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_create'
1641 INTEGER :: handle, ierr
1642#if defined(__parallel)
1643 LOGICAL,
DIMENSION(1:ndims) :: period
1648 CALL mp_timeset(routinen, handle)
1650 comm_cart%handle = comm_old%handle
1651#if defined(__parallel)
1653 IF (any(dims == 0))
CALL mpi_dims_create(comm_old%num_pe, ndims, dims, ierr)
1654 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_dims_create @ mp_cart_create")
1661 CALL mpi_cart_create(comm_old%handle, ndims, dims, period, reorder, comm_cart%handle, &
1663 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_create @ mp_cart_create")
1664 CALL add_perf(perf_id=1, count=1)
1667 comm_cart%handle = mp_comm_default_handle
1669 comm_cart%ndims = ndims
1670 debug_comm_count = debug_comm_count + 1
1671 CALL comm_cart%init()
1672 CALL mp_timestop(handle)
1674 END SUBROUTINE mp_cart_create
1682 SUBROUTINE mp_cart_coords(comm, rank, coords)
1685 INTEGER,
INTENT(IN) :: rank
1686 INTEGER,
DIMENSION(:),
INTENT(OUT) :: coords
1688 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_coords'
1690 INTEGER :: handle, ierr, m
1693 CALL mp_timeset(routinen, handle)
1696#if defined(__parallel)
1697 CALL mpi_cart_coords(comm%handle, rank, m, coords, ierr)
1698 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_coords @ mp_cart_coords")
1704 CALL mp_timestop(handle)
1706 END SUBROUTINE mp_cart_coords
1714 FUNCTION mp_comm_compare(comm1, comm2)
RESULT(res)
1719 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_compare'
1722#if defined(__parallel)
1723 INTEGER :: ierr, iout
1726 CALL mp_timeset(routinen, handle)
1729#if defined(__parallel)
1730 CALL mpi_comm_compare(comm1%handle, comm2%handle, iout, ierr)
1731 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_compare @ mp_comm_compare")
1735 CASE (mpi_congruent)
1742 cpabort(
"Unknown comparison state of the communicators!")
1748 CALL mp_timestop(handle)
1750 END FUNCTION mp_comm_compare
1758 SUBROUTINE mp_cart_sub(comm, rdim, sub_comm)
1761 LOGICAL,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: rdim
1764 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_sub'
1767#if defined(__parallel)
1771 CALL mp_timeset(routinen, handle)
1773#if defined(__parallel)
1774 CALL mpi_cart_sub(comm%handle, rdim, sub_comm%handle, ierr)
1775 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_sub @ mp_cart_sub")
1779 sub_comm%handle = mp_comm_default_handle
1781 sub_comm%ndims = count(rdim)
1782 debug_comm_count = debug_comm_count + 1
1783 CALL sub_comm%init()
1784 CALL mp_timestop(handle)
1786 END SUBROUTINE mp_cart_sub
1792 SUBROUTINE mp_comm_free(comm)
1796 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_free'
1799 LOGICAL :: free_comm
1800#if defined(__parallel)
1808 IF (comm%ref_count <= 0) &
1809 cpabort(
"para_env%ref_count <= 0")
1810 comm%ref_count = comm%ref_count - 1
1811 IF (comm%ref_count <= 0)
THEN
1812 free_comm = comm%owns_group
1816 IF (comm%ref_count <= 0) &
1817 cpabort(
"para_cart%ref_count <= 0")
1818 comm%ref_count = comm%ref_count - 1
1819 IF (comm%ref_count <= 0)
THEN
1820 free_comm = comm%owns_group
1824 CALL mp_timeset(routinen, handle)
1827#if defined(__parallel)
1828 CALL mpi_comm_free(comm%handle, ierr)
1829 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_free @ mp_comm_free")
1831 comm%handle = mp_comm_null_handle
1833 debug_comm_count = debug_comm_count - 1
1838 DEALLOCATE (comm%periodic, comm%mepos_cart, comm%num_pe_cart)
1841 CALL mp_timestop(handle)
1843 END SUBROUTINE mp_comm_free
1850 ELEMENTAL LOGICAL FUNCTION mp_para_env_is_valid(para_env)
1853 mp_para_env_is_valid = para_env%ref_count > 0
1855 END FUNCTION mp_para_env_is_valid
1861 ELEMENTAL SUBROUTINE mp_para_env_retain(para_env)
1864 para_env%ref_count = para_env%ref_count + 1
1866 END SUBROUTINE mp_para_env_retain
1873 ELEMENTAL LOGICAL FUNCTION mp_para_cart_is_valid(cart)
1876 mp_para_cart_is_valid = cart%ref_count > 0
1878 END FUNCTION mp_para_cart_is_valid
1884 ELEMENTAL SUBROUTINE mp_para_cart_retain(cart)
1887 cart%ref_count = cart%ref_count + 1
1889 END SUBROUTINE mp_para_cart_retain
1896 SUBROUTINE mp_comm_dup(comm1, comm2)
1901 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_dup'
1904#if defined(__parallel)
1908 CALL mp_timeset(routinen, handle)
1910#if defined(__parallel)
1911 CALL mpi_comm_dup(comm1%handle, comm2%handle, ierr)
1912 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_dup @ mp_comm_dup")
1915 comm2%handle = mp_comm_default_handle
1917 comm2%ndims = comm1%ndims
1918 debug_comm_count = debug_comm_count + 1
1920 CALL mp_timestop(handle)
1922 END SUBROUTINE mp_comm_dup
1929 ELEMENTAL IMPURE SUBROUTINE mp_comm_assign(comm_new, comm_old)
1933 comm_new%handle = comm_old%handle
1934 comm_new%ndims = comm_old%ndims
1935 CALL comm_new%init(.false.)
1943 ELEMENTAL LOGICAL FUNCTION mp_comm_is_source(comm)
1946 mp_comm_is_source = comm%source == comm%mepos
1948 END FUNCTION mp_comm_is_source
1954 ELEMENTAL IMPURE SUBROUTINE mp_comm_init(comm, owns_group)
1956 LOGICAL,
INTENT(IN),
OPTIONAL :: owns_group
1958 IF (comm%handle mpi_get_comp /= mp_comm_null_handle mpi_get_comp)
THEN
1960 CALL comm%get_size(comm%num_pe)
1961 CALL comm%get_rank(comm%mepos)
1966 IF (
ALLOCATED(comm%periodic))
DEALLOCATE (comm%periodic)
1967 IF (
ALLOCATED(comm%mepos_cart))
DEALLOCATE (comm%mepos_cart)
1968 IF (
ALLOCATED(comm%num_pe_cart))
DEALLOCATE (comm%num_pe_cart)
1970 associate(ndims => comm%ndims)
1972 ALLOCATE (comm%periodic(ndims), comm%mepos_cart(ndims), &
1973 comm%num_pe_cart(ndims))
1977 comm%periodic = .false.
1978 IF (comm%handle mpi_get_comp /= mp_comm_null_handle mpi_get_comp)
THEN
1979 CALL comm%get_info_cart(comm%num_pe_cart, comm%mepos_cart, &
1986 IF (
PRESENT(owns_group)) comm%owns_group = owns_group
1989 IF (
PRESENT(owns_group)) comm%owns_group = owns_group
2007 IF (
ASSOCIATED(para_env)) &
2008 cpabort(
"The passed para_env must not be associated!")
2010 para_env%mp_comm_type = group
2011 CALL para_env%init()
2028 IF (
ASSOCIATED(para_env))
THEN
2029 CALL para_env%free()
2030 IF (.NOT. para_env%is_valid())
DEALLOCATE (para_env)
2045 IF (
ASSOCIATED(cart)) &
2046 cpabort(
"The passed para_cart must not be associated!")
2048 cart%mp_cart_type = group
2061 IF (
ASSOCIATED(cart))
THEN
2063 IF (.NOT. cart%is_valid())
DEALLOCATE (cart)
2074 SUBROUTINE mp_rank_compare(comm1, comm2, rank)
2077 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rank
2079 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rank_compare'
2082#if defined(__parallel)
2083 INTEGER :: i, ierr, n, n1, n2
2084 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: rin
2085 mpi_group_type :: g1, g2
2088 CALL mp_timeset(routinen, handle)
2091#if defined(__parallel)
2092 CALL mpi_comm_size(comm1%handle, n1, ierr)
2093 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ mp_rank_compare")
2094 CALL mpi_comm_size(comm2%handle, n2, ierr)
2095 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ mp_rank_compare")
2097 CALL mpi_comm_group(comm1%handle, g1, ierr)
2098 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_rank_compare")
2099 CALL mpi_comm_group(comm2%handle, g2, ierr)
2100 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_rank_compare")
2101 ALLOCATE (rin(0:n - 1), stat=ierr)
2103 cpabort(
"allocate @ mp_rank_compare")
2107 CALL mpi_group_translate_ranks(g1, n, rin, g2, rank, ierr)
2108 IF (ierr /= 0)
CALL mp_stop(ierr, &
2109 "mpi_group_translate_rank @ mp_rank_compare")
2110 CALL mpi_group_free(g1, ierr)
2112 cpabort(
"group_free @ mp_rank_compare")
2113 CALL mpi_group_free(g2, ierr)
2115 cpabort(
"group_free @ mp_rank_compare")
2121 CALL mp_timestop(handle)
2123 END SUBROUTINE mp_rank_compare
2132 INTEGER,
INTENT(IN) :: nodes
2133 INTEGER,
DIMENSION(:),
INTENT(INOUT) :: dims
2135 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_dims_create'
2137 INTEGER :: handle, ndim
2138#if defined(__parallel)
2142 CALL mp_timeset(routinen, handle)
2145#if defined(__parallel)
2146 IF (any(dims == 0))
CALL mpi_dims_create(nodes, ndim, dims, ierr)
2147 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_dims_create @ mp_dims_create")
2152 CALL mp_timestop(handle)
2162 SUBROUTINE mp_cart_rank(comm, pos, rank)
2164 INTEGER,
DIMENSION(:),
INTENT(IN) :: pos
2165 INTEGER,
INTENT(OUT) :: rank
2167 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_rank'
2170#if defined(__parallel)
2174 CALL mp_timeset(routinen, handle)
2176#if defined(__parallel)
2177 CALL mpi_cart_rank(comm%handle, pos, rank, ierr)
2178 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_rank @ mp_cart_rank")
2184 CALL mp_timestop(handle)
2186 END SUBROUTINE mp_cart_rank
2197 SUBROUTINE mp_wait(request)
2200 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_wait'
2203#if defined(__parallel)
2207 CALL mp_timeset(routinen, handle)
2209#if defined(__parallel)
2211 CALL mpi_wait(request%handle, mpi_status_ignore, ierr)
2212 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_wait @ mp_wait")
2214 CALL add_perf(perf_id=9, count=1)
2216 request%handle = mp_request_null_handle
2218 CALL mp_timestop(handle)
2219 END SUBROUTINE mp_wait
2230 SUBROUTINE mp_waitall_1(requests)
2233 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_waitall_1'
2236#if defined(__parallel)
2237 INTEGER :: count, ierr
2238#if !defined(__MPI_F08)
2239 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: status
2241 TYPE(mpi_status),
ALLOCATABLE,
DIMENSION(:) :: status
2245 CALL mp_timeset(routinen, handle)
2247#if defined(__parallel)
2248 count =
SIZE(requests)
2249#if !defined(__MPI_F08)
2250 ALLOCATE (status(mpi_status_size, count))
2252 ALLOCATE (status(count))
2254 CALL mpi_waitall_internal(count, requests, status, ierr)
2255 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitall @ mp_waitall_1")
2257 CALL add_perf(perf_id=9, count=1)
2261 CALL mp_timestop(handle)
2262 END SUBROUTINE mp_waitall_1
2271 SUBROUTINE mp_waitall_2(requests)
2274 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_waitall_2'
2277#if defined(__parallel)
2278 INTEGER :: count, ierr
2279#if !defined(__MPI_F08)
2280 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: status
2282 TYPE(mpi_status),
ALLOCATABLE,
DIMENSION(:) :: status
2286 CALL mp_timeset(routinen, handle)
2288#if defined(__parallel)
2289 count =
SIZE(requests)
2290#if !defined(__MPI_F08)
2291 ALLOCATE (status(mpi_status_size, count))
2293 ALLOCATE (status(count))
2296 CALL mpi_waitall_internal(count, requests, status, ierr)
2297 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitall @ mp_waitall_2")
2300 CALL add_perf(perf_id=9, count=1)
2304 CALL mp_timestop(handle)
2305 END SUBROUTINE mp_waitall_2
2316#if defined(__parallel)
2317 SUBROUTINE mpi_waitall_internal(count, array_of_requests, array_of_statuses, ierr)
2318 INTEGER,
INTENT(in) :: count
2319 TYPE(
mp_request_type),
DIMENSION(count),
INTENT(inout) :: array_of_requests
2320#if !defined(__MPI_F08)
2321 INTEGER,
DIMENSION(MPI_STATUS_SIZE, count), &
2322 INTENT(out) :: array_of_statuses
2324 TYPE(mpi_status),
DIMENSION(count), &
2325 INTENT(out) :: array_of_statuses
2327 INTEGER,
INTENT(out) :: ierr
2330 mpi_request_type,
ALLOCATABLE,
DIMENSION(:) :: request_handles
2332 ALLOCATE (request_handles(count))
2334 request_handles(i) = array_of_requests(i)%handle
2337 CALL mpi_waitall(count, request_handles, array_of_statuses, ierr)
2340 array_of_requests(i)%handle = request_handles(i)
2343 END SUBROUTINE mpi_waitall_internal
2356 INTEGER,
INTENT(out) :: completed
2358 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_waitany'
2361#if defined(__parallel)
2362 INTEGER :: count, i, ierr
2363 mpi_request_type,
ALLOCATABLE,
DIMENSION(:) :: request_handles
2366 CALL mp_timeset(routinen, handle)
2368#if defined(__parallel)
2369 count =
SIZE(requests)
2372 ALLOCATE (request_handles(count))
2374 request_handles(i) = requests(i)%handle
2376 CALL mpi_waitany(count, request_handles, completed, mpi_status_ignore, ierr)
2377 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitany @ mp_waitany")
2380 requests(i)%handle = request_handles(i)
2382 CALL add_perf(perf_id=9, count=1)
2387 CALL mp_timestop(handle)
2399 FUNCTION mp_testall_tv(requests)
RESULT(flag)
2403#if defined(__parallel)
2405 LOGICAL,
DIMENSION(:),
POINTER :: flags
2410#if defined(__parallel)
2411 ALLOCATE (flags(
SIZE(requests)))
2412 DO i = 1,
SIZE(requests)
2413 CALL mpi_test(requests(i)%handle, flags(i), mpi_status_ignore, ierr)
2414 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testall @ mp_testall_tv")
2415 flag = flag .AND. flags(i)
2421 END FUNCTION mp_testall_tv
2431 FUNCTION mp_test_1(request)
RESULT(flag)
2435#if defined(__parallel)
2438 CALL mpi_test(request%handle, flag, mpi_status_ignore, ierr)
2439 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_test @ mp_test_1")
2444 END FUNCTION mp_test_1
2455 SUBROUTINE mp_testany_1(requests, completed, flag)
2457 INTEGER,
INTENT(out),
OPTIONAL :: completed
2458 LOGICAL,
INTENT(out),
OPTIONAL :: flag
2460#if defined(__parallel)
2461 INTEGER :: completed_l, count, ierr
2464 count =
SIZE(requests)
2466 CALL mpi_testany_internal(count, requests, completed_l, flag_l, mpi_status_ignore, ierr)
2467 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testany_1 @ mp_testany")
2469 IF (
PRESENT(completed)) completed = completed_l
2470 IF (
PRESENT(flag)) flag = flag_l
2473 IF (
PRESENT(completed)) completed = 1
2474 IF (
PRESENT(flag)) flag = .true.
2476 END SUBROUTINE mp_testany_1
2487 SUBROUTINE mp_testany_2(requests, completed, flag)
2489 INTEGER,
INTENT(out),
OPTIONAL :: completed
2490 LOGICAL,
INTENT(out),
OPTIONAL :: flag
2492#if defined(__parallel)
2493 INTEGER :: completed_l, count, ierr
2496 count =
SIZE(requests)
2498 CALL mpi_testany_internal(count, requests, completed_l, flag_l, mpi_status_ignore, ierr)
2499 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testany_2 @ mp_testany")
2501 IF (
PRESENT(completed)) completed = completed_l
2502 IF (
PRESENT(flag)) flag = flag_l
2505 IF (
PRESENT(completed)) completed = 1
2506 IF (
PRESENT(flag)) flag = .true.
2508 END SUBROUTINE mp_testany_2
2521#if defined(__parallel)
2522 SUBROUTINE mpi_testany_internal(count, array_of_requests, index, flag, status, ierr)
2523 INTEGER,
INTENT(in) :: count
2524 TYPE(
mp_request_type),
DIMENSION(count),
INTENT(inout) :: array_of_requests
2525 INTEGER,
INTENT(out) :: index
2526 LOGICAL,
INTENT(out) :: flag
2527 mpi_status_type,
INTENT(out) :: status
2528 INTEGER,
INTENT(out) :: ierr
2531 mpi_request_type,
ALLOCATABLE,
DIMENSION(:) :: request_handles
2533 ALLOCATE (request_handles(count))
2535 request_handles(i) = array_of_requests(i)%handle
2538 CALL mpi_testany(count, request_handles, index, flag, status, ierr)
2541 array_of_requests(i)%handle = request_handles(i)
2544 END SUBROUTINE mpi_testany_internal
2556 SUBROUTINE mp_comm_split_direct(comm, sub_comm, color, key)
2559 INTEGER,
INTENT(in) :: color
2560 INTEGER,
INTENT(in),
OPTIONAL :: key
2562 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_comm_split_direct'
2565#if defined(__parallel)
2566 INTEGER :: ierr, my_key
2569 CALL mp_timeset(routinen, handle)
2571#if defined(__parallel)
2573 IF (
PRESENT(key)) my_key = key
2574 CALL mpi_comm_split(comm%handle, color, my_key, sub_comm%handle, ierr)
2575 IF (ierr /= mpi_success)
CALL mp_stop(ierr, routinen)
2576 CALL add_perf(perf_id=10, count=1)
2578 sub_comm%handle = mp_comm_default_handle
2583 debug_comm_count = debug_comm_count + 1
2584 CALL sub_comm%init()
2585 CALL mp_timestop(handle)
2587 END SUBROUTINE mp_comm_split_direct
2611 SUBROUTINE mp_comm_split(comm, sub_comm, ngroups, group_distribution, &
2612 subgroup_min_size, n_subgroups, group_partition, stride)
2615 INTEGER,
INTENT(out) :: ngroups
2616 INTEGER,
DIMENSION(0:),
INTENT(INOUT) :: group_distribution
2617 INTEGER,
INTENT(in),
OPTIONAL :: subgroup_min_size, n_subgroups
2618 INTEGER,
DIMENSION(0:),
INTENT(IN),
OPTIONAL :: group_partition
2619 INTEGER,
OPTIONAL,
INTENT(IN) :: stride
2621 CHARACTER(LEN=*),
PARAMETER :: routineN =
'mp_comm_split', &
2622 routinep = modulen//
':'//routinen
2624 INTEGER :: handle, mepos, nnodes
2625#if defined(__parallel)
2626 INTEGER :: color, i, ierr, j, k, &
2627 my_subgroup_min_size, &
2628 istride, local_stride, irank
2629 INTEGER,
DIMENSION(:),
ALLOCATABLE :: rank_permutation
2632 CALL mp_timeset(routinen, handle)
2636 IF (.NOT.
PRESENT(subgroup_min_size) .AND. .NOT.
PRESENT(n_subgroups))
THEN
2637 cpabort(routinep//
" missing arguments")
2639 IF (
PRESENT(subgroup_min_size) .AND.
PRESENT(n_subgroups))
THEN
2640 cpabort(routinep//
" too many arguments")
2643 CALL comm%get_size(nnodes)
2644 CALL comm%get_rank(mepos)
2646 IF (ubound(group_distribution, 1) /= nnodes - 1)
THEN
2647 cpabort(routinep//
" group_distribution wrong bounds")
2650#if defined(__parallel)
2651 IF (
PRESENT(subgroup_min_size))
THEN
2652 IF (subgroup_min_size < 0 .OR. subgroup_min_size > nnodes)
THEN
2653 cpabort(routinep//
" subgroup_min_size too small or too large")
2655 ngroups = nnodes/subgroup_min_size
2656 my_subgroup_min_size = subgroup_min_size
2658 IF (n_subgroups <= 0)
THEN
2659 cpabort(routinep//
" n_subgroups too small")
2661 IF (nnodes/n_subgroups > 0)
THEN
2662 ngroups = n_subgroups
2666 my_subgroup_min_size = nnodes/ngroups
2672 ALLOCATE (rank_permutation(0:nnodes - 1))
2674 IF (
PRESENT(stride)) local_stride = stride
2676 DO istride = 1, local_stride
2677 DO irank = istride - 1, nnodes - 1, local_stride
2678 rank_permutation(k) = irank
2683 DO i = 0, nnodes - 1
2684 group_distribution(rank_permutation(i)) = min(i/my_subgroup_min_size, ngroups - 1)
2687 IF (
PRESENT(group_partition))
THEN
2688 IF (all(group_partition > 0) .AND. (sum(group_partition) == nnodes) .AND. (ngroups ==
SIZE(group_partition)))
THEN
2690 DO i = 0,
SIZE(group_partition) - 1
2691 DO j = 1, group_partition(i)
2692 group_distribution(rank_permutation(k)) = i
2700 color = group_distribution(mepos)
2701 CALL mpi_comm_split(comm%handle, color, 0, sub_comm%handle, ierr)
2702 IF (ierr /= mpi_success)
CALL mp_stop(ierr,
"in "//routinep//
" split")
2704 CALL add_perf(perf_id=10, count=1)
2706 sub_comm%handle = mp_comm_default_handle
2707 group_distribution(0) = 0
2711 mark_used(group_partition)
2713 debug_comm_count = debug_comm_count + 1
2714 CALL sub_comm%init()
2715 CALL mp_timestop(handle)
2717 END SUBROUTINE mp_comm_split
2730 SUBROUTINE mp_probe(source, comm, tag)
2731 INTEGER,
INTENT(INOUT) :: source
2733 INTEGER,
INTENT(OUT) :: tag
2735 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_probe'
2738#if defined(__parallel)
2740 mpi_status_type :: status_single
2746 CALL mp_timeset(routinen, handle)
2748#if defined(__parallel)
2751 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_probe @ mp_probe")
2752 source = status_single mpi_status_extract(mpi_source)
2753 tag = status_single mpi_status_extract(mpi_tag)
2756 CALL mpi_iprobe(source,
mp_any_tag, comm%handle, flag, status_single, ierr)
2757 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iprobe @ mp_probe")
2758 IF (flag .EQV. .false.)
THEN
2762 tag = status_single mpi_status_extract(mpi_tag)
2770 CALL mp_timestop(handle)
2771 END SUBROUTINE mp_probe
2783 SUBROUTINE mp_bcast_b(msg, source, comm)
2784 LOGICAL,
INTENT(INOUT) :: msg
2785 INTEGER,
INTENT(IN) :: source
2788 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_b'
2791#if defined(__parallel)
2792 INTEGER :: ierr, msglen
2795 CALL mp_timeset(routinen, handle)
2797#if defined(__parallel)
2799 CALL mpi_bcast(msg, msglen, mpi_logical, source, comm%handle, ierr)
2800 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2801 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2807 CALL mp_timestop(handle)
2808 END SUBROUTINE mp_bcast_b
2816 SUBROUTINE mp_bcast_b_src(msg, comm)
2817 LOGICAL,
INTENT(INOUT) :: msg
2820 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_b_src'
2823#if defined(__parallel)
2824 INTEGER :: ierr, msglen
2827 CALL mp_timeset(routinen, handle)
2829#if defined(__parallel)
2831 CALL mpi_bcast(msg, msglen, mpi_logical, comm%source, comm%handle, ierr)
2832 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2833 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2838 CALL mp_timestop(handle)
2839 END SUBROUTINE mp_bcast_b_src
2847 SUBROUTINE mp_bcast_bv(msg, source, comm)
2848 LOGICAL,
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
2849 INTEGER,
INTENT(IN) :: source
2852 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_bv'
2855#if defined(__parallel)
2856 INTEGER :: ierr, msglen
2859 CALL mp_timeset(routinen, handle)
2861#if defined(__parallel)
2863 CALL mpi_bcast(msg, msglen, mpi_logical, source, comm%handle, ierr)
2864 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2865 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2871 CALL mp_timestop(handle)
2872 END SUBROUTINE mp_bcast_bv
2879 SUBROUTINE mp_bcast_bv_src(msg, comm)
2880 LOGICAL,
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
2883 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_bv_src'
2886#if defined(__parallel)
2887 INTEGER :: ierr, msglen
2890 CALL mp_timeset(routinen, handle)
2892#if defined(__parallel)
2894 CALL mpi_bcast(msg, msglen, mpi_logical, comm%source, comm%handle, ierr)
2895 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2896 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2901 CALL mp_timestop(handle)
2902 END SUBROUTINE mp_bcast_bv_src
2918 SUBROUTINE mp_isend_bv(msgin, dest, comm, request, tag)
2919 LOGICAL,
DIMENSION(:),
INTENT(IN) :: msgin
2920 INTEGER,
INTENT(IN) :: dest
2923 INTEGER,
INTENT(in),
OPTIONAL :: tag
2925 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_isend_bv'
2928#if defined(__parallel)
2929 INTEGER :: ierr, msglen, my_tag
2933 CALL mp_timeset(routinen, handle)
2935#if defined(__parallel)
2936#if !defined(__GNUC__) || __GNUC__ >= 9
2937 cpassert(is_contiguous(msgin))
2941 IF (
PRESENT(tag)) my_tag = tag
2943 msglen =
SIZE(msgin, 1)
2944 IF (msglen > 0)
THEN
2945 CALL mpi_isend(msgin(1), msglen, mpi_logical, dest, my_tag, &
2946 comm%handle, request%handle, ierr)
2948 CALL mpi_isend(foo, msglen, mpi_logical, dest, my_tag, &
2949 comm%handle, request%handle, ierr)
2951 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
2953 CALL add_perf(perf_id=11, count=1, msg_size=msglen*loglen)
2955 cpabort(
"mp_isend called in non parallel case")
2962 CALL mp_timestop(handle)
2963 END SUBROUTINE mp_isend_bv
2979 SUBROUTINE mp_irecv_bv(msgout, source, comm, request, tag)
2980 LOGICAL,
DIMENSION(:),
INTENT(INOUT) :: msgout
2981 INTEGER,
INTENT(IN) :: source
2984 INTEGER,
INTENT(in),
OPTIONAL :: tag
2986 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_irecv_bv'
2989#if defined(__parallel)
2990 INTEGER :: ierr, msglen, my_tag
2994 CALL mp_timeset(routinen, handle)
2996#if defined(__parallel)
2997#if !defined(__GNUC__) || __GNUC__ >= 9
2998 cpassert(is_contiguous(msgout))
3002 IF (
PRESENT(tag)) my_tag = tag
3004 msglen =
SIZE(msgout, 1)
3005 IF (msglen > 0)
THEN
3006 CALL mpi_irecv(msgout(1), msglen, mpi_logical, source, my_tag, &
3007 comm%handle, request%handle, ierr)
3009 CALL mpi_irecv(foo, msglen, mpi_logical, source, my_tag, &
3010 comm%handle, request%handle, ierr)
3012 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
3014 CALL add_perf(perf_id=12, count=1, msg_size=msglen*loglen)
3016 cpabort(
"mp_irecv called in non parallel case")
3023 CALL mp_timestop(handle)
3024 END SUBROUTINE mp_irecv_bv
3040 SUBROUTINE mp_isend_bm3(msgin, dest, comm, request, tag)
3041 LOGICAL,
DIMENSION(:, :, :),
INTENT(INOUT) :: msgin
3042 INTEGER,
INTENT(IN) :: dest
3045 INTEGER,
INTENT(in),
OPTIONAL :: tag
3047 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_isend_bm3'
3050#if defined(__parallel)
3051 INTEGER :: ierr, msglen, my_tag
3055 CALL mp_timeset(routinen, handle)
3057#if defined(__parallel)
3058#if !defined(__GNUC__) || __GNUC__ >= 9
3059 cpassert(is_contiguous(msgin))
3063 IF (
PRESENT(tag)) my_tag = tag
3065 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
3066 IF (msglen > 0)
THEN
3067 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_logical, dest, my_tag, &
3068 comm%handle, request%handle, ierr)
3070 CALL mpi_isend(foo, msglen, mpi_logical, dest, my_tag, &
3071 comm%handle, request%handle, ierr)
3073 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
3075 CALL add_perf(perf_id=11, count=1, msg_size=msglen*loglen)
3077 cpabort(
"mp_isend called in non parallel case")
3084 CALL mp_timestop(handle)
3085 END SUBROUTINE mp_isend_bm3
3101 SUBROUTINE mp_irecv_bm3(msgout, source, comm, request, tag)
3102 LOGICAL,
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
3103 INTEGER,
INTENT(IN) :: source
3106 INTEGER,
INTENT(in),
OPTIONAL :: tag
3108 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_irecv_bm3'
3111#if defined(__parallel)
3112 INTEGER :: ierr, msglen, my_tag
3116 CALL mp_timeset(routinen, handle)
3118#if defined(__parallel)
3119#if !defined(__GNUC__) || __GNUC__ >= 9
3120 cpassert(is_contiguous(msgout))
3124 IF (
PRESENT(tag)) my_tag = tag
3126 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
3127 IF (msglen > 0)
THEN
3128 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_logical, source, my_tag, &
3129 comm%handle, request%handle, ierr)
3131 CALL mpi_irecv(foo, msglen, mpi_logical, source, my_tag, &
3132 comm%handle, request%handle, ierr)
3134 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
3136 CALL add_perf(perf_id=12, count=1, msg_size=msglen*loglen)
3138 cpabort(
"mp_irecv called in non parallel case")
3146 CALL mp_timestop(handle)
3147 END SUBROUTINE mp_irecv_bm3
3155 SUBROUTINE mp_bcast_av(msg, source, comm)
3156 CHARACTER(LEN=*),
INTENT(INOUT) :: msg
3157 INTEGER,
INTENT(IN) :: source
3160 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_av'
3163#if defined(__parallel)
3164 INTEGER :: i, ierr, msglen
3165 INTEGER,
DIMENSION(:),
ALLOCATABLE :: imsg
3168 CALL mp_timeset(routinen, handle)
3170#if defined(__parallel)
3172 IF (comm%mepos == source) msglen = len_trim(msg)
3174 CALL comm%bcast(msglen, source)
3180 ALLOCATE (imsg(1:msglen))
3182 imsg(i) = ichar(msg(i:i))
3184 CALL mpi_bcast(imsg, msglen, mpi_integer, source, comm%handle, ierr)
3185 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3188 msg(i:i) = char(imsg(i))
3191 CALL add_perf(perf_id=2, count=1, msg_size=msglen*charlen)
3197 CALL mp_timestop(handle)
3198 END SUBROUTINE mp_bcast_av
3205 SUBROUTINE mp_bcast_av_src(msg, comm)
3206 CHARACTER(LEN=*),
INTENT(INOUT) :: msg
3209 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_av_src'
3212#if defined(__parallel)
3213 INTEGER :: i, ierr, msglen
3214 INTEGER,
DIMENSION(:),
ALLOCATABLE :: imsg
3217 CALL mp_timeset(routinen, handle)
3219#if defined(__parallel)
3221 IF (comm%is_source()) msglen = len_trim(msg)
3223 CALL comm%bcast(msglen, comm%source)
3229 ALLOCATE (imsg(1:msglen))
3231 imsg(i) = ichar(msg(i:i))
3233 CALL mpi_bcast(imsg, msglen, mpi_integer, comm%source, comm%handle, ierr)
3234 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3237 msg(i:i) = char(imsg(i))
3240 CALL add_perf(perf_id=2, count=1, msg_size=msglen*charlen)
3245 CALL mp_timestop(handle)
3246 END SUBROUTINE mp_bcast_av_src
3254 SUBROUTINE mp_bcast_am(msg, source, comm)
3255 CHARACTER(LEN=*),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3256 INTEGER,
INTENT(IN) :: source
3259 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_am'
3262#if defined(__parallel)
3263 INTEGER :: i, ierr, j, k, msglen, msgsiz
3264 INTEGER,
ALLOCATABLE :: imsg(:), imsglen(:)
3267 CALL mp_timeset(routinen, handle)
3269#if defined(__parallel)
3272 ALLOCATE (imsglen(1:msgsiz))
3273 IF (comm%mepos == source)
THEN
3275 imsglen(j) = len_trim(msg(j))
3278 CALL comm%bcast(imsglen, source)
3279 msglen = sum(imsglen)
3284 ALLOCATE (imsg(1:msglen))
3287 DO i = 1, imsglen(j)
3289 imsg(k) = ichar(msg(j) (i:i))
3292 CALL mpi_bcast(imsg, msglen, mpi_integer, source, comm%handle, ierr)
3293 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3297 DO i = 1, imsglen(j)
3299 msg(j) (i:i) = char(imsg(k))
3303 DEALLOCATE (imsglen)
3304 CALL add_perf(perf_id=2, count=1, msg_size=msglen*charlen*msgsiz)
3310 CALL mp_timestop(handle)
3311 END SUBROUTINE mp_bcast_am
3313 SUBROUTINE mp_bcast_am_src(msg, comm)
3314 CHARACTER(LEN=*),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3317 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_am_src'
3320#if defined(__parallel)
3321 INTEGER :: i, ierr, j, k, msglen, msgsiz
3322 INTEGER,
ALLOCATABLE :: imsg(:), imsglen(:)
3325 CALL mp_timeset(routinen, handle)
3327#if defined(__parallel)
3330 ALLOCATE (imsglen(1:msgsiz))
3332 imsglen(j) = len_trim(msg(j))
3334 CALL comm%bcast(imsglen, comm%source)
3335 msglen = sum(imsglen)
3340 ALLOCATE (imsg(1:msglen))
3343 DO i = 1, imsglen(j)
3345 imsg(k) = ichar(msg(j) (i:i))
3348 CALL mpi_bcast(imsg, msglen, mpi_integer, comm%source, comm%handle, ierr)
3349 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3353 DO i = 1, imsglen(j)
3355 msg(j) (i:i) = char(imsg(k))
3359 DEALLOCATE (imsglen)
3360 CALL add_perf(perf_id=2, count=1, msg_size=msglen*charlen*msgsiz)
3365 CALL mp_timestop(handle)
3366 END SUBROUTINE mp_bcast_am_src
3378 SUBROUTINE mp_minloc_dv(msg, comm)
3379 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3382 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_minloc_dv'
3385#if defined(__parallel)
3386 INTEGER :: ierr, msglen
3387 REAL(kind=real_8),
ALLOCATABLE :: res(:)
3390 IF (
"d" ==
"l" .AND. real_8 == int_8)
THEN
3391 cpabort(
"Minimal location not available with long integers @ "//routinen)
3393 CALL mp_timeset(routinen, handle)
3395#if defined(__parallel)
3397 ALLOCATE (res(1:msglen), stat=ierr)
3399 cpabort(
"allocate @ "//routinen)
3400 CALL mpi_allreduce(msg, res, msglen/2, mpi_2double_precision, mpi_minloc, comm%handle, ierr)
3401 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3404 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
3409 CALL mp_timestop(handle)
3410 END SUBROUTINE mp_minloc_dv
3422 SUBROUTINE mp_minloc_iv(msg, comm)
3423 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3426 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_minloc_iv'
3429#if defined(__parallel)
3430 INTEGER :: ierr, msglen
3431 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
3434 IF (
"i" ==
"l" .AND. int_4 == int_8)
THEN
3435 cpabort(
"Minimal location not available with long integers @ "//routinen)
3437 CALL mp_timeset(routinen, handle)
3439#if defined(__parallel)
3441 ALLOCATE (res(1:msglen))
3442 CALL mpi_allreduce(msg, res, msglen/2, mpi_2integer, mpi_minloc, comm%handle, ierr)
3443 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3446 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
3451 CALL mp_timestop(handle)
3452 END SUBROUTINE mp_minloc_iv
3464 SUBROUTINE mp_minloc_lv(msg, comm)
3465 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3468 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_minloc_lv'
3471#if defined(__parallel)
3472 INTEGER :: ierr, msglen
3473 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
3476 IF (
"l" ==
"l" .AND. int_8 == int_8)
THEN
3477 cpabort(
"Minimal location not available with long integers @ "//routinen)
3479 CALL mp_timeset(routinen, handle)
3481#if defined(__parallel)
3483 ALLOCATE (res(1:msglen))
3484 CALL mpi_allreduce(msg, res, msglen/2, mpi_integer8, mpi_minloc, comm%handle, ierr)
3485 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3488 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
3493 CALL mp_timestop(handle)
3494 END SUBROUTINE mp_minloc_lv
3506 SUBROUTINE mp_minloc_rv(msg, comm)
3507 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3510 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_minloc_rv'
3513#if defined(__parallel)
3514 INTEGER :: ierr, msglen
3515 REAL(kind=real_4),
ALLOCATABLE :: res(:)
3518 IF (
"r" ==
"l" .AND. real_4 == int_8)
THEN
3519 cpabort(
"Minimal location not available with long integers @ "//routinen)
3521 CALL mp_timeset(routinen, handle)
3523#if defined(__parallel)
3525 ALLOCATE (res(1:msglen))
3526 CALL mpi_allreduce(msg, res, msglen/2, mpi_2real, mpi_minloc, comm%handle, ierr)
3527 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3530 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
3535 CALL mp_timestop(handle)
3536 END SUBROUTINE mp_minloc_rv
3548 SUBROUTINE mp_maxloc_dv(msg, comm)
3549 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3552 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_maxloc_dv'
3555#if defined(__parallel)
3556 INTEGER :: ierr, msglen
3557 REAL(kind=real_8),
ALLOCATABLE :: res(:)
3560 IF (
"d" ==
"l" .AND. real_8 == int_8)
THEN
3561 cpabort(
"Maximal location not available with long integers @ "//routinen)
3563 CALL mp_timeset(routinen, handle)
3565#if defined(__parallel)
3567 ALLOCATE (res(1:msglen))
3568 CALL mpi_allreduce(msg, res, msglen/2, mpi_2double_precision, mpi_maxloc, comm%handle, ierr)
3569 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3572 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
3577 CALL mp_timestop(handle)
3578 END SUBROUTINE mp_maxloc_dv
3590 SUBROUTINE mp_maxloc_iv(msg, comm)
3591 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3594 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_maxloc_iv'
3597#if defined(__parallel)
3598 INTEGER :: ierr, msglen
3599 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
3602 IF (
"i" ==
"l" .AND. int_4 == int_8)
THEN
3603 cpabort(
"Maximal location not available with long integers @ "//routinen)
3605 CALL mp_timeset(routinen, handle)
3607#if defined(__parallel)
3609 ALLOCATE (res(1:msglen))
3610 CALL mpi_allreduce(msg, res, msglen/2, mpi_2integer, mpi_maxloc, comm%handle, ierr)
3611 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3614 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
3619 CALL mp_timestop(handle)
3620 END SUBROUTINE mp_maxloc_iv
3632 SUBROUTINE mp_maxloc_lv(msg, comm)
3633 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3636 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_maxloc_lv'
3639#if defined(__parallel)
3640 INTEGER :: ierr, msglen
3641 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
3644 IF (
"l" ==
"l" .AND. int_8 == int_8)
THEN
3645 cpabort(
"Maximal location not available with long integers @ "//routinen)
3647 CALL mp_timeset(routinen, handle)
3649#if defined(__parallel)
3651 ALLOCATE (res(1:msglen))
3652 CALL mpi_allreduce(msg, res, msglen/2, mpi_integer8, mpi_maxloc, comm%handle, ierr)
3653 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3656 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
3661 CALL mp_timestop(handle)
3662 END SUBROUTINE mp_maxloc_lv
3674 SUBROUTINE mp_maxloc_rv(msg, comm)
3675 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3678 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_maxloc_rv'
3681#if defined(__parallel)
3682 INTEGER :: ierr, msglen
3683 REAL(kind=real_4),
ALLOCATABLE :: res(:)
3686 IF (
"r" ==
"l" .AND. real_4 == int_8)
THEN
3687 cpabort(
"Maximal location not available with long integers @ "//routinen)
3689 CALL mp_timeset(routinen, handle)
3691#if defined(__parallel)
3693 ALLOCATE (res(1:msglen))
3694 CALL mpi_allreduce(msg, res, msglen/2, mpi_2real, mpi_maxloc, comm%handle, ierr)
3695 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3698 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
3703 CALL mp_timestop(handle)
3704 END SUBROUTINE mp_maxloc_rv
3714 SUBROUTINE mp_sum_b(msg, comm)
3715 LOGICAL,
INTENT(INOUT) :: msg
3718 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_sum_b'
3721#if defined(__parallel)
3722 INTEGER :: ierr, msglen
3725 CALL mp_timeset(routinen, handle)
3726#if defined(__parallel)
3728 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, ierr)
3729 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3734 CALL mp_timestop(handle)
3735 END SUBROUTINE mp_sum_b
3745 SUBROUTINE mp_sum_bv(msg, comm)
3746 LOGICAL,
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: msg
3749 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_sum_bv'
3752#if defined(__parallel)
3753 INTEGER :: ierr, msglen
3756 CALL mp_timeset(routinen, handle)
3757#if defined(__parallel)
3759 IF (msglen > 0)
THEN
3760 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, ierr)
3761 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3767 CALL mp_timestop(handle)
3768 END SUBROUTINE mp_sum_bv
3779 SUBROUTINE mp_isum_bv(msg, comm, request)
3780 LOGICAL,
DIMENSION(:),
INTENT(INOUT) :: msg
3784 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_isum_bv'
3787#if defined(__parallel)
3788 INTEGER :: ierr, msglen
3791 CALL mp_timeset(routinen, handle)
3792#if defined(__parallel)
3794#if !defined(__GNUC__) || __GNUC__ >= 9
3795 cpassert(is_contiguous(msg))
3798 IF (msglen > 0)
THEN
3799 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, request%handle, ierr)
3800 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3809 CALL mp_timestop(handle)
3810 END SUBROUTINE mp_isum_bv
3820 CHARACTER(len=*),
INTENT(OUT) :: version
3821 INTEGER,
INTENT(OUT) :: resultlen
3823#if defined(__parallel)
3829#if defined(__parallel)
3831 CALL mpi_get_library_version(version, resultlen, ierr)
3832 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_get_library_version @ mp_get_library_version")
3852 SUBROUTINE mp_file_open(groupid, fh, filepath, amode_status, info)
3855 CHARACTER(len=*),
INTENT(IN) :: filepath
3856 INTEGER,
INTENT(IN) :: amode_status
3859#if defined(__parallel)
3861 mpi_info_type :: my_info
3863 CHARACTER(LEN=10) :: fstatus, fposition
3864 INTEGER :: amode, handle, istat
3865 LOGICAL :: exists, is_open
3868#if defined(__parallel)
3870 my_info = mpi_info_null
3871 IF (
PRESENT(info)) my_info = info%handle
3872 CALL mpi_file_open(groupid%handle, filepath, amode_status, my_info, fh%handle, ierr)
3873 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3874 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_open")
3878 amode = amode_status
3880 fposition =
"APPEND"
3883 fposition =
"REWIND"
3894 INQUIRE (unit=handle, exist=exists, opened=is_open, iostat=istat)
3895 IF (exists .AND. (.NOT. is_open) .AND. (istat == 0))
EXIT
3897 OPEN (unit=handle, file=filepath, status=fstatus, access=
"STREAM", position=fposition)
3900 END SUBROUTINE mp_file_open
3911 CHARACTER(len=*),
INTENT(IN) :: filepath
3914#if defined(__parallel)
3916 mpi_info_type :: my_info
3920 my_info = mpi_info_null
3921 IF (
PRESENT(info)) my_info = info%handle
3922 INQUIRE (file=filepath, exist=exists)
3923 IF (exists)
CALL mpi_file_delete(filepath, my_info, ierr)
3924 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_delete")
3942 SUBROUTINE mp_file_close(fh)
3945#if defined(__parallel)
3949 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3950 CALL mpi_file_close(fh%handle, ierr)
3951 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_close")
3954 fh%handle = mp_file_null_handle
3956 END SUBROUTINE mp_file_close
3958 SUBROUTINE mp_file_assign(fh_new, fh_old)
3962 fh_new%handle = fh_old%handle
3976 SUBROUTINE mp_file_get_size(fh, file_size)
3978 INTEGER(kind=file_offset),
INTENT(OUT) :: file_size
3980#if defined(__parallel)
3984#if defined(__parallel)
3986 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3987 CALL mpi_file_get_size(fh%handle, file_size, ierr)
3988 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_get_size")
3990 INQUIRE (unit=fh%handle, size=file_size)
3992 END SUBROUTINE mp_file_get_size
4004 SUBROUTINE mp_file_get_position(fh, pos)
4006 INTEGER(kind=file_offset),
INTENT(OUT) :: pos
4008#if defined(__parallel)
4012#if defined(__parallel)
4014 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4015 CALL mpi_file_get_position(fh%handle, pos, ierr)
4016 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_get_position")
4018 INQUIRE (unit=fh%handle, pos=pos)
4020 END SUBROUTINE mp_file_get_position
4033 SUBROUTINE mp_file_write_at_chv(fh, offset, msg, msglen)
4034 CHARACTER,
CONTIGUOUS,
INTENT(IN) :: msg(:)
4036 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
4037 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4039#if defined(__parallel)
4040 INTEGER :: ierr, msg_len
4043#if defined(__parallel)
4045 IF (
PRESENT(msglen)) msg_len = msglen
4046 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4048 cpabort(
"mpi_file_write_at_chv @ mp_file_write_at_chv")
4051 WRITE (unit=fh%handle, pos=offset + 1) msg
4053 END SUBROUTINE mp_file_write_at_chv
4061 SUBROUTINE mp_file_write_at_ch(fh, offset, msg)
4062 CHARACTER(LEN=*),
INTENT(IN) :: msg
4064 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4066#if defined(__parallel)
4070#if defined(__parallel)
4071 CALL mpi_file_write_at(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4073 cpabort(
"mpi_file_write_at_ch @ mp_file_write_at_ch")
4075 WRITE (unit=fh%handle, pos=offset + 1) msg
4077 END SUBROUTINE mp_file_write_at_ch
4089 SUBROUTINE mp_file_write_at_all_chv(fh, offset, msg, msglen)
4090 CHARACTER,
CONTIGUOUS,
INTENT(IN) :: msg(:)
4092 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
4093 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4095#if defined(__parallel)
4096 INTEGER :: ierr, msg_len
4099#if defined(__parallel)
4101 IF (
PRESENT(msglen)) msg_len = msglen
4102 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4104 cpabort(
"mpi_file_write_at_all_chv @ mp_file_write_at_all_chv")
4107 WRITE (unit=fh%handle, pos=offset + 1) msg
4109 END SUBROUTINE mp_file_write_at_all_chv
4117 SUBROUTINE mp_file_write_at_all_ch(fh, offset, msg)
4118 CHARACTER(LEN=*),
INTENT(IN) :: msg
4120 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4122#if defined(__parallel)
4126#if defined(__parallel)
4127 CALL mpi_file_write_at_all(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4129 cpabort(
"mpi_file_write_at_all_ch @ mp_file_write_at_all_ch")
4131 WRITE (unit=fh%handle, pos=offset + 1) msg
4133 END SUBROUTINE mp_file_write_at_all_ch
4146 SUBROUTINE mp_file_read_at_chv(fh, offset, msg, msglen)
4147 CHARACTER,
CONTIGUOUS,
INTENT(OUT) :: msg(:)
4149 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
4150 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4152#if defined(__parallel)
4153 INTEGER :: ierr, msg_len
4156#if defined(__parallel)
4158 IF (
PRESENT(msglen)) msg_len = msglen
4159 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4161 cpabort(
"mpi_file_read_at_chv @ mp_file_read_at_chv")
4164 READ (unit=fh%handle, pos=offset + 1) msg
4166 END SUBROUTINE mp_file_read_at_chv
4174 SUBROUTINE mp_file_read_at_ch(fh, offset, msg)
4175 CHARACTER(LEN=*),
INTENT(OUT) :: msg
4177 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4179#if defined(__parallel)
4183#if defined(__parallel)
4184 CALL mpi_file_read_at(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4186 cpabort(
"mpi_file_read_at_ch @ mp_file_read_at_ch")
4188 READ (unit=fh%handle, pos=offset + 1) msg
4190 END SUBROUTINE mp_file_read_at_ch
4202 SUBROUTINE mp_file_read_at_all_chv(fh, offset, msg, msglen)
4203 CHARACTER,
INTENT(OUT) :: msg(:)
4205 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
4206 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4208#if defined(__parallel)
4209 INTEGER :: ierr, msg_len
4212#if defined(__parallel)
4214 IF (
PRESENT(msglen)) msg_len = msglen
4215 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4217 cpabort(
"mpi_file_read_at_all_chv @ mp_file_read_at_all_chv")
4220 READ (unit=fh%handle, pos=offset + 1) msg
4222 END SUBROUTINE mp_file_read_at_all_chv
4230 SUBROUTINE mp_file_read_at_all_ch(fh, offset, msg)
4231 CHARACTER(LEN=*),
INTENT(OUT) :: msg
4233 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4235#if defined(__parallel)
4239#if defined(__parallel)
4240 CALL mpi_file_read_at_all(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4242 cpabort(
"mpi_file_read_at_all_ch @ mp_file_read_at_all_ch")
4244 READ (unit=fh%handle, pos=offset + 1) msg
4246 END SUBROUTINE mp_file_read_at_all_ch
4258 INTEGER,
INTENT(OUT) :: type_size
4260#if defined(__parallel)
4264 CALL mpi_type_size(type_descriptor%type_handle, type_size, ierr)
4266 cpabort(
"mpi_type_size failed @ mp_type_size")
4268 SELECT CASE (type_descriptor%type_handle)
4270 type_size = real_4_size
4272 type_size = real_8_size
4274 type_size = 2*real_4_size
4276 type_size = 2*real_8_size
4288 FUNCTION mp_type_make_struct(subtypes, &
4289 vector_descriptor, index_descriptor) &
4290 result(type_descriptor)
4292 DIMENSION(:),
INTENT(IN) :: subtypes
4293 INTEGER,
DIMENSION(2),
INTENT(IN), &
4294 OPTIONAL :: vector_descriptor
4295 TYPE(mp_indexing_meta_type), &
4296 INTENT(IN),
OPTIONAL :: index_descriptor
4299 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_struct'
4302 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: lengths
4303#if defined(__parallel)
4305 INTEGER(kind=mpi_address_kind), &
4306 ALLOCATABLE,
DIMENSION(:) :: displacements
4308 mpi_data_type,
ALLOCATABLE,
DIMENSION(:) :: old_types
4311 type_descriptor%length = 1
4312#if defined(__parallel)
4314 CALL mpi_get_address(mpi_bottom, type_descriptor%base, ierr)
4316 cpabort(
"MPI_get_address @ "//routinen)
4317 ALLOCATE (displacements(n))
4319 type_descriptor%vector_descriptor(1:2) = 1
4320 type_descriptor%has_indexing = .false.
4321 ALLOCATE (type_descriptor%subtype(n))
4322 type_descriptor%subtype(:) = subtypes(:)
4323 ALLOCATE (lengths(n), old_types(n))
4324 DO i = 1,
SIZE(subtypes)
4325#if defined(__parallel)
4326 displacements(i) = subtypes(i)%base
4328 old_types(i) = subtypes(i)%type_handle
4329 lengths(i) = subtypes(i)%length
4331#if defined(__parallel)
4332 CALL mpi_type_create_struct(n, &
4333 lengths, displacements, old_types, &
4334 type_descriptor%type_handle, ierr)
4336 cpabort(
"MPI_Type_create_struct @ "//routinen)
4337 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
4339 cpabort(
"MPI_Type_commit @ "//routinen)
4341 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
4342 cpabort(routinen//
" Vectors and indices NYI")
4344 END FUNCTION mp_type_make_struct
4350 RECURSIVE SUBROUTINE mp_type_free_m(type_descriptor)
4353 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_free_m'
4355 INTEGER :: handle, i
4356#if defined(__parallel)
4360 CALL mp_timeset(routinen, handle)
4364 IF (
ASSOCIATED(type_descriptor%subtype))
THEN
4365 DO i = 1,
SIZE(type_descriptor%subtype)
4366 CALL mp_type_free_m(type_descriptor%subtype(i))
4368 DEALLOCATE (type_descriptor%subtype)
4370#if defined(__parallel)
4372 CALL mpi_type_free(type_descriptor%type_handle, ierr)
4374 cpabort(
"MPI_Type_free @ "//routinen)
4377 CALL mp_timestop(handle)
4379 END SUBROUTINE mp_type_free_m
4385 SUBROUTINE mp_type_free_v(type_descriptors)
4387 INTENT(inout) :: type_descriptors
4391 DO i = 1,
SIZE(type_descriptors)
4392 CALL mp_type_free(type_descriptors(i))
4395 END SUBROUTINE mp_type_free_v
4406 result(type_descriptor)
4407 INTEGER,
INTENT(IN) :: count
4408 INTEGER,
DIMENSION(1:count), &
4409 INTENT(IN),
TARGET :: lengths
4410 INTEGER(kind=file_offset), &
4411 DIMENSION(1:count),
INTENT(in),
TARGET :: displs
4414 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_hindexed_make_chv'
4416 INTEGER :: ierr, handle
4419 CALL mp_timeset(routinen, handle)
4421#if defined(__parallel)
4422 CALL mpi_type_create_hindexed(count, lengths, int(displs, kind=
address_kind), mpi_character, &
4423 type_descriptor%type_handle, ierr)
4425 cpabort(
"MPI_Type_create_hindexed @ "//routinen)
4426 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
4428 cpabort(
"MPI_Type_commit @ "//routinen)
4430 type_descriptor%type_handle = 68
4432 type_descriptor%length = count
4433 type_descriptor%has_indexing = .true.
4434 type_descriptor%index_descriptor%index => lengths
4435 type_descriptor%index_descriptor%chunks => displs
4437 CALL mp_timestop(handle)
4451 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4454 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_set_view_chv'
4457#if defined(__parallel)
4461 CALL mp_timeset(routinen, handle)
4463#if defined(__parallel)
4465 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4466 CALL mpi_file_set_view(fh%handle, offset, mpi_character, &
4467 type_descriptor%type_handle,
"native", mpi_info_null, ierr)
4468 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_set_view")
4473 mark_used(type_descriptor)
4476 CALL mp_timestop(handle)
4491 SUBROUTINE mp_file_read_all_chv(fh, msglen, ndims, buffer, type_descriptor)
4493 INTEGER,
INTENT(IN) :: msglen
4494 INTEGER,
INTENT(IN) :: ndims
4495 CHARACTER(LEN=msglen),
DIMENSION(ndims),
INTENT(INOUT) :: buffer
4497 INTENT(IN),
OPTIONAL :: type_descriptor
4499 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_read_all_chv'
4502#if defined(__parallel)
4508 CALL mp_timeset(routinen, handle)
4510#if defined(__parallel)
4512 mark_used(type_descriptor)
4513 CALL mpi_file_read_all(fh%handle, buffer, ndims*msglen, mpi_character, mpi_status_ignore, ierr)
4514 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_read_all")
4515 CALL add_perf(perf_id=28, count=1, msg_size=ndims*msglen)
4519 IF (.NOT.
PRESENT(type_descriptor)) &
4520 CALL cp_abort(__location__, &
4521 "Container for mp_file_descriptor_type must be present in serial call.")
4522 IF (.NOT. type_descriptor%has_indexing) &
4523 CALL cp_abort(__location__, &
4524 "File view has not been set in mp_file_descriptor_type.")
4527 READ (fh%handle, pos=type_descriptor%index_descriptor%chunks(i)) buffer(i)
4531 CALL mp_timestop(handle)
4533 END SUBROUTINE mp_file_read_all_chv
4546 SUBROUTINE mp_file_write_all_chv(fh, msglen, ndims, buffer, type_descriptor)
4548 INTEGER,
INTENT(IN) :: msglen
4549 INTEGER,
INTENT(IN) :: ndims
4550 CHARACTER(LEN=msglen),
DIMENSION(ndims),
INTENT(IN) :: buffer
4552 INTENT(IN),
OPTIONAL :: type_descriptor
4554 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_write_all_chv'
4557#if defined(__parallel)
4563 CALL mp_timeset(routinen, handle)
4565#if defined(__parallel)
4566 mark_used(type_descriptor)
4567 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4568 CALL mpi_file_write_all(fh%handle, buffer, ndims*msglen, mpi_character, mpi_status_ignore, ierr)
4569 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_write_all")
4570 CALL add_perf(perf_id=28, count=1, msg_size=ndims*msglen)
4574 IF (.NOT.
PRESENT(type_descriptor)) &
4575 CALL cp_abort(__location__, &
4576 "Container for mp_file_descriptor_type must be present in serial call.")
4577 IF (.NOT. type_descriptor%has_indexing) &
4578 CALL cp_abort(__location__, &
4579 "File view has not been set in mp_file_descriptor_type.")
4582 WRITE (fh%handle, pos=type_descriptor%index_descriptor%chunks(i)) buffer(i)
4586 CALL mp_timestop(handle)
4588 END SUBROUTINE mp_file_write_all_chv
4598 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_type_free'
4601#if defined(__parallel)
4605 CALL mp_timeset(routinen, handle)
4607#if defined(__parallel)
4608 CALL mpi_type_free(type_descriptor%type_handle, ierr)
4610 cpabort(
"MPI_Type_free @ "//routinen)
4612#if defined(__parallel) && defined(__MPI_F08)
4613 type_descriptor%type_handle%mpi_val = -1
4615 type_descriptor%type_handle = -1
4617 type_descriptor%length = -1
4618 IF (type_descriptor%has_indexing)
THEN
4619 NULLIFY (type_descriptor%index_descriptor%index)
4620 NULLIFY (type_descriptor%index_descriptor%chunks)
4621 type_descriptor%has_indexing = .false.
4624 CALL mp_timestop(handle)
4642 LOGICAL,
INTENT(INOUT) :: mpi_io, replace
4643 INTEGER,
INTENT(OUT) :: amode
4644 CHARACTER(len=*),
INTENT(IN) :: form, action, status, position
4647#if defined(__parallel)
4652 CASE (
"UNFORMATTED")
4655 cpabort(
"Unknown MPI file form requested.")
4658 SELECT CASE (action)
4661 SELECT CASE (status)
4668 SELECT CASE (position)
4672 CASE (
"REWIND",
"ASIS")
4675 cpabort(
"Unknown MPI file position requested.")
4678 SELECT CASE (position)
4682 CASE (
"REWIND",
"ASIS")
4685 cpabort(
"Unknown MPI file position requested.")
4695 cpabort(
"Unknown MPI file status requested.")
4699 SELECT CASE (status)
4701 cpabort(
"Cannot read from 'NEW' file.")
4703 cpabort(
"Illegal status 'REPLACE' for read.")
4704 CASE (
"UNKNOWN",
"OLD")
4710 cpabort(
"Unknown MPI file status requested.")
4714 SELECT CASE (status)
4721 SELECT CASE (position)
4725 CASE (
"REWIND",
"ASIS")
4728 cpabort(
"Unknown MPI file position requested.")
4731 SELECT CASE (position)
4735 CASE (
"REWIND",
"ASIS")
4738 cpabort(
"Unknown MPI file position requested.")
4748 cpabort(
"Unknown MPI file status requested.")
4751 cpabort(
"Unknown MPI file action requested.")
4772 SUBROUTINE mp_isend_custom(msgin, dest, comm, request, tag)
4774 INTEGER,
INTENT(IN) :: dest
4777 INTEGER,
INTENT(in),
OPTIONAL :: tag
4779 INTEGER :: ierr, my_tag
4784#if defined(__parallel)
4785 IF (
PRESENT(tag)) my_tag = tag
4787 CALL mpi_isend(mpi_bottom, 1, msgin%type_handle, dest, my_tag, &
4788 comm%handle, request%handle, ierr)
4789 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ mp_isend_custom")
4797 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
4799 END SUBROUTINE mp_isend_custom
4809 SUBROUTINE mp_irecv_custom(msgout, source, comm, request, tag)
4811 INTEGER,
INTENT(IN) :: source
4814 INTEGER,
INTENT(in),
OPTIONAL :: tag
4816 INTEGER :: ierr, my_tag
4821#if defined(__parallel)
4822 IF (
PRESENT(tag)) my_tag = tag
4824 CALL mpi_irecv(mpi_bottom, 1, msgout%type_handle, source, my_tag, &
4825 comm%handle, request%handle, ierr)
4826 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ mp_irecv_custom")
4834 cpabort(
"mp_irecv called in non parallel case")
4836 END SUBROUTINE mp_irecv_custom
4842 SUBROUTINE mp_win_free(win)
4845 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_free'
4848#if defined(__parallel)
4852 CALL mp_timeset(routinen, handle)
4854#if defined(__parallel)
4856 CALL mpi_win_free(win%handle, ierr)
4857 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_free @ "//routinen)
4859 CALL add_perf(perf_id=21, count=1)
4861 win%handle = mp_win_null_handle
4863 CALL mp_timestop(handle)
4864 END SUBROUTINE mp_win_free
4866 SUBROUTINE mp_win_assign(win_new, win_old)
4870 win_new%handle = win_old%handle
4872 END SUBROUTINE mp_win_assign
4878 SUBROUTINE mp_win_flush_all(win)
4881 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_flush_all'
4883 INTEGER :: handle, ierr
4886 CALL mp_timeset(routinen, handle)
4888#if defined(__parallel)
4889 CALL mpi_win_flush_all(win%handle, ierr)
4890 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_flush_all @ "//routinen)
4894 CALL mp_timestop(handle)
4895 END SUBROUTINE mp_win_flush_all
4901 SUBROUTINE mp_win_lock_all(win)
4904 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_lock_all'
4906 INTEGER :: handle, ierr
4909 CALL mp_timeset(routinen, handle)
4911#if defined(__parallel)
4913 CALL mpi_win_lock_all(mpi_mode_nocheck, win%handle, ierr)
4914 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_lock_all @ "//routinen)
4916 CALL add_perf(perf_id=19, count=1)
4920 CALL mp_timestop(handle)
4921 END SUBROUTINE mp_win_lock_all
4927 SUBROUTINE mp_win_unlock_all(win)
4930 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_unlock_all'
4932 INTEGER :: handle, ierr
4935 CALL mp_timeset(routinen, handle)
4937#if defined(__parallel)
4939 CALL mpi_win_unlock_all(win%handle, ierr)
4940 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_unlock_all @ "//routinen)
4942 CALL add_perf(perf_id=19, count=1)
4946 CALL mp_timestop(handle)
4947 END SUBROUTINE mp_win_unlock_all
4954 SUBROUTINE mp_timeset(routineN, handle)
4955 CHARACTER(len=*),
INTENT(IN) :: routinen
4956 INTEGER,
INTENT(OUT) :: handle
4959 CALL timeset(routinen, handle)
4960 END SUBROUTINE mp_timeset
4966 SUBROUTINE mp_timestop(handle)
4967 INTEGER,
INTENT(IN) :: handle
4970 CALL timestop(handle)
4971 END SUBROUTINE mp_timestop
4984 SUBROUTINE mp_shift_im(msg, comm, displ_in)
4986 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
4988 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
4990 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_im'
4992 INTEGER :: handle, ierror
4993#if defined(__parallel)
4994 INTEGER :: displ, left, &
4995 msglen, myrank, nprocs, &
5000 CALL mp_timeset(routinen, handle)
5002#if defined(__parallel)
5003 CALL mpi_comm_rank(comm%handle, myrank, ierror)
5004 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
5005 CALL mpi_comm_size(comm%handle, nprocs, ierror)
5006 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
5007 IF (
PRESENT(displ_in))
THEN
5012 right =
modulo(myrank + displ, nprocs)
5013 left =
modulo(myrank - displ, nprocs)
5016 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer, right, tag, left, tag, &
5017 comm%handle, mpi_status_ignore, ierror)
5018 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
5019 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_4_size)
5025 CALL mp_timestop(handle)
5027 END SUBROUTINE mp_shift_im
5040 SUBROUTINE mp_shift_i (msg, comm, displ_in)
5042 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5044 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
5046 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_i'
5048 INTEGER :: handle, ierror
5049#if defined(__parallel)
5050 INTEGER :: displ, left, &
5051 msglen, myrank, nprocs, &
5056 CALL mp_timeset(routinen, handle)
5058#if defined(__parallel)
5059 CALL mpi_comm_rank(comm%handle, myrank, ierror)
5060 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
5061 CALL mpi_comm_size(comm%handle, nprocs, ierror)
5062 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
5063 IF (
PRESENT(displ_in))
THEN
5068 right =
modulo(myrank + displ, nprocs)
5069 left =
modulo(myrank - displ, nprocs)
5072 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer, right, tag, left, &
5073 tag, comm%handle, mpi_status_ignore, ierror)
5074 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
5075 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_4_size)
5081 CALL mp_timestop(handle)
5083 END SUBROUTINE mp_shift_i
5104 SUBROUTINE mp_alltoall_i11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
5106 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
5107 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
5108 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
5109 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
5112 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i11v'
5115#if defined(__parallel)
5116 INTEGER :: ierr, msglen
5121 CALL mp_timeset(routinen, handle)
5123#if defined(__parallel)
5124 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer, &
5125 rb, rcount, rdispl, mpi_integer, comm%handle, ierr)
5126 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
5127 msglen = sum(scount) + sum(rcount)
5128 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5135 rb(rdispl(1) + i) = sb(sdispl(1) + i)
5138 CALL mp_timestop(handle)
5140 END SUBROUTINE mp_alltoall_i11v
5155 SUBROUTINE mp_alltoall_i22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
5157 INTEGER(KIND=int_4),
DIMENSION(:, :), &
5158 INTENT(IN),
CONTIGUOUS :: sb
5159 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
5160 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS, &
5162 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
5165 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i22v'
5168#if defined(__parallel)
5169 INTEGER :: ierr, msglen
5172 CALL mp_timeset(routinen, handle)
5174#if defined(__parallel)
5175 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer, &
5176 rb, rcount, rdispl, mpi_integer, comm%handle, ierr)
5177 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
5178 msglen = sum(scount) + sum(rcount)
5179 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*int_4_size)
5188 CALL mp_timestop(handle)
5190 END SUBROUTINE mp_alltoall_i22v
5207 SUBROUTINE mp_alltoall_i (sb, rb, count, comm)
5209 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
5210 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
5211 INTEGER,
INTENT(IN) :: count
5214 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i'
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_i
5248 SUBROUTINE mp_alltoall_i22(sb, rb, count, comm)
5250 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
5251 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
5252 INTEGER,
INTENT(IN) :: count
5255 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i22'
5258#if defined(__parallel)
5259 INTEGER :: ierr, msglen, np
5262 CALL mp_timeset(routinen, handle)
5264#if defined(__parallel)
5265 CALL mpi_alltoall(sb, count, mpi_integer, &
5266 rb, count, mpi_integer, comm%handle, ierr)
5267 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5268 CALL mpi_comm_size(comm%handle, np, ierr)
5269 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5270 msglen = 2*
SIZE(sb)*np
5271 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5277 CALL mp_timestop(handle)
5279 END SUBROUTINE mp_alltoall_i22
5289 SUBROUTINE mp_alltoall_i33(sb, rb, count, comm)
5291 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
5292 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
5293 INTEGER,
INTENT(IN) :: count
5296 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i33'
5299#if defined(__parallel)
5300 INTEGER :: ierr, msglen, np
5303 CALL mp_timeset(routinen, handle)
5305#if defined(__parallel)
5306 CALL mpi_alltoall(sb, count, mpi_integer, &
5307 rb, count, mpi_integer, comm%handle, ierr)
5308 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5309 CALL mpi_comm_size(comm%handle, np, ierr)
5310 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5312 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5318 CALL mp_timestop(handle)
5320 END SUBROUTINE mp_alltoall_i33
5330 SUBROUTINE mp_alltoall_i44(sb, rb, count, comm)
5332 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5334 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5336 INTEGER,
INTENT(IN) :: count
5339 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i44'
5342#if defined(__parallel)
5343 INTEGER :: ierr, msglen, np
5346 CALL mp_timeset(routinen, handle)
5348#if defined(__parallel)
5349 CALL mpi_alltoall(sb, count, mpi_integer, &
5350 rb, count, mpi_integer, comm%handle, ierr)
5351 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5352 CALL mpi_comm_size(comm%handle, np, ierr)
5353 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5355 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5361 CALL mp_timestop(handle)
5363 END SUBROUTINE mp_alltoall_i44
5373 SUBROUTINE mp_alltoall_i55(sb, rb, count, comm)
5375 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
5377 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
5379 INTEGER,
INTENT(IN) :: count
5382 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i55'
5385#if defined(__parallel)
5386 INTEGER :: ierr, msglen, np
5389 CALL mp_timeset(routinen, handle)
5391#if defined(__parallel)
5392 CALL mpi_alltoall(sb, count, mpi_integer, &
5393 rb, count, mpi_integer, comm%handle, ierr)
5394 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5395 CALL mpi_comm_size(comm%handle, np, ierr)
5396 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5398 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5404 CALL mp_timestop(handle)
5406 END SUBROUTINE mp_alltoall_i55
5417 SUBROUTINE mp_alltoall_i45(sb, rb, count, comm)
5419 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5421 INTEGER(KIND=int_4), &
5422 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
5423 INTEGER,
INTENT(IN) :: count
5426 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i45'
5429#if defined(__parallel)
5430 INTEGER :: ierr, msglen, np
5433 CALL mp_timeset(routinen, handle)
5435#if defined(__parallel)
5436 CALL mpi_alltoall(sb, count, mpi_integer, &
5437 rb, count, mpi_integer, comm%handle, ierr)
5438 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5439 CALL mpi_comm_size(comm%handle, np, ierr)
5440 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5442 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5446 rb = reshape(sb, shape(rb))
5448 CALL mp_timestop(handle)
5450 END SUBROUTINE mp_alltoall_i45
5461 SUBROUTINE mp_alltoall_i34(sb, rb, count, comm)
5463 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
5465 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5467 INTEGER,
INTENT(IN) :: count
5470 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i34'
5473#if defined(__parallel)
5474 INTEGER :: ierr, msglen, np
5477 CALL mp_timeset(routinen, handle)
5479#if defined(__parallel)
5480 CALL mpi_alltoall(sb, count, mpi_integer, &
5481 rb, count, mpi_integer, comm%handle, ierr)
5482 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5483 CALL mpi_comm_size(comm%handle, np, ierr)
5484 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5486 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5490 rb = reshape(sb, shape(rb))
5492 CALL mp_timestop(handle)
5494 END SUBROUTINE mp_alltoall_i34
5505 SUBROUTINE mp_alltoall_i54(sb, rb, count, comm)
5507 INTEGER(KIND=int_4), &
5508 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
5509 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5511 INTEGER,
INTENT(IN) :: count
5514 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i54'
5517#if defined(__parallel)
5518 INTEGER :: ierr, msglen, np
5521 CALL mp_timeset(routinen, handle)
5523#if defined(__parallel)
5524 CALL mpi_alltoall(sb, count, mpi_integer, &
5525 rb, count, mpi_integer, comm%handle, ierr)
5526 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5527 CALL mpi_comm_size(comm%handle, np, ierr)
5528 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5530 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5534 rb = reshape(sb, shape(rb))
5536 CALL mp_timestop(handle)
5538 END SUBROUTINE mp_alltoall_i54
5549 SUBROUTINE mp_send_i (msg, dest, tag, comm)
5550 INTEGER(KIND=int_4),
INTENT(IN) :: msg
5551 INTEGER,
INTENT(IN) :: dest, tag
5554 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_i'
5557#if defined(__parallel)
5558 INTEGER :: ierr, msglen
5561 CALL mp_timeset(routinen, handle)
5563#if defined(__parallel)
5565 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5566 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5567 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5574 cpabort(
"not in parallel mode")
5576 CALL mp_timestop(handle)
5577 END SUBROUTINE mp_send_i
5587 SUBROUTINE mp_send_iv(msg, dest, tag, comm)
5588 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
5589 INTEGER,
INTENT(IN) :: dest, tag
5592 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_iv'
5595#if defined(__parallel)
5596 INTEGER :: ierr, msglen
5599 CALL mp_timeset(routinen, handle)
5601#if defined(__parallel)
5603 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5604 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5605 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5612 cpabort(
"not in parallel mode")
5614 CALL mp_timestop(handle)
5615 END SUBROUTINE mp_send_iv
5625 SUBROUTINE mp_send_im2(msg, dest, tag, comm)
5626 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
5627 INTEGER,
INTENT(IN) :: dest, tag
5630 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_im2'
5633#if defined(__parallel)
5634 INTEGER :: ierr, msglen
5637 CALL mp_timeset(routinen, handle)
5639#if defined(__parallel)
5641 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5642 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5643 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5650 cpabort(
"not in parallel mode")
5652 CALL mp_timestop(handle)
5653 END SUBROUTINE mp_send_im2
5663 SUBROUTINE mp_send_im3(msg, dest, tag, comm)
5664 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
5665 INTEGER,
INTENT(IN) :: dest, tag
5668 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
5671#if defined(__parallel)
5672 INTEGER :: ierr, msglen
5675 CALL mp_timeset(routinen, handle)
5677#if defined(__parallel)
5679 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5680 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5681 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5688 cpabort(
"not in parallel mode")
5690 CALL mp_timestop(handle)
5691 END SUBROUTINE mp_send_im3
5702 SUBROUTINE mp_recv_i (msg, source, tag, comm)
5703 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5704 INTEGER,
INTENT(INOUT) :: source, tag
5707 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_i'
5710#if defined(__parallel)
5711 INTEGER :: ierr, msglen
5712 mpi_status_type :: status
5715 CALL mp_timeset(routinen, handle)
5717#if defined(__parallel)
5720 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5721 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5723 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5724 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5725 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5726 source = status mpi_status_extract(mpi_source)
5727 tag = status mpi_status_extract(mpi_tag)
5735 cpabort(
"not in parallel mode")
5737 CALL mp_timestop(handle)
5738 END SUBROUTINE mp_recv_i
5748 SUBROUTINE mp_recv_iv(msg, source, tag, comm)
5749 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5750 INTEGER,
INTENT(INOUT) :: source, tag
5753 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_iv'
5756#if defined(__parallel)
5757 INTEGER :: ierr, msglen
5758 mpi_status_type :: status
5761 CALL mp_timeset(routinen, handle)
5763#if defined(__parallel)
5766 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5767 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5769 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5770 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5771 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5772 source = status mpi_status_extract(mpi_source)
5773 tag = status mpi_status_extract(mpi_tag)
5781 cpabort(
"not in parallel mode")
5783 CALL mp_timestop(handle)
5784 END SUBROUTINE mp_recv_iv
5794 SUBROUTINE mp_recv_im2(msg, source, tag, comm)
5795 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
5796 INTEGER,
INTENT(INOUT) :: source, tag
5799 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_im2'
5802#if defined(__parallel)
5803 INTEGER :: ierr, msglen
5804 mpi_status_type :: status
5807 CALL mp_timeset(routinen, handle)
5809#if defined(__parallel)
5812 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5813 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5815 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5816 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5817 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5818 source = status mpi_status_extract(mpi_source)
5819 tag = status mpi_status_extract(mpi_tag)
5827 cpabort(
"not in parallel mode")
5829 CALL mp_timestop(handle)
5830 END SUBROUTINE mp_recv_im2
5840 SUBROUTINE mp_recv_im3(msg, source, tag, comm)
5841 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
5842 INTEGER,
INTENT(INOUT) :: source, tag
5845 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_im3'
5848#if defined(__parallel)
5849 INTEGER :: ierr, msglen
5850 mpi_status_type :: status
5853 CALL mp_timeset(routinen, handle)
5855#if defined(__parallel)
5858 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5859 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5861 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5862 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5863 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5864 source = status mpi_status_extract(mpi_source)
5865 tag = status mpi_status_extract(mpi_tag)
5873 cpabort(
"not in parallel mode")
5875 CALL mp_timestop(handle)
5876 END SUBROUTINE mp_recv_im3
5886 SUBROUTINE mp_bcast_i (msg, source, comm)
5887 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5888 INTEGER,
INTENT(IN) :: source
5891 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i'
5894#if defined(__parallel)
5895 INTEGER :: ierr, msglen
5898 CALL mp_timeset(routinen, handle)
5900#if defined(__parallel)
5902 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
5903 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5904 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5910 CALL mp_timestop(handle)
5911 END SUBROUTINE mp_bcast_i
5920 SUBROUTINE mp_bcast_i_src(msg, comm)
5921 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5924 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i_src'
5927#if defined(__parallel)
5928 INTEGER :: ierr, msglen
5931 CALL mp_timeset(routinen, handle)
5933#if defined(__parallel)
5935 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
5936 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5937 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5942 CALL mp_timestop(handle)
5943 END SUBROUTINE mp_bcast_i_src
5953 SUBROUTINE mp_ibcast_i (msg, source, comm, request)
5954 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5955 INTEGER,
INTENT(IN) :: source
5959 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_i'
5962#if defined(__parallel)
5963 INTEGER :: ierr, msglen
5966 CALL mp_timeset(routinen, handle)
5968#if defined(__parallel)
5970 CALL mpi_ibcast(msg, msglen, mpi_integer, source, comm%handle, request%handle, ierr)
5971 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
5972 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_4_size)
5979 CALL mp_timestop(handle)
5980 END SUBROUTINE mp_ibcast_i
5989 SUBROUTINE mp_bcast_iv(msg, source, comm)
5990 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5991 INTEGER,
INTENT(IN) :: source
5994 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_iv'
5997#if defined(__parallel)
5998 INTEGER :: ierr, msglen
6001 CALL mp_timeset(routinen, handle)
6003#if defined(__parallel)
6005 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
6006 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6007 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6013 CALL mp_timestop(handle)
6014 END SUBROUTINE mp_bcast_iv
6022 SUBROUTINE mp_bcast_iv_src(msg, comm)
6023 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6026 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_iv_src'
6029#if defined(__parallel)
6030 INTEGER :: ierr, msglen
6033 CALL mp_timeset(routinen, handle)
6035#if defined(__parallel)
6037 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
6038 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6039 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6044 CALL mp_timestop(handle)
6045 END SUBROUTINE mp_bcast_iv_src
6054 SUBROUTINE mp_ibcast_iv(msg, source, comm, request)
6055 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6056 INTEGER,
INTENT(IN) :: source
6060 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_iv'
6063#if defined(__parallel)
6064 INTEGER :: ierr, msglen
6067 CALL mp_timeset(routinen, handle)
6069#if defined(__parallel)
6070#if !defined(__GNUC__) || __GNUC__ >= 9
6071 cpassert(is_contiguous(msg))
6074 CALL mpi_ibcast(msg, msglen, mpi_integer, source, comm%handle, request%handle, ierr)
6075 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
6076 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_4_size)
6083 CALL mp_timestop(handle)
6084 END SUBROUTINE mp_ibcast_iv
6093 SUBROUTINE mp_bcast_im(msg, source, comm)
6094 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6095 INTEGER,
INTENT(IN) :: source
6098 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_im'
6101#if defined(__parallel)
6102 INTEGER :: ierr, msglen
6105 CALL mp_timeset(routinen, handle)
6107#if defined(__parallel)
6109 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
6110 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6111 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6117 CALL mp_timestop(handle)
6118 END SUBROUTINE mp_bcast_im
6127 SUBROUTINE mp_bcast_im_src(msg, comm)
6128 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6131 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_im_src'
6134#if defined(__parallel)
6135 INTEGER :: ierr, msglen
6138 CALL mp_timeset(routinen, handle)
6140#if defined(__parallel)
6142 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
6143 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6144 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6149 CALL mp_timestop(handle)
6150 END SUBROUTINE mp_bcast_im_src
6159 SUBROUTINE mp_bcast_i3(msg, source, comm)
6160 INTEGER(KIND=int_4),
CONTIGUOUS :: msg(:, :, :)
6161 INTEGER,
INTENT(IN) :: source
6164 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i3'
6167#if defined(__parallel)
6168 INTEGER :: ierr, msglen
6171 CALL mp_timeset(routinen, handle)
6173#if defined(__parallel)
6175 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
6176 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6177 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6183 CALL mp_timestop(handle)
6184 END SUBROUTINE mp_bcast_i3
6193 SUBROUTINE mp_bcast_i3_src(msg, comm)
6194 INTEGER(KIND=int_4),
CONTIGUOUS :: msg(:, :, :)
6197 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i3_src'
6200#if defined(__parallel)
6201 INTEGER :: ierr, msglen
6204 CALL mp_timeset(routinen, handle)
6206#if defined(__parallel)
6208 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
6209 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6210 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6215 CALL mp_timestop(handle)
6216 END SUBROUTINE mp_bcast_i3_src
6225 SUBROUTINE mp_sum_i (msg, comm)
6226 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6229 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_i'
6232#if defined(__parallel)
6233 INTEGER :: ierr, msglen
6236 CALL mp_timeset(routinen, handle)
6238#if defined(__parallel)
6240 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6241 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6242 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6247 CALL mp_timestop(handle)
6248 END SUBROUTINE mp_sum_i
6256 SUBROUTINE mp_sum_iv(msg, comm)
6257 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6260 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_iv'
6263#if defined(__parallel)
6264 INTEGER :: ierr, msglen
6267 CALL mp_timeset(routinen, handle)
6269#if defined(__parallel)
6271 IF (msglen > 0)
THEN
6272 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6273 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6275 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6280 CALL mp_timestop(handle)
6281 END SUBROUTINE mp_sum_iv
6289 SUBROUTINE mp_isum_iv(msg, comm, request)
6290 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6294 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_iv'
6297#if defined(__parallel)
6298 INTEGER :: ierr, msglen
6301 CALL mp_timeset(routinen, handle)
6303#if defined(__parallel)
6304#if !defined(__GNUC__) || __GNUC__ >= 9
6305 cpassert(is_contiguous(msg))
6308 IF (msglen > 0)
THEN
6309 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, request%handle, ierr)
6310 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
6314 CALL add_perf(perf_id=23, count=1, msg_size=msglen*int_4_size)
6320 CALL mp_timestop(handle)
6321 END SUBROUTINE mp_isum_iv
6329 SUBROUTINE mp_sum_im(msg, comm)
6330 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6333 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im'
6336#if defined(__parallel)
6337 INTEGER,
PARAMETER :: max_msg = 2**25
6338 INTEGER :: ierr, m1, msglen, step, msglensum
6341 CALL mp_timeset(routinen, handle)
6343#if defined(__parallel)
6345 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
6347 DO m1 = lbound(msg, 2), ubound(msg, 2), step
6348 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
6349 msglensum = msglensum + msglen
6350 IF (msglen > 0)
THEN
6351 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6352 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6355 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_4_size)
6360 CALL mp_timestop(handle)
6361 END SUBROUTINE mp_sum_im
6369 SUBROUTINE mp_sum_im3(msg, comm)
6370 INTEGER(KIND=int_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
6373 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im3'
6376#if defined(__parallel)
6377 INTEGER :: ierr, msglen
6380 CALL mp_timeset(routinen, handle)
6382#if defined(__parallel)
6384 IF (msglen > 0)
THEN
6385 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6386 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6388 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6393 CALL mp_timestop(handle)
6394 END SUBROUTINE mp_sum_im3
6402 SUBROUTINE mp_sum_im4(msg, comm)
6403 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
6406 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im4'
6409#if defined(__parallel)
6410 INTEGER :: ierr, msglen
6413 CALL mp_timeset(routinen, handle)
6415#if defined(__parallel)
6417 IF (msglen > 0)
THEN
6418 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6419 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6421 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6426 CALL mp_timestop(handle)
6427 END SUBROUTINE mp_sum_im4
6439 SUBROUTINE mp_sum_root_iv(msg, root, comm)
6440 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6441 INTEGER,
INTENT(IN) :: root
6444 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_iv'
6447#if defined(__parallel)
6448 INTEGER :: ierr, m1, msglen, taskid
6449 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
6452 CALL mp_timeset(routinen, handle)
6454#if defined(__parallel)
6456 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6457 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6458 IF (msglen > 0)
THEN
6461 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_sum, &
6462 root, comm%handle, ierr)
6463 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6464 IF (taskid == root)
THEN
6469 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6475 CALL mp_timestop(handle)
6476 END SUBROUTINE mp_sum_root_iv
6487 SUBROUTINE mp_sum_root_im(msg, root, comm)
6488 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6489 INTEGER,
INTENT(IN) :: root
6492 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
6495#if defined(__parallel)
6496 INTEGER :: ierr, m1, m2, msglen, taskid
6497 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:, :)
6500 CALL mp_timeset(routinen, handle)
6502#if defined(__parallel)
6504 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6505 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6506 IF (msglen > 0)
THEN
6509 ALLOCATE (res(m1, m2))
6510 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_sum, root, comm%handle, ierr)
6511 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6512 IF (taskid == root)
THEN
6517 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6523 CALL mp_timestop(handle)
6524 END SUBROUTINE mp_sum_root_im
6532 SUBROUTINE mp_sum_partial_im(msg, res, comm)
6533 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
6534 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
6537 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_im'
6540#if defined(__parallel)
6541 INTEGER :: ierr, msglen, taskid
6544 CALL mp_timeset(routinen, handle)
6546#if defined(__parallel)
6548 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6549 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6550 IF (msglen > 0)
THEN
6551 CALL mpi_scan(msg, res, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6552 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
6554 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6560 CALL mp_timestop(handle)
6561 END SUBROUTINE mp_sum_partial_im
6571 SUBROUTINE mp_max_i (msg, comm)
6572 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6575 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_i'
6578#if defined(__parallel)
6579 INTEGER :: ierr, msglen
6582 CALL mp_timeset(routinen, handle)
6584#if defined(__parallel)
6586 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_max, comm%handle, ierr)
6587 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6588 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6593 CALL mp_timestop(handle)
6594 END SUBROUTINE mp_max_i
6604 SUBROUTINE mp_max_root_i (msg, root, comm)
6605 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6606 INTEGER,
INTENT(IN) :: root
6609 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_i'
6612#if defined(__parallel)
6613 INTEGER :: ierr, msglen
6614 INTEGER(KIND=int_4) :: res
6617 CALL mp_timeset(routinen, handle)
6619#if defined(__parallel)
6621 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_max, root, comm%handle, ierr)
6622 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6623 IF (root == comm%mepos) msg = res
6624 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6630 CALL mp_timestop(handle)
6631 END SUBROUTINE mp_max_root_i
6641 SUBROUTINE mp_max_iv(msg, comm)
6642 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6645 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_iv'
6648#if defined(__parallel)
6649 INTEGER :: ierr, msglen
6652 CALL mp_timeset(routinen, handle)
6654#if defined(__parallel)
6656 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_max, comm%handle, ierr)
6657 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6658 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6663 CALL mp_timestop(handle)
6664 END SUBROUTINE mp_max_iv
6674 SUBROUTINE mp_max_root_im(msg, root, comm)
6675 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6679 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_im'
6682#if defined(__parallel)
6683 INTEGER :: ierr, msglen
6684 INTEGER(KIND=int_4) :: res(size(msg, 1), size(msg, 2))
6687 CALL mp_timeset(routinen, handle)
6689#if defined(__parallel)
6691 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_max, root, comm%handle, ierr)
6692 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6693 IF (root == comm%mepos) msg = res
6694 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6700 CALL mp_timestop(handle)
6701 END SUBROUTINE mp_max_root_im
6711 SUBROUTINE mp_min_i (msg, comm)
6712 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6715 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_i'
6718#if defined(__parallel)
6719 INTEGER :: ierr, msglen
6722 CALL mp_timeset(routinen, handle)
6724#if defined(__parallel)
6726 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_min, comm%handle, ierr)
6727 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6728 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6733 CALL mp_timestop(handle)
6734 END SUBROUTINE mp_min_i
6746 SUBROUTINE mp_min_iv(msg, comm)
6747 INTEGER(KIND=int_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
6750 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_iv'
6753#if defined(__parallel)
6754 INTEGER :: ierr, msglen
6757 CALL mp_timeset(routinen, handle)
6759#if defined(__parallel)
6761 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_min, comm%handle, ierr)
6762 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6763 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6768 CALL mp_timestop(handle)
6769 END SUBROUTINE mp_min_iv
6779 SUBROUTINE mp_prod_i (msg, comm)
6780 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6783 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_i'
6786#if defined(__parallel)
6787 INTEGER :: ierr, msglen
6790 CALL mp_timeset(routinen, handle)
6792#if defined(__parallel)
6794 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_prod, comm%handle, ierr)
6795 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6796 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6801 CALL mp_timestop(handle)
6802 END SUBROUTINE mp_prod_i
6813 SUBROUTINE mp_scatter_iv(msg_scatter, msg, root, comm)
6814 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
6815 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
6816 INTEGER,
INTENT(IN) :: root
6819 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_iv'
6822#if defined(__parallel)
6823 INTEGER :: ierr, msglen
6826 CALL mp_timeset(routinen, handle)
6828#if defined(__parallel)
6830 CALL mpi_scatter(msg_scatter, msglen, mpi_integer, msg, &
6831 msglen, mpi_integer, root, comm%handle, ierr)
6832 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
6833 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
6839 CALL mp_timestop(handle)
6840 END SUBROUTINE mp_scatter_iv
6850 SUBROUTINE mp_iscatter_i (msg_scatter, msg, root, comm, request)
6851 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:)
6852 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6853 INTEGER,
INTENT(IN) :: root
6857 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_i'
6860#if defined(__parallel)
6861 INTEGER :: ierr, msglen
6864 CALL mp_timeset(routinen, handle)
6866#if defined(__parallel)
6867#if !defined(__GNUC__) || __GNUC__ >= 9
6868 cpassert(is_contiguous(msg_scatter))
6871 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer, msg, &
6872 msglen, mpi_integer, root, comm%handle, request%handle, ierr)
6873 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
6874 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6878 msg = msg_scatter(1)
6881 CALL mp_timestop(handle)
6882 END SUBROUTINE mp_iscatter_i
6892 SUBROUTINE mp_iscatter_iv2(msg_scatter, msg, root, comm, request)
6893 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:, :)
6894 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6895 INTEGER,
INTENT(IN) :: root
6899 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_iv2'
6902#if defined(__parallel)
6903 INTEGER :: ierr, msglen
6906 CALL mp_timeset(routinen, handle)
6908#if defined(__parallel)
6909#if !defined(__GNUC__) || __GNUC__ >= 9
6910 cpassert(is_contiguous(msg_scatter))
6913 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer, msg, &
6914 msglen, mpi_integer, root, comm%handle, request%handle, ierr)
6915 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
6916 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6920 msg(:) = msg_scatter(:, 1)
6923 CALL mp_timestop(handle)
6924 END SUBROUTINE mp_iscatter_iv2
6934 SUBROUTINE mp_iscatterv_iv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
6935 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:)
6936 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
6937 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6938 INTEGER,
INTENT(IN) :: recvcount, root
6942 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_iv'
6945#if defined(__parallel)
6949 CALL mp_timeset(routinen, handle)
6951#if defined(__parallel)
6952#if !defined(__GNUC__) || __GNUC__ >= 9
6953 cpassert(is_contiguous(msg_scatter))
6954 cpassert(is_contiguous(msg))
6955 cpassert(is_contiguous(sendcounts))
6956 cpassert(is_contiguous(displs))
6958 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_integer, msg, &
6959 recvcount, mpi_integer, root, comm%handle, request%handle, ierr)
6960 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
6961 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6963 mark_used(sendcounts)
6965 mark_used(recvcount)
6968 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
6971 CALL mp_timestop(handle)
6972 END SUBROUTINE mp_iscatterv_iv
6983 SUBROUTINE mp_gather_i (msg, msg_gather, root, comm)
6984 INTEGER(KIND=int_4),
INTENT(IN) :: msg
6985 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
6986 INTEGER,
INTENT(IN) :: root
6989 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_i'
6992#if defined(__parallel)
6993 INTEGER :: ierr, msglen
6996 CALL mp_timeset(routinen, handle)
6998#if defined(__parallel)
7000 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7001 msglen, mpi_integer, root, comm%handle, ierr)
7002 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7003 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7009 CALL mp_timestop(handle)
7010 END SUBROUTINE mp_gather_i
7020 SUBROUTINE mp_gather_i_src(msg, msg_gather, comm)
7021 INTEGER(KIND=int_4),
INTENT(IN) :: msg
7022 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
7025 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_i_src'
7028#if defined(__parallel)
7029 INTEGER :: ierr, msglen
7032 CALL mp_timeset(routinen, handle)
7034#if defined(__parallel)
7036 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7037 msglen, mpi_integer, comm%source, comm%handle, ierr)
7038 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7039 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7044 CALL mp_timestop(handle)
7045 END SUBROUTINE mp_gather_i_src
7059 SUBROUTINE mp_gather_iv(msg, msg_gather, root, comm)
7060 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
7061 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
7062 INTEGER,
INTENT(IN) :: root
7065 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_iv'
7068#if defined(__parallel)
7069 INTEGER :: ierr, msglen
7072 CALL mp_timeset(routinen, handle)
7074#if defined(__parallel)
7076 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7077 msglen, mpi_integer, root, comm%handle, ierr)
7078 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7079 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7085 CALL mp_timestop(handle)
7086 END SUBROUTINE mp_gather_iv
7099 SUBROUTINE mp_gather_iv_src(msg, msg_gather, comm)
7100 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
7101 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
7104 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_iv_src'
7107#if defined(__parallel)
7108 INTEGER :: ierr, msglen
7111 CALL mp_timeset(routinen, handle)
7113#if defined(__parallel)
7115 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7116 msglen, mpi_integer, comm%source, comm%handle, ierr)
7117 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7118 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7123 CALL mp_timestop(handle)
7124 END SUBROUTINE mp_gather_iv_src
7138 SUBROUTINE mp_gather_im(msg, msg_gather, root, comm)
7139 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
7140 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
7141 INTEGER,
INTENT(IN) :: root
7144 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_im'
7147#if defined(__parallel)
7148 INTEGER :: ierr, msglen
7151 CALL mp_timeset(routinen, handle)
7153#if defined(__parallel)
7155 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7156 msglen, mpi_integer, root, comm%handle, ierr)
7157 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7158 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7164 CALL mp_timestop(handle)
7165 END SUBROUTINE mp_gather_im
7178 SUBROUTINE mp_gather_im_src(msg, msg_gather, comm)
7179 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
7180 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
7183 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_im_src'
7186#if defined(__parallel)
7187 INTEGER :: ierr, msglen
7190 CALL mp_timeset(routinen, handle)
7192#if defined(__parallel)
7194 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7195 msglen, mpi_integer, comm%source, comm%handle, ierr)
7196 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7197 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7202 CALL mp_timestop(handle)
7203 END SUBROUTINE mp_gather_im_src
7220 SUBROUTINE mp_gatherv_iv(sendbuf, recvbuf, recvcounts, displs, root, comm)
7222 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7223 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7224 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7225 INTEGER,
INTENT(IN) :: root
7228 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_iv'
7231#if defined(__parallel)
7232 INTEGER :: ierr, sendcount
7235 CALL mp_timeset(routinen, handle)
7237#if defined(__parallel)
7238 sendcount =
SIZE(sendbuf)
7239 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7240 recvbuf, recvcounts, displs, mpi_integer, &
7241 root, comm%handle, ierr)
7242 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7243 CALL add_perf(perf_id=4, &
7245 msg_size=sendcount*int_4_size)
7247 mark_used(recvcounts)
7250 recvbuf(1 + displs(1):) = sendbuf
7252 CALL mp_timestop(handle)
7253 END SUBROUTINE mp_gatherv_iv
7269 SUBROUTINE mp_gatherv_iv_src(sendbuf, recvbuf, recvcounts, displs, comm)
7271 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7272 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7273 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7276 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_iv_src'
7279#if defined(__parallel)
7280 INTEGER :: ierr, sendcount
7283 CALL mp_timeset(routinen, handle)
7285#if defined(__parallel)
7286 sendcount =
SIZE(sendbuf)
7287 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7288 recvbuf, recvcounts, displs, mpi_integer, &
7289 comm%source, comm%handle, ierr)
7290 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7291 CALL add_perf(perf_id=4, &
7293 msg_size=sendcount*int_4_size)
7295 mark_used(recvcounts)
7297 recvbuf(1 + displs(1):) = sendbuf
7299 CALL mp_timestop(handle)
7300 END SUBROUTINE mp_gatherv_iv_src
7317 SUBROUTINE mp_gatherv_im2(sendbuf, recvbuf, recvcounts, displs, root, comm)
7319 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7320 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7321 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7322 INTEGER,
INTENT(IN) :: root
7325 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_im2'
7328#if defined(__parallel)
7329 INTEGER :: ierr, sendcount
7332 CALL mp_timeset(routinen, handle)
7334#if defined(__parallel)
7335 sendcount =
SIZE(sendbuf)
7336 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7337 recvbuf, recvcounts, displs, mpi_integer, &
7338 root, comm%handle, ierr)
7339 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7340 CALL add_perf(perf_id=4, &
7342 msg_size=sendcount*int_4_size)
7344 mark_used(recvcounts)
7347 recvbuf(:, 1 + displs(1):) = sendbuf
7349 CALL mp_timestop(handle)
7350 END SUBROUTINE mp_gatherv_im2
7366 SUBROUTINE mp_gatherv_im2_src(sendbuf, recvbuf, recvcounts, displs, comm)
7368 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7369 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7370 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7373 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_im2_src'
7376#if defined(__parallel)
7377 INTEGER :: ierr, sendcount
7380 CALL mp_timeset(routinen, handle)
7382#if defined(__parallel)
7383 sendcount =
SIZE(sendbuf)
7384 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7385 recvbuf, recvcounts, displs, mpi_integer, &
7386 comm%source, comm%handle, ierr)
7387 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7388 CALL add_perf(perf_id=4, &
7390 msg_size=sendcount*int_4_size)
7392 mark_used(recvcounts)
7394 recvbuf(:, 1 + displs(1):) = sendbuf
7396 CALL mp_timestop(handle)
7397 END SUBROUTINE mp_gatherv_im2_src
7414 SUBROUTINE mp_igatherv_iv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
7415 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
7416 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
7417 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7418 INTEGER,
INTENT(IN) :: sendcount, root
7422 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_iv'
7425#if defined(__parallel)
7429 CALL mp_timeset(routinen, handle)
7431#if defined(__parallel)
7432#if !defined(__GNUC__) || __GNUC__ >= 9
7433 cpassert(is_contiguous(sendbuf))
7434 cpassert(is_contiguous(recvbuf))
7435 cpassert(is_contiguous(recvcounts))
7436 cpassert(is_contiguous(displs))
7438 CALL mpi_igatherv(sendbuf, sendcount, mpi_integer, &
7439 recvbuf, recvcounts, displs, mpi_integer, &
7440 root, comm%handle, request%handle, ierr)
7441 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7442 CALL add_perf(perf_id=24, &
7444 msg_size=sendcount*int_4_size)
7446 mark_used(sendcount)
7447 mark_used(recvcounts)
7450 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
7453 CALL mp_timestop(handle)
7454 END SUBROUTINE mp_igatherv_iv
7467 SUBROUTINE mp_allgather_i (msgout, msgin, comm)
7468 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7469 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
7472 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i'
7475#if defined(__parallel)
7476 INTEGER :: ierr, rcount, scount
7479 CALL mp_timeset(routinen, handle)
7481#if defined(__parallel)
7484 CALL mpi_allgather(msgout, scount, mpi_integer, &
7485 msgin, rcount, mpi_integer, &
7487 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7492 CALL mp_timestop(handle)
7493 END SUBROUTINE mp_allgather_i
7506 SUBROUTINE mp_allgather_i2(msgout, msgin, comm)
7507 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7508 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7511 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i2'
7514#if defined(__parallel)
7515 INTEGER :: ierr, rcount, scount
7518 CALL mp_timeset(routinen, handle)
7520#if defined(__parallel)
7523 CALL mpi_allgather(msgout, scount, mpi_integer, &
7524 msgin, rcount, mpi_integer, &
7526 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7531 CALL mp_timestop(handle)
7532 END SUBROUTINE mp_allgather_i2
7545 SUBROUTINE mp_iallgather_i (msgout, msgin, comm, request)
7546 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7547 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
7551 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i'
7554#if defined(__parallel)
7555 INTEGER :: ierr, rcount, scount
7558 CALL mp_timeset(routinen, handle)
7560#if defined(__parallel)
7561#if !defined(__GNUC__) || __GNUC__ >= 9
7562 cpassert(is_contiguous(msgin))
7566 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7567 msgin, rcount, mpi_integer, &
7568 comm%handle, request%handle, ierr)
7569 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7575 CALL mp_timestop(handle)
7576 END SUBROUTINE mp_iallgather_i
7591 SUBROUTINE mp_allgather_i12(msgout, msgin, comm)
7592 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
7593 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7596 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i12'
7599#if defined(__parallel)
7600 INTEGER :: ierr, rcount, scount
7603 CALL mp_timeset(routinen, handle)
7605#if defined(__parallel)
7606 scount =
SIZE(msgout(:))
7608 CALL mpi_allgather(msgout, scount, mpi_integer, &
7609 msgin, rcount, mpi_integer, &
7611 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7614 msgin(:, 1) = msgout(:)
7616 CALL mp_timestop(handle)
7617 END SUBROUTINE mp_allgather_i12
7627 SUBROUTINE mp_allgather_i23(msgout, msgin, comm)
7628 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
7629 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
7632 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i23'
7635#if defined(__parallel)
7636 INTEGER :: ierr, rcount, scount
7639 CALL mp_timeset(routinen, handle)
7641#if defined(__parallel)
7642 scount =
SIZE(msgout(:, :))
7644 CALL mpi_allgather(msgout, scount, mpi_integer, &
7645 msgin, rcount, mpi_integer, &
7647 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7650 msgin(:, :, 1) = msgout(:, :)
7652 CALL mp_timestop(handle)
7653 END SUBROUTINE mp_allgather_i23
7663 SUBROUTINE mp_allgather_i34(msgout, msgin, comm)
7664 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
7665 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
7668 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i34'
7671#if defined(__parallel)
7672 INTEGER :: ierr, rcount, scount
7675 CALL mp_timeset(routinen, handle)
7677#if defined(__parallel)
7678 scount =
SIZE(msgout(:, :, :))
7680 CALL mpi_allgather(msgout, scount, mpi_integer, &
7681 msgin, rcount, mpi_integer, &
7683 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7686 msgin(:, :, :, 1) = msgout(:, :, :)
7688 CALL mp_timestop(handle)
7689 END SUBROUTINE mp_allgather_i34
7699 SUBROUTINE mp_allgather_i22(msgout, msgin, comm)
7700 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
7701 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7704 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i22'
7707#if defined(__parallel)
7708 INTEGER :: ierr, rcount, scount
7711 CALL mp_timeset(routinen, handle)
7713#if defined(__parallel)
7714 scount =
SIZE(msgout(:, :))
7716 CALL mpi_allgather(msgout, scount, mpi_integer, &
7717 msgin, rcount, mpi_integer, &
7719 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7722 msgin(:, :) = msgout(:, :)
7724 CALL mp_timestop(handle)
7725 END SUBROUTINE mp_allgather_i22
7736 SUBROUTINE mp_iallgather_i11(msgout, msgin, comm, request)
7737 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
7738 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
7742 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i11'
7745#if defined(__parallel)
7746 INTEGER :: ierr, rcount, scount
7749 CALL mp_timeset(routinen, handle)
7751#if defined(__parallel)
7752#if !defined(__GNUC__) || __GNUC__ >= 9
7753 cpassert(is_contiguous(msgout))
7754 cpassert(is_contiguous(msgin))
7756 scount =
SIZE(msgout(:))
7758 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7759 msgin, rcount, mpi_integer, &
7760 comm%handle, request%handle, ierr)
7761 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7767 CALL mp_timestop(handle)
7768 END SUBROUTINE mp_iallgather_i11
7779 SUBROUTINE mp_iallgather_i13(msgout, msgin, comm, request)
7780 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
7781 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :)
7785 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i13'
7788#if defined(__parallel)
7789 INTEGER :: ierr, rcount, scount
7792 CALL mp_timeset(routinen, handle)
7794#if defined(__parallel)
7795#if !defined(__GNUC__) || __GNUC__ >= 9
7796 cpassert(is_contiguous(msgout))
7797 cpassert(is_contiguous(msgin))
7800 scount =
SIZE(msgout(:))
7802 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7803 msgin, rcount, mpi_integer, &
7804 comm%handle, request%handle, ierr)
7805 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7808 msgin(:, 1, 1) = msgout(:)
7811 CALL mp_timestop(handle)
7812 END SUBROUTINE mp_iallgather_i13
7823 SUBROUTINE mp_iallgather_i22(msgout, msgin, comm, request)
7824 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :)
7825 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :)
7829 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i22'
7832#if defined(__parallel)
7833 INTEGER :: ierr, rcount, scount
7836 CALL mp_timeset(routinen, handle)
7838#if defined(__parallel)
7839#if !defined(__GNUC__) || __GNUC__ >= 9
7840 cpassert(is_contiguous(msgout))
7841 cpassert(is_contiguous(msgin))
7844 scount =
SIZE(msgout(:, :))
7846 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7847 msgin, rcount, mpi_integer, &
7848 comm%handle, request%handle, ierr)
7849 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7852 msgin(:, :) = msgout(:, :)
7855 CALL mp_timestop(handle)
7856 END SUBROUTINE mp_iallgather_i22
7867 SUBROUTINE mp_iallgather_i24(msgout, msgin, comm, request)
7868 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :)
7869 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :, :)
7873 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i24'
7876#if defined(__parallel)
7877 INTEGER :: ierr, rcount, scount
7880 CALL mp_timeset(routinen, handle)
7882#if defined(__parallel)
7883#if !defined(__GNUC__) || __GNUC__ >= 9
7884 cpassert(is_contiguous(msgout))
7885 cpassert(is_contiguous(msgin))
7888 scount =
SIZE(msgout(:, :))
7890 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7891 msgin, rcount, mpi_integer, &
7892 comm%handle, request%handle, ierr)
7893 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7896 msgin(:, :, 1, 1) = msgout(:, :)
7899 CALL mp_timestop(handle)
7900 END SUBROUTINE mp_iallgather_i24
7911 SUBROUTINE mp_iallgather_i33(msgout, msgin, comm, request)
7912 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :, :)
7913 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :)
7917 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i33'
7920#if defined(__parallel)
7921 INTEGER :: ierr, rcount, scount
7924 CALL mp_timeset(routinen, handle)
7926#if defined(__parallel)
7927#if !defined(__GNUC__) || __GNUC__ >= 9
7928 cpassert(is_contiguous(msgout))
7929 cpassert(is_contiguous(msgin))
7932 scount =
SIZE(msgout(:, :, :))
7934 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7935 msgin, rcount, mpi_integer, &
7936 comm%handle, request%handle, ierr)
7937 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7940 msgin(:, :, :) = msgout(:, :, :)
7943 CALL mp_timestop(handle)
7944 END SUBROUTINE mp_iallgather_i33
7963 SUBROUTINE mp_allgatherv_iv(msgout, msgin, rcount, rdispl, comm)
7964 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
7965 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
7966 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
7969 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_iv'
7972#if defined(__parallel)
7973 INTEGER :: ierr, scount
7976 CALL mp_timeset(routinen, handle)
7978#if defined(__parallel)
7979 scount =
SIZE(msgout)
7980 CALL mpi_allgatherv(msgout, scount, mpi_integer, msgin, rcount, &
7981 rdispl, mpi_integer, comm%handle, ierr)
7982 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
7989 CALL mp_timestop(handle)
7990 END SUBROUTINE mp_allgatherv_iv
8009 SUBROUTINE mp_allgatherv_im2(msgout, msgin, rcount, rdispl, comm)
8010 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
8011 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
8012 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
8015 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_iv'
8018#if defined(__parallel)
8019 INTEGER :: ierr, scount
8022 CALL mp_timeset(routinen, handle)
8024#if defined(__parallel)
8025 scount =
SIZE(msgout)
8026 CALL mpi_allgatherv(msgout, scount, mpi_integer, msgin, rcount, &
8027 rdispl, mpi_integer, comm%handle, ierr)
8028 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
8035 CALL mp_timestop(handle)
8036 END SUBROUTINE mp_allgatherv_im2
8055 SUBROUTINE mp_iallgatherv_iv(msgout, msgin, rcount, rdispl, comm, request)
8056 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
8057 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
8058 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
8062 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_iv'
8065#if defined(__parallel)
8066 INTEGER :: ierr, scount, rsize
8069 CALL mp_timeset(routinen, handle)
8071#if defined(__parallel)
8072#if !defined(__GNUC__) || __GNUC__ >= 9
8073 cpassert(is_contiguous(msgout))
8074 cpassert(is_contiguous(msgin))
8075 cpassert(is_contiguous(rcount))
8076 cpassert(is_contiguous(rdispl))
8079 scount =
SIZE(msgout)
8080 rsize =
SIZE(rcount)
8081 CALL mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, &
8082 rdispl, comm, request, ierr)
8083 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
8091 CALL mp_timestop(handle)
8092 END SUBROUTINE mp_iallgatherv_iv
8111 SUBROUTINE mp_iallgatherv_iv2(msgout, msgin, rcount, rdispl, comm, request)
8112 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
8113 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
8114 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
8118 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_iv2'
8121#if defined(__parallel)
8122 INTEGER :: ierr, scount, rsize
8125 CALL mp_timeset(routinen, handle)
8127#if defined(__parallel)
8128#if !defined(__GNUC__) || __GNUC__ >= 9
8129 cpassert(is_contiguous(msgout))
8130 cpassert(is_contiguous(msgin))
8131 cpassert(is_contiguous(rcount))
8132 cpassert(is_contiguous(rdispl))
8135 scount =
SIZE(msgout)
8136 rsize =
SIZE(rcount)
8137 CALL mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, &
8138 rdispl, comm, request, ierr)
8139 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
8147 CALL mp_timestop(handle)
8148 END SUBROUTINE mp_iallgatherv_iv2
8159#if defined(__parallel)
8160 SUBROUTINE mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
8161 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
8162 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
8163 INTEGER,
INTENT(IN) :: rsize
8164 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
8167 INTEGER,
INTENT(INOUT) :: ierr
8169 CALL mpi_iallgatherv(msgout, scount, mpi_integer, msgin, rcount, &
8170 rdispl, mpi_integer, comm%handle, request%handle, ierr)
8172 END SUBROUTINE mp_iallgatherv_iv_internal
8183 SUBROUTINE mp_sum_scatter_iv(msgout, msgin, rcount, comm)
8184 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
8185 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
8186 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
8189 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_iv'
8192#if defined(__parallel)
8196 CALL mp_timeset(routinen, handle)
8198#if defined(__parallel)
8199 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_integer, mpi_sum, &
8201 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
8203 CALL add_perf(perf_id=3, count=1, &
8204 msg_size=rcount(1)*2*int_4_size)
8208 msgin = msgout(:, 1)
8210 CALL mp_timestop(handle)
8211 END SUBROUTINE mp_sum_scatter_iv
8222 SUBROUTINE mp_sendrecv_i (msgin, dest, msgout, source, comm, tag)
8223 INTEGER(KIND=int_4),
INTENT(IN) :: msgin
8224 INTEGER,
INTENT(IN) :: dest
8225 INTEGER(KIND=int_4),
INTENT(OUT) :: msgout
8226 INTEGER,
INTENT(IN) :: source
8228 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8230 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_i'
8233#if defined(__parallel)
8234 INTEGER :: ierr, msglen_in, msglen_out, &
8238 CALL mp_timeset(routinen, handle)
8240#if defined(__parallel)
8245 IF (
PRESENT(tag))
THEN
8249 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8250 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8251 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8252 CALL add_perf(perf_id=7, count=1, &
8253 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8261 CALL mp_timestop(handle)
8262 END SUBROUTINE mp_sendrecv_i
8273 SUBROUTINE mp_sendrecv_iv(msgin, dest, msgout, source, comm, tag)
8274 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
8275 INTEGER,
INTENT(IN) :: dest
8276 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
8277 INTEGER,
INTENT(IN) :: source
8279 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8281 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_iv'
8284#if defined(__parallel)
8285 INTEGER :: ierr, msglen_in, msglen_out, &
8289 CALL mp_timeset(routinen, handle)
8291#if defined(__parallel)
8292 msglen_in =
SIZE(msgin)
8293 msglen_out =
SIZE(msgout)
8296 IF (
PRESENT(tag))
THEN
8300 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8301 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8302 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8303 CALL add_perf(perf_id=7, count=1, &
8304 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8312 CALL mp_timestop(handle)
8313 END SUBROUTINE mp_sendrecv_iv
8325 SUBROUTINE mp_sendrecv_im2(msgin, dest, msgout, source, comm, tag)
8326 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
8327 INTEGER,
INTENT(IN) :: dest
8328 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
8329 INTEGER,
INTENT(IN) :: source
8331 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8333 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im2'
8336#if defined(__parallel)
8337 INTEGER :: ierr, msglen_in, msglen_out, &
8341 CALL mp_timeset(routinen, handle)
8343#if defined(__parallel)
8344 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
8345 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
8348 IF (
PRESENT(tag))
THEN
8352 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8353 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8354 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8355 CALL add_perf(perf_id=7, count=1, &
8356 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8364 CALL mp_timestop(handle)
8365 END SUBROUTINE mp_sendrecv_im2
8376 SUBROUTINE mp_sendrecv_im3(msgin, dest, msgout, source, comm, tag)
8377 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
8378 INTEGER,
INTENT(IN) :: dest
8379 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
8380 INTEGER,
INTENT(IN) :: source
8382 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8384 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im3'
8387#if defined(__parallel)
8388 INTEGER :: ierr, msglen_in, msglen_out, &
8392 CALL mp_timeset(routinen, handle)
8394#if defined(__parallel)
8395 msglen_in =
SIZE(msgin)
8396 msglen_out =
SIZE(msgout)
8399 IF (
PRESENT(tag))
THEN
8403 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8404 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8405 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8406 CALL add_perf(perf_id=7, count=1, &
8407 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8415 CALL mp_timestop(handle)
8416 END SUBROUTINE mp_sendrecv_im3
8427 SUBROUTINE mp_sendrecv_im4(msgin, dest, msgout, source, comm, tag)
8428 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
8429 INTEGER,
INTENT(IN) :: dest
8430 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
8431 INTEGER,
INTENT(IN) :: source
8433 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8435 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im4'
8438#if defined(__parallel)
8439 INTEGER :: ierr, msglen_in, msglen_out, &
8443 CALL mp_timeset(routinen, handle)
8445#if defined(__parallel)
8446 msglen_in =
SIZE(msgin)
8447 msglen_out =
SIZE(msgout)
8450 IF (
PRESENT(tag))
THEN
8454 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8455 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8456 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8457 CALL add_perf(perf_id=7, count=1, &
8458 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8466 CALL mp_timestop(handle)
8467 END SUBROUTINE mp_sendrecv_im4
8484 SUBROUTINE mp_isendrecv_i (msgin, dest, msgout, source, comm, send_request, &
8486 INTEGER(KIND=int_4),
INTENT(IN) :: msgin
8487 INTEGER,
INTENT(IN) :: dest
8488 INTEGER(KIND=int_4),
INTENT(INOUT) :: msgout
8489 INTEGER,
INTENT(IN) :: source
8492 INTEGER,
INTENT(in),
OPTIONAL :: tag
8494 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_i'
8497#if defined(__parallel)
8498 INTEGER :: ierr, my_tag
8501 CALL mp_timeset(routinen, handle)
8503#if defined(__parallel)
8505 IF (
PRESENT(tag)) my_tag = tag
8507 CALL mpi_irecv(msgout, 1, mpi_integer, source, my_tag, &
8508 comm%handle, recv_request%handle, ierr)
8509 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8511 CALL mpi_isend(msgin, 1, mpi_integer, dest, my_tag, &
8512 comm%handle, send_request%handle, ierr)
8513 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8515 CALL add_perf(perf_id=8, count=1, msg_size=2*int_4_size)
8525 CALL mp_timestop(handle)
8526 END SUBROUTINE mp_isendrecv_i
8545 SUBROUTINE mp_isendrecv_iv(msgin, dest, msgout, source, comm, send_request, &
8547 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: msgin
8548 INTEGER,
INTENT(IN) :: dest
8549 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
8550 INTEGER,
INTENT(IN) :: source
8553 INTEGER,
INTENT(in),
OPTIONAL :: tag
8555 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_iv'
8558#if defined(__parallel)
8559 INTEGER :: ierr, msglen, my_tag
8560 INTEGER(KIND=int_4) :: foo
8563 CALL mp_timeset(routinen, handle)
8565#if defined(__parallel)
8566#if !defined(__GNUC__) || __GNUC__ >= 9
8567 cpassert(is_contiguous(msgout))
8568 cpassert(is_contiguous(msgin))
8572 IF (
PRESENT(tag)) my_tag = tag
8574 msglen =
SIZE(msgout, 1)
8575 IF (msglen > 0)
THEN
8576 CALL mpi_irecv(msgout(1), msglen, mpi_integer, source, my_tag, &
8577 comm%handle, recv_request%handle, ierr)
8579 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8580 comm%handle, recv_request%handle, ierr)
8582 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8584 msglen =
SIZE(msgin, 1)
8585 IF (msglen > 0)
THEN
8586 CALL mpi_isend(msgin(1), msglen, mpi_integer, dest, my_tag, &
8587 comm%handle, send_request%handle, ierr)
8589 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8590 comm%handle, send_request%handle, ierr)
8592 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8594 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
8595 CALL add_perf(perf_id=8, count=1, msg_size=msglen*int_4_size)
8605 CALL mp_timestop(handle)
8606 END SUBROUTINE mp_isendrecv_iv
8621 SUBROUTINE mp_isend_iv(msgin, dest, comm, request, tag)
8622 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: msgin
8623 INTEGER,
INTENT(IN) :: dest
8626 INTEGER,
INTENT(in),
OPTIONAL :: tag
8628 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_iv'
8630 INTEGER :: handle, ierr
8631#if defined(__parallel)
8632 INTEGER :: msglen, my_tag
8633 INTEGER(KIND=int_4) :: foo(1)
8636 CALL mp_timeset(routinen, handle)
8638#if defined(__parallel)
8639#if !defined(__GNUC__) || __GNUC__ >= 9
8640 cpassert(is_contiguous(msgin))
8643 IF (
PRESENT(tag)) my_tag = tag
8645 msglen =
SIZE(msgin)
8646 IF (msglen > 0)
THEN
8647 CALL mpi_isend(msgin(1), msglen, mpi_integer, dest, my_tag, &
8648 comm%handle, request%handle, ierr)
8650 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8651 comm%handle, request%handle, ierr)
8653 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8655 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8664 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8666 CALL mp_timestop(handle)
8667 END SUBROUTINE mp_isend_iv
8684 SUBROUTINE mp_isend_im2(msgin, dest, comm, request, tag)
8685 INTEGER(KIND=int_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
8686 INTEGER,
INTENT(IN) :: dest
8689 INTEGER,
INTENT(in),
OPTIONAL :: tag
8691 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im2'
8693 INTEGER :: handle, ierr
8694#if defined(__parallel)
8695 INTEGER :: msglen, my_tag
8696 INTEGER(KIND=int_4) :: foo(1)
8699 CALL mp_timeset(routinen, handle)
8701#if defined(__parallel)
8702#if !defined(__GNUC__) || __GNUC__ >= 9
8703 cpassert(is_contiguous(msgin))
8707 IF (
PRESENT(tag)) my_tag = tag
8709 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
8710 IF (msglen > 0)
THEN
8711 CALL mpi_isend(msgin(1, 1), msglen, mpi_integer, dest, my_tag, &
8712 comm%handle, request%handle, ierr)
8714 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8715 comm%handle, request%handle, ierr)
8717 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8719 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8728 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8730 CALL mp_timestop(handle)
8731 END SUBROUTINE mp_isend_im2
8750 SUBROUTINE mp_isend_im3(msgin, dest, comm, request, tag)
8751 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
8752 INTEGER,
INTENT(IN) :: dest
8755 INTEGER,
INTENT(in),
OPTIONAL :: tag
8757 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im3'
8759 INTEGER :: handle, ierr
8760#if defined(__parallel)
8761 INTEGER :: msglen, my_tag
8762 INTEGER(KIND=int_4) :: foo(1)
8765 CALL mp_timeset(routinen, handle)
8767#if defined(__parallel)
8768#if !defined(__GNUC__) || __GNUC__ >= 9
8769 cpassert(is_contiguous(msgin))
8773 IF (
PRESENT(tag)) my_tag = tag
8775 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
8776 IF (msglen > 0)
THEN
8777 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_integer, dest, my_tag, &
8778 comm%handle, request%handle, ierr)
8780 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8781 comm%handle, request%handle, ierr)
8783 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8785 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8794 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8796 CALL mp_timestop(handle)
8797 END SUBROUTINE mp_isend_im3
8813 SUBROUTINE mp_isend_im4(msgin, dest, comm, request, tag)
8814 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
8815 INTEGER,
INTENT(IN) :: dest
8818 INTEGER,
INTENT(in),
OPTIONAL :: tag
8820 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im4'
8822 INTEGER :: handle, ierr
8823#if defined(__parallel)
8824 INTEGER :: msglen, my_tag
8825 INTEGER(KIND=int_4) :: foo(1)
8828 CALL mp_timeset(routinen, handle)
8830#if defined(__parallel)
8831#if !defined(__GNUC__) || __GNUC__ >= 9
8832 cpassert(is_contiguous(msgin))
8836 IF (
PRESENT(tag)) my_tag = tag
8838 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
8839 IF (msglen > 0)
THEN
8840 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_integer, dest, my_tag, &
8841 comm%handle, request%handle, ierr)
8843 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8844 comm%handle, request%handle, ierr)
8846 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8848 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8857 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8859 CALL mp_timestop(handle)
8860 END SUBROUTINE mp_isend_im4
8876 SUBROUTINE mp_irecv_iv(msgout, source, comm, request, tag)
8877 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
8878 INTEGER,
INTENT(IN) :: source
8881 INTEGER,
INTENT(in),
OPTIONAL :: tag
8883 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_iv'
8886#if defined(__parallel)
8887 INTEGER :: ierr, msglen, my_tag
8888 INTEGER(KIND=int_4) :: foo(1)
8891 CALL mp_timeset(routinen, handle)
8893#if defined(__parallel)
8894#if !defined(__GNUC__) || __GNUC__ >= 9
8895 cpassert(is_contiguous(msgout))
8899 IF (
PRESENT(tag)) my_tag = tag
8901 msglen =
SIZE(msgout)
8902 IF (msglen > 0)
THEN
8903 CALL mpi_irecv(msgout(1), msglen, mpi_integer, source, my_tag, &
8904 comm%handle, request%handle, ierr)
8906 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8907 comm%handle, request%handle, ierr)
8909 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8911 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
8913 cpabort(
"mp_irecv called in non parallel case")
8920 CALL mp_timestop(handle)
8921 END SUBROUTINE mp_irecv_iv
8938 SUBROUTINE mp_irecv_im2(msgout, source, comm, request, tag)
8939 INTEGER(KIND=int_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
8940 INTEGER,
INTENT(IN) :: source
8943 INTEGER,
INTENT(in),
OPTIONAL :: tag
8945 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im2'
8948#if defined(__parallel)
8949 INTEGER :: ierr, msglen, my_tag
8950 INTEGER(KIND=int_4) :: foo(1)
8953 CALL mp_timeset(routinen, handle)
8955#if defined(__parallel)
8956#if !defined(__GNUC__) || __GNUC__ >= 9
8957 cpassert(is_contiguous(msgout))
8961 IF (
PRESENT(tag)) my_tag = tag
8963 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
8964 IF (msglen > 0)
THEN
8965 CALL mpi_irecv(msgout(1, 1), msglen, mpi_integer, source, my_tag, &
8966 comm%handle, request%handle, ierr)
8968 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8969 comm%handle, request%handle, ierr)
8971 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8973 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
8980 cpabort(
"mp_irecv called in non parallel case")
8982 CALL mp_timestop(handle)
8983 END SUBROUTINE mp_irecv_im2
9001 SUBROUTINE mp_irecv_im3(msgout, source, comm, request, tag)
9002 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
9003 INTEGER,
INTENT(IN) :: source
9006 INTEGER,
INTENT(in),
OPTIONAL :: tag
9008 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im3'
9011#if defined(__parallel)
9012 INTEGER :: ierr, msglen, my_tag
9013 INTEGER(KIND=int_4) :: foo(1)
9016 CALL mp_timeset(routinen, handle)
9018#if defined(__parallel)
9019#if !defined(__GNUC__) || __GNUC__ >= 9
9020 cpassert(is_contiguous(msgout))
9024 IF (
PRESENT(tag)) my_tag = tag
9026 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
9027 IF (msglen > 0)
THEN
9028 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_integer, source, my_tag, &
9029 comm%handle, request%handle, ierr)
9031 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
9032 comm%handle, request%handle, ierr)
9034 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
9036 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
9043 cpabort(
"mp_irecv called in non parallel case")
9045 CALL mp_timestop(handle)
9046 END SUBROUTINE mp_irecv_im3
9062 SUBROUTINE mp_irecv_im4(msgout, source, comm, request, tag)
9063 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
9064 INTEGER,
INTENT(IN) :: source
9067 INTEGER,
INTENT(in),
OPTIONAL :: tag
9069 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im4'
9072#if defined(__parallel)
9073 INTEGER :: ierr, msglen, my_tag
9074 INTEGER(KIND=int_4) :: foo(1)
9077 CALL mp_timeset(routinen, handle)
9079#if defined(__parallel)
9080#if !defined(__GNUC__) || __GNUC__ >= 9
9081 cpassert(is_contiguous(msgout))
9085 IF (
PRESENT(tag)) my_tag = tag
9087 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
9088 IF (msglen > 0)
THEN
9089 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_integer, source, my_tag, &
9090 comm%handle, request%handle, ierr)
9092 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
9093 comm%handle, request%handle, ierr)
9095 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
9097 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
9104 cpabort(
"mp_irecv called in non parallel case")
9106 CALL mp_timestop(handle)
9107 END SUBROUTINE mp_irecv_im4
9119 SUBROUTINE mp_win_create_iv(base, comm, win)
9120 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
9124 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_iv'
9127#if defined(__parallel)
9129 INTEGER(kind=mpi_address_kind) :: len
9130 INTEGER(KIND=int_4) :: foo(1)
9133 CALL mp_timeset(routinen, handle)
9135#if defined(__parallel)
9137 len =
SIZE(base)*int_4_size
9139 CALL mpi_win_create(base(1), len, int_4_size, mpi_info_null, comm%handle, win%handle, ierr)
9141 CALL mpi_win_create(foo, len, int_4_size, mpi_info_null, comm%handle, win%handle, ierr)
9143 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
9145 CALL add_perf(perf_id=20, count=1)
9149 win%handle = mp_win_null_handle
9151 CALL mp_timestop(handle)
9152 END SUBROUTINE mp_win_create_iv
9164 SUBROUTINE mp_rget_iv(base, source, win, win_data, myproc, disp, request, &
9165 origin_datatype, target_datatype)
9166 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
9167 INTEGER,
INTENT(IN) :: source
9169 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: win_data
9170 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
9174 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_iv'
9177#if defined(__parallel)
9178 INTEGER :: ierr, len, &
9179 origin_len, target_len
9180 LOGICAL :: do_local_copy
9181 INTEGER(kind=mpi_address_kind) :: disp_aint
9182 mpi_data_type :: handle_origin_datatype, handle_target_datatype
9185 CALL mp_timeset(routinen, handle)
9187#if defined(__parallel)
9190 IF (
PRESENT(disp))
THEN
9191 disp_aint = int(disp, kind=mpi_address_kind)
9193 handle_origin_datatype = mpi_integer
9195 IF (
PRESENT(origin_datatype))
THEN
9196 handle_origin_datatype = origin_datatype%type_handle
9199 handle_target_datatype = mpi_integer
9201 IF (
PRESENT(target_datatype))
THEN
9202 handle_target_datatype = target_datatype%type_handle
9206 do_local_copy = .false.
9207 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
9208 IF (myproc .EQ. source) do_local_copy = .true.
9210 IF (do_local_copy)
THEN
9212 base(:) = win_data(disp_aint + 1:disp_aint + len)
9217 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
9218 target_len, handle_target_datatype, win%handle, request%handle, ierr)
9224 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
9226 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*int_4_size)
9231 mark_used(origin_datatype)
9232 mark_used(target_datatype)
9236 IF (
PRESENT(disp))
THEN
9237 base(:) = win_data(disp + 1:disp +
SIZE(base))
9239 base(:) = win_data(:
SIZE(base))
9243 CALL mp_timestop(handle)
9244 END SUBROUTINE mp_rget_iv
9253 FUNCTION mp_type_indexed_make_i (count, lengths, displs) &
9254 result(type_descriptor)
9255 INTEGER,
INTENT(IN) :: count
9256 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
9259 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_i'
9262#if defined(__parallel)
9266 CALL mp_timeset(routinen, handle)
9268#if defined(__parallel)
9269 CALL mpi_type_indexed(count, lengths, displs, mpi_integer, &
9270 type_descriptor%type_handle, ierr)
9272 cpabort(
"MPI_Type_Indexed @ "//routinen)
9273 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
9275 cpabort(
"MPI_Type_commit @ "//routinen)
9277 type_descriptor%type_handle = 17
9279 type_descriptor%length = count
9280 NULLIFY (type_descriptor%subtype)
9281 type_descriptor%vector_descriptor(1:2) = 1
9282 type_descriptor%has_indexing = .true.
9283 type_descriptor%index_descriptor%index => lengths
9284 type_descriptor%index_descriptor%chunks => displs
9286 CALL mp_timestop(handle)
9288 END FUNCTION mp_type_indexed_make_i
9297 SUBROUTINE mp_allocate_i (DATA, len, stat)
9298 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
9299 INTEGER,
INTENT(IN) :: len
9300 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9302 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_i'
9304 INTEGER :: handle, ierr
9306 CALL mp_timeset(routinen, handle)
9308#if defined(__parallel)
9310 CALL mp_alloc_mem(
DATA, len, stat=ierr)
9311 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
9312 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
9313 CALL add_perf(perf_id=15, count=1)
9315 ALLOCATE (
DATA(len), stat=ierr)
9316 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
9317 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
9319 IF (
PRESENT(stat)) stat = ierr
9320 CALL mp_timestop(handle)
9321 END SUBROUTINE mp_allocate_i
9329 SUBROUTINE mp_deallocate_i (DATA, stat)
9330 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
9331 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9333 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_i'
9336#if defined(__parallel)
9340 CALL mp_timeset(routinen, handle)
9342#if defined(__parallel)
9343 CALL mp_free_mem(
DATA, ierr)
9344 IF (
PRESENT(stat))
THEN
9347 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
9350 CALL add_perf(perf_id=15, count=1)
9353 IF (
PRESENT(stat)) stat = 0
9355 CALL mp_timestop(handle)
9356 END SUBROUTINE mp_deallocate_i
9369 SUBROUTINE mp_file_write_at_iv(fh, offset, msg, msglen)
9370 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
9372 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9373 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9376#if defined(__parallel)
9381 IF (
PRESENT(msglen)) msg_len = msglen
9382#if defined(__parallel)
9383 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9385 cpabort(
"mpi_file_write_at_iv @ mp_file_write_at_iv")
9387 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9389 END SUBROUTINE mp_file_write_at_iv
9397 SUBROUTINE mp_file_write_at_i (fh, offset, msg)
9398 INTEGER(KIND=int_4),
INTENT(IN) :: msg
9400 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9402#if defined(__parallel)
9406 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9408 cpabort(
"mpi_file_write_at_i @ mp_file_write_at_i")
9410 WRITE (unit=fh%handle, pos=offset + 1) msg
9412 END SUBROUTINE mp_file_write_at_i
9424 SUBROUTINE mp_file_write_at_all_iv(fh, offset, msg, msglen)
9425 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
9427 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9428 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9431#if defined(__parallel)
9436 IF (
PRESENT(msglen)) msg_len = msglen
9437#if defined(__parallel)
9438 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9440 cpabort(
"mpi_file_write_at_all_iv @ mp_file_write_at_all_iv")
9442 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9444 END SUBROUTINE mp_file_write_at_all_iv
9452 SUBROUTINE mp_file_write_at_all_i (fh, offset, msg)
9453 INTEGER(KIND=int_4),
INTENT(IN) :: msg
9455 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9457#if defined(__parallel)
9461 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9463 cpabort(
"mpi_file_write_at_all_i @ mp_file_write_at_all_i")
9465 WRITE (unit=fh%handle, pos=offset + 1) msg
9467 END SUBROUTINE mp_file_write_at_all_i
9480 SUBROUTINE mp_file_read_at_iv(fh, offset, msg, msglen)
9481 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
9483 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9484 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9487#if defined(__parallel)
9492 IF (
PRESENT(msglen)) msg_len = msglen
9493#if defined(__parallel)
9494 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9496 cpabort(
"mpi_file_read_at_iv @ mp_file_read_at_iv")
9498 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9500 END SUBROUTINE mp_file_read_at_iv
9508 SUBROUTINE mp_file_read_at_i (fh, offset, msg)
9509 INTEGER(KIND=int_4),
INTENT(OUT) :: msg
9511 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9513#if defined(__parallel)
9517 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9519 cpabort(
"mpi_file_read_at_i @ mp_file_read_at_i")
9521 READ (unit=fh%handle, pos=offset + 1) msg
9523 END SUBROUTINE mp_file_read_at_i
9535 SUBROUTINE mp_file_read_at_all_iv(fh, offset, msg, msglen)
9536 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
9538 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9539 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9542#if defined(__parallel)
9547 IF (
PRESENT(msglen)) msg_len = msglen
9548#if defined(__parallel)
9549 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9551 cpabort(
"mpi_file_read_at_all_iv @ mp_file_read_at_all_iv")
9553 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9555 END SUBROUTINE mp_file_read_at_all_iv
9563 SUBROUTINE mp_file_read_at_all_i (fh, offset, msg)
9564 INTEGER(KIND=int_4),
INTENT(OUT) :: msg
9566 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9568#if defined(__parallel)
9572 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9574 cpabort(
"mpi_file_read_at_all_i @ mp_file_read_at_all_i")
9576 READ (unit=fh%handle, pos=offset + 1) msg
9578 END SUBROUTINE mp_file_read_at_all_i
9587 FUNCTION mp_type_make_i (ptr, &
9588 vector_descriptor, index_descriptor) &
9589 result(type_descriptor)
9590 INTEGER(KIND=int_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
9591 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
9592 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
9595 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_i'
9597#if defined(__parallel)
9601 NULLIFY (type_descriptor%subtype)
9602 type_descriptor%length =
SIZE(ptr)
9603#if defined(__parallel)
9604 type_descriptor%type_handle = mpi_integer
9605 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
9607 cpabort(
"MPI_Get_address @ "//routinen)
9609 type_descriptor%type_handle = 17
9611 type_descriptor%vector_descriptor(1:2) = 1
9612 type_descriptor%has_indexing = .false.
9613 type_descriptor%data_i => ptr
9614 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
9615 cpabort(routinen//
": Vectors and indices NYI")
9617 END FUNCTION mp_type_make_i
9626 SUBROUTINE mp_alloc_mem_i (DATA, len, stat)
9627 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
9628 INTEGER,
INTENT(IN) :: len
9629 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9631#if defined(__parallel)
9632 INTEGER :: size, ierr, length, &
9634 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
9635 TYPE(c_ptr) :: mp_baseptr
9636 mpi_info_type :: mp_info
9638 length = max(len, 1)
9639 CALL mpi_type_size(mpi_integer,
size, ierr)
9640 mp_size = int(length, kind=mpi_address_kind)*
size
9641 IF (mp_size .GT. mp_max_memory_size)
THEN
9642 cpabort(
"MPI cannot allocate more than 2 GiByte")
9644 mp_info = mpi_info_null
9645 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
9646 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
9647 IF (
PRESENT(stat)) stat = mp_res
9649 INTEGER :: length, mystat
9650 length = max(len, 1)
9651 IF (
PRESENT(stat))
THEN
9652 ALLOCATE (
DATA(length), stat=mystat)
9655 ALLOCATE (
DATA(length))
9658 END SUBROUTINE mp_alloc_mem_i
9666 SUBROUTINE mp_free_mem_i (DATA, stat)
9667 INTEGER(KIND=int_4),
DIMENSION(:), &
9668 POINTER, asynchronous :: data
9669 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9671#if defined(__parallel)
9673 CALL mpi_free_mem(
DATA, mp_res)
9674 IF (
PRESENT(stat)) stat = mp_res
9677 IF (
PRESENT(stat)) stat = 0
9679 END SUBROUTINE mp_free_mem_i
9691 SUBROUTINE mp_shift_lm(msg, comm, displ_in)
9693 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
9695 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
9697 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_lm'
9699 INTEGER :: handle, ierror
9700#if defined(__parallel)
9701 INTEGER :: displ, left, &
9702 msglen, myrank, nprocs, &
9707 CALL mp_timeset(routinen, handle)
9709#if defined(__parallel)
9710 CALL mpi_comm_rank(comm%handle, myrank, ierror)
9711 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
9712 CALL mpi_comm_size(comm%handle, nprocs, ierror)
9713 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
9714 IF (
PRESENT(displ_in))
THEN
9719 right =
modulo(myrank + displ, nprocs)
9720 left =
modulo(myrank - displ, nprocs)
9723 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer8, right, tag, left, tag, &
9724 comm%handle, mpi_status_ignore, ierror)
9725 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
9726 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_8_size)
9732 CALL mp_timestop(handle)
9734 END SUBROUTINE mp_shift_lm
9747 SUBROUTINE mp_shift_l (msg, comm, displ_in)
9749 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
9751 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
9753 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_l'
9755 INTEGER :: handle, ierror
9756#if defined(__parallel)
9757 INTEGER :: displ, left, &
9758 msglen, myrank, nprocs, &
9763 CALL mp_timeset(routinen, handle)
9765#if defined(__parallel)
9766 CALL mpi_comm_rank(comm%handle, myrank, ierror)
9767 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
9768 CALL mpi_comm_size(comm%handle, nprocs, ierror)
9769 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
9770 IF (
PRESENT(displ_in))
THEN
9775 right =
modulo(myrank + displ, nprocs)
9776 left =
modulo(myrank - displ, nprocs)
9779 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer8, right, tag, left, &
9780 tag, comm%handle, mpi_status_ignore, ierror)
9781 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
9782 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_8_size)
9788 CALL mp_timestop(handle)
9790 END SUBROUTINE mp_shift_l
9811 SUBROUTINE mp_alltoall_l11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
9813 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
9814 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
9815 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
9816 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
9819 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l11v'
9822#if defined(__parallel)
9823 INTEGER :: ierr, msglen
9828 CALL mp_timeset(routinen, handle)
9830#if defined(__parallel)
9831 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer8, &
9832 rb, rcount, rdispl, mpi_integer8, comm%handle, ierr)
9833 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
9834 msglen = sum(scount) + sum(rcount)
9835 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9842 rb(rdispl(1) + i) = sb(sdispl(1) + i)
9845 CALL mp_timestop(handle)
9847 END SUBROUTINE mp_alltoall_l11v
9862 SUBROUTINE mp_alltoall_l22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
9864 INTEGER(KIND=int_8),
DIMENSION(:, :), &
9865 INTENT(IN),
CONTIGUOUS :: sb
9866 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
9867 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS, &
9869 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
9872 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l22v'
9875#if defined(__parallel)
9876 INTEGER :: ierr, msglen
9879 CALL mp_timeset(routinen, handle)
9881#if defined(__parallel)
9882 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer8, &
9883 rb, rcount, rdispl, mpi_integer8, comm%handle, ierr)
9884 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
9885 msglen = sum(scount) + sum(rcount)
9886 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*int_8_size)
9895 CALL mp_timestop(handle)
9897 END SUBROUTINE mp_alltoall_l22v
9914 SUBROUTINE mp_alltoall_l (sb, rb, count, comm)
9916 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
9917 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
9918 INTEGER,
INTENT(IN) :: count
9921 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l'
9924#if defined(__parallel)
9925 INTEGER :: ierr, msglen, np
9928 CALL mp_timeset(routinen, handle)
9930#if defined(__parallel)
9931 CALL mpi_alltoall(sb, count, mpi_integer8, &
9932 rb, count, mpi_integer8, comm%handle, ierr)
9933 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9934 CALL mpi_comm_size(comm%handle, np, ierr)
9935 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9937 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9943 CALL mp_timestop(handle)
9945 END SUBROUTINE mp_alltoall_l
9955 SUBROUTINE mp_alltoall_l22(sb, rb, count, comm)
9957 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
9958 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
9959 INTEGER,
INTENT(IN) :: count
9962 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l22'
9965#if defined(__parallel)
9966 INTEGER :: ierr, msglen, np
9969 CALL mp_timeset(routinen, handle)
9971#if defined(__parallel)
9972 CALL mpi_alltoall(sb, count, mpi_integer8, &
9973 rb, count, mpi_integer8, comm%handle, ierr)
9974 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9975 CALL mpi_comm_size(comm%handle, np, ierr)
9976 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9977 msglen = 2*
SIZE(sb)*np
9978 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9984 CALL mp_timestop(handle)
9986 END SUBROUTINE mp_alltoall_l22
9996 SUBROUTINE mp_alltoall_l33(sb, rb, count, comm)
9998 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
9999 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
10000 INTEGER,
INTENT(IN) :: count
10003 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l33'
10006#if defined(__parallel)
10007 INTEGER :: ierr, msglen, np
10010 CALL mp_timeset(routinen, handle)
10012#if defined(__parallel)
10013 CALL mpi_alltoall(sb, count, mpi_integer8, &
10014 rb, count, mpi_integer8, comm%handle, ierr)
10015 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10016 CALL mpi_comm_size(comm%handle, np, ierr)
10017 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10018 msglen = 2*count*np
10019 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10025 CALL mp_timestop(handle)
10027 END SUBROUTINE mp_alltoall_l33
10037 SUBROUTINE mp_alltoall_l44(sb, rb, count, comm)
10039 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10041 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10043 INTEGER,
INTENT(IN) :: count
10046 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l44'
10049#if defined(__parallel)
10050 INTEGER :: ierr, msglen, np
10053 CALL mp_timeset(routinen, handle)
10055#if defined(__parallel)
10056 CALL mpi_alltoall(sb, count, mpi_integer8, &
10057 rb, count, mpi_integer8, comm%handle, ierr)
10058 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10059 CALL mpi_comm_size(comm%handle, np, ierr)
10060 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10061 msglen = 2*count*np
10062 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10068 CALL mp_timestop(handle)
10070 END SUBROUTINE mp_alltoall_l44
10080 SUBROUTINE mp_alltoall_l55(sb, rb, count, comm)
10082 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
10084 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
10086 INTEGER,
INTENT(IN) :: count
10089 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l55'
10092#if defined(__parallel)
10093 INTEGER :: ierr, msglen, np
10096 CALL mp_timeset(routinen, handle)
10098#if defined(__parallel)
10099 CALL mpi_alltoall(sb, count, mpi_integer8, &
10100 rb, count, mpi_integer8, comm%handle, ierr)
10101 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10102 CALL mpi_comm_size(comm%handle, np, ierr)
10103 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10104 msglen = 2*count*np
10105 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10111 CALL mp_timestop(handle)
10113 END SUBROUTINE mp_alltoall_l55
10124 SUBROUTINE mp_alltoall_l45(sb, rb, count, comm)
10126 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10128 INTEGER(KIND=int_8), &
10129 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
10130 INTEGER,
INTENT(IN) :: count
10133 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l45'
10136#if defined(__parallel)
10137 INTEGER :: ierr, msglen, np
10140 CALL mp_timeset(routinen, handle)
10142#if defined(__parallel)
10143 CALL mpi_alltoall(sb, count, mpi_integer8, &
10144 rb, count, mpi_integer8, comm%handle, ierr)
10145 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10146 CALL mpi_comm_size(comm%handle, np, ierr)
10147 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10148 msglen = 2*count*np
10149 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10153 rb = reshape(sb, shape(rb))
10155 CALL mp_timestop(handle)
10157 END SUBROUTINE mp_alltoall_l45
10168 SUBROUTINE mp_alltoall_l34(sb, rb, count, comm)
10170 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
10172 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10174 INTEGER,
INTENT(IN) :: count
10177 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l34'
10180#if defined(__parallel)
10181 INTEGER :: ierr, msglen, np
10184 CALL mp_timeset(routinen, handle)
10186#if defined(__parallel)
10187 CALL mpi_alltoall(sb, count, mpi_integer8, &
10188 rb, count, mpi_integer8, comm%handle, ierr)
10189 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10190 CALL mpi_comm_size(comm%handle, np, ierr)
10191 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10192 msglen = 2*count*np
10193 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10197 rb = reshape(sb, shape(rb))
10199 CALL mp_timestop(handle)
10201 END SUBROUTINE mp_alltoall_l34
10212 SUBROUTINE mp_alltoall_l54(sb, rb, count, comm)
10214 INTEGER(KIND=int_8), &
10215 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
10216 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10218 INTEGER,
INTENT(IN) :: count
10221 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l54'
10224#if defined(__parallel)
10225 INTEGER :: ierr, msglen, np
10228 CALL mp_timeset(routinen, handle)
10230#if defined(__parallel)
10231 CALL mpi_alltoall(sb, count, mpi_integer8, &
10232 rb, count, mpi_integer8, comm%handle, ierr)
10233 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10234 CALL mpi_comm_size(comm%handle, np, ierr)
10235 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10236 msglen = 2*count*np
10237 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10241 rb = reshape(sb, shape(rb))
10243 CALL mp_timestop(handle)
10245 END SUBROUTINE mp_alltoall_l54
10256 SUBROUTINE mp_send_l (msg, dest, tag, comm)
10257 INTEGER(KIND=int_8),
INTENT(IN) :: msg
10258 INTEGER,
INTENT(IN) :: dest, tag
10261 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_l'
10264#if defined(__parallel)
10265 INTEGER :: ierr, msglen
10268 CALL mp_timeset(routinen, handle)
10270#if defined(__parallel)
10272 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10273 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10274 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10281 cpabort(
"not in parallel mode")
10283 CALL mp_timestop(handle)
10284 END SUBROUTINE mp_send_l
10294 SUBROUTINE mp_send_lv(msg, dest, tag, comm)
10295 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
10296 INTEGER,
INTENT(IN) :: dest, tag
10299 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_lv'
10302#if defined(__parallel)
10303 INTEGER :: ierr, msglen
10306 CALL mp_timeset(routinen, handle)
10308#if defined(__parallel)
10310 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10311 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10312 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10319 cpabort(
"not in parallel mode")
10321 CALL mp_timestop(handle)
10322 END SUBROUTINE mp_send_lv
10332 SUBROUTINE mp_send_lm2(msg, dest, tag, comm)
10333 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
10334 INTEGER,
INTENT(IN) :: dest, tag
10337 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_lm2'
10340#if defined(__parallel)
10341 INTEGER :: ierr, msglen
10344 CALL mp_timeset(routinen, handle)
10346#if defined(__parallel)
10348 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10349 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10350 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10357 cpabort(
"not in parallel mode")
10359 CALL mp_timestop(handle)
10360 END SUBROUTINE mp_send_lm2
10370 SUBROUTINE mp_send_lm3(msg, dest, tag, comm)
10371 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
10372 INTEGER,
INTENT(IN) :: dest, tag
10375 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
10378#if defined(__parallel)
10379 INTEGER :: ierr, msglen
10382 CALL mp_timeset(routinen, handle)
10384#if defined(__parallel)
10386 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10387 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10388 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10395 cpabort(
"not in parallel mode")
10397 CALL mp_timestop(handle)
10398 END SUBROUTINE mp_send_lm3
10409 SUBROUTINE mp_recv_l (msg, source, tag, comm)
10410 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10411 INTEGER,
INTENT(INOUT) :: source, tag
10414 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_l'
10417#if defined(__parallel)
10418 INTEGER :: ierr, msglen
10419 mpi_status_type :: status
10422 CALL mp_timeset(routinen, handle)
10424#if defined(__parallel)
10427 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10428 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10430 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10431 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10432 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10433 source = status mpi_status_extract(mpi_source)
10434 tag = status mpi_status_extract(mpi_tag)
10442 cpabort(
"not in parallel mode")
10444 CALL mp_timestop(handle)
10445 END SUBROUTINE mp_recv_l
10455 SUBROUTINE mp_recv_lv(msg, source, tag, comm)
10456 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10457 INTEGER,
INTENT(INOUT) :: source, tag
10460 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lv'
10463#if defined(__parallel)
10464 INTEGER :: ierr, msglen
10465 mpi_status_type :: status
10468 CALL mp_timeset(routinen, handle)
10470#if defined(__parallel)
10473 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10474 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10476 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10477 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10478 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10479 source = status mpi_status_extract(mpi_source)
10480 tag = status mpi_status_extract(mpi_tag)
10488 cpabort(
"not in parallel mode")
10490 CALL mp_timestop(handle)
10491 END SUBROUTINE mp_recv_lv
10501 SUBROUTINE mp_recv_lm2(msg, source, tag, comm)
10502 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10503 INTEGER,
INTENT(INOUT) :: source, tag
10506 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lm2'
10509#if defined(__parallel)
10510 INTEGER :: ierr, msglen
10511 mpi_status_type :: status
10514 CALL mp_timeset(routinen, handle)
10516#if defined(__parallel)
10519 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10520 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10522 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10523 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10524 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10525 source = status mpi_status_extract(mpi_source)
10526 tag = status mpi_status_extract(mpi_tag)
10534 cpabort(
"not in parallel mode")
10536 CALL mp_timestop(handle)
10537 END SUBROUTINE mp_recv_lm2
10547 SUBROUTINE mp_recv_lm3(msg, source, tag, comm)
10548 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
10549 INTEGER,
INTENT(INOUT) :: source, tag
10552 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lm3'
10555#if defined(__parallel)
10556 INTEGER :: ierr, msglen
10557 mpi_status_type :: status
10560 CALL mp_timeset(routinen, handle)
10562#if defined(__parallel)
10565 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10566 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10568 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10569 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10570 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10571 source = status mpi_status_extract(mpi_source)
10572 tag = status mpi_status_extract(mpi_tag)
10580 cpabort(
"not in parallel mode")
10582 CALL mp_timestop(handle)
10583 END SUBROUTINE mp_recv_lm3
10593 SUBROUTINE mp_bcast_l (msg, source, comm)
10594 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10595 INTEGER,
INTENT(IN) :: source
10598 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l'
10601#if defined(__parallel)
10602 INTEGER :: ierr, msglen
10605 CALL mp_timeset(routinen, handle)
10607#if defined(__parallel)
10609 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10610 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10611 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10617 CALL mp_timestop(handle)
10618 END SUBROUTINE mp_bcast_l
10627 SUBROUTINE mp_bcast_l_src(msg, comm)
10628 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10631 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l_src'
10634#if defined(__parallel)
10635 INTEGER :: ierr, msglen
10638 CALL mp_timeset(routinen, handle)
10640#if defined(__parallel)
10642 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10643 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10644 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10649 CALL mp_timestop(handle)
10650 END SUBROUTINE mp_bcast_l_src
10660 SUBROUTINE mp_ibcast_l (msg, source, comm, request)
10661 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10662 INTEGER,
INTENT(IN) :: source
10666 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_l'
10669#if defined(__parallel)
10670 INTEGER :: ierr, msglen
10673 CALL mp_timeset(routinen, handle)
10675#if defined(__parallel)
10677 CALL mpi_ibcast(msg, msglen, mpi_integer8, source, comm%handle, request%handle, ierr)
10678 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
10679 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_8_size)
10686 CALL mp_timestop(handle)
10687 END SUBROUTINE mp_ibcast_l
10696 SUBROUTINE mp_bcast_lv(msg, source, comm)
10697 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10698 INTEGER,
INTENT(IN) :: source
10701 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lv'
10704#if defined(__parallel)
10705 INTEGER :: ierr, msglen
10708 CALL mp_timeset(routinen, handle)
10710#if defined(__parallel)
10712 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10713 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10714 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10720 CALL mp_timestop(handle)
10721 END SUBROUTINE mp_bcast_lv
10729 SUBROUTINE mp_bcast_lv_src(msg, comm)
10730 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10733 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lv_src'
10736#if defined(__parallel)
10737 INTEGER :: ierr, msglen
10740 CALL mp_timeset(routinen, handle)
10742#if defined(__parallel)
10744 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10745 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10746 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10751 CALL mp_timestop(handle)
10752 END SUBROUTINE mp_bcast_lv_src
10761 SUBROUTINE mp_ibcast_lv(msg, source, comm, request)
10762 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
10763 INTEGER,
INTENT(IN) :: source
10767 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_lv'
10770#if defined(__parallel)
10771 INTEGER :: ierr, msglen
10774 CALL mp_timeset(routinen, handle)
10776#if defined(__parallel)
10777#if !defined(__GNUC__) || __GNUC__ >= 9
10778 cpassert(is_contiguous(msg))
10781 CALL mpi_ibcast(msg, msglen, mpi_integer8, source, comm%handle, request%handle, ierr)
10782 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
10783 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_8_size)
10790 CALL mp_timestop(handle)
10791 END SUBROUTINE mp_ibcast_lv
10800 SUBROUTINE mp_bcast_lm(msg, source, comm)
10801 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10802 INTEGER,
INTENT(IN) :: source
10805 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lm'
10808#if defined(__parallel)
10809 INTEGER :: ierr, msglen
10812 CALL mp_timeset(routinen, handle)
10814#if defined(__parallel)
10816 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10817 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10818 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10824 CALL mp_timestop(handle)
10825 END SUBROUTINE mp_bcast_lm
10834 SUBROUTINE mp_bcast_lm_src(msg, comm)
10835 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10838 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lm_src'
10841#if defined(__parallel)
10842 INTEGER :: ierr, msglen
10845 CALL mp_timeset(routinen, handle)
10847#if defined(__parallel)
10849 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10850 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10851 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10856 CALL mp_timestop(handle)
10857 END SUBROUTINE mp_bcast_lm_src
10866 SUBROUTINE mp_bcast_l3(msg, source, comm)
10867 INTEGER(KIND=int_8),
CONTIGUOUS :: msg(:, :, :)
10868 INTEGER,
INTENT(IN) :: source
10871 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l3'
10874#if defined(__parallel)
10875 INTEGER :: ierr, msglen
10878 CALL mp_timeset(routinen, handle)
10880#if defined(__parallel)
10882 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10883 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10884 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10890 CALL mp_timestop(handle)
10891 END SUBROUTINE mp_bcast_l3
10900 SUBROUTINE mp_bcast_l3_src(msg, comm)
10901 INTEGER(KIND=int_8),
CONTIGUOUS :: msg(:, :, :)
10904 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l3_src'
10907#if defined(__parallel)
10908 INTEGER :: ierr, msglen
10911 CALL mp_timeset(routinen, handle)
10913#if defined(__parallel)
10915 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10916 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10917 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10922 CALL mp_timestop(handle)
10923 END SUBROUTINE mp_bcast_l3_src
10932 SUBROUTINE mp_sum_l (msg, comm)
10933 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10936 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_l'
10939#if defined(__parallel)
10940 INTEGER :: ierr, msglen
10943 CALL mp_timeset(routinen, handle)
10945#if defined(__parallel)
10947 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
10948 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
10949 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
10954 CALL mp_timestop(handle)
10955 END SUBROUTINE mp_sum_l
10963 SUBROUTINE mp_sum_lv(msg, comm)
10964 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10967 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lv'
10970#if defined(__parallel)
10971 INTEGER :: ierr, msglen
10974 CALL mp_timeset(routinen, handle)
10976#if defined(__parallel)
10978 IF (msglen > 0)
THEN
10979 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
10980 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
10982 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
10987 CALL mp_timestop(handle)
10988 END SUBROUTINE mp_sum_lv
10996 SUBROUTINE mp_isum_lv(msg, comm, request)
10997 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
11001 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_lv'
11004#if defined(__parallel)
11005 INTEGER :: ierr, msglen
11008 CALL mp_timeset(routinen, handle)
11010#if defined(__parallel)
11011#if !defined(__GNUC__) || __GNUC__ >= 9
11012 cpassert(is_contiguous(msg))
11015 IF (msglen > 0)
THEN
11016 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, request%handle, ierr)
11017 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
11021 CALL add_perf(perf_id=23, count=1, msg_size=msglen*int_8_size)
11027 CALL mp_timestop(handle)
11028 END SUBROUTINE mp_isum_lv
11036 SUBROUTINE mp_sum_lm(msg, comm)
11037 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11040 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm'
11043#if defined(__parallel)
11044 INTEGER,
PARAMETER :: max_msg = 2**25
11045 INTEGER :: ierr, m1, msglen, step, msglensum
11048 CALL mp_timeset(routinen, handle)
11050#if defined(__parallel)
11052 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
11054 DO m1 = lbound(msg, 2), ubound(msg, 2), step
11055 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
11056 msglensum = msglensum + msglen
11057 IF (msglen > 0)
THEN
11058 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11059 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11062 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_8_size)
11067 CALL mp_timestop(handle)
11068 END SUBROUTINE mp_sum_lm
11076 SUBROUTINE mp_sum_lm3(msg, comm)
11077 INTEGER(KIND=int_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
11080 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm3'
11083#if defined(__parallel)
11084 INTEGER :: ierr, msglen
11087 CALL mp_timeset(routinen, handle)
11089#if defined(__parallel)
11091 IF (msglen > 0)
THEN
11092 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11093 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11095 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11100 CALL mp_timestop(handle)
11101 END SUBROUTINE mp_sum_lm3
11109 SUBROUTINE mp_sum_lm4(msg, comm)
11110 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
11113 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm4'
11116#if defined(__parallel)
11117 INTEGER :: ierr, msglen
11120 CALL mp_timeset(routinen, handle)
11122#if defined(__parallel)
11124 IF (msglen > 0)
THEN
11125 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11126 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11128 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11133 CALL mp_timestop(handle)
11134 END SUBROUTINE mp_sum_lm4
11146 SUBROUTINE mp_sum_root_lv(msg, root, comm)
11147 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
11148 INTEGER,
INTENT(IN) :: root
11151 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_lv'
11154#if defined(__parallel)
11155 INTEGER :: ierr, m1, msglen, taskid
11156 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
11159 CALL mp_timeset(routinen, handle)
11161#if defined(__parallel)
11163 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11164 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11165 IF (msglen > 0)
THEN
11168 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_sum, &
11169 root, comm%handle, ierr)
11170 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11171 IF (taskid == root)
THEN
11176 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11182 CALL mp_timestop(handle)
11183 END SUBROUTINE mp_sum_root_lv
11194 SUBROUTINE mp_sum_root_lm(msg, root, comm)
11195 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11196 INTEGER,
INTENT(IN) :: root
11199 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
11202#if defined(__parallel)
11203 INTEGER :: ierr, m1, m2, msglen, taskid
11204 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:, :)
11207 CALL mp_timeset(routinen, handle)
11209#if defined(__parallel)
11211 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11212 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11213 IF (msglen > 0)
THEN
11216 ALLOCATE (res(m1, m2))
11217 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_sum, root, comm%handle, ierr)
11218 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11219 IF (taskid == root)
THEN
11224 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11230 CALL mp_timestop(handle)
11231 END SUBROUTINE mp_sum_root_lm
11239 SUBROUTINE mp_sum_partial_lm(msg, res, comm)
11240 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11241 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
11244 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_lm'
11247#if defined(__parallel)
11248 INTEGER :: ierr, msglen, taskid
11251 CALL mp_timeset(routinen, handle)
11253#if defined(__parallel)
11255 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11256 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11257 IF (msglen > 0)
THEN
11258 CALL mpi_scan(msg, res, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11259 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
11261 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11267 CALL mp_timestop(handle)
11268 END SUBROUTINE mp_sum_partial_lm
11278 SUBROUTINE mp_max_l (msg, comm)
11279 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11282 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_l'
11285#if defined(__parallel)
11286 INTEGER :: ierr, msglen
11289 CALL mp_timeset(routinen, handle)
11291#if defined(__parallel)
11293 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_max, comm%handle, ierr)
11294 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11295 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11300 CALL mp_timestop(handle)
11301 END SUBROUTINE mp_max_l
11311 SUBROUTINE mp_max_root_l (msg, root, comm)
11312 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11313 INTEGER,
INTENT(IN) :: root
11316 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_l'
11319#if defined(__parallel)
11320 INTEGER :: ierr, msglen
11321 INTEGER(KIND=int_8) :: res
11324 CALL mp_timeset(routinen, handle)
11326#if defined(__parallel)
11328 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_max, root, comm%handle, ierr)
11329 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11330 IF (root == comm%mepos) msg = res
11331 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11337 CALL mp_timestop(handle)
11338 END SUBROUTINE mp_max_root_l
11348 SUBROUTINE mp_max_lv(msg, comm)
11349 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
11352 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_lv'
11355#if defined(__parallel)
11356 INTEGER :: ierr, msglen
11359 CALL mp_timeset(routinen, handle)
11361#if defined(__parallel)
11363 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_max, comm%handle, ierr)
11364 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11365 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11370 CALL mp_timestop(handle)
11371 END SUBROUTINE mp_max_lv
11381 SUBROUTINE mp_max_root_lm(msg, root, comm)
11382 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11386 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_lm'
11389#if defined(__parallel)
11390 INTEGER :: ierr, msglen
11391 INTEGER(KIND=int_8) :: res(size(msg, 1), size(msg, 2))
11394 CALL mp_timeset(routinen, handle)
11396#if defined(__parallel)
11398 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_max, root, comm%handle, ierr)
11399 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11400 IF (root == comm%mepos) msg = res
11401 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11407 CALL mp_timestop(handle)
11408 END SUBROUTINE mp_max_root_lm
11418 SUBROUTINE mp_min_l (msg, comm)
11419 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11422 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_l'
11425#if defined(__parallel)
11426 INTEGER :: ierr, msglen
11429 CALL mp_timeset(routinen, handle)
11431#if defined(__parallel)
11433 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_min, comm%handle, ierr)
11434 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11435 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11440 CALL mp_timestop(handle)
11441 END SUBROUTINE mp_min_l
11453 SUBROUTINE mp_min_lv(msg, comm)
11454 INTEGER(KIND=int_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
11457 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_lv'
11460#if defined(__parallel)
11461 INTEGER :: ierr, msglen
11464 CALL mp_timeset(routinen, handle)
11466#if defined(__parallel)
11468 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_min, comm%handle, ierr)
11469 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11470 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11475 CALL mp_timestop(handle)
11476 END SUBROUTINE mp_min_lv
11486 SUBROUTINE mp_prod_l (msg, comm)
11487 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11490 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_l'
11493#if defined(__parallel)
11494 INTEGER :: ierr, msglen
11497 CALL mp_timeset(routinen, handle)
11499#if defined(__parallel)
11501 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_prod, comm%handle, ierr)
11502 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11503 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11508 CALL mp_timestop(handle)
11509 END SUBROUTINE mp_prod_l
11520 SUBROUTINE mp_scatter_lv(msg_scatter, msg, root, comm)
11521 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
11522 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
11523 INTEGER,
INTENT(IN) :: root
11526 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_lv'
11529#if defined(__parallel)
11530 INTEGER :: ierr, msglen
11533 CALL mp_timeset(routinen, handle)
11535#if defined(__parallel)
11537 CALL mpi_scatter(msg_scatter, msglen, mpi_integer8, msg, &
11538 msglen, mpi_integer8, root, comm%handle, ierr)
11539 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
11540 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11546 CALL mp_timestop(handle)
11547 END SUBROUTINE mp_scatter_lv
11557 SUBROUTINE mp_iscatter_l (msg_scatter, msg, root, comm, request)
11558 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:)
11559 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11560 INTEGER,
INTENT(IN) :: root
11564 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_l'
11567#if defined(__parallel)
11568 INTEGER :: ierr, msglen
11571 CALL mp_timeset(routinen, handle)
11573#if defined(__parallel)
11574#if !defined(__GNUC__) || __GNUC__ >= 9
11575 cpassert(is_contiguous(msg_scatter))
11578 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer8, msg, &
11579 msglen, mpi_integer8, root, comm%handle, request%handle, ierr)
11580 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
11581 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11585 msg = msg_scatter(1)
11588 CALL mp_timestop(handle)
11589 END SUBROUTINE mp_iscatter_l
11599 SUBROUTINE mp_iscatter_lv2(msg_scatter, msg, root, comm, request)
11600 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:, :)
11601 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
11602 INTEGER,
INTENT(IN) :: root
11606 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_lv2'
11609#if defined(__parallel)
11610 INTEGER :: ierr, msglen
11613 CALL mp_timeset(routinen, handle)
11615#if defined(__parallel)
11616#if !defined(__GNUC__) || __GNUC__ >= 9
11617 cpassert(is_contiguous(msg_scatter))
11620 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer8, msg, &
11621 msglen, mpi_integer8, root, comm%handle, request%handle, ierr)
11622 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
11623 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11627 msg(:) = msg_scatter(:, 1)
11630 CALL mp_timestop(handle)
11631 END SUBROUTINE mp_iscatter_lv2
11641 SUBROUTINE mp_iscatterv_lv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
11642 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:)
11643 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
11644 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
11645 INTEGER,
INTENT(IN) :: recvcount, root
11649 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_lv'
11652#if defined(__parallel)
11656 CALL mp_timeset(routinen, handle)
11658#if defined(__parallel)
11659#if !defined(__GNUC__) || __GNUC__ >= 9
11660 cpassert(is_contiguous(msg_scatter))
11661 cpassert(is_contiguous(msg))
11662 cpassert(is_contiguous(sendcounts))
11663 cpassert(is_contiguous(displs))
11665 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_integer8, msg, &
11666 recvcount, mpi_integer8, root, comm%handle, request%handle, ierr)
11667 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
11668 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11670 mark_used(sendcounts)
11672 mark_used(recvcount)
11675 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
11678 CALL mp_timestop(handle)
11679 END SUBROUTINE mp_iscatterv_lv
11690 SUBROUTINE mp_gather_l (msg, msg_gather, root, comm)
11691 INTEGER(KIND=int_8),
INTENT(IN) :: msg
11692 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11693 INTEGER,
INTENT(IN) :: root
11696 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_l'
11699#if defined(__parallel)
11700 INTEGER :: ierr, msglen
11703 CALL mp_timeset(routinen, handle)
11705#if defined(__parallel)
11707 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11708 msglen, mpi_integer8, root, comm%handle, ierr)
11709 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11710 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11714 msg_gather(1) = msg
11716 CALL mp_timestop(handle)
11717 END SUBROUTINE mp_gather_l
11727 SUBROUTINE mp_gather_l_src(msg, msg_gather, comm)
11728 INTEGER(KIND=int_8),
INTENT(IN) :: msg
11729 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11732 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_l_src'
11735#if defined(__parallel)
11736 INTEGER :: ierr, msglen
11739 CALL mp_timeset(routinen, handle)
11741#if defined(__parallel)
11743 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11744 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11745 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11746 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11749 msg_gather(1) = msg
11751 CALL mp_timestop(handle)
11752 END SUBROUTINE mp_gather_l_src
11766 SUBROUTINE mp_gather_lv(msg, msg_gather, root, comm)
11767 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
11768 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11769 INTEGER,
INTENT(IN) :: root
11772 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lv'
11775#if defined(__parallel)
11776 INTEGER :: ierr, msglen
11779 CALL mp_timeset(routinen, handle)
11781#if defined(__parallel)
11783 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11784 msglen, mpi_integer8, root, comm%handle, ierr)
11785 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11786 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11792 CALL mp_timestop(handle)
11793 END SUBROUTINE mp_gather_lv
11806 SUBROUTINE mp_gather_lv_src(msg, msg_gather, comm)
11807 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
11808 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11811 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lv_src'
11814#if defined(__parallel)
11815 INTEGER :: ierr, msglen
11818 CALL mp_timeset(routinen, handle)
11820#if defined(__parallel)
11822 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11823 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11824 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11825 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11830 CALL mp_timestop(handle)
11831 END SUBROUTINE mp_gather_lv_src
11845 SUBROUTINE mp_gather_lm(msg, msg_gather, root, comm)
11846 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11847 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
11848 INTEGER,
INTENT(IN) :: root
11851 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lm'
11854#if defined(__parallel)
11855 INTEGER :: ierr, msglen
11858 CALL mp_timeset(routinen, handle)
11860#if defined(__parallel)
11862 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11863 msglen, mpi_integer8, root, comm%handle, ierr)
11864 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11865 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11871 CALL mp_timestop(handle)
11872 END SUBROUTINE mp_gather_lm
11885 SUBROUTINE mp_gather_lm_src(msg, msg_gather, comm)
11886 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11887 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
11890 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lm_src'
11893#if defined(__parallel)
11894 INTEGER :: ierr, msglen
11897 CALL mp_timeset(routinen, handle)
11899#if defined(__parallel)
11901 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11902 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11903 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11904 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11909 CALL mp_timestop(handle)
11910 END SUBROUTINE mp_gather_lm_src
11927 SUBROUTINE mp_gatherv_lv(sendbuf, recvbuf, recvcounts, displs, root, comm)
11929 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
11930 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
11931 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
11932 INTEGER,
INTENT(IN) :: root
11935 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lv'
11938#if defined(__parallel)
11939 INTEGER :: ierr, sendcount
11942 CALL mp_timeset(routinen, handle)
11944#if defined(__parallel)
11945 sendcount =
SIZE(sendbuf)
11946 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
11947 recvbuf, recvcounts, displs, mpi_integer8, &
11948 root, comm%handle, ierr)
11949 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
11950 CALL add_perf(perf_id=4, &
11952 msg_size=sendcount*int_8_size)
11954 mark_used(recvcounts)
11957 recvbuf(1 + displs(1):) = sendbuf
11959 CALL mp_timestop(handle)
11960 END SUBROUTINE mp_gatherv_lv
11976 SUBROUTINE mp_gatherv_lv_src(sendbuf, recvbuf, recvcounts, displs, comm)
11978 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
11979 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
11980 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
11983 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lv_src'
11986#if defined(__parallel)
11987 INTEGER :: ierr, sendcount
11990 CALL mp_timeset(routinen, handle)
11992#if defined(__parallel)
11993 sendcount =
SIZE(sendbuf)
11994 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
11995 recvbuf, recvcounts, displs, mpi_integer8, &
11996 comm%source, comm%handle, ierr)
11997 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
11998 CALL add_perf(perf_id=4, &
12000 msg_size=sendcount*int_8_size)
12002 mark_used(recvcounts)
12004 recvbuf(1 + displs(1):) = sendbuf
12006 CALL mp_timestop(handle)
12007 END SUBROUTINE mp_gatherv_lv_src
12024 SUBROUTINE mp_gatherv_lm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
12026 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
12027 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
12028 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12029 INTEGER,
INTENT(IN) :: root
12032 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lm2'
12035#if defined(__parallel)
12036 INTEGER :: ierr, sendcount
12039 CALL mp_timeset(routinen, handle)
12041#if defined(__parallel)
12042 sendcount =
SIZE(sendbuf)
12043 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
12044 recvbuf, recvcounts, displs, mpi_integer8, &
12045 root, comm%handle, ierr)
12046 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12047 CALL add_perf(perf_id=4, &
12049 msg_size=sendcount*int_8_size)
12051 mark_used(recvcounts)
12054 recvbuf(:, 1 + displs(1):) = sendbuf
12056 CALL mp_timestop(handle)
12057 END SUBROUTINE mp_gatherv_lm2
12073 SUBROUTINE mp_gatherv_lm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
12075 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
12076 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
12077 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12080 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lm2_src'
12083#if defined(__parallel)
12084 INTEGER :: ierr, sendcount
12087 CALL mp_timeset(routinen, handle)
12089#if defined(__parallel)
12090 sendcount =
SIZE(sendbuf)
12091 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
12092 recvbuf, recvcounts, displs, mpi_integer8, &
12093 comm%source, comm%handle, ierr)
12094 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12095 CALL add_perf(perf_id=4, &
12097 msg_size=sendcount*int_8_size)
12099 mark_used(recvcounts)
12101 recvbuf(:, 1 + displs(1):) = sendbuf
12103 CALL mp_timestop(handle)
12104 END SUBROUTINE mp_gatherv_lm2_src
12121 SUBROUTINE mp_igatherv_lv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
12122 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
12123 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
12124 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12125 INTEGER,
INTENT(IN) :: sendcount, root
12129 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_lv'
12132#if defined(__parallel)
12136 CALL mp_timeset(routinen, handle)
12138#if defined(__parallel)
12139#if !defined(__GNUC__) || __GNUC__ >= 9
12140 cpassert(is_contiguous(sendbuf))
12141 cpassert(is_contiguous(recvbuf))
12142 cpassert(is_contiguous(recvcounts))
12143 cpassert(is_contiguous(displs))
12145 CALL mpi_igatherv(sendbuf, sendcount, mpi_integer8, &
12146 recvbuf, recvcounts, displs, mpi_integer8, &
12147 root, comm%handle, request%handle, ierr)
12148 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12149 CALL add_perf(perf_id=24, &
12151 msg_size=sendcount*int_8_size)
12153 mark_used(sendcount)
12154 mark_used(recvcounts)
12157 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
12160 CALL mp_timestop(handle)
12161 END SUBROUTINE mp_igatherv_lv
12174 SUBROUTINE mp_allgather_l (msgout, msgin, comm)
12175 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12176 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
12179 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l'
12182#if defined(__parallel)
12183 INTEGER :: ierr, rcount, scount
12186 CALL mp_timeset(routinen, handle)
12188#if defined(__parallel)
12191 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12192 msgin, rcount, mpi_integer8, &
12194 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12199 CALL mp_timestop(handle)
12200 END SUBROUTINE mp_allgather_l
12213 SUBROUTINE mp_allgather_l2(msgout, msgin, comm)
12214 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12215 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12218 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l2'
12221#if defined(__parallel)
12222 INTEGER :: ierr, rcount, scount
12225 CALL mp_timeset(routinen, handle)
12227#if defined(__parallel)
12230 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12231 msgin, rcount, mpi_integer8, &
12233 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12238 CALL mp_timestop(handle)
12239 END SUBROUTINE mp_allgather_l2
12252 SUBROUTINE mp_iallgather_l (msgout, msgin, comm, request)
12253 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12254 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12258 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l'
12261#if defined(__parallel)
12262 INTEGER :: ierr, rcount, scount
12265 CALL mp_timeset(routinen, handle)
12267#if defined(__parallel)
12268#if !defined(__GNUC__) || __GNUC__ >= 9
12269 cpassert(is_contiguous(msgin))
12273 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12274 msgin, rcount, mpi_integer8, &
12275 comm%handle, request%handle, ierr)
12276 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12282 CALL mp_timestop(handle)
12283 END SUBROUTINE mp_iallgather_l
12298 SUBROUTINE mp_allgather_l12(msgout, msgin, comm)
12299 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
12300 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12303 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l12'
12306#if defined(__parallel)
12307 INTEGER :: ierr, rcount, scount
12310 CALL mp_timeset(routinen, handle)
12312#if defined(__parallel)
12313 scount =
SIZE(msgout(:))
12315 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12316 msgin, rcount, mpi_integer8, &
12318 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12321 msgin(:, 1) = msgout(:)
12323 CALL mp_timestop(handle)
12324 END SUBROUTINE mp_allgather_l12
12334 SUBROUTINE mp_allgather_l23(msgout, msgin, comm)
12335 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
12336 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
12339 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l23'
12342#if defined(__parallel)
12343 INTEGER :: ierr, rcount, scount
12346 CALL mp_timeset(routinen, handle)
12348#if defined(__parallel)
12349 scount =
SIZE(msgout(:, :))
12351 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12352 msgin, rcount, mpi_integer8, &
12354 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12357 msgin(:, :, 1) = msgout(:, :)
12359 CALL mp_timestop(handle)
12360 END SUBROUTINE mp_allgather_l23
12370 SUBROUTINE mp_allgather_l34(msgout, msgin, comm)
12371 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
12372 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
12375 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l34'
12378#if defined(__parallel)
12379 INTEGER :: ierr, rcount, scount
12382 CALL mp_timeset(routinen, handle)
12384#if defined(__parallel)
12385 scount =
SIZE(msgout(:, :, :))
12387 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12388 msgin, rcount, mpi_integer8, &
12390 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12393 msgin(:, :, :, 1) = msgout(:, :, :)
12395 CALL mp_timestop(handle)
12396 END SUBROUTINE mp_allgather_l34
12406 SUBROUTINE mp_allgather_l22(msgout, msgin, comm)
12407 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
12408 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12411 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l22'
12414#if defined(__parallel)
12415 INTEGER :: ierr, rcount, scount
12418 CALL mp_timeset(routinen, handle)
12420#if defined(__parallel)
12421 scount =
SIZE(msgout(:, :))
12423 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12424 msgin, rcount, mpi_integer8, &
12426 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12429 msgin(:, :) = msgout(:, :)
12431 CALL mp_timestop(handle)
12432 END SUBROUTINE mp_allgather_l22
12443 SUBROUTINE mp_iallgather_l11(msgout, msgin, comm, request)
12444 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12445 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12449 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l11'
12452#if defined(__parallel)
12453 INTEGER :: ierr, rcount, scount
12456 CALL mp_timeset(routinen, handle)
12458#if defined(__parallel)
12459#if !defined(__GNUC__) || __GNUC__ >= 9
12460 cpassert(is_contiguous(msgout))
12461 cpassert(is_contiguous(msgin))
12463 scount =
SIZE(msgout(:))
12465 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12466 msgin, rcount, mpi_integer8, &
12467 comm%handle, request%handle, ierr)
12468 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12474 CALL mp_timestop(handle)
12475 END SUBROUTINE mp_iallgather_l11
12486 SUBROUTINE mp_iallgather_l13(msgout, msgin, comm, request)
12487 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12488 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :)
12492 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l13'
12495#if defined(__parallel)
12496 INTEGER :: ierr, rcount, scount
12499 CALL mp_timeset(routinen, handle)
12501#if defined(__parallel)
12502#if !defined(__GNUC__) || __GNUC__ >= 9
12503 cpassert(is_contiguous(msgout))
12504 cpassert(is_contiguous(msgin))
12507 scount =
SIZE(msgout(:))
12509 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12510 msgin, rcount, mpi_integer8, &
12511 comm%handle, request%handle, ierr)
12512 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12515 msgin(:, 1, 1) = msgout(:)
12518 CALL mp_timestop(handle)
12519 END SUBROUTINE mp_iallgather_l13
12530 SUBROUTINE mp_iallgather_l22(msgout, msgin, comm, request)
12531 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :)
12532 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :)
12536 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l22'
12539#if defined(__parallel)
12540 INTEGER :: ierr, rcount, scount
12543 CALL mp_timeset(routinen, handle)
12545#if defined(__parallel)
12546#if !defined(__GNUC__) || __GNUC__ >= 9
12547 cpassert(is_contiguous(msgout))
12548 cpassert(is_contiguous(msgin))
12551 scount =
SIZE(msgout(:, :))
12553 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12554 msgin, rcount, mpi_integer8, &
12555 comm%handle, request%handle, ierr)
12556 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12559 msgin(:, :) = msgout(:, :)
12562 CALL mp_timestop(handle)
12563 END SUBROUTINE mp_iallgather_l22
12574 SUBROUTINE mp_iallgather_l24(msgout, msgin, comm, request)
12575 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :)
12576 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :, :)
12580 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l24'
12583#if defined(__parallel)
12584 INTEGER :: ierr, rcount, scount
12587 CALL mp_timeset(routinen, handle)
12589#if defined(__parallel)
12590#if !defined(__GNUC__) || __GNUC__ >= 9
12591 cpassert(is_contiguous(msgout))
12592 cpassert(is_contiguous(msgin))
12595 scount =
SIZE(msgout(:, :))
12597 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12598 msgin, rcount, mpi_integer8, &
12599 comm%handle, request%handle, ierr)
12600 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12603 msgin(:, :, 1, 1) = msgout(:, :)
12606 CALL mp_timestop(handle)
12607 END SUBROUTINE mp_iallgather_l24
12618 SUBROUTINE mp_iallgather_l33(msgout, msgin, comm, request)
12619 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :, :)
12620 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :)
12624 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l33'
12627#if defined(__parallel)
12628 INTEGER :: ierr, rcount, scount
12631 CALL mp_timeset(routinen, handle)
12633#if defined(__parallel)
12634#if !defined(__GNUC__) || __GNUC__ >= 9
12635 cpassert(is_contiguous(msgout))
12636 cpassert(is_contiguous(msgin))
12639 scount =
SIZE(msgout(:, :, :))
12641 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12642 msgin, rcount, mpi_integer8, &
12643 comm%handle, request%handle, ierr)
12644 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12647 msgin(:, :, :) = msgout(:, :, :)
12650 CALL mp_timestop(handle)
12651 END SUBROUTINE mp_iallgather_l33
12670 SUBROUTINE mp_allgatherv_lv(msgout, msgin, rcount, rdispl, comm)
12671 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
12672 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12673 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12676 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_lv'
12679#if defined(__parallel)
12680 INTEGER :: ierr, scount
12683 CALL mp_timeset(routinen, handle)
12685#if defined(__parallel)
12686 scount =
SIZE(msgout)
12687 CALL mpi_allgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12688 rdispl, mpi_integer8, comm%handle, ierr)
12689 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
12696 CALL mp_timestop(handle)
12697 END SUBROUTINE mp_allgatherv_lv
12716 SUBROUTINE mp_allgatherv_lm2(msgout, msgin, rcount, rdispl, comm)
12717 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
12718 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
12719 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12722 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_lv'
12725#if defined(__parallel)
12726 INTEGER :: ierr, scount
12729 CALL mp_timeset(routinen, handle)
12731#if defined(__parallel)
12732 scount =
SIZE(msgout)
12733 CALL mpi_allgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12734 rdispl, mpi_integer8, comm%handle, ierr)
12735 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
12742 CALL mp_timestop(handle)
12743 END SUBROUTINE mp_allgatherv_lm2
12762 SUBROUTINE mp_iallgatherv_lv(msgout, msgin, rcount, rdispl, comm, request)
12763 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12764 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12765 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12769 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_lv'
12772#if defined(__parallel)
12773 INTEGER :: ierr, scount, rsize
12776 CALL mp_timeset(routinen, handle)
12778#if defined(__parallel)
12779#if !defined(__GNUC__) || __GNUC__ >= 9
12780 cpassert(is_contiguous(msgout))
12781 cpassert(is_contiguous(msgin))
12782 cpassert(is_contiguous(rcount))
12783 cpassert(is_contiguous(rdispl))
12786 scount =
SIZE(msgout)
12787 rsize =
SIZE(rcount)
12788 CALL mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, &
12789 rdispl, comm, request, ierr)
12790 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
12798 CALL mp_timestop(handle)
12799 END SUBROUTINE mp_iallgatherv_lv
12818 SUBROUTINE mp_iallgatherv_lv2(msgout, msgin, rcount, rdispl, comm, request)
12819 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12820 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12821 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
12825 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_lv2'
12828#if defined(__parallel)
12829 INTEGER :: ierr, scount, rsize
12832 CALL mp_timeset(routinen, handle)
12834#if defined(__parallel)
12835#if !defined(__GNUC__) || __GNUC__ >= 9
12836 cpassert(is_contiguous(msgout))
12837 cpassert(is_contiguous(msgin))
12838 cpassert(is_contiguous(rcount))
12839 cpassert(is_contiguous(rdispl))
12842 scount =
SIZE(msgout)
12843 rsize =
SIZE(rcount)
12844 CALL mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, &
12845 rdispl, comm, request, ierr)
12846 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
12854 CALL mp_timestop(handle)
12855 END SUBROUTINE mp_iallgatherv_lv2
12866#if defined(__parallel)
12867 SUBROUTINE mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
12868 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
12869 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12870 INTEGER,
INTENT(IN) :: rsize
12871 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
12874 INTEGER,
INTENT(INOUT) :: ierr
12876 CALL mpi_iallgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12877 rdispl, mpi_integer8, comm%handle, request%handle, ierr)
12879 END SUBROUTINE mp_iallgatherv_lv_internal
12890 SUBROUTINE mp_sum_scatter_lv(msgout, msgin, rcount, comm)
12891 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
12892 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12893 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
12896 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_lv'
12899#if defined(__parallel)
12903 CALL mp_timeset(routinen, handle)
12905#if defined(__parallel)
12906 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_integer8, mpi_sum, &
12908 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
12910 CALL add_perf(perf_id=3, count=1, &
12911 msg_size=rcount(1)*2*int_8_size)
12915 msgin = msgout(:, 1)
12917 CALL mp_timestop(handle)
12918 END SUBROUTINE mp_sum_scatter_lv
12929 SUBROUTINE mp_sendrecv_l (msgin, dest, msgout, source, comm, tag)
12930 INTEGER(KIND=int_8),
INTENT(IN) :: msgin
12931 INTEGER,
INTENT(IN) :: dest
12932 INTEGER(KIND=int_8),
INTENT(OUT) :: msgout
12933 INTEGER,
INTENT(IN) :: source
12935 INTEGER,
INTENT(IN),
OPTIONAL :: tag
12937 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_l'
12940#if defined(__parallel)
12941 INTEGER :: ierr, msglen_in, msglen_out, &
12945 CALL mp_timeset(routinen, handle)
12947#if defined(__parallel)
12952 IF (
PRESENT(tag))
THEN
12956 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
12957 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
12958 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
12959 CALL add_perf(perf_id=7, count=1, &
12960 msg_size=(msglen_in + msglen_out)*int_8_size/2)
12968 CALL mp_timestop(handle)
12969 END SUBROUTINE mp_sendrecv_l
12980 SUBROUTINE mp_sendrecv_lv(msgin, dest, msgout, source, comm, tag)
12981 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
12982 INTEGER,
INTENT(IN) :: dest
12983 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
12984 INTEGER,
INTENT(IN) :: source
12986 INTEGER,
INTENT(IN),
OPTIONAL :: tag
12988 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lv'
12991#if defined(__parallel)
12992 INTEGER :: ierr, msglen_in, msglen_out, &
12996 CALL mp_timeset(routinen, handle)
12998#if defined(__parallel)
12999 msglen_in =
SIZE(msgin)
13000 msglen_out =
SIZE(msgout)
13003 IF (
PRESENT(tag))
THEN
13007 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13008 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13009 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13010 CALL add_perf(perf_id=7, count=1, &
13011 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13019 CALL mp_timestop(handle)
13020 END SUBROUTINE mp_sendrecv_lv
13032 SUBROUTINE mp_sendrecv_lm2(msgin, dest, msgout, source, comm, tag)
13033 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
13034 INTEGER,
INTENT(IN) :: dest
13035 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
13036 INTEGER,
INTENT(IN) :: source
13038 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13040 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm2'
13043#if defined(__parallel)
13044 INTEGER :: ierr, msglen_in, msglen_out, &
13048 CALL mp_timeset(routinen, handle)
13050#if defined(__parallel)
13051 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
13052 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
13055 IF (
PRESENT(tag))
THEN
13059 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13060 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13061 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13062 CALL add_perf(perf_id=7, count=1, &
13063 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13071 CALL mp_timestop(handle)
13072 END SUBROUTINE mp_sendrecv_lm2
13083 SUBROUTINE mp_sendrecv_lm3(msgin, dest, msgout, source, comm, tag)
13084 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
13085 INTEGER,
INTENT(IN) :: dest
13086 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
13087 INTEGER,
INTENT(IN) :: source
13089 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13091 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm3'
13094#if defined(__parallel)
13095 INTEGER :: ierr, msglen_in, msglen_out, &
13099 CALL mp_timeset(routinen, handle)
13101#if defined(__parallel)
13102 msglen_in =
SIZE(msgin)
13103 msglen_out =
SIZE(msgout)
13106 IF (
PRESENT(tag))
THEN
13110 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13111 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13112 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13113 CALL add_perf(perf_id=7, count=1, &
13114 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13122 CALL mp_timestop(handle)
13123 END SUBROUTINE mp_sendrecv_lm3
13134 SUBROUTINE mp_sendrecv_lm4(msgin, dest, msgout, source, comm, tag)
13135 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
13136 INTEGER,
INTENT(IN) :: dest
13137 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
13138 INTEGER,
INTENT(IN) :: source
13140 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13142 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm4'
13145#if defined(__parallel)
13146 INTEGER :: ierr, msglen_in, msglen_out, &
13150 CALL mp_timeset(routinen, handle)
13152#if defined(__parallel)
13153 msglen_in =
SIZE(msgin)
13154 msglen_out =
SIZE(msgout)
13157 IF (
PRESENT(tag))
THEN
13161 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13162 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13163 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13164 CALL add_perf(perf_id=7, count=1, &
13165 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13173 CALL mp_timestop(handle)
13174 END SUBROUTINE mp_sendrecv_lm4
13191 SUBROUTINE mp_isendrecv_l (msgin, dest, msgout, source, comm, send_request, &
13193 INTEGER(KIND=int_8),
INTENT(IN) :: msgin
13194 INTEGER,
INTENT(IN) :: dest
13195 INTEGER(KIND=int_8),
INTENT(INOUT) :: msgout
13196 INTEGER,
INTENT(IN) :: source
13199 INTEGER,
INTENT(in),
OPTIONAL :: tag
13201 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_l'
13204#if defined(__parallel)
13205 INTEGER :: ierr, my_tag
13208 CALL mp_timeset(routinen, handle)
13210#if defined(__parallel)
13212 IF (
PRESENT(tag)) my_tag = tag
13214 CALL mpi_irecv(msgout, 1, mpi_integer8, source, my_tag, &
13215 comm%handle, recv_request%handle, ierr)
13216 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13218 CALL mpi_isend(msgin, 1, mpi_integer8, dest, my_tag, &
13219 comm%handle, send_request%handle, ierr)
13220 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13222 CALL add_perf(perf_id=8, count=1, msg_size=2*int_8_size)
13232 CALL mp_timestop(handle)
13233 END SUBROUTINE mp_isendrecv_l
13252 SUBROUTINE mp_isendrecv_lv(msgin, dest, msgout, source, comm, send_request, &
13254 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: msgin
13255 INTEGER,
INTENT(IN) :: dest
13256 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
13257 INTEGER,
INTENT(IN) :: source
13260 INTEGER,
INTENT(in),
OPTIONAL :: tag
13262 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_lv'
13265#if defined(__parallel)
13266 INTEGER :: ierr, msglen, my_tag
13267 INTEGER(KIND=int_8) :: foo
13270 CALL mp_timeset(routinen, handle)
13272#if defined(__parallel)
13273#if !defined(__GNUC__) || __GNUC__ >= 9
13274 cpassert(is_contiguous(msgout))
13275 cpassert(is_contiguous(msgin))
13279 IF (
PRESENT(tag)) my_tag = tag
13281 msglen =
SIZE(msgout, 1)
13282 IF (msglen > 0)
THEN
13283 CALL mpi_irecv(msgout(1), msglen, mpi_integer8, source, my_tag, &
13284 comm%handle, recv_request%handle, ierr)
13286 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13287 comm%handle, recv_request%handle, ierr)
13289 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13291 msglen =
SIZE(msgin, 1)
13292 IF (msglen > 0)
THEN
13293 CALL mpi_isend(msgin(1), msglen, mpi_integer8, dest, my_tag, &
13294 comm%handle, send_request%handle, ierr)
13296 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13297 comm%handle, send_request%handle, ierr)
13299 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13301 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
13302 CALL add_perf(perf_id=8, count=1, msg_size=msglen*int_8_size)
13312 CALL mp_timestop(handle)
13313 END SUBROUTINE mp_isendrecv_lv
13328 SUBROUTINE mp_isend_lv(msgin, dest, comm, request, tag)
13329 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: msgin
13330 INTEGER,
INTENT(IN) :: dest
13333 INTEGER,
INTENT(in),
OPTIONAL :: tag
13335 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lv'
13337 INTEGER :: handle, ierr
13338#if defined(__parallel)
13339 INTEGER :: msglen, my_tag
13340 INTEGER(KIND=int_8) :: foo(1)
13343 CALL mp_timeset(routinen, handle)
13345#if defined(__parallel)
13346#if !defined(__GNUC__) || __GNUC__ >= 9
13347 cpassert(is_contiguous(msgin))
13350 IF (
PRESENT(tag)) my_tag = tag
13352 msglen =
SIZE(msgin)
13353 IF (msglen > 0)
THEN
13354 CALL mpi_isend(msgin(1), msglen, mpi_integer8, dest, my_tag, &
13355 comm%handle, request%handle, ierr)
13357 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13358 comm%handle, request%handle, ierr)
13360 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13362 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13371 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13373 CALL mp_timestop(handle)
13374 END SUBROUTINE mp_isend_lv
13391 SUBROUTINE mp_isend_lm2(msgin, dest, comm, request, tag)
13392 INTEGER(KIND=int_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
13393 INTEGER,
INTENT(IN) :: dest
13396 INTEGER,
INTENT(in),
OPTIONAL :: tag
13398 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm2'
13400 INTEGER :: handle, ierr
13401#if defined(__parallel)
13402 INTEGER :: msglen, my_tag
13403 INTEGER(KIND=int_8) :: foo(1)
13406 CALL mp_timeset(routinen, handle)
13408#if defined(__parallel)
13409#if !defined(__GNUC__) || __GNUC__ >= 9
13410 cpassert(is_contiguous(msgin))
13414 IF (
PRESENT(tag)) my_tag = tag
13416 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
13417 IF (msglen > 0)
THEN
13418 CALL mpi_isend(msgin(1, 1), msglen, mpi_integer8, dest, my_tag, &
13419 comm%handle, request%handle, ierr)
13421 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13422 comm%handle, request%handle, ierr)
13424 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13426 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13435 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13437 CALL mp_timestop(handle)
13438 END SUBROUTINE mp_isend_lm2
13457 SUBROUTINE mp_isend_lm3(msgin, dest, comm, request, tag)
13458 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
13459 INTEGER,
INTENT(IN) :: dest
13462 INTEGER,
INTENT(in),
OPTIONAL :: tag
13464 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm3'
13466 INTEGER :: handle, ierr
13467#if defined(__parallel)
13468 INTEGER :: msglen, my_tag
13469 INTEGER(KIND=int_8) :: foo(1)
13472 CALL mp_timeset(routinen, handle)
13474#if defined(__parallel)
13475#if !defined(__GNUC__) || __GNUC__ >= 9
13476 cpassert(is_contiguous(msgin))
13480 IF (
PRESENT(tag)) my_tag = tag
13482 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
13483 IF (msglen > 0)
THEN
13484 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_integer8, dest, my_tag, &
13485 comm%handle, request%handle, ierr)
13487 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13488 comm%handle, request%handle, ierr)
13490 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13492 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13501 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13503 CALL mp_timestop(handle)
13504 END SUBROUTINE mp_isend_lm3
13520 SUBROUTINE mp_isend_lm4(msgin, dest, comm, request, tag)
13521 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
13522 INTEGER,
INTENT(IN) :: dest
13525 INTEGER,
INTENT(in),
OPTIONAL :: tag
13527 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm4'
13529 INTEGER :: handle, ierr
13530#if defined(__parallel)
13531 INTEGER :: msglen, my_tag
13532 INTEGER(KIND=int_8) :: foo(1)
13535 CALL mp_timeset(routinen, handle)
13537#if defined(__parallel)
13538#if !defined(__GNUC__) || __GNUC__ >= 9
13539 cpassert(is_contiguous(msgin))
13543 IF (
PRESENT(tag)) my_tag = tag
13545 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
13546 IF (msglen > 0)
THEN
13547 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_integer8, dest, my_tag, &
13548 comm%handle, request%handle, ierr)
13550 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13551 comm%handle, request%handle, ierr)
13553 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13555 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13564 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13566 CALL mp_timestop(handle)
13567 END SUBROUTINE mp_isend_lm4
13583 SUBROUTINE mp_irecv_lv(msgout, source, comm, request, tag)
13584 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
13585 INTEGER,
INTENT(IN) :: source
13588 INTEGER,
INTENT(in),
OPTIONAL :: tag
13590 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lv'
13593#if defined(__parallel)
13594 INTEGER :: ierr, msglen, my_tag
13595 INTEGER(KIND=int_8) :: foo(1)
13598 CALL mp_timeset(routinen, handle)
13600#if defined(__parallel)
13601#if !defined(__GNUC__) || __GNUC__ >= 9
13602 cpassert(is_contiguous(msgout))
13606 IF (
PRESENT(tag)) my_tag = tag
13608 msglen =
SIZE(msgout)
13609 IF (msglen > 0)
THEN
13610 CALL mpi_irecv(msgout(1), msglen, mpi_integer8, source, my_tag, &
13611 comm%handle, request%handle, ierr)
13613 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13614 comm%handle, request%handle, ierr)
13616 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13618 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13620 cpabort(
"mp_irecv called in non parallel case")
13627 CALL mp_timestop(handle)
13628 END SUBROUTINE mp_irecv_lv
13645 SUBROUTINE mp_irecv_lm2(msgout, source, comm, request, tag)
13646 INTEGER(KIND=int_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
13647 INTEGER,
INTENT(IN) :: source
13650 INTEGER,
INTENT(in),
OPTIONAL :: tag
13652 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm2'
13655#if defined(__parallel)
13656 INTEGER :: ierr, msglen, my_tag
13657 INTEGER(KIND=int_8) :: foo(1)
13660 CALL mp_timeset(routinen, handle)
13662#if defined(__parallel)
13663#if !defined(__GNUC__) || __GNUC__ >= 9
13664 cpassert(is_contiguous(msgout))
13668 IF (
PRESENT(tag)) my_tag = tag
13670 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
13671 IF (msglen > 0)
THEN
13672 CALL mpi_irecv(msgout(1, 1), msglen, mpi_integer8, source, my_tag, &
13673 comm%handle, request%handle, ierr)
13675 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13676 comm%handle, request%handle, ierr)
13678 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13680 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13687 cpabort(
"mp_irecv called in non parallel case")
13689 CALL mp_timestop(handle)
13690 END SUBROUTINE mp_irecv_lm2
13708 SUBROUTINE mp_irecv_lm3(msgout, source, comm, request, tag)
13709 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
13710 INTEGER,
INTENT(IN) :: source
13713 INTEGER,
INTENT(in),
OPTIONAL :: tag
13715 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm3'
13718#if defined(__parallel)
13719 INTEGER :: ierr, msglen, my_tag
13720 INTEGER(KIND=int_8) :: foo(1)
13723 CALL mp_timeset(routinen, handle)
13725#if defined(__parallel)
13726#if !defined(__GNUC__) || __GNUC__ >= 9
13727 cpassert(is_contiguous(msgout))
13731 IF (
PRESENT(tag)) my_tag = tag
13733 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
13734 IF (msglen > 0)
THEN
13735 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_integer8, source, my_tag, &
13736 comm%handle, request%handle, ierr)
13738 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13739 comm%handle, request%handle, ierr)
13741 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
13743 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13750 cpabort(
"mp_irecv called in non parallel case")
13752 CALL mp_timestop(handle)
13753 END SUBROUTINE mp_irecv_lm3
13769 SUBROUTINE mp_irecv_lm4(msgout, source, comm, request, tag)
13770 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
13771 INTEGER,
INTENT(IN) :: source
13774 INTEGER,
INTENT(in),
OPTIONAL :: tag
13776 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm4'
13779#if defined(__parallel)
13780 INTEGER :: ierr, msglen, my_tag
13781 INTEGER(KIND=int_8) :: foo(1)
13784 CALL mp_timeset(routinen, handle)
13786#if defined(__parallel)
13787#if !defined(__GNUC__) || __GNUC__ >= 9
13788 cpassert(is_contiguous(msgout))
13792 IF (
PRESENT(tag)) my_tag = tag
13794 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
13795 IF (msglen > 0)
THEN
13796 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_integer8, source, my_tag, &
13797 comm%handle, request%handle, ierr)
13799 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13800 comm%handle, request%handle, ierr)
13802 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
13804 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13811 cpabort(
"mp_irecv called in non parallel case")
13813 CALL mp_timestop(handle)
13814 END SUBROUTINE mp_irecv_lm4
13826 SUBROUTINE mp_win_create_lv(base, comm, win)
13827 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
13831 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_lv'
13834#if defined(__parallel)
13836 INTEGER(kind=mpi_address_kind) :: len
13837 INTEGER(KIND=int_8) :: foo(1)
13840 CALL mp_timeset(routinen, handle)
13842#if defined(__parallel)
13844 len =
SIZE(base)*int_8_size
13846 CALL mpi_win_create(base(1), len, int_8_size, mpi_info_null, comm%handle, win%handle, ierr)
13848 CALL mpi_win_create(foo, len, int_8_size, mpi_info_null, comm%handle, win%handle, ierr)
13850 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
13852 CALL add_perf(perf_id=20, count=1)
13856 win%handle = mp_win_null_handle
13858 CALL mp_timestop(handle)
13859 END SUBROUTINE mp_win_create_lv
13871 SUBROUTINE mp_rget_lv(base, source, win, win_data, myproc, disp, request, &
13872 origin_datatype, target_datatype)
13873 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
13874 INTEGER,
INTENT(IN) :: source
13876 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: win_data
13877 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
13881 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_lv'
13884#if defined(__parallel)
13885 INTEGER :: ierr, len, &
13886 origin_len, target_len
13887 LOGICAL :: do_local_copy
13888 INTEGER(kind=mpi_address_kind) :: disp_aint
13889 mpi_data_type :: handle_origin_datatype, handle_target_datatype
13892 CALL mp_timeset(routinen, handle)
13894#if defined(__parallel)
13897 IF (
PRESENT(disp))
THEN
13898 disp_aint = int(disp, kind=mpi_address_kind)
13900 handle_origin_datatype = mpi_integer8
13902 IF (
PRESENT(origin_datatype))
THEN
13903 handle_origin_datatype = origin_datatype%type_handle
13906 handle_target_datatype = mpi_integer8
13908 IF (
PRESENT(target_datatype))
THEN
13909 handle_target_datatype = target_datatype%type_handle
13913 do_local_copy = .false.
13914 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
13915 IF (myproc .EQ. source) do_local_copy = .true.
13917 IF (do_local_copy)
THEN
13919 base(:) = win_data(disp_aint + 1:disp_aint + len)
13924 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
13925 target_len, handle_target_datatype, win%handle, request%handle, ierr)
13931 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
13933 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*int_8_size)
13938 mark_used(origin_datatype)
13939 mark_used(target_datatype)
13943 IF (
PRESENT(disp))
THEN
13944 base(:) = win_data(disp + 1:disp +
SIZE(base))
13946 base(:) = win_data(:
SIZE(base))
13950 CALL mp_timestop(handle)
13951 END SUBROUTINE mp_rget_lv
13960 FUNCTION mp_type_indexed_make_l (count, lengths, displs) &
13961 result(type_descriptor)
13962 INTEGER,
INTENT(IN) :: count
13963 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
13966 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_l'
13969#if defined(__parallel)
13973 CALL mp_timeset(routinen, handle)
13975#if defined(__parallel)
13976 CALL mpi_type_indexed(count, lengths, displs, mpi_integer8, &
13977 type_descriptor%type_handle, ierr)
13979 cpabort(
"MPI_Type_Indexed @ "//routinen)
13980 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
13982 cpabort(
"MPI_Type_commit @ "//routinen)
13984 type_descriptor%type_handle = 19
13986 type_descriptor%length = count
13987 NULLIFY (type_descriptor%subtype)
13988 type_descriptor%vector_descriptor(1:2) = 1
13989 type_descriptor%has_indexing = .true.
13990 type_descriptor%index_descriptor%index => lengths
13991 type_descriptor%index_descriptor%chunks => displs
13993 CALL mp_timestop(handle)
13995 END FUNCTION mp_type_indexed_make_l
14004 SUBROUTINE mp_allocate_l (DATA, len, stat)
14005 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
14006 INTEGER,
INTENT(IN) :: len
14007 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14009 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_l'
14011 INTEGER :: handle, ierr
14013 CALL mp_timeset(routinen, handle)
14015#if defined(__parallel)
14017 CALL mp_alloc_mem(
DATA, len, stat=ierr)
14018 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
14019 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
14020 CALL add_perf(perf_id=15, count=1)
14022 ALLOCATE (
DATA(len), stat=ierr)
14023 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
14024 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
14026 IF (
PRESENT(stat)) stat = ierr
14027 CALL mp_timestop(handle)
14028 END SUBROUTINE mp_allocate_l
14036 SUBROUTINE mp_deallocate_l (DATA, stat)
14037 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
14038 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14040 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_l'
14043#if defined(__parallel)
14047 CALL mp_timeset(routinen, handle)
14049#if defined(__parallel)
14050 CALL mp_free_mem(
DATA, ierr)
14051 IF (
PRESENT(stat))
THEN
14054 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
14057 CALL add_perf(perf_id=15, count=1)
14060 IF (
PRESENT(stat)) stat = 0
14062 CALL mp_timestop(handle)
14063 END SUBROUTINE mp_deallocate_l
14076 SUBROUTINE mp_file_write_at_lv(fh, offset, msg, msglen)
14077 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
14079 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14080 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14083#if defined(__parallel)
14087 msg_len =
SIZE(msg)
14088 IF (
PRESENT(msglen)) msg_len = msglen
14089#if defined(__parallel)
14090 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14092 cpabort(
"mpi_file_write_at_lv @ mp_file_write_at_lv")
14094 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14096 END SUBROUTINE mp_file_write_at_lv
14104 SUBROUTINE mp_file_write_at_l (fh, offset, msg)
14105 INTEGER(KIND=int_8),
INTENT(IN) :: msg
14107 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14109#if defined(__parallel)
14113 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14115 cpabort(
"mpi_file_write_at_l @ mp_file_write_at_l")
14117 WRITE (unit=fh%handle, pos=offset + 1) msg
14119 END SUBROUTINE mp_file_write_at_l
14131 SUBROUTINE mp_file_write_at_all_lv(fh, offset, msg, msglen)
14132 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
14134 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14135 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14138#if defined(__parallel)
14142 msg_len =
SIZE(msg)
14143 IF (
PRESENT(msglen)) msg_len = msglen
14144#if defined(__parallel)
14145 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14147 cpabort(
"mpi_file_write_at_all_lv @ mp_file_write_at_all_lv")
14149 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14151 END SUBROUTINE mp_file_write_at_all_lv
14159 SUBROUTINE mp_file_write_at_all_l (fh, offset, msg)
14160 INTEGER(KIND=int_8),
INTENT(IN) :: msg
14162 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14164#if defined(__parallel)
14168 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14170 cpabort(
"mpi_file_write_at_all_l @ mp_file_write_at_all_l")
14172 WRITE (unit=fh%handle, pos=offset + 1) msg
14174 END SUBROUTINE mp_file_write_at_all_l
14187 SUBROUTINE mp_file_read_at_lv(fh, offset, msg, msglen)
14188 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
14190 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14191 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14194#if defined(__parallel)
14198 msg_len =
SIZE(msg)
14199 IF (
PRESENT(msglen)) msg_len = msglen
14200#if defined(__parallel)
14201 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14203 cpabort(
"mpi_file_read_at_lv @ mp_file_read_at_lv")
14205 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14207 END SUBROUTINE mp_file_read_at_lv
14215 SUBROUTINE mp_file_read_at_l (fh, offset, msg)
14216 INTEGER(KIND=int_8),
INTENT(OUT) :: msg
14218 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14220#if defined(__parallel)
14224 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14226 cpabort(
"mpi_file_read_at_l @ mp_file_read_at_l")
14228 READ (unit=fh%handle, pos=offset + 1) msg
14230 END SUBROUTINE mp_file_read_at_l
14242 SUBROUTINE mp_file_read_at_all_lv(fh, offset, msg, msglen)
14243 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
14245 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14246 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14249#if defined(__parallel)
14253 msg_len =
SIZE(msg)
14254 IF (
PRESENT(msglen)) msg_len = msglen
14255#if defined(__parallel)
14256 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14258 cpabort(
"mpi_file_read_at_all_lv @ mp_file_read_at_all_lv")
14260 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14262 END SUBROUTINE mp_file_read_at_all_lv
14270 SUBROUTINE mp_file_read_at_all_l (fh, offset, msg)
14271 INTEGER(KIND=int_8),
INTENT(OUT) :: msg
14273 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14275#if defined(__parallel)
14279 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14281 cpabort(
"mpi_file_read_at_all_l @ mp_file_read_at_all_l")
14283 READ (unit=fh%handle, pos=offset + 1) msg
14285 END SUBROUTINE mp_file_read_at_all_l
14294 FUNCTION mp_type_make_l (ptr, &
14295 vector_descriptor, index_descriptor) &
14296 result(type_descriptor)
14297 INTEGER(KIND=int_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
14298 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
14299 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
14302 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_l'
14304#if defined(__parallel)
14308 NULLIFY (type_descriptor%subtype)
14309 type_descriptor%length =
SIZE(ptr)
14310#if defined(__parallel)
14311 type_descriptor%type_handle = mpi_integer8
14312 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
14314 cpabort(
"MPI_Get_address @ "//routinen)
14316 type_descriptor%type_handle = 19
14318 type_descriptor%vector_descriptor(1:2) = 1
14319 type_descriptor%has_indexing = .false.
14320 type_descriptor%data_l => ptr
14321 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
14322 cpabort(routinen//
": Vectors and indices NYI")
14324 END FUNCTION mp_type_make_l
14333 SUBROUTINE mp_alloc_mem_l (DATA, len, stat)
14334 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
14335 INTEGER,
INTENT(IN) :: len
14336 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14338#if defined(__parallel)
14339 INTEGER :: size, ierr, length, &
14341 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
14342 TYPE(c_ptr) :: mp_baseptr
14343 mpi_info_type :: mp_info
14345 length = max(len, 1)
14346 CALL mpi_type_size(mpi_integer8,
size, ierr)
14347 mp_size = int(length, kind=mpi_address_kind)*
size
14348 IF (mp_size .GT. mp_max_memory_size)
THEN
14349 cpabort(
"MPI cannot allocate more than 2 GiByte")
14351 mp_info = mpi_info_null
14352 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
14353 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
14354 IF (
PRESENT(stat)) stat = mp_res
14356 INTEGER :: length, mystat
14357 length = max(len, 1)
14358 IF (
PRESENT(stat))
THEN
14359 ALLOCATE (
DATA(length), stat=mystat)
14362 ALLOCATE (
DATA(length))
14365 END SUBROUTINE mp_alloc_mem_l
14373 SUBROUTINE mp_free_mem_l (DATA, stat)
14374 INTEGER(KIND=int_8),
DIMENSION(:), &
14375 POINTER, asynchronous :: data
14376 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14378#if defined(__parallel)
14380 CALL mpi_free_mem(
DATA, mp_res)
14381 IF (
PRESENT(stat)) stat = mp_res
14384 IF (
PRESENT(stat)) stat = 0
14386 END SUBROUTINE mp_free_mem_l
14398 SUBROUTINE mp_shift_dm(msg, comm, displ_in)
14400 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
14402 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
14404 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_dm'
14406 INTEGER :: handle, ierror
14407#if defined(__parallel)
14408 INTEGER :: displ, left, &
14409 msglen, myrank, nprocs, &
14414 CALL mp_timeset(routinen, handle)
14416#if defined(__parallel)
14417 CALL mpi_comm_rank(comm%handle, myrank, ierror)
14418 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
14419 CALL mpi_comm_size(comm%handle, nprocs, ierror)
14420 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
14421 IF (
PRESENT(displ_in))
THEN
14426 right =
modulo(myrank + displ, nprocs)
14427 left =
modulo(myrank - displ, nprocs)
14430 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_precision, right, tag, left, tag, &
14431 comm%handle, mpi_status_ignore, ierror)
14432 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
14433 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_8_size)
14437 mark_used(displ_in)
14439 CALL mp_timestop(handle)
14441 END SUBROUTINE mp_shift_dm
14454 SUBROUTINE mp_shift_d (msg, comm, displ_in)
14456 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
14458 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
14460 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_d'
14462 INTEGER :: handle, ierror
14463#if defined(__parallel)
14464 INTEGER :: displ, left, &
14465 msglen, myrank, nprocs, &
14470 CALL mp_timeset(routinen, handle)
14472#if defined(__parallel)
14473 CALL mpi_comm_rank(comm%handle, myrank, ierror)
14474 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
14475 CALL mpi_comm_size(comm%handle, nprocs, ierror)
14476 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
14477 IF (
PRESENT(displ_in))
THEN
14482 right =
modulo(myrank + displ, nprocs)
14483 left =
modulo(myrank - displ, nprocs)
14486 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_precision, right, tag, left, &
14487 tag, comm%handle, mpi_status_ignore, ierror)
14488 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
14489 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_8_size)
14493 mark_used(displ_in)
14495 CALL mp_timestop(handle)
14497 END SUBROUTINE mp_shift_d
14518 SUBROUTINE mp_alltoall_d11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
14520 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
14521 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
14522 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
14523 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
14526 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d11v'
14529#if defined(__parallel)
14530 INTEGER :: ierr, msglen
14535 CALL mp_timeset(routinen, handle)
14537#if defined(__parallel)
14538 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_precision, &
14539 rb, rcount, rdispl, mpi_double_precision, comm%handle, ierr)
14540 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
14541 msglen = sum(scount) + sum(rcount)
14542 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14548 DO i = 1, rcount(1)
14549 rb(rdispl(1) + i) = sb(sdispl(1) + i)
14552 CALL mp_timestop(handle)
14554 END SUBROUTINE mp_alltoall_d11v
14569 SUBROUTINE mp_alltoall_d22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
14571 REAL(kind=real_8),
DIMENSION(:, :), &
14572 INTENT(IN),
CONTIGUOUS :: sb
14573 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
14574 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS, &
14575 INTENT(INOUT) :: rb
14576 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
14579 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d22v'
14582#if defined(__parallel)
14583 INTEGER :: ierr, msglen
14586 CALL mp_timeset(routinen, handle)
14588#if defined(__parallel)
14589 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_precision, &
14590 rb, rcount, rdispl, mpi_double_precision, comm%handle, ierr)
14591 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
14592 msglen = sum(scount) + sum(rcount)
14593 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*real_8_size)
14602 CALL mp_timestop(handle)
14604 END SUBROUTINE mp_alltoall_d22v
14621 SUBROUTINE mp_alltoall_d (sb, rb, count, comm)
14623 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
14624 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
14625 INTEGER,
INTENT(IN) :: count
14628 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d'
14631#if defined(__parallel)
14632 INTEGER :: ierr, msglen, np
14635 CALL mp_timeset(routinen, handle)
14637#if defined(__parallel)
14638 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14639 rb, count, mpi_double_precision, comm%handle, ierr)
14640 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14641 CALL mpi_comm_size(comm%handle, np, ierr)
14642 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14643 msglen = 2*count*np
14644 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14650 CALL mp_timestop(handle)
14652 END SUBROUTINE mp_alltoall_d
14662 SUBROUTINE mp_alltoall_d22(sb, rb, count, comm)
14664 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
14665 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
14666 INTEGER,
INTENT(IN) :: count
14669 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d22'
14672#if defined(__parallel)
14673 INTEGER :: ierr, msglen, np
14676 CALL mp_timeset(routinen, handle)
14678#if defined(__parallel)
14679 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14680 rb, count, mpi_double_precision, comm%handle, ierr)
14681 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14682 CALL mpi_comm_size(comm%handle, np, ierr)
14683 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14684 msglen = 2*
SIZE(sb)*np
14685 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14691 CALL mp_timestop(handle)
14693 END SUBROUTINE mp_alltoall_d22
14703 SUBROUTINE mp_alltoall_d33(sb, rb, count, comm)
14705 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
14706 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
14707 INTEGER,
INTENT(IN) :: count
14710 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d33'
14713#if defined(__parallel)
14714 INTEGER :: ierr, msglen, np
14717 CALL mp_timeset(routinen, handle)
14719#if defined(__parallel)
14720 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14721 rb, count, mpi_double_precision, comm%handle, ierr)
14722 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14723 CALL mpi_comm_size(comm%handle, np, ierr)
14724 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14725 msglen = 2*count*np
14726 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14732 CALL mp_timestop(handle)
14734 END SUBROUTINE mp_alltoall_d33
14744 SUBROUTINE mp_alltoall_d44(sb, rb, count, comm)
14746 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14748 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14750 INTEGER,
INTENT(IN) :: count
14753 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d44'
14756#if defined(__parallel)
14757 INTEGER :: ierr, msglen, np
14760 CALL mp_timeset(routinen, handle)
14762#if defined(__parallel)
14763 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14764 rb, count, mpi_double_precision, comm%handle, ierr)
14765 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14766 CALL mpi_comm_size(comm%handle, np, ierr)
14767 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14768 msglen = 2*count*np
14769 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14775 CALL mp_timestop(handle)
14777 END SUBROUTINE mp_alltoall_d44
14787 SUBROUTINE mp_alltoall_d55(sb, rb, count, comm)
14789 REAL(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
14791 REAL(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
14793 INTEGER,
INTENT(IN) :: count
14796 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d55'
14799#if defined(__parallel)
14800 INTEGER :: ierr, msglen, np
14803 CALL mp_timeset(routinen, handle)
14805#if defined(__parallel)
14806 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14807 rb, count, mpi_double_precision, comm%handle, ierr)
14808 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14809 CALL mpi_comm_size(comm%handle, np, ierr)
14810 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14811 msglen = 2*count*np
14812 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14818 CALL mp_timestop(handle)
14820 END SUBROUTINE mp_alltoall_d55
14831 SUBROUTINE mp_alltoall_d45(sb, rb, count, comm)
14833 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14835 REAL(kind=real_8), &
14836 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
14837 INTEGER,
INTENT(IN) :: count
14840 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d45'
14843#if defined(__parallel)
14844 INTEGER :: ierr, msglen, np
14847 CALL mp_timeset(routinen, handle)
14849#if defined(__parallel)
14850 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14851 rb, count, mpi_double_precision, comm%handle, ierr)
14852 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14853 CALL mpi_comm_size(comm%handle, np, ierr)
14854 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14855 msglen = 2*count*np
14856 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14860 rb = reshape(sb, shape(rb))
14862 CALL mp_timestop(handle)
14864 END SUBROUTINE mp_alltoall_d45
14875 SUBROUTINE mp_alltoall_d34(sb, rb, count, comm)
14877 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
14879 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14881 INTEGER,
INTENT(IN) :: count
14884 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d34'
14887#if defined(__parallel)
14888 INTEGER :: ierr, msglen, np
14891 CALL mp_timeset(routinen, handle)
14893#if defined(__parallel)
14894 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14895 rb, count, mpi_double_precision, comm%handle, ierr)
14896 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14897 CALL mpi_comm_size(comm%handle, np, ierr)
14898 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14899 msglen = 2*count*np
14900 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14904 rb = reshape(sb, shape(rb))
14906 CALL mp_timestop(handle)
14908 END SUBROUTINE mp_alltoall_d34
14919 SUBROUTINE mp_alltoall_d54(sb, rb, count, comm)
14921 REAL(kind=real_8), &
14922 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
14923 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14925 INTEGER,
INTENT(IN) :: count
14928 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d54'
14931#if defined(__parallel)
14932 INTEGER :: ierr, msglen, np
14935 CALL mp_timeset(routinen, handle)
14937#if defined(__parallel)
14938 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14939 rb, count, mpi_double_precision, comm%handle, ierr)
14940 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14941 CALL mpi_comm_size(comm%handle, np, ierr)
14942 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14943 msglen = 2*count*np
14944 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14948 rb = reshape(sb, shape(rb))
14950 CALL mp_timestop(handle)
14952 END SUBROUTINE mp_alltoall_d54
14963 SUBROUTINE mp_send_d (msg, dest, tag, comm)
14964 REAL(kind=real_8),
INTENT(IN) :: msg
14965 INTEGER,
INTENT(IN) :: dest, tag
14968 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_d'
14971#if defined(__parallel)
14972 INTEGER :: ierr, msglen
14975 CALL mp_timeset(routinen, handle)
14977#if defined(__parallel)
14979 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
14980 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
14981 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
14988 cpabort(
"not in parallel mode")
14990 CALL mp_timestop(handle)
14991 END SUBROUTINE mp_send_d
15001 SUBROUTINE mp_send_dv(msg, dest, tag, comm)
15002 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
15003 INTEGER,
INTENT(IN) :: dest, tag
15006 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_dv'
15009#if defined(__parallel)
15010 INTEGER :: ierr, msglen
15013 CALL mp_timeset(routinen, handle)
15015#if defined(__parallel)
15017 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15018 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15019 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15026 cpabort(
"not in parallel mode")
15028 CALL mp_timestop(handle)
15029 END SUBROUTINE mp_send_dv
15039 SUBROUTINE mp_send_dm2(msg, dest, tag, comm)
15040 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
15041 INTEGER,
INTENT(IN) :: dest, tag
15044 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_dm2'
15047#if defined(__parallel)
15048 INTEGER :: ierr, msglen
15051 CALL mp_timeset(routinen, handle)
15053#if defined(__parallel)
15055 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15056 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15057 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15064 cpabort(
"not in parallel mode")
15066 CALL mp_timestop(handle)
15067 END SUBROUTINE mp_send_dm2
15077 SUBROUTINE mp_send_dm3(msg, dest, tag, comm)
15078 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
15079 INTEGER,
INTENT(IN) :: dest, tag
15082 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
15085#if defined(__parallel)
15086 INTEGER :: ierr, msglen
15089 CALL mp_timeset(routinen, handle)
15091#if defined(__parallel)
15093 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15094 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15095 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15102 cpabort(
"not in parallel mode")
15104 CALL mp_timestop(handle)
15105 END SUBROUTINE mp_send_dm3
15116 SUBROUTINE mp_recv_d (msg, source, tag, comm)
15117 REAL(kind=real_8),
INTENT(INOUT) :: msg
15118 INTEGER,
INTENT(INOUT) :: source, tag
15121 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_d'
15124#if defined(__parallel)
15125 INTEGER :: ierr, msglen
15126 mpi_status_type :: status
15129 CALL mp_timeset(routinen, handle)
15131#if defined(__parallel)
15134 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15135 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15137 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15138 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15139 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15140 source = status mpi_status_extract(mpi_source)
15141 tag = status mpi_status_extract(mpi_tag)
15149 cpabort(
"not in parallel mode")
15151 CALL mp_timestop(handle)
15152 END SUBROUTINE mp_recv_d
15162 SUBROUTINE mp_recv_dv(msg, source, tag, comm)
15163 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15164 INTEGER,
INTENT(INOUT) :: source, tag
15167 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dv'
15170#if defined(__parallel)
15171 INTEGER :: ierr, msglen
15172 mpi_status_type :: status
15175 CALL mp_timeset(routinen, handle)
15177#if defined(__parallel)
15180 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15181 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15183 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15184 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15185 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15186 source = status mpi_status_extract(mpi_source)
15187 tag = status mpi_status_extract(mpi_tag)
15195 cpabort(
"not in parallel mode")
15197 CALL mp_timestop(handle)
15198 END SUBROUTINE mp_recv_dv
15208 SUBROUTINE mp_recv_dm2(msg, source, tag, comm)
15209 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15210 INTEGER,
INTENT(INOUT) :: source, tag
15213 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dm2'
15216#if defined(__parallel)
15217 INTEGER :: ierr, msglen
15218 mpi_status_type :: status
15221 CALL mp_timeset(routinen, handle)
15223#if defined(__parallel)
15226 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15227 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15229 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15230 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15231 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15232 source = status mpi_status_extract(mpi_source)
15233 tag = status mpi_status_extract(mpi_tag)
15241 cpabort(
"not in parallel mode")
15243 CALL mp_timestop(handle)
15244 END SUBROUTINE mp_recv_dm2
15254 SUBROUTINE mp_recv_dm3(msg, source, tag, comm)
15255 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
15256 INTEGER,
INTENT(INOUT) :: source, tag
15259 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dm3'
15262#if defined(__parallel)
15263 INTEGER :: ierr, msglen
15264 mpi_status_type :: status
15267 CALL mp_timeset(routinen, handle)
15269#if defined(__parallel)
15272 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15273 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15275 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15276 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15277 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15278 source = status mpi_status_extract(mpi_source)
15279 tag = status mpi_status_extract(mpi_tag)
15287 cpabort(
"not in parallel mode")
15289 CALL mp_timestop(handle)
15290 END SUBROUTINE mp_recv_dm3
15300 SUBROUTINE mp_bcast_d (msg, source, comm)
15301 REAL(kind=real_8),
INTENT(INOUT) :: msg
15302 INTEGER,
INTENT(IN) :: source
15305 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d'
15308#if defined(__parallel)
15309 INTEGER :: ierr, msglen
15312 CALL mp_timeset(routinen, handle)
15314#if defined(__parallel)
15316 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15317 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15318 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15324 CALL mp_timestop(handle)
15325 END SUBROUTINE mp_bcast_d
15334 SUBROUTINE mp_bcast_d_src(msg, comm)
15335 REAL(kind=real_8),
INTENT(INOUT) :: msg
15338 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d_src'
15341#if defined(__parallel)
15342 INTEGER :: ierr, msglen
15345 CALL mp_timeset(routinen, handle)
15347#if defined(__parallel)
15349 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15350 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15351 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15356 CALL mp_timestop(handle)
15357 END SUBROUTINE mp_bcast_d_src
15367 SUBROUTINE mp_ibcast_d (msg, source, comm, request)
15368 REAL(kind=real_8),
INTENT(INOUT) :: msg
15369 INTEGER,
INTENT(IN) :: source
15373 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_d'
15376#if defined(__parallel)
15377 INTEGER :: ierr, msglen
15380 CALL mp_timeset(routinen, handle)
15382#if defined(__parallel)
15384 CALL mpi_ibcast(msg, msglen, mpi_double_precision, source, comm%handle, request%handle, ierr)
15385 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
15386 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_8_size)
15393 CALL mp_timestop(handle)
15394 END SUBROUTINE mp_ibcast_d
15403 SUBROUTINE mp_bcast_dv(msg, source, comm)
15404 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15405 INTEGER,
INTENT(IN) :: source
15408 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dv'
15411#if defined(__parallel)
15412 INTEGER :: ierr, msglen
15415 CALL mp_timeset(routinen, handle)
15417#if defined(__parallel)
15419 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15420 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15421 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15427 CALL mp_timestop(handle)
15428 END SUBROUTINE mp_bcast_dv
15436 SUBROUTINE mp_bcast_dv_src(msg, comm)
15437 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15440 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dv_src'
15443#if defined(__parallel)
15444 INTEGER :: ierr, msglen
15447 CALL mp_timeset(routinen, handle)
15449#if defined(__parallel)
15451 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15452 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15453 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15458 CALL mp_timestop(handle)
15459 END SUBROUTINE mp_bcast_dv_src
15468 SUBROUTINE mp_ibcast_dv(msg, source, comm, request)
15469 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
15470 INTEGER,
INTENT(IN) :: source
15474 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_dv'
15477#if defined(__parallel)
15478 INTEGER :: ierr, msglen
15481 CALL mp_timeset(routinen, handle)
15483#if defined(__parallel)
15484#if !defined(__GNUC__) || __GNUC__ >= 9
15485 cpassert(is_contiguous(msg))
15488 CALL mpi_ibcast(msg, msglen, mpi_double_precision, source, comm%handle, request%handle, ierr)
15489 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
15490 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_8_size)
15497 CALL mp_timestop(handle)
15498 END SUBROUTINE mp_ibcast_dv
15507 SUBROUTINE mp_bcast_dm(msg, source, comm)
15508 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15509 INTEGER,
INTENT(IN) :: source
15512 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dm'
15515#if defined(__parallel)
15516 INTEGER :: ierr, msglen
15519 CALL mp_timeset(routinen, handle)
15521#if defined(__parallel)
15523 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15524 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15525 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15531 CALL mp_timestop(handle)
15532 END SUBROUTINE mp_bcast_dm
15541 SUBROUTINE mp_bcast_dm_src(msg, comm)
15542 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15545 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dm_src'
15548#if defined(__parallel)
15549 INTEGER :: ierr, msglen
15552 CALL mp_timeset(routinen, handle)
15554#if defined(__parallel)
15556 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15557 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15558 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15563 CALL mp_timestop(handle)
15564 END SUBROUTINE mp_bcast_dm_src
15573 SUBROUTINE mp_bcast_d3(msg, source, comm)
15574 REAL(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
15575 INTEGER,
INTENT(IN) :: source
15578 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d3'
15581#if defined(__parallel)
15582 INTEGER :: ierr, msglen
15585 CALL mp_timeset(routinen, handle)
15587#if defined(__parallel)
15589 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15590 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15591 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15597 CALL mp_timestop(handle)
15598 END SUBROUTINE mp_bcast_d3
15607 SUBROUTINE mp_bcast_d3_src(msg, comm)
15608 REAL(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
15611 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d3_src'
15614#if defined(__parallel)
15615 INTEGER :: ierr, msglen
15618 CALL mp_timeset(routinen, handle)
15620#if defined(__parallel)
15622 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15623 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15624 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15629 CALL mp_timestop(handle)
15630 END SUBROUTINE mp_bcast_d3_src
15639 SUBROUTINE mp_sum_d (msg, comm)
15640 REAL(kind=real_8),
INTENT(INOUT) :: msg
15643 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_d'
15646#if defined(__parallel)
15647 INTEGER :: ierr, msglen
15650 CALL mp_timeset(routinen, handle)
15652#if defined(__parallel)
15654 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15655 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15656 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15661 CALL mp_timestop(handle)
15662 END SUBROUTINE mp_sum_d
15670 SUBROUTINE mp_sum_dv(msg, comm)
15671 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15674 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dv'
15677#if defined(__parallel)
15678 INTEGER :: ierr, msglen
15681 CALL mp_timeset(routinen, handle)
15683#if defined(__parallel)
15685 IF (msglen > 0)
THEN
15686 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15687 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15689 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15694 CALL mp_timestop(handle)
15695 END SUBROUTINE mp_sum_dv
15703 SUBROUTINE mp_isum_dv(msg, comm, request)
15704 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
15708 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_dv'
15711#if defined(__parallel)
15712 INTEGER :: ierr, msglen
15715 CALL mp_timeset(routinen, handle)
15717#if defined(__parallel)
15718#if !defined(__GNUC__) || __GNUC__ >= 9
15719 cpassert(is_contiguous(msg))
15722 IF (msglen > 0)
THEN
15723 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, request%handle, ierr)
15724 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
15728 CALL add_perf(perf_id=23, count=1, msg_size=msglen*real_8_size)
15734 CALL mp_timestop(handle)
15735 END SUBROUTINE mp_isum_dv
15743 SUBROUTINE mp_sum_dm(msg, comm)
15744 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15747 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm'
15750#if defined(__parallel)
15751 INTEGER,
PARAMETER :: max_msg = 2**25
15752 INTEGER :: ierr, m1, msglen, step, msglensum
15755 CALL mp_timeset(routinen, handle)
15757#if defined(__parallel)
15759 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
15761 DO m1 = lbound(msg, 2), ubound(msg, 2), step
15762 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
15763 msglensum = msglensum + msglen
15764 IF (msglen > 0)
THEN
15765 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15766 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15769 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_8_size)
15774 CALL mp_timestop(handle)
15775 END SUBROUTINE mp_sum_dm
15783 SUBROUTINE mp_sum_dm3(msg, comm)
15784 REAL(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
15787 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm3'
15790#if defined(__parallel)
15791 INTEGER :: ierr, msglen
15794 CALL mp_timeset(routinen, handle)
15796#if defined(__parallel)
15798 IF (msglen > 0)
THEN
15799 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15800 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15802 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15807 CALL mp_timestop(handle)
15808 END SUBROUTINE mp_sum_dm3
15816 SUBROUTINE mp_sum_dm4(msg, comm)
15817 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
15820 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm4'
15823#if defined(__parallel)
15824 INTEGER :: ierr, msglen
15827 CALL mp_timeset(routinen, handle)
15829#if defined(__parallel)
15831 IF (msglen > 0)
THEN
15832 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15833 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15835 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15840 CALL mp_timestop(handle)
15841 END SUBROUTINE mp_sum_dm4
15853 SUBROUTINE mp_sum_root_dv(msg, root, comm)
15854 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15855 INTEGER,
INTENT(IN) :: root
15858 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_dv'
15861#if defined(__parallel)
15862 INTEGER :: ierr, m1, msglen, taskid
15863 REAL(kind=real_8),
ALLOCATABLE :: res(:)
15866 CALL mp_timeset(routinen, handle)
15868#if defined(__parallel)
15870 CALL mpi_comm_rank(comm%handle, taskid, ierr)
15871 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
15872 IF (msglen > 0)
THEN
15875 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_sum, &
15876 root, comm%handle, ierr)
15877 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
15878 IF (taskid == root)
THEN
15883 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15889 CALL mp_timestop(handle)
15890 END SUBROUTINE mp_sum_root_dv
15901 SUBROUTINE mp_sum_root_dm(msg, root, comm)
15902 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15903 INTEGER,
INTENT(IN) :: root
15906 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
15909#if defined(__parallel)
15910 INTEGER :: ierr, m1, m2, msglen, taskid
15911 REAL(kind=real_8),
ALLOCATABLE :: res(:, :)
15914 CALL mp_timeset(routinen, handle)
15916#if defined(__parallel)
15918 CALL mpi_comm_rank(comm%handle, taskid, ierr)
15919 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
15920 IF (msglen > 0)
THEN
15923 ALLOCATE (res(m1, m2))
15924 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_sum, root, comm%handle, ierr)
15925 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
15926 IF (taskid == root)
THEN
15931 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15937 CALL mp_timestop(handle)
15938 END SUBROUTINE mp_sum_root_dm
15946 SUBROUTINE mp_sum_partial_dm(msg, res, comm)
15947 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
15948 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
15951 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_dm'
15954#if defined(__parallel)
15955 INTEGER :: ierr, msglen, taskid
15958 CALL mp_timeset(routinen, handle)
15960#if defined(__parallel)
15962 CALL mpi_comm_rank(comm%handle, taskid, ierr)
15963 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
15964 IF (msglen > 0)
THEN
15965 CALL mpi_scan(msg, res, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15966 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
15968 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15974 CALL mp_timestop(handle)
15975 END SUBROUTINE mp_sum_partial_dm
15985 SUBROUTINE mp_max_d (msg, comm)
15986 REAL(kind=real_8),
INTENT(INOUT) :: msg
15989 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_d'
15992#if defined(__parallel)
15993 INTEGER :: ierr, msglen
15996 CALL mp_timeset(routinen, handle)
15998#if defined(__parallel)
16000 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_max, comm%handle, ierr)
16001 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16002 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16007 CALL mp_timestop(handle)
16008 END SUBROUTINE mp_max_d
16018 SUBROUTINE mp_max_root_d (msg, root, comm)
16019 REAL(kind=real_8),
INTENT(INOUT) :: msg
16020 INTEGER,
INTENT(IN) :: root
16023 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_d'
16026#if defined(__parallel)
16027 INTEGER :: ierr, msglen
16028 REAL(kind=real_8) :: res
16031 CALL mp_timeset(routinen, handle)
16033#if defined(__parallel)
16035 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_max, root, comm%handle, ierr)
16036 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
16037 IF (root == comm%mepos) msg = res
16038 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16044 CALL mp_timestop(handle)
16045 END SUBROUTINE mp_max_root_d
16055 SUBROUTINE mp_max_dv(msg, comm)
16056 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
16059 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_dv'
16062#if defined(__parallel)
16063 INTEGER :: ierr, msglen
16066 CALL mp_timeset(routinen, handle)
16068#if defined(__parallel)
16070 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_max, comm%handle, ierr)
16071 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16072 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16077 CALL mp_timestop(handle)
16078 END SUBROUTINE mp_max_dv
16088 SUBROUTINE mp_max_root_dm(msg, root, comm)
16089 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
16093 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_dm'
16096#if defined(__parallel)
16097 INTEGER :: ierr, msglen
16098 REAL(kind=real_8) :: res(
SIZE(msg, 1),
SIZE(msg, 2))
16101 CALL mp_timeset(routinen, handle)
16103#if defined(__parallel)
16105 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_max, root, comm%handle, ierr)
16106 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16107 IF (root == comm%mepos) msg = res
16108 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16114 CALL mp_timestop(handle)
16115 END SUBROUTINE mp_max_root_dm
16125 SUBROUTINE mp_min_d (msg, comm)
16126 REAL(kind=real_8),
INTENT(INOUT) :: msg
16129 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_d'
16132#if defined(__parallel)
16133 INTEGER :: ierr, msglen
16136 CALL mp_timeset(routinen, handle)
16138#if defined(__parallel)
16140 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_min, comm%handle, ierr)
16141 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16142 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16147 CALL mp_timestop(handle)
16148 END SUBROUTINE mp_min_d
16160 SUBROUTINE mp_min_dv(msg, comm)
16161 REAL(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
16164 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_dv'
16167#if defined(__parallel)
16168 INTEGER :: ierr, msglen
16171 CALL mp_timeset(routinen, handle)
16173#if defined(__parallel)
16175 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_min, comm%handle, ierr)
16176 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16177 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16182 CALL mp_timestop(handle)
16183 END SUBROUTINE mp_min_dv
16193 SUBROUTINE mp_prod_d (msg, comm)
16194 REAL(kind=real_8),
INTENT(INOUT) :: msg
16197 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_d'
16200#if defined(__parallel)
16201 INTEGER :: ierr, msglen
16204 CALL mp_timeset(routinen, handle)
16206#if defined(__parallel)
16208 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_prod, comm%handle, ierr)
16209 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16210 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16215 CALL mp_timestop(handle)
16216 END SUBROUTINE mp_prod_d
16227 SUBROUTINE mp_scatter_dv(msg_scatter, msg, root, comm)
16228 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
16229 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
16230 INTEGER,
INTENT(IN) :: root
16233 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_dv'
16236#if defined(__parallel)
16237 INTEGER :: ierr, msglen
16240 CALL mp_timeset(routinen, handle)
16242#if defined(__parallel)
16244 CALL mpi_scatter(msg_scatter, msglen, mpi_double_precision, msg, &
16245 msglen, mpi_double_precision, root, comm%handle, ierr)
16246 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
16247 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16253 CALL mp_timestop(handle)
16254 END SUBROUTINE mp_scatter_dv
16264 SUBROUTINE mp_iscatter_d (msg_scatter, msg, root, comm, request)
16265 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:)
16266 REAL(kind=real_8),
INTENT(INOUT) :: msg
16267 INTEGER,
INTENT(IN) :: root
16271 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_d'
16274#if defined(__parallel)
16275 INTEGER :: ierr, msglen
16278 CALL mp_timeset(routinen, handle)
16280#if defined(__parallel)
16281#if !defined(__GNUC__) || __GNUC__ >= 9
16282 cpassert(is_contiguous(msg_scatter))
16285 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_precision, msg, &
16286 msglen, mpi_double_precision, root, comm%handle, request%handle, ierr)
16287 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
16288 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16292 msg = msg_scatter(1)
16295 CALL mp_timestop(handle)
16296 END SUBROUTINE mp_iscatter_d
16306 SUBROUTINE mp_iscatter_dv2(msg_scatter, msg, root, comm, request)
16307 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:, :)
16308 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
16309 INTEGER,
INTENT(IN) :: root
16313 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_dv2'
16316#if defined(__parallel)
16317 INTEGER :: ierr, msglen
16320 CALL mp_timeset(routinen, handle)
16322#if defined(__parallel)
16323#if !defined(__GNUC__) || __GNUC__ >= 9
16324 cpassert(is_contiguous(msg_scatter))
16327 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_precision, msg, &
16328 msglen, mpi_double_precision, root, comm%handle, request%handle, ierr)
16329 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
16330 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16334 msg(:) = msg_scatter(:, 1)
16337 CALL mp_timestop(handle)
16338 END SUBROUTINE mp_iscatter_dv2
16348 SUBROUTINE mp_iscatterv_dv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
16349 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:)
16350 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
16351 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
16352 INTEGER,
INTENT(IN) :: recvcount, root
16356 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_dv'
16359#if defined(__parallel)
16363 CALL mp_timeset(routinen, handle)
16365#if defined(__parallel)
16366#if !defined(__GNUC__) || __GNUC__ >= 9
16367 cpassert(is_contiguous(msg_scatter))
16368 cpassert(is_contiguous(msg))
16369 cpassert(is_contiguous(sendcounts))
16370 cpassert(is_contiguous(displs))
16372 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_double_precision, msg, &
16373 recvcount, mpi_double_precision, root, comm%handle, request%handle, ierr)
16374 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
16375 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16377 mark_used(sendcounts)
16379 mark_used(recvcount)
16382 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
16385 CALL mp_timestop(handle)
16386 END SUBROUTINE mp_iscatterv_dv
16397 SUBROUTINE mp_gather_d (msg, msg_gather, root, comm)
16398 REAL(kind=real_8),
INTENT(IN) :: msg
16399 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16400 INTEGER,
INTENT(IN) :: root
16403 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_d'
16406#if defined(__parallel)
16407 INTEGER :: ierr, msglen
16410 CALL mp_timeset(routinen, handle)
16412#if defined(__parallel)
16414 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16415 msglen, mpi_double_precision, root, comm%handle, ierr)
16416 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16417 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16421 msg_gather(1) = msg
16423 CALL mp_timestop(handle)
16424 END SUBROUTINE mp_gather_d
16434 SUBROUTINE mp_gather_d_src(msg, msg_gather, comm)
16435 REAL(kind=real_8),
INTENT(IN) :: msg
16436 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16439 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_d_src'
16442#if defined(__parallel)
16443 INTEGER :: ierr, msglen
16446 CALL mp_timeset(routinen, handle)
16448#if defined(__parallel)
16450 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16451 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16452 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16453 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16456 msg_gather(1) = msg
16458 CALL mp_timestop(handle)
16459 END SUBROUTINE mp_gather_d_src
16473 SUBROUTINE mp_gather_dv(msg, msg_gather, root, comm)
16474 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
16475 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16476 INTEGER,
INTENT(IN) :: root
16479 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dv'
16482#if defined(__parallel)
16483 INTEGER :: ierr, msglen
16486 CALL mp_timeset(routinen, handle)
16488#if defined(__parallel)
16490 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16491 msglen, mpi_double_precision, root, comm%handle, ierr)
16492 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16493 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16499 CALL mp_timestop(handle)
16500 END SUBROUTINE mp_gather_dv
16513 SUBROUTINE mp_gather_dv_src(msg, msg_gather, comm)
16514 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
16515 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16518 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dv_src'
16521#if defined(__parallel)
16522 INTEGER :: ierr, msglen
16525 CALL mp_timeset(routinen, handle)
16527#if defined(__parallel)
16529 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16530 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16531 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16532 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16537 CALL mp_timestop(handle)
16538 END SUBROUTINE mp_gather_dv_src
16552 SUBROUTINE mp_gather_dm(msg, msg_gather, root, comm)
16553 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
16554 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
16555 INTEGER,
INTENT(IN) :: root
16558 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dm'
16561#if defined(__parallel)
16562 INTEGER :: ierr, msglen
16565 CALL mp_timeset(routinen, handle)
16567#if defined(__parallel)
16569 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16570 msglen, mpi_double_precision, root, comm%handle, ierr)
16571 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16572 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16578 CALL mp_timestop(handle)
16579 END SUBROUTINE mp_gather_dm
16592 SUBROUTINE mp_gather_dm_src(msg, msg_gather, comm)
16593 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
16594 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
16597 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dm_src'
16600#if defined(__parallel)
16601 INTEGER :: ierr, msglen
16604 CALL mp_timeset(routinen, handle)
16606#if defined(__parallel)
16608 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16609 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16610 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16611 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16616 CALL mp_timestop(handle)
16617 END SUBROUTINE mp_gather_dm_src
16634 SUBROUTINE mp_gatherv_dv(sendbuf, recvbuf, recvcounts, displs, root, comm)
16636 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16637 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16638 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16639 INTEGER,
INTENT(IN) :: root
16642 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dv'
16645#if defined(__parallel)
16646 INTEGER :: ierr, sendcount
16649 CALL mp_timeset(routinen, handle)
16651#if defined(__parallel)
16652 sendcount =
SIZE(sendbuf)
16653 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16654 recvbuf, recvcounts, displs, mpi_double_precision, &
16655 root, comm%handle, ierr)
16656 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16657 CALL add_perf(perf_id=4, &
16659 msg_size=sendcount*real_8_size)
16661 mark_used(recvcounts)
16664 recvbuf(1 + displs(1):) = sendbuf
16666 CALL mp_timestop(handle)
16667 END SUBROUTINE mp_gatherv_dv
16683 SUBROUTINE mp_gatherv_dv_src(sendbuf, recvbuf, recvcounts, displs, comm)
16685 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16686 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16687 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16690 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dv_src'
16693#if defined(__parallel)
16694 INTEGER :: ierr, sendcount
16697 CALL mp_timeset(routinen, handle)
16699#if defined(__parallel)
16700 sendcount =
SIZE(sendbuf)
16701 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16702 recvbuf, recvcounts, displs, mpi_double_precision, &
16703 comm%source, comm%handle, ierr)
16704 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16705 CALL add_perf(perf_id=4, &
16707 msg_size=sendcount*real_8_size)
16709 mark_used(recvcounts)
16711 recvbuf(1 + displs(1):) = sendbuf
16713 CALL mp_timestop(handle)
16714 END SUBROUTINE mp_gatherv_dv_src
16731 SUBROUTINE mp_gatherv_dm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
16733 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16734 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16735 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16736 INTEGER,
INTENT(IN) :: root
16739 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dm2'
16742#if defined(__parallel)
16743 INTEGER :: ierr, sendcount
16746 CALL mp_timeset(routinen, handle)
16748#if defined(__parallel)
16749 sendcount =
SIZE(sendbuf)
16750 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16751 recvbuf, recvcounts, displs, mpi_double_precision, &
16752 root, comm%handle, ierr)
16753 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16754 CALL add_perf(perf_id=4, &
16756 msg_size=sendcount*real_8_size)
16758 mark_used(recvcounts)
16761 recvbuf(:, 1 + displs(1):) = sendbuf
16763 CALL mp_timestop(handle)
16764 END SUBROUTINE mp_gatherv_dm2
16780 SUBROUTINE mp_gatherv_dm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
16782 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16783 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16784 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16787 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dm2_src'
16790#if defined(__parallel)
16791 INTEGER :: ierr, sendcount
16794 CALL mp_timeset(routinen, handle)
16796#if defined(__parallel)
16797 sendcount =
SIZE(sendbuf)
16798 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16799 recvbuf, recvcounts, displs, mpi_double_precision, &
16800 comm%source, comm%handle, ierr)
16801 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16802 CALL add_perf(perf_id=4, &
16804 msg_size=sendcount*real_8_size)
16806 mark_used(recvcounts)
16808 recvbuf(:, 1 + displs(1):) = sendbuf
16810 CALL mp_timestop(handle)
16811 END SUBROUTINE mp_gatherv_dm2_src
16828 SUBROUTINE mp_igatherv_dv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
16829 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
16830 REAL(kind=real_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
16831 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16832 INTEGER,
INTENT(IN) :: sendcount, root
16836 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_dv'
16839#if defined(__parallel)
16843 CALL mp_timeset(routinen, handle)
16845#if defined(__parallel)
16846#if !defined(__GNUC__) || __GNUC__ >= 9
16847 cpassert(is_contiguous(sendbuf))
16848 cpassert(is_contiguous(recvbuf))
16849 cpassert(is_contiguous(recvcounts))
16850 cpassert(is_contiguous(displs))
16852 CALL mpi_igatherv(sendbuf, sendcount, mpi_double_precision, &
16853 recvbuf, recvcounts, displs, mpi_double_precision, &
16854 root, comm%handle, request%handle, ierr)
16855 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16856 CALL add_perf(perf_id=24, &
16858 msg_size=sendcount*real_8_size)
16860 mark_used(sendcount)
16861 mark_used(recvcounts)
16864 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
16867 CALL mp_timestop(handle)
16868 END SUBROUTINE mp_igatherv_dv
16881 SUBROUTINE mp_allgather_d (msgout, msgin, comm)
16882 REAL(kind=real_8),
INTENT(IN) :: msgout
16883 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
16886 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d'
16889#if defined(__parallel)
16890 INTEGER :: ierr, rcount, scount
16893 CALL mp_timeset(routinen, handle)
16895#if defined(__parallel)
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)
16906 CALL mp_timestop(handle)
16907 END SUBROUTINE mp_allgather_d
16920 SUBROUTINE mp_allgather_d2(msgout, msgin, comm)
16921 REAL(kind=real_8),
INTENT(IN) :: msgout
16922 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
16925 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d2'
16928#if defined(__parallel)
16929 INTEGER :: ierr, rcount, scount
16932 CALL mp_timeset(routinen, handle)
16934#if defined(__parallel)
16937 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
16938 msgin, rcount, mpi_double_precision, &
16940 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16945 CALL mp_timestop(handle)
16946 END SUBROUTINE mp_allgather_d2
16959 SUBROUTINE mp_iallgather_d (msgout, msgin, comm, request)
16960 REAL(kind=real_8),
INTENT(IN) :: msgout
16961 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
16965 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d'
16968#if defined(__parallel)
16969 INTEGER :: ierr, rcount, scount
16972 CALL mp_timeset(routinen, handle)
16974#if defined(__parallel)
16975#if !defined(__GNUC__) || __GNUC__ >= 9
16976 cpassert(is_contiguous(msgin))
16980 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
16981 msgin, rcount, mpi_double_precision, &
16982 comm%handle, request%handle, ierr)
16983 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16989 CALL mp_timestop(handle)
16990 END SUBROUTINE mp_iallgather_d
17005 SUBROUTINE mp_allgather_d12(msgout, msgin, comm)
17006 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
17007 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
17010 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d12'
17013#if defined(__parallel)
17014 INTEGER :: ierr, rcount, scount
17017 CALL mp_timeset(routinen, handle)
17019#if defined(__parallel)
17020 scount =
SIZE(msgout(:))
17022 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17023 msgin, rcount, mpi_double_precision, &
17025 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17028 msgin(:, 1) = msgout(:)
17030 CALL mp_timestop(handle)
17031 END SUBROUTINE mp_allgather_d12
17041 SUBROUTINE mp_allgather_d23(msgout, msgin, comm)
17042 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
17043 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
17046 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d23'
17049#if defined(__parallel)
17050 INTEGER :: ierr, rcount, scount
17053 CALL mp_timeset(routinen, handle)
17055#if defined(__parallel)
17056 scount =
SIZE(msgout(:, :))
17058 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17059 msgin, rcount, mpi_double_precision, &
17061 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17064 msgin(:, :, 1) = msgout(:, :)
17066 CALL mp_timestop(handle)
17067 END SUBROUTINE mp_allgather_d23
17077 SUBROUTINE mp_allgather_d34(msgout, msgin, comm)
17078 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
17079 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
17082 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d34'
17085#if defined(__parallel)
17086 INTEGER :: ierr, rcount, scount
17089 CALL mp_timeset(routinen, handle)
17091#if defined(__parallel)
17092 scount =
SIZE(msgout(:, :, :))
17094 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17095 msgin, rcount, mpi_double_precision, &
17097 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17100 msgin(:, :, :, 1) = msgout(:, :, :)
17102 CALL mp_timestop(handle)
17103 END SUBROUTINE mp_allgather_d34
17113 SUBROUTINE mp_allgather_d22(msgout, msgin, comm)
17114 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
17115 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
17118 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d22'
17121#if defined(__parallel)
17122 INTEGER :: ierr, rcount, scount
17125 CALL mp_timeset(routinen, handle)
17127#if defined(__parallel)
17128 scount =
SIZE(msgout(:, :))
17130 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17131 msgin, rcount, mpi_double_precision, &
17133 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17136 msgin(:, :) = msgout(:, :)
17138 CALL mp_timestop(handle)
17139 END SUBROUTINE mp_allgather_d22
17150 SUBROUTINE mp_iallgather_d11(msgout, msgin, comm, request)
17151 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17152 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17156 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d11'
17159#if defined(__parallel)
17160 INTEGER :: ierr, rcount, scount
17163 CALL mp_timeset(routinen, handle)
17165#if defined(__parallel)
17166#if !defined(__GNUC__) || __GNUC__ >= 9
17167 cpassert(is_contiguous(msgout))
17168 cpassert(is_contiguous(msgin))
17170 scount =
SIZE(msgout(:))
17172 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17173 msgin, rcount, mpi_double_precision, &
17174 comm%handle, request%handle, ierr)
17175 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17181 CALL mp_timestop(handle)
17182 END SUBROUTINE mp_iallgather_d11
17193 SUBROUTINE mp_iallgather_d13(msgout, msgin, comm, request)
17194 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17195 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
17199 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d13'
17202#if defined(__parallel)
17203 INTEGER :: ierr, rcount, scount
17206 CALL mp_timeset(routinen, handle)
17208#if defined(__parallel)
17209#if !defined(__GNUC__) || __GNUC__ >= 9
17210 cpassert(is_contiguous(msgout))
17211 cpassert(is_contiguous(msgin))
17214 scount =
SIZE(msgout(:))
17216 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17217 msgin, rcount, mpi_double_precision, &
17218 comm%handle, request%handle, ierr)
17219 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17222 msgin(:, 1, 1) = msgout(:)
17225 CALL mp_timestop(handle)
17226 END SUBROUTINE mp_iallgather_d13
17237 SUBROUTINE mp_iallgather_d22(msgout, msgin, comm, request)
17238 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :)
17239 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :)
17243 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d22'
17246#if defined(__parallel)
17247 INTEGER :: ierr, rcount, scount
17250 CALL mp_timeset(routinen, handle)
17252#if defined(__parallel)
17253#if !defined(__GNUC__) || __GNUC__ >= 9
17254 cpassert(is_contiguous(msgout))
17255 cpassert(is_contiguous(msgin))
17258 scount =
SIZE(msgout(:, :))
17260 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17261 msgin, rcount, mpi_double_precision, &
17262 comm%handle, request%handle, ierr)
17263 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17266 msgin(:, :) = msgout(:, :)
17269 CALL mp_timestop(handle)
17270 END SUBROUTINE mp_iallgather_d22
17281 SUBROUTINE mp_iallgather_d24(msgout, msgin, comm, request)
17282 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :)
17283 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :, :)
17287 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d24'
17290#if defined(__parallel)
17291 INTEGER :: ierr, rcount, scount
17294 CALL mp_timeset(routinen, handle)
17296#if defined(__parallel)
17297#if !defined(__GNUC__) || __GNUC__ >= 9
17298 cpassert(is_contiguous(msgout))
17299 cpassert(is_contiguous(msgin))
17302 scount =
SIZE(msgout(:, :))
17304 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17305 msgin, rcount, mpi_double_precision, &
17306 comm%handle, request%handle, ierr)
17307 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17310 msgin(:, :, 1, 1) = msgout(:, :)
17313 CALL mp_timestop(handle)
17314 END SUBROUTINE mp_iallgather_d24
17325 SUBROUTINE mp_iallgather_d33(msgout, msgin, comm, request)
17326 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :, :)
17327 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
17331 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d33'
17334#if defined(__parallel)
17335 INTEGER :: ierr, rcount, scount
17338 CALL mp_timeset(routinen, handle)
17340#if defined(__parallel)
17341#if !defined(__GNUC__) || __GNUC__ >= 9
17342 cpassert(is_contiguous(msgout))
17343 cpassert(is_contiguous(msgin))
17346 scount =
SIZE(msgout(:, :, :))
17348 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17349 msgin, rcount, mpi_double_precision, &
17350 comm%handle, request%handle, ierr)
17351 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17354 msgin(:, :, :) = msgout(:, :, :)
17357 CALL mp_timestop(handle)
17358 END SUBROUTINE mp_iallgather_d33
17377 SUBROUTINE mp_allgatherv_dv(msgout, msgin, rcount, rdispl, comm)
17378 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
17379 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17380 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17383 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_dv'
17386#if defined(__parallel)
17387 INTEGER :: ierr, scount
17390 CALL mp_timeset(routinen, handle)
17392#if defined(__parallel)
17393 scount =
SIZE(msgout)
17394 CALL mpi_allgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17395 rdispl, mpi_double_precision, comm%handle, ierr)
17396 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
17403 CALL mp_timestop(handle)
17404 END SUBROUTINE mp_allgatherv_dv
17423 SUBROUTINE mp_allgatherv_dm2(msgout, msgin, rcount, rdispl, comm)
17424 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
17425 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
17426 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17429 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_dv'
17432#if defined(__parallel)
17433 INTEGER :: ierr, scount
17436 CALL mp_timeset(routinen, handle)
17438#if defined(__parallel)
17439 scount =
SIZE(msgout)
17440 CALL mpi_allgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17441 rdispl, mpi_double_precision, comm%handle, ierr)
17442 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
17449 CALL mp_timestop(handle)
17450 END SUBROUTINE mp_allgatherv_dm2
17469 SUBROUTINE mp_iallgatherv_dv(msgout, msgin, rcount, rdispl, comm, request)
17470 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17471 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17472 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17476 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_dv'
17479#if defined(__parallel)
17480 INTEGER :: ierr, scount, rsize
17483 CALL mp_timeset(routinen, handle)
17485#if defined(__parallel)
17486#if !defined(__GNUC__) || __GNUC__ >= 9
17487 cpassert(is_contiguous(msgout))
17488 cpassert(is_contiguous(msgin))
17489 cpassert(is_contiguous(rcount))
17490 cpassert(is_contiguous(rdispl))
17493 scount =
SIZE(msgout)
17494 rsize =
SIZE(rcount)
17495 CALL mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, &
17496 rdispl, comm, request, ierr)
17497 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
17505 CALL mp_timestop(handle)
17506 END SUBROUTINE mp_iallgatherv_dv
17525 SUBROUTINE mp_iallgatherv_dv2(msgout, msgin, rcount, rdispl, comm, request)
17526 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17527 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17528 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
17532 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_dv2'
17535#if defined(__parallel)
17536 INTEGER :: ierr, scount, rsize
17539 CALL mp_timeset(routinen, handle)
17541#if defined(__parallel)
17542#if !defined(__GNUC__) || __GNUC__ >= 9
17543 cpassert(is_contiguous(msgout))
17544 cpassert(is_contiguous(msgin))
17545 cpassert(is_contiguous(rcount))
17546 cpassert(is_contiguous(rdispl))
17549 scount =
SIZE(msgout)
17550 rsize =
SIZE(rcount)
17551 CALL mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, &
17552 rdispl, comm, request, ierr)
17553 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
17561 CALL mp_timestop(handle)
17562 END SUBROUTINE mp_iallgatherv_dv2
17573#if defined(__parallel)
17574 SUBROUTINE mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
17575 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
17576 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17577 INTEGER,
INTENT(IN) :: rsize
17578 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
17581 INTEGER,
INTENT(INOUT) :: ierr
17583 CALL mpi_iallgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17584 rdispl, mpi_double_precision, comm%handle, request%handle, ierr)
17586 END SUBROUTINE mp_iallgatherv_dv_internal
17597 SUBROUTINE mp_sum_scatter_dv(msgout, msgin, rcount, comm)
17598 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
17599 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17600 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
17603 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_dv'
17606#if defined(__parallel)
17610 CALL mp_timeset(routinen, handle)
17612#if defined(__parallel)
17613 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_double_precision, mpi_sum, &
17615 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
17617 CALL add_perf(perf_id=3, count=1, &
17618 msg_size=rcount(1)*2*real_8_size)
17622 msgin = msgout(:, 1)
17624 CALL mp_timestop(handle)
17625 END SUBROUTINE mp_sum_scatter_dv
17636 SUBROUTINE mp_sendrecv_d (msgin, dest, msgout, source, comm, tag)
17637 REAL(kind=real_8),
INTENT(IN) :: msgin
17638 INTEGER,
INTENT(IN) :: dest
17639 REAL(kind=real_8),
INTENT(OUT) :: msgout
17640 INTEGER,
INTENT(IN) :: source
17642 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17644 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_d'
17647#if defined(__parallel)
17648 INTEGER :: ierr, msglen_in, msglen_out, &
17652 CALL mp_timeset(routinen, handle)
17654#if defined(__parallel)
17659 IF (
PRESENT(tag))
THEN
17663 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17664 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17665 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17666 CALL add_perf(perf_id=7, count=1, &
17667 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17675 CALL mp_timestop(handle)
17676 END SUBROUTINE mp_sendrecv_d
17687 SUBROUTINE mp_sendrecv_dv(msgin, dest, msgout, source, comm, tag)
17688 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
17689 INTEGER,
INTENT(IN) :: dest
17690 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
17691 INTEGER,
INTENT(IN) :: source
17693 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17695 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dv'
17698#if defined(__parallel)
17699 INTEGER :: ierr, msglen_in, msglen_out, &
17703 CALL mp_timeset(routinen, handle)
17705#if defined(__parallel)
17706 msglen_in =
SIZE(msgin)
17707 msglen_out =
SIZE(msgout)
17710 IF (
PRESENT(tag))
THEN
17714 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17715 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17716 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17717 CALL add_perf(perf_id=7, count=1, &
17718 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17726 CALL mp_timestop(handle)
17727 END SUBROUTINE mp_sendrecv_dv
17739 SUBROUTINE mp_sendrecv_dm2(msgin, dest, msgout, source, comm, tag)
17740 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
17741 INTEGER,
INTENT(IN) :: dest
17742 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
17743 INTEGER,
INTENT(IN) :: source
17745 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17747 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm2'
17750#if defined(__parallel)
17751 INTEGER :: ierr, msglen_in, msglen_out, &
17755 CALL mp_timeset(routinen, handle)
17757#if defined(__parallel)
17758 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
17759 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
17762 IF (
PRESENT(tag))
THEN
17766 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17767 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17768 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17769 CALL add_perf(perf_id=7, count=1, &
17770 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17778 CALL mp_timestop(handle)
17779 END SUBROUTINE mp_sendrecv_dm2
17790 SUBROUTINE mp_sendrecv_dm3(msgin, dest, msgout, source, comm, tag)
17791 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
17792 INTEGER,
INTENT(IN) :: dest
17793 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
17794 INTEGER,
INTENT(IN) :: source
17796 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17798 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm3'
17801#if defined(__parallel)
17802 INTEGER :: ierr, msglen_in, msglen_out, &
17806 CALL mp_timeset(routinen, handle)
17808#if defined(__parallel)
17809 msglen_in =
SIZE(msgin)
17810 msglen_out =
SIZE(msgout)
17813 IF (
PRESENT(tag))
THEN
17817 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17818 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17819 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17820 CALL add_perf(perf_id=7, count=1, &
17821 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17829 CALL mp_timestop(handle)
17830 END SUBROUTINE mp_sendrecv_dm3
17841 SUBROUTINE mp_sendrecv_dm4(msgin, dest, msgout, source, comm, tag)
17842 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
17843 INTEGER,
INTENT(IN) :: dest
17844 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
17845 INTEGER,
INTENT(IN) :: source
17847 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17849 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm4'
17852#if defined(__parallel)
17853 INTEGER :: ierr, msglen_in, msglen_out, &
17857 CALL mp_timeset(routinen, handle)
17859#if defined(__parallel)
17860 msglen_in =
SIZE(msgin)
17861 msglen_out =
SIZE(msgout)
17864 IF (
PRESENT(tag))
THEN
17868 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17869 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17870 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17871 CALL add_perf(perf_id=7, count=1, &
17872 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17880 CALL mp_timestop(handle)
17881 END SUBROUTINE mp_sendrecv_dm4
17898 SUBROUTINE mp_isendrecv_d (msgin, dest, msgout, source, comm, send_request, &
17900 REAL(kind=real_8),
INTENT(IN) :: msgin
17901 INTEGER,
INTENT(IN) :: dest
17902 REAL(kind=real_8),
INTENT(INOUT) :: msgout
17903 INTEGER,
INTENT(IN) :: source
17906 INTEGER,
INTENT(in),
OPTIONAL :: tag
17908 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_d'
17911#if defined(__parallel)
17912 INTEGER :: ierr, my_tag
17915 CALL mp_timeset(routinen, handle)
17917#if defined(__parallel)
17919 IF (
PRESENT(tag)) my_tag = tag
17921 CALL mpi_irecv(msgout, 1, mpi_double_precision, source, my_tag, &
17922 comm%handle, recv_request%handle, ierr)
17923 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
17925 CALL mpi_isend(msgin, 1, mpi_double_precision, dest, my_tag, &
17926 comm%handle, send_request%handle, ierr)
17927 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
17929 CALL add_perf(perf_id=8, count=1, msg_size=2*real_8_size)
17939 CALL mp_timestop(handle)
17940 END SUBROUTINE mp_isendrecv_d
17959 SUBROUTINE mp_isendrecv_dv(msgin, dest, msgout, source, comm, send_request, &
17961 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
17962 INTEGER,
INTENT(IN) :: dest
17963 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
17964 INTEGER,
INTENT(IN) :: source
17967 INTEGER,
INTENT(in),
OPTIONAL :: tag
17969 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_dv'
17972#if defined(__parallel)
17973 INTEGER :: ierr, msglen, my_tag
17974 REAL(kind=real_8) :: foo
17977 CALL mp_timeset(routinen, handle)
17979#if defined(__parallel)
17980#if !defined(__GNUC__) || __GNUC__ >= 9
17981 cpassert(is_contiguous(msgout))
17982 cpassert(is_contiguous(msgin))
17986 IF (
PRESENT(tag)) my_tag = tag
17988 msglen =
SIZE(msgout, 1)
17989 IF (msglen > 0)
THEN
17990 CALL mpi_irecv(msgout(1), msglen, mpi_double_precision, source, my_tag, &
17991 comm%handle, recv_request%handle, ierr)
17993 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
17994 comm%handle, recv_request%handle, ierr)
17996 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
17998 msglen =
SIZE(msgin, 1)
17999 IF (msglen > 0)
THEN
18000 CALL mpi_isend(msgin(1), msglen, mpi_double_precision, dest, my_tag, &
18001 comm%handle, send_request%handle, ierr)
18003 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18004 comm%handle, send_request%handle, ierr)
18006 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18008 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
18009 CALL add_perf(perf_id=8, count=1, msg_size=msglen*real_8_size)
18019 CALL mp_timestop(handle)
18020 END SUBROUTINE mp_isendrecv_dv
18035 SUBROUTINE mp_isend_dv(msgin, dest, comm, request, tag)
18036 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
18037 INTEGER,
INTENT(IN) :: dest
18040 INTEGER,
INTENT(in),
OPTIONAL :: tag
18042 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dv'
18044 INTEGER :: handle, ierr
18045#if defined(__parallel)
18046 INTEGER :: msglen, my_tag
18047 REAL(kind=real_8) :: foo(1)
18050 CALL mp_timeset(routinen, handle)
18052#if defined(__parallel)
18053#if !defined(__GNUC__) || __GNUC__ >= 9
18054 cpassert(is_contiguous(msgin))
18057 IF (
PRESENT(tag)) my_tag = tag
18059 msglen =
SIZE(msgin)
18060 IF (msglen > 0)
THEN
18061 CALL mpi_isend(msgin(1), msglen, mpi_double_precision, dest, my_tag, &
18062 comm%handle, request%handle, ierr)
18064 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18065 comm%handle, request%handle, ierr)
18067 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18069 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18078 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18080 CALL mp_timestop(handle)
18081 END SUBROUTINE mp_isend_dv
18098 SUBROUTINE mp_isend_dm2(msgin, dest, comm, request, tag)
18099 REAL(kind=real_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
18100 INTEGER,
INTENT(IN) :: dest
18103 INTEGER,
INTENT(in),
OPTIONAL :: tag
18105 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm2'
18107 INTEGER :: handle, ierr
18108#if defined(__parallel)
18109 INTEGER :: msglen, my_tag
18110 REAL(kind=real_8) :: foo(1)
18113 CALL mp_timeset(routinen, handle)
18115#if defined(__parallel)
18116#if !defined(__GNUC__) || __GNUC__ >= 9
18117 cpassert(is_contiguous(msgin))
18121 IF (
PRESENT(tag)) my_tag = tag
18123 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
18124 IF (msglen > 0)
THEN
18125 CALL mpi_isend(msgin(1, 1), msglen, mpi_double_precision, dest, my_tag, &
18126 comm%handle, request%handle, ierr)
18128 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18129 comm%handle, request%handle, ierr)
18131 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18133 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18142 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18144 CALL mp_timestop(handle)
18145 END SUBROUTINE mp_isend_dm2
18164 SUBROUTINE mp_isend_dm3(msgin, dest, comm, request, tag)
18165 REAL(kind=real_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
18166 INTEGER,
INTENT(IN) :: dest
18169 INTEGER,
INTENT(in),
OPTIONAL :: tag
18171 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm3'
18173 INTEGER :: handle, ierr
18174#if defined(__parallel)
18175 INTEGER :: msglen, my_tag
18176 REAL(kind=real_8) :: foo(1)
18179 CALL mp_timeset(routinen, handle)
18181#if defined(__parallel)
18182#if !defined(__GNUC__) || __GNUC__ >= 9
18183 cpassert(is_contiguous(msgin))
18187 IF (
PRESENT(tag)) my_tag = tag
18189 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
18190 IF (msglen > 0)
THEN
18191 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_double_precision, dest, my_tag, &
18192 comm%handle, request%handle, ierr)
18194 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18195 comm%handle, request%handle, ierr)
18197 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18199 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18208 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18210 CALL mp_timestop(handle)
18211 END SUBROUTINE mp_isend_dm3
18227 SUBROUTINE mp_isend_dm4(msgin, dest, comm, request, tag)
18228 REAL(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
18229 INTEGER,
INTENT(IN) :: dest
18232 INTEGER,
INTENT(in),
OPTIONAL :: tag
18234 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm4'
18236 INTEGER :: handle, ierr
18237#if defined(__parallel)
18238 INTEGER :: msglen, my_tag
18239 REAL(kind=real_8) :: foo(1)
18242 CALL mp_timeset(routinen, handle)
18244#if defined(__parallel)
18245#if !defined(__GNUC__) || __GNUC__ >= 9
18246 cpassert(is_contiguous(msgin))
18250 IF (
PRESENT(tag)) my_tag = tag
18252 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
18253 IF (msglen > 0)
THEN
18254 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_double_precision, dest, my_tag, &
18255 comm%handle, request%handle, ierr)
18257 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18258 comm%handle, request%handle, ierr)
18260 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18262 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18271 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18273 CALL mp_timestop(handle)
18274 END SUBROUTINE mp_isend_dm4
18290 SUBROUTINE mp_irecv_dv(msgout, source, comm, request, tag)
18291 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
18292 INTEGER,
INTENT(IN) :: source
18295 INTEGER,
INTENT(in),
OPTIONAL :: tag
18297 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dv'
18300#if defined(__parallel)
18301 INTEGER :: ierr, msglen, my_tag
18302 REAL(kind=real_8) :: foo(1)
18305 CALL mp_timeset(routinen, handle)
18307#if defined(__parallel)
18308#if !defined(__GNUC__) || __GNUC__ >= 9
18309 cpassert(is_contiguous(msgout))
18313 IF (
PRESENT(tag)) my_tag = tag
18315 msglen =
SIZE(msgout)
18316 IF (msglen > 0)
THEN
18317 CALL mpi_irecv(msgout(1), msglen, mpi_double_precision, source, my_tag, &
18318 comm%handle, request%handle, ierr)
18320 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18321 comm%handle, request%handle, ierr)
18323 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18325 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18327 cpabort(
"mp_irecv called in non parallel case")
18334 CALL mp_timestop(handle)
18335 END SUBROUTINE mp_irecv_dv
18352 SUBROUTINE mp_irecv_dm2(msgout, source, comm, request, tag)
18353 REAL(kind=real_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
18354 INTEGER,
INTENT(IN) :: source
18357 INTEGER,
INTENT(in),
OPTIONAL :: tag
18359 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm2'
18362#if defined(__parallel)
18363 INTEGER :: ierr, msglen, my_tag
18364 REAL(kind=real_8) :: foo(1)
18367 CALL mp_timeset(routinen, handle)
18369#if defined(__parallel)
18370#if !defined(__GNUC__) || __GNUC__ >= 9
18371 cpassert(is_contiguous(msgout))
18375 IF (
PRESENT(tag)) my_tag = tag
18377 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
18378 IF (msglen > 0)
THEN
18379 CALL mpi_irecv(msgout(1, 1), msglen, mpi_double_precision, source, my_tag, &
18380 comm%handle, request%handle, ierr)
18382 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18383 comm%handle, request%handle, ierr)
18385 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18387 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18394 cpabort(
"mp_irecv called in non parallel case")
18396 CALL mp_timestop(handle)
18397 END SUBROUTINE mp_irecv_dm2
18415 SUBROUTINE mp_irecv_dm3(msgout, source, comm, request, tag)
18416 REAL(kind=real_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
18417 INTEGER,
INTENT(IN) :: source
18420 INTEGER,
INTENT(in),
OPTIONAL :: tag
18422 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm3'
18425#if defined(__parallel)
18426 INTEGER :: ierr, msglen, my_tag
18427 REAL(kind=real_8) :: foo(1)
18430 CALL mp_timeset(routinen, handle)
18432#if defined(__parallel)
18433#if !defined(__GNUC__) || __GNUC__ >= 9
18434 cpassert(is_contiguous(msgout))
18438 IF (
PRESENT(tag)) my_tag = tag
18440 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
18441 IF (msglen > 0)
THEN
18442 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_double_precision, source, my_tag, &
18443 comm%handle, request%handle, ierr)
18445 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18446 comm%handle, request%handle, ierr)
18448 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
18450 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18457 cpabort(
"mp_irecv called in non parallel case")
18459 CALL mp_timestop(handle)
18460 END SUBROUTINE mp_irecv_dm3
18476 SUBROUTINE mp_irecv_dm4(msgout, source, comm, request, tag)
18477 REAL(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
18478 INTEGER,
INTENT(IN) :: source
18481 INTEGER,
INTENT(in),
OPTIONAL :: tag
18483 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm4'
18486#if defined(__parallel)
18487 INTEGER :: ierr, msglen, my_tag
18488 REAL(kind=real_8) :: foo(1)
18491 CALL mp_timeset(routinen, handle)
18493#if defined(__parallel)
18494#if !defined(__GNUC__) || __GNUC__ >= 9
18495 cpassert(is_contiguous(msgout))
18499 IF (
PRESENT(tag)) my_tag = tag
18501 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
18502 IF (msglen > 0)
THEN
18503 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_double_precision, source, my_tag, &
18504 comm%handle, request%handle, ierr)
18506 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18507 comm%handle, request%handle, ierr)
18509 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
18511 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18518 cpabort(
"mp_irecv called in non parallel case")
18520 CALL mp_timestop(handle)
18521 END SUBROUTINE mp_irecv_dm4
18533 SUBROUTINE mp_win_create_dv(base, comm, win)
18534 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
18538 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_dv'
18541#if defined(__parallel)
18543 INTEGER(kind=mpi_address_kind) :: len
18544 REAL(kind=real_8) :: foo(1)
18547 CALL mp_timeset(routinen, handle)
18549#if defined(__parallel)
18551 len =
SIZE(base)*real_8_size
18553 CALL mpi_win_create(base(1), len, real_8_size, mpi_info_null, comm%handle, win%handle, ierr)
18555 CALL mpi_win_create(foo, len, real_8_size, mpi_info_null, comm%handle, win%handle, ierr)
18557 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
18559 CALL add_perf(perf_id=20, count=1)
18563 win%handle = mp_win_null_handle
18565 CALL mp_timestop(handle)
18566 END SUBROUTINE mp_win_create_dv
18578 SUBROUTINE mp_rget_dv(base, source, win, win_data, myproc, disp, request, &
18579 origin_datatype, target_datatype)
18580 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
18581 INTEGER,
INTENT(IN) :: source
18583 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: win_data
18584 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
18588 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_dv'
18591#if defined(__parallel)
18592 INTEGER :: ierr, len, &
18593 origin_len, target_len
18594 LOGICAL :: do_local_copy
18595 INTEGER(kind=mpi_address_kind) :: disp_aint
18596 mpi_data_type :: handle_origin_datatype, handle_target_datatype
18599 CALL mp_timeset(routinen, handle)
18601#if defined(__parallel)
18604 IF (
PRESENT(disp))
THEN
18605 disp_aint = int(disp, kind=mpi_address_kind)
18607 handle_origin_datatype = mpi_double_precision
18609 IF (
PRESENT(origin_datatype))
THEN
18610 handle_origin_datatype = origin_datatype%type_handle
18613 handle_target_datatype = mpi_double_precision
18615 IF (
PRESENT(target_datatype))
THEN
18616 handle_target_datatype = target_datatype%type_handle
18620 do_local_copy = .false.
18621 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
18622 IF (myproc .EQ. source) do_local_copy = .true.
18624 IF (do_local_copy)
THEN
18626 base(:) = win_data(disp_aint + 1:disp_aint + len)
18631 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
18632 target_len, handle_target_datatype, win%handle, request%handle, ierr)
18638 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
18640 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*real_8_size)
18645 mark_used(origin_datatype)
18646 mark_used(target_datatype)
18650 IF (
PRESENT(disp))
THEN
18651 base(:) = win_data(disp + 1:disp +
SIZE(base))
18653 base(:) = win_data(:
SIZE(base))
18657 CALL mp_timestop(handle)
18658 END SUBROUTINE mp_rget_dv
18668 result(type_descriptor)
18669 INTEGER,
INTENT(IN) :: count
18670 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
18673 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_d'
18676#if defined(__parallel)
18680 CALL mp_timeset(routinen, handle)
18682#if defined(__parallel)
18683 CALL mpi_type_indexed(count, lengths, displs, mpi_double_precision, &
18684 type_descriptor%type_handle, ierr)
18686 cpabort(
"MPI_Type_Indexed @ "//routinen)
18687 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
18689 cpabort(
"MPI_Type_commit @ "//routinen)
18691 type_descriptor%type_handle = 3
18693 type_descriptor%length = count
18694 NULLIFY (type_descriptor%subtype)
18695 type_descriptor%vector_descriptor(1:2) = 1
18696 type_descriptor%has_indexing = .true.
18697 type_descriptor%index_descriptor%index => lengths
18698 type_descriptor%index_descriptor%chunks => displs
18700 CALL mp_timestop(handle)
18711 SUBROUTINE mp_allocate_d (DATA, len, stat)
18712 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
18713 INTEGER,
INTENT(IN) :: len
18714 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
18716 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_d'
18718 INTEGER :: handle, ierr
18720 CALL mp_timeset(routinen, handle)
18722#if defined(__parallel)
18724 CALL mp_alloc_mem(
DATA, len, stat=ierr)
18725 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
18726 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
18727 CALL add_perf(perf_id=15, count=1)
18729 ALLOCATE (
DATA(len), stat=ierr)
18730 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
18731 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
18733 IF (
PRESENT(stat)) stat = ierr
18734 CALL mp_timestop(handle)
18735 END SUBROUTINE mp_allocate_d
18743 SUBROUTINE mp_deallocate_d (DATA, stat)
18744 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
18745 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
18747 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_d'
18750#if defined(__parallel)
18754 CALL mp_timeset(routinen, handle)
18756#if defined(__parallel)
18757 CALL mp_free_mem(
DATA, ierr)
18758 IF (
PRESENT(stat))
THEN
18761 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
18764 CALL add_perf(perf_id=15, count=1)
18767 IF (
PRESENT(stat)) stat = 0
18769 CALL mp_timestop(handle)
18770 END SUBROUTINE mp_deallocate_d
18783 SUBROUTINE mp_file_write_at_dv(fh, offset, msg, msglen)
18784 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
18786 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18787 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18790#if defined(__parallel)
18794 msg_len =
SIZE(msg)
18795 IF (
PRESENT(msglen)) msg_len = msglen
18796#if defined(__parallel)
18797 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18799 cpabort(
"mpi_file_write_at_dv @ mp_file_write_at_dv")
18801 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18803 END SUBROUTINE mp_file_write_at_dv
18811 SUBROUTINE mp_file_write_at_d (fh, offset, msg)
18812 REAL(kind=real_8),
INTENT(IN) :: msg
18814 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18816#if defined(__parallel)
18820 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18822 cpabort(
"mpi_file_write_at_d @ mp_file_write_at_d")
18824 WRITE (unit=fh%handle, pos=offset + 1) msg
18826 END SUBROUTINE mp_file_write_at_d
18838 SUBROUTINE mp_file_write_at_all_dv(fh, offset, msg, msglen)
18839 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
18841 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18842 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18845#if defined(__parallel)
18849 msg_len =
SIZE(msg)
18850 IF (
PRESENT(msglen)) msg_len = msglen
18851#if defined(__parallel)
18852 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18854 cpabort(
"mpi_file_write_at_all_dv @ mp_file_write_at_all_dv")
18856 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18858 END SUBROUTINE mp_file_write_at_all_dv
18866 SUBROUTINE mp_file_write_at_all_d (fh, offset, msg)
18867 REAL(kind=real_8),
INTENT(IN) :: msg
18869 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18871#if defined(__parallel)
18875 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18877 cpabort(
"mpi_file_write_at_all_d @ mp_file_write_at_all_d")
18879 WRITE (unit=fh%handle, pos=offset + 1) msg
18881 END SUBROUTINE mp_file_write_at_all_d
18894 SUBROUTINE mp_file_read_at_dv(fh, offset, msg, msglen)
18895 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
18897 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18898 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18901#if defined(__parallel)
18905 msg_len =
SIZE(msg)
18906 IF (
PRESENT(msglen)) msg_len = msglen
18907#if defined(__parallel)
18908 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18910 cpabort(
"mpi_file_read_at_dv @ mp_file_read_at_dv")
18912 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18914 END SUBROUTINE mp_file_read_at_dv
18922 SUBROUTINE mp_file_read_at_d (fh, offset, msg)
18923 REAL(kind=real_8),
INTENT(OUT) :: msg
18925 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18927#if defined(__parallel)
18931 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18933 cpabort(
"mpi_file_read_at_d @ mp_file_read_at_d")
18935 READ (unit=fh%handle, pos=offset + 1) msg
18937 END SUBROUTINE mp_file_read_at_d
18949 SUBROUTINE mp_file_read_at_all_dv(fh, offset, msg, msglen)
18950 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
18952 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18953 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18956#if defined(__parallel)
18960 msg_len =
SIZE(msg)
18961 IF (
PRESENT(msglen)) msg_len = msglen
18962#if defined(__parallel)
18963 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18965 cpabort(
"mpi_file_read_at_all_dv @ mp_file_read_at_all_dv")
18967 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18969 END SUBROUTINE mp_file_read_at_all_dv
18977 SUBROUTINE mp_file_read_at_all_d (fh, offset, msg)
18978 REAL(kind=real_8),
INTENT(OUT) :: msg
18980 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18982#if defined(__parallel)
18986 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18988 cpabort(
"mpi_file_read_at_all_d @ mp_file_read_at_all_d")
18990 READ (unit=fh%handle, pos=offset + 1) msg
18992 END SUBROUTINE mp_file_read_at_all_d
19001 FUNCTION mp_type_make_d (ptr, &
19002 vector_descriptor, index_descriptor) &
19003 result(type_descriptor)
19004 REAL(kind=real_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
19005 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
19006 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
19009 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_d'
19011#if defined(__parallel)
19015 NULLIFY (type_descriptor%subtype)
19016 type_descriptor%length =
SIZE(ptr)
19017#if defined(__parallel)
19018 type_descriptor%type_handle = mpi_double_precision
19019 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
19021 cpabort(
"MPI_Get_address @ "//routinen)
19023 type_descriptor%type_handle = 3
19025 type_descriptor%vector_descriptor(1:2) = 1
19026 type_descriptor%has_indexing = .false.
19027 type_descriptor%data_d => ptr
19028 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
19029 cpabort(routinen//
": Vectors and indices NYI")
19031 END FUNCTION mp_type_make_d
19040 SUBROUTINE mp_alloc_mem_d (DATA, len, stat)
19041 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
19042 INTEGER,
INTENT(IN) :: len
19043 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
19045#if defined(__parallel)
19046 INTEGER :: size, ierr, length, &
19048 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
19049 TYPE(c_ptr) :: mp_baseptr
19050 mpi_info_type :: mp_info
19052 length = max(len, 1)
19053 CALL mpi_type_size(mpi_double_precision,
size, ierr)
19054 mp_size = int(length, kind=mpi_address_kind)*
size
19055 IF (mp_size .GT. mp_max_memory_size)
THEN
19056 cpabort(
"MPI cannot allocate more than 2 GiByte")
19058 mp_info = mpi_info_null
19059 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
19060 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
19061 IF (
PRESENT(stat)) stat = mp_res
19063 INTEGER :: length, mystat
19064 length = max(len, 1)
19065 IF (
PRESENT(stat))
THEN
19066 ALLOCATE (
DATA(length), stat=mystat)
19069 ALLOCATE (
DATA(length))
19072 END SUBROUTINE mp_alloc_mem_d
19080 SUBROUTINE mp_free_mem_d (DATA, stat)
19081 REAL(kind=real_8),
DIMENSION(:), &
19082 POINTER, asynchronous ::
DATA
19083 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
19085#if defined(__parallel)
19087 CALL mpi_free_mem(
DATA, mp_res)
19088 IF (
PRESENT(stat)) stat = mp_res
19091 IF (
PRESENT(stat)) stat = 0
19093 END SUBROUTINE mp_free_mem_d
19105 SUBROUTINE mp_shift_rm(msg, comm, displ_in)
19107 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
19109 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
19111 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_rm'
19113 INTEGER :: handle, ierror
19114#if defined(__parallel)
19115 INTEGER :: displ, left, &
19116 msglen, myrank, nprocs, &
19121 CALL mp_timeset(routinen, handle)
19123#if defined(__parallel)
19124 CALL mpi_comm_rank(comm%handle, myrank, ierror)
19125 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
19126 CALL mpi_comm_size(comm%handle, nprocs, ierror)
19127 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
19128 IF (
PRESENT(displ_in))
THEN
19133 right =
modulo(myrank + displ, nprocs)
19134 left =
modulo(myrank - displ, nprocs)
19137 CALL mpi_sendrecv_replace(msg, msglen, mpi_real, right, tag, left, tag, &
19138 comm%handle, mpi_status_ignore, ierror)
19139 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
19140 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_4_size)
19144 mark_used(displ_in)
19146 CALL mp_timestop(handle)
19148 END SUBROUTINE mp_shift_rm
19161 SUBROUTINE mp_shift_r (msg, comm, displ_in)
19163 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
19165 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
19167 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_r'
19169 INTEGER :: handle, ierror
19170#if defined(__parallel)
19171 INTEGER :: displ, left, &
19172 msglen, myrank, nprocs, &
19177 CALL mp_timeset(routinen, handle)
19179#if defined(__parallel)
19180 CALL mpi_comm_rank(comm%handle, myrank, ierror)
19181 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
19182 CALL mpi_comm_size(comm%handle, nprocs, ierror)
19183 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
19184 IF (
PRESENT(displ_in))
THEN
19189 right =
modulo(myrank + displ, nprocs)
19190 left =
modulo(myrank - displ, nprocs)
19193 CALL mpi_sendrecv_replace(msg, msglen, mpi_real, right, tag, left, &
19194 tag, comm%handle, mpi_status_ignore, ierror)
19195 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
19196 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_4_size)
19200 mark_used(displ_in)
19202 CALL mp_timestop(handle)
19204 END SUBROUTINE mp_shift_r
19225 SUBROUTINE mp_alltoall_r11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
19227 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
19228 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
19229 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
19230 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
19233 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r11v'
19236#if defined(__parallel)
19237 INTEGER :: ierr, msglen
19242 CALL mp_timeset(routinen, handle)
19244#if defined(__parallel)
19245 CALL mpi_alltoallv(sb, scount, sdispl, mpi_real, &
19246 rb, rcount, rdispl, mpi_real, comm%handle, ierr)
19247 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
19248 msglen = sum(scount) + sum(rcount)
19249 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19255 DO i = 1, rcount(1)
19256 rb(rdispl(1) + i) = sb(sdispl(1) + i)
19259 CALL mp_timestop(handle)
19261 END SUBROUTINE mp_alltoall_r11v
19276 SUBROUTINE mp_alltoall_r22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
19278 REAL(kind=real_4),
DIMENSION(:, :), &
19279 INTENT(IN),
CONTIGUOUS :: sb
19280 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
19281 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS, &
19282 INTENT(INOUT) :: rb
19283 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
19286 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r22v'
19289#if defined(__parallel)
19290 INTEGER :: ierr, msglen
19293 CALL mp_timeset(routinen, handle)
19295#if defined(__parallel)
19296 CALL mpi_alltoallv(sb, scount, sdispl, mpi_real, &
19297 rb, rcount, rdispl, mpi_real, comm%handle, ierr)
19298 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
19299 msglen = sum(scount) + sum(rcount)
19300 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*real_4_size)
19309 CALL mp_timestop(handle)
19311 END SUBROUTINE mp_alltoall_r22v
19328 SUBROUTINE mp_alltoall_r (sb, rb, count, comm)
19330 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
19331 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
19332 INTEGER,
INTENT(IN) :: count
19335 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r'
19338#if defined(__parallel)
19339 INTEGER :: ierr, msglen, np
19342 CALL mp_timeset(routinen, handle)
19344#if defined(__parallel)
19345 CALL mpi_alltoall(sb, count, mpi_real, &
19346 rb, count, mpi_real, comm%handle, ierr)
19347 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19348 CALL mpi_comm_size(comm%handle, np, ierr)
19349 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19350 msglen = 2*count*np
19351 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19357 CALL mp_timestop(handle)
19359 END SUBROUTINE mp_alltoall_r
19369 SUBROUTINE mp_alltoall_r22(sb, rb, count, comm)
19371 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
19372 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
19373 INTEGER,
INTENT(IN) :: count
19376 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r22'
19379#if defined(__parallel)
19380 INTEGER :: ierr, msglen, np
19383 CALL mp_timeset(routinen, handle)
19385#if defined(__parallel)
19386 CALL mpi_alltoall(sb, count, mpi_real, &
19387 rb, count, mpi_real, comm%handle, ierr)
19388 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19389 CALL mpi_comm_size(comm%handle, np, ierr)
19390 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19391 msglen = 2*
SIZE(sb)*np
19392 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19398 CALL mp_timestop(handle)
19400 END SUBROUTINE mp_alltoall_r22
19410 SUBROUTINE mp_alltoall_r33(sb, rb, count, comm)
19412 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
19413 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
19414 INTEGER,
INTENT(IN) :: count
19417 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r33'
19420#if defined(__parallel)
19421 INTEGER :: ierr, msglen, np
19424 CALL mp_timeset(routinen, handle)
19426#if defined(__parallel)
19427 CALL mpi_alltoall(sb, count, mpi_real, &
19428 rb, count, mpi_real, comm%handle, ierr)
19429 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19430 CALL mpi_comm_size(comm%handle, np, ierr)
19431 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19432 msglen = 2*count*np
19433 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19439 CALL mp_timestop(handle)
19441 END SUBROUTINE mp_alltoall_r33
19451 SUBROUTINE mp_alltoall_r44(sb, rb, count, comm)
19453 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19455 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19457 INTEGER,
INTENT(IN) :: count
19460 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r44'
19463#if defined(__parallel)
19464 INTEGER :: ierr, msglen, np
19467 CALL mp_timeset(routinen, handle)
19469#if defined(__parallel)
19470 CALL mpi_alltoall(sb, count, mpi_real, &
19471 rb, count, mpi_real, comm%handle, ierr)
19472 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19473 CALL mpi_comm_size(comm%handle, np, ierr)
19474 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19475 msglen = 2*count*np
19476 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19482 CALL mp_timestop(handle)
19484 END SUBROUTINE mp_alltoall_r44
19494 SUBROUTINE mp_alltoall_r55(sb, rb, count, comm)
19496 REAL(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
19498 REAL(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
19500 INTEGER,
INTENT(IN) :: count
19503 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r55'
19506#if defined(__parallel)
19507 INTEGER :: ierr, msglen, np
19510 CALL mp_timeset(routinen, handle)
19512#if defined(__parallel)
19513 CALL mpi_alltoall(sb, count, mpi_real, &
19514 rb, count, mpi_real, comm%handle, ierr)
19515 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19516 CALL mpi_comm_size(comm%handle, np, ierr)
19517 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19518 msglen = 2*count*np
19519 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19525 CALL mp_timestop(handle)
19527 END SUBROUTINE mp_alltoall_r55
19538 SUBROUTINE mp_alltoall_r45(sb, rb, count, comm)
19540 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19542 REAL(kind=real_4), &
19543 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
19544 INTEGER,
INTENT(IN) :: count
19547 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r45'
19550#if defined(__parallel)
19551 INTEGER :: ierr, msglen, np
19554 CALL mp_timeset(routinen, handle)
19556#if defined(__parallel)
19557 CALL mpi_alltoall(sb, count, mpi_real, &
19558 rb, count, mpi_real, comm%handle, ierr)
19559 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19560 CALL mpi_comm_size(comm%handle, np, ierr)
19561 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19562 msglen = 2*count*np
19563 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19567 rb = reshape(sb, shape(rb))
19569 CALL mp_timestop(handle)
19571 END SUBROUTINE mp_alltoall_r45
19582 SUBROUTINE mp_alltoall_r34(sb, rb, count, comm)
19584 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
19586 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19588 INTEGER,
INTENT(IN) :: count
19591 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r34'
19594#if defined(__parallel)
19595 INTEGER :: ierr, msglen, np
19598 CALL mp_timeset(routinen, handle)
19600#if defined(__parallel)
19601 CALL mpi_alltoall(sb, count, mpi_real, &
19602 rb, count, mpi_real, comm%handle, ierr)
19603 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19604 CALL mpi_comm_size(comm%handle, np, ierr)
19605 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19606 msglen = 2*count*np
19607 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19611 rb = reshape(sb, shape(rb))
19613 CALL mp_timestop(handle)
19615 END SUBROUTINE mp_alltoall_r34
19626 SUBROUTINE mp_alltoall_r54(sb, rb, count, comm)
19628 REAL(kind=real_4), &
19629 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
19630 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19632 INTEGER,
INTENT(IN) :: count
19635 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r54'
19638#if defined(__parallel)
19639 INTEGER :: ierr, msglen, np
19642 CALL mp_timeset(routinen, handle)
19644#if defined(__parallel)
19645 CALL mpi_alltoall(sb, count, mpi_real, &
19646 rb, count, mpi_real, comm%handle, ierr)
19647 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19648 CALL mpi_comm_size(comm%handle, np, ierr)
19649 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19650 msglen = 2*count*np
19651 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19655 rb = reshape(sb, shape(rb))
19657 CALL mp_timestop(handle)
19659 END SUBROUTINE mp_alltoall_r54
19670 SUBROUTINE mp_send_r (msg, dest, tag, comm)
19671 REAL(kind=real_4),
INTENT(IN) :: msg
19672 INTEGER,
INTENT(IN) :: dest, tag
19675 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_r'
19678#if defined(__parallel)
19679 INTEGER :: ierr, msglen
19682 CALL mp_timeset(routinen, handle)
19684#if defined(__parallel)
19686 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19687 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19688 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19695 cpabort(
"not in parallel mode")
19697 CALL mp_timestop(handle)
19698 END SUBROUTINE mp_send_r
19708 SUBROUTINE mp_send_rv(msg, dest, tag, comm)
19709 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
19710 INTEGER,
INTENT(IN) :: dest, tag
19713 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_rv'
19716#if defined(__parallel)
19717 INTEGER :: ierr, msglen
19720 CALL mp_timeset(routinen, handle)
19722#if defined(__parallel)
19724 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19725 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19726 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19733 cpabort(
"not in parallel mode")
19735 CALL mp_timestop(handle)
19736 END SUBROUTINE mp_send_rv
19746 SUBROUTINE mp_send_rm2(msg, dest, tag, comm)
19747 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
19748 INTEGER,
INTENT(IN) :: dest, tag
19751 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_rm2'
19754#if defined(__parallel)
19755 INTEGER :: ierr, msglen
19758 CALL mp_timeset(routinen, handle)
19760#if defined(__parallel)
19762 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19763 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19764 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19771 cpabort(
"not in parallel mode")
19773 CALL mp_timestop(handle)
19774 END SUBROUTINE mp_send_rm2
19784 SUBROUTINE mp_send_rm3(msg, dest, tag, comm)
19785 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
19786 INTEGER,
INTENT(IN) :: dest, tag
19789 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
19792#if defined(__parallel)
19793 INTEGER :: ierr, msglen
19796 CALL mp_timeset(routinen, handle)
19798#if defined(__parallel)
19800 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19801 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19802 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19809 cpabort(
"not in parallel mode")
19811 CALL mp_timestop(handle)
19812 END SUBROUTINE mp_send_rm3
19823 SUBROUTINE mp_recv_r (msg, source, tag, comm)
19824 REAL(kind=real_4),
INTENT(INOUT) :: msg
19825 INTEGER,
INTENT(INOUT) :: source, tag
19828 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_r'
19831#if defined(__parallel)
19832 INTEGER :: ierr, msglen
19833 mpi_status_type :: status
19836 CALL mp_timeset(routinen, handle)
19838#if defined(__parallel)
19841 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19842 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19844 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19845 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19846 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19847 source = status mpi_status_extract(mpi_source)
19848 tag = status mpi_status_extract(mpi_tag)
19856 cpabort(
"not in parallel mode")
19858 CALL mp_timestop(handle)
19859 END SUBROUTINE mp_recv_r
19869 SUBROUTINE mp_recv_rv(msg, source, tag, comm)
19870 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
19871 INTEGER,
INTENT(INOUT) :: source, tag
19874 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rv'
19877#if defined(__parallel)
19878 INTEGER :: ierr, msglen
19879 mpi_status_type :: status
19882 CALL mp_timeset(routinen, handle)
19884#if defined(__parallel)
19887 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19888 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19890 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19891 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19892 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19893 source = status mpi_status_extract(mpi_source)
19894 tag = status mpi_status_extract(mpi_tag)
19902 cpabort(
"not in parallel mode")
19904 CALL mp_timestop(handle)
19905 END SUBROUTINE mp_recv_rv
19915 SUBROUTINE mp_recv_rm2(msg, source, tag, comm)
19916 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
19917 INTEGER,
INTENT(INOUT) :: source, tag
19920 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rm2'
19923#if defined(__parallel)
19924 INTEGER :: ierr, msglen
19925 mpi_status_type :: status
19928 CALL mp_timeset(routinen, handle)
19930#if defined(__parallel)
19933 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19934 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19936 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19937 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19938 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19939 source = status mpi_status_extract(mpi_source)
19940 tag = status mpi_status_extract(mpi_tag)
19948 cpabort(
"not in parallel mode")
19950 CALL mp_timestop(handle)
19951 END SUBROUTINE mp_recv_rm2
19961 SUBROUTINE mp_recv_rm3(msg, source, tag, comm)
19962 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
19963 INTEGER,
INTENT(INOUT) :: source, tag
19966 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rm3'
19969#if defined(__parallel)
19970 INTEGER :: ierr, msglen
19971 mpi_status_type :: status
19974 CALL mp_timeset(routinen, handle)
19976#if defined(__parallel)
19979 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19980 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19982 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19983 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19984 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19985 source = status mpi_status_extract(mpi_source)
19986 tag = status mpi_status_extract(mpi_tag)
19994 cpabort(
"not in parallel mode")
19996 CALL mp_timestop(handle)
19997 END SUBROUTINE mp_recv_rm3
20007 SUBROUTINE mp_bcast_r (msg, source, comm)
20008 REAL(kind=real_4),
INTENT(INOUT) :: msg
20009 INTEGER,
INTENT(IN) :: source
20012 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r'
20015#if defined(__parallel)
20016 INTEGER :: ierr, msglen
20019 CALL mp_timeset(routinen, handle)
20021#if defined(__parallel)
20023 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20024 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20025 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20031 CALL mp_timestop(handle)
20032 END SUBROUTINE mp_bcast_r
20041 SUBROUTINE mp_bcast_r_src(msg, comm)
20042 REAL(kind=real_4),
INTENT(INOUT) :: msg
20045 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r_src'
20048#if defined(__parallel)
20049 INTEGER :: ierr, msglen
20052 CALL mp_timeset(routinen, handle)
20054#if defined(__parallel)
20056 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20057 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20058 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20063 CALL mp_timestop(handle)
20064 END SUBROUTINE mp_bcast_r_src
20074 SUBROUTINE mp_ibcast_r (msg, source, comm, request)
20075 REAL(kind=real_4),
INTENT(INOUT) :: msg
20076 INTEGER,
INTENT(IN) :: source
20080 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_r'
20083#if defined(__parallel)
20084 INTEGER :: ierr, msglen
20087 CALL mp_timeset(routinen, handle)
20089#if defined(__parallel)
20091 CALL mpi_ibcast(msg, msglen, mpi_real, source, comm%handle, request%handle, ierr)
20092 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
20093 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_4_size)
20100 CALL mp_timestop(handle)
20101 END SUBROUTINE mp_ibcast_r
20110 SUBROUTINE mp_bcast_rv(msg, source, comm)
20111 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20112 INTEGER,
INTENT(IN) :: source
20115 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rv'
20118#if defined(__parallel)
20119 INTEGER :: ierr, msglen
20122 CALL mp_timeset(routinen, handle)
20124#if defined(__parallel)
20126 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20127 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20128 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20134 CALL mp_timestop(handle)
20135 END SUBROUTINE mp_bcast_rv
20143 SUBROUTINE mp_bcast_rv_src(msg, comm)
20144 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20147 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rv_src'
20150#if defined(__parallel)
20151 INTEGER :: ierr, msglen
20154 CALL mp_timeset(routinen, handle)
20156#if defined(__parallel)
20158 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20159 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20160 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20165 CALL mp_timestop(handle)
20166 END SUBROUTINE mp_bcast_rv_src
20175 SUBROUTINE mp_ibcast_rv(msg, source, comm, request)
20176 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
20177 INTEGER,
INTENT(IN) :: source
20181 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_rv'
20184#if defined(__parallel)
20185 INTEGER :: ierr, msglen
20188 CALL mp_timeset(routinen, handle)
20190#if defined(__parallel)
20191#if !defined(__GNUC__) || __GNUC__ >= 9
20192 cpassert(is_contiguous(msg))
20195 CALL mpi_ibcast(msg, msglen, mpi_real, source, comm%handle, request%handle, ierr)
20196 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
20197 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_4_size)
20204 CALL mp_timestop(handle)
20205 END SUBROUTINE mp_ibcast_rv
20214 SUBROUTINE mp_bcast_rm(msg, source, comm)
20215 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20216 INTEGER,
INTENT(IN) :: source
20219 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rm'
20222#if defined(__parallel)
20223 INTEGER :: ierr, msglen
20226 CALL mp_timeset(routinen, handle)
20228#if defined(__parallel)
20230 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20231 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20232 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20238 CALL mp_timestop(handle)
20239 END SUBROUTINE mp_bcast_rm
20248 SUBROUTINE mp_bcast_rm_src(msg, comm)
20249 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20252 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rm_src'
20255#if defined(__parallel)
20256 INTEGER :: ierr, msglen
20259 CALL mp_timeset(routinen, handle)
20261#if defined(__parallel)
20263 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20264 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20265 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20270 CALL mp_timestop(handle)
20271 END SUBROUTINE mp_bcast_rm_src
20280 SUBROUTINE mp_bcast_r3(msg, source, comm)
20281 REAL(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
20282 INTEGER,
INTENT(IN) :: source
20285 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r3'
20288#if defined(__parallel)
20289 INTEGER :: ierr, msglen
20292 CALL mp_timeset(routinen, handle)
20294#if defined(__parallel)
20296 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20297 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20298 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20304 CALL mp_timestop(handle)
20305 END SUBROUTINE mp_bcast_r3
20314 SUBROUTINE mp_bcast_r3_src(msg, comm)
20315 REAL(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
20318 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r3_src'
20321#if defined(__parallel)
20322 INTEGER :: ierr, msglen
20325 CALL mp_timeset(routinen, handle)
20327#if defined(__parallel)
20329 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20330 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20331 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20336 CALL mp_timestop(handle)
20337 END SUBROUTINE mp_bcast_r3_src
20346 SUBROUTINE mp_sum_r (msg, comm)
20347 REAL(kind=real_4),
INTENT(INOUT) :: msg
20350 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_r'
20353#if defined(__parallel)
20354 INTEGER :: ierr, msglen
20357 CALL mp_timeset(routinen, handle)
20359#if defined(__parallel)
20361 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20362 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20363 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20368 CALL mp_timestop(handle)
20369 END SUBROUTINE mp_sum_r
20377 SUBROUTINE mp_sum_rv(msg, comm)
20378 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20381 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rv'
20384#if defined(__parallel)
20385 INTEGER :: ierr, msglen
20388 CALL mp_timeset(routinen, handle)
20390#if defined(__parallel)
20392 IF (msglen > 0)
THEN
20393 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20394 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20396 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20401 CALL mp_timestop(handle)
20402 END SUBROUTINE mp_sum_rv
20410 SUBROUTINE mp_isum_rv(msg, comm, request)
20411 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
20415 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_rv'
20418#if defined(__parallel)
20419 INTEGER :: ierr, msglen
20422 CALL mp_timeset(routinen, handle)
20424#if defined(__parallel)
20425#if !defined(__GNUC__) || __GNUC__ >= 9
20426 cpassert(is_contiguous(msg))
20429 IF (msglen > 0)
THEN
20430 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, request%handle, ierr)
20431 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
20435 CALL add_perf(perf_id=23, count=1, msg_size=msglen*real_4_size)
20441 CALL mp_timestop(handle)
20442 END SUBROUTINE mp_isum_rv
20450 SUBROUTINE mp_sum_rm(msg, comm)
20451 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20454 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm'
20457#if defined(__parallel)
20458 INTEGER,
PARAMETER :: max_msg = 2**25
20459 INTEGER :: ierr, m1, msglen, step, msglensum
20462 CALL mp_timeset(routinen, handle)
20464#if defined(__parallel)
20466 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
20468 DO m1 = lbound(msg, 2), ubound(msg, 2), step
20469 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
20470 msglensum = msglensum + msglen
20471 IF (msglen > 0)
THEN
20472 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_real, mpi_sum, comm%handle, ierr)
20473 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20476 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_4_size)
20481 CALL mp_timestop(handle)
20482 END SUBROUTINE mp_sum_rm
20490 SUBROUTINE mp_sum_rm3(msg, comm)
20491 REAL(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
20494 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm3'
20497#if defined(__parallel)
20498 INTEGER :: ierr, msglen
20501 CALL mp_timeset(routinen, handle)
20503#if defined(__parallel)
20505 IF (msglen > 0)
THEN
20506 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20507 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20509 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20514 CALL mp_timestop(handle)
20515 END SUBROUTINE mp_sum_rm3
20523 SUBROUTINE mp_sum_rm4(msg, comm)
20524 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
20527 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm4'
20530#if defined(__parallel)
20531 INTEGER :: ierr, msglen
20534 CALL mp_timeset(routinen, handle)
20536#if defined(__parallel)
20538 IF (msglen > 0)
THEN
20539 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20540 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20542 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20547 CALL mp_timestop(handle)
20548 END SUBROUTINE mp_sum_rm4
20560 SUBROUTINE mp_sum_root_rv(msg, root, comm)
20561 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20562 INTEGER,
INTENT(IN) :: root
20565 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rv'
20568#if defined(__parallel)
20569 INTEGER :: ierr, m1, msglen, taskid
20570 REAL(kind=real_4),
ALLOCATABLE :: res(:)
20573 CALL mp_timeset(routinen, handle)
20575#if defined(__parallel)
20577 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20578 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20579 IF (msglen > 0)
THEN
20582 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_sum, &
20583 root, comm%handle, ierr)
20584 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20585 IF (taskid == root)
THEN
20590 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20596 CALL mp_timestop(handle)
20597 END SUBROUTINE mp_sum_root_rv
20608 SUBROUTINE mp_sum_root_rm(msg, root, comm)
20609 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20610 INTEGER,
INTENT(IN) :: root
20613 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
20616#if defined(__parallel)
20617 INTEGER :: ierr, m1, m2, msglen, taskid
20618 REAL(kind=real_4),
ALLOCATABLE :: res(:, :)
20621 CALL mp_timeset(routinen, handle)
20623#if defined(__parallel)
20625 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20626 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20627 IF (msglen > 0)
THEN
20630 ALLOCATE (res(m1, m2))
20631 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_sum, root, comm%handle, ierr)
20632 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20633 IF (taskid == root)
THEN
20638 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20644 CALL mp_timestop(handle)
20645 END SUBROUTINE mp_sum_root_rm
20653 SUBROUTINE mp_sum_partial_rm(msg, res, comm)
20654 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
20655 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
20658 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_rm'
20661#if defined(__parallel)
20662 INTEGER :: ierr, msglen, taskid
20665 CALL mp_timeset(routinen, handle)
20667#if defined(__parallel)
20669 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20670 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20671 IF (msglen > 0)
THEN
20672 CALL mpi_scan(msg, res, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20673 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
20675 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20681 CALL mp_timestop(handle)
20682 END SUBROUTINE mp_sum_partial_rm
20692 SUBROUTINE mp_max_r (msg, comm)
20693 REAL(kind=real_4),
INTENT(INOUT) :: msg
20696 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_r'
20699#if defined(__parallel)
20700 INTEGER :: ierr, msglen
20703 CALL mp_timeset(routinen, handle)
20705#if defined(__parallel)
20707 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_max, comm%handle, ierr)
20708 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20709 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20714 CALL mp_timestop(handle)
20715 END SUBROUTINE mp_max_r
20725 SUBROUTINE mp_max_root_r (msg, root, comm)
20726 REAL(kind=real_4),
INTENT(INOUT) :: msg
20727 INTEGER,
INTENT(IN) :: root
20730 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_r'
20733#if defined(__parallel)
20734 INTEGER :: ierr, msglen
20735 REAL(kind=real_4) :: res
20738 CALL mp_timeset(routinen, handle)
20740#if defined(__parallel)
20742 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_max, root, comm%handle, ierr)
20743 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20744 IF (root == comm%mepos) msg = res
20745 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20751 CALL mp_timestop(handle)
20752 END SUBROUTINE mp_max_root_r
20762 SUBROUTINE mp_max_rv(msg, comm)
20763 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20766 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_rv'
20769#if defined(__parallel)
20770 INTEGER :: ierr, msglen
20773 CALL mp_timeset(routinen, handle)
20775#if defined(__parallel)
20777 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_max, comm%handle, ierr)
20778 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20779 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20784 CALL mp_timestop(handle)
20785 END SUBROUTINE mp_max_rv
20795 SUBROUTINE mp_max_root_rm(msg, root, comm)
20796 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20800 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_rm'
20803#if defined(__parallel)
20804 INTEGER :: ierr, msglen
20805 REAL(kind=real_4) :: res(
SIZE(msg, 1),
SIZE(msg, 2))
20808 CALL mp_timeset(routinen, handle)
20810#if defined(__parallel)
20812 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_max, root, comm%handle, ierr)
20813 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20814 IF (root == comm%mepos) msg = res
20815 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20821 CALL mp_timestop(handle)
20822 END SUBROUTINE mp_max_root_rm
20832 SUBROUTINE mp_min_r (msg, comm)
20833 REAL(kind=real_4),
INTENT(INOUT) :: msg
20836 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_r'
20839#if defined(__parallel)
20840 INTEGER :: ierr, msglen
20843 CALL mp_timeset(routinen, handle)
20845#if defined(__parallel)
20847 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_min, comm%handle, ierr)
20848 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20849 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20854 CALL mp_timestop(handle)
20855 END SUBROUTINE mp_min_r
20867 SUBROUTINE mp_min_rv(msg, comm)
20868 REAL(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
20871 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_rv'
20874#if defined(__parallel)
20875 INTEGER :: ierr, msglen
20878 CALL mp_timeset(routinen, handle)
20880#if defined(__parallel)
20882 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_min, comm%handle, ierr)
20883 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20884 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20889 CALL mp_timestop(handle)
20890 END SUBROUTINE mp_min_rv
20900 SUBROUTINE mp_prod_r (msg, comm)
20901 REAL(kind=real_4),
INTENT(INOUT) :: msg
20904 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_r'
20907#if defined(__parallel)
20908 INTEGER :: ierr, msglen
20911 CALL mp_timeset(routinen, handle)
20913#if defined(__parallel)
20915 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_prod, comm%handle, ierr)
20916 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20917 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20922 CALL mp_timestop(handle)
20923 END SUBROUTINE mp_prod_r
20934 SUBROUTINE mp_scatter_rv(msg_scatter, msg, root, comm)
20935 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
20936 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
20937 INTEGER,
INTENT(IN) :: root
20940 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_rv'
20943#if defined(__parallel)
20944 INTEGER :: ierr, msglen
20947 CALL mp_timeset(routinen, handle)
20949#if defined(__parallel)
20951 CALL mpi_scatter(msg_scatter, msglen, mpi_real, msg, &
20952 msglen, mpi_real, root, comm%handle, ierr)
20953 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
20954 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
20960 CALL mp_timestop(handle)
20961 END SUBROUTINE mp_scatter_rv
20971 SUBROUTINE mp_iscatter_r (msg_scatter, msg, root, comm, request)
20972 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:)
20973 REAL(kind=real_4),
INTENT(INOUT) :: msg
20974 INTEGER,
INTENT(IN) :: root
20978 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_r'
20981#if defined(__parallel)
20982 INTEGER :: ierr, msglen
20985 CALL mp_timeset(routinen, handle)
20987#if defined(__parallel)
20988#if !defined(__GNUC__) || __GNUC__ >= 9
20989 cpassert(is_contiguous(msg_scatter))
20992 CALL mpi_iscatter(msg_scatter, msglen, mpi_real, msg, &
20993 msglen, mpi_real, root, comm%handle, request%handle, ierr)
20994 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
20995 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
20999 msg = msg_scatter(1)
21002 CALL mp_timestop(handle)
21003 END SUBROUTINE mp_iscatter_r
21013 SUBROUTINE mp_iscatter_rv2(msg_scatter, msg, root, comm, request)
21014 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:, :)
21015 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
21016 INTEGER,
INTENT(IN) :: root
21020 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_rv2'
21023#if defined(__parallel)
21024 INTEGER :: ierr, msglen
21027 CALL mp_timeset(routinen, handle)
21029#if defined(__parallel)
21030#if !defined(__GNUC__) || __GNUC__ >= 9
21031 cpassert(is_contiguous(msg_scatter))
21034 CALL mpi_iscatter(msg_scatter, msglen, mpi_real, msg, &
21035 msglen, mpi_real, root, comm%handle, request%handle, ierr)
21036 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
21037 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
21041 msg(:) = msg_scatter(:, 1)
21044 CALL mp_timestop(handle)
21045 END SUBROUTINE mp_iscatter_rv2
21055 SUBROUTINE mp_iscatterv_rv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
21056 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:)
21057 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
21058 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
21059 INTEGER,
INTENT(IN) :: recvcount, root
21063 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_rv'
21066#if defined(__parallel)
21070 CALL mp_timeset(routinen, handle)
21072#if defined(__parallel)
21073#if !defined(__GNUC__) || __GNUC__ >= 9
21074 cpassert(is_contiguous(msg_scatter))
21075 cpassert(is_contiguous(msg))
21076 cpassert(is_contiguous(sendcounts))
21077 cpassert(is_contiguous(displs))
21079 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_real, msg, &
21080 recvcount, mpi_real, root, comm%handle, request%handle, ierr)
21081 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
21082 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
21084 mark_used(sendcounts)
21086 mark_used(recvcount)
21089 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
21092 CALL mp_timestop(handle)
21093 END SUBROUTINE mp_iscatterv_rv
21104 SUBROUTINE mp_gather_r (msg, msg_gather, root, comm)
21105 REAL(kind=real_4),
INTENT(IN) :: msg
21106 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21107 INTEGER,
INTENT(IN) :: root
21110 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_r'
21113#if defined(__parallel)
21114 INTEGER :: ierr, msglen
21117 CALL mp_timeset(routinen, handle)
21119#if defined(__parallel)
21121 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21122 msglen, mpi_real, root, comm%handle, ierr)
21123 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21124 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21128 msg_gather(1) = msg
21130 CALL mp_timestop(handle)
21131 END SUBROUTINE mp_gather_r
21141 SUBROUTINE mp_gather_r_src(msg, msg_gather, comm)
21142 REAL(kind=real_4),
INTENT(IN) :: msg
21143 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21146 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_r_src'
21149#if defined(__parallel)
21150 INTEGER :: ierr, msglen
21153 CALL mp_timeset(routinen, handle)
21155#if defined(__parallel)
21157 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21158 msglen, mpi_real, comm%source, comm%handle, ierr)
21159 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21160 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21163 msg_gather(1) = msg
21165 CALL mp_timestop(handle)
21166 END SUBROUTINE mp_gather_r_src
21180 SUBROUTINE mp_gather_rv(msg, msg_gather, root, comm)
21181 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
21182 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21183 INTEGER,
INTENT(IN) :: root
21186 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rv'
21189#if defined(__parallel)
21190 INTEGER :: ierr, msglen
21193 CALL mp_timeset(routinen, handle)
21195#if defined(__parallel)
21197 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21198 msglen, mpi_real, root, comm%handle, ierr)
21199 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21200 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21206 CALL mp_timestop(handle)
21207 END SUBROUTINE mp_gather_rv
21220 SUBROUTINE mp_gather_rv_src(msg, msg_gather, comm)
21221 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
21222 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21225 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rv_src'
21228#if defined(__parallel)
21229 INTEGER :: ierr, msglen
21232 CALL mp_timeset(routinen, handle)
21234#if defined(__parallel)
21236 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21237 msglen, mpi_real, comm%source, comm%handle, ierr)
21238 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21239 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21244 CALL mp_timestop(handle)
21245 END SUBROUTINE mp_gather_rv_src
21259 SUBROUTINE mp_gather_rm(msg, msg_gather, root, comm)
21260 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
21261 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
21262 INTEGER,
INTENT(IN) :: root
21265 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rm'
21268#if defined(__parallel)
21269 INTEGER :: ierr, msglen
21272 CALL mp_timeset(routinen, handle)
21274#if defined(__parallel)
21276 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21277 msglen, mpi_real, root, comm%handle, ierr)
21278 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21279 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21285 CALL mp_timestop(handle)
21286 END SUBROUTINE mp_gather_rm
21299 SUBROUTINE mp_gather_rm_src(msg, msg_gather, comm)
21300 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
21301 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
21304 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rm_src'
21307#if defined(__parallel)
21308 INTEGER :: ierr, msglen
21311 CALL mp_timeset(routinen, handle)
21313#if defined(__parallel)
21315 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21316 msglen, mpi_real, comm%source, comm%handle, ierr)
21317 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21318 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21323 CALL mp_timestop(handle)
21324 END SUBROUTINE mp_gather_rm_src
21341 SUBROUTINE mp_gatherv_rv(sendbuf, recvbuf, recvcounts, displs, root, comm)
21343 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21344 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21345 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21346 INTEGER,
INTENT(IN) :: root
21349 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rv'
21352#if defined(__parallel)
21353 INTEGER :: ierr, sendcount
21356 CALL mp_timeset(routinen, handle)
21358#if defined(__parallel)
21359 sendcount =
SIZE(sendbuf)
21360 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21361 recvbuf, recvcounts, displs, mpi_real, &
21362 root, comm%handle, ierr)
21363 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21364 CALL add_perf(perf_id=4, &
21366 msg_size=sendcount*real_4_size)
21368 mark_used(recvcounts)
21371 recvbuf(1 + displs(1):) = sendbuf
21373 CALL mp_timestop(handle)
21374 END SUBROUTINE mp_gatherv_rv
21390 SUBROUTINE mp_gatherv_rv_src(sendbuf, recvbuf, recvcounts, displs, comm)
21392 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21393 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21394 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21397 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rv_src'
21400#if defined(__parallel)
21401 INTEGER :: ierr, sendcount
21404 CALL mp_timeset(routinen, handle)
21406#if defined(__parallel)
21407 sendcount =
SIZE(sendbuf)
21408 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21409 recvbuf, recvcounts, displs, mpi_real, &
21410 comm%source, comm%handle, ierr)
21411 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21412 CALL add_perf(perf_id=4, &
21414 msg_size=sendcount*real_4_size)
21416 mark_used(recvcounts)
21418 recvbuf(1 + displs(1):) = sendbuf
21420 CALL mp_timestop(handle)
21421 END SUBROUTINE mp_gatherv_rv_src
21438 SUBROUTINE mp_gatherv_rm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
21440 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21441 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21442 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21443 INTEGER,
INTENT(IN) :: root
21446 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rm2'
21449#if defined(__parallel)
21450 INTEGER :: ierr, sendcount
21453 CALL mp_timeset(routinen, handle)
21455#if defined(__parallel)
21456 sendcount =
SIZE(sendbuf)
21457 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21458 recvbuf, recvcounts, displs, mpi_real, &
21459 root, comm%handle, ierr)
21460 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21461 CALL add_perf(perf_id=4, &
21463 msg_size=sendcount*real_4_size)
21465 mark_used(recvcounts)
21468 recvbuf(:, 1 + displs(1):) = sendbuf
21470 CALL mp_timestop(handle)
21471 END SUBROUTINE mp_gatherv_rm2
21487 SUBROUTINE mp_gatherv_rm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
21489 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21490 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21491 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21494 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rm2_src'
21497#if defined(__parallel)
21498 INTEGER :: ierr, sendcount
21501 CALL mp_timeset(routinen, handle)
21503#if defined(__parallel)
21504 sendcount =
SIZE(sendbuf)
21505 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21506 recvbuf, recvcounts, displs, mpi_real, &
21507 comm%source, comm%handle, ierr)
21508 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21509 CALL add_perf(perf_id=4, &
21511 msg_size=sendcount*real_4_size)
21513 mark_used(recvcounts)
21515 recvbuf(:, 1 + displs(1):) = sendbuf
21517 CALL mp_timestop(handle)
21518 END SUBROUTINE mp_gatherv_rm2_src
21535 SUBROUTINE mp_igatherv_rv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
21536 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
21537 REAL(kind=real_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
21538 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21539 INTEGER,
INTENT(IN) :: sendcount, root
21543 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_rv'
21546#if defined(__parallel)
21550 CALL mp_timeset(routinen, handle)
21552#if defined(__parallel)
21553#if !defined(__GNUC__) || __GNUC__ >= 9
21554 cpassert(is_contiguous(sendbuf))
21555 cpassert(is_contiguous(recvbuf))
21556 cpassert(is_contiguous(recvcounts))
21557 cpassert(is_contiguous(displs))
21559 CALL mpi_igatherv(sendbuf, sendcount, mpi_real, &
21560 recvbuf, recvcounts, displs, mpi_real, &
21561 root, comm%handle, request%handle, ierr)
21562 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21563 CALL add_perf(perf_id=24, &
21565 msg_size=sendcount*real_4_size)
21567 mark_used(sendcount)
21568 mark_used(recvcounts)
21571 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
21574 CALL mp_timestop(handle)
21575 END SUBROUTINE mp_igatherv_rv
21588 SUBROUTINE mp_allgather_r (msgout, msgin, comm)
21589 REAL(kind=real_4),
INTENT(IN) :: msgout
21590 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
21593 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r'
21596#if defined(__parallel)
21597 INTEGER :: ierr, rcount, scount
21600 CALL mp_timeset(routinen, handle)
21602#if defined(__parallel)
21605 CALL mpi_allgather(msgout, scount, mpi_real, &
21606 msgin, rcount, mpi_real, &
21608 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21613 CALL mp_timestop(handle)
21614 END SUBROUTINE mp_allgather_r
21627 SUBROUTINE mp_allgather_r2(msgout, msgin, comm)
21628 REAL(kind=real_4),
INTENT(IN) :: msgout
21629 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
21632 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r2'
21635#if defined(__parallel)
21636 INTEGER :: ierr, rcount, scount
21639 CALL mp_timeset(routinen, handle)
21641#if defined(__parallel)
21644 CALL mpi_allgather(msgout, scount, mpi_real, &
21645 msgin, rcount, mpi_real, &
21647 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21652 CALL mp_timestop(handle)
21653 END SUBROUTINE mp_allgather_r2
21666 SUBROUTINE mp_iallgather_r (msgout, msgin, comm, request)
21667 REAL(kind=real_4),
INTENT(IN) :: msgout
21668 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
21672 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r'
21675#if defined(__parallel)
21676 INTEGER :: ierr, rcount, scount
21679 CALL mp_timeset(routinen, handle)
21681#if defined(__parallel)
21682#if !defined(__GNUC__) || __GNUC__ >= 9
21683 cpassert(is_contiguous(msgin))
21687 CALL mpi_iallgather(msgout, scount, mpi_real, &
21688 msgin, rcount, mpi_real, &
21689 comm%handle, request%handle, ierr)
21690 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21696 CALL mp_timestop(handle)
21697 END SUBROUTINE mp_iallgather_r
21712 SUBROUTINE mp_allgather_r12(msgout, msgin, comm)
21713 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
21714 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
21717 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r12'
21720#if defined(__parallel)
21721 INTEGER :: ierr, rcount, scount
21724 CALL mp_timeset(routinen, handle)
21726#if defined(__parallel)
21727 scount =
SIZE(msgout(:))
21729 CALL mpi_allgather(msgout, scount, mpi_real, &
21730 msgin, rcount, mpi_real, &
21732 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21735 msgin(:, 1) = msgout(:)
21737 CALL mp_timestop(handle)
21738 END SUBROUTINE mp_allgather_r12
21748 SUBROUTINE mp_allgather_r23(msgout, msgin, comm)
21749 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
21750 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
21753 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r23'
21756#if defined(__parallel)
21757 INTEGER :: ierr, rcount, scount
21760 CALL mp_timeset(routinen, handle)
21762#if defined(__parallel)
21763 scount =
SIZE(msgout(:, :))
21765 CALL mpi_allgather(msgout, scount, mpi_real, &
21766 msgin, rcount, mpi_real, &
21768 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21771 msgin(:, :, 1) = msgout(:, :)
21773 CALL mp_timestop(handle)
21774 END SUBROUTINE mp_allgather_r23
21784 SUBROUTINE mp_allgather_r34(msgout, msgin, comm)
21785 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
21786 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
21789 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r34'
21792#if defined(__parallel)
21793 INTEGER :: ierr, rcount, scount
21796 CALL mp_timeset(routinen, handle)
21798#if defined(__parallel)
21799 scount =
SIZE(msgout(:, :, :))
21801 CALL mpi_allgather(msgout, scount, mpi_real, &
21802 msgin, rcount, mpi_real, &
21804 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21807 msgin(:, :, :, 1) = msgout(:, :, :)
21809 CALL mp_timestop(handle)
21810 END SUBROUTINE mp_allgather_r34
21820 SUBROUTINE mp_allgather_r22(msgout, msgin, comm)
21821 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
21822 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
21825 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r22'
21828#if defined(__parallel)
21829 INTEGER :: ierr, rcount, scount
21832 CALL mp_timeset(routinen, handle)
21834#if defined(__parallel)
21835 scount =
SIZE(msgout(:, :))
21837 CALL mpi_allgather(msgout, scount, mpi_real, &
21838 msgin, rcount, mpi_real, &
21840 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21843 msgin(:, :) = msgout(:, :)
21845 CALL mp_timestop(handle)
21846 END SUBROUTINE mp_allgather_r22
21857 SUBROUTINE mp_iallgather_r11(msgout, msgin, comm, request)
21858 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
21859 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
21863 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r11'
21866#if defined(__parallel)
21867 INTEGER :: ierr, rcount, scount
21870 CALL mp_timeset(routinen, handle)
21872#if defined(__parallel)
21873#if !defined(__GNUC__) || __GNUC__ >= 9
21874 cpassert(is_contiguous(msgout))
21875 cpassert(is_contiguous(msgin))
21877 scount =
SIZE(msgout(:))
21879 CALL mpi_iallgather(msgout, scount, mpi_real, &
21880 msgin, rcount, mpi_real, &
21881 comm%handle, request%handle, ierr)
21882 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
21888 CALL mp_timestop(handle)
21889 END SUBROUTINE mp_iallgather_r11
21900 SUBROUTINE mp_iallgather_r13(msgout, msgin, comm, request)
21901 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
21902 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
21906 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r13'
21909#if defined(__parallel)
21910 INTEGER :: ierr, rcount, scount
21913 CALL mp_timeset(routinen, handle)
21915#if defined(__parallel)
21916#if !defined(__GNUC__) || __GNUC__ >= 9
21917 cpassert(is_contiguous(msgout))
21918 cpassert(is_contiguous(msgin))
21921 scount =
SIZE(msgout(:))
21923 CALL mpi_iallgather(msgout, scount, mpi_real, &
21924 msgin, rcount, mpi_real, &
21925 comm%handle, request%handle, ierr)
21926 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
21929 msgin(:, 1, 1) = msgout(:)
21932 CALL mp_timestop(handle)
21933 END SUBROUTINE mp_iallgather_r13
21944 SUBROUTINE mp_iallgather_r22(msgout, msgin, comm, request)
21945 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :)
21946 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :)
21950 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r22'
21953#if defined(__parallel)
21954 INTEGER :: ierr, rcount, scount
21957 CALL mp_timeset(routinen, handle)
21959#if defined(__parallel)
21960#if !defined(__GNUC__) || __GNUC__ >= 9
21961 cpassert(is_contiguous(msgout))
21962 cpassert(is_contiguous(msgin))
21965 scount =
SIZE(msgout(:, :))
21967 CALL mpi_iallgather(msgout, scount, mpi_real, &
21968 msgin, rcount, mpi_real, &
21969 comm%handle, request%handle, ierr)
21970 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
21973 msgin(:, :) = msgout(:, :)
21976 CALL mp_timestop(handle)
21977 END SUBROUTINE mp_iallgather_r22
21988 SUBROUTINE mp_iallgather_r24(msgout, msgin, comm, request)
21989 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :)
21990 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :, :)
21994 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r24'
21997#if defined(__parallel)
21998 INTEGER :: ierr, rcount, scount
22001 CALL mp_timeset(routinen, handle)
22003#if defined(__parallel)
22004#if !defined(__GNUC__) || __GNUC__ >= 9
22005 cpassert(is_contiguous(msgout))
22006 cpassert(is_contiguous(msgin))
22009 scount =
SIZE(msgout(:, :))
22011 CALL mpi_iallgather(msgout, scount, mpi_real, &
22012 msgin, rcount, mpi_real, &
22013 comm%handle, request%handle, ierr)
22014 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
22017 msgin(:, :, 1, 1) = msgout(:, :)
22020 CALL mp_timestop(handle)
22021 END SUBROUTINE mp_iallgather_r24
22032 SUBROUTINE mp_iallgather_r33(msgout, msgin, comm, request)
22033 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :, :)
22034 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
22038 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r33'
22041#if defined(__parallel)
22042 INTEGER :: ierr, rcount, scount
22045 CALL mp_timeset(routinen, handle)
22047#if defined(__parallel)
22048#if !defined(__GNUC__) || __GNUC__ >= 9
22049 cpassert(is_contiguous(msgout))
22050 cpassert(is_contiguous(msgin))
22053 scount =
SIZE(msgout(:, :, :))
22055 CALL mpi_iallgather(msgout, scount, mpi_real, &
22056 msgin, rcount, mpi_real, &
22057 comm%handle, request%handle, ierr)
22058 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
22061 msgin(:, :, :) = msgout(:, :, :)
22064 CALL mp_timestop(handle)
22065 END SUBROUTINE mp_iallgather_r33
22084 SUBROUTINE mp_allgatherv_rv(msgout, msgin, rcount, rdispl, comm)
22085 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
22086 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22087 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
22090 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_rv'
22093#if defined(__parallel)
22094 INTEGER :: ierr, scount
22097 CALL mp_timeset(routinen, handle)
22099#if defined(__parallel)
22100 scount =
SIZE(msgout)
22101 CALL mpi_allgatherv(msgout, scount, mpi_real, msgin, rcount, &
22102 rdispl, mpi_real, comm%handle, ierr)
22103 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
22110 CALL mp_timestop(handle)
22111 END SUBROUTINE mp_allgatherv_rv
22130 SUBROUTINE mp_allgatherv_rm2(msgout, msgin, rcount, rdispl, comm)
22131 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
22132 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
22133 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
22136 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_rv'
22139#if defined(__parallel)
22140 INTEGER :: ierr, scount
22143 CALL mp_timeset(routinen, handle)
22145#if defined(__parallel)
22146 scount =
SIZE(msgout)
22147 CALL mpi_allgatherv(msgout, scount, mpi_real, msgin, rcount, &
22148 rdispl, mpi_real, comm%handle, ierr)
22149 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
22156 CALL mp_timestop(handle)
22157 END SUBROUTINE mp_allgatherv_rm2
22176 SUBROUTINE mp_iallgatherv_rv(msgout, msgin, rcount, rdispl, comm, request)
22177 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
22178 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
22179 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
22183 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_rv'
22186#if defined(__parallel)
22187 INTEGER :: ierr, scount, rsize
22190 CALL mp_timeset(routinen, handle)
22192#if defined(__parallel)
22193#if !defined(__GNUC__) || __GNUC__ >= 9
22194 cpassert(is_contiguous(msgout))
22195 cpassert(is_contiguous(msgin))
22196 cpassert(is_contiguous(rcount))
22197 cpassert(is_contiguous(rdispl))
22200 scount =
SIZE(msgout)
22201 rsize =
SIZE(rcount)
22202 CALL mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, &
22203 rdispl, comm, request, ierr)
22204 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
22212 CALL mp_timestop(handle)
22213 END SUBROUTINE mp_iallgatherv_rv
22232 SUBROUTINE mp_iallgatherv_rv2(msgout, msgin, rcount, rdispl, comm, request)
22233 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
22234 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
22235 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
22239 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_rv2'
22242#if defined(__parallel)
22243 INTEGER :: ierr, scount, rsize
22246 CALL mp_timeset(routinen, handle)
22248#if defined(__parallel)
22249#if !defined(__GNUC__) || __GNUC__ >= 9
22250 cpassert(is_contiguous(msgout))
22251 cpassert(is_contiguous(msgin))
22252 cpassert(is_contiguous(rcount))
22253 cpassert(is_contiguous(rdispl))
22256 scount =
SIZE(msgout)
22257 rsize =
SIZE(rcount)
22258 CALL mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, &
22259 rdispl, comm, request, ierr)
22260 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
22268 CALL mp_timestop(handle)
22269 END SUBROUTINE mp_iallgatherv_rv2
22280#if defined(__parallel)
22281 SUBROUTINE mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
22282 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
22283 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22284 INTEGER,
INTENT(IN) :: rsize
22285 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
22288 INTEGER,
INTENT(INOUT) :: ierr
22290 CALL mpi_iallgatherv(msgout, scount, mpi_real, msgin, rcount, &
22291 rdispl, mpi_real, comm%handle, request%handle, ierr)
22293 END SUBROUTINE mp_iallgatherv_rv_internal
22304 SUBROUTINE mp_sum_scatter_rv(msgout, msgin, rcount, comm)
22305 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
22306 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22307 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
22310 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_rv'
22313#if defined(__parallel)
22317 CALL mp_timeset(routinen, handle)
22319#if defined(__parallel)
22320 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_real, mpi_sum, &
22322 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
22324 CALL add_perf(perf_id=3, count=1, &
22325 msg_size=rcount(1)*2*real_4_size)
22329 msgin = msgout(:, 1)
22331 CALL mp_timestop(handle)
22332 END SUBROUTINE mp_sum_scatter_rv
22343 SUBROUTINE mp_sendrecv_r (msgin, dest, msgout, source, comm, tag)
22344 REAL(kind=real_4),
INTENT(IN) :: msgin
22345 INTEGER,
INTENT(IN) :: dest
22346 REAL(kind=real_4),
INTENT(OUT) :: msgout
22347 INTEGER,
INTENT(IN) :: source
22349 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22351 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_r'
22354#if defined(__parallel)
22355 INTEGER :: ierr, msglen_in, msglen_out, &
22359 CALL mp_timeset(routinen, handle)
22361#if defined(__parallel)
22366 IF (
PRESENT(tag))
THEN
22370 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22371 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22372 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22373 CALL add_perf(perf_id=7, count=1, &
22374 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22382 CALL mp_timestop(handle)
22383 END SUBROUTINE mp_sendrecv_r
22394 SUBROUTINE mp_sendrecv_rv(msgin, dest, msgout, source, comm, tag)
22395 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
22396 INTEGER,
INTENT(IN) :: dest
22397 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
22398 INTEGER,
INTENT(IN) :: source
22400 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22402 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rv'
22405#if defined(__parallel)
22406 INTEGER :: ierr, msglen_in, msglen_out, &
22410 CALL mp_timeset(routinen, handle)
22412#if defined(__parallel)
22413 msglen_in =
SIZE(msgin)
22414 msglen_out =
SIZE(msgout)
22417 IF (
PRESENT(tag))
THEN
22421 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22422 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22423 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22424 CALL add_perf(perf_id=7, count=1, &
22425 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22433 CALL mp_timestop(handle)
22434 END SUBROUTINE mp_sendrecv_rv
22446 SUBROUTINE mp_sendrecv_rm2(msgin, dest, msgout, source, comm, tag)
22447 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
22448 INTEGER,
INTENT(IN) :: dest
22449 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
22450 INTEGER,
INTENT(IN) :: source
22452 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22454 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm2'
22457#if defined(__parallel)
22458 INTEGER :: ierr, msglen_in, msglen_out, &
22462 CALL mp_timeset(routinen, handle)
22464#if defined(__parallel)
22465 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
22466 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
22469 IF (
PRESENT(tag))
THEN
22473 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22474 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22475 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22476 CALL add_perf(perf_id=7, count=1, &
22477 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22485 CALL mp_timestop(handle)
22486 END SUBROUTINE mp_sendrecv_rm2
22497 SUBROUTINE mp_sendrecv_rm3(msgin, dest, msgout, source, comm, tag)
22498 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
22499 INTEGER,
INTENT(IN) :: dest
22500 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
22501 INTEGER,
INTENT(IN) :: source
22503 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22505 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm3'
22508#if defined(__parallel)
22509 INTEGER :: ierr, msglen_in, msglen_out, &
22513 CALL mp_timeset(routinen, handle)
22515#if defined(__parallel)
22516 msglen_in =
SIZE(msgin)
22517 msglen_out =
SIZE(msgout)
22520 IF (
PRESENT(tag))
THEN
22524 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22525 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22526 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22527 CALL add_perf(perf_id=7, count=1, &
22528 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22536 CALL mp_timestop(handle)
22537 END SUBROUTINE mp_sendrecv_rm3
22548 SUBROUTINE mp_sendrecv_rm4(msgin, dest, msgout, source, comm, tag)
22549 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
22550 INTEGER,
INTENT(IN) :: dest
22551 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
22552 INTEGER,
INTENT(IN) :: source
22554 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22556 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm4'
22559#if defined(__parallel)
22560 INTEGER :: ierr, msglen_in, msglen_out, &
22564 CALL mp_timeset(routinen, handle)
22566#if defined(__parallel)
22567 msglen_in =
SIZE(msgin)
22568 msglen_out =
SIZE(msgout)
22571 IF (
PRESENT(tag))
THEN
22575 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22576 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22577 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22578 CALL add_perf(perf_id=7, count=1, &
22579 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22587 CALL mp_timestop(handle)
22588 END SUBROUTINE mp_sendrecv_rm4
22605 SUBROUTINE mp_isendrecv_r (msgin, dest, msgout, source, comm, send_request, &
22607 REAL(kind=real_4),
INTENT(IN) :: msgin
22608 INTEGER,
INTENT(IN) :: dest
22609 REAL(kind=real_4),
INTENT(INOUT) :: msgout
22610 INTEGER,
INTENT(IN) :: source
22613 INTEGER,
INTENT(in),
OPTIONAL :: tag
22615 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_r'
22618#if defined(__parallel)
22619 INTEGER :: ierr, my_tag
22622 CALL mp_timeset(routinen, handle)
22624#if defined(__parallel)
22626 IF (
PRESENT(tag)) my_tag = tag
22628 CALL mpi_irecv(msgout, 1, mpi_real, source, my_tag, &
22629 comm%handle, recv_request%handle, ierr)
22630 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
22632 CALL mpi_isend(msgin, 1, mpi_real, dest, my_tag, &
22633 comm%handle, send_request%handle, ierr)
22634 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22636 CALL add_perf(perf_id=8, count=1, msg_size=2*real_4_size)
22646 CALL mp_timestop(handle)
22647 END SUBROUTINE mp_isendrecv_r
22666 SUBROUTINE mp_isendrecv_rv(msgin, dest, msgout, source, comm, send_request, &
22668 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
22669 INTEGER,
INTENT(IN) :: dest
22670 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
22671 INTEGER,
INTENT(IN) :: source
22674 INTEGER,
INTENT(in),
OPTIONAL :: tag
22676 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_rv'
22679#if defined(__parallel)
22680 INTEGER :: ierr, msglen, my_tag
22681 REAL(kind=real_4) :: foo
22684 CALL mp_timeset(routinen, handle)
22686#if defined(__parallel)
22687#if !defined(__GNUC__) || __GNUC__ >= 9
22688 cpassert(is_contiguous(msgout))
22689 cpassert(is_contiguous(msgin))
22693 IF (
PRESENT(tag)) my_tag = tag
22695 msglen =
SIZE(msgout, 1)
22696 IF (msglen > 0)
THEN
22697 CALL mpi_irecv(msgout(1), msglen, mpi_real, source, my_tag, &
22698 comm%handle, recv_request%handle, ierr)
22700 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
22701 comm%handle, recv_request%handle, ierr)
22703 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
22705 msglen =
SIZE(msgin, 1)
22706 IF (msglen > 0)
THEN
22707 CALL mpi_isend(msgin(1), msglen, mpi_real, dest, my_tag, &
22708 comm%handle, send_request%handle, ierr)
22710 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22711 comm%handle, send_request%handle, ierr)
22713 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22715 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
22716 CALL add_perf(perf_id=8, count=1, msg_size=msglen*real_4_size)
22726 CALL mp_timestop(handle)
22727 END SUBROUTINE mp_isendrecv_rv
22742 SUBROUTINE mp_isend_rv(msgin, dest, comm, request, tag)
22743 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
22744 INTEGER,
INTENT(IN) :: dest
22747 INTEGER,
INTENT(in),
OPTIONAL :: tag
22749 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rv'
22751 INTEGER :: handle, ierr
22752#if defined(__parallel)
22753 INTEGER :: msglen, my_tag
22754 REAL(kind=real_4) :: foo(1)
22757 CALL mp_timeset(routinen, handle)
22759#if defined(__parallel)
22760#if !defined(__GNUC__) || __GNUC__ >= 9
22761 cpassert(is_contiguous(msgin))
22764 IF (
PRESENT(tag)) my_tag = tag
22766 msglen =
SIZE(msgin)
22767 IF (msglen > 0)
THEN
22768 CALL mpi_isend(msgin(1), msglen, mpi_real, dest, my_tag, &
22769 comm%handle, request%handle, ierr)
22771 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22772 comm%handle, request%handle, ierr)
22774 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22776 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22785 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22787 CALL mp_timestop(handle)
22788 END SUBROUTINE mp_isend_rv
22805 SUBROUTINE mp_isend_rm2(msgin, dest, comm, request, tag)
22806 REAL(kind=real_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
22807 INTEGER,
INTENT(IN) :: dest
22810 INTEGER,
INTENT(in),
OPTIONAL :: tag
22812 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm2'
22814 INTEGER :: handle, ierr
22815#if defined(__parallel)
22816 INTEGER :: msglen, my_tag
22817 REAL(kind=real_4) :: foo(1)
22820 CALL mp_timeset(routinen, handle)
22822#if defined(__parallel)
22823#if !defined(__GNUC__) || __GNUC__ >= 9
22824 cpassert(is_contiguous(msgin))
22828 IF (
PRESENT(tag)) my_tag = tag
22830 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
22831 IF (msglen > 0)
THEN
22832 CALL mpi_isend(msgin(1, 1), msglen, mpi_real, dest, my_tag, &
22833 comm%handle, request%handle, ierr)
22835 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22836 comm%handle, request%handle, ierr)
22838 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22840 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22849 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22851 CALL mp_timestop(handle)
22852 END SUBROUTINE mp_isend_rm2
22871 SUBROUTINE mp_isend_rm3(msgin, dest, comm, request, tag)
22872 REAL(kind=real_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
22873 INTEGER,
INTENT(IN) :: dest
22876 INTEGER,
INTENT(in),
OPTIONAL :: tag
22878 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm3'
22880 INTEGER :: handle, ierr
22881#if defined(__parallel)
22882 INTEGER :: msglen, my_tag
22883 REAL(kind=real_4) :: foo(1)
22886 CALL mp_timeset(routinen, handle)
22888#if defined(__parallel)
22889#if !defined(__GNUC__) || __GNUC__ >= 9
22890 cpassert(is_contiguous(msgin))
22894 IF (
PRESENT(tag)) my_tag = tag
22896 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
22897 IF (msglen > 0)
THEN
22898 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_real, dest, my_tag, &
22899 comm%handle, request%handle, ierr)
22901 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22902 comm%handle, request%handle, ierr)
22904 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22906 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22915 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22917 CALL mp_timestop(handle)
22918 END SUBROUTINE mp_isend_rm3
22934 SUBROUTINE mp_isend_rm4(msgin, dest, comm, request, tag)
22935 REAL(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
22936 INTEGER,
INTENT(IN) :: dest
22939 INTEGER,
INTENT(in),
OPTIONAL :: tag
22941 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm4'
22943 INTEGER :: handle, ierr
22944#if defined(__parallel)
22945 INTEGER :: msglen, my_tag
22946 REAL(kind=real_4) :: foo(1)
22949 CALL mp_timeset(routinen, handle)
22951#if defined(__parallel)
22952#if !defined(__GNUC__) || __GNUC__ >= 9
22953 cpassert(is_contiguous(msgin))
22957 IF (
PRESENT(tag)) my_tag = tag
22959 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
22960 IF (msglen > 0)
THEN
22961 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_real, dest, my_tag, &
22962 comm%handle, request%handle, ierr)
22964 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22965 comm%handle, request%handle, ierr)
22967 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22969 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22978 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22980 CALL mp_timestop(handle)
22981 END SUBROUTINE mp_isend_rm4
22997 SUBROUTINE mp_irecv_rv(msgout, source, comm, request, tag)
22998 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
22999 INTEGER,
INTENT(IN) :: source
23002 INTEGER,
INTENT(in),
OPTIONAL :: tag
23004 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rv'
23007#if defined(__parallel)
23008 INTEGER :: ierr, msglen, my_tag
23009 REAL(kind=real_4) :: foo(1)
23012 CALL mp_timeset(routinen, handle)
23014#if defined(__parallel)
23015#if !defined(__GNUC__) || __GNUC__ >= 9
23016 cpassert(is_contiguous(msgout))
23020 IF (
PRESENT(tag)) my_tag = tag
23022 msglen =
SIZE(msgout)
23023 IF (msglen > 0)
THEN
23024 CALL mpi_irecv(msgout(1), msglen, mpi_real, source, my_tag, &
23025 comm%handle, request%handle, ierr)
23027 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23028 comm%handle, request%handle, ierr)
23030 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
23032 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23034 cpabort(
"mp_irecv called in non parallel case")
23041 CALL mp_timestop(handle)
23042 END SUBROUTINE mp_irecv_rv
23059 SUBROUTINE mp_irecv_rm2(msgout, source, comm, request, tag)
23060 REAL(kind=real_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
23061 INTEGER,
INTENT(IN) :: source
23064 INTEGER,
INTENT(in),
OPTIONAL :: tag
23066 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm2'
23069#if defined(__parallel)
23070 INTEGER :: ierr, msglen, my_tag
23071 REAL(kind=real_4) :: foo(1)
23074 CALL mp_timeset(routinen, handle)
23076#if defined(__parallel)
23077#if !defined(__GNUC__) || __GNUC__ >= 9
23078 cpassert(is_contiguous(msgout))
23082 IF (
PRESENT(tag)) my_tag = tag
23084 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
23085 IF (msglen > 0)
THEN
23086 CALL mpi_irecv(msgout(1, 1), msglen, mpi_real, source, my_tag, &
23087 comm%handle, request%handle, ierr)
23089 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23090 comm%handle, request%handle, ierr)
23092 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
23094 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23101 cpabort(
"mp_irecv called in non parallel case")
23103 CALL mp_timestop(handle)
23104 END SUBROUTINE mp_irecv_rm2
23122 SUBROUTINE mp_irecv_rm3(msgout, source, comm, request, tag)
23123 REAL(kind=real_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
23124 INTEGER,
INTENT(IN) :: source
23127 INTEGER,
INTENT(in),
OPTIONAL :: tag
23129 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm3'
23132#if defined(__parallel)
23133 INTEGER :: ierr, msglen, my_tag
23134 REAL(kind=real_4) :: foo(1)
23137 CALL mp_timeset(routinen, handle)
23139#if defined(__parallel)
23140#if !defined(__GNUC__) || __GNUC__ >= 9
23141 cpassert(is_contiguous(msgout))
23145 IF (
PRESENT(tag)) my_tag = tag
23147 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
23148 IF (msglen > 0)
THEN
23149 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_real, source, my_tag, &
23150 comm%handle, request%handle, ierr)
23152 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23153 comm%handle, request%handle, ierr)
23155 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
23157 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23164 cpabort(
"mp_irecv called in non parallel case")
23166 CALL mp_timestop(handle)
23167 END SUBROUTINE mp_irecv_rm3
23183 SUBROUTINE mp_irecv_rm4(msgout, source, comm, request, tag)
23184 REAL(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
23185 INTEGER,
INTENT(IN) :: source
23188 INTEGER,
INTENT(in),
OPTIONAL :: tag
23190 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm4'
23193#if defined(__parallel)
23194 INTEGER :: ierr, msglen, my_tag
23195 REAL(kind=real_4) :: foo(1)
23198 CALL mp_timeset(routinen, handle)
23200#if defined(__parallel)
23201#if !defined(__GNUC__) || __GNUC__ >= 9
23202 cpassert(is_contiguous(msgout))
23206 IF (
PRESENT(tag)) my_tag = tag
23208 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
23209 IF (msglen > 0)
THEN
23210 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_real, source, my_tag, &
23211 comm%handle, request%handle, ierr)
23213 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23214 comm%handle, request%handle, ierr)
23216 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
23218 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23225 cpabort(
"mp_irecv called in non parallel case")
23227 CALL mp_timestop(handle)
23228 END SUBROUTINE mp_irecv_rm4
23240 SUBROUTINE mp_win_create_rv(base, comm, win)
23241 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
23245 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_rv'
23248#if defined(__parallel)
23250 INTEGER(kind=mpi_address_kind) :: len
23251 REAL(kind=real_4) :: foo(1)
23254 CALL mp_timeset(routinen, handle)
23256#if defined(__parallel)
23258 len =
SIZE(base)*real_4_size
23260 CALL mpi_win_create(base(1), len, real_4_size, mpi_info_null, comm%handle, win%handle, ierr)
23262 CALL mpi_win_create(foo, len, real_4_size, mpi_info_null, comm%handle, win%handle, ierr)
23264 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
23266 CALL add_perf(perf_id=20, count=1)
23270 win%handle = mp_win_null_handle
23272 CALL mp_timestop(handle)
23273 END SUBROUTINE mp_win_create_rv
23285 SUBROUTINE mp_rget_rv(base, source, win, win_data, myproc, disp, request, &
23286 origin_datatype, target_datatype)
23287 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
23288 INTEGER,
INTENT(IN) :: source
23290 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: win_data
23291 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
23295 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_rv'
23298#if defined(__parallel)
23299 INTEGER :: ierr, len, &
23300 origin_len, target_len
23301 LOGICAL :: do_local_copy
23302 INTEGER(kind=mpi_address_kind) :: disp_aint
23303 mpi_data_type :: handle_origin_datatype, handle_target_datatype
23306 CALL mp_timeset(routinen, handle)
23308#if defined(__parallel)
23311 IF (
PRESENT(disp))
THEN
23312 disp_aint = int(disp, kind=mpi_address_kind)
23314 handle_origin_datatype = mpi_real
23316 IF (
PRESENT(origin_datatype))
THEN
23317 handle_origin_datatype = origin_datatype%type_handle
23320 handle_target_datatype = mpi_real
23322 IF (
PRESENT(target_datatype))
THEN
23323 handle_target_datatype = target_datatype%type_handle
23327 do_local_copy = .false.
23328 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
23329 IF (myproc .EQ. source) do_local_copy = .true.
23331 IF (do_local_copy)
THEN
23333 base(:) = win_data(disp_aint + 1:disp_aint + len)
23338 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
23339 target_len, handle_target_datatype, win%handle, request%handle, ierr)
23345 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
23347 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*real_4_size)
23352 mark_used(origin_datatype)
23353 mark_used(target_datatype)
23357 IF (
PRESENT(disp))
THEN
23358 base(:) = win_data(disp + 1:disp +
SIZE(base))
23360 base(:) = win_data(:
SIZE(base))
23364 CALL mp_timestop(handle)
23365 END SUBROUTINE mp_rget_rv
23375 result(type_descriptor)
23376 INTEGER,
INTENT(IN) :: count
23377 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
23380 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_r'
23383#if defined(__parallel)
23387 CALL mp_timeset(routinen, handle)
23389#if defined(__parallel)
23390 CALL mpi_type_indexed(count, lengths, displs, mpi_real, &
23391 type_descriptor%type_handle, ierr)
23393 cpabort(
"MPI_Type_Indexed @ "//routinen)
23394 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
23396 cpabort(
"MPI_Type_commit @ "//routinen)
23398 type_descriptor%type_handle = 1
23400 type_descriptor%length = count
23401 NULLIFY (type_descriptor%subtype)
23402 type_descriptor%vector_descriptor(1:2) = 1
23403 type_descriptor%has_indexing = .true.
23404 type_descriptor%index_descriptor%index => lengths
23405 type_descriptor%index_descriptor%chunks => displs
23407 CALL mp_timestop(handle)
23418 SUBROUTINE mp_allocate_r (DATA, len, stat)
23419 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23420 INTEGER,
INTENT(IN) :: len
23421 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23423 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_r'
23425 INTEGER :: handle, ierr
23427 CALL mp_timeset(routinen, handle)
23429#if defined(__parallel)
23431 CALL mp_alloc_mem(
DATA, len, stat=ierr)
23432 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
23433 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
23434 CALL add_perf(perf_id=15, count=1)
23436 ALLOCATE (
DATA(len), stat=ierr)
23437 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
23438 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
23440 IF (
PRESENT(stat)) stat = ierr
23441 CALL mp_timestop(handle)
23442 END SUBROUTINE mp_allocate_r
23450 SUBROUTINE mp_deallocate_r (DATA, stat)
23451 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23452 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23454 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_r'
23457#if defined(__parallel)
23461 CALL mp_timeset(routinen, handle)
23463#if defined(__parallel)
23464 CALL mp_free_mem(
DATA, ierr)
23465 IF (
PRESENT(stat))
THEN
23468 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
23471 CALL add_perf(perf_id=15, count=1)
23474 IF (
PRESENT(stat)) stat = 0
23476 CALL mp_timestop(handle)
23477 END SUBROUTINE mp_deallocate_r
23490 SUBROUTINE mp_file_write_at_rv(fh, offset, msg, msglen)
23491 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
23493 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23494 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23497#if defined(__parallel)
23501 msg_len =
SIZE(msg)
23502 IF (
PRESENT(msglen)) msg_len = msglen
23503#if defined(__parallel)
23504 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23506 cpabort(
"mpi_file_write_at_rv @ mp_file_write_at_rv")
23508 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23510 END SUBROUTINE mp_file_write_at_rv
23518 SUBROUTINE mp_file_write_at_r (fh, offset, msg)
23519 REAL(kind=real_4),
INTENT(IN) :: msg
23521 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23523#if defined(__parallel)
23527 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23529 cpabort(
"mpi_file_write_at_r @ mp_file_write_at_r")
23531 WRITE (unit=fh%handle, pos=offset + 1) msg
23533 END SUBROUTINE mp_file_write_at_r
23545 SUBROUTINE mp_file_write_at_all_rv(fh, offset, msg, msglen)
23546 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
23548 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23549 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23552#if defined(__parallel)
23556 msg_len =
SIZE(msg)
23557 IF (
PRESENT(msglen)) msg_len = msglen
23558#if defined(__parallel)
23559 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23561 cpabort(
"mpi_file_write_at_all_rv @ mp_file_write_at_all_rv")
23563 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23565 END SUBROUTINE mp_file_write_at_all_rv
23573 SUBROUTINE mp_file_write_at_all_r (fh, offset, msg)
23574 REAL(kind=real_4),
INTENT(IN) :: msg
23576 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23578#if defined(__parallel)
23582 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23584 cpabort(
"mpi_file_write_at_all_r @ mp_file_write_at_all_r")
23586 WRITE (unit=fh%handle, pos=offset + 1) msg
23588 END SUBROUTINE mp_file_write_at_all_r
23601 SUBROUTINE mp_file_read_at_rv(fh, offset, msg, msglen)
23602 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
23604 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23605 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23608#if defined(__parallel)
23612 msg_len =
SIZE(msg)
23613 IF (
PRESENT(msglen)) msg_len = msglen
23614#if defined(__parallel)
23615 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23617 cpabort(
"mpi_file_read_at_rv @ mp_file_read_at_rv")
23619 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23621 END SUBROUTINE mp_file_read_at_rv
23629 SUBROUTINE mp_file_read_at_r (fh, offset, msg)
23630 REAL(kind=real_4),
INTENT(OUT) :: msg
23632 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23634#if defined(__parallel)
23638 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23640 cpabort(
"mpi_file_read_at_r @ mp_file_read_at_r")
23642 READ (unit=fh%handle, pos=offset + 1) msg
23644 END SUBROUTINE mp_file_read_at_r
23656 SUBROUTINE mp_file_read_at_all_rv(fh, offset, msg, msglen)
23657 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
23659 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23660 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23663#if defined(__parallel)
23667 msg_len =
SIZE(msg)
23668 IF (
PRESENT(msglen)) msg_len = msglen
23669#if defined(__parallel)
23670 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23672 cpabort(
"mpi_file_read_at_all_rv @ mp_file_read_at_all_rv")
23674 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23676 END SUBROUTINE mp_file_read_at_all_rv
23684 SUBROUTINE mp_file_read_at_all_r (fh, offset, msg)
23685 REAL(kind=real_4),
INTENT(OUT) :: msg
23687 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23689#if defined(__parallel)
23693 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23695 cpabort(
"mpi_file_read_at_all_r @ mp_file_read_at_all_r")
23697 READ (unit=fh%handle, pos=offset + 1) msg
23699 END SUBROUTINE mp_file_read_at_all_r
23708 FUNCTION mp_type_make_r (ptr, &
23709 vector_descriptor, index_descriptor) &
23710 result(type_descriptor)
23711 REAL(kind=real_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
23712 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
23713 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
23716 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_r'
23718#if defined(__parallel)
23722 NULLIFY (type_descriptor%subtype)
23723 type_descriptor%length =
SIZE(ptr)
23724#if defined(__parallel)
23725 type_descriptor%type_handle = mpi_real
23726 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
23728 cpabort(
"MPI_Get_address @ "//routinen)
23730 type_descriptor%type_handle = 1
23732 type_descriptor%vector_descriptor(1:2) = 1
23733 type_descriptor%has_indexing = .false.
23734 type_descriptor%data_r => ptr
23735 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
23736 cpabort(routinen//
": Vectors and indices NYI")
23738 END FUNCTION mp_type_make_r
23747 SUBROUTINE mp_alloc_mem_r (DATA, len, stat)
23748 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23749 INTEGER,
INTENT(IN) :: len
23750 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23752#if defined(__parallel)
23753 INTEGER :: size, ierr, length, &
23755 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
23756 TYPE(c_ptr) :: mp_baseptr
23757 mpi_info_type :: mp_info
23759 length = max(len, 1)
23760 CALL mpi_type_size(mpi_real,
size, ierr)
23761 mp_size = int(length, kind=mpi_address_kind)*
size
23762 IF (mp_size .GT. mp_max_memory_size)
THEN
23763 cpabort(
"MPI cannot allocate more than 2 GiByte")
23765 mp_info = mpi_info_null
23766 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
23767 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
23768 IF (
PRESENT(stat)) stat = mp_res
23770 INTEGER :: length, mystat
23771 length = max(len, 1)
23772 IF (
PRESENT(stat))
THEN
23773 ALLOCATE (
DATA(length), stat=mystat)
23776 ALLOCATE (
DATA(length))
23779 END SUBROUTINE mp_alloc_mem_r
23787 SUBROUTINE mp_free_mem_r (DATA, stat)
23788 REAL(kind=real_4),
DIMENSION(:), &
23789 POINTER, asynchronous ::
DATA
23790 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23792#if defined(__parallel)
23794 CALL mpi_free_mem(
DATA, mp_res)
23795 IF (
PRESENT(stat)) stat = mp_res
23798 IF (
PRESENT(stat)) stat = 0
23800 END SUBROUTINE mp_free_mem_r
23812 SUBROUTINE mp_shift_zm(msg, comm, displ_in)
23814 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
23816 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
23818 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_zm'
23820 INTEGER :: handle, ierror
23821#if defined(__parallel)
23822 INTEGER :: displ, left, &
23823 msglen, myrank, nprocs, &
23828 CALL mp_timeset(routinen, handle)
23830#if defined(__parallel)
23831 CALL mpi_comm_rank(comm%handle, myrank, ierror)
23832 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
23833 CALL mpi_comm_size(comm%handle, nprocs, ierror)
23834 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
23835 IF (
PRESENT(displ_in))
THEN
23840 right =
modulo(myrank + displ, nprocs)
23841 left =
modulo(myrank - displ, nprocs)
23844 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_complex, right, tag, left, tag, &
23845 comm%handle, mpi_status_ignore, ierror)
23846 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
23847 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_8_size))
23851 mark_used(displ_in)
23853 CALL mp_timestop(handle)
23855 END SUBROUTINE mp_shift_zm
23868 SUBROUTINE mp_shift_z (msg, comm, displ_in)
23870 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
23872 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
23874 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_z'
23876 INTEGER :: handle, ierror
23877#if defined(__parallel)
23878 INTEGER :: displ, left, &
23879 msglen, myrank, nprocs, &
23884 CALL mp_timeset(routinen, handle)
23886#if defined(__parallel)
23887 CALL mpi_comm_rank(comm%handle, myrank, ierror)
23888 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
23889 CALL mpi_comm_size(comm%handle, nprocs, ierror)
23890 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
23891 IF (
PRESENT(displ_in))
THEN
23896 right =
modulo(myrank + displ, nprocs)
23897 left =
modulo(myrank - displ, nprocs)
23900 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_complex, right, tag, left, &
23901 tag, comm%handle, mpi_status_ignore, ierror)
23902 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
23903 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_8_size))
23907 mark_used(displ_in)
23909 CALL mp_timestop(handle)
23911 END SUBROUTINE mp_shift_z
23932 SUBROUTINE mp_alltoall_z11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
23934 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
23935 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
23936 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
23937 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
23940 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z11v'
23943#if defined(__parallel)
23944 INTEGER :: ierr, msglen
23949 CALL mp_timeset(routinen, handle)
23951#if defined(__parallel)
23952 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_complex, &
23953 rb, rcount, rdispl, mpi_double_complex, comm%handle, ierr)
23954 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
23955 msglen = sum(scount) + sum(rcount)
23956 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
23962 DO i = 1, rcount(1)
23963 rb(rdispl(1) + i) = sb(sdispl(1) + i)
23966 CALL mp_timestop(handle)
23968 END SUBROUTINE mp_alltoall_z11v
23983 SUBROUTINE mp_alltoall_z22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
23985 COMPLEX(kind=real_8),
DIMENSION(:, :), &
23986 INTENT(IN),
CONTIGUOUS :: sb
23987 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
23988 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS, &
23989 INTENT(INOUT) :: rb
23990 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
23993 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z22v'
23996#if defined(__parallel)
23997 INTEGER :: ierr, msglen
24000 CALL mp_timeset(routinen, handle)
24002#if defined(__parallel)
24003 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_complex, &
24004 rb, rcount, rdispl, mpi_double_complex, comm%handle, ierr)
24005 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
24006 msglen = sum(scount) + sum(rcount)
24007 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*(2*real_8_size))
24016 CALL mp_timestop(handle)
24018 END SUBROUTINE mp_alltoall_z22v
24035 SUBROUTINE mp_alltoall_z (sb, rb, count, comm)
24037 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
24038 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
24039 INTEGER,
INTENT(IN) :: count
24042 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z'
24045#if defined(__parallel)
24046 INTEGER :: ierr, msglen, np
24049 CALL mp_timeset(routinen, handle)
24051#if defined(__parallel)
24052 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24053 rb, count, mpi_double_complex, comm%handle, ierr)
24054 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24055 CALL mpi_comm_size(comm%handle, np, ierr)
24056 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24057 msglen = 2*count*np
24058 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24064 CALL mp_timestop(handle)
24066 END SUBROUTINE mp_alltoall_z
24076 SUBROUTINE mp_alltoall_z22(sb, rb, count, comm)
24078 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
24079 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
24080 INTEGER,
INTENT(IN) :: count
24083 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z22'
24086#if defined(__parallel)
24087 INTEGER :: ierr, msglen, np
24090 CALL mp_timeset(routinen, handle)
24092#if defined(__parallel)
24093 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24094 rb, count, mpi_double_complex, comm%handle, ierr)
24095 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24096 CALL mpi_comm_size(comm%handle, np, ierr)
24097 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24098 msglen = 2*
SIZE(sb)*np
24099 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24105 CALL mp_timestop(handle)
24107 END SUBROUTINE mp_alltoall_z22
24117 SUBROUTINE mp_alltoall_z33(sb, rb, count, comm)
24119 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
24120 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
24121 INTEGER,
INTENT(IN) :: count
24124 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z33'
24127#if defined(__parallel)
24128 INTEGER :: ierr, msglen, np
24131 CALL mp_timeset(routinen, handle)
24133#if defined(__parallel)
24134 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24135 rb, count, mpi_double_complex, comm%handle, ierr)
24136 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24137 CALL mpi_comm_size(comm%handle, np, ierr)
24138 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24139 msglen = 2*count*np
24140 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24146 CALL mp_timestop(handle)
24148 END SUBROUTINE mp_alltoall_z33
24158 SUBROUTINE mp_alltoall_z44(sb, rb, count, comm)
24160 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24162 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24164 INTEGER,
INTENT(IN) :: count
24167 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z44'
24170#if defined(__parallel)
24171 INTEGER :: ierr, msglen, np
24174 CALL mp_timeset(routinen, handle)
24176#if defined(__parallel)
24177 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24178 rb, count, mpi_double_complex, comm%handle, ierr)
24179 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24180 CALL mpi_comm_size(comm%handle, np, ierr)
24181 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24182 msglen = 2*count*np
24183 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24189 CALL mp_timestop(handle)
24191 END SUBROUTINE mp_alltoall_z44
24201 SUBROUTINE mp_alltoall_z55(sb, rb, count, comm)
24203 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
24205 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
24207 INTEGER,
INTENT(IN) :: count
24210 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z55'
24213#if defined(__parallel)
24214 INTEGER :: ierr, msglen, np
24217 CALL mp_timeset(routinen, handle)
24219#if defined(__parallel)
24220 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24221 rb, count, mpi_double_complex, comm%handle, ierr)
24222 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24223 CALL mpi_comm_size(comm%handle, np, ierr)
24224 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24225 msglen = 2*count*np
24226 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24232 CALL mp_timestop(handle)
24234 END SUBROUTINE mp_alltoall_z55
24245 SUBROUTINE mp_alltoall_z45(sb, rb, count, comm)
24247 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24249 COMPLEX(kind=real_8), &
24250 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
24251 INTEGER,
INTENT(IN) :: count
24254 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z45'
24257#if defined(__parallel)
24258 INTEGER :: ierr, msglen, np
24261 CALL mp_timeset(routinen, handle)
24263#if defined(__parallel)
24264 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24265 rb, count, mpi_double_complex, comm%handle, ierr)
24266 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24267 CALL mpi_comm_size(comm%handle, np, ierr)
24268 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24269 msglen = 2*count*np
24270 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24274 rb = reshape(sb, shape(rb))
24276 CALL mp_timestop(handle)
24278 END SUBROUTINE mp_alltoall_z45
24289 SUBROUTINE mp_alltoall_z34(sb, rb, count, comm)
24291 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
24293 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24295 INTEGER,
INTENT(IN) :: count
24298 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z34'
24301#if defined(__parallel)
24302 INTEGER :: ierr, msglen, np
24305 CALL mp_timeset(routinen, handle)
24307#if defined(__parallel)
24308 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24309 rb, count, mpi_double_complex, comm%handle, ierr)
24310 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24311 CALL mpi_comm_size(comm%handle, np, ierr)
24312 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24313 msglen = 2*count*np
24314 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24318 rb = reshape(sb, shape(rb))
24320 CALL mp_timestop(handle)
24322 END SUBROUTINE mp_alltoall_z34
24333 SUBROUTINE mp_alltoall_z54(sb, rb, count, comm)
24335 COMPLEX(kind=real_8), &
24336 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
24337 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24339 INTEGER,
INTENT(IN) :: count
24342 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z54'
24345#if defined(__parallel)
24346 INTEGER :: ierr, msglen, np
24349 CALL mp_timeset(routinen, handle)
24351#if defined(__parallel)
24352 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24353 rb, count, mpi_double_complex, comm%handle, ierr)
24354 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24355 CALL mpi_comm_size(comm%handle, np, ierr)
24356 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24357 msglen = 2*count*np
24358 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24362 rb = reshape(sb, shape(rb))
24364 CALL mp_timestop(handle)
24366 END SUBROUTINE mp_alltoall_z54
24377 SUBROUTINE mp_send_z (msg, dest, tag, comm)
24378 COMPLEX(kind=real_8),
INTENT(IN) :: msg
24379 INTEGER,
INTENT(IN) :: dest, tag
24382 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_z'
24385#if defined(__parallel)
24386 INTEGER :: ierr, msglen
24389 CALL mp_timeset(routinen, handle)
24391#if defined(__parallel)
24393 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24394 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24395 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24402 cpabort(
"not in parallel mode")
24404 CALL mp_timestop(handle)
24405 END SUBROUTINE mp_send_z
24415 SUBROUTINE mp_send_zv(msg, dest, tag, comm)
24416 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
24417 INTEGER,
INTENT(IN) :: dest, tag
24420 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_zv'
24423#if defined(__parallel)
24424 INTEGER :: ierr, msglen
24427 CALL mp_timeset(routinen, handle)
24429#if defined(__parallel)
24431 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24432 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24433 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24440 cpabort(
"not in parallel mode")
24442 CALL mp_timestop(handle)
24443 END SUBROUTINE mp_send_zv
24453 SUBROUTINE mp_send_zm2(msg, dest, tag, comm)
24454 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
24455 INTEGER,
INTENT(IN) :: dest, tag
24458 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_zm2'
24461#if defined(__parallel)
24462 INTEGER :: ierr, msglen
24465 CALL mp_timeset(routinen, handle)
24467#if defined(__parallel)
24469 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24470 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24471 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24478 cpabort(
"not in parallel mode")
24480 CALL mp_timestop(handle)
24481 END SUBROUTINE mp_send_zm2
24491 SUBROUTINE mp_send_zm3(msg, dest, tag, comm)
24492 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
24493 INTEGER,
INTENT(IN) :: dest, tag
24496 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
24499#if defined(__parallel)
24500 INTEGER :: ierr, msglen
24503 CALL mp_timeset(routinen, handle)
24505#if defined(__parallel)
24507 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24508 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24509 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24516 cpabort(
"not in parallel mode")
24518 CALL mp_timestop(handle)
24519 END SUBROUTINE mp_send_zm3
24530 SUBROUTINE mp_recv_z (msg, source, tag, comm)
24531 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24532 INTEGER,
INTENT(INOUT) :: source, tag
24535 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_z'
24538#if defined(__parallel)
24539 INTEGER :: ierr, msglen
24540 mpi_status_type :: status
24543 CALL mp_timeset(routinen, handle)
24545#if defined(__parallel)
24548 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24549 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24551 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24552 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24553 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24554 source = status mpi_status_extract(mpi_source)
24555 tag = status mpi_status_extract(mpi_tag)
24563 cpabort(
"not in parallel mode")
24565 CALL mp_timestop(handle)
24566 END SUBROUTINE mp_recv_z
24576 SUBROUTINE mp_recv_zv(msg, source, tag, comm)
24577 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24578 INTEGER,
INTENT(INOUT) :: source, tag
24581 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zv'
24584#if defined(__parallel)
24585 INTEGER :: ierr, msglen
24586 mpi_status_type :: status
24589 CALL mp_timeset(routinen, handle)
24591#if defined(__parallel)
24594 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24595 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24597 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24598 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24599 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24600 source = status mpi_status_extract(mpi_source)
24601 tag = status mpi_status_extract(mpi_tag)
24609 cpabort(
"not in parallel mode")
24611 CALL mp_timestop(handle)
24612 END SUBROUTINE mp_recv_zv
24622 SUBROUTINE mp_recv_zm2(msg, source, tag, comm)
24623 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
24624 INTEGER,
INTENT(INOUT) :: source, tag
24627 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zm2'
24630#if defined(__parallel)
24631 INTEGER :: ierr, msglen
24632 mpi_status_type :: status
24635 CALL mp_timeset(routinen, handle)
24637#if defined(__parallel)
24640 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24641 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24643 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24644 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24645 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24646 source = status mpi_status_extract(mpi_source)
24647 tag = status mpi_status_extract(mpi_tag)
24655 cpabort(
"not in parallel mode")
24657 CALL mp_timestop(handle)
24658 END SUBROUTINE mp_recv_zm2
24668 SUBROUTINE mp_recv_zm3(msg, source, tag, comm)
24669 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
24670 INTEGER,
INTENT(INOUT) :: source, tag
24673 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zm3'
24676#if defined(__parallel)
24677 INTEGER :: ierr, msglen
24678 mpi_status_type :: status
24681 CALL mp_timeset(routinen, handle)
24683#if defined(__parallel)
24686 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24687 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24689 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24690 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24691 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24692 source = status mpi_status_extract(mpi_source)
24693 tag = status mpi_status_extract(mpi_tag)
24701 cpabort(
"not in parallel mode")
24703 CALL mp_timestop(handle)
24704 END SUBROUTINE mp_recv_zm3
24714 SUBROUTINE mp_bcast_z (msg, source, comm)
24715 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24716 INTEGER,
INTENT(IN) :: source
24719 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z'
24722#if defined(__parallel)
24723 INTEGER :: ierr, msglen
24726 CALL mp_timeset(routinen, handle)
24728#if defined(__parallel)
24730 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
24731 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24732 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24738 CALL mp_timestop(handle)
24739 END SUBROUTINE mp_bcast_z
24748 SUBROUTINE mp_bcast_z_src(msg, comm)
24749 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24752 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z_src'
24755#if defined(__parallel)
24756 INTEGER :: ierr, msglen
24759 CALL mp_timeset(routinen, handle)
24761#if defined(__parallel)
24763 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
24764 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24765 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24770 CALL mp_timestop(handle)
24771 END SUBROUTINE mp_bcast_z_src
24781 SUBROUTINE mp_ibcast_z (msg, source, comm, request)
24782 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24783 INTEGER,
INTENT(IN) :: source
24787 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_z'
24790#if defined(__parallel)
24791 INTEGER :: ierr, msglen
24794 CALL mp_timeset(routinen, handle)
24796#if defined(__parallel)
24798 CALL mpi_ibcast(msg, msglen, mpi_double_complex, source, comm%handle, request%handle, ierr)
24799 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
24800 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_8_size))
24807 CALL mp_timestop(handle)
24808 END SUBROUTINE mp_ibcast_z
24817 SUBROUTINE mp_bcast_zv(msg, source, comm)
24818 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24819 INTEGER,
INTENT(IN) :: source
24822 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zv'
24825#if defined(__parallel)
24826 INTEGER :: ierr, msglen
24829 CALL mp_timeset(routinen, handle)
24831#if defined(__parallel)
24833 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
24834 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24835 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24841 CALL mp_timestop(handle)
24842 END SUBROUTINE mp_bcast_zv
24850 SUBROUTINE mp_bcast_zv_src(msg, comm)
24851 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24854 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zv_src'
24857#if defined(__parallel)
24858 INTEGER :: ierr, msglen
24861 CALL mp_timeset(routinen, handle)
24863#if defined(__parallel)
24865 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
24866 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24867 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24872 CALL mp_timestop(handle)
24873 END SUBROUTINE mp_bcast_zv_src
24882 SUBROUTINE mp_ibcast_zv(msg, source, comm, request)
24883 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
24884 INTEGER,
INTENT(IN) :: source
24888 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_zv'
24891#if defined(__parallel)
24892 INTEGER :: ierr, msglen
24895 CALL mp_timeset(routinen, handle)
24897#if defined(__parallel)
24898#if !defined(__GNUC__) || __GNUC__ >= 9
24899 cpassert(is_contiguous(msg))
24902 CALL mpi_ibcast(msg, msglen, mpi_double_complex, source, comm%handle, request%handle, ierr)
24903 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
24904 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_8_size))
24911 CALL mp_timestop(handle)
24912 END SUBROUTINE mp_ibcast_zv
24921 SUBROUTINE mp_bcast_zm(msg, source, comm)
24922 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
24923 INTEGER,
INTENT(IN) :: source
24926 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zm'
24929#if defined(__parallel)
24930 INTEGER :: ierr, msglen
24933 CALL mp_timeset(routinen, handle)
24935#if defined(__parallel)
24937 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
24938 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24939 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24945 CALL mp_timestop(handle)
24946 END SUBROUTINE mp_bcast_zm
24955 SUBROUTINE mp_bcast_zm_src(msg, comm)
24956 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
24959 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zm_src'
24962#if defined(__parallel)
24963 INTEGER :: ierr, msglen
24966 CALL mp_timeset(routinen, handle)
24968#if defined(__parallel)
24970 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
24971 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24972 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24977 CALL mp_timestop(handle)
24978 END SUBROUTINE mp_bcast_zm_src
24987 SUBROUTINE mp_bcast_z3(msg, source, comm)
24988 COMPLEX(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
24989 INTEGER,
INTENT(IN) :: source
24992 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z3'
24995#if defined(__parallel)
24996 INTEGER :: ierr, msglen
24999 CALL mp_timeset(routinen, handle)
25001#if defined(__parallel)
25003 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
25004 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25005 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25011 CALL mp_timestop(handle)
25012 END SUBROUTINE mp_bcast_z3
25021 SUBROUTINE mp_bcast_z3_src(msg, comm)
25022 COMPLEX(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
25025 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z3_src'
25028#if defined(__parallel)
25029 INTEGER :: ierr, msglen
25032 CALL mp_timeset(routinen, handle)
25034#if defined(__parallel)
25036 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25037 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25038 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25043 CALL mp_timestop(handle)
25044 END SUBROUTINE mp_bcast_z3_src
25053 SUBROUTINE mp_sum_z (msg, comm)
25054 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25057 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_z'
25060#if defined(__parallel)
25061 INTEGER :: ierr, msglen
25064 CALL mp_timeset(routinen, handle)
25066#if defined(__parallel)
25068 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25069 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25070 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25075 CALL mp_timestop(handle)
25076 END SUBROUTINE mp_sum_z
25084 SUBROUTINE mp_sum_zv(msg, comm)
25085 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25088 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zv'
25091#if defined(__parallel)
25092 INTEGER :: ierr, msglen
25095 CALL mp_timeset(routinen, handle)
25097#if defined(__parallel)
25099 IF (msglen > 0)
THEN
25100 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25101 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25103 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25108 CALL mp_timestop(handle)
25109 END SUBROUTINE mp_sum_zv
25117 SUBROUTINE mp_isum_zv(msg, comm, request)
25118 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
25122 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_zv'
25125#if defined(__parallel)
25126 INTEGER :: ierr, msglen
25129 CALL mp_timeset(routinen, handle)
25131#if defined(__parallel)
25132#if !defined(__GNUC__) || __GNUC__ >= 9
25133 cpassert(is_contiguous(msg))
25136 IF (msglen > 0)
THEN
25137 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, request%handle, ierr)
25138 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
25142 CALL add_perf(perf_id=23, count=1, msg_size=msglen*(2*real_8_size))
25148 CALL mp_timestop(handle)
25149 END SUBROUTINE mp_isum_zv
25157 SUBROUTINE mp_sum_zm(msg, comm)
25158 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25161 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm'
25164#if defined(__parallel)
25165 INTEGER,
PARAMETER :: max_msg = 2**25
25166 INTEGER :: ierr, m1, msglen, step, msglensum
25169 CALL mp_timeset(routinen, handle)
25171#if defined(__parallel)
25173 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
25175 DO m1 = lbound(msg, 2), ubound(msg, 2), step
25176 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
25177 msglensum = msglensum + msglen
25178 IF (msglen > 0)
THEN
25179 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25180 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25183 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_8_size))
25188 CALL mp_timestop(handle)
25189 END SUBROUTINE mp_sum_zm
25197 SUBROUTINE mp_sum_zm3(msg, comm)
25198 COMPLEX(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
25201 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm3'
25204#if defined(__parallel)
25205 INTEGER :: ierr, msglen
25208 CALL mp_timeset(routinen, handle)
25210#if defined(__parallel)
25212 IF (msglen > 0)
THEN
25213 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25214 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25216 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25221 CALL mp_timestop(handle)
25222 END SUBROUTINE mp_sum_zm3
25230 SUBROUTINE mp_sum_zm4(msg, comm)
25231 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
25234 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm4'
25237#if defined(__parallel)
25238 INTEGER :: ierr, msglen
25241 CALL mp_timeset(routinen, handle)
25243#if defined(__parallel)
25245 IF (msglen > 0)
THEN
25246 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25247 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25249 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25254 CALL mp_timestop(handle)
25255 END SUBROUTINE mp_sum_zm4
25267 SUBROUTINE mp_sum_root_zv(msg, root, comm)
25268 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25269 INTEGER,
INTENT(IN) :: root
25272 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_zv'
25275#if defined(__parallel)
25276 INTEGER :: ierr, m1, msglen, taskid
25277 COMPLEX(kind=real_8),
ALLOCATABLE :: res(:)
25280 CALL mp_timeset(routinen, handle)
25282#if defined(__parallel)
25284 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25285 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25286 IF (msglen > 0)
THEN
25289 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_sum, &
25290 root, comm%handle, ierr)
25291 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25292 IF (taskid == root)
THEN
25297 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25303 CALL mp_timestop(handle)
25304 END SUBROUTINE mp_sum_root_zv
25315 SUBROUTINE mp_sum_root_zm(msg, root, comm)
25316 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25317 INTEGER,
INTENT(IN) :: root
25320 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
25323#if defined(__parallel)
25324 INTEGER :: ierr, m1, m2, msglen, taskid
25325 COMPLEX(kind=real_8),
ALLOCATABLE :: res(:, :)
25328 CALL mp_timeset(routinen, handle)
25330#if defined(__parallel)
25332 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25333 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25334 IF (msglen > 0)
THEN
25337 ALLOCATE (res(m1, m2))
25338 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_sum, root, comm%handle, ierr)
25339 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25340 IF (taskid == root)
THEN
25345 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25351 CALL mp_timestop(handle)
25352 END SUBROUTINE mp_sum_root_zm
25360 SUBROUTINE mp_sum_partial_zm(msg, res, comm)
25361 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
25362 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
25365 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_zm'
25368#if defined(__parallel)
25369 INTEGER :: ierr, msglen, taskid
25372 CALL mp_timeset(routinen, handle)
25374#if defined(__parallel)
25376 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25377 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25378 IF (msglen > 0)
THEN
25379 CALL mpi_scan(msg, res, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25380 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
25382 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25388 CALL mp_timestop(handle)
25389 END SUBROUTINE mp_sum_partial_zm
25399 SUBROUTINE mp_max_z (msg, comm)
25400 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25403 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_z'
25406#if defined(__parallel)
25407 INTEGER :: ierr, msglen
25410 CALL mp_timeset(routinen, handle)
25412#if defined(__parallel)
25414 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_max, comm%handle, ierr)
25415 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25416 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25421 CALL mp_timestop(handle)
25422 END SUBROUTINE mp_max_z
25432 SUBROUTINE mp_max_root_z (msg, root, comm)
25433 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25434 INTEGER,
INTENT(IN) :: root
25437 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_z'
25440#if defined(__parallel)
25441 INTEGER :: ierr, msglen
25442 COMPLEX(kind=real_8) :: res
25445 CALL mp_timeset(routinen, handle)
25447#if defined(__parallel)
25449 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_max, root, comm%handle, ierr)
25450 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25451 IF (root == comm%mepos) msg = res
25452 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25458 CALL mp_timestop(handle)
25459 END SUBROUTINE mp_max_root_z
25469 SUBROUTINE mp_max_zv(msg, comm)
25470 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25473 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_zv'
25476#if defined(__parallel)
25477 INTEGER :: ierr, msglen
25480 CALL mp_timeset(routinen, handle)
25482#if defined(__parallel)
25484 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_max, comm%handle, ierr)
25485 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25486 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25491 CALL mp_timestop(handle)
25492 END SUBROUTINE mp_max_zv
25502 SUBROUTINE mp_max_root_zm(msg, root, comm)
25503 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25507 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_zm'
25510#if defined(__parallel)
25511 INTEGER :: ierr, msglen
25512 COMPLEX(kind=real_8) :: res(size(msg, 1), size(msg, 2))
25515 CALL mp_timeset(routinen, handle)
25517#if defined(__parallel)
25519 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_max, root, comm%handle, ierr)
25520 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25521 IF (root == comm%mepos) msg = res
25522 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25528 CALL mp_timestop(handle)
25529 END SUBROUTINE mp_max_root_zm
25539 SUBROUTINE mp_min_z (msg, comm)
25540 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25543 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_z'
25546#if defined(__parallel)
25547 INTEGER :: ierr, msglen
25550 CALL mp_timeset(routinen, handle)
25552#if defined(__parallel)
25554 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_min, comm%handle, ierr)
25555 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25556 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25561 CALL mp_timestop(handle)
25562 END SUBROUTINE mp_min_z
25574 SUBROUTINE mp_min_zv(msg, comm)
25575 COMPLEX(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
25578 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_zv'
25581#if defined(__parallel)
25582 INTEGER :: ierr, msglen
25585 CALL mp_timeset(routinen, handle)
25587#if defined(__parallel)
25589 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_min, comm%handle, ierr)
25590 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25591 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25596 CALL mp_timestop(handle)
25597 END SUBROUTINE mp_min_zv
25607 SUBROUTINE mp_prod_z (msg, comm)
25608 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25611 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_z'
25614#if defined(__parallel)
25615 INTEGER :: ierr, msglen
25618 CALL mp_timeset(routinen, handle)
25620#if defined(__parallel)
25622 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_prod, comm%handle, ierr)
25623 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25624 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25629 CALL mp_timestop(handle)
25630 END SUBROUTINE mp_prod_z
25641 SUBROUTINE mp_scatter_zv(msg_scatter, msg, root, comm)
25642 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
25643 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
25644 INTEGER,
INTENT(IN) :: root
25647 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_zv'
25650#if defined(__parallel)
25651 INTEGER :: ierr, msglen
25654 CALL mp_timeset(routinen, handle)
25656#if defined(__parallel)
25658 CALL mpi_scatter(msg_scatter, msglen, mpi_double_complex, msg, &
25659 msglen, mpi_double_complex, root, comm%handle, ierr)
25660 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
25661 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25667 CALL mp_timestop(handle)
25668 END SUBROUTINE mp_scatter_zv
25678 SUBROUTINE mp_iscatter_z (msg_scatter, msg, root, comm, request)
25679 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:)
25680 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25681 INTEGER,
INTENT(IN) :: root
25685 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_z'
25688#if defined(__parallel)
25689 INTEGER :: ierr, msglen
25692 CALL mp_timeset(routinen, handle)
25694#if defined(__parallel)
25695#if !defined(__GNUC__) || __GNUC__ >= 9
25696 cpassert(is_contiguous(msg_scatter))
25699 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_complex, msg, &
25700 msglen, mpi_double_complex, root, comm%handle, request%handle, ierr)
25701 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
25702 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
25706 msg = msg_scatter(1)
25709 CALL mp_timestop(handle)
25710 END SUBROUTINE mp_iscatter_z
25720 SUBROUTINE mp_iscatter_zv2(msg_scatter, msg, root, comm, request)
25721 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:, :)
25722 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
25723 INTEGER,
INTENT(IN) :: root
25727 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_zv2'
25730#if defined(__parallel)
25731 INTEGER :: ierr, msglen
25734 CALL mp_timeset(routinen, handle)
25736#if defined(__parallel)
25737#if !defined(__GNUC__) || __GNUC__ >= 9
25738 cpassert(is_contiguous(msg_scatter))
25741 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_complex, msg, &
25742 msglen, mpi_double_complex, root, comm%handle, request%handle, ierr)
25743 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
25744 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
25748 msg(:) = msg_scatter(:, 1)
25751 CALL mp_timestop(handle)
25752 END SUBROUTINE mp_iscatter_zv2
25762 SUBROUTINE mp_iscatterv_zv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
25763 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:)
25764 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
25765 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
25766 INTEGER,
INTENT(IN) :: recvcount, root
25770 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_zv'
25773#if defined(__parallel)
25777 CALL mp_timeset(routinen, handle)
25779#if defined(__parallel)
25780#if !defined(__GNUC__) || __GNUC__ >= 9
25781 cpassert(is_contiguous(msg_scatter))
25782 cpassert(is_contiguous(msg))
25783 cpassert(is_contiguous(sendcounts))
25784 cpassert(is_contiguous(displs))
25786 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_double_complex, msg, &
25787 recvcount, mpi_double_complex, root, comm%handle, request%handle, ierr)
25788 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
25789 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
25791 mark_used(sendcounts)
25793 mark_used(recvcount)
25796 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
25799 CALL mp_timestop(handle)
25800 END SUBROUTINE mp_iscatterv_zv
25811 SUBROUTINE mp_gather_z (msg, msg_gather, root, comm)
25812 COMPLEX(kind=real_8),
INTENT(IN) :: msg
25813 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25814 INTEGER,
INTENT(IN) :: root
25817 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_z'
25820#if defined(__parallel)
25821 INTEGER :: ierr, msglen
25824 CALL mp_timeset(routinen, handle)
25826#if defined(__parallel)
25828 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25829 msglen, mpi_double_complex, root, comm%handle, ierr)
25830 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25831 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25835 msg_gather(1) = msg
25837 CALL mp_timestop(handle)
25838 END SUBROUTINE mp_gather_z
25848 SUBROUTINE mp_gather_z_src(msg, msg_gather, comm)
25849 COMPLEX(kind=real_8),
INTENT(IN) :: msg
25850 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25853 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_z_src'
25856#if defined(__parallel)
25857 INTEGER :: ierr, msglen
25860 CALL mp_timeset(routinen, handle)
25862#if defined(__parallel)
25864 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25865 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25866 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25867 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25870 msg_gather(1) = msg
25872 CALL mp_timestop(handle)
25873 END SUBROUTINE mp_gather_z_src
25887 SUBROUTINE mp_gather_zv(msg, msg_gather, root, comm)
25888 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
25889 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25890 INTEGER,
INTENT(IN) :: root
25893 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zv'
25896#if defined(__parallel)
25897 INTEGER :: ierr, msglen
25900 CALL mp_timeset(routinen, handle)
25902#if defined(__parallel)
25904 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25905 msglen, mpi_double_complex, root, comm%handle, ierr)
25906 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25907 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25913 CALL mp_timestop(handle)
25914 END SUBROUTINE mp_gather_zv
25927 SUBROUTINE mp_gather_zv_src(msg, msg_gather, comm)
25928 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
25929 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25932 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zv_src'
25935#if defined(__parallel)
25936 INTEGER :: ierr, msglen
25939 CALL mp_timeset(routinen, handle)
25941#if defined(__parallel)
25943 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25944 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25945 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25946 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25951 CALL mp_timestop(handle)
25952 END SUBROUTINE mp_gather_zv_src
25966 SUBROUTINE mp_gather_zm(msg, msg_gather, root, comm)
25967 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
25968 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
25969 INTEGER,
INTENT(IN) :: root
25972 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zm'
25975#if defined(__parallel)
25976 INTEGER :: ierr, msglen
25979 CALL mp_timeset(routinen, handle)
25981#if defined(__parallel)
25983 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25984 msglen, mpi_double_complex, root, comm%handle, ierr)
25985 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25986 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25992 CALL mp_timestop(handle)
25993 END SUBROUTINE mp_gather_zm
26006 SUBROUTINE mp_gather_zm_src(msg, msg_gather, comm)
26007 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
26008 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
26011 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zm_src'
26014#if defined(__parallel)
26015 INTEGER :: ierr, msglen
26018 CALL mp_timeset(routinen, handle)
26020#if defined(__parallel)
26022 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
26023 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
26024 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
26025 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
26030 CALL mp_timestop(handle)
26031 END SUBROUTINE mp_gather_zm_src
26048 SUBROUTINE mp_gatherv_zv(sendbuf, recvbuf, recvcounts, displs, root, comm)
26050 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26051 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26052 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26053 INTEGER,
INTENT(IN) :: root
26056 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zv'
26059#if defined(__parallel)
26060 INTEGER :: ierr, sendcount
26063 CALL mp_timeset(routinen, handle)
26065#if defined(__parallel)
26066 sendcount =
SIZE(sendbuf)
26067 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26068 recvbuf, recvcounts, displs, mpi_double_complex, &
26069 root, comm%handle, ierr)
26070 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26071 CALL add_perf(perf_id=4, &
26073 msg_size=sendcount*(2*real_8_size))
26075 mark_used(recvcounts)
26078 recvbuf(1 + displs(1):) = sendbuf
26080 CALL mp_timestop(handle)
26081 END SUBROUTINE mp_gatherv_zv
26097 SUBROUTINE mp_gatherv_zv_src(sendbuf, recvbuf, recvcounts, displs, comm)
26099 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26100 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26101 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26104 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zv_src'
26107#if defined(__parallel)
26108 INTEGER :: ierr, sendcount
26111 CALL mp_timeset(routinen, handle)
26113#if defined(__parallel)
26114 sendcount =
SIZE(sendbuf)
26115 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26116 recvbuf, recvcounts, displs, mpi_double_complex, &
26117 comm%source, comm%handle, ierr)
26118 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26119 CALL add_perf(perf_id=4, &
26121 msg_size=sendcount*(2*real_8_size))
26123 mark_used(recvcounts)
26125 recvbuf(1 + displs(1):) = sendbuf
26127 CALL mp_timestop(handle)
26128 END SUBROUTINE mp_gatherv_zv_src
26145 SUBROUTINE mp_gatherv_zm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
26147 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26148 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26149 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26150 INTEGER,
INTENT(IN) :: root
26153 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zm2'
26156#if defined(__parallel)
26157 INTEGER :: ierr, sendcount
26160 CALL mp_timeset(routinen, handle)
26162#if defined(__parallel)
26163 sendcount =
SIZE(sendbuf)
26164 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26165 recvbuf, recvcounts, displs, mpi_double_complex, &
26166 root, comm%handle, ierr)
26167 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26168 CALL add_perf(perf_id=4, &
26170 msg_size=sendcount*(2*real_8_size))
26172 mark_used(recvcounts)
26175 recvbuf(:, 1 + displs(1):) = sendbuf
26177 CALL mp_timestop(handle)
26178 END SUBROUTINE mp_gatherv_zm2
26194 SUBROUTINE mp_gatherv_zm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
26196 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26197 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26198 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26201 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zm2_src'
26204#if defined(__parallel)
26205 INTEGER :: ierr, sendcount
26208 CALL mp_timeset(routinen, handle)
26210#if defined(__parallel)
26211 sendcount =
SIZE(sendbuf)
26212 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26213 recvbuf, recvcounts, displs, mpi_double_complex, &
26214 comm%source, comm%handle, ierr)
26215 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26216 CALL add_perf(perf_id=4, &
26218 msg_size=sendcount*(2*real_8_size))
26220 mark_used(recvcounts)
26222 recvbuf(:, 1 + displs(1):) = sendbuf
26224 CALL mp_timestop(handle)
26225 END SUBROUTINE mp_gatherv_zm2_src
26242 SUBROUTINE mp_igatherv_zv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
26243 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
26244 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
26245 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26246 INTEGER,
INTENT(IN) :: sendcount, root
26250 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_zv'
26253#if defined(__parallel)
26257 CALL mp_timeset(routinen, handle)
26259#if defined(__parallel)
26260#if !defined(__GNUC__) || __GNUC__ >= 9
26261 cpassert(is_contiguous(sendbuf))
26262 cpassert(is_contiguous(recvbuf))
26263 cpassert(is_contiguous(recvcounts))
26264 cpassert(is_contiguous(displs))
26266 CALL mpi_igatherv(sendbuf, sendcount, mpi_double_complex, &
26267 recvbuf, recvcounts, displs, mpi_double_complex, &
26268 root, comm%handle, request%handle, ierr)
26269 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26270 CALL add_perf(perf_id=24, &
26272 msg_size=sendcount*(2*real_8_size))
26274 mark_used(sendcount)
26275 mark_used(recvcounts)
26278 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
26281 CALL mp_timestop(handle)
26282 END SUBROUTINE mp_igatherv_zv
26295 SUBROUTINE mp_allgather_z (msgout, msgin, comm)
26296 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26297 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
26300 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z'
26303#if defined(__parallel)
26304 INTEGER :: ierr, rcount, scount
26307 CALL mp_timeset(routinen, handle)
26309#if defined(__parallel)
26312 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26313 msgin, rcount, mpi_double_complex, &
26315 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26320 CALL mp_timestop(handle)
26321 END SUBROUTINE mp_allgather_z
26334 SUBROUTINE mp_allgather_z2(msgout, msgin, comm)
26335 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26336 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26339 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z2'
26342#if defined(__parallel)
26343 INTEGER :: ierr, rcount, scount
26346 CALL mp_timeset(routinen, handle)
26348#if defined(__parallel)
26351 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26352 msgin, rcount, mpi_double_complex, &
26354 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26359 CALL mp_timestop(handle)
26360 END SUBROUTINE mp_allgather_z2
26373 SUBROUTINE mp_iallgather_z (msgout, msgin, comm, request)
26374 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26375 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26379 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z'
26382#if defined(__parallel)
26383 INTEGER :: ierr, rcount, scount
26386 CALL mp_timeset(routinen, handle)
26388#if defined(__parallel)
26389#if !defined(__GNUC__) || __GNUC__ >= 9
26390 cpassert(is_contiguous(msgin))
26394 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26395 msgin, rcount, mpi_double_complex, &
26396 comm%handle, request%handle, ierr)
26397 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26403 CALL mp_timestop(handle)
26404 END SUBROUTINE mp_iallgather_z
26419 SUBROUTINE mp_allgather_z12(msgout, msgin, comm)
26420 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
26421 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26424 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z12'
26427#if defined(__parallel)
26428 INTEGER :: ierr, rcount, scount
26431 CALL mp_timeset(routinen, handle)
26433#if defined(__parallel)
26434 scount =
SIZE(msgout(:))
26436 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26437 msgin, rcount, mpi_double_complex, &
26439 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26442 msgin(:, 1) = msgout(:)
26444 CALL mp_timestop(handle)
26445 END SUBROUTINE mp_allgather_z12
26455 SUBROUTINE mp_allgather_z23(msgout, msgin, comm)
26456 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
26457 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
26460 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z23'
26463#if defined(__parallel)
26464 INTEGER :: ierr, rcount, scount
26467 CALL mp_timeset(routinen, handle)
26469#if defined(__parallel)
26470 scount =
SIZE(msgout(:, :))
26472 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26473 msgin, rcount, mpi_double_complex, &
26475 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26478 msgin(:, :, 1) = msgout(:, :)
26480 CALL mp_timestop(handle)
26481 END SUBROUTINE mp_allgather_z23
26491 SUBROUTINE mp_allgather_z34(msgout, msgin, comm)
26492 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
26493 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
26496 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z34'
26499#if defined(__parallel)
26500 INTEGER :: ierr, rcount, scount
26503 CALL mp_timeset(routinen, handle)
26505#if defined(__parallel)
26506 scount =
SIZE(msgout(:, :, :))
26508 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26509 msgin, rcount, mpi_double_complex, &
26511 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26514 msgin(:, :, :, 1) = msgout(:, :, :)
26516 CALL mp_timestop(handle)
26517 END SUBROUTINE mp_allgather_z34
26527 SUBROUTINE mp_allgather_z22(msgout, msgin, comm)
26528 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
26529 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26532 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z22'
26535#if defined(__parallel)
26536 INTEGER :: ierr, rcount, scount
26539 CALL mp_timeset(routinen, handle)
26541#if defined(__parallel)
26542 scount =
SIZE(msgout(:, :))
26544 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26545 msgin, rcount, mpi_double_complex, &
26547 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26550 msgin(:, :) = msgout(:, :)
26552 CALL mp_timestop(handle)
26553 END SUBROUTINE mp_allgather_z22
26564 SUBROUTINE mp_iallgather_z11(msgout, msgin, comm, request)
26565 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26566 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26570 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z11'
26573#if defined(__parallel)
26574 INTEGER :: ierr, rcount, scount
26577 CALL mp_timeset(routinen, handle)
26579#if defined(__parallel)
26580#if !defined(__GNUC__) || __GNUC__ >= 9
26581 cpassert(is_contiguous(msgout))
26582 cpassert(is_contiguous(msgin))
26584 scount =
SIZE(msgout(:))
26586 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26587 msgin, rcount, mpi_double_complex, &
26588 comm%handle, request%handle, ierr)
26589 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26595 CALL mp_timestop(handle)
26596 END SUBROUTINE mp_iallgather_z11
26607 SUBROUTINE mp_iallgather_z13(msgout, msgin, comm, request)
26608 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26609 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
26613 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z13'
26616#if defined(__parallel)
26617 INTEGER :: ierr, rcount, scount
26620 CALL mp_timeset(routinen, handle)
26622#if defined(__parallel)
26623#if !defined(__GNUC__) || __GNUC__ >= 9
26624 cpassert(is_contiguous(msgout))
26625 cpassert(is_contiguous(msgin))
26628 scount =
SIZE(msgout(:))
26630 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26631 msgin, rcount, mpi_double_complex, &
26632 comm%handle, request%handle, ierr)
26633 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26636 msgin(:, 1, 1) = msgout(:)
26639 CALL mp_timestop(handle)
26640 END SUBROUTINE mp_iallgather_z13
26651 SUBROUTINE mp_iallgather_z22(msgout, msgin, comm, request)
26652 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :)
26653 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :)
26657 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z22'
26660#if defined(__parallel)
26661 INTEGER :: ierr, rcount, scount
26664 CALL mp_timeset(routinen, handle)
26666#if defined(__parallel)
26667#if !defined(__GNUC__) || __GNUC__ >= 9
26668 cpassert(is_contiguous(msgout))
26669 cpassert(is_contiguous(msgin))
26672 scount =
SIZE(msgout(:, :))
26674 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26675 msgin, rcount, mpi_double_complex, &
26676 comm%handle, request%handle, ierr)
26677 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26680 msgin(:, :) = msgout(:, :)
26683 CALL mp_timestop(handle)
26684 END SUBROUTINE mp_iallgather_z22
26695 SUBROUTINE mp_iallgather_z24(msgout, msgin, comm, request)
26696 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :)
26697 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :, :)
26701 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z24'
26704#if defined(__parallel)
26705 INTEGER :: ierr, rcount, scount
26708 CALL mp_timeset(routinen, handle)
26710#if defined(__parallel)
26711#if !defined(__GNUC__) || __GNUC__ >= 9
26712 cpassert(is_contiguous(msgout))
26713 cpassert(is_contiguous(msgin))
26716 scount =
SIZE(msgout(:, :))
26718 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26719 msgin, rcount, mpi_double_complex, &
26720 comm%handle, request%handle, ierr)
26721 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26724 msgin(:, :, 1, 1) = msgout(:, :)
26727 CALL mp_timestop(handle)
26728 END SUBROUTINE mp_iallgather_z24
26739 SUBROUTINE mp_iallgather_z33(msgout, msgin, comm, request)
26740 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :, :)
26741 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
26745 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z33'
26748#if defined(__parallel)
26749 INTEGER :: ierr, rcount, scount
26752 CALL mp_timeset(routinen, handle)
26754#if defined(__parallel)
26755#if !defined(__GNUC__) || __GNUC__ >= 9
26756 cpassert(is_contiguous(msgout))
26757 cpassert(is_contiguous(msgin))
26760 scount =
SIZE(msgout(:, :, :))
26762 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26763 msgin, rcount, mpi_double_complex, &
26764 comm%handle, request%handle, ierr)
26765 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26768 msgin(:, :, :) = msgout(:, :, :)
26771 CALL mp_timestop(handle)
26772 END SUBROUTINE mp_iallgather_z33
26791 SUBROUTINE mp_allgatherv_zv(msgout, msgin, rcount, rdispl, comm)
26792 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
26793 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
26794 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
26797 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_zv'
26800#if defined(__parallel)
26801 INTEGER :: ierr, scount
26804 CALL mp_timeset(routinen, handle)
26806#if defined(__parallel)
26807 scount =
SIZE(msgout)
26808 CALL mpi_allgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
26809 rdispl, mpi_double_complex, comm%handle, ierr)
26810 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
26817 CALL mp_timestop(handle)
26818 END SUBROUTINE mp_allgatherv_zv
26837 SUBROUTINE mp_allgatherv_zm2(msgout, msgin, rcount, rdispl, comm)
26838 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
26839 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
26840 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
26843 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_zv'
26846#if defined(__parallel)
26847 INTEGER :: ierr, scount
26850 CALL mp_timeset(routinen, handle)
26852#if defined(__parallel)
26853 scount =
SIZE(msgout)
26854 CALL mpi_allgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
26855 rdispl, mpi_double_complex, comm%handle, ierr)
26856 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
26863 CALL mp_timestop(handle)
26864 END SUBROUTINE mp_allgatherv_zm2
26883 SUBROUTINE mp_iallgatherv_zv(msgout, msgin, rcount, rdispl, comm, request)
26884 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26885 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26886 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
26890 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_zv'
26893#if defined(__parallel)
26894 INTEGER :: ierr, scount, rsize
26897 CALL mp_timeset(routinen, handle)
26899#if defined(__parallel)
26900#if !defined(__GNUC__) || __GNUC__ >= 9
26901 cpassert(is_contiguous(msgout))
26902 cpassert(is_contiguous(msgin))
26903 cpassert(is_contiguous(rcount))
26904 cpassert(is_contiguous(rdispl))
26907 scount =
SIZE(msgout)
26908 rsize =
SIZE(rcount)
26909 CALL mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, &
26910 rdispl, comm, request, ierr)
26911 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
26919 CALL mp_timestop(handle)
26920 END SUBROUTINE mp_iallgatherv_zv
26939 SUBROUTINE mp_iallgatherv_zv2(msgout, msgin, rcount, rdispl, comm, request)
26940 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26941 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26942 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
26946 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_zv2'
26949#if defined(__parallel)
26950 INTEGER :: ierr, scount, rsize
26953 CALL mp_timeset(routinen, handle)
26955#if defined(__parallel)
26956#if !defined(__GNUC__) || __GNUC__ >= 9
26957 cpassert(is_contiguous(msgout))
26958 cpassert(is_contiguous(msgin))
26959 cpassert(is_contiguous(rcount))
26960 cpassert(is_contiguous(rdispl))
26963 scount =
SIZE(msgout)
26964 rsize =
SIZE(rcount)
26965 CALL mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, &
26966 rdispl, comm, request, ierr)
26967 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
26975 CALL mp_timestop(handle)
26976 END SUBROUTINE mp_iallgatherv_zv2
26987#if defined(__parallel)
26988 SUBROUTINE mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
26989 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
26990 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
26991 INTEGER,
INTENT(IN) :: rsize
26992 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
26995 INTEGER,
INTENT(INOUT) :: ierr
26997 CALL mpi_iallgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
26998 rdispl, mpi_double_complex, comm%handle, request%handle, ierr)
27000 END SUBROUTINE mp_iallgatherv_zv_internal
27011 SUBROUTINE mp_sum_scatter_zv(msgout, msgin, rcount, comm)
27012 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
27013 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
27014 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
27017 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_zv'
27020#if defined(__parallel)
27024 CALL mp_timeset(routinen, handle)
27026#if defined(__parallel)
27027 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_double_complex, mpi_sum, &
27029 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
27031 CALL add_perf(perf_id=3, count=1, &
27032 msg_size=rcount(1)*2*(2*real_8_size))
27036 msgin = msgout(:, 1)
27038 CALL mp_timestop(handle)
27039 END SUBROUTINE mp_sum_scatter_zv
27050 SUBROUTINE mp_sendrecv_z (msgin, dest, msgout, source, comm, tag)
27051 COMPLEX(kind=real_8),
INTENT(IN) :: msgin
27052 INTEGER,
INTENT(IN) :: dest
27053 COMPLEX(kind=real_8),
INTENT(OUT) :: msgout
27054 INTEGER,
INTENT(IN) :: source
27056 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27058 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_z'
27061#if defined(__parallel)
27062 INTEGER :: ierr, msglen_in, msglen_out, &
27066 CALL mp_timeset(routinen, handle)
27068#if defined(__parallel)
27073 IF (
PRESENT(tag))
THEN
27077 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27078 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27079 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27080 CALL add_perf(perf_id=7, count=1, &
27081 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27089 CALL mp_timestop(handle)
27090 END SUBROUTINE mp_sendrecv_z
27101 SUBROUTINE mp_sendrecv_zv(msgin, dest, msgout, source, comm, tag)
27102 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
27103 INTEGER,
INTENT(IN) :: dest
27104 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
27105 INTEGER,
INTENT(IN) :: source
27107 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27109 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zv'
27112#if defined(__parallel)
27113 INTEGER :: ierr, msglen_in, msglen_out, &
27117 CALL mp_timeset(routinen, handle)
27119#if defined(__parallel)
27120 msglen_in =
SIZE(msgin)
27121 msglen_out =
SIZE(msgout)
27124 IF (
PRESENT(tag))
THEN
27128 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27129 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27130 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27131 CALL add_perf(perf_id=7, count=1, &
27132 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27140 CALL mp_timestop(handle)
27141 END SUBROUTINE mp_sendrecv_zv
27153 SUBROUTINE mp_sendrecv_zm2(msgin, dest, msgout, source, comm, tag)
27154 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
27155 INTEGER,
INTENT(IN) :: dest
27156 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
27157 INTEGER,
INTENT(IN) :: source
27159 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27161 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm2'
27164#if defined(__parallel)
27165 INTEGER :: ierr, msglen_in, msglen_out, &
27169 CALL mp_timeset(routinen, handle)
27171#if defined(__parallel)
27172 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
27173 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
27176 IF (
PRESENT(tag))
THEN
27180 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27181 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27182 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27183 CALL add_perf(perf_id=7, count=1, &
27184 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27192 CALL mp_timestop(handle)
27193 END SUBROUTINE mp_sendrecv_zm2
27204 SUBROUTINE mp_sendrecv_zm3(msgin, dest, msgout, source, comm, tag)
27205 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
27206 INTEGER,
INTENT(IN) :: dest
27207 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
27208 INTEGER,
INTENT(IN) :: source
27210 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27212 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm3'
27215#if defined(__parallel)
27216 INTEGER :: ierr, msglen_in, msglen_out, &
27220 CALL mp_timeset(routinen, handle)
27222#if defined(__parallel)
27223 msglen_in =
SIZE(msgin)
27224 msglen_out =
SIZE(msgout)
27227 IF (
PRESENT(tag))
THEN
27231 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27232 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27233 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27234 CALL add_perf(perf_id=7, count=1, &
27235 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27243 CALL mp_timestop(handle)
27244 END SUBROUTINE mp_sendrecv_zm3
27255 SUBROUTINE mp_sendrecv_zm4(msgin, dest, msgout, source, comm, tag)
27256 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
27257 INTEGER,
INTENT(IN) :: dest
27258 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
27259 INTEGER,
INTENT(IN) :: source
27261 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27263 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm4'
27266#if defined(__parallel)
27267 INTEGER :: ierr, msglen_in, msglen_out, &
27271 CALL mp_timeset(routinen, handle)
27273#if defined(__parallel)
27274 msglen_in =
SIZE(msgin)
27275 msglen_out =
SIZE(msgout)
27278 IF (
PRESENT(tag))
THEN
27282 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27283 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27284 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27285 CALL add_perf(perf_id=7, count=1, &
27286 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27294 CALL mp_timestop(handle)
27295 END SUBROUTINE mp_sendrecv_zm4
27312 SUBROUTINE mp_isendrecv_z (msgin, dest, msgout, source, comm, send_request, &
27314 COMPLEX(kind=real_8),
INTENT(IN) :: msgin
27315 INTEGER,
INTENT(IN) :: dest
27316 COMPLEX(kind=real_8),
INTENT(INOUT) :: msgout
27317 INTEGER,
INTENT(IN) :: source
27320 INTEGER,
INTENT(in),
OPTIONAL :: tag
27322 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_z'
27325#if defined(__parallel)
27326 INTEGER :: ierr, my_tag
27329 CALL mp_timeset(routinen, handle)
27331#if defined(__parallel)
27333 IF (
PRESENT(tag)) my_tag = tag
27335 CALL mpi_irecv(msgout, 1, mpi_double_complex, source, my_tag, &
27336 comm%handle, recv_request%handle, ierr)
27337 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27339 CALL mpi_isend(msgin, 1, mpi_double_complex, dest, my_tag, &
27340 comm%handle, send_request%handle, ierr)
27341 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27343 CALL add_perf(perf_id=8, count=1, msg_size=2*(2*real_8_size))
27353 CALL mp_timestop(handle)
27354 END SUBROUTINE mp_isendrecv_z
27373 SUBROUTINE mp_isendrecv_zv(msgin, dest, msgout, source, comm, send_request, &
27375 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
27376 INTEGER,
INTENT(IN) :: dest
27377 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
27378 INTEGER,
INTENT(IN) :: source
27381 INTEGER,
INTENT(in),
OPTIONAL :: tag
27383 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_zv'
27386#if defined(__parallel)
27387 INTEGER :: ierr, msglen, my_tag
27388 COMPLEX(kind=real_8) :: foo
27391 CALL mp_timeset(routinen, handle)
27393#if defined(__parallel)
27394#if !defined(__GNUC__) || __GNUC__ >= 9
27395 cpassert(is_contiguous(msgout))
27396 cpassert(is_contiguous(msgin))
27400 IF (
PRESENT(tag)) my_tag = tag
27402 msglen =
SIZE(msgout, 1)
27403 IF (msglen > 0)
THEN
27404 CALL mpi_irecv(msgout(1), msglen, mpi_double_complex, source, my_tag, &
27405 comm%handle, recv_request%handle, ierr)
27407 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27408 comm%handle, recv_request%handle, ierr)
27410 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27412 msglen =
SIZE(msgin, 1)
27413 IF (msglen > 0)
THEN
27414 CALL mpi_isend(msgin(1), msglen, mpi_double_complex, dest, my_tag, &
27415 comm%handle, send_request%handle, ierr)
27417 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27418 comm%handle, send_request%handle, ierr)
27420 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27422 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
27423 CALL add_perf(perf_id=8, count=1, msg_size=msglen*(2*real_8_size))
27433 CALL mp_timestop(handle)
27434 END SUBROUTINE mp_isendrecv_zv
27449 SUBROUTINE mp_isend_zv(msgin, dest, comm, request, tag)
27450 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
27451 INTEGER,
INTENT(IN) :: dest
27454 INTEGER,
INTENT(in),
OPTIONAL :: tag
27456 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zv'
27458 INTEGER :: handle, ierr
27459#if defined(__parallel)
27460 INTEGER :: msglen, my_tag
27461 COMPLEX(kind=real_8) :: foo(1)
27464 CALL mp_timeset(routinen, handle)
27466#if defined(__parallel)
27467#if !defined(__GNUC__) || __GNUC__ >= 9
27468 cpassert(is_contiguous(msgin))
27471 IF (
PRESENT(tag)) my_tag = tag
27473 msglen =
SIZE(msgin)
27474 IF (msglen > 0)
THEN
27475 CALL mpi_isend(msgin(1), msglen, mpi_double_complex, dest, my_tag, &
27476 comm%handle, request%handle, ierr)
27478 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27479 comm%handle, request%handle, ierr)
27481 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27483 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27492 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27494 CALL mp_timestop(handle)
27495 END SUBROUTINE mp_isend_zv
27512 SUBROUTINE mp_isend_zm2(msgin, dest, comm, request, tag)
27513 COMPLEX(kind=real_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
27514 INTEGER,
INTENT(IN) :: dest
27517 INTEGER,
INTENT(in),
OPTIONAL :: tag
27519 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm2'
27521 INTEGER :: handle, ierr
27522#if defined(__parallel)
27523 INTEGER :: msglen, my_tag
27524 COMPLEX(kind=real_8) :: foo(1)
27527 CALL mp_timeset(routinen, handle)
27529#if defined(__parallel)
27530#if !defined(__GNUC__) || __GNUC__ >= 9
27531 cpassert(is_contiguous(msgin))
27535 IF (
PRESENT(tag)) my_tag = tag
27537 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
27538 IF (msglen > 0)
THEN
27539 CALL mpi_isend(msgin(1, 1), msglen, mpi_double_complex, dest, my_tag, &
27540 comm%handle, request%handle, ierr)
27542 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27543 comm%handle, request%handle, ierr)
27545 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27547 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27556 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27558 CALL mp_timestop(handle)
27559 END SUBROUTINE mp_isend_zm2
27578 SUBROUTINE mp_isend_zm3(msgin, dest, comm, request, tag)
27579 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
27580 INTEGER,
INTENT(IN) :: dest
27583 INTEGER,
INTENT(in),
OPTIONAL :: tag
27585 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm3'
27587 INTEGER :: handle, ierr
27588#if defined(__parallel)
27589 INTEGER :: msglen, my_tag
27590 COMPLEX(kind=real_8) :: foo(1)
27593 CALL mp_timeset(routinen, handle)
27595#if defined(__parallel)
27596#if !defined(__GNUC__) || __GNUC__ >= 9
27597 cpassert(is_contiguous(msgin))
27601 IF (
PRESENT(tag)) my_tag = tag
27603 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
27604 IF (msglen > 0)
THEN
27605 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_double_complex, dest, my_tag, &
27606 comm%handle, request%handle, ierr)
27608 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27609 comm%handle, request%handle, ierr)
27611 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27613 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27622 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27624 CALL mp_timestop(handle)
27625 END SUBROUTINE mp_isend_zm3
27641 SUBROUTINE mp_isend_zm4(msgin, dest, comm, request, tag)
27642 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
27643 INTEGER,
INTENT(IN) :: dest
27646 INTEGER,
INTENT(in),
OPTIONAL :: tag
27648 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm4'
27650 INTEGER :: handle, ierr
27651#if defined(__parallel)
27652 INTEGER :: msglen, my_tag
27653 COMPLEX(kind=real_8) :: foo(1)
27656 CALL mp_timeset(routinen, handle)
27658#if defined(__parallel)
27659#if !defined(__GNUC__) || __GNUC__ >= 9
27660 cpassert(is_contiguous(msgin))
27664 IF (
PRESENT(tag)) my_tag = tag
27666 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
27667 IF (msglen > 0)
THEN
27668 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_double_complex, dest, my_tag, &
27669 comm%handle, request%handle, ierr)
27671 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27672 comm%handle, request%handle, ierr)
27674 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27676 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27685 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27687 CALL mp_timestop(handle)
27688 END SUBROUTINE mp_isend_zm4
27704 SUBROUTINE mp_irecv_zv(msgout, source, comm, request, tag)
27705 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
27706 INTEGER,
INTENT(IN) :: source
27709 INTEGER,
INTENT(in),
OPTIONAL :: tag
27711 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zv'
27714#if defined(__parallel)
27715 INTEGER :: ierr, msglen, my_tag
27716 COMPLEX(kind=real_8) :: foo(1)
27719 CALL mp_timeset(routinen, handle)
27721#if defined(__parallel)
27722#if !defined(__GNUC__) || __GNUC__ >= 9
27723 cpassert(is_contiguous(msgout))
27727 IF (
PRESENT(tag)) my_tag = tag
27729 msglen =
SIZE(msgout)
27730 IF (msglen > 0)
THEN
27731 CALL mpi_irecv(msgout(1), msglen, mpi_double_complex, source, my_tag, &
27732 comm%handle, request%handle, ierr)
27734 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27735 comm%handle, request%handle, ierr)
27737 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27739 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27741 cpabort(
"mp_irecv called in non parallel case")
27748 CALL mp_timestop(handle)
27749 END SUBROUTINE mp_irecv_zv
27766 SUBROUTINE mp_irecv_zm2(msgout, source, comm, request, tag)
27767 COMPLEX(kind=real_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
27768 INTEGER,
INTENT(IN) :: source
27771 INTEGER,
INTENT(in),
OPTIONAL :: tag
27773 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm2'
27776#if defined(__parallel)
27777 INTEGER :: ierr, msglen, my_tag
27778 COMPLEX(kind=real_8) :: foo(1)
27781 CALL mp_timeset(routinen, handle)
27783#if defined(__parallel)
27784#if !defined(__GNUC__) || __GNUC__ >= 9
27785 cpassert(is_contiguous(msgout))
27789 IF (
PRESENT(tag)) my_tag = tag
27791 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
27792 IF (msglen > 0)
THEN
27793 CALL mpi_irecv(msgout(1, 1), msglen, mpi_double_complex, source, my_tag, &
27794 comm%handle, request%handle, ierr)
27796 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27797 comm%handle, request%handle, ierr)
27799 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27801 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27808 cpabort(
"mp_irecv called in non parallel case")
27810 CALL mp_timestop(handle)
27811 END SUBROUTINE mp_irecv_zm2
27829 SUBROUTINE mp_irecv_zm3(msgout, source, comm, request, tag)
27830 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
27831 INTEGER,
INTENT(IN) :: source
27834 INTEGER,
INTENT(in),
OPTIONAL :: tag
27836 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm3'
27839#if defined(__parallel)
27840 INTEGER :: ierr, msglen, my_tag
27841 COMPLEX(kind=real_8) :: foo(1)
27844 CALL mp_timeset(routinen, handle)
27846#if defined(__parallel)
27847#if !defined(__GNUC__) || __GNUC__ >= 9
27848 cpassert(is_contiguous(msgout))
27852 IF (
PRESENT(tag)) my_tag = tag
27854 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
27855 IF (msglen > 0)
THEN
27856 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_double_complex, source, my_tag, &
27857 comm%handle, request%handle, ierr)
27859 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27860 comm%handle, request%handle, ierr)
27862 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
27864 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27871 cpabort(
"mp_irecv called in non parallel case")
27873 CALL mp_timestop(handle)
27874 END SUBROUTINE mp_irecv_zm3
27890 SUBROUTINE mp_irecv_zm4(msgout, source, comm, request, tag)
27891 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
27892 INTEGER,
INTENT(IN) :: source
27895 INTEGER,
INTENT(in),
OPTIONAL :: tag
27897 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm4'
27900#if defined(__parallel)
27901 INTEGER :: ierr, msglen, my_tag
27902 COMPLEX(kind=real_8) :: foo(1)
27905 CALL mp_timeset(routinen, handle)
27907#if defined(__parallel)
27908#if !defined(__GNUC__) || __GNUC__ >= 9
27909 cpassert(is_contiguous(msgout))
27913 IF (
PRESENT(tag)) my_tag = tag
27915 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
27916 IF (msglen > 0)
THEN
27917 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_double_complex, source, my_tag, &
27918 comm%handle, request%handle, ierr)
27920 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27921 comm%handle, request%handle, ierr)
27923 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
27925 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27932 cpabort(
"mp_irecv called in non parallel case")
27934 CALL mp_timestop(handle)
27935 END SUBROUTINE mp_irecv_zm4
27947 SUBROUTINE mp_win_create_zv(base, comm, win)
27948 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
27952 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_zv'
27955#if defined(__parallel)
27957 INTEGER(kind=mpi_address_kind) :: len
27958 COMPLEX(kind=real_8) :: foo(1)
27961 CALL mp_timeset(routinen, handle)
27963#if defined(__parallel)
27965 len =
SIZE(base)*(2*real_8_size)
27967 CALL mpi_win_create(base(1), len, (2*real_8_size), mpi_info_null, comm%handle, win%handle, ierr)
27969 CALL mpi_win_create(foo, len, (2*real_8_size), mpi_info_null, comm%handle, win%handle, ierr)
27971 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
27973 CALL add_perf(perf_id=20, count=1)
27977 win%handle = mp_win_null_handle
27979 CALL mp_timestop(handle)
27980 END SUBROUTINE mp_win_create_zv
27992 SUBROUTINE mp_rget_zv(base, source, win, win_data, myproc, disp, request, &
27993 origin_datatype, target_datatype)
27994 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
27995 INTEGER,
INTENT(IN) :: source
27997 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: win_data
27998 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
28002 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_zv'
28005#if defined(__parallel)
28006 INTEGER :: ierr, len, &
28007 origin_len, target_len
28008 LOGICAL :: do_local_copy
28009 INTEGER(kind=mpi_address_kind) :: disp_aint
28010 mpi_data_type :: handle_origin_datatype, handle_target_datatype
28013 CALL mp_timeset(routinen, handle)
28015#if defined(__parallel)
28018 IF (
PRESENT(disp))
THEN
28019 disp_aint = int(disp, kind=mpi_address_kind)
28021 handle_origin_datatype = mpi_double_complex
28023 IF (
PRESENT(origin_datatype))
THEN
28024 handle_origin_datatype = origin_datatype%type_handle
28027 handle_target_datatype = mpi_double_complex
28029 IF (
PRESENT(target_datatype))
THEN
28030 handle_target_datatype = target_datatype%type_handle
28034 do_local_copy = .false.
28035 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
28036 IF (myproc .EQ. source) do_local_copy = .true.
28038 IF (do_local_copy)
THEN
28040 base(:) = win_data(disp_aint + 1:disp_aint + len)
28045 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
28046 target_len, handle_target_datatype, win%handle, request%handle, ierr)
28052 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
28054 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*(2*real_8_size))
28059 mark_used(origin_datatype)
28060 mark_used(target_datatype)
28064 IF (
PRESENT(disp))
THEN
28065 base(:) = win_data(disp + 1:disp +
SIZE(base))
28067 base(:) = win_data(:
SIZE(base))
28071 CALL mp_timestop(handle)
28072 END SUBROUTINE mp_rget_zv
28082 result(type_descriptor)
28083 INTEGER,
INTENT(IN) :: count
28084 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
28087 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_z'
28090#if defined(__parallel)
28094 CALL mp_timeset(routinen, handle)
28096#if defined(__parallel)
28097 CALL mpi_type_indexed(count, lengths, displs, mpi_double_complex, &
28098 type_descriptor%type_handle, ierr)
28100 cpabort(
"MPI_Type_Indexed @ "//routinen)
28101 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
28103 cpabort(
"MPI_Type_commit @ "//routinen)
28105 type_descriptor%type_handle = 7
28107 type_descriptor%length = count
28108 NULLIFY (type_descriptor%subtype)
28109 type_descriptor%vector_descriptor(1:2) = 1
28110 type_descriptor%has_indexing = .true.
28111 type_descriptor%index_descriptor%index => lengths
28112 type_descriptor%index_descriptor%chunks => displs
28114 CALL mp_timestop(handle)
28125 SUBROUTINE mp_allocate_z (DATA, len, stat)
28126 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
28127 INTEGER,
INTENT(IN) :: len
28128 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28130 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_z'
28132 INTEGER :: handle, ierr
28134 CALL mp_timeset(routinen, handle)
28136#if defined(__parallel)
28138 CALL mp_alloc_mem(
DATA, len, stat=ierr)
28139 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
28140 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
28141 CALL add_perf(perf_id=15, count=1)
28143 ALLOCATE (
DATA(len), stat=ierr)
28144 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
28145 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
28147 IF (
PRESENT(stat)) stat = ierr
28148 CALL mp_timestop(handle)
28149 END SUBROUTINE mp_allocate_z
28157 SUBROUTINE mp_deallocate_z (DATA, stat)
28158 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
28159 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28161 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_z'
28164#if defined(__parallel)
28168 CALL mp_timeset(routinen, handle)
28170#if defined(__parallel)
28171 CALL mp_free_mem(
DATA, ierr)
28172 IF (
PRESENT(stat))
THEN
28175 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
28178 CALL add_perf(perf_id=15, count=1)
28181 IF (
PRESENT(stat)) stat = 0
28183 CALL mp_timestop(handle)
28184 END SUBROUTINE mp_deallocate_z
28197 SUBROUTINE mp_file_write_at_zv(fh, offset, msg, msglen)
28198 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
28200 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28201 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28204#if defined(__parallel)
28208 msg_len =
SIZE(msg)
28209 IF (
PRESENT(msglen)) msg_len = msglen
28210#if defined(__parallel)
28211 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28213 cpabort(
"mpi_file_write_at_zv @ mp_file_write_at_zv")
28215 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28217 END SUBROUTINE mp_file_write_at_zv
28225 SUBROUTINE mp_file_write_at_z (fh, offset, msg)
28226 COMPLEX(kind=real_8),
INTENT(IN) :: msg
28228 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28230#if defined(__parallel)
28234 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28236 cpabort(
"mpi_file_write_at_z @ mp_file_write_at_z")
28238 WRITE (unit=fh%handle, pos=offset + 1) msg
28240 END SUBROUTINE mp_file_write_at_z
28252 SUBROUTINE mp_file_write_at_all_zv(fh, offset, msg, msglen)
28253 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
28255 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28256 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28259#if defined(__parallel)
28263 msg_len =
SIZE(msg)
28264 IF (
PRESENT(msglen)) msg_len = msglen
28265#if defined(__parallel)
28266 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28268 cpabort(
"mpi_file_write_at_all_zv @ mp_file_write_at_all_zv")
28270 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28272 END SUBROUTINE mp_file_write_at_all_zv
28280 SUBROUTINE mp_file_write_at_all_z (fh, offset, msg)
28281 COMPLEX(kind=real_8),
INTENT(IN) :: msg
28283 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28285#if defined(__parallel)
28289 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28291 cpabort(
"mpi_file_write_at_all_z @ mp_file_write_at_all_z")
28293 WRITE (unit=fh%handle, pos=offset + 1) msg
28295 END SUBROUTINE mp_file_write_at_all_z
28308 SUBROUTINE mp_file_read_at_zv(fh, offset, msg, msglen)
28309 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
28311 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28312 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28315#if defined(__parallel)
28319 msg_len =
SIZE(msg)
28320 IF (
PRESENT(msglen)) msg_len = msglen
28321#if defined(__parallel)
28322 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28324 cpabort(
"mpi_file_read_at_zv @ mp_file_read_at_zv")
28326 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28328 END SUBROUTINE mp_file_read_at_zv
28336 SUBROUTINE mp_file_read_at_z (fh, offset, msg)
28337 COMPLEX(kind=real_8),
INTENT(OUT) :: msg
28339 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28341#if defined(__parallel)
28345 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28347 cpabort(
"mpi_file_read_at_z @ mp_file_read_at_z")
28349 READ (unit=fh%handle, pos=offset + 1) msg
28351 END SUBROUTINE mp_file_read_at_z
28363 SUBROUTINE mp_file_read_at_all_zv(fh, offset, msg, msglen)
28364 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
28366 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28367 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28370#if defined(__parallel)
28374 msg_len =
SIZE(msg)
28375 IF (
PRESENT(msglen)) msg_len = msglen
28376#if defined(__parallel)
28377 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28379 cpabort(
"mpi_file_read_at_all_zv @ mp_file_read_at_all_zv")
28381 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28383 END SUBROUTINE mp_file_read_at_all_zv
28391 SUBROUTINE mp_file_read_at_all_z (fh, offset, msg)
28392 COMPLEX(kind=real_8),
INTENT(OUT) :: msg
28394 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28396#if defined(__parallel)
28400 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28402 cpabort(
"mpi_file_read_at_all_z @ mp_file_read_at_all_z")
28404 READ (unit=fh%handle, pos=offset + 1) msg
28406 END SUBROUTINE mp_file_read_at_all_z
28415 FUNCTION mp_type_make_z (ptr, &
28416 vector_descriptor, index_descriptor) &
28417 result(type_descriptor)
28418 COMPLEX(kind=real_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
28419 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
28420 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
28423 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_z'
28425#if defined(__parallel)
28429 NULLIFY (type_descriptor%subtype)
28430 type_descriptor%length =
SIZE(ptr)
28431#if defined(__parallel)
28432 type_descriptor%type_handle = mpi_double_complex
28433 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
28435 cpabort(
"MPI_Get_address @ "//routinen)
28437 type_descriptor%type_handle = 7
28439 type_descriptor%vector_descriptor(1:2) = 1
28440 type_descriptor%has_indexing = .false.
28441 type_descriptor%data_z => ptr
28442 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
28443 cpabort(routinen//
": Vectors and indices NYI")
28445 END FUNCTION mp_type_make_z
28454 SUBROUTINE mp_alloc_mem_z (DATA, len, stat)
28455 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
28456 INTEGER,
INTENT(IN) :: len
28457 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28459#if defined(__parallel)
28460 INTEGER :: size, ierr, length, &
28462 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
28463 TYPE(c_ptr) :: mp_baseptr
28464 mpi_info_type :: mp_info
28466 length = max(len, 1)
28467 CALL mpi_type_size(mpi_double_complex,
size, ierr)
28468 mp_size = int(length, kind=mpi_address_kind)*
size
28469 IF (mp_size .GT. mp_max_memory_size)
THEN
28470 cpabort(
"MPI cannot allocate more than 2 GiByte")
28472 mp_info = mpi_info_null
28473 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
28474 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
28475 IF (
PRESENT(stat)) stat = mp_res
28477 INTEGER :: length, mystat
28478 length = max(len, 1)
28479 IF (
PRESENT(stat))
THEN
28480 ALLOCATE (
DATA(length), stat=mystat)
28483 ALLOCATE (
DATA(length))
28486 END SUBROUTINE mp_alloc_mem_z
28494 SUBROUTINE mp_free_mem_z (DATA, stat)
28495 COMPLEX(kind=real_8),
DIMENSION(:), &
28496 POINTER, asynchronous :: data
28497 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28499#if defined(__parallel)
28501 CALL mpi_free_mem(
DATA, mp_res)
28502 IF (
PRESENT(stat)) stat = mp_res
28505 IF (
PRESENT(stat)) stat = 0
28507 END SUBROUTINE mp_free_mem_z
28519 SUBROUTINE mp_shift_cm(msg, comm, displ_in)
28521 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
28523 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
28525 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_cm'
28527 INTEGER :: handle, ierror
28528#if defined(__parallel)
28529 INTEGER :: displ, left, &
28530 msglen, myrank, nprocs, &
28535 CALL mp_timeset(routinen, handle)
28537#if defined(__parallel)
28538 CALL mpi_comm_rank(comm%handle, myrank, ierror)
28539 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
28540 CALL mpi_comm_size(comm%handle, nprocs, ierror)
28541 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
28542 IF (
PRESENT(displ_in))
THEN
28547 right =
modulo(myrank + displ, nprocs)
28548 left =
modulo(myrank - displ, nprocs)
28551 CALL mpi_sendrecv_replace(msg, msglen, mpi_complex, right, tag, left, tag, &
28552 comm%handle, mpi_status_ignore, ierror)
28553 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
28554 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_4_size))
28558 mark_used(displ_in)
28560 CALL mp_timestop(handle)
28562 END SUBROUTINE mp_shift_cm
28575 SUBROUTINE mp_shift_c (msg, comm, displ_in)
28577 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
28579 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
28581 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_c'
28583 INTEGER :: handle, ierror
28584#if defined(__parallel)
28585 INTEGER :: displ, left, &
28586 msglen, myrank, nprocs, &
28591 CALL mp_timeset(routinen, handle)
28593#if defined(__parallel)
28594 CALL mpi_comm_rank(comm%handle, myrank, ierror)
28595 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
28596 CALL mpi_comm_size(comm%handle, nprocs, ierror)
28597 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
28598 IF (
PRESENT(displ_in))
THEN
28603 right =
modulo(myrank + displ, nprocs)
28604 left =
modulo(myrank - displ, nprocs)
28607 CALL mpi_sendrecv_replace(msg, msglen, mpi_complex, right, tag, left, &
28608 tag, comm%handle, mpi_status_ignore, ierror)
28609 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
28610 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_4_size))
28614 mark_used(displ_in)
28616 CALL mp_timestop(handle)
28618 END SUBROUTINE mp_shift_c
28639 SUBROUTINE mp_alltoall_c11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
28641 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
28642 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
28643 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
28644 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
28647 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c11v'
28650#if defined(__parallel)
28651 INTEGER :: ierr, msglen
28656 CALL mp_timeset(routinen, handle)
28658#if defined(__parallel)
28659 CALL mpi_alltoallv(sb, scount, sdispl, mpi_complex, &
28660 rb, rcount, rdispl, mpi_complex, comm%handle, ierr)
28661 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
28662 msglen = sum(scount) + sum(rcount)
28663 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28669 DO i = 1, rcount(1)
28670 rb(rdispl(1) + i) = sb(sdispl(1) + i)
28673 CALL mp_timestop(handle)
28675 END SUBROUTINE mp_alltoall_c11v
28690 SUBROUTINE mp_alltoall_c22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
28692 COMPLEX(kind=real_4),
DIMENSION(:, :), &
28693 INTENT(IN),
CONTIGUOUS :: sb
28694 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
28695 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS, &
28696 INTENT(INOUT) :: rb
28697 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
28700 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c22v'
28703#if defined(__parallel)
28704 INTEGER :: ierr, msglen
28707 CALL mp_timeset(routinen, handle)
28709#if defined(__parallel)
28710 CALL mpi_alltoallv(sb, scount, sdispl, mpi_complex, &
28711 rb, rcount, rdispl, mpi_complex, comm%handle, ierr)
28712 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
28713 msglen = sum(scount) + sum(rcount)
28714 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*(2*real_4_size))
28723 CALL mp_timestop(handle)
28725 END SUBROUTINE mp_alltoall_c22v
28742 SUBROUTINE mp_alltoall_c (sb, rb, count, comm)
28744 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
28745 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
28746 INTEGER,
INTENT(IN) :: count
28749 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c'
28752#if defined(__parallel)
28753 INTEGER :: ierr, msglen, np
28756 CALL mp_timeset(routinen, handle)
28758#if defined(__parallel)
28759 CALL mpi_alltoall(sb, count, mpi_complex, &
28760 rb, count, mpi_complex, comm%handle, ierr)
28761 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28762 CALL mpi_comm_size(comm%handle, np, ierr)
28763 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28764 msglen = 2*count*np
28765 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28771 CALL mp_timestop(handle)
28773 END SUBROUTINE mp_alltoall_c
28783 SUBROUTINE mp_alltoall_c22(sb, rb, count, comm)
28785 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
28786 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
28787 INTEGER,
INTENT(IN) :: count
28790 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c22'
28793#if defined(__parallel)
28794 INTEGER :: ierr, msglen, np
28797 CALL mp_timeset(routinen, handle)
28799#if defined(__parallel)
28800 CALL mpi_alltoall(sb, count, mpi_complex, &
28801 rb, count, mpi_complex, comm%handle, ierr)
28802 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28803 CALL mpi_comm_size(comm%handle, np, ierr)
28804 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28805 msglen = 2*
SIZE(sb)*np
28806 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28812 CALL mp_timestop(handle)
28814 END SUBROUTINE mp_alltoall_c22
28824 SUBROUTINE mp_alltoall_c33(sb, rb, count, comm)
28826 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
28827 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
28828 INTEGER,
INTENT(IN) :: count
28831 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c33'
28834#if defined(__parallel)
28835 INTEGER :: ierr, msglen, np
28838 CALL mp_timeset(routinen, handle)
28840#if defined(__parallel)
28841 CALL mpi_alltoall(sb, count, mpi_complex, &
28842 rb, count, mpi_complex, comm%handle, ierr)
28843 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28844 CALL mpi_comm_size(comm%handle, np, ierr)
28845 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28846 msglen = 2*count*np
28847 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28853 CALL mp_timestop(handle)
28855 END SUBROUTINE mp_alltoall_c33
28865 SUBROUTINE mp_alltoall_c44(sb, rb, count, comm)
28867 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28869 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28871 INTEGER,
INTENT(IN) :: count
28874 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c44'
28877#if defined(__parallel)
28878 INTEGER :: ierr, msglen, np
28881 CALL mp_timeset(routinen, handle)
28883#if defined(__parallel)
28884 CALL mpi_alltoall(sb, count, mpi_complex, &
28885 rb, count, mpi_complex, comm%handle, ierr)
28886 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28887 CALL mpi_comm_size(comm%handle, np, ierr)
28888 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28889 msglen = 2*count*np
28890 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28896 CALL mp_timestop(handle)
28898 END SUBROUTINE mp_alltoall_c44
28908 SUBROUTINE mp_alltoall_c55(sb, rb, count, comm)
28910 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
28912 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
28914 INTEGER,
INTENT(IN) :: count
28917 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c55'
28920#if defined(__parallel)
28921 INTEGER :: ierr, msglen, np
28924 CALL mp_timeset(routinen, handle)
28926#if defined(__parallel)
28927 CALL mpi_alltoall(sb, count, mpi_complex, &
28928 rb, count, mpi_complex, comm%handle, ierr)
28929 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28930 CALL mpi_comm_size(comm%handle, np, ierr)
28931 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28932 msglen = 2*count*np
28933 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28939 CALL mp_timestop(handle)
28941 END SUBROUTINE mp_alltoall_c55
28952 SUBROUTINE mp_alltoall_c45(sb, rb, count, comm)
28954 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28956 COMPLEX(kind=real_4), &
28957 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
28958 INTEGER,
INTENT(IN) :: count
28961 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c45'
28964#if defined(__parallel)
28965 INTEGER :: ierr, msglen, np
28968 CALL mp_timeset(routinen, handle)
28970#if defined(__parallel)
28971 CALL mpi_alltoall(sb, count, mpi_complex, &
28972 rb, count, mpi_complex, comm%handle, ierr)
28973 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28974 CALL mpi_comm_size(comm%handle, np, ierr)
28975 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28976 msglen = 2*count*np
28977 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28981 rb = reshape(sb, shape(rb))
28983 CALL mp_timestop(handle)
28985 END SUBROUTINE mp_alltoall_c45
28996 SUBROUTINE mp_alltoall_c34(sb, rb, count, comm)
28998 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
29000 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
29002 INTEGER,
INTENT(IN) :: count
29005 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c34'
29008#if defined(__parallel)
29009 INTEGER :: ierr, msglen, np
29012 CALL mp_timeset(routinen, handle)
29014#if defined(__parallel)
29015 CALL mpi_alltoall(sb, count, mpi_complex, &
29016 rb, count, mpi_complex, comm%handle, ierr)
29017 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29018 CALL mpi_comm_size(comm%handle, np, ierr)
29019 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29020 msglen = 2*count*np
29021 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29025 rb = reshape(sb, shape(rb))
29027 CALL mp_timestop(handle)
29029 END SUBROUTINE mp_alltoall_c34
29040 SUBROUTINE mp_alltoall_c54(sb, rb, count, comm)
29042 COMPLEX(kind=real_4), &
29043 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
29044 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
29046 INTEGER,
INTENT(IN) :: count
29049 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c54'
29052#if defined(__parallel)
29053 INTEGER :: ierr, msglen, np
29056 CALL mp_timeset(routinen, handle)
29058#if defined(__parallel)
29059 CALL mpi_alltoall(sb, count, mpi_complex, &
29060 rb, count, mpi_complex, comm%handle, ierr)
29061 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29062 CALL mpi_comm_size(comm%handle, np, ierr)
29063 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29064 msglen = 2*count*np
29065 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29069 rb = reshape(sb, shape(rb))
29071 CALL mp_timestop(handle)
29073 END SUBROUTINE mp_alltoall_c54
29084 SUBROUTINE mp_send_c (msg, dest, tag, comm)
29085 COMPLEX(kind=real_4),
INTENT(IN) :: msg
29086 INTEGER,
INTENT(IN) :: dest, tag
29089 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_c'
29092#if defined(__parallel)
29093 INTEGER :: ierr, msglen
29096 CALL mp_timeset(routinen, handle)
29098#if defined(__parallel)
29100 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29101 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29102 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29109 cpabort(
"not in parallel mode")
29111 CALL mp_timestop(handle)
29112 END SUBROUTINE mp_send_c
29122 SUBROUTINE mp_send_cv(msg, dest, tag, comm)
29123 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
29124 INTEGER,
INTENT(IN) :: dest, tag
29127 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_cv'
29130#if defined(__parallel)
29131 INTEGER :: ierr, msglen
29134 CALL mp_timeset(routinen, handle)
29136#if defined(__parallel)
29138 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29139 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29140 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29147 cpabort(
"not in parallel mode")
29149 CALL mp_timestop(handle)
29150 END SUBROUTINE mp_send_cv
29160 SUBROUTINE mp_send_cm2(msg, dest, tag, comm)
29161 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
29162 INTEGER,
INTENT(IN) :: dest, tag
29165 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_cm2'
29168#if defined(__parallel)
29169 INTEGER :: ierr, msglen
29172 CALL mp_timeset(routinen, handle)
29174#if defined(__parallel)
29176 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29177 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29178 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29185 cpabort(
"not in parallel mode")
29187 CALL mp_timestop(handle)
29188 END SUBROUTINE mp_send_cm2
29198 SUBROUTINE mp_send_cm3(msg, dest, tag, comm)
29199 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
29200 INTEGER,
INTENT(IN) :: dest, tag
29203 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
29206#if defined(__parallel)
29207 INTEGER :: ierr, msglen
29210 CALL mp_timeset(routinen, handle)
29212#if defined(__parallel)
29214 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29215 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29216 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29223 cpabort(
"not in parallel mode")
29225 CALL mp_timestop(handle)
29226 END SUBROUTINE mp_send_cm3
29237 SUBROUTINE mp_recv_c (msg, source, tag, comm)
29238 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29239 INTEGER,
INTENT(INOUT) :: source, tag
29242 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_c'
29245#if defined(__parallel)
29246 INTEGER :: ierr, msglen
29247 mpi_status_type :: status
29250 CALL mp_timeset(routinen, handle)
29252#if defined(__parallel)
29255 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29256 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29258 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29259 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29260 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29261 source = status mpi_status_extract(mpi_source)
29262 tag = status mpi_status_extract(mpi_tag)
29270 cpabort(
"not in parallel mode")
29272 CALL mp_timestop(handle)
29273 END SUBROUTINE mp_recv_c
29283 SUBROUTINE mp_recv_cv(msg, source, tag, comm)
29284 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29285 INTEGER,
INTENT(INOUT) :: source, tag
29288 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cv'
29291#if defined(__parallel)
29292 INTEGER :: ierr, msglen
29293 mpi_status_type :: status
29296 CALL mp_timeset(routinen, handle)
29298#if defined(__parallel)
29301 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29302 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29304 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29305 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29306 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29307 source = status mpi_status_extract(mpi_source)
29308 tag = status mpi_status_extract(mpi_tag)
29316 cpabort(
"not in parallel mode")
29318 CALL mp_timestop(handle)
29319 END SUBROUTINE mp_recv_cv
29329 SUBROUTINE mp_recv_cm2(msg, source, tag, comm)
29330 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29331 INTEGER,
INTENT(INOUT) :: source, tag
29334 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cm2'
29337#if defined(__parallel)
29338 INTEGER :: ierr, msglen
29339 mpi_status_type :: status
29342 CALL mp_timeset(routinen, handle)
29344#if defined(__parallel)
29347 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29348 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29350 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29351 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29352 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29353 source = status mpi_status_extract(mpi_source)
29354 tag = status mpi_status_extract(mpi_tag)
29362 cpabort(
"not in parallel mode")
29364 CALL mp_timestop(handle)
29365 END SUBROUTINE mp_recv_cm2
29375 SUBROUTINE mp_recv_cm3(msg, source, tag, comm)
29376 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
29377 INTEGER,
INTENT(INOUT) :: source, tag
29380 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cm3'
29383#if defined(__parallel)
29384 INTEGER :: ierr, msglen
29385 mpi_status_type :: status
29388 CALL mp_timeset(routinen, handle)
29390#if defined(__parallel)
29393 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29394 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29396 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29397 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29398 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29399 source = status mpi_status_extract(mpi_source)
29400 tag = status mpi_status_extract(mpi_tag)
29408 cpabort(
"not in parallel mode")
29410 CALL mp_timestop(handle)
29411 END SUBROUTINE mp_recv_cm3
29421 SUBROUTINE mp_bcast_c (msg, source, comm)
29422 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29423 INTEGER,
INTENT(IN) :: source
29426 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c'
29429#if defined(__parallel)
29430 INTEGER :: ierr, msglen
29433 CALL mp_timeset(routinen, handle)
29435#if defined(__parallel)
29437 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29438 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29439 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29445 CALL mp_timestop(handle)
29446 END SUBROUTINE mp_bcast_c
29455 SUBROUTINE mp_bcast_c_src(msg, comm)
29456 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29459 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c_src'
29462#if defined(__parallel)
29463 INTEGER :: ierr, msglen
29466 CALL mp_timeset(routinen, handle)
29468#if defined(__parallel)
29470 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29471 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29472 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29477 CALL mp_timestop(handle)
29478 END SUBROUTINE mp_bcast_c_src
29488 SUBROUTINE mp_ibcast_c (msg, source, comm, request)
29489 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29490 INTEGER,
INTENT(IN) :: source
29494 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_c'
29497#if defined(__parallel)
29498 INTEGER :: ierr, msglen
29501 CALL mp_timeset(routinen, handle)
29503#if defined(__parallel)
29505 CALL mpi_ibcast(msg, msglen, mpi_complex, source, comm%handle, request%handle, ierr)
29506 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
29507 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_4_size))
29514 CALL mp_timestop(handle)
29515 END SUBROUTINE mp_ibcast_c
29524 SUBROUTINE mp_bcast_cv(msg, source, comm)
29525 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29526 INTEGER,
INTENT(IN) :: source
29529 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cv'
29532#if defined(__parallel)
29533 INTEGER :: ierr, msglen
29536 CALL mp_timeset(routinen, handle)
29538#if defined(__parallel)
29540 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29541 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29542 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29548 CALL mp_timestop(handle)
29549 END SUBROUTINE mp_bcast_cv
29557 SUBROUTINE mp_bcast_cv_src(msg, comm)
29558 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29561 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cv_src'
29564#if defined(__parallel)
29565 INTEGER :: ierr, msglen
29568 CALL mp_timeset(routinen, handle)
29570#if defined(__parallel)
29572 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29573 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29574 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29579 CALL mp_timestop(handle)
29580 END SUBROUTINE mp_bcast_cv_src
29589 SUBROUTINE mp_ibcast_cv(msg, source, comm, request)
29590 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
29591 INTEGER,
INTENT(IN) :: source
29595 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_cv'
29598#if defined(__parallel)
29599 INTEGER :: ierr, msglen
29602 CALL mp_timeset(routinen, handle)
29604#if defined(__parallel)
29605#if !defined(__GNUC__) || __GNUC__ >= 9
29606 cpassert(is_contiguous(msg))
29609 CALL mpi_ibcast(msg, msglen, mpi_complex, source, comm%handle, request%handle, ierr)
29610 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
29611 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_4_size))
29618 CALL mp_timestop(handle)
29619 END SUBROUTINE mp_ibcast_cv
29628 SUBROUTINE mp_bcast_cm(msg, source, comm)
29629 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29630 INTEGER,
INTENT(IN) :: source
29633 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cm'
29636#if defined(__parallel)
29637 INTEGER :: ierr, msglen
29640 CALL mp_timeset(routinen, handle)
29642#if defined(__parallel)
29644 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29645 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29646 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29652 CALL mp_timestop(handle)
29653 END SUBROUTINE mp_bcast_cm
29662 SUBROUTINE mp_bcast_cm_src(msg, comm)
29663 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29666 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cm_src'
29669#if defined(__parallel)
29670 INTEGER :: ierr, msglen
29673 CALL mp_timeset(routinen, handle)
29675#if defined(__parallel)
29677 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29678 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29679 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29684 CALL mp_timestop(handle)
29685 END SUBROUTINE mp_bcast_cm_src
29694 SUBROUTINE mp_bcast_c3(msg, source, comm)
29695 COMPLEX(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
29696 INTEGER,
INTENT(IN) :: source
29699 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c3'
29702#if defined(__parallel)
29703 INTEGER :: ierr, msglen
29706 CALL mp_timeset(routinen, handle)
29708#if defined(__parallel)
29710 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29711 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29712 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29718 CALL mp_timestop(handle)
29719 END SUBROUTINE mp_bcast_c3
29728 SUBROUTINE mp_bcast_c3_src(msg, comm)
29729 COMPLEX(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
29732 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c3_src'
29735#if defined(__parallel)
29736 INTEGER :: ierr, msglen
29739 CALL mp_timeset(routinen, handle)
29741#if defined(__parallel)
29743 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29744 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29745 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29750 CALL mp_timestop(handle)
29751 END SUBROUTINE mp_bcast_c3_src
29760 SUBROUTINE mp_sum_c (msg, comm)
29761 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29764 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_c'
29767#if defined(__parallel)
29768 INTEGER :: ierr, msglen
29771 CALL mp_timeset(routinen, handle)
29773#if defined(__parallel)
29775 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29776 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29777 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29782 CALL mp_timestop(handle)
29783 END SUBROUTINE mp_sum_c
29791 SUBROUTINE mp_sum_cv(msg, comm)
29792 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29795 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cv'
29798#if defined(__parallel)
29799 INTEGER :: ierr, msglen
29802 CALL mp_timeset(routinen, handle)
29804#if defined(__parallel)
29806 IF (msglen > 0)
THEN
29807 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29808 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29810 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29815 CALL mp_timestop(handle)
29816 END SUBROUTINE mp_sum_cv
29824 SUBROUTINE mp_isum_cv(msg, comm, request)
29825 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
29829 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_cv'
29832#if defined(__parallel)
29833 INTEGER :: ierr, msglen
29836 CALL mp_timeset(routinen, handle)
29838#if defined(__parallel)
29839#if !defined(__GNUC__) || __GNUC__ >= 9
29840 cpassert(is_contiguous(msg))
29843 IF (msglen > 0)
THEN
29844 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, request%handle, ierr)
29845 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
29849 CALL add_perf(perf_id=23, count=1, msg_size=msglen*(2*real_4_size))
29855 CALL mp_timestop(handle)
29856 END SUBROUTINE mp_isum_cv
29864 SUBROUTINE mp_sum_cm(msg, comm)
29865 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29868 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm'
29871#if defined(__parallel)
29872 INTEGER,
PARAMETER :: max_msg = 2**25
29873 INTEGER :: ierr, m1, msglen, step, msglensum
29876 CALL mp_timeset(routinen, handle)
29878#if defined(__parallel)
29880 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
29882 DO m1 = lbound(msg, 2), ubound(msg, 2), step
29883 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
29884 msglensum = msglensum + msglen
29885 IF (msglen > 0)
THEN
29886 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29887 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29890 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_4_size))
29895 CALL mp_timestop(handle)
29896 END SUBROUTINE mp_sum_cm
29904 SUBROUTINE mp_sum_cm3(msg, comm)
29905 COMPLEX(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
29908 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm3'
29911#if defined(__parallel)
29912 INTEGER :: ierr, msglen
29915 CALL mp_timeset(routinen, handle)
29917#if defined(__parallel)
29919 IF (msglen > 0)
THEN
29920 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29921 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29923 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29928 CALL mp_timestop(handle)
29929 END SUBROUTINE mp_sum_cm3
29937 SUBROUTINE mp_sum_cm4(msg, comm)
29938 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
29941 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm4'
29944#if defined(__parallel)
29945 INTEGER :: ierr, msglen
29948 CALL mp_timeset(routinen, handle)
29950#if defined(__parallel)
29952 IF (msglen > 0)
THEN
29953 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29954 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29956 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29961 CALL mp_timestop(handle)
29962 END SUBROUTINE mp_sum_cm4
29974 SUBROUTINE mp_sum_root_cv(msg, root, comm)
29975 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29976 INTEGER,
INTENT(IN) :: root
29979 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_cv'
29982#if defined(__parallel)
29983 INTEGER :: ierr, m1, msglen, taskid
29984 COMPLEX(kind=real_4),
ALLOCATABLE :: res(:)
29987 CALL mp_timeset(routinen, handle)
29989#if defined(__parallel)
29991 CALL mpi_comm_rank(comm%handle, taskid, ierr)
29992 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
29993 IF (msglen > 0)
THEN
29996 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_sum, &
29997 root, comm%handle, ierr)
29998 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
29999 IF (taskid == root)
THEN
30004 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30010 CALL mp_timestop(handle)
30011 END SUBROUTINE mp_sum_root_cv
30022 SUBROUTINE mp_sum_root_cm(msg, root, comm)
30023 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30024 INTEGER,
INTENT(IN) :: root
30027 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
30030#if defined(__parallel)
30031 INTEGER :: ierr, m1, m2, msglen, taskid
30032 COMPLEX(kind=real_4),
ALLOCATABLE :: res(:, :)
30035 CALL mp_timeset(routinen, handle)
30037#if defined(__parallel)
30039 CALL mpi_comm_rank(comm%handle, taskid, ierr)
30040 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
30041 IF (msglen > 0)
THEN
30044 ALLOCATE (res(m1, m2))
30045 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_sum, root, comm%handle, ierr)
30046 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
30047 IF (taskid == root)
THEN
30052 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30058 CALL mp_timestop(handle)
30059 END SUBROUTINE mp_sum_root_cm
30067 SUBROUTINE mp_sum_partial_cm(msg, res, comm)
30068 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
30069 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
30072 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_cm'
30075#if defined(__parallel)
30076 INTEGER :: ierr, msglen, taskid
30079 CALL mp_timeset(routinen, handle)
30081#if defined(__parallel)
30083 CALL mpi_comm_rank(comm%handle, taskid, ierr)
30084 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
30085 IF (msglen > 0)
THEN
30086 CALL mpi_scan(msg, res, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
30087 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
30089 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30095 CALL mp_timestop(handle)
30096 END SUBROUTINE mp_sum_partial_cm
30106 SUBROUTINE mp_max_c (msg, comm)
30107 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30110 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_c'
30113#if defined(__parallel)
30114 INTEGER :: ierr, msglen
30117 CALL mp_timeset(routinen, handle)
30119#if defined(__parallel)
30121 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_max, comm%handle, ierr)
30122 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30123 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30128 CALL mp_timestop(handle)
30129 END SUBROUTINE mp_max_c
30139 SUBROUTINE mp_max_root_c (msg, root, comm)
30140 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30141 INTEGER,
INTENT(IN) :: root
30144 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_c'
30147#if defined(__parallel)
30148 INTEGER :: ierr, msglen
30149 COMPLEX(kind=real_4) :: res
30152 CALL mp_timeset(routinen, handle)
30154#if defined(__parallel)
30156 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_max, root, comm%handle, ierr)
30157 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
30158 IF (root == comm%mepos) msg = res
30159 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30165 CALL mp_timestop(handle)
30166 END SUBROUTINE mp_max_root_c
30176 SUBROUTINE mp_max_cv(msg, comm)
30177 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
30180 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_cv'
30183#if defined(__parallel)
30184 INTEGER :: ierr, msglen
30187 CALL mp_timeset(routinen, handle)
30189#if defined(__parallel)
30191 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_max, comm%handle, ierr)
30192 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30193 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30198 CALL mp_timestop(handle)
30199 END SUBROUTINE mp_max_cv
30209 SUBROUTINE mp_max_root_cm(msg, root, comm)
30210 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30214 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_cm'
30217#if defined(__parallel)
30218 INTEGER :: ierr, msglen
30219 COMPLEX(kind=real_4) :: res(size(msg, 1), size(msg, 2))
30222 CALL mp_timeset(routinen, handle)
30224#if defined(__parallel)
30226 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_max, root, comm%handle, ierr)
30227 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30228 IF (root == comm%mepos) msg = res
30229 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30235 CALL mp_timestop(handle)
30236 END SUBROUTINE mp_max_root_cm
30246 SUBROUTINE mp_min_c (msg, comm)
30247 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30250 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_c'
30253#if defined(__parallel)
30254 INTEGER :: ierr, msglen
30257 CALL mp_timeset(routinen, handle)
30259#if defined(__parallel)
30261 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_min, comm%handle, ierr)
30262 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30263 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30268 CALL mp_timestop(handle)
30269 END SUBROUTINE mp_min_c
30281 SUBROUTINE mp_min_cv(msg, comm)
30282 COMPLEX(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
30285 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_cv'
30288#if defined(__parallel)
30289 INTEGER :: ierr, msglen
30292 CALL mp_timeset(routinen, handle)
30294#if defined(__parallel)
30296 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_min, comm%handle, ierr)
30297 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30298 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30303 CALL mp_timestop(handle)
30304 END SUBROUTINE mp_min_cv
30314 SUBROUTINE mp_prod_c (msg, comm)
30315 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30318 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_c'
30321#if defined(__parallel)
30322 INTEGER :: ierr, msglen
30325 CALL mp_timeset(routinen, handle)
30327#if defined(__parallel)
30329 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_prod, comm%handle, ierr)
30330 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30331 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30336 CALL mp_timestop(handle)
30337 END SUBROUTINE mp_prod_c
30348 SUBROUTINE mp_scatter_cv(msg_scatter, msg, root, comm)
30349 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
30350 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
30351 INTEGER,
INTENT(IN) :: root
30354 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_cv'
30357#if defined(__parallel)
30358 INTEGER :: ierr, msglen
30361 CALL mp_timeset(routinen, handle)
30363#if defined(__parallel)
30365 CALL mpi_scatter(msg_scatter, msglen, mpi_complex, msg, &
30366 msglen, mpi_complex, root, comm%handle, ierr)
30367 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
30368 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30374 CALL mp_timestop(handle)
30375 END SUBROUTINE mp_scatter_cv
30385 SUBROUTINE mp_iscatter_c (msg_scatter, msg, root, comm, request)
30386 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:)
30387 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30388 INTEGER,
INTENT(IN) :: root
30392 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_c'
30395#if defined(__parallel)
30396 INTEGER :: ierr, msglen
30399 CALL mp_timeset(routinen, handle)
30401#if defined(__parallel)
30402#if !defined(__GNUC__) || __GNUC__ >= 9
30403 cpassert(is_contiguous(msg_scatter))
30406 CALL mpi_iscatter(msg_scatter, msglen, mpi_complex, msg, &
30407 msglen, mpi_complex, root, comm%handle, request%handle, ierr)
30408 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
30409 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
30413 msg = msg_scatter(1)
30416 CALL mp_timestop(handle)
30417 END SUBROUTINE mp_iscatter_c
30427 SUBROUTINE mp_iscatter_cv2(msg_scatter, msg, root, comm, request)
30428 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:, :)
30429 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
30430 INTEGER,
INTENT(IN) :: root
30434 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_cv2'
30437#if defined(__parallel)
30438 INTEGER :: ierr, msglen
30441 CALL mp_timeset(routinen, handle)
30443#if defined(__parallel)
30444#if !defined(__GNUC__) || __GNUC__ >= 9
30445 cpassert(is_contiguous(msg_scatter))
30448 CALL mpi_iscatter(msg_scatter, msglen, mpi_complex, msg, &
30449 msglen, mpi_complex, root, comm%handle, request%handle, ierr)
30450 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
30451 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
30455 msg(:) = msg_scatter(:, 1)
30458 CALL mp_timestop(handle)
30459 END SUBROUTINE mp_iscatter_cv2
30469 SUBROUTINE mp_iscatterv_cv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
30470 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:)
30471 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
30472 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
30473 INTEGER,
INTENT(IN) :: recvcount, root
30477 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_cv'
30480#if defined(__parallel)
30484 CALL mp_timeset(routinen, handle)
30486#if defined(__parallel)
30487#if !defined(__GNUC__) || __GNUC__ >= 9
30488 cpassert(is_contiguous(msg_scatter))
30489 cpassert(is_contiguous(msg))
30490 cpassert(is_contiguous(sendcounts))
30491 cpassert(is_contiguous(displs))
30493 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_complex, msg, &
30494 recvcount, mpi_complex, root, comm%handle, request%handle, ierr)
30495 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
30496 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
30498 mark_used(sendcounts)
30500 mark_used(recvcount)
30503 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
30506 CALL mp_timestop(handle)
30507 END SUBROUTINE mp_iscatterv_cv
30518 SUBROUTINE mp_gather_c (msg, msg_gather, root, comm)
30519 COMPLEX(kind=real_4),
INTENT(IN) :: msg
30520 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30521 INTEGER,
INTENT(IN) :: root
30524 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_c'
30527#if defined(__parallel)
30528 INTEGER :: ierr, msglen
30531 CALL mp_timeset(routinen, handle)
30533#if defined(__parallel)
30535 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30536 msglen, mpi_complex, root, comm%handle, ierr)
30537 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30538 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30542 msg_gather(1) = msg
30544 CALL mp_timestop(handle)
30545 END SUBROUTINE mp_gather_c
30555 SUBROUTINE mp_gather_c_src(msg, msg_gather, comm)
30556 COMPLEX(kind=real_4),
INTENT(IN) :: msg
30557 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30560 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_c_src'
30563#if defined(__parallel)
30564 INTEGER :: ierr, msglen
30567 CALL mp_timeset(routinen, handle)
30569#if defined(__parallel)
30571 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30572 msglen, mpi_complex, comm%source, comm%handle, ierr)
30573 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30574 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30577 msg_gather(1) = msg
30579 CALL mp_timestop(handle)
30580 END SUBROUTINE mp_gather_c_src
30594 SUBROUTINE mp_gather_cv(msg, msg_gather, root, comm)
30595 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
30596 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30597 INTEGER,
INTENT(IN) :: root
30600 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cv'
30603#if defined(__parallel)
30604 INTEGER :: ierr, msglen
30607 CALL mp_timeset(routinen, handle)
30609#if defined(__parallel)
30611 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30612 msglen, mpi_complex, root, comm%handle, ierr)
30613 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30614 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30620 CALL mp_timestop(handle)
30621 END SUBROUTINE mp_gather_cv
30634 SUBROUTINE mp_gather_cv_src(msg, msg_gather, comm)
30635 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
30636 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30639 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cv_src'
30642#if defined(__parallel)
30643 INTEGER :: ierr, msglen
30646 CALL mp_timeset(routinen, handle)
30648#if defined(__parallel)
30650 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30651 msglen, mpi_complex, comm%source, comm%handle, ierr)
30652 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30653 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30658 CALL mp_timestop(handle)
30659 END SUBROUTINE mp_gather_cv_src
30673 SUBROUTINE mp_gather_cm(msg, msg_gather, root, comm)
30674 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
30675 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
30676 INTEGER,
INTENT(IN) :: root
30679 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cm'
30682#if defined(__parallel)
30683 INTEGER :: ierr, msglen
30686 CALL mp_timeset(routinen, handle)
30688#if defined(__parallel)
30690 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30691 msglen, mpi_complex, root, comm%handle, ierr)
30692 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30693 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30699 CALL mp_timestop(handle)
30700 END SUBROUTINE mp_gather_cm
30713 SUBROUTINE mp_gather_cm_src(msg, msg_gather, comm)
30714 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
30715 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
30718 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cm_src'
30721#if defined(__parallel)
30722 INTEGER :: ierr, msglen
30725 CALL mp_timeset(routinen, handle)
30727#if defined(__parallel)
30729 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30730 msglen, mpi_complex, comm%source, comm%handle, ierr)
30731 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30732 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30737 CALL mp_timestop(handle)
30738 END SUBROUTINE mp_gather_cm_src
30755 SUBROUTINE mp_gatherv_cv(sendbuf, recvbuf, recvcounts, displs, root, comm)
30757 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30758 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30759 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30760 INTEGER,
INTENT(IN) :: root
30763 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cv'
30766#if defined(__parallel)
30767 INTEGER :: ierr, sendcount
30770 CALL mp_timeset(routinen, handle)
30772#if defined(__parallel)
30773 sendcount =
SIZE(sendbuf)
30774 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30775 recvbuf, recvcounts, displs, mpi_complex, &
30776 root, comm%handle, ierr)
30777 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30778 CALL add_perf(perf_id=4, &
30780 msg_size=sendcount*(2*real_4_size))
30782 mark_used(recvcounts)
30785 recvbuf(1 + displs(1):) = sendbuf
30787 CALL mp_timestop(handle)
30788 END SUBROUTINE mp_gatherv_cv
30804 SUBROUTINE mp_gatherv_cv_src(sendbuf, recvbuf, recvcounts, displs, comm)
30806 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30807 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30808 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30811 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cv_src'
30814#if defined(__parallel)
30815 INTEGER :: ierr, sendcount
30818 CALL mp_timeset(routinen, handle)
30820#if defined(__parallel)
30821 sendcount =
SIZE(sendbuf)
30822 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30823 recvbuf, recvcounts, displs, mpi_complex, &
30824 comm%source, comm%handle, ierr)
30825 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30826 CALL add_perf(perf_id=4, &
30828 msg_size=sendcount*(2*real_4_size))
30830 mark_used(recvcounts)
30832 recvbuf(1 + displs(1):) = sendbuf
30834 CALL mp_timestop(handle)
30835 END SUBROUTINE mp_gatherv_cv_src
30852 SUBROUTINE mp_gatherv_cm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
30854 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30855 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30856 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30857 INTEGER,
INTENT(IN) :: root
30860 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cm2'
30863#if defined(__parallel)
30864 INTEGER :: ierr, sendcount
30867 CALL mp_timeset(routinen, handle)
30869#if defined(__parallel)
30870 sendcount =
SIZE(sendbuf)
30871 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30872 recvbuf, recvcounts, displs, mpi_complex, &
30873 root, comm%handle, ierr)
30874 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30875 CALL add_perf(perf_id=4, &
30877 msg_size=sendcount*(2*real_4_size))
30879 mark_used(recvcounts)
30882 recvbuf(:, 1 + displs(1):) = sendbuf
30884 CALL mp_timestop(handle)
30885 END SUBROUTINE mp_gatherv_cm2
30901 SUBROUTINE mp_gatherv_cm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
30903 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30904 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30905 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30908 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cm2_src'
30911#if defined(__parallel)
30912 INTEGER :: ierr, sendcount
30915 CALL mp_timeset(routinen, handle)
30917#if defined(__parallel)
30918 sendcount =
SIZE(sendbuf)
30919 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30920 recvbuf, recvcounts, displs, mpi_complex, &
30921 comm%source, comm%handle, ierr)
30922 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30923 CALL add_perf(perf_id=4, &
30925 msg_size=sendcount*(2*real_4_size))
30927 mark_used(recvcounts)
30929 recvbuf(:, 1 + displs(1):) = sendbuf
30931 CALL mp_timestop(handle)
30932 END SUBROUTINE mp_gatherv_cm2_src
30949 SUBROUTINE mp_igatherv_cv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
30950 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
30951 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
30952 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30953 INTEGER,
INTENT(IN) :: sendcount, root
30957 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_cv'
30960#if defined(__parallel)
30964 CALL mp_timeset(routinen, handle)
30966#if defined(__parallel)
30967#if !defined(__GNUC__) || __GNUC__ >= 9
30968 cpassert(is_contiguous(sendbuf))
30969 cpassert(is_contiguous(recvbuf))
30970 cpassert(is_contiguous(recvcounts))
30971 cpassert(is_contiguous(displs))
30973 CALL mpi_igatherv(sendbuf, sendcount, mpi_complex, &
30974 recvbuf, recvcounts, displs, mpi_complex, &
30975 root, comm%handle, request%handle, ierr)
30976 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30977 CALL add_perf(perf_id=24, &
30979 msg_size=sendcount*(2*real_4_size))
30981 mark_used(sendcount)
30982 mark_used(recvcounts)
30985 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
30988 CALL mp_timestop(handle)
30989 END SUBROUTINE mp_igatherv_cv
31002 SUBROUTINE mp_allgather_c (msgout, msgin, comm)
31003 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
31004 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
31007 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c'
31010#if defined(__parallel)
31011 INTEGER :: ierr, rcount, scount
31014 CALL mp_timeset(routinen, handle)
31016#if defined(__parallel)
31019 CALL mpi_allgather(msgout, scount, mpi_complex, &
31020 msgin, rcount, mpi_complex, &
31022 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31027 CALL mp_timestop(handle)
31028 END SUBROUTINE mp_allgather_c
31041 SUBROUTINE mp_allgather_c2(msgout, msgin, comm)
31042 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
31043 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
31046 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c2'
31049#if defined(__parallel)
31050 INTEGER :: ierr, rcount, scount
31053 CALL mp_timeset(routinen, handle)
31055#if defined(__parallel)
31058 CALL mpi_allgather(msgout, scount, mpi_complex, &
31059 msgin, rcount, mpi_complex, &
31061 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31066 CALL mp_timestop(handle)
31067 END SUBROUTINE mp_allgather_c2
31080 SUBROUTINE mp_iallgather_c (msgout, msgin, comm, request)
31081 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
31082 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31086 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c'
31089#if defined(__parallel)
31090 INTEGER :: ierr, rcount, scount
31093 CALL mp_timeset(routinen, handle)
31095#if defined(__parallel)
31096#if !defined(__GNUC__) || __GNUC__ >= 9
31097 cpassert(is_contiguous(msgin))
31101 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31102 msgin, rcount, mpi_complex, &
31103 comm%handle, request%handle, ierr)
31104 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31110 CALL mp_timestop(handle)
31111 END SUBROUTINE mp_iallgather_c
31126 SUBROUTINE mp_allgather_c12(msgout, msgin, comm)
31127 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
31128 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
31131 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c12'
31134#if defined(__parallel)
31135 INTEGER :: ierr, rcount, scount
31138 CALL mp_timeset(routinen, handle)
31140#if defined(__parallel)
31141 scount =
SIZE(msgout(:))
31143 CALL mpi_allgather(msgout, scount, mpi_complex, &
31144 msgin, rcount, mpi_complex, &
31146 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31149 msgin(:, 1) = msgout(:)
31151 CALL mp_timestop(handle)
31152 END SUBROUTINE mp_allgather_c12
31162 SUBROUTINE mp_allgather_c23(msgout, msgin, comm)
31163 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
31164 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
31167 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c23'
31170#if defined(__parallel)
31171 INTEGER :: ierr, rcount, scount
31174 CALL mp_timeset(routinen, handle)
31176#if defined(__parallel)
31177 scount =
SIZE(msgout(:, :))
31179 CALL mpi_allgather(msgout, scount, mpi_complex, &
31180 msgin, rcount, mpi_complex, &
31182 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31185 msgin(:, :, 1) = msgout(:, :)
31187 CALL mp_timestop(handle)
31188 END SUBROUTINE mp_allgather_c23
31198 SUBROUTINE mp_allgather_c34(msgout, msgin, comm)
31199 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
31200 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
31203 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c34'
31206#if defined(__parallel)
31207 INTEGER :: ierr, rcount, scount
31210 CALL mp_timeset(routinen, handle)
31212#if defined(__parallel)
31213 scount =
SIZE(msgout(:, :, :))
31215 CALL mpi_allgather(msgout, scount, mpi_complex, &
31216 msgin, rcount, mpi_complex, &
31218 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31221 msgin(:, :, :, 1) = msgout(:, :, :)
31223 CALL mp_timestop(handle)
31224 END SUBROUTINE mp_allgather_c34
31234 SUBROUTINE mp_allgather_c22(msgout, msgin, comm)
31235 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
31236 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
31239 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c22'
31242#if defined(__parallel)
31243 INTEGER :: ierr, rcount, scount
31246 CALL mp_timeset(routinen, handle)
31248#if defined(__parallel)
31249 scount =
SIZE(msgout(:, :))
31251 CALL mpi_allgather(msgout, scount, mpi_complex, &
31252 msgin, rcount, mpi_complex, &
31254 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31257 msgin(:, :) = msgout(:, :)
31259 CALL mp_timestop(handle)
31260 END SUBROUTINE mp_allgather_c22
31271 SUBROUTINE mp_iallgather_c11(msgout, msgin, comm, request)
31272 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31273 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31277 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c11'
31280#if defined(__parallel)
31281 INTEGER :: ierr, rcount, scount
31284 CALL mp_timeset(routinen, handle)
31286#if defined(__parallel)
31287#if !defined(__GNUC__) || __GNUC__ >= 9
31288 cpassert(is_contiguous(msgout))
31289 cpassert(is_contiguous(msgin))
31291 scount =
SIZE(msgout(:))
31293 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31294 msgin, rcount, mpi_complex, &
31295 comm%handle, request%handle, ierr)
31296 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31302 CALL mp_timestop(handle)
31303 END SUBROUTINE mp_iallgather_c11
31314 SUBROUTINE mp_iallgather_c13(msgout, msgin, comm, request)
31315 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31316 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
31320 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c13'
31323#if defined(__parallel)
31324 INTEGER :: ierr, rcount, scount
31327 CALL mp_timeset(routinen, handle)
31329#if defined(__parallel)
31330#if !defined(__GNUC__) || __GNUC__ >= 9
31331 cpassert(is_contiguous(msgout))
31332 cpassert(is_contiguous(msgin))
31335 scount =
SIZE(msgout(:))
31337 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31338 msgin, rcount, mpi_complex, &
31339 comm%handle, request%handle, ierr)
31340 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31343 msgin(:, 1, 1) = msgout(:)
31346 CALL mp_timestop(handle)
31347 END SUBROUTINE mp_iallgather_c13
31358 SUBROUTINE mp_iallgather_c22(msgout, msgin, comm, request)
31359 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :)
31360 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :)
31364 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c22'
31367#if defined(__parallel)
31368 INTEGER :: ierr, rcount, scount
31371 CALL mp_timeset(routinen, handle)
31373#if defined(__parallel)
31374#if !defined(__GNUC__) || __GNUC__ >= 9
31375 cpassert(is_contiguous(msgout))
31376 cpassert(is_contiguous(msgin))
31379 scount =
SIZE(msgout(:, :))
31381 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31382 msgin, rcount, mpi_complex, &
31383 comm%handle, request%handle, ierr)
31384 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31387 msgin(:, :) = msgout(:, :)
31390 CALL mp_timestop(handle)
31391 END SUBROUTINE mp_iallgather_c22
31402 SUBROUTINE mp_iallgather_c24(msgout, msgin, comm, request)
31403 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :)
31404 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :, :)
31408 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c24'
31411#if defined(__parallel)
31412 INTEGER :: ierr, rcount, scount
31415 CALL mp_timeset(routinen, handle)
31417#if defined(__parallel)
31418#if !defined(__GNUC__) || __GNUC__ >= 9
31419 cpassert(is_contiguous(msgout))
31420 cpassert(is_contiguous(msgin))
31423 scount =
SIZE(msgout(:, :))
31425 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31426 msgin, rcount, mpi_complex, &
31427 comm%handle, request%handle, ierr)
31428 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31431 msgin(:, :, 1, 1) = msgout(:, :)
31434 CALL mp_timestop(handle)
31435 END SUBROUTINE mp_iallgather_c24
31446 SUBROUTINE mp_iallgather_c33(msgout, msgin, comm, request)
31447 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :, :)
31448 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
31452 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c33'
31455#if defined(__parallel)
31456 INTEGER :: ierr, rcount, scount
31459 CALL mp_timeset(routinen, handle)
31461#if defined(__parallel)
31462#if !defined(__GNUC__) || __GNUC__ >= 9
31463 cpassert(is_contiguous(msgout))
31464 cpassert(is_contiguous(msgin))
31467 scount =
SIZE(msgout(:, :, :))
31469 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31470 msgin, rcount, mpi_complex, &
31471 comm%handle, request%handle, ierr)
31472 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31475 msgin(:, :, :) = msgout(:, :, :)
31478 CALL mp_timestop(handle)
31479 END SUBROUTINE mp_iallgather_c33
31498 SUBROUTINE mp_allgatherv_cv(msgout, msgin, rcount, rdispl, comm)
31499 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
31500 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
31501 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
31504 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_cv'
31507#if defined(__parallel)
31508 INTEGER :: ierr, scount
31511 CALL mp_timeset(routinen, handle)
31513#if defined(__parallel)
31514 scount =
SIZE(msgout)
31515 CALL mpi_allgatherv(msgout, scount, mpi_complex, msgin, rcount, &
31516 rdispl, mpi_complex, comm%handle, ierr)
31517 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
31524 CALL mp_timestop(handle)
31525 END SUBROUTINE mp_allgatherv_cv
31544 SUBROUTINE mp_allgatherv_cm2(msgout, msgin, rcount, rdispl, comm)
31545 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
31546 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
31547 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
31550 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_cv'
31553#if defined(__parallel)
31554 INTEGER :: ierr, scount
31557 CALL mp_timeset(routinen, handle)
31559#if defined(__parallel)
31560 scount =
SIZE(msgout)
31561 CALL mpi_allgatherv(msgout, scount, mpi_complex, msgin, rcount, &
31562 rdispl, mpi_complex, comm%handle, ierr)
31563 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
31570 CALL mp_timestop(handle)
31571 END SUBROUTINE mp_allgatherv_cm2
31590 SUBROUTINE mp_iallgatherv_cv(msgout, msgin, rcount, rdispl, comm, request)
31591 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31592 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31593 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
31597 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_cv'
31600#if defined(__parallel)
31601 INTEGER :: ierr, scount, rsize
31604 CALL mp_timeset(routinen, handle)
31606#if defined(__parallel)
31607#if !defined(__GNUC__) || __GNUC__ >= 9
31608 cpassert(is_contiguous(msgout))
31609 cpassert(is_contiguous(msgin))
31610 cpassert(is_contiguous(rcount))
31611 cpassert(is_contiguous(rdispl))
31614 scount =
SIZE(msgout)
31615 rsize =
SIZE(rcount)
31616 CALL mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, &
31617 rdispl, comm, request, ierr)
31618 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
31626 CALL mp_timestop(handle)
31627 END SUBROUTINE mp_iallgatherv_cv
31646 SUBROUTINE mp_iallgatherv_cv2(msgout, msgin, rcount, rdispl, comm, request)
31647 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31648 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31649 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
31653 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_cv2'
31656#if defined(__parallel)
31657 INTEGER :: ierr, scount, rsize
31660 CALL mp_timeset(routinen, handle)
31662#if defined(__parallel)
31663#if !defined(__GNUC__) || __GNUC__ >= 9
31664 cpassert(is_contiguous(msgout))
31665 cpassert(is_contiguous(msgin))
31666 cpassert(is_contiguous(rcount))
31667 cpassert(is_contiguous(rdispl))
31670 scount =
SIZE(msgout)
31671 rsize =
SIZE(rcount)
31672 CALL mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, &
31673 rdispl, comm, request, ierr)
31674 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
31682 CALL mp_timestop(handle)
31683 END SUBROUTINE mp_iallgatherv_cv2
31694#if defined(__parallel)
31695 SUBROUTINE mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
31696 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
31697 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
31698 INTEGER,
INTENT(IN) :: rsize
31699 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
31702 INTEGER,
INTENT(INOUT) :: ierr
31704 CALL mpi_iallgatherv(msgout, scount, mpi_complex, msgin, rcount, &
31705 rdispl, mpi_complex, comm%handle, request%handle, ierr)
31707 END SUBROUTINE mp_iallgatherv_cv_internal
31718 SUBROUTINE mp_sum_scatter_cv(msgout, msgin, rcount, comm)
31719 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
31720 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
31721 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
31724 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_cv'
31727#if defined(__parallel)
31731 CALL mp_timeset(routinen, handle)
31733#if defined(__parallel)
31734 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_complex, mpi_sum, &
31736 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
31738 CALL add_perf(perf_id=3, count=1, &
31739 msg_size=rcount(1)*2*(2*real_4_size))
31743 msgin = msgout(:, 1)
31745 CALL mp_timestop(handle)
31746 END SUBROUTINE mp_sum_scatter_cv
31757 SUBROUTINE mp_sendrecv_c (msgin, dest, msgout, source, comm, tag)
31758 COMPLEX(kind=real_4),
INTENT(IN) :: msgin
31759 INTEGER,
INTENT(IN) :: dest
31760 COMPLEX(kind=real_4),
INTENT(OUT) :: msgout
31761 INTEGER,
INTENT(IN) :: source
31763 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31765 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_c'
31768#if defined(__parallel)
31769 INTEGER :: ierr, msglen_in, msglen_out, &
31773 CALL mp_timeset(routinen, handle)
31775#if defined(__parallel)
31780 IF (
PRESENT(tag))
THEN
31784 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31785 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31786 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31787 CALL add_perf(perf_id=7, count=1, &
31788 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31796 CALL mp_timestop(handle)
31797 END SUBROUTINE mp_sendrecv_c
31808 SUBROUTINE mp_sendrecv_cv(msgin, dest, msgout, source, comm, tag)
31809 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
31810 INTEGER,
INTENT(IN) :: dest
31811 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
31812 INTEGER,
INTENT(IN) :: source
31814 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31816 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cv'
31819#if defined(__parallel)
31820 INTEGER :: ierr, msglen_in, msglen_out, &
31824 CALL mp_timeset(routinen, handle)
31826#if defined(__parallel)
31827 msglen_in =
SIZE(msgin)
31828 msglen_out =
SIZE(msgout)
31831 IF (
PRESENT(tag))
THEN
31835 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31836 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31837 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31838 CALL add_perf(perf_id=7, count=1, &
31839 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31847 CALL mp_timestop(handle)
31848 END SUBROUTINE mp_sendrecv_cv
31860 SUBROUTINE mp_sendrecv_cm2(msgin, dest, msgout, source, comm, tag)
31861 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
31862 INTEGER,
INTENT(IN) :: dest
31863 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
31864 INTEGER,
INTENT(IN) :: source
31866 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31868 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm2'
31871#if defined(__parallel)
31872 INTEGER :: ierr, msglen_in, msglen_out, &
31876 CALL mp_timeset(routinen, handle)
31878#if defined(__parallel)
31879 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
31880 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
31883 IF (
PRESENT(tag))
THEN
31887 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31888 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31889 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31890 CALL add_perf(perf_id=7, count=1, &
31891 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31899 CALL mp_timestop(handle)
31900 END SUBROUTINE mp_sendrecv_cm2
31911 SUBROUTINE mp_sendrecv_cm3(msgin, dest, msgout, source, comm, tag)
31912 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
31913 INTEGER,
INTENT(IN) :: dest
31914 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
31915 INTEGER,
INTENT(IN) :: source
31917 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31919 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm3'
31922#if defined(__parallel)
31923 INTEGER :: ierr, msglen_in, msglen_out, &
31927 CALL mp_timeset(routinen, handle)
31929#if defined(__parallel)
31930 msglen_in =
SIZE(msgin)
31931 msglen_out =
SIZE(msgout)
31934 IF (
PRESENT(tag))
THEN
31938 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31939 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31940 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31941 CALL add_perf(perf_id=7, count=1, &
31942 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31950 CALL mp_timestop(handle)
31951 END SUBROUTINE mp_sendrecv_cm3
31962 SUBROUTINE mp_sendrecv_cm4(msgin, dest, msgout, source, comm, tag)
31963 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
31964 INTEGER,
INTENT(IN) :: dest
31965 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
31966 INTEGER,
INTENT(IN) :: source
31968 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31970 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm4'
31973#if defined(__parallel)
31974 INTEGER :: ierr, msglen_in, msglen_out, &
31978 CALL mp_timeset(routinen, handle)
31980#if defined(__parallel)
31981 msglen_in =
SIZE(msgin)
31982 msglen_out =
SIZE(msgout)
31985 IF (
PRESENT(tag))
THEN
31989 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31990 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31991 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31992 CALL add_perf(perf_id=7, count=1, &
31993 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
32001 CALL mp_timestop(handle)
32002 END SUBROUTINE mp_sendrecv_cm4
32019 SUBROUTINE mp_isendrecv_c (msgin, dest, msgout, source, comm, send_request, &
32021 COMPLEX(kind=real_4),
INTENT(IN) :: msgin
32022 INTEGER,
INTENT(IN) :: dest
32023 COMPLEX(kind=real_4),
INTENT(INOUT) :: msgout
32024 INTEGER,
INTENT(IN) :: source
32027 INTEGER,
INTENT(in),
OPTIONAL :: tag
32029 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_c'
32032#if defined(__parallel)
32033 INTEGER :: ierr, my_tag
32036 CALL mp_timeset(routinen, handle)
32038#if defined(__parallel)
32040 IF (
PRESENT(tag)) my_tag = tag
32042 CALL mpi_irecv(msgout, 1, mpi_complex, source, my_tag, &
32043 comm%handle, recv_request%handle, ierr)
32044 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32046 CALL mpi_isend(msgin, 1, mpi_complex, dest, my_tag, &
32047 comm%handle, send_request%handle, ierr)
32048 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32050 CALL add_perf(perf_id=8, count=1, msg_size=2*(2*real_4_size))
32060 CALL mp_timestop(handle)
32061 END SUBROUTINE mp_isendrecv_c
32080 SUBROUTINE mp_isendrecv_cv(msgin, dest, msgout, source, comm, send_request, &
32082 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
32083 INTEGER,
INTENT(IN) :: dest
32084 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
32085 INTEGER,
INTENT(IN) :: source
32088 INTEGER,
INTENT(in),
OPTIONAL :: tag
32090 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_cv'
32093#if defined(__parallel)
32094 INTEGER :: ierr, msglen, my_tag
32095 COMPLEX(kind=real_4) :: foo
32098 CALL mp_timeset(routinen, handle)
32100#if defined(__parallel)
32101#if !defined(__GNUC__) || __GNUC__ >= 9
32102 cpassert(is_contiguous(msgout))
32103 cpassert(is_contiguous(msgin))
32107 IF (
PRESENT(tag)) my_tag = tag
32109 msglen =
SIZE(msgout, 1)
32110 IF (msglen > 0)
THEN
32111 CALL mpi_irecv(msgout(1), msglen, mpi_complex, source, my_tag, &
32112 comm%handle, recv_request%handle, ierr)
32114 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32115 comm%handle, recv_request%handle, ierr)
32117 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32119 msglen =
SIZE(msgin, 1)
32120 IF (msglen > 0)
THEN
32121 CALL mpi_isend(msgin(1), msglen, mpi_complex, dest, my_tag, &
32122 comm%handle, send_request%handle, ierr)
32124 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32125 comm%handle, send_request%handle, ierr)
32127 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32129 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
32130 CALL add_perf(perf_id=8, count=1, msg_size=msglen*(2*real_4_size))
32140 CALL mp_timestop(handle)
32141 END SUBROUTINE mp_isendrecv_cv
32156 SUBROUTINE mp_isend_cv(msgin, dest, comm, request, tag)
32157 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
32158 INTEGER,
INTENT(IN) :: dest
32161 INTEGER,
INTENT(in),
OPTIONAL :: tag
32163 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cv'
32165 INTEGER :: handle, ierr
32166#if defined(__parallel)
32167 INTEGER :: msglen, my_tag
32168 COMPLEX(kind=real_4) :: foo(1)
32171 CALL mp_timeset(routinen, handle)
32173#if defined(__parallel)
32174#if !defined(__GNUC__) || __GNUC__ >= 9
32175 cpassert(is_contiguous(msgin))
32178 IF (
PRESENT(tag)) my_tag = tag
32180 msglen =
SIZE(msgin)
32181 IF (msglen > 0)
THEN
32182 CALL mpi_isend(msgin(1), msglen, mpi_complex, dest, my_tag, &
32183 comm%handle, request%handle, ierr)
32185 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32186 comm%handle, request%handle, ierr)
32188 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32190 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32199 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32201 CALL mp_timestop(handle)
32202 END SUBROUTINE mp_isend_cv
32219 SUBROUTINE mp_isend_cm2(msgin, dest, comm, request, tag)
32220 COMPLEX(kind=real_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
32221 INTEGER,
INTENT(IN) :: dest
32224 INTEGER,
INTENT(in),
OPTIONAL :: tag
32226 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm2'
32228 INTEGER :: handle, ierr
32229#if defined(__parallel)
32230 INTEGER :: msglen, my_tag
32231 COMPLEX(kind=real_4) :: foo(1)
32234 CALL mp_timeset(routinen, handle)
32236#if defined(__parallel)
32237#if !defined(__GNUC__) || __GNUC__ >= 9
32238 cpassert(is_contiguous(msgin))
32242 IF (
PRESENT(tag)) my_tag = tag
32244 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
32245 IF (msglen > 0)
THEN
32246 CALL mpi_isend(msgin(1, 1), msglen, mpi_complex, dest, my_tag, &
32247 comm%handle, request%handle, ierr)
32249 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32250 comm%handle, request%handle, ierr)
32252 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32254 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32263 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32265 CALL mp_timestop(handle)
32266 END SUBROUTINE mp_isend_cm2
32285 SUBROUTINE mp_isend_cm3(msgin, dest, comm, request, tag)
32286 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
32287 INTEGER,
INTENT(IN) :: dest
32290 INTEGER,
INTENT(in),
OPTIONAL :: tag
32292 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm3'
32294 INTEGER :: handle, ierr
32295#if defined(__parallel)
32296 INTEGER :: msglen, my_tag
32297 COMPLEX(kind=real_4) :: foo(1)
32300 CALL mp_timeset(routinen, handle)
32302#if defined(__parallel)
32303#if !defined(__GNUC__) || __GNUC__ >= 9
32304 cpassert(is_contiguous(msgin))
32308 IF (
PRESENT(tag)) my_tag = tag
32310 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
32311 IF (msglen > 0)
THEN
32312 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_complex, dest, my_tag, &
32313 comm%handle, request%handle, ierr)
32315 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32316 comm%handle, request%handle, ierr)
32318 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32320 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32329 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32331 CALL mp_timestop(handle)
32332 END SUBROUTINE mp_isend_cm3
32348 SUBROUTINE mp_isend_cm4(msgin, dest, comm, request, tag)
32349 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
32350 INTEGER,
INTENT(IN) :: dest
32353 INTEGER,
INTENT(in),
OPTIONAL :: tag
32355 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm4'
32357 INTEGER :: handle, ierr
32358#if defined(__parallel)
32359 INTEGER :: msglen, my_tag
32360 COMPLEX(kind=real_4) :: foo(1)
32363 CALL mp_timeset(routinen, handle)
32365#if defined(__parallel)
32366#if !defined(__GNUC__) || __GNUC__ >= 9
32367 cpassert(is_contiguous(msgin))
32371 IF (
PRESENT(tag)) my_tag = tag
32373 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
32374 IF (msglen > 0)
THEN
32375 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_complex, dest, my_tag, &
32376 comm%handle, request%handle, ierr)
32378 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32379 comm%handle, request%handle, ierr)
32381 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32383 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32392 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32394 CALL mp_timestop(handle)
32395 END SUBROUTINE mp_isend_cm4
32411 SUBROUTINE mp_irecv_cv(msgout, source, comm, request, tag)
32412 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
32413 INTEGER,
INTENT(IN) :: source
32416 INTEGER,
INTENT(in),
OPTIONAL :: tag
32418 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cv'
32421#if defined(__parallel)
32422 INTEGER :: ierr, msglen, my_tag
32423 COMPLEX(kind=real_4) :: foo(1)
32426 CALL mp_timeset(routinen, handle)
32428#if defined(__parallel)
32429#if !defined(__GNUC__) || __GNUC__ >= 9
32430 cpassert(is_contiguous(msgout))
32434 IF (
PRESENT(tag)) my_tag = tag
32436 msglen =
SIZE(msgout)
32437 IF (msglen > 0)
THEN
32438 CALL mpi_irecv(msgout(1), msglen, mpi_complex, source, my_tag, &
32439 comm%handle, request%handle, ierr)
32441 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32442 comm%handle, request%handle, ierr)
32444 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32446 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32448 cpabort(
"mp_irecv called in non parallel case")
32455 CALL mp_timestop(handle)
32456 END SUBROUTINE mp_irecv_cv
32473 SUBROUTINE mp_irecv_cm2(msgout, source, comm, request, tag)
32474 COMPLEX(kind=real_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
32475 INTEGER,
INTENT(IN) :: source
32478 INTEGER,
INTENT(in),
OPTIONAL :: tag
32480 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm2'
32483#if defined(__parallel)
32484 INTEGER :: ierr, msglen, my_tag
32485 COMPLEX(kind=real_4) :: foo(1)
32488 CALL mp_timeset(routinen, handle)
32490#if defined(__parallel)
32491#if !defined(__GNUC__) || __GNUC__ >= 9
32492 cpassert(is_contiguous(msgout))
32496 IF (
PRESENT(tag)) my_tag = tag
32498 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
32499 IF (msglen > 0)
THEN
32500 CALL mpi_irecv(msgout(1, 1), msglen, mpi_complex, source, my_tag, &
32501 comm%handle, request%handle, ierr)
32503 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32504 comm%handle, request%handle, ierr)
32506 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32508 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32515 cpabort(
"mp_irecv called in non parallel case")
32517 CALL mp_timestop(handle)
32518 END SUBROUTINE mp_irecv_cm2
32536 SUBROUTINE mp_irecv_cm3(msgout, source, comm, request, tag)
32537 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
32538 INTEGER,
INTENT(IN) :: source
32541 INTEGER,
INTENT(in),
OPTIONAL :: tag
32543 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm3'
32546#if defined(__parallel)
32547 INTEGER :: ierr, msglen, my_tag
32548 COMPLEX(kind=real_4) :: foo(1)
32551 CALL mp_timeset(routinen, handle)
32553#if defined(__parallel)
32554#if !defined(__GNUC__) || __GNUC__ >= 9
32555 cpassert(is_contiguous(msgout))
32559 IF (
PRESENT(tag)) my_tag = tag
32561 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
32562 IF (msglen > 0)
THEN
32563 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_complex, source, my_tag, &
32564 comm%handle, request%handle, ierr)
32566 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32567 comm%handle, request%handle, ierr)
32569 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
32571 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32578 cpabort(
"mp_irecv called in non parallel case")
32580 CALL mp_timestop(handle)
32581 END SUBROUTINE mp_irecv_cm3
32597 SUBROUTINE mp_irecv_cm4(msgout, source, comm, request, tag)
32598 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
32599 INTEGER,
INTENT(IN) :: source
32602 INTEGER,
INTENT(in),
OPTIONAL :: tag
32604 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm4'
32607#if defined(__parallel)
32608 INTEGER :: ierr, msglen, my_tag
32609 COMPLEX(kind=real_4) :: foo(1)
32612 CALL mp_timeset(routinen, handle)
32614#if defined(__parallel)
32615#if !defined(__GNUC__) || __GNUC__ >= 9
32616 cpassert(is_contiguous(msgout))
32620 IF (
PRESENT(tag)) my_tag = tag
32622 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
32623 IF (msglen > 0)
THEN
32624 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_complex, source, my_tag, &
32625 comm%handle, request%handle, ierr)
32627 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32628 comm%handle, request%handle, ierr)
32630 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
32632 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32639 cpabort(
"mp_irecv called in non parallel case")
32641 CALL mp_timestop(handle)
32642 END SUBROUTINE mp_irecv_cm4
32654 SUBROUTINE mp_win_create_cv(base, comm, win)
32655 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
32659 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_cv'
32662#if defined(__parallel)
32664 INTEGER(kind=mpi_address_kind) :: len
32665 COMPLEX(kind=real_4) :: foo(1)
32668 CALL mp_timeset(routinen, handle)
32670#if defined(__parallel)
32672 len =
SIZE(base)*(2*real_4_size)
32674 CALL mpi_win_create(base(1), len, (2*real_4_size), mpi_info_null, comm%handle, win%handle, ierr)
32676 CALL mpi_win_create(foo, len, (2*real_4_size), mpi_info_null, comm%handle, win%handle, ierr)
32678 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
32680 CALL add_perf(perf_id=20, count=1)
32684 win%handle = mp_win_null_handle
32686 CALL mp_timestop(handle)
32687 END SUBROUTINE mp_win_create_cv
32699 SUBROUTINE mp_rget_cv(base, source, win, win_data, myproc, disp, request, &
32700 origin_datatype, target_datatype)
32701 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
32702 INTEGER,
INTENT(IN) :: source
32704 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: win_data
32705 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
32709 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_cv'
32712#if defined(__parallel)
32713 INTEGER :: ierr, len, &
32714 origin_len, target_len
32715 LOGICAL :: do_local_copy
32716 INTEGER(kind=mpi_address_kind) :: disp_aint
32717 mpi_data_type :: handle_origin_datatype, handle_target_datatype
32720 CALL mp_timeset(routinen, handle)
32722#if defined(__parallel)
32725 IF (
PRESENT(disp))
THEN
32726 disp_aint = int(disp, kind=mpi_address_kind)
32728 handle_origin_datatype = mpi_complex
32730 IF (
PRESENT(origin_datatype))
THEN
32731 handle_origin_datatype = origin_datatype%type_handle
32734 handle_target_datatype = mpi_complex
32736 IF (
PRESENT(target_datatype))
THEN
32737 handle_target_datatype = target_datatype%type_handle
32741 do_local_copy = .false.
32742 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
32743 IF (myproc .EQ. source) do_local_copy = .true.
32745 IF (do_local_copy)
THEN
32747 base(:) = win_data(disp_aint + 1:disp_aint + len)
32752 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
32753 target_len, handle_target_datatype, win%handle, request%handle, ierr)
32759 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
32761 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*(2*real_4_size))
32766 mark_used(origin_datatype)
32767 mark_used(target_datatype)
32771 IF (
PRESENT(disp))
THEN
32772 base(:) = win_data(disp + 1:disp +
SIZE(base))
32774 base(:) = win_data(:
SIZE(base))
32778 CALL mp_timestop(handle)
32779 END SUBROUTINE mp_rget_cv
32789 result(type_descriptor)
32790 INTEGER,
INTENT(IN) :: count
32791 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
32794 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_c'
32797#if defined(__parallel)
32801 CALL mp_timeset(routinen, handle)
32803#if defined(__parallel)
32804 CALL mpi_type_indexed(count, lengths, displs, mpi_complex, &
32805 type_descriptor%type_handle, ierr)
32807 cpabort(
"MPI_Type_Indexed @ "//routinen)
32808 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
32810 cpabort(
"MPI_Type_commit @ "//routinen)
32812 type_descriptor%type_handle = 5
32814 type_descriptor%length = count
32815 NULLIFY (type_descriptor%subtype)
32816 type_descriptor%vector_descriptor(1:2) = 1
32817 type_descriptor%has_indexing = .true.
32818 type_descriptor%index_descriptor%index => lengths
32819 type_descriptor%index_descriptor%chunks => displs
32821 CALL mp_timestop(handle)
32832 SUBROUTINE mp_allocate_c (DATA, len, stat)
32833 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
32834 INTEGER,
INTENT(IN) :: len
32835 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
32837 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_c'
32839 INTEGER :: handle, ierr
32841 CALL mp_timeset(routinen, handle)
32843#if defined(__parallel)
32845 CALL mp_alloc_mem(
DATA, len, stat=ierr)
32846 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
32847 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
32848 CALL add_perf(perf_id=15, count=1)
32850 ALLOCATE (
DATA(len), stat=ierr)
32851 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
32852 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
32854 IF (
PRESENT(stat)) stat = ierr
32855 CALL mp_timestop(handle)
32856 END SUBROUTINE mp_allocate_c
32864 SUBROUTINE mp_deallocate_c (DATA, stat)
32865 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
32866 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
32868 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_c'
32871#if defined(__parallel)
32875 CALL mp_timeset(routinen, handle)
32877#if defined(__parallel)
32878 CALL mp_free_mem(
DATA, ierr)
32879 IF (
PRESENT(stat))
THEN
32882 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
32885 CALL add_perf(perf_id=15, count=1)
32888 IF (
PRESENT(stat)) stat = 0
32890 CALL mp_timestop(handle)
32891 END SUBROUTINE mp_deallocate_c
32904 SUBROUTINE mp_file_write_at_cv(fh, offset, msg, msglen)
32905 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
32907 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
32908 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32911#if defined(__parallel)
32915 msg_len =
SIZE(msg)
32916 IF (
PRESENT(msglen)) msg_len = msglen
32917#if defined(__parallel)
32918 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
32920 cpabort(
"mpi_file_write_at_cv @ mp_file_write_at_cv")
32922 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
32924 END SUBROUTINE mp_file_write_at_cv
32932 SUBROUTINE mp_file_write_at_c (fh, offset, msg)
32933 COMPLEX(kind=real_4),
INTENT(IN) :: msg
32935 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32937#if defined(__parallel)
32941 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
32943 cpabort(
"mpi_file_write_at_c @ mp_file_write_at_c")
32945 WRITE (unit=fh%handle, pos=offset + 1) msg
32947 END SUBROUTINE mp_file_write_at_c
32959 SUBROUTINE mp_file_write_at_all_cv(fh, offset, msg, msglen)
32960 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
32962 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
32963 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32966#if defined(__parallel)
32970 msg_len =
SIZE(msg)
32971 IF (
PRESENT(msglen)) msg_len = msglen
32972#if defined(__parallel)
32973 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
32975 cpabort(
"mpi_file_write_at_all_cv @ mp_file_write_at_all_cv")
32977 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
32979 END SUBROUTINE mp_file_write_at_all_cv
32987 SUBROUTINE mp_file_write_at_all_c (fh, offset, msg)
32988 COMPLEX(kind=real_4),
INTENT(IN) :: msg
32990 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32992#if defined(__parallel)
32996 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
32998 cpabort(
"mpi_file_write_at_all_c @ mp_file_write_at_all_c")
33000 WRITE (unit=fh%handle, pos=offset + 1) msg
33002 END SUBROUTINE mp_file_write_at_all_c
33015 SUBROUTINE mp_file_read_at_cv(fh, offset, msg, msglen)
33016 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
33018 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
33019 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33022#if defined(__parallel)
33026 msg_len =
SIZE(msg)
33027 IF (
PRESENT(msglen)) msg_len = msglen
33028#if defined(__parallel)
33029 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
33031 cpabort(
"mpi_file_read_at_cv @ mp_file_read_at_cv")
33033 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
33035 END SUBROUTINE mp_file_read_at_cv
33043 SUBROUTINE mp_file_read_at_c (fh, offset, msg)
33044 COMPLEX(kind=real_4),
INTENT(OUT) :: msg
33046 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33048#if defined(__parallel)
33052 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
33054 cpabort(
"mpi_file_read_at_c @ mp_file_read_at_c")
33056 READ (unit=fh%handle, pos=offset + 1) msg
33058 END SUBROUTINE mp_file_read_at_c
33070 SUBROUTINE mp_file_read_at_all_cv(fh, offset, msg, msglen)
33071 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
33073 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
33074 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33077#if defined(__parallel)
33081 msg_len =
SIZE(msg)
33082 IF (
PRESENT(msglen)) msg_len = msglen
33083#if defined(__parallel)
33084 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
33086 cpabort(
"mpi_file_read_at_all_cv @ mp_file_read_at_all_cv")
33088 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
33090 END SUBROUTINE mp_file_read_at_all_cv
33098 SUBROUTINE mp_file_read_at_all_c (fh, offset, msg)
33099 COMPLEX(kind=real_4),
INTENT(OUT) :: msg
33101 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33103#if defined(__parallel)
33107 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
33109 cpabort(
"mpi_file_read_at_all_c @ mp_file_read_at_all_c")
33111 READ (unit=fh%handle, pos=offset + 1) msg
33113 END SUBROUTINE mp_file_read_at_all_c
33122 FUNCTION mp_type_make_c (ptr, &
33123 vector_descriptor, index_descriptor) &
33124 result(type_descriptor)
33125 COMPLEX(kind=real_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
33126 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
33127 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
33130 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_c'
33132#if defined(__parallel)
33136 NULLIFY (type_descriptor%subtype)
33137 type_descriptor%length =
SIZE(ptr)
33138#if defined(__parallel)
33139 type_descriptor%type_handle = mpi_complex
33140 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
33142 cpabort(
"MPI_Get_address @ "//routinen)
33144 type_descriptor%type_handle = 5
33146 type_descriptor%vector_descriptor(1:2) = 1
33147 type_descriptor%has_indexing = .false.
33148 type_descriptor%data_c => ptr
33149 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
33150 cpabort(routinen//
": Vectors and indices NYI")
33152 END FUNCTION mp_type_make_c
33161 SUBROUTINE mp_alloc_mem_c (DATA, len, stat)
33162 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
33163 INTEGER,
INTENT(IN) :: len
33164 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
33166#if defined(__parallel)
33167 INTEGER :: size, ierr, length, &
33169 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
33170 TYPE(c_ptr) :: mp_baseptr
33171 mpi_info_type :: mp_info
33173 length = max(len, 1)
33174 CALL mpi_type_size(mpi_complex,
size, ierr)
33175 mp_size = int(length, kind=mpi_address_kind)*
size
33176 IF (mp_size .GT. mp_max_memory_size)
THEN
33177 cpabort(
"MPI cannot allocate more than 2 GiByte")
33179 mp_info = mpi_info_null
33180 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
33181 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
33182 IF (
PRESENT(stat)) stat = mp_res
33184 INTEGER :: length, mystat
33185 length = max(len, 1)
33186 IF (
PRESENT(stat))
THEN
33187 ALLOCATE (
DATA(length), stat=mystat)
33190 ALLOCATE (
DATA(length))
33193 END SUBROUTINE mp_alloc_mem_c
33201 SUBROUTINE mp_free_mem_c (DATA, stat)
33202 COMPLEX(kind=real_4),
DIMENSION(:), &
33203 POINTER, asynchronous :: data
33204 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
33206#if defined(__parallel)
33208 CALL mpi_free_mem(
DATA, mp_res)
33209 IF (
PRESENT(stat)) stat = mp_res
33212 IF (
PRESENT(stat)) stat = 0
33214 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