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)
62 #if defined(__MPI_F08)
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
178 PUBLIC :: mp_comm_type
179 PUBLIC :: mp_request_type
180 PUBLIC :: mp_win_type
181 PUBLIC :: mp_file_type
182 PUBLIC :: mp_info_type
183 PUBLIC :: mp_cart_type
185 PUBLIC :: mp_para_env_type, mp_para_env_p_type, mp_para_cart_type
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(.EQ.) => mp_comm_op_eq
204 generic,
PUBLIC ::
operator(.NE.) => 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(.EQ.) => mp_request_op_eq
632 generic,
PUBLIC ::
OPERATOR(.NE.) => 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(.EQ.) => mp_win_op_eq
648 generic,
PUBLIC ::
OPERATOR(.NE.) => 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(.EQ.) => mp_file_op_eq
678 generic,
PUBLIC ::
OPERATOR(.NE.) => 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(.EQ.) => mp_info_op_eq
737 generic,
PUBLIC ::
OPERATOR(.NE.) => mp_info_op_neq
740 TYPE,
EXTENDS(mp_comm_type) :: mp_cart_type
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
763 TYPE,
EXTENDS(mp_comm_type) :: mp_para_env_type
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
771 END TYPE mp_para_env_type
780 TYPE mp_para_env_p_type
781 TYPE(mp_para_env_type),
POINTER :: para_env => null()
782 END TYPE mp_para_env_p_type
800 TYPE,
EXTENDS(mp_cart_type) :: mp_para_cart_type
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
808 END TYPE mp_para_cart_type
811 TYPE(mp_comm_type),
PARAMETER,
PUBLIC ::
mp_comm_null = mp_comm_type(mp_comm_null_handle)
812 TYPE(mp_comm_type),
PARAMETER,
PUBLIC ::
mp_comm_self = mp_comm_type(mp_comm_self_handle)
813 TYPE(mp_comm_type),
PARAMETER,
PUBLIC ::
mp_comm_world = mp_comm_type(mp_comm_world_handle)
814 TYPE(mp_request_type),
PARAMETER,
PUBLIC ::
mp_request_null = mp_request_type(mp_request_null_handle)
815 TYPE(mp_win_type),
PARAMETER,
PUBLIC ::
mp_win_null = mp_win_type(mp_win_null_handle)
816 TYPE(mp_file_type),
PARAMETER,
PUBLIC ::
mp_file_null = mp_file_type(mp_file_null_handle)
817 TYPE(mp_info_type),
PARAMETER,
PUBLIC ::
mp_info_null = mp_info_type(mp_info_null_handle)
819 #if !defined(__parallel)
821 INTEGER,
PARAMETER,
PRIVATE :: mp_comm_default_handle = 1
822 TYPE(mp_comm_type),
PARAMETER,
PRIVATE :: mp_comm_default = mp_comm_type(mp_comm_default_handle)
838 PUBLIC :: cp2k_is_parallel
843 PUBLIC :: mp_testall, mp_testany
846 PUBLIC :: mp_allocate, mp_deallocate
853 PUBLIC :: mp_type_descriptor_type
854 PUBLIC :: mp_type_make
862 PUBLIC :: mp_file_descriptor_type
872 MODULE PROCEDURE mp_waitall_1, mp_waitall_2
876 MODULE PROCEDURE mp_testall_tv
880 MODULE PROCEDURE mp_testany_1, mp_testany_2
883 INTERFACE mp_type_free
884 MODULE PROCEDURE mp_type_free_m, mp_type_free_v
891 INTERFACE mp_allocate
892 MODULE PROCEDURE mp_allocate_i, &
900 INTERFACE mp_deallocate
901 MODULE PROCEDURE mp_deallocate_i, &
909 INTERFACE mp_type_make
910 MODULE PROCEDURE mp_type_make_struct
911 MODULE PROCEDURE mp_type_make_i, mp_type_make_l, &
912 mp_type_make_r, mp_type_make_d, &
913 mp_type_make_c, mp_type_make_z
916 INTERFACE mp_alloc_mem
917 MODULE PROCEDURE mp_alloc_mem_i, mp_alloc_mem_l, &
918 mp_alloc_mem_d, mp_alloc_mem_z, &
919 mp_alloc_mem_r, mp_alloc_mem_c
922 INTERFACE mp_free_mem
923 MODULE PROCEDURE mp_free_mem_i, mp_free_mem_l, &
924 mp_free_mem_d, mp_free_mem_z, &
925 mp_free_mem_r, mp_free_mem_c
929 TYPE mp_indexing_meta_type
930 INTEGER,
DIMENSION(:),
POINTER :: index => null(), chunks => null()
931 END TYPE mp_indexing_meta_type
933 TYPE mp_type_descriptor_type
934 mpi_data_type :: type_handle = mp_datatype_null_handle
935 INTEGER :: length = -1
936 #if defined(__parallel)
937 INTEGER(kind=mpi_address_kind) :: base = -1
939 INTEGER(kind=int_4),
DIMENSION(:),
POINTER :: data_i => null()
940 INTEGER(kind=int_8),
DIMENSION(:),
POINTER :: data_l => null()
941 REAL(kind=
real_4),
DIMENSION(:),
POINTER :: data_r => null()
942 REAL(kind=
real_8),
DIMENSION(:),
POINTER :: data_d => null()
943 COMPLEX(kind=real_4),
DIMENSION(:),
POINTER :: data_c => null()
944 COMPLEX(kind=real_8),
DIMENSION(:),
POINTER :: data_z => null()
945 TYPE(mp_type_descriptor_type),
DIMENSION(:),
POINTER :: subtype => null()
946 INTEGER :: vector_descriptor(2) = -1
947 LOGICAL :: has_indexing = .false.
948 TYPE(mp_indexing_meta_type) :: index_descriptor = mp_indexing_meta_type()
949 END TYPE mp_type_descriptor_type
951 TYPE mp_file_indexing_meta_type
952 INTEGER,
DIMENSION(:),
POINTER :: index => null()
953 INTEGER(kind=file_offset), &
954 DIMENSION(:),
POINTER :: chunks => null()
955 END TYPE mp_file_indexing_meta_type
957 TYPE mp_file_descriptor_type
958 mpi_data_type :: type_handle = mp_datatype_null_handle
959 INTEGER :: length = -1
960 LOGICAL :: has_indexing = .false.
961 TYPE(mp_file_indexing_meta_type) :: index_descriptor = mp_file_indexing_meta_type()
965 INTEGER,
PARAMETER :: intlen = bit_size(0)/8
966 INTEGER,
PARAMETER :: reallen = 8
967 INTEGER,
PARAMETER :: loglen = bit_size(0)/8
968 INTEGER,
PARAMETER :: charlen = 1
974 LOGICAL FUNCTION mp_comm_op_eq(comm1, comm2)
975 CLASS(mp_comm_type),
INTENT(IN) :: comm1, comm2
976 #if defined(__parallel) && defined(__MPI_F08)
977 mp_comm_op_eq = (comm1%handle%mpi_val .EQ. comm2%handle%mpi_val)
979 mp_comm_op_eq = (comm1%handle .EQ. comm2%handle)
981 END FUNCTION mp_comm_op_eq
983 LOGICAL FUNCTION mp_comm_op_neq(comm1, comm2)
984 CLASS(mp_comm_type),
INTENT(IN) :: comm1, comm2
985 #if defined(__parallel) && defined(__MPI_F08)
986 mp_comm_op_neq = (comm1%handle%mpi_val .NE. comm2%handle%mpi_val)
988 mp_comm_op_neq = (comm1%handle .NE. comm2%handle)
990 END FUNCTION mp_comm_op_neq
992 ELEMENTAL IMPURE SUBROUTINE mp_comm_type_set_handle(this, handle , ndims)
993 CLASS(mp_comm_type),
INTENT(INOUT) :: this
994 INTEGER,
INTENT(IN) :: handle
995 INTEGER,
INTENT(IN),
OPTIONAL :: ndims
997 #if defined(__parallel) && defined(__MPI_F08)
998 this%handle%mpi_val = handle
1000 this%handle = handle
1004 CLASS IS (mp_cart_type)
1005 IF (.NOT.
PRESENT(ndims)) &
1006 CALL cp_abort(__location__, &
1007 "Setup of a cartesian communicator requires information on the number of dimensions!")
1009 IF (
PRESENT(ndims)) this%ndims = ndims
1012 END SUBROUTINE mp_comm_type_set_handle
1014 ELEMENTAL FUNCTION mp_comm_type_get_handle(this)
RESULT(handle)
1015 CLASS(mp_comm_type),
INTENT(IN) :: this
1018 #if defined(__parallel) && defined(__MPI_F08)
1019 handle = this%handle%mpi_val
1021 handle = this%handle
1023 END FUNCTION mp_comm_type_get_handle
1024 LOGICAL FUNCTION mp_request_op_eq(request1, request2)
1025 CLASS(mp_request_type),
INTENT(IN) :: request1, request2
1026 #if defined(__parallel) && defined(__MPI_F08)
1027 mp_request_op_eq = (request1%handle%mpi_val .EQ. request2%handle%mpi_val)
1029 mp_request_op_eq = (request1%handle .EQ. request2%handle)
1031 END FUNCTION mp_request_op_eq
1033 LOGICAL FUNCTION mp_request_op_neq(request1, request2)
1034 CLASS(mp_request_type),
INTENT(IN) :: request1, request2
1035 #if defined(__parallel) && defined(__MPI_F08)
1036 mp_request_op_neq = (request1%handle%mpi_val .NE. request2%handle%mpi_val)
1038 mp_request_op_neq = (request1%handle .NE. request2%handle)
1040 END FUNCTION mp_request_op_neq
1042 ELEMENTAL SUBROUTINE mp_request_type_set_handle(this, handle )
1043 CLASS(mp_request_type),
INTENT(INOUT) :: this
1044 INTEGER,
INTENT(IN) :: handle
1046 #if defined(__parallel) && defined(__MPI_F08)
1047 this%handle%mpi_val = handle
1049 this%handle = handle
1053 END SUBROUTINE mp_request_type_set_handle
1055 ELEMENTAL FUNCTION mp_request_type_get_handle(this)
RESULT(handle)
1056 CLASS(mp_request_type),
INTENT(IN) :: this
1059 #if defined(__parallel) && defined(__MPI_F08)
1060 handle = this%handle%mpi_val
1062 handle = this%handle
1064 END FUNCTION mp_request_type_get_handle
1065 LOGICAL FUNCTION mp_win_op_eq(win1, win2)
1066 CLASS(mp_win_type),
INTENT(IN) :: win1, win2
1067 #if defined(__parallel) && defined(__MPI_F08)
1068 mp_win_op_eq = (win1%handle%mpi_val .EQ. win2%handle%mpi_val)
1070 mp_win_op_eq = (win1%handle .EQ. win2%handle)
1072 END FUNCTION mp_win_op_eq
1074 LOGICAL FUNCTION mp_win_op_neq(win1, win2)
1075 CLASS(mp_win_type),
INTENT(IN) :: win1, win2
1076 #if defined(__parallel) && defined(__MPI_F08)
1077 mp_win_op_neq = (win1%handle%mpi_val .NE. win2%handle%mpi_val)
1079 mp_win_op_neq = (win1%handle .NE. win2%handle)
1081 END FUNCTION mp_win_op_neq
1083 ELEMENTAL SUBROUTINE mp_win_type_set_handle(this, handle )
1084 CLASS(mp_win_type),
INTENT(INOUT) :: this
1085 INTEGER,
INTENT(IN) :: handle
1087 #if defined(__parallel) && defined(__MPI_F08)
1088 this%handle%mpi_val = handle
1090 this%handle = handle
1094 END SUBROUTINE mp_win_type_set_handle
1096 ELEMENTAL FUNCTION mp_win_type_get_handle(this)
RESULT(handle)
1097 CLASS(mp_win_type),
INTENT(IN) :: this
1100 #if defined(__parallel) && defined(__MPI_F08)
1101 handle = this%handle%mpi_val
1103 handle = this%handle
1105 END FUNCTION mp_win_type_get_handle
1106 LOGICAL FUNCTION mp_file_op_eq(file1, file2)
1107 CLASS(mp_file_type),
INTENT(IN) :: file1, file2
1108 #if defined(__parallel) && defined(__MPI_F08)
1109 mp_file_op_eq = (file1%handle%mpi_val .EQ. file2%handle%mpi_val)
1111 mp_file_op_eq = (file1%handle .EQ. file2%handle)
1113 END FUNCTION mp_file_op_eq
1115 LOGICAL FUNCTION mp_file_op_neq(file1, file2)
1116 CLASS(mp_file_type),
INTENT(IN) :: file1, file2
1117 #if defined(__parallel) && defined(__MPI_F08)
1118 mp_file_op_neq = (file1%handle%mpi_val .NE. file2%handle%mpi_val)
1120 mp_file_op_neq = (file1%handle .NE. file2%handle)
1122 END FUNCTION mp_file_op_neq
1124 ELEMENTAL SUBROUTINE mp_file_type_set_handle(this, handle )
1125 CLASS(mp_file_type),
INTENT(INOUT) :: this
1126 INTEGER,
INTENT(IN) :: handle
1128 #if defined(__parallel) && defined(__MPI_F08)
1129 this%handle%mpi_val = handle
1131 this%handle = handle
1135 END SUBROUTINE mp_file_type_set_handle
1137 ELEMENTAL FUNCTION mp_file_type_get_handle(this)
RESULT(handle)
1138 CLASS(mp_file_type),
INTENT(IN) :: this
1141 #if defined(__parallel) && defined(__MPI_F08)
1142 handle = this%handle%mpi_val
1144 handle = this%handle
1146 END FUNCTION mp_file_type_get_handle
1147 LOGICAL FUNCTION mp_info_op_eq(info1, info2)
1148 CLASS(mp_info_type),
INTENT(IN) :: info1, info2
1149 #if defined(__parallel) && defined(__MPI_F08)
1150 mp_info_op_eq = (info1%handle%mpi_val .EQ. info2%handle%mpi_val)
1152 mp_info_op_eq = (info1%handle .EQ. info2%handle)
1154 END FUNCTION mp_info_op_eq
1156 LOGICAL FUNCTION mp_info_op_neq(info1, info2)
1157 CLASS(mp_info_type),
INTENT(IN) :: info1, info2
1158 #if defined(__parallel) && defined(__MPI_F08)
1159 mp_info_op_neq = (info1%handle%mpi_val .NE. info2%handle%mpi_val)
1161 mp_info_op_neq = (info1%handle .NE. info2%handle)
1163 END FUNCTION mp_info_op_neq
1165 ELEMENTAL SUBROUTINE mp_info_type_set_handle(this, handle )
1166 CLASS(mp_info_type),
INTENT(INOUT) :: this
1167 INTEGER,
INTENT(IN) :: handle
1169 #if defined(__parallel) && defined(__MPI_F08)
1170 this%handle%mpi_val = handle
1172 this%handle = handle
1176 END SUBROUTINE mp_info_type_set_handle
1178 ELEMENTAL FUNCTION mp_info_type_get_handle(this)
RESULT(handle)
1179 CLASS(mp_info_type),
INTENT(IN) :: this
1182 #if defined(__parallel) && defined(__MPI_F08)
1183 handle = this%handle%mpi_val
1185 handle = this%handle
1187 END FUNCTION mp_info_type_get_handle
1189 FUNCTION mp_comm_get_tag_ub(comm)
RESULT(tag_ub)
1190 CLASS(mp_comm_type),
INTENT(IN) :: comm
1193 #if defined(__parallel)
1196 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1198 CALL mpi_comm_get_attr(comm%handle, mpi_tag_ub, attrval, flag, ierr)
1199 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_tag_ub")
1200 IF (.NOT. flag) cpabort(
"Upper bound of tags not available!")
1201 tag_ub = int(attrval, kind=kind(tag_ub))
1206 END FUNCTION mp_comm_get_tag_ub
1208 FUNCTION mp_comm_get_host_rank(comm)
RESULT(host_rank)
1209 CLASS(mp_comm_type),
INTENT(IN) :: comm
1210 INTEGER :: host_rank
1212 #if defined(__parallel)
1215 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1217 CALL mpi_comm_get_attr(comm%handle, mpi_host, attrval, flag, ierr)
1218 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_host_rank")
1219 IF (.NOT. flag) cpabort(
"Host process rank not available!")
1220 host_rank = int(attrval, kind=kind(host_rank))
1225 END FUNCTION mp_comm_get_host_rank
1227 FUNCTION mp_comm_get_io_rank(comm)
RESULT(io_rank)
1228 CLASS(mp_comm_type),
INTENT(IN) :: comm
1231 #if defined(__parallel)
1234 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1236 CALL mpi_comm_get_attr(comm%handle, mpi_io, attrval, flag, ierr)
1237 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_io_rank")
1238 IF (.NOT. flag) cpabort(
"IO rank not available!")
1239 io_rank = int(attrval, kind=kind(io_rank))
1244 END FUNCTION mp_comm_get_io_rank
1246 FUNCTION mp_comm_get_wtime_is_global(comm)
RESULT(wtime_is_global)
1247 CLASS(mp_comm_type),
INTENT(IN) :: comm
1248 LOGICAL :: wtime_is_global
1250 #if defined(__parallel)
1253 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1255 CALL mpi_comm_get_attr(comm%handle, mpi_tag_ub, attrval, flag, ierr)
1256 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_wtime_is_global")
1257 IF (.NOT. flag) cpabort(
"Synchronization state of WTIME not available!")
1258 wtime_is_global = (attrval == 1_mpi_address_kind)
1261 wtime_is_global = .true.
1263 END FUNCTION mp_comm_get_wtime_is_global
1274 CLASS(mp_comm_type),
INTENT(OUT) :: mp_comm
1275 #if defined(__parallel)
1280 #if defined(__NO_MPI_THREAD_SUPPORT_CHECK)
1298 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_init @ mp_world_init")
1320 CALL mpi_comm_set_errhandler(mpi_comm_world, mpi_errors_return, ierr)
1321 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_set_errhandler @ mp_world_init")
1323 debug_comm_count = 1
1340 SUBROUTINE mp_reordering(mp_comm, mp_new_comm, ranks_order)
1341 CLASS(mp_comm_type),
INTENT(IN) :: mp_comm
1342 CLASS(mp_comm_type),
INTENT(out) :: mp_new_comm
1343 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: ranks_order
1345 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_reordering'
1347 INTEGER :: handle, ierr
1348 #if defined(__parallel)
1349 mpi_group_type :: newgroup, oldgroup
1352 CALL mp_timeset(routinen, handle)
1354 #if defined(__parallel)
1356 CALL mpi_comm_group(mp_comm%handle, oldgroup, ierr)
1357 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_reordering")
1358 CALL mpi_group_incl(oldgroup,
SIZE(ranks_order), ranks_order, newgroup, ierr)
1359 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_incl @ mp_reordering")
1361 CALL mpi_comm_create(mp_comm%handle, newgroup, mp_new_comm%handle, ierr)
1362 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_create @ mp_reordering")
1364 CALL mpi_group_free(oldgroup, ierr)
1365 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_free @ mp_reordering")
1366 CALL mpi_group_free(newgroup, ierr)
1367 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_free @ mp_reordering")
1372 mark_used(ranks_order)
1373 mp_new_comm%handle = mp_comm_default_handle
1375 debug_comm_count = debug_comm_count + 1
1376 CALL mp_new_comm%init()
1377 CALL mp_timestop(handle)
1378 END SUBROUTINE mp_reordering
1387 CHARACTER(LEN=default_string_length) :: debug_comm_count_char
1388 #if defined(__parallel)
1390 CALL mpi_barrier(mpi_comm_world, ierr)
1394 debug_comm_count = debug_comm_count - 1
1395 #if defined(__parallel)
1396 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_barrier @ mp_world_finalize")
1398 IF (debug_comm_count .NE. 0)
THEN
1401 WRITE (unit=debug_comm_count_char, fmt=
'(I0)')
1402 CALL cp_abort(__location__,
"mp_world_finalize: assert failed:"// &
1403 " leaking communicators "//trim(debug_comm_count_char))
1405 #if defined(__parallel)
1406 CALL mpi_finalize(ierr)
1407 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_finalize @ mp_world_finalize")
1423 #if !defined(__NO_ABORT)
1424 #if defined(__parallel)
1425 CALL mpi_abort(mpi_comm_world, 1, ierr)
1441 SUBROUTINE mp_stop(ierr, prg_code)
1442 INTEGER,
INTENT(IN) :: ierr
1443 CHARACTER(LEN=*),
INTENT(IN) :: prg_code
1445 #if defined(__parallel)
1446 INTEGER :: istat, len
1447 CHARACTER(LEN=MPI_MAX_ERROR_STRING) :: error_string
1448 CHARACTER(LEN=MPI_MAX_ERROR_STRING + 512) :: full_error
1450 CHARACTER(LEN=512) :: full_error
1453 #if defined(__parallel)
1454 CALL mpi_error_string(ierr, error_string, len, istat)
1455 WRITE (full_error,
'(A,I0,A)')
' MPI error ', ierr,
' in '//trim(prg_code)//
' : '//error_string(1:len)
1457 WRITE (full_error,
'(A,I0,A)')
' MPI error (!?) ', ierr,
' in '//trim(prg_code)
1462 END SUBROUTINE mp_stop
1468 SUBROUTINE mp_sync(comm)
1469 CLASS(mp_comm_type),
INTENT(IN) :: comm
1471 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sync'
1473 INTEGER :: handle, ierr
1476 CALL mp_timeset(routinen, handle)
1478 #if defined(__parallel)
1479 CALL mpi_barrier(comm%handle, ierr)
1480 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_barrier @ mp_sync")
1485 CALL mp_timestop(handle)
1487 END SUBROUTINE mp_sync
1494 SUBROUTINE mp_isync(comm, request)
1495 CLASS(mp_comm_type),
INTENT(IN) :: comm
1496 TYPE(mp_request_type),
INTENT(OUT) :: request
1498 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isync'
1500 INTEGER :: handle, ierr
1503 CALL mp_timeset(routinen, handle)
1505 #if defined(__parallel)
1506 CALL mpi_ibarrier(comm%handle, request%handle, ierr)
1507 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibarrier @ mp_isync")
1513 CALL mp_timestop(handle)
1515 END SUBROUTINE mp_isync
1522 SUBROUTINE mp_comm_rank(taskid, comm)
1524 INTEGER,
INTENT(OUT) :: taskid
1525 CLASS(mp_comm_type),
INTENT(IN) :: comm
1527 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_rank'
1530 #if defined(__parallel)
1534 CALL mp_timeset(routinen, handle)
1536 #if defined(__parallel)
1537 CALL mpi_comm_rank(comm%handle, taskid, ierr)
1538 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ mp_comm_rank")
1543 CALL mp_timestop(handle)
1545 END SUBROUTINE mp_comm_rank
1552 SUBROUTINE mp_comm_size(numtask, comm)
1554 INTEGER,
INTENT(OUT) :: numtask
1555 CLASS(mp_comm_type),
INTENT(IN) :: comm
1557 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_size'
1560 #if defined(__parallel)
1564 CALL mp_timeset(routinen, handle)
1566 #if defined(__parallel)
1567 CALL mpi_comm_size(comm%handle, numtask, ierr)
1568 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ mp_comm_size")
1573 CALL mp_timestop(handle)
1575 END SUBROUTINE mp_comm_size
1585 SUBROUTINE mp_cart_get(comm, dims, task_coor, periods)
1587 CLASS(mp_cart_type),
INTENT(IN) :: comm
1588 INTEGER,
INTENT(OUT),
OPTIONAL :: dims(comm%ndims), task_coor(comm%ndims)
1589 LOGICAL,
INTENT(out),
OPTIONAL :: periods(comm%ndims)
1591 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_get'
1594 #if defined(__parallel)
1596 INTEGER :: my_dims(comm%ndims), my_task_coor(comm%ndims)
1597 LOGICAL :: my_periods(comm%ndims)
1600 CALL mp_timeset(routinen, handle)
1602 #if defined(__parallel)
1603 CALL mpi_cart_get(comm%handle, comm%ndims, my_dims, my_periods, my_task_coor, ierr)
1604 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_get @ mp_cart_get")
1605 IF (
PRESENT(dims)) dims = my_dims
1606 IF (
PRESENT(task_coor)) task_coor = my_task_coor
1607 IF (
PRESENT(periods)) periods = my_periods
1610 IF (
PRESENT(task_coor)) task_coor = 0
1611 IF (
PRESENT(dims)) dims = 1
1612 IF (
PRESENT(periods)) periods = .false.
1614 CALL mp_timestop(handle)
1616 END SUBROUTINE mp_cart_get
1618 INTEGER ELEMENTAL function mp_comm_get_ndims(comm)
1619 CLASS(mp_comm_type),
INTENT(IN) :: comm
1621 mp_comm_get_ndims = comm%ndims
1633 SUBROUTINE mp_cart_create(comm_old, ndims, dims, comm_cart)
1635 CLASS(mp_comm_type),
INTENT(IN) :: comm_old
1636 INTEGER,
INTENT(IN) :: ndims
1637 INTEGER,
INTENT(INOUT) :: dims(ndims)
1638 CLASS(mp_cart_type),
INTENT(OUT) :: comm_cart
1640 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_create'
1642 INTEGER :: handle, ierr
1643 #if defined(__parallel)
1644 LOGICAL,
DIMENSION(1:ndims) :: period
1649 CALL mp_timeset(routinen, handle)
1651 comm_cart%handle = comm_old%handle
1652 #if defined(__parallel)
1654 IF (any(dims == 0))
CALL mpi_dims_create(comm_old%num_pe, ndims, dims, ierr)
1655 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_dims_create @ mp_cart_create")
1662 CALL mpi_cart_create(comm_old%handle, ndims, dims, period, reorder, comm_cart%handle, &
1664 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_create @ mp_cart_create")
1665 CALL add_perf(perf_id=1, count=1)
1668 comm_cart%handle = mp_comm_default_handle
1670 comm_cart%ndims = ndims
1671 debug_comm_count = debug_comm_count + 1
1672 CALL comm_cart%init()
1673 CALL mp_timestop(handle)
1675 END SUBROUTINE mp_cart_create
1683 SUBROUTINE mp_cart_coords(comm, rank, coords)
1685 CLASS(mp_cart_type),
INTENT(IN) :: comm
1686 INTEGER,
INTENT(IN) :: rank
1687 INTEGER,
DIMENSION(:),
INTENT(OUT) :: coords
1689 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_coords'
1691 INTEGER :: handle, ierr, m
1694 CALL mp_timeset(routinen, handle)
1697 #if defined(__parallel)
1698 CALL mpi_cart_coords(comm%handle, rank, m, coords, ierr)
1699 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_coords @ mp_cart_coords")
1705 CALL mp_timestop(handle)
1707 END SUBROUTINE mp_cart_coords
1715 FUNCTION mp_comm_compare(comm1, comm2)
RESULT(res)
1717 CLASS(mp_comm_type),
INTENT(IN) :: comm1, comm2
1720 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_compare'
1723 #if defined(__parallel)
1724 INTEGER :: ierr, iout
1727 CALL mp_timeset(routinen, handle)
1730 #if defined(__parallel)
1731 CALL mpi_comm_compare(comm1%handle, comm2%handle, iout, ierr)
1732 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_compare @ mp_comm_compare")
1736 CASE (mpi_congruent)
1743 cpabort(
"Unknown comparison state of the communicators!")
1749 CALL mp_timestop(handle)
1751 END FUNCTION mp_comm_compare
1759 SUBROUTINE mp_cart_sub(comm, rdim, sub_comm)
1761 CLASS(mp_cart_type),
INTENT(IN) :: comm
1762 LOGICAL,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: rdim
1763 CLASS(mp_cart_type),
INTENT(OUT) :: sub_comm
1765 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_sub'
1768 #if defined(__parallel)
1772 CALL mp_timeset(routinen, handle)
1774 #if defined(__parallel)
1775 CALL mpi_cart_sub(comm%handle, rdim, sub_comm%handle, ierr)
1776 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_sub @ mp_cart_sub")
1780 sub_comm%handle = mp_comm_default_handle
1782 sub_comm%ndims = count(rdim)
1783 debug_comm_count = debug_comm_count + 1
1784 CALL sub_comm%init()
1785 CALL mp_timestop(handle)
1787 END SUBROUTINE mp_cart_sub
1793 SUBROUTINE mp_comm_free(comm)
1795 CLASS(mp_comm_type),
INTENT(INOUT) :: comm
1797 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_free'
1800 LOGICAL :: free_comm
1801 #if defined(__parallel)
1807 CLASS IS (mp_para_env_type)
1809 IF (comm%ref_count <= 0) &
1810 cpabort(
"para_env%ref_count <= 0")
1811 comm%ref_count = comm%ref_count - 1
1812 IF (comm%ref_count <= 0)
THEN
1813 free_comm = comm%owns_group
1815 CLASS IS (mp_para_cart_type)
1817 IF (comm%ref_count <= 0) &
1818 cpabort(
"para_cart%ref_count <= 0")
1819 comm%ref_count = comm%ref_count - 1
1820 IF (comm%ref_count <= 0)
THEN
1821 free_comm = comm%owns_group
1825 CALL mp_timeset(routinen, handle)
1828 #if defined(__parallel)
1829 CALL mpi_comm_free(comm%handle, ierr)
1830 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_free @ mp_comm_free")
1832 comm%handle = mp_comm_null_handle
1834 debug_comm_count = debug_comm_count - 1
1838 CLASS IS (mp_cart_type)
1839 DEALLOCATE (comm%periodic, comm%mepos_cart, comm%num_pe_cart)
1842 CALL mp_timestop(handle)
1844 END SUBROUTINE mp_comm_free
1851 ELEMENTAL LOGICAL FUNCTION mp_para_env_is_valid(para_env)
1852 CLASS(mp_para_env_type),
INTENT(IN) :: para_env
1854 mp_para_env_is_valid = para_env%ref_count > 0
1856 END FUNCTION mp_para_env_is_valid
1862 ELEMENTAL SUBROUTINE mp_para_env_retain(para_env)
1863 CLASS(mp_para_env_type),
INTENT(INOUT) :: para_env
1865 para_env%ref_count = para_env%ref_count + 1
1867 END SUBROUTINE mp_para_env_retain
1874 ELEMENTAL LOGICAL FUNCTION mp_para_cart_is_valid(cart)
1875 CLASS(mp_para_cart_type),
INTENT(IN) :: cart
1877 mp_para_cart_is_valid = cart%ref_count > 0
1879 END FUNCTION mp_para_cart_is_valid
1885 ELEMENTAL SUBROUTINE mp_para_cart_retain(cart)
1886 CLASS(mp_para_cart_type),
INTENT(INOUT) :: cart
1888 cart%ref_count = cart%ref_count + 1
1890 END SUBROUTINE mp_para_cart_retain
1897 SUBROUTINE mp_comm_dup(comm1, comm2)
1899 CLASS(mp_comm_type),
INTENT(IN) :: comm1
1900 CLASS(mp_comm_type),
INTENT(OUT) :: comm2
1902 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_dup'
1905 #if defined(__parallel)
1909 CALL mp_timeset(routinen, handle)
1911 #if defined(__parallel)
1912 CALL mpi_comm_dup(comm1%handle, comm2%handle, ierr)
1913 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_dup @ mp_comm_dup")
1916 comm2%handle = mp_comm_default_handle
1918 comm2%ndims = comm1%ndims
1919 debug_comm_count = debug_comm_count + 1
1921 CALL mp_timestop(handle)
1923 END SUBROUTINE mp_comm_dup
1930 ELEMENTAL IMPURE SUBROUTINE mp_comm_assign(comm_new, comm_old)
1931 CLASS(mp_comm_type),
INTENT(IN) :: comm_old
1932 CLASS(mp_comm_type),
INTENT(OUT) :: comm_new
1934 comm_new%handle = comm_old%handle
1935 comm_new%ndims = comm_old%ndims
1936 CALL comm_new%init(.false.)
1944 ELEMENTAL LOGICAL FUNCTION mp_comm_is_source(comm)
1945 CLASS(mp_comm_type),
INTENT(IN) :: comm
1947 mp_comm_is_source = comm%source == comm%mepos
1949 END FUNCTION mp_comm_is_source
1955 ELEMENTAL IMPURE SUBROUTINE mp_comm_init(comm, owns_group)
1956 CLASS(mp_comm_type),
INTENT(INOUT) :: comm
1957 LOGICAL,
INTENT(IN),
OPTIONAL :: owns_group
1959 IF (comm%handle mpi_get_comp .NE. mp_comm_null_handle mpi_get_comp)
THEN
1961 CALL comm%get_size(comm%num_pe)
1962 CALL comm%get_rank(comm%mepos)
1966 CLASS IS (mp_cart_type)
1967 IF (
ALLOCATED(comm%periodic))
DEALLOCATE (comm%periodic)
1968 IF (
ALLOCATED(comm%mepos_cart))
DEALLOCATE (comm%mepos_cart)
1969 IF (
ALLOCATED(comm%num_pe_cart))
DEALLOCATE (comm%num_pe_cart)
1971 associate(ndims => comm%ndims)
1973 ALLOCATE (comm%periodic(ndims), comm%mepos_cart(ndims), &
1974 comm%num_pe_cart(ndims))
1978 comm%periodic = .false.
1979 IF (comm%handle mpi_get_comp .NE. mp_comm_null_handle mpi_get_comp)
THEN
1980 CALL comm%get_info_cart(comm%num_pe_cart, comm%mepos_cart, &
1986 CLASS IS (mp_para_env_type)
1987 IF (
PRESENT(owns_group)) comm%owns_group = owns_group
1989 CLASS IS (mp_para_cart_type)
1990 IF (
PRESENT(owns_group)) comm%owns_group = owns_group
2005 TYPE(mp_para_env_type),
POINTER :: para_env
2006 CLASS(mp_comm_type),
INTENT(in) :: group
2008 IF (
ASSOCIATED(para_env)) &
2009 cpabort(
"The passed para_env must not be associated!")
2011 para_env%mp_comm_type = group
2012 CALL para_env%init()
2027 TYPE(mp_para_env_type),
POINTER :: para_env
2029 IF (
ASSOCIATED(para_env))
THEN
2030 CALL para_env%free()
2031 IF (.NOT. para_env%is_valid())
DEALLOCATE (para_env)
2043 TYPE(mp_para_cart_type),
POINTER,
INTENT(OUT) :: cart
2044 CLASS(mp_comm_type),
INTENT(in) :: group
2046 IF (
ASSOCIATED(cart)) &
2047 cpabort(
"The passed para_cart must not be associated!")
2049 cart%mp_cart_type = group
2060 TYPE(mp_para_cart_type),
POINTER :: cart
2062 IF (
ASSOCIATED(cart))
THEN
2064 IF (.NOT. cart%is_valid())
DEALLOCATE (cart)
2075 SUBROUTINE mp_rank_compare(comm1, comm2, rank)
2077 CLASS(mp_comm_type),
INTENT(IN) :: comm1, comm2
2078 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rank
2080 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rank_compare'
2083 #if defined(__parallel)
2084 INTEGER :: i, ierr, n, n1, n2
2085 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: rin
2086 mpi_group_type :: g1, g2
2089 CALL mp_timeset(routinen, handle)
2092 #if defined(__parallel)
2093 CALL mpi_comm_size(comm1%handle, n1, ierr)
2094 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ mp_rank_compare")
2095 CALL mpi_comm_size(comm2%handle, n2, ierr)
2096 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ mp_rank_compare")
2098 CALL mpi_comm_group(comm1%handle, g1, ierr)
2099 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_rank_compare")
2100 CALL mpi_comm_group(comm2%handle, g2, ierr)
2101 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_rank_compare")
2102 ALLOCATE (rin(0:n - 1), stat=ierr)
2104 cpabort(
"allocate @ mp_rank_compare")
2108 CALL mpi_group_translate_ranks(g1, n, rin, g2, rank, ierr)
2109 IF (ierr /= 0)
CALL mp_stop(ierr, &
2110 "mpi_group_translate_rank @ mp_rank_compare")
2111 CALL mpi_group_free(g1, ierr)
2113 cpabort(
"group_free @ mp_rank_compare")
2114 CALL mpi_group_free(g2, ierr)
2116 cpabort(
"group_free @ mp_rank_compare")
2122 CALL mp_timestop(handle)
2124 END SUBROUTINE mp_rank_compare
2133 INTEGER,
INTENT(IN) :: nodes
2134 INTEGER,
DIMENSION(:),
INTENT(INOUT) :: dims
2136 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_dims_create'
2138 INTEGER :: handle, ndim
2139 #if defined(__parallel)
2143 CALL mp_timeset(routinen, handle)
2146 #if defined(__parallel)
2147 IF (any(dims == 0))
CALL mpi_dims_create(nodes, ndim, dims, ierr)
2148 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_dims_create @ mp_dims_create")
2153 CALL mp_timestop(handle)
2163 SUBROUTINE mp_cart_rank(comm, pos, rank)
2164 CLASS(mp_cart_type),
INTENT(IN) :: comm
2165 INTEGER,
DIMENSION(:),
INTENT(IN) :: pos
2166 INTEGER,
INTENT(OUT) :: rank
2168 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_rank'
2171 #if defined(__parallel)
2175 CALL mp_timeset(routinen, handle)
2177 #if defined(__parallel)
2178 CALL mpi_cart_rank(comm%handle, pos, rank, ierr)
2179 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_rank @ mp_cart_rank")
2185 CALL mp_timestop(handle)
2187 END SUBROUTINE mp_cart_rank
2198 SUBROUTINE mp_wait(request)
2199 CLASS(mp_request_type),
INTENT(inout) :: request
2201 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_wait'
2204 #if defined(__parallel)
2208 CALL mp_timeset(routinen, handle)
2210 #if defined(__parallel)
2212 CALL mpi_wait(request%handle, mpi_status_ignore, ierr)
2213 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_wait @ mp_wait")
2215 CALL add_perf(perf_id=9, count=1)
2217 request%handle = mp_request_null_handle
2219 CALL mp_timestop(handle)
2220 END SUBROUTINE mp_wait
2231 SUBROUTINE mp_waitall_1(requests)
2232 TYPE(mp_request_type),
DIMENSION(:),
INTENT(inout) :: requests
2234 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_waitall_1'
2237 #if defined(__parallel)
2238 INTEGER :: count, ierr
2239 #if !defined(__MPI_F08)
2240 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: status
2242 TYPE(mpi_status),
ALLOCATABLE,
DIMENSION(:) :: status
2246 CALL mp_timeset(routinen, handle)
2248 #if defined(__parallel)
2249 count =
SIZE(requests)
2250 #if !defined(__MPI_F08)
2251 ALLOCATE (status(mpi_status_size, count))
2253 ALLOCATE (status(count))
2255 CALL mpi_waitall_internal(count, requests, status, ierr)
2256 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitall @ mp_waitall_1")
2258 CALL add_perf(perf_id=9, count=1)
2262 CALL mp_timestop(handle)
2263 END SUBROUTINE mp_waitall_1
2272 SUBROUTINE mp_waitall_2(requests)
2273 TYPE(mp_request_type),
DIMENSION(:, :),
INTENT(inout) :: requests
2275 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_waitall_2'
2278 #if defined(__parallel)
2279 INTEGER :: count, ierr
2280 #if !defined(__MPI_F08)
2281 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: status
2283 TYPE(mpi_status),
ALLOCATABLE,
DIMENSION(:) :: status
2287 CALL mp_timeset(routinen, handle)
2289 #if defined(__parallel)
2290 count =
SIZE(requests)
2291 #if !defined(__MPI_F08)
2292 ALLOCATE (status(mpi_status_size, count))
2294 ALLOCATE (status(count))
2297 CALL mpi_waitall_internal(count, requests, status, ierr)
2298 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitall @ mp_waitall_2")
2301 CALL add_perf(perf_id=9, count=1)
2305 CALL mp_timestop(handle)
2306 END SUBROUTINE mp_waitall_2
2317 #if defined(__parallel)
2318 SUBROUTINE mpi_waitall_internal(count, array_of_requests, array_of_statuses, ierr)
2319 INTEGER,
INTENT(in) :: count
2320 TYPE(mp_request_type),
DIMENSION(count),
INTENT(inout) :: array_of_requests
2321 #if !defined(__MPI_F08)
2322 INTEGER,
DIMENSION(MPI_STATUS_SIZE, count), &
2323 INTENT(out) :: array_of_statuses
2325 TYPE(mpi_status),
DIMENSION(count), &
2326 INTENT(out) :: array_of_statuses
2328 INTEGER,
INTENT(out) :: ierr
2331 mpi_request_type,
ALLOCATABLE,
DIMENSION(:) :: request_handles
2333 ALLOCATE (request_handles(count))
2335 request_handles(i) = array_of_requests(i)%handle
2338 CALL mpi_waitall(count, request_handles, array_of_statuses, ierr)
2341 array_of_requests(i)%handle = request_handles(i)
2344 END SUBROUTINE mpi_waitall_internal
2356 TYPE(mp_request_type),
DIMENSION(:),
INTENT(inout) :: requests
2357 INTEGER,
INTENT(out) :: completed
2359 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_waitany'
2362 #if defined(__parallel)
2363 INTEGER :: count, i, ierr
2364 mpi_request_type,
ALLOCATABLE,
DIMENSION(:) :: request_handles
2367 CALL mp_timeset(routinen, handle)
2369 #if defined(__parallel)
2370 count =
SIZE(requests)
2373 ALLOCATE (request_handles(count))
2375 request_handles(i) = requests(i)%handle
2377 CALL mpi_waitany(count, request_handles, completed, mpi_status_ignore, ierr)
2378 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitany @ mp_waitany")
2381 requests(i)%handle = request_handles(i)
2383 CALL add_perf(perf_id=9, count=1)
2388 CALL mp_timestop(handle)
2400 FUNCTION mp_testall_tv(requests)
RESULT(flag)
2401 TYPE(mp_request_type),
DIMENSION(:),
INTENT(INOUT) :: requests
2404 #if defined(__parallel)
2406 LOGICAL,
DIMENSION(:),
POINTER :: flags
2411 #if defined(__parallel)
2412 ALLOCATE (flags(
SIZE(requests)))
2413 DO i = 1,
SIZE(requests)
2414 CALL mpi_test(requests(i)%handle, flags(i), mpi_status_ignore, ierr)
2415 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testall @ mp_testall_tv")
2416 flag = flag .AND. flags(i)
2422 END FUNCTION mp_testall_tv
2432 FUNCTION mp_test_1(request)
RESULT(flag)
2433 CLASS(mp_request_type),
INTENT(inout) :: request
2436 #if defined(__parallel)
2439 CALL mpi_test(request%handle, flag, mpi_status_ignore, ierr)
2440 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_test @ mp_test_1")
2445 END FUNCTION mp_test_1
2456 SUBROUTINE mp_testany_1(requests, completed, flag)
2457 TYPE(mp_request_type),
DIMENSION(:),
INTENT(inout) :: requests
2458 INTEGER,
INTENT(out),
OPTIONAL :: completed
2459 LOGICAL,
INTENT(out),
OPTIONAL :: flag
2461 #if defined(__parallel)
2462 INTEGER :: completed_l, count, ierr
2465 count =
SIZE(requests)
2467 CALL mpi_testany_internal(count, requests, completed_l, flag_l, mpi_status_ignore, ierr)
2468 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testany_1 @ mp_testany")
2470 IF (
PRESENT(completed)) completed = completed_l
2471 IF (
PRESENT(flag)) flag = flag_l
2474 IF (
PRESENT(completed)) completed = 1
2475 IF (
PRESENT(flag)) flag = .true.
2477 END SUBROUTINE mp_testany_1
2488 SUBROUTINE mp_testany_2(requests, completed, flag)
2489 TYPE(mp_request_type),
DIMENSION(:, :),
INTENT(inout) :: requests
2490 INTEGER,
INTENT(out),
OPTIONAL :: completed
2491 LOGICAL,
INTENT(out),
OPTIONAL :: flag
2493 #if defined(__parallel)
2494 INTEGER :: completed_l, count, ierr
2497 count =
SIZE(requests)
2499 CALL mpi_testany_internal(count, requests, completed_l, flag_l, mpi_status_ignore, ierr)
2500 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testany_2 @ mp_testany")
2502 IF (
PRESENT(completed)) completed = completed_l
2503 IF (
PRESENT(flag)) flag = flag_l
2506 IF (
PRESENT(completed)) completed = 1
2507 IF (
PRESENT(flag)) flag = .true.
2509 END SUBROUTINE mp_testany_2
2522 #if defined(__parallel)
2523 SUBROUTINE mpi_testany_internal(count, array_of_requests, index, flag, status, ierr)
2524 INTEGER,
INTENT(in) :: count
2525 TYPE(mp_request_type),
DIMENSION(count),
INTENT(inout) :: array_of_requests
2526 INTEGER,
INTENT(out) :: index
2527 LOGICAL,
INTENT(out) :: flag
2528 mpi_status_type,
INTENT(out) :: status
2529 INTEGER,
INTENT(out) :: ierr
2532 mpi_request_type,
ALLOCATABLE,
DIMENSION(:) :: request_handles
2534 ALLOCATE (request_handles(count))
2536 request_handles(i) = array_of_requests(i)%handle
2539 CALL mpi_testany(count, request_handles, index, flag, status, ierr)
2542 array_of_requests(i)%handle = request_handles(i)
2545 END SUBROUTINE mpi_testany_internal
2557 SUBROUTINE mp_comm_split_direct(comm, sub_comm, color, key)
2558 CLASS(mp_comm_type),
INTENT(in) :: comm
2559 CLASS(mp_comm_type),
INTENT(OUT) :: sub_comm
2560 INTEGER,
INTENT(in) :: color
2561 INTEGER,
INTENT(in),
OPTIONAL :: key
2563 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_split_direct'
2566 #if defined(__parallel)
2567 INTEGER :: ierr, my_key
2570 CALL mp_timeset(routinen, handle)
2572 #if defined(__parallel)
2574 IF (
PRESENT(key)) my_key = key
2575 CALL mpi_comm_split(comm%handle, color, my_key, sub_comm%handle, ierr)
2576 IF (ierr /= mpi_success)
CALL mp_stop(ierr, routinen)
2577 CALL add_perf(perf_id=10, count=1)
2579 sub_comm%handle = mp_comm_default_handle
2584 debug_comm_count = debug_comm_count + 1
2585 CALL sub_comm%init()
2586 CALL mp_timestop(handle)
2588 END SUBROUTINE mp_comm_split_direct
2612 SUBROUTINE mp_comm_split(comm, sub_comm, ngroups, group_distribution, &
2613 subgroup_min_size, n_subgroups, group_partition, stride)
2614 CLASS(mp_comm_type),
INTENT(in) :: comm
2615 CLASS(mp_comm_type),
INTENT(out) :: sub_comm
2616 INTEGER,
INTENT(out) :: ngroups
2617 INTEGER,
DIMENSION(0:),
INTENT(INOUT) :: group_distribution
2618 INTEGER,
INTENT(in),
OPTIONAL :: subgroup_min_size, n_subgroups
2619 INTEGER,
DIMENSION(0:),
INTENT(IN),
OPTIONAL :: group_partition
2620 INTEGER,
OPTIONAL,
INTENT(IN) :: stride
2622 CHARACTER(LEN=*),
PARAMETER :: routinen =
'mp_comm_split', &
2623 routinep = modulen//
':'//routinen
2625 INTEGER :: handle, mepos, nnodes
2626 #if defined(__parallel)
2627 INTEGER :: color, i, ierr, j, k, &
2628 my_subgroup_min_size, &
2629 istride, local_stride, irank
2630 INTEGER,
DIMENSION(:),
ALLOCATABLE :: rank_permutation
2633 CALL mp_timeset(routinen, handle)
2637 IF (.NOT.
PRESENT(subgroup_min_size) .AND. .NOT.
PRESENT(n_subgroups))
THEN
2638 cpabort(routinep//
" missing arguments")
2640 IF (
PRESENT(subgroup_min_size) .AND.
PRESENT(n_subgroups))
THEN
2641 cpabort(routinep//
" too many arguments")
2644 CALL comm%get_size(nnodes)
2645 CALL comm%get_rank(mepos)
2647 IF (ubound(group_distribution, 1) .NE. nnodes - 1)
THEN
2648 cpabort(routinep//
" group_distribution wrong bounds")
2651 #if defined(__parallel)
2652 IF (
PRESENT(subgroup_min_size))
THEN
2653 IF (subgroup_min_size < 0 .OR. subgroup_min_size > nnodes)
THEN
2654 cpabort(routinep//
" subgroup_min_size too small or too large")
2656 ngroups = nnodes/subgroup_min_size
2657 my_subgroup_min_size = subgroup_min_size
2659 IF (n_subgroups <= 0)
THEN
2660 cpabort(routinep//
" n_subgroups too small")
2662 IF (nnodes/n_subgroups > 0)
THEN
2663 ngroups = n_subgroups
2667 my_subgroup_min_size = nnodes/ngroups
2673 ALLOCATE (rank_permutation(0:nnodes - 1))
2675 IF (
PRESENT(stride)) local_stride = stride
2677 DO istride = 1, local_stride
2678 DO irank = istride - 1, nnodes - 1, local_stride
2679 rank_permutation(k) = irank
2684 DO i = 0, nnodes - 1
2685 group_distribution(rank_permutation(i)) = min(i/my_subgroup_min_size, ngroups - 1)
2688 IF (
PRESENT(group_partition))
THEN
2689 IF (all(group_partition > 0) .AND. (sum(group_partition) .EQ. nnodes) .AND. (ngroups ==
SIZE(group_partition)))
THEN
2691 DO i = 0,
SIZE(group_partition) - 1
2692 DO j = 1, group_partition(i)
2693 group_distribution(rank_permutation(k)) = i
2701 color = group_distribution(mepos)
2702 CALL mpi_comm_split(comm%handle, color, 0, sub_comm%handle, ierr)
2703 IF (ierr /= mpi_success)
CALL mp_stop(ierr,
"in "//routinep//
" split")
2705 CALL add_perf(perf_id=10, count=1)
2707 sub_comm%handle = mp_comm_default_handle
2708 group_distribution(0) = 0
2712 mark_used(group_partition)
2714 debug_comm_count = debug_comm_count + 1
2715 CALL sub_comm%init()
2716 CALL mp_timestop(handle)
2718 END SUBROUTINE mp_comm_split
2728 INTEGER :: node_rank
2730 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_get_node_global_rank'
2732 #if defined(__parallel)
2733 INTEGER :: ierr, rank
2734 TYPE(mp_comm_type) :: comm
2737 CALL mp_timeset(routinen, handle)
2739 #if defined(__parallel)
2740 CALL mpi_comm_rank(mpi_comm_world, rank, ierr)
2741 IF (ierr /= mpi_success)
CALL mp_stop(ierr, routinen)
2742 CALL mpi_comm_split_type(mpi_comm_world, mpi_comm_type_shared, rank, mpi_info_null, comm%handle, ierr)
2743 IF (ierr /= mpi_success)
CALL mp_stop(ierr, routinen)
2744 CALL mpi_comm_rank(comm%handle, node_rank, ierr)
2745 IF (ierr /= mpi_success)
CALL mp_stop(ierr, routinen)
2746 CALL mpi_comm_free(comm%handle, ierr)
2747 IF (ierr /= mpi_success)
CALL mp_stop(ierr, routinen)
2751 CALL mp_timestop(handle)
2766 SUBROUTINE mp_probe(source, comm, tag)
2767 INTEGER,
INTENT(INOUT) :: source
2768 CLASS(mp_comm_type),
INTENT(IN) :: comm
2769 INTEGER,
INTENT(OUT) :: tag
2771 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_probe'
2774 #if defined(__parallel)
2776 mpi_status_type :: status_single
2782 CALL mp_timeset(routinen, handle)
2784 #if defined(__parallel)
2787 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_probe @ mp_probe")
2788 source = status_single mpi_status_extract(mpi_source)
2789 tag = status_single mpi_status_extract(mpi_tag)
2792 CALL mpi_iprobe(source,
mp_any_tag, comm%handle, flag, status_single, ierr)
2793 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iprobe @ mp_probe")
2794 IF (flag .EQV. .false.)
THEN
2798 tag = status_single mpi_status_extract(mpi_tag)
2806 CALL mp_timestop(handle)
2807 END SUBROUTINE mp_probe
2819 SUBROUTINE mp_bcast_b(msg, source, comm)
2820 LOGICAL,
INTENT(INOUT) :: msg
2821 INTEGER,
INTENT(IN) :: source
2822 CLASS(mp_comm_type),
INTENT(IN) :: comm
2824 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_b'
2827 #if defined(__parallel)
2828 INTEGER :: ierr, msglen
2831 CALL mp_timeset(routinen, handle)
2833 #if defined(__parallel)
2835 CALL mpi_bcast(msg, msglen, mpi_logical, source, comm%handle, ierr)
2836 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2837 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2843 CALL mp_timestop(handle)
2844 END SUBROUTINE mp_bcast_b
2852 SUBROUTINE mp_bcast_b_src(msg, comm)
2853 LOGICAL,
INTENT(INOUT) :: msg
2854 CLASS(mp_comm_type),
INTENT(IN) :: comm
2856 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_b_src'
2859 #if defined(__parallel)
2860 INTEGER :: ierr, msglen
2863 CALL mp_timeset(routinen, handle)
2865 #if defined(__parallel)
2867 CALL mpi_bcast(msg, msglen, mpi_logical, comm%source, comm%handle, ierr)
2868 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2869 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2874 CALL mp_timestop(handle)
2875 END SUBROUTINE mp_bcast_b_src
2883 SUBROUTINE mp_bcast_bv(msg, source, comm)
2884 LOGICAL,
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
2885 INTEGER,
INTENT(IN) :: source
2886 CLASS(mp_comm_type),
INTENT(IN) :: comm
2888 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_bv'
2891 #if defined(__parallel)
2892 INTEGER :: ierr, msglen
2895 CALL mp_timeset(routinen, handle)
2897 #if defined(__parallel)
2899 CALL mpi_bcast(msg, msglen, mpi_logical, source, comm%handle, ierr)
2900 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2901 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2907 CALL mp_timestop(handle)
2908 END SUBROUTINE mp_bcast_bv
2915 SUBROUTINE mp_bcast_bv_src(msg, comm)
2916 LOGICAL,
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
2917 CLASS(mp_comm_type),
INTENT(IN) :: comm
2919 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_bv_src'
2922 #if defined(__parallel)
2923 INTEGER :: ierr, msglen
2926 CALL mp_timeset(routinen, handle)
2928 #if defined(__parallel)
2930 CALL mpi_bcast(msg, msglen, mpi_logical, comm%source, comm%handle, ierr)
2931 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2932 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2937 CALL mp_timestop(handle)
2938 END SUBROUTINE mp_bcast_bv_src
2954 SUBROUTINE mp_isend_bv(msgin, dest, comm, request, tag)
2955 LOGICAL,
DIMENSION(:),
INTENT(IN) :: msgin
2956 INTEGER,
INTENT(IN) :: dest
2957 CLASS(mp_comm_type),
INTENT(IN) :: comm
2958 TYPE(mp_request_type),
INTENT(out) :: request
2959 INTEGER,
INTENT(in),
OPTIONAL :: tag
2961 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_bv'
2964 #if defined(__parallel)
2965 INTEGER :: ierr, msglen, my_tag
2969 CALL mp_timeset(routinen, handle)
2971 #if defined(__parallel)
2972 #if !defined(__GNUC__) || __GNUC__ >= 9
2973 cpassert(is_contiguous(msgin))
2977 IF (
PRESENT(tag)) my_tag = tag
2979 msglen =
SIZE(msgin, 1)
2980 IF (msglen > 0)
THEN
2981 CALL mpi_isend(msgin(1), msglen, mpi_logical, dest, my_tag, &
2982 comm%handle, request%handle, ierr)
2984 CALL mpi_isend(foo, msglen, mpi_logical, dest, my_tag, &
2985 comm%handle, request%handle, ierr)
2987 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
2989 CALL add_perf(perf_id=11, count=1, msg_size=msglen*loglen)
2991 cpabort(
"mp_isend called in non parallel case")
2998 CALL mp_timestop(handle)
2999 END SUBROUTINE mp_isend_bv
3015 SUBROUTINE mp_irecv_bv(msgout, source, comm, request, tag)
3016 LOGICAL,
DIMENSION(:),
INTENT(INOUT) :: msgout
3017 INTEGER,
INTENT(IN) :: source
3018 CLASS(mp_comm_type),
INTENT(IN) :: comm
3019 TYPE(mp_request_type),
INTENT(out) :: request
3020 INTEGER,
INTENT(in),
OPTIONAL :: tag
3022 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_bv'
3025 #if defined(__parallel)
3026 INTEGER :: ierr, msglen, my_tag
3030 CALL mp_timeset(routinen, handle)
3032 #if defined(__parallel)
3033 #if !defined(__GNUC__) || __GNUC__ >= 9
3034 cpassert(is_contiguous(msgout))
3038 IF (
PRESENT(tag)) my_tag = tag
3040 msglen =
SIZE(msgout, 1)
3041 IF (msglen > 0)
THEN
3042 CALL mpi_irecv(msgout(1), msglen, mpi_logical, source, my_tag, &
3043 comm%handle, request%handle, ierr)
3045 CALL mpi_irecv(foo, msglen, mpi_logical, source, my_tag, &
3046 comm%handle, request%handle, ierr)
3048 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
3050 CALL add_perf(perf_id=12, count=1, msg_size=msglen*loglen)
3052 cpabort(
"mp_irecv called in non parallel case")
3059 CALL mp_timestop(handle)
3060 END SUBROUTINE mp_irecv_bv
3076 SUBROUTINE mp_isend_bm3(msgin, dest, comm, request, tag)
3077 LOGICAL,
DIMENSION(:, :, :),
INTENT(INOUT) :: msgin
3078 INTEGER,
INTENT(IN) :: dest
3079 CLASS(mp_comm_type),
INTENT(IN) :: comm
3080 TYPE(mp_request_type),
INTENT(out) :: request
3081 INTEGER,
INTENT(in),
OPTIONAL :: tag
3083 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_bm3'
3086 #if defined(__parallel)
3087 INTEGER :: ierr, msglen, my_tag
3091 CALL mp_timeset(routinen, handle)
3093 #if defined(__parallel)
3094 #if !defined(__GNUC__) || __GNUC__ >= 9
3095 cpassert(is_contiguous(msgin))
3099 IF (
PRESENT(tag)) my_tag = tag
3101 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
3102 IF (msglen > 0)
THEN
3103 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_logical, dest, my_tag, &
3104 comm%handle, request%handle, ierr)
3106 CALL mpi_isend(foo, msglen, mpi_logical, dest, my_tag, &
3107 comm%handle, request%handle, ierr)
3109 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
3111 CALL add_perf(perf_id=11, count=1, msg_size=msglen*loglen)
3113 cpabort(
"mp_isend called in non parallel case")
3120 CALL mp_timestop(handle)
3121 END SUBROUTINE mp_isend_bm3
3137 SUBROUTINE mp_irecv_bm3(msgout, source, comm, request, tag)
3138 LOGICAL,
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
3139 INTEGER,
INTENT(IN) :: source
3140 CLASS(mp_comm_type),
INTENT(IN) :: comm
3141 TYPE(mp_request_type),
INTENT(out) :: request
3142 INTEGER,
INTENT(in),
OPTIONAL :: tag
3144 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_bm3'
3147 #if defined(__parallel)
3148 INTEGER :: ierr, msglen, my_tag
3152 CALL mp_timeset(routinen, handle)
3154 #if defined(__parallel)
3155 #if !defined(__GNUC__) || __GNUC__ >= 9
3156 cpassert(is_contiguous(msgout))
3160 IF (
PRESENT(tag)) my_tag = tag
3162 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
3163 IF (msglen > 0)
THEN
3164 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_logical, source, my_tag, &
3165 comm%handle, request%handle, ierr)
3167 CALL mpi_irecv(foo, msglen, mpi_logical, source, my_tag, &
3168 comm%handle, request%handle, ierr)
3170 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
3172 CALL add_perf(perf_id=12, count=1, msg_size=msglen*loglen)
3174 cpabort(
"mp_irecv called in non parallel case")
3182 CALL mp_timestop(handle)
3183 END SUBROUTINE mp_irecv_bm3
3191 SUBROUTINE mp_bcast_av(msg, source, comm)
3192 CHARACTER(LEN=*),
INTENT(INOUT) :: msg
3193 INTEGER,
INTENT(IN) :: source
3194 CLASS(mp_comm_type),
INTENT(IN) :: comm
3196 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_av'
3199 #if defined(__parallel)
3200 INTEGER :: i, ierr, msglen
3201 INTEGER,
DIMENSION(:),
ALLOCATABLE :: imsg
3204 CALL mp_timeset(routinen, handle)
3206 #if defined(__parallel)
3208 IF (comm%mepos == source) msglen = len_trim(msg)
3210 CALL comm%bcast(msglen, source)
3216 ALLOCATE (imsg(1:msglen))
3218 imsg(i) = ichar(msg(i:i))
3220 CALL mpi_bcast(imsg, msglen, mpi_integer, source, comm%handle, ierr)
3221 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3224 msg(i:i) = char(imsg(i))
3227 CALL add_perf(perf_id=2, count=1, msg_size=msglen*charlen)
3233 CALL mp_timestop(handle)
3234 END SUBROUTINE mp_bcast_av
3241 SUBROUTINE mp_bcast_av_src(msg, comm)
3242 CHARACTER(LEN=*),
INTENT(INOUT) :: msg
3243 CLASS(mp_comm_type),
INTENT(IN) :: comm
3245 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_av_src'
3248 #if defined(__parallel)
3249 INTEGER :: i, ierr, msglen
3250 INTEGER,
DIMENSION(:),
ALLOCATABLE :: imsg
3253 CALL mp_timeset(routinen, handle)
3255 #if defined(__parallel)
3257 IF (comm%is_source()) msglen = len_trim(msg)
3259 CALL comm%bcast(msglen, comm%source)
3265 ALLOCATE (imsg(1:msglen))
3267 imsg(i) = ichar(msg(i:i))
3269 CALL mpi_bcast(imsg, msglen, mpi_integer, comm%source, comm%handle, ierr)
3270 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3273 msg(i:i) = char(imsg(i))
3276 CALL add_perf(perf_id=2, count=1, msg_size=msglen*charlen)
3281 CALL mp_timestop(handle)
3282 END SUBROUTINE mp_bcast_av_src
3290 SUBROUTINE mp_bcast_am(msg, source, comm)
3291 CHARACTER(LEN=*),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3292 INTEGER,
INTENT(IN) :: source
3293 CLASS(mp_comm_type),
INTENT(IN) :: comm
3295 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_am'
3298 #if defined(__parallel)
3299 INTEGER :: i, ierr, j, k, msglen, msgsiz
3300 INTEGER,
ALLOCATABLE :: imsg(:), imsglen(:)
3303 CALL mp_timeset(routinen, handle)
3305 #if defined(__parallel)
3308 ALLOCATE (imsglen(1:msgsiz))
3309 IF (comm%mepos == source)
THEN
3311 imsglen(j) = len_trim(msg(j))
3314 CALL comm%bcast(imsglen, source)
3315 msglen = sum(imsglen)
3320 ALLOCATE (imsg(1:msglen))
3323 DO i = 1, imsglen(j)
3325 imsg(k) = ichar(msg(j) (i:i))
3328 CALL mpi_bcast(imsg, msglen, mpi_integer, source, comm%handle, ierr)
3329 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3333 DO i = 1, imsglen(j)
3335 msg(j) (i:i) = char(imsg(k))
3339 DEALLOCATE (imsglen)
3340 CALL add_perf(perf_id=2, count=1, msg_size=msglen*charlen*msgsiz)
3346 CALL mp_timestop(handle)
3347 END SUBROUTINE mp_bcast_am
3349 SUBROUTINE mp_bcast_am_src(msg, comm)
3350 CHARACTER(LEN=*),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3351 CLASS(mp_comm_type),
INTENT(IN) :: comm
3353 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_am_src'
3356 #if defined(__parallel)
3357 INTEGER :: i, ierr, j, k, msglen, msgsiz
3358 INTEGER,
ALLOCATABLE :: imsg(:), imsglen(:)
3361 CALL mp_timeset(routinen, handle)
3363 #if defined(__parallel)
3366 ALLOCATE (imsglen(1:msgsiz))
3368 imsglen(j) = len_trim(msg(j))
3370 CALL comm%bcast(imsglen, comm%source)
3371 msglen = sum(imsglen)
3376 ALLOCATE (imsg(1:msglen))
3379 DO i = 1, imsglen(j)
3381 imsg(k) = ichar(msg(j) (i:i))
3384 CALL mpi_bcast(imsg, msglen, mpi_integer, comm%source, comm%handle, ierr)
3385 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3389 DO i = 1, imsglen(j)
3391 msg(j) (i:i) = char(imsg(k))
3395 DEALLOCATE (imsglen)
3396 CALL add_perf(perf_id=2, count=1, msg_size=msglen*charlen*msgsiz)
3401 CALL mp_timestop(handle)
3402 END SUBROUTINE mp_bcast_am_src
3414 SUBROUTINE mp_minloc_dv(msg, comm)
3415 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3416 CLASS(mp_comm_type),
INTENT(IN) :: comm
3418 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_minloc_dv'
3421 #if defined(__parallel)
3422 INTEGER :: ierr, msglen
3423 REAL(kind=real_8),
ALLOCATABLE :: res(:)
3426 IF (
"d" .EQ.
"l" .AND. real_8 .EQ. int_8)
THEN
3427 cpabort(
"Minimal location not available with long integers @ "//routinen)
3429 CALL mp_timeset(routinen, handle)
3431 #if defined(__parallel)
3433 ALLOCATE (res(1:msglen), stat=ierr)
3435 cpabort(
"allocate @ "//routinen)
3436 CALL mpi_allreduce(msg, res, msglen/2, mpi_2double_precision, mpi_minloc, comm%handle, ierr)
3437 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3440 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
3445 CALL mp_timestop(handle)
3446 END SUBROUTINE mp_minloc_dv
3458 SUBROUTINE mp_minloc_iv(msg, comm)
3459 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3460 CLASS(mp_comm_type),
INTENT(IN) :: comm
3462 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_minloc_iv'
3465 #if defined(__parallel)
3466 INTEGER :: ierr, msglen
3467 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
3470 IF (
"i" .EQ.
"l" .AND. int_4 .EQ. int_8)
THEN
3471 cpabort(
"Minimal location not available with long integers @ "//routinen)
3473 CALL mp_timeset(routinen, handle)
3475 #if defined(__parallel)
3477 ALLOCATE (res(1:msglen))
3478 CALL mpi_allreduce(msg, res, msglen/2, mpi_2integer, mpi_minloc, comm%handle, ierr)
3479 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3482 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
3487 CALL mp_timestop(handle)
3488 END SUBROUTINE mp_minloc_iv
3500 SUBROUTINE mp_minloc_lv(msg, comm)
3501 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3502 CLASS(mp_comm_type),
INTENT(IN) :: comm
3504 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_minloc_lv'
3507 #if defined(__parallel)
3508 INTEGER :: ierr, msglen
3509 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
3512 IF (
"l" .EQ.
"l" .AND. int_8 .EQ. int_8)
THEN
3513 cpabort(
"Minimal location not available with long integers @ "//routinen)
3515 CALL mp_timeset(routinen, handle)
3517 #if defined(__parallel)
3519 ALLOCATE (res(1:msglen))
3520 CALL mpi_allreduce(msg, res, msglen/2, mpi_integer8, mpi_minloc, comm%handle, ierr)
3521 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3524 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
3529 CALL mp_timestop(handle)
3530 END SUBROUTINE mp_minloc_lv
3542 SUBROUTINE mp_minloc_rv(msg, comm)
3543 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3544 CLASS(mp_comm_type),
INTENT(IN) :: comm
3546 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_minloc_rv'
3549 #if defined(__parallel)
3550 INTEGER :: ierr, msglen
3551 REAL(kind=real_4),
ALLOCATABLE :: res(:)
3554 IF (
"r" .EQ.
"l" .AND. real_4 .EQ. int_8)
THEN
3555 cpabort(
"Minimal location not available with long integers @ "//routinen)
3557 CALL mp_timeset(routinen, handle)
3559 #if defined(__parallel)
3561 ALLOCATE (res(1:msglen))
3562 CALL mpi_allreduce(msg, res, msglen/2, mpi_2real, mpi_minloc, comm%handle, ierr)
3563 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3566 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
3571 CALL mp_timestop(handle)
3572 END SUBROUTINE mp_minloc_rv
3584 SUBROUTINE mp_maxloc_dv(msg, comm)
3585 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3586 CLASS(mp_comm_type),
INTENT(IN) :: comm
3588 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_maxloc_dv'
3591 #if defined(__parallel)
3592 INTEGER :: ierr, msglen
3593 REAL(kind=real_8),
ALLOCATABLE :: res(:)
3596 IF (
"d" .EQ.
"l" .AND. real_8 .EQ. int_8)
THEN
3597 cpabort(
"Maximal location not available with long integers @ "//routinen)
3599 CALL mp_timeset(routinen, handle)
3601 #if defined(__parallel)
3603 ALLOCATE (res(1:msglen))
3604 CALL mpi_allreduce(msg, res, msglen/2, mpi_2double_precision, mpi_maxloc, comm%handle, ierr)
3605 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3608 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
3613 CALL mp_timestop(handle)
3614 END SUBROUTINE mp_maxloc_dv
3626 SUBROUTINE mp_maxloc_iv(msg, comm)
3627 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3628 CLASS(mp_comm_type),
INTENT(IN) :: comm
3630 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_maxloc_iv'
3633 #if defined(__parallel)
3634 INTEGER :: ierr, msglen
3635 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
3638 IF (
"i" .EQ.
"l" .AND. int_4 .EQ. int_8)
THEN
3639 cpabort(
"Maximal location not available with long integers @ "//routinen)
3641 CALL mp_timeset(routinen, handle)
3643 #if defined(__parallel)
3645 ALLOCATE (res(1:msglen))
3646 CALL mpi_allreduce(msg, res, msglen/2, mpi_2integer, mpi_maxloc, comm%handle, ierr)
3647 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3650 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
3655 CALL mp_timestop(handle)
3656 END SUBROUTINE mp_maxloc_iv
3668 SUBROUTINE mp_maxloc_lv(msg, comm)
3669 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3670 CLASS(mp_comm_type),
INTENT(IN) :: comm
3672 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_maxloc_lv'
3675 #if defined(__parallel)
3676 INTEGER :: ierr, msglen
3677 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
3680 IF (
"l" .EQ.
"l" .AND. int_8 .EQ. int_8)
THEN
3681 cpabort(
"Maximal location not available with long integers @ "//routinen)
3683 CALL mp_timeset(routinen, handle)
3685 #if defined(__parallel)
3687 ALLOCATE (res(1:msglen))
3688 CALL mpi_allreduce(msg, res, msglen/2, mpi_integer8, mpi_maxloc, comm%handle, ierr)
3689 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3692 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
3697 CALL mp_timestop(handle)
3698 END SUBROUTINE mp_maxloc_lv
3710 SUBROUTINE mp_maxloc_rv(msg, comm)
3711 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3712 CLASS(mp_comm_type),
INTENT(IN) :: comm
3714 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_maxloc_rv'
3717 #if defined(__parallel)
3718 INTEGER :: ierr, msglen
3719 REAL(kind=real_4),
ALLOCATABLE :: res(:)
3722 IF (
"r" .EQ.
"l" .AND. real_4 .EQ. int_8)
THEN
3723 cpabort(
"Maximal location not available with long integers @ "//routinen)
3725 CALL mp_timeset(routinen, handle)
3727 #if defined(__parallel)
3729 ALLOCATE (res(1:msglen))
3730 CALL mpi_allreduce(msg, res, msglen/2, mpi_2real, mpi_maxloc, comm%handle, ierr)
3731 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3734 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
3739 CALL mp_timestop(handle)
3740 END SUBROUTINE mp_maxloc_rv
3750 SUBROUTINE mp_sum_b(msg, comm)
3751 LOGICAL,
INTENT(INOUT) :: msg
3752 CLASS(mp_comm_type),
INTENT(IN) :: comm
3754 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_b'
3757 #if defined(__parallel)
3758 INTEGER :: ierr, msglen
3761 CALL mp_timeset(routinen, handle)
3762 #if defined(__parallel)
3764 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, ierr)
3765 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3770 CALL mp_timestop(handle)
3771 END SUBROUTINE mp_sum_b
3781 SUBROUTINE mp_sum_bv(msg, comm)
3782 LOGICAL,
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: msg
3783 CLASS(mp_comm_type),
INTENT(IN) :: comm
3785 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_bv'
3788 #if defined(__parallel)
3789 INTEGER :: ierr, msglen
3792 CALL mp_timeset(routinen, handle)
3793 #if defined(__parallel)
3795 IF (msglen .GT. 0)
THEN
3796 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, ierr)
3797 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3803 CALL mp_timestop(handle)
3804 END SUBROUTINE mp_sum_bv
3815 SUBROUTINE mp_isum_bv(msg, comm, request)
3816 LOGICAL,
DIMENSION(:),
INTENT(INOUT) :: msg
3817 CLASS(mp_comm_type),
INTENT(IN) :: comm
3818 TYPE(mp_request_type),
INTENT(INOUT) :: request
3820 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_bv'
3823 #if defined(__parallel)
3824 INTEGER :: ierr, msglen
3827 CALL mp_timeset(routinen, handle)
3828 #if defined(__parallel)
3830 #if !defined(__GNUC__) || __GNUC__ >= 9
3831 cpassert(is_contiguous(msg))
3834 IF (msglen .GT. 0)
THEN
3835 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, request%handle, ierr)
3836 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3845 CALL mp_timestop(handle)
3846 END SUBROUTINE mp_isum_bv
3856 CHARACTER(len=*),
INTENT(OUT) :: version
3857 INTEGER,
INTENT(OUT) :: resultlen
3859 #if defined(__parallel)
3865 #if defined(__parallel)
3867 CALL mpi_get_library_version(version, resultlen, ierr)
3868 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_get_library_version @ mp_get_library_version")
3888 SUBROUTINE mp_file_open(groupid, fh, filepath, amode_status, info)
3889 CLASS(mp_comm_type),
INTENT(IN) :: groupid
3890 CLASS(mp_file_type),
INTENT(OUT) :: fh
3891 CHARACTER(len=*),
INTENT(IN) :: filepath
3892 INTEGER,
INTENT(IN) :: amode_status
3893 TYPE(mp_info_type),
INTENT(IN),
OPTIONAL :: info
3895 #if defined(__parallel)
3897 mpi_info_type :: my_info
3899 CHARACTER(LEN=10) :: fstatus, fposition
3900 INTEGER :: amode, handle, istat
3901 LOGICAL :: exists, is_open
3904 #if defined(__parallel)
3906 my_info = mpi_info_null
3907 IF (
PRESENT(info)) my_info = info%handle
3908 CALL mpi_file_open(groupid%handle, filepath, amode_status, my_info, fh%handle, ierr)
3909 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3910 IF (ierr .NE. 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_open")
3914 amode = amode_status
3916 fposition =
"APPEND"
3919 fposition =
"REWIND"
3930 INQUIRE (unit=handle, exist=exists, opened=is_open, iostat=istat)
3931 IF (exists .AND. (.NOT. is_open) .AND. (istat == 0))
EXIT
3933 OPEN (unit=handle, file=filepath, status=fstatus, access=
"STREAM", position=fposition)
3936 END SUBROUTINE mp_file_open
3947 CHARACTER(len=*),
INTENT(IN) :: filepath
3948 TYPE(mp_info_type),
INTENT(IN),
OPTIONAL :: info
3950 #if defined(__parallel)
3952 mpi_info_type :: my_info
3956 my_info = mpi_info_null
3957 IF (
PRESENT(info)) my_info = info%handle
3958 INQUIRE (file=filepath, exist=exists)
3959 IF (exists)
CALL mpi_file_delete(filepath, my_info, ierr)
3960 IF (ierr .NE. 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_delete")
3978 SUBROUTINE mp_file_close(fh)
3979 CLASS(mp_file_type),
INTENT(INOUT) :: fh
3981 #if defined(__parallel)
3985 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3986 CALL mpi_file_close(fh%handle, ierr)
3987 IF (ierr .NE. 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_close")
3990 fh%handle = mp_file_null_handle
3992 END SUBROUTINE mp_file_close
3994 SUBROUTINE mp_file_assign(fh_new, fh_old)
3995 CLASS(mp_file_type),
INTENT(OUT) :: fh_new
3996 CLASS(mp_file_type),
INTENT(IN) :: fh_old
3998 fh_new%handle = fh_old%handle
4012 SUBROUTINE mp_file_get_size(fh, file_size)
4013 CLASS(mp_file_type),
INTENT(IN) :: fh
4014 INTEGER(kind=file_offset),
INTENT(OUT) :: file_size
4016 #if defined(__parallel)
4020 #if defined(__parallel)
4022 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4023 CALL mpi_file_get_size(fh%handle, file_size, ierr)
4024 IF (ierr .NE. 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_get_size")
4026 INQUIRE (unit=fh%handle, size=file_size)
4028 END SUBROUTINE mp_file_get_size
4040 SUBROUTINE mp_file_get_position(fh, pos)
4041 CLASS(mp_file_type),
INTENT(IN) :: fh
4042 INTEGER(kind=file_offset),
INTENT(OUT) :: pos
4044 #if defined(__parallel)
4048 #if defined(__parallel)
4050 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4051 CALL mpi_file_get_position(fh%handle, pos, ierr)
4052 IF (ierr .NE. 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_get_position")
4054 INQUIRE (unit=fh%handle, pos=pos)
4056 END SUBROUTINE mp_file_get_position
4069 SUBROUTINE mp_file_write_at_chv(fh, offset, msg, msglen)
4070 CHARACTER,
CONTIGUOUS,
INTENT(IN) :: msg(:)
4071 CLASS(mp_file_type),
INTENT(IN) :: fh
4072 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
4073 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4075 #if defined(__parallel)
4076 INTEGER :: ierr, msg_len
4079 #if defined(__parallel)
4081 IF (
PRESENT(msglen)) msg_len = msglen
4082 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4084 cpabort(
"mpi_file_write_at_chv @ mp_file_write_at_chv")
4087 WRITE (unit=fh%handle, pos=offset + 1) msg
4089 END SUBROUTINE mp_file_write_at_chv
4097 SUBROUTINE mp_file_write_at_ch(fh, offset, msg)
4098 CHARACTER(LEN=*),
INTENT(IN) :: msg
4099 CLASS(mp_file_type),
INTENT(IN) :: fh
4100 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4102 #if defined(__parallel)
4106 #if defined(__parallel)
4107 CALL mpi_file_write_at(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4109 cpabort(
"mpi_file_write_at_ch @ mp_file_write_at_ch")
4111 WRITE (unit=fh%handle, pos=offset + 1) msg
4113 END SUBROUTINE mp_file_write_at_ch
4125 SUBROUTINE mp_file_write_at_all_chv(fh, offset, msg, msglen)
4126 CHARACTER,
CONTIGUOUS,
INTENT(IN) :: msg(:)
4127 CLASS(mp_file_type),
INTENT(IN) :: fh
4128 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
4129 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4131 #if defined(__parallel)
4132 INTEGER :: ierr, msg_len
4135 #if defined(__parallel)
4137 IF (
PRESENT(msglen)) msg_len = msglen
4138 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4140 cpabort(
"mpi_file_write_at_all_chv @ mp_file_write_at_all_chv")
4143 WRITE (unit=fh%handle, pos=offset + 1) msg
4145 END SUBROUTINE mp_file_write_at_all_chv
4153 SUBROUTINE mp_file_write_at_all_ch(fh, offset, msg)
4154 CHARACTER(LEN=*),
INTENT(IN) :: msg
4155 CLASS(mp_file_type),
INTENT(IN) :: fh
4156 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4158 #if defined(__parallel)
4162 #if defined(__parallel)
4163 CALL mpi_file_write_at_all(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4165 cpabort(
"mpi_file_write_at_all_ch @ mp_file_write_at_all_ch")
4167 WRITE (unit=fh%handle, pos=offset + 1) msg
4169 END SUBROUTINE mp_file_write_at_all_ch
4182 SUBROUTINE mp_file_read_at_chv(fh, offset, msg, msglen)
4183 CHARACTER,
CONTIGUOUS,
INTENT(OUT) :: msg(:)
4184 CLASS(mp_file_type),
INTENT(IN) :: fh
4185 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
4186 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4188 #if defined(__parallel)
4189 INTEGER :: ierr, msg_len
4192 #if defined(__parallel)
4194 IF (
PRESENT(msglen)) msg_len = msglen
4195 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4197 cpabort(
"mpi_file_read_at_chv @ mp_file_read_at_chv")
4200 READ (unit=fh%handle, pos=offset + 1) msg
4202 END SUBROUTINE mp_file_read_at_chv
4210 SUBROUTINE mp_file_read_at_ch(fh, offset, msg)
4211 CHARACTER(LEN=*),
INTENT(OUT) :: msg
4212 CLASS(mp_file_type),
INTENT(IN) :: fh
4213 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4215 #if defined(__parallel)
4219 #if defined(__parallel)
4220 CALL mpi_file_read_at(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4222 cpabort(
"mpi_file_read_at_ch @ mp_file_read_at_ch")
4224 READ (unit=fh%handle, pos=offset + 1) msg
4226 END SUBROUTINE mp_file_read_at_ch
4238 SUBROUTINE mp_file_read_at_all_chv(fh, offset, msg, msglen)
4239 CHARACTER,
INTENT(OUT) :: msg(:)
4240 CLASS(mp_file_type),
INTENT(IN) :: fh
4241 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
4242 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4244 #if defined(__parallel)
4245 INTEGER :: ierr, msg_len
4248 #if defined(__parallel)
4250 IF (
PRESENT(msglen)) msg_len = msglen
4251 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4253 cpabort(
"mpi_file_read_at_all_chv @ mp_file_read_at_all_chv")
4256 READ (unit=fh%handle, pos=offset + 1) msg
4258 END SUBROUTINE mp_file_read_at_all_chv
4266 SUBROUTINE mp_file_read_at_all_ch(fh, offset, msg)
4267 CHARACTER(LEN=*),
INTENT(OUT) :: msg
4268 CLASS(mp_file_type),
INTENT(IN) :: fh
4269 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4271 #if defined(__parallel)
4275 #if defined(__parallel)
4276 CALL mpi_file_read_at_all(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4278 cpabort(
"mpi_file_read_at_all_ch @ mp_file_read_at_all_ch")
4280 READ (unit=fh%handle, pos=offset + 1) msg
4282 END SUBROUTINE mp_file_read_at_all_ch
4293 TYPE(mp_type_descriptor_type),
INTENT(IN) :: type_descriptor
4294 INTEGER,
INTENT(OUT) :: type_size
4296 #if defined(__parallel)
4300 CALL mpi_type_size(type_descriptor%type_handle, type_size, ierr)
4302 cpabort(
"mpi_type_size failed @ mp_type_size")
4304 SELECT CASE (type_descriptor%type_handle)
4306 type_size = real_4_size
4308 type_size = real_8_size
4310 type_size = 2*real_4_size
4312 type_size = 2*real_8_size
4324 FUNCTION mp_type_make_struct(subtypes, &
4325 vector_descriptor, index_descriptor) &
4326 result(type_descriptor)
4327 TYPE(mp_type_descriptor_type), &
4328 DIMENSION(:),
INTENT(IN) :: subtypes
4329 INTEGER,
DIMENSION(2),
INTENT(IN), &
4330 OPTIONAL :: vector_descriptor
4331 TYPE(mp_indexing_meta_type), &
4332 INTENT(IN),
OPTIONAL :: index_descriptor
4333 TYPE(mp_type_descriptor_type) :: type_descriptor
4335 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_struct'
4338 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: lengths
4339 #if defined(__parallel)
4341 INTEGER(kind=mpi_address_kind), &
4342 ALLOCATABLE,
DIMENSION(:) :: displacements
4344 mpi_data_type,
ALLOCATABLE,
DIMENSION(:) :: old_types
4347 type_descriptor%length = 1
4348 #if defined(__parallel)
4350 CALL mpi_get_address(mpi_bottom, type_descriptor%base, ierr)
4352 cpabort(
"MPI_get_address @ "//routinen)
4353 ALLOCATE (displacements(n))
4355 type_descriptor%vector_descriptor(1:2) = 1
4356 type_descriptor%has_indexing = .false.
4357 ALLOCATE (type_descriptor%subtype(n))
4358 type_descriptor%subtype(:) = subtypes(:)
4359 ALLOCATE (lengths(n), old_types(n))
4360 DO i = 1,
SIZE(subtypes)
4361 #if defined(__parallel)
4362 displacements(i) = subtypes(i)%base
4364 old_types(i) = subtypes(i)%type_handle
4365 lengths(i) = subtypes(i)%length
4367 #if defined(__parallel)
4368 CALL mpi_type_create_struct(n, &
4369 lengths, displacements, old_types, &
4370 type_descriptor%type_handle, ierr)
4372 cpabort(
"MPI_Type_create_struct @ "//routinen)
4373 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
4375 cpabort(
"MPI_Type_commit @ "//routinen)
4377 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
4378 cpabort(routinen//
" Vectors and indices NYI")
4380 END FUNCTION mp_type_make_struct
4386 RECURSIVE SUBROUTINE mp_type_free_m(type_descriptor)
4387 TYPE(mp_type_descriptor_type),
INTENT(inout) :: type_descriptor
4389 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_free_m'
4391 INTEGER :: handle, i
4392 #if defined(__parallel)
4396 CALL mp_timeset(routinen, handle)
4400 IF (
ASSOCIATED(type_descriptor%subtype))
THEN
4401 DO i = 1,
SIZE(type_descriptor%subtype)
4402 CALL mp_type_free_m(type_descriptor%subtype(i))
4404 DEALLOCATE (type_descriptor%subtype)
4406 #if defined(__parallel)
4408 CALL mpi_type_free(type_descriptor%type_handle, ierr)
4410 cpabort(
"MPI_Type_free @ "//routinen)
4413 CALL mp_timestop(handle)
4415 END SUBROUTINE mp_type_free_m
4421 SUBROUTINE mp_type_free_v(type_descriptors)
4422 TYPE(mp_type_descriptor_type),
DIMENSION(:), &
4423 INTENT(inout) :: type_descriptors
4427 DO i = 1,
SIZE(type_descriptors)
4428 CALL mp_type_free(type_descriptors(i))
4431 END SUBROUTINE mp_type_free_v
4442 result(type_descriptor)
4443 INTEGER,
INTENT(IN) :: count
4444 INTEGER,
DIMENSION(1:count), &
4445 INTENT(IN),
TARGET :: lengths
4446 INTEGER(kind=file_offset), &
4447 DIMENSION(1:count),
INTENT(in),
TARGET :: displs
4448 TYPE(mp_file_descriptor_type) :: type_descriptor
4450 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_hindexed_make_chv'
4452 INTEGER :: ierr, handle
4455 CALL mp_timeset(routinen, handle)
4457 #if defined(__parallel)
4458 CALL mpi_type_create_hindexed(count, lengths, int(displs, kind=
address_kind), mpi_character, &
4459 type_descriptor%type_handle, ierr)
4461 cpabort(
"MPI_Type_create_hindexed @ "//routinen)
4462 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
4464 cpabort(
"MPI_Type_commit @ "//routinen)
4466 type_descriptor%type_handle = 68
4468 type_descriptor%length = count
4469 type_descriptor%has_indexing = .true.
4470 type_descriptor%index_descriptor%index => lengths
4471 type_descriptor%index_descriptor%chunks => displs
4473 CALL mp_timestop(handle)
4486 TYPE(mp_file_type),
INTENT(IN) :: fh
4487 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4488 TYPE(mp_file_descriptor_type) :: type_descriptor
4490 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_set_view_chv'
4493 #if defined(__parallel)
4497 CALL mp_timeset(routinen, handle)
4499 #if defined(__parallel)
4501 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4502 CALL mpi_file_set_view(fh%handle, offset, mpi_character, &
4503 type_descriptor%type_handle,
"native", mpi_info_null, ierr)
4504 IF (ierr .NE. 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_set_view")
4509 mark_used(type_descriptor)
4512 CALL mp_timestop(handle)
4527 SUBROUTINE mp_file_read_all_chv(fh, msglen, ndims, buffer, type_descriptor)
4528 CLASS(mp_file_type),
INTENT(IN) :: fh
4529 INTEGER,
INTENT(IN) :: msglen
4530 INTEGER,
INTENT(IN) :: ndims
4531 CHARACTER(LEN=msglen),
DIMENSION(ndims),
INTENT(INOUT) :: buffer
4532 TYPE(mp_file_descriptor_type), &
4533 INTENT(IN),
OPTIONAL :: type_descriptor
4535 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_read_all_chv'
4538 #if defined(__parallel)
4544 CALL mp_timeset(routinen, handle)
4546 #if defined(__parallel)
4548 mark_used(type_descriptor)
4549 CALL mpi_file_read_all(fh%handle, buffer, ndims*msglen, mpi_character, mpi_status_ignore, ierr)
4550 IF (ierr .NE. 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_read_all")
4551 CALL add_perf(perf_id=28, count=1, msg_size=ndims*msglen)
4555 IF (.NOT.
PRESENT(type_descriptor)) &
4556 CALL cp_abort(__location__, &
4557 "Container for mp_file_descriptor_type must be present in serial call.")
4558 IF (.NOT. type_descriptor%has_indexing) &
4559 CALL cp_abort(__location__, &
4560 "File view has not been set in mp_file_descriptor_type.")
4563 READ (fh%handle, pos=type_descriptor%index_descriptor%chunks(i)) buffer(i)
4567 CALL mp_timestop(handle)
4569 END SUBROUTINE mp_file_read_all_chv
4582 SUBROUTINE mp_file_write_all_chv(fh, msglen, ndims, buffer, type_descriptor)
4583 CLASS(mp_file_type),
INTENT(IN) :: fh
4584 INTEGER,
INTENT(IN) :: msglen
4585 INTEGER,
INTENT(IN) :: ndims
4586 CHARACTER(LEN=msglen),
DIMENSION(ndims),
INTENT(IN) :: buffer
4587 TYPE(mp_file_descriptor_type), &
4588 INTENT(IN),
OPTIONAL :: type_descriptor
4590 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_write_all_chv'
4593 #if defined(__parallel)
4599 CALL mp_timeset(routinen, handle)
4601 #if defined(__parallel)
4602 mark_used(type_descriptor)
4603 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4604 CALL mpi_file_write_all(fh%handle, buffer, ndims*msglen, mpi_character, mpi_status_ignore, ierr)
4605 IF (ierr .NE. 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_write_all")
4606 CALL add_perf(perf_id=28, count=1, msg_size=ndims*msglen)
4610 IF (.NOT.
PRESENT(type_descriptor)) &
4611 CALL cp_abort(__location__, &
4612 "Container for mp_file_descriptor_type must be present in serial call.")
4613 IF (.NOT. type_descriptor%has_indexing) &
4614 CALL cp_abort(__location__, &
4615 "File view has not been set in mp_file_descriptor_type.")
4618 WRITE (fh%handle, pos=type_descriptor%index_descriptor%chunks(i)) buffer(i)
4622 CALL mp_timestop(handle)
4624 END SUBROUTINE mp_file_write_all_chv
4632 TYPE(mp_file_descriptor_type) :: type_descriptor
4634 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_type_free'
4637 #if defined(__parallel)
4641 CALL mp_timeset(routinen, handle)
4643 #if defined(__parallel)
4644 CALL mpi_type_free(type_descriptor%type_handle, ierr)
4646 cpabort(
"MPI_Type_free @ "//routinen)
4648 #if defined(__parallel) && defined(__MPI_F08)
4649 type_descriptor%type_handle%mpi_val = -1
4651 type_descriptor%type_handle = -1
4653 type_descriptor%length = -1
4654 IF (type_descriptor%has_indexing)
THEN
4655 NULLIFY (type_descriptor%index_descriptor%index)
4656 NULLIFY (type_descriptor%index_descriptor%chunks)
4657 type_descriptor%has_indexing = .false.
4660 CALL mp_timestop(handle)
4678 LOGICAL,
INTENT(INOUT) :: mpi_io, replace
4679 INTEGER,
INTENT(OUT) :: amode
4680 CHARACTER(len=*),
INTENT(IN) :: form, action, status, position
4683 #if defined(__parallel)
4688 CASE (
"UNFORMATTED")
4691 cpabort(
"Unknown MPI file form requested.")
4694 SELECT CASE (action)
4697 SELECT CASE (status)
4704 SELECT CASE (position)
4708 CASE (
"REWIND",
"ASIS")
4711 cpabort(
"Unknown MPI file position requested.")
4714 SELECT CASE (position)
4718 CASE (
"REWIND",
"ASIS")
4721 cpabort(
"Unknown MPI file position requested.")
4731 cpabort(
"Unknown MPI file status requested.")
4735 SELECT CASE (status)
4737 cpabort(
"Cannot read from 'NEW' file.")
4739 cpabort(
"Illegal status 'REPLACE' for read.")
4740 CASE (
"UNKNOWN",
"OLD")
4746 cpabort(
"Unknown MPI file status requested.")
4750 SELECT CASE (status)
4757 SELECT CASE (position)
4761 CASE (
"REWIND",
"ASIS")
4764 cpabort(
"Unknown MPI file position requested.")
4767 SELECT CASE (position)
4771 CASE (
"REWIND",
"ASIS")
4774 cpabort(
"Unknown MPI file position requested.")
4784 cpabort(
"Unknown MPI file status requested.")
4787 cpabort(
"Unknown MPI file action requested.")
4808 SUBROUTINE mp_isend_custom(msgin, dest, comm, request, tag)
4809 TYPE(mp_type_descriptor_type),
INTENT(IN) :: msgin
4810 INTEGER,
INTENT(IN) :: dest
4811 CLASS(mp_comm_type),
INTENT(IN) :: comm
4812 TYPE(mp_request_type),
INTENT(out) :: request
4813 INTEGER,
INTENT(in),
OPTIONAL :: tag
4815 INTEGER :: ierr, my_tag
4820 #if defined(__parallel)
4821 IF (
PRESENT(tag)) my_tag = tag
4823 CALL mpi_isend(mpi_bottom, 1, msgin%type_handle, dest, my_tag, &
4824 comm%handle, request%handle, ierr)
4825 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ mp_isend_custom")
4833 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
4835 END SUBROUTINE mp_isend_custom
4845 SUBROUTINE mp_irecv_custom(msgout, source, comm, request, tag)
4846 TYPE(mp_type_descriptor_type),
INTENT(INOUT) :: msgout
4847 INTEGER,
INTENT(IN) :: source
4848 CLASS(mp_comm_type),
INTENT(IN) :: comm
4849 TYPE(mp_request_type),
INTENT(out) :: request
4850 INTEGER,
INTENT(in),
OPTIONAL :: tag
4852 INTEGER :: ierr, my_tag
4857 #if defined(__parallel)
4858 IF (
PRESENT(tag)) my_tag = tag
4860 CALL mpi_irecv(mpi_bottom, 1, msgout%type_handle, source, my_tag, &
4861 comm%handle, request%handle, ierr)
4862 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ mp_irecv_custom")
4870 cpabort(
"mp_irecv called in non parallel case")
4872 END SUBROUTINE mp_irecv_custom
4878 SUBROUTINE mp_win_free(win)
4879 CLASS(mp_win_type),
INTENT(INOUT) :: win
4881 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_free'
4884 #if defined(__parallel)
4888 CALL mp_timeset(routinen, handle)
4890 #if defined(__parallel)
4892 CALL mpi_win_free(win%handle, ierr)
4893 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_free @ "//routinen)
4895 CALL add_perf(perf_id=21, count=1)
4897 win%handle = mp_win_null_handle
4899 CALL mp_timestop(handle)
4900 END SUBROUTINE mp_win_free
4902 SUBROUTINE mp_win_assign(win_new, win_old)
4903 CLASS(mp_win_type),
INTENT(OUT) :: win_new
4904 CLASS(mp_win_type),
INTENT(IN) :: win_old
4906 win_new%handle = win_old%handle
4908 END SUBROUTINE mp_win_assign
4914 SUBROUTINE mp_win_flush_all(win)
4915 CLASS(mp_win_type),
INTENT(IN) :: win
4917 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_flush_all'
4919 INTEGER :: handle, ierr
4922 CALL mp_timeset(routinen, handle)
4924 #if defined(__parallel)
4925 CALL mpi_win_flush_all(win%handle, ierr)
4926 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_flush_all @ "//routinen)
4930 CALL mp_timestop(handle)
4931 END SUBROUTINE mp_win_flush_all
4937 SUBROUTINE mp_win_lock_all(win)
4938 CLASS(mp_win_type),
INTENT(IN) :: win
4940 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_lock_all'
4942 INTEGER :: handle, ierr
4945 CALL mp_timeset(routinen, handle)
4947 #if defined(__parallel)
4949 CALL mpi_win_lock_all(mpi_mode_nocheck, win%handle, ierr)
4950 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_lock_all @ "//routinen)
4952 CALL add_perf(perf_id=19, count=1)
4956 CALL mp_timestop(handle)
4957 END SUBROUTINE mp_win_lock_all
4963 SUBROUTINE mp_win_unlock_all(win)
4964 CLASS(mp_win_type),
INTENT(IN) :: win
4966 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_unlock_all'
4968 INTEGER :: handle, ierr
4971 CALL mp_timeset(routinen, handle)
4973 #if defined(__parallel)
4975 CALL mpi_win_unlock_all(win%handle, ierr)
4976 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_unlock_all @ "//routinen)
4978 CALL add_perf(perf_id=19, count=1)
4982 CALL mp_timestop(handle)
4983 END SUBROUTINE mp_win_unlock_all
4990 SUBROUTINE mp_timeset(routineN, handle)
4991 CHARACTER(len=*),
INTENT(IN) :: routinen
4992 INTEGER,
INTENT(OUT) :: handle
4995 CALL timeset(routinen, handle)
4996 END SUBROUTINE mp_timeset
5002 SUBROUTINE mp_timestop(handle)
5003 INTEGER,
INTENT(IN) :: handle
5006 CALL timestop(handle)
5007 END SUBROUTINE mp_timestop
5020 SUBROUTINE mp_shift_im(msg, comm, displ_in)
5022 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
5023 CLASS(mp_comm_type),
INTENT(IN) :: comm
5024 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
5026 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_im'
5028 INTEGER :: handle, ierror
5029 #if defined(__parallel)
5030 INTEGER :: displ, left, &
5031 msglen, myrank, nprocs, &
5036 CALL mp_timeset(routinen, handle)
5038 #if defined(__parallel)
5039 CALL mpi_comm_rank(comm%handle, myrank, ierror)
5040 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
5041 CALL mpi_comm_size(comm%handle, nprocs, ierror)
5042 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
5043 IF (
PRESENT(displ_in))
THEN
5048 right =
modulo(myrank + displ, nprocs)
5049 left =
modulo(myrank - displ, nprocs)
5052 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer, right, tag, left, tag, &
5053 comm%handle, mpi_status_ignore, ierror)
5054 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
5055 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_4_size)
5061 CALL mp_timestop(handle)
5063 END SUBROUTINE mp_shift_im
5076 SUBROUTINE mp_shift_i (msg, comm, displ_in)
5078 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5079 CLASS(mp_comm_type),
INTENT(IN) :: comm
5080 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
5082 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_i'
5084 INTEGER :: handle, ierror
5085 #if defined(__parallel)
5086 INTEGER :: displ, left, &
5087 msglen, myrank, nprocs, &
5092 CALL mp_timeset(routinen, handle)
5094 #if defined(__parallel)
5095 CALL mpi_comm_rank(comm%handle, myrank, ierror)
5096 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
5097 CALL mpi_comm_size(comm%handle, nprocs, ierror)
5098 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
5099 IF (
PRESENT(displ_in))
THEN
5104 right =
modulo(myrank + displ, nprocs)
5105 left =
modulo(myrank - displ, nprocs)
5108 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer, right, tag, left, &
5109 tag, comm%handle, mpi_status_ignore, ierror)
5110 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
5111 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_4_size)
5117 CALL mp_timestop(handle)
5119 END SUBROUTINE mp_shift_i
5140 SUBROUTINE mp_alltoall_i11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
5142 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
5143 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
5144 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
5145 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
5146 CLASS(mp_comm_type),
INTENT(IN) :: comm
5148 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i11v'
5151 #if defined(__parallel)
5152 INTEGER :: ierr, msglen
5157 CALL mp_timeset(routinen, handle)
5159 #if defined(__parallel)
5160 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer, &
5161 rb, rcount, rdispl, mpi_integer, comm%handle, ierr)
5162 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
5163 msglen = sum(scount) + sum(rcount)
5164 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5171 rb(rdispl(1) + i) = sb(sdispl(1) + i)
5174 CALL mp_timestop(handle)
5176 END SUBROUTINE mp_alltoall_i11v
5191 SUBROUTINE mp_alltoall_i22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
5193 INTEGER(KIND=int_4),
DIMENSION(:, :), &
5194 INTENT(IN),
CONTIGUOUS :: sb
5195 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
5196 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS, &
5198 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
5199 CLASS(mp_comm_type),
INTENT(IN) :: comm
5201 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i22v'
5204 #if defined(__parallel)
5205 INTEGER :: ierr, msglen
5208 CALL mp_timeset(routinen, handle)
5210 #if defined(__parallel)
5211 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer, &
5212 rb, rcount, rdispl, mpi_integer, comm%handle, ierr)
5213 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
5214 msglen = sum(scount) + sum(rcount)
5215 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*int_4_size)
5224 CALL mp_timestop(handle)
5226 END SUBROUTINE mp_alltoall_i22v
5243 SUBROUTINE mp_alltoall_i (sb, rb, count, comm)
5245 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
5246 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
5247 INTEGER,
INTENT(IN) :: count
5248 CLASS(mp_comm_type),
INTENT(IN) :: comm
5250 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i'
5253 #if defined(__parallel)
5254 INTEGER :: ierr, msglen, np
5257 CALL mp_timeset(routinen, handle)
5259 #if defined(__parallel)
5260 CALL mpi_alltoall(sb, count, mpi_integer, &
5261 rb, count, mpi_integer, comm%handle, ierr)
5262 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5263 CALL mpi_comm_size(comm%handle, np, ierr)
5264 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5266 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5272 CALL mp_timestop(handle)
5274 END SUBROUTINE mp_alltoall_i
5284 SUBROUTINE mp_alltoall_i22(sb, rb, count, comm)
5286 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
5287 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
5288 INTEGER,
INTENT(IN) :: count
5289 CLASS(mp_comm_type),
INTENT(IN) :: comm
5291 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i22'
5294 #if defined(__parallel)
5295 INTEGER :: ierr, msglen, np
5298 CALL mp_timeset(routinen, handle)
5300 #if defined(__parallel)
5301 CALL mpi_alltoall(sb, count, mpi_integer, &
5302 rb, count, mpi_integer, comm%handle, ierr)
5303 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5304 CALL mpi_comm_size(comm%handle, np, ierr)
5305 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5306 msglen = 2*
SIZE(sb)*np
5307 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5313 CALL mp_timestop(handle)
5315 END SUBROUTINE mp_alltoall_i22
5325 SUBROUTINE mp_alltoall_i33(sb, rb, count, comm)
5327 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
5328 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
5329 INTEGER,
INTENT(IN) :: count
5330 CLASS(mp_comm_type),
INTENT(IN) :: comm
5332 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i33'
5335 #if defined(__parallel)
5336 INTEGER :: ierr, msglen, np
5339 CALL mp_timeset(routinen, handle)
5341 #if defined(__parallel)
5342 CALL mpi_alltoall(sb, count, mpi_integer, &
5343 rb, count, mpi_integer, comm%handle, ierr)
5344 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5345 CALL mpi_comm_size(comm%handle, np, ierr)
5346 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5348 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5354 CALL mp_timestop(handle)
5356 END SUBROUTINE mp_alltoall_i33
5366 SUBROUTINE mp_alltoall_i44(sb, rb, count, comm)
5368 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5370 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5372 INTEGER,
INTENT(IN) :: count
5373 CLASS(mp_comm_type),
INTENT(IN) :: comm
5375 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i44'
5378 #if defined(__parallel)
5379 INTEGER :: ierr, msglen, np
5382 CALL mp_timeset(routinen, handle)
5384 #if defined(__parallel)
5385 CALL mpi_alltoall(sb, count, mpi_integer, &
5386 rb, count, mpi_integer, comm%handle, ierr)
5387 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5388 CALL mpi_comm_size(comm%handle, np, ierr)
5389 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5391 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5397 CALL mp_timestop(handle)
5399 END SUBROUTINE mp_alltoall_i44
5409 SUBROUTINE mp_alltoall_i55(sb, rb, count, comm)
5411 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
5413 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
5415 INTEGER,
INTENT(IN) :: count
5416 CLASS(mp_comm_type),
INTENT(IN) :: comm
5418 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i55'
5421 #if defined(__parallel)
5422 INTEGER :: ierr, msglen, np
5425 CALL mp_timeset(routinen, handle)
5427 #if defined(__parallel)
5428 CALL mpi_alltoall(sb, count, mpi_integer, &
5429 rb, count, mpi_integer, comm%handle, ierr)
5430 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5431 CALL mpi_comm_size(comm%handle, np, ierr)
5432 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5434 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5440 CALL mp_timestop(handle)
5442 END SUBROUTINE mp_alltoall_i55
5453 SUBROUTINE mp_alltoall_i45(sb, rb, count, comm)
5455 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5457 INTEGER(KIND=int_4), &
5458 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
5459 INTEGER,
INTENT(IN) :: count
5460 CLASS(mp_comm_type),
INTENT(IN) :: comm
5462 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i45'
5465 #if defined(__parallel)
5466 INTEGER :: ierr, msglen, np
5469 CALL mp_timeset(routinen, handle)
5471 #if defined(__parallel)
5472 CALL mpi_alltoall(sb, count, mpi_integer, &
5473 rb, count, mpi_integer, comm%handle, ierr)
5474 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5475 CALL mpi_comm_size(comm%handle, np, ierr)
5476 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5478 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5482 rb = reshape(sb, shape(rb))
5484 CALL mp_timestop(handle)
5486 END SUBROUTINE mp_alltoall_i45
5497 SUBROUTINE mp_alltoall_i34(sb, rb, count, comm)
5499 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
5501 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5503 INTEGER,
INTENT(IN) :: count
5504 CLASS(mp_comm_type),
INTENT(IN) :: comm
5506 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i34'
5509 #if defined(__parallel)
5510 INTEGER :: ierr, msglen, np
5513 CALL mp_timeset(routinen, handle)
5515 #if defined(__parallel)
5516 CALL mpi_alltoall(sb, count, mpi_integer, &
5517 rb, count, mpi_integer, comm%handle, ierr)
5518 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5519 CALL mpi_comm_size(comm%handle, np, ierr)
5520 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5522 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5526 rb = reshape(sb, shape(rb))
5528 CALL mp_timestop(handle)
5530 END SUBROUTINE mp_alltoall_i34
5541 SUBROUTINE mp_alltoall_i54(sb, rb, count, comm)
5543 INTEGER(KIND=int_4), &
5544 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
5545 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5547 INTEGER,
INTENT(IN) :: count
5548 CLASS(mp_comm_type),
INTENT(IN) :: comm
5550 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i54'
5553 #if defined(__parallel)
5554 INTEGER :: ierr, msglen, np
5557 CALL mp_timeset(routinen, handle)
5559 #if defined(__parallel)
5560 CALL mpi_alltoall(sb, count, mpi_integer, &
5561 rb, count, mpi_integer, comm%handle, ierr)
5562 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5563 CALL mpi_comm_size(comm%handle, np, ierr)
5564 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5566 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5570 rb = reshape(sb, shape(rb))
5572 CALL mp_timestop(handle)
5574 END SUBROUTINE mp_alltoall_i54
5585 SUBROUTINE mp_send_i (msg, dest, tag, comm)
5586 INTEGER(KIND=int_4),
INTENT(IN) :: msg
5587 INTEGER,
INTENT(IN) :: dest, tag
5588 CLASS(mp_comm_type),
INTENT(IN) :: comm
5590 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_i'
5593 #if defined(__parallel)
5594 INTEGER :: ierr, msglen
5597 CALL mp_timeset(routinen, handle)
5599 #if defined(__parallel)
5601 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5602 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5603 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5610 cpabort(
"not in parallel mode")
5612 CALL mp_timestop(handle)
5613 END SUBROUTINE mp_send_i
5623 SUBROUTINE mp_send_iv(msg, dest, tag, comm)
5624 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
5625 INTEGER,
INTENT(IN) :: dest, tag
5626 CLASS(mp_comm_type),
INTENT(IN) :: comm
5628 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_iv'
5631 #if defined(__parallel)
5632 INTEGER :: ierr, msglen
5635 CALL mp_timeset(routinen, handle)
5637 #if defined(__parallel)
5639 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5640 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5641 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5648 cpabort(
"not in parallel mode")
5650 CALL mp_timestop(handle)
5651 END SUBROUTINE mp_send_iv
5661 SUBROUTINE mp_send_im2(msg, dest, tag, comm)
5662 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
5663 INTEGER,
INTENT(IN) :: dest, tag
5664 CLASS(mp_comm_type),
INTENT(IN) :: comm
5666 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_im2'
5669 #if defined(__parallel)
5670 INTEGER :: ierr, msglen
5673 CALL mp_timeset(routinen, handle)
5675 #if defined(__parallel)
5677 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5678 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5679 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5686 cpabort(
"not in parallel mode")
5688 CALL mp_timestop(handle)
5689 END SUBROUTINE mp_send_im2
5699 SUBROUTINE mp_send_im3(msg, dest, tag, comm)
5700 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
5701 INTEGER,
INTENT(IN) :: dest, tag
5702 CLASS(mp_comm_type),
INTENT(IN) :: comm
5704 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
5707 #if defined(__parallel)
5708 INTEGER :: ierr, msglen
5711 CALL mp_timeset(routinen, handle)
5713 #if defined(__parallel)
5715 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5716 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5717 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5724 cpabort(
"not in parallel mode")
5726 CALL mp_timestop(handle)
5727 END SUBROUTINE mp_send_im3
5738 SUBROUTINE mp_recv_i (msg, source, tag, comm)
5739 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5740 INTEGER,
INTENT(INOUT) :: source, tag
5741 CLASS(mp_comm_type),
INTENT(IN) :: comm
5743 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_i'
5746 #if defined(__parallel)
5747 INTEGER :: ierr, msglen
5748 mpi_status_type :: status
5751 CALL mp_timeset(routinen, handle)
5753 #if defined(__parallel)
5756 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5757 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5759 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5760 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5761 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5762 source = status mpi_status_extract(mpi_source)
5763 tag = status mpi_status_extract(mpi_tag)
5771 cpabort(
"not in parallel mode")
5773 CALL mp_timestop(handle)
5774 END SUBROUTINE mp_recv_i
5784 SUBROUTINE mp_recv_iv(msg, source, tag, comm)
5785 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5786 INTEGER,
INTENT(INOUT) :: source, tag
5787 CLASS(mp_comm_type),
INTENT(IN) :: comm
5789 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_iv'
5792 #if defined(__parallel)
5793 INTEGER :: ierr, msglen
5794 mpi_status_type :: status
5797 CALL mp_timeset(routinen, handle)
5799 #if defined(__parallel)
5802 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5803 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5805 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5806 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5807 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5808 source = status mpi_status_extract(mpi_source)
5809 tag = status mpi_status_extract(mpi_tag)
5817 cpabort(
"not in parallel mode")
5819 CALL mp_timestop(handle)
5820 END SUBROUTINE mp_recv_iv
5830 SUBROUTINE mp_recv_im2(msg, source, tag, comm)
5831 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
5832 INTEGER,
INTENT(INOUT) :: source, tag
5833 CLASS(mp_comm_type),
INTENT(IN) :: comm
5835 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_im2'
5838 #if defined(__parallel)
5839 INTEGER :: ierr, msglen
5840 mpi_status_type :: status
5843 CALL mp_timeset(routinen, handle)
5845 #if defined(__parallel)
5848 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5849 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5851 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5852 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5853 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5854 source = status mpi_status_extract(mpi_source)
5855 tag = status mpi_status_extract(mpi_tag)
5863 cpabort(
"not in parallel mode")
5865 CALL mp_timestop(handle)
5866 END SUBROUTINE mp_recv_im2
5876 SUBROUTINE mp_recv_im3(msg, source, tag, comm)
5877 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
5878 INTEGER,
INTENT(INOUT) :: source, tag
5879 CLASS(mp_comm_type),
INTENT(IN) :: comm
5881 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_im3'
5884 #if defined(__parallel)
5885 INTEGER :: ierr, msglen
5886 mpi_status_type :: status
5889 CALL mp_timeset(routinen, handle)
5891 #if defined(__parallel)
5894 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5895 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5897 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5898 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5899 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5900 source = status mpi_status_extract(mpi_source)
5901 tag = status mpi_status_extract(mpi_tag)
5909 cpabort(
"not in parallel mode")
5911 CALL mp_timestop(handle)
5912 END SUBROUTINE mp_recv_im3
5922 SUBROUTINE mp_bcast_i (msg, source, comm)
5923 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5924 INTEGER,
INTENT(IN) :: source
5925 CLASS(mp_comm_type),
INTENT(IN) :: comm
5927 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i'
5930 #if defined(__parallel)
5931 INTEGER :: ierr, msglen
5934 CALL mp_timeset(routinen, handle)
5936 #if defined(__parallel)
5938 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
5939 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5940 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5946 CALL mp_timestop(handle)
5947 END SUBROUTINE mp_bcast_i
5956 SUBROUTINE mp_bcast_i_src(msg, comm)
5957 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5958 CLASS(mp_comm_type),
INTENT(IN) :: comm
5960 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i_src'
5963 #if defined(__parallel)
5964 INTEGER :: ierr, msglen
5967 CALL mp_timeset(routinen, handle)
5969 #if defined(__parallel)
5971 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
5972 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5973 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5978 CALL mp_timestop(handle)
5979 END SUBROUTINE mp_bcast_i_src
5989 SUBROUTINE mp_ibcast_i (msg, source, comm, request)
5990 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5991 INTEGER,
INTENT(IN) :: source
5992 CLASS(mp_comm_type),
INTENT(IN) :: comm
5993 TYPE(mp_request_type),
INTENT(OUT) :: request
5995 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_i'
5998 #if defined(__parallel)
5999 INTEGER :: ierr, msglen
6002 CALL mp_timeset(routinen, handle)
6004 #if defined(__parallel)
6006 CALL mpi_ibcast(msg, msglen, mpi_integer, source, comm%handle, request%handle, ierr)
6007 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
6008 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_4_size)
6015 CALL mp_timestop(handle)
6016 END SUBROUTINE mp_ibcast_i
6025 SUBROUTINE mp_bcast_iv(msg, source, comm)
6026 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6027 INTEGER,
INTENT(IN) :: source
6028 CLASS(mp_comm_type),
INTENT(IN) :: comm
6030 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_iv'
6033 #if defined(__parallel)
6034 INTEGER :: ierr, msglen
6037 CALL mp_timeset(routinen, handle)
6039 #if defined(__parallel)
6041 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
6042 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6043 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6049 CALL mp_timestop(handle)
6050 END SUBROUTINE mp_bcast_iv
6058 SUBROUTINE mp_bcast_iv_src(msg, comm)
6059 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6060 CLASS(mp_comm_type),
INTENT(IN) :: comm
6062 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_iv_src'
6065 #if defined(__parallel)
6066 INTEGER :: ierr, msglen
6069 CALL mp_timeset(routinen, handle)
6071 #if defined(__parallel)
6073 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
6074 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6075 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6080 CALL mp_timestop(handle)
6081 END SUBROUTINE mp_bcast_iv_src
6090 SUBROUTINE mp_ibcast_iv(msg, source, comm, request)
6091 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6092 INTEGER,
INTENT(IN) :: source
6093 CLASS(mp_comm_type),
INTENT(IN) :: comm
6094 TYPE(mp_request_type) :: request
6096 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_iv'
6099 #if defined(__parallel)
6100 INTEGER :: ierr, msglen
6103 CALL mp_timeset(routinen, handle)
6105 #if defined(__parallel)
6106 #if !defined(__GNUC__) || __GNUC__ >= 9
6107 cpassert(is_contiguous(msg))
6110 CALL mpi_ibcast(msg, msglen, mpi_integer, source, comm%handle, request%handle, ierr)
6111 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
6112 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_4_size)
6119 CALL mp_timestop(handle)
6120 END SUBROUTINE mp_ibcast_iv
6129 SUBROUTINE mp_bcast_im(msg, source, comm)
6130 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6131 INTEGER,
INTENT(IN) :: source
6132 CLASS(mp_comm_type),
INTENT(IN) :: comm
6134 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_im'
6137 #if defined(__parallel)
6138 INTEGER :: ierr, msglen
6141 CALL mp_timeset(routinen, handle)
6143 #if defined(__parallel)
6145 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
6146 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6147 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6153 CALL mp_timestop(handle)
6154 END SUBROUTINE mp_bcast_im
6163 SUBROUTINE mp_bcast_im_src(msg, comm)
6164 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6165 CLASS(mp_comm_type),
INTENT(IN) :: comm
6167 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_im_src'
6170 #if defined(__parallel)
6171 INTEGER :: ierr, msglen
6174 CALL mp_timeset(routinen, handle)
6176 #if defined(__parallel)
6178 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
6179 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6180 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6185 CALL mp_timestop(handle)
6186 END SUBROUTINE mp_bcast_im_src
6195 SUBROUTINE mp_bcast_i3(msg, source, comm)
6196 INTEGER(KIND=int_4),
CONTIGUOUS :: msg(:, :, :)
6197 INTEGER,
INTENT(IN) :: source
6198 CLASS(mp_comm_type),
INTENT(IN) :: comm
6200 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i3'
6203 #if defined(__parallel)
6204 INTEGER :: ierr, msglen
6207 CALL mp_timeset(routinen, handle)
6209 #if defined(__parallel)
6211 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
6212 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6213 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6219 CALL mp_timestop(handle)
6220 END SUBROUTINE mp_bcast_i3
6229 SUBROUTINE mp_bcast_i3_src(msg, comm)
6230 INTEGER(KIND=int_4),
CONTIGUOUS :: msg(:, :, :)
6231 CLASS(mp_comm_type),
INTENT(IN) :: comm
6233 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i3_src'
6236 #if defined(__parallel)
6237 INTEGER :: ierr, msglen
6240 CALL mp_timeset(routinen, handle)
6242 #if defined(__parallel)
6244 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
6245 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6246 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6251 CALL mp_timestop(handle)
6252 END SUBROUTINE mp_bcast_i3_src
6261 SUBROUTINE mp_sum_i (msg, comm)
6262 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6263 CLASS(mp_comm_type),
INTENT(IN) :: comm
6265 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_i'
6268 #if defined(__parallel)
6269 INTEGER :: ierr, msglen
6272 CALL mp_timeset(routinen, handle)
6274 #if defined(__parallel)
6276 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6277 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6278 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6283 CALL mp_timestop(handle)
6284 END SUBROUTINE mp_sum_i
6292 SUBROUTINE mp_sum_iv(msg, comm)
6293 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6294 CLASS(mp_comm_type),
INTENT(IN) :: comm
6296 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_iv'
6299 #if defined(__parallel)
6300 INTEGER :: ierr, msglen
6303 CALL mp_timeset(routinen, handle)
6305 #if defined(__parallel)
6307 IF (msglen > 0)
THEN
6308 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6309 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6311 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6316 CALL mp_timestop(handle)
6317 END SUBROUTINE mp_sum_iv
6325 SUBROUTINE mp_isum_iv(msg, comm, request)
6326 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6327 CLASS(mp_comm_type),
INTENT(IN) :: comm
6328 TYPE(mp_request_type),
INTENT(OUT) :: request
6330 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_iv'
6333 #if defined(__parallel)
6334 INTEGER :: ierr, msglen
6337 CALL mp_timeset(routinen, handle)
6339 #if defined(__parallel)
6340 #if !defined(__GNUC__) || __GNUC__ >= 9
6341 cpassert(is_contiguous(msg))
6344 IF (msglen > 0)
THEN
6345 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, request%handle, ierr)
6346 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
6350 CALL add_perf(perf_id=23, count=1, msg_size=msglen*int_4_size)
6356 CALL mp_timestop(handle)
6357 END SUBROUTINE mp_isum_iv
6365 SUBROUTINE mp_sum_im(msg, comm)
6366 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6367 CLASS(mp_comm_type),
INTENT(IN) :: comm
6369 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im'
6372 #if defined(__parallel)
6373 INTEGER,
PARAMETER :: max_msg = 2**25
6374 INTEGER :: ierr, m1, msglen, step, msglensum
6377 CALL mp_timeset(routinen, handle)
6379 #if defined(__parallel)
6381 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
6383 DO m1 = lbound(msg, 2), ubound(msg, 2), step
6384 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
6385 msglensum = msglensum + msglen
6386 IF (msglen > 0)
THEN
6387 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6388 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6391 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_4_size)
6396 CALL mp_timestop(handle)
6397 END SUBROUTINE mp_sum_im
6405 SUBROUTINE mp_sum_im3(msg, comm)
6406 INTEGER(KIND=int_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
6407 CLASS(mp_comm_type),
INTENT(IN) :: comm
6409 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im3'
6412 #if defined(__parallel)
6413 INTEGER :: ierr, msglen
6416 CALL mp_timeset(routinen, handle)
6418 #if defined(__parallel)
6420 IF (msglen > 0)
THEN
6421 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6422 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6424 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6429 CALL mp_timestop(handle)
6430 END SUBROUTINE mp_sum_im3
6438 SUBROUTINE mp_sum_im4(msg, comm)
6439 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
6440 CLASS(mp_comm_type),
INTENT(IN) :: comm
6442 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im4'
6445 #if defined(__parallel)
6446 INTEGER :: ierr, msglen
6449 CALL mp_timeset(routinen, handle)
6451 #if defined(__parallel)
6453 IF (msglen > 0)
THEN
6454 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6455 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6457 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6462 CALL mp_timestop(handle)
6463 END SUBROUTINE mp_sum_im4
6475 SUBROUTINE mp_sum_root_iv(msg, root, comm)
6476 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6477 INTEGER,
INTENT(IN) :: root
6478 CLASS(mp_comm_type),
INTENT(IN) :: comm
6480 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_iv'
6483 #if defined(__parallel)
6484 INTEGER :: ierr, m1, msglen, taskid
6485 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
6488 CALL mp_timeset(routinen, handle)
6490 #if defined(__parallel)
6492 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6493 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6494 IF (msglen > 0)
THEN
6497 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_sum, &
6498 root, comm%handle, ierr)
6499 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6500 IF (taskid == root)
THEN
6505 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6511 CALL mp_timestop(handle)
6512 END SUBROUTINE mp_sum_root_iv
6523 SUBROUTINE mp_sum_root_im(msg, root, comm)
6524 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6525 INTEGER,
INTENT(IN) :: root
6526 CLASS(mp_comm_type),
INTENT(IN) :: comm
6528 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
6531 #if defined(__parallel)
6532 INTEGER :: ierr, m1, m2, msglen, taskid
6533 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:, :)
6536 CALL mp_timeset(routinen, handle)
6538 #if defined(__parallel)
6540 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6541 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6542 IF (msglen > 0)
THEN
6545 ALLOCATE (res(m1, m2))
6546 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_sum, root, comm%handle, ierr)
6547 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6548 IF (taskid == root)
THEN
6553 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6559 CALL mp_timestop(handle)
6560 END SUBROUTINE mp_sum_root_im
6568 SUBROUTINE mp_sum_partial_im(msg, res, comm)
6569 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
6570 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
6571 CLASS(mp_comm_type),
INTENT(IN) :: comm
6573 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_im'
6576 #if defined(__parallel)
6577 INTEGER :: ierr, msglen, taskid
6580 CALL mp_timeset(routinen, handle)
6582 #if defined(__parallel)
6584 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6585 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6586 IF (msglen > 0)
THEN
6587 CALL mpi_scan(msg, res, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6588 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
6590 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6596 CALL mp_timestop(handle)
6597 END SUBROUTINE mp_sum_partial_im
6607 SUBROUTINE mp_max_i (msg, comm)
6608 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6609 CLASS(mp_comm_type),
INTENT(IN) :: comm
6611 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_i'
6614 #if defined(__parallel)
6615 INTEGER :: ierr, msglen
6618 CALL mp_timeset(routinen, handle)
6620 #if defined(__parallel)
6622 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_max, comm%handle, ierr)
6623 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6624 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6629 CALL mp_timestop(handle)
6630 END SUBROUTINE mp_max_i
6640 SUBROUTINE mp_max_root_i (msg, root, comm)
6641 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6642 INTEGER,
INTENT(IN) :: root
6643 CLASS(mp_comm_type),
INTENT(IN) :: comm
6645 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_i'
6648 #if defined(__parallel)
6649 INTEGER :: ierr, msglen
6650 INTEGER(KIND=int_4) :: res
6653 CALL mp_timeset(routinen, handle)
6655 #if defined(__parallel)
6657 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_max, root, comm%handle, ierr)
6658 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6659 IF (root == comm%mepos) msg = res
6660 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6666 CALL mp_timestop(handle)
6667 END SUBROUTINE mp_max_root_i
6677 SUBROUTINE mp_max_iv(msg, comm)
6678 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6679 CLASS(mp_comm_type),
INTENT(IN) :: comm
6681 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_iv'
6684 #if defined(__parallel)
6685 INTEGER :: ierr, msglen
6688 CALL mp_timeset(routinen, handle)
6690 #if defined(__parallel)
6692 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_max, comm%handle, ierr)
6693 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6694 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6699 CALL mp_timestop(handle)
6700 END SUBROUTINE mp_max_iv
6710 SUBROUTINE mp_max_root_im(msg, root, comm)
6711 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6713 CLASS(mp_comm_type),
INTENT(IN) :: comm
6715 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_im'
6718 #if defined(__parallel)
6719 INTEGER :: ierr, msglen
6720 INTEGER(KIND=int_4) :: res(size(msg, 1), size(msg, 2))
6723 CALL mp_timeset(routinen, handle)
6725 #if defined(__parallel)
6727 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_max, root, comm%handle, ierr)
6728 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6729 IF (root == comm%mepos) msg = res
6730 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6736 CALL mp_timestop(handle)
6737 END SUBROUTINE mp_max_root_im
6747 SUBROUTINE mp_min_i (msg, comm)
6748 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6749 CLASS(mp_comm_type),
INTENT(IN) :: comm
6751 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_i'
6754 #if defined(__parallel)
6755 INTEGER :: ierr, msglen
6758 CALL mp_timeset(routinen, handle)
6760 #if defined(__parallel)
6762 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_min, comm%handle, ierr)
6763 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6764 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6769 CALL mp_timestop(handle)
6770 END SUBROUTINE mp_min_i
6782 SUBROUTINE mp_min_iv(msg, comm)
6783 INTEGER(KIND=int_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
6784 CLASS(mp_comm_type),
INTENT(IN) :: comm
6786 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_iv'
6789 #if defined(__parallel)
6790 INTEGER :: ierr, msglen
6793 CALL mp_timeset(routinen, handle)
6795 #if defined(__parallel)
6797 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_min, comm%handle, ierr)
6798 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6799 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6804 CALL mp_timestop(handle)
6805 END SUBROUTINE mp_min_iv
6815 SUBROUTINE mp_prod_i (msg, comm)
6816 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6817 CLASS(mp_comm_type),
INTENT(IN) :: comm
6819 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_i'
6822 #if defined(__parallel)
6823 INTEGER :: ierr, msglen
6826 CALL mp_timeset(routinen, handle)
6828 #if defined(__parallel)
6830 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_prod, comm%handle, ierr)
6831 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6832 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6837 CALL mp_timestop(handle)
6838 END SUBROUTINE mp_prod_i
6849 SUBROUTINE mp_scatter_iv(msg_scatter, msg, root, comm)
6850 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
6851 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
6852 INTEGER,
INTENT(IN) :: root
6853 CLASS(mp_comm_type),
INTENT(IN) :: comm
6855 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_iv'
6858 #if defined(__parallel)
6859 INTEGER :: ierr, msglen
6862 CALL mp_timeset(routinen, handle)
6864 #if defined(__parallel)
6866 CALL mpi_scatter(msg_scatter, msglen, mpi_integer, msg, &
6867 msglen, mpi_integer, root, comm%handle, ierr)
6868 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
6869 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
6875 CALL mp_timestop(handle)
6876 END SUBROUTINE mp_scatter_iv
6886 SUBROUTINE mp_iscatter_i (msg_scatter, msg, root, comm, request)
6887 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:)
6888 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6889 INTEGER,
INTENT(IN) :: root
6890 CLASS(mp_comm_type),
INTENT(IN) :: comm
6891 TYPE(mp_request_type),
INTENT(OUT) :: request
6893 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_i'
6896 #if defined(__parallel)
6897 INTEGER :: ierr, msglen
6900 CALL mp_timeset(routinen, handle)
6902 #if defined(__parallel)
6903 #if !defined(__GNUC__) || __GNUC__ >= 9
6904 cpassert(is_contiguous(msg_scatter))
6907 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer, msg, &
6908 msglen, mpi_integer, root, comm%handle, request%handle, ierr)
6909 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
6910 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6914 msg = msg_scatter(1)
6917 CALL mp_timestop(handle)
6918 END SUBROUTINE mp_iscatter_i
6928 SUBROUTINE mp_iscatter_iv2(msg_scatter, msg, root, comm, request)
6929 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:, :)
6930 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6931 INTEGER,
INTENT(IN) :: root
6932 CLASS(mp_comm_type),
INTENT(IN) :: comm
6933 TYPE(mp_request_type),
INTENT(OUT) :: request
6935 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_iv2'
6938 #if defined(__parallel)
6939 INTEGER :: ierr, msglen
6942 CALL mp_timeset(routinen, handle)
6944 #if defined(__parallel)
6945 #if !defined(__GNUC__) || __GNUC__ >= 9
6946 cpassert(is_contiguous(msg_scatter))
6949 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer, msg, &
6950 msglen, mpi_integer, root, comm%handle, request%handle, ierr)
6951 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
6952 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6956 msg(:) = msg_scatter(:, 1)
6959 CALL mp_timestop(handle)
6960 END SUBROUTINE mp_iscatter_iv2
6970 SUBROUTINE mp_iscatterv_iv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
6971 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:)
6972 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
6973 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6974 INTEGER,
INTENT(IN) :: recvcount, root
6975 CLASS(mp_comm_type),
INTENT(IN) :: comm
6976 TYPE(mp_request_type),
INTENT(OUT) :: request
6978 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_iv'
6981 #if defined(__parallel)
6985 CALL mp_timeset(routinen, handle)
6987 #if defined(__parallel)
6988 #if !defined(__GNUC__) || __GNUC__ >= 9
6989 cpassert(is_contiguous(msg_scatter))
6990 cpassert(is_contiguous(msg))
6991 cpassert(is_contiguous(sendcounts))
6992 cpassert(is_contiguous(displs))
6994 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_integer, msg, &
6995 recvcount, mpi_integer, root, comm%handle, request%handle, ierr)
6996 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
6997 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6999 mark_used(sendcounts)
7001 mark_used(recvcount)
7004 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
7007 CALL mp_timestop(handle)
7008 END SUBROUTINE mp_iscatterv_iv
7019 SUBROUTINE mp_gather_i (msg, msg_gather, root, comm)
7020 INTEGER(KIND=int_4),
INTENT(IN) :: msg
7021 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
7022 INTEGER,
INTENT(IN) :: root
7023 CLASS(mp_comm_type),
INTENT(IN) :: comm
7025 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_i'
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, root, 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)
7045 CALL mp_timestop(handle)
7046 END SUBROUTINE mp_gather_i
7056 SUBROUTINE mp_gather_i_src(msg, msg_gather, comm)
7057 INTEGER(KIND=int_4),
INTENT(IN) :: msg
7058 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
7059 CLASS(mp_comm_type),
INTENT(IN) :: comm
7061 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_i_src'
7064 #if defined(__parallel)
7065 INTEGER :: ierr, msglen
7068 CALL mp_timeset(routinen, handle)
7070 #if defined(__parallel)
7072 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7073 msglen, mpi_integer, comm%source, comm%handle, ierr)
7074 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7075 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7080 CALL mp_timestop(handle)
7081 END SUBROUTINE mp_gather_i_src
7095 SUBROUTINE mp_gather_iv(msg, msg_gather, root, comm)
7096 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
7097 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
7098 INTEGER,
INTENT(IN) :: root
7099 CLASS(mp_comm_type),
INTENT(IN) :: comm
7101 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_iv'
7104 #if defined(__parallel)
7105 INTEGER :: ierr, msglen
7108 CALL mp_timeset(routinen, handle)
7110 #if defined(__parallel)
7112 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7113 msglen, mpi_integer, root, comm%handle, ierr)
7114 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7115 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7121 CALL mp_timestop(handle)
7122 END SUBROUTINE mp_gather_iv
7135 SUBROUTINE mp_gather_iv_src(msg, msg_gather, comm)
7136 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
7137 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
7138 CLASS(mp_comm_type),
INTENT(IN) :: comm
7140 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_iv_src'
7143 #if defined(__parallel)
7144 INTEGER :: ierr, msglen
7147 CALL mp_timeset(routinen, handle)
7149 #if defined(__parallel)
7151 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7152 msglen, mpi_integer, comm%source, comm%handle, ierr)
7153 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7154 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7159 CALL mp_timestop(handle)
7160 END SUBROUTINE mp_gather_iv_src
7174 SUBROUTINE mp_gather_im(msg, msg_gather, root, comm)
7175 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
7176 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
7177 INTEGER,
INTENT(IN) :: root
7178 CLASS(mp_comm_type),
INTENT(IN) :: comm
7180 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_im'
7183 #if defined(__parallel)
7184 INTEGER :: ierr, msglen
7187 CALL mp_timeset(routinen, handle)
7189 #if defined(__parallel)
7191 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7192 msglen, mpi_integer, root, comm%handle, ierr)
7193 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7194 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7200 CALL mp_timestop(handle)
7201 END SUBROUTINE mp_gather_im
7214 SUBROUTINE mp_gather_im_src(msg, msg_gather, comm)
7215 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
7216 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
7217 CLASS(mp_comm_type),
INTENT(IN) :: comm
7219 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_im_src'
7222 #if defined(__parallel)
7223 INTEGER :: ierr, msglen
7226 CALL mp_timeset(routinen, handle)
7228 #if defined(__parallel)
7230 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7231 msglen, mpi_integer, comm%source, comm%handle, ierr)
7232 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7233 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7238 CALL mp_timestop(handle)
7239 END SUBROUTINE mp_gather_im_src
7256 SUBROUTINE mp_gatherv_iv(sendbuf, recvbuf, recvcounts, displs, root, comm)
7258 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7259 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7260 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7261 INTEGER,
INTENT(IN) :: root
7262 CLASS(mp_comm_type),
INTENT(IN) :: comm
7264 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_iv'
7267 #if defined(__parallel)
7268 INTEGER :: ierr, sendcount
7271 CALL mp_timeset(routinen, handle)
7273 #if defined(__parallel)
7274 sendcount =
SIZE(sendbuf)
7275 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7276 recvbuf, recvcounts, displs, mpi_integer, &
7277 root, comm%handle, ierr)
7278 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7279 CALL add_perf(perf_id=4, &
7281 msg_size=sendcount*int_4_size)
7283 mark_used(recvcounts)
7286 recvbuf(1 + displs(1):) = sendbuf
7288 CALL mp_timestop(handle)
7289 END SUBROUTINE mp_gatherv_iv
7305 SUBROUTINE mp_gatherv_iv_src(sendbuf, recvbuf, recvcounts, displs, comm)
7307 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7308 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7309 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7310 CLASS(mp_comm_type),
INTENT(IN) :: comm
7312 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_iv_src'
7315 #if defined(__parallel)
7316 INTEGER :: ierr, sendcount
7319 CALL mp_timeset(routinen, handle)
7321 #if defined(__parallel)
7322 sendcount =
SIZE(sendbuf)
7323 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7324 recvbuf, recvcounts, displs, mpi_integer, &
7325 comm%source, comm%handle, ierr)
7326 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7327 CALL add_perf(perf_id=4, &
7329 msg_size=sendcount*int_4_size)
7331 mark_used(recvcounts)
7333 recvbuf(1 + displs(1):) = sendbuf
7335 CALL mp_timestop(handle)
7336 END SUBROUTINE mp_gatherv_iv_src
7353 SUBROUTINE mp_gatherv_im2(sendbuf, recvbuf, recvcounts, displs, root, comm)
7355 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7356 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7357 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7358 INTEGER,
INTENT(IN) :: root
7359 CLASS(mp_comm_type),
INTENT(IN) :: comm
7361 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_im2'
7364 #if defined(__parallel)
7365 INTEGER :: ierr, sendcount
7368 CALL mp_timeset(routinen, handle)
7370 #if defined(__parallel)
7371 sendcount =
SIZE(sendbuf)
7372 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7373 recvbuf, recvcounts, displs, mpi_integer, &
7374 root, comm%handle, ierr)
7375 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7376 CALL add_perf(perf_id=4, &
7378 msg_size=sendcount*int_4_size)
7380 mark_used(recvcounts)
7383 recvbuf(:, 1 + displs(1):) = sendbuf
7385 CALL mp_timestop(handle)
7386 END SUBROUTINE mp_gatherv_im2
7402 SUBROUTINE mp_gatherv_im2_src(sendbuf, recvbuf, recvcounts, displs, comm)
7404 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7405 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7406 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7407 CLASS(mp_comm_type),
INTENT(IN) :: comm
7409 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_im2_src'
7412 #if defined(__parallel)
7413 INTEGER :: ierr, sendcount
7416 CALL mp_timeset(routinen, handle)
7418 #if defined(__parallel)
7419 sendcount =
SIZE(sendbuf)
7420 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7421 recvbuf, recvcounts, displs, mpi_integer, &
7422 comm%source, comm%handle, ierr)
7423 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7424 CALL add_perf(perf_id=4, &
7426 msg_size=sendcount*int_4_size)
7428 mark_used(recvcounts)
7430 recvbuf(:, 1 + displs(1):) = sendbuf
7432 CALL mp_timestop(handle)
7433 END SUBROUTINE mp_gatherv_im2_src
7450 SUBROUTINE mp_igatherv_iv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
7451 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
7452 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
7453 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7454 INTEGER,
INTENT(IN) :: sendcount, root
7455 CLASS(mp_comm_type),
INTENT(IN) :: comm
7456 TYPE(mp_request_type),
INTENT(OUT) :: request
7458 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_iv'
7461 #if defined(__parallel)
7465 CALL mp_timeset(routinen, handle)
7467 #if defined(__parallel)
7468 #if !defined(__GNUC__) || __GNUC__ >= 9
7469 cpassert(is_contiguous(sendbuf))
7470 cpassert(is_contiguous(recvbuf))
7471 cpassert(is_contiguous(recvcounts))
7472 cpassert(is_contiguous(displs))
7474 CALL mpi_igatherv(sendbuf, sendcount, mpi_integer, &
7475 recvbuf, recvcounts, displs, mpi_integer, &
7476 root, comm%handle, request%handle, ierr)
7477 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7478 CALL add_perf(perf_id=24, &
7480 msg_size=sendcount*int_4_size)
7482 mark_used(sendcount)
7483 mark_used(recvcounts)
7486 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
7489 CALL mp_timestop(handle)
7490 END SUBROUTINE mp_igatherv_iv
7503 SUBROUTINE mp_allgather_i (msgout, msgin, comm)
7504 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7505 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
7506 CLASS(mp_comm_type),
INTENT(IN) :: comm
7508 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i'
7511 #if defined(__parallel)
7512 INTEGER :: ierr, rcount, scount
7515 CALL mp_timeset(routinen, handle)
7517 #if defined(__parallel)
7520 CALL mpi_allgather(msgout, scount, mpi_integer, &
7521 msgin, rcount, mpi_integer, &
7523 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7528 CALL mp_timestop(handle)
7529 END SUBROUTINE mp_allgather_i
7542 SUBROUTINE mp_allgather_i2(msgout, msgin, comm)
7543 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7544 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7545 CLASS(mp_comm_type),
INTENT(IN) :: comm
7547 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i2'
7550 #if defined(__parallel)
7551 INTEGER :: ierr, rcount, scount
7554 CALL mp_timeset(routinen, handle)
7556 #if defined(__parallel)
7559 CALL mpi_allgather(msgout, scount, mpi_integer, &
7560 msgin, rcount, mpi_integer, &
7562 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7567 CALL mp_timestop(handle)
7568 END SUBROUTINE mp_allgather_i2
7581 SUBROUTINE mp_iallgather_i (msgout, msgin, comm, request)
7582 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7583 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
7584 CLASS(mp_comm_type),
INTENT(IN) :: comm
7585 TYPE(mp_request_type),
INTENT(OUT) :: request
7587 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i'
7590 #if defined(__parallel)
7591 INTEGER :: ierr, rcount, scount
7594 CALL mp_timeset(routinen, handle)
7596 #if defined(__parallel)
7597 #if !defined(__GNUC__) || __GNUC__ >= 9
7598 cpassert(is_contiguous(msgin))
7602 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7603 msgin, rcount, mpi_integer, &
7604 comm%handle, request%handle, ierr)
7605 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7611 CALL mp_timestop(handle)
7612 END SUBROUTINE mp_iallgather_i
7627 SUBROUTINE mp_allgather_i12(msgout, msgin, comm)
7628 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
7629 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7630 CLASS(mp_comm_type),
INTENT(IN) :: comm
7632 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i12'
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_i12
7663 SUBROUTINE mp_allgather_i23(msgout, msgin, comm)
7664 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
7665 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
7666 CLASS(mp_comm_type),
INTENT(IN) :: comm
7668 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i23'
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_i23
7699 SUBROUTINE mp_allgather_i34(msgout, msgin, comm)
7700 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
7701 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
7702 CLASS(mp_comm_type),
INTENT(IN) :: comm
7704 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i34'
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(:, :, :, 1) = msgout(:, :, :)
7724 CALL mp_timestop(handle)
7725 END SUBROUTINE mp_allgather_i34
7735 SUBROUTINE mp_allgather_i22(msgout, msgin, comm)
7736 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
7737 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7738 CLASS(mp_comm_type),
INTENT(IN) :: comm
7740 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i22'
7743 #if defined(__parallel)
7744 INTEGER :: ierr, rcount, scount
7747 CALL mp_timeset(routinen, handle)
7749 #if defined(__parallel)
7750 scount =
SIZE(msgout(:, :))
7752 CALL mpi_allgather(msgout, scount, mpi_integer, &
7753 msgin, rcount, mpi_integer, &
7755 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7758 msgin(:, :) = msgout(:, :)
7760 CALL mp_timestop(handle)
7761 END SUBROUTINE mp_allgather_i22
7772 SUBROUTINE mp_iallgather_i11(msgout, msgin, comm, request)
7773 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
7774 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
7775 CLASS(mp_comm_type),
INTENT(IN) :: comm
7776 TYPE(mp_request_type),
INTENT(OUT) :: request
7778 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i11'
7781 #if defined(__parallel)
7782 INTEGER :: ierr, rcount, scount
7785 CALL mp_timeset(routinen, handle)
7787 #if defined(__parallel)
7788 #if !defined(__GNUC__) || __GNUC__ >= 9
7789 cpassert(is_contiguous(msgout))
7790 cpassert(is_contiguous(msgin))
7792 scount =
SIZE(msgout(:))
7794 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7795 msgin, rcount, mpi_integer, &
7796 comm%handle, request%handle, ierr)
7797 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7803 CALL mp_timestop(handle)
7804 END SUBROUTINE mp_iallgather_i11
7815 SUBROUTINE mp_iallgather_i13(msgout, msgin, comm, request)
7816 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
7817 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :)
7818 CLASS(mp_comm_type),
INTENT(IN) :: comm
7819 TYPE(mp_request_type),
INTENT(OUT) :: request
7821 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i13'
7824 #if defined(__parallel)
7825 INTEGER :: ierr, rcount, scount
7828 CALL mp_timeset(routinen, handle)
7830 #if defined(__parallel)
7831 #if !defined(__GNUC__) || __GNUC__ >= 9
7832 cpassert(is_contiguous(msgout))
7833 cpassert(is_contiguous(msgin))
7836 scount =
SIZE(msgout(:))
7838 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7839 msgin, rcount, mpi_integer, &
7840 comm%handle, request%handle, ierr)
7841 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7844 msgin(:, 1, 1) = msgout(:)
7847 CALL mp_timestop(handle)
7848 END SUBROUTINE mp_iallgather_i13
7859 SUBROUTINE mp_iallgather_i22(msgout, msgin, comm, request)
7860 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :)
7861 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :)
7862 CLASS(mp_comm_type),
INTENT(IN) :: comm
7863 TYPE(mp_request_type),
INTENT(OUT) :: request
7865 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i22'
7868 #if defined(__parallel)
7869 INTEGER :: ierr, rcount, scount
7872 CALL mp_timeset(routinen, handle)
7874 #if defined(__parallel)
7875 #if !defined(__GNUC__) || __GNUC__ >= 9
7876 cpassert(is_contiguous(msgout))
7877 cpassert(is_contiguous(msgin))
7880 scount =
SIZE(msgout(:, :))
7882 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7883 msgin, rcount, mpi_integer, &
7884 comm%handle, request%handle, ierr)
7885 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7888 msgin(:, :) = msgout(:, :)
7891 CALL mp_timestop(handle)
7892 END SUBROUTINE mp_iallgather_i22
7903 SUBROUTINE mp_iallgather_i24(msgout, msgin, comm, request)
7904 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :)
7905 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :, :)
7906 CLASS(mp_comm_type),
INTENT(IN) :: comm
7907 TYPE(mp_request_type),
INTENT(OUT) :: request
7909 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i24'
7912 #if defined(__parallel)
7913 INTEGER :: ierr, rcount, scount
7916 CALL mp_timeset(routinen, handle)
7918 #if defined(__parallel)
7919 #if !defined(__GNUC__) || __GNUC__ >= 9
7920 cpassert(is_contiguous(msgout))
7921 cpassert(is_contiguous(msgin))
7924 scount =
SIZE(msgout(:, :))
7926 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7927 msgin, rcount, mpi_integer, &
7928 comm%handle, request%handle, ierr)
7929 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7932 msgin(:, :, 1, 1) = msgout(:, :)
7935 CALL mp_timestop(handle)
7936 END SUBROUTINE mp_iallgather_i24
7947 SUBROUTINE mp_iallgather_i33(msgout, msgin, comm, request)
7948 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :, :)
7949 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :)
7950 CLASS(mp_comm_type),
INTENT(IN) :: comm
7951 TYPE(mp_request_type),
INTENT(OUT) :: request
7953 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i33'
7956 #if defined(__parallel)
7957 INTEGER :: ierr, rcount, scount
7960 CALL mp_timeset(routinen, handle)
7962 #if defined(__parallel)
7963 #if !defined(__GNUC__) || __GNUC__ >= 9
7964 cpassert(is_contiguous(msgout))
7965 cpassert(is_contiguous(msgin))
7968 scount =
SIZE(msgout(:, :, :))
7970 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7971 msgin, rcount, mpi_integer, &
7972 comm%handle, request%handle, ierr)
7973 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7976 msgin(:, :, :) = msgout(:, :, :)
7979 CALL mp_timestop(handle)
7980 END SUBROUTINE mp_iallgather_i33
7999 SUBROUTINE mp_allgatherv_iv(msgout, msgin, rcount, rdispl, comm)
8000 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
8001 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
8002 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
8003 CLASS(mp_comm_type),
INTENT(IN) :: comm
8005 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_iv'
8008 #if defined(__parallel)
8009 INTEGER :: ierr, scount
8012 CALL mp_timeset(routinen, handle)
8014 #if defined(__parallel)
8015 scount =
SIZE(msgout)
8016 CALL mpi_allgatherv(msgout, scount, mpi_integer, msgin, rcount, &
8017 rdispl, mpi_integer, comm%handle, ierr)
8018 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
8025 CALL mp_timestop(handle)
8026 END SUBROUTINE mp_allgatherv_iv
8045 SUBROUTINE mp_allgatherv_im2(msgout, msgin, rcount, rdispl, comm)
8046 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
8047 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
8048 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
8049 CLASS(mp_comm_type),
INTENT(IN) :: comm
8051 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_iv'
8054 #if defined(__parallel)
8055 INTEGER :: ierr, scount
8058 CALL mp_timeset(routinen, handle)
8060 #if defined(__parallel)
8061 scount =
SIZE(msgout)
8062 CALL mpi_allgatherv(msgout, scount, mpi_integer, msgin, rcount, &
8063 rdispl, mpi_integer, comm%handle, ierr)
8064 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
8071 CALL mp_timestop(handle)
8072 END SUBROUTINE mp_allgatherv_im2
8091 SUBROUTINE mp_iallgatherv_iv(msgout, msgin, rcount, rdispl, comm, request)
8092 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
8093 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
8094 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
8095 CLASS(mp_comm_type),
INTENT(IN) :: comm
8096 TYPE(mp_request_type),
INTENT(OUT) :: request
8098 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_iv'
8101 #if defined(__parallel)
8102 INTEGER :: ierr, scount, rsize
8105 CALL mp_timeset(routinen, handle)
8107 #if defined(__parallel)
8108 #if !defined(__GNUC__) || __GNUC__ >= 9
8109 cpassert(is_contiguous(msgout))
8110 cpassert(is_contiguous(msgin))
8111 cpassert(is_contiguous(rcount))
8112 cpassert(is_contiguous(rdispl))
8115 scount =
SIZE(msgout)
8116 rsize =
SIZE(rcount)
8117 CALL mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, &
8118 rdispl, comm, request, ierr)
8119 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
8127 CALL mp_timestop(handle)
8128 END SUBROUTINE mp_iallgatherv_iv
8147 SUBROUTINE mp_iallgatherv_iv2(msgout, msgin, rcount, rdispl, comm, request)
8148 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
8149 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
8150 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
8151 CLASS(mp_comm_type),
INTENT(IN) :: comm
8152 TYPE(mp_request_type),
INTENT(OUT) :: request
8154 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_iv2'
8157 #if defined(__parallel)
8158 INTEGER :: ierr, scount, rsize
8161 CALL mp_timeset(routinen, handle)
8163 #if defined(__parallel)
8164 #if !defined(__GNUC__) || __GNUC__ >= 9
8165 cpassert(is_contiguous(msgout))
8166 cpassert(is_contiguous(msgin))
8167 cpassert(is_contiguous(rcount))
8168 cpassert(is_contiguous(rdispl))
8171 scount =
SIZE(msgout)
8172 rsize =
SIZE(rcount)
8173 CALL mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, &
8174 rdispl, comm, request, ierr)
8175 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
8183 CALL mp_timestop(handle)
8184 END SUBROUTINE mp_iallgatherv_iv2
8195 #if defined(__parallel)
8196 SUBROUTINE mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
8197 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
8198 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
8199 INTEGER,
INTENT(IN) :: rsize
8200 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
8201 CLASS(mp_comm_type),
INTENT(IN) :: comm
8202 TYPE(mp_request_type),
INTENT(OUT) :: request
8203 INTEGER,
INTENT(INOUT) :: ierr
8205 CALL mpi_iallgatherv(msgout, scount, mpi_integer, msgin, rcount, &
8206 rdispl, mpi_integer, comm%handle, request%handle, ierr)
8208 END SUBROUTINE mp_iallgatherv_iv_internal
8219 SUBROUTINE mp_sum_scatter_iv(msgout, msgin, rcount, comm)
8220 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
8221 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
8222 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
8223 CLASS(mp_comm_type),
INTENT(IN) :: comm
8225 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_iv'
8228 #if defined(__parallel)
8232 CALL mp_timeset(routinen, handle)
8234 #if defined(__parallel)
8235 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_integer, mpi_sum, &
8237 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
8239 CALL add_perf(perf_id=3, count=1, &
8240 msg_size=rcount(1)*2*int_4_size)
8244 msgin = msgout(:, 1)
8246 CALL mp_timestop(handle)
8247 END SUBROUTINE mp_sum_scatter_iv
8258 SUBROUTINE mp_sendrecv_i (msgin, dest, msgout, source, comm, tag)
8259 INTEGER(KIND=int_4),
INTENT(IN) :: msgin
8260 INTEGER,
INTENT(IN) :: dest
8261 INTEGER(KIND=int_4),
INTENT(OUT) :: msgout
8262 INTEGER,
INTENT(IN) :: source
8263 CLASS(mp_comm_type),
INTENT(IN) :: comm
8264 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8266 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_i'
8269 #if defined(__parallel)
8270 INTEGER :: ierr, msglen_in, msglen_out, &
8274 CALL mp_timeset(routinen, handle)
8276 #if defined(__parallel)
8281 IF (
PRESENT(tag))
THEN
8285 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8286 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8287 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8288 CALL add_perf(perf_id=7, count=1, &
8289 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8297 CALL mp_timestop(handle)
8298 END SUBROUTINE mp_sendrecv_i
8309 SUBROUTINE mp_sendrecv_iv(msgin, dest, msgout, source, comm, tag)
8310 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
8311 INTEGER,
INTENT(IN) :: dest
8312 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
8313 INTEGER,
INTENT(IN) :: source
8314 CLASS(mp_comm_type),
INTENT(IN) :: comm
8315 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8317 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_iv'
8320 #if defined(__parallel)
8321 INTEGER :: ierr, msglen_in, msglen_out, &
8325 CALL mp_timeset(routinen, handle)
8327 #if defined(__parallel)
8328 msglen_in =
SIZE(msgin)
8329 msglen_out =
SIZE(msgout)
8332 IF (
PRESENT(tag))
THEN
8336 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8337 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8338 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8339 CALL add_perf(perf_id=7, count=1, &
8340 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8348 CALL mp_timestop(handle)
8349 END SUBROUTINE mp_sendrecv_iv
8361 SUBROUTINE mp_sendrecv_im2(msgin, dest, msgout, source, comm, tag)
8362 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
8363 INTEGER,
INTENT(IN) :: dest
8364 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
8365 INTEGER,
INTENT(IN) :: source
8366 CLASS(mp_comm_type),
INTENT(IN) :: comm
8367 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8369 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im2'
8372 #if defined(__parallel)
8373 INTEGER :: ierr, msglen_in, msglen_out, &
8377 CALL mp_timeset(routinen, handle)
8379 #if defined(__parallel)
8380 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
8381 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
8384 IF (
PRESENT(tag))
THEN
8388 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8389 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8390 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8391 CALL add_perf(perf_id=7, count=1, &
8392 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8400 CALL mp_timestop(handle)
8401 END SUBROUTINE mp_sendrecv_im2
8412 SUBROUTINE mp_sendrecv_im3(msgin, dest, msgout, source, comm, tag)
8413 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
8414 INTEGER,
INTENT(IN) :: dest
8415 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
8416 INTEGER,
INTENT(IN) :: source
8417 CLASS(mp_comm_type),
INTENT(IN) :: comm
8418 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8420 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im3'
8423 #if defined(__parallel)
8424 INTEGER :: ierr, msglen_in, msglen_out, &
8428 CALL mp_timeset(routinen, handle)
8430 #if defined(__parallel)
8431 msglen_in =
SIZE(msgin)
8432 msglen_out =
SIZE(msgout)
8435 IF (
PRESENT(tag))
THEN
8439 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8440 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8441 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8442 CALL add_perf(perf_id=7, count=1, &
8443 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8451 CALL mp_timestop(handle)
8452 END SUBROUTINE mp_sendrecv_im3
8463 SUBROUTINE mp_sendrecv_im4(msgin, dest, msgout, source, comm, tag)
8464 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
8465 INTEGER,
INTENT(IN) :: dest
8466 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
8467 INTEGER,
INTENT(IN) :: source
8468 CLASS(mp_comm_type),
INTENT(IN) :: comm
8469 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8471 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im4'
8474 #if defined(__parallel)
8475 INTEGER :: ierr, msglen_in, msglen_out, &
8479 CALL mp_timeset(routinen, handle)
8481 #if defined(__parallel)
8482 msglen_in =
SIZE(msgin)
8483 msglen_out =
SIZE(msgout)
8486 IF (
PRESENT(tag))
THEN
8490 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8491 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8492 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8493 CALL add_perf(perf_id=7, count=1, &
8494 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8502 CALL mp_timestop(handle)
8503 END SUBROUTINE mp_sendrecv_im4
8520 SUBROUTINE mp_isendrecv_i (msgin, dest, msgout, source, comm, send_request, &
8522 INTEGER(KIND=int_4),
INTENT(IN) :: msgin
8523 INTEGER,
INTENT(IN) :: dest
8524 INTEGER(KIND=int_4),
INTENT(INOUT) :: msgout
8525 INTEGER,
INTENT(IN) :: source
8526 CLASS(mp_comm_type),
INTENT(IN) :: comm
8527 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
8528 INTEGER,
INTENT(in),
OPTIONAL :: tag
8530 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_i'
8533 #if defined(__parallel)
8534 INTEGER :: ierr, my_tag
8537 CALL mp_timeset(routinen, handle)
8539 #if defined(__parallel)
8541 IF (
PRESENT(tag)) my_tag = tag
8543 CALL mpi_irecv(msgout, 1, mpi_integer, source, my_tag, &
8544 comm%handle, recv_request%handle, ierr)
8545 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8547 CALL mpi_isend(msgin, 1, mpi_integer, dest, my_tag, &
8548 comm%handle, send_request%handle, ierr)
8549 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8551 CALL add_perf(perf_id=8, count=1, msg_size=2*int_4_size)
8561 CALL mp_timestop(handle)
8562 END SUBROUTINE mp_isendrecv_i
8581 SUBROUTINE mp_isendrecv_iv(msgin, dest, msgout, source, comm, send_request, &
8583 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: msgin
8584 INTEGER,
INTENT(IN) :: dest
8585 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
8586 INTEGER,
INTENT(IN) :: source
8587 CLASS(mp_comm_type),
INTENT(IN) :: comm
8588 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
8589 INTEGER,
INTENT(in),
OPTIONAL :: tag
8591 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_iv'
8594 #if defined(__parallel)
8595 INTEGER :: ierr, msglen, my_tag
8596 INTEGER(KIND=int_4) :: foo
8599 CALL mp_timeset(routinen, handle)
8601 #if defined(__parallel)
8602 #if !defined(__GNUC__) || __GNUC__ >= 9
8603 cpassert(is_contiguous(msgout))
8604 cpassert(is_contiguous(msgin))
8608 IF (
PRESENT(tag)) my_tag = tag
8610 msglen =
SIZE(msgout, 1)
8611 IF (msglen > 0)
THEN
8612 CALL mpi_irecv(msgout(1), msglen, mpi_integer, source, my_tag, &
8613 comm%handle, recv_request%handle, ierr)
8615 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8616 comm%handle, recv_request%handle, ierr)
8618 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8620 msglen =
SIZE(msgin, 1)
8621 IF (msglen > 0)
THEN
8622 CALL mpi_isend(msgin(1), msglen, mpi_integer, dest, my_tag, &
8623 comm%handle, send_request%handle, ierr)
8625 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8626 comm%handle, send_request%handle, ierr)
8628 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8630 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
8631 CALL add_perf(perf_id=8, count=1, msg_size=msglen*int_4_size)
8641 CALL mp_timestop(handle)
8642 END SUBROUTINE mp_isendrecv_iv
8657 SUBROUTINE mp_isend_iv(msgin, dest, comm, request, tag)
8658 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: msgin
8659 INTEGER,
INTENT(IN) :: dest
8660 CLASS(mp_comm_type),
INTENT(IN) :: comm
8661 TYPE(mp_request_type),
INTENT(out) :: request
8662 INTEGER,
INTENT(in),
OPTIONAL :: tag
8664 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_iv'
8666 INTEGER :: handle, ierr
8667 #if defined(__parallel)
8668 INTEGER :: msglen, my_tag
8669 INTEGER(KIND=int_4) :: foo(1)
8672 CALL mp_timeset(routinen, handle)
8674 #if defined(__parallel)
8675 #if !defined(__GNUC__) || __GNUC__ >= 9
8676 cpassert(is_contiguous(msgin))
8679 IF (
PRESENT(tag)) my_tag = tag
8681 msglen =
SIZE(msgin)
8682 IF (msglen > 0)
THEN
8683 CALL mpi_isend(msgin(1), msglen, mpi_integer, dest, my_tag, &
8684 comm%handle, request%handle, ierr)
8686 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8687 comm%handle, request%handle, ierr)
8689 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8691 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8700 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8702 CALL mp_timestop(handle)
8703 END SUBROUTINE mp_isend_iv
8720 SUBROUTINE mp_isend_im2(msgin, dest, comm, request, tag)
8721 INTEGER(KIND=int_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
8722 INTEGER,
INTENT(IN) :: dest
8723 CLASS(mp_comm_type),
INTENT(IN) :: comm
8724 TYPE(mp_request_type),
INTENT(out) :: request
8725 INTEGER,
INTENT(in),
OPTIONAL :: tag
8727 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im2'
8729 INTEGER :: handle, ierr
8730 #if defined(__parallel)
8731 INTEGER :: msglen, my_tag
8732 INTEGER(KIND=int_4) :: foo(1)
8735 CALL mp_timeset(routinen, handle)
8737 #if defined(__parallel)
8738 #if !defined(__GNUC__) || __GNUC__ >= 9
8739 cpassert(is_contiguous(msgin))
8743 IF (
PRESENT(tag)) my_tag = tag
8745 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
8746 IF (msglen > 0)
THEN
8747 CALL mpi_isend(msgin(1, 1), msglen, mpi_integer, dest, my_tag, &
8748 comm%handle, request%handle, ierr)
8750 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8751 comm%handle, request%handle, ierr)
8753 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8755 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8764 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8766 CALL mp_timestop(handle)
8767 END SUBROUTINE mp_isend_im2
8786 SUBROUTINE mp_isend_im3(msgin, dest, comm, request, tag)
8787 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
8788 INTEGER,
INTENT(IN) :: dest
8789 CLASS(mp_comm_type),
INTENT(IN) :: comm
8790 TYPE(mp_request_type),
INTENT(out) :: request
8791 INTEGER,
INTENT(in),
OPTIONAL :: tag
8793 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im3'
8795 INTEGER :: handle, ierr
8796 #if defined(__parallel)
8797 INTEGER :: msglen, my_tag
8798 INTEGER(KIND=int_4) :: foo(1)
8801 CALL mp_timeset(routinen, handle)
8803 #if defined(__parallel)
8804 #if !defined(__GNUC__) || __GNUC__ >= 9
8805 cpassert(is_contiguous(msgin))
8809 IF (
PRESENT(tag)) my_tag = tag
8811 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
8812 IF (msglen > 0)
THEN
8813 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_integer, dest, my_tag, &
8814 comm%handle, request%handle, ierr)
8816 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8817 comm%handle, request%handle, ierr)
8819 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8821 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8830 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8832 CALL mp_timestop(handle)
8833 END SUBROUTINE mp_isend_im3
8849 SUBROUTINE mp_isend_im4(msgin, dest, comm, request, tag)
8850 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
8851 INTEGER,
INTENT(IN) :: dest
8852 CLASS(mp_comm_type),
INTENT(IN) :: comm
8853 TYPE(mp_request_type),
INTENT(out) :: request
8854 INTEGER,
INTENT(in),
OPTIONAL :: tag
8856 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im4'
8858 INTEGER :: handle, ierr
8859 #if defined(__parallel)
8860 INTEGER :: msglen, my_tag
8861 INTEGER(KIND=int_4) :: foo(1)
8864 CALL mp_timeset(routinen, handle)
8866 #if defined(__parallel)
8867 #if !defined(__GNUC__) || __GNUC__ >= 9
8868 cpassert(is_contiguous(msgin))
8872 IF (
PRESENT(tag)) my_tag = tag
8874 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
8875 IF (msglen > 0)
THEN
8876 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_integer, dest, my_tag, &
8877 comm%handle, request%handle, ierr)
8879 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8880 comm%handle, request%handle, ierr)
8882 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8884 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8893 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8895 CALL mp_timestop(handle)
8896 END SUBROUTINE mp_isend_im4
8912 SUBROUTINE mp_irecv_iv(msgout, source, comm, request, tag)
8913 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
8914 INTEGER,
INTENT(IN) :: source
8915 CLASS(mp_comm_type),
INTENT(IN) :: comm
8916 TYPE(mp_request_type),
INTENT(out) :: request
8917 INTEGER,
INTENT(in),
OPTIONAL :: tag
8919 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_iv'
8922 #if defined(__parallel)
8923 INTEGER :: ierr, msglen, my_tag
8924 INTEGER(KIND=int_4) :: foo(1)
8927 CALL mp_timeset(routinen, handle)
8929 #if defined(__parallel)
8930 #if !defined(__GNUC__) || __GNUC__ >= 9
8931 cpassert(is_contiguous(msgout))
8935 IF (
PRESENT(tag)) my_tag = tag
8937 msglen =
SIZE(msgout)
8938 IF (msglen > 0)
THEN
8939 CALL mpi_irecv(msgout(1), msglen, mpi_integer, source, my_tag, &
8940 comm%handle, request%handle, ierr)
8942 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8943 comm%handle, request%handle, ierr)
8945 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8947 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
8949 cpabort(
"mp_irecv called in non parallel case")
8956 CALL mp_timestop(handle)
8957 END SUBROUTINE mp_irecv_iv
8974 SUBROUTINE mp_irecv_im2(msgout, source, comm, request, tag)
8975 INTEGER(KIND=int_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
8976 INTEGER,
INTENT(IN) :: source
8977 CLASS(mp_comm_type),
INTENT(IN) :: comm
8978 TYPE(mp_request_type),
INTENT(out) :: request
8979 INTEGER,
INTENT(in),
OPTIONAL :: tag
8981 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im2'
8984 #if defined(__parallel)
8985 INTEGER :: ierr, msglen, my_tag
8986 INTEGER(KIND=int_4) :: foo(1)
8989 CALL mp_timeset(routinen, handle)
8991 #if defined(__parallel)
8992 #if !defined(__GNUC__) || __GNUC__ >= 9
8993 cpassert(is_contiguous(msgout))
8997 IF (
PRESENT(tag)) my_tag = tag
8999 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
9000 IF (msglen > 0)
THEN
9001 CALL mpi_irecv(msgout(1, 1), msglen, mpi_integer, source, my_tag, &
9002 comm%handle, request%handle, ierr)
9004 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
9005 comm%handle, request%handle, ierr)
9007 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
9009 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
9016 cpabort(
"mp_irecv called in non parallel case")
9018 CALL mp_timestop(handle)
9019 END SUBROUTINE mp_irecv_im2
9037 SUBROUTINE mp_irecv_im3(msgout, source, comm, request, tag)
9038 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
9039 INTEGER,
INTENT(IN) :: source
9040 CLASS(mp_comm_type),
INTENT(IN) :: comm
9041 TYPE(mp_request_type),
INTENT(out) :: request
9042 INTEGER,
INTENT(in),
OPTIONAL :: tag
9044 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im3'
9047 #if defined(__parallel)
9048 INTEGER :: ierr, msglen, my_tag
9049 INTEGER(KIND=int_4) :: foo(1)
9052 CALL mp_timeset(routinen, handle)
9054 #if defined(__parallel)
9055 #if !defined(__GNUC__) || __GNUC__ >= 9
9056 cpassert(is_contiguous(msgout))
9060 IF (
PRESENT(tag)) my_tag = tag
9062 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
9063 IF (msglen > 0)
THEN
9064 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_integer, source, my_tag, &
9065 comm%handle, request%handle, ierr)
9067 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
9068 comm%handle, request%handle, ierr)
9070 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
9072 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
9079 cpabort(
"mp_irecv called in non parallel case")
9081 CALL mp_timestop(handle)
9082 END SUBROUTINE mp_irecv_im3
9098 SUBROUTINE mp_irecv_im4(msgout, source, comm, request, tag)
9099 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
9100 INTEGER,
INTENT(IN) :: source
9101 CLASS(mp_comm_type),
INTENT(IN) :: comm
9102 TYPE(mp_request_type),
INTENT(out) :: request
9103 INTEGER,
INTENT(in),
OPTIONAL :: tag
9105 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im4'
9108 #if defined(__parallel)
9109 INTEGER :: ierr, msglen, my_tag
9110 INTEGER(KIND=int_4) :: foo(1)
9113 CALL mp_timeset(routinen, handle)
9115 #if defined(__parallel)
9116 #if !defined(__GNUC__) || __GNUC__ >= 9
9117 cpassert(is_contiguous(msgout))
9121 IF (
PRESENT(tag)) my_tag = tag
9123 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
9124 IF (msglen > 0)
THEN
9125 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_integer, source, my_tag, &
9126 comm%handle, request%handle, ierr)
9128 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
9129 comm%handle, request%handle, ierr)
9131 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
9133 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
9140 cpabort(
"mp_irecv called in non parallel case")
9142 CALL mp_timestop(handle)
9143 END SUBROUTINE mp_irecv_im4
9155 SUBROUTINE mp_win_create_iv(base, comm, win)
9156 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
9157 TYPE(mp_comm_type),
INTENT(IN) :: comm
9158 CLASS(mp_win_type),
INTENT(INOUT) :: win
9160 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_iv'
9163 #if defined(__parallel)
9165 INTEGER(kind=mpi_address_kind) :: len
9166 INTEGER(KIND=int_4) :: foo(1)
9169 CALL mp_timeset(routinen, handle)
9171 #if defined(__parallel)
9173 len =
SIZE(base)*int_4_size
9175 CALL mpi_win_create(base(1), len, int_4_size, mpi_info_null, comm%handle, win%handle, ierr)
9177 CALL mpi_win_create(foo, len, int_4_size, mpi_info_null, comm%handle, win%handle, ierr)
9179 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
9181 CALL add_perf(perf_id=20, count=1)
9185 win%handle = mp_win_null_handle
9187 CALL mp_timestop(handle)
9188 END SUBROUTINE mp_win_create_iv
9200 SUBROUTINE mp_rget_iv(base, source, win, win_data, myproc, disp, request, &
9201 origin_datatype, target_datatype)
9202 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
9203 INTEGER,
INTENT(IN) :: source
9204 CLASS(mp_win_type),
INTENT(IN) :: win
9205 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: win_data
9206 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
9207 TYPE(mp_request_type),
INTENT(OUT) :: request
9208 TYPE(mp_type_descriptor_type),
INTENT(IN),
OPTIONAL :: origin_datatype, target_datatype
9210 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_iv'
9213 #if defined(__parallel)
9214 INTEGER :: ierr, len, &
9215 origin_len, target_len
9216 LOGICAL :: do_local_copy
9217 INTEGER(kind=mpi_address_kind) :: disp_aint
9218 mpi_data_type :: handle_origin_datatype, handle_target_datatype
9221 CALL mp_timeset(routinen, handle)
9223 #if defined(__parallel)
9226 IF (
PRESENT(disp))
THEN
9227 disp_aint = int(disp, kind=mpi_address_kind)
9229 handle_origin_datatype = mpi_integer
9231 IF (
PRESENT(origin_datatype))
THEN
9232 handle_origin_datatype = origin_datatype%type_handle
9235 handle_target_datatype = mpi_integer
9237 IF (
PRESENT(target_datatype))
THEN
9238 handle_target_datatype = target_datatype%type_handle
9242 do_local_copy = .false.
9243 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
9244 IF (myproc .EQ. source) do_local_copy = .true.
9246 IF (do_local_copy)
THEN
9248 base(:) = win_data(disp_aint + 1:disp_aint + len)
9253 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
9254 target_len, handle_target_datatype, win%handle, request%handle, ierr)
9260 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
9262 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*int_4_size)
9267 mark_used(origin_datatype)
9268 mark_used(target_datatype)
9272 IF (
PRESENT(disp))
THEN
9273 base(:) = win_data(disp + 1:disp +
SIZE(base))
9275 base(:) = win_data(:
SIZE(base))
9279 CALL mp_timestop(handle)
9280 END SUBROUTINE mp_rget_iv
9289 FUNCTION mp_type_indexed_make_i (count, lengths, displs) &
9290 result(type_descriptor)
9291 INTEGER,
INTENT(IN) :: count
9292 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
9293 TYPE(mp_type_descriptor_type) :: type_descriptor
9295 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_i'
9298 #if defined(__parallel)
9302 CALL mp_timeset(routinen, handle)
9304 #if defined(__parallel)
9305 CALL mpi_type_indexed(count, lengths, displs, mpi_integer, &
9306 type_descriptor%type_handle, ierr)
9308 cpabort(
"MPI_Type_Indexed @ "//routinen)
9309 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
9311 cpabort(
"MPI_Type_commit @ "//routinen)
9313 type_descriptor%type_handle = 17
9315 type_descriptor%length = count
9316 NULLIFY (type_descriptor%subtype)
9317 type_descriptor%vector_descriptor(1:2) = 1
9318 type_descriptor%has_indexing = .true.
9319 type_descriptor%index_descriptor%index => lengths
9320 type_descriptor%index_descriptor%chunks => displs
9322 CALL mp_timestop(handle)
9324 END FUNCTION mp_type_indexed_make_i
9333 SUBROUTINE mp_allocate_i (DATA, len, stat)
9334 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
9335 INTEGER,
INTENT(IN) :: len
9336 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9338 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allocate_i'
9340 INTEGER :: handle, ierr
9342 CALL mp_timeset(routinen, handle)
9344 #if defined(__parallel)
9346 CALL mp_alloc_mem(
DATA, len, stat=ierr)
9347 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
9348 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
9349 CALL add_perf(perf_id=15, count=1)
9351 ALLOCATE (
DATA(len), stat=ierr)
9352 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
9353 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
9355 IF (
PRESENT(stat)) stat = ierr
9356 CALL mp_timestop(handle)
9357 END SUBROUTINE mp_allocate_i
9365 SUBROUTINE mp_deallocate_i (DATA, stat)
9366 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
9367 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9369 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_deallocate_i'
9372 #if defined(__parallel)
9376 CALL mp_timeset(routinen, handle)
9378 #if defined(__parallel)
9379 CALL mp_free_mem(
DATA, ierr)
9380 IF (
PRESENT(stat))
THEN
9383 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
9386 CALL add_perf(perf_id=15, count=1)
9389 IF (
PRESENT(stat)) stat = 0
9391 CALL mp_timestop(handle)
9392 END SUBROUTINE mp_deallocate_i
9405 SUBROUTINE mp_file_write_at_iv(fh, offset, msg, msglen)
9406 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
9407 CLASS(mp_file_type),
INTENT(IN) :: fh
9408 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9409 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9412 #if defined(__parallel)
9417 IF (
PRESENT(msglen)) msg_len = msglen
9418 #if defined(__parallel)
9419 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9421 cpabort(
"mpi_file_write_at_iv @ mp_file_write_at_iv")
9423 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9425 END SUBROUTINE mp_file_write_at_iv
9433 SUBROUTINE mp_file_write_at_i (fh, offset, msg)
9434 INTEGER(KIND=int_4),
INTENT(IN) :: msg
9435 CLASS(mp_file_type),
INTENT(IN) :: fh
9436 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9438 #if defined(__parallel)
9442 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9444 cpabort(
"mpi_file_write_at_i @ mp_file_write_at_i")
9446 WRITE (unit=fh%handle, pos=offset + 1) msg
9448 END SUBROUTINE mp_file_write_at_i
9460 SUBROUTINE mp_file_write_at_all_iv(fh, offset, msg, msglen)
9461 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
9462 CLASS(mp_file_type),
INTENT(IN) :: fh
9463 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9464 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9467 #if defined(__parallel)
9472 IF (
PRESENT(msglen)) msg_len = msglen
9473 #if defined(__parallel)
9474 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9476 cpabort(
"mpi_file_write_at_all_iv @ mp_file_write_at_all_iv")
9478 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9480 END SUBROUTINE mp_file_write_at_all_iv
9488 SUBROUTINE mp_file_write_at_all_i (fh, offset, msg)
9489 INTEGER(KIND=int_4),
INTENT(IN) :: msg
9490 CLASS(mp_file_type),
INTENT(IN) :: fh
9491 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9493 #if defined(__parallel)
9497 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9499 cpabort(
"mpi_file_write_at_all_i @ mp_file_write_at_all_i")
9501 WRITE (unit=fh%handle, pos=offset + 1) msg
9503 END SUBROUTINE mp_file_write_at_all_i
9516 SUBROUTINE mp_file_read_at_iv(fh, offset, msg, msglen)
9517 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
9518 CLASS(mp_file_type),
INTENT(IN) :: fh
9519 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9520 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9523 #if defined(__parallel)
9528 IF (
PRESENT(msglen)) msg_len = msglen
9529 #if defined(__parallel)
9530 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9532 cpabort(
"mpi_file_read_at_iv @ mp_file_read_at_iv")
9534 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9536 END SUBROUTINE mp_file_read_at_iv
9544 SUBROUTINE mp_file_read_at_i (fh, offset, msg)
9545 INTEGER(KIND=int_4),
INTENT(OUT) :: msg
9546 CLASS(mp_file_type),
INTENT(IN) :: fh
9547 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9549 #if defined(__parallel)
9553 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9555 cpabort(
"mpi_file_read_at_i @ mp_file_read_at_i")
9557 READ (unit=fh%handle, pos=offset + 1) msg
9559 END SUBROUTINE mp_file_read_at_i
9571 SUBROUTINE mp_file_read_at_all_iv(fh, offset, msg, msglen)
9572 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
9573 CLASS(mp_file_type),
INTENT(IN) :: fh
9574 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9575 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9578 #if defined(__parallel)
9583 IF (
PRESENT(msglen)) msg_len = msglen
9584 #if defined(__parallel)
9585 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9587 cpabort(
"mpi_file_read_at_all_iv @ mp_file_read_at_all_iv")
9589 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9591 END SUBROUTINE mp_file_read_at_all_iv
9599 SUBROUTINE mp_file_read_at_all_i (fh, offset, msg)
9600 INTEGER(KIND=int_4),
INTENT(OUT) :: msg
9601 CLASS(mp_file_type),
INTENT(IN) :: fh
9602 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9604 #if defined(__parallel)
9608 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9610 cpabort(
"mpi_file_read_at_all_i @ mp_file_read_at_all_i")
9612 READ (unit=fh%handle, pos=offset + 1) msg
9614 END SUBROUTINE mp_file_read_at_all_i
9623 FUNCTION mp_type_make_i (ptr, &
9624 vector_descriptor, index_descriptor) &
9625 result(type_descriptor)
9626 INTEGER(KIND=int_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
9627 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
9628 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
9629 TYPE(mp_type_descriptor_type) :: type_descriptor
9631 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_i'
9633 #if defined(__parallel)
9637 NULLIFY (type_descriptor%subtype)
9638 type_descriptor%length =
SIZE(ptr)
9639 #if defined(__parallel)
9640 type_descriptor%type_handle = mpi_integer
9641 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
9643 cpabort(
"MPI_Get_address @ "//routinen)
9645 type_descriptor%type_handle = 17
9647 type_descriptor%vector_descriptor(1:2) = 1
9648 type_descriptor%has_indexing = .false.
9649 type_descriptor%data_i => ptr
9650 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
9651 cpabort(routinen//
": Vectors and indices NYI")
9653 END FUNCTION mp_type_make_i
9662 SUBROUTINE mp_alloc_mem_i (DATA, len, stat)
9663 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
9664 INTEGER,
INTENT(IN) :: len
9665 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9667 #if defined(__parallel)
9668 INTEGER :: size, ierr, length, &
9670 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
9671 TYPE(c_ptr) :: mp_baseptr
9672 mpi_info_type :: mp_info
9674 length = max(len, 1)
9675 CALL mpi_type_size(mpi_integer,
size, ierr)
9676 mp_size = int(length, kind=mpi_address_kind)*
size
9677 IF (mp_size .GT. mp_max_memory_size)
THEN
9678 cpabort(
"MPI cannot allocate more than 2 GiByte")
9680 mp_info = mpi_info_null
9681 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
9682 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
9683 IF (
PRESENT(stat)) stat = mp_res
9685 INTEGER :: length, mystat
9686 length = max(len, 1)
9687 IF (
PRESENT(stat))
THEN
9688 ALLOCATE (
DATA(length), stat=mystat)
9691 ALLOCATE (
DATA(length))
9694 END SUBROUTINE mp_alloc_mem_i
9702 SUBROUTINE mp_free_mem_i (DATA, stat)
9703 INTEGER(KIND=int_4),
DIMENSION(:), &
9704 POINTER, asynchronous :: data
9705 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9707 #if defined(__parallel)
9709 CALL mpi_free_mem(
DATA, mp_res)
9710 IF (
PRESENT(stat)) stat = mp_res
9713 IF (
PRESENT(stat)) stat = 0
9715 END SUBROUTINE mp_free_mem_i
9727 SUBROUTINE mp_shift_lm(msg, comm, displ_in)
9729 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
9730 CLASS(mp_comm_type),
INTENT(IN) :: comm
9731 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
9733 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_lm'
9735 INTEGER :: handle, ierror
9736 #if defined(__parallel)
9737 INTEGER :: displ, left, &
9738 msglen, myrank, nprocs, &
9743 CALL mp_timeset(routinen, handle)
9745 #if defined(__parallel)
9746 CALL mpi_comm_rank(comm%handle, myrank, ierror)
9747 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
9748 CALL mpi_comm_size(comm%handle, nprocs, ierror)
9749 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
9750 IF (
PRESENT(displ_in))
THEN
9755 right =
modulo(myrank + displ, nprocs)
9756 left =
modulo(myrank - displ, nprocs)
9759 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer8, right, tag, left, tag, &
9760 comm%handle, mpi_status_ignore, ierror)
9761 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
9762 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_8_size)
9768 CALL mp_timestop(handle)
9770 END SUBROUTINE mp_shift_lm
9783 SUBROUTINE mp_shift_l (msg, comm, displ_in)
9785 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
9786 CLASS(mp_comm_type),
INTENT(IN) :: comm
9787 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
9789 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_l'
9791 INTEGER :: handle, ierror
9792 #if defined(__parallel)
9793 INTEGER :: displ, left, &
9794 msglen, myrank, nprocs, &
9799 CALL mp_timeset(routinen, handle)
9801 #if defined(__parallel)
9802 CALL mpi_comm_rank(comm%handle, myrank, ierror)
9803 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
9804 CALL mpi_comm_size(comm%handle, nprocs, ierror)
9805 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
9806 IF (
PRESENT(displ_in))
THEN
9811 right =
modulo(myrank + displ, nprocs)
9812 left =
modulo(myrank - displ, nprocs)
9815 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer8, right, tag, left, &
9816 tag, comm%handle, mpi_status_ignore, ierror)
9817 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
9818 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_8_size)
9824 CALL mp_timestop(handle)
9826 END SUBROUTINE mp_shift_l
9847 SUBROUTINE mp_alltoall_l11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
9849 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
9850 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
9851 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
9852 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
9853 CLASS(mp_comm_type),
INTENT(IN) :: comm
9855 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l11v'
9858 #if defined(__parallel)
9859 INTEGER :: ierr, msglen
9864 CALL mp_timeset(routinen, handle)
9866 #if defined(__parallel)
9867 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer8, &
9868 rb, rcount, rdispl, mpi_integer8, comm%handle, ierr)
9869 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
9870 msglen = sum(scount) + sum(rcount)
9871 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9878 rb(rdispl(1) + i) = sb(sdispl(1) + i)
9881 CALL mp_timestop(handle)
9883 END SUBROUTINE mp_alltoall_l11v
9898 SUBROUTINE mp_alltoall_l22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
9900 INTEGER(KIND=int_8),
DIMENSION(:, :), &
9901 INTENT(IN),
CONTIGUOUS :: sb
9902 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
9903 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS, &
9905 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
9906 CLASS(mp_comm_type),
INTENT(IN) :: comm
9908 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l22v'
9911 #if defined(__parallel)
9912 INTEGER :: ierr, msglen
9915 CALL mp_timeset(routinen, handle)
9917 #if defined(__parallel)
9918 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer8, &
9919 rb, rcount, rdispl, mpi_integer8, comm%handle, ierr)
9920 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
9921 msglen = sum(scount) + sum(rcount)
9922 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*int_8_size)
9931 CALL mp_timestop(handle)
9933 END SUBROUTINE mp_alltoall_l22v
9950 SUBROUTINE mp_alltoall_l (sb, rb, count, comm)
9952 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
9953 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
9954 INTEGER,
INTENT(IN) :: count
9955 CLASS(mp_comm_type),
INTENT(IN) :: comm
9957 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l'
9960 #if defined(__parallel)
9961 INTEGER :: ierr, msglen, np
9964 CALL mp_timeset(routinen, handle)
9966 #if defined(__parallel)
9967 CALL mpi_alltoall(sb, count, mpi_integer8, &
9968 rb, count, mpi_integer8, comm%handle, ierr)
9969 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9970 CALL mpi_comm_size(comm%handle, np, ierr)
9971 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9973 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9979 CALL mp_timestop(handle)
9981 END SUBROUTINE mp_alltoall_l
9991 SUBROUTINE mp_alltoall_l22(sb, rb, count, comm)
9993 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
9994 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
9995 INTEGER,
INTENT(IN) :: count
9996 CLASS(mp_comm_type),
INTENT(IN) :: comm
9998 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l22'
10001 #if defined(__parallel)
10002 INTEGER :: ierr, msglen, np
10005 CALL mp_timeset(routinen, handle)
10007 #if defined(__parallel)
10008 CALL mpi_alltoall(sb, count, mpi_integer8, &
10009 rb, count, mpi_integer8, comm%handle, ierr)
10010 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10011 CALL mpi_comm_size(comm%handle, np, ierr)
10012 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10013 msglen = 2*
SIZE(sb)*np
10014 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10020 CALL mp_timestop(handle)
10022 END SUBROUTINE mp_alltoall_l22
10032 SUBROUTINE mp_alltoall_l33(sb, rb, count, comm)
10034 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
10035 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
10036 INTEGER,
INTENT(IN) :: count
10037 CLASS(mp_comm_type),
INTENT(IN) :: comm
10039 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l33'
10042 #if defined(__parallel)
10043 INTEGER :: ierr, msglen, np
10046 CALL mp_timeset(routinen, handle)
10048 #if defined(__parallel)
10049 CALL mpi_alltoall(sb, count, mpi_integer8, &
10050 rb, count, mpi_integer8, comm%handle, ierr)
10051 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10052 CALL mpi_comm_size(comm%handle, np, ierr)
10053 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10054 msglen = 2*count*np
10055 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10061 CALL mp_timestop(handle)
10063 END SUBROUTINE mp_alltoall_l33
10073 SUBROUTINE mp_alltoall_l44(sb, rb, count, comm)
10075 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10077 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10079 INTEGER,
INTENT(IN) :: count
10080 CLASS(mp_comm_type),
INTENT(IN) :: comm
10082 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l44'
10085 #if defined(__parallel)
10086 INTEGER :: ierr, msglen, np
10089 CALL mp_timeset(routinen, handle)
10091 #if defined(__parallel)
10092 CALL mpi_alltoall(sb, count, mpi_integer8, &
10093 rb, count, mpi_integer8, comm%handle, ierr)
10094 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10095 CALL mpi_comm_size(comm%handle, np, ierr)
10096 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10097 msglen = 2*count*np
10098 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10104 CALL mp_timestop(handle)
10106 END SUBROUTINE mp_alltoall_l44
10116 SUBROUTINE mp_alltoall_l55(sb, rb, count, comm)
10118 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
10120 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
10122 INTEGER,
INTENT(IN) :: count
10123 CLASS(mp_comm_type),
INTENT(IN) :: comm
10125 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l55'
10128 #if defined(__parallel)
10129 INTEGER :: ierr, msglen, np
10132 CALL mp_timeset(routinen, handle)
10134 #if defined(__parallel)
10135 CALL mpi_alltoall(sb, count, mpi_integer8, &
10136 rb, count, mpi_integer8, comm%handle, ierr)
10137 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10138 CALL mpi_comm_size(comm%handle, np, ierr)
10139 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10140 msglen = 2*count*np
10141 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10147 CALL mp_timestop(handle)
10149 END SUBROUTINE mp_alltoall_l55
10160 SUBROUTINE mp_alltoall_l45(sb, rb, count, comm)
10162 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10164 INTEGER(KIND=int_8), &
10165 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
10166 INTEGER,
INTENT(IN) :: count
10167 CLASS(mp_comm_type),
INTENT(IN) :: comm
10169 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l45'
10172 #if defined(__parallel)
10173 INTEGER :: ierr, msglen, np
10176 CALL mp_timeset(routinen, handle)
10178 #if defined(__parallel)
10179 CALL mpi_alltoall(sb, count, mpi_integer8, &
10180 rb, count, mpi_integer8, comm%handle, ierr)
10181 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10182 CALL mpi_comm_size(comm%handle, np, ierr)
10183 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10184 msglen = 2*count*np
10185 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10189 rb = reshape(sb, shape(rb))
10191 CALL mp_timestop(handle)
10193 END SUBROUTINE mp_alltoall_l45
10204 SUBROUTINE mp_alltoall_l34(sb, rb, count, comm)
10206 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
10208 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10210 INTEGER,
INTENT(IN) :: count
10211 CLASS(mp_comm_type),
INTENT(IN) :: comm
10213 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l34'
10216 #if defined(__parallel)
10217 INTEGER :: ierr, msglen, np
10220 CALL mp_timeset(routinen, handle)
10222 #if defined(__parallel)
10223 CALL mpi_alltoall(sb, count, mpi_integer8, &
10224 rb, count, mpi_integer8, comm%handle, ierr)
10225 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10226 CALL mpi_comm_size(comm%handle, np, ierr)
10227 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10228 msglen = 2*count*np
10229 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10233 rb = reshape(sb, shape(rb))
10235 CALL mp_timestop(handle)
10237 END SUBROUTINE mp_alltoall_l34
10248 SUBROUTINE mp_alltoall_l54(sb, rb, count, comm)
10250 INTEGER(KIND=int_8), &
10251 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
10252 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10254 INTEGER,
INTENT(IN) :: count
10255 CLASS(mp_comm_type),
INTENT(IN) :: comm
10257 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l54'
10260 #if defined(__parallel)
10261 INTEGER :: ierr, msglen, np
10264 CALL mp_timeset(routinen, handle)
10266 #if defined(__parallel)
10267 CALL mpi_alltoall(sb, count, mpi_integer8, &
10268 rb, count, mpi_integer8, comm%handle, ierr)
10269 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10270 CALL mpi_comm_size(comm%handle, np, ierr)
10271 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10272 msglen = 2*count*np
10273 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10277 rb = reshape(sb, shape(rb))
10279 CALL mp_timestop(handle)
10281 END SUBROUTINE mp_alltoall_l54
10292 SUBROUTINE mp_send_l (msg, dest, tag, comm)
10293 INTEGER(KIND=int_8),
INTENT(IN) :: msg
10294 INTEGER,
INTENT(IN) :: dest, tag
10295 CLASS(mp_comm_type),
INTENT(IN) :: comm
10297 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_l'
10300 #if defined(__parallel)
10301 INTEGER :: ierr, msglen
10304 CALL mp_timeset(routinen, handle)
10306 #if defined(__parallel)
10308 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10309 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10310 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10317 cpabort(
"not in parallel mode")
10319 CALL mp_timestop(handle)
10320 END SUBROUTINE mp_send_l
10330 SUBROUTINE mp_send_lv(msg, dest, tag, comm)
10331 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
10332 INTEGER,
INTENT(IN) :: dest, tag
10333 CLASS(mp_comm_type),
INTENT(IN) :: comm
10335 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_lv'
10338 #if defined(__parallel)
10339 INTEGER :: ierr, msglen
10342 CALL mp_timeset(routinen, handle)
10344 #if defined(__parallel)
10346 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10347 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10348 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10355 cpabort(
"not in parallel mode")
10357 CALL mp_timestop(handle)
10358 END SUBROUTINE mp_send_lv
10368 SUBROUTINE mp_send_lm2(msg, dest, tag, comm)
10369 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
10370 INTEGER,
INTENT(IN) :: dest, tag
10371 CLASS(mp_comm_type),
INTENT(IN) :: comm
10373 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_lm2'
10376 #if defined(__parallel)
10377 INTEGER :: ierr, msglen
10380 CALL mp_timeset(routinen, handle)
10382 #if defined(__parallel)
10384 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10385 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10386 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10393 cpabort(
"not in parallel mode")
10395 CALL mp_timestop(handle)
10396 END SUBROUTINE mp_send_lm2
10406 SUBROUTINE mp_send_lm3(msg, dest, tag, comm)
10407 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
10408 INTEGER,
INTENT(IN) :: dest, tag
10409 CLASS(mp_comm_type),
INTENT(IN) :: comm
10411 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
10414 #if defined(__parallel)
10415 INTEGER :: ierr, msglen
10418 CALL mp_timeset(routinen, handle)
10420 #if defined(__parallel)
10422 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10423 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10424 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10431 cpabort(
"not in parallel mode")
10433 CALL mp_timestop(handle)
10434 END SUBROUTINE mp_send_lm3
10445 SUBROUTINE mp_recv_l (msg, source, tag, comm)
10446 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10447 INTEGER,
INTENT(INOUT) :: source, tag
10448 CLASS(mp_comm_type),
INTENT(IN) :: comm
10450 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_l'
10453 #if defined(__parallel)
10454 INTEGER :: ierr, msglen
10455 mpi_status_type :: status
10458 CALL mp_timeset(routinen, handle)
10460 #if defined(__parallel)
10463 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10464 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10466 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10467 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10468 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10469 source = status mpi_status_extract(mpi_source)
10470 tag = status mpi_status_extract(mpi_tag)
10478 cpabort(
"not in parallel mode")
10480 CALL mp_timestop(handle)
10481 END SUBROUTINE mp_recv_l
10491 SUBROUTINE mp_recv_lv(msg, source, tag, comm)
10492 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10493 INTEGER,
INTENT(INOUT) :: source, tag
10494 CLASS(mp_comm_type),
INTENT(IN) :: comm
10496 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lv'
10499 #if defined(__parallel)
10500 INTEGER :: ierr, msglen
10501 mpi_status_type :: status
10504 CALL mp_timeset(routinen, handle)
10506 #if defined(__parallel)
10509 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10510 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10512 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10513 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10514 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10515 source = status mpi_status_extract(mpi_source)
10516 tag = status mpi_status_extract(mpi_tag)
10524 cpabort(
"not in parallel mode")
10526 CALL mp_timestop(handle)
10527 END SUBROUTINE mp_recv_lv
10537 SUBROUTINE mp_recv_lm2(msg, source, tag, comm)
10538 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10539 INTEGER,
INTENT(INOUT) :: source, tag
10540 CLASS(mp_comm_type),
INTENT(IN) :: comm
10542 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lm2'
10545 #if defined(__parallel)
10546 INTEGER :: ierr, msglen
10547 mpi_status_type :: status
10550 CALL mp_timeset(routinen, handle)
10552 #if defined(__parallel)
10555 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10556 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10558 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10559 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10560 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10561 source = status mpi_status_extract(mpi_source)
10562 tag = status mpi_status_extract(mpi_tag)
10570 cpabort(
"not in parallel mode")
10572 CALL mp_timestop(handle)
10573 END SUBROUTINE mp_recv_lm2
10583 SUBROUTINE mp_recv_lm3(msg, source, tag, comm)
10584 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
10585 INTEGER,
INTENT(INOUT) :: source, tag
10586 CLASS(mp_comm_type),
INTENT(IN) :: comm
10588 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lm3'
10591 #if defined(__parallel)
10592 INTEGER :: ierr, msglen
10593 mpi_status_type :: status
10596 CALL mp_timeset(routinen, handle)
10598 #if defined(__parallel)
10601 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10602 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10604 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10605 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10606 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10607 source = status mpi_status_extract(mpi_source)
10608 tag = status mpi_status_extract(mpi_tag)
10616 cpabort(
"not in parallel mode")
10618 CALL mp_timestop(handle)
10619 END SUBROUTINE mp_recv_lm3
10629 SUBROUTINE mp_bcast_l (msg, source, comm)
10630 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10631 INTEGER,
INTENT(IN) :: source
10632 CLASS(mp_comm_type),
INTENT(IN) :: comm
10634 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l'
10637 #if defined(__parallel)
10638 INTEGER :: ierr, msglen
10641 CALL mp_timeset(routinen, handle)
10643 #if defined(__parallel)
10645 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10646 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10647 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10653 CALL mp_timestop(handle)
10654 END SUBROUTINE mp_bcast_l
10663 SUBROUTINE mp_bcast_l_src(msg, comm)
10664 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10665 CLASS(mp_comm_type),
INTENT(IN) :: comm
10667 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l_src'
10670 #if defined(__parallel)
10671 INTEGER :: ierr, msglen
10674 CALL mp_timeset(routinen, handle)
10676 #if defined(__parallel)
10678 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10679 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10680 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10685 CALL mp_timestop(handle)
10686 END SUBROUTINE mp_bcast_l_src
10696 SUBROUTINE mp_ibcast_l (msg, source, comm, request)
10697 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10698 INTEGER,
INTENT(IN) :: source
10699 CLASS(mp_comm_type),
INTENT(IN) :: comm
10700 TYPE(mp_request_type),
INTENT(OUT) :: request
10702 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_l'
10705 #if defined(__parallel)
10706 INTEGER :: ierr, msglen
10709 CALL mp_timeset(routinen, handle)
10711 #if defined(__parallel)
10713 CALL mpi_ibcast(msg, msglen, mpi_integer8, source, comm%handle, request%handle, ierr)
10714 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
10715 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_8_size)
10722 CALL mp_timestop(handle)
10723 END SUBROUTINE mp_ibcast_l
10732 SUBROUTINE mp_bcast_lv(msg, source, comm)
10733 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10734 INTEGER,
INTENT(IN) :: source
10735 CLASS(mp_comm_type),
INTENT(IN) :: comm
10737 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lv'
10740 #if defined(__parallel)
10741 INTEGER :: ierr, msglen
10744 CALL mp_timeset(routinen, handle)
10746 #if defined(__parallel)
10748 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10749 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10750 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10756 CALL mp_timestop(handle)
10757 END SUBROUTINE mp_bcast_lv
10765 SUBROUTINE mp_bcast_lv_src(msg, comm)
10766 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10767 CLASS(mp_comm_type),
INTENT(IN) :: comm
10769 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lv_src'
10772 #if defined(__parallel)
10773 INTEGER :: ierr, msglen
10776 CALL mp_timeset(routinen, handle)
10778 #if defined(__parallel)
10780 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10781 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10782 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10787 CALL mp_timestop(handle)
10788 END SUBROUTINE mp_bcast_lv_src
10797 SUBROUTINE mp_ibcast_lv(msg, source, comm, request)
10798 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
10799 INTEGER,
INTENT(IN) :: source
10800 CLASS(mp_comm_type),
INTENT(IN) :: comm
10801 TYPE(mp_request_type) :: request
10803 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_lv'
10806 #if defined(__parallel)
10807 INTEGER :: ierr, msglen
10810 CALL mp_timeset(routinen, handle)
10812 #if defined(__parallel)
10813 #if !defined(__GNUC__) || __GNUC__ >= 9
10814 cpassert(is_contiguous(msg))
10817 CALL mpi_ibcast(msg, msglen, mpi_integer8, source, comm%handle, request%handle, ierr)
10818 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
10819 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_8_size)
10826 CALL mp_timestop(handle)
10827 END SUBROUTINE mp_ibcast_lv
10836 SUBROUTINE mp_bcast_lm(msg, source, comm)
10837 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10838 INTEGER,
INTENT(IN) :: source
10839 CLASS(mp_comm_type),
INTENT(IN) :: comm
10841 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lm'
10844 #if defined(__parallel)
10845 INTEGER :: ierr, msglen
10848 CALL mp_timeset(routinen, handle)
10850 #if defined(__parallel)
10852 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10853 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10854 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10860 CALL mp_timestop(handle)
10861 END SUBROUTINE mp_bcast_lm
10870 SUBROUTINE mp_bcast_lm_src(msg, comm)
10871 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10872 CLASS(mp_comm_type),
INTENT(IN) :: comm
10874 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lm_src'
10877 #if defined(__parallel)
10878 INTEGER :: ierr, msglen
10881 CALL mp_timeset(routinen, handle)
10883 #if defined(__parallel)
10885 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10886 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10887 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10892 CALL mp_timestop(handle)
10893 END SUBROUTINE mp_bcast_lm_src
10902 SUBROUTINE mp_bcast_l3(msg, source, comm)
10903 INTEGER(KIND=int_8),
CONTIGUOUS :: msg(:, :, :)
10904 INTEGER,
INTENT(IN) :: source
10905 CLASS(mp_comm_type),
INTENT(IN) :: comm
10907 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l3'
10910 #if defined(__parallel)
10911 INTEGER :: ierr, msglen
10914 CALL mp_timeset(routinen, handle)
10916 #if defined(__parallel)
10918 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10919 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10920 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10926 CALL mp_timestop(handle)
10927 END SUBROUTINE mp_bcast_l3
10936 SUBROUTINE mp_bcast_l3_src(msg, comm)
10937 INTEGER(KIND=int_8),
CONTIGUOUS :: msg(:, :, :)
10938 CLASS(mp_comm_type),
INTENT(IN) :: comm
10940 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l3_src'
10943 #if defined(__parallel)
10944 INTEGER :: ierr, msglen
10947 CALL mp_timeset(routinen, handle)
10949 #if defined(__parallel)
10951 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10952 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10953 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10958 CALL mp_timestop(handle)
10959 END SUBROUTINE mp_bcast_l3_src
10968 SUBROUTINE mp_sum_l (msg, comm)
10969 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10970 CLASS(mp_comm_type),
INTENT(IN) :: comm
10972 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_l'
10975 #if defined(__parallel)
10976 INTEGER :: ierr, msglen
10979 CALL mp_timeset(routinen, handle)
10981 #if defined(__parallel)
10983 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
10984 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
10985 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
10990 CALL mp_timestop(handle)
10991 END SUBROUTINE mp_sum_l
10999 SUBROUTINE mp_sum_lv(msg, comm)
11000 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
11001 CLASS(mp_comm_type),
INTENT(IN) :: comm
11003 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lv'
11006 #if defined(__parallel)
11007 INTEGER :: ierr, msglen
11010 CALL mp_timeset(routinen, handle)
11012 #if defined(__parallel)
11014 IF (msglen > 0)
THEN
11015 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11016 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11018 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11023 CALL mp_timestop(handle)
11024 END SUBROUTINE mp_sum_lv
11032 SUBROUTINE mp_isum_lv(msg, comm, request)
11033 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
11034 CLASS(mp_comm_type),
INTENT(IN) :: comm
11035 TYPE(mp_request_type),
INTENT(OUT) :: request
11037 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_lv'
11040 #if defined(__parallel)
11041 INTEGER :: ierr, msglen
11044 CALL mp_timeset(routinen, handle)
11046 #if defined(__parallel)
11047 #if !defined(__GNUC__) || __GNUC__ >= 9
11048 cpassert(is_contiguous(msg))
11051 IF (msglen > 0)
THEN
11052 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, request%handle, ierr)
11053 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
11057 CALL add_perf(perf_id=23, count=1, msg_size=msglen*int_8_size)
11063 CALL mp_timestop(handle)
11064 END SUBROUTINE mp_isum_lv
11072 SUBROUTINE mp_sum_lm(msg, comm)
11073 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11074 CLASS(mp_comm_type),
INTENT(IN) :: comm
11076 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm'
11079 #if defined(__parallel)
11080 INTEGER,
PARAMETER :: max_msg = 2**25
11081 INTEGER :: ierr, m1, msglen, step, msglensum
11084 CALL mp_timeset(routinen, handle)
11086 #if defined(__parallel)
11088 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
11090 DO m1 = lbound(msg, 2), ubound(msg, 2), step
11091 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
11092 msglensum = msglensum + msglen
11093 IF (msglen > 0)
THEN
11094 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11095 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11098 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_8_size)
11103 CALL mp_timestop(handle)
11104 END SUBROUTINE mp_sum_lm
11112 SUBROUTINE mp_sum_lm3(msg, comm)
11113 INTEGER(KIND=int_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
11114 CLASS(mp_comm_type),
INTENT(IN) :: comm
11116 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm3'
11119 #if defined(__parallel)
11120 INTEGER :: ierr, msglen
11123 CALL mp_timeset(routinen, handle)
11125 #if defined(__parallel)
11127 IF (msglen > 0)
THEN
11128 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11129 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11131 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11136 CALL mp_timestop(handle)
11137 END SUBROUTINE mp_sum_lm3
11145 SUBROUTINE mp_sum_lm4(msg, comm)
11146 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
11147 CLASS(mp_comm_type),
INTENT(IN) :: comm
11149 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm4'
11152 #if defined(__parallel)
11153 INTEGER :: ierr, msglen
11156 CALL mp_timeset(routinen, handle)
11158 #if defined(__parallel)
11160 IF (msglen > 0)
THEN
11161 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11162 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11164 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11169 CALL mp_timestop(handle)
11170 END SUBROUTINE mp_sum_lm4
11182 SUBROUTINE mp_sum_root_lv(msg, root, comm)
11183 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
11184 INTEGER,
INTENT(IN) :: root
11185 CLASS(mp_comm_type),
INTENT(IN) :: comm
11187 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_lv'
11190 #if defined(__parallel)
11191 INTEGER :: ierr, m1, msglen, taskid
11192 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
11195 CALL mp_timeset(routinen, handle)
11197 #if defined(__parallel)
11199 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11200 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11201 IF (msglen > 0)
THEN
11204 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_sum, &
11205 root, comm%handle, ierr)
11206 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11207 IF (taskid == root)
THEN
11212 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11218 CALL mp_timestop(handle)
11219 END SUBROUTINE mp_sum_root_lv
11230 SUBROUTINE mp_sum_root_lm(msg, root, comm)
11231 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11232 INTEGER,
INTENT(IN) :: root
11233 CLASS(mp_comm_type),
INTENT(IN) :: comm
11235 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
11238 #if defined(__parallel)
11239 INTEGER :: ierr, m1, m2, msglen, taskid
11240 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:, :)
11243 CALL mp_timeset(routinen, handle)
11245 #if defined(__parallel)
11247 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11248 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11249 IF (msglen > 0)
THEN
11252 ALLOCATE (res(m1, m2))
11253 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_sum, root, comm%handle, ierr)
11254 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11255 IF (taskid == root)
THEN
11260 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11266 CALL mp_timestop(handle)
11267 END SUBROUTINE mp_sum_root_lm
11275 SUBROUTINE mp_sum_partial_lm(msg, res, comm)
11276 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11277 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
11278 CLASS(mp_comm_type),
INTENT(IN) :: comm
11280 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_lm'
11283 #if defined(__parallel)
11284 INTEGER :: ierr, msglen, taskid
11287 CALL mp_timeset(routinen, handle)
11289 #if defined(__parallel)
11291 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11292 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11293 IF (msglen > 0)
THEN
11294 CALL mpi_scan(msg, res, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11295 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
11297 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11303 CALL mp_timestop(handle)
11304 END SUBROUTINE mp_sum_partial_lm
11314 SUBROUTINE mp_max_l (msg, comm)
11315 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11316 CLASS(mp_comm_type),
INTENT(IN) :: comm
11318 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_l'
11321 #if defined(__parallel)
11322 INTEGER :: ierr, msglen
11325 CALL mp_timeset(routinen, handle)
11327 #if defined(__parallel)
11329 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_max, comm%handle, ierr)
11330 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11331 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11336 CALL mp_timestop(handle)
11337 END SUBROUTINE mp_max_l
11347 SUBROUTINE mp_max_root_l (msg, root, comm)
11348 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11349 INTEGER,
INTENT(IN) :: root
11350 CLASS(mp_comm_type),
INTENT(IN) :: comm
11352 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_l'
11355 #if defined(__parallel)
11356 INTEGER :: ierr, msglen
11357 INTEGER(KIND=int_8) :: res
11360 CALL mp_timeset(routinen, handle)
11362 #if defined(__parallel)
11364 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_max, root, comm%handle, ierr)
11365 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11366 IF (root == comm%mepos) msg = res
11367 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11373 CALL mp_timestop(handle)
11374 END SUBROUTINE mp_max_root_l
11384 SUBROUTINE mp_max_lv(msg, comm)
11385 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
11386 CLASS(mp_comm_type),
INTENT(IN) :: comm
11388 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_lv'
11391 #if defined(__parallel)
11392 INTEGER :: ierr, msglen
11395 CALL mp_timeset(routinen, handle)
11397 #if defined(__parallel)
11399 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_max, comm%handle, ierr)
11400 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11401 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11406 CALL mp_timestop(handle)
11407 END SUBROUTINE mp_max_lv
11417 SUBROUTINE mp_max_root_lm(msg, root, comm)
11418 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11420 CLASS(mp_comm_type),
INTENT(IN) :: comm
11422 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_lm'
11425 #if defined(__parallel)
11426 INTEGER :: ierr, msglen
11427 INTEGER(KIND=int_8) :: res(size(msg, 1), size(msg, 2))
11430 CALL mp_timeset(routinen, handle)
11432 #if defined(__parallel)
11434 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_max, root, comm%handle, ierr)
11435 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11436 IF (root == comm%mepos) msg = res
11437 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11443 CALL mp_timestop(handle)
11444 END SUBROUTINE mp_max_root_lm
11454 SUBROUTINE mp_min_l (msg, comm)
11455 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11456 CLASS(mp_comm_type),
INTENT(IN) :: comm
11458 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_l'
11461 #if defined(__parallel)
11462 INTEGER :: ierr, msglen
11465 CALL mp_timeset(routinen, handle)
11467 #if defined(__parallel)
11469 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_min, comm%handle, ierr)
11470 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11471 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11476 CALL mp_timestop(handle)
11477 END SUBROUTINE mp_min_l
11489 SUBROUTINE mp_min_lv(msg, comm)
11490 INTEGER(KIND=int_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
11491 CLASS(mp_comm_type),
INTENT(IN) :: comm
11493 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_lv'
11496 #if defined(__parallel)
11497 INTEGER :: ierr, msglen
11500 CALL mp_timeset(routinen, handle)
11502 #if defined(__parallel)
11504 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_min, comm%handle, ierr)
11505 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11506 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11511 CALL mp_timestop(handle)
11512 END SUBROUTINE mp_min_lv
11522 SUBROUTINE mp_prod_l (msg, comm)
11523 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11524 CLASS(mp_comm_type),
INTENT(IN) :: comm
11526 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_l'
11529 #if defined(__parallel)
11530 INTEGER :: ierr, msglen
11533 CALL mp_timeset(routinen, handle)
11535 #if defined(__parallel)
11537 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_prod, comm%handle, ierr)
11538 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11539 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11544 CALL mp_timestop(handle)
11545 END SUBROUTINE mp_prod_l
11556 SUBROUTINE mp_scatter_lv(msg_scatter, msg, root, comm)
11557 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
11558 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
11559 INTEGER,
INTENT(IN) :: root
11560 CLASS(mp_comm_type),
INTENT(IN) :: comm
11562 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_lv'
11565 #if defined(__parallel)
11566 INTEGER :: ierr, msglen
11569 CALL mp_timeset(routinen, handle)
11571 #if defined(__parallel)
11573 CALL mpi_scatter(msg_scatter, msglen, mpi_integer8, msg, &
11574 msglen, mpi_integer8, root, comm%handle, ierr)
11575 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
11576 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11582 CALL mp_timestop(handle)
11583 END SUBROUTINE mp_scatter_lv
11593 SUBROUTINE mp_iscatter_l (msg_scatter, msg, root, comm, request)
11594 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:)
11595 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11596 INTEGER,
INTENT(IN) :: root
11597 CLASS(mp_comm_type),
INTENT(IN) :: comm
11598 TYPE(mp_request_type),
INTENT(OUT) :: request
11600 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_l'
11603 #if defined(__parallel)
11604 INTEGER :: ierr, msglen
11607 CALL mp_timeset(routinen, handle)
11609 #if defined(__parallel)
11610 #if !defined(__GNUC__) || __GNUC__ >= 9
11611 cpassert(is_contiguous(msg_scatter))
11614 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer8, msg, &
11615 msglen, mpi_integer8, root, comm%handle, request%handle, ierr)
11616 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
11617 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11621 msg = msg_scatter(1)
11624 CALL mp_timestop(handle)
11625 END SUBROUTINE mp_iscatter_l
11635 SUBROUTINE mp_iscatter_lv2(msg_scatter, msg, root, comm, request)
11636 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:, :)
11637 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
11638 INTEGER,
INTENT(IN) :: root
11639 CLASS(mp_comm_type),
INTENT(IN) :: comm
11640 TYPE(mp_request_type),
INTENT(OUT) :: request
11642 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_lv2'
11645 #if defined(__parallel)
11646 INTEGER :: ierr, msglen
11649 CALL mp_timeset(routinen, handle)
11651 #if defined(__parallel)
11652 #if !defined(__GNUC__) || __GNUC__ >= 9
11653 cpassert(is_contiguous(msg_scatter))
11656 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer8, msg, &
11657 msglen, mpi_integer8, root, comm%handle, request%handle, ierr)
11658 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
11659 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11663 msg(:) = msg_scatter(:, 1)
11666 CALL mp_timestop(handle)
11667 END SUBROUTINE mp_iscatter_lv2
11677 SUBROUTINE mp_iscatterv_lv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
11678 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:)
11679 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
11680 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
11681 INTEGER,
INTENT(IN) :: recvcount, root
11682 CLASS(mp_comm_type),
INTENT(IN) :: comm
11683 TYPE(mp_request_type),
INTENT(OUT) :: request
11685 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_lv'
11688 #if defined(__parallel)
11692 CALL mp_timeset(routinen, handle)
11694 #if defined(__parallel)
11695 #if !defined(__GNUC__) || __GNUC__ >= 9
11696 cpassert(is_contiguous(msg_scatter))
11697 cpassert(is_contiguous(msg))
11698 cpassert(is_contiguous(sendcounts))
11699 cpassert(is_contiguous(displs))
11701 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_integer8, msg, &
11702 recvcount, mpi_integer8, root, comm%handle, request%handle, ierr)
11703 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
11704 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11706 mark_used(sendcounts)
11708 mark_used(recvcount)
11711 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
11714 CALL mp_timestop(handle)
11715 END SUBROUTINE mp_iscatterv_lv
11726 SUBROUTINE mp_gather_l (msg, msg_gather, root, comm)
11727 INTEGER(KIND=int_8),
INTENT(IN) :: msg
11728 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11729 INTEGER,
INTENT(IN) :: root
11730 CLASS(mp_comm_type),
INTENT(IN) :: comm
11732 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_l'
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, root, 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)
11750 msg_gather(1) = msg
11752 CALL mp_timestop(handle)
11753 END SUBROUTINE mp_gather_l
11763 SUBROUTINE mp_gather_l_src(msg, msg_gather, comm)
11764 INTEGER(KIND=int_8),
INTENT(IN) :: msg
11765 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11766 CLASS(mp_comm_type),
INTENT(IN) :: comm
11768 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_l_src'
11771 #if defined(__parallel)
11772 INTEGER :: ierr, msglen
11775 CALL mp_timeset(routinen, handle)
11777 #if defined(__parallel)
11779 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11780 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11781 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11782 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11785 msg_gather(1) = msg
11787 CALL mp_timestop(handle)
11788 END SUBROUTINE mp_gather_l_src
11802 SUBROUTINE mp_gather_lv(msg, msg_gather, root, comm)
11803 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
11804 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11805 INTEGER,
INTENT(IN) :: root
11806 CLASS(mp_comm_type),
INTENT(IN) :: comm
11808 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lv'
11811 #if defined(__parallel)
11812 INTEGER :: ierr, msglen
11815 CALL mp_timeset(routinen, handle)
11817 #if defined(__parallel)
11819 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11820 msglen, mpi_integer8, root, comm%handle, ierr)
11821 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11822 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11828 CALL mp_timestop(handle)
11829 END SUBROUTINE mp_gather_lv
11842 SUBROUTINE mp_gather_lv_src(msg, msg_gather, comm)
11843 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
11844 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11845 CLASS(mp_comm_type),
INTENT(IN) :: comm
11847 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lv_src'
11850 #if defined(__parallel)
11851 INTEGER :: ierr, msglen
11854 CALL mp_timeset(routinen, handle)
11856 #if defined(__parallel)
11858 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11859 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11860 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11861 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11866 CALL mp_timestop(handle)
11867 END SUBROUTINE mp_gather_lv_src
11881 SUBROUTINE mp_gather_lm(msg, msg_gather, root, comm)
11882 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11883 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
11884 INTEGER,
INTENT(IN) :: root
11885 CLASS(mp_comm_type),
INTENT(IN) :: comm
11887 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lm'
11890 #if defined(__parallel)
11891 INTEGER :: ierr, msglen
11894 CALL mp_timeset(routinen, handle)
11896 #if defined(__parallel)
11898 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11899 msglen, mpi_integer8, root, comm%handle, ierr)
11900 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11901 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11907 CALL mp_timestop(handle)
11908 END SUBROUTINE mp_gather_lm
11921 SUBROUTINE mp_gather_lm_src(msg, msg_gather, comm)
11922 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11923 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
11924 CLASS(mp_comm_type),
INTENT(IN) :: comm
11926 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lm_src'
11929 #if defined(__parallel)
11930 INTEGER :: ierr, msglen
11933 CALL mp_timeset(routinen, handle)
11935 #if defined(__parallel)
11937 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11938 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11939 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11940 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11945 CALL mp_timestop(handle)
11946 END SUBROUTINE mp_gather_lm_src
11963 SUBROUTINE mp_gatherv_lv(sendbuf, recvbuf, recvcounts, displs, root, comm)
11965 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
11966 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
11967 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
11968 INTEGER,
INTENT(IN) :: root
11969 CLASS(mp_comm_type),
INTENT(IN) :: comm
11971 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lv'
11974 #if defined(__parallel)
11975 INTEGER :: ierr, sendcount
11978 CALL mp_timeset(routinen, handle)
11980 #if defined(__parallel)
11981 sendcount =
SIZE(sendbuf)
11982 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
11983 recvbuf, recvcounts, displs, mpi_integer8, &
11984 root, comm%handle, ierr)
11985 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
11986 CALL add_perf(perf_id=4, &
11988 msg_size=sendcount*int_8_size)
11990 mark_used(recvcounts)
11993 recvbuf(1 + displs(1):) = sendbuf
11995 CALL mp_timestop(handle)
11996 END SUBROUTINE mp_gatherv_lv
12012 SUBROUTINE mp_gatherv_lv_src(sendbuf, recvbuf, recvcounts, displs, comm)
12014 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
12015 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
12016 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12017 CLASS(mp_comm_type),
INTENT(IN) :: comm
12019 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lv_src'
12022 #if defined(__parallel)
12023 INTEGER :: ierr, sendcount
12026 CALL mp_timeset(routinen, handle)
12028 #if defined(__parallel)
12029 sendcount =
SIZE(sendbuf)
12030 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
12031 recvbuf, recvcounts, displs, mpi_integer8, &
12032 comm%source, comm%handle, ierr)
12033 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12034 CALL add_perf(perf_id=4, &
12036 msg_size=sendcount*int_8_size)
12038 mark_used(recvcounts)
12040 recvbuf(1 + displs(1):) = sendbuf
12042 CALL mp_timestop(handle)
12043 END SUBROUTINE mp_gatherv_lv_src
12060 SUBROUTINE mp_gatherv_lm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
12062 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
12063 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
12064 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12065 INTEGER,
INTENT(IN) :: root
12066 CLASS(mp_comm_type),
INTENT(IN) :: comm
12068 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lm2'
12071 #if defined(__parallel)
12072 INTEGER :: ierr, sendcount
12075 CALL mp_timeset(routinen, handle)
12077 #if defined(__parallel)
12078 sendcount =
SIZE(sendbuf)
12079 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
12080 recvbuf, recvcounts, displs, mpi_integer8, &
12081 root, comm%handle, ierr)
12082 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12083 CALL add_perf(perf_id=4, &
12085 msg_size=sendcount*int_8_size)
12087 mark_used(recvcounts)
12090 recvbuf(:, 1 + displs(1):) = sendbuf
12092 CALL mp_timestop(handle)
12093 END SUBROUTINE mp_gatherv_lm2
12109 SUBROUTINE mp_gatherv_lm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
12111 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
12112 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
12113 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12114 CLASS(mp_comm_type),
INTENT(IN) :: comm
12116 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lm2_src'
12119 #if defined(__parallel)
12120 INTEGER :: ierr, sendcount
12123 CALL mp_timeset(routinen, handle)
12125 #if defined(__parallel)
12126 sendcount =
SIZE(sendbuf)
12127 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
12128 recvbuf, recvcounts, displs, mpi_integer8, &
12129 comm%source, comm%handle, ierr)
12130 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12131 CALL add_perf(perf_id=4, &
12133 msg_size=sendcount*int_8_size)
12135 mark_used(recvcounts)
12137 recvbuf(:, 1 + displs(1):) = sendbuf
12139 CALL mp_timestop(handle)
12140 END SUBROUTINE mp_gatherv_lm2_src
12157 SUBROUTINE mp_igatherv_lv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
12158 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
12159 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
12160 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12161 INTEGER,
INTENT(IN) :: sendcount, root
12162 CLASS(mp_comm_type),
INTENT(IN) :: comm
12163 TYPE(mp_request_type),
INTENT(OUT) :: request
12165 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_lv'
12168 #if defined(__parallel)
12172 CALL mp_timeset(routinen, handle)
12174 #if defined(__parallel)
12175 #if !defined(__GNUC__) || __GNUC__ >= 9
12176 cpassert(is_contiguous(sendbuf))
12177 cpassert(is_contiguous(recvbuf))
12178 cpassert(is_contiguous(recvcounts))
12179 cpassert(is_contiguous(displs))
12181 CALL mpi_igatherv(sendbuf, sendcount, mpi_integer8, &
12182 recvbuf, recvcounts, displs, mpi_integer8, &
12183 root, comm%handle, request%handle, ierr)
12184 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12185 CALL add_perf(perf_id=24, &
12187 msg_size=sendcount*int_8_size)
12189 mark_used(sendcount)
12190 mark_used(recvcounts)
12193 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
12196 CALL mp_timestop(handle)
12197 END SUBROUTINE mp_igatherv_lv
12210 SUBROUTINE mp_allgather_l (msgout, msgin, comm)
12211 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12212 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
12213 CLASS(mp_comm_type),
INTENT(IN) :: comm
12215 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l'
12218 #if defined(__parallel)
12219 INTEGER :: ierr, rcount, scount
12222 CALL mp_timeset(routinen, handle)
12224 #if defined(__parallel)
12227 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12228 msgin, rcount, mpi_integer8, &
12230 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12235 CALL mp_timestop(handle)
12236 END SUBROUTINE mp_allgather_l
12249 SUBROUTINE mp_allgather_l2(msgout, msgin, comm)
12250 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12251 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12252 CLASS(mp_comm_type),
INTENT(IN) :: comm
12254 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l2'
12257 #if defined(__parallel)
12258 INTEGER :: ierr, rcount, scount
12261 CALL mp_timeset(routinen, handle)
12263 #if defined(__parallel)
12266 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12267 msgin, rcount, mpi_integer8, &
12269 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12274 CALL mp_timestop(handle)
12275 END SUBROUTINE mp_allgather_l2
12288 SUBROUTINE mp_iallgather_l (msgout, msgin, comm, request)
12289 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12290 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12291 CLASS(mp_comm_type),
INTENT(IN) :: comm
12292 TYPE(mp_request_type),
INTENT(OUT) :: request
12294 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l'
12297 #if defined(__parallel)
12298 INTEGER :: ierr, rcount, scount
12301 CALL mp_timeset(routinen, handle)
12303 #if defined(__parallel)
12304 #if !defined(__GNUC__) || __GNUC__ >= 9
12305 cpassert(is_contiguous(msgin))
12309 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12310 msgin, rcount, mpi_integer8, &
12311 comm%handle, request%handle, ierr)
12312 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12318 CALL mp_timestop(handle)
12319 END SUBROUTINE mp_iallgather_l
12334 SUBROUTINE mp_allgather_l12(msgout, msgin, comm)
12335 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
12336 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12337 CLASS(mp_comm_type),
INTENT(IN) :: comm
12339 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l12'
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_l12
12370 SUBROUTINE mp_allgather_l23(msgout, msgin, comm)
12371 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
12372 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
12373 CLASS(mp_comm_type),
INTENT(IN) :: comm
12375 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l23'
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_l23
12406 SUBROUTINE mp_allgather_l34(msgout, msgin, comm)
12407 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
12408 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
12409 CLASS(mp_comm_type),
INTENT(IN) :: comm
12411 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l34'
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(:, :, :, 1) = msgout(:, :, :)
12431 CALL mp_timestop(handle)
12432 END SUBROUTINE mp_allgather_l34
12442 SUBROUTINE mp_allgather_l22(msgout, msgin, comm)
12443 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
12444 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12445 CLASS(mp_comm_type),
INTENT(IN) :: comm
12447 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l22'
12450 #if defined(__parallel)
12451 INTEGER :: ierr, rcount, scount
12454 CALL mp_timeset(routinen, handle)
12456 #if defined(__parallel)
12457 scount =
SIZE(msgout(:, :))
12459 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12460 msgin, rcount, mpi_integer8, &
12462 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12465 msgin(:, :) = msgout(:, :)
12467 CALL mp_timestop(handle)
12468 END SUBROUTINE mp_allgather_l22
12479 SUBROUTINE mp_iallgather_l11(msgout, msgin, comm, request)
12480 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12481 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12482 CLASS(mp_comm_type),
INTENT(IN) :: comm
12483 TYPE(mp_request_type),
INTENT(OUT) :: request
12485 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l11'
12488 #if defined(__parallel)
12489 INTEGER :: ierr, rcount, scount
12492 CALL mp_timeset(routinen, handle)
12494 #if defined(__parallel)
12495 #if !defined(__GNUC__) || __GNUC__ >= 9
12496 cpassert(is_contiguous(msgout))
12497 cpassert(is_contiguous(msgin))
12499 scount =
SIZE(msgout(:))
12501 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12502 msgin, rcount, mpi_integer8, &
12503 comm%handle, request%handle, ierr)
12504 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12510 CALL mp_timestop(handle)
12511 END SUBROUTINE mp_iallgather_l11
12522 SUBROUTINE mp_iallgather_l13(msgout, msgin, comm, request)
12523 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12524 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :)
12525 CLASS(mp_comm_type),
INTENT(IN) :: comm
12526 TYPE(mp_request_type),
INTENT(OUT) :: request
12528 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l13'
12531 #if defined(__parallel)
12532 INTEGER :: ierr, rcount, scount
12535 CALL mp_timeset(routinen, handle)
12537 #if defined(__parallel)
12538 #if !defined(__GNUC__) || __GNUC__ >= 9
12539 cpassert(is_contiguous(msgout))
12540 cpassert(is_contiguous(msgin))
12543 scount =
SIZE(msgout(:))
12545 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12546 msgin, rcount, mpi_integer8, &
12547 comm%handle, request%handle, ierr)
12548 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12551 msgin(:, 1, 1) = msgout(:)
12554 CALL mp_timestop(handle)
12555 END SUBROUTINE mp_iallgather_l13
12566 SUBROUTINE mp_iallgather_l22(msgout, msgin, comm, request)
12567 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :)
12568 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :)
12569 CLASS(mp_comm_type),
INTENT(IN) :: comm
12570 TYPE(mp_request_type),
INTENT(OUT) :: request
12572 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l22'
12575 #if defined(__parallel)
12576 INTEGER :: ierr, rcount, scount
12579 CALL mp_timeset(routinen, handle)
12581 #if defined(__parallel)
12582 #if !defined(__GNUC__) || __GNUC__ >= 9
12583 cpassert(is_contiguous(msgout))
12584 cpassert(is_contiguous(msgin))
12587 scount =
SIZE(msgout(:, :))
12589 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12590 msgin, rcount, mpi_integer8, &
12591 comm%handle, request%handle, ierr)
12592 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12595 msgin(:, :) = msgout(:, :)
12598 CALL mp_timestop(handle)
12599 END SUBROUTINE mp_iallgather_l22
12610 SUBROUTINE mp_iallgather_l24(msgout, msgin, comm, request)
12611 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :)
12612 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :, :)
12613 CLASS(mp_comm_type),
INTENT(IN) :: comm
12614 TYPE(mp_request_type),
INTENT(OUT) :: request
12616 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l24'
12619 #if defined(__parallel)
12620 INTEGER :: ierr, rcount, scount
12623 CALL mp_timeset(routinen, handle)
12625 #if defined(__parallel)
12626 #if !defined(__GNUC__) || __GNUC__ >= 9
12627 cpassert(is_contiguous(msgout))
12628 cpassert(is_contiguous(msgin))
12631 scount =
SIZE(msgout(:, :))
12633 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12634 msgin, rcount, mpi_integer8, &
12635 comm%handle, request%handle, ierr)
12636 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12639 msgin(:, :, 1, 1) = msgout(:, :)
12642 CALL mp_timestop(handle)
12643 END SUBROUTINE mp_iallgather_l24
12654 SUBROUTINE mp_iallgather_l33(msgout, msgin, comm, request)
12655 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :, :)
12656 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :)
12657 CLASS(mp_comm_type),
INTENT(IN) :: comm
12658 TYPE(mp_request_type),
INTENT(OUT) :: request
12660 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l33'
12663 #if defined(__parallel)
12664 INTEGER :: ierr, rcount, scount
12667 CALL mp_timeset(routinen, handle)
12669 #if defined(__parallel)
12670 #if !defined(__GNUC__) || __GNUC__ >= 9
12671 cpassert(is_contiguous(msgout))
12672 cpassert(is_contiguous(msgin))
12675 scount =
SIZE(msgout(:, :, :))
12677 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12678 msgin, rcount, mpi_integer8, &
12679 comm%handle, request%handle, ierr)
12680 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12683 msgin(:, :, :) = msgout(:, :, :)
12686 CALL mp_timestop(handle)
12687 END SUBROUTINE mp_iallgather_l33
12706 SUBROUTINE mp_allgatherv_lv(msgout, msgin, rcount, rdispl, comm)
12707 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
12708 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12709 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12710 CLASS(mp_comm_type),
INTENT(IN) :: comm
12712 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_lv'
12715 #if defined(__parallel)
12716 INTEGER :: ierr, scount
12719 CALL mp_timeset(routinen, handle)
12721 #if defined(__parallel)
12722 scount =
SIZE(msgout)
12723 CALL mpi_allgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12724 rdispl, mpi_integer8, comm%handle, ierr)
12725 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
12732 CALL mp_timestop(handle)
12733 END SUBROUTINE mp_allgatherv_lv
12752 SUBROUTINE mp_allgatherv_lm2(msgout, msgin, rcount, rdispl, comm)
12753 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
12754 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
12755 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12756 CLASS(mp_comm_type),
INTENT(IN) :: comm
12758 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_lv'
12761 #if defined(__parallel)
12762 INTEGER :: ierr, scount
12765 CALL mp_timeset(routinen, handle)
12767 #if defined(__parallel)
12768 scount =
SIZE(msgout)
12769 CALL mpi_allgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12770 rdispl, mpi_integer8, comm%handle, ierr)
12771 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
12778 CALL mp_timestop(handle)
12779 END SUBROUTINE mp_allgatherv_lm2
12798 SUBROUTINE mp_iallgatherv_lv(msgout, msgin, rcount, rdispl, comm, request)
12799 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12800 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12801 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12802 CLASS(mp_comm_type),
INTENT(IN) :: comm
12803 TYPE(mp_request_type),
INTENT(OUT) :: request
12805 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_lv'
12808 #if defined(__parallel)
12809 INTEGER :: ierr, scount, rsize
12812 CALL mp_timeset(routinen, handle)
12814 #if defined(__parallel)
12815 #if !defined(__GNUC__) || __GNUC__ >= 9
12816 cpassert(is_contiguous(msgout))
12817 cpassert(is_contiguous(msgin))
12818 cpassert(is_contiguous(rcount))
12819 cpassert(is_contiguous(rdispl))
12822 scount =
SIZE(msgout)
12823 rsize =
SIZE(rcount)
12824 CALL mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, &
12825 rdispl, comm, request, ierr)
12826 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
12834 CALL mp_timestop(handle)
12835 END SUBROUTINE mp_iallgatherv_lv
12854 SUBROUTINE mp_iallgatherv_lv2(msgout, msgin, rcount, rdispl, comm, request)
12855 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12856 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12857 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
12858 CLASS(mp_comm_type),
INTENT(IN) :: comm
12859 TYPE(mp_request_type),
INTENT(OUT) :: request
12861 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_lv2'
12864 #if defined(__parallel)
12865 INTEGER :: ierr, scount, rsize
12868 CALL mp_timeset(routinen, handle)
12870 #if defined(__parallel)
12871 #if !defined(__GNUC__) || __GNUC__ >= 9
12872 cpassert(is_contiguous(msgout))
12873 cpassert(is_contiguous(msgin))
12874 cpassert(is_contiguous(rcount))
12875 cpassert(is_contiguous(rdispl))
12878 scount =
SIZE(msgout)
12879 rsize =
SIZE(rcount)
12880 CALL mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, &
12881 rdispl, comm, request, ierr)
12882 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
12890 CALL mp_timestop(handle)
12891 END SUBROUTINE mp_iallgatherv_lv2
12902 #if defined(__parallel)
12903 SUBROUTINE mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
12904 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
12905 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12906 INTEGER,
INTENT(IN) :: rsize
12907 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
12908 CLASS(mp_comm_type),
INTENT(IN) :: comm
12909 TYPE(mp_request_type),
INTENT(OUT) :: request
12910 INTEGER,
INTENT(INOUT) :: ierr
12912 CALL mpi_iallgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12913 rdispl, mpi_integer8, comm%handle, request%handle, ierr)
12915 END SUBROUTINE mp_iallgatherv_lv_internal
12926 SUBROUTINE mp_sum_scatter_lv(msgout, msgin, rcount, comm)
12927 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
12928 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12929 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
12930 CLASS(mp_comm_type),
INTENT(IN) :: comm
12932 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_lv'
12935 #if defined(__parallel)
12939 CALL mp_timeset(routinen, handle)
12941 #if defined(__parallel)
12942 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_integer8, mpi_sum, &
12944 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
12946 CALL add_perf(perf_id=3, count=1, &
12947 msg_size=rcount(1)*2*int_8_size)
12951 msgin = msgout(:, 1)
12953 CALL mp_timestop(handle)
12954 END SUBROUTINE mp_sum_scatter_lv
12965 SUBROUTINE mp_sendrecv_l (msgin, dest, msgout, source, comm, tag)
12966 INTEGER(KIND=int_8),
INTENT(IN) :: msgin
12967 INTEGER,
INTENT(IN) :: dest
12968 INTEGER(KIND=int_8),
INTENT(OUT) :: msgout
12969 INTEGER,
INTENT(IN) :: source
12970 CLASS(mp_comm_type),
INTENT(IN) :: comm
12971 INTEGER,
INTENT(IN),
OPTIONAL :: tag
12973 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_l'
12976 #if defined(__parallel)
12977 INTEGER :: ierr, msglen_in, msglen_out, &
12981 CALL mp_timeset(routinen, handle)
12983 #if defined(__parallel)
12988 IF (
PRESENT(tag))
THEN
12992 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
12993 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
12994 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
12995 CALL add_perf(perf_id=7, count=1, &
12996 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13004 CALL mp_timestop(handle)
13005 END SUBROUTINE mp_sendrecv_l
13016 SUBROUTINE mp_sendrecv_lv(msgin, dest, msgout, source, comm, tag)
13017 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
13018 INTEGER,
INTENT(IN) :: dest
13019 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
13020 INTEGER,
INTENT(IN) :: source
13021 CLASS(mp_comm_type),
INTENT(IN) :: comm
13022 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13024 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lv'
13027 #if defined(__parallel)
13028 INTEGER :: ierr, msglen_in, msglen_out, &
13032 CALL mp_timeset(routinen, handle)
13034 #if defined(__parallel)
13035 msglen_in =
SIZE(msgin)
13036 msglen_out =
SIZE(msgout)
13039 IF (
PRESENT(tag))
THEN
13043 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13044 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13045 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13046 CALL add_perf(perf_id=7, count=1, &
13047 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13055 CALL mp_timestop(handle)
13056 END SUBROUTINE mp_sendrecv_lv
13068 SUBROUTINE mp_sendrecv_lm2(msgin, dest, msgout, source, comm, tag)
13069 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
13070 INTEGER,
INTENT(IN) :: dest
13071 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
13072 INTEGER,
INTENT(IN) :: source
13073 CLASS(mp_comm_type),
INTENT(IN) :: comm
13074 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13076 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm2'
13079 #if defined(__parallel)
13080 INTEGER :: ierr, msglen_in, msglen_out, &
13084 CALL mp_timeset(routinen, handle)
13086 #if defined(__parallel)
13087 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
13088 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
13091 IF (
PRESENT(tag))
THEN
13095 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13096 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13097 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13098 CALL add_perf(perf_id=7, count=1, &
13099 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13107 CALL mp_timestop(handle)
13108 END SUBROUTINE mp_sendrecv_lm2
13119 SUBROUTINE mp_sendrecv_lm3(msgin, dest, msgout, source, comm, tag)
13120 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
13121 INTEGER,
INTENT(IN) :: dest
13122 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
13123 INTEGER,
INTENT(IN) :: source
13124 CLASS(mp_comm_type),
INTENT(IN) :: comm
13125 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13127 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm3'
13130 #if defined(__parallel)
13131 INTEGER :: ierr, msglen_in, msglen_out, &
13135 CALL mp_timeset(routinen, handle)
13137 #if defined(__parallel)
13138 msglen_in =
SIZE(msgin)
13139 msglen_out =
SIZE(msgout)
13142 IF (
PRESENT(tag))
THEN
13146 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13147 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13148 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13149 CALL add_perf(perf_id=7, count=1, &
13150 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13158 CALL mp_timestop(handle)
13159 END SUBROUTINE mp_sendrecv_lm3
13170 SUBROUTINE mp_sendrecv_lm4(msgin, dest, msgout, source, comm, tag)
13171 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
13172 INTEGER,
INTENT(IN) :: dest
13173 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
13174 INTEGER,
INTENT(IN) :: source
13175 CLASS(mp_comm_type),
INTENT(IN) :: comm
13176 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13178 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm4'
13181 #if defined(__parallel)
13182 INTEGER :: ierr, msglen_in, msglen_out, &
13186 CALL mp_timeset(routinen, handle)
13188 #if defined(__parallel)
13189 msglen_in =
SIZE(msgin)
13190 msglen_out =
SIZE(msgout)
13193 IF (
PRESENT(tag))
THEN
13197 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13198 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13199 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13200 CALL add_perf(perf_id=7, count=1, &
13201 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13209 CALL mp_timestop(handle)
13210 END SUBROUTINE mp_sendrecv_lm4
13227 SUBROUTINE mp_isendrecv_l (msgin, dest, msgout, source, comm, send_request, &
13229 INTEGER(KIND=int_8),
INTENT(IN) :: msgin
13230 INTEGER,
INTENT(IN) :: dest
13231 INTEGER(KIND=int_8),
INTENT(INOUT) :: msgout
13232 INTEGER,
INTENT(IN) :: source
13233 CLASS(mp_comm_type),
INTENT(IN) :: comm
13234 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
13235 INTEGER,
INTENT(in),
OPTIONAL :: tag
13237 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_l'
13240 #if defined(__parallel)
13241 INTEGER :: ierr, my_tag
13244 CALL mp_timeset(routinen, handle)
13246 #if defined(__parallel)
13248 IF (
PRESENT(tag)) my_tag = tag
13250 CALL mpi_irecv(msgout, 1, mpi_integer8, source, my_tag, &
13251 comm%handle, recv_request%handle, ierr)
13252 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13254 CALL mpi_isend(msgin, 1, mpi_integer8, dest, my_tag, &
13255 comm%handle, send_request%handle, ierr)
13256 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13258 CALL add_perf(perf_id=8, count=1, msg_size=2*int_8_size)
13268 CALL mp_timestop(handle)
13269 END SUBROUTINE mp_isendrecv_l
13288 SUBROUTINE mp_isendrecv_lv(msgin, dest, msgout, source, comm, send_request, &
13290 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: msgin
13291 INTEGER,
INTENT(IN) :: dest
13292 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
13293 INTEGER,
INTENT(IN) :: source
13294 CLASS(mp_comm_type),
INTENT(IN) :: comm
13295 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
13296 INTEGER,
INTENT(in),
OPTIONAL :: tag
13298 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_lv'
13301 #if defined(__parallel)
13302 INTEGER :: ierr, msglen, my_tag
13303 INTEGER(KIND=int_8) :: foo
13306 CALL mp_timeset(routinen, handle)
13308 #if defined(__parallel)
13309 #if !defined(__GNUC__) || __GNUC__ >= 9
13310 cpassert(is_contiguous(msgout))
13311 cpassert(is_contiguous(msgin))
13315 IF (
PRESENT(tag)) my_tag = tag
13317 msglen =
SIZE(msgout, 1)
13318 IF (msglen > 0)
THEN
13319 CALL mpi_irecv(msgout(1), msglen, mpi_integer8, source, my_tag, &
13320 comm%handle, recv_request%handle, ierr)
13322 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13323 comm%handle, recv_request%handle, ierr)
13325 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13327 msglen =
SIZE(msgin, 1)
13328 IF (msglen > 0)
THEN
13329 CALL mpi_isend(msgin(1), msglen, mpi_integer8, dest, my_tag, &
13330 comm%handle, send_request%handle, ierr)
13332 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13333 comm%handle, send_request%handle, ierr)
13335 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13337 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
13338 CALL add_perf(perf_id=8, count=1, msg_size=msglen*int_8_size)
13348 CALL mp_timestop(handle)
13349 END SUBROUTINE mp_isendrecv_lv
13364 SUBROUTINE mp_isend_lv(msgin, dest, comm, request, tag)
13365 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: msgin
13366 INTEGER,
INTENT(IN) :: dest
13367 CLASS(mp_comm_type),
INTENT(IN) :: comm
13368 TYPE(mp_request_type),
INTENT(out) :: request
13369 INTEGER,
INTENT(in),
OPTIONAL :: tag
13371 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lv'
13373 INTEGER :: handle, ierr
13374 #if defined(__parallel)
13375 INTEGER :: msglen, my_tag
13376 INTEGER(KIND=int_8) :: foo(1)
13379 CALL mp_timeset(routinen, handle)
13381 #if defined(__parallel)
13382 #if !defined(__GNUC__) || __GNUC__ >= 9
13383 cpassert(is_contiguous(msgin))
13386 IF (
PRESENT(tag)) my_tag = tag
13388 msglen =
SIZE(msgin)
13389 IF (msglen > 0)
THEN
13390 CALL mpi_isend(msgin(1), msglen, mpi_integer8, dest, my_tag, &
13391 comm%handle, request%handle, ierr)
13393 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13394 comm%handle, request%handle, ierr)
13396 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13398 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13407 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13409 CALL mp_timestop(handle)
13410 END SUBROUTINE mp_isend_lv
13427 SUBROUTINE mp_isend_lm2(msgin, dest, comm, request, tag)
13428 INTEGER(KIND=int_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
13429 INTEGER,
INTENT(IN) :: dest
13430 CLASS(mp_comm_type),
INTENT(IN) :: comm
13431 TYPE(mp_request_type),
INTENT(out) :: request
13432 INTEGER,
INTENT(in),
OPTIONAL :: tag
13434 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm2'
13436 INTEGER :: handle, ierr
13437 #if defined(__parallel)
13438 INTEGER :: msglen, my_tag
13439 INTEGER(KIND=int_8) :: foo(1)
13442 CALL mp_timeset(routinen, handle)
13444 #if defined(__parallel)
13445 #if !defined(__GNUC__) || __GNUC__ >= 9
13446 cpassert(is_contiguous(msgin))
13450 IF (
PRESENT(tag)) my_tag = tag
13452 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
13453 IF (msglen > 0)
THEN
13454 CALL mpi_isend(msgin(1, 1), msglen, mpi_integer8, dest, my_tag, &
13455 comm%handle, request%handle, ierr)
13457 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13458 comm%handle, request%handle, ierr)
13460 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13462 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13471 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13473 CALL mp_timestop(handle)
13474 END SUBROUTINE mp_isend_lm2
13493 SUBROUTINE mp_isend_lm3(msgin, dest, comm, request, tag)
13494 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
13495 INTEGER,
INTENT(IN) :: dest
13496 CLASS(mp_comm_type),
INTENT(IN) :: comm
13497 TYPE(mp_request_type),
INTENT(out) :: request
13498 INTEGER,
INTENT(in),
OPTIONAL :: tag
13500 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm3'
13502 INTEGER :: handle, ierr
13503 #if defined(__parallel)
13504 INTEGER :: msglen, my_tag
13505 INTEGER(KIND=int_8) :: foo(1)
13508 CALL mp_timeset(routinen, handle)
13510 #if defined(__parallel)
13511 #if !defined(__GNUC__) || __GNUC__ >= 9
13512 cpassert(is_contiguous(msgin))
13516 IF (
PRESENT(tag)) my_tag = tag
13518 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
13519 IF (msglen > 0)
THEN
13520 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_integer8, dest, my_tag, &
13521 comm%handle, request%handle, ierr)
13523 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13524 comm%handle, request%handle, ierr)
13526 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13528 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13537 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13539 CALL mp_timestop(handle)
13540 END SUBROUTINE mp_isend_lm3
13556 SUBROUTINE mp_isend_lm4(msgin, dest, comm, request, tag)
13557 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
13558 INTEGER,
INTENT(IN) :: dest
13559 CLASS(mp_comm_type),
INTENT(IN) :: comm
13560 TYPE(mp_request_type),
INTENT(out) :: request
13561 INTEGER,
INTENT(in),
OPTIONAL :: tag
13563 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm4'
13565 INTEGER :: handle, ierr
13566 #if defined(__parallel)
13567 INTEGER :: msglen, my_tag
13568 INTEGER(KIND=int_8) :: foo(1)
13571 CALL mp_timeset(routinen, handle)
13573 #if defined(__parallel)
13574 #if !defined(__GNUC__) || __GNUC__ >= 9
13575 cpassert(is_contiguous(msgin))
13579 IF (
PRESENT(tag)) my_tag = tag
13581 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
13582 IF (msglen > 0)
THEN
13583 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_integer8, dest, my_tag, &
13584 comm%handle, request%handle, ierr)
13586 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13587 comm%handle, request%handle, ierr)
13589 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13591 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13600 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13602 CALL mp_timestop(handle)
13603 END SUBROUTINE mp_isend_lm4
13619 SUBROUTINE mp_irecv_lv(msgout, source, comm, request, tag)
13620 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
13621 INTEGER,
INTENT(IN) :: source
13622 CLASS(mp_comm_type),
INTENT(IN) :: comm
13623 TYPE(mp_request_type),
INTENT(out) :: request
13624 INTEGER,
INTENT(in),
OPTIONAL :: tag
13626 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lv'
13629 #if defined(__parallel)
13630 INTEGER :: ierr, msglen, my_tag
13631 INTEGER(KIND=int_8) :: foo(1)
13634 CALL mp_timeset(routinen, handle)
13636 #if defined(__parallel)
13637 #if !defined(__GNUC__) || __GNUC__ >= 9
13638 cpassert(is_contiguous(msgout))
13642 IF (
PRESENT(tag)) my_tag = tag
13644 msglen =
SIZE(msgout)
13645 IF (msglen > 0)
THEN
13646 CALL mpi_irecv(msgout(1), msglen, mpi_integer8, source, my_tag, &
13647 comm%handle, request%handle, ierr)
13649 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13650 comm%handle, request%handle, ierr)
13652 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13654 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13656 cpabort(
"mp_irecv called in non parallel case")
13663 CALL mp_timestop(handle)
13664 END SUBROUTINE mp_irecv_lv
13681 SUBROUTINE mp_irecv_lm2(msgout, source, comm, request, tag)
13682 INTEGER(KIND=int_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
13683 INTEGER,
INTENT(IN) :: source
13684 CLASS(mp_comm_type),
INTENT(IN) :: comm
13685 TYPE(mp_request_type),
INTENT(out) :: request
13686 INTEGER,
INTENT(in),
OPTIONAL :: tag
13688 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm2'
13691 #if defined(__parallel)
13692 INTEGER :: ierr, msglen, my_tag
13693 INTEGER(KIND=int_8) :: foo(1)
13696 CALL mp_timeset(routinen, handle)
13698 #if defined(__parallel)
13699 #if !defined(__GNUC__) || __GNUC__ >= 9
13700 cpassert(is_contiguous(msgout))
13704 IF (
PRESENT(tag)) my_tag = tag
13706 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
13707 IF (msglen > 0)
THEN
13708 CALL mpi_irecv(msgout(1, 1), msglen, mpi_integer8, source, my_tag, &
13709 comm%handle, request%handle, ierr)
13711 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13712 comm%handle, request%handle, ierr)
13714 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13716 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13723 cpabort(
"mp_irecv called in non parallel case")
13725 CALL mp_timestop(handle)
13726 END SUBROUTINE mp_irecv_lm2
13744 SUBROUTINE mp_irecv_lm3(msgout, source, comm, request, tag)
13745 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
13746 INTEGER,
INTENT(IN) :: source
13747 CLASS(mp_comm_type),
INTENT(IN) :: comm
13748 TYPE(mp_request_type),
INTENT(out) :: request
13749 INTEGER,
INTENT(in),
OPTIONAL :: tag
13751 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm3'
13754 #if defined(__parallel)
13755 INTEGER :: ierr, msglen, my_tag
13756 INTEGER(KIND=int_8) :: foo(1)
13759 CALL mp_timeset(routinen, handle)
13761 #if defined(__parallel)
13762 #if !defined(__GNUC__) || __GNUC__ >= 9
13763 cpassert(is_contiguous(msgout))
13767 IF (
PRESENT(tag)) my_tag = tag
13769 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
13770 IF (msglen > 0)
THEN
13771 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_integer8, source, my_tag, &
13772 comm%handle, request%handle, ierr)
13774 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13775 comm%handle, request%handle, ierr)
13777 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
13779 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13786 cpabort(
"mp_irecv called in non parallel case")
13788 CALL mp_timestop(handle)
13789 END SUBROUTINE mp_irecv_lm3
13805 SUBROUTINE mp_irecv_lm4(msgout, source, comm, request, tag)
13806 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
13807 INTEGER,
INTENT(IN) :: source
13808 CLASS(mp_comm_type),
INTENT(IN) :: comm
13809 TYPE(mp_request_type),
INTENT(out) :: request
13810 INTEGER,
INTENT(in),
OPTIONAL :: tag
13812 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm4'
13815 #if defined(__parallel)
13816 INTEGER :: ierr, msglen, my_tag
13817 INTEGER(KIND=int_8) :: foo(1)
13820 CALL mp_timeset(routinen, handle)
13822 #if defined(__parallel)
13823 #if !defined(__GNUC__) || __GNUC__ >= 9
13824 cpassert(is_contiguous(msgout))
13828 IF (
PRESENT(tag)) my_tag = tag
13830 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
13831 IF (msglen > 0)
THEN
13832 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_integer8, source, my_tag, &
13833 comm%handle, request%handle, ierr)
13835 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13836 comm%handle, request%handle, ierr)
13838 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
13840 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13847 cpabort(
"mp_irecv called in non parallel case")
13849 CALL mp_timestop(handle)
13850 END SUBROUTINE mp_irecv_lm4
13862 SUBROUTINE mp_win_create_lv(base, comm, win)
13863 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
13864 TYPE(mp_comm_type),
INTENT(IN) :: comm
13865 CLASS(mp_win_type),
INTENT(INOUT) :: win
13867 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_lv'
13870 #if defined(__parallel)
13872 INTEGER(kind=mpi_address_kind) :: len
13873 INTEGER(KIND=int_8) :: foo(1)
13876 CALL mp_timeset(routinen, handle)
13878 #if defined(__parallel)
13880 len =
SIZE(base)*int_8_size
13882 CALL mpi_win_create(base(1), len, int_8_size, mpi_info_null, comm%handle, win%handle, ierr)
13884 CALL mpi_win_create(foo, len, int_8_size, mpi_info_null, comm%handle, win%handle, ierr)
13886 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
13888 CALL add_perf(perf_id=20, count=1)
13892 win%handle = mp_win_null_handle
13894 CALL mp_timestop(handle)
13895 END SUBROUTINE mp_win_create_lv
13907 SUBROUTINE mp_rget_lv(base, source, win, win_data, myproc, disp, request, &
13908 origin_datatype, target_datatype)
13909 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
13910 INTEGER,
INTENT(IN) :: source
13911 CLASS(mp_win_type),
INTENT(IN) :: win
13912 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: win_data
13913 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
13914 TYPE(mp_request_type),
INTENT(OUT) :: request
13915 TYPE(mp_type_descriptor_type),
INTENT(IN),
OPTIONAL :: origin_datatype, target_datatype
13917 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_lv'
13920 #if defined(__parallel)
13921 INTEGER :: ierr, len, &
13922 origin_len, target_len
13923 LOGICAL :: do_local_copy
13924 INTEGER(kind=mpi_address_kind) :: disp_aint
13925 mpi_data_type :: handle_origin_datatype, handle_target_datatype
13928 CALL mp_timeset(routinen, handle)
13930 #if defined(__parallel)
13933 IF (
PRESENT(disp))
THEN
13934 disp_aint = int(disp, kind=mpi_address_kind)
13936 handle_origin_datatype = mpi_integer8
13938 IF (
PRESENT(origin_datatype))
THEN
13939 handle_origin_datatype = origin_datatype%type_handle
13942 handle_target_datatype = mpi_integer8
13944 IF (
PRESENT(target_datatype))
THEN
13945 handle_target_datatype = target_datatype%type_handle
13949 do_local_copy = .false.
13950 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
13951 IF (myproc .EQ. source) do_local_copy = .true.
13953 IF (do_local_copy)
THEN
13955 base(:) = win_data(disp_aint + 1:disp_aint + len)
13960 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
13961 target_len, handle_target_datatype, win%handle, request%handle, ierr)
13967 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
13969 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*int_8_size)
13974 mark_used(origin_datatype)
13975 mark_used(target_datatype)
13979 IF (
PRESENT(disp))
THEN
13980 base(:) = win_data(disp + 1:disp +
SIZE(base))
13982 base(:) = win_data(:
SIZE(base))
13986 CALL mp_timestop(handle)
13987 END SUBROUTINE mp_rget_lv
13996 FUNCTION mp_type_indexed_make_l (count, lengths, displs) &
13997 result(type_descriptor)
13998 INTEGER,
INTENT(IN) :: count
13999 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
14000 TYPE(mp_type_descriptor_type) :: type_descriptor
14002 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_l'
14005 #if defined(__parallel)
14009 CALL mp_timeset(routinen, handle)
14011 #if defined(__parallel)
14012 CALL mpi_type_indexed(count, lengths, displs, mpi_integer8, &
14013 type_descriptor%type_handle, ierr)
14015 cpabort(
"MPI_Type_Indexed @ "//routinen)
14016 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
14018 cpabort(
"MPI_Type_commit @ "//routinen)
14020 type_descriptor%type_handle = 19
14022 type_descriptor%length = count
14023 NULLIFY (type_descriptor%subtype)
14024 type_descriptor%vector_descriptor(1:2) = 1
14025 type_descriptor%has_indexing = .true.
14026 type_descriptor%index_descriptor%index => lengths
14027 type_descriptor%index_descriptor%chunks => displs
14029 CALL mp_timestop(handle)
14031 END FUNCTION mp_type_indexed_make_l
14040 SUBROUTINE mp_allocate_l (DATA, len, stat)
14041 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
14042 INTEGER,
INTENT(IN) :: len
14043 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14045 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allocate_l'
14047 INTEGER :: handle, ierr
14049 CALL mp_timeset(routinen, handle)
14051 #if defined(__parallel)
14053 CALL mp_alloc_mem(
DATA, len, stat=ierr)
14054 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
14055 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
14056 CALL add_perf(perf_id=15, count=1)
14058 ALLOCATE (
DATA(len), stat=ierr)
14059 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
14060 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
14062 IF (
PRESENT(stat)) stat = ierr
14063 CALL mp_timestop(handle)
14064 END SUBROUTINE mp_allocate_l
14072 SUBROUTINE mp_deallocate_l (DATA, stat)
14073 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
14074 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14076 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_deallocate_l'
14079 #if defined(__parallel)
14083 CALL mp_timeset(routinen, handle)
14085 #if defined(__parallel)
14086 CALL mp_free_mem(
DATA, ierr)
14087 IF (
PRESENT(stat))
THEN
14090 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
14093 CALL add_perf(perf_id=15, count=1)
14096 IF (
PRESENT(stat)) stat = 0
14098 CALL mp_timestop(handle)
14099 END SUBROUTINE mp_deallocate_l
14112 SUBROUTINE mp_file_write_at_lv(fh, offset, msg, msglen)
14113 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
14114 CLASS(mp_file_type),
INTENT(IN) :: fh
14115 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14116 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14119 #if defined(__parallel)
14123 msg_len =
SIZE(msg)
14124 IF (
PRESENT(msglen)) msg_len = msglen
14125 #if defined(__parallel)
14126 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14128 cpabort(
"mpi_file_write_at_lv @ mp_file_write_at_lv")
14130 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14132 END SUBROUTINE mp_file_write_at_lv
14140 SUBROUTINE mp_file_write_at_l (fh, offset, msg)
14141 INTEGER(KIND=int_8),
INTENT(IN) :: msg
14142 CLASS(mp_file_type),
INTENT(IN) :: fh
14143 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14145 #if defined(__parallel)
14149 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14151 cpabort(
"mpi_file_write_at_l @ mp_file_write_at_l")
14153 WRITE (unit=fh%handle, pos=offset + 1) msg
14155 END SUBROUTINE mp_file_write_at_l
14167 SUBROUTINE mp_file_write_at_all_lv(fh, offset, msg, msglen)
14168 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
14169 CLASS(mp_file_type),
INTENT(IN) :: fh
14170 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14171 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14174 #if defined(__parallel)
14178 msg_len =
SIZE(msg)
14179 IF (
PRESENT(msglen)) msg_len = msglen
14180 #if defined(__parallel)
14181 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14183 cpabort(
"mpi_file_write_at_all_lv @ mp_file_write_at_all_lv")
14185 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14187 END SUBROUTINE mp_file_write_at_all_lv
14195 SUBROUTINE mp_file_write_at_all_l (fh, offset, msg)
14196 INTEGER(KIND=int_8),
INTENT(IN) :: msg
14197 CLASS(mp_file_type),
INTENT(IN) :: fh
14198 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14200 #if defined(__parallel)
14204 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14206 cpabort(
"mpi_file_write_at_all_l @ mp_file_write_at_all_l")
14208 WRITE (unit=fh%handle, pos=offset + 1) msg
14210 END SUBROUTINE mp_file_write_at_all_l
14223 SUBROUTINE mp_file_read_at_lv(fh, offset, msg, msglen)
14224 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
14225 CLASS(mp_file_type),
INTENT(IN) :: fh
14226 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14227 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14230 #if defined(__parallel)
14234 msg_len =
SIZE(msg)
14235 IF (
PRESENT(msglen)) msg_len = msglen
14236 #if defined(__parallel)
14237 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14239 cpabort(
"mpi_file_read_at_lv @ mp_file_read_at_lv")
14241 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14243 END SUBROUTINE mp_file_read_at_lv
14251 SUBROUTINE mp_file_read_at_l (fh, offset, msg)
14252 INTEGER(KIND=int_8),
INTENT(OUT) :: msg
14253 CLASS(mp_file_type),
INTENT(IN) :: fh
14254 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14256 #if defined(__parallel)
14260 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14262 cpabort(
"mpi_file_read_at_l @ mp_file_read_at_l")
14264 READ (unit=fh%handle, pos=offset + 1) msg
14266 END SUBROUTINE mp_file_read_at_l
14278 SUBROUTINE mp_file_read_at_all_lv(fh, offset, msg, msglen)
14279 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
14280 CLASS(mp_file_type),
INTENT(IN) :: fh
14281 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14282 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14285 #if defined(__parallel)
14289 msg_len =
SIZE(msg)
14290 IF (
PRESENT(msglen)) msg_len = msglen
14291 #if defined(__parallel)
14292 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14294 cpabort(
"mpi_file_read_at_all_lv @ mp_file_read_at_all_lv")
14296 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14298 END SUBROUTINE mp_file_read_at_all_lv
14306 SUBROUTINE mp_file_read_at_all_l (fh, offset, msg)
14307 INTEGER(KIND=int_8),
INTENT(OUT) :: msg
14308 CLASS(mp_file_type),
INTENT(IN) :: fh
14309 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14311 #if defined(__parallel)
14315 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14317 cpabort(
"mpi_file_read_at_all_l @ mp_file_read_at_all_l")
14319 READ (unit=fh%handle, pos=offset + 1) msg
14321 END SUBROUTINE mp_file_read_at_all_l
14330 FUNCTION mp_type_make_l (ptr, &
14331 vector_descriptor, index_descriptor) &
14332 result(type_descriptor)
14333 INTEGER(KIND=int_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
14334 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
14335 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
14336 TYPE(mp_type_descriptor_type) :: type_descriptor
14338 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_l'
14340 #if defined(__parallel)
14344 NULLIFY (type_descriptor%subtype)
14345 type_descriptor%length =
SIZE(ptr)
14346 #if defined(__parallel)
14347 type_descriptor%type_handle = mpi_integer8
14348 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
14350 cpabort(
"MPI_Get_address @ "//routinen)
14352 type_descriptor%type_handle = 19
14354 type_descriptor%vector_descriptor(1:2) = 1
14355 type_descriptor%has_indexing = .false.
14356 type_descriptor%data_l => ptr
14357 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
14358 cpabort(routinen//
": Vectors and indices NYI")
14360 END FUNCTION mp_type_make_l
14369 SUBROUTINE mp_alloc_mem_l (DATA, len, stat)
14370 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
14371 INTEGER,
INTENT(IN) :: len
14372 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14374 #if defined(__parallel)
14375 INTEGER :: size, ierr, length, &
14377 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
14378 TYPE(c_ptr) :: mp_baseptr
14379 mpi_info_type :: mp_info
14381 length = max(len, 1)
14382 CALL mpi_type_size(mpi_integer8,
size, ierr)
14383 mp_size = int(length, kind=mpi_address_kind)*
size
14384 IF (mp_size .GT. mp_max_memory_size)
THEN
14385 cpabort(
"MPI cannot allocate more than 2 GiByte")
14387 mp_info = mpi_info_null
14388 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
14389 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
14390 IF (
PRESENT(stat)) stat = mp_res
14392 INTEGER :: length, mystat
14393 length = max(len, 1)
14394 IF (
PRESENT(stat))
THEN
14395 ALLOCATE (
DATA(length), stat=mystat)
14398 ALLOCATE (
DATA(length))
14401 END SUBROUTINE mp_alloc_mem_l
14409 SUBROUTINE mp_free_mem_l (DATA, stat)
14410 INTEGER(KIND=int_8),
DIMENSION(:), &
14411 POINTER, asynchronous :: data
14412 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14414 #if defined(__parallel)
14416 CALL mpi_free_mem(
DATA, mp_res)
14417 IF (
PRESENT(stat)) stat = mp_res
14420 IF (
PRESENT(stat)) stat = 0
14422 END SUBROUTINE mp_free_mem_l
14434 SUBROUTINE mp_shift_dm(msg, comm, displ_in)
14436 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
14437 CLASS(mp_comm_type),
INTENT(IN) :: comm
14438 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
14440 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_dm'
14442 INTEGER :: handle, ierror
14443 #if defined(__parallel)
14444 INTEGER :: displ, left, &
14445 msglen, myrank, nprocs, &
14450 CALL mp_timeset(routinen, handle)
14452 #if defined(__parallel)
14453 CALL mpi_comm_rank(comm%handle, myrank, ierror)
14454 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
14455 CALL mpi_comm_size(comm%handle, nprocs, ierror)
14456 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
14457 IF (
PRESENT(displ_in))
THEN
14462 right =
modulo(myrank + displ, nprocs)
14463 left =
modulo(myrank - displ, nprocs)
14466 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_precision, right, tag, left, tag, &
14467 comm%handle, mpi_status_ignore, ierror)
14468 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
14469 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_8_size)
14473 mark_used(displ_in)
14475 CALL mp_timestop(handle)
14477 END SUBROUTINE mp_shift_dm
14490 SUBROUTINE mp_shift_d (msg, comm, displ_in)
14492 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
14493 CLASS(mp_comm_type),
INTENT(IN) :: comm
14494 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
14496 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_d'
14498 INTEGER :: handle, ierror
14499 #if defined(__parallel)
14500 INTEGER :: displ, left, &
14501 msglen, myrank, nprocs, &
14506 CALL mp_timeset(routinen, handle)
14508 #if defined(__parallel)
14509 CALL mpi_comm_rank(comm%handle, myrank, ierror)
14510 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
14511 CALL mpi_comm_size(comm%handle, nprocs, ierror)
14512 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
14513 IF (
PRESENT(displ_in))
THEN
14518 right =
modulo(myrank + displ, nprocs)
14519 left =
modulo(myrank - displ, nprocs)
14522 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_precision, right, tag, left, &
14523 tag, comm%handle, mpi_status_ignore, ierror)
14524 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
14525 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_8_size)
14529 mark_used(displ_in)
14531 CALL mp_timestop(handle)
14533 END SUBROUTINE mp_shift_d
14554 SUBROUTINE mp_alltoall_d11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
14556 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
14557 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
14558 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
14559 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
14560 CLASS(mp_comm_type),
INTENT(IN) :: comm
14562 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d11v'
14565 #if defined(__parallel)
14566 INTEGER :: ierr, msglen
14571 CALL mp_timeset(routinen, handle)
14573 #if defined(__parallel)
14574 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_precision, &
14575 rb, rcount, rdispl, mpi_double_precision, comm%handle, ierr)
14576 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
14577 msglen = sum(scount) + sum(rcount)
14578 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14584 DO i = 1, rcount(1)
14585 rb(rdispl(1) + i) = sb(sdispl(1) + i)
14588 CALL mp_timestop(handle)
14590 END SUBROUTINE mp_alltoall_d11v
14605 SUBROUTINE mp_alltoall_d22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
14607 REAL(kind=real_8),
DIMENSION(:, :), &
14608 INTENT(IN),
CONTIGUOUS :: sb
14609 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
14610 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS, &
14611 INTENT(INOUT) :: rb
14612 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
14613 CLASS(mp_comm_type),
INTENT(IN) :: comm
14615 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d22v'
14618 #if defined(__parallel)
14619 INTEGER :: ierr, msglen
14622 CALL mp_timeset(routinen, handle)
14624 #if defined(__parallel)
14625 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_precision, &
14626 rb, rcount, rdispl, mpi_double_precision, comm%handle, ierr)
14627 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
14628 msglen = sum(scount) + sum(rcount)
14629 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*real_8_size)
14638 CALL mp_timestop(handle)
14640 END SUBROUTINE mp_alltoall_d22v
14657 SUBROUTINE mp_alltoall_d (sb, rb, count, comm)
14659 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
14660 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
14661 INTEGER,
INTENT(IN) :: count
14662 CLASS(mp_comm_type),
INTENT(IN) :: comm
14664 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d'
14667 #if defined(__parallel)
14668 INTEGER :: ierr, msglen, np
14671 CALL mp_timeset(routinen, handle)
14673 #if defined(__parallel)
14674 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14675 rb, count, mpi_double_precision, comm%handle, ierr)
14676 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14677 CALL mpi_comm_size(comm%handle, np, ierr)
14678 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14679 msglen = 2*count*np
14680 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14686 CALL mp_timestop(handle)
14688 END SUBROUTINE mp_alltoall_d
14698 SUBROUTINE mp_alltoall_d22(sb, rb, count, comm)
14700 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
14701 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
14702 INTEGER,
INTENT(IN) :: count
14703 CLASS(mp_comm_type),
INTENT(IN) :: comm
14705 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d22'
14708 #if defined(__parallel)
14709 INTEGER :: ierr, msglen, np
14712 CALL mp_timeset(routinen, handle)
14714 #if defined(__parallel)
14715 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14716 rb, count, mpi_double_precision, comm%handle, ierr)
14717 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14718 CALL mpi_comm_size(comm%handle, np, ierr)
14719 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14720 msglen = 2*
SIZE(sb)*np
14721 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14727 CALL mp_timestop(handle)
14729 END SUBROUTINE mp_alltoall_d22
14739 SUBROUTINE mp_alltoall_d33(sb, rb, count, comm)
14741 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
14742 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
14743 INTEGER,
INTENT(IN) :: count
14744 CLASS(mp_comm_type),
INTENT(IN) :: comm
14746 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d33'
14749 #if defined(__parallel)
14750 INTEGER :: ierr, msglen, np
14753 CALL mp_timeset(routinen, handle)
14755 #if defined(__parallel)
14756 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14757 rb, count, mpi_double_precision, comm%handle, ierr)
14758 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14759 CALL mpi_comm_size(comm%handle, np, ierr)
14760 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14761 msglen = 2*count*np
14762 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14768 CALL mp_timestop(handle)
14770 END SUBROUTINE mp_alltoall_d33
14780 SUBROUTINE mp_alltoall_d44(sb, rb, count, comm)
14782 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14784 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14786 INTEGER,
INTENT(IN) :: count
14787 CLASS(mp_comm_type),
INTENT(IN) :: comm
14789 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d44'
14792 #if defined(__parallel)
14793 INTEGER :: ierr, msglen, np
14796 CALL mp_timeset(routinen, handle)
14798 #if defined(__parallel)
14799 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14800 rb, count, mpi_double_precision, comm%handle, ierr)
14801 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14802 CALL mpi_comm_size(comm%handle, np, ierr)
14803 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14804 msglen = 2*count*np
14805 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14811 CALL mp_timestop(handle)
14813 END SUBROUTINE mp_alltoall_d44
14823 SUBROUTINE mp_alltoall_d55(sb, rb, count, comm)
14825 REAL(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
14827 REAL(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
14829 INTEGER,
INTENT(IN) :: count
14830 CLASS(mp_comm_type),
INTENT(IN) :: comm
14832 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d55'
14835 #if defined(__parallel)
14836 INTEGER :: ierr, msglen, np
14839 CALL mp_timeset(routinen, handle)
14841 #if defined(__parallel)
14842 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14843 rb, count, mpi_double_precision, comm%handle, ierr)
14844 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14845 CALL mpi_comm_size(comm%handle, np, ierr)
14846 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14847 msglen = 2*count*np
14848 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14854 CALL mp_timestop(handle)
14856 END SUBROUTINE mp_alltoall_d55
14867 SUBROUTINE mp_alltoall_d45(sb, rb, count, comm)
14869 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14871 REAL(kind=real_8), &
14872 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
14873 INTEGER,
INTENT(IN) :: count
14874 CLASS(mp_comm_type),
INTENT(IN) :: comm
14876 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d45'
14879 #if defined(__parallel)
14880 INTEGER :: ierr, msglen, np
14883 CALL mp_timeset(routinen, handle)
14885 #if defined(__parallel)
14886 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14887 rb, count, mpi_double_precision, comm%handle, ierr)
14888 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14889 CALL mpi_comm_size(comm%handle, np, ierr)
14890 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14891 msglen = 2*count*np
14892 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14896 rb = reshape(sb, shape(rb))
14898 CALL mp_timestop(handle)
14900 END SUBROUTINE mp_alltoall_d45
14911 SUBROUTINE mp_alltoall_d34(sb, rb, count, comm)
14913 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
14915 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14917 INTEGER,
INTENT(IN) :: count
14918 CLASS(mp_comm_type),
INTENT(IN) :: comm
14920 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d34'
14923 #if defined(__parallel)
14924 INTEGER :: ierr, msglen, np
14927 CALL mp_timeset(routinen, handle)
14929 #if defined(__parallel)
14930 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14931 rb, count, mpi_double_precision, comm%handle, ierr)
14932 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14933 CALL mpi_comm_size(comm%handle, np, ierr)
14934 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14935 msglen = 2*count*np
14936 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14940 rb = reshape(sb, shape(rb))
14942 CALL mp_timestop(handle)
14944 END SUBROUTINE mp_alltoall_d34
14955 SUBROUTINE mp_alltoall_d54(sb, rb, count, comm)
14957 REAL(kind=real_8), &
14958 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
14959 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14961 INTEGER,
INTENT(IN) :: count
14962 CLASS(mp_comm_type),
INTENT(IN) :: comm
14964 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d54'
14967 #if defined(__parallel)
14968 INTEGER :: ierr, msglen, np
14971 CALL mp_timeset(routinen, handle)
14973 #if defined(__parallel)
14974 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14975 rb, count, mpi_double_precision, comm%handle, ierr)
14976 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14977 CALL mpi_comm_size(comm%handle, np, ierr)
14978 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14979 msglen = 2*count*np
14980 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14984 rb = reshape(sb, shape(rb))
14986 CALL mp_timestop(handle)
14988 END SUBROUTINE mp_alltoall_d54
14999 SUBROUTINE mp_send_d (msg, dest, tag, comm)
15000 REAL(kind=real_8),
INTENT(IN) :: msg
15001 INTEGER,
INTENT(IN) :: dest, tag
15002 CLASS(mp_comm_type),
INTENT(IN) :: comm
15004 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_d'
15007 #if defined(__parallel)
15008 INTEGER :: ierr, msglen
15011 CALL mp_timeset(routinen, handle)
15013 #if defined(__parallel)
15015 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15016 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15017 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15024 cpabort(
"not in parallel mode")
15026 CALL mp_timestop(handle)
15027 END SUBROUTINE mp_send_d
15037 SUBROUTINE mp_send_dv(msg, dest, tag, comm)
15038 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
15039 INTEGER,
INTENT(IN) :: dest, tag
15040 CLASS(mp_comm_type),
INTENT(IN) :: comm
15042 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_dv'
15045 #if defined(__parallel)
15046 INTEGER :: ierr, msglen
15049 CALL mp_timeset(routinen, handle)
15051 #if defined(__parallel)
15053 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15054 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15055 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15062 cpabort(
"not in parallel mode")
15064 CALL mp_timestop(handle)
15065 END SUBROUTINE mp_send_dv
15075 SUBROUTINE mp_send_dm2(msg, dest, tag, comm)
15076 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
15077 INTEGER,
INTENT(IN) :: dest, tag
15078 CLASS(mp_comm_type),
INTENT(IN) :: comm
15080 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_dm2'
15083 #if defined(__parallel)
15084 INTEGER :: ierr, msglen
15087 CALL mp_timeset(routinen, handle)
15089 #if defined(__parallel)
15091 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15092 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15093 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15100 cpabort(
"not in parallel mode")
15102 CALL mp_timestop(handle)
15103 END SUBROUTINE mp_send_dm2
15113 SUBROUTINE mp_send_dm3(msg, dest, tag, comm)
15114 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
15115 INTEGER,
INTENT(IN) :: dest, tag
15116 CLASS(mp_comm_type),
INTENT(IN) :: comm
15118 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
15121 #if defined(__parallel)
15122 INTEGER :: ierr, msglen
15125 CALL mp_timeset(routinen, handle)
15127 #if defined(__parallel)
15129 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15130 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15131 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15138 cpabort(
"not in parallel mode")
15140 CALL mp_timestop(handle)
15141 END SUBROUTINE mp_send_dm3
15152 SUBROUTINE mp_recv_d (msg, source, tag, comm)
15153 REAL(kind=real_8),
INTENT(INOUT) :: msg
15154 INTEGER,
INTENT(INOUT) :: source, tag
15155 CLASS(mp_comm_type),
INTENT(IN) :: comm
15157 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_d'
15160 #if defined(__parallel)
15161 INTEGER :: ierr, msglen
15162 mpi_status_type :: status
15165 CALL mp_timeset(routinen, handle)
15167 #if defined(__parallel)
15170 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15171 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15173 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15174 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15175 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15176 source = status mpi_status_extract(mpi_source)
15177 tag = status mpi_status_extract(mpi_tag)
15185 cpabort(
"not in parallel mode")
15187 CALL mp_timestop(handle)
15188 END SUBROUTINE mp_recv_d
15198 SUBROUTINE mp_recv_dv(msg, source, tag, comm)
15199 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15200 INTEGER,
INTENT(INOUT) :: source, tag
15201 CLASS(mp_comm_type),
INTENT(IN) :: comm
15203 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dv'
15206 #if defined(__parallel)
15207 INTEGER :: ierr, msglen
15208 mpi_status_type :: status
15211 CALL mp_timeset(routinen, handle)
15213 #if defined(__parallel)
15216 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15217 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15219 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15220 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15221 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15222 source = status mpi_status_extract(mpi_source)
15223 tag = status mpi_status_extract(mpi_tag)
15231 cpabort(
"not in parallel mode")
15233 CALL mp_timestop(handle)
15234 END SUBROUTINE mp_recv_dv
15244 SUBROUTINE mp_recv_dm2(msg, source, tag, comm)
15245 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15246 INTEGER,
INTENT(INOUT) :: source, tag
15247 CLASS(mp_comm_type),
INTENT(IN) :: comm
15249 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dm2'
15252 #if defined(__parallel)
15253 INTEGER :: ierr, msglen
15254 mpi_status_type :: status
15257 CALL mp_timeset(routinen, handle)
15259 #if defined(__parallel)
15262 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15263 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15265 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15266 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15267 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15268 source = status mpi_status_extract(mpi_source)
15269 tag = status mpi_status_extract(mpi_tag)
15277 cpabort(
"not in parallel mode")
15279 CALL mp_timestop(handle)
15280 END SUBROUTINE mp_recv_dm2
15290 SUBROUTINE mp_recv_dm3(msg, source, tag, comm)
15291 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
15292 INTEGER,
INTENT(INOUT) :: source, tag
15293 CLASS(mp_comm_type),
INTENT(IN) :: comm
15295 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dm3'
15298 #if defined(__parallel)
15299 INTEGER :: ierr, msglen
15300 mpi_status_type :: status
15303 CALL mp_timeset(routinen, handle)
15305 #if defined(__parallel)
15308 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15309 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15311 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15312 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15313 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15314 source = status mpi_status_extract(mpi_source)
15315 tag = status mpi_status_extract(mpi_tag)
15323 cpabort(
"not in parallel mode")
15325 CALL mp_timestop(handle)
15326 END SUBROUTINE mp_recv_dm3
15336 SUBROUTINE mp_bcast_d (msg, source, comm)
15337 REAL(kind=real_8),
INTENT(INOUT) :: msg
15338 INTEGER,
INTENT(IN) :: source
15339 CLASS(mp_comm_type),
INTENT(IN) :: comm
15341 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d'
15344 #if defined(__parallel)
15345 INTEGER :: ierr, msglen
15348 CALL mp_timeset(routinen, handle)
15350 #if defined(__parallel)
15352 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15353 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15354 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15360 CALL mp_timestop(handle)
15361 END SUBROUTINE mp_bcast_d
15370 SUBROUTINE mp_bcast_d_src(msg, comm)
15371 REAL(kind=real_8),
INTENT(INOUT) :: msg
15372 CLASS(mp_comm_type),
INTENT(IN) :: comm
15374 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d_src'
15377 #if defined(__parallel)
15378 INTEGER :: ierr, msglen
15381 CALL mp_timeset(routinen, handle)
15383 #if defined(__parallel)
15385 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15386 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15387 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15392 CALL mp_timestop(handle)
15393 END SUBROUTINE mp_bcast_d_src
15403 SUBROUTINE mp_ibcast_d (msg, source, comm, request)
15404 REAL(kind=real_8),
INTENT(INOUT) :: msg
15405 INTEGER,
INTENT(IN) :: source
15406 CLASS(mp_comm_type),
INTENT(IN) :: comm
15407 TYPE(mp_request_type),
INTENT(OUT) :: request
15409 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_d'
15412 #if defined(__parallel)
15413 INTEGER :: ierr, msglen
15416 CALL mp_timeset(routinen, handle)
15418 #if defined(__parallel)
15420 CALL mpi_ibcast(msg, msglen, mpi_double_precision, source, comm%handle, request%handle, ierr)
15421 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
15422 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_8_size)
15429 CALL mp_timestop(handle)
15430 END SUBROUTINE mp_ibcast_d
15439 SUBROUTINE mp_bcast_dv(msg, source, comm)
15440 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15441 INTEGER,
INTENT(IN) :: source
15442 CLASS(mp_comm_type),
INTENT(IN) :: comm
15444 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dv'
15447 #if defined(__parallel)
15448 INTEGER :: ierr, msglen
15451 CALL mp_timeset(routinen, handle)
15453 #if defined(__parallel)
15455 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15456 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15457 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15463 CALL mp_timestop(handle)
15464 END SUBROUTINE mp_bcast_dv
15472 SUBROUTINE mp_bcast_dv_src(msg, comm)
15473 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15474 CLASS(mp_comm_type),
INTENT(IN) :: comm
15476 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dv_src'
15479 #if defined(__parallel)
15480 INTEGER :: ierr, msglen
15483 CALL mp_timeset(routinen, handle)
15485 #if defined(__parallel)
15487 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15488 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15489 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15494 CALL mp_timestop(handle)
15495 END SUBROUTINE mp_bcast_dv_src
15504 SUBROUTINE mp_ibcast_dv(msg, source, comm, request)
15505 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
15506 INTEGER,
INTENT(IN) :: source
15507 CLASS(mp_comm_type),
INTENT(IN) :: comm
15508 TYPE(mp_request_type) :: request
15510 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_dv'
15513 #if defined(__parallel)
15514 INTEGER :: ierr, msglen
15517 CALL mp_timeset(routinen, handle)
15519 #if defined(__parallel)
15520 #if !defined(__GNUC__) || __GNUC__ >= 9
15521 cpassert(is_contiguous(msg))
15524 CALL mpi_ibcast(msg, msglen, mpi_double_precision, source, comm%handle, request%handle, ierr)
15525 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
15526 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_8_size)
15533 CALL mp_timestop(handle)
15534 END SUBROUTINE mp_ibcast_dv
15543 SUBROUTINE mp_bcast_dm(msg, source, comm)
15544 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15545 INTEGER,
INTENT(IN) :: source
15546 CLASS(mp_comm_type),
INTENT(IN) :: comm
15548 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dm'
15551 #if defined(__parallel)
15552 INTEGER :: ierr, msglen
15555 CALL mp_timeset(routinen, handle)
15557 #if defined(__parallel)
15559 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15560 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15561 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15567 CALL mp_timestop(handle)
15568 END SUBROUTINE mp_bcast_dm
15577 SUBROUTINE mp_bcast_dm_src(msg, comm)
15578 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15579 CLASS(mp_comm_type),
INTENT(IN) :: comm
15581 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dm_src'
15584 #if defined(__parallel)
15585 INTEGER :: ierr, msglen
15588 CALL mp_timeset(routinen, handle)
15590 #if defined(__parallel)
15592 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15593 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15594 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15599 CALL mp_timestop(handle)
15600 END SUBROUTINE mp_bcast_dm_src
15609 SUBROUTINE mp_bcast_d3(msg, source, comm)
15610 REAL(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
15611 INTEGER,
INTENT(IN) :: source
15612 CLASS(mp_comm_type),
INTENT(IN) :: comm
15614 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d3'
15617 #if defined(__parallel)
15618 INTEGER :: ierr, msglen
15621 CALL mp_timeset(routinen, handle)
15623 #if defined(__parallel)
15625 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15626 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15627 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15633 CALL mp_timestop(handle)
15634 END SUBROUTINE mp_bcast_d3
15643 SUBROUTINE mp_bcast_d3_src(msg, comm)
15644 REAL(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
15645 CLASS(mp_comm_type),
INTENT(IN) :: comm
15647 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d3_src'
15650 #if defined(__parallel)
15651 INTEGER :: ierr, msglen
15654 CALL mp_timeset(routinen, handle)
15656 #if defined(__parallel)
15658 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15659 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15660 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15665 CALL mp_timestop(handle)
15666 END SUBROUTINE mp_bcast_d3_src
15675 SUBROUTINE mp_sum_d (msg, comm)
15676 REAL(kind=real_8),
INTENT(INOUT) :: msg
15677 CLASS(mp_comm_type),
INTENT(IN) :: comm
15679 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_d'
15682 #if defined(__parallel)
15683 INTEGER :: ierr, msglen
15686 CALL mp_timeset(routinen, handle)
15688 #if defined(__parallel)
15690 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15691 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15692 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15697 CALL mp_timestop(handle)
15698 END SUBROUTINE mp_sum_d
15706 SUBROUTINE mp_sum_dv(msg, comm)
15707 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15708 CLASS(mp_comm_type),
INTENT(IN) :: comm
15710 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dv'
15713 #if defined(__parallel)
15714 INTEGER :: ierr, msglen
15717 CALL mp_timeset(routinen, handle)
15719 #if defined(__parallel)
15721 IF (msglen > 0)
THEN
15722 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15723 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15725 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15730 CALL mp_timestop(handle)
15731 END SUBROUTINE mp_sum_dv
15739 SUBROUTINE mp_isum_dv(msg, comm, request)
15740 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
15741 CLASS(mp_comm_type),
INTENT(IN) :: comm
15742 TYPE(mp_request_type),
INTENT(OUT) :: request
15744 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_dv'
15747 #if defined(__parallel)
15748 INTEGER :: ierr, msglen
15751 CALL mp_timeset(routinen, handle)
15753 #if defined(__parallel)
15754 #if !defined(__GNUC__) || __GNUC__ >= 9
15755 cpassert(is_contiguous(msg))
15758 IF (msglen > 0)
THEN
15759 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, request%handle, ierr)
15760 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
15764 CALL add_perf(perf_id=23, count=1, msg_size=msglen*real_8_size)
15770 CALL mp_timestop(handle)
15771 END SUBROUTINE mp_isum_dv
15779 SUBROUTINE mp_sum_dm(msg, comm)
15780 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15781 CLASS(mp_comm_type),
INTENT(IN) :: comm
15783 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm'
15786 #if defined(__parallel)
15787 INTEGER,
PARAMETER :: max_msg = 2**25
15788 INTEGER :: ierr, m1, msglen, step, msglensum
15791 CALL mp_timeset(routinen, handle)
15793 #if defined(__parallel)
15795 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
15797 DO m1 = lbound(msg, 2), ubound(msg, 2), step
15798 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
15799 msglensum = msglensum + msglen
15800 IF (msglen > 0)
THEN
15801 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15802 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15805 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_8_size)
15810 CALL mp_timestop(handle)
15811 END SUBROUTINE mp_sum_dm
15819 SUBROUTINE mp_sum_dm3(msg, comm)
15820 REAL(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
15821 CLASS(mp_comm_type),
INTENT(IN) :: comm
15823 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm3'
15826 #if defined(__parallel)
15827 INTEGER :: ierr, msglen
15830 CALL mp_timeset(routinen, handle)
15832 #if defined(__parallel)
15834 IF (msglen > 0)
THEN
15835 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15836 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15838 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15843 CALL mp_timestop(handle)
15844 END SUBROUTINE mp_sum_dm3
15852 SUBROUTINE mp_sum_dm4(msg, comm)
15853 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
15854 CLASS(mp_comm_type),
INTENT(IN) :: comm
15856 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm4'
15859 #if defined(__parallel)
15860 INTEGER :: ierr, msglen
15863 CALL mp_timeset(routinen, handle)
15865 #if defined(__parallel)
15867 IF (msglen > 0)
THEN
15868 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15869 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15871 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15876 CALL mp_timestop(handle)
15877 END SUBROUTINE mp_sum_dm4
15889 SUBROUTINE mp_sum_root_dv(msg, root, comm)
15890 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15891 INTEGER,
INTENT(IN) :: root
15892 CLASS(mp_comm_type),
INTENT(IN) :: comm
15894 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_dv'
15897 #if defined(__parallel)
15898 INTEGER :: ierr, m1, msglen, taskid
15899 REAL(kind=real_8),
ALLOCATABLE :: res(:)
15902 CALL mp_timeset(routinen, handle)
15904 #if defined(__parallel)
15906 CALL mpi_comm_rank(comm%handle, taskid, ierr)
15907 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
15908 IF (msglen > 0)
THEN
15911 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_sum, &
15912 root, comm%handle, ierr)
15913 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
15914 IF (taskid == root)
THEN
15919 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15925 CALL mp_timestop(handle)
15926 END SUBROUTINE mp_sum_root_dv
15937 SUBROUTINE mp_sum_root_dm(msg, root, comm)
15938 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15939 INTEGER,
INTENT(IN) :: root
15940 CLASS(mp_comm_type),
INTENT(IN) :: comm
15942 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
15945 #if defined(__parallel)
15946 INTEGER :: ierr, m1, m2, msglen, taskid
15947 REAL(kind=real_8),
ALLOCATABLE :: res(:, :)
15950 CALL mp_timeset(routinen, handle)
15952 #if defined(__parallel)
15954 CALL mpi_comm_rank(comm%handle, taskid, ierr)
15955 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
15956 IF (msglen > 0)
THEN
15959 ALLOCATE (res(m1, m2))
15960 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_sum, root, comm%handle, ierr)
15961 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
15962 IF (taskid == root)
THEN
15967 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15973 CALL mp_timestop(handle)
15974 END SUBROUTINE mp_sum_root_dm
15982 SUBROUTINE mp_sum_partial_dm(msg, res, comm)
15983 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
15984 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
15985 CLASS(mp_comm_type),
INTENT(IN) :: comm
15987 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_dm'
15990 #if defined(__parallel)
15991 INTEGER :: ierr, msglen, taskid
15994 CALL mp_timeset(routinen, handle)
15996 #if defined(__parallel)
15998 CALL mpi_comm_rank(comm%handle, taskid, ierr)
15999 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
16000 IF (msglen > 0)
THEN
16001 CALL mpi_scan(msg, res, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
16002 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
16004 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16010 CALL mp_timestop(handle)
16011 END SUBROUTINE mp_sum_partial_dm
16021 SUBROUTINE mp_max_d (msg, comm)
16022 REAL(kind=real_8),
INTENT(INOUT) :: msg
16023 CLASS(mp_comm_type),
INTENT(IN) :: comm
16025 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_d'
16028 #if defined(__parallel)
16029 INTEGER :: ierr, msglen
16032 CALL mp_timeset(routinen, handle)
16034 #if defined(__parallel)
16036 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_max, comm%handle, ierr)
16037 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16038 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16043 CALL mp_timestop(handle)
16044 END SUBROUTINE mp_max_d
16054 SUBROUTINE mp_max_root_d (msg, root, comm)
16055 REAL(kind=real_8),
INTENT(INOUT) :: msg
16056 INTEGER,
INTENT(IN) :: root
16057 CLASS(mp_comm_type),
INTENT(IN) :: comm
16059 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_d'
16062 #if defined(__parallel)
16063 INTEGER :: ierr, msglen
16064 REAL(kind=real_8) :: res
16067 CALL mp_timeset(routinen, handle)
16069 #if defined(__parallel)
16071 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_max, root, comm%handle, ierr)
16072 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
16073 IF (root == comm%mepos) msg = res
16074 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16080 CALL mp_timestop(handle)
16081 END SUBROUTINE mp_max_root_d
16091 SUBROUTINE mp_max_dv(msg, comm)
16092 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
16093 CLASS(mp_comm_type),
INTENT(IN) :: comm
16095 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_dv'
16098 #if defined(__parallel)
16099 INTEGER :: ierr, msglen
16102 CALL mp_timeset(routinen, handle)
16104 #if defined(__parallel)
16106 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_max, comm%handle, ierr)
16107 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16108 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16113 CALL mp_timestop(handle)
16114 END SUBROUTINE mp_max_dv
16124 SUBROUTINE mp_max_root_dm(msg, root, comm)
16125 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
16127 CLASS(mp_comm_type),
INTENT(IN) :: comm
16129 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_dm'
16132 #if defined(__parallel)
16133 INTEGER :: ierr, msglen
16134 REAL(kind=real_8) :: res(
SIZE(msg, 1),
SIZE(msg, 2))
16137 CALL mp_timeset(routinen, handle)
16139 #if defined(__parallel)
16141 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_max, root, comm%handle, ierr)
16142 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16143 IF (root == comm%mepos) msg = res
16144 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16150 CALL mp_timestop(handle)
16151 END SUBROUTINE mp_max_root_dm
16161 SUBROUTINE mp_min_d (msg, comm)
16162 REAL(kind=real_8),
INTENT(INOUT) :: msg
16163 CLASS(mp_comm_type),
INTENT(IN) :: comm
16165 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_d'
16168 #if defined(__parallel)
16169 INTEGER :: ierr, msglen
16172 CALL mp_timeset(routinen, handle)
16174 #if defined(__parallel)
16176 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_min, comm%handle, ierr)
16177 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16178 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16183 CALL mp_timestop(handle)
16184 END SUBROUTINE mp_min_d
16196 SUBROUTINE mp_min_dv(msg, comm)
16197 REAL(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
16198 CLASS(mp_comm_type),
INTENT(IN) :: comm
16200 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_dv'
16203 #if defined(__parallel)
16204 INTEGER :: ierr, msglen
16207 CALL mp_timeset(routinen, handle)
16209 #if defined(__parallel)
16211 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_min, comm%handle, ierr)
16212 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16213 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16218 CALL mp_timestop(handle)
16219 END SUBROUTINE mp_min_dv
16229 SUBROUTINE mp_prod_d (msg, comm)
16230 REAL(kind=real_8),
INTENT(INOUT) :: msg
16231 CLASS(mp_comm_type),
INTENT(IN) :: comm
16233 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_d'
16236 #if defined(__parallel)
16237 INTEGER :: ierr, msglen
16240 CALL mp_timeset(routinen, handle)
16242 #if defined(__parallel)
16244 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_prod, comm%handle, ierr)
16245 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16246 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16251 CALL mp_timestop(handle)
16252 END SUBROUTINE mp_prod_d
16263 SUBROUTINE mp_scatter_dv(msg_scatter, msg, root, comm)
16264 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
16265 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
16266 INTEGER,
INTENT(IN) :: root
16267 CLASS(mp_comm_type),
INTENT(IN) :: comm
16269 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_dv'
16272 #if defined(__parallel)
16273 INTEGER :: ierr, msglen
16276 CALL mp_timeset(routinen, handle)
16278 #if defined(__parallel)
16280 CALL mpi_scatter(msg_scatter, msglen, mpi_double_precision, msg, &
16281 msglen, mpi_double_precision, root, comm%handle, ierr)
16282 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
16283 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16289 CALL mp_timestop(handle)
16290 END SUBROUTINE mp_scatter_dv
16300 SUBROUTINE mp_iscatter_d (msg_scatter, msg, root, comm, request)
16301 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:)
16302 REAL(kind=real_8),
INTENT(INOUT) :: msg
16303 INTEGER,
INTENT(IN) :: root
16304 CLASS(mp_comm_type),
INTENT(IN) :: comm
16305 TYPE(mp_request_type),
INTENT(OUT) :: request
16307 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_d'
16310 #if defined(__parallel)
16311 INTEGER :: ierr, msglen
16314 CALL mp_timeset(routinen, handle)
16316 #if defined(__parallel)
16317 #if !defined(__GNUC__) || __GNUC__ >= 9
16318 cpassert(is_contiguous(msg_scatter))
16321 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_precision, msg, &
16322 msglen, mpi_double_precision, root, comm%handle, request%handle, ierr)
16323 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
16324 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16328 msg = msg_scatter(1)
16331 CALL mp_timestop(handle)
16332 END SUBROUTINE mp_iscatter_d
16342 SUBROUTINE mp_iscatter_dv2(msg_scatter, msg, root, comm, request)
16343 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:, :)
16344 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
16345 INTEGER,
INTENT(IN) :: root
16346 CLASS(mp_comm_type),
INTENT(IN) :: comm
16347 TYPE(mp_request_type),
INTENT(OUT) :: request
16349 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_dv2'
16352 #if defined(__parallel)
16353 INTEGER :: ierr, msglen
16356 CALL mp_timeset(routinen, handle)
16358 #if defined(__parallel)
16359 #if !defined(__GNUC__) || __GNUC__ >= 9
16360 cpassert(is_contiguous(msg_scatter))
16363 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_precision, msg, &
16364 msglen, mpi_double_precision, root, comm%handle, request%handle, ierr)
16365 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
16366 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16370 msg(:) = msg_scatter(:, 1)
16373 CALL mp_timestop(handle)
16374 END SUBROUTINE mp_iscatter_dv2
16384 SUBROUTINE mp_iscatterv_dv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
16385 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:)
16386 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
16387 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
16388 INTEGER,
INTENT(IN) :: recvcount, root
16389 CLASS(mp_comm_type),
INTENT(IN) :: comm
16390 TYPE(mp_request_type),
INTENT(OUT) :: request
16392 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_dv'
16395 #if defined(__parallel)
16399 CALL mp_timeset(routinen, handle)
16401 #if defined(__parallel)
16402 #if !defined(__GNUC__) || __GNUC__ >= 9
16403 cpassert(is_contiguous(msg_scatter))
16404 cpassert(is_contiguous(msg))
16405 cpassert(is_contiguous(sendcounts))
16406 cpassert(is_contiguous(displs))
16408 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_double_precision, msg, &
16409 recvcount, mpi_double_precision, root, comm%handle, request%handle, ierr)
16410 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
16411 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16413 mark_used(sendcounts)
16415 mark_used(recvcount)
16418 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
16421 CALL mp_timestop(handle)
16422 END SUBROUTINE mp_iscatterv_dv
16433 SUBROUTINE mp_gather_d (msg, msg_gather, root, comm)
16434 REAL(kind=real_8),
INTENT(IN) :: msg
16435 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16436 INTEGER,
INTENT(IN) :: root
16437 CLASS(mp_comm_type),
INTENT(IN) :: comm
16439 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_d'
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, root, 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)
16457 msg_gather(1) = msg
16459 CALL mp_timestop(handle)
16460 END SUBROUTINE mp_gather_d
16470 SUBROUTINE mp_gather_d_src(msg, msg_gather, comm)
16471 REAL(kind=real_8),
INTENT(IN) :: msg
16472 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16473 CLASS(mp_comm_type),
INTENT(IN) :: comm
16475 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_d_src'
16478 #if defined(__parallel)
16479 INTEGER :: ierr, msglen
16482 CALL mp_timeset(routinen, handle)
16484 #if defined(__parallel)
16486 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16487 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16488 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16489 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16492 msg_gather(1) = msg
16494 CALL mp_timestop(handle)
16495 END SUBROUTINE mp_gather_d_src
16509 SUBROUTINE mp_gather_dv(msg, msg_gather, root, comm)
16510 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
16511 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16512 INTEGER,
INTENT(IN) :: root
16513 CLASS(mp_comm_type),
INTENT(IN) :: comm
16515 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dv'
16518 #if defined(__parallel)
16519 INTEGER :: ierr, msglen
16522 CALL mp_timeset(routinen, handle)
16524 #if defined(__parallel)
16526 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16527 msglen, mpi_double_precision, root, comm%handle, ierr)
16528 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16529 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16535 CALL mp_timestop(handle)
16536 END SUBROUTINE mp_gather_dv
16549 SUBROUTINE mp_gather_dv_src(msg, msg_gather, comm)
16550 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
16551 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16552 CLASS(mp_comm_type),
INTENT(IN) :: comm
16554 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dv_src'
16557 #if defined(__parallel)
16558 INTEGER :: ierr, msglen
16561 CALL mp_timeset(routinen, handle)
16563 #if defined(__parallel)
16565 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16566 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16567 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16568 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16573 CALL mp_timestop(handle)
16574 END SUBROUTINE mp_gather_dv_src
16588 SUBROUTINE mp_gather_dm(msg, msg_gather, root, comm)
16589 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
16590 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
16591 INTEGER,
INTENT(IN) :: root
16592 CLASS(mp_comm_type),
INTENT(IN) :: comm
16594 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dm'
16597 #if defined(__parallel)
16598 INTEGER :: ierr, msglen
16601 CALL mp_timeset(routinen, handle)
16603 #if defined(__parallel)
16605 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16606 msglen, mpi_double_precision, root, comm%handle, ierr)
16607 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16608 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16614 CALL mp_timestop(handle)
16615 END SUBROUTINE mp_gather_dm
16628 SUBROUTINE mp_gather_dm_src(msg, msg_gather, comm)
16629 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
16630 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
16631 CLASS(mp_comm_type),
INTENT(IN) :: comm
16633 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dm_src'
16636 #if defined(__parallel)
16637 INTEGER :: ierr, msglen
16640 CALL mp_timeset(routinen, handle)
16642 #if defined(__parallel)
16644 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16645 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16646 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16647 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16652 CALL mp_timestop(handle)
16653 END SUBROUTINE mp_gather_dm_src
16670 SUBROUTINE mp_gatherv_dv(sendbuf, recvbuf, recvcounts, displs, root, comm)
16672 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16673 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16674 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16675 INTEGER,
INTENT(IN) :: root
16676 CLASS(mp_comm_type),
INTENT(IN) :: comm
16678 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dv'
16681 #if defined(__parallel)
16682 INTEGER :: ierr, sendcount
16685 CALL mp_timeset(routinen, handle)
16687 #if defined(__parallel)
16688 sendcount =
SIZE(sendbuf)
16689 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16690 recvbuf, recvcounts, displs, mpi_double_precision, &
16691 root, comm%handle, ierr)
16692 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16693 CALL add_perf(perf_id=4, &
16695 msg_size=sendcount*real_8_size)
16697 mark_used(recvcounts)
16700 recvbuf(1 + displs(1):) = sendbuf
16702 CALL mp_timestop(handle)
16703 END SUBROUTINE mp_gatherv_dv
16719 SUBROUTINE mp_gatherv_dv_src(sendbuf, recvbuf, recvcounts, displs, comm)
16721 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16722 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16723 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16724 CLASS(mp_comm_type),
INTENT(IN) :: comm
16726 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dv_src'
16729 #if defined(__parallel)
16730 INTEGER :: ierr, sendcount
16733 CALL mp_timeset(routinen, handle)
16735 #if defined(__parallel)
16736 sendcount =
SIZE(sendbuf)
16737 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16738 recvbuf, recvcounts, displs, mpi_double_precision, &
16739 comm%source, comm%handle, ierr)
16740 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16741 CALL add_perf(perf_id=4, &
16743 msg_size=sendcount*real_8_size)
16745 mark_used(recvcounts)
16747 recvbuf(1 + displs(1):) = sendbuf
16749 CALL mp_timestop(handle)
16750 END SUBROUTINE mp_gatherv_dv_src
16767 SUBROUTINE mp_gatherv_dm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
16769 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16770 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16771 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16772 INTEGER,
INTENT(IN) :: root
16773 CLASS(mp_comm_type),
INTENT(IN) :: comm
16775 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dm2'
16778 #if defined(__parallel)
16779 INTEGER :: ierr, sendcount
16782 CALL mp_timeset(routinen, handle)
16784 #if defined(__parallel)
16785 sendcount =
SIZE(sendbuf)
16786 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16787 recvbuf, recvcounts, displs, mpi_double_precision, &
16788 root, comm%handle, ierr)
16789 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16790 CALL add_perf(perf_id=4, &
16792 msg_size=sendcount*real_8_size)
16794 mark_used(recvcounts)
16797 recvbuf(:, 1 + displs(1):) = sendbuf
16799 CALL mp_timestop(handle)
16800 END SUBROUTINE mp_gatherv_dm2
16816 SUBROUTINE mp_gatherv_dm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
16818 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16819 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16820 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16821 CLASS(mp_comm_type),
INTENT(IN) :: comm
16823 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dm2_src'
16826 #if defined(__parallel)
16827 INTEGER :: ierr, sendcount
16830 CALL mp_timeset(routinen, handle)
16832 #if defined(__parallel)
16833 sendcount =
SIZE(sendbuf)
16834 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16835 recvbuf, recvcounts, displs, mpi_double_precision, &
16836 comm%source, comm%handle, ierr)
16837 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16838 CALL add_perf(perf_id=4, &
16840 msg_size=sendcount*real_8_size)
16842 mark_used(recvcounts)
16844 recvbuf(:, 1 + displs(1):) = sendbuf
16846 CALL mp_timestop(handle)
16847 END SUBROUTINE mp_gatherv_dm2_src
16864 SUBROUTINE mp_igatherv_dv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
16865 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
16866 REAL(kind=real_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
16867 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16868 INTEGER,
INTENT(IN) :: sendcount, root
16869 CLASS(mp_comm_type),
INTENT(IN) :: comm
16870 TYPE(mp_request_type),
INTENT(OUT) :: request
16872 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_dv'
16875 #if defined(__parallel)
16879 CALL mp_timeset(routinen, handle)
16881 #if defined(__parallel)
16882 #if !defined(__GNUC__) || __GNUC__ >= 9
16883 cpassert(is_contiguous(sendbuf))
16884 cpassert(is_contiguous(recvbuf))
16885 cpassert(is_contiguous(recvcounts))
16886 cpassert(is_contiguous(displs))
16888 CALL mpi_igatherv(sendbuf, sendcount, mpi_double_precision, &
16889 recvbuf, recvcounts, displs, mpi_double_precision, &
16890 root, comm%handle, request%handle, ierr)
16891 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16892 CALL add_perf(perf_id=24, &
16894 msg_size=sendcount*real_8_size)
16896 mark_used(sendcount)
16897 mark_used(recvcounts)
16900 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
16903 CALL mp_timestop(handle)
16904 END SUBROUTINE mp_igatherv_dv
16917 SUBROUTINE mp_allgather_d (msgout, msgin, comm)
16918 REAL(kind=real_8),
INTENT(IN) :: msgout
16919 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
16920 CLASS(mp_comm_type),
INTENT(IN) :: comm
16922 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d'
16925 #if defined(__parallel)
16926 INTEGER :: ierr, rcount, scount
16929 CALL mp_timeset(routinen, handle)
16931 #if defined(__parallel)
16934 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
16935 msgin, rcount, mpi_double_precision, &
16937 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16942 CALL mp_timestop(handle)
16943 END SUBROUTINE mp_allgather_d
16956 SUBROUTINE mp_allgather_d2(msgout, msgin, comm)
16957 REAL(kind=real_8),
INTENT(IN) :: msgout
16958 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
16959 CLASS(mp_comm_type),
INTENT(IN) :: comm
16961 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d2'
16964 #if defined(__parallel)
16965 INTEGER :: ierr, rcount, scount
16968 CALL mp_timeset(routinen, handle)
16970 #if defined(__parallel)
16973 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
16974 msgin, rcount, mpi_double_precision, &
16976 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
16981 CALL mp_timestop(handle)
16982 END SUBROUTINE mp_allgather_d2
16995 SUBROUTINE mp_iallgather_d (msgout, msgin, comm, request)
16996 REAL(kind=real_8),
INTENT(IN) :: msgout
16997 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
16998 CLASS(mp_comm_type),
INTENT(IN) :: comm
16999 TYPE(mp_request_type),
INTENT(OUT) :: request
17001 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d'
17004 #if defined(__parallel)
17005 INTEGER :: ierr, rcount, scount
17008 CALL mp_timeset(routinen, handle)
17010 #if defined(__parallel)
17011 #if !defined(__GNUC__) || __GNUC__ >= 9
17012 cpassert(is_contiguous(msgin))
17016 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17017 msgin, rcount, mpi_double_precision, &
17018 comm%handle, request%handle, ierr)
17019 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17025 CALL mp_timestop(handle)
17026 END SUBROUTINE mp_iallgather_d
17041 SUBROUTINE mp_allgather_d12(msgout, msgin, comm)
17042 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
17043 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
17044 CLASS(mp_comm_type),
INTENT(IN) :: comm
17046 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d12'
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_d12
17077 SUBROUTINE mp_allgather_d23(msgout, msgin, comm)
17078 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
17079 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
17080 CLASS(mp_comm_type),
INTENT(IN) :: comm
17082 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d23'
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_d23
17113 SUBROUTINE mp_allgather_d34(msgout, msgin, comm)
17114 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
17115 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
17116 CLASS(mp_comm_type),
INTENT(IN) :: comm
17118 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d34'
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(:, :, :, 1) = msgout(:, :, :)
17138 CALL mp_timestop(handle)
17139 END SUBROUTINE mp_allgather_d34
17149 SUBROUTINE mp_allgather_d22(msgout, msgin, comm)
17150 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
17151 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
17152 CLASS(mp_comm_type),
INTENT(IN) :: comm
17154 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d22'
17157 #if defined(__parallel)
17158 INTEGER :: ierr, rcount, scount
17161 CALL mp_timeset(routinen, handle)
17163 #if defined(__parallel)
17164 scount =
SIZE(msgout(:, :))
17166 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17167 msgin, rcount, mpi_double_precision, &
17169 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17172 msgin(:, :) = msgout(:, :)
17174 CALL mp_timestop(handle)
17175 END SUBROUTINE mp_allgather_d22
17186 SUBROUTINE mp_iallgather_d11(msgout, msgin, comm, request)
17187 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17188 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17189 CLASS(mp_comm_type),
INTENT(IN) :: comm
17190 TYPE(mp_request_type),
INTENT(OUT) :: request
17192 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d11'
17195 #if defined(__parallel)
17196 INTEGER :: ierr, rcount, scount
17199 CALL mp_timeset(routinen, handle)
17201 #if defined(__parallel)
17202 #if !defined(__GNUC__) || __GNUC__ >= 9
17203 cpassert(is_contiguous(msgout))
17204 cpassert(is_contiguous(msgin))
17206 scount =
SIZE(msgout(:))
17208 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17209 msgin, rcount, mpi_double_precision, &
17210 comm%handle, request%handle, ierr)
17211 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17217 CALL mp_timestop(handle)
17218 END SUBROUTINE mp_iallgather_d11
17229 SUBROUTINE mp_iallgather_d13(msgout, msgin, comm, request)
17230 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17231 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
17232 CLASS(mp_comm_type),
INTENT(IN) :: comm
17233 TYPE(mp_request_type),
INTENT(OUT) :: request
17235 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d13'
17238 #if defined(__parallel)
17239 INTEGER :: ierr, rcount, scount
17242 CALL mp_timeset(routinen, handle)
17244 #if defined(__parallel)
17245 #if !defined(__GNUC__) || __GNUC__ >= 9
17246 cpassert(is_contiguous(msgout))
17247 cpassert(is_contiguous(msgin))
17250 scount =
SIZE(msgout(:))
17252 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17253 msgin, rcount, mpi_double_precision, &
17254 comm%handle, request%handle, ierr)
17255 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17258 msgin(:, 1, 1) = msgout(:)
17261 CALL mp_timestop(handle)
17262 END SUBROUTINE mp_iallgather_d13
17273 SUBROUTINE mp_iallgather_d22(msgout, msgin, comm, request)
17274 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :)
17275 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :)
17276 CLASS(mp_comm_type),
INTENT(IN) :: comm
17277 TYPE(mp_request_type),
INTENT(OUT) :: request
17279 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d22'
17282 #if defined(__parallel)
17283 INTEGER :: ierr, rcount, scount
17286 CALL mp_timeset(routinen, handle)
17288 #if defined(__parallel)
17289 #if !defined(__GNUC__) || __GNUC__ >= 9
17290 cpassert(is_contiguous(msgout))
17291 cpassert(is_contiguous(msgin))
17294 scount =
SIZE(msgout(:, :))
17296 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17297 msgin, rcount, mpi_double_precision, &
17298 comm%handle, request%handle, ierr)
17299 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17302 msgin(:, :) = msgout(:, :)
17305 CALL mp_timestop(handle)
17306 END SUBROUTINE mp_iallgather_d22
17317 SUBROUTINE mp_iallgather_d24(msgout, msgin, comm, request)
17318 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :)
17319 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :, :)
17320 CLASS(mp_comm_type),
INTENT(IN) :: comm
17321 TYPE(mp_request_type),
INTENT(OUT) :: request
17323 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d24'
17326 #if defined(__parallel)
17327 INTEGER :: ierr, rcount, scount
17330 CALL mp_timeset(routinen, handle)
17332 #if defined(__parallel)
17333 #if !defined(__GNUC__) || __GNUC__ >= 9
17334 cpassert(is_contiguous(msgout))
17335 cpassert(is_contiguous(msgin))
17338 scount =
SIZE(msgout(:, :))
17340 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17341 msgin, rcount, mpi_double_precision, &
17342 comm%handle, request%handle, ierr)
17343 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17346 msgin(:, :, 1, 1) = msgout(:, :)
17349 CALL mp_timestop(handle)
17350 END SUBROUTINE mp_iallgather_d24
17361 SUBROUTINE mp_iallgather_d33(msgout, msgin, comm, request)
17362 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :, :)
17363 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
17364 CLASS(mp_comm_type),
INTENT(IN) :: comm
17365 TYPE(mp_request_type),
INTENT(OUT) :: request
17367 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d33'
17370 #if defined(__parallel)
17371 INTEGER :: ierr, rcount, scount
17374 CALL mp_timeset(routinen, handle)
17376 #if defined(__parallel)
17377 #if !defined(__GNUC__) || __GNUC__ >= 9
17378 cpassert(is_contiguous(msgout))
17379 cpassert(is_contiguous(msgin))
17382 scount =
SIZE(msgout(:, :, :))
17384 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17385 msgin, rcount, mpi_double_precision, &
17386 comm%handle, request%handle, ierr)
17387 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17390 msgin(:, :, :) = msgout(:, :, :)
17393 CALL mp_timestop(handle)
17394 END SUBROUTINE mp_iallgather_d33
17413 SUBROUTINE mp_allgatherv_dv(msgout, msgin, rcount, rdispl, comm)
17414 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
17415 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17416 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17417 CLASS(mp_comm_type),
INTENT(IN) :: comm
17419 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_dv'
17422 #if defined(__parallel)
17423 INTEGER :: ierr, scount
17426 CALL mp_timeset(routinen, handle)
17428 #if defined(__parallel)
17429 scount =
SIZE(msgout)
17430 CALL mpi_allgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17431 rdispl, mpi_double_precision, comm%handle, ierr)
17432 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
17439 CALL mp_timestop(handle)
17440 END SUBROUTINE mp_allgatherv_dv
17459 SUBROUTINE mp_allgatherv_dm2(msgout, msgin, rcount, rdispl, comm)
17460 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
17461 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
17462 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17463 CLASS(mp_comm_type),
INTENT(IN) :: comm
17465 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_dv'
17468 #if defined(__parallel)
17469 INTEGER :: ierr, scount
17472 CALL mp_timeset(routinen, handle)
17474 #if defined(__parallel)
17475 scount =
SIZE(msgout)
17476 CALL mpi_allgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17477 rdispl, mpi_double_precision, comm%handle, ierr)
17478 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
17485 CALL mp_timestop(handle)
17486 END SUBROUTINE mp_allgatherv_dm2
17505 SUBROUTINE mp_iallgatherv_dv(msgout, msgin, rcount, rdispl, comm, request)
17506 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17507 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17508 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17509 CLASS(mp_comm_type),
INTENT(IN) :: comm
17510 TYPE(mp_request_type),
INTENT(OUT) :: request
17512 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_dv'
17515 #if defined(__parallel)
17516 INTEGER :: ierr, scount, rsize
17519 CALL mp_timeset(routinen, handle)
17521 #if defined(__parallel)
17522 #if !defined(__GNUC__) || __GNUC__ >= 9
17523 cpassert(is_contiguous(msgout))
17524 cpassert(is_contiguous(msgin))
17525 cpassert(is_contiguous(rcount))
17526 cpassert(is_contiguous(rdispl))
17529 scount =
SIZE(msgout)
17530 rsize =
SIZE(rcount)
17531 CALL mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, &
17532 rdispl, comm, request, ierr)
17533 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
17541 CALL mp_timestop(handle)
17542 END SUBROUTINE mp_iallgatherv_dv
17561 SUBROUTINE mp_iallgatherv_dv2(msgout, msgin, rcount, rdispl, comm, request)
17562 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17563 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17564 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
17565 CLASS(mp_comm_type),
INTENT(IN) :: comm
17566 TYPE(mp_request_type),
INTENT(OUT) :: request
17568 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_dv2'
17571 #if defined(__parallel)
17572 INTEGER :: ierr, scount, rsize
17575 CALL mp_timeset(routinen, handle)
17577 #if defined(__parallel)
17578 #if !defined(__GNUC__) || __GNUC__ >= 9
17579 cpassert(is_contiguous(msgout))
17580 cpassert(is_contiguous(msgin))
17581 cpassert(is_contiguous(rcount))
17582 cpassert(is_contiguous(rdispl))
17585 scount =
SIZE(msgout)
17586 rsize =
SIZE(rcount)
17587 CALL mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, &
17588 rdispl, comm, request, ierr)
17589 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
17597 CALL mp_timestop(handle)
17598 END SUBROUTINE mp_iallgatherv_dv2
17609 #if defined(__parallel)
17610 SUBROUTINE mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
17611 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
17612 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17613 INTEGER,
INTENT(IN) :: rsize
17614 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
17615 CLASS(mp_comm_type),
INTENT(IN) :: comm
17616 TYPE(mp_request_type),
INTENT(OUT) :: request
17617 INTEGER,
INTENT(INOUT) :: ierr
17619 CALL mpi_iallgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17620 rdispl, mpi_double_precision, comm%handle, request%handle, ierr)
17622 END SUBROUTINE mp_iallgatherv_dv_internal
17633 SUBROUTINE mp_sum_scatter_dv(msgout, msgin, rcount, comm)
17634 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
17635 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17636 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
17637 CLASS(mp_comm_type),
INTENT(IN) :: comm
17639 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_dv'
17642 #if defined(__parallel)
17646 CALL mp_timeset(routinen, handle)
17648 #if defined(__parallel)
17649 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_double_precision, mpi_sum, &
17651 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
17653 CALL add_perf(perf_id=3, count=1, &
17654 msg_size=rcount(1)*2*real_8_size)
17658 msgin = msgout(:, 1)
17660 CALL mp_timestop(handle)
17661 END SUBROUTINE mp_sum_scatter_dv
17672 SUBROUTINE mp_sendrecv_d (msgin, dest, msgout, source, comm, tag)
17673 REAL(kind=real_8),
INTENT(IN) :: msgin
17674 INTEGER,
INTENT(IN) :: dest
17675 REAL(kind=real_8),
INTENT(OUT) :: msgout
17676 INTEGER,
INTENT(IN) :: source
17677 CLASS(mp_comm_type),
INTENT(IN) :: comm
17678 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17680 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_d'
17683 #if defined(__parallel)
17684 INTEGER :: ierr, msglen_in, msglen_out, &
17688 CALL mp_timeset(routinen, handle)
17690 #if defined(__parallel)
17695 IF (
PRESENT(tag))
THEN
17699 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17700 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17701 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17702 CALL add_perf(perf_id=7, count=1, &
17703 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17711 CALL mp_timestop(handle)
17712 END SUBROUTINE mp_sendrecv_d
17723 SUBROUTINE mp_sendrecv_dv(msgin, dest, msgout, source, comm, tag)
17724 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
17725 INTEGER,
INTENT(IN) :: dest
17726 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
17727 INTEGER,
INTENT(IN) :: source
17728 CLASS(mp_comm_type),
INTENT(IN) :: comm
17729 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17731 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dv'
17734 #if defined(__parallel)
17735 INTEGER :: ierr, msglen_in, msglen_out, &
17739 CALL mp_timeset(routinen, handle)
17741 #if defined(__parallel)
17742 msglen_in =
SIZE(msgin)
17743 msglen_out =
SIZE(msgout)
17746 IF (
PRESENT(tag))
THEN
17750 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17751 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17752 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17753 CALL add_perf(perf_id=7, count=1, &
17754 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17762 CALL mp_timestop(handle)
17763 END SUBROUTINE mp_sendrecv_dv
17775 SUBROUTINE mp_sendrecv_dm2(msgin, dest, msgout, source, comm, tag)
17776 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
17777 INTEGER,
INTENT(IN) :: dest
17778 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
17779 INTEGER,
INTENT(IN) :: source
17780 CLASS(mp_comm_type),
INTENT(IN) :: comm
17781 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17783 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm2'
17786 #if defined(__parallel)
17787 INTEGER :: ierr, msglen_in, msglen_out, &
17791 CALL mp_timeset(routinen, handle)
17793 #if defined(__parallel)
17794 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
17795 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
17798 IF (
PRESENT(tag))
THEN
17802 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17803 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17804 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17805 CALL add_perf(perf_id=7, count=1, &
17806 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17814 CALL mp_timestop(handle)
17815 END SUBROUTINE mp_sendrecv_dm2
17826 SUBROUTINE mp_sendrecv_dm3(msgin, dest, msgout, source, comm, tag)
17827 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
17828 INTEGER,
INTENT(IN) :: dest
17829 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
17830 INTEGER,
INTENT(IN) :: source
17831 CLASS(mp_comm_type),
INTENT(IN) :: comm
17832 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17834 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm3'
17837 #if defined(__parallel)
17838 INTEGER :: ierr, msglen_in, msglen_out, &
17842 CALL mp_timeset(routinen, handle)
17844 #if defined(__parallel)
17845 msglen_in =
SIZE(msgin)
17846 msglen_out =
SIZE(msgout)
17849 IF (
PRESENT(tag))
THEN
17853 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17854 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17855 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17856 CALL add_perf(perf_id=7, count=1, &
17857 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17865 CALL mp_timestop(handle)
17866 END SUBROUTINE mp_sendrecv_dm3
17877 SUBROUTINE mp_sendrecv_dm4(msgin, dest, msgout, source, comm, tag)
17878 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
17879 INTEGER,
INTENT(IN) :: dest
17880 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
17881 INTEGER,
INTENT(IN) :: source
17882 CLASS(mp_comm_type),
INTENT(IN) :: comm
17883 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17885 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm4'
17888 #if defined(__parallel)
17889 INTEGER :: ierr, msglen_in, msglen_out, &
17893 CALL mp_timeset(routinen, handle)
17895 #if defined(__parallel)
17896 msglen_in =
SIZE(msgin)
17897 msglen_out =
SIZE(msgout)
17900 IF (
PRESENT(tag))
THEN
17904 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17905 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17906 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17907 CALL add_perf(perf_id=7, count=1, &
17908 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17916 CALL mp_timestop(handle)
17917 END SUBROUTINE mp_sendrecv_dm4
17934 SUBROUTINE mp_isendrecv_d (msgin, dest, msgout, source, comm, send_request, &
17936 REAL(kind=real_8),
INTENT(IN) :: msgin
17937 INTEGER,
INTENT(IN) :: dest
17938 REAL(kind=real_8),
INTENT(INOUT) :: msgout
17939 INTEGER,
INTENT(IN) :: source
17940 CLASS(mp_comm_type),
INTENT(IN) :: comm
17941 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
17942 INTEGER,
INTENT(in),
OPTIONAL :: tag
17944 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_d'
17947 #if defined(__parallel)
17948 INTEGER :: ierr, my_tag
17951 CALL mp_timeset(routinen, handle)
17953 #if defined(__parallel)
17955 IF (
PRESENT(tag)) my_tag = tag
17957 CALL mpi_irecv(msgout, 1, mpi_double_precision, source, my_tag, &
17958 comm%handle, recv_request%handle, ierr)
17959 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
17961 CALL mpi_isend(msgin, 1, mpi_double_precision, dest, my_tag, &
17962 comm%handle, send_request%handle, ierr)
17963 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
17965 CALL add_perf(perf_id=8, count=1, msg_size=2*real_8_size)
17975 CALL mp_timestop(handle)
17976 END SUBROUTINE mp_isendrecv_d
17995 SUBROUTINE mp_isendrecv_dv(msgin, dest, msgout, source, comm, send_request, &
17997 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
17998 INTEGER,
INTENT(IN) :: dest
17999 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
18000 INTEGER,
INTENT(IN) :: source
18001 CLASS(mp_comm_type),
INTENT(IN) :: comm
18002 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
18003 INTEGER,
INTENT(in),
OPTIONAL :: tag
18005 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_dv'
18008 #if defined(__parallel)
18009 INTEGER :: ierr, msglen, my_tag
18010 REAL(kind=real_8) :: foo
18013 CALL mp_timeset(routinen, handle)
18015 #if defined(__parallel)
18016 #if !defined(__GNUC__) || __GNUC__ >= 9
18017 cpassert(is_contiguous(msgout))
18018 cpassert(is_contiguous(msgin))
18022 IF (
PRESENT(tag)) my_tag = tag
18024 msglen =
SIZE(msgout, 1)
18025 IF (msglen > 0)
THEN
18026 CALL mpi_irecv(msgout(1), msglen, mpi_double_precision, source, my_tag, &
18027 comm%handle, recv_request%handle, ierr)
18029 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18030 comm%handle, recv_request%handle, ierr)
18032 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18034 msglen =
SIZE(msgin, 1)
18035 IF (msglen > 0)
THEN
18036 CALL mpi_isend(msgin(1), msglen, mpi_double_precision, dest, my_tag, &
18037 comm%handle, send_request%handle, ierr)
18039 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18040 comm%handle, send_request%handle, ierr)
18042 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18044 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
18045 CALL add_perf(perf_id=8, count=1, msg_size=msglen*real_8_size)
18055 CALL mp_timestop(handle)
18056 END SUBROUTINE mp_isendrecv_dv
18071 SUBROUTINE mp_isend_dv(msgin, dest, comm, request, tag)
18072 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
18073 INTEGER,
INTENT(IN) :: dest
18074 CLASS(mp_comm_type),
INTENT(IN) :: comm
18075 TYPE(mp_request_type),
INTENT(out) :: request
18076 INTEGER,
INTENT(in),
OPTIONAL :: tag
18078 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dv'
18080 INTEGER :: handle, ierr
18081 #if defined(__parallel)
18082 INTEGER :: msglen, my_tag
18083 REAL(kind=real_8) :: foo(1)
18086 CALL mp_timeset(routinen, handle)
18088 #if defined(__parallel)
18089 #if !defined(__GNUC__) || __GNUC__ >= 9
18090 cpassert(is_contiguous(msgin))
18093 IF (
PRESENT(tag)) my_tag = tag
18095 msglen =
SIZE(msgin)
18096 IF (msglen > 0)
THEN
18097 CALL mpi_isend(msgin(1), msglen, mpi_double_precision, dest, my_tag, &
18098 comm%handle, request%handle, ierr)
18100 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18101 comm%handle, request%handle, ierr)
18103 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18105 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18114 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18116 CALL mp_timestop(handle)
18117 END SUBROUTINE mp_isend_dv
18134 SUBROUTINE mp_isend_dm2(msgin, dest, comm, request, tag)
18135 REAL(kind=real_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
18136 INTEGER,
INTENT(IN) :: dest
18137 CLASS(mp_comm_type),
INTENT(IN) :: comm
18138 TYPE(mp_request_type),
INTENT(out) :: request
18139 INTEGER,
INTENT(in),
OPTIONAL :: tag
18141 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm2'
18143 INTEGER :: handle, ierr
18144 #if defined(__parallel)
18145 INTEGER :: msglen, my_tag
18146 REAL(kind=real_8) :: foo(1)
18149 CALL mp_timeset(routinen, handle)
18151 #if defined(__parallel)
18152 #if !defined(__GNUC__) || __GNUC__ >= 9
18153 cpassert(is_contiguous(msgin))
18157 IF (
PRESENT(tag)) my_tag = tag
18159 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
18160 IF (msglen > 0)
THEN
18161 CALL mpi_isend(msgin(1, 1), msglen, mpi_double_precision, dest, my_tag, &
18162 comm%handle, request%handle, ierr)
18164 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18165 comm%handle, request%handle, ierr)
18167 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18169 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18178 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18180 CALL mp_timestop(handle)
18181 END SUBROUTINE mp_isend_dm2
18200 SUBROUTINE mp_isend_dm3(msgin, dest, comm, request, tag)
18201 REAL(kind=real_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
18202 INTEGER,
INTENT(IN) :: dest
18203 CLASS(mp_comm_type),
INTENT(IN) :: comm
18204 TYPE(mp_request_type),
INTENT(out) :: request
18205 INTEGER,
INTENT(in),
OPTIONAL :: tag
18207 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm3'
18209 INTEGER :: handle, ierr
18210 #if defined(__parallel)
18211 INTEGER :: msglen, my_tag
18212 REAL(kind=real_8) :: foo(1)
18215 CALL mp_timeset(routinen, handle)
18217 #if defined(__parallel)
18218 #if !defined(__GNUC__) || __GNUC__ >= 9
18219 cpassert(is_contiguous(msgin))
18223 IF (
PRESENT(tag)) my_tag = tag
18225 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
18226 IF (msglen > 0)
THEN
18227 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_double_precision, dest, my_tag, &
18228 comm%handle, request%handle, ierr)
18230 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18231 comm%handle, request%handle, ierr)
18233 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18235 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18244 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18246 CALL mp_timestop(handle)
18247 END SUBROUTINE mp_isend_dm3
18263 SUBROUTINE mp_isend_dm4(msgin, dest, comm, request, tag)
18264 REAL(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
18265 INTEGER,
INTENT(IN) :: dest
18266 CLASS(mp_comm_type),
INTENT(IN) :: comm
18267 TYPE(mp_request_type),
INTENT(out) :: request
18268 INTEGER,
INTENT(in),
OPTIONAL :: tag
18270 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm4'
18272 INTEGER :: handle, ierr
18273 #if defined(__parallel)
18274 INTEGER :: msglen, my_tag
18275 REAL(kind=real_8) :: foo(1)
18278 CALL mp_timeset(routinen, handle)
18280 #if defined(__parallel)
18281 #if !defined(__GNUC__) || __GNUC__ >= 9
18282 cpassert(is_contiguous(msgin))
18286 IF (
PRESENT(tag)) my_tag = tag
18288 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
18289 IF (msglen > 0)
THEN
18290 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_double_precision, dest, my_tag, &
18291 comm%handle, request%handle, ierr)
18293 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18294 comm%handle, request%handle, ierr)
18296 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18298 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18307 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18309 CALL mp_timestop(handle)
18310 END SUBROUTINE mp_isend_dm4
18326 SUBROUTINE mp_irecv_dv(msgout, source, comm, request, tag)
18327 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
18328 INTEGER,
INTENT(IN) :: source
18329 CLASS(mp_comm_type),
INTENT(IN) :: comm
18330 TYPE(mp_request_type),
INTENT(out) :: request
18331 INTEGER,
INTENT(in),
OPTIONAL :: tag
18333 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dv'
18336 #if defined(__parallel)
18337 INTEGER :: ierr, msglen, my_tag
18338 REAL(kind=real_8) :: foo(1)
18341 CALL mp_timeset(routinen, handle)
18343 #if defined(__parallel)
18344 #if !defined(__GNUC__) || __GNUC__ >= 9
18345 cpassert(is_contiguous(msgout))
18349 IF (
PRESENT(tag)) my_tag = tag
18351 msglen =
SIZE(msgout)
18352 IF (msglen > 0)
THEN
18353 CALL mpi_irecv(msgout(1), msglen, mpi_double_precision, source, my_tag, &
18354 comm%handle, request%handle, ierr)
18356 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18357 comm%handle, request%handle, ierr)
18359 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18361 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18363 cpabort(
"mp_irecv called in non parallel case")
18370 CALL mp_timestop(handle)
18371 END SUBROUTINE mp_irecv_dv
18388 SUBROUTINE mp_irecv_dm2(msgout, source, comm, request, tag)
18389 REAL(kind=real_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
18390 INTEGER,
INTENT(IN) :: source
18391 CLASS(mp_comm_type),
INTENT(IN) :: comm
18392 TYPE(mp_request_type),
INTENT(out) :: request
18393 INTEGER,
INTENT(in),
OPTIONAL :: tag
18395 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm2'
18398 #if defined(__parallel)
18399 INTEGER :: ierr, msglen, my_tag
18400 REAL(kind=real_8) :: foo(1)
18403 CALL mp_timeset(routinen, handle)
18405 #if defined(__parallel)
18406 #if !defined(__GNUC__) || __GNUC__ >= 9
18407 cpassert(is_contiguous(msgout))
18411 IF (
PRESENT(tag)) my_tag = tag
18413 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
18414 IF (msglen > 0)
THEN
18415 CALL mpi_irecv(msgout(1, 1), msglen, mpi_double_precision, source, my_tag, &
18416 comm%handle, request%handle, ierr)
18418 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18419 comm%handle, request%handle, ierr)
18421 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18423 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18430 cpabort(
"mp_irecv called in non parallel case")
18432 CALL mp_timestop(handle)
18433 END SUBROUTINE mp_irecv_dm2
18451 SUBROUTINE mp_irecv_dm3(msgout, source, comm, request, tag)
18452 REAL(kind=real_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
18453 INTEGER,
INTENT(IN) :: source
18454 CLASS(mp_comm_type),
INTENT(IN) :: comm
18455 TYPE(mp_request_type),
INTENT(out) :: request
18456 INTEGER,
INTENT(in),
OPTIONAL :: tag
18458 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm3'
18461 #if defined(__parallel)
18462 INTEGER :: ierr, msglen, my_tag
18463 REAL(kind=real_8) :: foo(1)
18466 CALL mp_timeset(routinen, handle)
18468 #if defined(__parallel)
18469 #if !defined(__GNUC__) || __GNUC__ >= 9
18470 cpassert(is_contiguous(msgout))
18474 IF (
PRESENT(tag)) my_tag = tag
18476 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
18477 IF (msglen > 0)
THEN
18478 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_double_precision, source, my_tag, &
18479 comm%handle, request%handle, ierr)
18481 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18482 comm%handle, request%handle, ierr)
18484 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
18486 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18493 cpabort(
"mp_irecv called in non parallel case")
18495 CALL mp_timestop(handle)
18496 END SUBROUTINE mp_irecv_dm3
18512 SUBROUTINE mp_irecv_dm4(msgout, source, comm, request, tag)
18513 REAL(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
18514 INTEGER,
INTENT(IN) :: source
18515 CLASS(mp_comm_type),
INTENT(IN) :: comm
18516 TYPE(mp_request_type),
INTENT(out) :: request
18517 INTEGER,
INTENT(in),
OPTIONAL :: tag
18519 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm4'
18522 #if defined(__parallel)
18523 INTEGER :: ierr, msglen, my_tag
18524 REAL(kind=real_8) :: foo(1)
18527 CALL mp_timeset(routinen, handle)
18529 #if defined(__parallel)
18530 #if !defined(__GNUC__) || __GNUC__ >= 9
18531 cpassert(is_contiguous(msgout))
18535 IF (
PRESENT(tag)) my_tag = tag
18537 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
18538 IF (msglen > 0)
THEN
18539 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_double_precision, source, my_tag, &
18540 comm%handle, request%handle, ierr)
18542 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18543 comm%handle, request%handle, ierr)
18545 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
18547 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18554 cpabort(
"mp_irecv called in non parallel case")
18556 CALL mp_timestop(handle)
18557 END SUBROUTINE mp_irecv_dm4
18569 SUBROUTINE mp_win_create_dv(base, comm, win)
18570 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
18571 TYPE(mp_comm_type),
INTENT(IN) :: comm
18572 CLASS(mp_win_type),
INTENT(INOUT) :: win
18574 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_dv'
18577 #if defined(__parallel)
18579 INTEGER(kind=mpi_address_kind) :: len
18580 REAL(kind=real_8) :: foo(1)
18583 CALL mp_timeset(routinen, handle)
18585 #if defined(__parallel)
18587 len =
SIZE(base)*real_8_size
18589 CALL mpi_win_create(base(1), len, real_8_size, mpi_info_null, comm%handle, win%handle, ierr)
18591 CALL mpi_win_create(foo, len, real_8_size, mpi_info_null, comm%handle, win%handle, ierr)
18593 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
18595 CALL add_perf(perf_id=20, count=1)
18599 win%handle = mp_win_null_handle
18601 CALL mp_timestop(handle)
18602 END SUBROUTINE mp_win_create_dv
18614 SUBROUTINE mp_rget_dv(base, source, win, win_data, myproc, disp, request, &
18615 origin_datatype, target_datatype)
18616 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
18617 INTEGER,
INTENT(IN) :: source
18618 CLASS(mp_win_type),
INTENT(IN) :: win
18619 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: win_data
18620 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
18621 TYPE(mp_request_type),
INTENT(OUT) :: request
18622 TYPE(mp_type_descriptor_type),
INTENT(IN),
OPTIONAL :: origin_datatype, target_datatype
18624 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_dv'
18627 #if defined(__parallel)
18628 INTEGER :: ierr, len, &
18629 origin_len, target_len
18630 LOGICAL :: do_local_copy
18631 INTEGER(kind=mpi_address_kind) :: disp_aint
18632 mpi_data_type :: handle_origin_datatype, handle_target_datatype
18635 CALL mp_timeset(routinen, handle)
18637 #if defined(__parallel)
18640 IF (
PRESENT(disp))
THEN
18641 disp_aint = int(disp, kind=mpi_address_kind)
18643 handle_origin_datatype = mpi_double_precision
18645 IF (
PRESENT(origin_datatype))
THEN
18646 handle_origin_datatype = origin_datatype%type_handle
18649 handle_target_datatype = mpi_double_precision
18651 IF (
PRESENT(target_datatype))
THEN
18652 handle_target_datatype = target_datatype%type_handle
18656 do_local_copy = .false.
18657 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
18658 IF (myproc .EQ. source) do_local_copy = .true.
18660 IF (do_local_copy)
THEN
18662 base(:) = win_data(disp_aint + 1:disp_aint + len)
18667 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
18668 target_len, handle_target_datatype, win%handle, request%handle, ierr)
18674 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
18676 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*real_8_size)
18681 mark_used(origin_datatype)
18682 mark_used(target_datatype)
18686 IF (
PRESENT(disp))
THEN
18687 base(:) = win_data(disp + 1:disp +
SIZE(base))
18689 base(:) = win_data(:
SIZE(base))
18693 CALL mp_timestop(handle)
18694 END SUBROUTINE mp_rget_dv
18704 result(type_descriptor)
18705 INTEGER,
INTENT(IN) :: count
18706 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
18707 TYPE(mp_type_descriptor_type) :: type_descriptor
18709 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_d'
18712 #if defined(__parallel)
18716 CALL mp_timeset(routinen, handle)
18718 #if defined(__parallel)
18719 CALL mpi_type_indexed(count, lengths, displs, mpi_double_precision, &
18720 type_descriptor%type_handle, ierr)
18722 cpabort(
"MPI_Type_Indexed @ "//routinen)
18723 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
18725 cpabort(
"MPI_Type_commit @ "//routinen)
18727 type_descriptor%type_handle = 3
18729 type_descriptor%length = count
18730 NULLIFY (type_descriptor%subtype)
18731 type_descriptor%vector_descriptor(1:2) = 1
18732 type_descriptor%has_indexing = .true.
18733 type_descriptor%index_descriptor%index => lengths
18734 type_descriptor%index_descriptor%chunks => displs
18736 CALL mp_timestop(handle)
18747 SUBROUTINE mp_allocate_d (DATA, len, stat)
18748 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
18749 INTEGER,
INTENT(IN) :: len
18750 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
18752 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allocate_d'
18754 INTEGER :: handle, ierr
18756 CALL mp_timeset(routinen, handle)
18758 #if defined(__parallel)
18760 CALL mp_alloc_mem(
DATA, len, stat=ierr)
18761 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
18762 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
18763 CALL add_perf(perf_id=15, count=1)
18765 ALLOCATE (
DATA(len), stat=ierr)
18766 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
18767 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
18769 IF (
PRESENT(stat)) stat = ierr
18770 CALL mp_timestop(handle)
18771 END SUBROUTINE mp_allocate_d
18779 SUBROUTINE mp_deallocate_d (DATA, stat)
18780 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
18781 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
18783 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_deallocate_d'
18786 #if defined(__parallel)
18790 CALL mp_timeset(routinen, handle)
18792 #if defined(__parallel)
18793 CALL mp_free_mem(
DATA, ierr)
18794 IF (
PRESENT(stat))
THEN
18797 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
18800 CALL add_perf(perf_id=15, count=1)
18803 IF (
PRESENT(stat)) stat = 0
18805 CALL mp_timestop(handle)
18806 END SUBROUTINE mp_deallocate_d
18819 SUBROUTINE mp_file_write_at_dv(fh, offset, msg, msglen)
18820 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
18821 CLASS(mp_file_type),
INTENT(IN) :: fh
18822 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18823 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18826 #if defined(__parallel)
18830 msg_len =
SIZE(msg)
18831 IF (
PRESENT(msglen)) msg_len = msglen
18832 #if defined(__parallel)
18833 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18835 cpabort(
"mpi_file_write_at_dv @ mp_file_write_at_dv")
18837 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18839 END SUBROUTINE mp_file_write_at_dv
18847 SUBROUTINE mp_file_write_at_d (fh, offset, msg)
18848 REAL(kind=real_8),
INTENT(IN) :: msg
18849 CLASS(mp_file_type),
INTENT(IN) :: fh
18850 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18852 #if defined(__parallel)
18856 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18858 cpabort(
"mpi_file_write_at_d @ mp_file_write_at_d")
18860 WRITE (unit=fh%handle, pos=offset + 1) msg
18862 END SUBROUTINE mp_file_write_at_d
18874 SUBROUTINE mp_file_write_at_all_dv(fh, offset, msg, msglen)
18875 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
18876 CLASS(mp_file_type),
INTENT(IN) :: fh
18877 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18878 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18881 #if defined(__parallel)
18885 msg_len =
SIZE(msg)
18886 IF (
PRESENT(msglen)) msg_len = msglen
18887 #if defined(__parallel)
18888 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18890 cpabort(
"mpi_file_write_at_all_dv @ mp_file_write_at_all_dv")
18892 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18894 END SUBROUTINE mp_file_write_at_all_dv
18902 SUBROUTINE mp_file_write_at_all_d (fh, offset, msg)
18903 REAL(kind=real_8),
INTENT(IN) :: msg
18904 CLASS(mp_file_type),
INTENT(IN) :: fh
18905 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18907 #if defined(__parallel)
18911 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18913 cpabort(
"mpi_file_write_at_all_d @ mp_file_write_at_all_d")
18915 WRITE (unit=fh%handle, pos=offset + 1) msg
18917 END SUBROUTINE mp_file_write_at_all_d
18930 SUBROUTINE mp_file_read_at_dv(fh, offset, msg, msglen)
18931 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
18932 CLASS(mp_file_type),
INTENT(IN) :: fh
18933 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18934 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18937 #if defined(__parallel)
18941 msg_len =
SIZE(msg)
18942 IF (
PRESENT(msglen)) msg_len = msglen
18943 #if defined(__parallel)
18944 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
18946 cpabort(
"mpi_file_read_at_dv @ mp_file_read_at_dv")
18948 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
18950 END SUBROUTINE mp_file_read_at_dv
18958 SUBROUTINE mp_file_read_at_d (fh, offset, msg)
18959 REAL(kind=real_8),
INTENT(OUT) :: msg
18960 CLASS(mp_file_type),
INTENT(IN) :: fh
18961 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18963 #if defined(__parallel)
18967 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
18969 cpabort(
"mpi_file_read_at_d @ mp_file_read_at_d")
18971 READ (unit=fh%handle, pos=offset + 1) msg
18973 END SUBROUTINE mp_file_read_at_d
18985 SUBROUTINE mp_file_read_at_all_dv(fh, offset, msg, msglen)
18986 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
18987 CLASS(mp_file_type),
INTENT(IN) :: fh
18988 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
18989 INTEGER(kind=file_offset),
INTENT(IN) :: offset
18992 #if defined(__parallel)
18996 msg_len =
SIZE(msg)
18997 IF (
PRESENT(msglen)) msg_len = msglen
18998 #if defined(__parallel)
18999 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
19001 cpabort(
"mpi_file_read_at_all_dv @ mp_file_read_at_all_dv")
19003 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
19005 END SUBROUTINE mp_file_read_at_all_dv
19013 SUBROUTINE mp_file_read_at_all_d (fh, offset, msg)
19014 REAL(kind=real_8),
INTENT(OUT) :: msg
19015 CLASS(mp_file_type),
INTENT(IN) :: fh
19016 INTEGER(kind=file_offset),
INTENT(IN) :: offset
19018 #if defined(__parallel)
19022 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
19024 cpabort(
"mpi_file_read_at_all_d @ mp_file_read_at_all_d")
19026 READ (unit=fh%handle, pos=offset + 1) msg
19028 END SUBROUTINE mp_file_read_at_all_d
19037 FUNCTION mp_type_make_d (ptr, &
19038 vector_descriptor, index_descriptor) &
19039 result(type_descriptor)
19040 REAL(kind=real_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
19041 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
19042 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
19043 TYPE(mp_type_descriptor_type) :: type_descriptor
19045 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_d'
19047 #if defined(__parallel)
19051 NULLIFY (type_descriptor%subtype)
19052 type_descriptor%length =
SIZE(ptr)
19053 #if defined(__parallel)
19054 type_descriptor%type_handle = mpi_double_precision
19055 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
19057 cpabort(
"MPI_Get_address @ "//routinen)
19059 type_descriptor%type_handle = 3
19061 type_descriptor%vector_descriptor(1:2) = 1
19062 type_descriptor%has_indexing = .false.
19063 type_descriptor%data_d => ptr
19064 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
19065 cpabort(routinen//
": Vectors and indices NYI")
19067 END FUNCTION mp_type_make_d
19076 SUBROUTINE mp_alloc_mem_d (DATA, len, stat)
19077 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
19078 INTEGER,
INTENT(IN) :: len
19079 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
19081 #if defined(__parallel)
19082 INTEGER :: size, ierr, length, &
19084 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
19085 TYPE(c_ptr) :: mp_baseptr
19086 mpi_info_type :: mp_info
19088 length = max(len, 1)
19089 CALL mpi_type_size(mpi_double_precision,
size, ierr)
19090 mp_size = int(length, kind=mpi_address_kind)*
size
19091 IF (mp_size .GT. mp_max_memory_size)
THEN
19092 cpabort(
"MPI cannot allocate more than 2 GiByte")
19094 mp_info = mpi_info_null
19095 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
19096 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
19097 IF (
PRESENT(stat)) stat = mp_res
19099 INTEGER :: length, mystat
19100 length = max(len, 1)
19101 IF (
PRESENT(stat))
THEN
19102 ALLOCATE (
DATA(length), stat=mystat)
19105 ALLOCATE (
DATA(length))
19108 END SUBROUTINE mp_alloc_mem_d
19116 SUBROUTINE mp_free_mem_d (DATA, stat)
19117 REAL(kind=real_8),
DIMENSION(:), &
19118 POINTER, asynchronous ::
DATA
19119 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
19121 #if defined(__parallel)
19123 CALL mpi_free_mem(
DATA, mp_res)
19124 IF (
PRESENT(stat)) stat = mp_res
19127 IF (
PRESENT(stat)) stat = 0
19129 END SUBROUTINE mp_free_mem_d
19141 SUBROUTINE mp_shift_rm(msg, comm, displ_in)
19143 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
19144 CLASS(mp_comm_type),
INTENT(IN) :: comm
19145 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
19147 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_rm'
19149 INTEGER :: handle, ierror
19150 #if defined(__parallel)
19151 INTEGER :: displ, left, &
19152 msglen, myrank, nprocs, &
19157 CALL mp_timeset(routinen, handle)
19159 #if defined(__parallel)
19160 CALL mpi_comm_rank(comm%handle, myrank, ierror)
19161 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
19162 CALL mpi_comm_size(comm%handle, nprocs, ierror)
19163 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
19164 IF (
PRESENT(displ_in))
THEN
19169 right =
modulo(myrank + displ, nprocs)
19170 left =
modulo(myrank - displ, nprocs)
19173 CALL mpi_sendrecv_replace(msg, msglen, mpi_real, right, tag, left, tag, &
19174 comm%handle, mpi_status_ignore, ierror)
19175 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
19176 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_4_size)
19180 mark_used(displ_in)
19182 CALL mp_timestop(handle)
19184 END SUBROUTINE mp_shift_rm
19197 SUBROUTINE mp_shift_r (msg, comm, displ_in)
19199 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
19200 CLASS(mp_comm_type),
INTENT(IN) :: comm
19201 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
19203 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_r'
19205 INTEGER :: handle, ierror
19206 #if defined(__parallel)
19207 INTEGER :: displ, left, &
19208 msglen, myrank, nprocs, &
19213 CALL mp_timeset(routinen, handle)
19215 #if defined(__parallel)
19216 CALL mpi_comm_rank(comm%handle, myrank, ierror)
19217 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
19218 CALL mpi_comm_size(comm%handle, nprocs, ierror)
19219 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
19220 IF (
PRESENT(displ_in))
THEN
19225 right =
modulo(myrank + displ, nprocs)
19226 left =
modulo(myrank - displ, nprocs)
19229 CALL mpi_sendrecv_replace(msg, msglen, mpi_real, right, tag, left, &
19230 tag, comm%handle, mpi_status_ignore, ierror)
19231 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
19232 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_4_size)
19236 mark_used(displ_in)
19238 CALL mp_timestop(handle)
19240 END SUBROUTINE mp_shift_r
19261 SUBROUTINE mp_alltoall_r11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
19263 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
19264 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
19265 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
19266 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
19267 CLASS(mp_comm_type),
INTENT(IN) :: comm
19269 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r11v'
19272 #if defined(__parallel)
19273 INTEGER :: ierr, msglen
19278 CALL mp_timeset(routinen, handle)
19280 #if defined(__parallel)
19281 CALL mpi_alltoallv(sb, scount, sdispl, mpi_real, &
19282 rb, rcount, rdispl, mpi_real, comm%handle, ierr)
19283 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
19284 msglen = sum(scount) + sum(rcount)
19285 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19291 DO i = 1, rcount(1)
19292 rb(rdispl(1) + i) = sb(sdispl(1) + i)
19295 CALL mp_timestop(handle)
19297 END SUBROUTINE mp_alltoall_r11v
19312 SUBROUTINE mp_alltoall_r22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
19314 REAL(kind=real_4),
DIMENSION(:, :), &
19315 INTENT(IN),
CONTIGUOUS :: sb
19316 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
19317 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS, &
19318 INTENT(INOUT) :: rb
19319 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
19320 CLASS(mp_comm_type),
INTENT(IN) :: comm
19322 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r22v'
19325 #if defined(__parallel)
19326 INTEGER :: ierr, msglen
19329 CALL mp_timeset(routinen, handle)
19331 #if defined(__parallel)
19332 CALL mpi_alltoallv(sb, scount, sdispl, mpi_real, &
19333 rb, rcount, rdispl, mpi_real, comm%handle, ierr)
19334 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
19335 msglen = sum(scount) + sum(rcount)
19336 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*real_4_size)
19345 CALL mp_timestop(handle)
19347 END SUBROUTINE mp_alltoall_r22v
19364 SUBROUTINE mp_alltoall_r (sb, rb, count, comm)
19366 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
19367 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
19368 INTEGER,
INTENT(IN) :: count
19369 CLASS(mp_comm_type),
INTENT(IN) :: comm
19371 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r'
19374 #if defined(__parallel)
19375 INTEGER :: ierr, msglen, np
19378 CALL mp_timeset(routinen, handle)
19380 #if defined(__parallel)
19381 CALL mpi_alltoall(sb, count, mpi_real, &
19382 rb, count, mpi_real, comm%handle, ierr)
19383 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19384 CALL mpi_comm_size(comm%handle, np, ierr)
19385 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19386 msglen = 2*count*np
19387 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19393 CALL mp_timestop(handle)
19395 END SUBROUTINE mp_alltoall_r
19405 SUBROUTINE mp_alltoall_r22(sb, rb, count, comm)
19407 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
19408 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
19409 INTEGER,
INTENT(IN) :: count
19410 CLASS(mp_comm_type),
INTENT(IN) :: comm
19412 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r22'
19415 #if defined(__parallel)
19416 INTEGER :: ierr, msglen, np
19419 CALL mp_timeset(routinen, handle)
19421 #if defined(__parallel)
19422 CALL mpi_alltoall(sb, count, mpi_real, &
19423 rb, count, mpi_real, comm%handle, ierr)
19424 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19425 CALL mpi_comm_size(comm%handle, np, ierr)
19426 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19427 msglen = 2*
SIZE(sb)*np
19428 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19434 CALL mp_timestop(handle)
19436 END SUBROUTINE mp_alltoall_r22
19446 SUBROUTINE mp_alltoall_r33(sb, rb, count, comm)
19448 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
19449 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
19450 INTEGER,
INTENT(IN) :: count
19451 CLASS(mp_comm_type),
INTENT(IN) :: comm
19453 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r33'
19456 #if defined(__parallel)
19457 INTEGER :: ierr, msglen, np
19460 CALL mp_timeset(routinen, handle)
19462 #if defined(__parallel)
19463 CALL mpi_alltoall(sb, count, mpi_real, &
19464 rb, count, mpi_real, comm%handle, ierr)
19465 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19466 CALL mpi_comm_size(comm%handle, np, ierr)
19467 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19468 msglen = 2*count*np
19469 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19475 CALL mp_timestop(handle)
19477 END SUBROUTINE mp_alltoall_r33
19487 SUBROUTINE mp_alltoall_r44(sb, rb, count, comm)
19489 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19491 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19493 INTEGER,
INTENT(IN) :: count
19494 CLASS(mp_comm_type),
INTENT(IN) :: comm
19496 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r44'
19499 #if defined(__parallel)
19500 INTEGER :: ierr, msglen, np
19503 CALL mp_timeset(routinen, handle)
19505 #if defined(__parallel)
19506 CALL mpi_alltoall(sb, count, mpi_real, &
19507 rb, count, mpi_real, comm%handle, ierr)
19508 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19509 CALL mpi_comm_size(comm%handle, np, ierr)
19510 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19511 msglen = 2*count*np
19512 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19518 CALL mp_timestop(handle)
19520 END SUBROUTINE mp_alltoall_r44
19530 SUBROUTINE mp_alltoall_r55(sb, rb, count, comm)
19532 REAL(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
19534 REAL(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
19536 INTEGER,
INTENT(IN) :: count
19537 CLASS(mp_comm_type),
INTENT(IN) :: comm
19539 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r55'
19542 #if defined(__parallel)
19543 INTEGER :: ierr, msglen, np
19546 CALL mp_timeset(routinen, handle)
19548 #if defined(__parallel)
19549 CALL mpi_alltoall(sb, count, mpi_real, &
19550 rb, count, mpi_real, comm%handle, ierr)
19551 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19552 CALL mpi_comm_size(comm%handle, np, ierr)
19553 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19554 msglen = 2*count*np
19555 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19561 CALL mp_timestop(handle)
19563 END SUBROUTINE mp_alltoall_r55
19574 SUBROUTINE mp_alltoall_r45(sb, rb, count, comm)
19576 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19578 REAL(kind=real_4), &
19579 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
19580 INTEGER,
INTENT(IN) :: count
19581 CLASS(mp_comm_type),
INTENT(IN) :: comm
19583 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r45'
19586 #if defined(__parallel)
19587 INTEGER :: ierr, msglen, np
19590 CALL mp_timeset(routinen, handle)
19592 #if defined(__parallel)
19593 CALL mpi_alltoall(sb, count, mpi_real, &
19594 rb, count, mpi_real, comm%handle, ierr)
19595 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19596 CALL mpi_comm_size(comm%handle, np, ierr)
19597 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19598 msglen = 2*count*np
19599 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19603 rb = reshape(sb, shape(rb))
19605 CALL mp_timestop(handle)
19607 END SUBROUTINE mp_alltoall_r45
19618 SUBROUTINE mp_alltoall_r34(sb, rb, count, comm)
19620 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
19622 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19624 INTEGER,
INTENT(IN) :: count
19625 CLASS(mp_comm_type),
INTENT(IN) :: comm
19627 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r34'
19630 #if defined(__parallel)
19631 INTEGER :: ierr, msglen, np
19634 CALL mp_timeset(routinen, handle)
19636 #if defined(__parallel)
19637 CALL mpi_alltoall(sb, count, mpi_real, &
19638 rb, count, mpi_real, comm%handle, ierr)
19639 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19640 CALL mpi_comm_size(comm%handle, np, ierr)
19641 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19642 msglen = 2*count*np
19643 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19647 rb = reshape(sb, shape(rb))
19649 CALL mp_timestop(handle)
19651 END SUBROUTINE mp_alltoall_r34
19662 SUBROUTINE mp_alltoall_r54(sb, rb, count, comm)
19664 REAL(kind=real_4), &
19665 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
19666 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19668 INTEGER,
INTENT(IN) :: count
19669 CLASS(mp_comm_type),
INTENT(IN) :: comm
19671 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r54'
19674 #if defined(__parallel)
19675 INTEGER :: ierr, msglen, np
19678 CALL mp_timeset(routinen, handle)
19680 #if defined(__parallel)
19681 CALL mpi_alltoall(sb, count, mpi_real, &
19682 rb, count, mpi_real, comm%handle, ierr)
19683 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19684 CALL mpi_comm_size(comm%handle, np, ierr)
19685 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19686 msglen = 2*count*np
19687 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19691 rb = reshape(sb, shape(rb))
19693 CALL mp_timestop(handle)
19695 END SUBROUTINE mp_alltoall_r54
19706 SUBROUTINE mp_send_r (msg, dest, tag, comm)
19707 REAL(kind=real_4),
INTENT(IN) :: msg
19708 INTEGER,
INTENT(IN) :: dest, tag
19709 CLASS(mp_comm_type),
INTENT(IN) :: comm
19711 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_r'
19714 #if defined(__parallel)
19715 INTEGER :: ierr, msglen
19718 CALL mp_timeset(routinen, handle)
19720 #if defined(__parallel)
19722 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19723 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19724 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19731 cpabort(
"not in parallel mode")
19733 CALL mp_timestop(handle)
19734 END SUBROUTINE mp_send_r
19744 SUBROUTINE mp_send_rv(msg, dest, tag, comm)
19745 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
19746 INTEGER,
INTENT(IN) :: dest, tag
19747 CLASS(mp_comm_type),
INTENT(IN) :: comm
19749 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_rv'
19752 #if defined(__parallel)
19753 INTEGER :: ierr, msglen
19756 CALL mp_timeset(routinen, handle)
19758 #if defined(__parallel)
19760 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19761 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19762 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19769 cpabort(
"not in parallel mode")
19771 CALL mp_timestop(handle)
19772 END SUBROUTINE mp_send_rv
19782 SUBROUTINE mp_send_rm2(msg, dest, tag, comm)
19783 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
19784 INTEGER,
INTENT(IN) :: dest, tag
19785 CLASS(mp_comm_type),
INTENT(IN) :: comm
19787 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_rm2'
19790 #if defined(__parallel)
19791 INTEGER :: ierr, msglen
19794 CALL mp_timeset(routinen, handle)
19796 #if defined(__parallel)
19798 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19799 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19800 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19807 cpabort(
"not in parallel mode")
19809 CALL mp_timestop(handle)
19810 END SUBROUTINE mp_send_rm2
19820 SUBROUTINE mp_send_rm3(msg, dest, tag, comm)
19821 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
19822 INTEGER,
INTENT(IN) :: dest, tag
19823 CLASS(mp_comm_type),
INTENT(IN) :: comm
19825 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
19828 #if defined(__parallel)
19829 INTEGER :: ierr, msglen
19832 CALL mp_timeset(routinen, handle)
19834 #if defined(__parallel)
19836 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19837 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19838 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19845 cpabort(
"not in parallel mode")
19847 CALL mp_timestop(handle)
19848 END SUBROUTINE mp_send_rm3
19859 SUBROUTINE mp_recv_r (msg, source, tag, comm)
19860 REAL(kind=real_4),
INTENT(INOUT) :: msg
19861 INTEGER,
INTENT(INOUT) :: source, tag
19862 CLASS(mp_comm_type),
INTENT(IN) :: comm
19864 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_r'
19867 #if defined(__parallel)
19868 INTEGER :: ierr, msglen
19869 mpi_status_type :: status
19872 CALL mp_timeset(routinen, handle)
19874 #if defined(__parallel)
19877 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19878 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19880 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19881 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19882 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19883 source = status mpi_status_extract(mpi_source)
19884 tag = status mpi_status_extract(mpi_tag)
19892 cpabort(
"not in parallel mode")
19894 CALL mp_timestop(handle)
19895 END SUBROUTINE mp_recv_r
19905 SUBROUTINE mp_recv_rv(msg, source, tag, comm)
19906 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
19907 INTEGER,
INTENT(INOUT) :: source, tag
19908 CLASS(mp_comm_type),
INTENT(IN) :: comm
19910 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rv'
19913 #if defined(__parallel)
19914 INTEGER :: ierr, msglen
19915 mpi_status_type :: status
19918 CALL mp_timeset(routinen, handle)
19920 #if defined(__parallel)
19923 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19924 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19926 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19927 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19928 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19929 source = status mpi_status_extract(mpi_source)
19930 tag = status mpi_status_extract(mpi_tag)
19938 cpabort(
"not in parallel mode")
19940 CALL mp_timestop(handle)
19941 END SUBROUTINE mp_recv_rv
19951 SUBROUTINE mp_recv_rm2(msg, source, tag, comm)
19952 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
19953 INTEGER,
INTENT(INOUT) :: source, tag
19954 CLASS(mp_comm_type),
INTENT(IN) :: comm
19956 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rm2'
19959 #if defined(__parallel)
19960 INTEGER :: ierr, msglen
19961 mpi_status_type :: status
19964 CALL mp_timeset(routinen, handle)
19966 #if defined(__parallel)
19969 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
19970 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19972 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
19973 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
19974 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
19975 source = status mpi_status_extract(mpi_source)
19976 tag = status mpi_status_extract(mpi_tag)
19984 cpabort(
"not in parallel mode")
19986 CALL mp_timestop(handle)
19987 END SUBROUTINE mp_recv_rm2
19997 SUBROUTINE mp_recv_rm3(msg, source, tag, comm)
19998 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
19999 INTEGER,
INTENT(INOUT) :: source, tag
20000 CLASS(mp_comm_type),
INTENT(IN) :: comm
20002 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rm3'
20005 #if defined(__parallel)
20006 INTEGER :: ierr, msglen
20007 mpi_status_type :: status
20010 CALL mp_timeset(routinen, handle)
20012 #if defined(__parallel)
20015 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
20016 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
20018 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
20019 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
20020 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
20021 source = status mpi_status_extract(mpi_source)
20022 tag = status mpi_status_extract(mpi_tag)
20030 cpabort(
"not in parallel mode")
20032 CALL mp_timestop(handle)
20033 END SUBROUTINE mp_recv_rm3
20043 SUBROUTINE mp_bcast_r (msg, source, comm)
20044 REAL(kind=real_4),
INTENT(INOUT) :: msg
20045 INTEGER,
INTENT(IN) :: source
20046 CLASS(mp_comm_type),
INTENT(IN) :: comm
20048 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r'
20051 #if defined(__parallel)
20052 INTEGER :: ierr, msglen
20055 CALL mp_timeset(routinen, handle)
20057 #if defined(__parallel)
20059 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20060 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20061 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20067 CALL mp_timestop(handle)
20068 END SUBROUTINE mp_bcast_r
20077 SUBROUTINE mp_bcast_r_src(msg, comm)
20078 REAL(kind=real_4),
INTENT(INOUT) :: msg
20079 CLASS(mp_comm_type),
INTENT(IN) :: comm
20081 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r_src'
20084 #if defined(__parallel)
20085 INTEGER :: ierr, msglen
20088 CALL mp_timeset(routinen, handle)
20090 #if defined(__parallel)
20092 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20093 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20094 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20099 CALL mp_timestop(handle)
20100 END SUBROUTINE mp_bcast_r_src
20110 SUBROUTINE mp_ibcast_r (msg, source, comm, request)
20111 REAL(kind=real_4),
INTENT(INOUT) :: msg
20112 INTEGER,
INTENT(IN) :: source
20113 CLASS(mp_comm_type),
INTENT(IN) :: comm
20114 TYPE(mp_request_type),
INTENT(OUT) :: request
20116 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_r'
20119 #if defined(__parallel)
20120 INTEGER :: ierr, msglen
20123 CALL mp_timeset(routinen, handle)
20125 #if defined(__parallel)
20127 CALL mpi_ibcast(msg, msglen, mpi_real, source, comm%handle, request%handle, ierr)
20128 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
20129 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_4_size)
20136 CALL mp_timestop(handle)
20137 END SUBROUTINE mp_ibcast_r
20146 SUBROUTINE mp_bcast_rv(msg, source, comm)
20147 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20148 INTEGER,
INTENT(IN) :: source
20149 CLASS(mp_comm_type),
INTENT(IN) :: comm
20151 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rv'
20154 #if defined(__parallel)
20155 INTEGER :: ierr, msglen
20158 CALL mp_timeset(routinen, handle)
20160 #if defined(__parallel)
20162 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20163 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20164 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20170 CALL mp_timestop(handle)
20171 END SUBROUTINE mp_bcast_rv
20179 SUBROUTINE mp_bcast_rv_src(msg, comm)
20180 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20181 CLASS(mp_comm_type),
INTENT(IN) :: comm
20183 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rv_src'
20186 #if defined(__parallel)
20187 INTEGER :: ierr, msglen
20190 CALL mp_timeset(routinen, handle)
20192 #if defined(__parallel)
20194 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20195 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20196 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20201 CALL mp_timestop(handle)
20202 END SUBROUTINE mp_bcast_rv_src
20211 SUBROUTINE mp_ibcast_rv(msg, source, comm, request)
20212 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
20213 INTEGER,
INTENT(IN) :: source
20214 CLASS(mp_comm_type),
INTENT(IN) :: comm
20215 TYPE(mp_request_type) :: request
20217 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_rv'
20220 #if defined(__parallel)
20221 INTEGER :: ierr, msglen
20224 CALL mp_timeset(routinen, handle)
20226 #if defined(__parallel)
20227 #if !defined(__GNUC__) || __GNUC__ >= 9
20228 cpassert(is_contiguous(msg))
20231 CALL mpi_ibcast(msg, msglen, mpi_real, source, comm%handle, request%handle, ierr)
20232 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
20233 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_4_size)
20240 CALL mp_timestop(handle)
20241 END SUBROUTINE mp_ibcast_rv
20250 SUBROUTINE mp_bcast_rm(msg, source, comm)
20251 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20252 INTEGER,
INTENT(IN) :: source
20253 CLASS(mp_comm_type),
INTENT(IN) :: comm
20255 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rm'
20258 #if defined(__parallel)
20259 INTEGER :: ierr, msglen
20262 CALL mp_timeset(routinen, handle)
20264 #if defined(__parallel)
20266 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20267 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20268 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20274 CALL mp_timestop(handle)
20275 END SUBROUTINE mp_bcast_rm
20284 SUBROUTINE mp_bcast_rm_src(msg, comm)
20285 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20286 CLASS(mp_comm_type),
INTENT(IN) :: comm
20288 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rm_src'
20291 #if defined(__parallel)
20292 INTEGER :: ierr, msglen
20295 CALL mp_timeset(routinen, handle)
20297 #if defined(__parallel)
20299 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20300 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20301 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20306 CALL mp_timestop(handle)
20307 END SUBROUTINE mp_bcast_rm_src
20316 SUBROUTINE mp_bcast_r3(msg, source, comm)
20317 REAL(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
20318 INTEGER,
INTENT(IN) :: source
20319 CLASS(mp_comm_type),
INTENT(IN) :: comm
20321 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r3'
20324 #if defined(__parallel)
20325 INTEGER :: ierr, msglen
20328 CALL mp_timeset(routinen, handle)
20330 #if defined(__parallel)
20332 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20333 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20334 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20340 CALL mp_timestop(handle)
20341 END SUBROUTINE mp_bcast_r3
20350 SUBROUTINE mp_bcast_r3_src(msg, comm)
20351 REAL(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
20352 CLASS(mp_comm_type),
INTENT(IN) :: comm
20354 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r3_src'
20357 #if defined(__parallel)
20358 INTEGER :: ierr, msglen
20361 CALL mp_timeset(routinen, handle)
20363 #if defined(__parallel)
20365 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20366 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20367 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20372 CALL mp_timestop(handle)
20373 END SUBROUTINE mp_bcast_r3_src
20382 SUBROUTINE mp_sum_r (msg, comm)
20383 REAL(kind=real_4),
INTENT(INOUT) :: msg
20384 CLASS(mp_comm_type),
INTENT(IN) :: comm
20386 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_r'
20389 #if defined(__parallel)
20390 INTEGER :: ierr, msglen
20393 CALL mp_timeset(routinen, handle)
20395 #if defined(__parallel)
20397 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20398 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20399 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20404 CALL mp_timestop(handle)
20405 END SUBROUTINE mp_sum_r
20413 SUBROUTINE mp_sum_rv(msg, comm)
20414 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20415 CLASS(mp_comm_type),
INTENT(IN) :: comm
20417 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rv'
20420 #if defined(__parallel)
20421 INTEGER :: ierr, msglen
20424 CALL mp_timeset(routinen, handle)
20426 #if defined(__parallel)
20428 IF (msglen > 0)
THEN
20429 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20430 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20432 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20437 CALL mp_timestop(handle)
20438 END SUBROUTINE mp_sum_rv
20446 SUBROUTINE mp_isum_rv(msg, comm, request)
20447 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
20448 CLASS(mp_comm_type),
INTENT(IN) :: comm
20449 TYPE(mp_request_type),
INTENT(OUT) :: request
20451 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_rv'
20454 #if defined(__parallel)
20455 INTEGER :: ierr, msglen
20458 CALL mp_timeset(routinen, handle)
20460 #if defined(__parallel)
20461 #if !defined(__GNUC__) || __GNUC__ >= 9
20462 cpassert(is_contiguous(msg))
20465 IF (msglen > 0)
THEN
20466 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, request%handle, ierr)
20467 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
20471 CALL add_perf(perf_id=23, count=1, msg_size=msglen*real_4_size)
20477 CALL mp_timestop(handle)
20478 END SUBROUTINE mp_isum_rv
20486 SUBROUTINE mp_sum_rm(msg, comm)
20487 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20488 CLASS(mp_comm_type),
INTENT(IN) :: comm
20490 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm'
20493 #if defined(__parallel)
20494 INTEGER,
PARAMETER :: max_msg = 2**25
20495 INTEGER :: ierr, m1, msglen, step, msglensum
20498 CALL mp_timeset(routinen, handle)
20500 #if defined(__parallel)
20502 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
20504 DO m1 = lbound(msg, 2), ubound(msg, 2), step
20505 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
20506 msglensum = msglensum + msglen
20507 IF (msglen > 0)
THEN
20508 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_real, mpi_sum, comm%handle, ierr)
20509 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20512 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_4_size)
20517 CALL mp_timestop(handle)
20518 END SUBROUTINE mp_sum_rm
20526 SUBROUTINE mp_sum_rm3(msg, comm)
20527 REAL(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
20528 CLASS(mp_comm_type),
INTENT(IN) :: comm
20530 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm3'
20533 #if defined(__parallel)
20534 INTEGER :: ierr, msglen
20537 CALL mp_timeset(routinen, handle)
20539 #if defined(__parallel)
20541 IF (msglen > 0)
THEN
20542 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20543 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20545 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20550 CALL mp_timestop(handle)
20551 END SUBROUTINE mp_sum_rm3
20559 SUBROUTINE mp_sum_rm4(msg, comm)
20560 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
20561 CLASS(mp_comm_type),
INTENT(IN) :: comm
20563 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm4'
20566 #if defined(__parallel)
20567 INTEGER :: ierr, msglen
20570 CALL mp_timeset(routinen, handle)
20572 #if defined(__parallel)
20574 IF (msglen > 0)
THEN
20575 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20576 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20578 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20583 CALL mp_timestop(handle)
20584 END SUBROUTINE mp_sum_rm4
20596 SUBROUTINE mp_sum_root_rv(msg, root, comm)
20597 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20598 INTEGER,
INTENT(IN) :: root
20599 CLASS(mp_comm_type),
INTENT(IN) :: comm
20601 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rv'
20604 #if defined(__parallel)
20605 INTEGER :: ierr, m1, msglen, taskid
20606 REAL(kind=real_4),
ALLOCATABLE :: res(:)
20609 CALL mp_timeset(routinen, handle)
20611 #if defined(__parallel)
20613 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20614 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20615 IF (msglen > 0)
THEN
20618 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_sum, &
20619 root, comm%handle, ierr)
20620 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20621 IF (taskid == root)
THEN
20626 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20632 CALL mp_timestop(handle)
20633 END SUBROUTINE mp_sum_root_rv
20644 SUBROUTINE mp_sum_root_rm(msg, root, comm)
20645 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20646 INTEGER,
INTENT(IN) :: root
20647 CLASS(mp_comm_type),
INTENT(IN) :: comm
20649 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
20652 #if defined(__parallel)
20653 INTEGER :: ierr, m1, m2, msglen, taskid
20654 REAL(kind=real_4),
ALLOCATABLE :: res(:, :)
20657 CALL mp_timeset(routinen, handle)
20659 #if defined(__parallel)
20661 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20662 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20663 IF (msglen > 0)
THEN
20666 ALLOCATE (res(m1, m2))
20667 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_sum, root, comm%handle, ierr)
20668 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20669 IF (taskid == root)
THEN
20674 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20680 CALL mp_timestop(handle)
20681 END SUBROUTINE mp_sum_root_rm
20689 SUBROUTINE mp_sum_partial_rm(msg, res, comm)
20690 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
20691 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
20692 CLASS(mp_comm_type),
INTENT(IN) :: comm
20694 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_rm'
20697 #if defined(__parallel)
20698 INTEGER :: ierr, msglen, taskid
20701 CALL mp_timeset(routinen, handle)
20703 #if defined(__parallel)
20705 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20706 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20707 IF (msglen > 0)
THEN
20708 CALL mpi_scan(msg, res, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20709 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
20711 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20717 CALL mp_timestop(handle)
20718 END SUBROUTINE mp_sum_partial_rm
20728 SUBROUTINE mp_max_r (msg, comm)
20729 REAL(kind=real_4),
INTENT(INOUT) :: msg
20730 CLASS(mp_comm_type),
INTENT(IN) :: comm
20732 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_r'
20735 #if defined(__parallel)
20736 INTEGER :: ierr, msglen
20739 CALL mp_timeset(routinen, handle)
20741 #if defined(__parallel)
20743 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_max, comm%handle, ierr)
20744 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20745 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20750 CALL mp_timestop(handle)
20751 END SUBROUTINE mp_max_r
20761 SUBROUTINE mp_max_root_r (msg, root, comm)
20762 REAL(kind=real_4),
INTENT(INOUT) :: msg
20763 INTEGER,
INTENT(IN) :: root
20764 CLASS(mp_comm_type),
INTENT(IN) :: comm
20766 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_r'
20769 #if defined(__parallel)
20770 INTEGER :: ierr, msglen
20771 REAL(kind=real_4) :: res
20774 CALL mp_timeset(routinen, handle)
20776 #if defined(__parallel)
20778 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_max, root, comm%handle, ierr)
20779 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20780 IF (root == comm%mepos) msg = res
20781 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20787 CALL mp_timestop(handle)
20788 END SUBROUTINE mp_max_root_r
20798 SUBROUTINE mp_max_rv(msg, comm)
20799 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20800 CLASS(mp_comm_type),
INTENT(IN) :: comm
20802 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_rv'
20805 #if defined(__parallel)
20806 INTEGER :: ierr, msglen
20809 CALL mp_timeset(routinen, handle)
20811 #if defined(__parallel)
20813 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_max, comm%handle, ierr)
20814 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20815 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20820 CALL mp_timestop(handle)
20821 END SUBROUTINE mp_max_rv
20831 SUBROUTINE mp_max_root_rm(msg, root, comm)
20832 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20834 CLASS(mp_comm_type),
INTENT(IN) :: comm
20836 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_rm'
20839 #if defined(__parallel)
20840 INTEGER :: ierr, msglen
20841 REAL(kind=real_4) :: res(
SIZE(msg, 1),
SIZE(msg, 2))
20844 CALL mp_timeset(routinen, handle)
20846 #if defined(__parallel)
20848 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_max, root, comm%handle, ierr)
20849 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20850 IF (root == comm%mepos) msg = res
20851 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20857 CALL mp_timestop(handle)
20858 END SUBROUTINE mp_max_root_rm
20868 SUBROUTINE mp_min_r (msg, comm)
20869 REAL(kind=real_4),
INTENT(INOUT) :: msg
20870 CLASS(mp_comm_type),
INTENT(IN) :: comm
20872 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_r'
20875 #if defined(__parallel)
20876 INTEGER :: ierr, msglen
20879 CALL mp_timeset(routinen, handle)
20881 #if defined(__parallel)
20883 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_min, comm%handle, ierr)
20884 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20885 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20890 CALL mp_timestop(handle)
20891 END SUBROUTINE mp_min_r
20903 SUBROUTINE mp_min_rv(msg, comm)
20904 REAL(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
20905 CLASS(mp_comm_type),
INTENT(IN) :: comm
20907 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_rv'
20910 #if defined(__parallel)
20911 INTEGER :: ierr, msglen
20914 CALL mp_timeset(routinen, handle)
20916 #if defined(__parallel)
20918 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_min, comm%handle, ierr)
20919 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20920 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20925 CALL mp_timestop(handle)
20926 END SUBROUTINE mp_min_rv
20936 SUBROUTINE mp_prod_r (msg, comm)
20937 REAL(kind=real_4),
INTENT(INOUT) :: msg
20938 CLASS(mp_comm_type),
INTENT(IN) :: comm
20940 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_r'
20943 #if defined(__parallel)
20944 INTEGER :: ierr, msglen
20947 CALL mp_timeset(routinen, handle)
20949 #if defined(__parallel)
20951 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_real, mpi_prod, comm%handle, ierr)
20952 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20953 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20958 CALL mp_timestop(handle)
20959 END SUBROUTINE mp_prod_r
20970 SUBROUTINE mp_scatter_rv(msg_scatter, msg, root, comm)
20971 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
20972 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
20973 INTEGER,
INTENT(IN) :: root
20974 CLASS(mp_comm_type),
INTENT(IN) :: comm
20976 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_rv'
20979 #if defined(__parallel)
20980 INTEGER :: ierr, msglen
20983 CALL mp_timeset(routinen, handle)
20985 #if defined(__parallel)
20987 CALL mpi_scatter(msg_scatter, msglen, mpi_real, msg, &
20988 msglen, mpi_real, root, comm%handle, ierr)
20989 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
20990 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
20996 CALL mp_timestop(handle)
20997 END SUBROUTINE mp_scatter_rv
21007 SUBROUTINE mp_iscatter_r (msg_scatter, msg, root, comm, request)
21008 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:)
21009 REAL(kind=real_4),
INTENT(INOUT) :: msg
21010 INTEGER,
INTENT(IN) :: root
21011 CLASS(mp_comm_type),
INTENT(IN) :: comm
21012 TYPE(mp_request_type),
INTENT(OUT) :: request
21014 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_r'
21017 #if defined(__parallel)
21018 INTEGER :: ierr, msglen
21021 CALL mp_timeset(routinen, handle)
21023 #if defined(__parallel)
21024 #if !defined(__GNUC__) || __GNUC__ >= 9
21025 cpassert(is_contiguous(msg_scatter))
21028 CALL mpi_iscatter(msg_scatter, msglen, mpi_real, msg, &
21029 msglen, mpi_real, root, comm%handle, request%handle, ierr)
21030 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
21031 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
21035 msg = msg_scatter(1)
21038 CALL mp_timestop(handle)
21039 END SUBROUTINE mp_iscatter_r
21049 SUBROUTINE mp_iscatter_rv2(msg_scatter, msg, root, comm, request)
21050 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:, :)
21051 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
21052 INTEGER,
INTENT(IN) :: root
21053 CLASS(mp_comm_type),
INTENT(IN) :: comm
21054 TYPE(mp_request_type),
INTENT(OUT) :: request
21056 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_rv2'
21059 #if defined(__parallel)
21060 INTEGER :: ierr, msglen
21063 CALL mp_timeset(routinen, handle)
21065 #if defined(__parallel)
21066 #if !defined(__GNUC__) || __GNUC__ >= 9
21067 cpassert(is_contiguous(msg_scatter))
21070 CALL mpi_iscatter(msg_scatter, msglen, mpi_real, msg, &
21071 msglen, mpi_real, root, comm%handle, request%handle, ierr)
21072 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
21073 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
21077 msg(:) = msg_scatter(:, 1)
21080 CALL mp_timestop(handle)
21081 END SUBROUTINE mp_iscatter_rv2
21091 SUBROUTINE mp_iscatterv_rv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
21092 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:)
21093 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
21094 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
21095 INTEGER,
INTENT(IN) :: recvcount, root
21096 CLASS(mp_comm_type),
INTENT(IN) :: comm
21097 TYPE(mp_request_type),
INTENT(OUT) :: request
21099 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_rv'
21102 #if defined(__parallel)
21106 CALL mp_timeset(routinen, handle)
21108 #if defined(__parallel)
21109 #if !defined(__GNUC__) || __GNUC__ >= 9
21110 cpassert(is_contiguous(msg_scatter))
21111 cpassert(is_contiguous(msg))
21112 cpassert(is_contiguous(sendcounts))
21113 cpassert(is_contiguous(displs))
21115 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_real, msg, &
21116 recvcount, mpi_real, root, comm%handle, request%handle, ierr)
21117 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
21118 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
21120 mark_used(sendcounts)
21122 mark_used(recvcount)
21125 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
21128 CALL mp_timestop(handle)
21129 END SUBROUTINE mp_iscatterv_rv
21140 SUBROUTINE mp_gather_r (msg, msg_gather, root, comm)
21141 REAL(kind=real_4),
INTENT(IN) :: msg
21142 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21143 INTEGER,
INTENT(IN) :: root
21144 CLASS(mp_comm_type),
INTENT(IN) :: comm
21146 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_r'
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, root, 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)
21164 msg_gather(1) = msg
21166 CALL mp_timestop(handle)
21167 END SUBROUTINE mp_gather_r
21177 SUBROUTINE mp_gather_r_src(msg, msg_gather, comm)
21178 REAL(kind=real_4),
INTENT(IN) :: msg
21179 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21180 CLASS(mp_comm_type),
INTENT(IN) :: comm
21182 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_r_src'
21185 #if defined(__parallel)
21186 INTEGER :: ierr, msglen
21189 CALL mp_timeset(routinen, handle)
21191 #if defined(__parallel)
21193 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21194 msglen, mpi_real, comm%source, comm%handle, ierr)
21195 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21196 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21199 msg_gather(1) = msg
21201 CALL mp_timestop(handle)
21202 END SUBROUTINE mp_gather_r_src
21216 SUBROUTINE mp_gather_rv(msg, msg_gather, root, comm)
21217 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
21218 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21219 INTEGER,
INTENT(IN) :: root
21220 CLASS(mp_comm_type),
INTENT(IN) :: comm
21222 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rv'
21225 #if defined(__parallel)
21226 INTEGER :: ierr, msglen
21229 CALL mp_timeset(routinen, handle)
21231 #if defined(__parallel)
21233 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21234 msglen, mpi_real, root, comm%handle, ierr)
21235 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21236 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21242 CALL mp_timestop(handle)
21243 END SUBROUTINE mp_gather_rv
21256 SUBROUTINE mp_gather_rv_src(msg, msg_gather, comm)
21257 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
21258 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21259 CLASS(mp_comm_type),
INTENT(IN) :: comm
21261 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rv_src'
21264 #if defined(__parallel)
21265 INTEGER :: ierr, msglen
21268 CALL mp_timeset(routinen, handle)
21270 #if defined(__parallel)
21272 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21273 msglen, mpi_real, comm%source, comm%handle, ierr)
21274 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21275 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21280 CALL mp_timestop(handle)
21281 END SUBROUTINE mp_gather_rv_src
21295 SUBROUTINE mp_gather_rm(msg, msg_gather, root, comm)
21296 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
21297 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
21298 INTEGER,
INTENT(IN) :: root
21299 CLASS(mp_comm_type),
INTENT(IN) :: comm
21301 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rm'
21304 #if defined(__parallel)
21305 INTEGER :: ierr, msglen
21308 CALL mp_timeset(routinen, handle)
21310 #if defined(__parallel)
21312 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21313 msglen, mpi_real, root, comm%handle, ierr)
21314 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21315 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21321 CALL mp_timestop(handle)
21322 END SUBROUTINE mp_gather_rm
21335 SUBROUTINE mp_gather_rm_src(msg, msg_gather, comm)
21336 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
21337 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
21338 CLASS(mp_comm_type),
INTENT(IN) :: comm
21340 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rm_src'
21343 #if defined(__parallel)
21344 INTEGER :: ierr, msglen
21347 CALL mp_timeset(routinen, handle)
21349 #if defined(__parallel)
21351 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21352 msglen, mpi_real, comm%source, comm%handle, ierr)
21353 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21354 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21359 CALL mp_timestop(handle)
21360 END SUBROUTINE mp_gather_rm_src
21377 SUBROUTINE mp_gatherv_rv(sendbuf, recvbuf, recvcounts, displs, root, comm)
21379 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21380 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21381 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21382 INTEGER,
INTENT(IN) :: root
21383 CLASS(mp_comm_type),
INTENT(IN) :: comm
21385 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rv'
21388 #if defined(__parallel)
21389 INTEGER :: ierr, sendcount
21392 CALL mp_timeset(routinen, handle)
21394 #if defined(__parallel)
21395 sendcount =
SIZE(sendbuf)
21396 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21397 recvbuf, recvcounts, displs, mpi_real, &
21398 root, comm%handle, ierr)
21399 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21400 CALL add_perf(perf_id=4, &
21402 msg_size=sendcount*real_4_size)
21404 mark_used(recvcounts)
21407 recvbuf(1 + displs(1):) = sendbuf
21409 CALL mp_timestop(handle)
21410 END SUBROUTINE mp_gatherv_rv
21426 SUBROUTINE mp_gatherv_rv_src(sendbuf, recvbuf, recvcounts, displs, comm)
21428 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21429 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21430 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21431 CLASS(mp_comm_type),
INTENT(IN) :: comm
21433 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rv_src'
21436 #if defined(__parallel)
21437 INTEGER :: ierr, sendcount
21440 CALL mp_timeset(routinen, handle)
21442 #if defined(__parallel)
21443 sendcount =
SIZE(sendbuf)
21444 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21445 recvbuf, recvcounts, displs, mpi_real, &
21446 comm%source, comm%handle, ierr)
21447 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21448 CALL add_perf(perf_id=4, &
21450 msg_size=sendcount*real_4_size)
21452 mark_used(recvcounts)
21454 recvbuf(1 + displs(1):) = sendbuf
21456 CALL mp_timestop(handle)
21457 END SUBROUTINE mp_gatherv_rv_src
21474 SUBROUTINE mp_gatherv_rm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
21476 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21477 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21478 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21479 INTEGER,
INTENT(IN) :: root
21480 CLASS(mp_comm_type),
INTENT(IN) :: comm
21482 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rm2'
21485 #if defined(__parallel)
21486 INTEGER :: ierr, sendcount
21489 CALL mp_timeset(routinen, handle)
21491 #if defined(__parallel)
21492 sendcount =
SIZE(sendbuf)
21493 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21494 recvbuf, recvcounts, displs, mpi_real, &
21495 root, comm%handle, ierr)
21496 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21497 CALL add_perf(perf_id=4, &
21499 msg_size=sendcount*real_4_size)
21501 mark_used(recvcounts)
21504 recvbuf(:, 1 + displs(1):) = sendbuf
21506 CALL mp_timestop(handle)
21507 END SUBROUTINE mp_gatherv_rm2
21523 SUBROUTINE mp_gatherv_rm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
21525 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21526 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21527 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21528 CLASS(mp_comm_type),
INTENT(IN) :: comm
21530 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rm2_src'
21533 #if defined(__parallel)
21534 INTEGER :: ierr, sendcount
21537 CALL mp_timeset(routinen, handle)
21539 #if defined(__parallel)
21540 sendcount =
SIZE(sendbuf)
21541 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21542 recvbuf, recvcounts, displs, mpi_real, &
21543 comm%source, comm%handle, ierr)
21544 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21545 CALL add_perf(perf_id=4, &
21547 msg_size=sendcount*real_4_size)
21549 mark_used(recvcounts)
21551 recvbuf(:, 1 + displs(1):) = sendbuf
21553 CALL mp_timestop(handle)
21554 END SUBROUTINE mp_gatherv_rm2_src
21571 SUBROUTINE mp_igatherv_rv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
21572 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
21573 REAL(kind=real_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
21574 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21575 INTEGER,
INTENT(IN) :: sendcount, root
21576 CLASS(mp_comm_type),
INTENT(IN) :: comm
21577 TYPE(mp_request_type),
INTENT(OUT) :: request
21579 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_rv'
21582 #if defined(__parallel)
21586 CALL mp_timeset(routinen, handle)
21588 #if defined(__parallel)
21589 #if !defined(__GNUC__) || __GNUC__ >= 9
21590 cpassert(is_contiguous(sendbuf))
21591 cpassert(is_contiguous(recvbuf))
21592 cpassert(is_contiguous(recvcounts))
21593 cpassert(is_contiguous(displs))
21595 CALL mpi_igatherv(sendbuf, sendcount, mpi_real, &
21596 recvbuf, recvcounts, displs, mpi_real, &
21597 root, comm%handle, request%handle, ierr)
21598 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21599 CALL add_perf(perf_id=24, &
21601 msg_size=sendcount*real_4_size)
21603 mark_used(sendcount)
21604 mark_used(recvcounts)
21607 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
21610 CALL mp_timestop(handle)
21611 END SUBROUTINE mp_igatherv_rv
21624 SUBROUTINE mp_allgather_r (msgout, msgin, comm)
21625 REAL(kind=real_4),
INTENT(IN) :: msgout
21626 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
21627 CLASS(mp_comm_type),
INTENT(IN) :: comm
21629 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r'
21632 #if defined(__parallel)
21633 INTEGER :: ierr, rcount, scount
21636 CALL mp_timeset(routinen, handle)
21638 #if defined(__parallel)
21641 CALL mpi_allgather(msgout, scount, mpi_real, &
21642 msgin, rcount, mpi_real, &
21644 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21649 CALL mp_timestop(handle)
21650 END SUBROUTINE mp_allgather_r
21663 SUBROUTINE mp_allgather_r2(msgout, msgin, comm)
21664 REAL(kind=real_4),
INTENT(IN) :: msgout
21665 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
21666 CLASS(mp_comm_type),
INTENT(IN) :: comm
21668 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r2'
21671 #if defined(__parallel)
21672 INTEGER :: ierr, rcount, scount
21675 CALL mp_timeset(routinen, handle)
21677 #if defined(__parallel)
21680 CALL mpi_allgather(msgout, scount, mpi_real, &
21681 msgin, rcount, mpi_real, &
21683 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21688 CALL mp_timestop(handle)
21689 END SUBROUTINE mp_allgather_r2
21702 SUBROUTINE mp_iallgather_r (msgout, msgin, comm, request)
21703 REAL(kind=real_4),
INTENT(IN) :: msgout
21704 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
21705 CLASS(mp_comm_type),
INTENT(IN) :: comm
21706 TYPE(mp_request_type),
INTENT(OUT) :: request
21708 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r'
21711 #if defined(__parallel)
21712 INTEGER :: ierr, rcount, scount
21715 CALL mp_timeset(routinen, handle)
21717 #if defined(__parallel)
21718 #if !defined(__GNUC__) || __GNUC__ >= 9
21719 cpassert(is_contiguous(msgin))
21723 CALL mpi_iallgather(msgout, scount, mpi_real, &
21724 msgin, rcount, mpi_real, &
21725 comm%handle, request%handle, ierr)
21726 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21732 CALL mp_timestop(handle)
21733 END SUBROUTINE mp_iallgather_r
21748 SUBROUTINE mp_allgather_r12(msgout, msgin, comm)
21749 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
21750 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
21751 CLASS(mp_comm_type),
INTENT(IN) :: comm
21753 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r12'
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_r12
21784 SUBROUTINE mp_allgather_r23(msgout, msgin, comm)
21785 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
21786 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
21787 CLASS(mp_comm_type),
INTENT(IN) :: comm
21789 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r23'
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_r23
21820 SUBROUTINE mp_allgather_r34(msgout, msgin, comm)
21821 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
21822 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
21823 CLASS(mp_comm_type),
INTENT(IN) :: comm
21825 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r34'
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(:, :, :, 1) = msgout(:, :, :)
21845 CALL mp_timestop(handle)
21846 END SUBROUTINE mp_allgather_r34
21856 SUBROUTINE mp_allgather_r22(msgout, msgin, comm)
21857 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
21858 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
21859 CLASS(mp_comm_type),
INTENT(IN) :: comm
21861 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r22'
21864 #if defined(__parallel)
21865 INTEGER :: ierr, rcount, scount
21868 CALL mp_timeset(routinen, handle)
21870 #if defined(__parallel)
21871 scount =
SIZE(msgout(:, :))
21873 CALL mpi_allgather(msgout, scount, mpi_real, &
21874 msgin, rcount, mpi_real, &
21876 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
21879 msgin(:, :) = msgout(:, :)
21881 CALL mp_timestop(handle)
21882 END SUBROUTINE mp_allgather_r22
21893 SUBROUTINE mp_iallgather_r11(msgout, msgin, comm, request)
21894 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
21895 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
21896 CLASS(mp_comm_type),
INTENT(IN) :: comm
21897 TYPE(mp_request_type),
INTENT(OUT) :: request
21899 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r11'
21902 #if defined(__parallel)
21903 INTEGER :: ierr, rcount, scount
21906 CALL mp_timeset(routinen, handle)
21908 #if defined(__parallel)
21909 #if !defined(__GNUC__) || __GNUC__ >= 9
21910 cpassert(is_contiguous(msgout))
21911 cpassert(is_contiguous(msgin))
21913 scount =
SIZE(msgout(:))
21915 CALL mpi_iallgather(msgout, scount, mpi_real, &
21916 msgin, rcount, mpi_real, &
21917 comm%handle, request%handle, ierr)
21918 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
21924 CALL mp_timestop(handle)
21925 END SUBROUTINE mp_iallgather_r11
21936 SUBROUTINE mp_iallgather_r13(msgout, msgin, comm, request)
21937 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
21938 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
21939 CLASS(mp_comm_type),
INTENT(IN) :: comm
21940 TYPE(mp_request_type),
INTENT(OUT) :: request
21942 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r13'
21945 #if defined(__parallel)
21946 INTEGER :: ierr, rcount, scount
21949 CALL mp_timeset(routinen, handle)
21951 #if defined(__parallel)
21952 #if !defined(__GNUC__) || __GNUC__ >= 9
21953 cpassert(is_contiguous(msgout))
21954 cpassert(is_contiguous(msgin))
21957 scount =
SIZE(msgout(:))
21959 CALL mpi_iallgather(msgout, scount, mpi_real, &
21960 msgin, rcount, mpi_real, &
21961 comm%handle, request%handle, ierr)
21962 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
21965 msgin(:, 1, 1) = msgout(:)
21968 CALL mp_timestop(handle)
21969 END SUBROUTINE mp_iallgather_r13
21980 SUBROUTINE mp_iallgather_r22(msgout, msgin, comm, request)
21981 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :)
21982 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :)
21983 CLASS(mp_comm_type),
INTENT(IN) :: comm
21984 TYPE(mp_request_type),
INTENT(OUT) :: request
21986 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r22'
21989 #if defined(__parallel)
21990 INTEGER :: ierr, rcount, scount
21993 CALL mp_timeset(routinen, handle)
21995 #if defined(__parallel)
21996 #if !defined(__GNUC__) || __GNUC__ >= 9
21997 cpassert(is_contiguous(msgout))
21998 cpassert(is_contiguous(msgin))
22001 scount =
SIZE(msgout(:, :))
22003 CALL mpi_iallgather(msgout, scount, mpi_real, &
22004 msgin, rcount, mpi_real, &
22005 comm%handle, request%handle, ierr)
22006 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
22009 msgin(:, :) = msgout(:, :)
22012 CALL mp_timestop(handle)
22013 END SUBROUTINE mp_iallgather_r22
22024 SUBROUTINE mp_iallgather_r24(msgout, msgin, comm, request)
22025 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :)
22026 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :, :)
22027 CLASS(mp_comm_type),
INTENT(IN) :: comm
22028 TYPE(mp_request_type),
INTENT(OUT) :: request
22030 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r24'
22033 #if defined(__parallel)
22034 INTEGER :: ierr, rcount, scount
22037 CALL mp_timeset(routinen, handle)
22039 #if defined(__parallel)
22040 #if !defined(__GNUC__) || __GNUC__ >= 9
22041 cpassert(is_contiguous(msgout))
22042 cpassert(is_contiguous(msgin))
22045 scount =
SIZE(msgout(:, :))
22047 CALL mpi_iallgather(msgout, scount, mpi_real, &
22048 msgin, rcount, mpi_real, &
22049 comm%handle, request%handle, ierr)
22050 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
22053 msgin(:, :, 1, 1) = msgout(:, :)
22056 CALL mp_timestop(handle)
22057 END SUBROUTINE mp_iallgather_r24
22068 SUBROUTINE mp_iallgather_r33(msgout, msgin, comm, request)
22069 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :, :)
22070 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
22071 CLASS(mp_comm_type),
INTENT(IN) :: comm
22072 TYPE(mp_request_type),
INTENT(OUT) :: request
22074 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r33'
22077 #if defined(__parallel)
22078 INTEGER :: ierr, rcount, scount
22081 CALL mp_timeset(routinen, handle)
22083 #if defined(__parallel)
22084 #if !defined(__GNUC__) || __GNUC__ >= 9
22085 cpassert(is_contiguous(msgout))
22086 cpassert(is_contiguous(msgin))
22089 scount =
SIZE(msgout(:, :, :))
22091 CALL mpi_iallgather(msgout, scount, mpi_real, &
22092 msgin, rcount, mpi_real, &
22093 comm%handle, request%handle, ierr)
22094 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
22097 msgin(:, :, :) = msgout(:, :, :)
22100 CALL mp_timestop(handle)
22101 END SUBROUTINE mp_iallgather_r33
22120 SUBROUTINE mp_allgatherv_rv(msgout, msgin, rcount, rdispl, comm)
22121 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
22122 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22123 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
22124 CLASS(mp_comm_type),
INTENT(IN) :: comm
22126 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_rv'
22129 #if defined(__parallel)
22130 INTEGER :: ierr, scount
22133 CALL mp_timeset(routinen, handle)
22135 #if defined(__parallel)
22136 scount =
SIZE(msgout)
22137 CALL mpi_allgatherv(msgout, scount, mpi_real, msgin, rcount, &
22138 rdispl, mpi_real, comm%handle, ierr)
22139 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
22146 CALL mp_timestop(handle)
22147 END SUBROUTINE mp_allgatherv_rv
22166 SUBROUTINE mp_allgatherv_rm2(msgout, msgin, rcount, rdispl, comm)
22167 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
22168 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
22169 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
22170 CLASS(mp_comm_type),
INTENT(IN) :: comm
22172 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_rv'
22175 #if defined(__parallel)
22176 INTEGER :: ierr, scount
22179 CALL mp_timeset(routinen, handle)
22181 #if defined(__parallel)
22182 scount =
SIZE(msgout)
22183 CALL mpi_allgatherv(msgout, scount, mpi_real, msgin, rcount, &
22184 rdispl, mpi_real, comm%handle, ierr)
22185 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
22192 CALL mp_timestop(handle)
22193 END SUBROUTINE mp_allgatherv_rm2
22212 SUBROUTINE mp_iallgatherv_rv(msgout, msgin, rcount, rdispl, comm, request)
22213 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
22214 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
22215 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
22216 CLASS(mp_comm_type),
INTENT(IN) :: comm
22217 TYPE(mp_request_type),
INTENT(OUT) :: request
22219 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_rv'
22222 #if defined(__parallel)
22223 INTEGER :: ierr, scount, rsize
22226 CALL mp_timeset(routinen, handle)
22228 #if defined(__parallel)
22229 #if !defined(__GNUC__) || __GNUC__ >= 9
22230 cpassert(is_contiguous(msgout))
22231 cpassert(is_contiguous(msgin))
22232 cpassert(is_contiguous(rcount))
22233 cpassert(is_contiguous(rdispl))
22236 scount =
SIZE(msgout)
22237 rsize =
SIZE(rcount)
22238 CALL mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, &
22239 rdispl, comm, request, ierr)
22240 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
22248 CALL mp_timestop(handle)
22249 END SUBROUTINE mp_iallgatherv_rv
22268 SUBROUTINE mp_iallgatherv_rv2(msgout, msgin, rcount, rdispl, comm, request)
22269 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
22270 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
22271 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
22272 CLASS(mp_comm_type),
INTENT(IN) :: comm
22273 TYPE(mp_request_type),
INTENT(OUT) :: request
22275 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_rv2'
22278 #if defined(__parallel)
22279 INTEGER :: ierr, scount, rsize
22282 CALL mp_timeset(routinen, handle)
22284 #if defined(__parallel)
22285 #if !defined(__GNUC__) || __GNUC__ >= 9
22286 cpassert(is_contiguous(msgout))
22287 cpassert(is_contiguous(msgin))
22288 cpassert(is_contiguous(rcount))
22289 cpassert(is_contiguous(rdispl))
22292 scount =
SIZE(msgout)
22293 rsize =
SIZE(rcount)
22294 CALL mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, &
22295 rdispl, comm, request, ierr)
22296 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
22304 CALL mp_timestop(handle)
22305 END SUBROUTINE mp_iallgatherv_rv2
22316 #if defined(__parallel)
22317 SUBROUTINE mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
22318 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
22319 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22320 INTEGER,
INTENT(IN) :: rsize
22321 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
22322 CLASS(mp_comm_type),
INTENT(IN) :: comm
22323 TYPE(mp_request_type),
INTENT(OUT) :: request
22324 INTEGER,
INTENT(INOUT) :: ierr
22326 CALL mpi_iallgatherv(msgout, scount, mpi_real, msgin, rcount, &
22327 rdispl, mpi_real, comm%handle, request%handle, ierr)
22329 END SUBROUTINE mp_iallgatherv_rv_internal
22340 SUBROUTINE mp_sum_scatter_rv(msgout, msgin, rcount, comm)
22341 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
22342 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22343 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
22344 CLASS(mp_comm_type),
INTENT(IN) :: comm
22346 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_rv'
22349 #if defined(__parallel)
22353 CALL mp_timeset(routinen, handle)
22355 #if defined(__parallel)
22356 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_real, mpi_sum, &
22358 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
22360 CALL add_perf(perf_id=3, count=1, &
22361 msg_size=rcount(1)*2*real_4_size)
22365 msgin = msgout(:, 1)
22367 CALL mp_timestop(handle)
22368 END SUBROUTINE mp_sum_scatter_rv
22379 SUBROUTINE mp_sendrecv_r (msgin, dest, msgout, source, comm, tag)
22380 REAL(kind=real_4),
INTENT(IN) :: msgin
22381 INTEGER,
INTENT(IN) :: dest
22382 REAL(kind=real_4),
INTENT(OUT) :: msgout
22383 INTEGER,
INTENT(IN) :: source
22384 CLASS(mp_comm_type),
INTENT(IN) :: comm
22385 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22387 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_r'
22390 #if defined(__parallel)
22391 INTEGER :: ierr, msglen_in, msglen_out, &
22395 CALL mp_timeset(routinen, handle)
22397 #if defined(__parallel)
22402 IF (
PRESENT(tag))
THEN
22406 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22407 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22408 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22409 CALL add_perf(perf_id=7, count=1, &
22410 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22418 CALL mp_timestop(handle)
22419 END SUBROUTINE mp_sendrecv_r
22430 SUBROUTINE mp_sendrecv_rv(msgin, dest, msgout, source, comm, tag)
22431 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
22432 INTEGER,
INTENT(IN) :: dest
22433 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
22434 INTEGER,
INTENT(IN) :: source
22435 CLASS(mp_comm_type),
INTENT(IN) :: comm
22436 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22438 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rv'
22441 #if defined(__parallel)
22442 INTEGER :: ierr, msglen_in, msglen_out, &
22446 CALL mp_timeset(routinen, handle)
22448 #if defined(__parallel)
22449 msglen_in =
SIZE(msgin)
22450 msglen_out =
SIZE(msgout)
22453 IF (
PRESENT(tag))
THEN
22457 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22458 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22459 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22460 CALL add_perf(perf_id=7, count=1, &
22461 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22469 CALL mp_timestop(handle)
22470 END SUBROUTINE mp_sendrecv_rv
22482 SUBROUTINE mp_sendrecv_rm2(msgin, dest, msgout, source, comm, tag)
22483 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
22484 INTEGER,
INTENT(IN) :: dest
22485 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
22486 INTEGER,
INTENT(IN) :: source
22487 CLASS(mp_comm_type),
INTENT(IN) :: comm
22488 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22490 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm2'
22493 #if defined(__parallel)
22494 INTEGER :: ierr, msglen_in, msglen_out, &
22498 CALL mp_timeset(routinen, handle)
22500 #if defined(__parallel)
22501 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
22502 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
22505 IF (
PRESENT(tag))
THEN
22509 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22510 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22511 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22512 CALL add_perf(perf_id=7, count=1, &
22513 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22521 CALL mp_timestop(handle)
22522 END SUBROUTINE mp_sendrecv_rm2
22533 SUBROUTINE mp_sendrecv_rm3(msgin, dest, msgout, source, comm, tag)
22534 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
22535 INTEGER,
INTENT(IN) :: dest
22536 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
22537 INTEGER,
INTENT(IN) :: source
22538 CLASS(mp_comm_type),
INTENT(IN) :: comm
22539 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22541 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm3'
22544 #if defined(__parallel)
22545 INTEGER :: ierr, msglen_in, msglen_out, &
22549 CALL mp_timeset(routinen, handle)
22551 #if defined(__parallel)
22552 msglen_in =
SIZE(msgin)
22553 msglen_out =
SIZE(msgout)
22556 IF (
PRESENT(tag))
THEN
22560 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22561 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22562 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22563 CALL add_perf(perf_id=7, count=1, &
22564 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22572 CALL mp_timestop(handle)
22573 END SUBROUTINE mp_sendrecv_rm3
22584 SUBROUTINE mp_sendrecv_rm4(msgin, dest, msgout, source, comm, tag)
22585 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
22586 INTEGER,
INTENT(IN) :: dest
22587 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
22588 INTEGER,
INTENT(IN) :: source
22589 CLASS(mp_comm_type),
INTENT(IN) :: comm
22590 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22592 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm4'
22595 #if defined(__parallel)
22596 INTEGER :: ierr, msglen_in, msglen_out, &
22600 CALL mp_timeset(routinen, handle)
22602 #if defined(__parallel)
22603 msglen_in =
SIZE(msgin)
22604 msglen_out =
SIZE(msgout)
22607 IF (
PRESENT(tag))
THEN
22611 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22612 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22613 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22614 CALL add_perf(perf_id=7, count=1, &
22615 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22623 CALL mp_timestop(handle)
22624 END SUBROUTINE mp_sendrecv_rm4
22641 SUBROUTINE mp_isendrecv_r (msgin, dest, msgout, source, comm, send_request, &
22643 REAL(kind=real_4),
INTENT(IN) :: msgin
22644 INTEGER,
INTENT(IN) :: dest
22645 REAL(kind=real_4),
INTENT(INOUT) :: msgout
22646 INTEGER,
INTENT(IN) :: source
22647 CLASS(mp_comm_type),
INTENT(IN) :: comm
22648 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
22649 INTEGER,
INTENT(in),
OPTIONAL :: tag
22651 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_r'
22654 #if defined(__parallel)
22655 INTEGER :: ierr, my_tag
22658 CALL mp_timeset(routinen, handle)
22660 #if defined(__parallel)
22662 IF (
PRESENT(tag)) my_tag = tag
22664 CALL mpi_irecv(msgout, 1, mpi_real, source, my_tag, &
22665 comm%handle, recv_request%handle, ierr)
22666 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
22668 CALL mpi_isend(msgin, 1, mpi_real, dest, my_tag, &
22669 comm%handle, send_request%handle, ierr)
22670 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22672 CALL add_perf(perf_id=8, count=1, msg_size=2*real_4_size)
22682 CALL mp_timestop(handle)
22683 END SUBROUTINE mp_isendrecv_r
22702 SUBROUTINE mp_isendrecv_rv(msgin, dest, msgout, source, comm, send_request, &
22704 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
22705 INTEGER,
INTENT(IN) :: dest
22706 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
22707 INTEGER,
INTENT(IN) :: source
22708 CLASS(mp_comm_type),
INTENT(IN) :: comm
22709 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
22710 INTEGER,
INTENT(in),
OPTIONAL :: tag
22712 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_rv'
22715 #if defined(__parallel)
22716 INTEGER :: ierr, msglen, my_tag
22717 REAL(kind=real_4) :: foo
22720 CALL mp_timeset(routinen, handle)
22722 #if defined(__parallel)
22723 #if !defined(__GNUC__) || __GNUC__ >= 9
22724 cpassert(is_contiguous(msgout))
22725 cpassert(is_contiguous(msgin))
22729 IF (
PRESENT(tag)) my_tag = tag
22731 msglen =
SIZE(msgout, 1)
22732 IF (msglen > 0)
THEN
22733 CALL mpi_irecv(msgout(1), msglen, mpi_real, source, my_tag, &
22734 comm%handle, recv_request%handle, ierr)
22736 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
22737 comm%handle, recv_request%handle, ierr)
22739 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
22741 msglen =
SIZE(msgin, 1)
22742 IF (msglen > 0)
THEN
22743 CALL mpi_isend(msgin(1), msglen, mpi_real, dest, my_tag, &
22744 comm%handle, send_request%handle, ierr)
22746 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22747 comm%handle, send_request%handle, ierr)
22749 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22751 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
22752 CALL add_perf(perf_id=8, count=1, msg_size=msglen*real_4_size)
22762 CALL mp_timestop(handle)
22763 END SUBROUTINE mp_isendrecv_rv
22778 SUBROUTINE mp_isend_rv(msgin, dest, comm, request, tag)
22779 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
22780 INTEGER,
INTENT(IN) :: dest
22781 CLASS(mp_comm_type),
INTENT(IN) :: comm
22782 TYPE(mp_request_type),
INTENT(out) :: request
22783 INTEGER,
INTENT(in),
OPTIONAL :: tag
22785 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rv'
22787 INTEGER :: handle, ierr
22788 #if defined(__parallel)
22789 INTEGER :: msglen, my_tag
22790 REAL(kind=real_4) :: foo(1)
22793 CALL mp_timeset(routinen, handle)
22795 #if defined(__parallel)
22796 #if !defined(__GNUC__) || __GNUC__ >= 9
22797 cpassert(is_contiguous(msgin))
22800 IF (
PRESENT(tag)) my_tag = tag
22802 msglen =
SIZE(msgin)
22803 IF (msglen > 0)
THEN
22804 CALL mpi_isend(msgin(1), msglen, mpi_real, dest, my_tag, &
22805 comm%handle, request%handle, ierr)
22807 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22808 comm%handle, request%handle, ierr)
22810 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22812 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22821 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22823 CALL mp_timestop(handle)
22824 END SUBROUTINE mp_isend_rv
22841 SUBROUTINE mp_isend_rm2(msgin, dest, comm, request, tag)
22842 REAL(kind=real_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
22843 INTEGER,
INTENT(IN) :: dest
22844 CLASS(mp_comm_type),
INTENT(IN) :: comm
22845 TYPE(mp_request_type),
INTENT(out) :: request
22846 INTEGER,
INTENT(in),
OPTIONAL :: tag
22848 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm2'
22850 INTEGER :: handle, ierr
22851 #if defined(__parallel)
22852 INTEGER :: msglen, my_tag
22853 REAL(kind=real_4) :: foo(1)
22856 CALL mp_timeset(routinen, handle)
22858 #if defined(__parallel)
22859 #if !defined(__GNUC__) || __GNUC__ >= 9
22860 cpassert(is_contiguous(msgin))
22864 IF (
PRESENT(tag)) my_tag = tag
22866 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
22867 IF (msglen > 0)
THEN
22868 CALL mpi_isend(msgin(1, 1), msglen, mpi_real, dest, my_tag, &
22869 comm%handle, request%handle, ierr)
22871 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22872 comm%handle, request%handle, ierr)
22874 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22876 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22885 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22887 CALL mp_timestop(handle)
22888 END SUBROUTINE mp_isend_rm2
22907 SUBROUTINE mp_isend_rm3(msgin, dest, comm, request, tag)
22908 REAL(kind=real_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
22909 INTEGER,
INTENT(IN) :: dest
22910 CLASS(mp_comm_type),
INTENT(IN) :: comm
22911 TYPE(mp_request_type),
INTENT(out) :: request
22912 INTEGER,
INTENT(in),
OPTIONAL :: tag
22914 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm3'
22916 INTEGER :: handle, ierr
22917 #if defined(__parallel)
22918 INTEGER :: msglen, my_tag
22919 REAL(kind=real_4) :: foo(1)
22922 CALL mp_timeset(routinen, handle)
22924 #if defined(__parallel)
22925 #if !defined(__GNUC__) || __GNUC__ >= 9
22926 cpassert(is_contiguous(msgin))
22930 IF (
PRESENT(tag)) my_tag = tag
22932 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
22933 IF (msglen > 0)
THEN
22934 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_real, dest, my_tag, &
22935 comm%handle, request%handle, ierr)
22937 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
22938 comm%handle, request%handle, ierr)
22940 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
22942 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
22951 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
22953 CALL mp_timestop(handle)
22954 END SUBROUTINE mp_isend_rm3
22970 SUBROUTINE mp_isend_rm4(msgin, dest, comm, request, tag)
22971 REAL(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
22972 INTEGER,
INTENT(IN) :: dest
22973 CLASS(mp_comm_type),
INTENT(IN) :: comm
22974 TYPE(mp_request_type),
INTENT(out) :: request
22975 INTEGER,
INTENT(in),
OPTIONAL :: tag
22977 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm4'
22979 INTEGER :: handle, ierr
22980 #if defined(__parallel)
22981 INTEGER :: msglen, my_tag
22982 REAL(kind=real_4) :: foo(1)
22985 CALL mp_timeset(routinen, handle)
22987 #if defined(__parallel)
22988 #if !defined(__GNUC__) || __GNUC__ >= 9
22989 cpassert(is_contiguous(msgin))
22993 IF (
PRESENT(tag)) my_tag = tag
22995 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
22996 IF (msglen > 0)
THEN
22997 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_real, dest, my_tag, &
22998 comm%handle, request%handle, ierr)
23000 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
23001 comm%handle, request%handle, ierr)
23003 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
23005 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
23014 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
23016 CALL mp_timestop(handle)
23017 END SUBROUTINE mp_isend_rm4
23033 SUBROUTINE mp_irecv_rv(msgout, source, comm, request, tag)
23034 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
23035 INTEGER,
INTENT(IN) :: source
23036 CLASS(mp_comm_type),
INTENT(IN) :: comm
23037 TYPE(mp_request_type),
INTENT(out) :: request
23038 INTEGER,
INTENT(in),
OPTIONAL :: tag
23040 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rv'
23043 #if defined(__parallel)
23044 INTEGER :: ierr, msglen, my_tag
23045 REAL(kind=real_4) :: foo(1)
23048 CALL mp_timeset(routinen, handle)
23050 #if defined(__parallel)
23051 #if !defined(__GNUC__) || __GNUC__ >= 9
23052 cpassert(is_contiguous(msgout))
23056 IF (
PRESENT(tag)) my_tag = tag
23058 msglen =
SIZE(msgout)
23059 IF (msglen > 0)
THEN
23060 CALL mpi_irecv(msgout(1), msglen, mpi_real, source, my_tag, &
23061 comm%handle, request%handle, ierr)
23063 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23064 comm%handle, request%handle, ierr)
23066 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
23068 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23070 cpabort(
"mp_irecv called in non parallel case")
23077 CALL mp_timestop(handle)
23078 END SUBROUTINE mp_irecv_rv
23095 SUBROUTINE mp_irecv_rm2(msgout, source, comm, request, tag)
23096 REAL(kind=real_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
23097 INTEGER,
INTENT(IN) :: source
23098 CLASS(mp_comm_type),
INTENT(IN) :: comm
23099 TYPE(mp_request_type),
INTENT(out) :: request
23100 INTEGER,
INTENT(in),
OPTIONAL :: tag
23102 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm2'
23105 #if defined(__parallel)
23106 INTEGER :: ierr, msglen, my_tag
23107 REAL(kind=real_4) :: foo(1)
23110 CALL mp_timeset(routinen, handle)
23112 #if defined(__parallel)
23113 #if !defined(__GNUC__) || __GNUC__ >= 9
23114 cpassert(is_contiguous(msgout))
23118 IF (
PRESENT(tag)) my_tag = tag
23120 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
23121 IF (msglen > 0)
THEN
23122 CALL mpi_irecv(msgout(1, 1), msglen, mpi_real, source, my_tag, &
23123 comm%handle, request%handle, ierr)
23125 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23126 comm%handle, request%handle, ierr)
23128 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
23130 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23137 cpabort(
"mp_irecv called in non parallel case")
23139 CALL mp_timestop(handle)
23140 END SUBROUTINE mp_irecv_rm2
23158 SUBROUTINE mp_irecv_rm3(msgout, source, comm, request, tag)
23159 REAL(kind=real_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
23160 INTEGER,
INTENT(IN) :: source
23161 CLASS(mp_comm_type),
INTENT(IN) :: comm
23162 TYPE(mp_request_type),
INTENT(out) :: request
23163 INTEGER,
INTENT(in),
OPTIONAL :: tag
23165 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm3'
23168 #if defined(__parallel)
23169 INTEGER :: ierr, msglen, my_tag
23170 REAL(kind=real_4) :: foo(1)
23173 CALL mp_timeset(routinen, handle)
23175 #if defined(__parallel)
23176 #if !defined(__GNUC__) || __GNUC__ >= 9
23177 cpassert(is_contiguous(msgout))
23181 IF (
PRESENT(tag)) my_tag = tag
23183 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
23184 IF (msglen > 0)
THEN
23185 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_real, source, my_tag, &
23186 comm%handle, request%handle, ierr)
23188 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23189 comm%handle, request%handle, ierr)
23191 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
23193 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23200 cpabort(
"mp_irecv called in non parallel case")
23202 CALL mp_timestop(handle)
23203 END SUBROUTINE mp_irecv_rm3
23219 SUBROUTINE mp_irecv_rm4(msgout, source, comm, request, tag)
23220 REAL(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
23221 INTEGER,
INTENT(IN) :: source
23222 CLASS(mp_comm_type),
INTENT(IN) :: comm
23223 TYPE(mp_request_type),
INTENT(out) :: request
23224 INTEGER,
INTENT(in),
OPTIONAL :: tag
23226 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm4'
23229 #if defined(__parallel)
23230 INTEGER :: ierr, msglen, my_tag
23231 REAL(kind=real_4) :: foo(1)
23234 CALL mp_timeset(routinen, handle)
23236 #if defined(__parallel)
23237 #if !defined(__GNUC__) || __GNUC__ >= 9
23238 cpassert(is_contiguous(msgout))
23242 IF (
PRESENT(tag)) my_tag = tag
23244 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
23245 IF (msglen > 0)
THEN
23246 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_real, source, my_tag, &
23247 comm%handle, request%handle, ierr)
23249 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23250 comm%handle, request%handle, ierr)
23252 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
23254 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23261 cpabort(
"mp_irecv called in non parallel case")
23263 CALL mp_timestop(handle)
23264 END SUBROUTINE mp_irecv_rm4
23276 SUBROUTINE mp_win_create_rv(base, comm, win)
23277 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
23278 TYPE(mp_comm_type),
INTENT(IN) :: comm
23279 CLASS(mp_win_type),
INTENT(INOUT) :: win
23281 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_rv'
23284 #if defined(__parallel)
23286 INTEGER(kind=mpi_address_kind) :: len
23287 REAL(kind=real_4) :: foo(1)
23290 CALL mp_timeset(routinen, handle)
23292 #if defined(__parallel)
23294 len =
SIZE(base)*real_4_size
23296 CALL mpi_win_create(base(1), len, real_4_size, mpi_info_null, comm%handle, win%handle, ierr)
23298 CALL mpi_win_create(foo, len, real_4_size, mpi_info_null, comm%handle, win%handle, ierr)
23300 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
23302 CALL add_perf(perf_id=20, count=1)
23306 win%handle = mp_win_null_handle
23308 CALL mp_timestop(handle)
23309 END SUBROUTINE mp_win_create_rv
23321 SUBROUTINE mp_rget_rv(base, source, win, win_data, myproc, disp, request, &
23322 origin_datatype, target_datatype)
23323 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
23324 INTEGER,
INTENT(IN) :: source
23325 CLASS(mp_win_type),
INTENT(IN) :: win
23326 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: win_data
23327 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
23328 TYPE(mp_request_type),
INTENT(OUT) :: request
23329 TYPE(mp_type_descriptor_type),
INTENT(IN),
OPTIONAL :: origin_datatype, target_datatype
23331 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_rv'
23334 #if defined(__parallel)
23335 INTEGER :: ierr, len, &
23336 origin_len, target_len
23337 LOGICAL :: do_local_copy
23338 INTEGER(kind=mpi_address_kind) :: disp_aint
23339 mpi_data_type :: handle_origin_datatype, handle_target_datatype
23342 CALL mp_timeset(routinen, handle)
23344 #if defined(__parallel)
23347 IF (
PRESENT(disp))
THEN
23348 disp_aint = int(disp, kind=mpi_address_kind)
23350 handle_origin_datatype = mpi_real
23352 IF (
PRESENT(origin_datatype))
THEN
23353 handle_origin_datatype = origin_datatype%type_handle
23356 handle_target_datatype = mpi_real
23358 IF (
PRESENT(target_datatype))
THEN
23359 handle_target_datatype = target_datatype%type_handle
23363 do_local_copy = .false.
23364 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
23365 IF (myproc .EQ. source) do_local_copy = .true.
23367 IF (do_local_copy)
THEN
23369 base(:) = win_data(disp_aint + 1:disp_aint + len)
23374 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
23375 target_len, handle_target_datatype, win%handle, request%handle, ierr)
23381 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
23383 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*real_4_size)
23388 mark_used(origin_datatype)
23389 mark_used(target_datatype)
23393 IF (
PRESENT(disp))
THEN
23394 base(:) = win_data(disp + 1:disp +
SIZE(base))
23396 base(:) = win_data(:
SIZE(base))
23400 CALL mp_timestop(handle)
23401 END SUBROUTINE mp_rget_rv
23411 result(type_descriptor)
23412 INTEGER,
INTENT(IN) :: count
23413 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
23414 TYPE(mp_type_descriptor_type) :: type_descriptor
23416 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_r'
23419 #if defined(__parallel)
23423 CALL mp_timeset(routinen, handle)
23425 #if defined(__parallel)
23426 CALL mpi_type_indexed(count, lengths, displs, mpi_real, &
23427 type_descriptor%type_handle, ierr)
23429 cpabort(
"MPI_Type_Indexed @ "//routinen)
23430 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
23432 cpabort(
"MPI_Type_commit @ "//routinen)
23434 type_descriptor%type_handle = 1
23436 type_descriptor%length = count
23437 NULLIFY (type_descriptor%subtype)
23438 type_descriptor%vector_descriptor(1:2) = 1
23439 type_descriptor%has_indexing = .true.
23440 type_descriptor%index_descriptor%index => lengths
23441 type_descriptor%index_descriptor%chunks => displs
23443 CALL mp_timestop(handle)
23454 SUBROUTINE mp_allocate_r (DATA, len, stat)
23455 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23456 INTEGER,
INTENT(IN) :: len
23457 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23459 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allocate_r'
23461 INTEGER :: handle, ierr
23463 CALL mp_timeset(routinen, handle)
23465 #if defined(__parallel)
23467 CALL mp_alloc_mem(
DATA, len, stat=ierr)
23468 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
23469 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
23470 CALL add_perf(perf_id=15, count=1)
23472 ALLOCATE (
DATA(len), stat=ierr)
23473 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
23474 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
23476 IF (
PRESENT(stat)) stat = ierr
23477 CALL mp_timestop(handle)
23478 END SUBROUTINE mp_allocate_r
23486 SUBROUTINE mp_deallocate_r (DATA, stat)
23487 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23488 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23490 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_deallocate_r'
23493 #if defined(__parallel)
23497 CALL mp_timeset(routinen, handle)
23499 #if defined(__parallel)
23500 CALL mp_free_mem(
DATA, ierr)
23501 IF (
PRESENT(stat))
THEN
23504 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
23507 CALL add_perf(perf_id=15, count=1)
23510 IF (
PRESENT(stat)) stat = 0
23512 CALL mp_timestop(handle)
23513 END SUBROUTINE mp_deallocate_r
23526 SUBROUTINE mp_file_write_at_rv(fh, offset, msg, msglen)
23527 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
23528 CLASS(mp_file_type),
INTENT(IN) :: fh
23529 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23530 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23533 #if defined(__parallel)
23537 msg_len =
SIZE(msg)
23538 IF (
PRESENT(msglen)) msg_len = msglen
23539 #if defined(__parallel)
23540 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23542 cpabort(
"mpi_file_write_at_rv @ mp_file_write_at_rv")
23544 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23546 END SUBROUTINE mp_file_write_at_rv
23554 SUBROUTINE mp_file_write_at_r (fh, offset, msg)
23555 REAL(kind=real_4),
INTENT(IN) :: msg
23556 CLASS(mp_file_type),
INTENT(IN) :: fh
23557 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23559 #if defined(__parallel)
23563 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23565 cpabort(
"mpi_file_write_at_r @ mp_file_write_at_r")
23567 WRITE (unit=fh%handle, pos=offset + 1) msg
23569 END SUBROUTINE mp_file_write_at_r
23581 SUBROUTINE mp_file_write_at_all_rv(fh, offset, msg, msglen)
23582 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
23583 CLASS(mp_file_type),
INTENT(IN) :: fh
23584 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23585 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23588 #if defined(__parallel)
23592 msg_len =
SIZE(msg)
23593 IF (
PRESENT(msglen)) msg_len = msglen
23594 #if defined(__parallel)
23595 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23597 cpabort(
"mpi_file_write_at_all_rv @ mp_file_write_at_all_rv")
23599 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23601 END SUBROUTINE mp_file_write_at_all_rv
23609 SUBROUTINE mp_file_write_at_all_r (fh, offset, msg)
23610 REAL(kind=real_4),
INTENT(IN) :: msg
23611 CLASS(mp_file_type),
INTENT(IN) :: fh
23612 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23614 #if defined(__parallel)
23618 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23620 cpabort(
"mpi_file_write_at_all_r @ mp_file_write_at_all_r")
23622 WRITE (unit=fh%handle, pos=offset + 1) msg
23624 END SUBROUTINE mp_file_write_at_all_r
23637 SUBROUTINE mp_file_read_at_rv(fh, offset, msg, msglen)
23638 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
23639 CLASS(mp_file_type),
INTENT(IN) :: fh
23640 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23641 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23644 #if defined(__parallel)
23648 msg_len =
SIZE(msg)
23649 IF (
PRESENT(msglen)) msg_len = msglen
23650 #if defined(__parallel)
23651 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23653 cpabort(
"mpi_file_read_at_rv @ mp_file_read_at_rv")
23655 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23657 END SUBROUTINE mp_file_read_at_rv
23665 SUBROUTINE mp_file_read_at_r (fh, offset, msg)
23666 REAL(kind=real_4),
INTENT(OUT) :: msg
23667 CLASS(mp_file_type),
INTENT(IN) :: fh
23668 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23670 #if defined(__parallel)
23674 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23676 cpabort(
"mpi_file_read_at_r @ mp_file_read_at_r")
23678 READ (unit=fh%handle, pos=offset + 1) msg
23680 END SUBROUTINE mp_file_read_at_r
23692 SUBROUTINE mp_file_read_at_all_rv(fh, offset, msg, msglen)
23693 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
23694 CLASS(mp_file_type),
INTENT(IN) :: fh
23695 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23696 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23699 #if defined(__parallel)
23703 msg_len =
SIZE(msg)
23704 IF (
PRESENT(msglen)) msg_len = msglen
23705 #if defined(__parallel)
23706 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23708 cpabort(
"mpi_file_read_at_all_rv @ mp_file_read_at_all_rv")
23710 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23712 END SUBROUTINE mp_file_read_at_all_rv
23720 SUBROUTINE mp_file_read_at_all_r (fh, offset, msg)
23721 REAL(kind=real_4),
INTENT(OUT) :: msg
23722 CLASS(mp_file_type),
INTENT(IN) :: fh
23723 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23725 #if defined(__parallel)
23729 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23731 cpabort(
"mpi_file_read_at_all_r @ mp_file_read_at_all_r")
23733 READ (unit=fh%handle, pos=offset + 1) msg
23735 END SUBROUTINE mp_file_read_at_all_r
23744 FUNCTION mp_type_make_r (ptr, &
23745 vector_descriptor, index_descriptor) &
23746 result(type_descriptor)
23747 REAL(kind=real_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
23748 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
23749 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
23750 TYPE(mp_type_descriptor_type) :: type_descriptor
23752 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_r'
23754 #if defined(__parallel)
23758 NULLIFY (type_descriptor%subtype)
23759 type_descriptor%length =
SIZE(ptr)
23760 #if defined(__parallel)
23761 type_descriptor%type_handle = mpi_real
23762 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
23764 cpabort(
"MPI_Get_address @ "//routinen)
23766 type_descriptor%type_handle = 1
23768 type_descriptor%vector_descriptor(1:2) = 1
23769 type_descriptor%has_indexing = .false.
23770 type_descriptor%data_r => ptr
23771 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
23772 cpabort(routinen//
": Vectors and indices NYI")
23774 END FUNCTION mp_type_make_r
23783 SUBROUTINE mp_alloc_mem_r (DATA, len, stat)
23784 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23785 INTEGER,
INTENT(IN) :: len
23786 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23788 #if defined(__parallel)
23789 INTEGER :: size, ierr, length, &
23791 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
23792 TYPE(c_ptr) :: mp_baseptr
23793 mpi_info_type :: mp_info
23795 length = max(len, 1)
23796 CALL mpi_type_size(mpi_real,
size, ierr)
23797 mp_size = int(length, kind=mpi_address_kind)*
size
23798 IF (mp_size .GT. mp_max_memory_size)
THEN
23799 cpabort(
"MPI cannot allocate more than 2 GiByte")
23801 mp_info = mpi_info_null
23802 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
23803 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
23804 IF (
PRESENT(stat)) stat = mp_res
23806 INTEGER :: length, mystat
23807 length = max(len, 1)
23808 IF (
PRESENT(stat))
THEN
23809 ALLOCATE (
DATA(length), stat=mystat)
23812 ALLOCATE (
DATA(length))
23815 END SUBROUTINE mp_alloc_mem_r
23823 SUBROUTINE mp_free_mem_r (DATA, stat)
23824 REAL(kind=real_4),
DIMENSION(:), &
23825 POINTER, asynchronous ::
DATA
23826 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23828 #if defined(__parallel)
23830 CALL mpi_free_mem(
DATA, mp_res)
23831 IF (
PRESENT(stat)) stat = mp_res
23834 IF (
PRESENT(stat)) stat = 0
23836 END SUBROUTINE mp_free_mem_r
23848 SUBROUTINE mp_shift_zm(msg, comm, displ_in)
23850 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
23851 CLASS(mp_comm_type),
INTENT(IN) :: comm
23852 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
23854 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_zm'
23856 INTEGER :: handle, ierror
23857 #if defined(__parallel)
23858 INTEGER :: displ, left, &
23859 msglen, myrank, nprocs, &
23864 CALL mp_timeset(routinen, handle)
23866 #if defined(__parallel)
23867 CALL mpi_comm_rank(comm%handle, myrank, ierror)
23868 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
23869 CALL mpi_comm_size(comm%handle, nprocs, ierror)
23870 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
23871 IF (
PRESENT(displ_in))
THEN
23876 right =
modulo(myrank + displ, nprocs)
23877 left =
modulo(myrank - displ, nprocs)
23880 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_complex, right, tag, left, tag, &
23881 comm%handle, mpi_status_ignore, ierror)
23882 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
23883 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_8_size))
23887 mark_used(displ_in)
23889 CALL mp_timestop(handle)
23891 END SUBROUTINE mp_shift_zm
23904 SUBROUTINE mp_shift_z (msg, comm, displ_in)
23906 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
23907 CLASS(mp_comm_type),
INTENT(IN) :: comm
23908 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
23910 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_z'
23912 INTEGER :: handle, ierror
23913 #if defined(__parallel)
23914 INTEGER :: displ, left, &
23915 msglen, myrank, nprocs, &
23920 CALL mp_timeset(routinen, handle)
23922 #if defined(__parallel)
23923 CALL mpi_comm_rank(comm%handle, myrank, ierror)
23924 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
23925 CALL mpi_comm_size(comm%handle, nprocs, ierror)
23926 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
23927 IF (
PRESENT(displ_in))
THEN
23932 right =
modulo(myrank + displ, nprocs)
23933 left =
modulo(myrank - displ, nprocs)
23936 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_complex, right, tag, left, &
23937 tag, comm%handle, mpi_status_ignore, ierror)
23938 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
23939 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_8_size))
23943 mark_used(displ_in)
23945 CALL mp_timestop(handle)
23947 END SUBROUTINE mp_shift_z
23968 SUBROUTINE mp_alltoall_z11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
23970 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
23971 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
23972 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
23973 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
23974 CLASS(mp_comm_type),
INTENT(IN) :: comm
23976 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z11v'
23979 #if defined(__parallel)
23980 INTEGER :: ierr, msglen
23985 CALL mp_timeset(routinen, handle)
23987 #if defined(__parallel)
23988 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_complex, &
23989 rb, rcount, rdispl, mpi_double_complex, comm%handle, ierr)
23990 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
23991 msglen = sum(scount) + sum(rcount)
23992 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
23998 DO i = 1, rcount(1)
23999 rb(rdispl(1) + i) = sb(sdispl(1) + i)
24002 CALL mp_timestop(handle)
24004 END SUBROUTINE mp_alltoall_z11v
24019 SUBROUTINE mp_alltoall_z22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
24021 COMPLEX(kind=real_8),
DIMENSION(:, :), &
24022 INTENT(IN),
CONTIGUOUS :: sb
24023 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
24024 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS, &
24025 INTENT(INOUT) :: rb
24026 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
24027 CLASS(mp_comm_type),
INTENT(IN) :: comm
24029 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z22v'
24032 #if defined(__parallel)
24033 INTEGER :: ierr, msglen
24036 CALL mp_timeset(routinen, handle)
24038 #if defined(__parallel)
24039 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_complex, &
24040 rb, rcount, rdispl, mpi_double_complex, comm%handle, ierr)
24041 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
24042 msglen = sum(scount) + sum(rcount)
24043 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*(2*real_8_size))
24052 CALL mp_timestop(handle)
24054 END SUBROUTINE mp_alltoall_z22v
24071 SUBROUTINE mp_alltoall_z (sb, rb, count, comm)
24073 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
24074 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
24075 INTEGER,
INTENT(IN) :: count
24076 CLASS(mp_comm_type),
INTENT(IN) :: comm
24078 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z'
24081 #if defined(__parallel)
24082 INTEGER :: ierr, msglen, np
24085 CALL mp_timeset(routinen, handle)
24087 #if defined(__parallel)
24088 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24089 rb, count, mpi_double_complex, comm%handle, ierr)
24090 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24091 CALL mpi_comm_size(comm%handle, np, ierr)
24092 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24093 msglen = 2*count*np
24094 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24100 CALL mp_timestop(handle)
24102 END SUBROUTINE mp_alltoall_z
24112 SUBROUTINE mp_alltoall_z22(sb, rb, count, comm)
24114 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
24115 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
24116 INTEGER,
INTENT(IN) :: count
24117 CLASS(mp_comm_type),
INTENT(IN) :: comm
24119 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z22'
24122 #if defined(__parallel)
24123 INTEGER :: ierr, msglen, np
24126 CALL mp_timeset(routinen, handle)
24128 #if defined(__parallel)
24129 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24130 rb, count, mpi_double_complex, comm%handle, ierr)
24131 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24132 CALL mpi_comm_size(comm%handle, np, ierr)
24133 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24134 msglen = 2*
SIZE(sb)*np
24135 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24141 CALL mp_timestop(handle)
24143 END SUBROUTINE mp_alltoall_z22
24153 SUBROUTINE mp_alltoall_z33(sb, rb, count, comm)
24155 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
24156 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
24157 INTEGER,
INTENT(IN) :: count
24158 CLASS(mp_comm_type),
INTENT(IN) :: comm
24160 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z33'
24163 #if defined(__parallel)
24164 INTEGER :: ierr, msglen, np
24167 CALL mp_timeset(routinen, handle)
24169 #if defined(__parallel)
24170 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24171 rb, count, mpi_double_complex, comm%handle, ierr)
24172 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24173 CALL mpi_comm_size(comm%handle, np, ierr)
24174 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24175 msglen = 2*count*np
24176 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24182 CALL mp_timestop(handle)
24184 END SUBROUTINE mp_alltoall_z33
24194 SUBROUTINE mp_alltoall_z44(sb, rb, count, comm)
24196 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24198 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24200 INTEGER,
INTENT(IN) :: count
24201 CLASS(mp_comm_type),
INTENT(IN) :: comm
24203 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z44'
24206 #if defined(__parallel)
24207 INTEGER :: ierr, msglen, np
24210 CALL mp_timeset(routinen, handle)
24212 #if defined(__parallel)
24213 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24214 rb, count, mpi_double_complex, comm%handle, ierr)
24215 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24216 CALL mpi_comm_size(comm%handle, np, ierr)
24217 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24218 msglen = 2*count*np
24219 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24225 CALL mp_timestop(handle)
24227 END SUBROUTINE mp_alltoall_z44
24237 SUBROUTINE mp_alltoall_z55(sb, rb, count, comm)
24239 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
24241 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
24243 INTEGER,
INTENT(IN) :: count
24244 CLASS(mp_comm_type),
INTENT(IN) :: comm
24246 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z55'
24249 #if defined(__parallel)
24250 INTEGER :: ierr, msglen, np
24253 CALL mp_timeset(routinen, handle)
24255 #if defined(__parallel)
24256 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24257 rb, count, mpi_double_complex, comm%handle, ierr)
24258 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24259 CALL mpi_comm_size(comm%handle, np, ierr)
24260 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24261 msglen = 2*count*np
24262 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24268 CALL mp_timestop(handle)
24270 END SUBROUTINE mp_alltoall_z55
24281 SUBROUTINE mp_alltoall_z45(sb, rb, count, comm)
24283 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24285 COMPLEX(kind=real_8), &
24286 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
24287 INTEGER,
INTENT(IN) :: count
24288 CLASS(mp_comm_type),
INTENT(IN) :: comm
24290 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z45'
24293 #if defined(__parallel)
24294 INTEGER :: ierr, msglen, np
24297 CALL mp_timeset(routinen, handle)
24299 #if defined(__parallel)
24300 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24301 rb, count, mpi_double_complex, comm%handle, ierr)
24302 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24303 CALL mpi_comm_size(comm%handle, np, ierr)
24304 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24305 msglen = 2*count*np
24306 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24310 rb = reshape(sb, shape(rb))
24312 CALL mp_timestop(handle)
24314 END SUBROUTINE mp_alltoall_z45
24325 SUBROUTINE mp_alltoall_z34(sb, rb, count, comm)
24327 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
24329 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24331 INTEGER,
INTENT(IN) :: count
24332 CLASS(mp_comm_type),
INTENT(IN) :: comm
24334 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z34'
24337 #if defined(__parallel)
24338 INTEGER :: ierr, msglen, np
24341 CALL mp_timeset(routinen, handle)
24343 #if defined(__parallel)
24344 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24345 rb, count, mpi_double_complex, comm%handle, ierr)
24346 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24347 CALL mpi_comm_size(comm%handle, np, ierr)
24348 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24349 msglen = 2*count*np
24350 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24354 rb = reshape(sb, shape(rb))
24356 CALL mp_timestop(handle)
24358 END SUBROUTINE mp_alltoall_z34
24369 SUBROUTINE mp_alltoall_z54(sb, rb, count, comm)
24371 COMPLEX(kind=real_8), &
24372 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
24373 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24375 INTEGER,
INTENT(IN) :: count
24376 CLASS(mp_comm_type),
INTENT(IN) :: comm
24378 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z54'
24381 #if defined(__parallel)
24382 INTEGER :: ierr, msglen, np
24385 CALL mp_timeset(routinen, handle)
24387 #if defined(__parallel)
24388 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24389 rb, count, mpi_double_complex, comm%handle, ierr)
24390 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24391 CALL mpi_comm_size(comm%handle, np, ierr)
24392 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24393 msglen = 2*count*np
24394 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24398 rb = reshape(sb, shape(rb))
24400 CALL mp_timestop(handle)
24402 END SUBROUTINE mp_alltoall_z54
24413 SUBROUTINE mp_send_z (msg, dest, tag, comm)
24414 COMPLEX(kind=real_8),
INTENT(IN) :: msg
24415 INTEGER,
INTENT(IN) :: dest, tag
24416 CLASS(mp_comm_type),
INTENT(IN) :: comm
24418 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_z'
24421 #if defined(__parallel)
24422 INTEGER :: ierr, msglen
24425 CALL mp_timeset(routinen, handle)
24427 #if defined(__parallel)
24429 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24430 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24431 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24438 cpabort(
"not in parallel mode")
24440 CALL mp_timestop(handle)
24441 END SUBROUTINE mp_send_z
24451 SUBROUTINE mp_send_zv(msg, dest, tag, comm)
24452 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
24453 INTEGER,
INTENT(IN) :: dest, tag
24454 CLASS(mp_comm_type),
INTENT(IN) :: comm
24456 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_zv'
24459 #if defined(__parallel)
24460 INTEGER :: ierr, msglen
24463 CALL mp_timeset(routinen, handle)
24465 #if defined(__parallel)
24467 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24468 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24469 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24476 cpabort(
"not in parallel mode")
24478 CALL mp_timestop(handle)
24479 END SUBROUTINE mp_send_zv
24489 SUBROUTINE mp_send_zm2(msg, dest, tag, comm)
24490 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
24491 INTEGER,
INTENT(IN) :: dest, tag
24492 CLASS(mp_comm_type),
INTENT(IN) :: comm
24494 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_zm2'
24497 #if defined(__parallel)
24498 INTEGER :: ierr, msglen
24501 CALL mp_timeset(routinen, handle)
24503 #if defined(__parallel)
24505 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24506 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24507 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24514 cpabort(
"not in parallel mode")
24516 CALL mp_timestop(handle)
24517 END SUBROUTINE mp_send_zm2
24527 SUBROUTINE mp_send_zm3(msg, dest, tag, comm)
24528 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
24529 INTEGER,
INTENT(IN) :: dest, tag
24530 CLASS(mp_comm_type),
INTENT(IN) :: comm
24532 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
24535 #if defined(__parallel)
24536 INTEGER :: ierr, msglen
24539 CALL mp_timeset(routinen, handle)
24541 #if defined(__parallel)
24543 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24544 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24545 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24552 cpabort(
"not in parallel mode")
24554 CALL mp_timestop(handle)
24555 END SUBROUTINE mp_send_zm3
24566 SUBROUTINE mp_recv_z (msg, source, tag, comm)
24567 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24568 INTEGER,
INTENT(INOUT) :: source, tag
24569 CLASS(mp_comm_type),
INTENT(IN) :: comm
24571 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_z'
24574 #if defined(__parallel)
24575 INTEGER :: ierr, msglen
24576 mpi_status_type :: status
24579 CALL mp_timeset(routinen, handle)
24581 #if defined(__parallel)
24584 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24585 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24587 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24588 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24589 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24590 source = status mpi_status_extract(mpi_source)
24591 tag = status mpi_status_extract(mpi_tag)
24599 cpabort(
"not in parallel mode")
24601 CALL mp_timestop(handle)
24602 END SUBROUTINE mp_recv_z
24612 SUBROUTINE mp_recv_zv(msg, source, tag, comm)
24613 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24614 INTEGER,
INTENT(INOUT) :: source, tag
24615 CLASS(mp_comm_type),
INTENT(IN) :: comm
24617 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zv'
24620 #if defined(__parallel)
24621 INTEGER :: ierr, msglen
24622 mpi_status_type :: status
24625 CALL mp_timeset(routinen, handle)
24627 #if defined(__parallel)
24630 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24631 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24633 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24634 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24635 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24636 source = status mpi_status_extract(mpi_source)
24637 tag = status mpi_status_extract(mpi_tag)
24645 cpabort(
"not in parallel mode")
24647 CALL mp_timestop(handle)
24648 END SUBROUTINE mp_recv_zv
24658 SUBROUTINE mp_recv_zm2(msg, source, tag, comm)
24659 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
24660 INTEGER,
INTENT(INOUT) :: source, tag
24661 CLASS(mp_comm_type),
INTENT(IN) :: comm
24663 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zm2'
24666 #if defined(__parallel)
24667 INTEGER :: ierr, msglen
24668 mpi_status_type :: status
24671 CALL mp_timeset(routinen, handle)
24673 #if defined(__parallel)
24676 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24677 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24679 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24680 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24681 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24682 source = status mpi_status_extract(mpi_source)
24683 tag = status mpi_status_extract(mpi_tag)
24691 cpabort(
"not in parallel mode")
24693 CALL mp_timestop(handle)
24694 END SUBROUTINE mp_recv_zm2
24704 SUBROUTINE mp_recv_zm3(msg, source, tag, comm)
24705 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
24706 INTEGER,
INTENT(INOUT) :: source, tag
24707 CLASS(mp_comm_type),
INTENT(IN) :: comm
24709 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zm3'
24712 #if defined(__parallel)
24713 INTEGER :: ierr, msglen
24714 mpi_status_type :: status
24717 CALL mp_timeset(routinen, handle)
24719 #if defined(__parallel)
24722 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24723 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24725 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24726 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24727 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24728 source = status mpi_status_extract(mpi_source)
24729 tag = status mpi_status_extract(mpi_tag)
24737 cpabort(
"not in parallel mode")
24739 CALL mp_timestop(handle)
24740 END SUBROUTINE mp_recv_zm3
24750 SUBROUTINE mp_bcast_z (msg, source, comm)
24751 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24752 INTEGER,
INTENT(IN) :: source
24753 CLASS(mp_comm_type),
INTENT(IN) :: comm
24755 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z'
24758 #if defined(__parallel)
24759 INTEGER :: ierr, msglen
24762 CALL mp_timeset(routinen, handle)
24764 #if defined(__parallel)
24766 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
24767 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24768 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24774 CALL mp_timestop(handle)
24775 END SUBROUTINE mp_bcast_z
24784 SUBROUTINE mp_bcast_z_src(msg, comm)
24785 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24786 CLASS(mp_comm_type),
INTENT(IN) :: comm
24788 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z_src'
24791 #if defined(__parallel)
24792 INTEGER :: ierr, msglen
24795 CALL mp_timeset(routinen, handle)
24797 #if defined(__parallel)
24799 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
24800 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24801 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24806 CALL mp_timestop(handle)
24807 END SUBROUTINE mp_bcast_z_src
24817 SUBROUTINE mp_ibcast_z (msg, source, comm, request)
24818 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24819 INTEGER,
INTENT(IN) :: source
24820 CLASS(mp_comm_type),
INTENT(IN) :: comm
24821 TYPE(mp_request_type),
INTENT(OUT) :: request
24823 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_z'
24826 #if defined(__parallel)
24827 INTEGER :: ierr, msglen
24830 CALL mp_timeset(routinen, handle)
24832 #if defined(__parallel)
24834 CALL mpi_ibcast(msg, msglen, mpi_double_complex, source, comm%handle, request%handle, ierr)
24835 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
24836 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_8_size))
24843 CALL mp_timestop(handle)
24844 END SUBROUTINE mp_ibcast_z
24853 SUBROUTINE mp_bcast_zv(msg, source, comm)
24854 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24855 INTEGER,
INTENT(IN) :: source
24856 CLASS(mp_comm_type),
INTENT(IN) :: comm
24858 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zv'
24861 #if defined(__parallel)
24862 INTEGER :: ierr, msglen
24865 CALL mp_timeset(routinen, handle)
24867 #if defined(__parallel)
24869 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
24870 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24871 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24877 CALL mp_timestop(handle)
24878 END SUBROUTINE mp_bcast_zv
24886 SUBROUTINE mp_bcast_zv_src(msg, comm)
24887 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24888 CLASS(mp_comm_type),
INTENT(IN) :: comm
24890 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zv_src'
24893 #if defined(__parallel)
24894 INTEGER :: ierr, msglen
24897 CALL mp_timeset(routinen, handle)
24899 #if defined(__parallel)
24901 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
24902 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24903 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24908 CALL mp_timestop(handle)
24909 END SUBROUTINE mp_bcast_zv_src
24918 SUBROUTINE mp_ibcast_zv(msg, source, comm, request)
24919 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
24920 INTEGER,
INTENT(IN) :: source
24921 CLASS(mp_comm_type),
INTENT(IN) :: comm
24922 TYPE(mp_request_type) :: request
24924 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_zv'
24927 #if defined(__parallel)
24928 INTEGER :: ierr, msglen
24931 CALL mp_timeset(routinen, handle)
24933 #if defined(__parallel)
24934 #if !defined(__GNUC__) || __GNUC__ >= 9
24935 cpassert(is_contiguous(msg))
24938 CALL mpi_ibcast(msg, msglen, mpi_double_complex, source, comm%handle, request%handle, ierr)
24939 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
24940 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_8_size))
24947 CALL mp_timestop(handle)
24948 END SUBROUTINE mp_ibcast_zv
24957 SUBROUTINE mp_bcast_zm(msg, source, comm)
24958 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
24959 INTEGER,
INTENT(IN) :: source
24960 CLASS(mp_comm_type),
INTENT(IN) :: comm
24962 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zm'
24965 #if defined(__parallel)
24966 INTEGER :: ierr, msglen
24969 CALL mp_timeset(routinen, handle)
24971 #if defined(__parallel)
24973 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
24974 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
24975 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
24981 CALL mp_timestop(handle)
24982 END SUBROUTINE mp_bcast_zm
24991 SUBROUTINE mp_bcast_zm_src(msg, comm)
24992 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
24993 CLASS(mp_comm_type),
INTENT(IN) :: comm
24995 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zm_src'
24998 #if defined(__parallel)
24999 INTEGER :: ierr, msglen
25002 CALL mp_timeset(routinen, handle)
25004 #if defined(__parallel)
25006 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25007 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25008 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25013 CALL mp_timestop(handle)
25014 END SUBROUTINE mp_bcast_zm_src
25023 SUBROUTINE mp_bcast_z3(msg, source, comm)
25024 COMPLEX(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
25025 INTEGER,
INTENT(IN) :: source
25026 CLASS(mp_comm_type),
INTENT(IN) :: comm
25028 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z3'
25031 #if defined(__parallel)
25032 INTEGER :: ierr, msglen
25035 CALL mp_timeset(routinen, handle)
25037 #if defined(__parallel)
25039 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
25040 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25041 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25047 CALL mp_timestop(handle)
25048 END SUBROUTINE mp_bcast_z3
25057 SUBROUTINE mp_bcast_z3_src(msg, comm)
25058 COMPLEX(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
25059 CLASS(mp_comm_type),
INTENT(IN) :: comm
25061 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z3_src'
25064 #if defined(__parallel)
25065 INTEGER :: ierr, msglen
25068 CALL mp_timeset(routinen, handle)
25070 #if defined(__parallel)
25072 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25073 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25074 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25079 CALL mp_timestop(handle)
25080 END SUBROUTINE mp_bcast_z3_src
25089 SUBROUTINE mp_sum_z (msg, comm)
25090 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25091 CLASS(mp_comm_type),
INTENT(IN) :: comm
25093 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_z'
25096 #if defined(__parallel)
25097 INTEGER :: ierr, msglen
25100 CALL mp_timeset(routinen, handle)
25102 #if defined(__parallel)
25104 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25105 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25106 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25111 CALL mp_timestop(handle)
25112 END SUBROUTINE mp_sum_z
25120 SUBROUTINE mp_sum_zv(msg, comm)
25121 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25122 CLASS(mp_comm_type),
INTENT(IN) :: comm
25124 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zv'
25127 #if defined(__parallel)
25128 INTEGER :: ierr, msglen
25131 CALL mp_timeset(routinen, handle)
25133 #if defined(__parallel)
25135 IF (msglen > 0)
THEN
25136 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25137 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25139 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25144 CALL mp_timestop(handle)
25145 END SUBROUTINE mp_sum_zv
25153 SUBROUTINE mp_isum_zv(msg, comm, request)
25154 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
25155 CLASS(mp_comm_type),
INTENT(IN) :: comm
25156 TYPE(mp_request_type),
INTENT(OUT) :: request
25158 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_zv'
25161 #if defined(__parallel)
25162 INTEGER :: ierr, msglen
25165 CALL mp_timeset(routinen, handle)
25167 #if defined(__parallel)
25168 #if !defined(__GNUC__) || __GNUC__ >= 9
25169 cpassert(is_contiguous(msg))
25172 IF (msglen > 0)
THEN
25173 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, request%handle, ierr)
25174 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
25178 CALL add_perf(perf_id=23, count=1, msg_size=msglen*(2*real_8_size))
25184 CALL mp_timestop(handle)
25185 END SUBROUTINE mp_isum_zv
25193 SUBROUTINE mp_sum_zm(msg, comm)
25194 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25195 CLASS(mp_comm_type),
INTENT(IN) :: comm
25197 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm'
25200 #if defined(__parallel)
25201 INTEGER,
PARAMETER :: max_msg = 2**25
25202 INTEGER :: ierr, m1, msglen, step, msglensum
25205 CALL mp_timeset(routinen, handle)
25207 #if defined(__parallel)
25209 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
25211 DO m1 = lbound(msg, 2), ubound(msg, 2), step
25212 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
25213 msglensum = msglensum + msglen
25214 IF (msglen > 0)
THEN
25215 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25216 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25219 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_8_size))
25224 CALL mp_timestop(handle)
25225 END SUBROUTINE mp_sum_zm
25233 SUBROUTINE mp_sum_zm3(msg, comm)
25234 COMPLEX(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
25235 CLASS(mp_comm_type),
INTENT(IN) :: comm
25237 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm3'
25240 #if defined(__parallel)
25241 INTEGER :: ierr, msglen
25244 CALL mp_timeset(routinen, handle)
25246 #if defined(__parallel)
25248 IF (msglen > 0)
THEN
25249 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25250 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25252 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25257 CALL mp_timestop(handle)
25258 END SUBROUTINE mp_sum_zm3
25266 SUBROUTINE mp_sum_zm4(msg, comm)
25267 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
25268 CLASS(mp_comm_type),
INTENT(IN) :: comm
25270 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm4'
25273 #if defined(__parallel)
25274 INTEGER :: ierr, msglen
25277 CALL mp_timeset(routinen, handle)
25279 #if defined(__parallel)
25281 IF (msglen > 0)
THEN
25282 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25283 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25285 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25290 CALL mp_timestop(handle)
25291 END SUBROUTINE mp_sum_zm4
25303 SUBROUTINE mp_sum_root_zv(msg, root, comm)
25304 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25305 INTEGER,
INTENT(IN) :: root
25306 CLASS(mp_comm_type),
INTENT(IN) :: comm
25308 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_zv'
25311 #if defined(__parallel)
25312 INTEGER :: ierr, m1, msglen, taskid
25313 COMPLEX(kind=real_8),
ALLOCATABLE :: res(:)
25316 CALL mp_timeset(routinen, handle)
25318 #if defined(__parallel)
25320 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25321 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25322 IF (msglen > 0)
THEN
25325 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_sum, &
25326 root, comm%handle, ierr)
25327 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25328 IF (taskid == root)
THEN
25333 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25339 CALL mp_timestop(handle)
25340 END SUBROUTINE mp_sum_root_zv
25351 SUBROUTINE mp_sum_root_zm(msg, root, comm)
25352 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25353 INTEGER,
INTENT(IN) :: root
25354 CLASS(mp_comm_type),
INTENT(IN) :: comm
25356 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
25359 #if defined(__parallel)
25360 INTEGER :: ierr, m1, m2, msglen, taskid
25361 COMPLEX(kind=real_8),
ALLOCATABLE :: res(:, :)
25364 CALL mp_timeset(routinen, handle)
25366 #if defined(__parallel)
25368 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25369 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25370 IF (msglen > 0)
THEN
25373 ALLOCATE (res(m1, m2))
25374 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_sum, root, comm%handle, ierr)
25375 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25376 IF (taskid == root)
THEN
25381 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25387 CALL mp_timestop(handle)
25388 END SUBROUTINE mp_sum_root_zm
25396 SUBROUTINE mp_sum_partial_zm(msg, res, comm)
25397 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
25398 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
25399 CLASS(mp_comm_type),
INTENT(IN) :: comm
25401 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_zm'
25404 #if defined(__parallel)
25405 INTEGER :: ierr, msglen, taskid
25408 CALL mp_timeset(routinen, handle)
25410 #if defined(__parallel)
25412 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25413 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25414 IF (msglen > 0)
THEN
25415 CALL mpi_scan(msg, res, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25416 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
25418 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25424 CALL mp_timestop(handle)
25425 END SUBROUTINE mp_sum_partial_zm
25435 SUBROUTINE mp_max_z (msg, comm)
25436 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25437 CLASS(mp_comm_type),
INTENT(IN) :: comm
25439 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_z'
25442 #if defined(__parallel)
25443 INTEGER :: ierr, msglen
25446 CALL mp_timeset(routinen, handle)
25448 #if defined(__parallel)
25450 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_max, comm%handle, ierr)
25451 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25452 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25457 CALL mp_timestop(handle)
25458 END SUBROUTINE mp_max_z
25468 SUBROUTINE mp_max_root_z (msg, root, comm)
25469 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25470 INTEGER,
INTENT(IN) :: root
25471 CLASS(mp_comm_type),
INTENT(IN) :: comm
25473 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_z'
25476 #if defined(__parallel)
25477 INTEGER :: ierr, msglen
25478 COMPLEX(kind=real_8) :: res
25481 CALL mp_timeset(routinen, handle)
25483 #if defined(__parallel)
25485 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_max, root, comm%handle, ierr)
25486 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25487 IF (root == comm%mepos) msg = res
25488 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25494 CALL mp_timestop(handle)
25495 END SUBROUTINE mp_max_root_z
25505 SUBROUTINE mp_max_zv(msg, comm)
25506 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25507 CLASS(mp_comm_type),
INTENT(IN) :: comm
25509 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_zv'
25512 #if defined(__parallel)
25513 INTEGER :: ierr, msglen
25516 CALL mp_timeset(routinen, handle)
25518 #if defined(__parallel)
25520 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_max, comm%handle, ierr)
25521 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25522 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25527 CALL mp_timestop(handle)
25528 END SUBROUTINE mp_max_zv
25538 SUBROUTINE mp_max_root_zm(msg, root, comm)
25539 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25541 CLASS(mp_comm_type),
INTENT(IN) :: comm
25543 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_zm'
25546 #if defined(__parallel)
25547 INTEGER :: ierr, msglen
25548 COMPLEX(kind=real_8) :: res(size(msg, 1), size(msg, 2))
25551 CALL mp_timeset(routinen, handle)
25553 #if defined(__parallel)
25555 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_max, root, comm%handle, ierr)
25556 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25557 IF (root == comm%mepos) msg = res
25558 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25564 CALL mp_timestop(handle)
25565 END SUBROUTINE mp_max_root_zm
25575 SUBROUTINE mp_min_z (msg, comm)
25576 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25577 CLASS(mp_comm_type),
INTENT(IN) :: comm
25579 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_z'
25582 #if defined(__parallel)
25583 INTEGER :: ierr, msglen
25586 CALL mp_timeset(routinen, handle)
25588 #if defined(__parallel)
25590 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_min, comm%handle, ierr)
25591 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25592 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25597 CALL mp_timestop(handle)
25598 END SUBROUTINE mp_min_z
25610 SUBROUTINE mp_min_zv(msg, comm)
25611 COMPLEX(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
25612 CLASS(mp_comm_type),
INTENT(IN) :: comm
25614 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_zv'
25617 #if defined(__parallel)
25618 INTEGER :: ierr, msglen
25621 CALL mp_timeset(routinen, handle)
25623 #if defined(__parallel)
25625 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_min, comm%handle, ierr)
25626 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25627 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25632 CALL mp_timestop(handle)
25633 END SUBROUTINE mp_min_zv
25643 SUBROUTINE mp_prod_z (msg, comm)
25644 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25645 CLASS(mp_comm_type),
INTENT(IN) :: comm
25647 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_z'
25650 #if defined(__parallel)
25651 INTEGER :: ierr, msglen
25654 CALL mp_timeset(routinen, handle)
25656 #if defined(__parallel)
25658 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_prod, comm%handle, ierr)
25659 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25660 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25665 CALL mp_timestop(handle)
25666 END SUBROUTINE mp_prod_z
25677 SUBROUTINE mp_scatter_zv(msg_scatter, msg, root, comm)
25678 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
25679 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
25680 INTEGER,
INTENT(IN) :: root
25681 CLASS(mp_comm_type),
INTENT(IN) :: comm
25683 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_zv'
25686 #if defined(__parallel)
25687 INTEGER :: ierr, msglen
25690 CALL mp_timeset(routinen, handle)
25692 #if defined(__parallel)
25694 CALL mpi_scatter(msg_scatter, msglen, mpi_double_complex, msg, &
25695 msglen, mpi_double_complex, root, comm%handle, ierr)
25696 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
25697 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25703 CALL mp_timestop(handle)
25704 END SUBROUTINE mp_scatter_zv
25714 SUBROUTINE mp_iscatter_z (msg_scatter, msg, root, comm, request)
25715 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:)
25716 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25717 INTEGER,
INTENT(IN) :: root
25718 CLASS(mp_comm_type),
INTENT(IN) :: comm
25719 TYPE(mp_request_type),
INTENT(OUT) :: request
25721 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_z'
25724 #if defined(__parallel)
25725 INTEGER :: ierr, msglen
25728 CALL mp_timeset(routinen, handle)
25730 #if defined(__parallel)
25731 #if !defined(__GNUC__) || __GNUC__ >= 9
25732 cpassert(is_contiguous(msg_scatter))
25735 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_complex, msg, &
25736 msglen, mpi_double_complex, root, comm%handle, request%handle, ierr)
25737 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
25738 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
25742 msg = msg_scatter(1)
25745 CALL mp_timestop(handle)
25746 END SUBROUTINE mp_iscatter_z
25756 SUBROUTINE mp_iscatter_zv2(msg_scatter, msg, root, comm, request)
25757 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:, :)
25758 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
25759 INTEGER,
INTENT(IN) :: root
25760 CLASS(mp_comm_type),
INTENT(IN) :: comm
25761 TYPE(mp_request_type),
INTENT(OUT) :: request
25763 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_zv2'
25766 #if defined(__parallel)
25767 INTEGER :: ierr, msglen
25770 CALL mp_timeset(routinen, handle)
25772 #if defined(__parallel)
25773 #if !defined(__GNUC__) || __GNUC__ >= 9
25774 cpassert(is_contiguous(msg_scatter))
25777 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_complex, msg, &
25778 msglen, mpi_double_complex, root, comm%handle, request%handle, ierr)
25779 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
25780 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
25784 msg(:) = msg_scatter(:, 1)
25787 CALL mp_timestop(handle)
25788 END SUBROUTINE mp_iscatter_zv2
25798 SUBROUTINE mp_iscatterv_zv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
25799 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:)
25800 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
25801 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
25802 INTEGER,
INTENT(IN) :: recvcount, root
25803 CLASS(mp_comm_type),
INTENT(IN) :: comm
25804 TYPE(mp_request_type),
INTENT(OUT) :: request
25806 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_zv'
25809 #if defined(__parallel)
25813 CALL mp_timeset(routinen, handle)
25815 #if defined(__parallel)
25816 #if !defined(__GNUC__) || __GNUC__ >= 9
25817 cpassert(is_contiguous(msg_scatter))
25818 cpassert(is_contiguous(msg))
25819 cpassert(is_contiguous(sendcounts))
25820 cpassert(is_contiguous(displs))
25822 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_double_complex, msg, &
25823 recvcount, mpi_double_complex, root, comm%handle, request%handle, ierr)
25824 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
25825 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
25827 mark_used(sendcounts)
25829 mark_used(recvcount)
25832 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
25835 CALL mp_timestop(handle)
25836 END SUBROUTINE mp_iscatterv_zv
25847 SUBROUTINE mp_gather_z (msg, msg_gather, root, comm)
25848 COMPLEX(kind=real_8),
INTENT(IN) :: msg
25849 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25850 INTEGER,
INTENT(IN) :: root
25851 CLASS(mp_comm_type),
INTENT(IN) :: comm
25853 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_z'
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, root, 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))
25871 msg_gather(1) = msg
25873 CALL mp_timestop(handle)
25874 END SUBROUTINE mp_gather_z
25884 SUBROUTINE mp_gather_z_src(msg, msg_gather, comm)
25885 COMPLEX(kind=real_8),
INTENT(IN) :: msg
25886 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25887 CLASS(mp_comm_type),
INTENT(IN) :: comm
25889 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_z_src'
25892 #if defined(__parallel)
25893 INTEGER :: ierr, msglen
25896 CALL mp_timeset(routinen, handle)
25898 #if defined(__parallel)
25900 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25901 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25902 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25903 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25906 msg_gather(1) = msg
25908 CALL mp_timestop(handle)
25909 END SUBROUTINE mp_gather_z_src
25923 SUBROUTINE mp_gather_zv(msg, msg_gather, root, comm)
25924 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
25925 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25926 INTEGER,
INTENT(IN) :: root
25927 CLASS(mp_comm_type),
INTENT(IN) :: comm
25929 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zv'
25932 #if defined(__parallel)
25933 INTEGER :: ierr, msglen
25936 CALL mp_timeset(routinen, handle)
25938 #if defined(__parallel)
25940 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25941 msglen, mpi_double_complex, root, comm%handle, ierr)
25942 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25943 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25949 CALL mp_timestop(handle)
25950 END SUBROUTINE mp_gather_zv
25963 SUBROUTINE mp_gather_zv_src(msg, msg_gather, comm)
25964 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
25965 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
25966 CLASS(mp_comm_type),
INTENT(IN) :: comm
25968 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zv_src'
25971 #if defined(__parallel)
25972 INTEGER :: ierr, msglen
25975 CALL mp_timeset(routinen, handle)
25977 #if defined(__parallel)
25979 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
25980 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25981 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
25982 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
25987 CALL mp_timestop(handle)
25988 END SUBROUTINE mp_gather_zv_src
26002 SUBROUTINE mp_gather_zm(msg, msg_gather, root, comm)
26003 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
26004 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
26005 INTEGER,
INTENT(IN) :: root
26006 CLASS(mp_comm_type),
INTENT(IN) :: comm
26008 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zm'
26011 #if defined(__parallel)
26012 INTEGER :: ierr, msglen
26015 CALL mp_timeset(routinen, handle)
26017 #if defined(__parallel)
26019 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
26020 msglen, mpi_double_complex, root, comm%handle, ierr)
26021 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
26022 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
26028 CALL mp_timestop(handle)
26029 END SUBROUTINE mp_gather_zm
26042 SUBROUTINE mp_gather_zm_src(msg, msg_gather, comm)
26043 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
26044 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
26045 CLASS(mp_comm_type),
INTENT(IN) :: comm
26047 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zm_src'
26050 #if defined(__parallel)
26051 INTEGER :: ierr, msglen
26054 CALL mp_timeset(routinen, handle)
26056 #if defined(__parallel)
26058 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
26059 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
26060 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
26061 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
26066 CALL mp_timestop(handle)
26067 END SUBROUTINE mp_gather_zm_src
26084 SUBROUTINE mp_gatherv_zv(sendbuf, recvbuf, recvcounts, displs, root, comm)
26086 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26087 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26088 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26089 INTEGER,
INTENT(IN) :: root
26090 CLASS(mp_comm_type),
INTENT(IN) :: comm
26092 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zv'
26095 #if defined(__parallel)
26096 INTEGER :: ierr, sendcount
26099 CALL mp_timeset(routinen, handle)
26101 #if defined(__parallel)
26102 sendcount =
SIZE(sendbuf)
26103 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26104 recvbuf, recvcounts, displs, mpi_double_complex, &
26105 root, comm%handle, ierr)
26106 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26107 CALL add_perf(perf_id=4, &
26109 msg_size=sendcount*(2*real_8_size))
26111 mark_used(recvcounts)
26114 recvbuf(1 + displs(1):) = sendbuf
26116 CALL mp_timestop(handle)
26117 END SUBROUTINE mp_gatherv_zv
26133 SUBROUTINE mp_gatherv_zv_src(sendbuf, recvbuf, recvcounts, displs, comm)
26135 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26136 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26137 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26138 CLASS(mp_comm_type),
INTENT(IN) :: comm
26140 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zv_src'
26143 #if defined(__parallel)
26144 INTEGER :: ierr, sendcount
26147 CALL mp_timeset(routinen, handle)
26149 #if defined(__parallel)
26150 sendcount =
SIZE(sendbuf)
26151 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26152 recvbuf, recvcounts, displs, mpi_double_complex, &
26153 comm%source, comm%handle, ierr)
26154 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26155 CALL add_perf(perf_id=4, &
26157 msg_size=sendcount*(2*real_8_size))
26159 mark_used(recvcounts)
26161 recvbuf(1 + displs(1):) = sendbuf
26163 CALL mp_timestop(handle)
26164 END SUBROUTINE mp_gatherv_zv_src
26181 SUBROUTINE mp_gatherv_zm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
26183 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26184 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26185 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26186 INTEGER,
INTENT(IN) :: root
26187 CLASS(mp_comm_type),
INTENT(IN) :: comm
26189 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zm2'
26192 #if defined(__parallel)
26193 INTEGER :: ierr, sendcount
26196 CALL mp_timeset(routinen, handle)
26198 #if defined(__parallel)
26199 sendcount =
SIZE(sendbuf)
26200 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26201 recvbuf, recvcounts, displs, mpi_double_complex, &
26202 root, comm%handle, ierr)
26203 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26204 CALL add_perf(perf_id=4, &
26206 msg_size=sendcount*(2*real_8_size))
26208 mark_used(recvcounts)
26211 recvbuf(:, 1 + displs(1):) = sendbuf
26213 CALL mp_timestop(handle)
26214 END SUBROUTINE mp_gatherv_zm2
26230 SUBROUTINE mp_gatherv_zm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
26232 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26233 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26234 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26235 CLASS(mp_comm_type),
INTENT(IN) :: comm
26237 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zm2_src'
26240 #if defined(__parallel)
26241 INTEGER :: ierr, sendcount
26244 CALL mp_timeset(routinen, handle)
26246 #if defined(__parallel)
26247 sendcount =
SIZE(sendbuf)
26248 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26249 recvbuf, recvcounts, displs, mpi_double_complex, &
26250 comm%source, comm%handle, ierr)
26251 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26252 CALL add_perf(perf_id=4, &
26254 msg_size=sendcount*(2*real_8_size))
26256 mark_used(recvcounts)
26258 recvbuf(:, 1 + displs(1):) = sendbuf
26260 CALL mp_timestop(handle)
26261 END SUBROUTINE mp_gatherv_zm2_src
26278 SUBROUTINE mp_igatherv_zv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
26279 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
26280 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
26281 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26282 INTEGER,
INTENT(IN) :: sendcount, root
26283 CLASS(mp_comm_type),
INTENT(IN) :: comm
26284 TYPE(mp_request_type),
INTENT(OUT) :: request
26286 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_zv'
26289 #if defined(__parallel)
26293 CALL mp_timeset(routinen, handle)
26295 #if defined(__parallel)
26296 #if !defined(__GNUC__) || __GNUC__ >= 9
26297 cpassert(is_contiguous(sendbuf))
26298 cpassert(is_contiguous(recvbuf))
26299 cpassert(is_contiguous(recvcounts))
26300 cpassert(is_contiguous(displs))
26302 CALL mpi_igatherv(sendbuf, sendcount, mpi_double_complex, &
26303 recvbuf, recvcounts, displs, mpi_double_complex, &
26304 root, comm%handle, request%handle, ierr)
26305 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26306 CALL add_perf(perf_id=24, &
26308 msg_size=sendcount*(2*real_8_size))
26310 mark_used(sendcount)
26311 mark_used(recvcounts)
26314 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
26317 CALL mp_timestop(handle)
26318 END SUBROUTINE mp_igatherv_zv
26331 SUBROUTINE mp_allgather_z (msgout, msgin, comm)
26332 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26333 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
26334 CLASS(mp_comm_type),
INTENT(IN) :: comm
26336 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z'
26339 #if defined(__parallel)
26340 INTEGER :: ierr, rcount, scount
26343 CALL mp_timeset(routinen, handle)
26345 #if defined(__parallel)
26348 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26349 msgin, rcount, mpi_double_complex, &
26351 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26356 CALL mp_timestop(handle)
26357 END SUBROUTINE mp_allgather_z
26370 SUBROUTINE mp_allgather_z2(msgout, msgin, comm)
26371 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26372 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26373 CLASS(mp_comm_type),
INTENT(IN) :: comm
26375 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z2'
26378 #if defined(__parallel)
26379 INTEGER :: ierr, rcount, scount
26382 CALL mp_timeset(routinen, handle)
26384 #if defined(__parallel)
26387 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26388 msgin, rcount, mpi_double_complex, &
26390 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26395 CALL mp_timestop(handle)
26396 END SUBROUTINE mp_allgather_z2
26409 SUBROUTINE mp_iallgather_z (msgout, msgin, comm, request)
26410 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26411 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26412 CLASS(mp_comm_type),
INTENT(IN) :: comm
26413 TYPE(mp_request_type),
INTENT(OUT) :: request
26415 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z'
26418 #if defined(__parallel)
26419 INTEGER :: ierr, rcount, scount
26422 CALL mp_timeset(routinen, handle)
26424 #if defined(__parallel)
26425 #if !defined(__GNUC__) || __GNUC__ >= 9
26426 cpassert(is_contiguous(msgin))
26430 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26431 msgin, rcount, mpi_double_complex, &
26432 comm%handle, request%handle, ierr)
26433 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26439 CALL mp_timestop(handle)
26440 END SUBROUTINE mp_iallgather_z
26455 SUBROUTINE mp_allgather_z12(msgout, msgin, comm)
26456 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
26457 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26458 CLASS(mp_comm_type),
INTENT(IN) :: comm
26460 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z12'
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_z12
26491 SUBROUTINE mp_allgather_z23(msgout, msgin, comm)
26492 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
26493 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
26494 CLASS(mp_comm_type),
INTENT(IN) :: comm
26496 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z23'
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_z23
26527 SUBROUTINE mp_allgather_z34(msgout, msgin, comm)
26528 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
26529 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
26530 CLASS(mp_comm_type),
INTENT(IN) :: comm
26532 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z34'
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(:, :, :, 1) = msgout(:, :, :)
26552 CALL mp_timestop(handle)
26553 END SUBROUTINE mp_allgather_z34
26563 SUBROUTINE mp_allgather_z22(msgout, msgin, comm)
26564 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
26565 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26566 CLASS(mp_comm_type),
INTENT(IN) :: comm
26568 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z22'
26571 #if defined(__parallel)
26572 INTEGER :: ierr, rcount, scount
26575 CALL mp_timeset(routinen, handle)
26577 #if defined(__parallel)
26578 scount =
SIZE(msgout(:, :))
26580 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26581 msgin, rcount, mpi_double_complex, &
26583 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26586 msgin(:, :) = msgout(:, :)
26588 CALL mp_timestop(handle)
26589 END SUBROUTINE mp_allgather_z22
26600 SUBROUTINE mp_iallgather_z11(msgout, msgin, comm, request)
26601 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26602 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26603 CLASS(mp_comm_type),
INTENT(IN) :: comm
26604 TYPE(mp_request_type),
INTENT(OUT) :: request
26606 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z11'
26609 #if defined(__parallel)
26610 INTEGER :: ierr, rcount, scount
26613 CALL mp_timeset(routinen, handle)
26615 #if defined(__parallel)
26616 #if !defined(__GNUC__) || __GNUC__ >= 9
26617 cpassert(is_contiguous(msgout))
26618 cpassert(is_contiguous(msgin))
26620 scount =
SIZE(msgout(:))
26622 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26623 msgin, rcount, mpi_double_complex, &
26624 comm%handle, request%handle, ierr)
26625 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26631 CALL mp_timestop(handle)
26632 END SUBROUTINE mp_iallgather_z11
26643 SUBROUTINE mp_iallgather_z13(msgout, msgin, comm, request)
26644 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26645 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
26646 CLASS(mp_comm_type),
INTENT(IN) :: comm
26647 TYPE(mp_request_type),
INTENT(OUT) :: request
26649 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z13'
26652 #if defined(__parallel)
26653 INTEGER :: ierr, rcount, scount
26656 CALL mp_timeset(routinen, handle)
26658 #if defined(__parallel)
26659 #if !defined(__GNUC__) || __GNUC__ >= 9
26660 cpassert(is_contiguous(msgout))
26661 cpassert(is_contiguous(msgin))
26664 scount =
SIZE(msgout(:))
26666 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26667 msgin, rcount, mpi_double_complex, &
26668 comm%handle, request%handle, ierr)
26669 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26672 msgin(:, 1, 1) = msgout(:)
26675 CALL mp_timestop(handle)
26676 END SUBROUTINE mp_iallgather_z13
26687 SUBROUTINE mp_iallgather_z22(msgout, msgin, comm, request)
26688 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :)
26689 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :)
26690 CLASS(mp_comm_type),
INTENT(IN) :: comm
26691 TYPE(mp_request_type),
INTENT(OUT) :: request
26693 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z22'
26696 #if defined(__parallel)
26697 INTEGER :: ierr, rcount, scount
26700 CALL mp_timeset(routinen, handle)
26702 #if defined(__parallel)
26703 #if !defined(__GNUC__) || __GNUC__ >= 9
26704 cpassert(is_contiguous(msgout))
26705 cpassert(is_contiguous(msgin))
26708 scount =
SIZE(msgout(:, :))
26710 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26711 msgin, rcount, mpi_double_complex, &
26712 comm%handle, request%handle, ierr)
26713 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26716 msgin(:, :) = msgout(:, :)
26719 CALL mp_timestop(handle)
26720 END SUBROUTINE mp_iallgather_z22
26731 SUBROUTINE mp_iallgather_z24(msgout, msgin, comm, request)
26732 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :)
26733 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :, :)
26734 CLASS(mp_comm_type),
INTENT(IN) :: comm
26735 TYPE(mp_request_type),
INTENT(OUT) :: request
26737 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z24'
26740 #if defined(__parallel)
26741 INTEGER :: ierr, rcount, scount
26744 CALL mp_timeset(routinen, handle)
26746 #if defined(__parallel)
26747 #if !defined(__GNUC__) || __GNUC__ >= 9
26748 cpassert(is_contiguous(msgout))
26749 cpassert(is_contiguous(msgin))
26752 scount =
SIZE(msgout(:, :))
26754 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26755 msgin, rcount, mpi_double_complex, &
26756 comm%handle, request%handle, ierr)
26757 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26760 msgin(:, :, 1, 1) = msgout(:, :)
26763 CALL mp_timestop(handle)
26764 END SUBROUTINE mp_iallgather_z24
26775 SUBROUTINE mp_iallgather_z33(msgout, msgin, comm, request)
26776 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :, :)
26777 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
26778 CLASS(mp_comm_type),
INTENT(IN) :: comm
26779 TYPE(mp_request_type),
INTENT(OUT) :: request
26781 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z33'
26784 #if defined(__parallel)
26785 INTEGER :: ierr, rcount, scount
26788 CALL mp_timeset(routinen, handle)
26790 #if defined(__parallel)
26791 #if !defined(__GNUC__) || __GNUC__ >= 9
26792 cpassert(is_contiguous(msgout))
26793 cpassert(is_contiguous(msgin))
26796 scount =
SIZE(msgout(:, :, :))
26798 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26799 msgin, rcount, mpi_double_complex, &
26800 comm%handle, request%handle, ierr)
26801 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
26804 msgin(:, :, :) = msgout(:, :, :)
26807 CALL mp_timestop(handle)
26808 END SUBROUTINE mp_iallgather_z33
26827 SUBROUTINE mp_allgatherv_zv(msgout, msgin, rcount, rdispl, comm)
26828 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
26829 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
26830 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
26831 CLASS(mp_comm_type),
INTENT(IN) :: comm
26833 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_zv'
26836 #if defined(__parallel)
26837 INTEGER :: ierr, scount
26840 CALL mp_timeset(routinen, handle)
26842 #if defined(__parallel)
26843 scount =
SIZE(msgout)
26844 CALL mpi_allgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
26845 rdispl, mpi_double_complex, comm%handle, ierr)
26846 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
26853 CALL mp_timestop(handle)
26854 END SUBROUTINE mp_allgatherv_zv
26873 SUBROUTINE mp_allgatherv_zm2(msgout, msgin, rcount, rdispl, comm)
26874 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
26875 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
26876 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
26877 CLASS(mp_comm_type),
INTENT(IN) :: comm
26879 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_zv'
26882 #if defined(__parallel)
26883 INTEGER :: ierr, scount
26886 CALL mp_timeset(routinen, handle)
26888 #if defined(__parallel)
26889 scount =
SIZE(msgout)
26890 CALL mpi_allgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
26891 rdispl, mpi_double_complex, comm%handle, ierr)
26892 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
26899 CALL mp_timestop(handle)
26900 END SUBROUTINE mp_allgatherv_zm2
26919 SUBROUTINE mp_iallgatherv_zv(msgout, msgin, rcount, rdispl, comm, request)
26920 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26921 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26922 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
26923 CLASS(mp_comm_type),
INTENT(IN) :: comm
26924 TYPE(mp_request_type),
INTENT(OUT) :: request
26926 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_zv'
26929 #if defined(__parallel)
26930 INTEGER :: ierr, scount, rsize
26933 CALL mp_timeset(routinen, handle)
26935 #if defined(__parallel)
26936 #if !defined(__GNUC__) || __GNUC__ >= 9
26937 cpassert(is_contiguous(msgout))
26938 cpassert(is_contiguous(msgin))
26939 cpassert(is_contiguous(rcount))
26940 cpassert(is_contiguous(rdispl))
26943 scount =
SIZE(msgout)
26944 rsize =
SIZE(rcount)
26945 CALL mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, &
26946 rdispl, comm, request, ierr)
26947 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
26955 CALL mp_timestop(handle)
26956 END SUBROUTINE mp_iallgatherv_zv
26975 SUBROUTINE mp_iallgatherv_zv2(msgout, msgin, rcount, rdispl, comm, request)
26976 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
26977 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26978 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
26979 CLASS(mp_comm_type),
INTENT(IN) :: comm
26980 TYPE(mp_request_type),
INTENT(OUT) :: request
26982 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_zv2'
26985 #if defined(__parallel)
26986 INTEGER :: ierr, scount, rsize
26989 CALL mp_timeset(routinen, handle)
26991 #if defined(__parallel)
26992 #if !defined(__GNUC__) || __GNUC__ >= 9
26993 cpassert(is_contiguous(msgout))
26994 cpassert(is_contiguous(msgin))
26995 cpassert(is_contiguous(rcount))
26996 cpassert(is_contiguous(rdispl))
26999 scount =
SIZE(msgout)
27000 rsize =
SIZE(rcount)
27001 CALL mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, &
27002 rdispl, comm, request, ierr)
27003 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
27011 CALL mp_timestop(handle)
27012 END SUBROUTINE mp_iallgatherv_zv2
27023 #if defined(__parallel)
27024 SUBROUTINE mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
27025 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
27026 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
27027 INTEGER,
INTENT(IN) :: rsize
27028 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
27029 CLASS(mp_comm_type),
INTENT(IN) :: comm
27030 TYPE(mp_request_type),
INTENT(OUT) :: request
27031 INTEGER,
INTENT(INOUT) :: ierr
27033 CALL mpi_iallgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
27034 rdispl, mpi_double_complex, comm%handle, request%handle, ierr)
27036 END SUBROUTINE mp_iallgatherv_zv_internal
27047 SUBROUTINE mp_sum_scatter_zv(msgout, msgin, rcount, comm)
27048 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
27049 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
27050 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
27051 CLASS(mp_comm_type),
INTENT(IN) :: comm
27053 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_zv'
27056 #if defined(__parallel)
27060 CALL mp_timeset(routinen, handle)
27062 #if defined(__parallel)
27063 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_double_complex, mpi_sum, &
27065 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
27067 CALL add_perf(perf_id=3, count=1, &
27068 msg_size=rcount(1)*2*(2*real_8_size))
27072 msgin = msgout(:, 1)
27074 CALL mp_timestop(handle)
27075 END SUBROUTINE mp_sum_scatter_zv
27086 SUBROUTINE mp_sendrecv_z (msgin, dest, msgout, source, comm, tag)
27087 COMPLEX(kind=real_8),
INTENT(IN) :: msgin
27088 INTEGER,
INTENT(IN) :: dest
27089 COMPLEX(kind=real_8),
INTENT(OUT) :: msgout
27090 INTEGER,
INTENT(IN) :: source
27091 CLASS(mp_comm_type),
INTENT(IN) :: comm
27092 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27094 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_z'
27097 #if defined(__parallel)
27098 INTEGER :: ierr, msglen_in, msglen_out, &
27102 CALL mp_timeset(routinen, handle)
27104 #if defined(__parallel)
27109 IF (
PRESENT(tag))
THEN
27113 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27114 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27115 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27116 CALL add_perf(perf_id=7, count=1, &
27117 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27125 CALL mp_timestop(handle)
27126 END SUBROUTINE mp_sendrecv_z
27137 SUBROUTINE mp_sendrecv_zv(msgin, dest, msgout, source, comm, tag)
27138 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
27139 INTEGER,
INTENT(IN) :: dest
27140 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
27141 INTEGER,
INTENT(IN) :: source
27142 CLASS(mp_comm_type),
INTENT(IN) :: comm
27143 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27145 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zv'
27148 #if defined(__parallel)
27149 INTEGER :: ierr, msglen_in, msglen_out, &
27153 CALL mp_timeset(routinen, handle)
27155 #if defined(__parallel)
27156 msglen_in =
SIZE(msgin)
27157 msglen_out =
SIZE(msgout)
27160 IF (
PRESENT(tag))
THEN
27164 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27165 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27166 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27167 CALL add_perf(perf_id=7, count=1, &
27168 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27176 CALL mp_timestop(handle)
27177 END SUBROUTINE mp_sendrecv_zv
27189 SUBROUTINE mp_sendrecv_zm2(msgin, dest, msgout, source, comm, tag)
27190 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
27191 INTEGER,
INTENT(IN) :: dest
27192 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
27193 INTEGER,
INTENT(IN) :: source
27194 CLASS(mp_comm_type),
INTENT(IN) :: comm
27195 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27197 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm2'
27200 #if defined(__parallel)
27201 INTEGER :: ierr, msglen_in, msglen_out, &
27205 CALL mp_timeset(routinen, handle)
27207 #if defined(__parallel)
27208 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
27209 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
27212 IF (
PRESENT(tag))
THEN
27216 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27217 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27218 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27219 CALL add_perf(perf_id=7, count=1, &
27220 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27228 CALL mp_timestop(handle)
27229 END SUBROUTINE mp_sendrecv_zm2
27240 SUBROUTINE mp_sendrecv_zm3(msgin, dest, msgout, source, comm, tag)
27241 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
27242 INTEGER,
INTENT(IN) :: dest
27243 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
27244 INTEGER,
INTENT(IN) :: source
27245 CLASS(mp_comm_type),
INTENT(IN) :: comm
27246 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27248 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm3'
27251 #if defined(__parallel)
27252 INTEGER :: ierr, msglen_in, msglen_out, &
27256 CALL mp_timeset(routinen, handle)
27258 #if defined(__parallel)
27259 msglen_in =
SIZE(msgin)
27260 msglen_out =
SIZE(msgout)
27263 IF (
PRESENT(tag))
THEN
27267 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27268 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27269 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27270 CALL add_perf(perf_id=7, count=1, &
27271 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27279 CALL mp_timestop(handle)
27280 END SUBROUTINE mp_sendrecv_zm3
27291 SUBROUTINE mp_sendrecv_zm4(msgin, dest, msgout, source, comm, tag)
27292 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
27293 INTEGER,
INTENT(IN) :: dest
27294 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
27295 INTEGER,
INTENT(IN) :: source
27296 CLASS(mp_comm_type),
INTENT(IN) :: comm
27297 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27299 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm4'
27302 #if defined(__parallel)
27303 INTEGER :: ierr, msglen_in, msglen_out, &
27307 CALL mp_timeset(routinen, handle)
27309 #if defined(__parallel)
27310 msglen_in =
SIZE(msgin)
27311 msglen_out =
SIZE(msgout)
27314 IF (
PRESENT(tag))
THEN
27318 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27319 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27320 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27321 CALL add_perf(perf_id=7, count=1, &
27322 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27330 CALL mp_timestop(handle)
27331 END SUBROUTINE mp_sendrecv_zm4
27348 SUBROUTINE mp_isendrecv_z (msgin, dest, msgout, source, comm, send_request, &
27350 COMPLEX(kind=real_8),
INTENT(IN) :: msgin
27351 INTEGER,
INTENT(IN) :: dest
27352 COMPLEX(kind=real_8),
INTENT(INOUT) :: msgout
27353 INTEGER,
INTENT(IN) :: source
27354 CLASS(mp_comm_type),
INTENT(IN) :: comm
27355 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
27356 INTEGER,
INTENT(in),
OPTIONAL :: tag
27358 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_z'
27361 #if defined(__parallel)
27362 INTEGER :: ierr, my_tag
27365 CALL mp_timeset(routinen, handle)
27367 #if defined(__parallel)
27369 IF (
PRESENT(tag)) my_tag = tag
27371 CALL mpi_irecv(msgout, 1, mpi_double_complex, source, my_tag, &
27372 comm%handle, recv_request%handle, ierr)
27373 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27375 CALL mpi_isend(msgin, 1, mpi_double_complex, dest, my_tag, &
27376 comm%handle, send_request%handle, ierr)
27377 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27379 CALL add_perf(perf_id=8, count=1, msg_size=2*(2*real_8_size))
27389 CALL mp_timestop(handle)
27390 END SUBROUTINE mp_isendrecv_z
27409 SUBROUTINE mp_isendrecv_zv(msgin, dest, msgout, source, comm, send_request, &
27411 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
27412 INTEGER,
INTENT(IN) :: dest
27413 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
27414 INTEGER,
INTENT(IN) :: source
27415 CLASS(mp_comm_type),
INTENT(IN) :: comm
27416 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
27417 INTEGER,
INTENT(in),
OPTIONAL :: tag
27419 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_zv'
27422 #if defined(__parallel)
27423 INTEGER :: ierr, msglen, my_tag
27424 COMPLEX(kind=real_8) :: foo
27427 CALL mp_timeset(routinen, handle)
27429 #if defined(__parallel)
27430 #if !defined(__GNUC__) || __GNUC__ >= 9
27431 cpassert(is_contiguous(msgout))
27432 cpassert(is_contiguous(msgin))
27436 IF (
PRESENT(tag)) my_tag = tag
27438 msglen =
SIZE(msgout, 1)
27439 IF (msglen > 0)
THEN
27440 CALL mpi_irecv(msgout(1), msglen, mpi_double_complex, source, my_tag, &
27441 comm%handle, recv_request%handle, ierr)
27443 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27444 comm%handle, recv_request%handle, ierr)
27446 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27448 msglen =
SIZE(msgin, 1)
27449 IF (msglen > 0)
THEN
27450 CALL mpi_isend(msgin(1), msglen, mpi_double_complex, dest, my_tag, &
27451 comm%handle, send_request%handle, ierr)
27453 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27454 comm%handle, send_request%handle, ierr)
27456 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27458 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
27459 CALL add_perf(perf_id=8, count=1, msg_size=msglen*(2*real_8_size))
27469 CALL mp_timestop(handle)
27470 END SUBROUTINE mp_isendrecv_zv
27485 SUBROUTINE mp_isend_zv(msgin, dest, comm, request, tag)
27486 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
27487 INTEGER,
INTENT(IN) :: dest
27488 CLASS(mp_comm_type),
INTENT(IN) :: comm
27489 TYPE(mp_request_type),
INTENT(out) :: request
27490 INTEGER,
INTENT(in),
OPTIONAL :: tag
27492 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zv'
27494 INTEGER :: handle, ierr
27495 #if defined(__parallel)
27496 INTEGER :: msglen, my_tag
27497 COMPLEX(kind=real_8) :: foo(1)
27500 CALL mp_timeset(routinen, handle)
27502 #if defined(__parallel)
27503 #if !defined(__GNUC__) || __GNUC__ >= 9
27504 cpassert(is_contiguous(msgin))
27507 IF (
PRESENT(tag)) my_tag = tag
27509 msglen =
SIZE(msgin)
27510 IF (msglen > 0)
THEN
27511 CALL mpi_isend(msgin(1), msglen, mpi_double_complex, dest, my_tag, &
27512 comm%handle, request%handle, ierr)
27514 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27515 comm%handle, request%handle, ierr)
27517 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27519 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27528 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27530 CALL mp_timestop(handle)
27531 END SUBROUTINE mp_isend_zv
27548 SUBROUTINE mp_isend_zm2(msgin, dest, comm, request, tag)
27549 COMPLEX(kind=real_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
27550 INTEGER,
INTENT(IN) :: dest
27551 CLASS(mp_comm_type),
INTENT(IN) :: comm
27552 TYPE(mp_request_type),
INTENT(out) :: request
27553 INTEGER,
INTENT(in),
OPTIONAL :: tag
27555 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm2'
27557 INTEGER :: handle, ierr
27558 #if defined(__parallel)
27559 INTEGER :: msglen, my_tag
27560 COMPLEX(kind=real_8) :: foo(1)
27563 CALL mp_timeset(routinen, handle)
27565 #if defined(__parallel)
27566 #if !defined(__GNUC__) || __GNUC__ >= 9
27567 cpassert(is_contiguous(msgin))
27571 IF (
PRESENT(tag)) my_tag = tag
27573 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
27574 IF (msglen > 0)
THEN
27575 CALL mpi_isend(msgin(1, 1), msglen, mpi_double_complex, dest, my_tag, &
27576 comm%handle, request%handle, ierr)
27578 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27579 comm%handle, request%handle, ierr)
27581 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27583 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27592 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27594 CALL mp_timestop(handle)
27595 END SUBROUTINE mp_isend_zm2
27614 SUBROUTINE mp_isend_zm3(msgin, dest, comm, request, tag)
27615 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
27616 INTEGER,
INTENT(IN) :: dest
27617 CLASS(mp_comm_type),
INTENT(IN) :: comm
27618 TYPE(mp_request_type),
INTENT(out) :: request
27619 INTEGER,
INTENT(in),
OPTIONAL :: tag
27621 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm3'
27623 INTEGER :: handle, ierr
27624 #if defined(__parallel)
27625 INTEGER :: msglen, my_tag
27626 COMPLEX(kind=real_8) :: foo(1)
27629 CALL mp_timeset(routinen, handle)
27631 #if defined(__parallel)
27632 #if !defined(__GNUC__) || __GNUC__ >= 9
27633 cpassert(is_contiguous(msgin))
27637 IF (
PRESENT(tag)) my_tag = tag
27639 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
27640 IF (msglen > 0)
THEN
27641 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_double_complex, dest, my_tag, &
27642 comm%handle, request%handle, ierr)
27644 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27645 comm%handle, request%handle, ierr)
27647 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27649 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27658 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27660 CALL mp_timestop(handle)
27661 END SUBROUTINE mp_isend_zm3
27677 SUBROUTINE mp_isend_zm4(msgin, dest, comm, request, tag)
27678 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
27679 INTEGER,
INTENT(IN) :: dest
27680 CLASS(mp_comm_type),
INTENT(IN) :: comm
27681 TYPE(mp_request_type),
INTENT(out) :: request
27682 INTEGER,
INTENT(in),
OPTIONAL :: tag
27684 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm4'
27686 INTEGER :: handle, ierr
27687 #if defined(__parallel)
27688 INTEGER :: msglen, my_tag
27689 COMPLEX(kind=real_8) :: foo(1)
27692 CALL mp_timeset(routinen, handle)
27694 #if defined(__parallel)
27695 #if !defined(__GNUC__) || __GNUC__ >= 9
27696 cpassert(is_contiguous(msgin))
27700 IF (
PRESENT(tag)) my_tag = tag
27702 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
27703 IF (msglen > 0)
THEN
27704 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_double_complex, dest, my_tag, &
27705 comm%handle, request%handle, ierr)
27707 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27708 comm%handle, request%handle, ierr)
27710 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27712 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
27721 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
27723 CALL mp_timestop(handle)
27724 END SUBROUTINE mp_isend_zm4
27740 SUBROUTINE mp_irecv_zv(msgout, source, comm, request, tag)
27741 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
27742 INTEGER,
INTENT(IN) :: source
27743 CLASS(mp_comm_type),
INTENT(IN) :: comm
27744 TYPE(mp_request_type),
INTENT(out) :: request
27745 INTEGER,
INTENT(in),
OPTIONAL :: tag
27747 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zv'
27750 #if defined(__parallel)
27751 INTEGER :: ierr, msglen, my_tag
27752 COMPLEX(kind=real_8) :: foo(1)
27755 CALL mp_timeset(routinen, handle)
27757 #if defined(__parallel)
27758 #if !defined(__GNUC__) || __GNUC__ >= 9
27759 cpassert(is_contiguous(msgout))
27763 IF (
PRESENT(tag)) my_tag = tag
27765 msglen =
SIZE(msgout)
27766 IF (msglen > 0)
THEN
27767 CALL mpi_irecv(msgout(1), msglen, mpi_double_complex, source, my_tag, &
27768 comm%handle, request%handle, ierr)
27770 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27771 comm%handle, request%handle, ierr)
27773 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27775 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27777 cpabort(
"mp_irecv called in non parallel case")
27784 CALL mp_timestop(handle)
27785 END SUBROUTINE mp_irecv_zv
27802 SUBROUTINE mp_irecv_zm2(msgout, source, comm, request, tag)
27803 COMPLEX(kind=real_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
27804 INTEGER,
INTENT(IN) :: source
27805 CLASS(mp_comm_type),
INTENT(IN) :: comm
27806 TYPE(mp_request_type),
INTENT(out) :: request
27807 INTEGER,
INTENT(in),
OPTIONAL :: tag
27809 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm2'
27812 #if defined(__parallel)
27813 INTEGER :: ierr, msglen, my_tag
27814 COMPLEX(kind=real_8) :: foo(1)
27817 CALL mp_timeset(routinen, handle)
27819 #if defined(__parallel)
27820 #if !defined(__GNUC__) || __GNUC__ >= 9
27821 cpassert(is_contiguous(msgout))
27825 IF (
PRESENT(tag)) my_tag = tag
27827 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
27828 IF (msglen > 0)
THEN
27829 CALL mpi_irecv(msgout(1, 1), msglen, mpi_double_complex, source, my_tag, &
27830 comm%handle, request%handle, ierr)
27832 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27833 comm%handle, request%handle, ierr)
27835 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27837 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27844 cpabort(
"mp_irecv called in non parallel case")
27846 CALL mp_timestop(handle)
27847 END SUBROUTINE mp_irecv_zm2
27865 SUBROUTINE mp_irecv_zm3(msgout, source, comm, request, tag)
27866 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
27867 INTEGER,
INTENT(IN) :: source
27868 CLASS(mp_comm_type),
INTENT(IN) :: comm
27869 TYPE(mp_request_type),
INTENT(out) :: request
27870 INTEGER,
INTENT(in),
OPTIONAL :: tag
27872 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm3'
27875 #if defined(__parallel)
27876 INTEGER :: ierr, msglen, my_tag
27877 COMPLEX(kind=real_8) :: foo(1)
27880 CALL mp_timeset(routinen, handle)
27882 #if defined(__parallel)
27883 #if !defined(__GNUC__) || __GNUC__ >= 9
27884 cpassert(is_contiguous(msgout))
27888 IF (
PRESENT(tag)) my_tag = tag
27890 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
27891 IF (msglen > 0)
THEN
27892 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_double_complex, source, my_tag, &
27893 comm%handle, request%handle, ierr)
27895 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27896 comm%handle, request%handle, ierr)
27898 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
27900 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27907 cpabort(
"mp_irecv called in non parallel case")
27909 CALL mp_timestop(handle)
27910 END SUBROUTINE mp_irecv_zm3
27926 SUBROUTINE mp_irecv_zm4(msgout, source, comm, request, tag)
27927 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
27928 INTEGER,
INTENT(IN) :: source
27929 CLASS(mp_comm_type),
INTENT(IN) :: comm
27930 TYPE(mp_request_type),
INTENT(out) :: request
27931 INTEGER,
INTENT(in),
OPTIONAL :: tag
27933 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm4'
27936 #if defined(__parallel)
27937 INTEGER :: ierr, msglen, my_tag
27938 COMPLEX(kind=real_8) :: foo(1)
27941 CALL mp_timeset(routinen, handle)
27943 #if defined(__parallel)
27944 #if !defined(__GNUC__) || __GNUC__ >= 9
27945 cpassert(is_contiguous(msgout))
27949 IF (
PRESENT(tag)) my_tag = tag
27951 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
27952 IF (msglen > 0)
THEN
27953 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_double_complex, source, my_tag, &
27954 comm%handle, request%handle, ierr)
27956 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27957 comm%handle, request%handle, ierr)
27959 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
27961 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
27968 cpabort(
"mp_irecv called in non parallel case")
27970 CALL mp_timestop(handle)
27971 END SUBROUTINE mp_irecv_zm4
27983 SUBROUTINE mp_win_create_zv(base, comm, win)
27984 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
27985 TYPE(mp_comm_type),
INTENT(IN) :: comm
27986 CLASS(mp_win_type),
INTENT(INOUT) :: win
27988 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_zv'
27991 #if defined(__parallel)
27993 INTEGER(kind=mpi_address_kind) :: len
27994 COMPLEX(kind=real_8) :: foo(1)
27997 CALL mp_timeset(routinen, handle)
27999 #if defined(__parallel)
28001 len =
SIZE(base)*(2*real_8_size)
28003 CALL mpi_win_create(base(1), len, (2*real_8_size), mpi_info_null, comm%handle, win%handle, ierr)
28005 CALL mpi_win_create(foo, len, (2*real_8_size), mpi_info_null, comm%handle, win%handle, ierr)
28007 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
28009 CALL add_perf(perf_id=20, count=1)
28013 win%handle = mp_win_null_handle
28015 CALL mp_timestop(handle)
28016 END SUBROUTINE mp_win_create_zv
28028 SUBROUTINE mp_rget_zv(base, source, win, win_data, myproc, disp, request, &
28029 origin_datatype, target_datatype)
28030 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
28031 INTEGER,
INTENT(IN) :: source
28032 CLASS(mp_win_type),
INTENT(IN) :: win
28033 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: win_data
28034 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
28035 TYPE(mp_request_type),
INTENT(OUT) :: request
28036 TYPE(mp_type_descriptor_type),
INTENT(IN),
OPTIONAL :: origin_datatype, target_datatype
28038 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_zv'
28041 #if defined(__parallel)
28042 INTEGER :: ierr, len, &
28043 origin_len, target_len
28044 LOGICAL :: do_local_copy
28045 INTEGER(kind=mpi_address_kind) :: disp_aint
28046 mpi_data_type :: handle_origin_datatype, handle_target_datatype
28049 CALL mp_timeset(routinen, handle)
28051 #if defined(__parallel)
28054 IF (
PRESENT(disp))
THEN
28055 disp_aint = int(disp, kind=mpi_address_kind)
28057 handle_origin_datatype = mpi_double_complex
28059 IF (
PRESENT(origin_datatype))
THEN
28060 handle_origin_datatype = origin_datatype%type_handle
28063 handle_target_datatype = mpi_double_complex
28065 IF (
PRESENT(target_datatype))
THEN
28066 handle_target_datatype = target_datatype%type_handle
28070 do_local_copy = .false.
28071 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
28072 IF (myproc .EQ. source) do_local_copy = .true.
28074 IF (do_local_copy)
THEN
28076 base(:) = win_data(disp_aint + 1:disp_aint + len)
28081 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
28082 target_len, handle_target_datatype, win%handle, request%handle, ierr)
28088 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
28090 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*(2*real_8_size))
28095 mark_used(origin_datatype)
28096 mark_used(target_datatype)
28100 IF (
PRESENT(disp))
THEN
28101 base(:) = win_data(disp + 1:disp +
SIZE(base))
28103 base(:) = win_data(:
SIZE(base))
28107 CALL mp_timestop(handle)
28108 END SUBROUTINE mp_rget_zv
28118 result(type_descriptor)
28119 INTEGER,
INTENT(IN) :: count
28120 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
28121 TYPE(mp_type_descriptor_type) :: type_descriptor
28123 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_z'
28126 #if defined(__parallel)
28130 CALL mp_timeset(routinen, handle)
28132 #if defined(__parallel)
28133 CALL mpi_type_indexed(count, lengths, displs, mpi_double_complex, &
28134 type_descriptor%type_handle, ierr)
28136 cpabort(
"MPI_Type_Indexed @ "//routinen)
28137 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
28139 cpabort(
"MPI_Type_commit @ "//routinen)
28141 type_descriptor%type_handle = 7
28143 type_descriptor%length = count
28144 NULLIFY (type_descriptor%subtype)
28145 type_descriptor%vector_descriptor(1:2) = 1
28146 type_descriptor%has_indexing = .true.
28147 type_descriptor%index_descriptor%index => lengths
28148 type_descriptor%index_descriptor%chunks => displs
28150 CALL mp_timestop(handle)
28161 SUBROUTINE mp_allocate_z (DATA, len, stat)
28162 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
28163 INTEGER,
INTENT(IN) :: len
28164 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28166 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allocate_z'
28168 INTEGER :: handle, ierr
28170 CALL mp_timeset(routinen, handle)
28172 #if defined(__parallel)
28174 CALL mp_alloc_mem(
DATA, len, stat=ierr)
28175 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
28176 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
28177 CALL add_perf(perf_id=15, count=1)
28179 ALLOCATE (
DATA(len), stat=ierr)
28180 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
28181 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
28183 IF (
PRESENT(stat)) stat = ierr
28184 CALL mp_timestop(handle)
28185 END SUBROUTINE mp_allocate_z
28193 SUBROUTINE mp_deallocate_z (DATA, stat)
28194 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
28195 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28197 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_deallocate_z'
28200 #if defined(__parallel)
28204 CALL mp_timeset(routinen, handle)
28206 #if defined(__parallel)
28207 CALL mp_free_mem(
DATA, ierr)
28208 IF (
PRESENT(stat))
THEN
28211 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
28214 CALL add_perf(perf_id=15, count=1)
28217 IF (
PRESENT(stat)) stat = 0
28219 CALL mp_timestop(handle)
28220 END SUBROUTINE mp_deallocate_z
28233 SUBROUTINE mp_file_write_at_zv(fh, offset, msg, msglen)
28234 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
28235 CLASS(mp_file_type),
INTENT(IN) :: fh
28236 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28237 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28240 #if defined(__parallel)
28244 msg_len =
SIZE(msg)
28245 IF (
PRESENT(msglen)) msg_len = msglen
28246 #if defined(__parallel)
28247 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28249 cpabort(
"mpi_file_write_at_zv @ mp_file_write_at_zv")
28251 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28253 END SUBROUTINE mp_file_write_at_zv
28261 SUBROUTINE mp_file_write_at_z (fh, offset, msg)
28262 COMPLEX(kind=real_8),
INTENT(IN) :: msg
28263 CLASS(mp_file_type),
INTENT(IN) :: fh
28264 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28266 #if defined(__parallel)
28270 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28272 cpabort(
"mpi_file_write_at_z @ mp_file_write_at_z")
28274 WRITE (unit=fh%handle, pos=offset + 1) msg
28276 END SUBROUTINE mp_file_write_at_z
28288 SUBROUTINE mp_file_write_at_all_zv(fh, offset, msg, msglen)
28289 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
28290 CLASS(mp_file_type),
INTENT(IN) :: fh
28291 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28292 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28295 #if defined(__parallel)
28299 msg_len =
SIZE(msg)
28300 IF (
PRESENT(msglen)) msg_len = msglen
28301 #if defined(__parallel)
28302 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28304 cpabort(
"mpi_file_write_at_all_zv @ mp_file_write_at_all_zv")
28306 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28308 END SUBROUTINE mp_file_write_at_all_zv
28316 SUBROUTINE mp_file_write_at_all_z (fh, offset, msg)
28317 COMPLEX(kind=real_8),
INTENT(IN) :: msg
28318 CLASS(mp_file_type),
INTENT(IN) :: fh
28319 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28321 #if defined(__parallel)
28325 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28327 cpabort(
"mpi_file_write_at_all_z @ mp_file_write_at_all_z")
28329 WRITE (unit=fh%handle, pos=offset + 1) msg
28331 END SUBROUTINE mp_file_write_at_all_z
28344 SUBROUTINE mp_file_read_at_zv(fh, offset, msg, msglen)
28345 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
28346 CLASS(mp_file_type),
INTENT(IN) :: fh
28347 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28348 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28351 #if defined(__parallel)
28355 msg_len =
SIZE(msg)
28356 IF (
PRESENT(msglen)) msg_len = msglen
28357 #if defined(__parallel)
28358 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28360 cpabort(
"mpi_file_read_at_zv @ mp_file_read_at_zv")
28362 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28364 END SUBROUTINE mp_file_read_at_zv
28372 SUBROUTINE mp_file_read_at_z (fh, offset, msg)
28373 COMPLEX(kind=real_8),
INTENT(OUT) :: msg
28374 CLASS(mp_file_type),
INTENT(IN) :: fh
28375 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28377 #if defined(__parallel)
28381 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28383 cpabort(
"mpi_file_read_at_z @ mp_file_read_at_z")
28385 READ (unit=fh%handle, pos=offset + 1) msg
28387 END SUBROUTINE mp_file_read_at_z
28399 SUBROUTINE mp_file_read_at_all_zv(fh, offset, msg, msglen)
28400 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
28401 CLASS(mp_file_type),
INTENT(IN) :: fh
28402 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28403 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28406 #if defined(__parallel)
28410 msg_len =
SIZE(msg)
28411 IF (
PRESENT(msglen)) msg_len = msglen
28412 #if defined(__parallel)
28413 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28415 cpabort(
"mpi_file_read_at_all_zv @ mp_file_read_at_all_zv")
28417 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28419 END SUBROUTINE mp_file_read_at_all_zv
28427 SUBROUTINE mp_file_read_at_all_z (fh, offset, msg)
28428 COMPLEX(kind=real_8),
INTENT(OUT) :: msg
28429 CLASS(mp_file_type),
INTENT(IN) :: fh
28430 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28432 #if defined(__parallel)
28436 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28438 cpabort(
"mpi_file_read_at_all_z @ mp_file_read_at_all_z")
28440 READ (unit=fh%handle, pos=offset + 1) msg
28442 END SUBROUTINE mp_file_read_at_all_z
28451 FUNCTION mp_type_make_z (ptr, &
28452 vector_descriptor, index_descriptor) &
28453 result(type_descriptor)
28454 COMPLEX(kind=real_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
28455 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
28456 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
28457 TYPE(mp_type_descriptor_type) :: type_descriptor
28459 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_z'
28461 #if defined(__parallel)
28465 NULLIFY (type_descriptor%subtype)
28466 type_descriptor%length =
SIZE(ptr)
28467 #if defined(__parallel)
28468 type_descriptor%type_handle = mpi_double_complex
28469 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
28471 cpabort(
"MPI_Get_address @ "//routinen)
28473 type_descriptor%type_handle = 7
28475 type_descriptor%vector_descriptor(1:2) = 1
28476 type_descriptor%has_indexing = .false.
28477 type_descriptor%data_z => ptr
28478 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
28479 cpabort(routinen//
": Vectors and indices NYI")
28481 END FUNCTION mp_type_make_z
28490 SUBROUTINE mp_alloc_mem_z (DATA, len, stat)
28491 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
28492 INTEGER,
INTENT(IN) :: len
28493 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28495 #if defined(__parallel)
28496 INTEGER :: size, ierr, length, &
28498 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
28499 TYPE(c_ptr) :: mp_baseptr
28500 mpi_info_type :: mp_info
28502 length = max(len, 1)
28503 CALL mpi_type_size(mpi_double_complex,
size, ierr)
28504 mp_size = int(length, kind=mpi_address_kind)*
size
28505 IF (mp_size .GT. mp_max_memory_size)
THEN
28506 cpabort(
"MPI cannot allocate more than 2 GiByte")
28508 mp_info = mpi_info_null
28509 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
28510 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
28511 IF (
PRESENT(stat)) stat = mp_res
28513 INTEGER :: length, mystat
28514 length = max(len, 1)
28515 IF (
PRESENT(stat))
THEN
28516 ALLOCATE (
DATA(length), stat=mystat)
28519 ALLOCATE (
DATA(length))
28522 END SUBROUTINE mp_alloc_mem_z
28530 SUBROUTINE mp_free_mem_z (DATA, stat)
28531 COMPLEX(kind=real_8),
DIMENSION(:), &
28532 POINTER, asynchronous :: data
28533 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28535 #if defined(__parallel)
28537 CALL mpi_free_mem(
DATA, mp_res)
28538 IF (
PRESENT(stat)) stat = mp_res
28541 IF (
PRESENT(stat)) stat = 0
28543 END SUBROUTINE mp_free_mem_z
28555 SUBROUTINE mp_shift_cm(msg, comm, displ_in)
28557 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
28558 CLASS(mp_comm_type),
INTENT(IN) :: comm
28559 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
28561 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_cm'
28563 INTEGER :: handle, ierror
28564 #if defined(__parallel)
28565 INTEGER :: displ, left, &
28566 msglen, myrank, nprocs, &
28571 CALL mp_timeset(routinen, handle)
28573 #if defined(__parallel)
28574 CALL mpi_comm_rank(comm%handle, myrank, ierror)
28575 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
28576 CALL mpi_comm_size(comm%handle, nprocs, ierror)
28577 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
28578 IF (
PRESENT(displ_in))
THEN
28583 right =
modulo(myrank + displ, nprocs)
28584 left =
modulo(myrank - displ, nprocs)
28587 CALL mpi_sendrecv_replace(msg, msglen, mpi_complex, right, tag, left, tag, &
28588 comm%handle, mpi_status_ignore, ierror)
28589 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
28590 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_4_size))
28594 mark_used(displ_in)
28596 CALL mp_timestop(handle)
28598 END SUBROUTINE mp_shift_cm
28611 SUBROUTINE mp_shift_c (msg, comm, displ_in)
28613 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
28614 CLASS(mp_comm_type),
INTENT(IN) :: comm
28615 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
28617 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_c'
28619 INTEGER :: handle, ierror
28620 #if defined(__parallel)
28621 INTEGER :: displ, left, &
28622 msglen, myrank, nprocs, &
28627 CALL mp_timeset(routinen, handle)
28629 #if defined(__parallel)
28630 CALL mpi_comm_rank(comm%handle, myrank, ierror)
28631 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
28632 CALL mpi_comm_size(comm%handle, nprocs, ierror)
28633 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
28634 IF (
PRESENT(displ_in))
THEN
28639 right =
modulo(myrank + displ, nprocs)
28640 left =
modulo(myrank - displ, nprocs)
28643 CALL mpi_sendrecv_replace(msg, msglen, mpi_complex, right, tag, left, &
28644 tag, comm%handle, mpi_status_ignore, ierror)
28645 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
28646 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_4_size))
28650 mark_used(displ_in)
28652 CALL mp_timestop(handle)
28654 END SUBROUTINE mp_shift_c
28675 SUBROUTINE mp_alltoall_c11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
28677 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
28678 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
28679 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
28680 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
28681 CLASS(mp_comm_type),
INTENT(IN) :: comm
28683 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c11v'
28686 #if defined(__parallel)
28687 INTEGER :: ierr, msglen
28692 CALL mp_timeset(routinen, handle)
28694 #if defined(__parallel)
28695 CALL mpi_alltoallv(sb, scount, sdispl, mpi_complex, &
28696 rb, rcount, rdispl, mpi_complex, comm%handle, ierr)
28697 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
28698 msglen = sum(scount) + sum(rcount)
28699 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28705 DO i = 1, rcount(1)
28706 rb(rdispl(1) + i) = sb(sdispl(1) + i)
28709 CALL mp_timestop(handle)
28711 END SUBROUTINE mp_alltoall_c11v
28726 SUBROUTINE mp_alltoall_c22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
28728 COMPLEX(kind=real_4),
DIMENSION(:, :), &
28729 INTENT(IN),
CONTIGUOUS :: sb
28730 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
28731 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS, &
28732 INTENT(INOUT) :: rb
28733 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
28734 CLASS(mp_comm_type),
INTENT(IN) :: comm
28736 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c22v'
28739 #if defined(__parallel)
28740 INTEGER :: ierr, msglen
28743 CALL mp_timeset(routinen, handle)
28745 #if defined(__parallel)
28746 CALL mpi_alltoallv(sb, scount, sdispl, mpi_complex, &
28747 rb, rcount, rdispl, mpi_complex, comm%handle, ierr)
28748 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
28749 msglen = sum(scount) + sum(rcount)
28750 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*(2*real_4_size))
28759 CALL mp_timestop(handle)
28761 END SUBROUTINE mp_alltoall_c22v
28778 SUBROUTINE mp_alltoall_c (sb, rb, count, comm)
28780 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
28781 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
28782 INTEGER,
INTENT(IN) :: count
28783 CLASS(mp_comm_type),
INTENT(IN) :: comm
28785 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c'
28788 #if defined(__parallel)
28789 INTEGER :: ierr, msglen, np
28792 CALL mp_timeset(routinen, handle)
28794 #if defined(__parallel)
28795 CALL mpi_alltoall(sb, count, mpi_complex, &
28796 rb, count, mpi_complex, comm%handle, ierr)
28797 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28798 CALL mpi_comm_size(comm%handle, np, ierr)
28799 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28800 msglen = 2*count*np
28801 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28807 CALL mp_timestop(handle)
28809 END SUBROUTINE mp_alltoall_c
28819 SUBROUTINE mp_alltoall_c22(sb, rb, count, comm)
28821 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
28822 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
28823 INTEGER,
INTENT(IN) :: count
28824 CLASS(mp_comm_type),
INTENT(IN) :: comm
28826 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c22'
28829 #if defined(__parallel)
28830 INTEGER :: ierr, msglen, np
28833 CALL mp_timeset(routinen, handle)
28835 #if defined(__parallel)
28836 CALL mpi_alltoall(sb, count, mpi_complex, &
28837 rb, count, mpi_complex, comm%handle, ierr)
28838 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28839 CALL mpi_comm_size(comm%handle, np, ierr)
28840 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28841 msglen = 2*
SIZE(sb)*np
28842 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28848 CALL mp_timestop(handle)
28850 END SUBROUTINE mp_alltoall_c22
28860 SUBROUTINE mp_alltoall_c33(sb, rb, count, comm)
28862 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
28863 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
28864 INTEGER,
INTENT(IN) :: count
28865 CLASS(mp_comm_type),
INTENT(IN) :: comm
28867 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c33'
28870 #if defined(__parallel)
28871 INTEGER :: ierr, msglen, np
28874 CALL mp_timeset(routinen, handle)
28876 #if defined(__parallel)
28877 CALL mpi_alltoall(sb, count, mpi_complex, &
28878 rb, count, mpi_complex, comm%handle, ierr)
28879 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28880 CALL mpi_comm_size(comm%handle, np, ierr)
28881 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28882 msglen = 2*count*np
28883 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28889 CALL mp_timestop(handle)
28891 END SUBROUTINE mp_alltoall_c33
28901 SUBROUTINE mp_alltoall_c44(sb, rb, count, comm)
28903 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28905 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28907 INTEGER,
INTENT(IN) :: count
28908 CLASS(mp_comm_type),
INTENT(IN) :: comm
28910 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c44'
28913 #if defined(__parallel)
28914 INTEGER :: ierr, msglen, np
28917 CALL mp_timeset(routinen, handle)
28919 #if defined(__parallel)
28920 CALL mpi_alltoall(sb, count, mpi_complex, &
28921 rb, count, mpi_complex, comm%handle, ierr)
28922 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28923 CALL mpi_comm_size(comm%handle, np, ierr)
28924 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28925 msglen = 2*count*np
28926 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28932 CALL mp_timestop(handle)
28934 END SUBROUTINE mp_alltoall_c44
28944 SUBROUTINE mp_alltoall_c55(sb, rb, count, comm)
28946 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
28948 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
28950 INTEGER,
INTENT(IN) :: count
28951 CLASS(mp_comm_type),
INTENT(IN) :: comm
28953 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c55'
28956 #if defined(__parallel)
28957 INTEGER :: ierr, msglen, np
28960 CALL mp_timeset(routinen, handle)
28962 #if defined(__parallel)
28963 CALL mpi_alltoall(sb, count, mpi_complex, &
28964 rb, count, mpi_complex, comm%handle, ierr)
28965 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
28966 CALL mpi_comm_size(comm%handle, np, ierr)
28967 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
28968 msglen = 2*count*np
28969 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
28975 CALL mp_timestop(handle)
28977 END SUBROUTINE mp_alltoall_c55
28988 SUBROUTINE mp_alltoall_c45(sb, rb, count, comm)
28990 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
28992 COMPLEX(kind=real_4), &
28993 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
28994 INTEGER,
INTENT(IN) :: count
28995 CLASS(mp_comm_type),
INTENT(IN) :: comm
28997 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c45'
29000 #if defined(__parallel)
29001 INTEGER :: ierr, msglen, np
29004 CALL mp_timeset(routinen, handle)
29006 #if defined(__parallel)
29007 CALL mpi_alltoall(sb, count, mpi_complex, &
29008 rb, count, mpi_complex, comm%handle, ierr)
29009 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29010 CALL mpi_comm_size(comm%handle, np, ierr)
29011 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29012 msglen = 2*count*np
29013 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29017 rb = reshape(sb, shape(rb))
29019 CALL mp_timestop(handle)
29021 END SUBROUTINE mp_alltoall_c45
29032 SUBROUTINE mp_alltoall_c34(sb, rb, count, comm)
29034 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
29036 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
29038 INTEGER,
INTENT(IN) :: count
29039 CLASS(mp_comm_type),
INTENT(IN) :: comm
29041 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c34'
29044 #if defined(__parallel)
29045 INTEGER :: ierr, msglen, np
29048 CALL mp_timeset(routinen, handle)
29050 #if defined(__parallel)
29051 CALL mpi_alltoall(sb, count, mpi_complex, &
29052 rb, count, mpi_complex, comm%handle, ierr)
29053 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29054 CALL mpi_comm_size(comm%handle, np, ierr)
29055 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29056 msglen = 2*count*np
29057 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29061 rb = reshape(sb, shape(rb))
29063 CALL mp_timestop(handle)
29065 END SUBROUTINE mp_alltoall_c34
29076 SUBROUTINE mp_alltoall_c54(sb, rb, count, comm)
29078 COMPLEX(kind=real_4), &
29079 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
29080 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
29082 INTEGER,
INTENT(IN) :: count
29083 CLASS(mp_comm_type),
INTENT(IN) :: comm
29085 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c54'
29088 #if defined(__parallel)
29089 INTEGER :: ierr, msglen, np
29092 CALL mp_timeset(routinen, handle)
29094 #if defined(__parallel)
29095 CALL mpi_alltoall(sb, count, mpi_complex, &
29096 rb, count, mpi_complex, comm%handle, ierr)
29097 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29098 CALL mpi_comm_size(comm%handle, np, ierr)
29099 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29100 msglen = 2*count*np
29101 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29105 rb = reshape(sb, shape(rb))
29107 CALL mp_timestop(handle)
29109 END SUBROUTINE mp_alltoall_c54
29120 SUBROUTINE mp_send_c (msg, dest, tag, comm)
29121 COMPLEX(kind=real_4),
INTENT(IN) :: msg
29122 INTEGER,
INTENT(IN) :: dest, tag
29123 CLASS(mp_comm_type),
INTENT(IN) :: comm
29125 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_c'
29128 #if defined(__parallel)
29129 INTEGER :: ierr, msglen
29132 CALL mp_timeset(routinen, handle)
29134 #if defined(__parallel)
29136 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29137 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29138 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29145 cpabort(
"not in parallel mode")
29147 CALL mp_timestop(handle)
29148 END SUBROUTINE mp_send_c
29158 SUBROUTINE mp_send_cv(msg, dest, tag, comm)
29159 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
29160 INTEGER,
INTENT(IN) :: dest, tag
29161 CLASS(mp_comm_type),
INTENT(IN) :: comm
29163 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_cv'
29166 #if defined(__parallel)
29167 INTEGER :: ierr, msglen
29170 CALL mp_timeset(routinen, handle)
29172 #if defined(__parallel)
29174 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29175 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29176 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29183 cpabort(
"not in parallel mode")
29185 CALL mp_timestop(handle)
29186 END SUBROUTINE mp_send_cv
29196 SUBROUTINE mp_send_cm2(msg, dest, tag, comm)
29197 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
29198 INTEGER,
INTENT(IN) :: dest, tag
29199 CLASS(mp_comm_type),
INTENT(IN) :: comm
29201 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_cm2'
29204 #if defined(__parallel)
29205 INTEGER :: ierr, msglen
29208 CALL mp_timeset(routinen, handle)
29210 #if defined(__parallel)
29212 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29213 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29214 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29221 cpabort(
"not in parallel mode")
29223 CALL mp_timestop(handle)
29224 END SUBROUTINE mp_send_cm2
29234 SUBROUTINE mp_send_cm3(msg, dest, tag, comm)
29235 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
29236 INTEGER,
INTENT(IN) :: dest, tag
29237 CLASS(mp_comm_type),
INTENT(IN) :: comm
29239 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
29242 #if defined(__parallel)
29243 INTEGER :: ierr, msglen
29246 CALL mp_timeset(routinen, handle)
29248 #if defined(__parallel)
29250 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29251 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29252 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29259 cpabort(
"not in parallel mode")
29261 CALL mp_timestop(handle)
29262 END SUBROUTINE mp_send_cm3
29273 SUBROUTINE mp_recv_c (msg, source, tag, comm)
29274 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29275 INTEGER,
INTENT(INOUT) :: source, tag
29276 CLASS(mp_comm_type),
INTENT(IN) :: comm
29278 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_c'
29281 #if defined(__parallel)
29282 INTEGER :: ierr, msglen
29283 mpi_status_type :: status
29286 CALL mp_timeset(routinen, handle)
29288 #if defined(__parallel)
29291 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29292 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29294 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29295 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29296 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29297 source = status mpi_status_extract(mpi_source)
29298 tag = status mpi_status_extract(mpi_tag)
29306 cpabort(
"not in parallel mode")
29308 CALL mp_timestop(handle)
29309 END SUBROUTINE mp_recv_c
29319 SUBROUTINE mp_recv_cv(msg, source, tag, comm)
29320 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29321 INTEGER,
INTENT(INOUT) :: source, tag
29322 CLASS(mp_comm_type),
INTENT(IN) :: comm
29324 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cv'
29327 #if defined(__parallel)
29328 INTEGER :: ierr, msglen
29329 mpi_status_type :: status
29332 CALL mp_timeset(routinen, handle)
29334 #if defined(__parallel)
29337 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29338 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29340 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29341 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29342 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29343 source = status mpi_status_extract(mpi_source)
29344 tag = status mpi_status_extract(mpi_tag)
29352 cpabort(
"not in parallel mode")
29354 CALL mp_timestop(handle)
29355 END SUBROUTINE mp_recv_cv
29365 SUBROUTINE mp_recv_cm2(msg, source, tag, comm)
29366 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29367 INTEGER,
INTENT(INOUT) :: source, tag
29368 CLASS(mp_comm_type),
INTENT(IN) :: comm
29370 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cm2'
29373 #if defined(__parallel)
29374 INTEGER :: ierr, msglen
29375 mpi_status_type :: status
29378 CALL mp_timeset(routinen, handle)
29380 #if defined(__parallel)
29383 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29384 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29386 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29387 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29388 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29389 source = status mpi_status_extract(mpi_source)
29390 tag = status mpi_status_extract(mpi_tag)
29398 cpabort(
"not in parallel mode")
29400 CALL mp_timestop(handle)
29401 END SUBROUTINE mp_recv_cm2
29411 SUBROUTINE mp_recv_cm3(msg, source, tag, comm)
29412 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
29413 INTEGER,
INTENT(INOUT) :: source, tag
29414 CLASS(mp_comm_type),
INTENT(IN) :: comm
29416 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cm3'
29419 #if defined(__parallel)
29420 INTEGER :: ierr, msglen
29421 mpi_status_type :: status
29424 CALL mp_timeset(routinen, handle)
29426 #if defined(__parallel)
29429 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29430 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29432 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29433 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29434 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29435 source = status mpi_status_extract(mpi_source)
29436 tag = status mpi_status_extract(mpi_tag)
29444 cpabort(
"not in parallel mode")
29446 CALL mp_timestop(handle)
29447 END SUBROUTINE mp_recv_cm3
29457 SUBROUTINE mp_bcast_c (msg, source, comm)
29458 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29459 INTEGER,
INTENT(IN) :: source
29460 CLASS(mp_comm_type),
INTENT(IN) :: comm
29462 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c'
29465 #if defined(__parallel)
29466 INTEGER :: ierr, msglen
29469 CALL mp_timeset(routinen, handle)
29471 #if defined(__parallel)
29473 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29474 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29475 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29481 CALL mp_timestop(handle)
29482 END SUBROUTINE mp_bcast_c
29491 SUBROUTINE mp_bcast_c_src(msg, comm)
29492 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29493 CLASS(mp_comm_type),
INTENT(IN) :: comm
29495 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c_src'
29498 #if defined(__parallel)
29499 INTEGER :: ierr, msglen
29502 CALL mp_timeset(routinen, handle)
29504 #if defined(__parallel)
29506 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29507 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29508 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29513 CALL mp_timestop(handle)
29514 END SUBROUTINE mp_bcast_c_src
29524 SUBROUTINE mp_ibcast_c (msg, source, comm, request)
29525 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29526 INTEGER,
INTENT(IN) :: source
29527 CLASS(mp_comm_type),
INTENT(IN) :: comm
29528 TYPE(mp_request_type),
INTENT(OUT) :: request
29530 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_c'
29533 #if defined(__parallel)
29534 INTEGER :: ierr, msglen
29537 CALL mp_timeset(routinen, handle)
29539 #if defined(__parallel)
29541 CALL mpi_ibcast(msg, msglen, mpi_complex, source, comm%handle, request%handle, ierr)
29542 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
29543 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_4_size))
29550 CALL mp_timestop(handle)
29551 END SUBROUTINE mp_ibcast_c
29560 SUBROUTINE mp_bcast_cv(msg, source, comm)
29561 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29562 INTEGER,
INTENT(IN) :: source
29563 CLASS(mp_comm_type),
INTENT(IN) :: comm
29565 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cv'
29568 #if defined(__parallel)
29569 INTEGER :: ierr, msglen
29572 CALL mp_timeset(routinen, handle)
29574 #if defined(__parallel)
29576 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29577 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29578 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29584 CALL mp_timestop(handle)
29585 END SUBROUTINE mp_bcast_cv
29593 SUBROUTINE mp_bcast_cv_src(msg, comm)
29594 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29595 CLASS(mp_comm_type),
INTENT(IN) :: comm
29597 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cv_src'
29600 #if defined(__parallel)
29601 INTEGER :: ierr, msglen
29604 CALL mp_timeset(routinen, handle)
29606 #if defined(__parallel)
29608 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29609 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29610 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29615 CALL mp_timestop(handle)
29616 END SUBROUTINE mp_bcast_cv_src
29625 SUBROUTINE mp_ibcast_cv(msg, source, comm, request)
29626 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
29627 INTEGER,
INTENT(IN) :: source
29628 CLASS(mp_comm_type),
INTENT(IN) :: comm
29629 TYPE(mp_request_type) :: request
29631 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_cv'
29634 #if defined(__parallel)
29635 INTEGER :: ierr, msglen
29638 CALL mp_timeset(routinen, handle)
29640 #if defined(__parallel)
29641 #if !defined(__GNUC__) || __GNUC__ >= 9
29642 cpassert(is_contiguous(msg))
29645 CALL mpi_ibcast(msg, msglen, mpi_complex, source, comm%handle, request%handle, ierr)
29646 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
29647 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_4_size))
29654 CALL mp_timestop(handle)
29655 END SUBROUTINE mp_ibcast_cv
29664 SUBROUTINE mp_bcast_cm(msg, source, comm)
29665 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29666 INTEGER,
INTENT(IN) :: source
29667 CLASS(mp_comm_type),
INTENT(IN) :: comm
29669 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cm'
29672 #if defined(__parallel)
29673 INTEGER :: ierr, msglen
29676 CALL mp_timeset(routinen, handle)
29678 #if defined(__parallel)
29680 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29681 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29682 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29688 CALL mp_timestop(handle)
29689 END SUBROUTINE mp_bcast_cm
29698 SUBROUTINE mp_bcast_cm_src(msg, comm)
29699 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29700 CLASS(mp_comm_type),
INTENT(IN) :: comm
29702 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cm_src'
29705 #if defined(__parallel)
29706 INTEGER :: ierr, msglen
29709 CALL mp_timeset(routinen, handle)
29711 #if defined(__parallel)
29713 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29714 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29715 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29720 CALL mp_timestop(handle)
29721 END SUBROUTINE mp_bcast_cm_src
29730 SUBROUTINE mp_bcast_c3(msg, source, comm)
29731 COMPLEX(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
29732 INTEGER,
INTENT(IN) :: source
29733 CLASS(mp_comm_type),
INTENT(IN) :: comm
29735 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c3'
29738 #if defined(__parallel)
29739 INTEGER :: ierr, msglen
29742 CALL mp_timeset(routinen, handle)
29744 #if defined(__parallel)
29746 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29747 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29748 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29754 CALL mp_timestop(handle)
29755 END SUBROUTINE mp_bcast_c3
29764 SUBROUTINE mp_bcast_c3_src(msg, comm)
29765 COMPLEX(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
29766 CLASS(mp_comm_type),
INTENT(IN) :: comm
29768 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c3_src'
29771 #if defined(__parallel)
29772 INTEGER :: ierr, msglen
29775 CALL mp_timeset(routinen, handle)
29777 #if defined(__parallel)
29779 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
29780 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29781 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29786 CALL mp_timestop(handle)
29787 END SUBROUTINE mp_bcast_c3_src
29796 SUBROUTINE mp_sum_c (msg, comm)
29797 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29798 CLASS(mp_comm_type),
INTENT(IN) :: comm
29800 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_c'
29803 #if defined(__parallel)
29804 INTEGER :: ierr, msglen
29807 CALL mp_timeset(routinen, handle)
29809 #if defined(__parallel)
29811 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29812 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29813 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29818 CALL mp_timestop(handle)
29819 END SUBROUTINE mp_sum_c
29827 SUBROUTINE mp_sum_cv(msg, comm)
29828 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29829 CLASS(mp_comm_type),
INTENT(IN) :: comm
29831 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cv'
29834 #if defined(__parallel)
29835 INTEGER :: ierr, msglen
29838 CALL mp_timeset(routinen, handle)
29840 #if defined(__parallel)
29842 IF (msglen > 0)
THEN
29843 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29844 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29846 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29851 CALL mp_timestop(handle)
29852 END SUBROUTINE mp_sum_cv
29860 SUBROUTINE mp_isum_cv(msg, comm, request)
29861 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
29862 CLASS(mp_comm_type),
INTENT(IN) :: comm
29863 TYPE(mp_request_type),
INTENT(OUT) :: request
29865 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_cv'
29868 #if defined(__parallel)
29869 INTEGER :: ierr, msglen
29872 CALL mp_timeset(routinen, handle)
29874 #if defined(__parallel)
29875 #if !defined(__GNUC__) || __GNUC__ >= 9
29876 cpassert(is_contiguous(msg))
29879 IF (msglen > 0)
THEN
29880 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, request%handle, ierr)
29881 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
29885 CALL add_perf(perf_id=23, count=1, msg_size=msglen*(2*real_4_size))
29891 CALL mp_timestop(handle)
29892 END SUBROUTINE mp_isum_cv
29900 SUBROUTINE mp_sum_cm(msg, comm)
29901 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29902 CLASS(mp_comm_type),
INTENT(IN) :: comm
29904 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm'
29907 #if defined(__parallel)
29908 INTEGER,
PARAMETER :: max_msg = 2**25
29909 INTEGER :: ierr, m1, msglen, step, msglensum
29912 CALL mp_timeset(routinen, handle)
29914 #if defined(__parallel)
29916 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
29918 DO m1 = lbound(msg, 2), ubound(msg, 2), step
29919 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
29920 msglensum = msglensum + msglen
29921 IF (msglen > 0)
THEN
29922 CALL mpi_allreduce(mpi_in_place, msg(lbound(msg, 1), m1), msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29923 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29926 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_4_size))
29931 CALL mp_timestop(handle)
29932 END SUBROUTINE mp_sum_cm
29940 SUBROUTINE mp_sum_cm3(msg, comm)
29941 COMPLEX(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
29942 CLASS(mp_comm_type),
INTENT(IN) :: comm
29944 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm3'
29947 #if defined(__parallel)
29948 INTEGER :: ierr, msglen
29951 CALL mp_timeset(routinen, handle)
29953 #if defined(__parallel)
29955 IF (msglen > 0)
THEN
29956 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29957 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29959 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29964 CALL mp_timestop(handle)
29965 END SUBROUTINE mp_sum_cm3
29973 SUBROUTINE mp_sum_cm4(msg, comm)
29974 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
29975 CLASS(mp_comm_type),
INTENT(IN) :: comm
29977 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm4'
29980 #if defined(__parallel)
29981 INTEGER :: ierr, msglen
29984 CALL mp_timeset(routinen, handle)
29986 #if defined(__parallel)
29988 IF (msglen > 0)
THEN
29989 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
29990 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
29992 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
29997 CALL mp_timestop(handle)
29998 END SUBROUTINE mp_sum_cm4
30010 SUBROUTINE mp_sum_root_cv(msg, root, comm)
30011 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
30012 INTEGER,
INTENT(IN) :: root
30013 CLASS(mp_comm_type),
INTENT(IN) :: comm
30015 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_cv'
30018 #if defined(__parallel)
30019 INTEGER :: ierr, m1, msglen, taskid
30020 COMPLEX(kind=real_4),
ALLOCATABLE :: res(:)
30023 CALL mp_timeset(routinen, handle)
30025 #if defined(__parallel)
30027 CALL mpi_comm_rank(comm%handle, taskid, ierr)
30028 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
30029 IF (msglen > 0)
THEN
30032 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_sum, &
30033 root, comm%handle, ierr)
30034 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
30035 IF (taskid == root)
THEN
30040 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30046 CALL mp_timestop(handle)
30047 END SUBROUTINE mp_sum_root_cv
30058 SUBROUTINE mp_sum_root_cm(msg, root, comm)
30059 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30060 INTEGER,
INTENT(IN) :: root
30061 CLASS(mp_comm_type),
INTENT(IN) :: comm
30063 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
30066 #if defined(__parallel)
30067 INTEGER :: ierr, m1, m2, msglen, taskid
30068 COMPLEX(kind=real_4),
ALLOCATABLE :: res(:, :)
30071 CALL mp_timeset(routinen, handle)
30073 #if defined(__parallel)
30075 CALL mpi_comm_rank(comm%handle, taskid, ierr)
30076 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
30077 IF (msglen > 0)
THEN
30080 ALLOCATE (res(m1, m2))
30081 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_sum, root, comm%handle, ierr)
30082 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
30083 IF (taskid == root)
THEN
30088 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30094 CALL mp_timestop(handle)
30095 END SUBROUTINE mp_sum_root_cm
30103 SUBROUTINE mp_sum_partial_cm(msg, res, comm)
30104 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
30105 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
30106 CLASS(mp_comm_type),
INTENT(IN) :: comm
30108 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_cm'
30111 #if defined(__parallel)
30112 INTEGER :: ierr, msglen, taskid
30115 CALL mp_timeset(routinen, handle)
30117 #if defined(__parallel)
30119 CALL mpi_comm_rank(comm%handle, taskid, ierr)
30120 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
30121 IF (msglen > 0)
THEN
30122 CALL mpi_scan(msg, res, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
30123 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
30125 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30131 CALL mp_timestop(handle)
30132 END SUBROUTINE mp_sum_partial_cm
30142 SUBROUTINE mp_max_c (msg, comm)
30143 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30144 CLASS(mp_comm_type),
INTENT(IN) :: comm
30146 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_c'
30149 #if defined(__parallel)
30150 INTEGER :: ierr, msglen
30153 CALL mp_timeset(routinen, handle)
30155 #if defined(__parallel)
30157 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_max, comm%handle, ierr)
30158 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30159 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30164 CALL mp_timestop(handle)
30165 END SUBROUTINE mp_max_c
30175 SUBROUTINE mp_max_root_c (msg, root, comm)
30176 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30177 INTEGER,
INTENT(IN) :: root
30178 CLASS(mp_comm_type),
INTENT(IN) :: comm
30180 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_c'
30183 #if defined(__parallel)
30184 INTEGER :: ierr, msglen
30185 COMPLEX(kind=real_4) :: res
30188 CALL mp_timeset(routinen, handle)
30190 #if defined(__parallel)
30192 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_max, root, comm%handle, ierr)
30193 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
30194 IF (root == comm%mepos) msg = res
30195 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30201 CALL mp_timestop(handle)
30202 END SUBROUTINE mp_max_root_c
30212 SUBROUTINE mp_max_cv(msg, comm)
30213 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
30214 CLASS(mp_comm_type),
INTENT(IN) :: comm
30216 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_cv'
30219 #if defined(__parallel)
30220 INTEGER :: ierr, msglen
30223 CALL mp_timeset(routinen, handle)
30225 #if defined(__parallel)
30227 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_max, comm%handle, ierr)
30228 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30229 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30234 CALL mp_timestop(handle)
30235 END SUBROUTINE mp_max_cv
30245 SUBROUTINE mp_max_root_cm(msg, root, comm)
30246 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30248 CLASS(mp_comm_type),
INTENT(IN) :: comm
30250 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_cm'
30253 #if defined(__parallel)
30254 INTEGER :: ierr, msglen
30255 COMPLEX(kind=real_4) :: res(size(msg, 1), size(msg, 2))
30258 CALL mp_timeset(routinen, handle)
30260 #if defined(__parallel)
30262 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_max, root, comm%handle, ierr)
30263 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30264 IF (root == comm%mepos) msg = res
30265 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30271 CALL mp_timestop(handle)
30272 END SUBROUTINE mp_max_root_cm
30282 SUBROUTINE mp_min_c (msg, comm)
30283 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30284 CLASS(mp_comm_type),
INTENT(IN) :: comm
30286 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_c'
30289 #if defined(__parallel)
30290 INTEGER :: ierr, msglen
30293 CALL mp_timeset(routinen, handle)
30295 #if defined(__parallel)
30297 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_min, comm%handle, ierr)
30298 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30299 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30304 CALL mp_timestop(handle)
30305 END SUBROUTINE mp_min_c
30317 SUBROUTINE mp_min_cv(msg, comm)
30318 COMPLEX(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
30319 CLASS(mp_comm_type),
INTENT(IN) :: comm
30321 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_cv'
30324 #if defined(__parallel)
30325 INTEGER :: ierr, msglen
30328 CALL mp_timeset(routinen, handle)
30330 #if defined(__parallel)
30332 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_min, comm%handle, ierr)
30333 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30334 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30339 CALL mp_timestop(handle)
30340 END SUBROUTINE mp_min_cv
30350 SUBROUTINE mp_prod_c (msg, comm)
30351 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30352 CLASS(mp_comm_type),
INTENT(IN) :: comm
30354 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_c'
30357 #if defined(__parallel)
30358 INTEGER :: ierr, msglen
30361 CALL mp_timeset(routinen, handle)
30363 #if defined(__parallel)
30365 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_prod, comm%handle, ierr)
30366 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30367 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30372 CALL mp_timestop(handle)
30373 END SUBROUTINE mp_prod_c
30384 SUBROUTINE mp_scatter_cv(msg_scatter, msg, root, comm)
30385 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
30386 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
30387 INTEGER,
INTENT(IN) :: root
30388 CLASS(mp_comm_type),
INTENT(IN) :: comm
30390 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_cv'
30393 #if defined(__parallel)
30394 INTEGER :: ierr, msglen
30397 CALL mp_timeset(routinen, handle)
30399 #if defined(__parallel)
30401 CALL mpi_scatter(msg_scatter, msglen, mpi_complex, msg, &
30402 msglen, mpi_complex, root, comm%handle, ierr)
30403 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
30404 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30410 CALL mp_timestop(handle)
30411 END SUBROUTINE mp_scatter_cv
30421 SUBROUTINE mp_iscatter_c (msg_scatter, msg, root, comm, request)
30422 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:)
30423 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30424 INTEGER,
INTENT(IN) :: root
30425 CLASS(mp_comm_type),
INTENT(IN) :: comm
30426 TYPE(mp_request_type),
INTENT(OUT) :: request
30428 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_c'
30431 #if defined(__parallel)
30432 INTEGER :: ierr, msglen
30435 CALL mp_timeset(routinen, handle)
30437 #if defined(__parallel)
30438 #if !defined(__GNUC__) || __GNUC__ >= 9
30439 cpassert(is_contiguous(msg_scatter))
30442 CALL mpi_iscatter(msg_scatter, msglen, mpi_complex, msg, &
30443 msglen, mpi_complex, root, comm%handle, request%handle, ierr)
30444 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
30445 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
30449 msg = msg_scatter(1)
30452 CALL mp_timestop(handle)
30453 END SUBROUTINE mp_iscatter_c
30463 SUBROUTINE mp_iscatter_cv2(msg_scatter, msg, root, comm, request)
30464 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:, :)
30465 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
30466 INTEGER,
INTENT(IN) :: root
30467 CLASS(mp_comm_type),
INTENT(IN) :: comm
30468 TYPE(mp_request_type),
INTENT(OUT) :: request
30470 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_cv2'
30473 #if defined(__parallel)
30474 INTEGER :: ierr, msglen
30477 CALL mp_timeset(routinen, handle)
30479 #if defined(__parallel)
30480 #if !defined(__GNUC__) || __GNUC__ >= 9
30481 cpassert(is_contiguous(msg_scatter))
30484 CALL mpi_iscatter(msg_scatter, msglen, mpi_complex, msg, &
30485 msglen, mpi_complex, root, comm%handle, request%handle, ierr)
30486 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
30487 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
30491 msg(:) = msg_scatter(:, 1)
30494 CALL mp_timestop(handle)
30495 END SUBROUTINE mp_iscatter_cv2
30505 SUBROUTINE mp_iscatterv_cv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
30506 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:)
30507 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
30508 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
30509 INTEGER,
INTENT(IN) :: recvcount, root
30510 CLASS(mp_comm_type),
INTENT(IN) :: comm
30511 TYPE(mp_request_type),
INTENT(OUT) :: request
30513 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_cv'
30516 #if defined(__parallel)
30520 CALL mp_timeset(routinen, handle)
30522 #if defined(__parallel)
30523 #if !defined(__GNUC__) || __GNUC__ >= 9
30524 cpassert(is_contiguous(msg_scatter))
30525 cpassert(is_contiguous(msg))
30526 cpassert(is_contiguous(sendcounts))
30527 cpassert(is_contiguous(displs))
30529 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_complex, msg, &
30530 recvcount, mpi_complex, root, comm%handle, request%handle, ierr)
30531 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
30532 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
30534 mark_used(sendcounts)
30536 mark_used(recvcount)
30539 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
30542 CALL mp_timestop(handle)
30543 END SUBROUTINE mp_iscatterv_cv
30554 SUBROUTINE mp_gather_c (msg, msg_gather, root, comm)
30555 COMPLEX(kind=real_4),
INTENT(IN) :: msg
30556 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30557 INTEGER,
INTENT(IN) :: root
30558 CLASS(mp_comm_type),
INTENT(IN) :: comm
30560 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_c'
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, root, 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))
30578 msg_gather(1) = msg
30580 CALL mp_timestop(handle)
30581 END SUBROUTINE mp_gather_c
30591 SUBROUTINE mp_gather_c_src(msg, msg_gather, comm)
30592 COMPLEX(kind=real_4),
INTENT(IN) :: msg
30593 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30594 CLASS(mp_comm_type),
INTENT(IN) :: comm
30596 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_c_src'
30599 #if defined(__parallel)
30600 INTEGER :: ierr, msglen
30603 CALL mp_timeset(routinen, handle)
30605 #if defined(__parallel)
30607 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30608 msglen, mpi_complex, comm%source, comm%handle, ierr)
30609 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30610 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30613 msg_gather(1) = msg
30615 CALL mp_timestop(handle)
30616 END SUBROUTINE mp_gather_c_src
30630 SUBROUTINE mp_gather_cv(msg, msg_gather, root, comm)
30631 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
30632 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30633 INTEGER,
INTENT(IN) :: root
30634 CLASS(mp_comm_type),
INTENT(IN) :: comm
30636 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cv'
30639 #if defined(__parallel)
30640 INTEGER :: ierr, msglen
30643 CALL mp_timeset(routinen, handle)
30645 #if defined(__parallel)
30647 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30648 msglen, mpi_complex, root, comm%handle, ierr)
30649 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30650 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30656 CALL mp_timestop(handle)
30657 END SUBROUTINE mp_gather_cv
30670 SUBROUTINE mp_gather_cv_src(msg, msg_gather, comm)
30671 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
30672 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
30673 CLASS(mp_comm_type),
INTENT(IN) :: comm
30675 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cv_src'
30678 #if defined(__parallel)
30679 INTEGER :: ierr, msglen
30682 CALL mp_timeset(routinen, handle)
30684 #if defined(__parallel)
30686 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30687 msglen, mpi_complex, comm%source, comm%handle, ierr)
30688 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30689 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30694 CALL mp_timestop(handle)
30695 END SUBROUTINE mp_gather_cv_src
30709 SUBROUTINE mp_gather_cm(msg, msg_gather, root, comm)
30710 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
30711 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
30712 INTEGER,
INTENT(IN) :: root
30713 CLASS(mp_comm_type),
INTENT(IN) :: comm
30715 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cm'
30718 #if defined(__parallel)
30719 INTEGER :: ierr, msglen
30722 CALL mp_timeset(routinen, handle)
30724 #if defined(__parallel)
30726 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30727 msglen, mpi_complex, root, comm%handle, ierr)
30728 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30729 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30735 CALL mp_timestop(handle)
30736 END SUBROUTINE mp_gather_cm
30749 SUBROUTINE mp_gather_cm_src(msg, msg_gather, comm)
30750 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
30751 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
30752 CLASS(mp_comm_type),
INTENT(IN) :: comm
30754 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cm_src'
30757 #if defined(__parallel)
30758 INTEGER :: ierr, msglen
30761 CALL mp_timeset(routinen, handle)
30763 #if defined(__parallel)
30765 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
30766 msglen, mpi_complex, comm%source, comm%handle, ierr)
30767 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
30768 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
30773 CALL mp_timestop(handle)
30774 END SUBROUTINE mp_gather_cm_src
30791 SUBROUTINE mp_gatherv_cv(sendbuf, recvbuf, recvcounts, displs, root, comm)
30793 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30794 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30795 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30796 INTEGER,
INTENT(IN) :: root
30797 CLASS(mp_comm_type),
INTENT(IN) :: comm
30799 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cv'
30802 #if defined(__parallel)
30803 INTEGER :: ierr, sendcount
30806 CALL mp_timeset(routinen, handle)
30808 #if defined(__parallel)
30809 sendcount =
SIZE(sendbuf)
30810 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30811 recvbuf, recvcounts, displs, mpi_complex, &
30812 root, comm%handle, ierr)
30813 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30814 CALL add_perf(perf_id=4, &
30816 msg_size=sendcount*(2*real_4_size))
30818 mark_used(recvcounts)
30821 recvbuf(1 + displs(1):) = sendbuf
30823 CALL mp_timestop(handle)
30824 END SUBROUTINE mp_gatherv_cv
30840 SUBROUTINE mp_gatherv_cv_src(sendbuf, recvbuf, recvcounts, displs, comm)
30842 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30843 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30844 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30845 CLASS(mp_comm_type),
INTENT(IN) :: comm
30847 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cv_src'
30850 #if defined(__parallel)
30851 INTEGER :: ierr, sendcount
30854 CALL mp_timeset(routinen, handle)
30856 #if defined(__parallel)
30857 sendcount =
SIZE(sendbuf)
30858 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30859 recvbuf, recvcounts, displs, mpi_complex, &
30860 comm%source, comm%handle, ierr)
30861 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30862 CALL add_perf(perf_id=4, &
30864 msg_size=sendcount*(2*real_4_size))
30866 mark_used(recvcounts)
30868 recvbuf(1 + displs(1):) = sendbuf
30870 CALL mp_timestop(handle)
30871 END SUBROUTINE mp_gatherv_cv_src
30888 SUBROUTINE mp_gatherv_cm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
30890 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30891 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30892 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30893 INTEGER,
INTENT(IN) :: root
30894 CLASS(mp_comm_type),
INTENT(IN) :: comm
30896 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cm2'
30899 #if defined(__parallel)
30900 INTEGER :: ierr, sendcount
30903 CALL mp_timeset(routinen, handle)
30905 #if defined(__parallel)
30906 sendcount =
SIZE(sendbuf)
30907 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30908 recvbuf, recvcounts, displs, mpi_complex, &
30909 root, comm%handle, ierr)
30910 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30911 CALL add_perf(perf_id=4, &
30913 msg_size=sendcount*(2*real_4_size))
30915 mark_used(recvcounts)
30918 recvbuf(:, 1 + displs(1):) = sendbuf
30920 CALL mp_timestop(handle)
30921 END SUBROUTINE mp_gatherv_cm2
30937 SUBROUTINE mp_gatherv_cm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
30939 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
30940 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
30941 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30942 CLASS(mp_comm_type),
INTENT(IN) :: comm
30944 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cm2_src'
30947 #if defined(__parallel)
30948 INTEGER :: ierr, sendcount
30951 CALL mp_timeset(routinen, handle)
30953 #if defined(__parallel)
30954 sendcount =
SIZE(sendbuf)
30955 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
30956 recvbuf, recvcounts, displs, mpi_complex, &
30957 comm%source, comm%handle, ierr)
30958 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
30959 CALL add_perf(perf_id=4, &
30961 msg_size=sendcount*(2*real_4_size))
30963 mark_used(recvcounts)
30965 recvbuf(:, 1 + displs(1):) = sendbuf
30967 CALL mp_timestop(handle)
30968 END SUBROUTINE mp_gatherv_cm2_src
30985 SUBROUTINE mp_igatherv_cv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
30986 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
30987 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
30988 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
30989 INTEGER,
INTENT(IN) :: sendcount, root
30990 CLASS(mp_comm_type),
INTENT(IN) :: comm
30991 TYPE(mp_request_type),
INTENT(OUT) :: request
30993 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_cv'
30996 #if defined(__parallel)
31000 CALL mp_timeset(routinen, handle)
31002 #if defined(__parallel)
31003 #if !defined(__GNUC__) || __GNUC__ >= 9
31004 cpassert(is_contiguous(sendbuf))
31005 cpassert(is_contiguous(recvbuf))
31006 cpassert(is_contiguous(recvcounts))
31007 cpassert(is_contiguous(displs))
31009 CALL mpi_igatherv(sendbuf, sendcount, mpi_complex, &
31010 recvbuf, recvcounts, displs, mpi_complex, &
31011 root, comm%handle, request%handle, ierr)
31012 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
31013 CALL add_perf(perf_id=24, &
31015 msg_size=sendcount*(2*real_4_size))
31017 mark_used(sendcount)
31018 mark_used(recvcounts)
31021 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
31024 CALL mp_timestop(handle)
31025 END SUBROUTINE mp_igatherv_cv
31038 SUBROUTINE mp_allgather_c (msgout, msgin, comm)
31039 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
31040 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
31041 CLASS(mp_comm_type),
INTENT(IN) :: comm
31043 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c'
31046 #if defined(__parallel)
31047 INTEGER :: ierr, rcount, scount
31050 CALL mp_timeset(routinen, handle)
31052 #if defined(__parallel)
31055 CALL mpi_allgather(msgout, scount, mpi_complex, &
31056 msgin, rcount, mpi_complex, &
31058 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31063 CALL mp_timestop(handle)
31064 END SUBROUTINE mp_allgather_c
31077 SUBROUTINE mp_allgather_c2(msgout, msgin, comm)
31078 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
31079 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
31080 CLASS(mp_comm_type),
INTENT(IN) :: comm
31082 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c2'
31085 #if defined(__parallel)
31086 INTEGER :: ierr, rcount, scount
31089 CALL mp_timeset(routinen, handle)
31091 #if defined(__parallel)
31094 CALL mpi_allgather(msgout, scount, mpi_complex, &
31095 msgin, rcount, mpi_complex, &
31097 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31102 CALL mp_timestop(handle)
31103 END SUBROUTINE mp_allgather_c2
31116 SUBROUTINE mp_iallgather_c (msgout, msgin, comm, request)
31117 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
31118 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31119 CLASS(mp_comm_type),
INTENT(IN) :: comm
31120 TYPE(mp_request_type),
INTENT(OUT) :: request
31122 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c'
31125 #if defined(__parallel)
31126 INTEGER :: ierr, rcount, scount
31129 CALL mp_timeset(routinen, handle)
31131 #if defined(__parallel)
31132 #if !defined(__GNUC__) || __GNUC__ >= 9
31133 cpassert(is_contiguous(msgin))
31137 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31138 msgin, rcount, mpi_complex, &
31139 comm%handle, request%handle, ierr)
31140 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31146 CALL mp_timestop(handle)
31147 END SUBROUTINE mp_iallgather_c
31162 SUBROUTINE mp_allgather_c12(msgout, msgin, comm)
31163 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
31164 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
31165 CLASS(mp_comm_type),
INTENT(IN) :: comm
31167 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c12'
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_c12
31198 SUBROUTINE mp_allgather_c23(msgout, msgin, comm)
31199 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
31200 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
31201 CLASS(mp_comm_type),
INTENT(IN) :: comm
31203 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c23'
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_c23
31234 SUBROUTINE mp_allgather_c34(msgout, msgin, comm)
31235 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
31236 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
31237 CLASS(mp_comm_type),
INTENT(IN) :: comm
31239 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c34'
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(:, :, :, 1) = msgout(:, :, :)
31259 CALL mp_timestop(handle)
31260 END SUBROUTINE mp_allgather_c34
31270 SUBROUTINE mp_allgather_c22(msgout, msgin, comm)
31271 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
31272 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
31273 CLASS(mp_comm_type),
INTENT(IN) :: comm
31275 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c22'
31278 #if defined(__parallel)
31279 INTEGER :: ierr, rcount, scount
31282 CALL mp_timeset(routinen, handle)
31284 #if defined(__parallel)
31285 scount =
SIZE(msgout(:, :))
31287 CALL mpi_allgather(msgout, scount, mpi_complex, &
31288 msgin, rcount, mpi_complex, &
31290 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31293 msgin(:, :) = msgout(:, :)
31295 CALL mp_timestop(handle)
31296 END SUBROUTINE mp_allgather_c22
31307 SUBROUTINE mp_iallgather_c11(msgout, msgin, comm, request)
31308 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31309 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31310 CLASS(mp_comm_type),
INTENT(IN) :: comm
31311 TYPE(mp_request_type),
INTENT(OUT) :: request
31313 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c11'
31316 #if defined(__parallel)
31317 INTEGER :: ierr, rcount, scount
31320 CALL mp_timeset(routinen, handle)
31322 #if defined(__parallel)
31323 #if !defined(__GNUC__) || __GNUC__ >= 9
31324 cpassert(is_contiguous(msgout))
31325 cpassert(is_contiguous(msgin))
31327 scount =
SIZE(msgout(:))
31329 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31330 msgin, rcount, mpi_complex, &
31331 comm%handle, request%handle, ierr)
31332 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31338 CALL mp_timestop(handle)
31339 END SUBROUTINE mp_iallgather_c11
31350 SUBROUTINE mp_iallgather_c13(msgout, msgin, comm, request)
31351 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31352 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
31353 CLASS(mp_comm_type),
INTENT(IN) :: comm
31354 TYPE(mp_request_type),
INTENT(OUT) :: request
31356 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c13'
31359 #if defined(__parallel)
31360 INTEGER :: ierr, rcount, scount
31363 CALL mp_timeset(routinen, handle)
31365 #if defined(__parallel)
31366 #if !defined(__GNUC__) || __GNUC__ >= 9
31367 cpassert(is_contiguous(msgout))
31368 cpassert(is_contiguous(msgin))
31371 scount =
SIZE(msgout(:))
31373 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31374 msgin, rcount, mpi_complex, &
31375 comm%handle, request%handle, ierr)
31376 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31379 msgin(:, 1, 1) = msgout(:)
31382 CALL mp_timestop(handle)
31383 END SUBROUTINE mp_iallgather_c13
31394 SUBROUTINE mp_iallgather_c22(msgout, msgin, comm, request)
31395 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :)
31396 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :)
31397 CLASS(mp_comm_type),
INTENT(IN) :: comm
31398 TYPE(mp_request_type),
INTENT(OUT) :: request
31400 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c22'
31403 #if defined(__parallel)
31404 INTEGER :: ierr, rcount, scount
31407 CALL mp_timeset(routinen, handle)
31409 #if defined(__parallel)
31410 #if !defined(__GNUC__) || __GNUC__ >= 9
31411 cpassert(is_contiguous(msgout))
31412 cpassert(is_contiguous(msgin))
31415 scount =
SIZE(msgout(:, :))
31417 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31418 msgin, rcount, mpi_complex, &
31419 comm%handle, request%handle, ierr)
31420 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31423 msgin(:, :) = msgout(:, :)
31426 CALL mp_timestop(handle)
31427 END SUBROUTINE mp_iallgather_c22
31438 SUBROUTINE mp_iallgather_c24(msgout, msgin, comm, request)
31439 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :)
31440 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :, :)
31441 CLASS(mp_comm_type),
INTENT(IN) :: comm
31442 TYPE(mp_request_type),
INTENT(OUT) :: request
31444 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c24'
31447 #if defined(__parallel)
31448 INTEGER :: ierr, rcount, scount
31451 CALL mp_timeset(routinen, handle)
31453 #if defined(__parallel)
31454 #if !defined(__GNUC__) || __GNUC__ >= 9
31455 cpassert(is_contiguous(msgout))
31456 cpassert(is_contiguous(msgin))
31459 scount =
SIZE(msgout(:, :))
31461 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31462 msgin, rcount, mpi_complex, &
31463 comm%handle, request%handle, ierr)
31464 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31467 msgin(:, :, 1, 1) = msgout(:, :)
31470 CALL mp_timestop(handle)
31471 END SUBROUTINE mp_iallgather_c24
31482 SUBROUTINE mp_iallgather_c33(msgout, msgin, comm, request)
31483 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :, :)
31484 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
31485 CLASS(mp_comm_type),
INTENT(IN) :: comm
31486 TYPE(mp_request_type),
INTENT(OUT) :: request
31488 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c33'
31491 #if defined(__parallel)
31492 INTEGER :: ierr, rcount, scount
31495 CALL mp_timeset(routinen, handle)
31497 #if defined(__parallel)
31498 #if !defined(__GNUC__) || __GNUC__ >= 9
31499 cpassert(is_contiguous(msgout))
31500 cpassert(is_contiguous(msgin))
31503 scount =
SIZE(msgout(:, :, :))
31505 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31506 msgin, rcount, mpi_complex, &
31507 comm%handle, request%handle, ierr)
31508 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31511 msgin(:, :, :) = msgout(:, :, :)
31514 CALL mp_timestop(handle)
31515 END SUBROUTINE mp_iallgather_c33
31534 SUBROUTINE mp_allgatherv_cv(msgout, msgin, rcount, rdispl, comm)
31535 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
31536 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
31537 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
31538 CLASS(mp_comm_type),
INTENT(IN) :: comm
31540 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_cv'
31543 #if defined(__parallel)
31544 INTEGER :: ierr, scount
31547 CALL mp_timeset(routinen, handle)
31549 #if defined(__parallel)
31550 scount =
SIZE(msgout)
31551 CALL mpi_allgatherv(msgout, scount, mpi_complex, msgin, rcount, &
31552 rdispl, mpi_complex, comm%handle, ierr)
31553 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
31560 CALL mp_timestop(handle)
31561 END SUBROUTINE mp_allgatherv_cv
31580 SUBROUTINE mp_allgatherv_cm2(msgout, msgin, rcount, rdispl, comm)
31581 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
31582 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
31583 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
31584 CLASS(mp_comm_type),
INTENT(IN) :: comm
31586 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_cv'
31589 #if defined(__parallel)
31590 INTEGER :: ierr, scount
31593 CALL mp_timeset(routinen, handle)
31595 #if defined(__parallel)
31596 scount =
SIZE(msgout)
31597 CALL mpi_allgatherv(msgout, scount, mpi_complex, msgin, rcount, &
31598 rdispl, mpi_complex, comm%handle, ierr)
31599 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
31606 CALL mp_timestop(handle)
31607 END SUBROUTINE mp_allgatherv_cm2
31626 SUBROUTINE mp_iallgatherv_cv(msgout, msgin, rcount, rdispl, comm, request)
31627 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31628 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31629 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
31630 CLASS(mp_comm_type),
INTENT(IN) :: comm
31631 TYPE(mp_request_type),
INTENT(OUT) :: request
31633 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_cv'
31636 #if defined(__parallel)
31637 INTEGER :: ierr, scount, rsize
31640 CALL mp_timeset(routinen, handle)
31642 #if defined(__parallel)
31643 #if !defined(__GNUC__) || __GNUC__ >= 9
31644 cpassert(is_contiguous(msgout))
31645 cpassert(is_contiguous(msgin))
31646 cpassert(is_contiguous(rcount))
31647 cpassert(is_contiguous(rdispl))
31650 scount =
SIZE(msgout)
31651 rsize =
SIZE(rcount)
31652 CALL mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, &
31653 rdispl, comm, request, ierr)
31654 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
31662 CALL mp_timestop(handle)
31663 END SUBROUTINE mp_iallgatherv_cv
31682 SUBROUTINE mp_iallgatherv_cv2(msgout, msgin, rcount, rdispl, comm, request)
31683 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31684 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31685 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
31686 CLASS(mp_comm_type),
INTENT(IN) :: comm
31687 TYPE(mp_request_type),
INTENT(OUT) :: request
31689 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_cv2'
31692 #if defined(__parallel)
31693 INTEGER :: ierr, scount, rsize
31696 CALL mp_timeset(routinen, handle)
31698 #if defined(__parallel)
31699 #if !defined(__GNUC__) || __GNUC__ >= 9
31700 cpassert(is_contiguous(msgout))
31701 cpassert(is_contiguous(msgin))
31702 cpassert(is_contiguous(rcount))
31703 cpassert(is_contiguous(rdispl))
31706 scount =
SIZE(msgout)
31707 rsize =
SIZE(rcount)
31708 CALL mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, &
31709 rdispl, comm, request, ierr)
31710 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
31718 CALL mp_timestop(handle)
31719 END SUBROUTINE mp_iallgatherv_cv2
31730 #if defined(__parallel)
31731 SUBROUTINE mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
31732 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
31733 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
31734 INTEGER,
INTENT(IN) :: rsize
31735 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
31736 CLASS(mp_comm_type),
INTENT(IN) :: comm
31737 TYPE(mp_request_type),
INTENT(OUT) :: request
31738 INTEGER,
INTENT(INOUT) :: ierr
31740 CALL mpi_iallgatherv(msgout, scount, mpi_complex, msgin, rcount, &
31741 rdispl, mpi_complex, comm%handle, request%handle, ierr)
31743 END SUBROUTINE mp_iallgatherv_cv_internal
31754 SUBROUTINE mp_sum_scatter_cv(msgout, msgin, rcount, comm)
31755 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
31756 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
31757 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
31758 CLASS(mp_comm_type),
INTENT(IN) :: comm
31760 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_cv'
31763 #if defined(__parallel)
31767 CALL mp_timeset(routinen, handle)
31769 #if defined(__parallel)
31770 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_complex, mpi_sum, &
31772 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
31774 CALL add_perf(perf_id=3, count=1, &
31775 msg_size=rcount(1)*2*(2*real_4_size))
31779 msgin = msgout(:, 1)
31781 CALL mp_timestop(handle)
31782 END SUBROUTINE mp_sum_scatter_cv
31793 SUBROUTINE mp_sendrecv_c (msgin, dest, msgout, source, comm, tag)
31794 COMPLEX(kind=real_4),
INTENT(IN) :: msgin
31795 INTEGER,
INTENT(IN) :: dest
31796 COMPLEX(kind=real_4),
INTENT(OUT) :: msgout
31797 INTEGER,
INTENT(IN) :: source
31798 CLASS(mp_comm_type),
INTENT(IN) :: comm
31799 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31801 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_c'
31804 #if defined(__parallel)
31805 INTEGER :: ierr, msglen_in, msglen_out, &
31809 CALL mp_timeset(routinen, handle)
31811 #if defined(__parallel)
31816 IF (
PRESENT(tag))
THEN
31820 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31821 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31822 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31823 CALL add_perf(perf_id=7, count=1, &
31824 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31832 CALL mp_timestop(handle)
31833 END SUBROUTINE mp_sendrecv_c
31844 SUBROUTINE mp_sendrecv_cv(msgin, dest, msgout, source, comm, tag)
31845 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
31846 INTEGER,
INTENT(IN) :: dest
31847 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
31848 INTEGER,
INTENT(IN) :: source
31849 CLASS(mp_comm_type),
INTENT(IN) :: comm
31850 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31852 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cv'
31855 #if defined(__parallel)
31856 INTEGER :: ierr, msglen_in, msglen_out, &
31860 CALL mp_timeset(routinen, handle)
31862 #if defined(__parallel)
31863 msglen_in =
SIZE(msgin)
31864 msglen_out =
SIZE(msgout)
31867 IF (
PRESENT(tag))
THEN
31871 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31872 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31873 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31874 CALL add_perf(perf_id=7, count=1, &
31875 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31883 CALL mp_timestop(handle)
31884 END SUBROUTINE mp_sendrecv_cv
31896 SUBROUTINE mp_sendrecv_cm2(msgin, dest, msgout, source, comm, tag)
31897 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
31898 INTEGER,
INTENT(IN) :: dest
31899 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
31900 INTEGER,
INTENT(IN) :: source
31901 CLASS(mp_comm_type),
INTENT(IN) :: comm
31902 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31904 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm2'
31907 #if defined(__parallel)
31908 INTEGER :: ierr, msglen_in, msglen_out, &
31912 CALL mp_timeset(routinen, handle)
31914 #if defined(__parallel)
31915 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
31916 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
31919 IF (
PRESENT(tag))
THEN
31923 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31924 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31925 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31926 CALL add_perf(perf_id=7, count=1, &
31927 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31935 CALL mp_timestop(handle)
31936 END SUBROUTINE mp_sendrecv_cm2
31947 SUBROUTINE mp_sendrecv_cm3(msgin, dest, msgout, source, comm, tag)
31948 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
31949 INTEGER,
INTENT(IN) :: dest
31950 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
31951 INTEGER,
INTENT(IN) :: source
31952 CLASS(mp_comm_type),
INTENT(IN) :: comm
31953 INTEGER,
INTENT(IN),
OPTIONAL :: tag
31955 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm3'
31958 #if defined(__parallel)
31959 INTEGER :: ierr, msglen_in, msglen_out, &
31963 CALL mp_timeset(routinen, handle)
31965 #if defined(__parallel)
31966 msglen_in =
SIZE(msgin)
31967 msglen_out =
SIZE(msgout)
31970 IF (
PRESENT(tag))
THEN
31974 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
31975 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
31976 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
31977 CALL add_perf(perf_id=7, count=1, &
31978 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
31986 CALL mp_timestop(handle)
31987 END SUBROUTINE mp_sendrecv_cm3
31998 SUBROUTINE mp_sendrecv_cm4(msgin, dest, msgout, source, comm, tag)
31999 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
32000 INTEGER,
INTENT(IN) :: dest
32001 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
32002 INTEGER,
INTENT(IN) :: source
32003 CLASS(mp_comm_type),
INTENT(IN) :: comm
32004 INTEGER,
INTENT(IN),
OPTIONAL :: tag
32006 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm4'
32009 #if defined(__parallel)
32010 INTEGER :: ierr, msglen_in, msglen_out, &
32014 CALL mp_timeset(routinen, handle)
32016 #if defined(__parallel)
32017 msglen_in =
SIZE(msgin)
32018 msglen_out =
SIZE(msgout)
32021 IF (
PRESENT(tag))
THEN
32025 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
32026 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
32027 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
32028 CALL add_perf(perf_id=7, count=1, &
32029 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
32037 CALL mp_timestop(handle)
32038 END SUBROUTINE mp_sendrecv_cm4
32055 SUBROUTINE mp_isendrecv_c (msgin, dest, msgout, source, comm, send_request, &
32057 COMPLEX(kind=real_4),
INTENT(IN) :: msgin
32058 INTEGER,
INTENT(IN) :: dest
32059 COMPLEX(kind=real_4),
INTENT(INOUT) :: msgout
32060 INTEGER,
INTENT(IN) :: source
32061 CLASS(mp_comm_type),
INTENT(IN) :: comm
32062 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
32063 INTEGER,
INTENT(in),
OPTIONAL :: tag
32065 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_c'
32068 #if defined(__parallel)
32069 INTEGER :: ierr, my_tag
32072 CALL mp_timeset(routinen, handle)
32074 #if defined(__parallel)
32076 IF (
PRESENT(tag)) my_tag = tag
32078 CALL mpi_irecv(msgout, 1, mpi_complex, source, my_tag, &
32079 comm%handle, recv_request%handle, ierr)
32080 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32082 CALL mpi_isend(msgin, 1, mpi_complex, dest, my_tag, &
32083 comm%handle, send_request%handle, ierr)
32084 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32086 CALL add_perf(perf_id=8, count=1, msg_size=2*(2*real_4_size))
32096 CALL mp_timestop(handle)
32097 END SUBROUTINE mp_isendrecv_c
32116 SUBROUTINE mp_isendrecv_cv(msgin, dest, msgout, source, comm, send_request, &
32118 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
32119 INTEGER,
INTENT(IN) :: dest
32120 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
32121 INTEGER,
INTENT(IN) :: source
32122 CLASS(mp_comm_type),
INTENT(IN) :: comm
32123 TYPE(mp_request_type),
INTENT(out) :: send_request, recv_request
32124 INTEGER,
INTENT(in),
OPTIONAL :: tag
32126 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_cv'
32129 #if defined(__parallel)
32130 INTEGER :: ierr, msglen, my_tag
32131 COMPLEX(kind=real_4) :: foo
32134 CALL mp_timeset(routinen, handle)
32136 #if defined(__parallel)
32137 #if !defined(__GNUC__) || __GNUC__ >= 9
32138 cpassert(is_contiguous(msgout))
32139 cpassert(is_contiguous(msgin))
32143 IF (
PRESENT(tag)) my_tag = tag
32145 msglen =
SIZE(msgout, 1)
32146 IF (msglen > 0)
THEN
32147 CALL mpi_irecv(msgout(1), msglen, mpi_complex, source, my_tag, &
32148 comm%handle, recv_request%handle, ierr)
32150 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32151 comm%handle, recv_request%handle, ierr)
32153 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32155 msglen =
SIZE(msgin, 1)
32156 IF (msglen > 0)
THEN
32157 CALL mpi_isend(msgin(1), msglen, mpi_complex, dest, my_tag, &
32158 comm%handle, send_request%handle, ierr)
32160 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32161 comm%handle, send_request%handle, ierr)
32163 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32165 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
32166 CALL add_perf(perf_id=8, count=1, msg_size=msglen*(2*real_4_size))
32176 CALL mp_timestop(handle)
32177 END SUBROUTINE mp_isendrecv_cv
32192 SUBROUTINE mp_isend_cv(msgin, dest, comm, request, tag)
32193 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
32194 INTEGER,
INTENT(IN) :: dest
32195 CLASS(mp_comm_type),
INTENT(IN) :: comm
32196 TYPE(mp_request_type),
INTENT(out) :: request
32197 INTEGER,
INTENT(in),
OPTIONAL :: tag
32199 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cv'
32201 INTEGER :: handle, ierr
32202 #if defined(__parallel)
32203 INTEGER :: msglen, my_tag
32204 COMPLEX(kind=real_4) :: foo(1)
32207 CALL mp_timeset(routinen, handle)
32209 #if defined(__parallel)
32210 #if !defined(__GNUC__) || __GNUC__ >= 9
32211 cpassert(is_contiguous(msgin))
32214 IF (
PRESENT(tag)) my_tag = tag
32216 msglen =
SIZE(msgin)
32217 IF (msglen > 0)
THEN
32218 CALL mpi_isend(msgin(1), msglen, mpi_complex, dest, my_tag, &
32219 comm%handle, request%handle, ierr)
32221 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32222 comm%handle, request%handle, ierr)
32224 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32226 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32235 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32237 CALL mp_timestop(handle)
32238 END SUBROUTINE mp_isend_cv
32255 SUBROUTINE mp_isend_cm2(msgin, dest, comm, request, tag)
32256 COMPLEX(kind=real_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
32257 INTEGER,
INTENT(IN) :: dest
32258 CLASS(mp_comm_type),
INTENT(IN) :: comm
32259 TYPE(mp_request_type),
INTENT(out) :: request
32260 INTEGER,
INTENT(in),
OPTIONAL :: tag
32262 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm2'
32264 INTEGER :: handle, ierr
32265 #if defined(__parallel)
32266 INTEGER :: msglen, my_tag
32267 COMPLEX(kind=real_4) :: foo(1)
32270 CALL mp_timeset(routinen, handle)
32272 #if defined(__parallel)
32273 #if !defined(__GNUC__) || __GNUC__ >= 9
32274 cpassert(is_contiguous(msgin))
32278 IF (
PRESENT(tag)) my_tag = tag
32280 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
32281 IF (msglen > 0)
THEN
32282 CALL mpi_isend(msgin(1, 1), msglen, mpi_complex, dest, my_tag, &
32283 comm%handle, request%handle, ierr)
32285 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32286 comm%handle, request%handle, ierr)
32288 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32290 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32299 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32301 CALL mp_timestop(handle)
32302 END SUBROUTINE mp_isend_cm2
32321 SUBROUTINE mp_isend_cm3(msgin, dest, comm, request, tag)
32322 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
32323 INTEGER,
INTENT(IN) :: dest
32324 CLASS(mp_comm_type),
INTENT(IN) :: comm
32325 TYPE(mp_request_type),
INTENT(out) :: request
32326 INTEGER,
INTENT(in),
OPTIONAL :: tag
32328 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm3'
32330 INTEGER :: handle, ierr
32331 #if defined(__parallel)
32332 INTEGER :: msglen, my_tag
32333 COMPLEX(kind=real_4) :: foo(1)
32336 CALL mp_timeset(routinen, handle)
32338 #if defined(__parallel)
32339 #if !defined(__GNUC__) || __GNUC__ >= 9
32340 cpassert(is_contiguous(msgin))
32344 IF (
PRESENT(tag)) my_tag = tag
32346 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
32347 IF (msglen > 0)
THEN
32348 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_complex, dest, my_tag, &
32349 comm%handle, request%handle, ierr)
32351 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32352 comm%handle, request%handle, ierr)
32354 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32356 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32365 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32367 CALL mp_timestop(handle)
32368 END SUBROUTINE mp_isend_cm3
32384 SUBROUTINE mp_isend_cm4(msgin, dest, comm, request, tag)
32385 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
32386 INTEGER,
INTENT(IN) :: dest
32387 CLASS(mp_comm_type),
INTENT(IN) :: comm
32388 TYPE(mp_request_type),
INTENT(out) :: request
32389 INTEGER,
INTENT(in),
OPTIONAL :: tag
32391 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm4'
32393 INTEGER :: handle, ierr
32394 #if defined(__parallel)
32395 INTEGER :: msglen, my_tag
32396 COMPLEX(kind=real_4) :: foo(1)
32399 CALL mp_timeset(routinen, handle)
32401 #if defined(__parallel)
32402 #if !defined(__GNUC__) || __GNUC__ >= 9
32403 cpassert(is_contiguous(msgin))
32407 IF (
PRESENT(tag)) my_tag = tag
32409 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
32410 IF (msglen > 0)
THEN
32411 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_complex, dest, my_tag, &
32412 comm%handle, request%handle, ierr)
32414 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32415 comm%handle, request%handle, ierr)
32417 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32419 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32428 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32430 CALL mp_timestop(handle)
32431 END SUBROUTINE mp_isend_cm4
32447 SUBROUTINE mp_irecv_cv(msgout, source, comm, request, tag)
32448 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
32449 INTEGER,
INTENT(IN) :: source
32450 CLASS(mp_comm_type),
INTENT(IN) :: comm
32451 TYPE(mp_request_type),
INTENT(out) :: request
32452 INTEGER,
INTENT(in),
OPTIONAL :: tag
32454 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cv'
32457 #if defined(__parallel)
32458 INTEGER :: ierr, msglen, my_tag
32459 COMPLEX(kind=real_4) :: foo(1)
32462 CALL mp_timeset(routinen, handle)
32464 #if defined(__parallel)
32465 #if !defined(__GNUC__) || __GNUC__ >= 9
32466 cpassert(is_contiguous(msgout))
32470 IF (
PRESENT(tag)) my_tag = tag
32472 msglen =
SIZE(msgout)
32473 IF (msglen > 0)
THEN
32474 CALL mpi_irecv(msgout(1), msglen, mpi_complex, source, my_tag, &
32475 comm%handle, request%handle, ierr)
32477 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32478 comm%handle, request%handle, ierr)
32480 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32482 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32484 cpabort(
"mp_irecv called in non parallel case")
32491 CALL mp_timestop(handle)
32492 END SUBROUTINE mp_irecv_cv
32509 SUBROUTINE mp_irecv_cm2(msgout, source, comm, request, tag)
32510 COMPLEX(kind=real_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
32511 INTEGER,
INTENT(IN) :: source
32512 CLASS(mp_comm_type),
INTENT(IN) :: comm
32513 TYPE(mp_request_type),
INTENT(out) :: request
32514 INTEGER,
INTENT(in),
OPTIONAL :: tag
32516 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm2'
32519 #if defined(__parallel)
32520 INTEGER :: ierr, msglen, my_tag
32521 COMPLEX(kind=real_4) :: foo(1)
32524 CALL mp_timeset(routinen, handle)
32526 #if defined(__parallel)
32527 #if !defined(__GNUC__) || __GNUC__ >= 9
32528 cpassert(is_contiguous(msgout))
32532 IF (
PRESENT(tag)) my_tag = tag
32534 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
32535 IF (msglen > 0)
THEN
32536 CALL mpi_irecv(msgout(1, 1), msglen, mpi_complex, source, my_tag, &
32537 comm%handle, request%handle, ierr)
32539 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32540 comm%handle, request%handle, ierr)
32542 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32544 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32551 cpabort(
"mp_irecv called in non parallel case")
32553 CALL mp_timestop(handle)
32554 END SUBROUTINE mp_irecv_cm2
32572 SUBROUTINE mp_irecv_cm3(msgout, source, comm, request, tag)
32573 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
32574 INTEGER,
INTENT(IN) :: source
32575 CLASS(mp_comm_type),
INTENT(IN) :: comm
32576 TYPE(mp_request_type),
INTENT(out) :: request
32577 INTEGER,
INTENT(in),
OPTIONAL :: tag
32579 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm3'
32582 #if defined(__parallel)
32583 INTEGER :: ierr, msglen, my_tag
32584 COMPLEX(kind=real_4) :: foo(1)
32587 CALL mp_timeset(routinen, handle)
32589 #if defined(__parallel)
32590 #if !defined(__GNUC__) || __GNUC__ >= 9
32591 cpassert(is_contiguous(msgout))
32595 IF (
PRESENT(tag)) my_tag = tag
32597 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
32598 IF (msglen > 0)
THEN
32599 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_complex, source, my_tag, &
32600 comm%handle, request%handle, ierr)
32602 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32603 comm%handle, request%handle, ierr)
32605 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
32607 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32614 cpabort(
"mp_irecv called in non parallel case")
32616 CALL mp_timestop(handle)
32617 END SUBROUTINE mp_irecv_cm3
32633 SUBROUTINE mp_irecv_cm4(msgout, source, comm, request, tag)
32634 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
32635 INTEGER,
INTENT(IN) :: source
32636 CLASS(mp_comm_type),
INTENT(IN) :: comm
32637 TYPE(mp_request_type),
INTENT(out) :: request
32638 INTEGER,
INTENT(in),
OPTIONAL :: tag
32640 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm4'
32643 #if defined(__parallel)
32644 INTEGER :: ierr, msglen, my_tag
32645 COMPLEX(kind=real_4) :: foo(1)
32648 CALL mp_timeset(routinen, handle)
32650 #if defined(__parallel)
32651 #if !defined(__GNUC__) || __GNUC__ >= 9
32652 cpassert(is_contiguous(msgout))
32656 IF (
PRESENT(tag)) my_tag = tag
32658 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
32659 IF (msglen > 0)
THEN
32660 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_complex, source, my_tag, &
32661 comm%handle, request%handle, ierr)
32663 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32664 comm%handle, request%handle, ierr)
32666 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
32668 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
32675 cpabort(
"mp_irecv called in non parallel case")
32677 CALL mp_timestop(handle)
32678 END SUBROUTINE mp_irecv_cm4
32690 SUBROUTINE mp_win_create_cv(base, comm, win)
32691 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
32692 TYPE(mp_comm_type),
INTENT(IN) :: comm
32693 CLASS(mp_win_type),
INTENT(INOUT) :: win
32695 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_cv'
32698 #if defined(__parallel)
32700 INTEGER(kind=mpi_address_kind) :: len
32701 COMPLEX(kind=real_4) :: foo(1)
32704 CALL mp_timeset(routinen, handle)
32706 #if defined(__parallel)
32708 len =
SIZE(base)*(2*real_4_size)
32710 CALL mpi_win_create(base(1), len, (2*real_4_size), mpi_info_null, comm%handle, win%handle, ierr)
32712 CALL mpi_win_create(foo, len, (2*real_4_size), mpi_info_null, comm%handle, win%handle, ierr)
32714 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
32716 CALL add_perf(perf_id=20, count=1)
32720 win%handle = mp_win_null_handle
32722 CALL mp_timestop(handle)
32723 END SUBROUTINE mp_win_create_cv
32735 SUBROUTINE mp_rget_cv(base, source, win, win_data, myproc, disp, request, &
32736 origin_datatype, target_datatype)
32737 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
32738 INTEGER,
INTENT(IN) :: source
32739 CLASS(mp_win_type),
INTENT(IN) :: win
32740 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: win_data
32741 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
32742 TYPE(mp_request_type),
INTENT(OUT) :: request
32743 TYPE(mp_type_descriptor_type),
INTENT(IN),
OPTIONAL :: origin_datatype, target_datatype
32745 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_cv'
32748 #if defined(__parallel)
32749 INTEGER :: ierr, len, &
32750 origin_len, target_len
32751 LOGICAL :: do_local_copy
32752 INTEGER(kind=mpi_address_kind) :: disp_aint
32753 mpi_data_type :: handle_origin_datatype, handle_target_datatype
32756 CALL mp_timeset(routinen, handle)
32758 #if defined(__parallel)
32761 IF (
PRESENT(disp))
THEN
32762 disp_aint = int(disp, kind=mpi_address_kind)
32764 handle_origin_datatype = mpi_complex
32766 IF (
PRESENT(origin_datatype))
THEN
32767 handle_origin_datatype = origin_datatype%type_handle
32770 handle_target_datatype = mpi_complex
32772 IF (
PRESENT(target_datatype))
THEN
32773 handle_target_datatype = target_datatype%type_handle
32777 do_local_copy = .false.
32778 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
32779 IF (myproc .EQ. source) do_local_copy = .true.
32781 IF (do_local_copy)
THEN
32783 base(:) = win_data(disp_aint + 1:disp_aint + len)
32788 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
32789 target_len, handle_target_datatype, win%handle, request%handle, ierr)
32795 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
32797 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*(2*real_4_size))
32802 mark_used(origin_datatype)
32803 mark_used(target_datatype)
32807 IF (
PRESENT(disp))
THEN
32808 base(:) = win_data(disp + 1:disp +
SIZE(base))
32810 base(:) = win_data(:
SIZE(base))
32814 CALL mp_timestop(handle)
32815 END SUBROUTINE mp_rget_cv
32825 result(type_descriptor)
32826 INTEGER,
INTENT(IN) :: count
32827 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
32828 TYPE(mp_type_descriptor_type) :: type_descriptor
32830 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_c'
32833 #if defined(__parallel)
32837 CALL mp_timeset(routinen, handle)
32839 #if defined(__parallel)
32840 CALL mpi_type_indexed(count, lengths, displs, mpi_complex, &
32841 type_descriptor%type_handle, ierr)
32843 cpabort(
"MPI_Type_Indexed @ "//routinen)
32844 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
32846 cpabort(
"MPI_Type_commit @ "//routinen)
32848 type_descriptor%type_handle = 5
32850 type_descriptor%length = count
32851 NULLIFY (type_descriptor%subtype)
32852 type_descriptor%vector_descriptor(1:2) = 1
32853 type_descriptor%has_indexing = .true.
32854 type_descriptor%index_descriptor%index => lengths
32855 type_descriptor%index_descriptor%chunks => displs
32857 CALL mp_timestop(handle)
32868 SUBROUTINE mp_allocate_c (DATA, len, stat)
32869 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
32870 INTEGER,
INTENT(IN) :: len
32871 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
32873 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allocate_c'
32875 INTEGER :: handle, ierr
32877 CALL mp_timeset(routinen, handle)
32879 #if defined(__parallel)
32881 CALL mp_alloc_mem(
DATA, len, stat=ierr)
32882 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
32883 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
32884 CALL add_perf(perf_id=15, count=1)
32886 ALLOCATE (
DATA(len), stat=ierr)
32887 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
32888 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
32890 IF (
PRESENT(stat)) stat = ierr
32891 CALL mp_timestop(handle)
32892 END SUBROUTINE mp_allocate_c
32900 SUBROUTINE mp_deallocate_c (DATA, stat)
32901 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
32902 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
32904 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_deallocate_c'
32907 #if defined(__parallel)
32911 CALL mp_timeset(routinen, handle)
32913 #if defined(__parallel)
32914 CALL mp_free_mem(
DATA, ierr)
32915 IF (
PRESENT(stat))
THEN
32918 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
32921 CALL add_perf(perf_id=15, count=1)
32924 IF (
PRESENT(stat)) stat = 0
32926 CALL mp_timestop(handle)
32927 END SUBROUTINE mp_deallocate_c
32940 SUBROUTINE mp_file_write_at_cv(fh, offset, msg, msglen)
32941 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
32942 CLASS(mp_file_type),
INTENT(IN) :: fh
32943 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
32944 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32947 #if defined(__parallel)
32951 msg_len =
SIZE(msg)
32952 IF (
PRESENT(msglen)) msg_len = msglen
32953 #if defined(__parallel)
32954 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
32956 cpabort(
"mpi_file_write_at_cv @ mp_file_write_at_cv")
32958 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
32960 END SUBROUTINE mp_file_write_at_cv
32968 SUBROUTINE mp_file_write_at_c (fh, offset, msg)
32969 COMPLEX(kind=real_4),
INTENT(IN) :: msg
32970 CLASS(mp_file_type),
INTENT(IN) :: fh
32971 INTEGER(kind=file_offset),
INTENT(IN) :: offset
32973 #if defined(__parallel)
32977 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
32979 cpabort(
"mpi_file_write_at_c @ mp_file_write_at_c")
32981 WRITE (unit=fh%handle, pos=offset + 1) msg
32983 END SUBROUTINE mp_file_write_at_c
32995 SUBROUTINE mp_file_write_at_all_cv(fh, offset, msg, msglen)
32996 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
32997 CLASS(mp_file_type),
INTENT(IN) :: fh
32998 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
32999 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33002 #if defined(__parallel)
33006 msg_len =
SIZE(msg)
33007 IF (
PRESENT(msglen)) msg_len = msglen
33008 #if defined(__parallel)
33009 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
33011 cpabort(
"mpi_file_write_at_all_cv @ mp_file_write_at_all_cv")
33013 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
33015 END SUBROUTINE mp_file_write_at_all_cv
33023 SUBROUTINE mp_file_write_at_all_c (fh, offset, msg)
33024 COMPLEX(kind=real_4),
INTENT(IN) :: msg
33025 CLASS(mp_file_type),
INTENT(IN) :: fh
33026 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33028 #if defined(__parallel)
33032 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
33034 cpabort(
"mpi_file_write_at_all_c @ mp_file_write_at_all_c")
33036 WRITE (unit=fh%handle, pos=offset + 1) msg
33038 END SUBROUTINE mp_file_write_at_all_c
33051 SUBROUTINE mp_file_read_at_cv(fh, offset, msg, msglen)
33052 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
33053 CLASS(mp_file_type),
INTENT(IN) :: fh
33054 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
33055 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33058 #if defined(__parallel)
33062 msg_len =
SIZE(msg)
33063 IF (
PRESENT(msglen)) msg_len = msglen
33064 #if defined(__parallel)
33065 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
33067 cpabort(
"mpi_file_read_at_cv @ mp_file_read_at_cv")
33069 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
33071 END SUBROUTINE mp_file_read_at_cv
33079 SUBROUTINE mp_file_read_at_c (fh, offset, msg)
33080 COMPLEX(kind=real_4),
INTENT(OUT) :: msg
33081 CLASS(mp_file_type),
INTENT(IN) :: fh
33082 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33084 #if defined(__parallel)
33088 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
33090 cpabort(
"mpi_file_read_at_c @ mp_file_read_at_c")
33092 READ (unit=fh%handle, pos=offset + 1) msg
33094 END SUBROUTINE mp_file_read_at_c
33106 SUBROUTINE mp_file_read_at_all_cv(fh, offset, msg, msglen)
33107 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
33108 CLASS(mp_file_type),
INTENT(IN) :: fh
33109 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
33110 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33113 #if defined(__parallel)
33117 msg_len =
SIZE(msg)
33118 IF (
PRESENT(msglen)) msg_len = msglen
33119 #if defined(__parallel)
33120 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
33122 cpabort(
"mpi_file_read_at_all_cv @ mp_file_read_at_all_cv")
33124 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
33126 END SUBROUTINE mp_file_read_at_all_cv
33134 SUBROUTINE mp_file_read_at_all_c (fh, offset, msg)
33135 COMPLEX(kind=real_4),
INTENT(OUT) :: msg
33136 CLASS(mp_file_type),
INTENT(IN) :: fh
33137 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33139 #if defined(__parallel)
33143 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
33145 cpabort(
"mpi_file_read_at_all_c @ mp_file_read_at_all_c")
33147 READ (unit=fh%handle, pos=offset + 1) msg
33149 END SUBROUTINE mp_file_read_at_all_c
33158 FUNCTION mp_type_make_c (ptr, &
33159 vector_descriptor, index_descriptor) &
33160 result(type_descriptor)
33161 COMPLEX(kind=real_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
33162 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
33163 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
33164 TYPE(mp_type_descriptor_type) :: type_descriptor
33166 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_c'
33168 #if defined(__parallel)
33172 NULLIFY (type_descriptor%subtype)
33173 type_descriptor%length =
SIZE(ptr)
33174 #if defined(__parallel)
33175 type_descriptor%type_handle = mpi_complex
33176 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
33178 cpabort(
"MPI_Get_address @ "//routinen)
33180 type_descriptor%type_handle = 5
33182 type_descriptor%vector_descriptor(1:2) = 1
33183 type_descriptor%has_indexing = .false.
33184 type_descriptor%data_c => ptr
33185 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
33186 cpabort(routinen//
": Vectors and indices NYI")
33188 END FUNCTION mp_type_make_c
33197 SUBROUTINE mp_alloc_mem_c (DATA, len, stat)
33198 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
33199 INTEGER,
INTENT(IN) :: len
33200 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
33202 #if defined(__parallel)
33203 INTEGER :: size, ierr, length, &
33205 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
33206 TYPE(c_ptr) :: mp_baseptr
33207 mpi_info_type :: mp_info
33209 length = max(len, 1)
33210 CALL mpi_type_size(mpi_complex,
size, ierr)
33211 mp_size = int(length, kind=mpi_address_kind)*
size
33212 IF (mp_size .GT. mp_max_memory_size)
THEN
33213 cpabort(
"MPI cannot allocate more than 2 GiByte")
33215 mp_info = mpi_info_null
33216 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
33217 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
33218 IF (
PRESENT(stat)) stat = mp_res
33220 INTEGER :: length, mystat
33221 length = max(len, 1)
33222 IF (
PRESENT(stat))
THEN
33223 ALLOCATE (
DATA(length), stat=mystat)
33226 ALLOCATE (
DATA(length))
33229 END SUBROUTINE mp_alloc_mem_c
33237 SUBROUTINE mp_free_mem_c (DATA, stat)
33238 COMPLEX(kind=real_4),
DIMENSION(:), &
33239 POINTER, asynchronous :: data
33240 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
33242 #if defined(__parallel)
33244 CALL mpi_free_mem(
DATA, mp_res)
33245 IF (
PRESENT(stat)) stat = mp_res
33248 IF (
PRESENT(stat)) stat = 0
33250 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
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
integer function, public mp_get_node_global_rank()
Get the local rank on the node according to the global communicator.
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 ...