24 USE iso_c_binding,
ONLY: c_f_pointer, c_ptr
31 USE mcl,
ONLY: mcl_initialize, mcl_is_initialized, mcl_abort
34#include "../base/base_uses.f90"
38#if defined(__parallel) && defined(__MPI_F08)
39#define MPI_DATA_TYPE TYPE(MPI_Datatype)
40#define MPI_COMM_TYPE TYPE(MPI_Comm)
41#define MPI_REQUEST_TYPE TYPE(MPI_Request)
42#define MPI_WIN_TYPE TYPE(MPI_Win)
43#define MPI_FILE_TYPE TYPE(MPI_File)
44#define MPI_INFO_TYPE TYPE(MPI_Info)
45#define MPI_STATUS_TYPE TYPE(MPI_Status)
46#define MPI_GROUP_TYPE TYPE(MPI_Group)
47#define MPI_STATUS_EXTRACT(X) %X
48#define MPI_GET_COMP %mpi_val
50#define MPI_DATA_TYPE INTEGER
51#define MPI_COMM_TYPE INTEGER
52#define MPI_REQUEST_TYPE INTEGER
53#define MPI_WIN_TYPE INTEGER
54#define MPI_FILE_TYPE INTEGER
55#define MPI_INFO_TYPE INTEGER
56#define MPI_STATUS_TYPE INTEGER, DIMENSION(MPI_STATUS_SIZE)
57#define MPI_GROUP_TYPE INTEGER
58#define MPI_STATUS_EXTRACT(X) (X)
62#if defined(__parallel)
76#if defined(__parallel)
77 LOGICAL,
PARAMETER :: cp2k_is_parallel = .true.
78 INTEGER,
PARAMETER,
PUBLIC :: mp_any_tag = mpi_any_tag
79 INTEGER,
PARAMETER,
PUBLIC :: mp_any_source = mpi_any_source
80 mpi_comm_type,
PARAMETER :: mp_comm_null_handle = mpi_comm_null
81 mpi_comm_type,
PARAMETER :: mp_comm_self_handle = mpi_comm_self
82 mpi_comm_type,
PARAMETER :: mp_comm_world_handle = mpi_comm_world
83 mpi_request_type,
PARAMETER :: mp_request_null_handle = mpi_request_null
84 mpi_win_type,
PARAMETER :: mp_win_null_handle = mpi_win_null
85 mpi_file_type,
PARAMETER :: mp_file_null_handle = mpi_file_null
86 mpi_info_type,
PARAMETER :: mp_info_null_handle = mpi_info_null
87 mpi_data_type,
PARAMETER :: mp_datatype_null_handle = mpi_datatype_null
88 INTEGER,
PARAMETER,
PUBLIC :: mp_status_size = mpi_status_size
89 INTEGER,
PARAMETER,
PUBLIC :: mp_proc_null = mpi_proc_null
91 INTEGER(KIND=MPI_ADDRESS_KIND),
PARAMETER,
PRIVATE :: mp_max_memory_size = huge(int(1, kind=
int_4))
93 INTEGER,
PARAMETER,
PUBLIC :: mp_max_library_version_string = mpi_max_library_version_string
95 INTEGER,
PARAMETER,
PUBLIC :: file_offset = mpi_offset_kind
96 INTEGER,
PARAMETER,
PUBLIC :: address_kind = mpi_address_kind
97 INTEGER,
PARAMETER,
PUBLIC :: file_amode_create = mpi_mode_create
98 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdonly = mpi_mode_rdonly
99 INTEGER,
PARAMETER,
PUBLIC :: file_amode_wronly = mpi_mode_wronly
100 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdwr = mpi_mode_rdwr
101 INTEGER,
PARAMETER,
PUBLIC :: file_amode_excl = mpi_mode_excl
102 INTEGER,
PARAMETER,
PUBLIC :: file_amode_append = mpi_mode_append
104 LOGICAL,
PARAMETER :: cp2k_is_parallel = .false.
105 INTEGER,
PARAMETER,
PUBLIC :: mp_any_tag = -1
106 INTEGER,
PARAMETER,
PUBLIC :: mp_any_source = -2
107 mpi_comm_type,
PARAMETER :: mp_comm_null_handle = -3
108 mpi_comm_type,
PARAMETER :: mp_comm_self_handle = -11
109 mpi_comm_type,
PARAMETER :: mp_comm_world_handle = -12
110 mpi_request_type,
PARAMETER :: mp_request_null_handle = -4
111 mpi_win_type,
PARAMETER :: mp_win_null_handle = -5
112 mpi_file_type,
PARAMETER :: mp_file_null_handle = -6
113 mpi_info_type,
PARAMETER :: mp_info_null_handle = -7
114 mpi_data_type,
PARAMETER :: mp_datatype_null_handle = -8
115 INTEGER,
PARAMETER,
PUBLIC :: mp_status_size = -9
116 INTEGER,
PARAMETER,
PUBLIC :: mp_proc_null = -10
117 INTEGER,
PARAMETER,
PUBLIC :: mp_max_library_version_string = 1
119 INTEGER,
PARAMETER,
PUBLIC :: file_offset =
int_8
120 INTEGER,
PARAMETER,
PUBLIC :: address_kind =
int_8
121 INTEGER,
PARAMETER,
PUBLIC :: file_amode_create = 1
122 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdonly = 2
123 INTEGER,
PARAMETER,
PUBLIC :: file_amode_wronly = 4
124 INTEGER,
PARAMETER,
PUBLIC :: file_amode_rdwr = 8
125 INTEGER,
PARAMETER,
PUBLIC :: file_amode_excl = 64
126 INTEGER,
PARAMETER,
PUBLIC :: file_amode_append = 128
134 CHARACTER(LEN=*),
PARAMETER,
PRIVATE :: modulen =
'message_passing'
137 INTEGER,
PRIVATE,
SAVE :: debug_comm_count
152 mpi_comm_type,
PRIVATE,
SAVE :: mimic_comm_world
157 mpi_comm_type :: handle = mp_comm_null_handle
161 INTEGER,
PUBLIC :: mepos = -1, source = -1, num_pe = -1
164 PROCEDURE, pass, non_overridable :: set_handle => mp_comm_type_set_handle
165 PROCEDURE, pass, non_overridable :: get_handle => mp_comm_type_get_handle
167 PROCEDURE,
PRIVATE, pass, non_overridable :: mp_comm_op_eq
168 PROCEDURE,
PRIVATE, pass, non_overridable :: mp_comm_op_neq
169 generic,
PUBLIC ::
operator(==) => mp_comm_op_eq
170 generic,
PUBLIC ::
operator(/=) => mp_comm_op_neq
172 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: &
173 mp_sendrecv_i, mp_sendrecv_l, mp_sendrecv_r, mp_sendrecv_d, &
174 mp_sendrecv_c, mp_sendrecv_z, &
175 mp_sendrecv_iv, mp_sendrecv_im2, mp_sendrecv_im3, mp_sendrecv_im4, &
176 mp_sendrecv_lv, mp_sendrecv_lm2, mp_sendrecv_lm3, mp_sendrecv_lm4, &
177 mp_sendrecv_rv, mp_sendrecv_rm2, mp_sendrecv_rm3, mp_sendrecv_rm4, &
178 mp_sendrecv_dv, mp_sendrecv_dm2, mp_sendrecv_dm3, mp_sendrecv_dm4, &
179 mp_sendrecv_cv, mp_sendrecv_cm2, mp_sendrecv_cm3, mp_sendrecv_cm4, &
180 mp_sendrecv_zv, mp_sendrecv_zm2, mp_sendrecv_zm3, mp_sendrecv_zm4
181 generic,
PUBLIC :: sendrecv => mp_sendrecv_i, mp_sendrecv_l, &
182 mp_sendrecv_r, mp_sendrecv_d, mp_sendrecv_c, mp_sendrecv_z, &
183 mp_sendrecv_iv, mp_sendrecv_im2, mp_sendrecv_im3, mp_sendrecv_im4, &
184 mp_sendrecv_lv, mp_sendrecv_lm2, mp_sendrecv_lm3, mp_sendrecv_lm4, &
185 mp_sendrecv_rv, mp_sendrecv_rm2, mp_sendrecv_rm3, mp_sendrecv_rm4, &
186 mp_sendrecv_dv, mp_sendrecv_dm2, mp_sendrecv_dm3, mp_sendrecv_dm4, &
187 mp_sendrecv_cv, mp_sendrecv_cm2, mp_sendrecv_cm3, mp_sendrecv_cm4, &
188 mp_sendrecv_zv, mp_sendrecv_zm2, mp_sendrecv_zm3, mp_sendrecv_zm4
190 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_minloc_iv, &
191 mp_minloc_lv, mp_minloc_rv, mp_minloc_dv
192 generic,
PUBLIC :: minloc => mp_minloc_iv, &
193 mp_minloc_lv, mp_minloc_rv, mp_minloc_dv
195 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_maxloc_iv, &
196 mp_maxloc_lv, mp_maxloc_rv, mp_maxloc_dv
197 generic,
PUBLIC :: maxloc => mp_maxloc_iv, &
198 mp_maxloc_lv, mp_maxloc_rv, mp_maxloc_dv
200 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_shift_im, mp_shift_i, &
201 mp_shift_lm, mp_shift_l, mp_shift_rm, mp_shift_r, &
202 mp_shift_dm, mp_shift_d, mp_shift_cm, mp_shift_c, &
203 mp_shift_zm, mp_shift_z
204 generic,
PUBLIC :: shift => mp_shift_im, mp_shift_i, &
205 mp_shift_lm, mp_shift_l, mp_shift_rm, mp_shift_r, &
206 mp_shift_dm, mp_shift_d, mp_shift_cm, mp_shift_c, &
207 mp_shift_zm, mp_shift_z
209 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_bcast_i, mp_bcast_iv, mp_bcast_im, mp_bcast_i3, &
210 mp_bcast_l, mp_bcast_lv, mp_bcast_lm, mp_bcast_l3, &
211 mp_bcast_r, mp_bcast_rv, mp_bcast_rm, mp_bcast_r3, &
212 mp_bcast_d, mp_bcast_dv, mp_bcast_dm, mp_bcast_d3, &
213 mp_bcast_c, mp_bcast_cv, mp_bcast_cm, mp_bcast_c3, &
214 mp_bcast_z, mp_bcast_zv, mp_bcast_zm, mp_bcast_z3, &
215 mp_bcast_b, mp_bcast_bv, mp_bcast_av, mp_bcast_am, &
216 mp_bcast_i_src, mp_bcast_iv_src, mp_bcast_im_src, mp_bcast_i3_src, &
217 mp_bcast_l_src, mp_bcast_lv_src, mp_bcast_lm_src, mp_bcast_l3_src, &
218 mp_bcast_r_src, mp_bcast_rv_src, mp_bcast_rm_src, mp_bcast_r3_src, &
219 mp_bcast_d_src, mp_bcast_dv_src, mp_bcast_dm_src, mp_bcast_d3_src, &
220 mp_bcast_c_src, mp_bcast_cv_src, mp_bcast_cm_src, mp_bcast_c3_src, &
221 mp_bcast_z_src, mp_bcast_zv_src, mp_bcast_zm_src, mp_bcast_z3_src, &
222 mp_bcast_b_src, mp_bcast_bv_src, mp_bcast_av_src, mp_bcast_am_src
223 generic,
PUBLIC :: bcast => mp_bcast_i, mp_bcast_iv, mp_bcast_im, mp_bcast_i3, &
224 mp_bcast_l, mp_bcast_lv, mp_bcast_lm, mp_bcast_l3, &
225 mp_bcast_r, mp_bcast_rv, mp_bcast_rm, mp_bcast_r3, &
226 mp_bcast_d, mp_bcast_dv, mp_bcast_dm, mp_bcast_d3, &
227 mp_bcast_c, mp_bcast_cv, mp_bcast_cm, mp_bcast_c3, &
228 mp_bcast_z, mp_bcast_zv, mp_bcast_zm, mp_bcast_z3, &
229 mp_bcast_b, mp_bcast_bv, mp_bcast_av, mp_bcast_am, &
230 mp_bcast_i_src, mp_bcast_iv_src, mp_bcast_im_src, mp_bcast_i3_src, &
231 mp_bcast_l_src, mp_bcast_lv_src, mp_bcast_lm_src, mp_bcast_l3_src, &
232 mp_bcast_r_src, mp_bcast_rv_src, mp_bcast_rm_src, mp_bcast_r3_src, &
233 mp_bcast_d_src, mp_bcast_dv_src, mp_bcast_dm_src, mp_bcast_d3_src, &
234 mp_bcast_c_src, mp_bcast_cv_src, mp_bcast_cm_src, mp_bcast_c3_src, &
235 mp_bcast_z_src, mp_bcast_zv_src, mp_bcast_zm_src, mp_bcast_z3_src, &
236 mp_bcast_b_src, mp_bcast_bv_src, mp_bcast_av_src, mp_bcast_am_src
238 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_ibcast_i, mp_ibcast_iv, &
239 mp_ibcast_l, mp_ibcast_lv, mp_ibcast_r, mp_ibcast_rv, &
240 mp_ibcast_d, mp_ibcast_dv, mp_ibcast_c, mp_ibcast_cv, &
241 mp_ibcast_z, mp_ibcast_zv
242 generic,
PUBLIC :: ibcast => mp_ibcast_i, mp_ibcast_iv, &
243 mp_ibcast_l, mp_ibcast_lv, mp_ibcast_r, mp_ibcast_rv, &
244 mp_ibcast_d, mp_ibcast_dv, mp_ibcast_c, mp_ibcast_cv, &
245 mp_ibcast_z, mp_ibcast_zv
247 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: &
248 mp_sum_i, mp_sum_iv, mp_sum_im, mp_sum_im3, mp_sum_im4, &
249 mp_sum_l, mp_sum_lv, mp_sum_lm, mp_sum_lm3, mp_sum_lm4, &
250 mp_sum_r, mp_sum_rv, mp_sum_rm, mp_sum_rm3, mp_sum_rm4, &
251 mp_sum_d, mp_sum_dv, mp_sum_dm, mp_sum_dm3, mp_sum_dm4, &
252 mp_sum_c, mp_sum_cv, mp_sum_cm, mp_sum_cm3, mp_sum_cm4, &
253 mp_sum_z, mp_sum_zv, mp_sum_zm, mp_sum_zm3, mp_sum_zm4, &
254 mp_sum_root_iv, mp_sum_root_im, mp_sum_root_lv, mp_sum_root_lm, &
255 mp_sum_root_rv, mp_sum_root_rm, mp_sum_root_dv, mp_sum_root_dm, &
256 mp_sum_root_cv, mp_sum_root_cm, mp_sum_root_zv, mp_sum_root_zm, &
258 generic,
PUBLIC :: sum => mp_sum_i, mp_sum_iv, mp_sum_im, mp_sum_im3, mp_sum_im4, &
259 mp_sum_l, mp_sum_lv, mp_sum_lm, mp_sum_lm3, mp_sum_lm4, &
260 mp_sum_r, mp_sum_rv, mp_sum_rm, mp_sum_rm3, mp_sum_rm4, &
261 mp_sum_d, mp_sum_dv, mp_sum_dm, mp_sum_dm3, mp_sum_dm4, &
262 mp_sum_c, mp_sum_cv, mp_sum_cm, mp_sum_cm3, mp_sum_cm4, &
263 mp_sum_z, mp_sum_zv, mp_sum_zm, mp_sum_zm3, mp_sum_zm4, &
264 mp_sum_root_iv, mp_sum_root_im, mp_sum_root_lv, mp_sum_root_lm, &
265 mp_sum_root_rv, mp_sum_root_rm, mp_sum_root_dv, mp_sum_root_dm, &
266 mp_sum_root_cv, mp_sum_root_cm, mp_sum_root_zv, mp_sum_root_zm, &
269 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_isum_iv, &
270 mp_isum_lv, mp_isum_rv, mp_isum_dv, mp_isum_cv, &
271 mp_isum_zv, mp_isum_bv
272 generic,
PUBLIC ::
isum => mp_isum_iv, &
273 mp_isum_lv, mp_isum_rv, mp_isum_dv, mp_isum_cv, &
274 mp_isum_zv, mp_isum_bv
276 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_sum_partial_im, &
277 mp_sum_partial_lm, mp_sum_partial_rm, mp_sum_partial_dm, &
278 mp_sum_partial_cm, mp_sum_partial_zm
279 generic,
PUBLIC :: sum_partial => mp_sum_partial_im, &
280 mp_sum_partial_lm, mp_sum_partial_rm, mp_sum_partial_dm, &
281 mp_sum_partial_cm, mp_sum_partial_zm
283 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_max_i, mp_max_iv, &
285 mp_max_l, mp_max_lv, mp_max_lm, &
286 mp_max_r, mp_max_rv, mp_max_rm, &
287 mp_max_d, mp_max_dv, mp_max_dm, &
288 mp_max_c, mp_max_cv, mp_max_cm, &
289 mp_max_z, mp_max_zv, mp_max_zm, &
290 mp_max_root_i, mp_max_root_l, &
291 mp_max_root_r, mp_max_root_d, mp_max_root_c, mp_max_root_z, &
292 mp_max_root_im, mp_max_root_lm, mp_max_root_rm, mp_max_root_dm, &
293 mp_max_root_cm, mp_max_root_zm
294 generic,
PUBLIC :: max => mp_max_i, mp_max_iv, &
296 mp_max_l, mp_max_lv, mp_max_lm, &
297 mp_max_r, mp_max_rv, mp_max_rm, &
298 mp_max_d, mp_max_dv, mp_max_dm, &
299 mp_max_c, mp_max_cv, mp_max_cm, &
300 mp_max_z, mp_max_zv, mp_max_zm, &
301 mp_max_root_i, mp_max_root_l, &
302 mp_max_root_r, mp_max_root_d, mp_max_root_c, mp_max_root_z, &
303 mp_max_root_im, mp_max_root_lm, mp_max_root_rm, mp_max_root_dm, &
304 mp_max_root_cm, mp_max_root_zm
306 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_min_i, mp_min_iv, &
308 mp_min_l, mp_min_lv, mp_min_lm, &
309 mp_min_r, mp_min_rv, mp_min_rm, &
310 mp_min_d, mp_min_dv, mp_min_dm, &
311 mp_min_c, mp_min_cv, mp_min_cm, &
312 mp_min_z, mp_min_zv, mp_min_zm
313 generic,
PUBLIC :: min => mp_min_i, mp_min_iv, &
315 mp_min_l, mp_min_lv, mp_min_lm, &
316 mp_min_r, mp_min_rv, mp_min_rm, &
317 mp_min_d, mp_min_dv, mp_min_dm, &
318 mp_min_c, mp_min_cv, mp_min_cm, &
319 mp_min_z, mp_min_zv, mp_min_zm
321 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: &
322 mp_sum_scatter_iv, mp_sum_scatter_lv, mp_sum_scatter_rv, &
323 mp_sum_scatter_dv, mp_sum_scatter_cv, mp_sum_scatter_zv
324 generic,
PUBLIC :: sum_scatter => &
325 mp_sum_scatter_iv, mp_sum_scatter_lv, mp_sum_scatter_rv, &
326 mp_sum_scatter_dv, mp_sum_scatter_cv, mp_sum_scatter_zv
328 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_prod_r, mp_prod_d, mp_prod_c, mp_prod_z
329 generic,
PUBLIC :: prod => mp_prod_r, mp_prod_d, mp_prod_c, mp_prod_z
331 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_gather_i, mp_gather_iv, mp_gather_im, &
332 mp_gather_l, mp_gather_lv, mp_gather_lm, &
333 mp_gather_r, mp_gather_rv, mp_gather_rm, &
334 mp_gather_d, mp_gather_dv, mp_gather_dm, &
335 mp_gather_c, mp_gather_cv, mp_gather_cm, &
336 mp_gather_z, mp_gather_zv, mp_gather_zm, &
337 mp_gather_i_src, mp_gather_iv_src, mp_gather_im_src, &
338 mp_gather_l_src, mp_gather_lv_src, mp_gather_lm_src, &
339 mp_gather_r_src, mp_gather_rv_src, mp_gather_rm_src, &
340 mp_gather_d_src, mp_gather_dv_src, mp_gather_dm_src, &
341 mp_gather_c_src, mp_gather_cv_src, mp_gather_cm_src, &
342 mp_gather_z_src, mp_gather_zv_src, mp_gather_zm_src
343 generic,
PUBLIC :: gather => mp_gather_i, mp_gather_iv, mp_gather_im, &
344 mp_gather_l, mp_gather_lv, mp_gather_lm, &
345 mp_gather_r, mp_gather_rv, mp_gather_rm, &
346 mp_gather_d, mp_gather_dv, mp_gather_dm, &
347 mp_gather_c, mp_gather_cv, mp_gather_cm, &
348 mp_gather_z, mp_gather_zv, mp_gather_zm, &
349 mp_gather_i_src, mp_gather_iv_src, mp_gather_im_src, &
350 mp_gather_l_src, mp_gather_lv_src, mp_gather_lm_src, &
351 mp_gather_r_src, mp_gather_rv_src, mp_gather_rm_src, &
352 mp_gather_d_src, mp_gather_dv_src, mp_gather_dm_src, &
353 mp_gather_c_src, mp_gather_cv_src, mp_gather_cm_src, &
354 mp_gather_z_src, mp_gather_zv_src, mp_gather_zm_src
356 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_gatherv_iv, &
357 mp_gatherv_lv, mp_gatherv_rv, mp_gatherv_dv, &
358 mp_gatherv_cv, mp_gatherv_zv, mp_gatherv_lm2, mp_gatherv_rm2, &
359 mp_gatherv_dm2, mp_gatherv_cm2, mp_gatherv_zm2, mp_gatherv_iv_src, &
360 mp_gatherv_lv_src, mp_gatherv_rv_src, mp_gatherv_dv_src, &
361 mp_gatherv_cv_src, mp_gatherv_zv_src, mp_gatherv_lm2_src, mp_gatherv_rm2_src, &
362 mp_gatherv_dm2_src, mp_gatherv_cm2_src, mp_gatherv_zm2_src
363 generic,
PUBLIC :: gatherv => mp_gatherv_iv, &
364 mp_gatherv_lv, mp_gatherv_rv, mp_gatherv_dv, &
365 mp_gatherv_cv, mp_gatherv_zv, mp_gatherv_lm2, mp_gatherv_rm2, &
366 mp_gatherv_dm2, mp_gatherv_cm2, mp_gatherv_zm2, mp_gatherv_iv_src, &
367 mp_gatherv_lv_src, mp_gatherv_rv_src, mp_gatherv_dv_src, &
368 mp_gatherv_cv_src, mp_gatherv_zv_src, mp_gatherv_lm2_src, mp_gatherv_rm2_src, &
369 mp_gatherv_dm2_src, mp_gatherv_cm2_src, mp_gatherv_zm2_src
371 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_igatherv_iv, &
372 mp_igatherv_lv, mp_igatherv_rv, mp_igatherv_dv, &
373 mp_igatherv_cv, mp_igatherv_zv
374 generic,
PUBLIC :: igatherv => mp_igatherv_iv, &
375 mp_igatherv_lv, mp_igatherv_rv, mp_igatherv_dv, &
376 mp_igatherv_cv, mp_igatherv_zv
378 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_allgather_i, mp_allgather_i2, &
379 mp_allgather_i12, mp_allgather_i23, mp_allgather_i34, &
380 mp_allgather_i22, mp_allgather_l, mp_allgather_l2, &
381 mp_allgather_l12, mp_allgather_l23, mp_allgather_l34, &
382 mp_allgather_l22, mp_allgather_r, mp_allgather_r2, &
383 mp_allgather_r12, mp_allgather_r23, mp_allgather_r34, &
384 mp_allgather_r22, mp_allgather_d, mp_allgather_d2, &
385 mp_allgather_d12, mp_allgather_d23, mp_allgather_d34, &
386 mp_allgather_d22, mp_allgather_c, mp_allgather_c2, &
387 mp_allgather_c12, mp_allgather_c23, mp_allgather_c34, &
388 mp_allgather_c22, mp_allgather_z, mp_allgather_z2, &
389 mp_allgather_z12, mp_allgather_z23, mp_allgather_z34, &
391 generic,
PUBLIC :: allgather => mp_allgather_i, mp_allgather_i2, &
392 mp_allgather_i12, mp_allgather_i23, mp_allgather_i34, &
393 mp_allgather_i22, mp_allgather_l, mp_allgather_l2, &
394 mp_allgather_l12, mp_allgather_l23, mp_allgather_l34, &
395 mp_allgather_l22, mp_allgather_r, mp_allgather_r2, &
396 mp_allgather_r12, mp_allgather_r23, mp_allgather_r34, &
397 mp_allgather_r22, mp_allgather_d, mp_allgather_d2, &
398 mp_allgather_d12, mp_allgather_d23, mp_allgather_d34, &
399 mp_allgather_d22, mp_allgather_c, mp_allgather_c2, &
400 mp_allgather_c12, mp_allgather_c23, mp_allgather_c34, &
401 mp_allgather_c22, mp_allgather_z, mp_allgather_z2, &
402 mp_allgather_z12, mp_allgather_z23, mp_allgather_z34, &
405 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_allgatherv_iv, mp_allgatherv_lv, &
406 mp_allgatherv_rv, mp_allgatherv_dv, mp_allgatherv_cv, mp_allgatherv_zv, &
407 mp_allgatherv_im2, mp_allgatherv_lm2, mp_allgatherv_rm2, &
408 mp_allgatherv_dm2, mp_allgatherv_cm2, mp_allgatherv_zm2
409 generic,
PUBLIC :: allgatherv => mp_allgatherv_iv, mp_allgatherv_lv, &
410 mp_allgatherv_rv, mp_allgatherv_dv, mp_allgatherv_cv, mp_allgatherv_zv, &
411 mp_allgatherv_im2, mp_allgatherv_lm2, mp_allgatherv_rm2, &
412 mp_allgatherv_dm2, mp_allgatherv_cm2, mp_allgatherv_zm2
414 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iallgather_i, mp_iallgather_l, &
415 mp_iallgather_r, mp_iallgather_d, mp_iallgather_c, mp_iallgather_z, &
416 mp_iallgather_i11, mp_iallgather_l11, mp_iallgather_r11, mp_iallgather_d11, &
417 mp_iallgather_c11, mp_iallgather_z11, mp_iallgather_i13, mp_iallgather_l13, &
418 mp_iallgather_r13, mp_iallgather_d13, mp_iallgather_c13, mp_iallgather_z13, &
419 mp_iallgather_i22, mp_iallgather_l22, mp_iallgather_r22, mp_iallgather_d22, &
420 mp_iallgather_c22, mp_iallgather_z22, mp_iallgather_i24, mp_iallgather_l24, &
421 mp_iallgather_r24, mp_iallgather_d24, mp_iallgather_c24, mp_iallgather_z24, &
422 mp_iallgather_i33, mp_iallgather_l33, mp_iallgather_r33, mp_iallgather_d33, &
423 mp_iallgather_c33, mp_iallgather_z33
424 generic,
PUBLIC :: iallgather => mp_iallgather_i, mp_iallgather_l, &
425 mp_iallgather_r, mp_iallgather_d, mp_iallgather_c, mp_iallgather_z, &
426 mp_iallgather_i11, mp_iallgather_l11, mp_iallgather_r11, mp_iallgather_d11, &
427 mp_iallgather_c11, mp_iallgather_z11, mp_iallgather_i13, mp_iallgather_l13, &
428 mp_iallgather_r13, mp_iallgather_d13, mp_iallgather_c13, mp_iallgather_z13, &
429 mp_iallgather_i22, mp_iallgather_l22, mp_iallgather_r22, mp_iallgather_d22, &
430 mp_iallgather_c22, mp_iallgather_z22, mp_iallgather_i24, mp_iallgather_l24, &
431 mp_iallgather_r24, mp_iallgather_d24, mp_iallgather_c24, mp_iallgather_z24, &
432 mp_iallgather_i33, mp_iallgather_l33, mp_iallgather_r33, mp_iallgather_d33, &
433 mp_iallgather_c33, mp_iallgather_z33
435 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iallgatherv_iv, mp_iallgatherv_iv2, &
436 mp_iallgatherv_lv, mp_iallgatherv_lv2, mp_iallgatherv_rv, mp_iallgatherv_rv2, &
437 mp_iallgatherv_dv, mp_iallgatherv_dv2, mp_iallgatherv_cv, mp_iallgatherv_cv2, &
438 mp_iallgatherv_zv, mp_iallgatherv_zv2
439 generic,
PUBLIC :: iallgatherv => mp_iallgatherv_iv, mp_iallgatherv_iv2, &
440 mp_iallgatherv_lv, mp_iallgatherv_lv2, mp_iallgatherv_rv, mp_iallgatherv_rv2, &
441 mp_iallgatherv_dv, mp_iallgatherv_dv2, mp_iallgatherv_cv, mp_iallgatherv_cv2, &
442 mp_iallgatherv_zv, mp_iallgatherv_zv2
444 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_scatter_iv, mp_scatter_lv, &
445 mp_scatter_rv, mp_scatter_dv, mp_scatter_cv, mp_scatter_zv
446 generic,
PUBLIC :: scatter => mp_scatter_iv, mp_scatter_lv, &
447 mp_scatter_rv, mp_scatter_dv, mp_scatter_cv, mp_scatter_zv
449 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iscatter_i, mp_iscatter_l, &
450 mp_iscatter_r, mp_iscatter_d, mp_iscatter_c, mp_iscatter_z, &
451 mp_iscatter_iv2, mp_iscatter_lv2, mp_iscatter_rv2, mp_iscatter_dv2, &
452 mp_iscatter_cv2, mp_iscatter_zv2
453 generic,
PUBLIC :: iscatter => mp_iscatter_i, mp_iscatter_l, &
454 mp_iscatter_r, mp_iscatter_d, mp_iscatter_c, mp_iscatter_z, &
455 mp_iscatter_iv2, mp_iscatter_lv2, mp_iscatter_rv2, mp_iscatter_dv2, &
456 mp_iscatter_cv2, mp_iscatter_zv2
458 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_iscatterv_iv, mp_iscatterv_lv, &
459 mp_iscatterv_rv, mp_iscatterv_dv, mp_iscatterv_cv, mp_iscatterv_zv
460 generic,
PUBLIC :: iscatterv => mp_iscatterv_iv, mp_iscatterv_lv, &
461 mp_iscatterv_rv, mp_iscatterv_dv, mp_iscatterv_cv, mp_iscatterv_zv
463 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_alltoall_i, mp_alltoall_i22, mp_alltoall_i33, &
464 mp_alltoall_i44, mp_alltoall_i55, mp_alltoall_i45, mp_alltoall_i34, &
465 mp_alltoall_i11v, mp_alltoall_i22v, mp_alltoall_i54, &
466 mp_alltoall_l, mp_alltoall_l22, mp_alltoall_l33, &
467 mp_alltoall_l44, mp_alltoall_l55, mp_alltoall_l45, mp_alltoall_l34, &
468 mp_alltoall_l11v, mp_alltoall_l22v, mp_alltoall_l54, &
469 mp_alltoall_r, mp_alltoall_r22, mp_alltoall_r33, &
470 mp_alltoall_r44, mp_alltoall_r55, mp_alltoall_r45, mp_alltoall_r34, &
471 mp_alltoall_r11v, mp_alltoall_r22v, mp_alltoall_r54, &
472 mp_alltoall_d, mp_alltoall_d22, mp_alltoall_d33, &
473 mp_alltoall_d44, mp_alltoall_d55, mp_alltoall_d45, mp_alltoall_d34, &
474 mp_alltoall_d11v, mp_alltoall_d22v, mp_alltoall_d54, &
475 mp_alltoall_c, mp_alltoall_c22, mp_alltoall_c33, &
476 mp_alltoall_c44, mp_alltoall_c55, mp_alltoall_c45, mp_alltoall_c34, &
477 mp_alltoall_c11v, mp_alltoall_c22v, mp_alltoall_c54, &
478 mp_alltoall_z, mp_alltoall_z22, mp_alltoall_z33, &
479 mp_alltoall_z44, mp_alltoall_z55, mp_alltoall_z45, mp_alltoall_z34, &
480 mp_alltoall_z11v, mp_alltoall_z22v, mp_alltoall_z54
481 generic,
PUBLIC :: alltoall => mp_alltoall_i, mp_alltoall_i22, mp_alltoall_i33, &
482 mp_alltoall_i44, mp_alltoall_i55, mp_alltoall_i45, mp_alltoall_i34, &
483 mp_alltoall_i11v, mp_alltoall_i22v, mp_alltoall_i54, &
484 mp_alltoall_l, mp_alltoall_l22, mp_alltoall_l33, &
485 mp_alltoall_l44, mp_alltoall_l55, mp_alltoall_l45, mp_alltoall_l34, &
486 mp_alltoall_l11v, mp_alltoall_l22v, mp_alltoall_l54, &
487 mp_alltoall_r, mp_alltoall_r22, mp_alltoall_r33, &
488 mp_alltoall_r44, mp_alltoall_r55, mp_alltoall_r45, mp_alltoall_r34, &
489 mp_alltoall_r11v, mp_alltoall_r22v, mp_alltoall_r54, &
490 mp_alltoall_d, mp_alltoall_d22, mp_alltoall_d33, &
491 mp_alltoall_d44, mp_alltoall_d55, mp_alltoall_d45, mp_alltoall_d34, &
492 mp_alltoall_d11v, mp_alltoall_d22v, mp_alltoall_d54, &
493 mp_alltoall_c, mp_alltoall_c22, mp_alltoall_c33, &
494 mp_alltoall_c44, mp_alltoall_c55, mp_alltoall_c45, mp_alltoall_c34, &
495 mp_alltoall_c11v, mp_alltoall_c22v, mp_alltoall_c54, &
496 mp_alltoall_z, mp_alltoall_z22, mp_alltoall_z33, &
497 mp_alltoall_z44, mp_alltoall_z55, mp_alltoall_z45, mp_alltoall_z34, &
498 mp_alltoall_z11v, mp_alltoall_z22v, mp_alltoall_z54
500 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_send_i, mp_send_iv, mp_send_im2, mp_send_im3, &
501 mp_send_l, mp_send_lv, mp_send_lm2, mp_send_lm3, &
502 mp_send_r, mp_send_rv, mp_send_rm2, mp_send_rm3, &
503 mp_send_d, mp_send_dv, mp_send_dm2, mp_send_dm3, &
504 mp_send_c, mp_send_cv, mp_send_cm2, mp_send_cm3, &
505 mp_send_z, mp_send_zv, mp_send_zm2, mp_send_zm3
506 generic,
PUBLIC :: send => mp_send_i, mp_send_iv, mp_send_im2, mp_send_im3, &
507 mp_send_l, mp_send_lv, mp_send_lm2, mp_send_lm3, &
508 mp_send_r, mp_send_rv, mp_send_rm2, mp_send_rm3, &
509 mp_send_d, mp_send_dv, mp_send_dm2, mp_send_dm3, &
510 mp_send_c, mp_send_cv, mp_send_cm2, mp_send_cm3, &
511 mp_send_z, mp_send_zv, mp_send_zm2, mp_send_zm3
513 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_recv_i, mp_recv_iv, mp_recv_im2, mp_recv_im3, &
514 mp_recv_l, mp_recv_lv, mp_recv_lm2, mp_recv_lm3, &
515 mp_recv_r, mp_recv_rv, mp_recv_rm2, mp_recv_rm3, &
516 mp_recv_d, mp_recv_dv, mp_recv_dm2, mp_recv_dm3, &
517 mp_recv_c, mp_recv_cv, mp_recv_cm2, mp_recv_cm3, &
518 mp_recv_z, mp_recv_zv, mp_recv_zm2, mp_recv_zm3
519 generic,
PUBLIC :: recv => mp_recv_i, mp_recv_iv, mp_recv_im2, mp_recv_im3, &
520 mp_recv_l, mp_recv_lv, mp_recv_lm2, mp_recv_lm3, &
521 mp_recv_r, mp_recv_rv, mp_recv_rm2, mp_recv_rm3, &
522 mp_recv_d, mp_recv_dv, mp_recv_dm2, mp_recv_dm3, &
523 mp_recv_c, mp_recv_cv, mp_recv_cm2, mp_recv_cm3, &
524 mp_recv_z, mp_recv_zv, mp_recv_zm2, mp_recv_zm3
526 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_isendrecv_i, mp_isendrecv_iv, &
527 mp_isendrecv_l, mp_isendrecv_lv, mp_isendrecv_r, mp_isendrecv_rv, &
528 mp_isendrecv_d, mp_isendrecv_dv, mp_isendrecv_c, mp_isendrecv_cv, &
529 mp_isendrecv_z, mp_isendrecv_zv
530 generic,
PUBLIC :: isendrecv => mp_isendrecv_i, mp_isendrecv_iv, &
531 mp_isendrecv_l, mp_isendrecv_lv, mp_isendrecv_r, mp_isendrecv_rv, &
532 mp_isendrecv_d, mp_isendrecv_dv, mp_isendrecv_c, mp_isendrecv_cv, &
533 mp_isendrecv_z, mp_isendrecv_zv
535 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_isend_iv, mp_isend_im2, mp_isend_im3, mp_isend_im4, &
536 mp_isend_lv, mp_isend_lm2, mp_isend_lm3, mp_isend_lm4, &
537 mp_isend_rv, mp_isend_rm2, mp_isend_rm3, mp_isend_rm4, &
538 mp_isend_dv, mp_isend_dm2, mp_isend_dm3, mp_isend_dm4, &
539 mp_isend_cv, mp_isend_cm2, mp_isend_cm3, mp_isend_cm4, &
540 mp_isend_zv, mp_isend_zm2, mp_isend_zm3, mp_isend_zm4, &
541 mp_isend_bv, mp_isend_bm3, mp_isend_custom
542 generic,
PUBLIC :: isend => mp_isend_iv, mp_isend_im2, mp_isend_im3, mp_isend_im4, &
543 mp_isend_lv, mp_isend_lm2, mp_isend_lm3, mp_isend_lm4, &
544 mp_isend_rv, mp_isend_rm2, mp_isend_rm3, mp_isend_rm4, &
545 mp_isend_dv, mp_isend_dm2, mp_isend_dm3, mp_isend_dm4, &
546 mp_isend_cv, mp_isend_cm2, mp_isend_cm3, mp_isend_cm4, &
547 mp_isend_zv, mp_isend_zm2, mp_isend_zm3, mp_isend_zm4, &
548 mp_isend_bv, mp_isend_bm3, mp_isend_custom
550 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_irecv_iv, mp_irecv_im2, mp_irecv_im3, mp_irecv_im4, &
551 mp_irecv_lv, mp_irecv_lm2, mp_irecv_lm3, mp_irecv_lm4, &
552 mp_irecv_rv, mp_irecv_rm2, mp_irecv_rm3, mp_irecv_rm4, &
553 mp_irecv_dv, mp_irecv_dm2, mp_irecv_dm3, mp_irecv_dm4, &
554 mp_irecv_cv, mp_irecv_cm2, mp_irecv_cm3, mp_irecv_cm4, &
555 mp_irecv_zv, mp_irecv_zm2, mp_irecv_zm3, mp_irecv_zm4, &
556 mp_irecv_bv, mp_irecv_bm3, mp_irecv_custom
557 generic,
PUBLIC :: irecv => mp_irecv_iv, mp_irecv_im2, mp_irecv_im3, mp_irecv_im4, &
558 mp_irecv_lv, mp_irecv_lm2, mp_irecv_lm3, mp_irecv_lm4, &
559 mp_irecv_rv, mp_irecv_rm2, mp_irecv_rm3, mp_irecv_rm4, &
560 mp_irecv_dv, mp_irecv_dm2, mp_irecv_dm3, mp_irecv_dm4, &
561 mp_irecv_cv, mp_irecv_cm2, mp_irecv_cm3, mp_irecv_cm4, &
562 mp_irecv_zv, mp_irecv_zm2, mp_irecv_zm3, mp_irecv_zm4, &
563 mp_irecv_bv, mp_irecv_bm3, mp_irecv_custom
565 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: probe => mp_probe
567 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: sync => mp_sync
568 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: isync => mp_isync
570 PROCEDURE,
PUBLIC, pass(comm1), non_overridable :: compare => mp_comm_compare
571 PROCEDURE,
PUBLIC, pass(comm1), non_overridable :: rank_compare => mp_rank_compare
573 PROCEDURE,
PUBLIC, pass(comm2), non_overridable :: from_dup => mp_comm_dup
574 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: mp_comm_free
575 generic,
PUBLIC :: free => mp_comm_free
577 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: mp_comm_init
578 generic,
PUBLIC :: init => mp_comm_init
580 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: get_size => mp_comm_size
581 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: get_rank => mp_comm_rank
582 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: get_ndims => mp_comm_get_ndims
583 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: is_source => mp_comm_is_source
586 PROCEDURE,
PRIVATE, pass(sub_comm), non_overridable :: mp_comm_split, mp_comm_split_direct
587 generic,
PUBLIC :: from_split => mp_comm_split, mp_comm_split_direct
588 PROCEDURE,
PUBLIC, pass(mp_new_comm), non_overridable :: from_reordering => mp_reordering
589 PROCEDURE,
PUBLIC, pass(comm_new), non_overridable :: mp_comm_assign
590 generic,
PUBLIC ::
ASSIGNMENT(=) => mp_comm_assign
593 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_tag_ub
594 generic,
PUBLIC :: get_tag_ub => mp_comm_get_tag_ub
595 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_host_rank
596 generic,
PUBLIC :: get_host_rank => mp_comm_get_host_rank
597 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_io_rank
598 generic,
PUBLIC :: get_io_rank => mp_comm_get_io_rank
599 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: mp_comm_get_wtime_is_global
600 generic,
PUBLIC :: get_wtime_is_global => mp_comm_get_wtime_is_global
605 mpi_request_type :: handle = mp_request_null_handle
607 PROCEDURE,
PUBLIC, non_overridable :: set_handle => mp_request_type_set_handle
608 PROCEDURE,
PUBLIC, non_overridable :: get_handle => mp_request_type_get_handle
609 PROCEDURE,
PRIVATE, non_overridable :: mp_request_op_eq
610 PROCEDURE,
PRIVATE, non_overridable :: mp_request_op_neq
611 generic,
PUBLIC ::
OPERATOR(==) => mp_request_op_eq
612 generic,
PUBLIC ::
OPERATOR(/=) => mp_request_op_neq
614 PROCEDURE,
PUBLIC, pass(request), non_overridable :: test => mp_test_1
616 PROCEDURE,
PUBLIC, pass(request), non_overridable :: wait => mp_wait
621 mpi_win_type :: handle = mp_win_null_handle
623 PROCEDURE,
PUBLIC, non_overridable :: set_handle => mp_win_type_set_handle
624 PROCEDURE,
PUBLIC, non_overridable :: get_handle => mp_win_type_get_handle
625 PROCEDURE,
PRIVATE, non_overridable :: mp_win_op_eq
626 PROCEDURE,
PRIVATE, non_overridable :: mp_win_op_neq
627 generic,
PUBLIC ::
OPERATOR(==) => mp_win_op_eq
628 generic,
PUBLIC ::
OPERATOR(/=) => mp_win_op_neq
630 PROCEDURE,
PRIVATE, pass(win), non_overridable :: mp_win_create_iv, mp_win_create_lv, &
631 mp_win_create_rv, mp_win_create_dv, mp_win_create_cv, mp_win_create_zv
632 generic,
PUBLIC :: create => mp_win_create_iv, mp_win_create_lv, &
633 mp_win_create_rv, mp_win_create_dv, mp_win_create_cv, mp_win_create_zv
635 PROCEDURE,
PRIVATE, pass(win), non_overridable :: mp_rget_iv, mp_rget_lv, &
636 mp_rget_rv, mp_rget_dv, mp_rget_cv, mp_rget_zv
637 generic,
PUBLIC :: rget => mp_rget_iv, mp_rget_lv, &
638 mp_rget_rv, mp_rget_dv, mp_rget_cv, mp_rget_zv
640 PROCEDURE,
PUBLIC, pass(win), non_overridable :: free => mp_win_free
641 PROCEDURE,
PUBLIC, pass(win_new), non_overridable :: mp_win_assign
642 generic,
PUBLIC ::
ASSIGNMENT(=) => mp_win_assign
644 PROCEDURE,
PUBLIC, pass(win), non_overridable :: lock_all => mp_win_lock_all
645 PROCEDURE,
PUBLIC, pass(win), non_overridable :: unlock_all => mp_win_unlock_all
646 PROCEDURE,
PUBLIC, pass(win), non_overridable :: flush_all => mp_win_flush_all
651 mpi_file_type :: handle = mp_file_null_handle
653 PROCEDURE,
PUBLIC, non_overridable :: set_handle => mp_file_type_set_handle
654 PROCEDURE,
PUBLIC, non_overridable :: get_handle => mp_file_type_get_handle
655 PROCEDURE,
PRIVATE, non_overridable :: mp_file_op_eq
656 PROCEDURE,
PRIVATE, non_overridable :: mp_file_op_neq
657 generic,
PUBLIC ::
OPERATOR(==) => mp_file_op_eq
658 generic,
PUBLIC ::
OPERATOR(/=) => mp_file_op_neq
660 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_write_at_ch, mp_file_write_at_chv, &
661 mp_file_write_at_i, mp_file_write_at_iv, mp_file_write_at_r, mp_file_write_at_rv, &
662 mp_file_write_at_d, mp_file_write_at_dv, mp_file_write_at_c, mp_file_write_at_cv, &
663 mp_file_write_at_z, mp_file_write_at_zv, mp_file_write_at_l, mp_file_write_at_lv
664 generic,
PUBLIC :: write_at => mp_file_write_at_ch, mp_file_write_at_chv, &
665 mp_file_write_at_i, mp_file_write_at_iv, mp_file_write_at_r, mp_file_write_at_rv, &
666 mp_file_write_at_d, mp_file_write_at_dv, mp_file_write_at_c, mp_file_write_at_cv, &
667 mp_file_write_at_z, mp_file_write_at_zv, mp_file_write_at_l, mp_file_write_at_lv
669 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_write_at_all_ch, mp_file_write_at_all_chv, &
670 mp_file_write_at_all_i, mp_file_write_at_all_iv, mp_file_write_at_all_l, mp_file_write_at_all_lv, &
671 mp_file_write_at_all_r, mp_file_write_at_all_rv, mp_file_write_at_all_d, mp_file_write_at_all_dv, &
672 mp_file_write_at_all_c, mp_file_write_at_all_cv, mp_file_write_at_all_z, mp_file_write_at_all_zv
673 generic,
PUBLIC :: write_at_all => mp_file_write_at_all_ch, mp_file_write_at_all_chv, &
674 mp_file_write_at_all_i, mp_file_write_at_all_iv, mp_file_write_at_all_l, mp_file_write_at_all_lv, &
675 mp_file_write_at_all_r, mp_file_write_at_all_rv, mp_file_write_at_all_d, mp_file_write_at_all_dv, &
676 mp_file_write_at_all_c, mp_file_write_at_all_cv, mp_file_write_at_all_z, mp_file_write_at_all_zv
678 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_read_at_ch, mp_file_read_at_chv, &
679 mp_file_read_at_i, mp_file_read_at_iv, mp_file_read_at_r, mp_file_read_at_rv, &
680 mp_file_read_at_d, mp_file_read_at_dv, mp_file_read_at_c, mp_file_read_at_cv, &
681 mp_file_read_at_z, mp_file_read_at_zv, mp_file_read_at_l, mp_file_read_at_lv
682 generic,
PUBLIC :: read_at => mp_file_read_at_ch, mp_file_read_at_chv, &
683 mp_file_read_at_i, mp_file_read_at_iv, mp_file_read_at_r, mp_file_read_at_rv, &
684 mp_file_read_at_d, mp_file_read_at_dv, mp_file_read_at_c, mp_file_read_at_cv, &
685 mp_file_read_at_z, mp_file_read_at_zv, mp_file_read_at_l, mp_file_read_at_lv
687 PROCEDURE,
PRIVATE, pass(fh), non_overridable :: mp_file_read_at_all_ch, mp_file_read_at_all_chv, &
688 mp_file_read_at_all_i, mp_file_read_at_all_iv, mp_file_read_at_all_l, mp_file_read_at_all_lv, &
689 mp_file_read_at_all_r, mp_file_read_at_all_rv, mp_file_read_at_all_d, mp_file_read_at_all_dv, &
690 mp_file_read_at_all_c, mp_file_read_at_all_cv, mp_file_read_at_all_z, mp_file_read_at_all_zv
691 generic,
PUBLIC :: read_at_all => mp_file_read_at_all_ch, mp_file_read_at_all_chv, &
692 mp_file_read_at_all_i, mp_file_read_at_all_iv, mp_file_read_at_all_l, mp_file_read_at_all_lv, &
693 mp_file_read_at_all_r, mp_file_read_at_all_rv, mp_file_read_at_all_d, mp_file_read_at_all_dv, &
694 mp_file_read_at_all_c, mp_file_read_at_all_cv, mp_file_read_at_all_z, mp_file_read_at_all_zv
696 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: open => mp_file_open
697 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: close => mp_file_close
698 PROCEDURE,
PRIVATE, pass(fh_new), non_overridable :: mp_file_assign
699 generic,
PUBLIC ::
ASSIGNMENT(=) => mp_file_assign
701 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: get_size => mp_file_get_size
702 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: get_position => mp_file_get_position
704 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: read_all => mp_file_read_all_chv
705 PROCEDURE,
PUBLIC, pass(fh), non_overridable :: write_all => mp_file_write_all_chv
710 mpi_info_type :: handle = mp_info_null_handle
712 PROCEDURE, NON_OVERRIDABLE :: set_handle => mp_info_type_set_handle
713 PROCEDURE, non_overridable :: get_handle => mp_info_type_get_handle
714 PROCEDURE,
PRIVATE, non_overridable :: mp_info_op_eq
715 PROCEDURE,
PRIVATE, non_overridable :: mp_info_op_neq
716 generic,
PUBLIC ::
OPERATOR(==) => mp_info_op_eq
717 generic,
PUBLIC ::
OPERATOR(/=) => mp_info_op_neq
721 INTEGER,
DIMENSION(:),
ALLOCATABLE,
PUBLIC :: mepos_cart, num_pe_cart
722 LOGICAL,
DIMENSION(:),
ALLOCATABLE,
PUBLIC :: periodic
724 PROCEDURE,
PUBLIC, pass(comm_cart), non_overridable :: create => mp_cart_create
725 PROCEDURE,
PUBLIC, pass(sub_comm), non_overridable :: from_sub => mp_cart_sub
727 PROCEDURE,
PRIVATE, pass(comm), non_overridable :: get_info_cart => mp_cart_get
729 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: coords => mp_cart_coords
730 PROCEDURE,
PUBLIC, pass(comm), non_overridable :: rank_cart => mp_cart_rank
746 LOGICAL :: owns_group = .true.
747 INTEGER :: ref_count = -1
749 PROCEDURE,
PUBLIC, pass(para_env), non_overridable :: retain => mp_para_env_retain
750 PROCEDURE,
PUBLIC, pass(para_env), non_overridable :: is_valid => mp_para_env_is_valid
783 LOGICAL :: owns_group = .true.
784 INTEGER :: ref_count = -1
786 PROCEDURE,
PUBLIC, pass(cart), non_overridable :: retain => mp_para_cart_retain
787 PROCEDURE,
PUBLIC, pass(cart), non_overridable :: is_valid => mp_para_cart_is_valid
799#if !defined(__parallel)
801 INTEGER,
PARAMETER,
PRIVATE :: mp_comm_default_handle = 1
818 PUBLIC :: cp2k_is_parallel
851 MODULE PROCEDURE mp_waitall_1, mp_waitall_2
855 MODULE PROCEDURE mp_testall_tv
859 MODULE PROCEDURE mp_testany_1, mp_testany_2
862 INTERFACE mp_type_free
863 MODULE PROCEDURE mp_type_free_m, mp_type_free_v
871 MODULE PROCEDURE mp_allocate_i, &
880 MODULE PROCEDURE mp_deallocate_i, &
889 MODULE PROCEDURE mp_type_make_struct
890 MODULE PROCEDURE mp_type_make_i, mp_type_make_l, &
891 mp_type_make_r, mp_type_make_d, &
892 mp_type_make_c, mp_type_make_z
895 INTERFACE mp_alloc_mem
896 MODULE PROCEDURE mp_alloc_mem_i, mp_alloc_mem_l, &
897 mp_alloc_mem_d, mp_alloc_mem_z, &
898 mp_alloc_mem_r, mp_alloc_mem_c
901 INTERFACE mp_free_mem
902 MODULE PROCEDURE mp_free_mem_i, mp_free_mem_l, &
903 mp_free_mem_d, mp_free_mem_z, &
904 mp_free_mem_r, mp_free_mem_c
908 TYPE mp_indexing_meta_type
909 INTEGER,
DIMENSION(:),
POINTER :: index => null(), chunks => null()
910 END TYPE mp_indexing_meta_type
913 mpi_data_type :: type_handle = mp_datatype_null_handle
914 INTEGER :: length = -1
915#if defined(__parallel)
916 INTEGER(kind=mpi_address_kind) :: base = -1
918 INTEGER(kind=int_4),
DIMENSION(:),
POINTER :: data_i => null()
919 INTEGER(kind=int_8),
DIMENSION(:),
POINTER :: data_l => null()
920 REAL(kind=
real_4),
DIMENSION(:),
POINTER :: data_r => null()
921 REAL(kind=
real_8),
DIMENSION(:),
POINTER :: data_d => null()
922 COMPLEX(kind=real_4),
DIMENSION(:),
POINTER :: data_c => null()
923 COMPLEX(kind=real_8),
DIMENSION(:),
POINTER :: data_z => null()
925 INTEGER :: vector_descriptor(2) = -1
926 LOGICAL :: has_indexing = .false.
927 TYPE(mp_indexing_meta_type) :: index_descriptor = mp_indexing_meta_type()
930 TYPE mp_file_indexing_meta_type
931 INTEGER,
DIMENSION(:),
POINTER :: index => null()
932 INTEGER(kind=file_offset), &
933 DIMENSION(:),
POINTER :: chunks => null()
934 END TYPE mp_file_indexing_meta_type
937 mpi_data_type :: type_handle = mp_datatype_null_handle
938 INTEGER :: length = -1
939 LOGICAL :: has_indexing = .false.
940 TYPE(mp_file_indexing_meta_type) :: index_descriptor = mp_file_indexing_meta_type()
944 INTEGER,
PARAMETER ::
intlen = bit_size(0)/8
945 INTEGER,
PARAMETER :: reallen = 8
946 INTEGER,
PARAMETER :: loglen = bit_size(0)/8
947 INTEGER,
PARAMETER :: charlen = 1
953 LOGICAL FUNCTION mp_comm_op_eq(comm1, comm2)
955#if defined(__parallel) && defined(__MPI_F08)
956 mp_comm_op_eq = (comm1%handle%mpi_val == comm2%handle%mpi_val)
958 mp_comm_op_eq = (comm1%handle == comm2%handle)
960 END FUNCTION mp_comm_op_eq
962 LOGICAL FUNCTION mp_comm_op_neq(comm1, comm2)
964#if defined(__parallel) && defined(__MPI_F08)
965 mp_comm_op_neq = (comm1%handle%mpi_val /= comm2%handle%mpi_val)
967 mp_comm_op_neq = (comm1%handle /= comm2%handle)
969 END FUNCTION mp_comm_op_neq
971 ELEMENTAL IMPURE SUBROUTINE mp_comm_type_set_handle(this, handle , ndims)
973 INTEGER,
INTENT(IN) :: handle
974 INTEGER,
INTENT(IN),
OPTIONAL :: ndims
976#if defined(__parallel) && defined(__MPI_F08)
977 this%handle%mpi_val = handle
984 IF (.NOT.
PRESENT(ndims)) &
985 CALL cp_abort(__location__, &
986 "Setup of a cartesian communicator requires information on the number of dimensions!")
988 IF (
PRESENT(ndims)) this%ndims = ndims
991 END SUBROUTINE mp_comm_type_set_handle
993 ELEMENTAL FUNCTION mp_comm_type_get_handle(this)
RESULT(handle)
997#if defined(__parallel) && defined(__MPI_F08)
998 handle = this%handle%mpi_val
1000 handle = this%handle
1002 END FUNCTION mp_comm_type_get_handle
1003 LOGICAL FUNCTION mp_request_op_eq(request1, request2)
1005#if defined(__parallel) && defined(__MPI_F08)
1006 mp_request_op_eq = (request1%handle%mpi_val == request2%handle%mpi_val)
1008 mp_request_op_eq = (request1%handle == request2%handle)
1010 END FUNCTION mp_request_op_eq
1012 LOGICAL FUNCTION mp_request_op_neq(request1, request2)
1014#if defined(__parallel) && defined(__MPI_F08)
1015 mp_request_op_neq = (request1%handle%mpi_val /= request2%handle%mpi_val)
1017 mp_request_op_neq = (request1%handle /= request2%handle)
1019 END FUNCTION mp_request_op_neq
1021 ELEMENTAL SUBROUTINE mp_request_type_set_handle(this, handle )
1023 INTEGER,
INTENT(IN) :: handle
1025#if defined(__parallel) && defined(__MPI_F08)
1026 this%handle%mpi_val = handle
1028 this%handle = handle
1032 END SUBROUTINE mp_request_type_set_handle
1034 ELEMENTAL FUNCTION mp_request_type_get_handle(this)
RESULT(handle)
1038#if defined(__parallel) && defined(__MPI_F08)
1039 handle = this%handle%mpi_val
1041 handle = this%handle
1043 END FUNCTION mp_request_type_get_handle
1044 LOGICAL FUNCTION mp_win_op_eq(win1, win2)
1046#if defined(__parallel) && defined(__MPI_F08)
1047 mp_win_op_eq = (win1%handle%mpi_val == win2%handle%mpi_val)
1049 mp_win_op_eq = (win1%handle == win2%handle)
1051 END FUNCTION mp_win_op_eq
1053 LOGICAL FUNCTION mp_win_op_neq(win1, win2)
1055#if defined(__parallel) && defined(__MPI_F08)
1056 mp_win_op_neq = (win1%handle%mpi_val /= win2%handle%mpi_val)
1058 mp_win_op_neq = (win1%handle /= win2%handle)
1060 END FUNCTION mp_win_op_neq
1062 ELEMENTAL SUBROUTINE mp_win_type_set_handle(this, handle )
1064 INTEGER,
INTENT(IN) :: handle
1066#if defined(__parallel) && defined(__MPI_F08)
1067 this%handle%mpi_val = handle
1069 this%handle = handle
1073 END SUBROUTINE mp_win_type_set_handle
1075 ELEMENTAL FUNCTION mp_win_type_get_handle(this)
RESULT(handle)
1079#if defined(__parallel) && defined(__MPI_F08)
1080 handle = this%handle%mpi_val
1082 handle = this%handle
1084 END FUNCTION mp_win_type_get_handle
1085 LOGICAL FUNCTION mp_file_op_eq(file1, file2)
1087#if defined(__parallel) && defined(__MPI_F08)
1088 mp_file_op_eq = (file1%handle%mpi_val == file2%handle%mpi_val)
1090 mp_file_op_eq = (file1%handle == file2%handle)
1092 END FUNCTION mp_file_op_eq
1094 LOGICAL FUNCTION mp_file_op_neq(file1, file2)
1096#if defined(__parallel) && defined(__MPI_F08)
1097 mp_file_op_neq = (file1%handle%mpi_val /= file2%handle%mpi_val)
1099 mp_file_op_neq = (file1%handle /= file2%handle)
1101 END FUNCTION mp_file_op_neq
1103 ELEMENTAL SUBROUTINE mp_file_type_set_handle(this, handle )
1105 INTEGER,
INTENT(IN) :: handle
1107#if defined(__parallel) && defined(__MPI_F08)
1108 this%handle%mpi_val = handle
1110 this%handle = handle
1114 END SUBROUTINE mp_file_type_set_handle
1116 ELEMENTAL FUNCTION mp_file_type_get_handle(this)
RESULT(handle)
1120#if defined(__parallel) && defined(__MPI_F08)
1121 handle = this%handle%mpi_val
1123 handle = this%handle
1125 END FUNCTION mp_file_type_get_handle
1126 LOGICAL FUNCTION mp_info_op_eq(info1, info2)
1128#if defined(__parallel) && defined(__MPI_F08)
1129 mp_info_op_eq = (info1%handle%mpi_val == info2%handle%mpi_val)
1131 mp_info_op_eq = (info1%handle == info2%handle)
1133 END FUNCTION mp_info_op_eq
1135 LOGICAL FUNCTION mp_info_op_neq(info1, info2)
1137#if defined(__parallel) && defined(__MPI_F08)
1138 mp_info_op_neq = (info1%handle%mpi_val /= info2%handle%mpi_val)
1140 mp_info_op_neq = (info1%handle /= info2%handle)
1142 END FUNCTION mp_info_op_neq
1144 ELEMENTAL SUBROUTINE mp_info_type_set_handle(this, handle )
1146 INTEGER,
INTENT(IN) :: handle
1148#if defined(__parallel) && defined(__MPI_F08)
1149 this%handle%mpi_val = handle
1151 this%handle = handle
1155 END SUBROUTINE mp_info_type_set_handle
1157 ELEMENTAL FUNCTION mp_info_type_get_handle(this)
RESULT(handle)
1161#if defined(__parallel) && defined(__MPI_F08)
1162 handle = this%handle%mpi_val
1164 handle = this%handle
1166 END FUNCTION mp_info_type_get_handle
1168 FUNCTION mp_comm_get_tag_ub(comm)
RESULT(tag_ub)
1172#if defined(__parallel)
1175 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1177 CALL mpi_comm_get_attr(comm%handle, mpi_tag_ub, attrval, flag, ierr)
1178 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_tag_ub")
1179 IF (.NOT. flag)
THEN
1180 CALL cp_warn(__location__,
"Upper bound of tags not available! "// &
1181 "Only the guaranteed minimum of 32767 is used.")
1184 tag_ub = int(attrval, kind=kind(tag_ub))
1190 END FUNCTION mp_comm_get_tag_ub
1192 FUNCTION mp_comm_get_host_rank(comm)
RESULT(host_rank)
1194 INTEGER :: host_rank
1196#if defined(__parallel)
1199 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1201 CALL mpi_comm_get_attr(comm%handle, mpi_host, attrval, flag, ierr)
1202 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_host_rank")
1203 IF (.NOT. flag) cpabort(
"Host process rank not available!")
1204 host_rank = int(attrval, kind=kind(host_rank))
1209 END FUNCTION mp_comm_get_host_rank
1211 FUNCTION mp_comm_get_io_rank(comm)
RESULT(io_rank)
1215#if defined(__parallel)
1218 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1220 CALL mpi_comm_get_attr(comm%handle, mpi_io, attrval, flag, ierr)
1221 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_io_rank")
1222 IF (.NOT. flag) cpabort(
"IO rank not available!")
1223 io_rank = int(attrval, kind=kind(io_rank))
1228 END FUNCTION mp_comm_get_io_rank
1230 FUNCTION mp_comm_get_wtime_is_global(comm)
RESULT(wtime_is_global)
1232 LOGICAL :: wtime_is_global
1234#if defined(__parallel)
1237 INTEGER(KIND=MPI_ADDRESS_KIND) :: attrval
1239 CALL mpi_comm_get_attr(comm%handle, mpi_tag_ub, attrval, flag, ierr)
1240 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_get_attr @ mp_comm_get_wtime_is_global")
1241 IF (.NOT. flag) cpabort(
"Synchronization state of WTIME not available!")
1242 wtime_is_global = (attrval == 1_mpi_address_kind)
1245 wtime_is_global = .true.
1247 END FUNCTION mp_comm_get_wtime_is_global
1259#if defined(__parallel)
1260 INTEGER :: ierr, provided_tsl
1262 INTEGER :: mimic_handle
1266#if defined(__DLAF) || defined(__OPENPMD)
1269 CALL mpi_init_thread(mpi_thread_multiple, provided_tsl, ierr)
1270 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_init_thread @ mp_world_init")
1271 IF (provided_tsl < mpi_thread_multiple)
THEN
1272 CALL mp_stop(0,
"MPI library does not support the requested level of threading (MPI_THREAD_MULTIPLE),"// &
1273 " required by DLA-Future/openPMD-api. Build CP2K without DLA-Future and openPMD-api.")
1276 CALL mpi_init_thread(mpi_thread_serialized, provided_tsl, ierr)
1277 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_init_thread @ mp_world_init")
1278 IF (provided_tsl < mpi_thread_serialized)
THEN
1279 CALL mp_stop(0,
"MPI library does not support the requested level of threading (MPI_THREAD_SERIALIZED).")
1283 CALL mpi_comm_set_errhandler(mpi_comm_world, mpi_errors_return, ierr)
1284 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_set_errhandler @ mp_world_init")
1286 debug_comm_count = 1
1289 mimic_handle = mp_comm%get_handle()
1290 CALL mcl_initialize(mimic_handle)
1291 CALL mp_comm%set_handle(mimic_handle)
1292#if defined(__MPI_F08)
1293 mimic_comm_world%mpi_val = mimic_handle
1295 mimic_comm_world = mimic_handle
1313 SUBROUTINE mp_reordering(mp_comm, mp_new_comm, ranks_order)
1316 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: ranks_order
1318 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_reordering'
1320 INTEGER :: handle, ierr
1321#if defined(__parallel)
1322 mpi_group_type :: newgroup, oldgroup
1325 CALL mp_timeset(routinen, handle)
1327#if defined(__parallel)
1329 CALL mpi_comm_group(mp_comm%handle, oldgroup, ierr)
1330 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_reordering")
1331 CALL mpi_group_incl(oldgroup,
SIZE(ranks_order), ranks_order, newgroup, ierr)
1332 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_incl @ mp_reordering")
1334 CALL mpi_comm_create(mp_comm%handle, newgroup, mp_new_comm%handle, ierr)
1335 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_create @ mp_reordering")
1337 CALL mpi_group_free(oldgroup, ierr)
1338 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_free @ mp_reordering")
1339 CALL mpi_group_free(newgroup, ierr)
1340 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_group_free @ mp_reordering")
1345 mark_used(ranks_order)
1346 mp_new_comm%handle = mp_comm_default_handle
1348 debug_comm_count = debug_comm_count + 1
1349 CALL mp_new_comm%init()
1350 CALL mp_timestop(handle)
1351 END SUBROUTINE mp_reordering
1360 CHARACTER(LEN=default_string_length) :: debug_comm_count_char
1361#if defined(__parallel)
1364 CALL mpi_barrier(mimic_comm_world, ierr)
1366 CALL mpi_barrier(mpi_comm_world, ierr)
1371 debug_comm_count = debug_comm_count - 1
1372#if defined(__parallel)
1373 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_barrier @ mp_world_finalize")
1375 IF (debug_comm_count /= 0)
THEN
1378 WRITE (unit=debug_comm_count_char, fmt=
'(I2)') debug_comm_count
1379 CALL cp_abort(__location__,
"mp_world_finalize: assert failed:"// &
1380 " leaking communicators "//adjustl(trim(debug_comm_count_char)))
1382#if defined(__parallel)
1383 CALL mpi_finalize(ierr)
1384 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_finalize @ mp_world_finalize")
1398 LOGICAL :: mcl_initialized
1403#if !defined(__NO_ABORT)
1404#if defined(__parallel)
1406 CALL mcl_is_initialized(mcl_initialized)
1407 IF (mcl_initialized)
CALL mcl_abort(1, ierr)
1409 CALL mpi_abort(mpi_comm_world, 1, ierr)
1425 SUBROUTINE mp_stop(ierr, prg_code)
1426 INTEGER,
INTENT(IN) :: ierr
1427 CHARACTER(LEN=*),
INTENT(IN) :: prg_code
1429#if defined(__parallel)
1430 INTEGER :: istat, len
1431 CHARACTER(LEN=MPI_MAX_ERROR_STRING) :: error_string
1432 CHARACTER(LEN=MPI_MAX_ERROR_STRING + 512) :: full_error
1434 CHARACTER(LEN=512) :: full_error
1437#if defined(__parallel)
1438 CALL mpi_error_string(ierr, error_string, len, istat)
1439 WRITE (full_error,
'(A,I0,A)')
' MPI error ', ierr,
' in '//trim(prg_code)//
' : '//error_string(1:len)
1441 WRITE (full_error,
'(A,I0,A)')
' MPI error (!?) ', ierr,
' in '//trim(prg_code)
1446 END SUBROUTINE mp_stop
1452 SUBROUTINE mp_sync(comm)
1455 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sync'
1457 INTEGER :: handle, ierr
1460 CALL mp_timeset(routinen, handle)
1462#if defined(__parallel)
1463 CALL mpi_barrier(comm%handle, ierr)
1464 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_barrier @ mp_sync")
1469 CALL mp_timestop(handle)
1471 END SUBROUTINE mp_sync
1478 SUBROUTINE mp_isync(comm, request)
1482 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isync'
1484 INTEGER :: handle, ierr
1487 CALL mp_timeset(routinen, handle)
1489#if defined(__parallel)
1490 CALL mpi_ibarrier(comm%handle, request%handle, ierr)
1491 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibarrier @ mp_isync")
1497 CALL mp_timestop(handle)
1499 END SUBROUTINE mp_isync
1506 SUBROUTINE mp_comm_rank(taskid, comm)
1508 INTEGER,
INTENT(OUT) :: taskid
1511 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_rank'
1514#if defined(__parallel)
1518 CALL mp_timeset(routinen, handle)
1520#if defined(__parallel)
1521 CALL mpi_comm_rank(comm%handle, taskid, ierr)
1522 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ mp_comm_rank")
1527 CALL mp_timestop(handle)
1529 END SUBROUTINE mp_comm_rank
1536 SUBROUTINE mp_comm_size(numtask, comm)
1538 INTEGER,
INTENT(OUT) :: numtask
1541 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_size'
1544#if defined(__parallel)
1548 CALL mp_timeset(routinen, handle)
1550#if defined(__parallel)
1551 CALL mpi_comm_size(comm%handle, numtask, ierr)
1552 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ mp_comm_size")
1557 CALL mp_timestop(handle)
1559 END SUBROUTINE mp_comm_size
1569 SUBROUTINE mp_cart_get(comm, dims, task_coor, periods)
1572 INTEGER,
INTENT(OUT),
OPTIONAL :: dims(comm%ndims), task_coor(comm%ndims)
1573 LOGICAL,
INTENT(out),
OPTIONAL :: periods(comm%ndims)
1575 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_get'
1578#if defined(__parallel)
1580 INTEGER :: my_dims(comm%ndims), my_task_coor(comm%ndims)
1581 LOGICAL :: my_periods(comm%ndims)
1584 CALL mp_timeset(routinen, handle)
1586#if defined(__parallel)
1587 CALL mpi_cart_get(comm%handle, comm%ndims, my_dims, my_periods, my_task_coor, ierr)
1588 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_get @ mp_cart_get")
1589 IF (
PRESENT(dims)) dims = my_dims
1590 IF (
PRESENT(task_coor)) task_coor = my_task_coor
1591 IF (
PRESENT(periods)) periods = my_periods
1594 IF (
PRESENT(task_coor)) task_coor = 0
1595 IF (
PRESENT(dims)) dims = 1
1596 IF (
PRESENT(periods)) periods = .false.
1598 CALL mp_timestop(handle)
1600 END SUBROUTINE mp_cart_get
1602 INTEGER ELEMENTAL function mp_comm_get_ndims(comm)
1605 mp_comm_get_ndims = comm%ndims
1617 SUBROUTINE mp_cart_create(comm_old, ndims, dims, comm_cart)
1620 INTEGER,
INTENT(IN) :: ndims
1621 INTEGER,
INTENT(INOUT) :: dims(ndims)
1624 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_create'
1626 INTEGER :: handle, ierr
1627#if defined(__parallel)
1628 LOGICAL,
DIMENSION(1:ndims) :: period
1633 CALL mp_timeset(routinen, handle)
1635 comm_cart%handle = comm_old%handle
1636#if defined(__parallel)
1638 IF (any(dims == 0))
CALL mpi_dims_create(comm_old%num_pe, ndims, dims, ierr)
1639 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_dims_create @ mp_cart_create")
1646 CALL mpi_cart_create(comm_old%handle, ndims, dims, period, reorder, comm_cart%handle, &
1648 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_create @ mp_cart_create")
1649 CALL add_perf(perf_id=1, count=1)
1652 comm_cart%handle = mp_comm_default_handle
1654 comm_cart%ndims = ndims
1655 debug_comm_count = debug_comm_count + 1
1656 CALL comm_cart%init()
1657 CALL mp_timestop(handle)
1659 END SUBROUTINE mp_cart_create
1667 SUBROUTINE mp_cart_coords(comm, rank, coords)
1670 INTEGER,
INTENT(IN) :: rank
1671 INTEGER,
DIMENSION(:),
INTENT(OUT) :: coords
1673 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_coords'
1675 INTEGER :: handle, ierr, m
1678 CALL mp_timeset(routinen, handle)
1681#if defined(__parallel)
1682 CALL mpi_cart_coords(comm%handle, rank, m, coords, ierr)
1683 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_coords @ mp_cart_coords")
1689 CALL mp_timestop(handle)
1691 END SUBROUTINE mp_cart_coords
1699 FUNCTION mp_comm_compare(comm1, comm2)
RESULT(res)
1704 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_compare'
1707#if defined(__parallel)
1708 INTEGER :: ierr, iout
1711 CALL mp_timeset(routinen, handle)
1714#if defined(__parallel)
1715 CALL mpi_comm_compare(comm1%handle, comm2%handle, iout, ierr)
1716 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_compare @ mp_comm_compare")
1720 CASE (mpi_congruent)
1727 cpabort(
"Unknown comparison state of the communicators!")
1733 CALL mp_timestop(handle)
1735 END FUNCTION mp_comm_compare
1743 SUBROUTINE mp_cart_sub(comm, rdim, sub_comm)
1746 LOGICAL,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: rdim
1749 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_sub'
1752#if defined(__parallel)
1756 CALL mp_timeset(routinen, handle)
1758#if defined(__parallel)
1759 CALL mpi_cart_sub(comm%handle, rdim, sub_comm%handle, ierr)
1760 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_sub @ mp_cart_sub")
1764 sub_comm%handle = mp_comm_default_handle
1766 sub_comm%ndims = count(rdim)
1767 debug_comm_count = debug_comm_count + 1
1768 CALL sub_comm%init()
1769 CALL mp_timestop(handle)
1771 END SUBROUTINE mp_cart_sub
1777 SUBROUTINE mp_comm_free(comm)
1781 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_free'
1784 LOGICAL :: free_comm
1785#if defined(__parallel)
1793 IF (comm%ref_count <= 0) &
1794 cpabort(
"para_env%ref_count <= 0")
1795 comm%ref_count = comm%ref_count - 1
1796 IF (comm%ref_count <= 0)
THEN
1797 free_comm = comm%owns_group
1801 IF (comm%ref_count <= 0) &
1802 cpabort(
"para_cart%ref_count <= 0")
1803 comm%ref_count = comm%ref_count - 1
1804 IF (comm%ref_count <= 0)
THEN
1805 free_comm = comm%owns_group
1809 CALL mp_timeset(routinen, handle)
1812#if defined(__parallel)
1813 CALL mpi_comm_free(comm%handle, ierr)
1814 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_free @ mp_comm_free")
1816 comm%handle = mp_comm_null_handle
1818 debug_comm_count = debug_comm_count - 1
1823 DEALLOCATE (comm%periodic, comm%mepos_cart, comm%num_pe_cart)
1826 CALL mp_timestop(handle)
1828 END SUBROUTINE mp_comm_free
1835 ELEMENTAL LOGICAL FUNCTION mp_para_env_is_valid(para_env)
1838 mp_para_env_is_valid = para_env%ref_count > 0
1840 END FUNCTION mp_para_env_is_valid
1846 ELEMENTAL SUBROUTINE mp_para_env_retain(para_env)
1849 para_env%ref_count = para_env%ref_count + 1
1851 END SUBROUTINE mp_para_env_retain
1858 ELEMENTAL LOGICAL FUNCTION mp_para_cart_is_valid(cart)
1861 mp_para_cart_is_valid = cart%ref_count > 0
1863 END FUNCTION mp_para_cart_is_valid
1869 ELEMENTAL SUBROUTINE mp_para_cart_retain(cart)
1872 cart%ref_count = cart%ref_count + 1
1874 END SUBROUTINE mp_para_cart_retain
1881 SUBROUTINE mp_comm_dup(comm1, comm2)
1886 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_comm_dup'
1889#if defined(__parallel)
1893 CALL mp_timeset(routinen, handle)
1895#if defined(__parallel)
1896 CALL mpi_comm_dup(comm1%handle, comm2%handle, ierr)
1897 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_dup @ mp_comm_dup")
1900 comm2%handle = mp_comm_default_handle
1902 comm2%ndims = comm1%ndims
1903 debug_comm_count = debug_comm_count + 1
1905 CALL mp_timestop(handle)
1907 END SUBROUTINE mp_comm_dup
1914 ELEMENTAL IMPURE SUBROUTINE mp_comm_assign(comm_new, comm_old)
1918 comm_new%handle = comm_old%handle
1919 comm_new%ndims = comm_old%ndims
1920 CALL comm_new%init(.false.)
1928 ELEMENTAL LOGICAL FUNCTION mp_comm_is_source(comm)
1931 mp_comm_is_source = comm%source == comm%mepos
1933 END FUNCTION mp_comm_is_source
1939 ELEMENTAL IMPURE SUBROUTINE mp_comm_init(comm, owns_group)
1941 LOGICAL,
INTENT(IN),
OPTIONAL :: owns_group
1943 IF (comm%handle mpi_get_comp /= mp_comm_null_handle mpi_get_comp)
THEN
1945 CALL comm%get_size(comm%num_pe)
1946 CALL comm%get_rank(comm%mepos)
1951 IF (
ALLOCATED(comm%periodic))
DEALLOCATE (comm%periodic)
1952 IF (
ALLOCATED(comm%mepos_cart))
DEALLOCATE (comm%mepos_cart)
1953 IF (
ALLOCATED(comm%num_pe_cart))
DEALLOCATE (comm%num_pe_cart)
1955 associate(ndims => comm%ndims)
1957 ALLOCATE (comm%periodic(ndims), comm%mepos_cart(ndims), &
1958 comm%num_pe_cart(ndims))
1962 comm%periodic = .false.
1963 IF (comm%handle mpi_get_comp /= mp_comm_null_handle mpi_get_comp)
THEN
1964 CALL comm%get_info_cart(comm%num_pe_cart, comm%mepos_cart, &
1971 IF (
PRESENT(owns_group)) comm%owns_group = owns_group
1974 IF (
PRESENT(owns_group)) comm%owns_group = owns_group
1992 IF (
ASSOCIATED(para_env)) &
1993 cpabort(
"The passed para_env must not be associated!")
1995 para_env%mp_comm_type = group
1996 CALL para_env%init()
2013 IF (
ASSOCIATED(para_env))
THEN
2014 CALL para_env%free()
2015 IF (.NOT. para_env%is_valid())
DEALLOCATE (para_env)
2030 IF (
ASSOCIATED(cart)) &
2031 cpabort(
"The passed para_cart must not be associated!")
2033 cart%mp_cart_type = group
2046 IF (
ASSOCIATED(cart))
THEN
2048 IF (.NOT. cart%is_valid())
DEALLOCATE (cart)
2059 SUBROUTINE mp_rank_compare(comm1, comm2, rank)
2062 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rank
2064 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rank_compare'
2067#if defined(__parallel)
2068 INTEGER :: i, ierr, n, n1, n2
2069 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: rin
2070 mpi_group_type :: g1, g2
2073 CALL mp_timeset(routinen, handle)
2076#if defined(__parallel)
2077 CALL mpi_comm_size(comm1%handle, n1, ierr)
2078 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ mp_rank_compare")
2079 CALL mpi_comm_size(comm2%handle, n2, ierr)
2080 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ mp_rank_compare")
2082 CALL mpi_comm_group(comm1%handle, g1, ierr)
2083 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_rank_compare")
2084 CALL mpi_comm_group(comm2%handle, g2, ierr)
2085 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_group @ mp_rank_compare")
2086 ALLOCATE (rin(0:n - 1), stat=ierr)
2088 cpabort(
"allocate @ mp_rank_compare")
2092 CALL mpi_group_translate_ranks(g1, n, rin, g2, rank, ierr)
2093 IF (ierr /= 0)
CALL mp_stop(ierr, &
2094 "mpi_group_translate_rank @ mp_rank_compare")
2095 CALL mpi_group_free(g1, ierr)
2097 cpabort(
"group_free @ mp_rank_compare")
2098 CALL mpi_group_free(g2, ierr)
2100 cpabort(
"group_free @ mp_rank_compare")
2106 CALL mp_timestop(handle)
2108 END SUBROUTINE mp_rank_compare
2117 INTEGER,
INTENT(IN) :: nodes
2118 INTEGER,
DIMENSION(:),
INTENT(INOUT) :: dims
2120 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_dims_create'
2122 INTEGER :: handle, ndim
2123#if defined(__parallel)
2127 CALL mp_timeset(routinen, handle)
2130#if defined(__parallel)
2131 IF (any(dims == 0))
CALL mpi_dims_create(nodes, ndim, dims, ierr)
2132 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_dims_create @ mp_dims_create")
2137 CALL mp_timestop(handle)
2147 SUBROUTINE mp_cart_rank(comm, pos, rank)
2149 INTEGER,
DIMENSION(:),
INTENT(IN) :: pos
2150 INTEGER,
INTENT(OUT) :: rank
2152 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_cart_rank'
2155#if defined(__parallel)
2159 CALL mp_timeset(routinen, handle)
2161#if defined(__parallel)
2162 CALL mpi_cart_rank(comm%handle, pos, rank, ierr)
2163 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_cart_rank @ mp_cart_rank")
2169 CALL mp_timestop(handle)
2171 END SUBROUTINE mp_cart_rank
2182 SUBROUTINE mp_wait(request)
2185 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_wait'
2188#if defined(__parallel)
2192 CALL mp_timeset(routinen, handle)
2194#if defined(__parallel)
2196 CALL mpi_wait(request%handle, mpi_status_ignore, ierr)
2197 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_wait @ mp_wait")
2199 CALL add_perf(perf_id=9, count=1)
2201 request%handle = mp_request_null_handle
2203 CALL mp_timestop(handle)
2204 END SUBROUTINE mp_wait
2215 SUBROUTINE mp_waitall_1(requests)
2218 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_waitall_1'
2221#if defined(__parallel)
2222 INTEGER :: count, ierr
2225 CALL mp_timeset(routinen, handle)
2226#if defined(__parallel)
2227 count =
SIZE(requests)
2228 CALL mpi_waitall_internal(count, requests, ierr)
2229 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitall @ mp_waitall_1")
2230 CALL add_perf(perf_id=9, count=1)
2234 CALL mp_timestop(handle)
2235 END SUBROUTINE mp_waitall_1
2244 SUBROUTINE mp_waitall_2(requests)
2247 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_waitall_2'
2250#if defined(__parallel)
2251 INTEGER :: count, ierr
2254 CALL mp_timeset(routinen, handle)
2255#if defined(__parallel)
2256 count =
SIZE(requests)
2257 CALL mpi_waitall_internal(count, requests, ierr)
2258 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitall @ mp_waitall_2")
2259 CALL add_perf(perf_id=9, count=1)
2263 CALL mp_timestop(handle)
2264 END SUBROUTINE mp_waitall_2
2274#if defined(__parallel)
2275 SUBROUTINE mpi_waitall_internal(count, array_of_requests, ierr)
2276 INTEGER,
INTENT(in) :: count
2277 TYPE(
mp_request_type),
DIMENSION(count),
INTENT(inout) :: array_of_requests
2278 INTEGER,
INTENT(out) :: ierr
2280 mpi_request_type,
ALLOCATABLE,
DIMENSION(:),
TARGET :: request_handles
2282 ALLOCATE (request_handles(count), source=array_of_requests(1:count)%handle)
2283 CALL mpi_waitall(count, request_handles, mpi_statuses_ignore, ierr)
2284 array_of_requests(1:count)%handle = request_handles(:)
2285 DEALLOCATE (request_handles)
2287 END SUBROUTINE mpi_waitall_internal
2300 INTEGER,
INTENT(out) :: completed
2302 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_waitany'
2305#if defined(__parallel)
2306 INTEGER :: count, ierr
2307 mpi_request_type,
ALLOCATABLE,
DIMENSION(:) :: request_handles
2310 CALL mp_timeset(routinen, handle)
2312#if defined(__parallel)
2313 count =
SIZE(requests)
2315 ALLOCATE (request_handles(count), source=requests(1:count)%handle)
2317 CALL mpi_waitany(count, request_handles, completed, mpi_status_ignore, ierr)
2318 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_waitany @ mp_waitany")
2321 requests(1:count)%handle = request_handles(:)
2322 DEALLOCATE (request_handles)
2323 CALL add_perf(perf_id=9, count=1)
2328 CALL mp_timestop(handle)
2340 FUNCTION mp_testall_tv(requests)
RESULT(flag)
2344#if defined(__parallel)
2346 LOGICAL,
DIMENSION(:),
POINTER :: flags
2351#if defined(__parallel)
2352 ALLOCATE (flags(
SIZE(requests)))
2353 DO i = 1,
SIZE(requests)
2354 CALL mpi_test(requests(i)%handle, flags(i), mpi_status_ignore, ierr)
2355 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testall @ mp_testall_tv")
2356 flag = flag .AND. flags(i)
2362 END FUNCTION mp_testall_tv
2372 FUNCTION mp_test_1(request)
RESULT(flag)
2376#if defined(__parallel)
2379 CALL mpi_test(request%handle, flag, mpi_status_ignore, ierr)
2380 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_test @ mp_test_1")
2385 END FUNCTION mp_test_1
2396 SUBROUTINE mp_testany_1(requests, completed, flag)
2398 INTEGER,
INTENT(out),
OPTIONAL :: completed
2399 LOGICAL,
INTENT(out),
OPTIONAL :: flag
2401#if defined(__parallel)
2402 INTEGER :: completed_l, count, ierr
2405 count =
SIZE(requests)
2407 CALL mpi_testany_internal(count, requests, completed_l, flag_l, mpi_status_ignore, ierr)
2408 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testany_1 @ mp_testany")
2410 IF (
PRESENT(completed)) completed = completed_l
2411 IF (
PRESENT(flag)) flag = flag_l
2414 IF (
PRESENT(completed)) completed = 1
2415 IF (
PRESENT(flag)) flag = .true.
2417 END SUBROUTINE mp_testany_1
2428 SUBROUTINE mp_testany_2(requests, completed, flag)
2430 INTEGER,
INTENT(out),
OPTIONAL :: completed
2431 LOGICAL,
INTENT(out),
OPTIONAL :: flag
2433#if defined(__parallel)
2434 INTEGER :: completed_l, count, ierr
2437 count =
SIZE(requests)
2439 CALL mpi_testany_internal(count, requests, completed_l, flag_l, mpi_status_ignore, ierr)
2440 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_testany_2 @ mp_testany")
2442 IF (
PRESENT(completed)) completed = completed_l
2443 IF (
PRESENT(flag)) flag = flag_l
2446 IF (
PRESENT(completed)) completed = 1
2447 IF (
PRESENT(flag)) flag = .true.
2449 END SUBROUTINE mp_testany_2
2462#if defined(__parallel)
2463 SUBROUTINE mpi_testany_internal(count, array_of_requests, index, flag, status, ierr)
2464 INTEGER,
INTENT(in) :: count
2465 TYPE(
mp_request_type),
DIMENSION(count),
INTENT(inout) :: array_of_requests
2466 INTEGER,
INTENT(out) :: index
2467 LOGICAL,
INTENT(out) :: flag
2468 mpi_status_type,
INTENT(out) :: status
2469 INTEGER,
INTENT(out) :: ierr
2471 mpi_request_type,
ALLOCATABLE,
DIMENSION(:) :: request_handles
2473 ALLOCATE (request_handles(count), source=array_of_requests(1:count)%handle)
2474 CALL mpi_testany(count, request_handles, index, flag, status, ierr)
2475 array_of_requests(1:count)%handle = request_handles(:)
2476 DEALLOCATE (request_handles)
2478 END SUBROUTINE mpi_testany_internal
2490 SUBROUTINE mp_comm_split_direct(comm, sub_comm, color, key)
2493 INTEGER,
INTENT(in) :: color
2494 INTEGER,
INTENT(in),
OPTIONAL :: key
2496 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_comm_split_direct'
2499#if defined(__parallel)
2500 INTEGER :: ierr, my_key
2503 CALL mp_timeset(routinen, handle)
2505#if defined(__parallel)
2507 IF (
PRESENT(key)) my_key = key
2508 CALL mpi_comm_split(comm%handle, color, my_key, sub_comm%handle, ierr)
2509 IF (ierr /= mpi_success)
CALL mp_stop(ierr, routinen)
2510 CALL add_perf(perf_id=10, count=1)
2512 sub_comm%handle = mp_comm_default_handle
2517 debug_comm_count = debug_comm_count + 1
2518 CALL sub_comm%init()
2519 CALL mp_timestop(handle)
2521 END SUBROUTINE mp_comm_split_direct
2545 SUBROUTINE mp_comm_split(comm, sub_comm, ngroups, group_distribution, &
2546 subgroup_min_size, n_subgroups, group_partition, stride)
2549 INTEGER,
INTENT(out) :: ngroups
2550 INTEGER,
DIMENSION(0:),
INTENT(INOUT) :: group_distribution
2551 INTEGER,
INTENT(in),
OPTIONAL :: subgroup_min_size, &
2553 INTEGER,
DIMENSION(0:),
INTENT(IN),
OPTIONAL :: group_partition
2554 INTEGER,
OPTIONAL,
INTENT(IN) :: stride
2556 CHARACTER(LEN=*),
PARAMETER :: routineN =
'mp_comm_split', &
2557 routinep = modulen//
':'//routinen
2559 INTEGER :: handle, mepos, nnodes
2560#if defined(__parallel)
2561 INTEGER :: color, i, ierr, j, k, &
2562 my_subgroup_min_size, &
2563 istride, local_stride, irank
2564 INTEGER,
DIMENSION(:),
ALLOCATABLE :: rank_permutation
2567 CALL mp_timeset(routinen, handle)
2571 IF (.NOT.
PRESENT(subgroup_min_size) .AND. .NOT.
PRESENT(n_subgroups))
THEN
2572 cpabort(routinep//
" missing arguments")
2574 IF (
PRESENT(subgroup_min_size) .AND.
PRESENT(n_subgroups))
THEN
2575 cpabort(routinep//
" too many arguments")
2578 CALL comm%get_size(nnodes)
2579 CALL comm%get_rank(mepos)
2581 IF (ubound(group_distribution, 1) /= nnodes - 1)
THEN
2582 cpabort(routinep//
" group_distribution wrong bounds")
2585#if defined(__parallel)
2586 IF (
PRESENT(subgroup_min_size))
THEN
2587 IF (subgroup_min_size < 0 .OR. subgroup_min_size > nnodes)
THEN
2588 cpabort(routinep//
" subgroup_min_size too small or too large")
2590 ngroups = nnodes/subgroup_min_size
2591 my_subgroup_min_size = subgroup_min_size
2593 IF (n_subgroups <= 0)
THEN
2594 cpabort(routinep//
" n_subgroups too small")
2596 IF (nnodes/n_subgroups > 0)
THEN
2597 ngroups = n_subgroups
2601 my_subgroup_min_size = nnodes/ngroups
2607 ALLOCATE (rank_permutation(0:nnodes - 1))
2609 IF (
PRESENT(stride)) local_stride = stride
2611 DO istride = 1, local_stride
2612 DO irank = istride - 1, nnodes - 1, local_stride
2613 rank_permutation(k) = irank
2618 DO i = 0, nnodes - 1
2619 group_distribution(rank_permutation(i)) = min(i/my_subgroup_min_size, ngroups - 1)
2622 IF (
PRESENT(group_partition))
THEN
2623 IF (all(group_partition > 0) .AND. (sum(group_partition) == nnodes) .AND. (ngroups ==
SIZE(group_partition)))
THEN
2625 DO i = 0,
SIZE(group_partition) - 1
2626 DO j = 1, group_partition(i)
2627 group_distribution(rank_permutation(k)) = i
2635 DEALLOCATE (rank_permutation)
2636 color = group_distribution(mepos)
2637 CALL mpi_comm_split(comm%handle, color, 0, sub_comm%handle, ierr)
2638 IF (ierr /= mpi_success)
CALL mp_stop(ierr,
"in "//routinep//
" split")
2640 CALL add_perf(perf_id=10, count=1)
2642 sub_comm%handle = mp_comm_default_handle
2643 group_distribution(0) = 0
2647 mark_used(group_partition)
2649 debug_comm_count = debug_comm_count + 1
2650 CALL sub_comm%init()
2651 CALL mp_timestop(handle)
2653 END SUBROUTINE mp_comm_split
2666 SUBROUTINE mp_probe(source, comm, tag)
2667 INTEGER,
INTENT(INOUT) :: source
2669 INTEGER,
INTENT(OUT) :: tag
2671 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_probe'
2674#if defined(__parallel)
2676 mpi_status_type :: status_single
2682 CALL mp_timeset(routinen, handle)
2684#if defined(__parallel)
2687 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_probe @ mp_probe")
2688 source = status_single mpi_status_extract(mpi_source)
2689 tag = status_single mpi_status_extract(mpi_tag)
2692 CALL mpi_iprobe(source,
mp_any_tag, comm%handle, flag, status_single, ierr)
2693 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iprobe @ mp_probe")
2694 IF (flag .EQV. .false.)
THEN
2698 tag = status_single mpi_status_extract(mpi_tag)
2706 CALL mp_timestop(handle)
2707 END SUBROUTINE mp_probe
2719 SUBROUTINE mp_bcast_b(msg, source, comm)
2720 LOGICAL,
INTENT(INOUT) :: msg
2721 INTEGER,
INTENT(IN) :: source
2724 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_b'
2727#if defined(__parallel)
2728 INTEGER :: ierr, msglen
2731 CALL mp_timeset(routinen, handle)
2733#if defined(__parallel)
2735 CALL mpi_bcast(msg, msglen, mpi_logical, source, comm%handle, ierr)
2736 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2737 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2743 CALL mp_timestop(handle)
2744 END SUBROUTINE mp_bcast_b
2752 SUBROUTINE mp_bcast_b_src(msg, comm)
2753 LOGICAL,
INTENT(INOUT) :: msg
2756 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_b_src'
2759#if defined(__parallel)
2760 INTEGER :: ierr, msglen
2763 CALL mp_timeset(routinen, handle)
2765#if defined(__parallel)
2767 CALL mpi_bcast(msg, msglen, mpi_logical, comm%source, comm%handle, ierr)
2768 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2769 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2774 CALL mp_timestop(handle)
2775 END SUBROUTINE mp_bcast_b_src
2783 SUBROUTINE mp_bcast_bv(msg, source, comm)
2784 LOGICAL,
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
2785 INTEGER,
INTENT(IN) :: source
2788 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_bv'
2791#if defined(__parallel)
2792 INTEGER :: ierr, msglen
2795 CALL mp_timeset(routinen, handle)
2797#if defined(__parallel)
2799 CALL mpi_bcast(msg, msglen, mpi_logical, source, comm%handle, ierr)
2800 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2801 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2807 CALL mp_timestop(handle)
2808 END SUBROUTINE mp_bcast_bv
2815 SUBROUTINE mp_bcast_bv_src(msg, comm)
2816 LOGICAL,
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
2819 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_bv_src'
2822#if defined(__parallel)
2823 INTEGER :: ierr, msglen
2826 CALL mp_timeset(routinen, handle)
2828#if defined(__parallel)
2830 CALL mpi_bcast(msg, msglen, mpi_logical, comm%source, comm%handle, ierr)
2831 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
2832 CALL add_perf(perf_id=2, count=1, msg_size=msglen*loglen)
2837 CALL mp_timestop(handle)
2838 END SUBROUTINE mp_bcast_bv_src
2854 SUBROUTINE mp_isend_bv(msgin, dest, comm, request, tag)
2855 LOGICAL,
DIMENSION(:),
INTENT(IN) :: msgin
2856 INTEGER,
INTENT(IN) :: dest
2859 INTEGER,
INTENT(in),
OPTIONAL :: tag
2861 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_isend_bv'
2864#if defined(__parallel)
2865 INTEGER :: ierr, msglen, my_tag
2869 CALL mp_timeset(routinen, handle)
2871#if defined(__parallel)
2872#if !defined(__GNUC__) || __GNUC__ >= 9
2873 cpassert(is_contiguous(msgin) .OR. product(shape(msgin)) == 0)
2877 IF (
PRESENT(tag)) my_tag = tag
2879 msglen =
SIZE(msgin, 1)
2880 IF (msglen > 0)
THEN
2881 CALL mpi_isend(msgin(1), msglen, mpi_logical, dest, my_tag, &
2882 comm%handle, request%handle, ierr)
2884 CALL mpi_isend(foo, msglen, mpi_logical, dest, my_tag, &
2885 comm%handle, request%handle, ierr)
2887 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
2889 CALL add_perf(perf_id=11, count=1, msg_size=msglen*loglen)
2891 cpabort(
"mp_isend called in non parallel case")
2898 CALL mp_timestop(handle)
2899 END SUBROUTINE mp_isend_bv
2915 SUBROUTINE mp_irecv_bv(msgout, source, comm, request, tag)
2916 LOGICAL,
DIMENSION(:),
INTENT(INOUT) :: msgout
2917 INTEGER,
INTENT(IN) :: source
2920 INTEGER,
INTENT(in),
OPTIONAL :: tag
2922 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_irecv_bv'
2925#if defined(__parallel)
2926 INTEGER :: ierr, msglen, my_tag
2930 CALL mp_timeset(routinen, handle)
2932#if defined(__parallel)
2933#if !defined(__GNUC__) || __GNUC__ >= 9
2934 cpassert(is_contiguous(msgout) .OR. product(shape(msgout)) == 0)
2938 IF (
PRESENT(tag)) my_tag = tag
2940 msglen =
SIZE(msgout, 1)
2941 IF (msglen > 0)
THEN
2942 CALL mpi_irecv(msgout(1), msglen, mpi_logical, source, my_tag, &
2943 comm%handle, request%handle, ierr)
2945 CALL mpi_irecv(foo, msglen, mpi_logical, source, my_tag, &
2946 comm%handle, request%handle, ierr)
2948 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
2950 CALL add_perf(perf_id=12, count=1, msg_size=msglen*loglen)
2952 cpabort(
"mp_irecv called in non parallel case")
2959 CALL mp_timestop(handle)
2960 END SUBROUTINE mp_irecv_bv
2976 SUBROUTINE mp_isend_bm3(msgin, dest, comm, request, tag)
2977 LOGICAL,
DIMENSION(:, :, :),
INTENT(INOUT) :: msgin
2978 INTEGER,
INTENT(IN) :: dest
2981 INTEGER,
INTENT(in),
OPTIONAL :: tag
2983 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_isend_bm3'
2986#if defined(__parallel)
2987 INTEGER :: ierr, msglen, my_tag
2991 CALL mp_timeset(routinen, handle)
2993#if defined(__parallel)
2994#if !defined(__GNUC__) || __GNUC__ >= 9
2995 cpassert(is_contiguous(msgin) .OR. product(shape(msgin)) == 0)
2999 IF (
PRESENT(tag)) my_tag = tag
3001 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
3002 IF (msglen > 0)
THEN
3003 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_logical, dest, my_tag, &
3004 comm%handle, request%handle, ierr)
3006 CALL mpi_isend(foo, msglen, mpi_logical, dest, my_tag, &
3007 comm%handle, request%handle, ierr)
3009 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
3011 CALL add_perf(perf_id=11, count=1, msg_size=msglen*loglen)
3013 cpabort(
"mp_isend called in non parallel case")
3020 CALL mp_timestop(handle)
3021 END SUBROUTINE mp_isend_bm3
3037 SUBROUTINE mp_irecv_bm3(msgout, source, comm, request, tag)
3038 LOGICAL,
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
3039 INTEGER,
INTENT(IN) :: source
3042 INTEGER,
INTENT(in),
OPTIONAL :: tag
3044 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_irecv_bm3'
3047#if defined(__parallel)
3048 INTEGER :: ierr, msglen, my_tag
3052 CALL mp_timeset(routinen, handle)
3054#if defined(__parallel)
3055#if !defined(__GNUC__) || __GNUC__ >= 9
3056 cpassert(is_contiguous(msgout) .OR. product(shape(msgout)) == 0)
3060 IF (
PRESENT(tag)) my_tag = tag
3062 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
3063 IF (msglen > 0)
THEN
3064 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_logical, source, my_tag, &
3065 comm%handle, request%handle, ierr)
3067 CALL mpi_irecv(foo, msglen, mpi_logical, source, my_tag, &
3068 comm%handle, request%handle, ierr)
3070 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
3072 CALL add_perf(perf_id=12, count=1, msg_size=msglen*loglen)
3074 cpabort(
"mp_irecv called in non parallel case")
3082 CALL mp_timestop(handle)
3083 END SUBROUTINE mp_irecv_bm3
3091 SUBROUTINE mp_bcast_av(msg, source, comm)
3092 CHARACTER(LEN=*),
INTENT(INOUT) :: msg
3093 INTEGER,
INTENT(IN) :: source
3096 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_av'
3099#if defined(__parallel)
3100 INTEGER :: ierr, msglen
3103 CALL mp_timeset(routinen, handle)
3105#if defined(__parallel)
3106 msglen = len(msg)*charlen
3107 IF (comm%mepos /= source) msg =
""
3108 CALL mpi_bcast(msg, msglen, mpi_character, source, comm%handle, ierr)
3109 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3110 CALL add_perf(perf_id=2, count=1, msg_size=msglen)
3116 CALL mp_timestop(handle)
3117 END SUBROUTINE mp_bcast_av
3124 SUBROUTINE mp_bcast_av_src(msg, comm)
3125 CHARACTER(LEN=*),
INTENT(INOUT) :: msg
3128 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_av_src'
3131#if defined(__parallel)
3132 INTEGER :: ierr, msglen
3135 CALL mp_timeset(routinen, handle)
3137#if defined(__parallel)
3138 msglen = len(msg)*charlen
3139 IF (.NOT. comm%is_source()) msg =
""
3140 CALL mpi_bcast(msg, msglen, mpi_character, comm%source, comm%handle, ierr)
3141 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3142 CALL add_perf(perf_id=2, count=1, msg_size=msglen)
3147 CALL mp_timestop(handle)
3148 END SUBROUTINE mp_bcast_av_src
3156 SUBROUTINE mp_bcast_am(msg, source, comm)
3157 CHARACTER(LEN=*),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3158 INTEGER,
INTENT(IN) :: source
3161 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_am'
3164#if defined(__parallel)
3165 INTEGER :: ierr, msglen
3168 CALL mp_timeset(routinen, handle)
3170#if defined(__parallel)
3171 msglen =
SIZE(msg)*len(msg(1))*charlen
3172 IF (comm%mepos /= source) msg =
""
3173 CALL mpi_bcast(msg, msglen, mpi_character, source, comm%handle, ierr)
3174 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3175 CALL add_perf(perf_id=2, count=1, msg_size=msglen)
3181 CALL mp_timestop(handle)
3182 END SUBROUTINE mp_bcast_am
3184 SUBROUTINE mp_bcast_am_src(msg, comm)
3185 CHARACTER(LEN=*),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3188 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_bcast_am_src'
3191#if defined(__parallel)
3192 INTEGER :: ierr, msglen
3195 CALL mp_timeset(routinen, handle)
3197#if defined(__parallel)
3198 msglen =
SIZE(msg)*len(msg(1))*charlen
3199 IF (.NOT. comm%is_source()) msg =
""
3200 CALL mpi_bcast(msg, msglen, mpi_character, comm%source, comm%handle, ierr)
3201 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
3202 CALL add_perf(perf_id=2, count=1, msg_size=msglen)
3207 CALL mp_timestop(handle)
3208 END SUBROUTINE mp_bcast_am_src
3220 SUBROUTINE mp_minloc_dv(msg, comm)
3221 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3224 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_minloc_dv'
3227#if defined(__parallel)
3228 INTEGER :: ierr, msglen
3229 REAL(kind=real_8),
ALLOCATABLE :: res(:)
3232 IF (
"d" ==
"l" .AND. real_8 == int_8)
THEN
3233 cpabort(
"Minimal location not available with long integers @ "//routinen)
3235 CALL mp_timeset(routinen, handle)
3237#if defined(__parallel)
3239 ALLOCATE (res(1:msglen), stat=ierr)
3241 cpabort(
"allocate @ "//routinen)
3242 CALL mpi_allreduce(msg, res, msglen/2, mpi_2double_precision, mpi_minloc, comm%handle, ierr)
3243 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3246 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
3251 CALL mp_timestop(handle)
3252 END SUBROUTINE mp_minloc_dv
3264 SUBROUTINE mp_minloc_iv(msg, comm)
3265 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3268 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_minloc_iv'
3271#if defined(__parallel)
3272 INTEGER :: ierr, msglen
3273 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
3276 IF (
"i" ==
"l" .AND. int_4 == int_8)
THEN
3277 cpabort(
"Minimal location not available with long integers @ "//routinen)
3279 CALL mp_timeset(routinen, handle)
3281#if defined(__parallel)
3283 ALLOCATE (res(1:msglen))
3284 CALL mpi_allreduce(msg, res, msglen/2, mpi_2integer, mpi_minloc, comm%handle, ierr)
3285 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3288 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
3293 CALL mp_timestop(handle)
3294 END SUBROUTINE mp_minloc_iv
3306 SUBROUTINE mp_minloc_lv(msg, comm)
3307 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3310 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_minloc_lv'
3313#if defined(__parallel)
3314 INTEGER :: ierr, msglen
3315 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
3318 IF (
"l" ==
"l" .AND. int_8 == int_8)
THEN
3319 cpabort(
"Minimal location not available with long integers @ "//routinen)
3321 CALL mp_timeset(routinen, handle)
3323#if defined(__parallel)
3325 ALLOCATE (res(1:msglen))
3326 CALL mpi_allreduce(msg, res, msglen/2, mpi_integer8, mpi_minloc, comm%handle, ierr)
3327 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3330 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
3335 CALL mp_timestop(handle)
3336 END SUBROUTINE mp_minloc_lv
3348 SUBROUTINE mp_minloc_rv(msg, comm)
3349 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3352 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_minloc_rv'
3355#if defined(__parallel)
3356 INTEGER :: ierr, msglen
3357 REAL(kind=real_4),
ALLOCATABLE :: res(:)
3360 IF (
"r" ==
"l" .AND. real_4 == int_8)
THEN
3361 cpabort(
"Minimal location not available with long integers @ "//routinen)
3363 CALL mp_timeset(routinen, handle)
3365#if defined(__parallel)
3367 ALLOCATE (res(1:msglen))
3368 CALL mpi_allreduce(msg, res, msglen/2, mpi_2real, mpi_minloc, comm%handle, ierr)
3369 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3372 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
3377 CALL mp_timestop(handle)
3378 END SUBROUTINE mp_minloc_rv
3390 SUBROUTINE mp_maxloc_dv(msg, comm)
3391 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3394 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_maxloc_dv'
3397#if defined(__parallel)
3398 INTEGER :: ierr, msglen
3399 REAL(kind=real_8),
ALLOCATABLE :: res(:)
3402 IF (
"d" ==
"l" .AND. real_8 == int_8)
THEN
3403 cpabort(
"Maximal location not available with long integers @ "//routinen)
3405 CALL mp_timeset(routinen, handle)
3407#if defined(__parallel)
3409 ALLOCATE (res(1:msglen))
3410 CALL mpi_allreduce(msg, res, msglen/2, mpi_2double_precision, mpi_maxloc, comm%handle, ierr)
3411 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3414 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
3419 CALL mp_timestop(handle)
3420 END SUBROUTINE mp_maxloc_dv
3432 SUBROUTINE mp_maxloc_iv(msg, comm)
3433 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3436 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_maxloc_iv'
3439#if defined(__parallel)
3440 INTEGER :: ierr, msglen
3441 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
3444 IF (
"i" ==
"l" .AND. int_4 == int_8)
THEN
3445 cpabort(
"Maximal location not available with long integers @ "//routinen)
3447 CALL mp_timeset(routinen, handle)
3449#if defined(__parallel)
3451 ALLOCATE (res(1:msglen))
3452 CALL mpi_allreduce(msg, res, msglen/2, mpi_2integer, mpi_maxloc, comm%handle, ierr)
3453 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3456 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
3461 CALL mp_timestop(handle)
3462 END SUBROUTINE mp_maxloc_iv
3474 SUBROUTINE mp_maxloc_lv(msg, comm)
3475 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3478 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_maxloc_lv'
3481#if defined(__parallel)
3482 INTEGER :: ierr, msglen
3483 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
3486 IF (
"l" ==
"l" .AND. int_8 == int_8)
THEN
3487 cpabort(
"Maximal location not available with long integers @ "//routinen)
3489 CALL mp_timeset(routinen, handle)
3491#if defined(__parallel)
3493 ALLOCATE (res(1:msglen))
3494 CALL mpi_allreduce(msg, res, msglen/2, mpi_integer8, mpi_maxloc, comm%handle, ierr)
3495 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3498 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
3503 CALL mp_timestop(handle)
3504 END SUBROUTINE mp_maxloc_lv
3516 SUBROUTINE mp_maxloc_rv(msg, comm)
3517 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
3520 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_maxloc_rv'
3523#if defined(__parallel)
3524 INTEGER :: ierr, msglen
3525 REAL(kind=real_4),
ALLOCATABLE :: res(:)
3528 IF (
"r" ==
"l" .AND. real_4 == int_8)
THEN
3529 cpabort(
"Maximal location not available with long integers @ "//routinen)
3531 CALL mp_timeset(routinen, handle)
3533#if defined(__parallel)
3535 ALLOCATE (res(1:msglen))
3536 CALL mpi_allreduce(msg, res, msglen/2, mpi_2real, mpi_maxloc, comm%handle, ierr)
3537 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3540 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
3545 CALL mp_timestop(handle)
3546 END SUBROUTINE mp_maxloc_rv
3556 SUBROUTINE mp_sum_b(msg, comm)
3557 LOGICAL,
INTENT(INOUT) :: msg
3560 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_sum_b'
3563#if defined(__parallel)
3564 INTEGER :: ierr, msglen
3567 CALL mp_timeset(routinen, handle)
3568#if defined(__parallel)
3570 IF (comm%num_pe > 1)
THEN
3571 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, ierr)
3572 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3578 CALL mp_timestop(handle)
3579 END SUBROUTINE mp_sum_b
3589 SUBROUTINE mp_sum_bv(msg, comm)
3590 LOGICAL,
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: msg
3593 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_sum_bv'
3596#if defined(__parallel)
3597 INTEGER :: ierr, msglen
3600 CALL mp_timeset(routinen, handle)
3601#if defined(__parallel)
3603 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
3604 CALL mpi_allreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, ierr)
3605 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3611 CALL mp_timestop(handle)
3612 END SUBROUTINE mp_sum_bv
3623 SUBROUTINE mp_isum_bv(msg, comm, request)
3624 LOGICAL,
DIMENSION(:),
INTENT(INOUT) :: msg
3628 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_isum_bv'
3631#if defined(__parallel)
3632 INTEGER :: ierr, msglen
3635 CALL mp_timeset(routinen, handle)
3636#if defined(__parallel)
3638#if !defined(__GNUC__) || __GNUC__ >= 9
3639 cpassert(is_contiguous(msg) .OR. product(shape(msg)) == 0)
3642 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
3643 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_logical, mpi_lor, comm%handle, request%handle, ierr)
3644 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
3653 CALL mp_timestop(handle)
3654 END SUBROUTINE mp_isum_bv
3664 CHARACTER(len=*),
INTENT(OUT) :: version
3665 INTEGER,
INTENT(OUT) :: resultlen
3667#if defined(__parallel)
3673#if defined(__parallel)
3675 CALL mpi_get_library_version(version, resultlen, ierr)
3676 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_get_library_version @ mp_get_library_version")
3696 SUBROUTINE mp_file_open(groupid, fh, filepath, amode_status, info)
3699 CHARACTER(len=*),
INTENT(IN) :: filepath
3700 INTEGER,
INTENT(IN) :: amode_status
3703#if defined(__parallel)
3705 mpi_info_type :: my_info
3707 CHARACTER(LEN=10) :: fstatus, fposition
3708 INTEGER :: amode, handle, istat
3709 LOGICAL :: exists, is_open
3712#if defined(__parallel)
3714 my_info = mpi_info_null
3715 IF (
PRESENT(info)) my_info = info%handle
3716 CALL mpi_file_open(groupid%handle, filepath, amode_status, my_info, fh%handle, ierr)
3717 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3718 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_open")
3722 amode = amode_status
3724 fposition =
"APPEND"
3727 fposition =
"REWIND"
3738 INQUIRE (unit=handle, exist=exists, opened=is_open, iostat=istat)
3739 IF (exists .AND. (.NOT. is_open) .AND. (istat == 0))
EXIT
3741 OPEN (unit=handle, file=filepath, status=fstatus, access=
"STREAM", position=fposition)
3744 END SUBROUTINE mp_file_open
3755 CHARACTER(len=*),
INTENT(IN) :: filepath
3758#if defined(__parallel)
3760 mpi_info_type :: my_info
3764 my_info = mpi_info_null
3765 IF (
PRESENT(info)) my_info = info%handle
3766 INQUIRE (file=filepath, exist=exists)
3767 IF (exists)
CALL mpi_file_delete(filepath, my_info, ierr)
3768 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_delete")
3786 SUBROUTINE mp_file_close(fh)
3789#if defined(__parallel)
3793 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3794 CALL mpi_file_close(fh%handle, ierr)
3795 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_close")
3798 fh%handle = mp_file_null_handle
3800 END SUBROUTINE mp_file_close
3802 SUBROUTINE mp_file_assign(fh_new, fh_old)
3806 fh_new%handle = fh_old%handle
3820 SUBROUTINE mp_file_get_size(fh, file_size)
3822 INTEGER(kind=file_offset),
INTENT(OUT) :: file_size
3824#if defined(__parallel)
3828#if defined(__parallel)
3830 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3831 CALL mpi_file_get_size(fh%handle, file_size, ierr)
3832 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_get_size")
3834 INQUIRE (unit=fh%handle, size=file_size)
3836 END SUBROUTINE mp_file_get_size
3848 SUBROUTINE mp_file_get_position(fh, pos)
3850 INTEGER(kind=file_offset),
INTENT(OUT) :: pos
3852#if defined(__parallel)
3856#if defined(__parallel)
3858 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
3859 CALL mpi_file_get_position(fh%handle, pos, ierr)
3860 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ mp_file_get_position")
3862 INQUIRE (unit=fh%handle, pos=pos)
3864 END SUBROUTINE mp_file_get_position
3877 SUBROUTINE mp_file_write_at_chv(fh, offset, msg, msglen)
3878 CHARACTER,
CONTIGUOUS,
INTENT(IN) :: msg(:)
3880 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
3881 INTEGER(kind=file_offset),
INTENT(IN) :: offset
3883#if defined(__parallel)
3884 INTEGER :: ierr, msg_len
3887#if defined(__parallel)
3889 IF (
PRESENT(msglen)) msg_len = msglen
3890 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
3892 cpabort(
"mpi_file_write_at_chv @ mp_file_write_at_chv")
3895 WRITE (unit=fh%handle, pos=offset + 1) msg
3897 END SUBROUTINE mp_file_write_at_chv
3905 SUBROUTINE mp_file_write_at_ch(fh, offset, msg)
3906 CHARACTER(LEN=*),
INTENT(IN) :: msg
3908 INTEGER(kind=file_offset),
INTENT(IN) :: offset
3910#if defined(__parallel)
3914#if defined(__parallel)
3915 CALL mpi_file_write_at(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
3917 cpabort(
"mpi_file_write_at_ch @ mp_file_write_at_ch")
3919 WRITE (unit=fh%handle, pos=offset + 1) msg
3921 END SUBROUTINE mp_file_write_at_ch
3933 SUBROUTINE mp_file_write_at_all_chv(fh, offset, msg, msglen)
3934 CHARACTER,
CONTIGUOUS,
INTENT(IN) :: msg(:)
3936 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
3937 INTEGER(kind=file_offset),
INTENT(IN) :: offset
3939#if defined(__parallel)
3940 INTEGER :: ierr, msg_len
3943#if defined(__parallel)
3945 IF (
PRESENT(msglen)) msg_len = msglen
3946 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
3948 cpabort(
"mpi_file_write_at_all_chv @ mp_file_write_at_all_chv")
3951 WRITE (unit=fh%handle, pos=offset + 1) msg
3953 END SUBROUTINE mp_file_write_at_all_chv
3961 SUBROUTINE mp_file_write_at_all_ch(fh, offset, msg)
3962 CHARACTER(LEN=*),
INTENT(IN) :: msg
3964 INTEGER(kind=file_offset),
INTENT(IN) :: offset
3966#if defined(__parallel)
3970#if defined(__parallel)
3971 CALL mpi_file_write_at_all(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
3973 cpabort(
"mpi_file_write_at_all_ch @ mp_file_write_at_all_ch")
3975 WRITE (unit=fh%handle, pos=offset + 1) msg
3977 END SUBROUTINE mp_file_write_at_all_ch
3990 SUBROUTINE mp_file_read_at_chv(fh, offset, msg, msglen)
3991 CHARACTER,
CONTIGUOUS,
INTENT(OUT) :: msg(:)
3993 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
3994 INTEGER(kind=file_offset),
INTENT(IN) :: offset
3996#if defined(__parallel)
3997 INTEGER :: ierr, msg_len
4000#if defined(__parallel)
4002 IF (
PRESENT(msglen)) msg_len = msglen
4003 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4005 cpabort(
"mpi_file_read_at_chv @ mp_file_read_at_chv")
4008 READ (unit=fh%handle, pos=offset + 1) msg
4010 END SUBROUTINE mp_file_read_at_chv
4018 SUBROUTINE mp_file_read_at_ch(fh, offset, msg)
4019 CHARACTER(LEN=*),
INTENT(OUT) :: msg
4021 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4023#if defined(__parallel)
4027#if defined(__parallel)
4028 CALL mpi_file_read_at(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4030 cpabort(
"mpi_file_read_at_ch @ mp_file_read_at_ch")
4032 READ (unit=fh%handle, pos=offset + 1) msg
4034 END SUBROUTINE mp_file_read_at_ch
4046 SUBROUTINE mp_file_read_at_all_chv(fh, offset, msg, msglen)
4047 CHARACTER,
INTENT(OUT) :: msg(:)
4049 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
4050 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4052#if defined(__parallel)
4053 INTEGER :: ierr, msg_len
4056#if defined(__parallel)
4058 IF (
PRESENT(msglen)) msg_len = msglen
4059 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_character, mpi_status_ignore, ierr)
4061 cpabort(
"mpi_file_read_at_all_chv @ mp_file_read_at_all_chv")
4064 READ (unit=fh%handle, pos=offset + 1) msg
4066 END SUBROUTINE mp_file_read_at_all_chv
4074 SUBROUTINE mp_file_read_at_all_ch(fh, offset, msg)
4075 CHARACTER(LEN=*),
INTENT(OUT) :: msg
4077 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4079#if defined(__parallel)
4083#if defined(__parallel)
4084 CALL mpi_file_read_at_all(fh%handle, offset, msg, len(msg), mpi_character, mpi_status_ignore, ierr)
4086 cpabort(
"mpi_file_read_at_all_ch @ mp_file_read_at_all_ch")
4088 READ (unit=fh%handle, pos=offset + 1) msg
4090 END SUBROUTINE mp_file_read_at_all_ch
4102 INTEGER,
INTENT(OUT) :: type_size
4104#if defined(__parallel)
4108 CALL mpi_type_size(type_descriptor%type_handle, type_size, ierr)
4110 cpabort(
"mpi_type_size failed @ mp_type_size")
4112 SELECT CASE (type_descriptor%type_handle)
4114 type_size = real_4_size
4116 type_size = real_8_size
4118 type_size = 2*real_4_size
4120 type_size = 2*real_8_size
4132 FUNCTION mp_type_make_struct(subtypes, &
4133 vector_descriptor, index_descriptor) &
4134 result(type_descriptor)
4136 DIMENSION(:),
INTENT(IN) :: subtypes
4137 INTEGER,
DIMENSION(2),
INTENT(IN), &
4138 OPTIONAL :: vector_descriptor
4139 TYPE(mp_indexing_meta_type), &
4140 INTENT(IN),
OPTIONAL :: index_descriptor
4143 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_struct'
4146 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: lengths
4147#if defined(__parallel)
4149 INTEGER(kind=mpi_address_kind), &
4150 ALLOCATABLE,
DIMENSION(:) :: displacements
4151#if defined(__MPI_F08)
4153 EXTERNAL :: mpi_get_address
4156 mpi_data_type,
ALLOCATABLE,
DIMENSION(:) :: old_types
4159 type_descriptor%length = 1
4160#if defined(__parallel)
4162 CALL mpi_get_address(mpi_bottom, type_descriptor%base, ierr)
4164 cpabort(
"MPI_get_address @ "//routinen)
4165 ALLOCATE (displacements(n))
4167 type_descriptor%vector_descriptor(1:2) = 1
4168 type_descriptor%has_indexing = .false.
4169 ALLOCATE (type_descriptor%subtype(n))
4170 type_descriptor%subtype(:) = subtypes(:)
4171 ALLOCATE (lengths(n), old_types(n))
4172 DO i = 1,
SIZE(subtypes)
4173#if defined(__parallel)
4174 displacements(i) = subtypes(i)%base
4176 old_types(i) = subtypes(i)%type_handle
4177 lengths(i) = subtypes(i)%length
4179#if defined(__parallel)
4180 CALL mpi_type_create_struct(n, &
4181 lengths, displacements, old_types, &
4182 type_descriptor%type_handle, ierr)
4184 cpabort(
"MPI_Type_create_struct @ "//routinen)
4185 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
4187 cpabort(
"MPI_Type_commit @ "//routinen)
4189 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
4190 cpabort(routinen//
" Vectors and indices NYI")
4192 END FUNCTION mp_type_make_struct
4198 RECURSIVE SUBROUTINE mp_type_free_m(type_descriptor)
4201 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_free_m'
4203 INTEGER :: handle, i
4204#if defined(__parallel)
4208 CALL mp_timeset(routinen, handle)
4212 IF (
ASSOCIATED(type_descriptor%subtype))
THEN
4213 DO i = 1,
SIZE(type_descriptor%subtype)
4214 CALL mp_type_free_m(type_descriptor%subtype(i))
4216 DEALLOCATE (type_descriptor%subtype)
4218#if defined(__parallel)
4220 CALL mpi_type_free(type_descriptor%type_handle, ierr)
4222 cpabort(
"MPI_Type_free @ "//routinen)
4225 CALL mp_timestop(handle)
4227 END SUBROUTINE mp_type_free_m
4233 SUBROUTINE mp_type_free_v(type_descriptors)
4235 INTENT(inout) :: type_descriptors
4239 DO i = 1,
SIZE(type_descriptors)
4240 CALL mp_type_free(type_descriptors(i))
4243 END SUBROUTINE mp_type_free_v
4254 result(type_descriptor)
4255 INTEGER,
INTENT(IN) :: count
4256 INTEGER,
DIMENSION(1:count), &
4257 INTENT(IN),
TARGET :: lengths
4258 INTEGER(kind=file_offset), &
4259 DIMENSION(1:count),
INTENT(in),
TARGET :: displs
4262 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_hindexed_make_chv'
4264 INTEGER :: ierr, handle
4267 CALL mp_timeset(routinen, handle)
4269#if defined(__parallel)
4270 CALL mpi_type_create_hindexed(count, lengths, int(displs, kind=
address_kind), mpi_character, &
4271 type_descriptor%type_handle, ierr)
4273 cpabort(
"MPI_Type_create_hindexed @ "//routinen)
4274 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
4276 cpabort(
"MPI_Type_commit @ "//routinen)
4278 type_descriptor%type_handle = 68
4280 type_descriptor%length = count
4281 type_descriptor%has_indexing = .true.
4282 type_descriptor%index_descriptor%index => lengths
4283 type_descriptor%index_descriptor%chunks => displs
4285 CALL mp_timestop(handle)
4299 INTEGER(kind=file_offset),
INTENT(IN) :: offset
4302 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_set_view_chv'
4305#if defined(__parallel)
4309 CALL mp_timeset(routinen, handle)
4311#if defined(__parallel)
4313 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4314 CALL mpi_file_set_view(fh%handle, offset, mpi_character, &
4315 type_descriptor%type_handle,
"native", mpi_info_null, ierr)
4316 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_set_view")
4321 mark_used(type_descriptor)
4324 CALL mp_timestop(handle)
4339 SUBROUTINE mp_file_read_all_chv(fh, msglen, ndims, buffer, type_descriptor)
4341 INTEGER,
INTENT(IN) :: msglen
4342 INTEGER,
INTENT(IN) :: ndims
4343 CHARACTER(LEN=msglen),
DIMENSION(ndims),
INTENT(INOUT) :: buffer
4345 INTENT(IN),
OPTIONAL :: type_descriptor
4347 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_read_all_chv'
4350#if defined(__parallel)
4356 CALL mp_timeset(routinen, handle)
4358#if defined(__parallel)
4360 mark_used(type_descriptor)
4361 CALL mpi_file_read_all(fh%handle, buffer, ndims*msglen, mpi_character, mpi_status_ignore, ierr)
4362 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_read_all")
4363 CALL add_perf(perf_id=28, count=1, msg_size=ndims*msglen)
4367 IF (.NOT.
PRESENT(type_descriptor)) &
4368 CALL cp_abort(__location__, &
4369 "Container for mp_file_descriptor_type must be present in serial call.")
4370 IF (.NOT. type_descriptor%has_indexing) &
4371 CALL cp_abort(__location__, &
4372 "File view has not been set in mp_file_descriptor_type.")
4375 READ (fh%handle, pos=type_descriptor%index_descriptor%chunks(i)) buffer(i)
4379 CALL mp_timestop(handle)
4381 END SUBROUTINE mp_file_read_all_chv
4394 SUBROUTINE mp_file_write_all_chv(fh, msglen, ndims, buffer, type_descriptor)
4396 INTEGER,
INTENT(IN) :: msglen
4397 INTEGER,
INTENT(IN) :: ndims
4398 CHARACTER(LEN=msglen),
DIMENSION(ndims),
INTENT(IN) :: buffer
4400 INTENT(IN),
OPTIONAL :: type_descriptor
4402 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_write_all_chv'
4405#if defined(__parallel)
4411 CALL mp_timeset(routinen, handle)
4413#if defined(__parallel)
4414 mark_used(type_descriptor)
4415 CALL mpi_file_set_errhandler(fh%handle, mpi_errors_return, ierr)
4416 CALL mpi_file_write_all(fh%handle, buffer, ndims*msglen, mpi_character, mpi_status_ignore, ierr)
4417 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_file_set_errhandler @ MPI_File_write_all")
4418 CALL add_perf(perf_id=28, count=1, msg_size=ndims*msglen)
4422 IF (.NOT.
PRESENT(type_descriptor)) &
4423 CALL cp_abort(__location__, &
4424 "Container for mp_file_descriptor_type must be present in serial call.")
4425 IF (.NOT. type_descriptor%has_indexing) &
4426 CALL cp_abort(__location__, &
4427 "File view has not been set in mp_file_descriptor_type.")
4430 WRITE (fh%handle, pos=type_descriptor%index_descriptor%chunks(i)) buffer(i)
4434 CALL mp_timestop(handle)
4436 END SUBROUTINE mp_file_write_all_chv
4446 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_file_type_free'
4449#if defined(__parallel)
4453 CALL mp_timeset(routinen, handle)
4455#if defined(__parallel)
4456 CALL mpi_type_free(type_descriptor%type_handle, ierr)
4458 cpabort(
"MPI_Type_free @ "//routinen)
4460#if defined(__parallel) && defined(__MPI_F08)
4461 type_descriptor%type_handle%mpi_val = -1
4463 type_descriptor%type_handle = -1
4465 type_descriptor%length = -1
4466 IF (type_descriptor%has_indexing)
THEN
4467 NULLIFY (type_descriptor%index_descriptor%index)
4468 NULLIFY (type_descriptor%index_descriptor%chunks)
4469 type_descriptor%has_indexing = .false.
4472 CALL mp_timestop(handle)
4490 LOGICAL,
INTENT(INOUT) :: mpi_io, replace
4491 INTEGER,
INTENT(OUT) :: amode
4492 CHARACTER(len=*),
INTENT(IN) :: form, action, status, position
4495#if defined(__parallel)
4500 CASE (
"UNFORMATTED")
4503 cpabort(
"Unknown MPI file form requested.")
4506 SELECT CASE (action)
4509 SELECT CASE (status)
4516 SELECT CASE (position)
4520 CASE (
"REWIND",
"ASIS")
4523 cpabort(
"Unknown MPI file position requested.")
4526 SELECT CASE (position)
4530 CASE (
"REWIND",
"ASIS")
4533 cpabort(
"Unknown MPI file position requested.")
4543 cpabort(
"Unknown MPI file status requested.")
4547 SELECT CASE (status)
4549 cpabort(
"Cannot read from 'NEW' file.")
4551 cpabort(
"Illegal status 'REPLACE' for read.")
4552 CASE (
"UNKNOWN",
"OLD")
4558 cpabort(
"Unknown MPI file status requested.")
4562 SELECT CASE (status)
4569 SELECT CASE (position)
4573 CASE (
"REWIND",
"ASIS")
4576 cpabort(
"Unknown MPI file position requested.")
4579 SELECT CASE (position)
4583 CASE (
"REWIND",
"ASIS")
4586 cpabort(
"Unknown MPI file position requested.")
4596 cpabort(
"Unknown MPI file status requested.")
4599 cpabort(
"Unknown MPI file action requested.")
4620 SUBROUTINE mp_isend_custom(msgin, dest, comm, request, tag)
4622 INTEGER,
INTENT(IN) :: dest
4625 INTEGER,
INTENT(in),
OPTIONAL :: tag
4627 INTEGER :: ierr, my_tag
4632#if defined(__parallel)
4633 IF (
PRESENT(tag)) my_tag = tag
4635 CALL mpi_isend(mpi_bottom, 1, msgin%type_handle, dest, my_tag, &
4636 comm%handle, request%handle, ierr)
4637 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ mp_isend_custom")
4645 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
4647 END SUBROUTINE mp_isend_custom
4657 SUBROUTINE mp_irecv_custom(msgout, source, comm, request, tag)
4659 INTEGER,
INTENT(IN) :: source
4662 INTEGER,
INTENT(in),
OPTIONAL :: tag
4664 INTEGER :: ierr, my_tag
4669#if defined(__parallel)
4670 IF (
PRESENT(tag)) my_tag = tag
4672 CALL mpi_irecv(mpi_bottom, 1, msgout%type_handle, source, my_tag, &
4673 comm%handle, request%handle, ierr)
4674 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ mp_irecv_custom")
4682 cpabort(
"mp_irecv called in non parallel case")
4684 END SUBROUTINE mp_irecv_custom
4690 SUBROUTINE mp_win_free(win)
4693 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_free'
4696#if defined(__parallel)
4700 CALL mp_timeset(routinen, handle)
4702#if defined(__parallel)
4704 CALL mpi_win_free(win%handle, ierr)
4705 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_free @ "//routinen)
4707 CALL add_perf(perf_id=21, count=1)
4709 win%handle = mp_win_null_handle
4711 CALL mp_timestop(handle)
4712 END SUBROUTINE mp_win_free
4714 SUBROUTINE mp_win_assign(win_new, win_old)
4718 win_new%handle = win_old%handle
4720 END SUBROUTINE mp_win_assign
4726 SUBROUTINE mp_win_flush_all(win)
4729 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_flush_all'
4731 INTEGER :: handle, ierr
4734 CALL mp_timeset(routinen, handle)
4736#if defined(__parallel)
4737 CALL mpi_win_flush_all(win%handle, ierr)
4738 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_flush_all @ "//routinen)
4742 CALL mp_timestop(handle)
4743 END SUBROUTINE mp_win_flush_all
4749 SUBROUTINE mp_win_lock_all(win)
4752 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_lock_all'
4754 INTEGER :: handle, ierr
4757 CALL mp_timeset(routinen, handle)
4759#if defined(__parallel)
4761 CALL mpi_win_lock_all(mpi_mode_nocheck, win%handle, ierr)
4762 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_lock_all @ "//routinen)
4764 CALL add_perf(perf_id=19, count=1)
4768 CALL mp_timestop(handle)
4769 END SUBROUTINE mp_win_lock_all
4775 SUBROUTINE mp_win_unlock_all(win)
4778 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_unlock_all'
4780 INTEGER :: handle, ierr
4783 CALL mp_timeset(routinen, handle)
4785#if defined(__parallel)
4787 CALL mpi_win_unlock_all(win%handle, ierr)
4788 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_unlock_all @ "//routinen)
4790 CALL add_perf(perf_id=19, count=1)
4794 CALL mp_timestop(handle)
4795 END SUBROUTINE mp_win_unlock_all
4802 SUBROUTINE mp_timeset(routineN, handle)
4803 CHARACTER(len=*),
INTENT(IN) :: routinen
4804 INTEGER,
INTENT(OUT) :: handle
4807 CALL timeset(routinen, handle)
4808 END SUBROUTINE mp_timeset
4814 SUBROUTINE mp_timestop(handle)
4815 INTEGER,
INTENT(IN) :: handle
4818 CALL timestop(handle)
4819 END SUBROUTINE mp_timestop
4832 SUBROUTINE mp_shift_im(msg, comm, displ_in)
4834 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
4836 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
4838 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_im'
4840 INTEGER :: handle, ierror
4841#if defined(__parallel)
4842 INTEGER :: displ, left, &
4843 msglen, myrank, nprocs, &
4848 CALL mp_timeset(routinen, handle)
4850#if defined(__parallel)
4851 CALL mpi_comm_rank(comm%handle, myrank, ierror)
4852 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
4853 CALL mpi_comm_size(comm%handle, nprocs, ierror)
4854 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
4855 IF (
PRESENT(displ_in))
THEN
4860 right =
modulo(myrank + displ, nprocs)
4861 left =
modulo(myrank - displ, nprocs)
4864 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer, right, tag, left, tag, &
4865 comm%handle, mpi_status_ignore, ierror)
4866 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
4867 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_4_size)
4873 CALL mp_timestop(handle)
4875 END SUBROUTINE mp_shift_im
4888 SUBROUTINE mp_shift_i (msg, comm, displ_in)
4890 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
4892 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
4894 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_i'
4896 INTEGER :: handle, ierror
4897#if defined(__parallel)
4898 INTEGER :: displ, left, &
4899 msglen, myrank, nprocs, &
4904 CALL mp_timeset(routinen, handle)
4906#if defined(__parallel)
4907 CALL mpi_comm_rank(comm%handle, myrank, ierror)
4908 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
4909 CALL mpi_comm_size(comm%handle, nprocs, ierror)
4910 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
4911 IF (
PRESENT(displ_in))
THEN
4916 right =
modulo(myrank + displ, nprocs)
4917 left =
modulo(myrank - displ, nprocs)
4920 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer, right, tag, left, &
4921 tag, comm%handle, mpi_status_ignore, ierror)
4922 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
4923 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_4_size)
4929 CALL mp_timestop(handle)
4931 END SUBROUTINE mp_shift_i
4952 SUBROUTINE mp_alltoall_i11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
4954 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
4955 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
4956 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
4957 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
4960 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i11v'
4963#if defined(__parallel)
4964 INTEGER :: ierr, msglen
4969 CALL mp_timeset(routinen, handle)
4971#if defined(__parallel)
4972 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer, &
4973 rb, rcount, rdispl, mpi_integer, comm%handle, ierr)
4974 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
4975 msglen = sum(scount) + sum(rcount)
4976 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
4983 rb(rdispl(1) + i) = sb(sdispl(1) + i)
4986 CALL mp_timestop(handle)
4988 END SUBROUTINE mp_alltoall_i11v
5003 SUBROUTINE mp_alltoall_i22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
5005 INTEGER(KIND=int_4),
DIMENSION(:, :), &
5006 INTENT(IN),
CONTIGUOUS :: sb
5007 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
5008 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS, &
5010 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
5013 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i22v'
5016#if defined(__parallel)
5017 INTEGER :: ierr, msglen
5020 CALL mp_timeset(routinen, handle)
5022#if defined(__parallel)
5023 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer, &
5024 rb, rcount, rdispl, mpi_integer, comm%handle, ierr)
5025 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
5026 msglen = sum(scount) + sum(rcount)
5027 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*int_4_size)
5036 CALL mp_timestop(handle)
5038 END SUBROUTINE mp_alltoall_i22v
5055 SUBROUTINE mp_alltoall_i (sb, rb, count, comm)
5057 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
5058 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
5059 INTEGER,
INTENT(IN) :: count
5062 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i'
5065#if defined(__parallel)
5066 INTEGER :: ierr, msglen, np
5069 CALL mp_timeset(routinen, handle)
5071#if defined(__parallel)
5072 CALL mpi_alltoall(sb, count, mpi_integer, &
5073 rb, count, mpi_integer, comm%handle, ierr)
5074 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5075 CALL mpi_comm_size(comm%handle, np, ierr)
5076 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5078 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5084 CALL mp_timestop(handle)
5086 END SUBROUTINE mp_alltoall_i
5096 SUBROUTINE mp_alltoall_i22(sb, rb, count, comm)
5098 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
5099 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
5100 INTEGER,
INTENT(IN) :: count
5103 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i22'
5106#if defined(__parallel)
5107 INTEGER :: ierr, msglen, np
5110 CALL mp_timeset(routinen, handle)
5112#if defined(__parallel)
5113 CALL mpi_alltoall(sb, count, mpi_integer, &
5114 rb, count, mpi_integer, comm%handle, ierr)
5115 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5116 CALL mpi_comm_size(comm%handle, np, ierr)
5117 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5118 msglen = 2*
SIZE(sb)*np
5119 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5125 CALL mp_timestop(handle)
5127 END SUBROUTINE mp_alltoall_i22
5137 SUBROUTINE mp_alltoall_i33(sb, rb, count, comm)
5139 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
5140 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
5141 INTEGER,
INTENT(IN) :: count
5144 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i33'
5147#if defined(__parallel)
5148 INTEGER :: ierr, msglen, np
5151 CALL mp_timeset(routinen, handle)
5153#if defined(__parallel)
5154 CALL mpi_alltoall(sb, count, mpi_integer, &
5155 rb, count, mpi_integer, comm%handle, ierr)
5156 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5157 CALL mpi_comm_size(comm%handle, np, ierr)
5158 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5160 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5166 CALL mp_timestop(handle)
5168 END SUBROUTINE mp_alltoall_i33
5178 SUBROUTINE mp_alltoall_i44(sb, rb, count, comm)
5180 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5182 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5184 INTEGER,
INTENT(IN) :: count
5187 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i44'
5190#if defined(__parallel)
5191 INTEGER :: ierr, msglen, np
5194 CALL mp_timeset(routinen, handle)
5196#if defined(__parallel)
5197 CALL mpi_alltoall(sb, count, mpi_integer, &
5198 rb, count, mpi_integer, comm%handle, ierr)
5199 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5200 CALL mpi_comm_size(comm%handle, np, ierr)
5201 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5203 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5209 CALL mp_timestop(handle)
5211 END SUBROUTINE mp_alltoall_i44
5221 SUBROUTINE mp_alltoall_i55(sb, rb, count, comm)
5223 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
5225 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
5227 INTEGER,
INTENT(IN) :: count
5230 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i55'
5233#if defined(__parallel)
5234 INTEGER :: ierr, msglen, np
5237 CALL mp_timeset(routinen, handle)
5239#if defined(__parallel)
5240 CALL mpi_alltoall(sb, count, mpi_integer, &
5241 rb, count, mpi_integer, comm%handle, ierr)
5242 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5243 CALL mpi_comm_size(comm%handle, np, ierr)
5244 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5246 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5252 CALL mp_timestop(handle)
5254 END SUBROUTINE mp_alltoall_i55
5265 SUBROUTINE mp_alltoall_i45(sb, rb, count, comm)
5267 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5269 INTEGER(KIND=int_4), &
5270 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
5271 INTEGER,
INTENT(IN) :: count
5274 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i45'
5277#if defined(__parallel)
5278 INTEGER :: ierr, msglen, np
5281 CALL mp_timeset(routinen, handle)
5283#if defined(__parallel)
5284 CALL mpi_alltoall(sb, count, mpi_integer, &
5285 rb, count, mpi_integer, comm%handle, ierr)
5286 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5287 CALL mpi_comm_size(comm%handle, np, ierr)
5288 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5290 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5294 rb = reshape(sb, shape(rb))
5296 CALL mp_timestop(handle)
5298 END SUBROUTINE mp_alltoall_i45
5309 SUBROUTINE mp_alltoall_i34(sb, rb, count, comm)
5311 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
5313 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5315 INTEGER,
INTENT(IN) :: count
5318 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i34'
5321#if defined(__parallel)
5322 INTEGER :: ierr, msglen, np
5325 CALL mp_timeset(routinen, handle)
5327#if defined(__parallel)
5328 CALL mpi_alltoall(sb, count, mpi_integer, &
5329 rb, count, mpi_integer, comm%handle, ierr)
5330 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5331 CALL mpi_comm_size(comm%handle, np, ierr)
5332 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5334 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5338 rb = reshape(sb, shape(rb))
5340 CALL mp_timestop(handle)
5342 END SUBROUTINE mp_alltoall_i34
5353 SUBROUTINE mp_alltoall_i54(sb, rb, count, comm)
5355 INTEGER(KIND=int_4), &
5356 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
5357 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
5359 INTEGER,
INTENT(IN) :: count
5362 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_i54'
5365#if defined(__parallel)
5366 INTEGER :: ierr, msglen, np
5369 CALL mp_timeset(routinen, handle)
5371#if defined(__parallel)
5372 CALL mpi_alltoall(sb, count, mpi_integer, &
5373 rb, count, mpi_integer, comm%handle, ierr)
5374 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
5375 CALL mpi_comm_size(comm%handle, np, ierr)
5376 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
5378 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_4_size)
5382 rb = reshape(sb, shape(rb))
5384 CALL mp_timestop(handle)
5386 END SUBROUTINE mp_alltoall_i54
5397 SUBROUTINE mp_send_i (msg, dest, tag, comm)
5398 INTEGER(KIND=int_4),
INTENT(IN) :: msg
5399 INTEGER,
INTENT(IN) :: dest, tag
5402 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_i'
5405#if defined(__parallel)
5406 INTEGER :: ierr, msglen
5409 CALL mp_timeset(routinen, handle)
5411#if defined(__parallel)
5413 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5414 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5415 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5422 cpabort(
"not in parallel mode")
5424 CALL mp_timestop(handle)
5425 END SUBROUTINE mp_send_i
5435 SUBROUTINE mp_send_iv(msg, dest, tag, comm)
5436 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
5437 INTEGER,
INTENT(IN) :: dest, tag
5440 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_iv'
5443#if defined(__parallel)
5444 INTEGER :: ierr, msglen
5447 CALL mp_timeset(routinen, handle)
5449#if defined(__parallel)
5451 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5452 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5453 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5460 cpabort(
"not in parallel mode")
5462 CALL mp_timestop(handle)
5463 END SUBROUTINE mp_send_iv
5473 SUBROUTINE mp_send_im2(msg, dest, tag, comm)
5474 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
5475 INTEGER,
INTENT(IN) :: dest, tag
5478 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_im2'
5481#if defined(__parallel)
5482 INTEGER :: ierr, msglen
5485 CALL mp_timeset(routinen, handle)
5487#if defined(__parallel)
5489 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5490 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5491 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5498 cpabort(
"not in parallel mode")
5500 CALL mp_timestop(handle)
5501 END SUBROUTINE mp_send_im2
5511 SUBROUTINE mp_send_im3(msg, dest, tag, comm)
5512 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
5513 INTEGER,
INTENT(IN) :: dest, tag
5516 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
5519#if defined(__parallel)
5520 INTEGER :: ierr, msglen
5523 CALL mp_timeset(routinen, handle)
5525#if defined(__parallel)
5527 CALL mpi_send(msg, msglen, mpi_integer, dest, tag, comm%handle, ierr)
5528 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
5529 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_4_size)
5536 cpabort(
"not in parallel mode")
5538 CALL mp_timestop(handle)
5539 END SUBROUTINE mp_send_im3
5550 SUBROUTINE mp_recv_i (msg, source, tag, comm)
5551 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5552 INTEGER,
INTENT(INOUT) :: source, tag
5555 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_i'
5558#if defined(__parallel)
5559 INTEGER :: ierr, msglen
5560 mpi_status_type :: status
5563 CALL mp_timeset(routinen, handle)
5565#if defined(__parallel)
5568 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5569 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5571 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5572 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5573 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5574 source = status mpi_status_extract(mpi_source)
5575 tag = status mpi_status_extract(mpi_tag)
5583 cpabort(
"not in parallel mode")
5585 CALL mp_timestop(handle)
5586 END SUBROUTINE mp_recv_i
5596 SUBROUTINE mp_recv_iv(msg, source, tag, comm)
5597 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5598 INTEGER,
INTENT(INOUT) :: source, tag
5601 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_iv'
5604#if defined(__parallel)
5605 INTEGER :: ierr, msglen
5606 mpi_status_type :: status
5609 CALL mp_timeset(routinen, handle)
5611#if defined(__parallel)
5614 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5615 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5617 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5618 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5619 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5620 source = status mpi_status_extract(mpi_source)
5621 tag = status mpi_status_extract(mpi_tag)
5629 cpabort(
"not in parallel mode")
5631 CALL mp_timestop(handle)
5632 END SUBROUTINE mp_recv_iv
5642 SUBROUTINE mp_recv_im2(msg, source, tag, comm)
5643 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
5644 INTEGER,
INTENT(INOUT) :: source, tag
5647 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_im2'
5650#if defined(__parallel)
5651 INTEGER :: ierr, msglen
5652 mpi_status_type :: status
5655 CALL mp_timeset(routinen, handle)
5657#if defined(__parallel)
5660 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5661 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5663 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5664 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5665 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5666 source = status mpi_status_extract(mpi_source)
5667 tag = status mpi_status_extract(mpi_tag)
5675 cpabort(
"not in parallel mode")
5677 CALL mp_timestop(handle)
5678 END SUBROUTINE mp_recv_im2
5688 SUBROUTINE mp_recv_im3(msg, source, tag, comm)
5689 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
5690 INTEGER,
INTENT(INOUT) :: source, tag
5693 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_im3'
5696#if defined(__parallel)
5697 INTEGER :: ierr, msglen
5698 mpi_status_type :: status
5701 CALL mp_timeset(routinen, handle)
5703#if defined(__parallel)
5706 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, mpi_status_ignore, ierr)
5707 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5709 CALL mpi_recv(msg, msglen, mpi_integer, source, tag, comm%handle, status, ierr)
5710 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
5711 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_4_size)
5712 source = status mpi_status_extract(mpi_source)
5713 tag = status mpi_status_extract(mpi_tag)
5721 cpabort(
"not in parallel mode")
5723 CALL mp_timestop(handle)
5724 END SUBROUTINE mp_recv_im3
5734 SUBROUTINE mp_bcast_i (msg, source, comm)
5735 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5736 INTEGER,
INTENT(IN) :: source
5739 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i'
5742#if defined(__parallel)
5743 INTEGER :: ierr, msglen
5746 CALL mp_timeset(routinen, handle)
5748#if defined(__parallel)
5750 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
5751 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5752 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5758 CALL mp_timestop(handle)
5759 END SUBROUTINE mp_bcast_i
5768 SUBROUTINE mp_bcast_i_src(msg, comm)
5769 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5772 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i_src'
5775#if defined(__parallel)
5776 INTEGER :: ierr, msglen
5779 CALL mp_timeset(routinen, handle)
5781#if defined(__parallel)
5783 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
5784 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5785 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5790 CALL mp_timestop(handle)
5791 END SUBROUTINE mp_bcast_i_src
5801 SUBROUTINE mp_ibcast_i (msg, source, comm, request)
5802 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
5803 INTEGER,
INTENT(IN) :: source
5807 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_i'
5810#if defined(__parallel)
5811 INTEGER :: ierr, msglen
5814 CALL mp_timeset(routinen, handle)
5816#if defined(__parallel)
5818 CALL mpi_ibcast(msg, msglen, mpi_integer, source, comm%handle, request%handle, ierr)
5819 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
5820 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_4_size)
5827 CALL mp_timestop(handle)
5828 END SUBROUTINE mp_ibcast_i
5837 SUBROUTINE mp_bcast_iv(msg, source, comm)
5838 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5839 INTEGER,
INTENT(IN) :: source
5842 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_iv'
5845#if defined(__parallel)
5846 INTEGER :: ierr, msglen
5849 CALL mp_timeset(routinen, handle)
5851#if defined(__parallel)
5853 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
5854 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5855 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5861 CALL mp_timestop(handle)
5862 END SUBROUTINE mp_bcast_iv
5870 SUBROUTINE mp_bcast_iv_src(msg, comm)
5871 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
5874 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_iv_src'
5877#if defined(__parallel)
5878 INTEGER :: ierr, msglen
5881 CALL mp_timeset(routinen, handle)
5883#if defined(__parallel)
5885 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
5886 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5887 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5892 CALL mp_timestop(handle)
5893 END SUBROUTINE mp_bcast_iv_src
5902 SUBROUTINE mp_ibcast_iv(msg, source, comm, request)
5903 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
5904 INTEGER,
INTENT(IN) :: source
5908 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_iv'
5911#if defined(__parallel)
5912 INTEGER :: ierr, msglen
5915 CALL mp_timeset(routinen, handle)
5917#if defined(__parallel)
5918#if !defined(__GNUC__) || __GNUC__ >= 9
5919 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
5922 CALL mpi_ibcast(msg, msglen, mpi_integer, source, comm%handle, request%handle, ierr)
5923 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
5924 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_4_size)
5931 CALL mp_timestop(handle)
5932 END SUBROUTINE mp_ibcast_iv
5941 SUBROUTINE mp_bcast_im(msg, source, comm)
5942 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
5943 INTEGER,
INTENT(IN) :: source
5946 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_im'
5949#if defined(__parallel)
5950 INTEGER :: ierr, msglen
5953 CALL mp_timeset(routinen, handle)
5955#if defined(__parallel)
5957 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
5958 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5959 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5965 CALL mp_timestop(handle)
5966 END SUBROUTINE mp_bcast_im
5975 SUBROUTINE mp_bcast_im_src(msg, comm)
5976 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
5979 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_im_src'
5982#if defined(__parallel)
5983 INTEGER :: ierr, msglen
5986 CALL mp_timeset(routinen, handle)
5988#if defined(__parallel)
5990 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
5991 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
5992 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
5997 CALL mp_timestop(handle)
5998 END SUBROUTINE mp_bcast_im_src
6007 SUBROUTINE mp_bcast_i3(msg, source, comm)
6008 INTEGER(KIND=int_4),
CONTIGUOUS :: msg(:, :, :)
6009 INTEGER,
INTENT(IN) :: source
6012 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i3'
6015#if defined(__parallel)
6016 INTEGER :: ierr, msglen
6019 CALL mp_timeset(routinen, handle)
6021#if defined(__parallel)
6023 CALL mpi_bcast(msg, msglen, mpi_integer, source, comm%handle, ierr)
6024 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6025 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6031 CALL mp_timestop(handle)
6032 END SUBROUTINE mp_bcast_i3
6041 SUBROUTINE mp_bcast_i3_src(msg, comm)
6042 INTEGER(KIND=int_4),
CONTIGUOUS :: msg(:, :, :)
6045 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_i3_src'
6048#if defined(__parallel)
6049 INTEGER :: ierr, msglen
6052 CALL mp_timeset(routinen, handle)
6054#if defined(__parallel)
6056 CALL mpi_bcast(msg, msglen, mpi_integer, comm%source, comm%handle, ierr)
6057 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
6058 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_4_size)
6063 CALL mp_timestop(handle)
6064 END SUBROUTINE mp_bcast_i3_src
6073 SUBROUTINE mp_sum_i (msg, comm)
6074 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6077 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_i'
6080#if defined(__parallel)
6081 INTEGER :: ierr, msglen
6082 INTEGER(KIND=int_4) :: res
6085 CALL mp_timeset(routinen, handle)
6087#if defined(__parallel)
6089 IF (comm%num_pe > 1)
THEN
6090 CALL mpi_allreduce(msg, res, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6091 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6094 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6099 CALL mp_timestop(handle)
6100 END SUBROUTINE mp_sum_i
6108 SUBROUTINE mp_sum_iv(msg, comm)
6109 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6112 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_iv'
6115#if defined(__parallel)
6116 INTEGER :: ierr, msglen
6117 INTEGER(KIND=int_4),
ALLOCATABLE :: msgbuf(:)
6120 CALL mp_timeset(routinen, handle)
6122#if defined(__parallel)
6124 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
6125 ALLOCATE (msgbuf(msglen))
6126 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6127 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6130 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6135 CALL mp_timestop(handle)
6136 END SUBROUTINE mp_sum_iv
6144 SUBROUTINE mp_isum_iv(msg, comm, request)
6145 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6149 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_iv'
6152#if defined(__parallel)
6153 INTEGER :: ierr, msglen
6156 CALL mp_timeset(routinen, handle)
6158#if defined(__parallel)
6159#if !defined(__GNUC__) || __GNUC__ >= 9
6160 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
6163 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
6164 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_integer, mpi_sum, comm%handle, request%handle, ierr)
6165 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
6169 CALL add_perf(perf_id=23, count=1, msg_size=msglen*int_4_size)
6175 CALL mp_timestop(handle)
6176 END SUBROUTINE mp_isum_iv
6184 SUBROUTINE mp_sum_im(msg, comm)
6185 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6188 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im'
6191#if defined(__parallel)
6192 INTEGER,
PARAMETER :: max_msg = 2**25
6193 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
6194 INTEGER(KIND=int_4),
ALLOCATABLE :: msgbuf(:)
6197 CALL mp_timeset(routinen, handle)
6199#if defined(__parallel)
6201 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
6203 DO m1 = lbound(msg, 2), ubound(msg, 2), step
6204 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
6205 msglensum = msglensum + msglen
6206 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
6207 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
6208 ALLOCATE (msgbuf(msglen))
6209 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6210 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6211 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
6215 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_4_size)
6220 CALL mp_timestop(handle)
6221 END SUBROUTINE mp_sum_im
6229 SUBROUTINE mp_sum_im3(msg, comm)
6230 INTEGER(KIND=int_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
6233 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im3'
6236#if defined(__parallel)
6237 INTEGER :: ierr, msglen
6238 INTEGER(KIND=int_4),
ALLOCATABLE :: msgbuf(:)
6241 CALL mp_timeset(routinen, handle)
6243#if defined(__parallel)
6245 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
6246 ALLOCATE (msgbuf(msglen))
6247 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6248 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6249 msg = reshape(msgbuf, shape(msg))
6251 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6256 CALL mp_timestop(handle)
6257 END SUBROUTINE mp_sum_im3
6265 SUBROUTINE mp_sum_im4(msg, comm)
6266 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
6269 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_im4'
6272#if defined(__parallel)
6273 INTEGER :: ierr, msglen
6274 INTEGER(KIND=int_4),
ALLOCATABLE :: msgbuf(:)
6277 CALL mp_timeset(routinen, handle)
6279#if defined(__parallel)
6281 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
6282 ALLOCATE (msgbuf(msglen))
6283 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6284 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6285 msg = reshape(msgbuf, shape(msg))
6287 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6292 CALL mp_timestop(handle)
6293 END SUBROUTINE mp_sum_im4
6305 SUBROUTINE mp_sum_root_iv(msg, root, comm)
6306 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6307 INTEGER,
INTENT(IN) :: root
6310 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_iv'
6313#if defined(__parallel)
6314 INTEGER :: ierr, m1, msglen, taskid
6315 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:)
6318 CALL mp_timeset(routinen, handle)
6320#if defined(__parallel)
6322 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6323 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6324 IF (msglen > 0)
THEN
6327 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_sum, &
6328 root, comm%handle, ierr)
6329 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6330 IF (taskid == root)
THEN
6335 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6341 CALL mp_timestop(handle)
6342 END SUBROUTINE mp_sum_root_iv
6353 SUBROUTINE mp_sum_root_im(msg, root, comm)
6354 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6355 INTEGER,
INTENT(IN) :: root
6358 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
6361#if defined(__parallel)
6362 INTEGER :: ierr, m1, m2, msglen, taskid
6363 INTEGER(KIND=int_4),
ALLOCATABLE :: res(:, :)
6366 CALL mp_timeset(routinen, handle)
6368#if defined(__parallel)
6370 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6371 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6372 IF (msglen > 0)
THEN
6375 ALLOCATE (res(m1, m2))
6376 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_sum, root, comm%handle, ierr)
6377 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6378 IF (taskid == root)
THEN
6383 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6389 CALL mp_timestop(handle)
6390 END SUBROUTINE mp_sum_root_im
6398 SUBROUTINE mp_sum_partial_im(msg, res, comm)
6399 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
6400 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
6403 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_im'
6406#if defined(__parallel)
6407 INTEGER :: ierr, msglen, taskid
6410 CALL mp_timeset(routinen, handle)
6412#if defined(__parallel)
6414 CALL mpi_comm_rank(comm%handle, taskid, ierr)
6415 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
6416 IF (msglen > 0)
THEN
6417 CALL mpi_scan(msg, res, msglen, mpi_integer, mpi_sum, comm%handle, ierr)
6418 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
6420 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6426 CALL mp_timestop(handle)
6427 END SUBROUTINE mp_sum_partial_im
6437 SUBROUTINE mp_max_i (msg, comm)
6438 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6441 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_i'
6444#if defined(__parallel)
6445 INTEGER :: ierr, msglen
6446 INTEGER(KIND=int_4) :: res
6449 CALL mp_timeset(routinen, handle)
6451#if defined(__parallel)
6453 IF (comm%num_pe > 1)
THEN
6454 CALL mpi_allreduce(msg, res, msglen, mpi_integer, mpi_max, comm%handle, ierr)
6455 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6458 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6463 CALL mp_timestop(handle)
6464 END SUBROUTINE mp_max_i
6474 SUBROUTINE mp_max_root_i (msg, root, comm)
6475 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6476 INTEGER,
INTENT(IN) :: root
6479 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_i'
6482#if defined(__parallel)
6483 INTEGER :: ierr, msglen
6484 INTEGER(KIND=int_4) :: res
6487 CALL mp_timeset(routinen, handle)
6489#if defined(__parallel)
6491 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_max, root, comm%handle, ierr)
6492 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
6493 IF (root == comm%mepos) msg = res
6494 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6500 CALL mp_timestop(handle)
6501 END SUBROUTINE mp_max_root_i
6511 SUBROUTINE mp_max_iv(msg, comm)
6512 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
6515 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_iv'
6518#if defined(__parallel)
6519 INTEGER :: ierr, msglen
6520 INTEGER(KIND=int_4),
ALLOCATABLE :: msgbuf(:)
6523 CALL mp_timeset(routinen, handle)
6525#if defined(__parallel)
6527 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
6528 ALLOCATE (msgbuf(msglen))
6529 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_integer, mpi_max, comm%handle, ierr)
6530 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6533 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6538 CALL mp_timestop(handle)
6539 END SUBROUTINE mp_max_iv
6549 SUBROUTINE mp_max_im(msg, comm)
6550 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6553 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_im'
6556#if defined(__parallel)
6557 INTEGER,
PARAMETER :: max_msg = 2**25
6558 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
6559 INTEGER(KIND=int_4),
ALLOCATABLE :: msgbuf(:)
6562 CALL mp_timeset(routinen, handle)
6564#if defined(__parallel)
6566 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
6568 DO m1 = lbound(msg, 2), ubound(msg, 2), step
6569 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
6570 msglensum = msglensum + msglen
6571 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
6572 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
6573 ALLOCATE (msgbuf(msglen))
6574 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_integer, mpi_max, comm%handle, ierr)
6575 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6576 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
6580 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_4_size)
6585 CALL mp_timestop(handle)
6586 END SUBROUTINE mp_max_im
6596 SUBROUTINE mp_max_root_im(msg, root, comm)
6597 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6601 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_im'
6604#if defined(__parallel)
6605 INTEGER :: ierr, msglen
6606 INTEGER(KIND=int_4) :: res(size(msg, 1), size(msg, 2))
6609 CALL mp_timeset(routinen, handle)
6611#if defined(__parallel)
6613 CALL mpi_reduce(msg, res, msglen, mpi_integer, mpi_max, root, comm%handle, ierr)
6614 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6615 IF (root == comm%mepos) msg = res
6616 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6622 CALL mp_timestop(handle)
6623 END SUBROUTINE mp_max_root_im
6633 SUBROUTINE mp_min_i (msg, comm)
6634 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6637 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_i'
6640#if defined(__parallel)
6641 INTEGER :: ierr, msglen
6642 INTEGER(KIND=int_4) :: res
6645 CALL mp_timeset(routinen, handle)
6647#if defined(__parallel)
6649 IF (comm%num_pe > 1)
THEN
6650 CALL mpi_allreduce(msg, res, msglen, mpi_integer, mpi_min, comm%handle, ierr)
6651 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6654 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6659 CALL mp_timestop(handle)
6660 END SUBROUTINE mp_min_i
6672 SUBROUTINE mp_min_iv(msg, comm)
6673 INTEGER(KIND=int_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
6676 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_iv'
6679#if defined(__parallel)
6680 INTEGER :: ierr, msglen
6681 INTEGER(KIND=int_4),
ALLOCATABLE :: msgbuf(:)
6684 CALL mp_timeset(routinen, handle)
6686#if defined(__parallel)
6688 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
6689 ALLOCATE (msgbuf(msglen))
6690 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_integer, mpi_min, comm%handle, ierr)
6691 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_min_iv
6710 SUBROUTINE mp_min_im(msg, comm)
6711 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
6714 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_im'
6717#if defined(__parallel)
6718 INTEGER,
PARAMETER :: max_msg = 2**25
6719 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
6720 INTEGER(KIND=int_4),
ALLOCATABLE :: msgbuf(:)
6723 CALL mp_timeset(routinen, handle)
6725#if defined(__parallel)
6727 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
6729 DO m1 = lbound(msg, 2), ubound(msg, 2), step
6730 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
6731 msglensum = msglensum + msglen
6732 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
6733 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
6734 ALLOCATE (msgbuf(msglen))
6735 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_integer, mpi_min, comm%handle, ierr)
6736 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6737 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
6741 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_4_size)
6746 CALL mp_timestop(handle)
6747 END SUBROUTINE mp_min_im
6757 SUBROUTINE mp_prod_i (msg, comm)
6758 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6761 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_i'
6764#if defined(__parallel)
6765 INTEGER :: ierr, msglen
6766 INTEGER(KIND=int_4) :: res
6769 CALL mp_timeset(routinen, handle)
6771#if defined(__parallel)
6773 IF (comm%num_pe > 1)
THEN
6774 CALL mpi_allreduce(msg, res, msglen, mpi_integer, mpi_prod, comm%handle, ierr)
6775 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
6778 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_4_size)
6783 CALL mp_timestop(handle)
6784 END SUBROUTINE mp_prod_i
6795 SUBROUTINE mp_scatter_iv(msg_scatter, msg, root, comm)
6796 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
6797 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
6798 INTEGER,
INTENT(IN) :: root
6801 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_iv'
6804#if defined(__parallel)
6805 INTEGER :: ierr, msglen
6808 CALL mp_timeset(routinen, handle)
6810#if defined(__parallel)
6812 CALL mpi_scatter(msg_scatter, msglen, mpi_integer, msg, &
6813 msglen, mpi_integer, root, comm%handle, ierr)
6814 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
6815 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
6821 CALL mp_timestop(handle)
6822 END SUBROUTINE mp_scatter_iv
6832 SUBROUTINE mp_iscatter_i (msg_scatter, msg, root, comm, request)
6833 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:)
6834 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg
6835 INTEGER,
INTENT(IN) :: root
6839 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_i'
6842#if defined(__parallel)
6843 INTEGER :: ierr, msglen
6846 CALL mp_timeset(routinen, handle)
6848#if defined(__parallel)
6849#if !defined(__GNUC__) || __GNUC__ >= 9
6850 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
6853 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer, msg, &
6854 msglen, mpi_integer, root, comm%handle, request%handle, ierr)
6855 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
6856 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6860 msg = msg_scatter(1)
6863 CALL mp_timestop(handle)
6864 END SUBROUTINE mp_iscatter_i
6874 SUBROUTINE mp_iscatter_iv2(msg_scatter, msg, root, comm, request)
6875 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:, :)
6876 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6877 INTEGER,
INTENT(IN) :: root
6881 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_iv2'
6884#if defined(__parallel)
6885 INTEGER :: ierr, msglen
6888 CALL mp_timeset(routinen, handle)
6890#if defined(__parallel)
6891#if !defined(__GNUC__) || __GNUC__ >= 9
6892 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
6895 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer, msg, &
6896 msglen, mpi_integer, root, comm%handle, request%handle, ierr)
6897 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
6898 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6902 msg(:) = msg_scatter(:, 1)
6905 CALL mp_timestop(handle)
6906 END SUBROUTINE mp_iscatter_iv2
6916 SUBROUTINE mp_iscatterv_iv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
6917 INTEGER(KIND=int_4),
INTENT(IN) :: msg_scatter(:)
6918 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
6919 INTEGER(KIND=int_4),
INTENT(INOUT) :: msg(:)
6920 INTEGER,
INTENT(IN) :: recvcount, root
6924 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_iv'
6927#if defined(__parallel)
6931 CALL mp_timeset(routinen, handle)
6933#if defined(__parallel)
6934#if !defined(__GNUC__) || __GNUC__ >= 9
6935 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
6936 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
6937 cpassert(is_contiguous(sendcounts) .OR.
SIZE(sendcounts) == 0)
6938 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
6940 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_integer, msg, &
6941 recvcount, mpi_integer, root, comm%handle, request%handle, ierr)
6942 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
6943 CALL add_perf(perf_id=24, count=1, msg_size=1*int_4_size)
6945 mark_used(sendcounts)
6947 mark_used(recvcount)
6950 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
6953 CALL mp_timestop(handle)
6954 END SUBROUTINE mp_iscatterv_iv
6965 SUBROUTINE mp_gather_i (msg, msg_gather, root, comm)
6966 INTEGER(KIND=int_4),
INTENT(IN) :: msg
6967 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
6968 INTEGER,
INTENT(IN) :: root
6971 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_i'
6974#if defined(__parallel)
6975 INTEGER :: ierr, msglen
6978 CALL mp_timeset(routinen, handle)
6980#if defined(__parallel)
6982 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
6983 msglen, mpi_integer, root, comm%handle, ierr)
6984 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
6985 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
6991 CALL mp_timestop(handle)
6992 END SUBROUTINE mp_gather_i
7002 SUBROUTINE mp_gather_i_src(msg, msg_gather, comm)
7003 INTEGER(KIND=int_4),
INTENT(IN) :: msg
7004 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
7007 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_i_src'
7010#if defined(__parallel)
7011 INTEGER :: ierr, msglen
7014 CALL mp_timeset(routinen, handle)
7016#if defined(__parallel)
7018 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7019 msglen, mpi_integer, comm%source, comm%handle, ierr)
7020 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7021 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7026 CALL mp_timestop(handle)
7027 END SUBROUTINE mp_gather_i_src
7041 SUBROUTINE mp_gather_iv(msg, msg_gather, root, comm)
7042 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
7043 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
7044 INTEGER,
INTENT(IN) :: root
7047 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_iv'
7050#if defined(__parallel)
7051 INTEGER :: ierr, msglen
7054 CALL mp_timeset(routinen, handle)
7056#if defined(__parallel)
7058 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7059 msglen, mpi_integer, root, comm%handle, ierr)
7060 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7061 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7067 CALL mp_timestop(handle)
7068 END SUBROUTINE mp_gather_iv
7081 SUBROUTINE mp_gather_iv_src(msg, msg_gather, comm)
7082 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
7083 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
7086 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_iv_src'
7089#if defined(__parallel)
7090 INTEGER :: ierr, msglen
7093 CALL mp_timeset(routinen, handle)
7095#if defined(__parallel)
7097 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7098 msglen, mpi_integer, comm%source, comm%handle, ierr)
7099 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7100 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7105 CALL mp_timestop(handle)
7106 END SUBROUTINE mp_gather_iv_src
7120 SUBROUTINE mp_gather_im(msg, msg_gather, root, comm)
7121 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
7122 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
7123 INTEGER,
INTENT(IN) :: root
7126 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_im'
7129#if defined(__parallel)
7130 INTEGER :: ierr, msglen
7133 CALL mp_timeset(routinen, handle)
7135#if defined(__parallel)
7137 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7138 msglen, mpi_integer, root, comm%handle, ierr)
7139 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7140 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7146 CALL mp_timestop(handle)
7147 END SUBROUTINE mp_gather_im
7160 SUBROUTINE mp_gather_im_src(msg, msg_gather, comm)
7161 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
7162 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
7165 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_im_src'
7168#if defined(__parallel)
7169 INTEGER :: ierr, msglen
7172 CALL mp_timeset(routinen, handle)
7174#if defined(__parallel)
7176 CALL mpi_gather(msg, msglen, mpi_integer, msg_gather, &
7177 msglen, mpi_integer, comm%source, comm%handle, ierr)
7178 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
7179 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_4_size)
7184 CALL mp_timestop(handle)
7185 END SUBROUTINE mp_gather_im_src
7202 SUBROUTINE mp_gatherv_iv(sendbuf, recvbuf, recvcounts, displs, root, comm)
7204 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7205 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7206 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7207 INTEGER,
INTENT(IN) :: root
7210 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_iv'
7213#if defined(__parallel)
7214 INTEGER :: ierr, sendcount
7217 CALL mp_timeset(routinen, handle)
7219#if defined(__parallel)
7220 sendcount =
SIZE(sendbuf)
7221 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7222 recvbuf, recvcounts, displs, mpi_integer, &
7223 root, comm%handle, ierr)
7224 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7225 CALL add_perf(perf_id=4, &
7227 msg_size=sendcount*int_4_size)
7229 mark_used(recvcounts)
7232 recvbuf(1 + displs(1):) = sendbuf
7234 CALL mp_timestop(handle)
7235 END SUBROUTINE mp_gatherv_iv
7251 SUBROUTINE mp_gatherv_iv_src(sendbuf, recvbuf, recvcounts, displs, comm)
7253 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7254 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7255 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7258 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_iv_src'
7261#if defined(__parallel)
7262 INTEGER :: ierr, sendcount
7265 CALL mp_timeset(routinen, handle)
7267#if defined(__parallel)
7268 sendcount =
SIZE(sendbuf)
7269 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7270 recvbuf, recvcounts, displs, mpi_integer, &
7271 comm%source, comm%handle, ierr)
7272 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7273 CALL add_perf(perf_id=4, &
7275 msg_size=sendcount*int_4_size)
7277 mark_used(recvcounts)
7279 recvbuf(1 + displs(1):) = sendbuf
7281 CALL mp_timestop(handle)
7282 END SUBROUTINE mp_gatherv_iv_src
7299 SUBROUTINE mp_gatherv_im2(sendbuf, recvbuf, recvcounts, displs, root, comm)
7301 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7302 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7303 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7304 INTEGER,
INTENT(IN) :: root
7307 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_im2'
7310#if defined(__parallel)
7311 INTEGER :: ierr, sendcount
7314 CALL mp_timeset(routinen, handle)
7316#if defined(__parallel)
7317 sendcount =
SIZE(sendbuf)
7318 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7319 recvbuf, recvcounts, displs, mpi_integer, &
7320 root, comm%handle, ierr)
7321 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7322 CALL add_perf(perf_id=4, &
7324 msg_size=sendcount*int_4_size)
7326 mark_used(recvcounts)
7329 recvbuf(:, 1 + displs(1):) = sendbuf
7331 CALL mp_timestop(handle)
7332 END SUBROUTINE mp_gatherv_im2
7348 SUBROUTINE mp_gatherv_im2_src(sendbuf, recvbuf, recvcounts, displs, comm)
7350 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
7351 INTEGER(KIND=int_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
7352 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7355 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_im2_src'
7358#if defined(__parallel)
7359 INTEGER :: ierr, sendcount
7362 CALL mp_timeset(routinen, handle)
7364#if defined(__parallel)
7365 sendcount =
SIZE(sendbuf)
7366 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer, &
7367 recvbuf, recvcounts, displs, mpi_integer, &
7368 comm%source, comm%handle, ierr)
7369 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7370 CALL add_perf(perf_id=4, &
7372 msg_size=sendcount*int_4_size)
7374 mark_used(recvcounts)
7376 recvbuf(:, 1 + displs(1):) = sendbuf
7378 CALL mp_timestop(handle)
7379 END SUBROUTINE mp_gatherv_im2_src
7396 SUBROUTINE mp_igatherv_iv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
7397 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
7398 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
7399 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
7400 INTEGER,
INTENT(IN) :: sendcount, root
7404 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_iv'
7407#if defined(__parallel)
7411 CALL mp_timeset(routinen, handle)
7413#if defined(__parallel)
7414#if !defined(__GNUC__) || __GNUC__ >= 9
7415 cpassert(is_contiguous(sendbuf) .OR.
SIZE(sendbuf) == 0)
7416 cpassert(is_contiguous(recvbuf) .OR.
SIZE(recvbuf) == 0)
7417 cpassert(is_contiguous(recvcounts) .OR.
SIZE(recvcounts) == 0)
7418 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
7420 CALL mpi_igatherv(sendbuf, sendcount, mpi_integer, &
7421 recvbuf, recvcounts, displs, mpi_integer, &
7422 root, comm%handle, request%handle, ierr)
7423 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
7424 CALL add_perf(perf_id=24, &
7426 msg_size=sendcount*int_4_size)
7428 mark_used(sendcount)
7429 mark_used(recvcounts)
7432 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
7435 CALL mp_timestop(handle)
7436 END SUBROUTINE mp_igatherv_iv
7449 SUBROUTINE mp_allgather_i (msgout, msgin, comm)
7450 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7451 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
7454 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i'
7457#if defined(__parallel)
7458 INTEGER :: ierr, rcount, scount
7461 CALL mp_timeset(routinen, handle)
7463#if defined(__parallel)
7466 CALL mpi_allgather(msgout, scount, mpi_integer, &
7467 msgin, rcount, mpi_integer, &
7469 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7474 CALL mp_timestop(handle)
7475 END SUBROUTINE mp_allgather_i
7488 SUBROUTINE mp_allgather_i2(msgout, msgin, comm)
7489 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7490 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7493 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i2'
7496#if defined(__parallel)
7497 INTEGER :: ierr, rcount, scount
7500 CALL mp_timeset(routinen, handle)
7502#if defined(__parallel)
7505 CALL mpi_allgather(msgout, scount, mpi_integer, &
7506 msgin, rcount, mpi_integer, &
7508 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7513 CALL mp_timestop(handle)
7514 END SUBROUTINE mp_allgather_i2
7527 SUBROUTINE mp_iallgather_i (msgout, msgin, comm, request)
7528 INTEGER(KIND=int_4),
INTENT(IN) :: msgout
7529 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
7533 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i'
7536#if defined(__parallel)
7537 INTEGER :: ierr, rcount, scount
7540 CALL mp_timeset(routinen, handle)
7542#if defined(__parallel)
7543#if !defined(__GNUC__) || __GNUC__ >= 9
7544 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
7548 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7549 msgin, rcount, mpi_integer, &
7550 comm%handle, request%handle, ierr)
7551 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7557 CALL mp_timestop(handle)
7558 END SUBROUTINE mp_iallgather_i
7573 SUBROUTINE mp_allgather_i12(msgout, msgin, comm)
7574 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
7575 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7578 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i12'
7581#if defined(__parallel)
7582 INTEGER :: ierr, rcount, scount
7585 CALL mp_timeset(routinen, handle)
7587#if defined(__parallel)
7588 scount =
SIZE(msgout(:))
7590 CALL mpi_allgather(msgout, scount, mpi_integer, &
7591 msgin, rcount, mpi_integer, &
7593 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7596 msgin(:, 1) = msgout(:)
7598 CALL mp_timestop(handle)
7599 END SUBROUTINE mp_allgather_i12
7609 SUBROUTINE mp_allgather_i23(msgout, msgin, comm)
7610 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
7611 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
7614 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i23'
7617#if defined(__parallel)
7618 INTEGER :: ierr, rcount, scount
7621 CALL mp_timeset(routinen, handle)
7623#if defined(__parallel)
7624 scount =
SIZE(msgout(:, :))
7626 CALL mpi_allgather(msgout, scount, mpi_integer, &
7627 msgin, rcount, mpi_integer, &
7629 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7632 msgin(:, :, 1) = msgout(:, :)
7634 CALL mp_timestop(handle)
7635 END SUBROUTINE mp_allgather_i23
7645 SUBROUTINE mp_allgather_i34(msgout, msgin, comm)
7646 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
7647 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
7650 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i34'
7653#if defined(__parallel)
7654 INTEGER :: ierr, rcount, scount
7657 CALL mp_timeset(routinen, handle)
7659#if defined(__parallel)
7660 scount =
SIZE(msgout(:, :, :))
7662 CALL mpi_allgather(msgout, scount, mpi_integer, &
7663 msgin, rcount, mpi_integer, &
7665 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7668 msgin(:, :, :, 1) = msgout(:, :, :)
7670 CALL mp_timestop(handle)
7671 END SUBROUTINE mp_allgather_i34
7681 SUBROUTINE mp_allgather_i22(msgout, msgin, comm)
7682 INTEGER(KIND=int_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
7683 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
7686 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_i22'
7689#if defined(__parallel)
7690 INTEGER :: ierr, rcount, scount
7693 CALL mp_timeset(routinen, handle)
7695#if defined(__parallel)
7696 scount =
SIZE(msgout(:, :))
7698 CALL mpi_allgather(msgout, scount, mpi_integer, &
7699 msgin, rcount, mpi_integer, &
7701 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
7704 msgin(:, :) = msgout(:, :)
7706 CALL mp_timestop(handle)
7707 END SUBROUTINE mp_allgather_i22
7718 SUBROUTINE mp_iallgather_i11(msgout, msgin, comm, request)
7719 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
7720 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
7724 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i11'
7727#if defined(__parallel)
7728 INTEGER :: ierr, rcount, scount
7731 CALL mp_timeset(routinen, handle)
7733#if defined(__parallel)
7734#if !defined(__GNUC__) || __GNUC__ >= 9
7735 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
7736 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
7738 scount =
SIZE(msgout(:))
7740 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7741 msgin, rcount, mpi_integer, &
7742 comm%handle, request%handle, ierr)
7743 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7749 CALL mp_timestop(handle)
7750 END SUBROUTINE mp_iallgather_i11
7761 SUBROUTINE mp_iallgather_i13(msgout, msgin, comm, request)
7762 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
7763 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :)
7767 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i13'
7770#if defined(__parallel)
7771 INTEGER :: ierr, rcount, scount
7774 CALL mp_timeset(routinen, handle)
7776#if defined(__parallel)
7777#if !defined(__GNUC__) || __GNUC__ >= 9
7778 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
7779 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
7782 scount =
SIZE(msgout(:))
7784 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7785 msgin, rcount, mpi_integer, &
7786 comm%handle, request%handle, ierr)
7787 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7790 msgin(:, 1, 1) = msgout(:)
7793 CALL mp_timestop(handle)
7794 END SUBROUTINE mp_iallgather_i13
7805 SUBROUTINE mp_iallgather_i22(msgout, msgin, comm, request)
7806 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :)
7807 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :)
7811 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i22'
7814#if defined(__parallel)
7815 INTEGER :: ierr, rcount, scount
7818 CALL mp_timeset(routinen, handle)
7820#if defined(__parallel)
7821#if !defined(__GNUC__) || __GNUC__ >= 9
7822 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
7823 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
7826 scount =
SIZE(msgout(:, :))
7828 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7829 msgin, rcount, mpi_integer, &
7830 comm%handle, request%handle, ierr)
7831 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7834 msgin(:, :) = msgout(:, :)
7837 CALL mp_timestop(handle)
7838 END SUBROUTINE mp_iallgather_i22
7849 SUBROUTINE mp_iallgather_i24(msgout, msgin, comm, request)
7850 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :)
7851 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :, :)
7855 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i24'
7858#if defined(__parallel)
7859 INTEGER :: ierr, rcount, scount
7862 CALL mp_timeset(routinen, handle)
7864#if defined(__parallel)
7865#if !defined(__GNUC__) || __GNUC__ >= 9
7866 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
7867 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
7870 scount =
SIZE(msgout(:, :))
7872 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7873 msgin, rcount, mpi_integer, &
7874 comm%handle, request%handle, ierr)
7875 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7878 msgin(:, :, 1, 1) = msgout(:, :)
7881 CALL mp_timestop(handle)
7882 END SUBROUTINE mp_iallgather_i24
7893 SUBROUTINE mp_iallgather_i33(msgout, msgin, comm, request)
7894 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:, :, :)
7895 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:, :, :)
7899 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_i33'
7902#if defined(__parallel)
7903 INTEGER :: ierr, rcount, scount
7906 CALL mp_timeset(routinen, handle)
7908#if defined(__parallel)
7909#if !defined(__GNUC__) || __GNUC__ >= 9
7910 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
7911 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
7914 scount =
SIZE(msgout(:, :, :))
7916 CALL mpi_iallgather(msgout, scount, mpi_integer, &
7917 msgin, rcount, mpi_integer, &
7918 comm%handle, request%handle, ierr)
7919 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
7922 msgin(:, :, :) = msgout(:, :, :)
7925 CALL mp_timestop(handle)
7926 END SUBROUTINE mp_iallgather_i33
7945 SUBROUTINE mp_allgatherv_iv(msgout, msgin, rcount, rdispl, comm)
7946 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
7947 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
7948 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
7951 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_iv'
7954#if defined(__parallel)
7955 INTEGER :: ierr, scount
7958 CALL mp_timeset(routinen, handle)
7960#if defined(__parallel)
7961 scount =
SIZE(msgout)
7962 CALL mpi_allgatherv(msgout, scount, mpi_integer, msgin, rcount, &
7963 rdispl, mpi_integer, comm%handle, ierr)
7964 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
7971 CALL mp_timestop(handle)
7972 END SUBROUTINE mp_allgatherv_iv
7991 SUBROUTINE mp_allgatherv_im2(msgout, msgin, rcount, rdispl, comm)
7992 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
7993 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
7994 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
7997 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_iv'
8000#if defined(__parallel)
8001 INTEGER :: ierr, scount
8004 CALL mp_timeset(routinen, handle)
8006#if defined(__parallel)
8007 scount =
SIZE(msgout)
8008 CALL mpi_allgatherv(msgout, scount, mpi_integer, msgin, rcount, &
8009 rdispl, mpi_integer, comm%handle, ierr)
8010 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
8017 CALL mp_timestop(handle)
8018 END SUBROUTINE mp_allgatherv_im2
8037 SUBROUTINE mp_iallgatherv_iv(msgout, msgin, rcount, rdispl, comm, request)
8038 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
8039 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
8040 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
8044 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_iv'
8047#if defined(__parallel)
8048 INTEGER :: ierr, scount, rsize
8051 CALL mp_timeset(routinen, handle)
8053#if defined(__parallel)
8054#if !defined(__GNUC__) || __GNUC__ >= 9
8055 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
8056 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
8057 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
8058 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
8061 scount =
SIZE(msgout)
8062 rsize =
SIZE(rcount)
8063 CALL mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, &
8064 rdispl, comm, request, ierr)
8065 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
8073 CALL mp_timestop(handle)
8074 END SUBROUTINE mp_iallgatherv_iv
8093 SUBROUTINE mp_iallgatherv_iv2(msgout, msgin, rcount, rdispl, comm, request)
8094 INTEGER(KIND=int_4),
INTENT(IN) :: msgout(:)
8095 INTEGER(KIND=int_4),
INTENT(OUT) :: msgin(:)
8096 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
8100 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_iv2'
8103#if defined(__parallel)
8104 INTEGER :: ierr, scount, rsize
8107 CALL mp_timeset(routinen, handle)
8109#if defined(__parallel)
8110#if !defined(__GNUC__) || __GNUC__ >= 9
8111 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
8112 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
8113 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
8114 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
8117 scount =
SIZE(msgout)
8118 rsize =
SIZE(rcount)
8119 CALL mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, &
8120 rdispl, comm, request, ierr)
8121 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
8129 CALL mp_timestop(handle)
8130 END SUBROUTINE mp_iallgatherv_iv2
8141#if defined(__parallel)
8142 SUBROUTINE mp_iallgatherv_iv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
8143 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
8144 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
8145 INTEGER,
INTENT(IN) :: rsize
8146 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
8149 INTEGER,
INTENT(INOUT) :: ierr
8151 CALL mpi_iallgatherv(msgout, scount, mpi_integer, msgin, rcount, &
8152 rdispl, mpi_integer, comm%handle, request%handle, ierr)
8154 END SUBROUTINE mp_iallgatherv_iv_internal
8165 SUBROUTINE mp_sum_scatter_iv(msgout, msgin, rcount, comm)
8166 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
8167 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
8168 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
8171 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_iv'
8174#if defined(__parallel)
8178 CALL mp_timeset(routinen, handle)
8180#if defined(__parallel)
8181 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_integer, mpi_sum, &
8183 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
8185 CALL add_perf(perf_id=3, count=1, &
8186 msg_size=rcount(1)*2*int_4_size)
8190 msgin = msgout(:, 1)
8192 CALL mp_timestop(handle)
8193 END SUBROUTINE mp_sum_scatter_iv
8204 SUBROUTINE mp_sendrecv_i (msgin, dest, msgout, source, comm, tag)
8205 INTEGER(KIND=int_4),
INTENT(IN) :: msgin
8206 INTEGER,
INTENT(IN) :: dest
8207 INTEGER(KIND=int_4),
INTENT(OUT) :: msgout
8208 INTEGER,
INTENT(IN) :: source
8210 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8212 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_i'
8215#if defined(__parallel)
8216 INTEGER :: ierr, msglen_in, msglen_out, &
8220 CALL mp_timeset(routinen, handle)
8222#if defined(__parallel)
8227 IF (
PRESENT(tag))
THEN
8231 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8232 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8233 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8234 CALL add_perf(perf_id=7, count=1, &
8235 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8243 CALL mp_timestop(handle)
8244 END SUBROUTINE mp_sendrecv_i
8255 SUBROUTINE mp_sendrecv_iv(msgin, dest, msgout, source, comm, tag)
8256 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
8257 INTEGER,
INTENT(IN) :: dest
8258 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
8259 INTEGER,
INTENT(IN) :: source
8261 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8263 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_iv'
8266#if defined(__parallel)
8267 INTEGER :: ierr, msglen_in, msglen_out, &
8271 CALL mp_timeset(routinen, handle)
8273#if defined(__parallel)
8274 msglen_in =
SIZE(msgin)
8275 msglen_out =
SIZE(msgout)
8278 IF (
PRESENT(tag))
THEN
8282 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8283 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8284 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8285 CALL add_perf(perf_id=7, count=1, &
8286 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8294 CALL mp_timestop(handle)
8295 END SUBROUTINE mp_sendrecv_iv
8307 SUBROUTINE mp_sendrecv_im2(msgin, dest, msgout, source, comm, tag)
8308 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
8309 INTEGER,
INTENT(IN) :: dest
8310 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
8311 INTEGER,
INTENT(IN) :: source
8313 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8315 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im2'
8318#if defined(__parallel)
8319 INTEGER :: ierr, msglen_in, msglen_out, &
8323 CALL mp_timeset(routinen, handle)
8325#if defined(__parallel)
8326 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
8327 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
8330 IF (
PRESENT(tag))
THEN
8334 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8335 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8336 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8337 CALL add_perf(perf_id=7, count=1, &
8338 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8346 CALL mp_timestop(handle)
8347 END SUBROUTINE mp_sendrecv_im2
8358 SUBROUTINE mp_sendrecv_im3(msgin, dest, msgout, source, comm, tag)
8359 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
8360 INTEGER,
INTENT(IN) :: dest
8361 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
8362 INTEGER,
INTENT(IN) :: source
8364 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8366 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im3'
8369#if defined(__parallel)
8370 INTEGER :: ierr, msglen_in, msglen_out, &
8374 CALL mp_timeset(routinen, handle)
8376#if defined(__parallel)
8377 msglen_in =
SIZE(msgin)
8378 msglen_out =
SIZE(msgout)
8381 IF (
PRESENT(tag))
THEN
8385 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8386 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8387 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8388 CALL add_perf(perf_id=7, count=1, &
8389 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8397 CALL mp_timestop(handle)
8398 END SUBROUTINE mp_sendrecv_im3
8409 SUBROUTINE mp_sendrecv_im4(msgin, dest, msgout, source, comm, tag)
8410 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
8411 INTEGER,
INTENT(IN) :: dest
8412 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
8413 INTEGER,
INTENT(IN) :: source
8415 INTEGER,
INTENT(IN),
OPTIONAL :: tag
8417 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_im4'
8420#if defined(__parallel)
8421 INTEGER :: ierr, msglen_in, msglen_out, &
8425 CALL mp_timeset(routinen, handle)
8427#if defined(__parallel)
8428 msglen_in =
SIZE(msgin)
8429 msglen_out =
SIZE(msgout)
8432 IF (
PRESENT(tag))
THEN
8436 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer, dest, send_tag, msgout, &
8437 msglen_out, mpi_integer, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
8438 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
8439 CALL add_perf(perf_id=7, count=1, &
8440 msg_size=(msglen_in + msglen_out)*int_4_size/2)
8448 CALL mp_timestop(handle)
8449 END SUBROUTINE mp_sendrecv_im4
8466 SUBROUTINE mp_isendrecv_i (msgin, dest, msgout, source, comm, send_request, &
8468 INTEGER(KIND=int_4),
INTENT(IN) :: msgin
8469 INTEGER,
INTENT(IN) :: dest
8470 INTEGER(KIND=int_4),
INTENT(INOUT) :: msgout
8471 INTEGER,
INTENT(IN) :: source
8474 INTEGER,
INTENT(in),
OPTIONAL :: tag
8476 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_i'
8479#if defined(__parallel)
8480 INTEGER :: ierr, my_tag
8483 CALL mp_timeset(routinen, handle)
8485#if defined(__parallel)
8487 IF (
PRESENT(tag)) my_tag = tag
8489 CALL mpi_irecv(msgout, 1, mpi_integer, source, my_tag, &
8490 comm%handle, recv_request%handle, ierr)
8491 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8493 CALL mpi_isend(msgin, 1, mpi_integer, dest, my_tag, &
8494 comm%handle, send_request%handle, ierr)
8495 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8497 CALL add_perf(perf_id=8, count=1, msg_size=2*int_4_size)
8507 CALL mp_timestop(handle)
8508 END SUBROUTINE mp_isendrecv_i
8527 SUBROUTINE mp_isendrecv_iv(msgin, dest, msgout, source, comm, send_request, &
8529 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: msgin
8530 INTEGER,
INTENT(IN) :: dest
8531 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
8532 INTEGER,
INTENT(IN) :: source
8535 INTEGER,
INTENT(in),
OPTIONAL :: tag
8537 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_iv'
8540#if defined(__parallel)
8541 INTEGER :: ierr, msglen, my_tag
8542 INTEGER(KIND=int_4) :: foo
8545 CALL mp_timeset(routinen, handle)
8547#if defined(__parallel)
8548#if !defined(__GNUC__) || __GNUC__ >= 9
8549 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
8550 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
8554 IF (
PRESENT(tag)) my_tag = tag
8556 msglen =
SIZE(msgout, 1)
8557 IF (msglen > 0)
THEN
8558 CALL mpi_irecv(msgout(1), msglen, mpi_integer, source, my_tag, &
8559 comm%handle, recv_request%handle, ierr)
8561 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8562 comm%handle, recv_request%handle, ierr)
8564 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8566 msglen =
SIZE(msgin, 1)
8567 IF (msglen > 0)
THEN
8568 CALL mpi_isend(msgin(1), msglen, mpi_integer, dest, my_tag, &
8569 comm%handle, send_request%handle, ierr)
8571 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8572 comm%handle, send_request%handle, ierr)
8574 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8576 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
8577 CALL add_perf(perf_id=8, count=1, msg_size=msglen*int_4_size)
8587 CALL mp_timestop(handle)
8588 END SUBROUTINE mp_isendrecv_iv
8603 SUBROUTINE mp_isend_iv(msgin, dest, comm, request, tag)
8604 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: msgin
8605 INTEGER,
INTENT(IN) :: dest
8608 INTEGER,
INTENT(in),
OPTIONAL :: tag
8610 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_iv'
8612 INTEGER :: handle, ierr
8613#if defined(__parallel)
8614 INTEGER :: msglen, my_tag
8615 INTEGER(KIND=int_4) :: foo(1)
8618 CALL mp_timeset(routinen, handle)
8620#if defined(__parallel)
8621#if !defined(__GNUC__) || __GNUC__ >= 9
8622 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
8625 IF (
PRESENT(tag)) my_tag = tag
8627 msglen =
SIZE(msgin)
8628 IF (msglen > 0)
THEN
8629 CALL mpi_isend(msgin(1), msglen, mpi_integer, dest, my_tag, &
8630 comm%handle, request%handle, ierr)
8632 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8633 comm%handle, request%handle, ierr)
8635 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8637 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8646 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8648 CALL mp_timestop(handle)
8649 END SUBROUTINE mp_isend_iv
8666 SUBROUTINE mp_isend_im2(msgin, dest, comm, request, tag)
8667 INTEGER(KIND=int_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
8668 INTEGER,
INTENT(IN) :: dest
8671 INTEGER,
INTENT(in),
OPTIONAL :: tag
8673 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im2'
8675 INTEGER :: handle, ierr
8676#if defined(__parallel)
8677 INTEGER :: msglen, my_tag
8678 INTEGER(KIND=int_4) :: foo(1)
8681 CALL mp_timeset(routinen, handle)
8683#if defined(__parallel)
8684#if !defined(__GNUC__) || __GNUC__ >= 9
8685 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
8689 IF (
PRESENT(tag)) my_tag = tag
8691 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
8692 IF (msglen > 0)
THEN
8693 CALL mpi_isend(msgin(1, 1), msglen, mpi_integer, dest, my_tag, &
8694 comm%handle, request%handle, ierr)
8696 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8697 comm%handle, request%handle, ierr)
8699 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8701 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8710 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8712 CALL mp_timestop(handle)
8713 END SUBROUTINE mp_isend_im2
8732 SUBROUTINE mp_isend_im3(msgin, dest, comm, request, tag)
8733 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
8734 INTEGER,
INTENT(IN) :: dest
8737 INTEGER,
INTENT(in),
OPTIONAL :: tag
8739 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im3'
8741 INTEGER :: handle, ierr
8742#if defined(__parallel)
8743 INTEGER :: msglen, my_tag
8744 INTEGER(KIND=int_4) :: foo(1)
8747 CALL mp_timeset(routinen, handle)
8749#if defined(__parallel)
8750#if !defined(__GNUC__) || __GNUC__ >= 9
8751 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
8755 IF (
PRESENT(tag)) my_tag = tag
8757 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
8758 IF (msglen > 0)
THEN
8759 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_integer, dest, my_tag, &
8760 comm%handle, request%handle, ierr)
8762 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8763 comm%handle, request%handle, ierr)
8765 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8767 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8776 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8778 CALL mp_timestop(handle)
8779 END SUBROUTINE mp_isend_im3
8795 SUBROUTINE mp_isend_im4(msgin, dest, comm, request, tag)
8796 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
8797 INTEGER,
INTENT(IN) :: dest
8800 INTEGER,
INTENT(in),
OPTIONAL :: tag
8802 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_im4'
8804 INTEGER :: handle, ierr
8805#if defined(__parallel)
8806 INTEGER :: msglen, my_tag
8807 INTEGER(KIND=int_4) :: foo(1)
8810 CALL mp_timeset(routinen, handle)
8812#if defined(__parallel)
8813#if !defined(__GNUC__) || __GNUC__ >= 9
8814 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
8818 IF (
PRESENT(tag)) my_tag = tag
8820 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
8821 IF (msglen > 0)
THEN
8822 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_integer, dest, my_tag, &
8823 comm%handle, request%handle, ierr)
8825 CALL mpi_isend(foo, msglen, mpi_integer, dest, my_tag, &
8826 comm%handle, request%handle, ierr)
8828 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
8830 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_4_size)
8839 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
8841 CALL mp_timestop(handle)
8842 END SUBROUTINE mp_isend_im4
8858 SUBROUTINE mp_irecv_iv(msgout, source, comm, request, tag)
8859 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
8860 INTEGER,
INTENT(IN) :: source
8863 INTEGER,
INTENT(in),
OPTIONAL :: tag
8865 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_iv'
8868#if defined(__parallel)
8869 INTEGER :: ierr, msglen, my_tag
8870 INTEGER(KIND=int_4) :: foo(1)
8873 CALL mp_timeset(routinen, handle)
8875#if defined(__parallel)
8876#if !defined(__GNUC__) || __GNUC__ >= 9
8877 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
8881 IF (
PRESENT(tag)) my_tag = tag
8883 msglen =
SIZE(msgout)
8884 IF (msglen > 0)
THEN
8885 CALL mpi_irecv(msgout(1), msglen, mpi_integer, source, my_tag, &
8886 comm%handle, request%handle, ierr)
8888 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8889 comm%handle, request%handle, ierr)
8891 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8893 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
8895 cpabort(
"mp_irecv called in non parallel case")
8902 CALL mp_timestop(handle)
8903 END SUBROUTINE mp_irecv_iv
8920 SUBROUTINE mp_irecv_im2(msgout, source, comm, request, tag)
8921 INTEGER(KIND=int_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
8922 INTEGER,
INTENT(IN) :: source
8925 INTEGER,
INTENT(in),
OPTIONAL :: tag
8927 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im2'
8930#if defined(__parallel)
8931 INTEGER :: ierr, msglen, my_tag
8932 INTEGER(KIND=int_4) :: foo(1)
8935 CALL mp_timeset(routinen, handle)
8937#if defined(__parallel)
8938#if !defined(__GNUC__) || __GNUC__ >= 9
8939 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
8943 IF (
PRESENT(tag)) my_tag = tag
8945 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
8946 IF (msglen > 0)
THEN
8947 CALL mpi_irecv(msgout(1, 1), msglen, mpi_integer, source, my_tag, &
8948 comm%handle, request%handle, ierr)
8950 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
8951 comm%handle, request%handle, ierr)
8953 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
8955 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
8962 cpabort(
"mp_irecv called in non parallel case")
8964 CALL mp_timestop(handle)
8965 END SUBROUTINE mp_irecv_im2
8983 SUBROUTINE mp_irecv_im3(msgout, source, comm, request, tag)
8984 INTEGER(KIND=int_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
8985 INTEGER,
INTENT(IN) :: source
8988 INTEGER,
INTENT(in),
OPTIONAL :: tag
8990 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im3'
8993#if defined(__parallel)
8994 INTEGER :: ierr, msglen, my_tag
8995 INTEGER(KIND=int_4) :: foo(1)
8998 CALL mp_timeset(routinen, handle)
9000#if defined(__parallel)
9001#if !defined(__GNUC__) || __GNUC__ >= 9
9002 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
9006 IF (
PRESENT(tag)) my_tag = tag
9008 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
9009 IF (msglen > 0)
THEN
9010 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_integer, source, my_tag, &
9011 comm%handle, request%handle, ierr)
9013 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
9014 comm%handle, request%handle, ierr)
9016 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
9018 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
9025 cpabort(
"mp_irecv called in non parallel case")
9027 CALL mp_timestop(handle)
9028 END SUBROUTINE mp_irecv_im3
9044 SUBROUTINE mp_irecv_im4(msgout, source, comm, request, tag)
9045 INTEGER(KIND=int_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
9046 INTEGER,
INTENT(IN) :: source
9049 INTEGER,
INTENT(in),
OPTIONAL :: tag
9051 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_im4'
9054#if defined(__parallel)
9055 INTEGER :: ierr, msglen, my_tag
9056 INTEGER(KIND=int_4) :: foo(1)
9059 CALL mp_timeset(routinen, handle)
9061#if defined(__parallel)
9062#if !defined(__GNUC__) || __GNUC__ >= 9
9063 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
9067 IF (
PRESENT(tag)) my_tag = tag
9069 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
9070 IF (msglen > 0)
THEN
9071 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_integer, source, my_tag, &
9072 comm%handle, request%handle, ierr)
9074 CALL mpi_irecv(foo, msglen, mpi_integer, source, my_tag, &
9075 comm%handle, request%handle, ierr)
9077 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
9079 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_4_size)
9086 cpabort(
"mp_irecv called in non parallel case")
9088 CALL mp_timestop(handle)
9089 END SUBROUTINE mp_irecv_im4
9101 SUBROUTINE mp_win_create_iv(base, comm, win)
9102 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
9106 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_iv'
9109#if defined(__parallel)
9111 INTEGER(kind=mpi_address_kind) :: len
9112 INTEGER(KIND=int_4) :: foo(1)
9115 CALL mp_timeset(routinen, handle)
9117#if defined(__parallel)
9119 len =
SIZE(base)*int_4_size
9121 CALL mpi_win_create(base(1), len, int_4_size, mpi_info_null, comm%handle, win%handle, ierr)
9123 CALL mpi_win_create(foo, len, int_4_size, mpi_info_null, comm%handle, win%handle, ierr)
9125 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
9127 CALL add_perf(perf_id=20, count=1)
9131 win%handle = mp_win_null_handle
9133 CALL mp_timestop(handle)
9134 END SUBROUTINE mp_win_create_iv
9146 SUBROUTINE mp_rget_iv(base, source, win, win_data, myproc, disp, request, &
9147 origin_datatype, target_datatype)
9148 INTEGER(KIND=int_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
9149 INTEGER,
INTENT(IN) :: source
9151 INTEGER(KIND=int_4),
DIMENSION(:),
INTENT(IN) :: win_data
9152 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
9156 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_iv'
9159#if defined(__parallel)
9160 INTEGER :: ierr, len, &
9161 origin_len, target_len
9162 LOGICAL :: do_local_copy
9163 INTEGER(kind=mpi_address_kind) :: disp_aint
9164 mpi_data_type :: handle_origin_datatype, handle_target_datatype
9167 CALL mp_timeset(routinen, handle)
9169#if defined(__parallel)
9172 IF (
PRESENT(disp))
THEN
9173 disp_aint = int(disp, kind=mpi_address_kind)
9175 handle_origin_datatype = mpi_integer
9177 IF (
PRESENT(origin_datatype))
THEN
9178 handle_origin_datatype = origin_datatype%type_handle
9181 handle_target_datatype = mpi_integer
9183 IF (
PRESENT(target_datatype))
THEN
9184 handle_target_datatype = target_datatype%type_handle
9188 do_local_copy = .false.
9189 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
9190 IF (myproc .EQ. source) do_local_copy = .true.
9192 IF (do_local_copy)
THEN
9194 base(:) = win_data(disp_aint + 1:disp_aint + len)
9199 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
9200 target_len, handle_target_datatype, win%handle, request%handle, ierr)
9206 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
9208 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*int_4_size)
9213 mark_used(origin_datatype)
9214 mark_used(target_datatype)
9218 IF (
PRESENT(disp))
THEN
9219 base(:) = win_data(disp + 1:disp +
SIZE(base))
9221 base(:) = win_data(:
SIZE(base))
9225 CALL mp_timestop(handle)
9226 END SUBROUTINE mp_rget_iv
9235 FUNCTION mp_type_indexed_make_i (count, lengths, displs) &
9236 result(type_descriptor)
9237 INTEGER,
INTENT(IN) :: count
9238 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
9241 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_i'
9244#if defined(__parallel)
9248 CALL mp_timeset(routinen, handle)
9250#if defined(__parallel)
9251 CALL mpi_type_indexed(count, lengths, displs, mpi_integer, &
9252 type_descriptor%type_handle, ierr)
9254 cpabort(
"MPI_Type_Indexed @ "//routinen)
9255 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
9257 cpabort(
"MPI_Type_commit @ "//routinen)
9259 type_descriptor%type_handle = 17
9261 type_descriptor%length = count
9262 NULLIFY (type_descriptor%subtype)
9263 type_descriptor%vector_descriptor(1:2) = 1
9264 type_descriptor%has_indexing = .true.
9265 type_descriptor%index_descriptor%index => lengths
9266 type_descriptor%index_descriptor%chunks => displs
9268 CALL mp_timestop(handle)
9270 END FUNCTION mp_type_indexed_make_i
9279 SUBROUTINE mp_allocate_i (DATA, len, stat)
9280 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
9281 INTEGER,
INTENT(IN) :: len
9282 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9284 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_i'
9286 INTEGER :: handle, ierr
9288 CALL mp_timeset(routinen, handle)
9290#if defined(__parallel)
9292 CALL mp_alloc_mem(
DATA, len, stat=ierr)
9293 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
9294 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
9295 CALL add_perf(perf_id=15, count=1)
9297 ALLOCATE (
DATA(len), stat=ierr)
9298 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
9299 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
9301 IF (
PRESENT(stat)) stat = ierr
9302 CALL mp_timestop(handle)
9303 END SUBROUTINE mp_allocate_i
9311 SUBROUTINE mp_deallocate_i (DATA, stat)
9312 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
9313 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9315 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_i'
9318#if defined(__parallel)
9322 CALL mp_timeset(routinen, handle)
9324#if defined(__parallel)
9325 CALL mp_free_mem(
DATA, ierr)
9326 IF (
PRESENT(stat))
THEN
9329 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
9332 CALL add_perf(perf_id=15, count=1)
9335 IF (
PRESENT(stat)) stat = 0
9337 CALL mp_timestop(handle)
9338 END SUBROUTINE mp_deallocate_i
9351 SUBROUTINE mp_file_write_at_iv(fh, offset, msg, msglen)
9352 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
9354 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9355 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9358#if defined(__parallel)
9363 IF (
PRESENT(msglen)) msg_len = msglen
9364#if defined(__parallel)
9365 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9367 cpabort(
"mpi_file_write_at_iv @ mp_file_write_at_iv")
9369 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9371 END SUBROUTINE mp_file_write_at_iv
9379 SUBROUTINE mp_file_write_at_i (fh, offset, msg)
9380 INTEGER(KIND=int_4),
INTENT(IN) :: msg
9382 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9384#if defined(__parallel)
9388 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9390 cpabort(
"mpi_file_write_at_i @ mp_file_write_at_i")
9392 WRITE (unit=fh%handle, pos=offset + 1) msg
9394 END SUBROUTINE mp_file_write_at_i
9406 SUBROUTINE mp_file_write_at_all_iv(fh, offset, msg, msglen)
9407 INTEGER(KIND=int_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
9409 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9410 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9413#if defined(__parallel)
9418 IF (
PRESENT(msglen)) msg_len = msglen
9419#if defined(__parallel)
9420 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9422 cpabort(
"mpi_file_write_at_all_iv @ mp_file_write_at_all_iv")
9424 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9426 END SUBROUTINE mp_file_write_at_all_iv
9434 SUBROUTINE mp_file_write_at_all_i (fh, offset, msg)
9435 INTEGER(KIND=int_4),
INTENT(IN) :: msg
9437 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9439#if defined(__parallel)
9443 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9445 cpabort(
"mpi_file_write_at_all_i @ mp_file_write_at_all_i")
9447 WRITE (unit=fh%handle, pos=offset + 1) msg
9449 END SUBROUTINE mp_file_write_at_all_i
9462 SUBROUTINE mp_file_read_at_iv(fh, offset, msg, msglen)
9463 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
9465 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9466 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9469#if defined(__parallel)
9474 IF (
PRESENT(msglen)) msg_len = msglen
9475#if defined(__parallel)
9476 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9478 cpabort(
"mpi_file_read_at_iv @ mp_file_read_at_iv")
9480 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9482 END SUBROUTINE mp_file_read_at_iv
9490 SUBROUTINE mp_file_read_at_i (fh, offset, msg)
9491 INTEGER(KIND=int_4),
INTENT(OUT) :: msg
9493 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9495#if defined(__parallel)
9499 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9501 cpabort(
"mpi_file_read_at_i @ mp_file_read_at_i")
9503 READ (unit=fh%handle, pos=offset + 1) msg
9505 END SUBROUTINE mp_file_read_at_i
9517 SUBROUTINE mp_file_read_at_all_iv(fh, offset, msg, msglen)
9518 INTEGER(KIND=int_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
9520 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
9521 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9524#if defined(__parallel)
9529 IF (
PRESENT(msglen)) msg_len = msglen
9530#if defined(__parallel)
9531 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_integer, mpi_status_ignore, ierr)
9533 cpabort(
"mpi_file_read_at_all_iv @ mp_file_read_at_all_iv")
9535 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
9537 END SUBROUTINE mp_file_read_at_all_iv
9545 SUBROUTINE mp_file_read_at_all_i (fh, offset, msg)
9546 INTEGER(KIND=int_4),
INTENT(OUT) :: msg
9548 INTEGER(kind=file_offset),
INTENT(IN) :: offset
9550#if defined(__parallel)
9554 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_integer, mpi_status_ignore, ierr)
9556 cpabort(
"mpi_file_read_at_all_i @ mp_file_read_at_all_i")
9558 READ (unit=fh%handle, pos=offset + 1) msg
9560 END SUBROUTINE mp_file_read_at_all_i
9569 FUNCTION mp_type_make_i (ptr, &
9570 vector_descriptor, index_descriptor) &
9571 result(type_descriptor)
9572 INTEGER(KIND=int_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
9573 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
9574 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
9577 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_i'
9579#if defined(__parallel)
9581#if defined(__MPI_F08)
9583 EXTERNAL :: mpi_get_address
9587 NULLIFY (type_descriptor%subtype)
9588 type_descriptor%length =
SIZE(ptr)
9589#if defined(__parallel)
9590 type_descriptor%type_handle = mpi_integer
9591 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
9593 cpabort(
"MPI_Get_address @ "//routinen)
9595 type_descriptor%type_handle = 17
9597 type_descriptor%vector_descriptor(1:2) = 1
9598 type_descriptor%has_indexing = .false.
9599 type_descriptor%data_i => ptr
9600 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
9601 cpabort(routinen//
": Vectors and indices NYI")
9603 END FUNCTION mp_type_make_i
9612 SUBROUTINE mp_alloc_mem_i (DATA, len, stat)
9613 INTEGER(KIND=int_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
9614 INTEGER,
INTENT(IN) :: len
9615 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9617#if defined(__parallel)
9618 INTEGER :: size, ierr, length, &
9620 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
9621 TYPE(c_ptr) :: mp_baseptr
9622 mpi_info_type :: mp_info
9624 length = max(len, 1)
9625 CALL mpi_type_size(mpi_integer,
size, ierr)
9626 mp_size = int(length, kind=mpi_address_kind)*
size
9627 IF (mp_size .GT. mp_max_memory_size)
THEN
9628 cpabort(
"MPI cannot allocate more than 2 GiByte")
9630 mp_info = mpi_info_null
9631 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
9632 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
9633 IF (
PRESENT(stat)) stat = mp_res
9635 INTEGER :: length, mystat
9636 length = max(len, 1)
9637 IF (
PRESENT(stat))
THEN
9638 ALLOCATE (
DATA(length), stat=mystat)
9641 ALLOCATE (
DATA(length))
9644 END SUBROUTINE mp_alloc_mem_i
9652 SUBROUTINE mp_free_mem_i (DATA, stat)
9653 INTEGER(KIND=int_4),
DIMENSION(:), &
9654 POINTER, asynchronous :: data
9655 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
9657#if defined(__parallel)
9659 CALL mpi_free_mem(
DATA, mp_res)
9660 IF (
PRESENT(stat)) stat = mp_res
9663 IF (
PRESENT(stat)) stat = 0
9665 END SUBROUTINE mp_free_mem_i
9677 SUBROUTINE mp_shift_lm(msg, comm, displ_in)
9679 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
9681 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
9683 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_lm'
9685 INTEGER :: handle, ierror
9686#if defined(__parallel)
9687 INTEGER :: displ, left, &
9688 msglen, myrank, nprocs, &
9693 CALL mp_timeset(routinen, handle)
9695#if defined(__parallel)
9696 CALL mpi_comm_rank(comm%handle, myrank, ierror)
9697 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
9698 CALL mpi_comm_size(comm%handle, nprocs, ierror)
9699 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
9700 IF (
PRESENT(displ_in))
THEN
9705 right =
modulo(myrank + displ, nprocs)
9706 left =
modulo(myrank - displ, nprocs)
9709 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer8, right, tag, left, tag, &
9710 comm%handle, mpi_status_ignore, ierror)
9711 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
9712 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_8_size)
9718 CALL mp_timestop(handle)
9720 END SUBROUTINE mp_shift_lm
9733 SUBROUTINE mp_shift_l (msg, comm, displ_in)
9735 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
9737 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
9739 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_l'
9741 INTEGER :: handle, ierror
9742#if defined(__parallel)
9743 INTEGER :: displ, left, &
9744 msglen, myrank, nprocs, &
9749 CALL mp_timeset(routinen, handle)
9751#if defined(__parallel)
9752 CALL mpi_comm_rank(comm%handle, myrank, ierror)
9753 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
9754 CALL mpi_comm_size(comm%handle, nprocs, ierror)
9755 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
9756 IF (
PRESENT(displ_in))
THEN
9761 right =
modulo(myrank + displ, nprocs)
9762 left =
modulo(myrank - displ, nprocs)
9765 CALL mpi_sendrecv_replace(msg, msglen, mpi_integer8, right, tag, left, &
9766 tag, comm%handle, mpi_status_ignore, ierror)
9767 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
9768 CALL add_perf(perf_id=7, count=1, msg_size=msglen*int_8_size)
9774 CALL mp_timestop(handle)
9776 END SUBROUTINE mp_shift_l
9797 SUBROUTINE mp_alltoall_l11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
9799 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
9800 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
9801 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
9802 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
9805 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l11v'
9808#if defined(__parallel)
9809 INTEGER :: ierr, msglen
9814 CALL mp_timeset(routinen, handle)
9816#if defined(__parallel)
9817 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer8, &
9818 rb, rcount, rdispl, mpi_integer8, comm%handle, ierr)
9819 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
9820 msglen = sum(scount) + sum(rcount)
9821 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9828 rb(rdispl(1) + i) = sb(sdispl(1) + i)
9831 CALL mp_timestop(handle)
9833 END SUBROUTINE mp_alltoall_l11v
9848 SUBROUTINE mp_alltoall_l22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
9850 INTEGER(KIND=int_8),
DIMENSION(:, :), &
9851 INTENT(IN),
CONTIGUOUS :: sb
9852 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
9853 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS, &
9855 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
9858 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l22v'
9861#if defined(__parallel)
9862 INTEGER :: ierr, msglen
9865 CALL mp_timeset(routinen, handle)
9867#if defined(__parallel)
9868 CALL mpi_alltoallv(sb, scount, sdispl, mpi_integer8, &
9869 rb, rcount, rdispl, mpi_integer8, comm%handle, ierr)
9870 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
9871 msglen = sum(scount) + sum(rcount)
9872 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*int_8_size)
9881 CALL mp_timestop(handle)
9883 END SUBROUTINE mp_alltoall_l22v
9900 SUBROUTINE mp_alltoall_l (sb, rb, count, comm)
9902 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
9903 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
9904 INTEGER,
INTENT(IN) :: count
9907 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l'
9910#if defined(__parallel)
9911 INTEGER :: ierr, msglen, np
9914 CALL mp_timeset(routinen, handle)
9916#if defined(__parallel)
9917 CALL mpi_alltoall(sb, count, mpi_integer8, &
9918 rb, count, mpi_integer8, comm%handle, ierr)
9919 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9920 CALL mpi_comm_size(comm%handle, np, ierr)
9921 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9923 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9929 CALL mp_timestop(handle)
9931 END SUBROUTINE mp_alltoall_l
9941 SUBROUTINE mp_alltoall_l22(sb, rb, count, comm)
9943 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
9944 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
9945 INTEGER,
INTENT(IN) :: count
9948 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l22'
9951#if defined(__parallel)
9952 INTEGER :: ierr, msglen, np
9955 CALL mp_timeset(routinen, handle)
9957#if defined(__parallel)
9958 CALL mpi_alltoall(sb, count, mpi_integer8, &
9959 rb, count, mpi_integer8, comm%handle, ierr)
9960 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
9961 CALL mpi_comm_size(comm%handle, np, ierr)
9962 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
9963 msglen = 2*
SIZE(sb)*np
9964 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
9970 CALL mp_timestop(handle)
9972 END SUBROUTINE mp_alltoall_l22
9982 SUBROUTINE mp_alltoall_l33(sb, rb, count, comm)
9984 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
9985 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
9986 INTEGER,
INTENT(IN) :: count
9989 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l33'
9992#if defined(__parallel)
9993 INTEGER :: ierr, msglen, np
9996 CALL mp_timeset(routinen, handle)
9998#if defined(__parallel)
9999 CALL mpi_alltoall(sb, count, mpi_integer8, &
10000 rb, count, mpi_integer8, comm%handle, ierr)
10001 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10002 CALL mpi_comm_size(comm%handle, np, ierr)
10003 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10004 msglen = 2*count*np
10005 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10011 CALL mp_timestop(handle)
10013 END SUBROUTINE mp_alltoall_l33
10023 SUBROUTINE mp_alltoall_l44(sb, rb, count, comm)
10025 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10027 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10029 INTEGER,
INTENT(IN) :: count
10032 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l44'
10035#if defined(__parallel)
10036 INTEGER :: ierr, msglen, np
10039 CALL mp_timeset(routinen, handle)
10041#if defined(__parallel)
10042 CALL mpi_alltoall(sb, count, mpi_integer8, &
10043 rb, count, mpi_integer8, comm%handle, ierr)
10044 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10045 CALL mpi_comm_size(comm%handle, np, ierr)
10046 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10047 msglen = 2*count*np
10048 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10054 CALL mp_timestop(handle)
10056 END SUBROUTINE mp_alltoall_l44
10066 SUBROUTINE mp_alltoall_l55(sb, rb, count, comm)
10068 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
10070 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
10072 INTEGER,
INTENT(IN) :: count
10075 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l55'
10078#if defined(__parallel)
10079 INTEGER :: ierr, msglen, np
10082 CALL mp_timeset(routinen, handle)
10084#if defined(__parallel)
10085 CALL mpi_alltoall(sb, count, mpi_integer8, &
10086 rb, count, mpi_integer8, comm%handle, ierr)
10087 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10088 CALL mpi_comm_size(comm%handle, np, ierr)
10089 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10090 msglen = 2*count*np
10091 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10097 CALL mp_timestop(handle)
10099 END SUBROUTINE mp_alltoall_l55
10110 SUBROUTINE mp_alltoall_l45(sb, rb, count, comm)
10112 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10114 INTEGER(KIND=int_8), &
10115 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
10116 INTEGER,
INTENT(IN) :: count
10119 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l45'
10122#if defined(__parallel)
10123 INTEGER :: ierr, msglen, np
10126 CALL mp_timeset(routinen, handle)
10128#if defined(__parallel)
10129 CALL mpi_alltoall(sb, count, mpi_integer8, &
10130 rb, count, mpi_integer8, comm%handle, ierr)
10131 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10132 CALL mpi_comm_size(comm%handle, np, ierr)
10133 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10134 msglen = 2*count*np
10135 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10139 rb = reshape(sb, shape(rb))
10141 CALL mp_timestop(handle)
10143 END SUBROUTINE mp_alltoall_l45
10154 SUBROUTINE mp_alltoall_l34(sb, rb, count, comm)
10156 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
10158 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10160 INTEGER,
INTENT(IN) :: count
10163 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l34'
10166#if defined(__parallel)
10167 INTEGER :: ierr, msglen, np
10170 CALL mp_timeset(routinen, handle)
10172#if defined(__parallel)
10173 CALL mpi_alltoall(sb, count, mpi_integer8, &
10174 rb, count, mpi_integer8, comm%handle, ierr)
10175 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10176 CALL mpi_comm_size(comm%handle, np, ierr)
10177 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10178 msglen = 2*count*np
10179 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10183 rb = reshape(sb, shape(rb))
10185 CALL mp_timestop(handle)
10187 END SUBROUTINE mp_alltoall_l34
10198 SUBROUTINE mp_alltoall_l54(sb, rb, count, comm)
10200 INTEGER(KIND=int_8), &
10201 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
10202 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
10204 INTEGER,
INTENT(IN) :: count
10207 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_l54'
10210#if defined(__parallel)
10211 INTEGER :: ierr, msglen, np
10214 CALL mp_timeset(routinen, handle)
10216#if defined(__parallel)
10217 CALL mpi_alltoall(sb, count, mpi_integer8, &
10218 rb, count, mpi_integer8, comm%handle, ierr)
10219 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
10220 CALL mpi_comm_size(comm%handle, np, ierr)
10221 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
10222 msglen = 2*count*np
10223 CALL add_perf(perf_id=6, count=1, msg_size=msglen*int_8_size)
10227 rb = reshape(sb, shape(rb))
10229 CALL mp_timestop(handle)
10231 END SUBROUTINE mp_alltoall_l54
10242 SUBROUTINE mp_send_l (msg, dest, tag, comm)
10243 INTEGER(KIND=int_8),
INTENT(IN) :: msg
10244 INTEGER,
INTENT(IN) :: dest, tag
10247 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_l'
10250#if defined(__parallel)
10251 INTEGER :: ierr, msglen
10254 CALL mp_timeset(routinen, handle)
10256#if defined(__parallel)
10258 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10259 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10260 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10267 cpabort(
"not in parallel mode")
10269 CALL mp_timestop(handle)
10270 END SUBROUTINE mp_send_l
10280 SUBROUTINE mp_send_lv(msg, dest, tag, comm)
10281 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
10282 INTEGER,
INTENT(IN) :: dest, tag
10285 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_lv'
10288#if defined(__parallel)
10289 INTEGER :: ierr, msglen
10292 CALL mp_timeset(routinen, handle)
10294#if defined(__parallel)
10296 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10297 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10298 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10305 cpabort(
"not in parallel mode")
10307 CALL mp_timestop(handle)
10308 END SUBROUTINE mp_send_lv
10318 SUBROUTINE mp_send_lm2(msg, dest, tag, comm)
10319 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
10320 INTEGER,
INTENT(IN) :: dest, tag
10323 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_lm2'
10326#if defined(__parallel)
10327 INTEGER :: ierr, msglen
10330 CALL mp_timeset(routinen, handle)
10332#if defined(__parallel)
10334 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10335 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10336 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10343 cpabort(
"not in parallel mode")
10345 CALL mp_timestop(handle)
10346 END SUBROUTINE mp_send_lm2
10356 SUBROUTINE mp_send_lm3(msg, dest, tag, comm)
10357 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
10358 INTEGER,
INTENT(IN) :: dest, tag
10361 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
10364#if defined(__parallel)
10365 INTEGER :: ierr, msglen
10368 CALL mp_timeset(routinen, handle)
10370#if defined(__parallel)
10372 CALL mpi_send(msg, msglen, mpi_integer8, dest, tag, comm%handle, ierr)
10373 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
10374 CALL add_perf(perf_id=13, count=1, msg_size=msglen*int_8_size)
10381 cpabort(
"not in parallel mode")
10383 CALL mp_timestop(handle)
10384 END SUBROUTINE mp_send_lm3
10395 SUBROUTINE mp_recv_l (msg, source, tag, comm)
10396 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10397 INTEGER,
INTENT(INOUT) :: source, tag
10400 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_l'
10403#if defined(__parallel)
10404 INTEGER :: ierr, msglen
10405 mpi_status_type :: status
10408 CALL mp_timeset(routinen, handle)
10410#if defined(__parallel)
10413 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10414 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10416 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10417 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10418 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10419 source = status mpi_status_extract(mpi_source)
10420 tag = status mpi_status_extract(mpi_tag)
10428 cpabort(
"not in parallel mode")
10430 CALL mp_timestop(handle)
10431 END SUBROUTINE mp_recv_l
10441 SUBROUTINE mp_recv_lv(msg, source, tag, comm)
10442 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10443 INTEGER,
INTENT(INOUT) :: source, tag
10446 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lv'
10449#if defined(__parallel)
10450 INTEGER :: ierr, msglen
10451 mpi_status_type :: status
10454 CALL mp_timeset(routinen, handle)
10456#if defined(__parallel)
10459 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10460 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10462 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10463 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10464 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10465 source = status mpi_status_extract(mpi_source)
10466 tag = status mpi_status_extract(mpi_tag)
10474 cpabort(
"not in parallel mode")
10476 CALL mp_timestop(handle)
10477 END SUBROUTINE mp_recv_lv
10487 SUBROUTINE mp_recv_lm2(msg, source, tag, comm)
10488 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10489 INTEGER,
INTENT(INOUT) :: source, tag
10492 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lm2'
10495#if defined(__parallel)
10496 INTEGER :: ierr, msglen
10497 mpi_status_type :: status
10500 CALL mp_timeset(routinen, handle)
10502#if defined(__parallel)
10505 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10506 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10508 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10509 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10510 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10511 source = status mpi_status_extract(mpi_source)
10512 tag = status mpi_status_extract(mpi_tag)
10520 cpabort(
"not in parallel mode")
10522 CALL mp_timestop(handle)
10523 END SUBROUTINE mp_recv_lm2
10533 SUBROUTINE mp_recv_lm3(msg, source, tag, comm)
10534 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
10535 INTEGER,
INTENT(INOUT) :: source, tag
10538 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_lm3'
10541#if defined(__parallel)
10542 INTEGER :: ierr, msglen
10543 mpi_status_type :: status
10546 CALL mp_timeset(routinen, handle)
10548#if defined(__parallel)
10551 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, mpi_status_ignore, ierr)
10552 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10554 CALL mpi_recv(msg, msglen, mpi_integer8, source, tag, comm%handle, status, ierr)
10555 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
10556 CALL add_perf(perf_id=14, count=1, msg_size=msglen*int_8_size)
10557 source = status mpi_status_extract(mpi_source)
10558 tag = status mpi_status_extract(mpi_tag)
10566 cpabort(
"not in parallel mode")
10568 CALL mp_timestop(handle)
10569 END SUBROUTINE mp_recv_lm3
10579 SUBROUTINE mp_bcast_l (msg, source, comm)
10580 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10581 INTEGER,
INTENT(IN) :: source
10584 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l'
10587#if defined(__parallel)
10588 INTEGER :: ierr, msglen
10591 CALL mp_timeset(routinen, handle)
10593#if defined(__parallel)
10595 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10596 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10597 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10603 CALL mp_timestop(handle)
10604 END SUBROUTINE mp_bcast_l
10613 SUBROUTINE mp_bcast_l_src(msg, comm)
10614 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10617 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l_src'
10620#if defined(__parallel)
10621 INTEGER :: ierr, msglen
10624 CALL mp_timeset(routinen, handle)
10626#if defined(__parallel)
10628 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10629 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10630 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10635 CALL mp_timestop(handle)
10636 END SUBROUTINE mp_bcast_l_src
10646 SUBROUTINE mp_ibcast_l (msg, source, comm, request)
10647 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10648 INTEGER,
INTENT(IN) :: source
10652 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_l'
10655#if defined(__parallel)
10656 INTEGER :: ierr, msglen
10659 CALL mp_timeset(routinen, handle)
10661#if defined(__parallel)
10663 CALL mpi_ibcast(msg, msglen, mpi_integer8, source, comm%handle, request%handle, ierr)
10664 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
10665 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_8_size)
10672 CALL mp_timestop(handle)
10673 END SUBROUTINE mp_ibcast_l
10682 SUBROUTINE mp_bcast_lv(msg, source, comm)
10683 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10684 INTEGER,
INTENT(IN) :: source
10687 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lv'
10690#if defined(__parallel)
10691 INTEGER :: ierr, msglen
10694 CALL mp_timeset(routinen, handle)
10696#if defined(__parallel)
10698 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10699 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10700 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10706 CALL mp_timestop(handle)
10707 END SUBROUTINE mp_bcast_lv
10715 SUBROUTINE mp_bcast_lv_src(msg, comm)
10716 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10719 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lv_src'
10722#if defined(__parallel)
10723 INTEGER :: ierr, msglen
10726 CALL mp_timeset(routinen, handle)
10728#if defined(__parallel)
10730 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10731 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10732 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10737 CALL mp_timestop(handle)
10738 END SUBROUTINE mp_bcast_lv_src
10747 SUBROUTINE mp_ibcast_lv(msg, source, comm, request)
10748 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
10749 INTEGER,
INTENT(IN) :: source
10753 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_lv'
10756#if defined(__parallel)
10757 INTEGER :: ierr, msglen
10760 CALL mp_timeset(routinen, handle)
10762#if defined(__parallel)
10763#if !defined(__GNUC__) || __GNUC__ >= 9
10764 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
10767 CALL mpi_ibcast(msg, msglen, mpi_integer8, source, comm%handle, request%handle, ierr)
10768 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
10769 CALL add_perf(perf_id=22, count=1, msg_size=msglen*int_8_size)
10776 CALL mp_timestop(handle)
10777 END SUBROUTINE mp_ibcast_lv
10786 SUBROUTINE mp_bcast_lm(msg, source, comm)
10787 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10788 INTEGER,
INTENT(IN) :: source
10791 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lm'
10794#if defined(__parallel)
10795 INTEGER :: ierr, msglen
10798 CALL mp_timeset(routinen, handle)
10800#if defined(__parallel)
10802 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10803 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10804 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10810 CALL mp_timestop(handle)
10811 END SUBROUTINE mp_bcast_lm
10820 SUBROUTINE mp_bcast_lm_src(msg, comm)
10821 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
10824 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_lm_src'
10827#if defined(__parallel)
10828 INTEGER :: ierr, msglen
10831 CALL mp_timeset(routinen, handle)
10833#if defined(__parallel)
10835 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10836 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10837 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10842 CALL mp_timestop(handle)
10843 END SUBROUTINE mp_bcast_lm_src
10852 SUBROUTINE mp_bcast_l3(msg, source, comm)
10853 INTEGER(KIND=int_8),
CONTIGUOUS :: msg(:, :, :)
10854 INTEGER,
INTENT(IN) :: source
10857 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l3'
10860#if defined(__parallel)
10861 INTEGER :: ierr, msglen
10864 CALL mp_timeset(routinen, handle)
10866#if defined(__parallel)
10868 CALL mpi_bcast(msg, msglen, mpi_integer8, source, comm%handle, ierr)
10869 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10870 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10876 CALL mp_timestop(handle)
10877 END SUBROUTINE mp_bcast_l3
10886 SUBROUTINE mp_bcast_l3_src(msg, comm)
10887 INTEGER(KIND=int_8),
CONTIGUOUS :: msg(:, :, :)
10890 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_l3_src'
10893#if defined(__parallel)
10894 INTEGER :: ierr, msglen
10897 CALL mp_timeset(routinen, handle)
10899#if defined(__parallel)
10901 CALL mpi_bcast(msg, msglen, mpi_integer8, comm%source, comm%handle, ierr)
10902 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
10903 CALL add_perf(perf_id=2, count=1, msg_size=msglen*int_8_size)
10908 CALL mp_timestop(handle)
10909 END SUBROUTINE mp_bcast_l3_src
10918 SUBROUTINE mp_sum_l (msg, comm)
10919 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
10922 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_l'
10925#if defined(__parallel)
10926 INTEGER :: ierr, msglen
10927 INTEGER(KIND=int_8) :: res
10930 CALL mp_timeset(routinen, handle)
10932#if defined(__parallel)
10934 IF (comm%num_pe > 1)
THEN
10935 CALL mpi_allreduce(msg, res, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
10936 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
10939 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
10944 CALL mp_timestop(handle)
10945 END SUBROUTINE mp_sum_l
10953 SUBROUTINE mp_sum_lv(msg, comm)
10954 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
10957 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lv'
10960#if defined(__parallel)
10961 INTEGER :: ierr, msglen
10962 INTEGER(KIND=int_8),
ALLOCATABLE :: msgbuf(:)
10965 CALL mp_timeset(routinen, handle)
10967#if defined(__parallel)
10969 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
10970 ALLOCATE (msgbuf(msglen))
10971 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
10972 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
10975 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
10980 CALL mp_timestop(handle)
10981 END SUBROUTINE mp_sum_lv
10989 SUBROUTINE mp_isum_lv(msg, comm, request)
10990 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
10994 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_lv'
10997#if defined(__parallel)
10998 INTEGER :: ierr, msglen
11001 CALL mp_timeset(routinen, handle)
11003#if defined(__parallel)
11004#if !defined(__GNUC__) || __GNUC__ >= 9
11005 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
11008 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
11009 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_integer8, mpi_sum, comm%handle, request%handle, ierr)
11010 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
11014 CALL add_perf(perf_id=23, count=1, msg_size=msglen*int_8_size)
11020 CALL mp_timestop(handle)
11021 END SUBROUTINE mp_isum_lv
11029 SUBROUTINE mp_sum_lm(msg, comm)
11030 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11033 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm'
11036#if defined(__parallel)
11037 INTEGER,
PARAMETER :: max_msg = 2**25
11038 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
11039 INTEGER(KIND=int_8),
ALLOCATABLE :: msgbuf(:)
11042 CALL mp_timeset(routinen, handle)
11044#if defined(__parallel)
11046 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
11048 DO m1 = lbound(msg, 2), ubound(msg, 2), step
11049 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
11050 msglensum = msglensum + msglen
11051 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
11052 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
11053 ALLOCATE (msgbuf(msglen))
11054 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11055 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11056 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
11057 DEALLOCATE (msgbuf)
11060 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_8_size)
11065 CALL mp_timestop(handle)
11066 END SUBROUTINE mp_sum_lm
11074 SUBROUTINE mp_sum_lm3(msg, comm)
11075 INTEGER(KIND=int_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
11078 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm3'
11081#if defined(__parallel)
11082 INTEGER :: ierr, msglen
11083 INTEGER(KIND=int_8),
ALLOCATABLE :: msgbuf(:)
11086 CALL mp_timeset(routinen, handle)
11088#if defined(__parallel)
11090 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
11091 ALLOCATE (msgbuf(msglen))
11092 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11093 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11094 msg = reshape(msgbuf, shape(msg))
11096 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11101 CALL mp_timestop(handle)
11102 END SUBROUTINE mp_sum_lm3
11110 SUBROUTINE mp_sum_lm4(msg, comm)
11111 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
11114 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_lm4'
11117#if defined(__parallel)
11118 INTEGER :: ierr, msglen
11119 INTEGER(KIND=int_8),
ALLOCATABLE :: msgbuf(:)
11122 CALL mp_timeset(routinen, handle)
11124#if defined(__parallel)
11126 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
11127 ALLOCATE (msgbuf(msglen))
11128 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11129 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11130 msg = reshape(msgbuf, shape(msg))
11132 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11137 CALL mp_timestop(handle)
11138 END SUBROUTINE mp_sum_lm4
11150 SUBROUTINE mp_sum_root_lv(msg, root, comm)
11151 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
11152 INTEGER,
INTENT(IN) :: root
11155 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_lv'
11158#if defined(__parallel)
11159 INTEGER :: ierr, m1, msglen, taskid
11160 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:)
11163 CALL mp_timeset(routinen, handle)
11165#if defined(__parallel)
11167 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11168 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11169 IF (msglen > 0)
THEN
11172 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_sum, &
11173 root, comm%handle, ierr)
11174 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11175 IF (taskid == root)
THEN
11180 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11186 CALL mp_timestop(handle)
11187 END SUBROUTINE mp_sum_root_lv
11198 SUBROUTINE mp_sum_root_lm(msg, root, comm)
11199 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11200 INTEGER,
INTENT(IN) :: root
11203 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
11206#if defined(__parallel)
11207 INTEGER :: ierr, m1, m2, msglen, taskid
11208 INTEGER(KIND=int_8),
ALLOCATABLE :: res(:, :)
11211 CALL mp_timeset(routinen, handle)
11213#if defined(__parallel)
11215 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11216 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11217 IF (msglen > 0)
THEN
11220 ALLOCATE (res(m1, m2))
11221 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_sum, root, comm%handle, ierr)
11222 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11223 IF (taskid == root)
THEN
11228 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11234 CALL mp_timestop(handle)
11235 END SUBROUTINE mp_sum_root_lm
11243 SUBROUTINE mp_sum_partial_lm(msg, res, comm)
11244 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11245 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
11248 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_lm'
11251#if defined(__parallel)
11252 INTEGER :: ierr, msglen, taskid
11255 CALL mp_timeset(routinen, handle)
11257#if defined(__parallel)
11259 CALL mpi_comm_rank(comm%handle, taskid, ierr)
11260 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
11261 IF (msglen > 0)
THEN
11262 CALL mpi_scan(msg, res, msglen, mpi_integer8, mpi_sum, comm%handle, ierr)
11263 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
11265 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11271 CALL mp_timestop(handle)
11272 END SUBROUTINE mp_sum_partial_lm
11282 SUBROUTINE mp_max_l (msg, comm)
11283 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11286 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_l'
11289#if defined(__parallel)
11290 INTEGER :: ierr, msglen
11291 INTEGER(KIND=int_8) :: res
11294 CALL mp_timeset(routinen, handle)
11296#if defined(__parallel)
11298 IF (comm%num_pe > 1)
THEN
11299 CALL mpi_allreduce(msg, res, msglen, mpi_integer8, mpi_max, comm%handle, ierr)
11300 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11303 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11308 CALL mp_timestop(handle)
11309 END SUBROUTINE mp_max_l
11319 SUBROUTINE mp_max_root_l (msg, root, comm)
11320 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11321 INTEGER,
INTENT(IN) :: root
11324 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_l'
11327#if defined(__parallel)
11328 INTEGER :: ierr, msglen
11329 INTEGER(KIND=int_8) :: res
11332 CALL mp_timeset(routinen, handle)
11334#if defined(__parallel)
11336 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_max, root, comm%handle, ierr)
11337 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
11338 IF (root == comm%mepos) msg = res
11339 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11345 CALL mp_timestop(handle)
11346 END SUBROUTINE mp_max_root_l
11356 SUBROUTINE mp_max_lv(msg, comm)
11357 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
11360 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_lv'
11363#if defined(__parallel)
11364 INTEGER :: ierr, msglen
11365 INTEGER(KIND=int_8),
ALLOCATABLE :: msgbuf(:)
11368 CALL mp_timeset(routinen, handle)
11370#if defined(__parallel)
11372 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
11373 ALLOCATE (msgbuf(msglen))
11374 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_integer8, mpi_max, comm%handle, ierr)
11375 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11378 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11383 CALL mp_timestop(handle)
11384 END SUBROUTINE mp_max_lv
11394 SUBROUTINE mp_max_lm(msg, comm)
11395 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11398 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_lm'
11401#if defined(__parallel)
11402 INTEGER,
PARAMETER :: max_msg = 2**25
11403 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
11404 INTEGER(KIND=int_8),
ALLOCATABLE :: msgbuf(:)
11407 CALL mp_timeset(routinen, handle)
11409#if defined(__parallel)
11411 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
11413 DO m1 = lbound(msg, 2), ubound(msg, 2), step
11414 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
11415 msglensum = msglensum + msglen
11416 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
11417 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
11418 ALLOCATE (msgbuf(msglen))
11419 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_integer8, mpi_max, comm%handle, ierr)
11420 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11421 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
11422 DEALLOCATE (msgbuf)
11425 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_8_size)
11430 CALL mp_timestop(handle)
11431 END SUBROUTINE mp_max_lm
11441 SUBROUTINE mp_max_root_lm(msg, root, comm)
11442 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11446 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_lm'
11449#if defined(__parallel)
11450 INTEGER :: ierr, msglen
11451 INTEGER(KIND=int_8) :: res(size(msg, 1), size(msg, 2))
11454 CALL mp_timeset(routinen, handle)
11456#if defined(__parallel)
11458 CALL mpi_reduce(msg, res, msglen, mpi_integer8, mpi_max, root, comm%handle, ierr)
11459 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11460 IF (root == comm%mepos) msg = res
11461 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11467 CALL mp_timestop(handle)
11468 END SUBROUTINE mp_max_root_lm
11478 SUBROUTINE mp_min_l (msg, comm)
11479 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11482 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_l'
11485#if defined(__parallel)
11486 INTEGER :: ierr, msglen
11487 INTEGER(KIND=int_8) :: res
11490 CALL mp_timeset(routinen, handle)
11492#if defined(__parallel)
11494 IF (comm%num_pe > 1)
THEN
11495 CALL mpi_allreduce(msg, res, msglen, mpi_integer8, mpi_min, comm%handle, ierr)
11496 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11499 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11504 CALL mp_timestop(handle)
11505 END SUBROUTINE mp_min_l
11517 SUBROUTINE mp_min_lv(msg, comm)
11518 INTEGER(KIND=int_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
11521 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_lv'
11524#if defined(__parallel)
11525 INTEGER :: ierr, msglen
11526 INTEGER(KIND=int_8),
ALLOCATABLE :: msgbuf(:)
11529 CALL mp_timeset(routinen, handle)
11531#if defined(__parallel)
11533 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
11534 ALLOCATE (msgbuf(msglen))
11535 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_integer8, mpi_min, comm%handle, ierr)
11536 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_min_lv
11555 SUBROUTINE mp_min_lm(msg, comm)
11556 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
11559 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_lm'
11562#if defined(__parallel)
11563 INTEGER,
PARAMETER :: max_msg = 2**25
11564 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
11565 INTEGER(KIND=int_8),
ALLOCATABLE :: msgbuf(:)
11568 CALL mp_timeset(routinen, handle)
11570#if defined(__parallel)
11572 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
11574 DO m1 = lbound(msg, 2), ubound(msg, 2), step
11575 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
11576 msglensum = msglensum + msglen
11577 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
11578 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
11579 ALLOCATE (msgbuf(msglen))
11580 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_integer8, mpi_min, comm%handle, ierr)
11581 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11582 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
11583 DEALLOCATE (msgbuf)
11586 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*int_8_size)
11591 CALL mp_timestop(handle)
11592 END SUBROUTINE mp_min_lm
11602 SUBROUTINE mp_prod_l (msg, comm)
11603 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11606 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_l'
11609#if defined(__parallel)
11610 INTEGER :: ierr, msglen
11611 INTEGER(KIND=int_8) :: res
11614 CALL mp_timeset(routinen, handle)
11616#if defined(__parallel)
11618 IF (comm%num_pe > 1)
THEN
11619 CALL mpi_allreduce(msg, res, msglen, mpi_integer8, mpi_prod, comm%handle, ierr)
11620 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
11623 CALL add_perf(perf_id=3, count=1, msg_size=msglen*int_8_size)
11628 CALL mp_timestop(handle)
11629 END SUBROUTINE mp_prod_l
11640 SUBROUTINE mp_scatter_lv(msg_scatter, msg, root, comm)
11641 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
11642 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
11643 INTEGER,
INTENT(IN) :: root
11646 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_lv'
11649#if defined(__parallel)
11650 INTEGER :: ierr, msglen
11653 CALL mp_timeset(routinen, handle)
11655#if defined(__parallel)
11657 CALL mpi_scatter(msg_scatter, msglen, mpi_integer8, msg, &
11658 msglen, mpi_integer8, root, comm%handle, ierr)
11659 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
11660 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11666 CALL mp_timestop(handle)
11667 END SUBROUTINE mp_scatter_lv
11677 SUBROUTINE mp_iscatter_l (msg_scatter, msg, root, comm, request)
11678 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:)
11679 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg
11680 INTEGER,
INTENT(IN) :: root
11684 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_l'
11687#if defined(__parallel)
11688 INTEGER :: ierr, msglen
11691 CALL mp_timeset(routinen, handle)
11693#if defined(__parallel)
11694#if !defined(__GNUC__) || __GNUC__ >= 9
11695 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
11698 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer8, msg, &
11699 msglen, mpi_integer8, root, comm%handle, request%handle, ierr)
11700 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
11701 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11705 msg = msg_scatter(1)
11708 CALL mp_timestop(handle)
11709 END SUBROUTINE mp_iscatter_l
11719 SUBROUTINE mp_iscatter_lv2(msg_scatter, msg, root, comm, request)
11720 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:, :)
11721 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
11722 INTEGER,
INTENT(IN) :: root
11726 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_lv2'
11729#if defined(__parallel)
11730 INTEGER :: ierr, msglen
11733 CALL mp_timeset(routinen, handle)
11735#if defined(__parallel)
11736#if !defined(__GNUC__) || __GNUC__ >= 9
11737 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
11740 CALL mpi_iscatter(msg_scatter, msglen, mpi_integer8, msg, &
11741 msglen, mpi_integer8, root, comm%handle, request%handle, ierr)
11742 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
11743 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11747 msg(:) = msg_scatter(:, 1)
11750 CALL mp_timestop(handle)
11751 END SUBROUTINE mp_iscatter_lv2
11761 SUBROUTINE mp_iscatterv_lv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
11762 INTEGER(KIND=int_8),
INTENT(IN) :: msg_scatter(:)
11763 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
11764 INTEGER(KIND=int_8),
INTENT(INOUT) :: msg(:)
11765 INTEGER,
INTENT(IN) :: recvcount, root
11769 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_lv'
11772#if defined(__parallel)
11776 CALL mp_timeset(routinen, handle)
11778#if defined(__parallel)
11779#if !defined(__GNUC__) || __GNUC__ >= 9
11780 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
11781 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
11782 cpassert(is_contiguous(sendcounts) .OR.
SIZE(sendcounts) == 0)
11783 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
11785 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_integer8, msg, &
11786 recvcount, mpi_integer8, root, comm%handle, request%handle, ierr)
11787 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
11788 CALL add_perf(perf_id=24, count=1, msg_size=1*int_8_size)
11790 mark_used(sendcounts)
11792 mark_used(recvcount)
11795 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
11798 CALL mp_timestop(handle)
11799 END SUBROUTINE mp_iscatterv_lv
11810 SUBROUTINE mp_gather_l (msg, msg_gather, root, comm)
11811 INTEGER(KIND=int_8),
INTENT(IN) :: msg
11812 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11813 INTEGER,
INTENT(IN) :: root
11816 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_l'
11819#if defined(__parallel)
11820 INTEGER :: ierr, msglen
11823 CALL mp_timeset(routinen, handle)
11825#if defined(__parallel)
11827 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11828 msglen, mpi_integer8, root, comm%handle, ierr)
11829 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11830 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11834 msg_gather(1) = msg
11836 CALL mp_timestop(handle)
11837 END SUBROUTINE mp_gather_l
11847 SUBROUTINE mp_gather_l_src(msg, msg_gather, comm)
11848 INTEGER(KIND=int_8),
INTENT(IN) :: msg
11849 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11852 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_l_src'
11855#if defined(__parallel)
11856 INTEGER :: ierr, msglen
11859 CALL mp_timeset(routinen, handle)
11861#if defined(__parallel)
11863 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11864 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11865 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11866 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11869 msg_gather(1) = msg
11871 CALL mp_timestop(handle)
11872 END SUBROUTINE mp_gather_l_src
11886 SUBROUTINE mp_gather_lv(msg, msg_gather, root, comm)
11887 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
11888 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11889 INTEGER,
INTENT(IN) :: root
11892 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lv'
11895#if defined(__parallel)
11896 INTEGER :: ierr, msglen
11899 CALL mp_timeset(routinen, handle)
11901#if defined(__parallel)
11903 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11904 msglen, mpi_integer8, root, comm%handle, ierr)
11905 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11906 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11912 CALL mp_timestop(handle)
11913 END SUBROUTINE mp_gather_lv
11926 SUBROUTINE mp_gather_lv_src(msg, msg_gather, comm)
11927 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
11928 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
11931 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lv_src'
11934#if defined(__parallel)
11935 INTEGER :: ierr, msglen
11938 CALL mp_timeset(routinen, handle)
11940#if defined(__parallel)
11942 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11943 msglen, mpi_integer8, comm%source, comm%handle, ierr)
11944 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11945 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11950 CALL mp_timestop(handle)
11951 END SUBROUTINE mp_gather_lv_src
11965 SUBROUTINE mp_gather_lm(msg, msg_gather, root, comm)
11966 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
11967 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
11968 INTEGER,
INTENT(IN) :: root
11971 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lm'
11974#if defined(__parallel)
11975 INTEGER :: ierr, msglen
11978 CALL mp_timeset(routinen, handle)
11980#if defined(__parallel)
11982 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
11983 msglen, mpi_integer8, root, comm%handle, ierr)
11984 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
11985 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
11991 CALL mp_timestop(handle)
11992 END SUBROUTINE mp_gather_lm
12005 SUBROUTINE mp_gather_lm_src(msg, msg_gather, comm)
12006 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
12007 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
12010 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_lm_src'
12013#if defined(__parallel)
12014 INTEGER :: ierr, msglen
12017 CALL mp_timeset(routinen, handle)
12019#if defined(__parallel)
12021 CALL mpi_gather(msg, msglen, mpi_integer8, msg_gather, &
12022 msglen, mpi_integer8, comm%source, comm%handle, ierr)
12023 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
12024 CALL add_perf(perf_id=4, count=1, msg_size=msglen*int_8_size)
12029 CALL mp_timestop(handle)
12030 END SUBROUTINE mp_gather_lm_src
12047 SUBROUTINE mp_gatherv_lv(sendbuf, recvbuf, recvcounts, displs, root, comm)
12049 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
12050 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
12051 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12052 INTEGER,
INTENT(IN) :: root
12055 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lv'
12058#if defined(__parallel)
12059 INTEGER :: ierr, sendcount
12062 CALL mp_timeset(routinen, handle)
12064#if defined(__parallel)
12065 sendcount =
SIZE(sendbuf)
12066 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
12067 recvbuf, recvcounts, displs, mpi_integer8, &
12068 root, comm%handle, ierr)
12069 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12070 CALL add_perf(perf_id=4, &
12072 msg_size=sendcount*int_8_size)
12074 mark_used(recvcounts)
12077 recvbuf(1 + displs(1):) = sendbuf
12079 CALL mp_timestop(handle)
12080 END SUBROUTINE mp_gatherv_lv
12096 SUBROUTINE mp_gatherv_lv_src(sendbuf, recvbuf, recvcounts, displs, comm)
12098 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
12099 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
12100 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12103 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lv_src'
12106#if defined(__parallel)
12107 INTEGER :: ierr, sendcount
12110 CALL mp_timeset(routinen, handle)
12112#if defined(__parallel)
12113 sendcount =
SIZE(sendbuf)
12114 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
12115 recvbuf, recvcounts, displs, mpi_integer8, &
12116 comm%source, comm%handle, ierr)
12117 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12118 CALL add_perf(perf_id=4, &
12120 msg_size=sendcount*int_8_size)
12122 mark_used(recvcounts)
12124 recvbuf(1 + displs(1):) = sendbuf
12126 CALL mp_timestop(handle)
12127 END SUBROUTINE mp_gatherv_lv_src
12144 SUBROUTINE mp_gatherv_lm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
12146 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
12147 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
12148 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12149 INTEGER,
INTENT(IN) :: root
12152 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lm2'
12155#if defined(__parallel)
12156 INTEGER :: ierr, sendcount
12159 CALL mp_timeset(routinen, handle)
12161#if defined(__parallel)
12162 sendcount =
SIZE(sendbuf)
12163 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
12164 recvbuf, recvcounts, displs, mpi_integer8, &
12165 root, comm%handle, ierr)
12166 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12167 CALL add_perf(perf_id=4, &
12169 msg_size=sendcount*int_8_size)
12171 mark_used(recvcounts)
12174 recvbuf(:, 1 + displs(1):) = sendbuf
12176 CALL mp_timestop(handle)
12177 END SUBROUTINE mp_gatherv_lm2
12193 SUBROUTINE mp_gatherv_lm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
12195 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
12196 INTEGER(KIND=int_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
12197 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12200 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_lm2_src'
12203#if defined(__parallel)
12204 INTEGER :: ierr, sendcount
12207 CALL mp_timeset(routinen, handle)
12209#if defined(__parallel)
12210 sendcount =
SIZE(sendbuf)
12211 CALL mpi_gatherv(sendbuf, sendcount, mpi_integer8, &
12212 recvbuf, recvcounts, displs, mpi_integer8, &
12213 comm%source, comm%handle, ierr)
12214 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12215 CALL add_perf(perf_id=4, &
12217 msg_size=sendcount*int_8_size)
12219 mark_used(recvcounts)
12221 recvbuf(:, 1 + displs(1):) = sendbuf
12223 CALL mp_timestop(handle)
12224 END SUBROUTINE mp_gatherv_lm2_src
12241 SUBROUTINE mp_igatherv_lv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
12242 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
12243 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
12244 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
12245 INTEGER,
INTENT(IN) :: sendcount, root
12249 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_lv'
12252#if defined(__parallel)
12256 CALL mp_timeset(routinen, handle)
12258#if defined(__parallel)
12259#if !defined(__GNUC__) || __GNUC__ >= 9
12260 cpassert(is_contiguous(sendbuf) .OR.
SIZE(sendbuf) == 0)
12261 cpassert(is_contiguous(recvbuf) .OR.
SIZE(recvbuf) == 0)
12262 cpassert(is_contiguous(recvcounts) .OR.
SIZE(recvcounts) == 0)
12263 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
12265 CALL mpi_igatherv(sendbuf, sendcount, mpi_integer8, &
12266 recvbuf, recvcounts, displs, mpi_integer8, &
12267 root, comm%handle, request%handle, ierr)
12268 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
12269 CALL add_perf(perf_id=24, &
12271 msg_size=sendcount*int_8_size)
12273 mark_used(sendcount)
12274 mark_used(recvcounts)
12277 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
12280 CALL mp_timestop(handle)
12281 END SUBROUTINE mp_igatherv_lv
12294 SUBROUTINE mp_allgather_l (msgout, msgin, comm)
12295 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12296 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
12299 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l'
12302#if defined(__parallel)
12303 INTEGER :: ierr, rcount, scount
12306 CALL mp_timeset(routinen, handle)
12308#if defined(__parallel)
12311 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12312 msgin, rcount, mpi_integer8, &
12314 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12319 CALL mp_timestop(handle)
12320 END SUBROUTINE mp_allgather_l
12333 SUBROUTINE mp_allgather_l2(msgout, msgin, comm)
12334 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12335 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12338 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l2'
12341#if defined(__parallel)
12342 INTEGER :: ierr, rcount, scount
12345 CALL mp_timeset(routinen, handle)
12347#if defined(__parallel)
12350 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12351 msgin, rcount, mpi_integer8, &
12353 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12358 CALL mp_timestop(handle)
12359 END SUBROUTINE mp_allgather_l2
12372 SUBROUTINE mp_iallgather_l (msgout, msgin, comm, request)
12373 INTEGER(KIND=int_8),
INTENT(IN) :: msgout
12374 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12378 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l'
12381#if defined(__parallel)
12382 INTEGER :: ierr, rcount, scount
12385 CALL mp_timeset(routinen, handle)
12387#if defined(__parallel)
12388#if !defined(__GNUC__) || __GNUC__ >= 9
12389 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
12393 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12394 msgin, rcount, mpi_integer8, &
12395 comm%handle, request%handle, ierr)
12396 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12402 CALL mp_timestop(handle)
12403 END SUBROUTINE mp_iallgather_l
12418 SUBROUTINE mp_allgather_l12(msgout, msgin, comm)
12419 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
12420 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12423 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l12'
12426#if defined(__parallel)
12427 INTEGER :: ierr, rcount, scount
12430 CALL mp_timeset(routinen, handle)
12432#if defined(__parallel)
12433 scount =
SIZE(msgout(:))
12435 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12436 msgin, rcount, mpi_integer8, &
12438 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12441 msgin(:, 1) = msgout(:)
12443 CALL mp_timestop(handle)
12444 END SUBROUTINE mp_allgather_l12
12454 SUBROUTINE mp_allgather_l23(msgout, msgin, comm)
12455 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
12456 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
12459 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l23'
12462#if defined(__parallel)
12463 INTEGER :: ierr, rcount, scount
12466 CALL mp_timeset(routinen, handle)
12468#if defined(__parallel)
12469 scount =
SIZE(msgout(:, :))
12471 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12472 msgin, rcount, mpi_integer8, &
12474 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12477 msgin(:, :, 1) = msgout(:, :)
12479 CALL mp_timestop(handle)
12480 END SUBROUTINE mp_allgather_l23
12490 SUBROUTINE mp_allgather_l34(msgout, msgin, comm)
12491 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
12492 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
12495 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l34'
12498#if defined(__parallel)
12499 INTEGER :: ierr, rcount, scount
12502 CALL mp_timeset(routinen, handle)
12504#if defined(__parallel)
12505 scount =
SIZE(msgout(:, :, :))
12507 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12508 msgin, rcount, mpi_integer8, &
12510 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12513 msgin(:, :, :, 1) = msgout(:, :, :)
12515 CALL mp_timestop(handle)
12516 END SUBROUTINE mp_allgather_l34
12526 SUBROUTINE mp_allgather_l22(msgout, msgin, comm)
12527 INTEGER(KIND=int_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
12528 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
12531 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_l22'
12534#if defined(__parallel)
12535 INTEGER :: ierr, rcount, scount
12538 CALL mp_timeset(routinen, handle)
12540#if defined(__parallel)
12541 scount =
SIZE(msgout(:, :))
12543 CALL mpi_allgather(msgout, scount, mpi_integer8, &
12544 msgin, rcount, mpi_integer8, &
12546 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
12549 msgin(:, :) = msgout(:, :)
12551 CALL mp_timestop(handle)
12552 END SUBROUTINE mp_allgather_l22
12563 SUBROUTINE mp_iallgather_l11(msgout, msgin, comm, request)
12564 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12565 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12569 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l11'
12572#if defined(__parallel)
12573 INTEGER :: ierr, rcount, scount
12576 CALL mp_timeset(routinen, handle)
12578#if defined(__parallel)
12579#if !defined(__GNUC__) || __GNUC__ >= 9
12580 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
12581 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
12583 scount =
SIZE(msgout(:))
12585 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12586 msgin, rcount, mpi_integer8, &
12587 comm%handle, request%handle, ierr)
12588 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12594 CALL mp_timestop(handle)
12595 END SUBROUTINE mp_iallgather_l11
12606 SUBROUTINE mp_iallgather_l13(msgout, msgin, comm, request)
12607 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12608 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :)
12612 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l13'
12615#if defined(__parallel)
12616 INTEGER :: ierr, rcount, scount
12619 CALL mp_timeset(routinen, handle)
12621#if defined(__parallel)
12622#if !defined(__GNUC__) || __GNUC__ >= 9
12623 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
12624 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
12627 scount =
SIZE(msgout(:))
12629 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12630 msgin, rcount, mpi_integer8, &
12631 comm%handle, request%handle, ierr)
12632 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12635 msgin(:, 1, 1) = msgout(:)
12638 CALL mp_timestop(handle)
12639 END SUBROUTINE mp_iallgather_l13
12650 SUBROUTINE mp_iallgather_l22(msgout, msgin, comm, request)
12651 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :)
12652 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :)
12656 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l22'
12659#if defined(__parallel)
12660 INTEGER :: ierr, rcount, scount
12663 CALL mp_timeset(routinen, handle)
12665#if defined(__parallel)
12666#if !defined(__GNUC__) || __GNUC__ >= 9
12667 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
12668 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
12671 scount =
SIZE(msgout(:, :))
12673 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12674 msgin, rcount, mpi_integer8, &
12675 comm%handle, request%handle, ierr)
12676 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12679 msgin(:, :) = msgout(:, :)
12682 CALL mp_timestop(handle)
12683 END SUBROUTINE mp_iallgather_l22
12694 SUBROUTINE mp_iallgather_l24(msgout, msgin, comm, request)
12695 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :)
12696 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :, :)
12700 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l24'
12703#if defined(__parallel)
12704 INTEGER :: ierr, rcount, scount
12707 CALL mp_timeset(routinen, handle)
12709#if defined(__parallel)
12710#if !defined(__GNUC__) || __GNUC__ >= 9
12711 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
12712 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
12715 scount =
SIZE(msgout(:, :))
12717 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12718 msgin, rcount, mpi_integer8, &
12719 comm%handle, request%handle, ierr)
12720 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12723 msgin(:, :, 1, 1) = msgout(:, :)
12726 CALL mp_timestop(handle)
12727 END SUBROUTINE mp_iallgather_l24
12738 SUBROUTINE mp_iallgather_l33(msgout, msgin, comm, request)
12739 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:, :, :)
12740 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:, :, :)
12744 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_l33'
12747#if defined(__parallel)
12748 INTEGER :: ierr, rcount, scount
12751 CALL mp_timeset(routinen, handle)
12753#if defined(__parallel)
12754#if !defined(__GNUC__) || __GNUC__ >= 9
12755 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
12756 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
12759 scount =
SIZE(msgout(:, :, :))
12761 CALL mpi_iallgather(msgout, scount, mpi_integer8, &
12762 msgin, rcount, mpi_integer8, &
12763 comm%handle, request%handle, ierr)
12764 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
12767 msgin(:, :, :) = msgout(:, :, :)
12770 CALL mp_timestop(handle)
12771 END SUBROUTINE mp_iallgather_l33
12790 SUBROUTINE mp_allgatherv_lv(msgout, msgin, rcount, rdispl, comm)
12791 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
12792 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12793 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12796 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_lv'
12799#if defined(__parallel)
12800 INTEGER :: ierr, scount
12803 CALL mp_timeset(routinen, handle)
12805#if defined(__parallel)
12806 scount =
SIZE(msgout)
12807 CALL mpi_allgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12808 rdispl, mpi_integer8, comm%handle, ierr)
12809 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
12816 CALL mp_timestop(handle)
12817 END SUBROUTINE mp_allgatherv_lv
12836 SUBROUTINE mp_allgatherv_lm2(msgout, msgin, rcount, rdispl, comm)
12837 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
12838 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
12839 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12842 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_lv'
12845#if defined(__parallel)
12846 INTEGER :: ierr, scount
12849 CALL mp_timeset(routinen, handle)
12851#if defined(__parallel)
12852 scount =
SIZE(msgout)
12853 CALL mpi_allgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12854 rdispl, mpi_integer8, comm%handle, ierr)
12855 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
12862 CALL mp_timestop(handle)
12863 END SUBROUTINE mp_allgatherv_lm2
12882 SUBROUTINE mp_iallgatherv_lv(msgout, msgin, rcount, rdispl, comm, request)
12883 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12884 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12885 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
12889 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_lv'
12892#if defined(__parallel)
12893 INTEGER :: ierr, scount, rsize
12896 CALL mp_timeset(routinen, handle)
12898#if defined(__parallel)
12899#if !defined(__GNUC__) || __GNUC__ >= 9
12900 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
12901 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
12902 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
12903 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
12906 scount =
SIZE(msgout)
12907 rsize =
SIZE(rcount)
12908 CALL mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, &
12909 rdispl, comm, request, ierr)
12910 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
12918 CALL mp_timestop(handle)
12919 END SUBROUTINE mp_iallgatherv_lv
12938 SUBROUTINE mp_iallgatherv_lv2(msgout, msgin, rcount, rdispl, comm, request)
12939 INTEGER(KIND=int_8),
INTENT(IN) :: msgout(:)
12940 INTEGER(KIND=int_8),
INTENT(OUT) :: msgin(:)
12941 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
12945 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_lv2'
12948#if defined(__parallel)
12949 INTEGER :: ierr, scount, rsize
12952 CALL mp_timeset(routinen, handle)
12954#if defined(__parallel)
12955#if !defined(__GNUC__) || __GNUC__ >= 9
12956 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
12957 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
12958 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
12959 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
12962 scount =
SIZE(msgout)
12963 rsize =
SIZE(rcount)
12964 CALL mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, &
12965 rdispl, comm, request, ierr)
12966 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
12974 CALL mp_timestop(handle)
12975 END SUBROUTINE mp_iallgatherv_lv2
12986#if defined(__parallel)
12987 SUBROUTINE mp_iallgatherv_lv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
12988 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
12989 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
12990 INTEGER,
INTENT(IN) :: rsize
12991 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
12994 INTEGER,
INTENT(INOUT) :: ierr
12996 CALL mpi_iallgatherv(msgout, scount, mpi_integer8, msgin, rcount, &
12997 rdispl, mpi_integer8, comm%handle, request%handle, ierr)
12999 END SUBROUTINE mp_iallgatherv_lv_internal
13010 SUBROUTINE mp_sum_scatter_lv(msgout, msgin, rcount, comm)
13011 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
13012 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
13013 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
13016 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_lv'
13019#if defined(__parallel)
13023 CALL mp_timeset(routinen, handle)
13025#if defined(__parallel)
13026 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_integer8, mpi_sum, &
13028 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
13030 CALL add_perf(perf_id=3, count=1, &
13031 msg_size=rcount(1)*2*int_8_size)
13035 msgin = msgout(:, 1)
13037 CALL mp_timestop(handle)
13038 END SUBROUTINE mp_sum_scatter_lv
13049 SUBROUTINE mp_sendrecv_l (msgin, dest, msgout, source, comm, tag)
13050 INTEGER(KIND=int_8),
INTENT(IN) :: msgin
13051 INTEGER,
INTENT(IN) :: dest
13052 INTEGER(KIND=int_8),
INTENT(OUT) :: msgout
13053 INTEGER,
INTENT(IN) :: source
13055 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13057 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_l'
13060#if defined(__parallel)
13061 INTEGER :: ierr, msglen_in, msglen_out, &
13065 CALL mp_timeset(routinen, handle)
13067#if defined(__parallel)
13072 IF (
PRESENT(tag))
THEN
13076 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13077 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13078 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13079 CALL add_perf(perf_id=7, count=1, &
13080 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13088 CALL mp_timestop(handle)
13089 END SUBROUTINE mp_sendrecv_l
13100 SUBROUTINE mp_sendrecv_lv(msgin, dest, msgout, source, comm, tag)
13101 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
13102 INTEGER,
INTENT(IN) :: dest
13103 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
13104 INTEGER,
INTENT(IN) :: source
13106 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13108 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lv'
13111#if defined(__parallel)
13112 INTEGER :: ierr, msglen_in, msglen_out, &
13116 CALL mp_timeset(routinen, handle)
13118#if defined(__parallel)
13119 msglen_in =
SIZE(msgin)
13120 msglen_out =
SIZE(msgout)
13123 IF (
PRESENT(tag))
THEN
13127 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13128 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13129 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13130 CALL add_perf(perf_id=7, count=1, &
13131 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13139 CALL mp_timestop(handle)
13140 END SUBROUTINE mp_sendrecv_lv
13152 SUBROUTINE mp_sendrecv_lm2(msgin, dest, msgout, source, comm, tag)
13153 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
13154 INTEGER,
INTENT(IN) :: dest
13155 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
13156 INTEGER,
INTENT(IN) :: source
13158 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13160 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm2'
13163#if defined(__parallel)
13164 INTEGER :: ierr, msglen_in, msglen_out, &
13168 CALL mp_timeset(routinen, handle)
13170#if defined(__parallel)
13171 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
13172 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
13175 IF (
PRESENT(tag))
THEN
13179 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13180 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13181 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13182 CALL add_perf(perf_id=7, count=1, &
13183 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13191 CALL mp_timestop(handle)
13192 END SUBROUTINE mp_sendrecv_lm2
13203 SUBROUTINE mp_sendrecv_lm3(msgin, dest, msgout, source, comm, tag)
13204 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
13205 INTEGER,
INTENT(IN) :: dest
13206 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
13207 INTEGER,
INTENT(IN) :: source
13209 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13211 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm3'
13214#if defined(__parallel)
13215 INTEGER :: ierr, msglen_in, msglen_out, &
13219 CALL mp_timeset(routinen, handle)
13221#if defined(__parallel)
13222 msglen_in =
SIZE(msgin)
13223 msglen_out =
SIZE(msgout)
13226 IF (
PRESENT(tag))
THEN
13230 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13231 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13232 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13233 CALL add_perf(perf_id=7, count=1, &
13234 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13242 CALL mp_timestop(handle)
13243 END SUBROUTINE mp_sendrecv_lm3
13254 SUBROUTINE mp_sendrecv_lm4(msgin, dest, msgout, source, comm, tag)
13255 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
13256 INTEGER,
INTENT(IN) :: dest
13257 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
13258 INTEGER,
INTENT(IN) :: source
13260 INTEGER,
INTENT(IN),
OPTIONAL :: tag
13262 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_lm4'
13265#if defined(__parallel)
13266 INTEGER :: ierr, msglen_in, msglen_out, &
13270 CALL mp_timeset(routinen, handle)
13272#if defined(__parallel)
13273 msglen_in =
SIZE(msgin)
13274 msglen_out =
SIZE(msgout)
13277 IF (
PRESENT(tag))
THEN
13281 CALL mpi_sendrecv(msgin, msglen_in, mpi_integer8, dest, send_tag, msgout, &
13282 msglen_out, mpi_integer8, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
13283 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
13284 CALL add_perf(perf_id=7, count=1, &
13285 msg_size=(msglen_in + msglen_out)*int_8_size/2)
13293 CALL mp_timestop(handle)
13294 END SUBROUTINE mp_sendrecv_lm4
13311 SUBROUTINE mp_isendrecv_l (msgin, dest, msgout, source, comm, send_request, &
13313 INTEGER(KIND=int_8),
INTENT(IN) :: msgin
13314 INTEGER,
INTENT(IN) :: dest
13315 INTEGER(KIND=int_8),
INTENT(INOUT) :: msgout
13316 INTEGER,
INTENT(IN) :: source
13319 INTEGER,
INTENT(in),
OPTIONAL :: tag
13321 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_l'
13324#if defined(__parallel)
13325 INTEGER :: ierr, my_tag
13328 CALL mp_timeset(routinen, handle)
13330#if defined(__parallel)
13332 IF (
PRESENT(tag)) my_tag = tag
13334 CALL mpi_irecv(msgout, 1, mpi_integer8, source, my_tag, &
13335 comm%handle, recv_request%handle, ierr)
13336 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13338 CALL mpi_isend(msgin, 1, mpi_integer8, dest, my_tag, &
13339 comm%handle, send_request%handle, ierr)
13340 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13342 CALL add_perf(perf_id=8, count=1, msg_size=2*int_8_size)
13352 CALL mp_timestop(handle)
13353 END SUBROUTINE mp_isendrecv_l
13372 SUBROUTINE mp_isendrecv_lv(msgin, dest, msgout, source, comm, send_request, &
13374 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: msgin
13375 INTEGER,
INTENT(IN) :: dest
13376 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
13377 INTEGER,
INTENT(IN) :: source
13380 INTEGER,
INTENT(in),
OPTIONAL :: tag
13382 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_lv'
13385#if defined(__parallel)
13386 INTEGER :: ierr, msglen, my_tag
13387 INTEGER(KIND=int_8) :: foo
13390 CALL mp_timeset(routinen, handle)
13392#if defined(__parallel)
13393#if !defined(__GNUC__) || __GNUC__ >= 9
13394 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
13395 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
13399 IF (
PRESENT(tag)) my_tag = tag
13401 msglen =
SIZE(msgout, 1)
13402 IF (msglen > 0)
THEN
13403 CALL mpi_irecv(msgout(1), msglen, mpi_integer8, source, my_tag, &
13404 comm%handle, recv_request%handle, ierr)
13406 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13407 comm%handle, recv_request%handle, ierr)
13409 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13411 msglen =
SIZE(msgin, 1)
13412 IF (msglen > 0)
THEN
13413 CALL mpi_isend(msgin(1), msglen, mpi_integer8, dest, my_tag, &
13414 comm%handle, send_request%handle, ierr)
13416 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13417 comm%handle, send_request%handle, ierr)
13419 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13421 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
13422 CALL add_perf(perf_id=8, count=1, msg_size=msglen*int_8_size)
13432 CALL mp_timestop(handle)
13433 END SUBROUTINE mp_isendrecv_lv
13448 SUBROUTINE mp_isend_lv(msgin, dest, comm, request, tag)
13449 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: msgin
13450 INTEGER,
INTENT(IN) :: dest
13453 INTEGER,
INTENT(in),
OPTIONAL :: tag
13455 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lv'
13457 INTEGER :: handle, ierr
13458#if defined(__parallel)
13459 INTEGER :: msglen, my_tag
13460 INTEGER(KIND=int_8) :: foo(1)
13463 CALL mp_timeset(routinen, handle)
13465#if defined(__parallel)
13466#if !defined(__GNUC__) || __GNUC__ >= 9
13467 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
13470 IF (
PRESENT(tag)) my_tag = tag
13472 msglen =
SIZE(msgin)
13473 IF (msglen > 0)
THEN
13474 CALL mpi_isend(msgin(1), msglen, mpi_integer8, dest, my_tag, &
13475 comm%handle, request%handle, ierr)
13477 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13478 comm%handle, request%handle, ierr)
13480 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13482 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13491 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13493 CALL mp_timestop(handle)
13494 END SUBROUTINE mp_isend_lv
13511 SUBROUTINE mp_isend_lm2(msgin, dest, comm, request, tag)
13512 INTEGER(KIND=int_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
13513 INTEGER,
INTENT(IN) :: dest
13516 INTEGER,
INTENT(in),
OPTIONAL :: tag
13518 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm2'
13520 INTEGER :: handle, ierr
13521#if defined(__parallel)
13522 INTEGER :: msglen, my_tag
13523 INTEGER(KIND=int_8) :: foo(1)
13526 CALL mp_timeset(routinen, handle)
13528#if defined(__parallel)
13529#if !defined(__GNUC__) || __GNUC__ >= 9
13530 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
13534 IF (
PRESENT(tag)) my_tag = tag
13536 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
13537 IF (msglen > 0)
THEN
13538 CALL mpi_isend(msgin(1, 1), msglen, mpi_integer8, dest, my_tag, &
13539 comm%handle, request%handle, ierr)
13541 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13542 comm%handle, request%handle, ierr)
13544 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13546 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13555 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13557 CALL mp_timestop(handle)
13558 END SUBROUTINE mp_isend_lm2
13577 SUBROUTINE mp_isend_lm3(msgin, dest, comm, request, tag)
13578 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
13579 INTEGER,
INTENT(IN) :: dest
13582 INTEGER,
INTENT(in),
OPTIONAL :: tag
13584 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm3'
13586 INTEGER :: handle, ierr
13587#if defined(__parallel)
13588 INTEGER :: msglen, my_tag
13589 INTEGER(KIND=int_8) :: foo(1)
13592 CALL mp_timeset(routinen, handle)
13594#if defined(__parallel)
13595#if !defined(__GNUC__) || __GNUC__ >= 9
13596 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
13600 IF (
PRESENT(tag)) my_tag = tag
13602 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
13603 IF (msglen > 0)
THEN
13604 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_integer8, dest, my_tag, &
13605 comm%handle, request%handle, ierr)
13607 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13608 comm%handle, request%handle, ierr)
13610 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13612 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13621 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13623 CALL mp_timestop(handle)
13624 END SUBROUTINE mp_isend_lm3
13640 SUBROUTINE mp_isend_lm4(msgin, dest, comm, request, tag)
13641 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
13642 INTEGER,
INTENT(IN) :: dest
13645 INTEGER,
INTENT(in),
OPTIONAL :: tag
13647 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_lm4'
13649 INTEGER :: handle, ierr
13650#if defined(__parallel)
13651 INTEGER :: msglen, my_tag
13652 INTEGER(KIND=int_8) :: foo(1)
13655 CALL mp_timeset(routinen, handle)
13657#if defined(__parallel)
13658#if !defined(__GNUC__) || __GNUC__ >= 9
13659 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
13663 IF (
PRESENT(tag)) my_tag = tag
13665 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
13666 IF (msglen > 0)
THEN
13667 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_integer8, dest, my_tag, &
13668 comm%handle, request%handle, ierr)
13670 CALL mpi_isend(foo, msglen, mpi_integer8, dest, my_tag, &
13671 comm%handle, request%handle, ierr)
13673 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
13675 CALL add_perf(perf_id=11, count=1, msg_size=msglen*int_8_size)
13684 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
13686 CALL mp_timestop(handle)
13687 END SUBROUTINE mp_isend_lm4
13703 SUBROUTINE mp_irecv_lv(msgout, source, comm, request, tag)
13704 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
13705 INTEGER,
INTENT(IN) :: source
13708 INTEGER,
INTENT(in),
OPTIONAL :: tag
13710 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lv'
13713#if defined(__parallel)
13714 INTEGER :: ierr, msglen, my_tag
13715 INTEGER(KIND=int_8) :: foo(1)
13718 CALL mp_timeset(routinen, handle)
13720#if defined(__parallel)
13721#if !defined(__GNUC__) || __GNUC__ >= 9
13722 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
13726 IF (
PRESENT(tag)) my_tag = tag
13728 msglen =
SIZE(msgout)
13729 IF (msglen > 0)
THEN
13730 CALL mpi_irecv(msgout(1), msglen, mpi_integer8, source, my_tag, &
13731 comm%handle, request%handle, ierr)
13733 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13734 comm%handle, request%handle, ierr)
13736 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13738 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13740 cpabort(
"mp_irecv called in non parallel case")
13747 CALL mp_timestop(handle)
13748 END SUBROUTINE mp_irecv_lv
13765 SUBROUTINE mp_irecv_lm2(msgout, source, comm, request, tag)
13766 INTEGER(KIND=int_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
13767 INTEGER,
INTENT(IN) :: source
13770 INTEGER,
INTENT(in),
OPTIONAL :: tag
13772 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm2'
13775#if defined(__parallel)
13776 INTEGER :: ierr, msglen, my_tag
13777 INTEGER(KIND=int_8) :: foo(1)
13780 CALL mp_timeset(routinen, handle)
13782#if defined(__parallel)
13783#if !defined(__GNUC__) || __GNUC__ >= 9
13784 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
13788 IF (
PRESENT(tag)) my_tag = tag
13790 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
13791 IF (msglen > 0)
THEN
13792 CALL mpi_irecv(msgout(1, 1), msglen, mpi_integer8, source, my_tag, &
13793 comm%handle, request%handle, ierr)
13795 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13796 comm%handle, request%handle, ierr)
13798 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
13800 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13807 cpabort(
"mp_irecv called in non parallel case")
13809 CALL mp_timestop(handle)
13810 END SUBROUTINE mp_irecv_lm2
13828 SUBROUTINE mp_irecv_lm3(msgout, source, comm, request, tag)
13829 INTEGER(KIND=int_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
13830 INTEGER,
INTENT(IN) :: source
13833 INTEGER,
INTENT(in),
OPTIONAL :: tag
13835 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm3'
13838#if defined(__parallel)
13839 INTEGER :: ierr, msglen, my_tag
13840 INTEGER(KIND=int_8) :: foo(1)
13843 CALL mp_timeset(routinen, handle)
13845#if defined(__parallel)
13846#if !defined(__GNUC__) || __GNUC__ >= 9
13847 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
13851 IF (
PRESENT(tag)) my_tag = tag
13853 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
13854 IF (msglen > 0)
THEN
13855 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_integer8, source, my_tag, &
13856 comm%handle, request%handle, ierr)
13858 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13859 comm%handle, request%handle, ierr)
13861 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
13863 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13870 cpabort(
"mp_irecv called in non parallel case")
13872 CALL mp_timestop(handle)
13873 END SUBROUTINE mp_irecv_lm3
13889 SUBROUTINE mp_irecv_lm4(msgout, source, comm, request, tag)
13890 INTEGER(KIND=int_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
13891 INTEGER,
INTENT(IN) :: source
13894 INTEGER,
INTENT(in),
OPTIONAL :: tag
13896 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_lm4'
13899#if defined(__parallel)
13900 INTEGER :: ierr, msglen, my_tag
13901 INTEGER(KIND=int_8) :: foo(1)
13904 CALL mp_timeset(routinen, handle)
13906#if defined(__parallel)
13907#if !defined(__GNUC__) || __GNUC__ >= 9
13908 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
13912 IF (
PRESENT(tag)) my_tag = tag
13914 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
13915 IF (msglen > 0)
THEN
13916 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_integer8, source, my_tag, &
13917 comm%handle, request%handle, ierr)
13919 CALL mpi_irecv(foo, msglen, mpi_integer8, source, my_tag, &
13920 comm%handle, request%handle, ierr)
13922 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
13924 CALL add_perf(perf_id=12, count=1, msg_size=msglen*int_8_size)
13931 cpabort(
"mp_irecv called in non parallel case")
13933 CALL mp_timestop(handle)
13934 END SUBROUTINE mp_irecv_lm4
13946 SUBROUTINE mp_win_create_lv(base, comm, win)
13947 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
13951 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_lv'
13954#if defined(__parallel)
13956 INTEGER(kind=mpi_address_kind) :: len
13957 INTEGER(KIND=int_8) :: foo(1)
13960 CALL mp_timeset(routinen, handle)
13962#if defined(__parallel)
13964 len =
SIZE(base)*int_8_size
13966 CALL mpi_win_create(base(1), len, int_8_size, mpi_info_null, comm%handle, win%handle, ierr)
13968 CALL mpi_win_create(foo, len, int_8_size, mpi_info_null, comm%handle, win%handle, ierr)
13970 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
13972 CALL add_perf(perf_id=20, count=1)
13976 win%handle = mp_win_null_handle
13978 CALL mp_timestop(handle)
13979 END SUBROUTINE mp_win_create_lv
13991 SUBROUTINE mp_rget_lv(base, source, win, win_data, myproc, disp, request, &
13992 origin_datatype, target_datatype)
13993 INTEGER(KIND=int_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
13994 INTEGER,
INTENT(IN) :: source
13996 INTEGER(KIND=int_8),
DIMENSION(:),
INTENT(IN) :: win_data
13997 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
14001 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_lv'
14004#if defined(__parallel)
14005 INTEGER :: ierr, len, &
14006 origin_len, target_len
14007 LOGICAL :: do_local_copy
14008 INTEGER(kind=mpi_address_kind) :: disp_aint
14009 mpi_data_type :: handle_origin_datatype, handle_target_datatype
14012 CALL mp_timeset(routinen, handle)
14014#if defined(__parallel)
14017 IF (
PRESENT(disp))
THEN
14018 disp_aint = int(disp, kind=mpi_address_kind)
14020 handle_origin_datatype = mpi_integer8
14022 IF (
PRESENT(origin_datatype))
THEN
14023 handle_origin_datatype = origin_datatype%type_handle
14026 handle_target_datatype = mpi_integer8
14028 IF (
PRESENT(target_datatype))
THEN
14029 handle_target_datatype = target_datatype%type_handle
14033 do_local_copy = .false.
14034 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
14035 IF (myproc .EQ. source) do_local_copy = .true.
14037 IF (do_local_copy)
THEN
14039 base(:) = win_data(disp_aint + 1:disp_aint + len)
14044 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
14045 target_len, handle_target_datatype, win%handle, request%handle, ierr)
14051 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
14053 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*int_8_size)
14058 mark_used(origin_datatype)
14059 mark_used(target_datatype)
14063 IF (
PRESENT(disp))
THEN
14064 base(:) = win_data(disp + 1:disp +
SIZE(base))
14066 base(:) = win_data(:
SIZE(base))
14070 CALL mp_timestop(handle)
14071 END SUBROUTINE mp_rget_lv
14080 FUNCTION mp_type_indexed_make_l (count, lengths, displs) &
14081 result(type_descriptor)
14082 INTEGER,
INTENT(IN) :: count
14083 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
14086 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_l'
14089#if defined(__parallel)
14093 CALL mp_timeset(routinen, handle)
14095#if defined(__parallel)
14096 CALL mpi_type_indexed(count, lengths, displs, mpi_integer8, &
14097 type_descriptor%type_handle, ierr)
14099 cpabort(
"MPI_Type_Indexed @ "//routinen)
14100 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
14102 cpabort(
"MPI_Type_commit @ "//routinen)
14104 type_descriptor%type_handle = 19
14106 type_descriptor%length = count
14107 NULLIFY (type_descriptor%subtype)
14108 type_descriptor%vector_descriptor(1:2) = 1
14109 type_descriptor%has_indexing = .true.
14110 type_descriptor%index_descriptor%index => lengths
14111 type_descriptor%index_descriptor%chunks => displs
14113 CALL mp_timestop(handle)
14115 END FUNCTION mp_type_indexed_make_l
14124 SUBROUTINE mp_allocate_l (DATA, len, stat)
14125 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
14126 INTEGER,
INTENT(IN) :: len
14127 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14129 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_l'
14131 INTEGER :: handle, ierr
14133 CALL mp_timeset(routinen, handle)
14135#if defined(__parallel)
14137 CALL mp_alloc_mem(
DATA, len, stat=ierr)
14138 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
14139 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
14140 CALL add_perf(perf_id=15, count=1)
14142 ALLOCATE (
DATA(len), stat=ierr)
14143 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
14144 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
14146 IF (
PRESENT(stat)) stat = ierr
14147 CALL mp_timestop(handle)
14148 END SUBROUTINE mp_allocate_l
14156 SUBROUTINE mp_deallocate_l (DATA, stat)
14157 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
14158 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14160 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_l'
14163#if defined(__parallel)
14167 CALL mp_timeset(routinen, handle)
14169#if defined(__parallel)
14170 CALL mp_free_mem(
DATA, ierr)
14171 IF (
PRESENT(stat))
THEN
14174 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
14177 CALL add_perf(perf_id=15, count=1)
14180 IF (
PRESENT(stat)) stat = 0
14182 CALL mp_timestop(handle)
14183 END SUBROUTINE mp_deallocate_l
14196 SUBROUTINE mp_file_write_at_lv(fh, offset, msg, msglen)
14197 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
14199 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14200 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14203#if defined(__parallel)
14207 msg_len =
SIZE(msg)
14208 IF (
PRESENT(msglen)) msg_len = msglen
14209#if defined(__parallel)
14210 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14212 cpabort(
"mpi_file_write_at_lv @ mp_file_write_at_lv")
14214 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14216 END SUBROUTINE mp_file_write_at_lv
14224 SUBROUTINE mp_file_write_at_l (fh, offset, msg)
14225 INTEGER(KIND=int_8),
INTENT(IN) :: msg
14227 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14229#if defined(__parallel)
14233 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14235 cpabort(
"mpi_file_write_at_l @ mp_file_write_at_l")
14237 WRITE (unit=fh%handle, pos=offset + 1) msg
14239 END SUBROUTINE mp_file_write_at_l
14251 SUBROUTINE mp_file_write_at_all_lv(fh, offset, msg, msglen)
14252 INTEGER(KIND=int_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
14254 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14255 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14258#if defined(__parallel)
14262 msg_len =
SIZE(msg)
14263 IF (
PRESENT(msglen)) msg_len = msglen
14264#if defined(__parallel)
14265 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14267 cpabort(
"mpi_file_write_at_all_lv @ mp_file_write_at_all_lv")
14269 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14271 END SUBROUTINE mp_file_write_at_all_lv
14279 SUBROUTINE mp_file_write_at_all_l (fh, offset, msg)
14280 INTEGER(KIND=int_8),
INTENT(IN) :: msg
14282 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14284#if defined(__parallel)
14288 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14290 cpabort(
"mpi_file_write_at_all_l @ mp_file_write_at_all_l")
14292 WRITE (unit=fh%handle, pos=offset + 1) msg
14294 END SUBROUTINE mp_file_write_at_all_l
14307 SUBROUTINE mp_file_read_at_lv(fh, offset, msg, msglen)
14308 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
14310 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14311 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14314#if defined(__parallel)
14318 msg_len =
SIZE(msg)
14319 IF (
PRESENT(msglen)) msg_len = msglen
14320#if defined(__parallel)
14321 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14323 cpabort(
"mpi_file_read_at_lv @ mp_file_read_at_lv")
14325 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14327 END SUBROUTINE mp_file_read_at_lv
14335 SUBROUTINE mp_file_read_at_l (fh, offset, msg)
14336 INTEGER(KIND=int_8),
INTENT(OUT) :: msg
14338 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14340#if defined(__parallel)
14344 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14346 cpabort(
"mpi_file_read_at_l @ mp_file_read_at_l")
14348 READ (unit=fh%handle, pos=offset + 1) msg
14350 END SUBROUTINE mp_file_read_at_l
14362 SUBROUTINE mp_file_read_at_all_lv(fh, offset, msg, msglen)
14363 INTEGER(KIND=int_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
14365 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
14366 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14369#if defined(__parallel)
14373 msg_len =
SIZE(msg)
14374 IF (
PRESENT(msglen)) msg_len = msglen
14375#if defined(__parallel)
14376 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_integer8, mpi_status_ignore, ierr)
14378 cpabort(
"mpi_file_read_at_all_lv @ mp_file_read_at_all_lv")
14380 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
14382 END SUBROUTINE mp_file_read_at_all_lv
14390 SUBROUTINE mp_file_read_at_all_l (fh, offset, msg)
14391 INTEGER(KIND=int_8),
INTENT(OUT) :: msg
14393 INTEGER(kind=file_offset),
INTENT(IN) :: offset
14395#if defined(__parallel)
14399 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_integer8, mpi_status_ignore, ierr)
14401 cpabort(
"mpi_file_read_at_all_l @ mp_file_read_at_all_l")
14403 READ (unit=fh%handle, pos=offset + 1) msg
14405 END SUBROUTINE mp_file_read_at_all_l
14414 FUNCTION mp_type_make_l (ptr, &
14415 vector_descriptor, index_descriptor) &
14416 result(type_descriptor)
14417 INTEGER(KIND=int_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
14418 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
14419 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
14422 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_l'
14424#if defined(__parallel)
14426#if defined(__MPI_F08)
14428 EXTERNAL :: mpi_get_address
14432 NULLIFY (type_descriptor%subtype)
14433 type_descriptor%length =
SIZE(ptr)
14434#if defined(__parallel)
14435 type_descriptor%type_handle = mpi_integer8
14436 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
14438 cpabort(
"MPI_Get_address @ "//routinen)
14440 type_descriptor%type_handle = 19
14442 type_descriptor%vector_descriptor(1:2) = 1
14443 type_descriptor%has_indexing = .false.
14444 type_descriptor%data_l => ptr
14445 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
14446 cpabort(routinen//
": Vectors and indices NYI")
14448 END FUNCTION mp_type_make_l
14457 SUBROUTINE mp_alloc_mem_l (DATA, len, stat)
14458 INTEGER(KIND=int_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
14459 INTEGER,
INTENT(IN) :: len
14460 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14462#if defined(__parallel)
14463 INTEGER :: size, ierr, length, &
14465 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
14466 TYPE(c_ptr) :: mp_baseptr
14467 mpi_info_type :: mp_info
14469 length = max(len, 1)
14470 CALL mpi_type_size(mpi_integer8,
size, ierr)
14471 mp_size = int(length, kind=mpi_address_kind)*
size
14472 IF (mp_size .GT. mp_max_memory_size)
THEN
14473 cpabort(
"MPI cannot allocate more than 2 GiByte")
14475 mp_info = mpi_info_null
14476 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
14477 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
14478 IF (
PRESENT(stat)) stat = mp_res
14480 INTEGER :: length, mystat
14481 length = max(len, 1)
14482 IF (
PRESENT(stat))
THEN
14483 ALLOCATE (
DATA(length), stat=mystat)
14486 ALLOCATE (
DATA(length))
14489 END SUBROUTINE mp_alloc_mem_l
14497 SUBROUTINE mp_free_mem_l (DATA, stat)
14498 INTEGER(KIND=int_8),
DIMENSION(:), &
14499 POINTER, asynchronous :: data
14500 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
14502#if defined(__parallel)
14504 CALL mpi_free_mem(
DATA, mp_res)
14505 IF (
PRESENT(stat)) stat = mp_res
14508 IF (
PRESENT(stat)) stat = 0
14510 END SUBROUTINE mp_free_mem_l
14522 SUBROUTINE mp_shift_dm(msg, comm, displ_in)
14524 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
14526 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
14528 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_dm'
14530 INTEGER :: handle, ierror
14531#if defined(__parallel)
14532 INTEGER :: displ, left, &
14533 msglen, myrank, nprocs, &
14538 CALL mp_timeset(routinen, handle)
14540#if defined(__parallel)
14541 CALL mpi_comm_rank(comm%handle, myrank, ierror)
14542 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
14543 CALL mpi_comm_size(comm%handle, nprocs, ierror)
14544 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
14545 IF (
PRESENT(displ_in))
THEN
14550 right =
modulo(myrank + displ, nprocs)
14551 left =
modulo(myrank - displ, nprocs)
14554 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_precision, right, tag, left, tag, &
14555 comm%handle, mpi_status_ignore, ierror)
14556 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
14557 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_8_size)
14561 mark_used(displ_in)
14563 CALL mp_timestop(handle)
14565 END SUBROUTINE mp_shift_dm
14578 SUBROUTINE mp_shift_d (msg, comm, displ_in)
14580 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
14582 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
14584 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_d'
14586 INTEGER :: handle, ierror
14587#if defined(__parallel)
14588 INTEGER :: displ, left, &
14589 msglen, myrank, nprocs, &
14594 CALL mp_timeset(routinen, handle)
14596#if defined(__parallel)
14597 CALL mpi_comm_rank(comm%handle, myrank, ierror)
14598 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
14599 CALL mpi_comm_size(comm%handle, nprocs, ierror)
14600 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
14601 IF (
PRESENT(displ_in))
THEN
14606 right =
modulo(myrank + displ, nprocs)
14607 left =
modulo(myrank - displ, nprocs)
14610 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_precision, right, tag, left, &
14611 tag, comm%handle, mpi_status_ignore, ierror)
14612 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
14613 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_8_size)
14617 mark_used(displ_in)
14619 CALL mp_timestop(handle)
14621 END SUBROUTINE mp_shift_d
14642 SUBROUTINE mp_alltoall_d11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
14644 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
14645 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
14646 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
14647 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
14650 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d11v'
14653#if defined(__parallel)
14654 INTEGER :: ierr, msglen
14659 CALL mp_timeset(routinen, handle)
14661#if defined(__parallel)
14662 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_precision, &
14663 rb, rcount, rdispl, mpi_double_precision, comm%handle, ierr)
14664 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
14665 msglen = sum(scount) + sum(rcount)
14666 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14672 DO i = 1, rcount(1)
14673 rb(rdispl(1) + i) = sb(sdispl(1) + i)
14676 CALL mp_timestop(handle)
14678 END SUBROUTINE mp_alltoall_d11v
14693 SUBROUTINE mp_alltoall_d22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
14695 REAL(kind=real_8),
DIMENSION(:, :), &
14696 INTENT(IN),
CONTIGUOUS :: sb
14697 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
14698 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS, &
14699 INTENT(INOUT) :: rb
14700 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
14703 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d22v'
14706#if defined(__parallel)
14707 INTEGER :: ierr, msglen
14710 CALL mp_timeset(routinen, handle)
14712#if defined(__parallel)
14713 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_precision, &
14714 rb, rcount, rdispl, mpi_double_precision, comm%handle, ierr)
14715 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
14716 msglen = sum(scount) + sum(rcount)
14717 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*real_8_size)
14726 CALL mp_timestop(handle)
14728 END SUBROUTINE mp_alltoall_d22v
14745 SUBROUTINE mp_alltoall_d (sb, rb, count, comm)
14747 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
14748 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
14749 INTEGER,
INTENT(IN) :: count
14752 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d'
14755#if defined(__parallel)
14756 INTEGER :: ierr, msglen, np
14759 CALL mp_timeset(routinen, handle)
14761#if defined(__parallel)
14762 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14763 rb, count, mpi_double_precision, comm%handle, ierr)
14764 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14765 CALL mpi_comm_size(comm%handle, np, ierr)
14766 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14767 msglen = 2*count*np
14768 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14774 CALL mp_timestop(handle)
14776 END SUBROUTINE mp_alltoall_d
14786 SUBROUTINE mp_alltoall_d22(sb, rb, count, comm)
14788 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
14789 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
14790 INTEGER,
INTENT(IN) :: count
14793 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d22'
14796#if defined(__parallel)
14797 INTEGER :: ierr, msglen, np
14800 CALL mp_timeset(routinen, handle)
14802#if defined(__parallel)
14803 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14804 rb, count, mpi_double_precision, comm%handle, ierr)
14805 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14806 CALL mpi_comm_size(comm%handle, np, ierr)
14807 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14808 msglen = 2*
SIZE(sb)*np
14809 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14815 CALL mp_timestop(handle)
14817 END SUBROUTINE mp_alltoall_d22
14827 SUBROUTINE mp_alltoall_d33(sb, rb, count, comm)
14829 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
14830 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
14831 INTEGER,
INTENT(IN) :: count
14834 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d33'
14837#if defined(__parallel)
14838 INTEGER :: ierr, msglen, np
14841 CALL mp_timeset(routinen, handle)
14843#if defined(__parallel)
14844 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14845 rb, count, mpi_double_precision, comm%handle, ierr)
14846 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14847 CALL mpi_comm_size(comm%handle, np, ierr)
14848 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14849 msglen = 2*count*np
14850 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14856 CALL mp_timestop(handle)
14858 END SUBROUTINE mp_alltoall_d33
14868 SUBROUTINE mp_alltoall_d44(sb, rb, count, comm)
14870 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14872 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14874 INTEGER,
INTENT(IN) :: count
14877 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d44'
14880#if defined(__parallel)
14881 INTEGER :: ierr, msglen, np
14884 CALL mp_timeset(routinen, handle)
14886#if defined(__parallel)
14887 CALL mpi_alltoall(sb, count, mpi_double_precision, &
14888 rb, count, mpi_double_precision, comm%handle, ierr)
14889 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
14890 CALL mpi_comm_size(comm%handle, np, ierr)
14891 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
14892 msglen = 2*count*np
14893 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
14899 CALL mp_timestop(handle)
14901 END SUBROUTINE mp_alltoall_d44
14911 SUBROUTINE mp_alltoall_d55(sb, rb, count, comm)
14913 REAL(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
14915 REAL(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
14917 INTEGER,
INTENT(IN) :: count
14920 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d55'
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)
14942 CALL mp_timestop(handle)
14944 END SUBROUTINE mp_alltoall_d55
14955 SUBROUTINE mp_alltoall_d45(sb, rb, count, comm)
14957 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
14959 REAL(kind=real_8), &
14960 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
14961 INTEGER,
INTENT(IN) :: count
14964 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d45'
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_d45
14999 SUBROUTINE mp_alltoall_d34(sb, rb, count, comm)
15001 REAL(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
15003 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
15005 INTEGER,
INTENT(IN) :: count
15008 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d34'
15011#if defined(__parallel)
15012 INTEGER :: ierr, msglen, np
15015 CALL mp_timeset(routinen, handle)
15017#if defined(__parallel)
15018 CALL mpi_alltoall(sb, count, mpi_double_precision, &
15019 rb, count, mpi_double_precision, comm%handle, ierr)
15020 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
15021 CALL mpi_comm_size(comm%handle, np, ierr)
15022 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
15023 msglen = 2*count*np
15024 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
15028 rb = reshape(sb, shape(rb))
15030 CALL mp_timestop(handle)
15032 END SUBROUTINE mp_alltoall_d34
15043 SUBROUTINE mp_alltoall_d54(sb, rb, count, comm)
15045 REAL(kind=real_8), &
15046 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
15047 REAL(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
15049 INTEGER,
INTENT(IN) :: count
15052 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_d54'
15055#if defined(__parallel)
15056 INTEGER :: ierr, msglen, np
15059 CALL mp_timeset(routinen, handle)
15061#if defined(__parallel)
15062 CALL mpi_alltoall(sb, count, mpi_double_precision, &
15063 rb, count, mpi_double_precision, comm%handle, ierr)
15064 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
15065 CALL mpi_comm_size(comm%handle, np, ierr)
15066 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
15067 msglen = 2*count*np
15068 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_8_size)
15072 rb = reshape(sb, shape(rb))
15074 CALL mp_timestop(handle)
15076 END SUBROUTINE mp_alltoall_d54
15087 SUBROUTINE mp_send_d (msg, dest, tag, comm)
15088 REAL(kind=real_8),
INTENT(IN) :: msg
15089 INTEGER,
INTENT(IN) :: dest, tag
15092 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_d'
15095#if defined(__parallel)
15096 INTEGER :: ierr, msglen
15099 CALL mp_timeset(routinen, handle)
15101#if defined(__parallel)
15103 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15104 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15105 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15112 cpabort(
"not in parallel mode")
15114 CALL mp_timestop(handle)
15115 END SUBROUTINE mp_send_d
15125 SUBROUTINE mp_send_dv(msg, dest, tag, comm)
15126 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
15127 INTEGER,
INTENT(IN) :: dest, tag
15130 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_dv'
15133#if defined(__parallel)
15134 INTEGER :: ierr, msglen
15137 CALL mp_timeset(routinen, handle)
15139#if defined(__parallel)
15141 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15142 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15143 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15150 cpabort(
"not in parallel mode")
15152 CALL mp_timestop(handle)
15153 END SUBROUTINE mp_send_dv
15163 SUBROUTINE mp_send_dm2(msg, dest, tag, comm)
15164 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
15165 INTEGER,
INTENT(IN) :: dest, tag
15168 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_dm2'
15171#if defined(__parallel)
15172 INTEGER :: ierr, msglen
15175 CALL mp_timeset(routinen, handle)
15177#if defined(__parallel)
15179 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15180 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15181 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15188 cpabort(
"not in parallel mode")
15190 CALL mp_timestop(handle)
15191 END SUBROUTINE mp_send_dm2
15201 SUBROUTINE mp_send_dm3(msg, dest, tag, comm)
15202 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
15203 INTEGER,
INTENT(IN) :: dest, tag
15206 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
15209#if defined(__parallel)
15210 INTEGER :: ierr, msglen
15213 CALL mp_timeset(routinen, handle)
15215#if defined(__parallel)
15217 CALL mpi_send(msg, msglen, mpi_double_precision, dest, tag, comm%handle, ierr)
15218 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
15219 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_8_size)
15226 cpabort(
"not in parallel mode")
15228 CALL mp_timestop(handle)
15229 END SUBROUTINE mp_send_dm3
15240 SUBROUTINE mp_recv_d (msg, source, tag, comm)
15241 REAL(kind=real_8),
INTENT(INOUT) :: msg
15242 INTEGER,
INTENT(INOUT) :: source, tag
15245 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_d'
15248#if defined(__parallel)
15249 INTEGER :: ierr, msglen
15250 mpi_status_type :: status
15253 CALL mp_timeset(routinen, handle)
15255#if defined(__parallel)
15258 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15259 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15261 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15262 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15263 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15264 source = status mpi_status_extract(mpi_source)
15265 tag = status mpi_status_extract(mpi_tag)
15273 cpabort(
"not in parallel mode")
15275 CALL mp_timestop(handle)
15276 END SUBROUTINE mp_recv_d
15286 SUBROUTINE mp_recv_dv(msg, source, tag, comm)
15287 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15288 INTEGER,
INTENT(INOUT) :: source, tag
15291 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dv'
15294#if defined(__parallel)
15295 INTEGER :: ierr, msglen
15296 mpi_status_type :: status
15299 CALL mp_timeset(routinen, handle)
15301#if defined(__parallel)
15304 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15305 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15307 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15308 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15309 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15310 source = status mpi_status_extract(mpi_source)
15311 tag = status mpi_status_extract(mpi_tag)
15319 cpabort(
"not in parallel mode")
15321 CALL mp_timestop(handle)
15322 END SUBROUTINE mp_recv_dv
15332 SUBROUTINE mp_recv_dm2(msg, source, tag, comm)
15333 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15334 INTEGER,
INTENT(INOUT) :: source, tag
15337 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dm2'
15340#if defined(__parallel)
15341 INTEGER :: ierr, msglen
15342 mpi_status_type :: status
15345 CALL mp_timeset(routinen, handle)
15347#if defined(__parallel)
15350 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15351 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15353 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15354 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15355 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15356 source = status mpi_status_extract(mpi_source)
15357 tag = status mpi_status_extract(mpi_tag)
15365 cpabort(
"not in parallel mode")
15367 CALL mp_timestop(handle)
15368 END SUBROUTINE mp_recv_dm2
15378 SUBROUTINE mp_recv_dm3(msg, source, tag, comm)
15379 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
15380 INTEGER,
INTENT(INOUT) :: source, tag
15383 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_dm3'
15386#if defined(__parallel)
15387 INTEGER :: ierr, msglen
15388 mpi_status_type :: status
15391 CALL mp_timeset(routinen, handle)
15393#if defined(__parallel)
15396 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, mpi_status_ignore, ierr)
15397 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15399 CALL mpi_recv(msg, msglen, mpi_double_precision, source, tag, comm%handle, status, ierr)
15400 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
15401 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_8_size)
15402 source = status mpi_status_extract(mpi_source)
15403 tag = status mpi_status_extract(mpi_tag)
15411 cpabort(
"not in parallel mode")
15413 CALL mp_timestop(handle)
15414 END SUBROUTINE mp_recv_dm3
15424 SUBROUTINE mp_bcast_d (msg, source, comm)
15425 REAL(kind=real_8),
INTENT(INOUT) :: msg
15426 INTEGER,
INTENT(IN) :: source
15429 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d'
15432#if defined(__parallel)
15433 INTEGER :: ierr, msglen
15436 CALL mp_timeset(routinen, handle)
15438#if defined(__parallel)
15440 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15441 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15442 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15448 CALL mp_timestop(handle)
15449 END SUBROUTINE mp_bcast_d
15458 SUBROUTINE mp_bcast_d_src(msg, comm)
15459 REAL(kind=real_8),
INTENT(INOUT) :: msg
15462 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d_src'
15465#if defined(__parallel)
15466 INTEGER :: ierr, msglen
15469 CALL mp_timeset(routinen, handle)
15471#if defined(__parallel)
15473 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15474 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15475 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15480 CALL mp_timestop(handle)
15481 END SUBROUTINE mp_bcast_d_src
15491 SUBROUTINE mp_ibcast_d (msg, source, comm, request)
15492 REAL(kind=real_8),
INTENT(INOUT) :: msg
15493 INTEGER,
INTENT(IN) :: source
15497 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_d'
15500#if defined(__parallel)
15501 INTEGER :: ierr, msglen
15504 CALL mp_timeset(routinen, handle)
15506#if defined(__parallel)
15508 CALL mpi_ibcast(msg, msglen, mpi_double_precision, source, comm%handle, request%handle, ierr)
15509 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
15510 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_8_size)
15517 CALL mp_timestop(handle)
15518 END SUBROUTINE mp_ibcast_d
15527 SUBROUTINE mp_bcast_dv(msg, source, comm)
15528 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15529 INTEGER,
INTENT(IN) :: source
15532 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dv'
15535#if defined(__parallel)
15536 INTEGER :: ierr, msglen
15539 CALL mp_timeset(routinen, handle)
15541#if defined(__parallel)
15543 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15544 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15545 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15551 CALL mp_timestop(handle)
15552 END SUBROUTINE mp_bcast_dv
15560 SUBROUTINE mp_bcast_dv_src(msg, comm)
15561 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15564 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dv_src'
15567#if defined(__parallel)
15568 INTEGER :: ierr, msglen
15571 CALL mp_timeset(routinen, handle)
15573#if defined(__parallel)
15575 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15576 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15577 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15582 CALL mp_timestop(handle)
15583 END SUBROUTINE mp_bcast_dv_src
15592 SUBROUTINE mp_ibcast_dv(msg, source, comm, request)
15593 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
15594 INTEGER,
INTENT(IN) :: source
15598 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_dv'
15601#if defined(__parallel)
15602 INTEGER :: ierr, msglen
15605 CALL mp_timeset(routinen, handle)
15607#if defined(__parallel)
15608#if !defined(__GNUC__) || __GNUC__ >= 9
15609 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
15612 CALL mpi_ibcast(msg, msglen, mpi_double_precision, source, comm%handle, request%handle, ierr)
15613 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
15614 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_8_size)
15621 CALL mp_timestop(handle)
15622 END SUBROUTINE mp_ibcast_dv
15631 SUBROUTINE mp_bcast_dm(msg, source, comm)
15632 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15633 INTEGER,
INTENT(IN) :: source
15636 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dm'
15639#if defined(__parallel)
15640 INTEGER :: ierr, msglen
15643 CALL mp_timeset(routinen, handle)
15645#if defined(__parallel)
15647 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15648 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15649 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15655 CALL mp_timestop(handle)
15656 END SUBROUTINE mp_bcast_dm
15665 SUBROUTINE mp_bcast_dm_src(msg, comm)
15666 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15669 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_dm_src'
15672#if defined(__parallel)
15673 INTEGER :: ierr, msglen
15676 CALL mp_timeset(routinen, handle)
15678#if defined(__parallel)
15680 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15681 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15682 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15687 CALL mp_timestop(handle)
15688 END SUBROUTINE mp_bcast_dm_src
15697 SUBROUTINE mp_bcast_d3(msg, source, comm)
15698 REAL(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
15699 INTEGER,
INTENT(IN) :: source
15702 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d3'
15705#if defined(__parallel)
15706 INTEGER :: ierr, msglen
15709 CALL mp_timeset(routinen, handle)
15711#if defined(__parallel)
15713 CALL mpi_bcast(msg, msglen, mpi_double_precision, source, comm%handle, ierr)
15714 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15715 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15721 CALL mp_timestop(handle)
15722 END SUBROUTINE mp_bcast_d3
15731 SUBROUTINE mp_bcast_d3_src(msg, comm)
15732 REAL(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
15735 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_d3_src'
15738#if defined(__parallel)
15739 INTEGER :: ierr, msglen
15742 CALL mp_timeset(routinen, handle)
15744#if defined(__parallel)
15746 CALL mpi_bcast(msg, msglen, mpi_double_precision, comm%source, comm%handle, ierr)
15747 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
15748 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_8_size)
15753 CALL mp_timestop(handle)
15754 END SUBROUTINE mp_bcast_d3_src
15763 SUBROUTINE mp_sum_d (msg, comm)
15764 REAL(kind=real_8),
INTENT(INOUT) :: msg
15767 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_d'
15770#if defined(__parallel)
15771 INTEGER :: ierr, msglen
15772 REAL(kind=real_8) :: res
15775 CALL mp_timeset(routinen, handle)
15777#if defined(__parallel)
15779 IF (comm%num_pe > 1)
THEN
15780 CALL mpi_allreduce(msg, res, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15781 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15784 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15789 CALL mp_timestop(handle)
15790 END SUBROUTINE mp_sum_d
15798 SUBROUTINE mp_sum_dv(msg, comm)
15799 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15802 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dv'
15805#if defined(__parallel)
15806 INTEGER :: ierr, msglen
15807 REAL(kind=real_8),
ALLOCATABLE :: msgbuf(:)
15810 CALL mp_timeset(routinen, handle)
15812#if defined(__parallel)
15814 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
15815 ALLOCATE (msgbuf(msglen))
15816 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15817 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15820 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15825 CALL mp_timestop(handle)
15826 END SUBROUTINE mp_sum_dv
15834 SUBROUTINE mp_isum_dv(msg, comm, request)
15835 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
15839 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_dv'
15842#if defined(__parallel)
15843 INTEGER :: ierr, msglen
15846 CALL mp_timeset(routinen, handle)
15848#if defined(__parallel)
15849#if !defined(__GNUC__) || __GNUC__ >= 9
15850 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
15853 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
15854 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_double_precision, mpi_sum, comm%handle, request%handle, ierr)
15855 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
15859 CALL add_perf(perf_id=23, count=1, msg_size=msglen*real_8_size)
15865 CALL mp_timestop(handle)
15866 END SUBROUTINE mp_isum_dv
15874 SUBROUTINE mp_sum_dm(msg, comm)
15875 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
15878 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm'
15881#if defined(__parallel)
15882 INTEGER,
PARAMETER :: max_msg = 2**25
15883 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
15884 REAL(kind=real_8),
ALLOCATABLE :: msgbuf(:)
15887 CALL mp_timeset(routinen, handle)
15889#if defined(__parallel)
15891 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
15893 DO m1 = lbound(msg, 2), ubound(msg, 2), step
15894 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
15895 msglensum = msglensum + msglen
15896 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
15897 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
15898 ALLOCATE (msgbuf(msglen))
15899 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15900 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15901 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
15902 DEALLOCATE (msgbuf)
15905 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_8_size)
15910 CALL mp_timestop(handle)
15911 END SUBROUTINE mp_sum_dm
15919 SUBROUTINE mp_sum_dm3(msg, comm)
15920 REAL(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
15923 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm3'
15926#if defined(__parallel)
15927 INTEGER :: ierr, msglen
15928 REAL(kind=real_8),
ALLOCATABLE :: msgbuf(:)
15931 CALL mp_timeset(routinen, handle)
15933#if defined(__parallel)
15935 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
15936 ALLOCATE (msgbuf(msglen))
15937 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15938 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15939 msg = reshape(msgbuf, shape(msg))
15941 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15946 CALL mp_timestop(handle)
15947 END SUBROUTINE mp_sum_dm3
15955 SUBROUTINE mp_sum_dm4(msg, comm)
15956 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
15959 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_dm4'
15962#if defined(__parallel)
15963 INTEGER :: ierr, msglen
15964 REAL(kind=real_8),
ALLOCATABLE :: msgbuf(:)
15967 CALL mp_timeset(routinen, handle)
15969#if defined(__parallel)
15971 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
15972 ALLOCATE (msgbuf(msglen))
15973 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
15974 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
15975 msg = reshape(msgbuf, shape(msg))
15977 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
15982 CALL mp_timestop(handle)
15983 END SUBROUTINE mp_sum_dm4
15995 SUBROUTINE mp_sum_root_dv(msg, root, comm)
15996 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
15997 INTEGER,
INTENT(IN) :: root
16000 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_dv'
16003#if defined(__parallel)
16004 INTEGER :: ierr, m1, msglen, taskid
16005 REAL(kind=real_8),
ALLOCATABLE :: res(:)
16008 CALL mp_timeset(routinen, handle)
16010#if defined(__parallel)
16012 CALL mpi_comm_rank(comm%handle, taskid, ierr)
16013 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
16014 IF (msglen > 0)
THEN
16017 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_sum, &
16018 root, comm%handle, ierr)
16019 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
16020 IF (taskid == root)
THEN
16025 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16031 CALL mp_timestop(handle)
16032 END SUBROUTINE mp_sum_root_dv
16043 SUBROUTINE mp_sum_root_dm(msg, root, comm)
16044 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
16045 INTEGER,
INTENT(IN) :: root
16048 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
16051#if defined(__parallel)
16052 INTEGER :: ierr, m1, m2, msglen, taskid
16053 REAL(kind=real_8),
ALLOCATABLE :: res(:, :)
16056 CALL mp_timeset(routinen, handle)
16058#if defined(__parallel)
16060 CALL mpi_comm_rank(comm%handle, taskid, ierr)
16061 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
16062 IF (msglen > 0)
THEN
16065 ALLOCATE (res(m1, m2))
16066 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_sum, root, comm%handle, ierr)
16067 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
16068 IF (taskid == root)
THEN
16073 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16079 CALL mp_timestop(handle)
16080 END SUBROUTINE mp_sum_root_dm
16088 SUBROUTINE mp_sum_partial_dm(msg, res, comm)
16089 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
16090 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
16093 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_dm'
16096#if defined(__parallel)
16097 INTEGER :: ierr, msglen, taskid
16100 CALL mp_timeset(routinen, handle)
16102#if defined(__parallel)
16104 CALL mpi_comm_rank(comm%handle, taskid, ierr)
16105 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
16106 IF (msglen > 0)
THEN
16107 CALL mpi_scan(msg, res, msglen, mpi_double_precision, mpi_sum, comm%handle, ierr)
16108 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
16110 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16116 CALL mp_timestop(handle)
16117 END SUBROUTINE mp_sum_partial_dm
16127 SUBROUTINE mp_max_d (msg, comm)
16128 REAL(kind=real_8),
INTENT(INOUT) :: msg
16131 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_d'
16134#if defined(__parallel)
16135 INTEGER :: ierr, msglen
16136 REAL(kind=real_8) :: res
16139 CALL mp_timeset(routinen, handle)
16141#if defined(__parallel)
16143 IF (comm%num_pe > 1)
THEN
16144 CALL mpi_allreduce(msg, res, msglen, mpi_double_precision, mpi_max, comm%handle, ierr)
16145 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16148 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16153 CALL mp_timestop(handle)
16154 END SUBROUTINE mp_max_d
16164 SUBROUTINE mp_max_root_d (msg, root, comm)
16165 REAL(kind=real_8),
INTENT(INOUT) :: msg
16166 INTEGER,
INTENT(IN) :: root
16169 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_d'
16172#if defined(__parallel)
16173 INTEGER :: ierr, msglen
16174 REAL(kind=real_8) :: res
16177 CALL mp_timeset(routinen, handle)
16179#if defined(__parallel)
16181 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_max, root, comm%handle, ierr)
16182 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
16183 IF (root == comm%mepos) msg = res
16184 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16190 CALL mp_timestop(handle)
16191 END SUBROUTINE mp_max_root_d
16201 SUBROUTINE mp_max_dv(msg, comm)
16202 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
16205 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_dv'
16208#if defined(__parallel)
16209 INTEGER :: ierr, msglen
16210 REAL(kind=real_8),
ALLOCATABLE :: msgbuf(:)
16213 CALL mp_timeset(routinen, handle)
16215#if defined(__parallel)
16217 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
16218 ALLOCATE (msgbuf(msglen))
16219 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_double_precision, mpi_max, comm%handle, ierr)
16220 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16223 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16228 CALL mp_timestop(handle)
16229 END SUBROUTINE mp_max_dv
16239 SUBROUTINE mp_max_dm(msg, comm)
16240 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
16243 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_dm'
16246#if defined(__parallel)
16247 INTEGER,
PARAMETER :: max_msg = 2**25
16248 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
16249 REAL(kind=real_8),
ALLOCATABLE :: msgbuf(:)
16252 CALL mp_timeset(routinen, handle)
16254#if defined(__parallel)
16256 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
16258 DO m1 = lbound(msg, 2), ubound(msg, 2), step
16259 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
16260 msglensum = msglensum + msglen
16261 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
16262 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
16263 ALLOCATE (msgbuf(msglen))
16264 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_double_precision, mpi_max, comm%handle, ierr)
16265 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16266 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
16267 DEALLOCATE (msgbuf)
16270 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_8_size)
16275 CALL mp_timestop(handle)
16276 END SUBROUTINE mp_max_dm
16286 SUBROUTINE mp_max_root_dm(msg, root, comm)
16287 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
16291 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_dm'
16294#if defined(__parallel)
16295 INTEGER :: ierr, msglen
16296 REAL(kind=real_8) :: res(
SIZE(msg, 1),
SIZE(msg, 2))
16299 CALL mp_timeset(routinen, handle)
16301#if defined(__parallel)
16303 CALL mpi_reduce(msg, res, msglen, mpi_double_precision, mpi_max, root, comm%handle, ierr)
16304 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16305 IF (root == comm%mepos) msg = res
16306 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16312 CALL mp_timestop(handle)
16313 END SUBROUTINE mp_max_root_dm
16323 SUBROUTINE mp_min_d (msg, comm)
16324 REAL(kind=real_8),
INTENT(INOUT) :: msg
16327 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_d'
16330#if defined(__parallel)
16331 INTEGER :: ierr, msglen
16332 REAL(kind=real_8) :: res
16335 CALL mp_timeset(routinen, handle)
16337#if defined(__parallel)
16339 IF (comm%num_pe > 1)
THEN
16340 CALL mpi_allreduce(msg, res, msglen, mpi_double_precision, mpi_min, comm%handle, ierr)
16341 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16344 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16349 CALL mp_timestop(handle)
16350 END SUBROUTINE mp_min_d
16362 SUBROUTINE mp_min_dv(msg, comm)
16363 REAL(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
16366 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_dv'
16369#if defined(__parallel)
16370 INTEGER :: ierr, msglen
16371 REAL(kind=real_8),
ALLOCATABLE :: msgbuf(:)
16374 CALL mp_timeset(routinen, handle)
16376#if defined(__parallel)
16378 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
16379 ALLOCATE (msgbuf(msglen))
16380 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_double_precision, mpi_min, comm%handle, ierr)
16381 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16384 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16389 CALL mp_timestop(handle)
16390 END SUBROUTINE mp_min_dv
16400 SUBROUTINE mp_min_dm(msg, comm)
16401 REAL(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
16404 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_dm'
16407#if defined(__parallel)
16408 INTEGER,
PARAMETER :: max_msg = 2**25
16409 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
16410 REAL(kind=real_8),
ALLOCATABLE :: msgbuf(:)
16413 CALL mp_timeset(routinen, handle)
16415#if defined(__parallel)
16417 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
16419 DO m1 = lbound(msg, 2), ubound(msg, 2), step
16420 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
16421 msglensum = msglensum + msglen
16422 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
16423 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
16424 ALLOCATE (msgbuf(msglen))
16425 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_double_precision, mpi_min, comm%handle, ierr)
16426 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16427 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
16428 DEALLOCATE (msgbuf)
16431 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_8_size)
16436 CALL mp_timestop(handle)
16437 END SUBROUTINE mp_min_dm
16447 SUBROUTINE mp_prod_d (msg, comm)
16448 REAL(kind=real_8),
INTENT(INOUT) :: msg
16451 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_d'
16454#if defined(__parallel)
16455 INTEGER :: ierr, msglen
16456 REAL(kind=real_8) :: res
16459 CALL mp_timeset(routinen, handle)
16461#if defined(__parallel)
16463 IF (comm%num_pe > 1)
THEN
16464 CALL mpi_allreduce(msg, res, msglen, mpi_double_precision, mpi_prod, comm%handle, ierr)
16465 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
16468 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_8_size)
16473 CALL mp_timestop(handle)
16474 END SUBROUTINE mp_prod_d
16485 SUBROUTINE mp_scatter_dv(msg_scatter, msg, root, comm)
16486 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
16487 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
16488 INTEGER,
INTENT(IN) :: root
16491 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_dv'
16494#if defined(__parallel)
16495 INTEGER :: ierr, msglen
16498 CALL mp_timeset(routinen, handle)
16500#if defined(__parallel)
16502 CALL mpi_scatter(msg_scatter, msglen, mpi_double_precision, msg, &
16503 msglen, mpi_double_precision, root, comm%handle, ierr)
16504 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
16505 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16511 CALL mp_timestop(handle)
16512 END SUBROUTINE mp_scatter_dv
16522 SUBROUTINE mp_iscatter_d (msg_scatter, msg, root, comm, request)
16523 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:)
16524 REAL(kind=real_8),
INTENT(INOUT) :: msg
16525 INTEGER,
INTENT(IN) :: root
16529 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_d'
16532#if defined(__parallel)
16533 INTEGER :: ierr, msglen
16536 CALL mp_timeset(routinen, handle)
16538#if defined(__parallel)
16539#if !defined(__GNUC__) || __GNUC__ >= 9
16540 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
16543 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_precision, msg, &
16544 msglen, mpi_double_precision, root, comm%handle, request%handle, ierr)
16545 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
16546 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16550 msg = msg_scatter(1)
16553 CALL mp_timestop(handle)
16554 END SUBROUTINE mp_iscatter_d
16564 SUBROUTINE mp_iscatter_dv2(msg_scatter, msg, root, comm, request)
16565 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:, :)
16566 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
16567 INTEGER,
INTENT(IN) :: root
16571 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_dv2'
16574#if defined(__parallel)
16575 INTEGER :: ierr, msglen
16578 CALL mp_timeset(routinen, handle)
16580#if defined(__parallel)
16581#if !defined(__GNUC__) || __GNUC__ >= 9
16582 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
16585 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_precision, msg, &
16586 msglen, mpi_double_precision, root, comm%handle, request%handle, ierr)
16587 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
16588 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16592 msg(:) = msg_scatter(:, 1)
16595 CALL mp_timestop(handle)
16596 END SUBROUTINE mp_iscatter_dv2
16606 SUBROUTINE mp_iscatterv_dv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
16607 REAL(kind=real_8),
INTENT(IN) :: msg_scatter(:)
16608 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
16609 REAL(kind=real_8),
INTENT(INOUT) :: msg(:)
16610 INTEGER,
INTENT(IN) :: recvcount, root
16614 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_dv'
16617#if defined(__parallel)
16621 CALL mp_timeset(routinen, handle)
16623#if defined(__parallel)
16624#if !defined(__GNUC__) || __GNUC__ >= 9
16625 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
16626 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
16627 cpassert(is_contiguous(sendcounts) .OR.
SIZE(sendcounts) == 0)
16628 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
16630 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_double_precision, msg, &
16631 recvcount, mpi_double_precision, root, comm%handle, request%handle, ierr)
16632 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
16633 CALL add_perf(perf_id=24, count=1, msg_size=1*real_8_size)
16635 mark_used(sendcounts)
16637 mark_used(recvcount)
16640 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
16643 CALL mp_timestop(handle)
16644 END SUBROUTINE mp_iscatterv_dv
16655 SUBROUTINE mp_gather_d (msg, msg_gather, root, comm)
16656 REAL(kind=real_8),
INTENT(IN) :: msg
16657 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16658 INTEGER,
INTENT(IN) :: root
16661 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_d'
16664#if defined(__parallel)
16665 INTEGER :: ierr, msglen
16668 CALL mp_timeset(routinen, handle)
16670#if defined(__parallel)
16672 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16673 msglen, mpi_double_precision, root, comm%handle, ierr)
16674 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16675 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16679 msg_gather(1) = msg
16681 CALL mp_timestop(handle)
16682 END SUBROUTINE mp_gather_d
16692 SUBROUTINE mp_gather_d_src(msg, msg_gather, comm)
16693 REAL(kind=real_8),
INTENT(IN) :: msg
16694 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16697 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_d_src'
16700#if defined(__parallel)
16701 INTEGER :: ierr, msglen
16704 CALL mp_timeset(routinen, handle)
16706#if defined(__parallel)
16708 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16709 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16710 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16711 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16714 msg_gather(1) = msg
16716 CALL mp_timestop(handle)
16717 END SUBROUTINE mp_gather_d_src
16731 SUBROUTINE mp_gather_dv(msg, msg_gather, root, comm)
16732 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
16733 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16734 INTEGER,
INTENT(IN) :: root
16737 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dv'
16740#if defined(__parallel)
16741 INTEGER :: ierr, msglen
16744 CALL mp_timeset(routinen, handle)
16746#if defined(__parallel)
16748 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16749 msglen, mpi_double_precision, root, comm%handle, ierr)
16750 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16751 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16757 CALL mp_timestop(handle)
16758 END SUBROUTINE mp_gather_dv
16771 SUBROUTINE mp_gather_dv_src(msg, msg_gather, comm)
16772 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
16773 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
16776 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dv_src'
16779#if defined(__parallel)
16780 INTEGER :: ierr, msglen
16783 CALL mp_timeset(routinen, handle)
16785#if defined(__parallel)
16787 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16788 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16789 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16790 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16795 CALL mp_timestop(handle)
16796 END SUBROUTINE mp_gather_dv_src
16810 SUBROUTINE mp_gather_dm(msg, msg_gather, root, comm)
16811 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
16812 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
16813 INTEGER,
INTENT(IN) :: root
16816 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dm'
16819#if defined(__parallel)
16820 INTEGER :: ierr, msglen
16823 CALL mp_timeset(routinen, handle)
16825#if defined(__parallel)
16827 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16828 msglen, mpi_double_precision, root, comm%handle, ierr)
16829 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16830 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16836 CALL mp_timestop(handle)
16837 END SUBROUTINE mp_gather_dm
16850 SUBROUTINE mp_gather_dm_src(msg, msg_gather, comm)
16851 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
16852 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
16855 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_dm_src'
16858#if defined(__parallel)
16859 INTEGER :: ierr, msglen
16862 CALL mp_timeset(routinen, handle)
16864#if defined(__parallel)
16866 CALL mpi_gather(msg, msglen, mpi_double_precision, msg_gather, &
16867 msglen, mpi_double_precision, comm%source, comm%handle, ierr)
16868 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
16869 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_8_size)
16874 CALL mp_timestop(handle)
16875 END SUBROUTINE mp_gather_dm_src
16892 SUBROUTINE mp_gatherv_dv(sendbuf, recvbuf, recvcounts, displs, root, comm)
16894 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16895 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16896 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16897 INTEGER,
INTENT(IN) :: root
16900 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dv'
16903#if defined(__parallel)
16904 INTEGER :: ierr, sendcount
16907 CALL mp_timeset(routinen, handle)
16909#if defined(__parallel)
16910 sendcount =
SIZE(sendbuf)
16911 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16912 recvbuf, recvcounts, displs, mpi_double_precision, &
16913 root, comm%handle, ierr)
16914 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16915 CALL add_perf(perf_id=4, &
16917 msg_size=sendcount*real_8_size)
16919 mark_used(recvcounts)
16922 recvbuf(1 + displs(1):) = sendbuf
16924 CALL mp_timestop(handle)
16925 END SUBROUTINE mp_gatherv_dv
16941 SUBROUTINE mp_gatherv_dv_src(sendbuf, recvbuf, recvcounts, displs, comm)
16943 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16944 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16945 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16948 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dv_src'
16951#if defined(__parallel)
16952 INTEGER :: ierr, sendcount
16955 CALL mp_timeset(routinen, handle)
16957#if defined(__parallel)
16958 sendcount =
SIZE(sendbuf)
16959 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
16960 recvbuf, recvcounts, displs, mpi_double_precision, &
16961 comm%source, comm%handle, ierr)
16962 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
16963 CALL add_perf(perf_id=4, &
16965 msg_size=sendcount*real_8_size)
16967 mark_used(recvcounts)
16969 recvbuf(1 + displs(1):) = sendbuf
16971 CALL mp_timestop(handle)
16972 END SUBROUTINE mp_gatherv_dv_src
16989 SUBROUTINE mp_gatherv_dm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
16991 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
16992 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
16993 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
16994 INTEGER,
INTENT(IN) :: root
16997 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dm2'
17000#if defined(__parallel)
17001 INTEGER :: ierr, sendcount
17004 CALL mp_timeset(routinen, handle)
17006#if defined(__parallel)
17007 sendcount =
SIZE(sendbuf)
17008 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
17009 recvbuf, recvcounts, displs, mpi_double_precision, &
17010 root, comm%handle, ierr)
17011 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
17012 CALL add_perf(perf_id=4, &
17014 msg_size=sendcount*real_8_size)
17016 mark_used(recvcounts)
17019 recvbuf(:, 1 + displs(1):) = sendbuf
17021 CALL mp_timestop(handle)
17022 END SUBROUTINE mp_gatherv_dm2
17038 SUBROUTINE mp_gatherv_dm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
17040 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
17041 REAL(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
17042 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
17045 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_dm2_src'
17048#if defined(__parallel)
17049 INTEGER :: ierr, sendcount
17052 CALL mp_timeset(routinen, handle)
17054#if defined(__parallel)
17055 sendcount =
SIZE(sendbuf)
17056 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_precision, &
17057 recvbuf, recvcounts, displs, mpi_double_precision, &
17058 comm%source, comm%handle, ierr)
17059 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
17060 CALL add_perf(perf_id=4, &
17062 msg_size=sendcount*real_8_size)
17064 mark_used(recvcounts)
17066 recvbuf(:, 1 + displs(1):) = sendbuf
17068 CALL mp_timestop(handle)
17069 END SUBROUTINE mp_gatherv_dm2_src
17086 SUBROUTINE mp_igatherv_dv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
17087 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
17088 REAL(kind=real_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
17089 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
17090 INTEGER,
INTENT(IN) :: sendcount, root
17094 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_dv'
17097#if defined(__parallel)
17101 CALL mp_timeset(routinen, handle)
17103#if defined(__parallel)
17104#if !defined(__GNUC__) || __GNUC__ >= 9
17105 cpassert(is_contiguous(sendbuf) .OR.
SIZE(sendbuf) == 0)
17106 cpassert(is_contiguous(recvbuf) .OR.
SIZE(recvbuf) == 0)
17107 cpassert(is_contiguous(recvcounts) .OR.
SIZE(recvcounts) == 0)
17108 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
17110 CALL mpi_igatherv(sendbuf, sendcount, mpi_double_precision, &
17111 recvbuf, recvcounts, displs, mpi_double_precision, &
17112 root, comm%handle, request%handle, ierr)
17113 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
17114 CALL add_perf(perf_id=24, &
17116 msg_size=sendcount*real_8_size)
17118 mark_used(sendcount)
17119 mark_used(recvcounts)
17122 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
17125 CALL mp_timestop(handle)
17126 END SUBROUTINE mp_igatherv_dv
17139 SUBROUTINE mp_allgather_d (msgout, msgin, comm)
17140 REAL(kind=real_8),
INTENT(IN) :: msgout
17141 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
17144 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d'
17147#if defined(__parallel)
17148 INTEGER :: ierr, rcount, scount
17151 CALL mp_timeset(routinen, handle)
17153#if defined(__parallel)
17156 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17157 msgin, rcount, mpi_double_precision, &
17159 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17164 CALL mp_timestop(handle)
17165 END SUBROUTINE mp_allgather_d
17178 SUBROUTINE mp_allgather_d2(msgout, msgin, comm)
17179 REAL(kind=real_8),
INTENT(IN) :: msgout
17180 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
17183 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d2'
17186#if defined(__parallel)
17187 INTEGER :: ierr, rcount, scount
17190 CALL mp_timeset(routinen, handle)
17192#if defined(__parallel)
17195 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17196 msgin, rcount, mpi_double_precision, &
17198 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17203 CALL mp_timestop(handle)
17204 END SUBROUTINE mp_allgather_d2
17217 SUBROUTINE mp_iallgather_d (msgout, msgin, comm, request)
17218 REAL(kind=real_8),
INTENT(IN) :: msgout
17219 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17223 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d'
17226#if defined(__parallel)
17227 INTEGER :: ierr, rcount, scount
17230 CALL mp_timeset(routinen, handle)
17232#if defined(__parallel)
17233#if !defined(__GNUC__) || __GNUC__ >= 9
17234 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
17238 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17239 msgin, rcount, mpi_double_precision, &
17240 comm%handle, request%handle, ierr)
17241 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17247 CALL mp_timestop(handle)
17248 END SUBROUTINE mp_iallgather_d
17263 SUBROUTINE mp_allgather_d12(msgout, msgin, comm)
17264 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
17265 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
17268 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d12'
17271#if defined(__parallel)
17272 INTEGER :: ierr, rcount, scount
17275 CALL mp_timeset(routinen, handle)
17277#if defined(__parallel)
17278 scount =
SIZE(msgout(:))
17280 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17281 msgin, rcount, mpi_double_precision, &
17283 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17286 msgin(:, 1) = msgout(:)
17288 CALL mp_timestop(handle)
17289 END SUBROUTINE mp_allgather_d12
17299 SUBROUTINE mp_allgather_d23(msgout, msgin, comm)
17300 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
17301 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
17304 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d23'
17307#if defined(__parallel)
17308 INTEGER :: ierr, rcount, scount
17311 CALL mp_timeset(routinen, handle)
17313#if defined(__parallel)
17314 scount =
SIZE(msgout(:, :))
17316 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17317 msgin, rcount, mpi_double_precision, &
17319 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17322 msgin(:, :, 1) = msgout(:, :)
17324 CALL mp_timestop(handle)
17325 END SUBROUTINE mp_allgather_d23
17335 SUBROUTINE mp_allgather_d34(msgout, msgin, comm)
17336 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
17337 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
17340 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d34'
17343#if defined(__parallel)
17344 INTEGER :: ierr, rcount, scount
17347 CALL mp_timeset(routinen, handle)
17349#if defined(__parallel)
17350 scount =
SIZE(msgout(:, :, :))
17352 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17353 msgin, rcount, mpi_double_precision, &
17355 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17358 msgin(:, :, :, 1) = msgout(:, :, :)
17360 CALL mp_timestop(handle)
17361 END SUBROUTINE mp_allgather_d34
17371 SUBROUTINE mp_allgather_d22(msgout, msgin, comm)
17372 REAL(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
17373 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
17376 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_d22'
17379#if defined(__parallel)
17380 INTEGER :: ierr, rcount, scount
17383 CALL mp_timeset(routinen, handle)
17385#if defined(__parallel)
17386 scount =
SIZE(msgout(:, :))
17388 CALL mpi_allgather(msgout, scount, mpi_double_precision, &
17389 msgin, rcount, mpi_double_precision, &
17391 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
17394 msgin(:, :) = msgout(:, :)
17396 CALL mp_timestop(handle)
17397 END SUBROUTINE mp_allgather_d22
17408 SUBROUTINE mp_iallgather_d11(msgout, msgin, comm, request)
17409 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17410 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17414 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d11'
17417#if defined(__parallel)
17418 INTEGER :: ierr, rcount, scount
17421 CALL mp_timeset(routinen, handle)
17423#if defined(__parallel)
17424#if !defined(__GNUC__) || __GNUC__ >= 9
17425 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
17426 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
17428 scount =
SIZE(msgout(:))
17430 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17431 msgin, rcount, mpi_double_precision, &
17432 comm%handle, request%handle, ierr)
17433 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17439 CALL mp_timestop(handle)
17440 END SUBROUTINE mp_iallgather_d11
17451 SUBROUTINE mp_iallgather_d13(msgout, msgin, comm, request)
17452 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17453 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
17457 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d13'
17460#if defined(__parallel)
17461 INTEGER :: ierr, rcount, scount
17464 CALL mp_timeset(routinen, handle)
17466#if defined(__parallel)
17467#if !defined(__GNUC__) || __GNUC__ >= 9
17468 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
17469 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
17472 scount =
SIZE(msgout(:))
17474 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17475 msgin, rcount, mpi_double_precision, &
17476 comm%handle, request%handle, ierr)
17477 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17480 msgin(:, 1, 1) = msgout(:)
17483 CALL mp_timestop(handle)
17484 END SUBROUTINE mp_iallgather_d13
17495 SUBROUTINE mp_iallgather_d22(msgout, msgin, comm, request)
17496 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :)
17497 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :)
17501 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d22'
17504#if defined(__parallel)
17505 INTEGER :: ierr, rcount, scount
17508 CALL mp_timeset(routinen, handle)
17510#if defined(__parallel)
17511#if !defined(__GNUC__) || __GNUC__ >= 9
17512 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
17513 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
17516 scount =
SIZE(msgout(:, :))
17518 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17519 msgin, rcount, mpi_double_precision, &
17520 comm%handle, request%handle, ierr)
17521 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17524 msgin(:, :) = msgout(:, :)
17527 CALL mp_timestop(handle)
17528 END SUBROUTINE mp_iallgather_d22
17539 SUBROUTINE mp_iallgather_d24(msgout, msgin, comm, request)
17540 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :)
17541 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :, :)
17545 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d24'
17548#if defined(__parallel)
17549 INTEGER :: ierr, rcount, scount
17552 CALL mp_timeset(routinen, handle)
17554#if defined(__parallel)
17555#if !defined(__GNUC__) || __GNUC__ >= 9
17556 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
17557 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
17560 scount =
SIZE(msgout(:, :))
17562 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17563 msgin, rcount, mpi_double_precision, &
17564 comm%handle, request%handle, ierr)
17565 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17568 msgin(:, :, 1, 1) = msgout(:, :)
17571 CALL mp_timestop(handle)
17572 END SUBROUTINE mp_iallgather_d24
17583 SUBROUTINE mp_iallgather_d33(msgout, msgin, comm, request)
17584 REAL(kind=real_8),
INTENT(IN) :: msgout(:, :, :)
17585 REAL(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
17589 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_d33'
17592#if defined(__parallel)
17593 INTEGER :: ierr, rcount, scount
17596 CALL mp_timeset(routinen, handle)
17598#if defined(__parallel)
17599#if !defined(__GNUC__) || __GNUC__ >= 9
17600 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
17601 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
17604 scount =
SIZE(msgout(:, :, :))
17606 CALL mpi_iallgather(msgout, scount, mpi_double_precision, &
17607 msgin, rcount, mpi_double_precision, &
17608 comm%handle, request%handle, ierr)
17609 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
17612 msgin(:, :, :) = msgout(:, :, :)
17615 CALL mp_timestop(handle)
17616 END SUBROUTINE mp_iallgather_d33
17635 SUBROUTINE mp_allgatherv_dv(msgout, msgin, rcount, rdispl, comm)
17636 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
17637 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17638 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17641 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_dv'
17644#if defined(__parallel)
17645 INTEGER :: ierr, scount
17648 CALL mp_timeset(routinen, handle)
17650#if defined(__parallel)
17651 scount =
SIZE(msgout)
17652 CALL mpi_allgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17653 rdispl, mpi_double_precision, comm%handle, ierr)
17654 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
17661 CALL mp_timestop(handle)
17662 END SUBROUTINE mp_allgatherv_dv
17681 SUBROUTINE mp_allgatherv_dm2(msgout, msgin, rcount, rdispl, comm)
17682 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
17683 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
17684 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17687 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_dv'
17690#if defined(__parallel)
17691 INTEGER :: ierr, scount
17694 CALL mp_timeset(routinen, handle)
17696#if defined(__parallel)
17697 scount =
SIZE(msgout)
17698 CALL mpi_allgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17699 rdispl, mpi_double_precision, comm%handle, ierr)
17700 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
17707 CALL mp_timestop(handle)
17708 END SUBROUTINE mp_allgatherv_dm2
17727 SUBROUTINE mp_iallgatherv_dv(msgout, msgin, rcount, rdispl, comm, request)
17728 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17729 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17730 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
17734 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_dv'
17737#if defined(__parallel)
17738 INTEGER :: ierr, scount, rsize
17741 CALL mp_timeset(routinen, handle)
17743#if defined(__parallel)
17744#if !defined(__GNUC__) || __GNUC__ >= 9
17745 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
17746 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
17747 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
17748 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
17751 scount =
SIZE(msgout)
17752 rsize =
SIZE(rcount)
17753 CALL mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, &
17754 rdispl, comm, request, ierr)
17755 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
17763 CALL mp_timestop(handle)
17764 END SUBROUTINE mp_iallgatherv_dv
17783 SUBROUTINE mp_iallgatherv_dv2(msgout, msgin, rcount, rdispl, comm, request)
17784 REAL(kind=real_8),
INTENT(IN) :: msgout(:)
17785 REAL(kind=real_8),
INTENT(OUT) :: msgin(:)
17786 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
17790 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_dv2'
17793#if defined(__parallel)
17794 INTEGER :: ierr, scount, rsize
17797 CALL mp_timeset(routinen, handle)
17799#if defined(__parallel)
17800#if !defined(__GNUC__) || __GNUC__ >= 9
17801 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
17802 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
17803 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
17804 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
17807 scount =
SIZE(msgout)
17808 rsize =
SIZE(rcount)
17809 CALL mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, &
17810 rdispl, comm, request, ierr)
17811 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
17819 CALL mp_timestop(handle)
17820 END SUBROUTINE mp_iallgatherv_dv2
17831#if defined(__parallel)
17832 SUBROUTINE mp_iallgatherv_dv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
17833 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
17834 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17835 INTEGER,
INTENT(IN) :: rsize
17836 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
17839 INTEGER,
INTENT(INOUT) :: ierr
17841 CALL mpi_iallgatherv(msgout, scount, mpi_double_precision, msgin, rcount, &
17842 rdispl, mpi_double_precision, comm%handle, request%handle, ierr)
17844 END SUBROUTINE mp_iallgatherv_dv_internal
17855 SUBROUTINE mp_sum_scatter_dv(msgout, msgin, rcount, comm)
17856 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
17857 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
17858 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
17861 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_dv'
17864#if defined(__parallel)
17868 CALL mp_timeset(routinen, handle)
17870#if defined(__parallel)
17871 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_double_precision, mpi_sum, &
17873 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
17875 CALL add_perf(perf_id=3, count=1, &
17876 msg_size=rcount(1)*2*real_8_size)
17880 msgin = msgout(:, 1)
17882 CALL mp_timestop(handle)
17883 END SUBROUTINE mp_sum_scatter_dv
17894 SUBROUTINE mp_sendrecv_d (msgin, dest, msgout, source, comm, tag)
17895 REAL(kind=real_8),
INTENT(IN) :: msgin
17896 INTEGER,
INTENT(IN) :: dest
17897 REAL(kind=real_8),
INTENT(OUT) :: msgout
17898 INTEGER,
INTENT(IN) :: source
17900 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17902 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_d'
17905#if defined(__parallel)
17906 INTEGER :: ierr, msglen_in, msglen_out, &
17910 CALL mp_timeset(routinen, handle)
17912#if defined(__parallel)
17917 IF (
PRESENT(tag))
THEN
17921 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17922 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17923 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17924 CALL add_perf(perf_id=7, count=1, &
17925 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17933 CALL mp_timestop(handle)
17934 END SUBROUTINE mp_sendrecv_d
17945 SUBROUTINE mp_sendrecv_dv(msgin, dest, msgout, source, comm, tag)
17946 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
17947 INTEGER,
INTENT(IN) :: dest
17948 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
17949 INTEGER,
INTENT(IN) :: source
17951 INTEGER,
INTENT(IN),
OPTIONAL :: tag
17953 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dv'
17956#if defined(__parallel)
17957 INTEGER :: ierr, msglen_in, msglen_out, &
17961 CALL mp_timeset(routinen, handle)
17963#if defined(__parallel)
17964 msglen_in =
SIZE(msgin)
17965 msglen_out =
SIZE(msgout)
17968 IF (
PRESENT(tag))
THEN
17972 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
17973 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
17974 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
17975 CALL add_perf(perf_id=7, count=1, &
17976 msg_size=(msglen_in + msglen_out)*real_8_size/2)
17984 CALL mp_timestop(handle)
17985 END SUBROUTINE mp_sendrecv_dv
17997 SUBROUTINE mp_sendrecv_dm2(msgin, dest, msgout, source, comm, tag)
17998 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
17999 INTEGER,
INTENT(IN) :: dest
18000 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
18001 INTEGER,
INTENT(IN) :: source
18003 INTEGER,
INTENT(IN),
OPTIONAL :: tag
18005 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm2'
18008#if defined(__parallel)
18009 INTEGER :: ierr, msglen_in, msglen_out, &
18013 CALL mp_timeset(routinen, handle)
18015#if defined(__parallel)
18016 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
18017 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
18020 IF (
PRESENT(tag))
THEN
18024 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
18025 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
18026 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
18027 CALL add_perf(perf_id=7, count=1, &
18028 msg_size=(msglen_in + msglen_out)*real_8_size/2)
18036 CALL mp_timestop(handle)
18037 END SUBROUTINE mp_sendrecv_dm2
18048 SUBROUTINE mp_sendrecv_dm3(msgin, dest, msgout, source, comm, tag)
18049 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
18050 INTEGER,
INTENT(IN) :: dest
18051 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
18052 INTEGER,
INTENT(IN) :: source
18054 INTEGER,
INTENT(IN),
OPTIONAL :: tag
18056 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm3'
18059#if defined(__parallel)
18060 INTEGER :: ierr, msglen_in, msglen_out, &
18064 CALL mp_timeset(routinen, handle)
18066#if defined(__parallel)
18067 msglen_in =
SIZE(msgin)
18068 msglen_out =
SIZE(msgout)
18071 IF (
PRESENT(tag))
THEN
18075 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
18076 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
18077 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
18078 CALL add_perf(perf_id=7, count=1, &
18079 msg_size=(msglen_in + msglen_out)*real_8_size/2)
18087 CALL mp_timestop(handle)
18088 END SUBROUTINE mp_sendrecv_dm3
18099 SUBROUTINE mp_sendrecv_dm4(msgin, dest, msgout, source, comm, tag)
18100 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
18101 INTEGER,
INTENT(IN) :: dest
18102 REAL(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
18103 INTEGER,
INTENT(IN) :: source
18105 INTEGER,
INTENT(IN),
OPTIONAL :: tag
18107 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_dm4'
18110#if defined(__parallel)
18111 INTEGER :: ierr, msglen_in, msglen_out, &
18115 CALL mp_timeset(routinen, handle)
18117#if defined(__parallel)
18118 msglen_in =
SIZE(msgin)
18119 msglen_out =
SIZE(msgout)
18122 IF (
PRESENT(tag))
THEN
18126 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_precision, dest, send_tag, msgout, &
18127 msglen_out, mpi_double_precision, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
18128 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
18129 CALL add_perf(perf_id=7, count=1, &
18130 msg_size=(msglen_in + msglen_out)*real_8_size/2)
18138 CALL mp_timestop(handle)
18139 END SUBROUTINE mp_sendrecv_dm4
18156 SUBROUTINE mp_isendrecv_d (msgin, dest, msgout, source, comm, send_request, &
18158 REAL(kind=real_8),
INTENT(IN) :: msgin
18159 INTEGER,
INTENT(IN) :: dest
18160 REAL(kind=real_8),
INTENT(INOUT) :: msgout
18161 INTEGER,
INTENT(IN) :: source
18164 INTEGER,
INTENT(in),
OPTIONAL :: tag
18166 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_d'
18169#if defined(__parallel)
18170 INTEGER :: ierr, my_tag
18173 CALL mp_timeset(routinen, handle)
18175#if defined(__parallel)
18177 IF (
PRESENT(tag)) my_tag = tag
18179 CALL mpi_irecv(msgout, 1, mpi_double_precision, source, my_tag, &
18180 comm%handle, recv_request%handle, ierr)
18181 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18183 CALL mpi_isend(msgin, 1, mpi_double_precision, dest, my_tag, &
18184 comm%handle, send_request%handle, ierr)
18185 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18187 CALL add_perf(perf_id=8, count=1, msg_size=2*real_8_size)
18197 CALL mp_timestop(handle)
18198 END SUBROUTINE mp_isendrecv_d
18217 SUBROUTINE mp_isendrecv_dv(msgin, dest, msgout, source, comm, send_request, &
18219 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
18220 INTEGER,
INTENT(IN) :: dest
18221 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
18222 INTEGER,
INTENT(IN) :: source
18225 INTEGER,
INTENT(in),
OPTIONAL :: tag
18227 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_dv'
18230#if defined(__parallel)
18231 INTEGER :: ierr, msglen, my_tag
18232 REAL(kind=real_8) :: foo
18235 CALL mp_timeset(routinen, handle)
18237#if defined(__parallel)
18238#if !defined(__GNUC__) || __GNUC__ >= 9
18239 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
18240 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
18244 IF (
PRESENT(tag)) my_tag = tag
18246 msglen =
SIZE(msgout, 1)
18247 IF (msglen > 0)
THEN
18248 CALL mpi_irecv(msgout(1), msglen, mpi_double_precision, source, my_tag, &
18249 comm%handle, recv_request%handle, ierr)
18251 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18252 comm%handle, recv_request%handle, ierr)
18254 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18256 msglen =
SIZE(msgin, 1)
18257 IF (msglen > 0)
THEN
18258 CALL mpi_isend(msgin(1), msglen, mpi_double_precision, dest, my_tag, &
18259 comm%handle, send_request%handle, ierr)
18261 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18262 comm%handle, send_request%handle, ierr)
18264 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18266 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
18267 CALL add_perf(perf_id=8, count=1, msg_size=msglen*real_8_size)
18277 CALL mp_timestop(handle)
18278 END SUBROUTINE mp_isendrecv_dv
18293 SUBROUTINE mp_isend_dv(msgin, dest, comm, request, tag)
18294 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
18295 INTEGER,
INTENT(IN) :: dest
18298 INTEGER,
INTENT(in),
OPTIONAL :: tag
18300 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dv'
18302 INTEGER :: handle, ierr
18303#if defined(__parallel)
18304 INTEGER :: msglen, my_tag
18305 REAL(kind=real_8) :: foo(1)
18308 CALL mp_timeset(routinen, handle)
18310#if defined(__parallel)
18311#if !defined(__GNUC__) || __GNUC__ >= 9
18312 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
18315 IF (
PRESENT(tag)) my_tag = tag
18317 msglen =
SIZE(msgin)
18318 IF (msglen > 0)
THEN
18319 CALL mpi_isend(msgin(1), msglen, mpi_double_precision, dest, my_tag, &
18320 comm%handle, request%handle, ierr)
18322 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18323 comm%handle, request%handle, ierr)
18325 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18327 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18336 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18338 CALL mp_timestop(handle)
18339 END SUBROUTINE mp_isend_dv
18356 SUBROUTINE mp_isend_dm2(msgin, dest, comm, request, tag)
18357 REAL(kind=real_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
18358 INTEGER,
INTENT(IN) :: dest
18361 INTEGER,
INTENT(in),
OPTIONAL :: tag
18363 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm2'
18365 INTEGER :: handle, ierr
18366#if defined(__parallel)
18367 INTEGER :: msglen, my_tag
18368 REAL(kind=real_8) :: foo(1)
18371 CALL mp_timeset(routinen, handle)
18373#if defined(__parallel)
18374#if !defined(__GNUC__) || __GNUC__ >= 9
18375 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
18379 IF (
PRESENT(tag)) my_tag = tag
18381 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
18382 IF (msglen > 0)
THEN
18383 CALL mpi_isend(msgin(1, 1), msglen, mpi_double_precision, dest, my_tag, &
18384 comm%handle, request%handle, ierr)
18386 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18387 comm%handle, request%handle, ierr)
18389 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18391 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18400 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18402 CALL mp_timestop(handle)
18403 END SUBROUTINE mp_isend_dm2
18422 SUBROUTINE mp_isend_dm3(msgin, dest, comm, request, tag)
18423 REAL(kind=real_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
18424 INTEGER,
INTENT(IN) :: dest
18427 INTEGER,
INTENT(in),
OPTIONAL :: tag
18429 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm3'
18431 INTEGER :: handle, ierr
18432#if defined(__parallel)
18433 INTEGER :: msglen, my_tag
18434 REAL(kind=real_8) :: foo(1)
18437 CALL mp_timeset(routinen, handle)
18439#if defined(__parallel)
18440#if !defined(__GNUC__) || __GNUC__ >= 9
18441 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
18445 IF (
PRESENT(tag)) my_tag = tag
18447 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
18448 IF (msglen > 0)
THEN
18449 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_double_precision, dest, my_tag, &
18450 comm%handle, request%handle, ierr)
18452 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18453 comm%handle, request%handle, ierr)
18455 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18457 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18466 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18468 CALL mp_timestop(handle)
18469 END SUBROUTINE mp_isend_dm3
18485 SUBROUTINE mp_isend_dm4(msgin, dest, comm, request, tag)
18486 REAL(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
18487 INTEGER,
INTENT(IN) :: dest
18490 INTEGER,
INTENT(in),
OPTIONAL :: tag
18492 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_dm4'
18494 INTEGER :: handle, ierr
18495#if defined(__parallel)
18496 INTEGER :: msglen, my_tag
18497 REAL(kind=real_8) :: foo(1)
18500 CALL mp_timeset(routinen, handle)
18502#if defined(__parallel)
18503#if !defined(__GNUC__) || __GNUC__ >= 9
18504 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
18508 IF (
PRESENT(tag)) my_tag = tag
18510 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
18511 IF (msglen > 0)
THEN
18512 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_double_precision, dest, my_tag, &
18513 comm%handle, request%handle, ierr)
18515 CALL mpi_isend(foo, msglen, mpi_double_precision, dest, my_tag, &
18516 comm%handle, request%handle, ierr)
18518 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
18520 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_8_size)
18529 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
18531 CALL mp_timestop(handle)
18532 END SUBROUTINE mp_isend_dm4
18548 SUBROUTINE mp_irecv_dv(msgout, source, comm, request, tag)
18549 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
18550 INTEGER,
INTENT(IN) :: source
18553 INTEGER,
INTENT(in),
OPTIONAL :: tag
18555 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dv'
18558#if defined(__parallel)
18559 INTEGER :: ierr, msglen, my_tag
18560 REAL(kind=real_8) :: foo(1)
18563 CALL mp_timeset(routinen, handle)
18565#if defined(__parallel)
18566#if !defined(__GNUC__) || __GNUC__ >= 9
18567 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
18571 IF (
PRESENT(tag)) my_tag = tag
18573 msglen =
SIZE(msgout)
18574 IF (msglen > 0)
THEN
18575 CALL mpi_irecv(msgout(1), msglen, mpi_double_precision, source, my_tag, &
18576 comm%handle, request%handle, ierr)
18578 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18579 comm%handle, request%handle, ierr)
18581 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18583 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18585 cpabort(
"mp_irecv called in non parallel case")
18592 CALL mp_timestop(handle)
18593 END SUBROUTINE mp_irecv_dv
18610 SUBROUTINE mp_irecv_dm2(msgout, source, comm, request, tag)
18611 REAL(kind=real_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
18612 INTEGER,
INTENT(IN) :: source
18615 INTEGER,
INTENT(in),
OPTIONAL :: tag
18617 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm2'
18620#if defined(__parallel)
18621 INTEGER :: ierr, msglen, my_tag
18622 REAL(kind=real_8) :: foo(1)
18625 CALL mp_timeset(routinen, handle)
18627#if defined(__parallel)
18628#if !defined(__GNUC__) || __GNUC__ >= 9
18629 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
18633 IF (
PRESENT(tag)) my_tag = tag
18635 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
18636 IF (msglen > 0)
THEN
18637 CALL mpi_irecv(msgout(1, 1), msglen, mpi_double_precision, source, my_tag, &
18638 comm%handle, request%handle, ierr)
18640 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18641 comm%handle, request%handle, ierr)
18643 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
18645 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18652 cpabort(
"mp_irecv called in non parallel case")
18654 CALL mp_timestop(handle)
18655 END SUBROUTINE mp_irecv_dm2
18673 SUBROUTINE mp_irecv_dm3(msgout, source, comm, request, tag)
18674 REAL(kind=real_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
18675 INTEGER,
INTENT(IN) :: source
18678 INTEGER,
INTENT(in),
OPTIONAL :: tag
18680 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm3'
18683#if defined(__parallel)
18684 INTEGER :: ierr, msglen, my_tag
18685 REAL(kind=real_8) :: foo(1)
18688 CALL mp_timeset(routinen, handle)
18690#if defined(__parallel)
18691#if !defined(__GNUC__) || __GNUC__ >= 9
18692 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
18696 IF (
PRESENT(tag)) my_tag = tag
18698 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
18699 IF (msglen > 0)
THEN
18700 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_double_precision, source, my_tag, &
18701 comm%handle, request%handle, ierr)
18703 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18704 comm%handle, request%handle, ierr)
18706 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
18708 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18715 cpabort(
"mp_irecv called in non parallel case")
18717 CALL mp_timestop(handle)
18718 END SUBROUTINE mp_irecv_dm3
18734 SUBROUTINE mp_irecv_dm4(msgout, source, comm, request, tag)
18735 REAL(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
18736 INTEGER,
INTENT(IN) :: source
18739 INTEGER,
INTENT(in),
OPTIONAL :: tag
18741 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_dm4'
18744#if defined(__parallel)
18745 INTEGER :: ierr, msglen, my_tag
18746 REAL(kind=real_8) :: foo(1)
18749 CALL mp_timeset(routinen, handle)
18751#if defined(__parallel)
18752#if !defined(__GNUC__) || __GNUC__ >= 9
18753 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
18757 IF (
PRESENT(tag)) my_tag = tag
18759 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
18760 IF (msglen > 0)
THEN
18761 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_double_precision, source, my_tag, &
18762 comm%handle, request%handle, ierr)
18764 CALL mpi_irecv(foo, msglen, mpi_double_precision, source, my_tag, &
18765 comm%handle, request%handle, ierr)
18767 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
18769 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_8_size)
18776 cpabort(
"mp_irecv called in non parallel case")
18778 CALL mp_timestop(handle)
18779 END SUBROUTINE mp_irecv_dm4
18791 SUBROUTINE mp_win_create_dv(base, comm, win)
18792 REAL(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
18796 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_dv'
18799#if defined(__parallel)
18801 INTEGER(kind=mpi_address_kind) :: len
18802 REAL(kind=real_8) :: foo(1)
18805 CALL mp_timeset(routinen, handle)
18807#if defined(__parallel)
18809 len =
SIZE(base)*real_8_size
18811 CALL mpi_win_create(base(1), len, real_8_size, mpi_info_null, comm%handle, win%handle, ierr)
18813 CALL mpi_win_create(foo, len, real_8_size, mpi_info_null, comm%handle, win%handle, ierr)
18815 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
18817 CALL add_perf(perf_id=20, count=1)
18821 win%handle = mp_win_null_handle
18823 CALL mp_timestop(handle)
18824 END SUBROUTINE mp_win_create_dv
18836 SUBROUTINE mp_rget_dv(base, source, win, win_data, myproc, disp, request, &
18837 origin_datatype, target_datatype)
18838 REAL(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
18839 INTEGER,
INTENT(IN) :: source
18841 REAL(kind=real_8),
DIMENSION(:),
INTENT(IN) :: win_data
18842 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
18846 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_dv'
18849#if defined(__parallel)
18850 INTEGER :: ierr, len, &
18851 origin_len, target_len
18852 LOGICAL :: do_local_copy
18853 INTEGER(kind=mpi_address_kind) :: disp_aint
18854 mpi_data_type :: handle_origin_datatype, handle_target_datatype
18857 CALL mp_timeset(routinen, handle)
18859#if defined(__parallel)
18862 IF (
PRESENT(disp))
THEN
18863 disp_aint = int(disp, kind=mpi_address_kind)
18865 handle_origin_datatype = mpi_double_precision
18867 IF (
PRESENT(origin_datatype))
THEN
18868 handle_origin_datatype = origin_datatype%type_handle
18871 handle_target_datatype = mpi_double_precision
18873 IF (
PRESENT(target_datatype))
THEN
18874 handle_target_datatype = target_datatype%type_handle
18878 do_local_copy = .false.
18879 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
18880 IF (myproc .EQ. source) do_local_copy = .true.
18882 IF (do_local_copy)
THEN
18884 base(:) = win_data(disp_aint + 1:disp_aint + len)
18889 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
18890 target_len, handle_target_datatype, win%handle, request%handle, ierr)
18896 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
18898 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*real_8_size)
18903 mark_used(origin_datatype)
18904 mark_used(target_datatype)
18908 IF (
PRESENT(disp))
THEN
18909 base(:) = win_data(disp + 1:disp +
SIZE(base))
18911 base(:) = win_data(:
SIZE(base))
18915 CALL mp_timestop(handle)
18916 END SUBROUTINE mp_rget_dv
18926 result(type_descriptor)
18927 INTEGER,
INTENT(IN) :: count
18928 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
18931 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_d'
18934#if defined(__parallel)
18938 CALL mp_timeset(routinen, handle)
18940#if defined(__parallel)
18941 CALL mpi_type_indexed(count, lengths, displs, mpi_double_precision, &
18942 type_descriptor%type_handle, ierr)
18944 cpabort(
"MPI_Type_Indexed @ "//routinen)
18945 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
18947 cpabort(
"MPI_Type_commit @ "//routinen)
18949 type_descriptor%type_handle = 3
18951 type_descriptor%length = count
18952 NULLIFY (type_descriptor%subtype)
18953 type_descriptor%vector_descriptor(1:2) = 1
18954 type_descriptor%has_indexing = .true.
18955 type_descriptor%index_descriptor%index => lengths
18956 type_descriptor%index_descriptor%chunks => displs
18958 CALL mp_timestop(handle)
18969 SUBROUTINE mp_allocate_d (DATA, len, stat)
18970 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
18971 INTEGER,
INTENT(IN) :: len
18972 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
18974 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_d'
18976 INTEGER :: handle, ierr
18978 CALL mp_timeset(routinen, handle)
18980#if defined(__parallel)
18982 CALL mp_alloc_mem(
DATA, len, stat=ierr)
18983 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
18984 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
18985 CALL add_perf(perf_id=15, count=1)
18987 ALLOCATE (
DATA(len), stat=ierr)
18988 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
18989 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
18991 IF (
PRESENT(stat)) stat = ierr
18992 CALL mp_timestop(handle)
18993 END SUBROUTINE mp_allocate_d
19001 SUBROUTINE mp_deallocate_d (DATA, stat)
19002 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
19003 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
19005 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_d'
19008#if defined(__parallel)
19012 CALL mp_timeset(routinen, handle)
19014#if defined(__parallel)
19015 CALL mp_free_mem(
DATA, ierr)
19016 IF (
PRESENT(stat))
THEN
19019 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
19022 CALL add_perf(perf_id=15, count=1)
19025 IF (
PRESENT(stat)) stat = 0
19027 CALL mp_timestop(handle)
19028 END SUBROUTINE mp_deallocate_d
19041 SUBROUTINE mp_file_write_at_dv(fh, offset, msg, msglen)
19042 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
19044 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
19045 INTEGER(kind=file_offset),
INTENT(IN) :: offset
19048#if defined(__parallel)
19052 msg_len =
SIZE(msg)
19053 IF (
PRESENT(msglen)) msg_len = msglen
19054#if defined(__parallel)
19055 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
19057 cpabort(
"mpi_file_write_at_dv @ mp_file_write_at_dv")
19059 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
19061 END SUBROUTINE mp_file_write_at_dv
19069 SUBROUTINE mp_file_write_at_d (fh, offset, msg)
19070 REAL(kind=real_8),
INTENT(IN) :: msg
19072 INTEGER(kind=file_offset),
INTENT(IN) :: offset
19074#if defined(__parallel)
19078 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
19080 cpabort(
"mpi_file_write_at_d @ mp_file_write_at_d")
19082 WRITE (unit=fh%handle, pos=offset + 1) msg
19084 END SUBROUTINE mp_file_write_at_d
19096 SUBROUTINE mp_file_write_at_all_dv(fh, offset, msg, msglen)
19097 REAL(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
19099 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
19100 INTEGER(kind=file_offset),
INTENT(IN) :: offset
19103#if defined(__parallel)
19107 msg_len =
SIZE(msg)
19108 IF (
PRESENT(msglen)) msg_len = msglen
19109#if defined(__parallel)
19110 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
19112 cpabort(
"mpi_file_write_at_all_dv @ mp_file_write_at_all_dv")
19114 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
19116 END SUBROUTINE mp_file_write_at_all_dv
19124 SUBROUTINE mp_file_write_at_all_d (fh, offset, msg)
19125 REAL(kind=real_8),
INTENT(IN) :: msg
19127 INTEGER(kind=file_offset),
INTENT(IN) :: offset
19129#if defined(__parallel)
19133 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
19135 cpabort(
"mpi_file_write_at_all_d @ mp_file_write_at_all_d")
19137 WRITE (unit=fh%handle, pos=offset + 1) msg
19139 END SUBROUTINE mp_file_write_at_all_d
19152 SUBROUTINE mp_file_read_at_dv(fh, offset, msg, msglen)
19153 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
19155 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
19156 INTEGER(kind=file_offset),
INTENT(IN) :: offset
19159#if defined(__parallel)
19163 msg_len =
SIZE(msg)
19164 IF (
PRESENT(msglen)) msg_len = msglen
19165#if defined(__parallel)
19166 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
19168 cpabort(
"mpi_file_read_at_dv @ mp_file_read_at_dv")
19170 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
19172 END SUBROUTINE mp_file_read_at_dv
19180 SUBROUTINE mp_file_read_at_d (fh, offset, msg)
19181 REAL(kind=real_8),
INTENT(OUT) :: msg
19183 INTEGER(kind=file_offset),
INTENT(IN) :: offset
19185#if defined(__parallel)
19189 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
19191 cpabort(
"mpi_file_read_at_d @ mp_file_read_at_d")
19193 READ (unit=fh%handle, pos=offset + 1) msg
19195 END SUBROUTINE mp_file_read_at_d
19207 SUBROUTINE mp_file_read_at_all_dv(fh, offset, msg, msglen)
19208 REAL(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
19210 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
19211 INTEGER(kind=file_offset),
INTENT(IN) :: offset
19214#if defined(__parallel)
19218 msg_len =
SIZE(msg)
19219 IF (
PRESENT(msglen)) msg_len = msglen
19220#if defined(__parallel)
19221 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_double_precision, mpi_status_ignore, ierr)
19223 cpabort(
"mpi_file_read_at_all_dv @ mp_file_read_at_all_dv")
19225 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
19227 END SUBROUTINE mp_file_read_at_all_dv
19235 SUBROUTINE mp_file_read_at_all_d (fh, offset, msg)
19236 REAL(kind=real_8),
INTENT(OUT) :: msg
19238 INTEGER(kind=file_offset),
INTENT(IN) :: offset
19240#if defined(__parallel)
19244 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_double_precision, mpi_status_ignore, ierr)
19246 cpabort(
"mpi_file_read_at_all_d @ mp_file_read_at_all_d")
19248 READ (unit=fh%handle, pos=offset + 1) msg
19250 END SUBROUTINE mp_file_read_at_all_d
19259 FUNCTION mp_type_make_d (ptr, &
19260 vector_descriptor, index_descriptor) &
19261 result(type_descriptor)
19262 REAL(kind=real_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
19263 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
19264 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
19267 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_d'
19269#if defined(__parallel)
19271#if defined(__MPI_F08)
19273 EXTERNAL :: mpi_get_address
19277 NULLIFY (type_descriptor%subtype)
19278 type_descriptor%length =
SIZE(ptr)
19279#if defined(__parallel)
19280 type_descriptor%type_handle = mpi_double_precision
19281 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
19283 cpabort(
"MPI_Get_address @ "//routinen)
19285 type_descriptor%type_handle = 3
19287 type_descriptor%vector_descriptor(1:2) = 1
19288 type_descriptor%has_indexing = .false.
19289 type_descriptor%data_d => ptr
19290 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
19291 cpabort(routinen//
": Vectors and indices NYI")
19293 END FUNCTION mp_type_make_d
19302 SUBROUTINE mp_alloc_mem_d (DATA, len, stat)
19303 REAL(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
19304 INTEGER,
INTENT(IN) :: len
19305 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
19307#if defined(__parallel)
19308 INTEGER :: size, ierr, length, &
19310 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
19311 TYPE(c_ptr) :: mp_baseptr
19312 mpi_info_type :: mp_info
19314 length = max(len, 1)
19315 CALL mpi_type_size(mpi_double_precision,
size, ierr)
19316 mp_size = int(length, kind=mpi_address_kind)*
size
19317 IF (mp_size .GT. mp_max_memory_size)
THEN
19318 cpabort(
"MPI cannot allocate more than 2 GiByte")
19320 mp_info = mpi_info_null
19321 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
19322 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
19323 IF (
PRESENT(stat)) stat = mp_res
19325 INTEGER :: length, mystat
19326 length = max(len, 1)
19327 IF (
PRESENT(stat))
THEN
19328 ALLOCATE (
DATA(length), stat=mystat)
19331 ALLOCATE (
DATA(length))
19334 END SUBROUTINE mp_alloc_mem_d
19342 SUBROUTINE mp_free_mem_d (DATA, stat)
19343 REAL(kind=real_8),
DIMENSION(:), &
19344 POINTER, asynchronous ::
DATA
19345 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
19347#if defined(__parallel)
19349 CALL mpi_free_mem(
DATA, mp_res)
19350 IF (
PRESENT(stat)) stat = mp_res
19353 IF (
PRESENT(stat)) stat = 0
19355 END SUBROUTINE mp_free_mem_d
19367 SUBROUTINE mp_shift_rm(msg, comm, displ_in)
19369 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
19371 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
19373 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_rm'
19375 INTEGER :: handle, ierror
19376#if defined(__parallel)
19377 INTEGER :: displ, left, &
19378 msglen, myrank, nprocs, &
19383 CALL mp_timeset(routinen, handle)
19385#if defined(__parallel)
19386 CALL mpi_comm_rank(comm%handle, myrank, ierror)
19387 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
19388 CALL mpi_comm_size(comm%handle, nprocs, ierror)
19389 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
19390 IF (
PRESENT(displ_in))
THEN
19395 right =
modulo(myrank + displ, nprocs)
19396 left =
modulo(myrank - displ, nprocs)
19399 CALL mpi_sendrecv_replace(msg, msglen, mpi_real, right, tag, left, tag, &
19400 comm%handle, mpi_status_ignore, ierror)
19401 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
19402 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_4_size)
19406 mark_used(displ_in)
19408 CALL mp_timestop(handle)
19410 END SUBROUTINE mp_shift_rm
19423 SUBROUTINE mp_shift_r (msg, comm, displ_in)
19425 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
19427 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
19429 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_r'
19431 INTEGER :: handle, ierror
19432#if defined(__parallel)
19433 INTEGER :: displ, left, &
19434 msglen, myrank, nprocs, &
19439 CALL mp_timeset(routinen, handle)
19441#if defined(__parallel)
19442 CALL mpi_comm_rank(comm%handle, myrank, ierror)
19443 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
19444 CALL mpi_comm_size(comm%handle, nprocs, ierror)
19445 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
19446 IF (
PRESENT(displ_in))
THEN
19451 right =
modulo(myrank + displ, nprocs)
19452 left =
modulo(myrank - displ, nprocs)
19455 CALL mpi_sendrecv_replace(msg, msglen, mpi_real, right, tag, left, &
19456 tag, comm%handle, mpi_status_ignore, ierror)
19457 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
19458 CALL add_perf(perf_id=7, count=1, msg_size=msglen*real_4_size)
19462 mark_used(displ_in)
19464 CALL mp_timestop(handle)
19466 END SUBROUTINE mp_shift_r
19487 SUBROUTINE mp_alltoall_r11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
19489 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
19490 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
19491 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
19492 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
19495 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r11v'
19498#if defined(__parallel)
19499 INTEGER :: ierr, msglen
19504 CALL mp_timeset(routinen, handle)
19506#if defined(__parallel)
19507 CALL mpi_alltoallv(sb, scount, sdispl, mpi_real, &
19508 rb, rcount, rdispl, mpi_real, comm%handle, ierr)
19509 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
19510 msglen = sum(scount) + sum(rcount)
19511 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19517 DO i = 1, rcount(1)
19518 rb(rdispl(1) + i) = sb(sdispl(1) + i)
19521 CALL mp_timestop(handle)
19523 END SUBROUTINE mp_alltoall_r11v
19538 SUBROUTINE mp_alltoall_r22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
19540 REAL(kind=real_4),
DIMENSION(:, :), &
19541 INTENT(IN),
CONTIGUOUS :: sb
19542 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
19543 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS, &
19544 INTENT(INOUT) :: rb
19545 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
19548 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r22v'
19551#if defined(__parallel)
19552 INTEGER :: ierr, msglen
19555 CALL mp_timeset(routinen, handle)
19557#if defined(__parallel)
19558 CALL mpi_alltoallv(sb, scount, sdispl, mpi_real, &
19559 rb, rcount, rdispl, mpi_real, comm%handle, ierr)
19560 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
19561 msglen = sum(scount) + sum(rcount)
19562 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*real_4_size)
19571 CALL mp_timestop(handle)
19573 END SUBROUTINE mp_alltoall_r22v
19590 SUBROUTINE mp_alltoall_r (sb, rb, count, comm)
19592 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
19593 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
19594 INTEGER,
INTENT(IN) :: count
19597 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r'
19600#if defined(__parallel)
19601 INTEGER :: ierr, msglen, np
19604 CALL mp_timeset(routinen, handle)
19606#if defined(__parallel)
19607 CALL mpi_alltoall(sb, count, mpi_real, &
19608 rb, count, mpi_real, comm%handle, ierr)
19609 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19610 CALL mpi_comm_size(comm%handle, np, ierr)
19611 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19612 msglen = 2*count*np
19613 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19619 CALL mp_timestop(handle)
19621 END SUBROUTINE mp_alltoall_r
19631 SUBROUTINE mp_alltoall_r22(sb, rb, count, comm)
19633 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
19634 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
19635 INTEGER,
INTENT(IN) :: count
19638 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r22'
19641#if defined(__parallel)
19642 INTEGER :: ierr, msglen, np
19645 CALL mp_timeset(routinen, handle)
19647#if defined(__parallel)
19648 CALL mpi_alltoall(sb, count, mpi_real, &
19649 rb, count, mpi_real, comm%handle, ierr)
19650 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19651 CALL mpi_comm_size(comm%handle, np, ierr)
19652 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19653 msglen = 2*
SIZE(sb)*np
19654 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19660 CALL mp_timestop(handle)
19662 END SUBROUTINE mp_alltoall_r22
19672 SUBROUTINE mp_alltoall_r33(sb, rb, count, comm)
19674 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
19675 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
19676 INTEGER,
INTENT(IN) :: count
19679 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r33'
19682#if defined(__parallel)
19683 INTEGER :: ierr, msglen, np
19686 CALL mp_timeset(routinen, handle)
19688#if defined(__parallel)
19689 CALL mpi_alltoall(sb, count, mpi_real, &
19690 rb, count, mpi_real, comm%handle, ierr)
19691 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19692 CALL mpi_comm_size(comm%handle, np, ierr)
19693 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19694 msglen = 2*count*np
19695 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19701 CALL mp_timestop(handle)
19703 END SUBROUTINE mp_alltoall_r33
19713 SUBROUTINE mp_alltoall_r44(sb, rb, count, comm)
19715 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19717 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19719 INTEGER,
INTENT(IN) :: count
19722 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r44'
19725#if defined(__parallel)
19726 INTEGER :: ierr, msglen, np
19729 CALL mp_timeset(routinen, handle)
19731#if defined(__parallel)
19732 CALL mpi_alltoall(sb, count, mpi_real, &
19733 rb, count, mpi_real, comm%handle, ierr)
19734 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19735 CALL mpi_comm_size(comm%handle, np, ierr)
19736 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19737 msglen = 2*count*np
19738 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19744 CALL mp_timestop(handle)
19746 END SUBROUTINE mp_alltoall_r44
19756 SUBROUTINE mp_alltoall_r55(sb, rb, count, comm)
19758 REAL(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
19760 REAL(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
19762 INTEGER,
INTENT(IN) :: count
19765 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r55'
19768#if defined(__parallel)
19769 INTEGER :: ierr, msglen, np
19772 CALL mp_timeset(routinen, handle)
19774#if defined(__parallel)
19775 CALL mpi_alltoall(sb, count, mpi_real, &
19776 rb, count, mpi_real, comm%handle, ierr)
19777 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19778 CALL mpi_comm_size(comm%handle, np, ierr)
19779 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19780 msglen = 2*count*np
19781 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19787 CALL mp_timestop(handle)
19789 END SUBROUTINE mp_alltoall_r55
19800 SUBROUTINE mp_alltoall_r45(sb, rb, count, comm)
19802 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19804 REAL(kind=real_4), &
19805 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
19806 INTEGER,
INTENT(IN) :: count
19809 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r45'
19812#if defined(__parallel)
19813 INTEGER :: ierr, msglen, np
19816 CALL mp_timeset(routinen, handle)
19818#if defined(__parallel)
19819 CALL mpi_alltoall(sb, count, mpi_real, &
19820 rb, count, mpi_real, comm%handle, ierr)
19821 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19822 CALL mpi_comm_size(comm%handle, np, ierr)
19823 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19824 msglen = 2*count*np
19825 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19829 rb = reshape(sb, shape(rb))
19831 CALL mp_timestop(handle)
19833 END SUBROUTINE mp_alltoall_r45
19844 SUBROUTINE mp_alltoall_r34(sb, rb, count, comm)
19846 REAL(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
19848 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19850 INTEGER,
INTENT(IN) :: count
19853 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r34'
19856#if defined(__parallel)
19857 INTEGER :: ierr, msglen, np
19860 CALL mp_timeset(routinen, handle)
19862#if defined(__parallel)
19863 CALL mpi_alltoall(sb, count, mpi_real, &
19864 rb, count, mpi_real, comm%handle, ierr)
19865 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19866 CALL mpi_comm_size(comm%handle, np, ierr)
19867 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19868 msglen = 2*count*np
19869 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19873 rb = reshape(sb, shape(rb))
19875 CALL mp_timestop(handle)
19877 END SUBROUTINE mp_alltoall_r34
19888 SUBROUTINE mp_alltoall_r54(sb, rb, count, comm)
19890 REAL(kind=real_4), &
19891 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
19892 REAL(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
19894 INTEGER,
INTENT(IN) :: count
19897 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_r54'
19900#if defined(__parallel)
19901 INTEGER :: ierr, msglen, np
19904 CALL mp_timeset(routinen, handle)
19906#if defined(__parallel)
19907 CALL mpi_alltoall(sb, count, mpi_real, &
19908 rb, count, mpi_real, comm%handle, ierr)
19909 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
19910 CALL mpi_comm_size(comm%handle, np, ierr)
19911 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
19912 msglen = 2*count*np
19913 CALL add_perf(perf_id=6, count=1, msg_size=msglen*real_4_size)
19917 rb = reshape(sb, shape(rb))
19919 CALL mp_timestop(handle)
19921 END SUBROUTINE mp_alltoall_r54
19932 SUBROUTINE mp_send_r (msg, dest, tag, comm)
19933 REAL(kind=real_4),
INTENT(IN) :: msg
19934 INTEGER,
INTENT(IN) :: dest, tag
19937 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_r'
19940#if defined(__parallel)
19941 INTEGER :: ierr, msglen
19944 CALL mp_timeset(routinen, handle)
19946#if defined(__parallel)
19948 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19949 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19950 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19957 cpabort(
"not in parallel mode")
19959 CALL mp_timestop(handle)
19960 END SUBROUTINE mp_send_r
19970 SUBROUTINE mp_send_rv(msg, dest, tag, comm)
19971 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
19972 INTEGER,
INTENT(IN) :: dest, tag
19975 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_rv'
19978#if defined(__parallel)
19979 INTEGER :: ierr, msglen
19982 CALL mp_timeset(routinen, handle)
19984#if defined(__parallel)
19986 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
19987 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
19988 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
19995 cpabort(
"not in parallel mode")
19997 CALL mp_timestop(handle)
19998 END SUBROUTINE mp_send_rv
20008 SUBROUTINE mp_send_rm2(msg, dest, tag, comm)
20009 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
20010 INTEGER,
INTENT(IN) :: dest, tag
20013 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_rm2'
20016#if defined(__parallel)
20017 INTEGER :: ierr, msglen
20020 CALL mp_timeset(routinen, handle)
20022#if defined(__parallel)
20024 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
20025 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
20026 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
20033 cpabort(
"not in parallel mode")
20035 CALL mp_timestop(handle)
20036 END SUBROUTINE mp_send_rm2
20046 SUBROUTINE mp_send_rm3(msg, dest, tag, comm)
20047 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
20048 INTEGER,
INTENT(IN) :: dest, tag
20051 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
20054#if defined(__parallel)
20055 INTEGER :: ierr, msglen
20058 CALL mp_timeset(routinen, handle)
20060#if defined(__parallel)
20062 CALL mpi_send(msg, msglen, mpi_real, dest, tag, comm%handle, ierr)
20063 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
20064 CALL add_perf(perf_id=13, count=1, msg_size=msglen*real_4_size)
20071 cpabort(
"not in parallel mode")
20073 CALL mp_timestop(handle)
20074 END SUBROUTINE mp_send_rm3
20085 SUBROUTINE mp_recv_r (msg, source, tag, comm)
20086 REAL(kind=real_4),
INTENT(INOUT) :: msg
20087 INTEGER,
INTENT(INOUT) :: source, tag
20090 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_r'
20093#if defined(__parallel)
20094 INTEGER :: ierr, msglen
20095 mpi_status_type :: status
20098 CALL mp_timeset(routinen, handle)
20100#if defined(__parallel)
20103 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
20104 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
20106 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
20107 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
20108 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
20109 source = status mpi_status_extract(mpi_source)
20110 tag = status mpi_status_extract(mpi_tag)
20118 cpabort(
"not in parallel mode")
20120 CALL mp_timestop(handle)
20121 END SUBROUTINE mp_recv_r
20131 SUBROUTINE mp_recv_rv(msg, source, tag, comm)
20132 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20133 INTEGER,
INTENT(INOUT) :: source, tag
20136 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rv'
20139#if defined(__parallel)
20140 INTEGER :: ierr, msglen
20141 mpi_status_type :: status
20144 CALL mp_timeset(routinen, handle)
20146#if defined(__parallel)
20149 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
20150 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
20152 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
20153 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
20154 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
20155 source = status mpi_status_extract(mpi_source)
20156 tag = status mpi_status_extract(mpi_tag)
20164 cpabort(
"not in parallel mode")
20166 CALL mp_timestop(handle)
20167 END SUBROUTINE mp_recv_rv
20177 SUBROUTINE mp_recv_rm2(msg, source, tag, comm)
20178 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20179 INTEGER,
INTENT(INOUT) :: source, tag
20182 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rm2'
20185#if defined(__parallel)
20186 INTEGER :: ierr, msglen
20187 mpi_status_type :: status
20190 CALL mp_timeset(routinen, handle)
20192#if defined(__parallel)
20195 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
20196 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
20198 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
20199 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
20200 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
20201 source = status mpi_status_extract(mpi_source)
20202 tag = status mpi_status_extract(mpi_tag)
20210 cpabort(
"not in parallel mode")
20212 CALL mp_timestop(handle)
20213 END SUBROUTINE mp_recv_rm2
20223 SUBROUTINE mp_recv_rm3(msg, source, tag, comm)
20224 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
20225 INTEGER,
INTENT(INOUT) :: source, tag
20228 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_rm3'
20231#if defined(__parallel)
20232 INTEGER :: ierr, msglen
20233 mpi_status_type :: status
20236 CALL mp_timeset(routinen, handle)
20238#if defined(__parallel)
20241 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, mpi_status_ignore, ierr)
20242 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
20244 CALL mpi_recv(msg, msglen, mpi_real, source, tag, comm%handle, status, ierr)
20245 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
20246 CALL add_perf(perf_id=14, count=1, msg_size=msglen*real_4_size)
20247 source = status mpi_status_extract(mpi_source)
20248 tag = status mpi_status_extract(mpi_tag)
20256 cpabort(
"not in parallel mode")
20258 CALL mp_timestop(handle)
20259 END SUBROUTINE mp_recv_rm3
20269 SUBROUTINE mp_bcast_r (msg, source, comm)
20270 REAL(kind=real_4),
INTENT(INOUT) :: msg
20271 INTEGER,
INTENT(IN) :: source
20274 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r'
20277#if defined(__parallel)
20278 INTEGER :: ierr, msglen
20281 CALL mp_timeset(routinen, handle)
20283#if defined(__parallel)
20285 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20286 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20287 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20293 CALL mp_timestop(handle)
20294 END SUBROUTINE mp_bcast_r
20303 SUBROUTINE mp_bcast_r_src(msg, comm)
20304 REAL(kind=real_4),
INTENT(INOUT) :: msg
20307 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r_src'
20310#if defined(__parallel)
20311 INTEGER :: ierr, msglen
20314 CALL mp_timeset(routinen, handle)
20316#if defined(__parallel)
20318 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20319 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20320 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20325 CALL mp_timestop(handle)
20326 END SUBROUTINE mp_bcast_r_src
20336 SUBROUTINE mp_ibcast_r (msg, source, comm, request)
20337 REAL(kind=real_4),
INTENT(INOUT) :: msg
20338 INTEGER,
INTENT(IN) :: source
20342 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_r'
20345#if defined(__parallel)
20346 INTEGER :: ierr, msglen
20349 CALL mp_timeset(routinen, handle)
20351#if defined(__parallel)
20353 CALL mpi_ibcast(msg, msglen, mpi_real, source, comm%handle, request%handle, ierr)
20354 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
20355 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_4_size)
20362 CALL mp_timestop(handle)
20363 END SUBROUTINE mp_ibcast_r
20372 SUBROUTINE mp_bcast_rv(msg, source, comm)
20373 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20374 INTEGER,
INTENT(IN) :: source
20377 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rv'
20380#if defined(__parallel)
20381 INTEGER :: ierr, msglen
20384 CALL mp_timeset(routinen, handle)
20386#if defined(__parallel)
20388 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20389 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20390 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20396 CALL mp_timestop(handle)
20397 END SUBROUTINE mp_bcast_rv
20405 SUBROUTINE mp_bcast_rv_src(msg, comm)
20406 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20409 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rv_src'
20412#if defined(__parallel)
20413 INTEGER :: ierr, msglen
20416 CALL mp_timeset(routinen, handle)
20418#if defined(__parallel)
20420 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20421 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20422 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20427 CALL mp_timestop(handle)
20428 END SUBROUTINE mp_bcast_rv_src
20437 SUBROUTINE mp_ibcast_rv(msg, source, comm, request)
20438 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
20439 INTEGER,
INTENT(IN) :: source
20443 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_rv'
20446#if defined(__parallel)
20447 INTEGER :: ierr, msglen
20450 CALL mp_timeset(routinen, handle)
20452#if defined(__parallel)
20453#if !defined(__GNUC__) || __GNUC__ >= 9
20454 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
20457 CALL mpi_ibcast(msg, msglen, mpi_real, source, comm%handle, request%handle, ierr)
20458 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
20459 CALL add_perf(perf_id=22, count=1, msg_size=msglen*real_4_size)
20466 CALL mp_timestop(handle)
20467 END SUBROUTINE mp_ibcast_rv
20476 SUBROUTINE mp_bcast_rm(msg, source, comm)
20477 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20478 INTEGER,
INTENT(IN) :: source
20481 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rm'
20484#if defined(__parallel)
20485 INTEGER :: ierr, msglen
20488 CALL mp_timeset(routinen, handle)
20490#if defined(__parallel)
20492 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20493 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20494 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20500 CALL mp_timestop(handle)
20501 END SUBROUTINE mp_bcast_rm
20510 SUBROUTINE mp_bcast_rm_src(msg, comm)
20511 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20514 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_rm_src'
20517#if defined(__parallel)
20518 INTEGER :: ierr, msglen
20521 CALL mp_timeset(routinen, handle)
20523#if defined(__parallel)
20525 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20526 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20527 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20532 CALL mp_timestop(handle)
20533 END SUBROUTINE mp_bcast_rm_src
20542 SUBROUTINE mp_bcast_r3(msg, source, comm)
20543 REAL(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
20544 INTEGER,
INTENT(IN) :: source
20547 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r3'
20550#if defined(__parallel)
20551 INTEGER :: ierr, msglen
20554 CALL mp_timeset(routinen, handle)
20556#if defined(__parallel)
20558 CALL mpi_bcast(msg, msglen, mpi_real, source, comm%handle, ierr)
20559 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20560 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20566 CALL mp_timestop(handle)
20567 END SUBROUTINE mp_bcast_r3
20576 SUBROUTINE mp_bcast_r3_src(msg, comm)
20577 REAL(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
20580 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_r3_src'
20583#if defined(__parallel)
20584 INTEGER :: ierr, msglen
20587 CALL mp_timeset(routinen, handle)
20589#if defined(__parallel)
20591 CALL mpi_bcast(msg, msglen, mpi_real, comm%source, comm%handle, ierr)
20592 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
20593 CALL add_perf(perf_id=2, count=1, msg_size=msglen*real_4_size)
20598 CALL mp_timestop(handle)
20599 END SUBROUTINE mp_bcast_r3_src
20608 SUBROUTINE mp_sum_r (msg, comm)
20609 REAL(kind=real_4),
INTENT(INOUT) :: msg
20612 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_r'
20615#if defined(__parallel)
20616 INTEGER :: ierr, msglen
20617 REAL(kind=real_4) :: res
20620 CALL mp_timeset(routinen, handle)
20622#if defined(__parallel)
20624 IF (comm%num_pe > 1)
THEN
20625 CALL mpi_allreduce(msg, res, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20626 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20629 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20634 CALL mp_timestop(handle)
20635 END SUBROUTINE mp_sum_r
20643 SUBROUTINE mp_sum_rv(msg, comm)
20644 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20647 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rv'
20650#if defined(__parallel)
20651 INTEGER :: ierr, msglen
20652 REAL(kind=real_4),
ALLOCATABLE :: msgbuf(:)
20655 CALL mp_timeset(routinen, handle)
20657#if defined(__parallel)
20659 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
20660 ALLOCATE (msgbuf(msglen))
20661 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20662 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20665 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20670 CALL mp_timestop(handle)
20671 END SUBROUTINE mp_sum_rv
20679 SUBROUTINE mp_isum_rv(msg, comm, request)
20680 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
20684 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_rv'
20687#if defined(__parallel)
20688 INTEGER :: ierr, msglen
20691 CALL mp_timeset(routinen, handle)
20693#if defined(__parallel)
20694#if !defined(__GNUC__) || __GNUC__ >= 9
20695 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
20698 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
20699 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_real, mpi_sum, comm%handle, request%handle, ierr)
20700 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
20704 CALL add_perf(perf_id=23, count=1, msg_size=msglen*real_4_size)
20710 CALL mp_timestop(handle)
20711 END SUBROUTINE mp_isum_rv
20719 SUBROUTINE mp_sum_rm(msg, comm)
20720 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20723 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm'
20726#if defined(__parallel)
20727 INTEGER,
PARAMETER :: max_msg = 2**25
20728 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
20729 REAL(kind=real_4),
ALLOCATABLE :: msgbuf(:)
20732 CALL mp_timeset(routinen, handle)
20734#if defined(__parallel)
20736 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
20738 DO m1 = lbound(msg, 2), ubound(msg, 2), step
20739 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
20740 msglensum = msglensum + msglen
20741 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
20742 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
20743 ALLOCATE (msgbuf(msglen))
20744 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20745 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20746 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
20747 DEALLOCATE (msgbuf)
20750 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_4_size)
20755 CALL mp_timestop(handle)
20756 END SUBROUTINE mp_sum_rm
20764 SUBROUTINE mp_sum_rm3(msg, comm)
20765 REAL(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
20768 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm3'
20771#if defined(__parallel)
20772 INTEGER :: ierr, msglen
20773 REAL(kind=real_4),
ALLOCATABLE :: msgbuf(:)
20776 CALL mp_timeset(routinen, handle)
20778#if defined(__parallel)
20780 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
20781 ALLOCATE (msgbuf(msglen))
20782 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20783 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20784 msg = reshape(msgbuf, shape(msg))
20786 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20791 CALL mp_timestop(handle)
20792 END SUBROUTINE mp_sum_rm3
20800 SUBROUTINE mp_sum_rm4(msg, comm)
20801 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
20804 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_rm4'
20807#if defined(__parallel)
20808 INTEGER :: ierr, msglen
20809 REAL(kind=real_4),
ALLOCATABLE :: msgbuf(:)
20812 CALL mp_timeset(routinen, handle)
20814#if defined(__parallel)
20816 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
20817 ALLOCATE (msgbuf(msglen))
20818 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20819 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20820 msg = reshape(msgbuf, shape(msg))
20822 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20827 CALL mp_timestop(handle)
20828 END SUBROUTINE mp_sum_rm4
20840 SUBROUTINE mp_sum_root_rv(msg, root, comm)
20841 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
20842 INTEGER,
INTENT(IN) :: root
20845 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rv'
20848#if defined(__parallel)
20849 INTEGER :: ierr, m1, msglen, taskid
20850 REAL(kind=real_4),
ALLOCATABLE :: res(:)
20853 CALL mp_timeset(routinen, handle)
20855#if defined(__parallel)
20857 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20858 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20859 IF (msglen > 0)
THEN
20862 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_sum, &
20863 root, comm%handle, ierr)
20864 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20865 IF (taskid == root)
THEN
20870 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20876 CALL mp_timestop(handle)
20877 END SUBROUTINE mp_sum_root_rv
20888 SUBROUTINE mp_sum_root_rm(msg, root, comm)
20889 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
20890 INTEGER,
INTENT(IN) :: root
20893 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
20896#if defined(__parallel)
20897 INTEGER :: ierr, m1, m2, msglen, taskid
20898 REAL(kind=real_4),
ALLOCATABLE :: res(:, :)
20901 CALL mp_timeset(routinen, handle)
20903#if defined(__parallel)
20905 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20906 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20907 IF (msglen > 0)
THEN
20910 ALLOCATE (res(m1, m2))
20911 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_sum, root, comm%handle, ierr)
20912 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
20913 IF (taskid == root)
THEN
20918 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20924 CALL mp_timestop(handle)
20925 END SUBROUTINE mp_sum_root_rm
20933 SUBROUTINE mp_sum_partial_rm(msg, res, comm)
20934 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
20935 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
20938 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_rm'
20941#if defined(__parallel)
20942 INTEGER :: ierr, msglen, taskid
20945 CALL mp_timeset(routinen, handle)
20947#if defined(__parallel)
20949 CALL mpi_comm_rank(comm%handle, taskid, ierr)
20950 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
20951 IF (msglen > 0)
THEN
20952 CALL mpi_scan(msg, res, msglen, mpi_real, mpi_sum, comm%handle, ierr)
20953 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
20955 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20961 CALL mp_timestop(handle)
20962 END SUBROUTINE mp_sum_partial_rm
20972 SUBROUTINE mp_max_r (msg, comm)
20973 REAL(kind=real_4),
INTENT(INOUT) :: msg
20976 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_r'
20979#if defined(__parallel)
20980 INTEGER :: ierr, msglen
20981 REAL(kind=real_4) :: res
20984 CALL mp_timeset(routinen, handle)
20986#if defined(__parallel)
20988 IF (comm%num_pe > 1)
THEN
20989 CALL mpi_allreduce(msg, res, msglen, mpi_real, mpi_max, comm%handle, ierr)
20990 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
20993 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
20998 CALL mp_timestop(handle)
20999 END SUBROUTINE mp_max_r
21009 SUBROUTINE mp_max_root_r (msg, root, comm)
21010 REAL(kind=real_4),
INTENT(INOUT) :: msg
21011 INTEGER,
INTENT(IN) :: root
21014 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_r'
21017#if defined(__parallel)
21018 INTEGER :: ierr, msglen
21019 REAL(kind=real_4) :: res
21022 CALL mp_timeset(routinen, handle)
21024#if defined(__parallel)
21026 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_max, root, comm%handle, ierr)
21027 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
21028 IF (root == comm%mepos) msg = res
21029 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
21035 CALL mp_timestop(handle)
21036 END SUBROUTINE mp_max_root_r
21046 SUBROUTINE mp_max_rv(msg, comm)
21047 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
21050 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_rv'
21053#if defined(__parallel)
21054 INTEGER :: ierr, msglen
21055 REAL(kind=real_4),
ALLOCATABLE :: msgbuf(:)
21058 CALL mp_timeset(routinen, handle)
21060#if defined(__parallel)
21062 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
21063 ALLOCATE (msgbuf(msglen))
21064 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_real, mpi_max, comm%handle, ierr)
21065 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
21068 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
21073 CALL mp_timestop(handle)
21074 END SUBROUTINE mp_max_rv
21084 SUBROUTINE mp_max_rm(msg, comm)
21085 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
21088 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_rm'
21091#if defined(__parallel)
21092 INTEGER,
PARAMETER :: max_msg = 2**25
21093 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
21094 REAL(kind=real_4),
ALLOCATABLE :: msgbuf(:)
21097 CALL mp_timeset(routinen, handle)
21099#if defined(__parallel)
21101 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
21103 DO m1 = lbound(msg, 2), ubound(msg, 2), step
21104 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
21105 msglensum = msglensum + msglen
21106 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
21107 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
21108 ALLOCATE (msgbuf(msglen))
21109 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_real, mpi_max, comm%handle, ierr)
21110 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
21111 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
21112 DEALLOCATE (msgbuf)
21115 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_4_size)
21120 CALL mp_timestop(handle)
21121 END SUBROUTINE mp_max_rm
21131 SUBROUTINE mp_max_root_rm(msg, root, comm)
21132 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
21136 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_rm'
21139#if defined(__parallel)
21140 INTEGER :: ierr, msglen
21141 REAL(kind=real_4) :: res(
SIZE(msg, 1),
SIZE(msg, 2))
21144 CALL mp_timeset(routinen, handle)
21146#if defined(__parallel)
21148 CALL mpi_reduce(msg, res, msglen, mpi_real, mpi_max, root, comm%handle, ierr)
21149 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
21150 IF (root == comm%mepos) msg = res
21151 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
21157 CALL mp_timestop(handle)
21158 END SUBROUTINE mp_max_root_rm
21168 SUBROUTINE mp_min_r (msg, comm)
21169 REAL(kind=real_4),
INTENT(INOUT) :: msg
21172 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_r'
21175#if defined(__parallel)
21176 INTEGER :: ierr, msglen
21177 REAL(kind=real_4) :: res
21180 CALL mp_timeset(routinen, handle)
21182#if defined(__parallel)
21184 IF (comm%num_pe > 1)
THEN
21185 CALL mpi_allreduce(msg, res, msglen, mpi_real, mpi_min, comm%handle, ierr)
21186 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
21189 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
21194 CALL mp_timestop(handle)
21195 END SUBROUTINE mp_min_r
21207 SUBROUTINE mp_min_rv(msg, comm)
21208 REAL(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
21211 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_rv'
21214#if defined(__parallel)
21215 INTEGER :: ierr, msglen
21216 REAL(kind=real_4),
ALLOCATABLE :: msgbuf(:)
21219 CALL mp_timeset(routinen, handle)
21221#if defined(__parallel)
21223 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
21224 ALLOCATE (msgbuf(msglen))
21225 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_real, mpi_min, comm%handle, ierr)
21226 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
21229 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
21234 CALL mp_timestop(handle)
21235 END SUBROUTINE mp_min_rv
21245 SUBROUTINE mp_min_rm(msg, comm)
21246 REAL(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
21249 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_rm'
21252#if defined(__parallel)
21253 INTEGER,
PARAMETER :: max_msg = 2**25
21254 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
21255 REAL(kind=real_4),
ALLOCATABLE :: msgbuf(:)
21258 CALL mp_timeset(routinen, handle)
21260#if defined(__parallel)
21262 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
21264 DO m1 = lbound(msg, 2), ubound(msg, 2), step
21265 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
21266 msglensum = msglensum + msglen
21267 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
21268 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
21269 ALLOCATE (msgbuf(msglen))
21270 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_real, mpi_min, comm%handle, ierr)
21271 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
21272 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
21273 DEALLOCATE (msgbuf)
21276 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*real_4_size)
21281 CALL mp_timestop(handle)
21282 END SUBROUTINE mp_min_rm
21292 SUBROUTINE mp_prod_r (msg, comm)
21293 REAL(kind=real_4),
INTENT(INOUT) :: msg
21296 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_r'
21299#if defined(__parallel)
21300 INTEGER :: ierr, msglen
21301 REAL(kind=real_4) :: res
21304 CALL mp_timeset(routinen, handle)
21306#if defined(__parallel)
21308 IF (comm%num_pe > 1)
THEN
21309 CALL mpi_allreduce(msg, res, msglen, mpi_real, mpi_prod, comm%handle, ierr)
21310 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
21313 CALL add_perf(perf_id=3, count=1, msg_size=msglen*real_4_size)
21318 CALL mp_timestop(handle)
21319 END SUBROUTINE mp_prod_r
21330 SUBROUTINE mp_scatter_rv(msg_scatter, msg, root, comm)
21331 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
21332 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
21333 INTEGER,
INTENT(IN) :: root
21336 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_rv'
21339#if defined(__parallel)
21340 INTEGER :: ierr, msglen
21343 CALL mp_timeset(routinen, handle)
21345#if defined(__parallel)
21347 CALL mpi_scatter(msg_scatter, msglen, mpi_real, msg, &
21348 msglen, mpi_real, root, comm%handle, ierr)
21349 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
21350 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21356 CALL mp_timestop(handle)
21357 END SUBROUTINE mp_scatter_rv
21367 SUBROUTINE mp_iscatter_r (msg_scatter, msg, root, comm, request)
21368 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:)
21369 REAL(kind=real_4),
INTENT(INOUT) :: msg
21370 INTEGER,
INTENT(IN) :: root
21374 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_r'
21377#if defined(__parallel)
21378 INTEGER :: ierr, msglen
21381 CALL mp_timeset(routinen, handle)
21383#if defined(__parallel)
21384#if !defined(__GNUC__) || __GNUC__ >= 9
21385 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
21388 CALL mpi_iscatter(msg_scatter, msglen, mpi_real, msg, &
21389 msglen, mpi_real, root, comm%handle, request%handle, ierr)
21390 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
21391 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
21395 msg = msg_scatter(1)
21398 CALL mp_timestop(handle)
21399 END SUBROUTINE mp_iscatter_r
21409 SUBROUTINE mp_iscatter_rv2(msg_scatter, msg, root, comm, request)
21410 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:, :)
21411 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
21412 INTEGER,
INTENT(IN) :: root
21416 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_rv2'
21419#if defined(__parallel)
21420 INTEGER :: ierr, msglen
21423 CALL mp_timeset(routinen, handle)
21425#if defined(__parallel)
21426#if !defined(__GNUC__) || __GNUC__ >= 9
21427 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
21430 CALL mpi_iscatter(msg_scatter, msglen, mpi_real, msg, &
21431 msglen, mpi_real, root, comm%handle, request%handle, ierr)
21432 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
21433 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
21437 msg(:) = msg_scatter(:, 1)
21440 CALL mp_timestop(handle)
21441 END SUBROUTINE mp_iscatter_rv2
21451 SUBROUTINE mp_iscatterv_rv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
21452 REAL(kind=real_4),
INTENT(IN) :: msg_scatter(:)
21453 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
21454 REAL(kind=real_4),
INTENT(INOUT) :: msg(:)
21455 INTEGER,
INTENT(IN) :: recvcount, root
21459 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_rv'
21462#if defined(__parallel)
21466 CALL mp_timeset(routinen, handle)
21468#if defined(__parallel)
21469#if !defined(__GNUC__) || __GNUC__ >= 9
21470 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
21471 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
21472 cpassert(is_contiguous(sendcounts) .OR.
SIZE(sendcounts) == 0)
21473 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
21475 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_real, msg, &
21476 recvcount, mpi_real, root, comm%handle, request%handle, ierr)
21477 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
21478 CALL add_perf(perf_id=24, count=1, msg_size=1*real_4_size)
21480 mark_used(sendcounts)
21482 mark_used(recvcount)
21485 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
21488 CALL mp_timestop(handle)
21489 END SUBROUTINE mp_iscatterv_rv
21500 SUBROUTINE mp_gather_r (msg, msg_gather, root, comm)
21501 REAL(kind=real_4),
INTENT(IN) :: msg
21502 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21503 INTEGER,
INTENT(IN) :: root
21506 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_r'
21509#if defined(__parallel)
21510 INTEGER :: ierr, msglen
21513 CALL mp_timeset(routinen, handle)
21515#if defined(__parallel)
21517 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21518 msglen, mpi_real, root, comm%handle, ierr)
21519 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21520 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21524 msg_gather(1) = msg
21526 CALL mp_timestop(handle)
21527 END SUBROUTINE mp_gather_r
21537 SUBROUTINE mp_gather_r_src(msg, msg_gather, comm)
21538 REAL(kind=real_4),
INTENT(IN) :: msg
21539 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21542 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_r_src'
21545#if defined(__parallel)
21546 INTEGER :: ierr, msglen
21549 CALL mp_timeset(routinen, handle)
21551#if defined(__parallel)
21553 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21554 msglen, mpi_real, comm%source, comm%handle, ierr)
21555 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21556 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21559 msg_gather(1) = msg
21561 CALL mp_timestop(handle)
21562 END SUBROUTINE mp_gather_r_src
21576 SUBROUTINE mp_gather_rv(msg, msg_gather, root, comm)
21577 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
21578 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21579 INTEGER,
INTENT(IN) :: root
21582 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rv'
21585#if defined(__parallel)
21586 INTEGER :: ierr, msglen
21589 CALL mp_timeset(routinen, handle)
21591#if defined(__parallel)
21593 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21594 msglen, mpi_real, root, comm%handle, ierr)
21595 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21596 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21602 CALL mp_timestop(handle)
21603 END SUBROUTINE mp_gather_rv
21616 SUBROUTINE mp_gather_rv_src(msg, msg_gather, comm)
21617 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
21618 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
21621 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rv_src'
21624#if defined(__parallel)
21625 INTEGER :: ierr, msglen
21628 CALL mp_timeset(routinen, handle)
21630#if defined(__parallel)
21632 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21633 msglen, mpi_real, comm%source, comm%handle, ierr)
21634 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21635 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21640 CALL mp_timestop(handle)
21641 END SUBROUTINE mp_gather_rv_src
21655 SUBROUTINE mp_gather_rm(msg, msg_gather, root, comm)
21656 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
21657 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
21658 INTEGER,
INTENT(IN) :: root
21661 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rm'
21664#if defined(__parallel)
21665 INTEGER :: ierr, msglen
21668 CALL mp_timeset(routinen, handle)
21670#if defined(__parallel)
21672 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21673 msglen, mpi_real, root, comm%handle, ierr)
21674 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21675 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21681 CALL mp_timestop(handle)
21682 END SUBROUTINE mp_gather_rm
21695 SUBROUTINE mp_gather_rm_src(msg, msg_gather, comm)
21696 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
21697 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
21700 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_rm_src'
21703#if defined(__parallel)
21704 INTEGER :: ierr, msglen
21707 CALL mp_timeset(routinen, handle)
21709#if defined(__parallel)
21711 CALL mpi_gather(msg, msglen, mpi_real, msg_gather, &
21712 msglen, mpi_real, comm%source, comm%handle, ierr)
21713 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
21714 CALL add_perf(perf_id=4, count=1, msg_size=msglen*real_4_size)
21719 CALL mp_timestop(handle)
21720 END SUBROUTINE mp_gather_rm_src
21737 SUBROUTINE mp_gatherv_rv(sendbuf, recvbuf, recvcounts, displs, root, comm)
21739 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21740 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21741 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21742 INTEGER,
INTENT(IN) :: root
21745 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rv'
21748#if defined(__parallel)
21749 INTEGER :: ierr, sendcount
21752 CALL mp_timeset(routinen, handle)
21754#if defined(__parallel)
21755 sendcount =
SIZE(sendbuf)
21756 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21757 recvbuf, recvcounts, displs, mpi_real, &
21758 root, comm%handle, ierr)
21759 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21760 CALL add_perf(perf_id=4, &
21762 msg_size=sendcount*real_4_size)
21764 mark_used(recvcounts)
21767 recvbuf(1 + displs(1):) = sendbuf
21769 CALL mp_timestop(handle)
21770 END SUBROUTINE mp_gatherv_rv
21786 SUBROUTINE mp_gatherv_rv_src(sendbuf, recvbuf, recvcounts, displs, comm)
21788 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21789 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21790 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21793 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rv_src'
21796#if defined(__parallel)
21797 INTEGER :: ierr, sendcount
21800 CALL mp_timeset(routinen, handle)
21802#if defined(__parallel)
21803 sendcount =
SIZE(sendbuf)
21804 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21805 recvbuf, recvcounts, displs, mpi_real, &
21806 comm%source, comm%handle, ierr)
21807 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21808 CALL add_perf(perf_id=4, &
21810 msg_size=sendcount*real_4_size)
21812 mark_used(recvcounts)
21814 recvbuf(1 + displs(1):) = sendbuf
21816 CALL mp_timestop(handle)
21817 END SUBROUTINE mp_gatherv_rv_src
21834 SUBROUTINE mp_gatherv_rm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
21836 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21837 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21838 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21839 INTEGER,
INTENT(IN) :: root
21842 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rm2'
21845#if defined(__parallel)
21846 INTEGER :: ierr, sendcount
21849 CALL mp_timeset(routinen, handle)
21851#if defined(__parallel)
21852 sendcount =
SIZE(sendbuf)
21853 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21854 recvbuf, recvcounts, displs, mpi_real, &
21855 root, comm%handle, ierr)
21856 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21857 CALL add_perf(perf_id=4, &
21859 msg_size=sendcount*real_4_size)
21861 mark_used(recvcounts)
21864 recvbuf(:, 1 + displs(1):) = sendbuf
21866 CALL mp_timestop(handle)
21867 END SUBROUTINE mp_gatherv_rm2
21883 SUBROUTINE mp_gatherv_rm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
21885 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
21886 REAL(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
21887 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21890 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_rm2_src'
21893#if defined(__parallel)
21894 INTEGER :: ierr, sendcount
21897 CALL mp_timeset(routinen, handle)
21899#if defined(__parallel)
21900 sendcount =
SIZE(sendbuf)
21901 CALL mpi_gatherv(sendbuf, sendcount, mpi_real, &
21902 recvbuf, recvcounts, displs, mpi_real, &
21903 comm%source, comm%handle, ierr)
21904 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21905 CALL add_perf(perf_id=4, &
21907 msg_size=sendcount*real_4_size)
21909 mark_used(recvcounts)
21911 recvbuf(:, 1 + displs(1):) = sendbuf
21913 CALL mp_timestop(handle)
21914 END SUBROUTINE mp_gatherv_rm2_src
21931 SUBROUTINE mp_igatherv_rv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
21932 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
21933 REAL(kind=real_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
21934 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
21935 INTEGER,
INTENT(IN) :: sendcount, root
21939 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_rv'
21942#if defined(__parallel)
21946 CALL mp_timeset(routinen, handle)
21948#if defined(__parallel)
21949#if !defined(__GNUC__) || __GNUC__ >= 9
21950 cpassert(is_contiguous(sendbuf) .OR.
SIZE(sendbuf) == 0)
21951 cpassert(is_contiguous(recvbuf) .OR.
SIZE(recvbuf) == 0)
21952 cpassert(is_contiguous(recvcounts) .OR.
SIZE(recvcounts) == 0)
21953 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
21955 CALL mpi_igatherv(sendbuf, sendcount, mpi_real, &
21956 recvbuf, recvcounts, displs, mpi_real, &
21957 root, comm%handle, request%handle, ierr)
21958 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
21959 CALL add_perf(perf_id=24, &
21961 msg_size=sendcount*real_4_size)
21963 mark_used(sendcount)
21964 mark_used(recvcounts)
21967 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
21970 CALL mp_timestop(handle)
21971 END SUBROUTINE mp_igatherv_rv
21984 SUBROUTINE mp_allgather_r (msgout, msgin, comm)
21985 REAL(kind=real_4),
INTENT(IN) :: msgout
21986 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
21989 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r'
21992#if defined(__parallel)
21993 INTEGER :: ierr, rcount, scount
21996 CALL mp_timeset(routinen, handle)
21998#if defined(__parallel)
22001 CALL mpi_allgather(msgout, scount, mpi_real, &
22002 msgin, rcount, mpi_real, &
22004 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
22009 CALL mp_timestop(handle)
22010 END SUBROUTINE mp_allgather_r
22023 SUBROUTINE mp_allgather_r2(msgout, msgin, comm)
22024 REAL(kind=real_4),
INTENT(IN) :: msgout
22025 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
22028 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r2'
22031#if defined(__parallel)
22032 INTEGER :: ierr, rcount, scount
22035 CALL mp_timeset(routinen, handle)
22037#if defined(__parallel)
22040 CALL mpi_allgather(msgout, scount, mpi_real, &
22041 msgin, rcount, mpi_real, &
22043 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
22048 CALL mp_timestop(handle)
22049 END SUBROUTINE mp_allgather_r2
22062 SUBROUTINE mp_iallgather_r (msgout, msgin, comm, request)
22063 REAL(kind=real_4),
INTENT(IN) :: msgout
22064 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
22068 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r'
22071#if defined(__parallel)
22072 INTEGER :: ierr, rcount, scount
22075 CALL mp_timeset(routinen, handle)
22077#if defined(__parallel)
22078#if !defined(__GNUC__) || __GNUC__ >= 9
22079 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
22083 CALL mpi_iallgather(msgout, scount, mpi_real, &
22084 msgin, rcount, mpi_real, &
22085 comm%handle, request%handle, ierr)
22086 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
22092 CALL mp_timestop(handle)
22093 END SUBROUTINE mp_iallgather_r
22108 SUBROUTINE mp_allgather_r12(msgout, msgin, comm)
22109 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
22110 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
22113 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r12'
22116#if defined(__parallel)
22117 INTEGER :: ierr, rcount, scount
22120 CALL mp_timeset(routinen, handle)
22122#if defined(__parallel)
22123 scount =
SIZE(msgout(:))
22125 CALL mpi_allgather(msgout, scount, mpi_real, &
22126 msgin, rcount, mpi_real, &
22128 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
22131 msgin(:, 1) = msgout(:)
22133 CALL mp_timestop(handle)
22134 END SUBROUTINE mp_allgather_r12
22144 SUBROUTINE mp_allgather_r23(msgout, msgin, comm)
22145 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
22146 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
22149 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r23'
22152#if defined(__parallel)
22153 INTEGER :: ierr, rcount, scount
22156 CALL mp_timeset(routinen, handle)
22158#if defined(__parallel)
22159 scount =
SIZE(msgout(:, :))
22161 CALL mpi_allgather(msgout, scount, mpi_real, &
22162 msgin, rcount, mpi_real, &
22164 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
22167 msgin(:, :, 1) = msgout(:, :)
22169 CALL mp_timestop(handle)
22170 END SUBROUTINE mp_allgather_r23
22180 SUBROUTINE mp_allgather_r34(msgout, msgin, comm)
22181 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
22182 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
22185 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r34'
22188#if defined(__parallel)
22189 INTEGER :: ierr, rcount, scount
22192 CALL mp_timeset(routinen, handle)
22194#if defined(__parallel)
22195 scount =
SIZE(msgout(:, :, :))
22197 CALL mpi_allgather(msgout, scount, mpi_real, &
22198 msgin, rcount, mpi_real, &
22200 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
22203 msgin(:, :, :, 1) = msgout(:, :, :)
22205 CALL mp_timestop(handle)
22206 END SUBROUTINE mp_allgather_r34
22216 SUBROUTINE mp_allgather_r22(msgout, msgin, comm)
22217 REAL(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
22218 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
22221 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_r22'
22224#if defined(__parallel)
22225 INTEGER :: ierr, rcount, scount
22228 CALL mp_timeset(routinen, handle)
22230#if defined(__parallel)
22231 scount =
SIZE(msgout(:, :))
22233 CALL mpi_allgather(msgout, scount, mpi_real, &
22234 msgin, rcount, mpi_real, &
22236 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
22239 msgin(:, :) = msgout(:, :)
22241 CALL mp_timestop(handle)
22242 END SUBROUTINE mp_allgather_r22
22253 SUBROUTINE mp_iallgather_r11(msgout, msgin, comm, request)
22254 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
22255 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
22259 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r11'
22262#if defined(__parallel)
22263 INTEGER :: ierr, rcount, scount
22266 CALL mp_timeset(routinen, handle)
22268#if defined(__parallel)
22269#if !defined(__GNUC__) || __GNUC__ >= 9
22270 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
22271 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
22273 scount =
SIZE(msgout(:))
22275 CALL mpi_iallgather(msgout, scount, mpi_real, &
22276 msgin, rcount, mpi_real, &
22277 comm%handle, request%handle, ierr)
22278 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
22284 CALL mp_timestop(handle)
22285 END SUBROUTINE mp_iallgather_r11
22296 SUBROUTINE mp_iallgather_r13(msgout, msgin, comm, request)
22297 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
22298 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
22302 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r13'
22305#if defined(__parallel)
22306 INTEGER :: ierr, rcount, scount
22309 CALL mp_timeset(routinen, handle)
22311#if defined(__parallel)
22312#if !defined(__GNUC__) || __GNUC__ >= 9
22313 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
22314 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
22317 scount =
SIZE(msgout(:))
22319 CALL mpi_iallgather(msgout, scount, mpi_real, &
22320 msgin, rcount, mpi_real, &
22321 comm%handle, request%handle, ierr)
22322 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
22325 msgin(:, 1, 1) = msgout(:)
22328 CALL mp_timestop(handle)
22329 END SUBROUTINE mp_iallgather_r13
22340 SUBROUTINE mp_iallgather_r22(msgout, msgin, comm, request)
22341 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :)
22342 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :)
22346 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r22'
22349#if defined(__parallel)
22350 INTEGER :: ierr, rcount, scount
22353 CALL mp_timeset(routinen, handle)
22355#if defined(__parallel)
22356#if !defined(__GNUC__) || __GNUC__ >= 9
22357 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
22358 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
22361 scount =
SIZE(msgout(:, :))
22363 CALL mpi_iallgather(msgout, scount, mpi_real, &
22364 msgin, rcount, mpi_real, &
22365 comm%handle, request%handle, ierr)
22366 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
22369 msgin(:, :) = msgout(:, :)
22372 CALL mp_timestop(handle)
22373 END SUBROUTINE mp_iallgather_r22
22384 SUBROUTINE mp_iallgather_r24(msgout, msgin, comm, request)
22385 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :)
22386 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :, :)
22390 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r24'
22393#if defined(__parallel)
22394 INTEGER :: ierr, rcount, scount
22397 CALL mp_timeset(routinen, handle)
22399#if defined(__parallel)
22400#if !defined(__GNUC__) || __GNUC__ >= 9
22401 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
22402 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
22405 scount =
SIZE(msgout(:, :))
22407 CALL mpi_iallgather(msgout, scount, mpi_real, &
22408 msgin, rcount, mpi_real, &
22409 comm%handle, request%handle, ierr)
22410 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
22413 msgin(:, :, 1, 1) = msgout(:, :)
22416 CALL mp_timestop(handle)
22417 END SUBROUTINE mp_iallgather_r24
22428 SUBROUTINE mp_iallgather_r33(msgout, msgin, comm, request)
22429 REAL(kind=real_4),
INTENT(IN) :: msgout(:, :, :)
22430 REAL(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
22434 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_r33'
22437#if defined(__parallel)
22438 INTEGER :: ierr, rcount, scount
22441 CALL mp_timeset(routinen, handle)
22443#if defined(__parallel)
22444#if !defined(__GNUC__) || __GNUC__ >= 9
22445 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
22446 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
22449 scount =
SIZE(msgout(:, :, :))
22451 CALL mpi_iallgather(msgout, scount, mpi_real, &
22452 msgin, rcount, mpi_real, &
22453 comm%handle, request%handle, ierr)
22454 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
22457 msgin(:, :, :) = msgout(:, :, :)
22460 CALL mp_timestop(handle)
22461 END SUBROUTINE mp_iallgather_r33
22480 SUBROUTINE mp_allgatherv_rv(msgout, msgin, rcount, rdispl, comm)
22481 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
22482 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22483 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
22486 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_rv'
22489#if defined(__parallel)
22490 INTEGER :: ierr, scount
22493 CALL mp_timeset(routinen, handle)
22495#if defined(__parallel)
22496 scount =
SIZE(msgout)
22497 CALL mpi_allgatherv(msgout, scount, mpi_real, msgin, rcount, &
22498 rdispl, mpi_real, comm%handle, ierr)
22499 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
22506 CALL mp_timestop(handle)
22507 END SUBROUTINE mp_allgatherv_rv
22526 SUBROUTINE mp_allgatherv_rm2(msgout, msgin, rcount, rdispl, comm)
22527 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
22528 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
22529 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
22532 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_rv'
22535#if defined(__parallel)
22536 INTEGER :: ierr, scount
22539 CALL mp_timeset(routinen, handle)
22541#if defined(__parallel)
22542 scount =
SIZE(msgout)
22543 CALL mpi_allgatherv(msgout, scount, mpi_real, msgin, rcount, &
22544 rdispl, mpi_real, comm%handle, ierr)
22545 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
22552 CALL mp_timestop(handle)
22553 END SUBROUTINE mp_allgatherv_rm2
22572 SUBROUTINE mp_iallgatherv_rv(msgout, msgin, rcount, rdispl, comm, request)
22573 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
22574 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
22575 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
22579 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_rv'
22582#if defined(__parallel)
22583 INTEGER :: ierr, scount, rsize
22586 CALL mp_timeset(routinen, handle)
22588#if defined(__parallel)
22589#if !defined(__GNUC__) || __GNUC__ >= 9
22590 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
22591 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
22592 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
22593 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
22596 scount =
SIZE(msgout)
22597 rsize =
SIZE(rcount)
22598 CALL mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, &
22599 rdispl, comm, request, ierr)
22600 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
22608 CALL mp_timestop(handle)
22609 END SUBROUTINE mp_iallgatherv_rv
22628 SUBROUTINE mp_iallgatherv_rv2(msgout, msgin, rcount, rdispl, comm, request)
22629 REAL(kind=real_4),
INTENT(IN) :: msgout(:)
22630 REAL(kind=real_4),
INTENT(OUT) :: msgin(:)
22631 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
22635 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_rv2'
22638#if defined(__parallel)
22639 INTEGER :: ierr, scount, rsize
22642 CALL mp_timeset(routinen, handle)
22644#if defined(__parallel)
22645#if !defined(__GNUC__) || __GNUC__ >= 9
22646 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
22647 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
22648 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
22649 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
22652 scount =
SIZE(msgout)
22653 rsize =
SIZE(rcount)
22654 CALL mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, &
22655 rdispl, comm, request, ierr)
22656 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
22664 CALL mp_timestop(handle)
22665 END SUBROUTINE mp_iallgatherv_rv2
22676#if defined(__parallel)
22677 SUBROUTINE mp_iallgatherv_rv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
22678 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
22679 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22680 INTEGER,
INTENT(IN) :: rsize
22681 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
22684 INTEGER,
INTENT(INOUT) :: ierr
22686 CALL mpi_iallgatherv(msgout, scount, mpi_real, msgin, rcount, &
22687 rdispl, mpi_real, comm%handle, request%handle, ierr)
22689 END SUBROUTINE mp_iallgatherv_rv_internal
22700 SUBROUTINE mp_sum_scatter_rv(msgout, msgin, rcount, comm)
22701 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
22702 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
22703 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
22706 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_rv'
22709#if defined(__parallel)
22713 CALL mp_timeset(routinen, handle)
22715#if defined(__parallel)
22716 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_real, mpi_sum, &
22718 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
22720 CALL add_perf(perf_id=3, count=1, &
22721 msg_size=rcount(1)*2*real_4_size)
22725 msgin = msgout(:, 1)
22727 CALL mp_timestop(handle)
22728 END SUBROUTINE mp_sum_scatter_rv
22739 SUBROUTINE mp_sendrecv_r (msgin, dest, msgout, source, comm, tag)
22740 REAL(kind=real_4),
INTENT(IN) :: msgin
22741 INTEGER,
INTENT(IN) :: dest
22742 REAL(kind=real_4),
INTENT(OUT) :: msgout
22743 INTEGER,
INTENT(IN) :: source
22745 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22747 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_r'
22750#if defined(__parallel)
22751 INTEGER :: ierr, msglen_in, msglen_out, &
22755 CALL mp_timeset(routinen, handle)
22757#if defined(__parallel)
22762 IF (
PRESENT(tag))
THEN
22766 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22767 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22768 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22769 CALL add_perf(perf_id=7, count=1, &
22770 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22778 CALL mp_timestop(handle)
22779 END SUBROUTINE mp_sendrecv_r
22790 SUBROUTINE mp_sendrecv_rv(msgin, dest, msgout, source, comm, tag)
22791 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
22792 INTEGER,
INTENT(IN) :: dest
22793 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
22794 INTEGER,
INTENT(IN) :: source
22796 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22798 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rv'
22801#if defined(__parallel)
22802 INTEGER :: ierr, msglen_in, msglen_out, &
22806 CALL mp_timeset(routinen, handle)
22808#if defined(__parallel)
22809 msglen_in =
SIZE(msgin)
22810 msglen_out =
SIZE(msgout)
22813 IF (
PRESENT(tag))
THEN
22817 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22818 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22819 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22820 CALL add_perf(perf_id=7, count=1, &
22821 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22829 CALL mp_timestop(handle)
22830 END SUBROUTINE mp_sendrecv_rv
22842 SUBROUTINE mp_sendrecv_rm2(msgin, dest, msgout, source, comm, tag)
22843 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
22844 INTEGER,
INTENT(IN) :: dest
22845 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
22846 INTEGER,
INTENT(IN) :: source
22848 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22850 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm2'
22853#if defined(__parallel)
22854 INTEGER :: ierr, msglen_in, msglen_out, &
22858 CALL mp_timeset(routinen, handle)
22860#if defined(__parallel)
22861 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
22862 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
22865 IF (
PRESENT(tag))
THEN
22869 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22870 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22871 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22872 CALL add_perf(perf_id=7, count=1, &
22873 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22881 CALL mp_timestop(handle)
22882 END SUBROUTINE mp_sendrecv_rm2
22893 SUBROUTINE mp_sendrecv_rm3(msgin, dest, msgout, source, comm, tag)
22894 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
22895 INTEGER,
INTENT(IN) :: dest
22896 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
22897 INTEGER,
INTENT(IN) :: source
22899 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22901 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm3'
22904#if defined(__parallel)
22905 INTEGER :: ierr, msglen_in, msglen_out, &
22909 CALL mp_timeset(routinen, handle)
22911#if defined(__parallel)
22912 msglen_in =
SIZE(msgin)
22913 msglen_out =
SIZE(msgout)
22916 IF (
PRESENT(tag))
THEN
22920 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22921 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22922 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22923 CALL add_perf(perf_id=7, count=1, &
22924 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22932 CALL mp_timestop(handle)
22933 END SUBROUTINE mp_sendrecv_rm3
22944 SUBROUTINE mp_sendrecv_rm4(msgin, dest, msgout, source, comm, tag)
22945 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
22946 INTEGER,
INTENT(IN) :: dest
22947 REAL(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
22948 INTEGER,
INTENT(IN) :: source
22950 INTEGER,
INTENT(IN),
OPTIONAL :: tag
22952 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_rm4'
22955#if defined(__parallel)
22956 INTEGER :: ierr, msglen_in, msglen_out, &
22960 CALL mp_timeset(routinen, handle)
22962#if defined(__parallel)
22963 msglen_in =
SIZE(msgin)
22964 msglen_out =
SIZE(msgout)
22967 IF (
PRESENT(tag))
THEN
22971 CALL mpi_sendrecv(msgin, msglen_in, mpi_real, dest, send_tag, msgout, &
22972 msglen_out, mpi_real, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
22973 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
22974 CALL add_perf(perf_id=7, count=1, &
22975 msg_size=(msglen_in + msglen_out)*real_4_size/2)
22983 CALL mp_timestop(handle)
22984 END SUBROUTINE mp_sendrecv_rm4
23001 SUBROUTINE mp_isendrecv_r (msgin, dest, msgout, source, comm, send_request, &
23003 REAL(kind=real_4),
INTENT(IN) :: msgin
23004 INTEGER,
INTENT(IN) :: dest
23005 REAL(kind=real_4),
INTENT(INOUT) :: msgout
23006 INTEGER,
INTENT(IN) :: source
23009 INTEGER,
INTENT(in),
OPTIONAL :: tag
23011 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_r'
23014#if defined(__parallel)
23015 INTEGER :: ierr, my_tag
23018 CALL mp_timeset(routinen, handle)
23020#if defined(__parallel)
23022 IF (
PRESENT(tag)) my_tag = tag
23024 CALL mpi_irecv(msgout, 1, mpi_real, source, my_tag, &
23025 comm%handle, recv_request%handle, ierr)
23026 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
23028 CALL mpi_isend(msgin, 1, mpi_real, dest, my_tag, &
23029 comm%handle, send_request%handle, ierr)
23030 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
23032 CALL add_perf(perf_id=8, count=1, msg_size=2*real_4_size)
23042 CALL mp_timestop(handle)
23043 END SUBROUTINE mp_isendrecv_r
23062 SUBROUTINE mp_isendrecv_rv(msgin, dest, msgout, source, comm, send_request, &
23064 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
23065 INTEGER,
INTENT(IN) :: dest
23066 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
23067 INTEGER,
INTENT(IN) :: source
23070 INTEGER,
INTENT(in),
OPTIONAL :: tag
23072 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_rv'
23075#if defined(__parallel)
23076 INTEGER :: ierr, msglen, my_tag
23077 REAL(kind=real_4) :: foo
23080 CALL mp_timeset(routinen, handle)
23082#if defined(__parallel)
23083#if !defined(__GNUC__) || __GNUC__ >= 9
23084 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
23085 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
23089 IF (
PRESENT(tag)) my_tag = tag
23091 msglen =
SIZE(msgout, 1)
23092 IF (msglen > 0)
THEN
23093 CALL mpi_irecv(msgout(1), msglen, mpi_real, source, my_tag, &
23094 comm%handle, recv_request%handle, ierr)
23096 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23097 comm%handle, recv_request%handle, ierr)
23099 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
23101 msglen =
SIZE(msgin, 1)
23102 IF (msglen > 0)
THEN
23103 CALL mpi_isend(msgin(1), msglen, mpi_real, dest, my_tag, &
23104 comm%handle, send_request%handle, ierr)
23106 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
23107 comm%handle, send_request%handle, ierr)
23109 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
23111 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
23112 CALL add_perf(perf_id=8, count=1, msg_size=msglen*real_4_size)
23122 CALL mp_timestop(handle)
23123 END SUBROUTINE mp_isendrecv_rv
23138 SUBROUTINE mp_isend_rv(msgin, dest, comm, request, tag)
23139 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
23140 INTEGER,
INTENT(IN) :: dest
23143 INTEGER,
INTENT(in),
OPTIONAL :: tag
23145 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rv'
23147 INTEGER :: handle, ierr
23148#if defined(__parallel)
23149 INTEGER :: msglen, my_tag
23150 REAL(kind=real_4) :: foo(1)
23153 CALL mp_timeset(routinen, handle)
23155#if defined(__parallel)
23156#if !defined(__GNUC__) || __GNUC__ >= 9
23157 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
23160 IF (
PRESENT(tag)) my_tag = tag
23162 msglen =
SIZE(msgin)
23163 IF (msglen > 0)
THEN
23164 CALL mpi_isend(msgin(1), msglen, mpi_real, dest, my_tag, &
23165 comm%handle, request%handle, ierr)
23167 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
23168 comm%handle, request%handle, ierr)
23170 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
23172 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
23181 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
23183 CALL mp_timestop(handle)
23184 END SUBROUTINE mp_isend_rv
23201 SUBROUTINE mp_isend_rm2(msgin, dest, comm, request, tag)
23202 REAL(kind=real_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
23203 INTEGER,
INTENT(IN) :: dest
23206 INTEGER,
INTENT(in),
OPTIONAL :: tag
23208 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm2'
23210 INTEGER :: handle, ierr
23211#if defined(__parallel)
23212 INTEGER :: msglen, my_tag
23213 REAL(kind=real_4) :: foo(1)
23216 CALL mp_timeset(routinen, handle)
23218#if defined(__parallel)
23219#if !defined(__GNUC__) || __GNUC__ >= 9
23220 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
23224 IF (
PRESENT(tag)) my_tag = tag
23226 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
23227 IF (msglen > 0)
THEN
23228 CALL mpi_isend(msgin(1, 1), msglen, mpi_real, dest, my_tag, &
23229 comm%handle, request%handle, ierr)
23231 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
23232 comm%handle, request%handle, ierr)
23234 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
23236 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
23245 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
23247 CALL mp_timestop(handle)
23248 END SUBROUTINE mp_isend_rm2
23267 SUBROUTINE mp_isend_rm3(msgin, dest, comm, request, tag)
23268 REAL(kind=real_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
23269 INTEGER,
INTENT(IN) :: dest
23272 INTEGER,
INTENT(in),
OPTIONAL :: tag
23274 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm3'
23276 INTEGER :: handle, ierr
23277#if defined(__parallel)
23278 INTEGER :: msglen, my_tag
23279 REAL(kind=real_4) :: foo(1)
23282 CALL mp_timeset(routinen, handle)
23284#if defined(__parallel)
23285#if !defined(__GNUC__) || __GNUC__ >= 9
23286 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
23290 IF (
PRESENT(tag)) my_tag = tag
23292 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
23293 IF (msglen > 0)
THEN
23294 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_real, dest, my_tag, &
23295 comm%handle, request%handle, ierr)
23297 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
23298 comm%handle, request%handle, ierr)
23300 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
23302 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
23311 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
23313 CALL mp_timestop(handle)
23314 END SUBROUTINE mp_isend_rm3
23330 SUBROUTINE mp_isend_rm4(msgin, dest, comm, request, tag)
23331 REAL(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
23332 INTEGER,
INTENT(IN) :: dest
23335 INTEGER,
INTENT(in),
OPTIONAL :: tag
23337 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_rm4'
23339 INTEGER :: handle, ierr
23340#if defined(__parallel)
23341 INTEGER :: msglen, my_tag
23342 REAL(kind=real_4) :: foo(1)
23345 CALL mp_timeset(routinen, handle)
23347#if defined(__parallel)
23348#if !defined(__GNUC__) || __GNUC__ >= 9
23349 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
23353 IF (
PRESENT(tag)) my_tag = tag
23355 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
23356 IF (msglen > 0)
THEN
23357 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_real, dest, my_tag, &
23358 comm%handle, request%handle, ierr)
23360 CALL mpi_isend(foo, msglen, mpi_real, dest, my_tag, &
23361 comm%handle, request%handle, ierr)
23363 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
23365 CALL add_perf(perf_id=11, count=1, msg_size=msglen*real_4_size)
23374 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
23376 CALL mp_timestop(handle)
23377 END SUBROUTINE mp_isend_rm4
23393 SUBROUTINE mp_irecv_rv(msgout, source, comm, request, tag)
23394 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
23395 INTEGER,
INTENT(IN) :: source
23398 INTEGER,
INTENT(in),
OPTIONAL :: tag
23400 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rv'
23403#if defined(__parallel)
23404 INTEGER :: ierr, msglen, my_tag
23405 REAL(kind=real_4) :: foo(1)
23408 CALL mp_timeset(routinen, handle)
23410#if defined(__parallel)
23411#if !defined(__GNUC__) || __GNUC__ >= 9
23412 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
23416 IF (
PRESENT(tag)) my_tag = tag
23418 msglen =
SIZE(msgout)
23419 IF (msglen > 0)
THEN
23420 CALL mpi_irecv(msgout(1), msglen, mpi_real, source, my_tag, &
23421 comm%handle, request%handle, ierr)
23423 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23424 comm%handle, request%handle, ierr)
23426 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
23428 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23430 cpabort(
"mp_irecv called in non parallel case")
23437 CALL mp_timestop(handle)
23438 END SUBROUTINE mp_irecv_rv
23455 SUBROUTINE mp_irecv_rm2(msgout, source, comm, request, tag)
23456 REAL(kind=real_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
23457 INTEGER,
INTENT(IN) :: source
23460 INTEGER,
INTENT(in),
OPTIONAL :: tag
23462 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm2'
23465#if defined(__parallel)
23466 INTEGER :: ierr, msglen, my_tag
23467 REAL(kind=real_4) :: foo(1)
23470 CALL mp_timeset(routinen, handle)
23472#if defined(__parallel)
23473#if !defined(__GNUC__) || __GNUC__ >= 9
23474 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
23478 IF (
PRESENT(tag)) my_tag = tag
23480 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
23481 IF (msglen > 0)
THEN
23482 CALL mpi_irecv(msgout(1, 1), msglen, mpi_real, source, my_tag, &
23483 comm%handle, request%handle, ierr)
23485 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23486 comm%handle, request%handle, ierr)
23488 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
23490 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23497 cpabort(
"mp_irecv called in non parallel case")
23499 CALL mp_timestop(handle)
23500 END SUBROUTINE mp_irecv_rm2
23518 SUBROUTINE mp_irecv_rm3(msgout, source, comm, request, tag)
23519 REAL(kind=real_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
23520 INTEGER,
INTENT(IN) :: source
23523 INTEGER,
INTENT(in),
OPTIONAL :: tag
23525 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm3'
23528#if defined(__parallel)
23529 INTEGER :: ierr, msglen, my_tag
23530 REAL(kind=real_4) :: foo(1)
23533 CALL mp_timeset(routinen, handle)
23535#if defined(__parallel)
23536#if !defined(__GNUC__) || __GNUC__ >= 9
23537 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
23541 IF (
PRESENT(tag)) my_tag = tag
23543 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
23544 IF (msglen > 0)
THEN
23545 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_real, source, my_tag, &
23546 comm%handle, request%handle, ierr)
23548 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23549 comm%handle, request%handle, ierr)
23551 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
23553 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23560 cpabort(
"mp_irecv called in non parallel case")
23562 CALL mp_timestop(handle)
23563 END SUBROUTINE mp_irecv_rm3
23579 SUBROUTINE mp_irecv_rm4(msgout, source, comm, request, tag)
23580 REAL(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
23581 INTEGER,
INTENT(IN) :: source
23584 INTEGER,
INTENT(in),
OPTIONAL :: tag
23586 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_rm4'
23589#if defined(__parallel)
23590 INTEGER :: ierr, msglen, my_tag
23591 REAL(kind=real_4) :: foo(1)
23594 CALL mp_timeset(routinen, handle)
23596#if defined(__parallel)
23597#if !defined(__GNUC__) || __GNUC__ >= 9
23598 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
23602 IF (
PRESENT(tag)) my_tag = tag
23604 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
23605 IF (msglen > 0)
THEN
23606 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_real, source, my_tag, &
23607 comm%handle, request%handle, ierr)
23609 CALL mpi_irecv(foo, msglen, mpi_real, source, my_tag, &
23610 comm%handle, request%handle, ierr)
23612 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
23614 CALL add_perf(perf_id=12, count=1, msg_size=msglen*real_4_size)
23621 cpabort(
"mp_irecv called in non parallel case")
23623 CALL mp_timestop(handle)
23624 END SUBROUTINE mp_irecv_rm4
23636 SUBROUTINE mp_win_create_rv(base, comm, win)
23637 REAL(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
23641 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_rv'
23644#if defined(__parallel)
23646 INTEGER(kind=mpi_address_kind) :: len
23647 REAL(kind=real_4) :: foo(1)
23650 CALL mp_timeset(routinen, handle)
23652#if defined(__parallel)
23654 len =
SIZE(base)*real_4_size
23656 CALL mpi_win_create(base(1), len, real_4_size, mpi_info_null, comm%handle, win%handle, ierr)
23658 CALL mpi_win_create(foo, len, real_4_size, mpi_info_null, comm%handle, win%handle, ierr)
23660 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
23662 CALL add_perf(perf_id=20, count=1)
23666 win%handle = mp_win_null_handle
23668 CALL mp_timestop(handle)
23669 END SUBROUTINE mp_win_create_rv
23681 SUBROUTINE mp_rget_rv(base, source, win, win_data, myproc, disp, request, &
23682 origin_datatype, target_datatype)
23683 REAL(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
23684 INTEGER,
INTENT(IN) :: source
23686 REAL(kind=real_4),
DIMENSION(:),
INTENT(IN) :: win_data
23687 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
23691 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_rv'
23694#if defined(__parallel)
23695 INTEGER :: ierr, len, &
23696 origin_len, target_len
23697 LOGICAL :: do_local_copy
23698 INTEGER(kind=mpi_address_kind) :: disp_aint
23699 mpi_data_type :: handle_origin_datatype, handle_target_datatype
23702 CALL mp_timeset(routinen, handle)
23704#if defined(__parallel)
23707 IF (
PRESENT(disp))
THEN
23708 disp_aint = int(disp, kind=mpi_address_kind)
23710 handle_origin_datatype = mpi_real
23712 IF (
PRESENT(origin_datatype))
THEN
23713 handle_origin_datatype = origin_datatype%type_handle
23716 handle_target_datatype = mpi_real
23718 IF (
PRESENT(target_datatype))
THEN
23719 handle_target_datatype = target_datatype%type_handle
23723 do_local_copy = .false.
23724 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
23725 IF (myproc .EQ. source) do_local_copy = .true.
23727 IF (do_local_copy)
THEN
23729 base(:) = win_data(disp_aint + 1:disp_aint + len)
23734 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
23735 target_len, handle_target_datatype, win%handle, request%handle, ierr)
23741 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
23743 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*real_4_size)
23748 mark_used(origin_datatype)
23749 mark_used(target_datatype)
23753 IF (
PRESENT(disp))
THEN
23754 base(:) = win_data(disp + 1:disp +
SIZE(base))
23756 base(:) = win_data(:
SIZE(base))
23760 CALL mp_timestop(handle)
23761 END SUBROUTINE mp_rget_rv
23771 result(type_descriptor)
23772 INTEGER,
INTENT(IN) :: count
23773 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
23776 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_r'
23779#if defined(__parallel)
23783 CALL mp_timeset(routinen, handle)
23785#if defined(__parallel)
23786 CALL mpi_type_indexed(count, lengths, displs, mpi_real, &
23787 type_descriptor%type_handle, ierr)
23789 cpabort(
"MPI_Type_Indexed @ "//routinen)
23790 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
23792 cpabort(
"MPI_Type_commit @ "//routinen)
23794 type_descriptor%type_handle = 1
23796 type_descriptor%length = count
23797 NULLIFY (type_descriptor%subtype)
23798 type_descriptor%vector_descriptor(1:2) = 1
23799 type_descriptor%has_indexing = .true.
23800 type_descriptor%index_descriptor%index => lengths
23801 type_descriptor%index_descriptor%chunks => displs
23803 CALL mp_timestop(handle)
23814 SUBROUTINE mp_allocate_r (DATA, len, stat)
23815 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23816 INTEGER,
INTENT(IN) :: len
23817 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23819 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_r'
23821 INTEGER :: handle, ierr
23823 CALL mp_timeset(routinen, handle)
23825#if defined(__parallel)
23827 CALL mp_alloc_mem(
DATA, len, stat=ierr)
23828 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
23829 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
23830 CALL add_perf(perf_id=15, count=1)
23832 ALLOCATE (
DATA(len), stat=ierr)
23833 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
23834 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
23836 IF (
PRESENT(stat)) stat = ierr
23837 CALL mp_timestop(handle)
23838 END SUBROUTINE mp_allocate_r
23846 SUBROUTINE mp_deallocate_r (DATA, stat)
23847 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
23848 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
23850 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_r'
23853#if defined(__parallel)
23857 CALL mp_timeset(routinen, handle)
23859#if defined(__parallel)
23860 CALL mp_free_mem(
DATA, ierr)
23861 IF (
PRESENT(stat))
THEN
23864 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
23867 CALL add_perf(perf_id=15, count=1)
23870 IF (
PRESENT(stat)) stat = 0
23872 CALL mp_timestop(handle)
23873 END SUBROUTINE mp_deallocate_r
23886 SUBROUTINE mp_file_write_at_rv(fh, offset, msg, msglen)
23887 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
23889 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23890 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23893#if defined(__parallel)
23897 msg_len =
SIZE(msg)
23898 IF (
PRESENT(msglen)) msg_len = msglen
23899#if defined(__parallel)
23900 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23902 cpabort(
"mpi_file_write_at_rv @ mp_file_write_at_rv")
23904 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23906 END SUBROUTINE mp_file_write_at_rv
23914 SUBROUTINE mp_file_write_at_r (fh, offset, msg)
23915 REAL(kind=real_4),
INTENT(IN) :: msg
23917 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23919#if defined(__parallel)
23923 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23925 cpabort(
"mpi_file_write_at_r @ mp_file_write_at_r")
23927 WRITE (unit=fh%handle, pos=offset + 1) msg
23929 END SUBROUTINE mp_file_write_at_r
23941 SUBROUTINE mp_file_write_at_all_rv(fh, offset, msg, msglen)
23942 REAL(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
23944 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
23945 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23948#if defined(__parallel)
23952 msg_len =
SIZE(msg)
23953 IF (
PRESENT(msglen)) msg_len = msglen
23954#if defined(__parallel)
23955 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
23957 cpabort(
"mpi_file_write_at_all_rv @ mp_file_write_at_all_rv")
23959 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
23961 END SUBROUTINE mp_file_write_at_all_rv
23969 SUBROUTINE mp_file_write_at_all_r (fh, offset, msg)
23970 REAL(kind=real_4),
INTENT(IN) :: msg
23972 INTEGER(kind=file_offset),
INTENT(IN) :: offset
23974#if defined(__parallel)
23978 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
23980 cpabort(
"mpi_file_write_at_all_r @ mp_file_write_at_all_r")
23982 WRITE (unit=fh%handle, pos=offset + 1) msg
23984 END SUBROUTINE mp_file_write_at_all_r
23997 SUBROUTINE mp_file_read_at_rv(fh, offset, msg, msglen)
23998 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
24000 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
24001 INTEGER(kind=file_offset),
INTENT(IN) :: offset
24004#if defined(__parallel)
24008 msg_len =
SIZE(msg)
24009 IF (
PRESENT(msglen)) msg_len = msglen
24010#if defined(__parallel)
24011 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
24013 cpabort(
"mpi_file_read_at_rv @ mp_file_read_at_rv")
24015 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
24017 END SUBROUTINE mp_file_read_at_rv
24025 SUBROUTINE mp_file_read_at_r (fh, offset, msg)
24026 REAL(kind=real_4),
INTENT(OUT) :: msg
24028 INTEGER(kind=file_offset),
INTENT(IN) :: offset
24030#if defined(__parallel)
24034 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
24036 cpabort(
"mpi_file_read_at_r @ mp_file_read_at_r")
24038 READ (unit=fh%handle, pos=offset + 1) msg
24040 END SUBROUTINE mp_file_read_at_r
24052 SUBROUTINE mp_file_read_at_all_rv(fh, offset, msg, msglen)
24053 REAL(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
24055 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
24056 INTEGER(kind=file_offset),
INTENT(IN) :: offset
24059#if defined(__parallel)
24063 msg_len =
SIZE(msg)
24064 IF (
PRESENT(msglen)) msg_len = msglen
24065#if defined(__parallel)
24066 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_real, mpi_status_ignore, ierr)
24068 cpabort(
"mpi_file_read_at_all_rv @ mp_file_read_at_all_rv")
24070 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
24072 END SUBROUTINE mp_file_read_at_all_rv
24080 SUBROUTINE mp_file_read_at_all_r (fh, offset, msg)
24081 REAL(kind=real_4),
INTENT(OUT) :: msg
24083 INTEGER(kind=file_offset),
INTENT(IN) :: offset
24085#if defined(__parallel)
24089 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_real, mpi_status_ignore, ierr)
24091 cpabort(
"mpi_file_read_at_all_r @ mp_file_read_at_all_r")
24093 READ (unit=fh%handle, pos=offset + 1) msg
24095 END SUBROUTINE mp_file_read_at_all_r
24104 FUNCTION mp_type_make_r (ptr, &
24105 vector_descriptor, index_descriptor) &
24106 result(type_descriptor)
24107 REAL(kind=real_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
24108 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
24109 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
24112 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_r'
24114#if defined(__parallel)
24116#if defined(__MPI_F08)
24118 EXTERNAL :: mpi_get_address
24122 NULLIFY (type_descriptor%subtype)
24123 type_descriptor%length =
SIZE(ptr)
24124#if defined(__parallel)
24125 type_descriptor%type_handle = mpi_real
24126 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
24128 cpabort(
"MPI_Get_address @ "//routinen)
24130 type_descriptor%type_handle = 1
24132 type_descriptor%vector_descriptor(1:2) = 1
24133 type_descriptor%has_indexing = .false.
24134 type_descriptor%data_r => ptr
24135 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
24136 cpabort(routinen//
": Vectors and indices NYI")
24138 END FUNCTION mp_type_make_r
24147 SUBROUTINE mp_alloc_mem_r (DATA, len, stat)
24148 REAL(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER ::
DATA
24149 INTEGER,
INTENT(IN) :: len
24150 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
24152#if defined(__parallel)
24153 INTEGER :: size, ierr, length, &
24155 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
24156 TYPE(c_ptr) :: mp_baseptr
24157 mpi_info_type :: mp_info
24159 length = max(len, 1)
24160 CALL mpi_type_size(mpi_real,
size, ierr)
24161 mp_size = int(length, kind=mpi_address_kind)*
size
24162 IF (mp_size .GT. mp_max_memory_size)
THEN
24163 cpabort(
"MPI cannot allocate more than 2 GiByte")
24165 mp_info = mpi_info_null
24166 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
24167 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
24168 IF (
PRESENT(stat)) stat = mp_res
24170 INTEGER :: length, mystat
24171 length = max(len, 1)
24172 IF (
PRESENT(stat))
THEN
24173 ALLOCATE (
DATA(length), stat=mystat)
24176 ALLOCATE (
DATA(length))
24179 END SUBROUTINE mp_alloc_mem_r
24187 SUBROUTINE mp_free_mem_r (DATA, stat)
24188 REAL(kind=real_4),
DIMENSION(:), &
24189 POINTER, asynchronous ::
DATA
24190 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
24192#if defined(__parallel)
24194 CALL mpi_free_mem(
DATA, mp_res)
24195 IF (
PRESENT(stat)) stat = mp_res
24198 IF (
PRESENT(stat)) stat = 0
24200 END SUBROUTINE mp_free_mem_r
24212 SUBROUTINE mp_shift_zm(msg, comm, displ_in)
24214 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
24216 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
24218 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_zm'
24220 INTEGER :: handle, ierror
24221#if defined(__parallel)
24222 INTEGER :: displ, left, &
24223 msglen, myrank, nprocs, &
24228 CALL mp_timeset(routinen, handle)
24230#if defined(__parallel)
24231 CALL mpi_comm_rank(comm%handle, myrank, ierror)
24232 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
24233 CALL mpi_comm_size(comm%handle, nprocs, ierror)
24234 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
24235 IF (
PRESENT(displ_in))
THEN
24240 right =
modulo(myrank + displ, nprocs)
24241 left =
modulo(myrank - displ, nprocs)
24244 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_complex, right, tag, left, tag, &
24245 comm%handle, mpi_status_ignore, ierror)
24246 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
24247 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_8_size))
24251 mark_used(displ_in)
24253 CALL mp_timestop(handle)
24255 END SUBROUTINE mp_shift_zm
24268 SUBROUTINE mp_shift_z (msg, comm, displ_in)
24270 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24272 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
24274 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_z'
24276 INTEGER :: handle, ierror
24277#if defined(__parallel)
24278 INTEGER :: displ, left, &
24279 msglen, myrank, nprocs, &
24284 CALL mp_timeset(routinen, handle)
24286#if defined(__parallel)
24287 CALL mpi_comm_rank(comm%handle, myrank, ierror)
24288 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
24289 CALL mpi_comm_size(comm%handle, nprocs, ierror)
24290 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
24291 IF (
PRESENT(displ_in))
THEN
24296 right =
modulo(myrank + displ, nprocs)
24297 left =
modulo(myrank - displ, nprocs)
24300 CALL mpi_sendrecv_replace(msg, msglen, mpi_double_complex, right, tag, left, &
24301 tag, comm%handle, mpi_status_ignore, ierror)
24302 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
24303 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_8_size))
24307 mark_used(displ_in)
24309 CALL mp_timestop(handle)
24311 END SUBROUTINE mp_shift_z
24332 SUBROUTINE mp_alltoall_z11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
24334 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
24335 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
24336 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
24337 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
24340 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z11v'
24343#if defined(__parallel)
24344 INTEGER :: ierr, msglen
24349 CALL mp_timeset(routinen, handle)
24351#if defined(__parallel)
24352 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_complex, &
24353 rb, rcount, rdispl, mpi_double_complex, comm%handle, ierr)
24354 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
24355 msglen = sum(scount) + sum(rcount)
24356 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24362 DO i = 1, rcount(1)
24363 rb(rdispl(1) + i) = sb(sdispl(1) + i)
24366 CALL mp_timestop(handle)
24368 END SUBROUTINE mp_alltoall_z11v
24383 SUBROUTINE mp_alltoall_z22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
24385 COMPLEX(kind=real_8),
DIMENSION(:, :), &
24386 INTENT(IN),
CONTIGUOUS :: sb
24387 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
24388 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS, &
24389 INTENT(INOUT) :: rb
24390 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
24393 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z22v'
24396#if defined(__parallel)
24397 INTEGER :: ierr, msglen
24400 CALL mp_timeset(routinen, handle)
24402#if defined(__parallel)
24403 CALL mpi_alltoallv(sb, scount, sdispl, mpi_double_complex, &
24404 rb, rcount, rdispl, mpi_double_complex, comm%handle, ierr)
24405 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
24406 msglen = sum(scount) + sum(rcount)
24407 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*(2*real_8_size))
24416 CALL mp_timestop(handle)
24418 END SUBROUTINE mp_alltoall_z22v
24435 SUBROUTINE mp_alltoall_z (sb, rb, count, comm)
24437 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
24438 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
24439 INTEGER,
INTENT(IN) :: count
24442 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z'
24445#if defined(__parallel)
24446 INTEGER :: ierr, msglen, np
24449 CALL mp_timeset(routinen, handle)
24451#if defined(__parallel)
24452 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24453 rb, count, mpi_double_complex, comm%handle, ierr)
24454 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24455 CALL mpi_comm_size(comm%handle, np, ierr)
24456 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24457 msglen = 2*count*np
24458 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24464 CALL mp_timestop(handle)
24466 END SUBROUTINE mp_alltoall_z
24476 SUBROUTINE mp_alltoall_z22(sb, rb, count, comm)
24478 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
24479 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
24480 INTEGER,
INTENT(IN) :: count
24483 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z22'
24486#if defined(__parallel)
24487 INTEGER :: ierr, msglen, np
24490 CALL mp_timeset(routinen, handle)
24492#if defined(__parallel)
24493 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24494 rb, count, mpi_double_complex, comm%handle, ierr)
24495 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24496 CALL mpi_comm_size(comm%handle, np, ierr)
24497 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24498 msglen = 2*
SIZE(sb)*np
24499 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24505 CALL mp_timestop(handle)
24507 END SUBROUTINE mp_alltoall_z22
24517 SUBROUTINE mp_alltoall_z33(sb, rb, count, comm)
24519 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
24520 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
24521 INTEGER,
INTENT(IN) :: count
24524 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z33'
24527#if defined(__parallel)
24528 INTEGER :: ierr, msglen, np
24531 CALL mp_timeset(routinen, handle)
24533#if defined(__parallel)
24534 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24535 rb, count, mpi_double_complex, comm%handle, ierr)
24536 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24537 CALL mpi_comm_size(comm%handle, np, ierr)
24538 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24539 msglen = 2*count*np
24540 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24546 CALL mp_timestop(handle)
24548 END SUBROUTINE mp_alltoall_z33
24558 SUBROUTINE mp_alltoall_z44(sb, rb, count, comm)
24560 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24562 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24564 INTEGER,
INTENT(IN) :: count
24567 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z44'
24570#if defined(__parallel)
24571 INTEGER :: ierr, msglen, np
24574 CALL mp_timeset(routinen, handle)
24576#if defined(__parallel)
24577 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24578 rb, count, mpi_double_complex, comm%handle, ierr)
24579 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24580 CALL mpi_comm_size(comm%handle, np, ierr)
24581 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24582 msglen = 2*count*np
24583 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24589 CALL mp_timestop(handle)
24591 END SUBROUTINE mp_alltoall_z44
24601 SUBROUTINE mp_alltoall_z55(sb, rb, count, comm)
24603 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
24605 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
24607 INTEGER,
INTENT(IN) :: count
24610 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z55'
24613#if defined(__parallel)
24614 INTEGER :: ierr, msglen, np
24617 CALL mp_timeset(routinen, handle)
24619#if defined(__parallel)
24620 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24621 rb, count, mpi_double_complex, comm%handle, ierr)
24622 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24623 CALL mpi_comm_size(comm%handle, np, ierr)
24624 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24625 msglen = 2*count*np
24626 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24632 CALL mp_timestop(handle)
24634 END SUBROUTINE mp_alltoall_z55
24645 SUBROUTINE mp_alltoall_z45(sb, rb, count, comm)
24647 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24649 COMPLEX(kind=real_8), &
24650 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
24651 INTEGER,
INTENT(IN) :: count
24654 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z45'
24657#if defined(__parallel)
24658 INTEGER :: ierr, msglen, np
24661 CALL mp_timeset(routinen, handle)
24663#if defined(__parallel)
24664 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24665 rb, count, mpi_double_complex, comm%handle, ierr)
24666 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24667 CALL mpi_comm_size(comm%handle, np, ierr)
24668 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24669 msglen = 2*count*np
24670 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24674 rb = reshape(sb, shape(rb))
24676 CALL mp_timestop(handle)
24678 END SUBROUTINE mp_alltoall_z45
24689 SUBROUTINE mp_alltoall_z34(sb, rb, count, comm)
24691 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
CONTIGUOUS, &
24693 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24695 INTEGER,
INTENT(IN) :: count
24698 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z34'
24701#if defined(__parallel)
24702 INTEGER :: ierr, msglen, np
24705 CALL mp_timeset(routinen, handle)
24707#if defined(__parallel)
24708 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24709 rb, count, mpi_double_complex, comm%handle, ierr)
24710 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24711 CALL mpi_comm_size(comm%handle, np, ierr)
24712 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24713 msglen = 2*count*np
24714 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24718 rb = reshape(sb, shape(rb))
24720 CALL mp_timestop(handle)
24722 END SUBROUTINE mp_alltoall_z34
24733 SUBROUTINE mp_alltoall_z54(sb, rb, count, comm)
24735 COMPLEX(kind=real_8), &
24736 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
24737 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
24739 INTEGER,
INTENT(IN) :: count
24742 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_z54'
24745#if defined(__parallel)
24746 INTEGER :: ierr, msglen, np
24749 CALL mp_timeset(routinen, handle)
24751#if defined(__parallel)
24752 CALL mpi_alltoall(sb, count, mpi_double_complex, &
24753 rb, count, mpi_double_complex, comm%handle, ierr)
24754 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
24755 CALL mpi_comm_size(comm%handle, np, ierr)
24756 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
24757 msglen = 2*count*np
24758 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_8_size))
24762 rb = reshape(sb, shape(rb))
24764 CALL mp_timestop(handle)
24766 END SUBROUTINE mp_alltoall_z54
24777 SUBROUTINE mp_send_z (msg, dest, tag, comm)
24778 COMPLEX(kind=real_8),
INTENT(IN) :: msg
24779 INTEGER,
INTENT(IN) :: dest, tag
24782 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_z'
24785#if defined(__parallel)
24786 INTEGER :: ierr, msglen
24789 CALL mp_timeset(routinen, handle)
24791#if defined(__parallel)
24793 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24794 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24795 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24802 cpabort(
"not in parallel mode")
24804 CALL mp_timestop(handle)
24805 END SUBROUTINE mp_send_z
24815 SUBROUTINE mp_send_zv(msg, dest, tag, comm)
24816 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
24817 INTEGER,
INTENT(IN) :: dest, tag
24820 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_zv'
24823#if defined(__parallel)
24824 INTEGER :: ierr, msglen
24827 CALL mp_timeset(routinen, handle)
24829#if defined(__parallel)
24831 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24832 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24833 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24840 cpabort(
"not in parallel mode")
24842 CALL mp_timestop(handle)
24843 END SUBROUTINE mp_send_zv
24853 SUBROUTINE mp_send_zm2(msg, dest, tag, comm)
24854 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
24855 INTEGER,
INTENT(IN) :: dest, tag
24858 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_zm2'
24861#if defined(__parallel)
24862 INTEGER :: ierr, msglen
24865 CALL mp_timeset(routinen, handle)
24867#if defined(__parallel)
24869 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24870 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24871 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24878 cpabort(
"not in parallel mode")
24880 CALL mp_timestop(handle)
24881 END SUBROUTINE mp_send_zm2
24891 SUBROUTINE mp_send_zm3(msg, dest, tag, comm)
24892 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
24893 INTEGER,
INTENT(IN) :: dest, tag
24896 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
24899#if defined(__parallel)
24900 INTEGER :: ierr, msglen
24903 CALL mp_timeset(routinen, handle)
24905#if defined(__parallel)
24907 CALL mpi_send(msg, msglen, mpi_double_complex, dest, tag, comm%handle, ierr)
24908 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
24909 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_8_size))
24916 cpabort(
"not in parallel mode")
24918 CALL mp_timestop(handle)
24919 END SUBROUTINE mp_send_zm3
24930 SUBROUTINE mp_recv_z (msg, source, tag, comm)
24931 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
24932 INTEGER,
INTENT(INOUT) :: source, tag
24935 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_z'
24938#if defined(__parallel)
24939 INTEGER :: ierr, msglen
24940 mpi_status_type :: status
24943 CALL mp_timeset(routinen, handle)
24945#if defined(__parallel)
24948 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24949 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24951 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24952 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24953 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
24954 source = status mpi_status_extract(mpi_source)
24955 tag = status mpi_status_extract(mpi_tag)
24963 cpabort(
"not in parallel mode")
24965 CALL mp_timestop(handle)
24966 END SUBROUTINE mp_recv_z
24976 SUBROUTINE mp_recv_zv(msg, source, tag, comm)
24977 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
24978 INTEGER,
INTENT(INOUT) :: source, tag
24981 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zv'
24984#if defined(__parallel)
24985 INTEGER :: ierr, msglen
24986 mpi_status_type :: status
24989 CALL mp_timeset(routinen, handle)
24991#if defined(__parallel)
24994 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
24995 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24997 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
24998 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
24999 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
25000 source = status mpi_status_extract(mpi_source)
25001 tag = status mpi_status_extract(mpi_tag)
25009 cpabort(
"not in parallel mode")
25011 CALL mp_timestop(handle)
25012 END SUBROUTINE mp_recv_zv
25022 SUBROUTINE mp_recv_zm2(msg, source, tag, comm)
25023 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25024 INTEGER,
INTENT(INOUT) :: source, tag
25027 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zm2'
25030#if defined(__parallel)
25031 INTEGER :: ierr, msglen
25032 mpi_status_type :: status
25035 CALL mp_timeset(routinen, handle)
25037#if defined(__parallel)
25040 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
25041 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
25043 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
25044 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
25045 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
25046 source = status mpi_status_extract(mpi_source)
25047 tag = status mpi_status_extract(mpi_tag)
25055 cpabort(
"not in parallel mode")
25057 CALL mp_timestop(handle)
25058 END SUBROUTINE mp_recv_zm2
25068 SUBROUTINE mp_recv_zm3(msg, source, tag, comm)
25069 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
25070 INTEGER,
INTENT(INOUT) :: source, tag
25073 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_zm3'
25076#if defined(__parallel)
25077 INTEGER :: ierr, msglen
25078 mpi_status_type :: status
25081 CALL mp_timeset(routinen, handle)
25083#if defined(__parallel)
25086 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
25087 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
25089 CALL mpi_recv(msg, msglen, mpi_double_complex, source, tag, comm%handle, status, ierr)
25090 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
25091 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_8_size))
25092 source = status mpi_status_extract(mpi_source)
25093 tag = status mpi_status_extract(mpi_tag)
25101 cpabort(
"not in parallel mode")
25103 CALL mp_timestop(handle)
25104 END SUBROUTINE mp_recv_zm3
25114 SUBROUTINE mp_bcast_z (msg, source, comm)
25115 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25116 INTEGER,
INTENT(IN) :: source
25119 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z'
25122#if defined(__parallel)
25123 INTEGER :: ierr, msglen
25126 CALL mp_timeset(routinen, handle)
25128#if defined(__parallel)
25130 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
25131 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25132 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25138 CALL mp_timestop(handle)
25139 END SUBROUTINE mp_bcast_z
25148 SUBROUTINE mp_bcast_z_src(msg, comm)
25149 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25152 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z_src'
25155#if defined(__parallel)
25156 INTEGER :: ierr, msglen
25159 CALL mp_timeset(routinen, handle)
25161#if defined(__parallel)
25163 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25164 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25165 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25170 CALL mp_timestop(handle)
25171 END SUBROUTINE mp_bcast_z_src
25181 SUBROUTINE mp_ibcast_z (msg, source, comm, request)
25182 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25183 INTEGER,
INTENT(IN) :: source
25187 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_z'
25190#if defined(__parallel)
25191 INTEGER :: ierr, msglen
25194 CALL mp_timeset(routinen, handle)
25196#if defined(__parallel)
25198 CALL mpi_ibcast(msg, msglen, mpi_double_complex, source, comm%handle, request%handle, ierr)
25199 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
25200 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_8_size))
25207 CALL mp_timestop(handle)
25208 END SUBROUTINE mp_ibcast_z
25217 SUBROUTINE mp_bcast_zv(msg, source, comm)
25218 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25219 INTEGER,
INTENT(IN) :: source
25222 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zv'
25225#if defined(__parallel)
25226 INTEGER :: ierr, msglen
25229 CALL mp_timeset(routinen, handle)
25231#if defined(__parallel)
25233 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
25234 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25235 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25241 CALL mp_timestop(handle)
25242 END SUBROUTINE mp_bcast_zv
25250 SUBROUTINE mp_bcast_zv_src(msg, comm)
25251 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25254 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zv_src'
25257#if defined(__parallel)
25258 INTEGER :: ierr, msglen
25261 CALL mp_timeset(routinen, handle)
25263#if defined(__parallel)
25265 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25266 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25267 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25272 CALL mp_timestop(handle)
25273 END SUBROUTINE mp_bcast_zv_src
25282 SUBROUTINE mp_ibcast_zv(msg, source, comm, request)
25283 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
25284 INTEGER,
INTENT(IN) :: source
25288 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_zv'
25291#if defined(__parallel)
25292 INTEGER :: ierr, msglen
25295 CALL mp_timeset(routinen, handle)
25297#if defined(__parallel)
25298#if !defined(__GNUC__) || __GNUC__ >= 9
25299 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
25302 CALL mpi_ibcast(msg, msglen, mpi_double_complex, source, comm%handle, request%handle, ierr)
25303 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
25304 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_8_size))
25311 CALL mp_timestop(handle)
25312 END SUBROUTINE mp_ibcast_zv
25321 SUBROUTINE mp_bcast_zm(msg, source, comm)
25322 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25323 INTEGER,
INTENT(IN) :: source
25326 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zm'
25329#if defined(__parallel)
25330 INTEGER :: ierr, msglen
25333 CALL mp_timeset(routinen, handle)
25335#if defined(__parallel)
25337 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
25338 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25339 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25345 CALL mp_timestop(handle)
25346 END SUBROUTINE mp_bcast_zm
25355 SUBROUTINE mp_bcast_zm_src(msg, comm)
25356 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25359 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_zm_src'
25362#if defined(__parallel)
25363 INTEGER :: ierr, msglen
25366 CALL mp_timeset(routinen, handle)
25368#if defined(__parallel)
25370 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25371 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25372 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25377 CALL mp_timestop(handle)
25378 END SUBROUTINE mp_bcast_zm_src
25387 SUBROUTINE mp_bcast_z3(msg, source, comm)
25388 COMPLEX(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
25389 INTEGER,
INTENT(IN) :: source
25392 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z3'
25395#if defined(__parallel)
25396 INTEGER :: ierr, msglen
25399 CALL mp_timeset(routinen, handle)
25401#if defined(__parallel)
25403 CALL mpi_bcast(msg, msglen, mpi_double_complex, source, comm%handle, ierr)
25404 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25405 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25411 CALL mp_timestop(handle)
25412 END SUBROUTINE mp_bcast_z3
25421 SUBROUTINE mp_bcast_z3_src(msg, comm)
25422 COMPLEX(kind=real_8),
CONTIGUOUS :: msg(:, :, :)
25425 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_z3_src'
25428#if defined(__parallel)
25429 INTEGER :: ierr, msglen
25432 CALL mp_timeset(routinen, handle)
25434#if defined(__parallel)
25436 CALL mpi_bcast(msg, msglen, mpi_double_complex, comm%source, comm%handle, ierr)
25437 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
25438 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_8_size))
25443 CALL mp_timestop(handle)
25444 END SUBROUTINE mp_bcast_z3_src
25453 SUBROUTINE mp_sum_z (msg, comm)
25454 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25457 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_z'
25460#if defined(__parallel)
25461 INTEGER :: ierr, msglen
25462 COMPLEX(kind=real_8) :: res
25465 CALL mp_timeset(routinen, handle)
25467#if defined(__parallel)
25469 IF (comm%num_pe > 1)
THEN
25470 CALL mpi_allreduce(msg, res, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25471 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25474 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25479 CALL mp_timestop(handle)
25480 END SUBROUTINE mp_sum_z
25488 SUBROUTINE mp_sum_zv(msg, comm)
25489 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25492 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zv'
25495#if defined(__parallel)
25496 INTEGER :: ierr, msglen
25497 COMPLEX(kind=real_8),
ALLOCATABLE :: msgbuf(:)
25500 CALL mp_timeset(routinen, handle)
25502#if defined(__parallel)
25504 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
25505 ALLOCATE (msgbuf(msglen))
25506 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25507 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25510 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25515 CALL mp_timestop(handle)
25516 END SUBROUTINE mp_sum_zv
25524 SUBROUTINE mp_isum_zv(msg, comm, request)
25525 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
25529 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_zv'
25532#if defined(__parallel)
25533 INTEGER :: ierr, msglen
25536 CALL mp_timeset(routinen, handle)
25538#if defined(__parallel)
25539#if !defined(__GNUC__) || __GNUC__ >= 9
25540 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
25543 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
25544 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_double_complex, mpi_sum, comm%handle, request%handle, ierr)
25545 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
25549 CALL add_perf(perf_id=23, count=1, msg_size=msglen*(2*real_8_size))
25555 CALL mp_timestop(handle)
25556 END SUBROUTINE mp_isum_zv
25564 SUBROUTINE mp_sum_zm(msg, comm)
25565 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25568 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm'
25571#if defined(__parallel)
25572 INTEGER,
PARAMETER :: max_msg = 2**25
25573 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
25574 COMPLEX(kind=real_8),
ALLOCATABLE :: msgbuf(:)
25577 CALL mp_timeset(routinen, handle)
25579#if defined(__parallel)
25581 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
25583 DO m1 = lbound(msg, 2), ubound(msg, 2), step
25584 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
25585 msglensum = msglensum + msglen
25586 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
25587 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
25588 ALLOCATE (msgbuf(msglen))
25589 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25590 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25591 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
25592 DEALLOCATE (msgbuf)
25595 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_8_size))
25600 CALL mp_timestop(handle)
25601 END SUBROUTINE mp_sum_zm
25609 SUBROUTINE mp_sum_zm3(msg, comm)
25610 COMPLEX(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
25613 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm3'
25616#if defined(__parallel)
25617 INTEGER :: ierr, msglen
25618 COMPLEX(kind=real_8),
ALLOCATABLE :: msgbuf(:)
25621 CALL mp_timeset(routinen, handle)
25623#if defined(__parallel)
25625 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
25626 ALLOCATE (msgbuf(msglen))
25627 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25628 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25629 msg = reshape(msgbuf, shape(msg))
25631 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25636 CALL mp_timestop(handle)
25637 END SUBROUTINE mp_sum_zm3
25645 SUBROUTINE mp_sum_zm4(msg, comm)
25646 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
25649 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_zm4'
25652#if defined(__parallel)
25653 INTEGER :: ierr, msglen
25654 COMPLEX(kind=real_8),
ALLOCATABLE :: msgbuf(:)
25657 CALL mp_timeset(routinen, handle)
25659#if defined(__parallel)
25661 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
25662 ALLOCATE (msgbuf(msglen))
25663 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25664 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25665 msg = reshape(msgbuf, shape(msg))
25667 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25672 CALL mp_timestop(handle)
25673 END SUBROUTINE mp_sum_zm4
25685 SUBROUTINE mp_sum_root_zv(msg, root, comm)
25686 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25687 INTEGER,
INTENT(IN) :: root
25690 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_zv'
25693#if defined(__parallel)
25694 INTEGER :: ierr, m1, msglen, taskid
25695 COMPLEX(kind=real_8),
ALLOCATABLE :: res(:)
25698 CALL mp_timeset(routinen, handle)
25700#if defined(__parallel)
25702 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25703 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25704 IF (msglen > 0)
THEN
25707 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_sum, &
25708 root, comm%handle, ierr)
25709 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25710 IF (taskid == root)
THEN
25715 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25721 CALL mp_timestop(handle)
25722 END SUBROUTINE mp_sum_root_zv
25733 SUBROUTINE mp_sum_root_zm(msg, root, comm)
25734 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25735 INTEGER,
INTENT(IN) :: root
25738 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
25741#if defined(__parallel)
25742 INTEGER :: ierr, m1, m2, msglen, taskid
25743 COMPLEX(kind=real_8),
ALLOCATABLE :: res(:, :)
25746 CALL mp_timeset(routinen, handle)
25748#if defined(__parallel)
25750 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25751 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25752 IF (msglen > 0)
THEN
25755 ALLOCATE (res(m1, m2))
25756 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_sum, root, comm%handle, ierr)
25757 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25758 IF (taskid == root)
THEN
25763 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25769 CALL mp_timestop(handle)
25770 END SUBROUTINE mp_sum_root_zm
25778 SUBROUTINE mp_sum_partial_zm(msg, res, comm)
25779 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
25780 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
25783 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_zm'
25786#if defined(__parallel)
25787 INTEGER :: ierr, msglen, taskid
25790 CALL mp_timeset(routinen, handle)
25792#if defined(__parallel)
25794 CALL mpi_comm_rank(comm%handle, taskid, ierr)
25795 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
25796 IF (msglen > 0)
THEN
25797 CALL mpi_scan(msg, res, msglen, mpi_double_complex, mpi_sum, comm%handle, ierr)
25798 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
25800 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25806 CALL mp_timestop(handle)
25807 END SUBROUTINE mp_sum_partial_zm
25817 SUBROUTINE mp_max_z (msg, comm)
25818 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25821 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_z'
25824#if defined(__parallel)
25825 INTEGER :: ierr, msglen
25826 COMPLEX(kind=real_8) :: res
25829 CALL mp_timeset(routinen, handle)
25831#if defined(__parallel)
25833 IF (comm%num_pe > 1)
THEN
25834 CALL mpi_allreduce(msg, res, msglen, mpi_double_complex, mpi_max, comm%handle, ierr)
25835 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25838 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25843 CALL mp_timestop(handle)
25844 END SUBROUTINE mp_max_z
25854 SUBROUTINE mp_max_root_z (msg, root, comm)
25855 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
25856 INTEGER,
INTENT(IN) :: root
25859 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_z'
25862#if defined(__parallel)
25863 INTEGER :: ierr, msglen
25864 COMPLEX(kind=real_8) :: res
25867 CALL mp_timeset(routinen, handle)
25869#if defined(__parallel)
25871 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_max, root, comm%handle, ierr)
25872 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
25873 IF (root == comm%mepos) msg = res
25874 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25880 CALL mp_timestop(handle)
25881 END SUBROUTINE mp_max_root_z
25891 SUBROUTINE mp_max_zv(msg, comm)
25892 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
25895 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_zv'
25898#if defined(__parallel)
25899 INTEGER :: ierr, msglen
25900 COMPLEX(kind=real_8),
ALLOCATABLE :: msgbuf(:)
25903 CALL mp_timeset(routinen, handle)
25905#if defined(__parallel)
25907 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
25908 ALLOCATE (msgbuf(msglen))
25909 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_double_complex, mpi_max, comm%handle, ierr)
25910 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25913 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
25918 CALL mp_timestop(handle)
25919 END SUBROUTINE mp_max_zv
25929 SUBROUTINE mp_max_zm(msg, comm)
25930 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25933 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_zm'
25936#if defined(__parallel)
25937 INTEGER,
PARAMETER :: max_msg = 2**25
25938 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
25939 COMPLEX(kind=real_8),
ALLOCATABLE :: msgbuf(:)
25942 CALL mp_timeset(routinen, handle)
25944#if defined(__parallel)
25946 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
25948 DO m1 = lbound(msg, 2), ubound(msg, 2), step
25949 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
25950 msglensum = msglensum + msglen
25951 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
25952 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
25953 ALLOCATE (msgbuf(msglen))
25954 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_double_complex, mpi_max, comm%handle, ierr)
25955 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25956 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
25957 DEALLOCATE (msgbuf)
25960 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_8_size))
25965 CALL mp_timestop(handle)
25966 END SUBROUTINE mp_max_zm
25976 SUBROUTINE mp_max_root_zm(msg, root, comm)
25977 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
25981 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_zm'
25984#if defined(__parallel)
25985 INTEGER :: ierr, msglen
25986 COMPLEX(kind=real_8) :: res(size(msg, 1), size(msg, 2))
25989 CALL mp_timeset(routinen, handle)
25991#if defined(__parallel)
25993 CALL mpi_reduce(msg, res, msglen, mpi_double_complex, mpi_max, root, comm%handle, ierr)
25994 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
25995 IF (root == comm%mepos) msg = res
25996 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
26002 CALL mp_timestop(handle)
26003 END SUBROUTINE mp_max_root_zm
26013 SUBROUTINE mp_min_z (msg, comm)
26014 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
26017 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_z'
26020#if defined(__parallel)
26021 INTEGER :: ierr, msglen
26022 COMPLEX(kind=real_8) :: res
26025 CALL mp_timeset(routinen, handle)
26027#if defined(__parallel)
26029 IF (comm%num_pe > 1)
THEN
26030 CALL mpi_allreduce(msg, res, msglen, mpi_double_complex, mpi_min, comm%handle, ierr)
26031 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
26034 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
26039 CALL mp_timestop(handle)
26040 END SUBROUTINE mp_min_z
26052 SUBROUTINE mp_min_zv(msg, comm)
26053 COMPLEX(kind=real_8),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
26056 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_zv'
26059#if defined(__parallel)
26060 INTEGER :: ierr, msglen
26061 COMPLEX(kind=real_8),
ALLOCATABLE :: msgbuf(:)
26064 CALL mp_timeset(routinen, handle)
26066#if defined(__parallel)
26068 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
26069 ALLOCATE (msgbuf(msglen))
26070 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_double_complex, mpi_min, comm%handle, ierr)
26071 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
26074 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
26079 CALL mp_timestop(handle)
26080 END SUBROUTINE mp_min_zv
26090 SUBROUTINE mp_min_zm(msg, comm)
26091 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
26094 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_zm'
26097#if defined(__parallel)
26098 INTEGER,
PARAMETER :: max_msg = 2**25
26099 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
26100 COMPLEX(kind=real_8),
ALLOCATABLE :: msgbuf(:)
26103 CALL mp_timeset(routinen, handle)
26105#if defined(__parallel)
26107 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
26109 DO m1 = lbound(msg, 2), ubound(msg, 2), step
26110 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
26111 msglensum = msglensum + msglen
26112 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
26113 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
26114 ALLOCATE (msgbuf(msglen))
26115 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_double_complex, mpi_min, comm%handle, ierr)
26116 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
26117 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
26118 DEALLOCATE (msgbuf)
26121 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_8_size))
26126 CALL mp_timestop(handle)
26127 END SUBROUTINE mp_min_zm
26137 SUBROUTINE mp_prod_z (msg, comm)
26138 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
26141 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_z'
26144#if defined(__parallel)
26145 INTEGER :: ierr, msglen
26146 COMPLEX(kind=real_8) :: res
26149 CALL mp_timeset(routinen, handle)
26151#if defined(__parallel)
26153 IF (comm%num_pe > 1)
THEN
26154 CALL mpi_allreduce(msg, res, msglen, mpi_double_complex, mpi_prod, comm%handle, ierr)
26155 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
26158 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_8_size))
26163 CALL mp_timestop(handle)
26164 END SUBROUTINE mp_prod_z
26175 SUBROUTINE mp_scatter_zv(msg_scatter, msg, root, comm)
26176 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
26177 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
26178 INTEGER,
INTENT(IN) :: root
26181 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_zv'
26184#if defined(__parallel)
26185 INTEGER :: ierr, msglen
26188 CALL mp_timeset(routinen, handle)
26190#if defined(__parallel)
26192 CALL mpi_scatter(msg_scatter, msglen, mpi_double_complex, msg, &
26193 msglen, mpi_double_complex, root, comm%handle, ierr)
26194 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
26195 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
26201 CALL mp_timestop(handle)
26202 END SUBROUTINE mp_scatter_zv
26212 SUBROUTINE mp_iscatter_z (msg_scatter, msg, root, comm, request)
26213 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:)
26214 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg
26215 INTEGER,
INTENT(IN) :: root
26219 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_z'
26222#if defined(__parallel)
26223 INTEGER :: ierr, msglen
26226 CALL mp_timeset(routinen, handle)
26228#if defined(__parallel)
26229#if !defined(__GNUC__) || __GNUC__ >= 9
26230 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
26233 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_complex, msg, &
26234 msglen, mpi_double_complex, root, comm%handle, request%handle, ierr)
26235 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
26236 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
26240 msg = msg_scatter(1)
26243 CALL mp_timestop(handle)
26244 END SUBROUTINE mp_iscatter_z
26254 SUBROUTINE mp_iscatter_zv2(msg_scatter, msg, root, comm, request)
26255 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:, :)
26256 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
26257 INTEGER,
INTENT(IN) :: root
26261 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_zv2'
26264#if defined(__parallel)
26265 INTEGER :: ierr, msglen
26268 CALL mp_timeset(routinen, handle)
26270#if defined(__parallel)
26271#if !defined(__GNUC__) || __GNUC__ >= 9
26272 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
26275 CALL mpi_iscatter(msg_scatter, msglen, mpi_double_complex, msg, &
26276 msglen, mpi_double_complex, root, comm%handle, request%handle, ierr)
26277 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
26278 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
26282 msg(:) = msg_scatter(:, 1)
26285 CALL mp_timestop(handle)
26286 END SUBROUTINE mp_iscatter_zv2
26296 SUBROUTINE mp_iscatterv_zv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
26297 COMPLEX(kind=real_8),
INTENT(IN) :: msg_scatter(:)
26298 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
26299 COMPLEX(kind=real_8),
INTENT(INOUT) :: msg(:)
26300 INTEGER,
INTENT(IN) :: recvcount, root
26304 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_zv'
26307#if defined(__parallel)
26311 CALL mp_timeset(routinen, handle)
26313#if defined(__parallel)
26314#if !defined(__GNUC__) || __GNUC__ >= 9
26315 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
26316 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
26317 cpassert(is_contiguous(sendcounts) .OR.
SIZE(sendcounts) == 0)
26318 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
26320 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_double_complex, msg, &
26321 recvcount, mpi_double_complex, root, comm%handle, request%handle, ierr)
26322 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
26323 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_8_size))
26325 mark_used(sendcounts)
26327 mark_used(recvcount)
26330 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
26333 CALL mp_timestop(handle)
26334 END SUBROUTINE mp_iscatterv_zv
26345 SUBROUTINE mp_gather_z (msg, msg_gather, root, comm)
26346 COMPLEX(kind=real_8),
INTENT(IN) :: msg
26347 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
26348 INTEGER,
INTENT(IN) :: root
26351 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_z'
26354#if defined(__parallel)
26355 INTEGER :: ierr, msglen
26358 CALL mp_timeset(routinen, handle)
26360#if defined(__parallel)
26362 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
26363 msglen, mpi_double_complex, root, comm%handle, ierr)
26364 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
26365 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
26369 msg_gather(1) = msg
26371 CALL mp_timestop(handle)
26372 END SUBROUTINE mp_gather_z
26382 SUBROUTINE mp_gather_z_src(msg, msg_gather, comm)
26383 COMPLEX(kind=real_8),
INTENT(IN) :: msg
26384 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
26387 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_z_src'
26390#if defined(__parallel)
26391 INTEGER :: ierr, msglen
26394 CALL mp_timeset(routinen, handle)
26396#if defined(__parallel)
26398 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
26399 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
26400 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
26401 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
26404 msg_gather(1) = msg
26406 CALL mp_timestop(handle)
26407 END SUBROUTINE mp_gather_z_src
26421 SUBROUTINE mp_gather_zv(msg, msg_gather, root, comm)
26422 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
26423 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
26424 INTEGER,
INTENT(IN) :: root
26427 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zv'
26430#if defined(__parallel)
26431 INTEGER :: ierr, msglen
26434 CALL mp_timeset(routinen, handle)
26436#if defined(__parallel)
26438 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
26439 msglen, mpi_double_complex, root, comm%handle, ierr)
26440 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
26441 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
26447 CALL mp_timestop(handle)
26448 END SUBROUTINE mp_gather_zv
26461 SUBROUTINE mp_gather_zv_src(msg, msg_gather, comm)
26462 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
26463 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
26466 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zv_src'
26469#if defined(__parallel)
26470 INTEGER :: ierr, msglen
26473 CALL mp_timeset(routinen, handle)
26475#if defined(__parallel)
26477 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
26478 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
26479 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
26480 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
26485 CALL mp_timestop(handle)
26486 END SUBROUTINE mp_gather_zv_src
26500 SUBROUTINE mp_gather_zm(msg, msg_gather, root, comm)
26501 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
26502 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
26503 INTEGER,
INTENT(IN) :: root
26506 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zm'
26509#if defined(__parallel)
26510 INTEGER :: ierr, msglen
26513 CALL mp_timeset(routinen, handle)
26515#if defined(__parallel)
26517 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
26518 msglen, mpi_double_complex, root, comm%handle, ierr)
26519 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
26520 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
26526 CALL mp_timestop(handle)
26527 END SUBROUTINE mp_gather_zm
26540 SUBROUTINE mp_gather_zm_src(msg, msg_gather, comm)
26541 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
26542 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
26545 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_zm_src'
26548#if defined(__parallel)
26549 INTEGER :: ierr, msglen
26552 CALL mp_timeset(routinen, handle)
26554#if defined(__parallel)
26556 CALL mpi_gather(msg, msglen, mpi_double_complex, msg_gather, &
26557 msglen, mpi_double_complex, comm%source, comm%handle, ierr)
26558 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
26559 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_8_size))
26564 CALL mp_timestop(handle)
26565 END SUBROUTINE mp_gather_zm_src
26582 SUBROUTINE mp_gatherv_zv(sendbuf, recvbuf, recvcounts, displs, root, comm)
26584 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26585 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26586 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26587 INTEGER,
INTENT(IN) :: root
26590 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zv'
26593#if defined(__parallel)
26594 INTEGER :: ierr, sendcount
26597 CALL mp_timeset(routinen, handle)
26599#if defined(__parallel)
26600 sendcount =
SIZE(sendbuf)
26601 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26602 recvbuf, recvcounts, displs, mpi_double_complex, &
26603 root, comm%handle, ierr)
26604 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26605 CALL add_perf(perf_id=4, &
26607 msg_size=sendcount*(2*real_8_size))
26609 mark_used(recvcounts)
26612 recvbuf(1 + displs(1):) = sendbuf
26614 CALL mp_timestop(handle)
26615 END SUBROUTINE mp_gatherv_zv
26631 SUBROUTINE mp_gatherv_zv_src(sendbuf, recvbuf, recvcounts, displs, comm)
26633 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26634 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26635 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26638 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zv_src'
26641#if defined(__parallel)
26642 INTEGER :: ierr, sendcount
26645 CALL mp_timeset(routinen, handle)
26647#if defined(__parallel)
26648 sendcount =
SIZE(sendbuf)
26649 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26650 recvbuf, recvcounts, displs, mpi_double_complex, &
26651 comm%source, comm%handle, ierr)
26652 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26653 CALL add_perf(perf_id=4, &
26655 msg_size=sendcount*(2*real_8_size))
26657 mark_used(recvcounts)
26659 recvbuf(1 + displs(1):) = sendbuf
26661 CALL mp_timestop(handle)
26662 END SUBROUTINE mp_gatherv_zv_src
26679 SUBROUTINE mp_gatherv_zm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
26681 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26682 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26683 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26684 INTEGER,
INTENT(IN) :: root
26687 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zm2'
26690#if defined(__parallel)
26691 INTEGER :: ierr, sendcount
26694 CALL mp_timeset(routinen, handle)
26696#if defined(__parallel)
26697 sendcount =
SIZE(sendbuf)
26698 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26699 recvbuf, recvcounts, displs, mpi_double_complex, &
26700 root, comm%handle, ierr)
26701 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26702 CALL add_perf(perf_id=4, &
26704 msg_size=sendcount*(2*real_8_size))
26706 mark_used(recvcounts)
26709 recvbuf(:, 1 + displs(1):) = sendbuf
26711 CALL mp_timestop(handle)
26712 END SUBROUTINE mp_gatherv_zm2
26728 SUBROUTINE mp_gatherv_zm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
26730 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
26731 COMPLEX(kind=real_8),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
26732 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26735 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_zm2_src'
26738#if defined(__parallel)
26739 INTEGER :: ierr, sendcount
26742 CALL mp_timeset(routinen, handle)
26744#if defined(__parallel)
26745 sendcount =
SIZE(sendbuf)
26746 CALL mpi_gatherv(sendbuf, sendcount, mpi_double_complex, &
26747 recvbuf, recvcounts, displs, mpi_double_complex, &
26748 comm%source, comm%handle, ierr)
26749 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26750 CALL add_perf(perf_id=4, &
26752 msg_size=sendcount*(2*real_8_size))
26754 mark_used(recvcounts)
26756 recvbuf(:, 1 + displs(1):) = sendbuf
26758 CALL mp_timestop(handle)
26759 END SUBROUTINE mp_gatherv_zm2_src
26776 SUBROUTINE mp_igatherv_zv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
26777 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: sendbuf
26778 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(OUT) :: recvbuf
26779 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
26780 INTEGER,
INTENT(IN) :: sendcount, root
26784 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_zv'
26787#if defined(__parallel)
26791 CALL mp_timeset(routinen, handle)
26793#if defined(__parallel)
26794#if !defined(__GNUC__) || __GNUC__ >= 9
26795 cpassert(is_contiguous(sendbuf) .OR.
SIZE(sendbuf) == 0)
26796 cpassert(is_contiguous(recvbuf) .OR.
SIZE(recvbuf) == 0)
26797 cpassert(is_contiguous(recvcounts) .OR.
SIZE(recvcounts) == 0)
26798 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
26800 CALL mpi_igatherv(sendbuf, sendcount, mpi_double_complex, &
26801 recvbuf, recvcounts, displs, mpi_double_complex, &
26802 root, comm%handle, request%handle, ierr)
26803 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
26804 CALL add_perf(perf_id=24, &
26806 msg_size=sendcount*(2*real_8_size))
26808 mark_used(sendcount)
26809 mark_used(recvcounts)
26812 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
26815 CALL mp_timestop(handle)
26816 END SUBROUTINE mp_igatherv_zv
26829 SUBROUTINE mp_allgather_z (msgout, msgin, comm)
26830 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26831 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
26834 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z'
26837#if defined(__parallel)
26838 INTEGER :: ierr, rcount, scount
26841 CALL mp_timeset(routinen, handle)
26843#if defined(__parallel)
26846 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26847 msgin, rcount, mpi_double_complex, &
26849 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26854 CALL mp_timestop(handle)
26855 END SUBROUTINE mp_allgather_z
26868 SUBROUTINE mp_allgather_z2(msgout, msgin, comm)
26869 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26870 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26873 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z2'
26876#if defined(__parallel)
26877 INTEGER :: ierr, rcount, scount
26880 CALL mp_timeset(routinen, handle)
26882#if defined(__parallel)
26885 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26886 msgin, rcount, mpi_double_complex, &
26888 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26893 CALL mp_timestop(handle)
26894 END SUBROUTINE mp_allgather_z2
26907 SUBROUTINE mp_iallgather_z (msgout, msgin, comm, request)
26908 COMPLEX(kind=real_8),
INTENT(IN) :: msgout
26909 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
26913 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z'
26916#if defined(__parallel)
26917 INTEGER :: ierr, rcount, scount
26920 CALL mp_timeset(routinen, handle)
26922#if defined(__parallel)
26923#if !defined(__GNUC__) || __GNUC__ >= 9
26924 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
26928 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
26929 msgin, rcount, mpi_double_complex, &
26930 comm%handle, request%handle, ierr)
26931 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26937 CALL mp_timestop(handle)
26938 END SUBROUTINE mp_iallgather_z
26953 SUBROUTINE mp_allgather_z12(msgout, msgin, comm)
26954 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:)
26955 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
26958 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z12'
26961#if defined(__parallel)
26962 INTEGER :: ierr, rcount, scount
26965 CALL mp_timeset(routinen, handle)
26967#if defined(__parallel)
26968 scount =
SIZE(msgout(:))
26970 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
26971 msgin, rcount, mpi_double_complex, &
26973 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
26976 msgin(:, 1) = msgout(:)
26978 CALL mp_timestop(handle)
26979 END SUBROUTINE mp_allgather_z12
26989 SUBROUTINE mp_allgather_z23(msgout, msgin, comm)
26990 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
26991 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
26994 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z23'
26997#if defined(__parallel)
26998 INTEGER :: ierr, rcount, scount
27001 CALL mp_timeset(routinen, handle)
27003#if defined(__parallel)
27004 scount =
SIZE(msgout(:, :))
27006 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
27007 msgin, rcount, mpi_double_complex, &
27009 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
27012 msgin(:, :, 1) = msgout(:, :)
27014 CALL mp_timestop(handle)
27015 END SUBROUTINE mp_allgather_z23
27025 SUBROUTINE mp_allgather_z34(msgout, msgin, comm)
27026 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
27027 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
27030 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z34'
27033#if defined(__parallel)
27034 INTEGER :: ierr, rcount, scount
27037 CALL mp_timeset(routinen, handle)
27039#if defined(__parallel)
27040 scount =
SIZE(msgout(:, :, :))
27042 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
27043 msgin, rcount, mpi_double_complex, &
27045 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
27048 msgin(:, :, :, 1) = msgout(:, :, :)
27050 CALL mp_timestop(handle)
27051 END SUBROUTINE mp_allgather_z34
27061 SUBROUTINE mp_allgather_z22(msgout, msgin, comm)
27062 COMPLEX(kind=real_8),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
27063 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
27066 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_z22'
27069#if defined(__parallel)
27070 INTEGER :: ierr, rcount, scount
27073 CALL mp_timeset(routinen, handle)
27075#if defined(__parallel)
27076 scount =
SIZE(msgout(:, :))
27078 CALL mpi_allgather(msgout, scount, mpi_double_complex, &
27079 msgin, rcount, mpi_double_complex, &
27081 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
27084 msgin(:, :) = msgout(:, :)
27086 CALL mp_timestop(handle)
27087 END SUBROUTINE mp_allgather_z22
27098 SUBROUTINE mp_iallgather_z11(msgout, msgin, comm, request)
27099 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
27100 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
27104 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z11'
27107#if defined(__parallel)
27108 INTEGER :: ierr, rcount, scount
27111 CALL mp_timeset(routinen, handle)
27113#if defined(__parallel)
27114#if !defined(__GNUC__) || __GNUC__ >= 9
27115 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
27116 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
27118 scount =
SIZE(msgout(:))
27120 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
27121 msgin, rcount, mpi_double_complex, &
27122 comm%handle, request%handle, ierr)
27123 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
27129 CALL mp_timestop(handle)
27130 END SUBROUTINE mp_iallgather_z11
27141 SUBROUTINE mp_iallgather_z13(msgout, msgin, comm, request)
27142 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
27143 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
27147 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z13'
27150#if defined(__parallel)
27151 INTEGER :: ierr, rcount, scount
27154 CALL mp_timeset(routinen, handle)
27156#if defined(__parallel)
27157#if !defined(__GNUC__) || __GNUC__ >= 9
27158 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
27159 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
27162 scount =
SIZE(msgout(:))
27164 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
27165 msgin, rcount, mpi_double_complex, &
27166 comm%handle, request%handle, ierr)
27167 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
27170 msgin(:, 1, 1) = msgout(:)
27173 CALL mp_timestop(handle)
27174 END SUBROUTINE mp_iallgather_z13
27185 SUBROUTINE mp_iallgather_z22(msgout, msgin, comm, request)
27186 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :)
27187 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :)
27191 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z22'
27194#if defined(__parallel)
27195 INTEGER :: ierr, rcount, scount
27198 CALL mp_timeset(routinen, handle)
27200#if defined(__parallel)
27201#if !defined(__GNUC__) || __GNUC__ >= 9
27202 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
27203 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
27206 scount =
SIZE(msgout(:, :))
27208 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
27209 msgin, rcount, mpi_double_complex, &
27210 comm%handle, request%handle, ierr)
27211 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
27214 msgin(:, :) = msgout(:, :)
27217 CALL mp_timestop(handle)
27218 END SUBROUTINE mp_iallgather_z22
27229 SUBROUTINE mp_iallgather_z24(msgout, msgin, comm, request)
27230 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :)
27231 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :, :)
27235 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z24'
27238#if defined(__parallel)
27239 INTEGER :: ierr, rcount, scount
27242 CALL mp_timeset(routinen, handle)
27244#if defined(__parallel)
27245#if !defined(__GNUC__) || __GNUC__ >= 9
27246 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
27247 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
27250 scount =
SIZE(msgout(:, :))
27252 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
27253 msgin, rcount, mpi_double_complex, &
27254 comm%handle, request%handle, ierr)
27255 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
27258 msgin(:, :, 1, 1) = msgout(:, :)
27261 CALL mp_timestop(handle)
27262 END SUBROUTINE mp_iallgather_z24
27273 SUBROUTINE mp_iallgather_z33(msgout, msgin, comm, request)
27274 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:, :, :)
27275 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:, :, :)
27279 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_z33'
27282#if defined(__parallel)
27283 INTEGER :: ierr, rcount, scount
27286 CALL mp_timeset(routinen, handle)
27288#if defined(__parallel)
27289#if !defined(__GNUC__) || __GNUC__ >= 9
27290 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
27291 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
27294 scount =
SIZE(msgout(:, :, :))
27296 CALL mpi_iallgather(msgout, scount, mpi_double_complex, &
27297 msgin, rcount, mpi_double_complex, &
27298 comm%handle, request%handle, ierr)
27299 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
27302 msgin(:, :, :) = msgout(:, :, :)
27305 CALL mp_timestop(handle)
27306 END SUBROUTINE mp_iallgather_z33
27325 SUBROUTINE mp_allgatherv_zv(msgout, msgin, rcount, rdispl, comm)
27326 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
27327 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
27328 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
27331 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_zv'
27334#if defined(__parallel)
27335 INTEGER :: ierr, scount
27338 CALL mp_timeset(routinen, handle)
27340#if defined(__parallel)
27341 scount =
SIZE(msgout)
27342 CALL mpi_allgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
27343 rdispl, mpi_double_complex, comm%handle, ierr)
27344 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
27351 CALL mp_timestop(handle)
27352 END SUBROUTINE mp_allgatherv_zv
27371 SUBROUTINE mp_allgatherv_zm2(msgout, msgin, rcount, rdispl, comm)
27372 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
27373 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
27374 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
27377 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_zv'
27380#if defined(__parallel)
27381 INTEGER :: ierr, scount
27384 CALL mp_timeset(routinen, handle)
27386#if defined(__parallel)
27387 scount =
SIZE(msgout)
27388 CALL mpi_allgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
27389 rdispl, mpi_double_complex, comm%handle, ierr)
27390 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
27397 CALL mp_timestop(handle)
27398 END SUBROUTINE mp_allgatherv_zm2
27417 SUBROUTINE mp_iallgatherv_zv(msgout, msgin, rcount, rdispl, comm, request)
27418 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
27419 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
27420 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
27424 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_zv'
27427#if defined(__parallel)
27428 INTEGER :: ierr, scount, rsize
27431 CALL mp_timeset(routinen, handle)
27433#if defined(__parallel)
27434#if !defined(__GNUC__) || __GNUC__ >= 9
27435 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
27436 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
27437 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
27438 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
27441 scount =
SIZE(msgout)
27442 rsize =
SIZE(rcount)
27443 CALL mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, &
27444 rdispl, comm, request, ierr)
27445 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
27453 CALL mp_timestop(handle)
27454 END SUBROUTINE mp_iallgatherv_zv
27473 SUBROUTINE mp_iallgatherv_zv2(msgout, msgin, rcount, rdispl, comm, request)
27474 COMPLEX(kind=real_8),
INTENT(IN) :: msgout(:)
27475 COMPLEX(kind=real_8),
INTENT(OUT) :: msgin(:)
27476 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
27480 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_zv2'
27483#if defined(__parallel)
27484 INTEGER :: ierr, scount, rsize
27487 CALL mp_timeset(routinen, handle)
27489#if defined(__parallel)
27490#if !defined(__GNUC__) || __GNUC__ >= 9
27491 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
27492 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
27493 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
27494 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
27497 scount =
SIZE(msgout)
27498 rsize =
SIZE(rcount)
27499 CALL mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, &
27500 rdispl, comm, request, ierr)
27501 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
27509 CALL mp_timestop(handle)
27510 END SUBROUTINE mp_iallgatherv_zv2
27521#if defined(__parallel)
27522 SUBROUTINE mp_iallgatherv_zv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
27523 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
27524 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
27525 INTEGER,
INTENT(IN) :: rsize
27526 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
27529 INTEGER,
INTENT(INOUT) :: ierr
27531 CALL mpi_iallgatherv(msgout, scount, mpi_double_complex, msgin, rcount, &
27532 rdispl, mpi_double_complex, comm%handle, request%handle, ierr)
27534 END SUBROUTINE mp_iallgatherv_zv_internal
27545 SUBROUTINE mp_sum_scatter_zv(msgout, msgin, rcount, comm)
27546 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
27547 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
27548 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
27551 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_zv'
27554#if defined(__parallel)
27558 CALL mp_timeset(routinen, handle)
27560#if defined(__parallel)
27561 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_double_complex, mpi_sum, &
27563 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
27565 CALL add_perf(perf_id=3, count=1, &
27566 msg_size=rcount(1)*2*(2*real_8_size))
27570 msgin = msgout(:, 1)
27572 CALL mp_timestop(handle)
27573 END SUBROUTINE mp_sum_scatter_zv
27584 SUBROUTINE mp_sendrecv_z (msgin, dest, msgout, source, comm, tag)
27585 COMPLEX(kind=real_8),
INTENT(IN) :: msgin
27586 INTEGER,
INTENT(IN) :: dest
27587 COMPLEX(kind=real_8),
INTENT(OUT) :: msgout
27588 INTEGER,
INTENT(IN) :: source
27590 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27592 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_z'
27595#if defined(__parallel)
27596 INTEGER :: ierr, msglen_in, msglen_out, &
27600 CALL mp_timeset(routinen, handle)
27602#if defined(__parallel)
27607 IF (
PRESENT(tag))
THEN
27611 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27612 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27613 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27614 CALL add_perf(perf_id=7, count=1, &
27615 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27623 CALL mp_timestop(handle)
27624 END SUBROUTINE mp_sendrecv_z
27635 SUBROUTINE mp_sendrecv_zv(msgin, dest, msgout, source, comm, tag)
27636 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
27637 INTEGER,
INTENT(IN) :: dest
27638 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
27639 INTEGER,
INTENT(IN) :: source
27641 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27643 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zv'
27646#if defined(__parallel)
27647 INTEGER :: ierr, msglen_in, msglen_out, &
27651 CALL mp_timeset(routinen, handle)
27653#if defined(__parallel)
27654 msglen_in =
SIZE(msgin)
27655 msglen_out =
SIZE(msgout)
27658 IF (
PRESENT(tag))
THEN
27662 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27663 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27664 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27665 CALL add_perf(perf_id=7, count=1, &
27666 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27674 CALL mp_timestop(handle)
27675 END SUBROUTINE mp_sendrecv_zv
27687 SUBROUTINE mp_sendrecv_zm2(msgin, dest, msgout, source, comm, tag)
27688 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
27689 INTEGER,
INTENT(IN) :: dest
27690 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
27691 INTEGER,
INTENT(IN) :: source
27693 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27695 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm2'
27698#if defined(__parallel)
27699 INTEGER :: ierr, msglen_in, msglen_out, &
27703 CALL mp_timeset(routinen, handle)
27705#if defined(__parallel)
27706 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
27707 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
27710 IF (
PRESENT(tag))
THEN
27714 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27715 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27716 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27717 CALL add_perf(perf_id=7, count=1, &
27718 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27726 CALL mp_timestop(handle)
27727 END SUBROUTINE mp_sendrecv_zm2
27738 SUBROUTINE mp_sendrecv_zm3(msgin, dest, msgout, source, comm, tag)
27739 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
27740 INTEGER,
INTENT(IN) :: dest
27741 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
27742 INTEGER,
INTENT(IN) :: source
27744 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27746 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm3'
27749#if defined(__parallel)
27750 INTEGER :: ierr, msglen_in, msglen_out, &
27754 CALL mp_timeset(routinen, handle)
27756#if defined(__parallel)
27757 msglen_in =
SIZE(msgin)
27758 msglen_out =
SIZE(msgout)
27761 IF (
PRESENT(tag))
THEN
27765 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27766 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27767 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27768 CALL add_perf(perf_id=7, count=1, &
27769 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27777 CALL mp_timestop(handle)
27778 END SUBROUTINE mp_sendrecv_zm3
27789 SUBROUTINE mp_sendrecv_zm4(msgin, dest, msgout, source, comm, tag)
27790 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
27791 INTEGER,
INTENT(IN) :: dest
27792 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
27793 INTEGER,
INTENT(IN) :: source
27795 INTEGER,
INTENT(IN),
OPTIONAL :: tag
27797 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_zm4'
27800#if defined(__parallel)
27801 INTEGER :: ierr, msglen_in, msglen_out, &
27805 CALL mp_timeset(routinen, handle)
27807#if defined(__parallel)
27808 msglen_in =
SIZE(msgin)
27809 msglen_out =
SIZE(msgout)
27812 IF (
PRESENT(tag))
THEN
27816 CALL mpi_sendrecv(msgin, msglen_in, mpi_double_complex, dest, send_tag, msgout, &
27817 msglen_out, mpi_double_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
27818 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
27819 CALL add_perf(perf_id=7, count=1, &
27820 msg_size=(msglen_in + msglen_out)*(2*real_8_size)/2)
27828 CALL mp_timestop(handle)
27829 END SUBROUTINE mp_sendrecv_zm4
27846 SUBROUTINE mp_isendrecv_z (msgin, dest, msgout, source, comm, send_request, &
27848 COMPLEX(kind=real_8),
INTENT(IN) :: msgin
27849 INTEGER,
INTENT(IN) :: dest
27850 COMPLEX(kind=real_8),
INTENT(INOUT) :: msgout
27851 INTEGER,
INTENT(IN) :: source
27854 INTEGER,
INTENT(in),
OPTIONAL :: tag
27856 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_z'
27859#if defined(__parallel)
27860 INTEGER :: ierr, my_tag
27863 CALL mp_timeset(routinen, handle)
27865#if defined(__parallel)
27867 IF (
PRESENT(tag)) my_tag = tag
27869 CALL mpi_irecv(msgout, 1, mpi_double_complex, source, my_tag, &
27870 comm%handle, recv_request%handle, ierr)
27871 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27873 CALL mpi_isend(msgin, 1, mpi_double_complex, dest, my_tag, &
27874 comm%handle, send_request%handle, ierr)
27875 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27877 CALL add_perf(perf_id=8, count=1, msg_size=2*(2*real_8_size))
27887 CALL mp_timestop(handle)
27888 END SUBROUTINE mp_isendrecv_z
27907 SUBROUTINE mp_isendrecv_zv(msgin, dest, msgout, source, comm, send_request, &
27909 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
27910 INTEGER,
INTENT(IN) :: dest
27911 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
27912 INTEGER,
INTENT(IN) :: source
27915 INTEGER,
INTENT(in),
OPTIONAL :: tag
27917 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_zv'
27920#if defined(__parallel)
27921 INTEGER :: ierr, msglen, my_tag
27922 COMPLEX(kind=real_8) :: foo
27925 CALL mp_timeset(routinen, handle)
27927#if defined(__parallel)
27928#if !defined(__GNUC__) || __GNUC__ >= 9
27929 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
27930 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
27934 IF (
PRESENT(tag)) my_tag = tag
27936 msglen =
SIZE(msgout, 1)
27937 IF (msglen > 0)
THEN
27938 CALL mpi_irecv(msgout(1), msglen, mpi_double_complex, source, my_tag, &
27939 comm%handle, recv_request%handle, ierr)
27941 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
27942 comm%handle, recv_request%handle, ierr)
27944 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
27946 msglen =
SIZE(msgin, 1)
27947 IF (msglen > 0)
THEN
27948 CALL mpi_isend(msgin(1), msglen, mpi_double_complex, dest, my_tag, &
27949 comm%handle, send_request%handle, ierr)
27951 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
27952 comm%handle, send_request%handle, ierr)
27954 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
27956 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
27957 CALL add_perf(perf_id=8, count=1, msg_size=msglen*(2*real_8_size))
27967 CALL mp_timestop(handle)
27968 END SUBROUTINE mp_isendrecv_zv
27983 SUBROUTINE mp_isend_zv(msgin, dest, comm, request, tag)
27984 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: msgin
27985 INTEGER,
INTENT(IN) :: dest
27988 INTEGER,
INTENT(in),
OPTIONAL :: tag
27990 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zv'
27992 INTEGER :: handle, ierr
27993#if defined(__parallel)
27994 INTEGER :: msglen, my_tag
27995 COMPLEX(kind=real_8) :: foo(1)
27998 CALL mp_timeset(routinen, handle)
28000#if defined(__parallel)
28001#if !defined(__GNUC__) || __GNUC__ >= 9
28002 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
28005 IF (
PRESENT(tag)) my_tag = tag
28007 msglen =
SIZE(msgin)
28008 IF (msglen > 0)
THEN
28009 CALL mpi_isend(msgin(1), msglen, mpi_double_complex, dest, my_tag, &
28010 comm%handle, request%handle, ierr)
28012 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
28013 comm%handle, request%handle, ierr)
28015 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
28017 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
28026 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
28028 CALL mp_timestop(handle)
28029 END SUBROUTINE mp_isend_zv
28046 SUBROUTINE mp_isend_zm2(msgin, dest, comm, request, tag)
28047 COMPLEX(kind=real_8),
DIMENSION(:, :),
INTENT(IN) :: msgin
28048 INTEGER,
INTENT(IN) :: dest
28051 INTEGER,
INTENT(in),
OPTIONAL :: tag
28053 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm2'
28055 INTEGER :: handle, ierr
28056#if defined(__parallel)
28057 INTEGER :: msglen, my_tag
28058 COMPLEX(kind=real_8) :: foo(1)
28061 CALL mp_timeset(routinen, handle)
28063#if defined(__parallel)
28064#if !defined(__GNUC__) || __GNUC__ >= 9
28065 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
28069 IF (
PRESENT(tag)) my_tag = tag
28071 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
28072 IF (msglen > 0)
THEN
28073 CALL mpi_isend(msgin(1, 1), msglen, mpi_double_complex, dest, my_tag, &
28074 comm%handle, request%handle, ierr)
28076 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
28077 comm%handle, request%handle, ierr)
28079 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
28081 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
28090 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
28092 CALL mp_timestop(handle)
28093 END SUBROUTINE mp_isend_zm2
28112 SUBROUTINE mp_isend_zm3(msgin, dest, comm, request, tag)
28113 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
28114 INTEGER,
INTENT(IN) :: dest
28117 INTEGER,
INTENT(in),
OPTIONAL :: tag
28119 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm3'
28121 INTEGER :: handle, ierr
28122#if defined(__parallel)
28123 INTEGER :: msglen, my_tag
28124 COMPLEX(kind=real_8) :: foo(1)
28127 CALL mp_timeset(routinen, handle)
28129#if defined(__parallel)
28130#if !defined(__GNUC__) || __GNUC__ >= 9
28131 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
28135 IF (
PRESENT(tag)) my_tag = tag
28137 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
28138 IF (msglen > 0)
THEN
28139 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_double_complex, dest, my_tag, &
28140 comm%handle, request%handle, ierr)
28142 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
28143 comm%handle, request%handle, ierr)
28145 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
28147 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
28156 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
28158 CALL mp_timestop(handle)
28159 END SUBROUTINE mp_isend_zm3
28175 SUBROUTINE mp_isend_zm4(msgin, dest, comm, request, tag)
28176 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
28177 INTEGER,
INTENT(IN) :: dest
28180 INTEGER,
INTENT(in),
OPTIONAL :: tag
28182 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_zm4'
28184 INTEGER :: handle, ierr
28185#if defined(__parallel)
28186 INTEGER :: msglen, my_tag
28187 COMPLEX(kind=real_8) :: foo(1)
28190 CALL mp_timeset(routinen, handle)
28192#if defined(__parallel)
28193#if !defined(__GNUC__) || __GNUC__ >= 9
28194 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
28198 IF (
PRESENT(tag)) my_tag = tag
28200 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
28201 IF (msglen > 0)
THEN
28202 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_double_complex, dest, my_tag, &
28203 comm%handle, request%handle, ierr)
28205 CALL mpi_isend(foo, msglen, mpi_double_complex, dest, my_tag, &
28206 comm%handle, request%handle, ierr)
28208 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
28210 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_8_size))
28219 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
28221 CALL mp_timestop(handle)
28222 END SUBROUTINE mp_isend_zm4
28238 SUBROUTINE mp_irecv_zv(msgout, source, comm, request, tag)
28239 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT) :: msgout
28240 INTEGER,
INTENT(IN) :: source
28243 INTEGER,
INTENT(in),
OPTIONAL :: tag
28245 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zv'
28248#if defined(__parallel)
28249 INTEGER :: ierr, msglen, my_tag
28250 COMPLEX(kind=real_8) :: foo(1)
28253 CALL mp_timeset(routinen, handle)
28255#if defined(__parallel)
28256#if !defined(__GNUC__) || __GNUC__ >= 9
28257 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
28261 IF (
PRESENT(tag)) my_tag = tag
28263 msglen =
SIZE(msgout)
28264 IF (msglen > 0)
THEN
28265 CALL mpi_irecv(msgout(1), msglen, mpi_double_complex, source, my_tag, &
28266 comm%handle, request%handle, ierr)
28268 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
28269 comm%handle, request%handle, ierr)
28271 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
28273 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
28275 cpabort(
"mp_irecv called in non parallel case")
28282 CALL mp_timestop(handle)
28283 END SUBROUTINE mp_irecv_zv
28300 SUBROUTINE mp_irecv_zm2(msgout, source, comm, request, tag)
28301 COMPLEX(kind=real_8),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
28302 INTEGER,
INTENT(IN) :: source
28305 INTEGER,
INTENT(in),
OPTIONAL :: tag
28307 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm2'
28310#if defined(__parallel)
28311 INTEGER :: ierr, msglen, my_tag
28312 COMPLEX(kind=real_8) :: foo(1)
28315 CALL mp_timeset(routinen, handle)
28317#if defined(__parallel)
28318#if !defined(__GNUC__) || __GNUC__ >= 9
28319 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
28323 IF (
PRESENT(tag)) my_tag = tag
28325 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
28326 IF (msglen > 0)
THEN
28327 CALL mpi_irecv(msgout(1, 1), msglen, mpi_double_complex, source, my_tag, &
28328 comm%handle, request%handle, ierr)
28330 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
28331 comm%handle, request%handle, ierr)
28333 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
28335 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
28342 cpabort(
"mp_irecv called in non parallel case")
28344 CALL mp_timestop(handle)
28345 END SUBROUTINE mp_irecv_zm2
28363 SUBROUTINE mp_irecv_zm3(msgout, source, comm, request, tag)
28364 COMPLEX(kind=real_8),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
28365 INTEGER,
INTENT(IN) :: source
28368 INTEGER,
INTENT(in),
OPTIONAL :: tag
28370 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm3'
28373#if defined(__parallel)
28374 INTEGER :: ierr, msglen, my_tag
28375 COMPLEX(kind=real_8) :: foo(1)
28378 CALL mp_timeset(routinen, handle)
28380#if defined(__parallel)
28381#if !defined(__GNUC__) || __GNUC__ >= 9
28382 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
28386 IF (
PRESENT(tag)) my_tag = tag
28388 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
28389 IF (msglen > 0)
THEN
28390 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_double_complex, source, my_tag, &
28391 comm%handle, request%handle, ierr)
28393 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
28394 comm%handle, request%handle, ierr)
28396 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
28398 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
28405 cpabort(
"mp_irecv called in non parallel case")
28407 CALL mp_timestop(handle)
28408 END SUBROUTINE mp_irecv_zm3
28424 SUBROUTINE mp_irecv_zm4(msgout, source, comm, request, tag)
28425 COMPLEX(kind=real_8),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
28426 INTEGER,
INTENT(IN) :: source
28429 INTEGER,
INTENT(in),
OPTIONAL :: tag
28431 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_zm4'
28434#if defined(__parallel)
28435 INTEGER :: ierr, msglen, my_tag
28436 COMPLEX(kind=real_8) :: foo(1)
28439 CALL mp_timeset(routinen, handle)
28441#if defined(__parallel)
28442#if !defined(__GNUC__) || __GNUC__ >= 9
28443 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
28447 IF (
PRESENT(tag)) my_tag = tag
28449 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
28450 IF (msglen > 0)
THEN
28451 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_double_complex, source, my_tag, &
28452 comm%handle, request%handle, ierr)
28454 CALL mpi_irecv(foo, msglen, mpi_double_complex, source, my_tag, &
28455 comm%handle, request%handle, ierr)
28457 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
28459 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_8_size))
28466 cpabort(
"mp_irecv called in non parallel case")
28468 CALL mp_timestop(handle)
28469 END SUBROUTINE mp_irecv_zm4
28481 SUBROUTINE mp_win_create_zv(base, comm, win)
28482 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
28486 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_zv'
28489#if defined(__parallel)
28491 INTEGER(kind=mpi_address_kind) :: len
28492 COMPLEX(kind=real_8) :: foo(1)
28495 CALL mp_timeset(routinen, handle)
28497#if defined(__parallel)
28499 len =
SIZE(base)*(2*real_8_size)
28501 CALL mpi_win_create(base(1), len, (2*real_8_size), mpi_info_null, comm%handle, win%handle, ierr)
28503 CALL mpi_win_create(foo, len, (2*real_8_size), mpi_info_null, comm%handle, win%handle, ierr)
28505 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
28507 CALL add_perf(perf_id=20, count=1)
28511 win%handle = mp_win_null_handle
28513 CALL mp_timestop(handle)
28514 END SUBROUTINE mp_win_create_zv
28526 SUBROUTINE mp_rget_zv(base, source, win, win_data, myproc, disp, request, &
28527 origin_datatype, target_datatype)
28528 COMPLEX(kind=real_8),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
28529 INTEGER,
INTENT(IN) :: source
28531 COMPLEX(kind=real_8),
DIMENSION(:),
INTENT(IN) :: win_data
28532 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
28536 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_zv'
28539#if defined(__parallel)
28540 INTEGER :: ierr, len, &
28541 origin_len, target_len
28542 LOGICAL :: do_local_copy
28543 INTEGER(kind=mpi_address_kind) :: disp_aint
28544 mpi_data_type :: handle_origin_datatype, handle_target_datatype
28547 CALL mp_timeset(routinen, handle)
28549#if defined(__parallel)
28552 IF (
PRESENT(disp))
THEN
28553 disp_aint = int(disp, kind=mpi_address_kind)
28555 handle_origin_datatype = mpi_double_complex
28557 IF (
PRESENT(origin_datatype))
THEN
28558 handle_origin_datatype = origin_datatype%type_handle
28561 handle_target_datatype = mpi_double_complex
28563 IF (
PRESENT(target_datatype))
THEN
28564 handle_target_datatype = target_datatype%type_handle
28568 do_local_copy = .false.
28569 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
28570 IF (myproc .EQ. source) do_local_copy = .true.
28572 IF (do_local_copy)
THEN
28574 base(:) = win_data(disp_aint + 1:disp_aint + len)
28579 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
28580 target_len, handle_target_datatype, win%handle, request%handle, ierr)
28586 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
28588 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*(2*real_8_size))
28593 mark_used(origin_datatype)
28594 mark_used(target_datatype)
28598 IF (
PRESENT(disp))
THEN
28599 base(:) = win_data(disp + 1:disp +
SIZE(base))
28601 base(:) = win_data(:
SIZE(base))
28605 CALL mp_timestop(handle)
28606 END SUBROUTINE mp_rget_zv
28616 result(type_descriptor)
28617 INTEGER,
INTENT(IN) :: count
28618 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
28621 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_z'
28624#if defined(__parallel)
28628 CALL mp_timeset(routinen, handle)
28630#if defined(__parallel)
28631 CALL mpi_type_indexed(count, lengths, displs, mpi_double_complex, &
28632 type_descriptor%type_handle, ierr)
28634 cpabort(
"MPI_Type_Indexed @ "//routinen)
28635 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
28637 cpabort(
"MPI_Type_commit @ "//routinen)
28639 type_descriptor%type_handle = 7
28641 type_descriptor%length = count
28642 NULLIFY (type_descriptor%subtype)
28643 type_descriptor%vector_descriptor(1:2) = 1
28644 type_descriptor%has_indexing = .true.
28645 type_descriptor%index_descriptor%index => lengths
28646 type_descriptor%index_descriptor%chunks => displs
28648 CALL mp_timestop(handle)
28659 SUBROUTINE mp_allocate_z (DATA, len, stat)
28660 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
28661 INTEGER,
INTENT(IN) :: len
28662 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28664 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_z'
28666 INTEGER :: handle, ierr
28668 CALL mp_timeset(routinen, handle)
28670#if defined(__parallel)
28672 CALL mp_alloc_mem(
DATA, len, stat=ierr)
28673 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
28674 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
28675 CALL add_perf(perf_id=15, count=1)
28677 ALLOCATE (
DATA(len), stat=ierr)
28678 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
28679 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
28681 IF (
PRESENT(stat)) stat = ierr
28682 CALL mp_timestop(handle)
28683 END SUBROUTINE mp_allocate_z
28691 SUBROUTINE mp_deallocate_z (DATA, stat)
28692 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
28693 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28695 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_z'
28698#if defined(__parallel)
28702 CALL mp_timeset(routinen, handle)
28704#if defined(__parallel)
28705 CALL mp_free_mem(
DATA, ierr)
28706 IF (
PRESENT(stat))
THEN
28709 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
28712 CALL add_perf(perf_id=15, count=1)
28715 IF (
PRESENT(stat)) stat = 0
28717 CALL mp_timestop(handle)
28718 END SUBROUTINE mp_deallocate_z
28731 SUBROUTINE mp_file_write_at_zv(fh, offset, msg, msglen)
28732 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
28734 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28735 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28738#if defined(__parallel)
28742 msg_len =
SIZE(msg)
28743 IF (
PRESENT(msglen)) msg_len = msglen
28744#if defined(__parallel)
28745 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28747 cpabort(
"mpi_file_write_at_zv @ mp_file_write_at_zv")
28749 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28751 END SUBROUTINE mp_file_write_at_zv
28759 SUBROUTINE mp_file_write_at_z (fh, offset, msg)
28760 COMPLEX(kind=real_8),
INTENT(IN) :: msg
28762 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28764#if defined(__parallel)
28768 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28770 cpabort(
"mpi_file_write_at_z @ mp_file_write_at_z")
28772 WRITE (unit=fh%handle, pos=offset + 1) msg
28774 END SUBROUTINE mp_file_write_at_z
28786 SUBROUTINE mp_file_write_at_all_zv(fh, offset, msg, msglen)
28787 COMPLEX(kind=real_8),
CONTIGUOUS,
INTENT(IN) :: msg(:)
28789 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28790 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28793#if defined(__parallel)
28797 msg_len =
SIZE(msg)
28798 IF (
PRESENT(msglen)) msg_len = msglen
28799#if defined(__parallel)
28800 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28802 cpabort(
"mpi_file_write_at_all_zv @ mp_file_write_at_all_zv")
28804 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28806 END SUBROUTINE mp_file_write_at_all_zv
28814 SUBROUTINE mp_file_write_at_all_z (fh, offset, msg)
28815 COMPLEX(kind=real_8),
INTENT(IN) :: msg
28817 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28819#if defined(__parallel)
28823 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28825 cpabort(
"mpi_file_write_at_all_z @ mp_file_write_at_all_z")
28827 WRITE (unit=fh%handle, pos=offset + 1) msg
28829 END SUBROUTINE mp_file_write_at_all_z
28842 SUBROUTINE mp_file_read_at_zv(fh, offset, msg, msglen)
28843 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
28845 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28846 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28849#if defined(__parallel)
28853 msg_len =
SIZE(msg)
28854 IF (
PRESENT(msglen)) msg_len = msglen
28855#if defined(__parallel)
28856 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28858 cpabort(
"mpi_file_read_at_zv @ mp_file_read_at_zv")
28860 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28862 END SUBROUTINE mp_file_read_at_zv
28870 SUBROUTINE mp_file_read_at_z (fh, offset, msg)
28871 COMPLEX(kind=real_8),
INTENT(OUT) :: msg
28873 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28875#if defined(__parallel)
28879 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28881 cpabort(
"mpi_file_read_at_z @ mp_file_read_at_z")
28883 READ (unit=fh%handle, pos=offset + 1) msg
28885 END SUBROUTINE mp_file_read_at_z
28897 SUBROUTINE mp_file_read_at_all_zv(fh, offset, msg, msglen)
28898 COMPLEX(kind=real_8),
INTENT(OUT),
CONTIGUOUS :: msg(:)
28900 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
28901 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28904#if defined(__parallel)
28908 msg_len =
SIZE(msg)
28909 IF (
PRESENT(msglen)) msg_len = msglen
28910#if defined(__parallel)
28911 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_double_complex, mpi_status_ignore, ierr)
28913 cpabort(
"mpi_file_read_at_all_zv @ mp_file_read_at_all_zv")
28915 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
28917 END SUBROUTINE mp_file_read_at_all_zv
28925 SUBROUTINE mp_file_read_at_all_z (fh, offset, msg)
28926 COMPLEX(kind=real_8),
INTENT(OUT) :: msg
28928 INTEGER(kind=file_offset),
INTENT(IN) :: offset
28930#if defined(__parallel)
28934 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_double_complex, mpi_status_ignore, ierr)
28936 cpabort(
"mpi_file_read_at_all_z @ mp_file_read_at_all_z")
28938 READ (unit=fh%handle, pos=offset + 1) msg
28940 END SUBROUTINE mp_file_read_at_all_z
28949 FUNCTION mp_type_make_z (ptr, &
28950 vector_descriptor, index_descriptor) &
28951 result(type_descriptor)
28952 COMPLEX(kind=real_8),
DIMENSION(:),
TARGET, asynchronous :: ptr
28953 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
28954 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
28957 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_z'
28959#if defined(__parallel)
28961#if defined(__MPI_F08)
28963 EXTERNAL :: mpi_get_address
28967 NULLIFY (type_descriptor%subtype)
28968 type_descriptor%length =
SIZE(ptr)
28969#if defined(__parallel)
28970 type_descriptor%type_handle = mpi_double_complex
28971 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
28973 cpabort(
"MPI_Get_address @ "//routinen)
28975 type_descriptor%type_handle = 7
28977 type_descriptor%vector_descriptor(1:2) = 1
28978 type_descriptor%has_indexing = .false.
28979 type_descriptor%data_z => ptr
28980 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
28981 cpabort(routinen//
": Vectors and indices NYI")
28983 END FUNCTION mp_type_make_z
28992 SUBROUTINE mp_alloc_mem_z (DATA, len, stat)
28993 COMPLEX(kind=real_8),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
28994 INTEGER,
INTENT(IN) :: len
28995 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
28997#if defined(__parallel)
28998 INTEGER :: size, ierr, length, &
29000 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
29001 TYPE(c_ptr) :: mp_baseptr
29002 mpi_info_type :: mp_info
29004 length = max(len, 1)
29005 CALL mpi_type_size(mpi_double_complex,
size, ierr)
29006 mp_size = int(length, kind=mpi_address_kind)*
size
29007 IF (mp_size .GT. mp_max_memory_size)
THEN
29008 cpabort(
"MPI cannot allocate more than 2 GiByte")
29010 mp_info = mpi_info_null
29011 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
29012 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
29013 IF (
PRESENT(stat)) stat = mp_res
29015 INTEGER :: length, mystat
29016 length = max(len, 1)
29017 IF (
PRESENT(stat))
THEN
29018 ALLOCATE (
DATA(length), stat=mystat)
29021 ALLOCATE (
DATA(length))
29024 END SUBROUTINE mp_alloc_mem_z
29032 SUBROUTINE mp_free_mem_z (DATA, stat)
29033 COMPLEX(kind=real_8),
DIMENSION(:), &
29034 POINTER, asynchronous :: data
29035 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
29037#if defined(__parallel)
29039 CALL mpi_free_mem(
DATA, mp_res)
29040 IF (
PRESENT(stat)) stat = mp_res
29043 IF (
PRESENT(stat)) stat = 0
29045 END SUBROUTINE mp_free_mem_z
29057 SUBROUTINE mp_shift_cm(msg, comm, displ_in)
29059 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29061 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
29063 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_cm'
29065 INTEGER :: handle, ierror
29066#if defined(__parallel)
29067 INTEGER :: displ, left, &
29068 msglen, myrank, nprocs, &
29073 CALL mp_timeset(routinen, handle)
29075#if defined(__parallel)
29076 CALL mpi_comm_rank(comm%handle, myrank, ierror)
29077 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
29078 CALL mpi_comm_size(comm%handle, nprocs, ierror)
29079 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
29080 IF (
PRESENT(displ_in))
THEN
29085 right =
modulo(myrank + displ, nprocs)
29086 left =
modulo(myrank - displ, nprocs)
29089 CALL mpi_sendrecv_replace(msg, msglen, mpi_complex, right, tag, left, tag, &
29090 comm%handle, mpi_status_ignore, ierror)
29091 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
29092 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_4_size))
29096 mark_used(displ_in)
29098 CALL mp_timestop(handle)
29100 END SUBROUTINE mp_shift_cm
29113 SUBROUTINE mp_shift_c (msg, comm, displ_in)
29115 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29117 INTEGER,
INTENT(IN),
OPTIONAL :: displ_in
29119 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_shift_c'
29121 INTEGER :: handle, ierror
29122#if defined(__parallel)
29123 INTEGER :: displ, left, &
29124 msglen, myrank, nprocs, &
29129 CALL mp_timeset(routinen, handle)
29131#if defined(__parallel)
29132 CALL mpi_comm_rank(comm%handle, myrank, ierror)
29133 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_rank @ "//routinen)
29134 CALL mpi_comm_size(comm%handle, nprocs, ierror)
29135 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_comm_size @ "//routinen)
29136 IF (
PRESENT(displ_in))
THEN
29141 right =
modulo(myrank + displ, nprocs)
29142 left =
modulo(myrank - displ, nprocs)
29145 CALL mpi_sendrecv_replace(msg, msglen, mpi_complex, right, tag, left, &
29146 tag, comm%handle, mpi_status_ignore, ierror)
29147 IF (ierror /= 0)
CALL mp_stop(ierror,
"mpi_sendrecv_replace @ "//routinen)
29148 CALL add_perf(perf_id=7, count=1, msg_size=msglen*(2*real_4_size))
29152 mark_used(displ_in)
29154 CALL mp_timestop(handle)
29156 END SUBROUTINE mp_shift_c
29177 SUBROUTINE mp_alltoall_c11v(sb, scount, sdispl, rb, rcount, rdispl, comm)
29179 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: sb
29180 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
29181 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: rb
29182 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
29185 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c11v'
29188#if defined(__parallel)
29189 INTEGER :: ierr, msglen
29194 CALL mp_timeset(routinen, handle)
29196#if defined(__parallel)
29197 CALL mpi_alltoallv(sb, scount, sdispl, mpi_complex, &
29198 rb, rcount, rdispl, mpi_complex, comm%handle, ierr)
29199 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
29200 msglen = sum(scount) + sum(rcount)
29201 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29207 DO i = 1, rcount(1)
29208 rb(rdispl(1) + i) = sb(sdispl(1) + i)
29211 CALL mp_timestop(handle)
29213 END SUBROUTINE mp_alltoall_c11v
29228 SUBROUTINE mp_alltoall_c22v(sb, scount, sdispl, rb, rcount, rdispl, comm)
29230 COMPLEX(kind=real_4),
DIMENSION(:, :), &
29231 INTENT(IN),
CONTIGUOUS :: sb
29232 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: scount, sdispl
29233 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS, &
29234 INTENT(INOUT) :: rb
29235 INTEGER,
DIMENSION(:),
INTENT(IN),
CONTIGUOUS :: rcount, rdispl
29238 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c22v'
29241#if defined(__parallel)
29242 INTEGER :: ierr, msglen
29245 CALL mp_timeset(routinen, handle)
29247#if defined(__parallel)
29248 CALL mpi_alltoallv(sb, scount, sdispl, mpi_complex, &
29249 rb, rcount, rdispl, mpi_complex, comm%handle, ierr)
29250 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoallv @ "//routinen)
29251 msglen = sum(scount) + sum(rcount)
29252 CALL add_perf(perf_id=6, count=1, msg_size=msglen*2*(2*real_4_size))
29261 CALL mp_timestop(handle)
29263 END SUBROUTINE mp_alltoall_c22v
29280 SUBROUTINE mp_alltoall_c (sb, rb, count, comm)
29282 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sb
29283 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: rb
29284 INTEGER,
INTENT(IN) :: count
29287 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c'
29290#if defined(__parallel)
29291 INTEGER :: ierr, msglen, np
29294 CALL mp_timeset(routinen, handle)
29296#if defined(__parallel)
29297 CALL mpi_alltoall(sb, count, mpi_complex, &
29298 rb, count, mpi_complex, comm%handle, ierr)
29299 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29300 CALL mpi_comm_size(comm%handle, np, ierr)
29301 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29302 msglen = 2*count*np
29303 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29309 CALL mp_timestop(handle)
29311 END SUBROUTINE mp_alltoall_c
29321 SUBROUTINE mp_alltoall_c22(sb, rb, count, comm)
29323 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sb
29324 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: rb
29325 INTEGER,
INTENT(IN) :: count
29328 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c22'
29331#if defined(__parallel)
29332 INTEGER :: ierr, msglen, np
29335 CALL mp_timeset(routinen, handle)
29337#if defined(__parallel)
29338 CALL mpi_alltoall(sb, count, mpi_complex, &
29339 rb, count, mpi_complex, comm%handle, ierr)
29340 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29341 CALL mpi_comm_size(comm%handle, np, ierr)
29342 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29343 msglen = 2*
SIZE(sb)*np
29344 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29350 CALL mp_timestop(handle)
29352 END SUBROUTINE mp_alltoall_c22
29362 SUBROUTINE mp_alltoall_c33(sb, rb, count, comm)
29364 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
29365 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS,
INTENT(OUT) :: rb
29366 INTEGER,
INTENT(IN) :: count
29369 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c33'
29372#if defined(__parallel)
29373 INTEGER :: ierr, msglen, np
29376 CALL mp_timeset(routinen, handle)
29378#if defined(__parallel)
29379 CALL mpi_alltoall(sb, count, mpi_complex, &
29380 rb, count, mpi_complex, comm%handle, ierr)
29381 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29382 CALL mpi_comm_size(comm%handle, np, ierr)
29383 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29384 msglen = 2*count*np
29385 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29391 CALL mp_timestop(handle)
29393 END SUBROUTINE mp_alltoall_c33
29403 SUBROUTINE mp_alltoall_c44(sb, rb, count, comm)
29405 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
29407 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
29409 INTEGER,
INTENT(IN) :: count
29412 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c44'
29415#if defined(__parallel)
29416 INTEGER :: ierr, msglen, np
29419 CALL mp_timeset(routinen, handle)
29421#if defined(__parallel)
29422 CALL mpi_alltoall(sb, count, mpi_complex, &
29423 rb, count, mpi_complex, comm%handle, ierr)
29424 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29425 CALL mpi_comm_size(comm%handle, np, ierr)
29426 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29427 msglen = 2*count*np
29428 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29434 CALL mp_timestop(handle)
29436 END SUBROUTINE mp_alltoall_c44
29446 SUBROUTINE mp_alltoall_c55(sb, rb, count, comm)
29448 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
29450 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :, :),
CONTIGUOUS, &
29452 INTEGER,
INTENT(IN) :: count
29455 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c55'
29458#if defined(__parallel)
29459 INTEGER :: ierr, msglen, np
29462 CALL mp_timeset(routinen, handle)
29464#if defined(__parallel)
29465 CALL mpi_alltoall(sb, count, mpi_complex, &
29466 rb, count, mpi_complex, comm%handle, ierr)
29467 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29468 CALL mpi_comm_size(comm%handle, np, ierr)
29469 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29470 msglen = 2*count*np
29471 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29477 CALL mp_timestop(handle)
29479 END SUBROUTINE mp_alltoall_c55
29490 SUBROUTINE mp_alltoall_c45(sb, rb, count, comm)
29492 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
29494 COMPLEX(kind=real_4), &
29495 DIMENSION(:, :, :, :, :),
INTENT(OUT),
CONTIGUOUS :: rb
29496 INTEGER,
INTENT(IN) :: count
29499 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c45'
29502#if defined(__parallel)
29503 INTEGER :: ierr, msglen, np
29506 CALL mp_timeset(routinen, handle)
29508#if defined(__parallel)
29509 CALL mpi_alltoall(sb, count, mpi_complex, &
29510 rb, count, mpi_complex, comm%handle, ierr)
29511 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29512 CALL mpi_comm_size(comm%handle, np, ierr)
29513 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29514 msglen = 2*count*np
29515 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29519 rb = reshape(sb, shape(rb))
29521 CALL mp_timestop(handle)
29523 END SUBROUTINE mp_alltoall_c45
29534 SUBROUTINE mp_alltoall_c34(sb, rb, count, comm)
29536 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
CONTIGUOUS, &
29538 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
29540 INTEGER,
INTENT(IN) :: count
29543 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c34'
29546#if defined(__parallel)
29547 INTEGER :: ierr, msglen, np
29550 CALL mp_timeset(routinen, handle)
29552#if defined(__parallel)
29553 CALL mpi_alltoall(sb, count, mpi_complex, &
29554 rb, count, mpi_complex, comm%handle, ierr)
29555 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29556 CALL mpi_comm_size(comm%handle, np, ierr)
29557 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29558 msglen = 2*count*np
29559 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29563 rb = reshape(sb, shape(rb))
29565 CALL mp_timestop(handle)
29567 END SUBROUTINE mp_alltoall_c34
29578 SUBROUTINE mp_alltoall_c54(sb, rb, count, comm)
29580 COMPLEX(kind=real_4), &
29581 DIMENSION(:, :, :, :, :),
CONTIGUOUS,
INTENT(IN) :: sb
29582 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
CONTIGUOUS, &
29584 INTEGER,
INTENT(IN) :: count
29587 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_alltoall_c54'
29590#if defined(__parallel)
29591 INTEGER :: ierr, msglen, np
29594 CALL mp_timeset(routinen, handle)
29596#if defined(__parallel)
29597 CALL mpi_alltoall(sb, count, mpi_complex, &
29598 rb, count, mpi_complex, comm%handle, ierr)
29599 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_alltoall @ "//routinen)
29600 CALL mpi_comm_size(comm%handle, np, ierr)
29601 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_size @ "//routinen)
29602 msglen = 2*count*np
29603 CALL add_perf(perf_id=6, count=1, msg_size=msglen*(2*real_4_size))
29607 rb = reshape(sb, shape(rb))
29609 CALL mp_timestop(handle)
29611 END SUBROUTINE mp_alltoall_c54
29622 SUBROUTINE mp_send_c (msg, dest, tag, comm)
29623 COMPLEX(kind=real_4),
INTENT(IN) :: msg
29624 INTEGER,
INTENT(IN) :: dest, tag
29627 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_c'
29630#if defined(__parallel)
29631 INTEGER :: ierr, msglen
29634 CALL mp_timeset(routinen, handle)
29636#if defined(__parallel)
29638 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29639 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29640 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29647 cpabort(
"not in parallel mode")
29649 CALL mp_timestop(handle)
29650 END SUBROUTINE mp_send_c
29660 SUBROUTINE mp_send_cv(msg, dest, tag, comm)
29661 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
29662 INTEGER,
INTENT(IN) :: dest, tag
29665 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_cv'
29668#if defined(__parallel)
29669 INTEGER :: ierr, msglen
29672 CALL mp_timeset(routinen, handle)
29674#if defined(__parallel)
29676 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29677 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29678 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29685 cpabort(
"not in parallel mode")
29687 CALL mp_timestop(handle)
29688 END SUBROUTINE mp_send_cv
29698 SUBROUTINE mp_send_cm2(msg, dest, tag, comm)
29699 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
29700 INTEGER,
INTENT(IN) :: dest, tag
29703 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_cm2'
29706#if defined(__parallel)
29707 INTEGER :: ierr, msglen
29710 CALL mp_timeset(routinen, handle)
29712#if defined(__parallel)
29714 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29715 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29716 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29723 cpabort(
"not in parallel mode")
29725 CALL mp_timestop(handle)
29726 END SUBROUTINE mp_send_cm2
29736 SUBROUTINE mp_send_cm3(msg, dest, tag, comm)
29737 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :, :)
29738 INTEGER,
INTENT(IN) :: dest, tag
29741 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_send_${nametype1}m3'
29744#if defined(__parallel)
29745 INTEGER :: ierr, msglen
29748 CALL mp_timeset(routinen, handle)
29750#if defined(__parallel)
29752 CALL mpi_send(msg, msglen, mpi_complex, dest, tag, comm%handle, ierr)
29753 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_send @ "//routinen)
29754 CALL add_perf(perf_id=13, count=1, msg_size=msglen*(2*real_4_size))
29761 cpabort(
"not in parallel mode")
29763 CALL mp_timestop(handle)
29764 END SUBROUTINE mp_send_cm3
29775 SUBROUTINE mp_recv_c (msg, source, tag, comm)
29776 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29777 INTEGER,
INTENT(INOUT) :: source, tag
29780 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_c'
29783#if defined(__parallel)
29784 INTEGER :: ierr, msglen
29785 mpi_status_type :: status
29788 CALL mp_timeset(routinen, handle)
29790#if defined(__parallel)
29793 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29794 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29796 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29797 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29798 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29799 source = status mpi_status_extract(mpi_source)
29800 tag = status mpi_status_extract(mpi_tag)
29808 cpabort(
"not in parallel mode")
29810 CALL mp_timestop(handle)
29811 END SUBROUTINE mp_recv_c
29821 SUBROUTINE mp_recv_cv(msg, source, tag, comm)
29822 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
29823 INTEGER,
INTENT(INOUT) :: source, tag
29826 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cv'
29829#if defined(__parallel)
29830 INTEGER :: ierr, msglen
29831 mpi_status_type :: status
29834 CALL mp_timeset(routinen, handle)
29836#if defined(__parallel)
29839 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29840 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29842 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29843 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29844 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29845 source = status mpi_status_extract(mpi_source)
29846 tag = status mpi_status_extract(mpi_tag)
29854 cpabort(
"not in parallel mode")
29856 CALL mp_timestop(handle)
29857 END SUBROUTINE mp_recv_cv
29867 SUBROUTINE mp_recv_cm2(msg, source, tag, comm)
29868 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
29869 INTEGER,
INTENT(INOUT) :: source, tag
29872 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cm2'
29875#if defined(__parallel)
29876 INTEGER :: ierr, msglen
29877 mpi_status_type :: status
29880 CALL mp_timeset(routinen, handle)
29882#if defined(__parallel)
29885 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29886 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29888 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29889 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29890 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29891 source = status mpi_status_extract(mpi_source)
29892 tag = status mpi_status_extract(mpi_tag)
29900 cpabort(
"not in parallel mode")
29902 CALL mp_timestop(handle)
29903 END SUBROUTINE mp_recv_cm2
29913 SUBROUTINE mp_recv_cm3(msg, source, tag, comm)
29914 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :)
29915 INTEGER,
INTENT(INOUT) :: source, tag
29918 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_recv_cm3'
29921#if defined(__parallel)
29922 INTEGER :: ierr, msglen
29923 mpi_status_type :: status
29926 CALL mp_timeset(routinen, handle)
29928#if defined(__parallel)
29931 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, mpi_status_ignore, ierr)
29932 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29934 CALL mpi_recv(msg, msglen, mpi_complex, source, tag, comm%handle, status, ierr)
29935 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_recv @ "//routinen)
29936 CALL add_perf(perf_id=14, count=1, msg_size=msglen*(2*real_4_size))
29937 source = status mpi_status_extract(mpi_source)
29938 tag = status mpi_status_extract(mpi_tag)
29946 cpabort(
"not in parallel mode")
29948 CALL mp_timestop(handle)
29949 END SUBROUTINE mp_recv_cm3
29959 SUBROUTINE mp_bcast_c (msg, source, comm)
29960 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29961 INTEGER,
INTENT(IN) :: source
29964 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c'
29967#if defined(__parallel)
29968 INTEGER :: ierr, msglen
29971 CALL mp_timeset(routinen, handle)
29973#if defined(__parallel)
29975 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
29976 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
29977 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
29983 CALL mp_timestop(handle)
29984 END SUBROUTINE mp_bcast_c
29993 SUBROUTINE mp_bcast_c_src(msg, comm)
29994 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
29997 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c_src'
30000#if defined(__parallel)
30001 INTEGER :: ierr, msglen
30004 CALL mp_timeset(routinen, handle)
30006#if defined(__parallel)
30008 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
30009 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
30010 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
30015 CALL mp_timestop(handle)
30016 END SUBROUTINE mp_bcast_c_src
30026 SUBROUTINE mp_ibcast_c (msg, source, comm, request)
30027 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30028 INTEGER,
INTENT(IN) :: source
30032 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_c'
30035#if defined(__parallel)
30036 INTEGER :: ierr, msglen
30039 CALL mp_timeset(routinen, handle)
30041#if defined(__parallel)
30043 CALL mpi_ibcast(msg, msglen, mpi_complex, source, comm%handle, request%handle, ierr)
30044 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
30045 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_4_size))
30052 CALL mp_timestop(handle)
30053 END SUBROUTINE mp_ibcast_c
30062 SUBROUTINE mp_bcast_cv(msg, source, comm)
30063 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
30064 INTEGER,
INTENT(IN) :: source
30067 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cv'
30070#if defined(__parallel)
30071 INTEGER :: ierr, msglen
30074 CALL mp_timeset(routinen, handle)
30076#if defined(__parallel)
30078 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
30079 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
30080 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
30086 CALL mp_timestop(handle)
30087 END SUBROUTINE mp_bcast_cv
30095 SUBROUTINE mp_bcast_cv_src(msg, comm)
30096 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
30099 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cv_src'
30102#if defined(__parallel)
30103 INTEGER :: ierr, msglen
30106 CALL mp_timeset(routinen, handle)
30108#if defined(__parallel)
30110 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
30111 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
30112 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
30117 CALL mp_timestop(handle)
30118 END SUBROUTINE mp_bcast_cv_src
30127 SUBROUTINE mp_ibcast_cv(msg, source, comm, request)
30128 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
30129 INTEGER,
INTENT(IN) :: source
30133 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_ibcast_cv'
30136#if defined(__parallel)
30137 INTEGER :: ierr, msglen
30140 CALL mp_timeset(routinen, handle)
30142#if defined(__parallel)
30143#if !defined(__GNUC__) || __GNUC__ >= 9
30144 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
30147 CALL mpi_ibcast(msg, msglen, mpi_complex, source, comm%handle, request%handle, ierr)
30148 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ibcast @ "//routinen)
30149 CALL add_perf(perf_id=22, count=1, msg_size=msglen*(2*real_4_size))
30156 CALL mp_timestop(handle)
30157 END SUBROUTINE mp_ibcast_cv
30166 SUBROUTINE mp_bcast_cm(msg, source, comm)
30167 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30168 INTEGER,
INTENT(IN) :: source
30171 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cm'
30174#if defined(__parallel)
30175 INTEGER :: ierr, msglen
30178 CALL mp_timeset(routinen, handle)
30180#if defined(__parallel)
30182 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
30183 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
30184 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
30190 CALL mp_timestop(handle)
30191 END SUBROUTINE mp_bcast_cm
30200 SUBROUTINE mp_bcast_cm_src(msg, comm)
30201 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30204 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_cm_src'
30207#if defined(__parallel)
30208 INTEGER :: ierr, msglen
30211 CALL mp_timeset(routinen, handle)
30213#if defined(__parallel)
30215 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
30216 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
30217 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
30222 CALL mp_timestop(handle)
30223 END SUBROUTINE mp_bcast_cm_src
30232 SUBROUTINE mp_bcast_c3(msg, source, comm)
30233 COMPLEX(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
30234 INTEGER,
INTENT(IN) :: source
30237 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c3'
30240#if defined(__parallel)
30241 INTEGER :: ierr, msglen
30244 CALL mp_timeset(routinen, handle)
30246#if defined(__parallel)
30248 CALL mpi_bcast(msg, msglen, mpi_complex, source, comm%handle, ierr)
30249 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
30250 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
30256 CALL mp_timestop(handle)
30257 END SUBROUTINE mp_bcast_c3
30266 SUBROUTINE mp_bcast_c3_src(msg, comm)
30267 COMPLEX(kind=real_4),
CONTIGUOUS :: msg(:, :, :)
30270 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_bcast_c3_src'
30273#if defined(__parallel)
30274 INTEGER :: ierr, msglen
30277 CALL mp_timeset(routinen, handle)
30279#if defined(__parallel)
30281 CALL mpi_bcast(msg, msglen, mpi_complex, comm%source, comm%handle, ierr)
30282 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_bcast @ "//routinen)
30283 CALL add_perf(perf_id=2, count=1, msg_size=msglen*(2*real_4_size))
30288 CALL mp_timestop(handle)
30289 END SUBROUTINE mp_bcast_c3_src
30298 SUBROUTINE mp_sum_c (msg, comm)
30299 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30302 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_c'
30305#if defined(__parallel)
30306 INTEGER :: ierr, msglen
30307 COMPLEX(kind=real_4) :: res
30310 CALL mp_timeset(routinen, handle)
30312#if defined(__parallel)
30314 IF (comm%num_pe > 1)
THEN
30315 CALL mpi_allreduce(msg, res, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
30316 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30319 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30324 CALL mp_timestop(handle)
30325 END SUBROUTINE mp_sum_c
30333 SUBROUTINE mp_sum_cv(msg, comm)
30334 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
30337 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cv'
30340#if defined(__parallel)
30341 INTEGER :: ierr, msglen
30342 COMPLEX(kind=real_4),
ALLOCATABLE :: msgbuf(:)
30345 CALL mp_timeset(routinen, handle)
30347#if defined(__parallel)
30349 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
30350 ALLOCATE (msgbuf(msglen))
30351 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
30352 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30355 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30360 CALL mp_timestop(handle)
30361 END SUBROUTINE mp_sum_cv
30369 SUBROUTINE mp_isum_cv(msg, comm, request)
30370 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
30374 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isum_cv'
30377#if defined(__parallel)
30378 INTEGER :: ierr, msglen
30381 CALL mp_timeset(routinen, handle)
30383#if defined(__parallel)
30384#if !defined(__GNUC__) || __GNUC__ >= 9
30385 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
30388 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
30389 CALL mpi_iallreduce(mpi_in_place, msg, msglen, mpi_complex, mpi_sum, comm%handle, request%handle, ierr)
30390 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallreduce @ "//routinen)
30394 CALL add_perf(perf_id=23, count=1, msg_size=msglen*(2*real_4_size))
30400 CALL mp_timestop(handle)
30401 END SUBROUTINE mp_isum_cv
30409 SUBROUTINE mp_sum_cm(msg, comm)
30410 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30413 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm'
30416#if defined(__parallel)
30417 INTEGER,
PARAMETER :: max_msg = 2**25
30418 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
30419 COMPLEX(kind=real_4),
ALLOCATABLE :: msgbuf(:)
30422 CALL mp_timeset(routinen, handle)
30424#if defined(__parallel)
30426 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
30428 DO m1 = lbound(msg, 2), ubound(msg, 2), step
30429 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
30430 msglensum = msglensum + msglen
30431 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
30432 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
30433 ALLOCATE (msgbuf(msglen))
30434 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
30435 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30436 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
30437 DEALLOCATE (msgbuf)
30440 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_4_size))
30445 CALL mp_timestop(handle)
30446 END SUBROUTINE mp_sum_cm
30454 SUBROUTINE mp_sum_cm3(msg, comm)
30455 COMPLEX(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:, :, :)
30458 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm3'
30461#if defined(__parallel)
30462 INTEGER :: ierr, msglen
30463 COMPLEX(kind=real_4),
ALLOCATABLE :: msgbuf(:)
30466 CALL mp_timeset(routinen, handle)
30468#if defined(__parallel)
30470 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
30471 ALLOCATE (msgbuf(msglen))
30472 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
30473 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30474 msg = reshape(msgbuf, shape(msg))
30476 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30481 CALL mp_timestop(handle)
30482 END SUBROUTINE mp_sum_cm3
30490 SUBROUTINE mp_sum_cm4(msg, comm)
30491 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :, :, :)
30494 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_cm4'
30497#if defined(__parallel)
30498 INTEGER :: ierr, msglen
30499 COMPLEX(kind=real_4),
ALLOCATABLE :: msgbuf(:)
30502 CALL mp_timeset(routinen, handle)
30504#if defined(__parallel)
30506 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
30507 ALLOCATE (msgbuf(msglen))
30508 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
30509 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30510 msg = reshape(msgbuf, shape(msg))
30512 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30517 CALL mp_timestop(handle)
30518 END SUBROUTINE mp_sum_cm4
30530 SUBROUTINE mp_sum_root_cv(msg, root, comm)
30531 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
30532 INTEGER,
INTENT(IN) :: root
30535 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_cv'
30538#if defined(__parallel)
30539 INTEGER :: ierr, m1, msglen, taskid
30540 COMPLEX(kind=real_4),
ALLOCATABLE :: res(:)
30543 CALL mp_timeset(routinen, handle)
30545#if defined(__parallel)
30547 CALL mpi_comm_rank(comm%handle, taskid, ierr)
30548 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
30549 IF (msglen > 0)
THEN
30552 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_sum, &
30553 root, comm%handle, ierr)
30554 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
30555 IF (taskid == root)
THEN
30560 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30566 CALL mp_timestop(handle)
30567 END SUBROUTINE mp_sum_root_cv
30578 SUBROUTINE mp_sum_root_cm(msg, root, comm)
30579 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30580 INTEGER,
INTENT(IN) :: root
30583 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_root_rm'
30586#if defined(__parallel)
30587 INTEGER :: ierr, m1, m2, msglen, taskid
30588 COMPLEX(kind=real_4),
ALLOCATABLE :: res(:, :)
30591 CALL mp_timeset(routinen, handle)
30593#if defined(__parallel)
30595 CALL mpi_comm_rank(comm%handle, taskid, ierr)
30596 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
30597 IF (msglen > 0)
THEN
30600 ALLOCATE (res(m1, m2))
30601 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_sum, root, comm%handle, ierr)
30602 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
30603 IF (taskid == root)
THEN
30608 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30614 CALL mp_timestop(handle)
30615 END SUBROUTINE mp_sum_root_cm
30623 SUBROUTINE mp_sum_partial_cm(msg, res, comm)
30624 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
30625 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: res(:, :)
30628 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_partial_cm'
30631#if defined(__parallel)
30632 INTEGER :: ierr, msglen, taskid
30635 CALL mp_timeset(routinen, handle)
30637#if defined(__parallel)
30639 CALL mpi_comm_rank(comm%handle, taskid, ierr)
30640 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_comm_rank @ "//routinen)
30641 IF (msglen > 0)
THEN
30642 CALL mpi_scan(msg, res, msglen, mpi_complex, mpi_sum, comm%handle, ierr)
30643 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scan @ "//routinen)
30645 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30651 CALL mp_timestop(handle)
30652 END SUBROUTINE mp_sum_partial_cm
30662 SUBROUTINE mp_max_c (msg, comm)
30663 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30666 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_c'
30669#if defined(__parallel)
30670 INTEGER :: ierr, msglen
30671 COMPLEX(kind=real_4) :: res
30674 CALL mp_timeset(routinen, handle)
30676#if defined(__parallel)
30678 IF (comm%num_pe > 1)
THEN
30679 CALL mpi_allreduce(msg, res, msglen, mpi_complex, mpi_max, comm%handle, ierr)
30680 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30683 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30688 CALL mp_timestop(handle)
30689 END SUBROUTINE mp_max_c
30699 SUBROUTINE mp_max_root_c (msg, root, comm)
30700 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30701 INTEGER,
INTENT(IN) :: root
30704 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_c'
30707#if defined(__parallel)
30708 INTEGER :: ierr, msglen
30709 COMPLEX(kind=real_4) :: res
30712 CALL mp_timeset(routinen, handle)
30714#if defined(__parallel)
30716 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_max, root, comm%handle, ierr)
30717 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce @ "//routinen)
30718 IF (root == comm%mepos) msg = res
30719 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30725 CALL mp_timestop(handle)
30726 END SUBROUTINE mp_max_root_c
30736 SUBROUTINE mp_max_cv(msg, comm)
30737 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:)
30740 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_cv'
30743#if defined(__parallel)
30744 INTEGER :: ierr, msglen
30745 COMPLEX(kind=real_4),
ALLOCATABLE :: msgbuf(:)
30748 CALL mp_timeset(routinen, handle)
30750#if defined(__parallel)
30752 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
30753 ALLOCATE (msgbuf(msglen))
30754 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_complex, mpi_max, comm%handle, ierr)
30755 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30758 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30763 CALL mp_timestop(handle)
30764 END SUBROUTINE mp_max_cv
30774 SUBROUTINE mp_max_cm(msg, comm)
30775 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30778 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_cm'
30781#if defined(__parallel)
30782 INTEGER,
PARAMETER :: max_msg = 2**25
30783 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
30784 COMPLEX(kind=real_4),
ALLOCATABLE :: msgbuf(:)
30787 CALL mp_timeset(routinen, handle)
30789#if defined(__parallel)
30791 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
30793 DO m1 = lbound(msg, 2), ubound(msg, 2), step
30794 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
30795 msglensum = msglensum + msglen
30796 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
30797 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
30798 ALLOCATE (msgbuf(msglen))
30799 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_complex, mpi_max, comm%handle, ierr)
30800 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30801 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
30802 DEALLOCATE (msgbuf)
30805 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_4_size))
30810 CALL mp_timestop(handle)
30811 END SUBROUTINE mp_max_cm
30821 SUBROUTINE mp_max_root_cm(msg, root, comm)
30822 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30826 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_max_root_cm'
30829#if defined(__parallel)
30830 INTEGER :: ierr, msglen
30831 COMPLEX(kind=real_4) :: res(size(msg, 1), size(msg, 2))
30834 CALL mp_timeset(routinen, handle)
30836#if defined(__parallel)
30838 CALL mpi_reduce(msg, res, msglen, mpi_complex, mpi_max, root, comm%handle, ierr)
30839 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30840 IF (root == comm%mepos) msg = res
30841 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30847 CALL mp_timestop(handle)
30848 END SUBROUTINE mp_max_root_cm
30858 SUBROUTINE mp_min_c (msg, comm)
30859 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30862 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_c'
30865#if defined(__parallel)
30866 INTEGER :: ierr, msglen
30867 COMPLEX(kind=real_4) :: res
30870 CALL mp_timeset(routinen, handle)
30872#if defined(__parallel)
30874 IF (comm%num_pe > 1)
THEN
30875 CALL mpi_allreduce(msg, res, msglen, mpi_complex, mpi_min, comm%handle, ierr)
30876 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30879 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30884 CALL mp_timestop(handle)
30885 END SUBROUTINE mp_min_c
30897 SUBROUTINE mp_min_cv(msg, comm)
30898 COMPLEX(kind=real_4),
INTENT(INOUT),
CONTIGUOUS :: msg(:)
30901 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_cv'
30904#if defined(__parallel)
30905 INTEGER :: ierr, msglen
30906 COMPLEX(kind=real_4),
ALLOCATABLE :: msgbuf(:)
30909 CALL mp_timeset(routinen, handle)
30911#if defined(__parallel)
30913 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
30914 ALLOCATE (msgbuf(msglen))
30915 CALL mpi_allreduce(msg, msgbuf, msglen, mpi_complex, mpi_min, comm%handle, ierr)
30916 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30919 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
30924 CALL mp_timestop(handle)
30925 END SUBROUTINE mp_min_cv
30935 SUBROUTINE mp_min_cm(msg, comm)
30936 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(INOUT) :: msg(:, :)
30939 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_min_cm'
30942#if defined(__parallel)
30943 INTEGER,
PARAMETER :: max_msg = 2**25
30944 INTEGER :: ierr, m1, msglen, ncols, step, msglensum
30945 COMPLEX(kind=real_4),
ALLOCATABLE :: msgbuf(:)
30948 CALL mp_timeset(routinen, handle)
30950#if defined(__parallel)
30952 step = max(1,
SIZE(msg, 2)/max(1,
SIZE(msg)/max_msg))
30954 DO m1 = lbound(msg, 2), ubound(msg, 2), step
30955 msglen =
SIZE(msg, 1)*(min(ubound(msg, 2), m1 + step - 1) - m1 + 1)
30956 msglensum = msglensum + msglen
30957 IF (msglen > 0 .AND. comm%num_pe > 1)
THEN
30958 ncols = min(ubound(msg, 2), m1 + step - 1) - m1 + 1
30959 ALLOCATE (msgbuf(msglen))
30960 CALL mpi_allreduce(msg(lbound(msg, 1), m1), msgbuf, msglen, mpi_complex, mpi_min, comm%handle, ierr)
30961 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
30962 msg(:, m1:m1 + ncols - 1) = reshape(msgbuf, [
SIZE(msg, 1), ncols])
30963 DEALLOCATE (msgbuf)
30966 CALL add_perf(perf_id=3, count=1, msg_size=msglensum*(2*real_4_size))
30971 CALL mp_timestop(handle)
30972 END SUBROUTINE mp_min_cm
30982 SUBROUTINE mp_prod_c (msg, comm)
30983 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
30986 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_prod_c'
30989#if defined(__parallel)
30990 INTEGER :: ierr, msglen
30991 COMPLEX(kind=real_4) :: res
30994 CALL mp_timeset(routinen, handle)
30996#if defined(__parallel)
30998 IF (comm%num_pe > 1)
THEN
30999 CALL mpi_allreduce(msg, res, msglen, mpi_complex, mpi_prod, comm%handle, ierr)
31000 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allreduce @ "//routinen)
31003 CALL add_perf(perf_id=3, count=1, msg_size=msglen*(2*real_4_size))
31008 CALL mp_timestop(handle)
31009 END SUBROUTINE mp_prod_c
31020 SUBROUTINE mp_scatter_cv(msg_scatter, msg, root, comm)
31021 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg_scatter(:)
31022 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg(:)
31023 INTEGER,
INTENT(IN) :: root
31026 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_scatter_cv'
31029#if defined(__parallel)
31030 INTEGER :: ierr, msglen
31033 CALL mp_timeset(routinen, handle)
31035#if defined(__parallel)
31037 CALL mpi_scatter(msg_scatter, msglen, mpi_complex, msg, &
31038 msglen, mpi_complex, root, comm%handle, ierr)
31039 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_scatter @ "//routinen)
31040 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
31046 CALL mp_timestop(handle)
31047 END SUBROUTINE mp_scatter_cv
31057 SUBROUTINE mp_iscatter_c (msg_scatter, msg, root, comm, request)
31058 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:)
31059 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg
31060 INTEGER,
INTENT(IN) :: root
31064 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_c'
31067#if defined(__parallel)
31068 INTEGER :: ierr, msglen
31071 CALL mp_timeset(routinen, handle)
31073#if defined(__parallel)
31074#if !defined(__GNUC__) || __GNUC__ >= 9
31075 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
31078 CALL mpi_iscatter(msg_scatter, msglen, mpi_complex, msg, &
31079 msglen, mpi_complex, root, comm%handle, request%handle, ierr)
31080 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
31081 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
31085 msg = msg_scatter(1)
31088 CALL mp_timestop(handle)
31089 END SUBROUTINE mp_iscatter_c
31099 SUBROUTINE mp_iscatter_cv2(msg_scatter, msg, root, comm, request)
31100 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:, :)
31101 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
31102 INTEGER,
INTENT(IN) :: root
31106 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatter_cv2'
31109#if defined(__parallel)
31110 INTEGER :: ierr, msglen
31113 CALL mp_timeset(routinen, handle)
31115#if defined(__parallel)
31116#if !defined(__GNUC__) || __GNUC__ >= 9
31117 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
31120 CALL mpi_iscatter(msg_scatter, msglen, mpi_complex, msg, &
31121 msglen, mpi_complex, root, comm%handle, request%handle, ierr)
31122 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatter @ "//routinen)
31123 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
31127 msg(:) = msg_scatter(:, 1)
31130 CALL mp_timestop(handle)
31131 END SUBROUTINE mp_iscatter_cv2
31141 SUBROUTINE mp_iscatterv_cv(msg_scatter, sendcounts, displs, msg, recvcount, root, comm, request)
31142 COMPLEX(kind=real_4),
INTENT(IN) :: msg_scatter(:)
31143 INTEGER,
INTENT(IN) :: sendcounts(:), displs(:)
31144 COMPLEX(kind=real_4),
INTENT(INOUT) :: msg(:)
31145 INTEGER,
INTENT(IN) :: recvcount, root
31149 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iscatterv_cv'
31152#if defined(__parallel)
31156 CALL mp_timeset(routinen, handle)
31158#if defined(__parallel)
31159#if !defined(__GNUC__) || __GNUC__ >= 9
31160 cpassert(is_contiguous(msg_scatter) .OR.
SIZE(msg_scatter) == 0)
31161 cpassert(is_contiguous(msg) .OR.
SIZE(msg) == 0)
31162 cpassert(is_contiguous(sendcounts) .OR.
SIZE(sendcounts) == 0)
31163 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
31165 CALL mpi_iscatterv(msg_scatter, sendcounts, displs, mpi_complex, msg, &
31166 recvcount, mpi_complex, root, comm%handle, request%handle, ierr)
31167 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iscatterv @ "//routinen)
31168 CALL add_perf(perf_id=24, count=1, msg_size=1*(2*real_4_size))
31170 mark_used(sendcounts)
31172 mark_used(recvcount)
31175 msg(1:recvcount) = msg_scatter(1 + displs(1):1 + displs(1) + sendcounts(1))
31178 CALL mp_timestop(handle)
31179 END SUBROUTINE mp_iscatterv_cv
31190 SUBROUTINE mp_gather_c (msg, msg_gather, root, comm)
31191 COMPLEX(kind=real_4),
INTENT(IN) :: msg
31192 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
31193 INTEGER,
INTENT(IN) :: root
31196 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_c'
31199#if defined(__parallel)
31200 INTEGER :: ierr, msglen
31203 CALL mp_timeset(routinen, handle)
31205#if defined(__parallel)
31207 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
31208 msglen, mpi_complex, root, comm%handle, ierr)
31209 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
31210 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
31214 msg_gather(1) = msg
31216 CALL mp_timestop(handle)
31217 END SUBROUTINE mp_gather_c
31227 SUBROUTINE mp_gather_c_src(msg, msg_gather, comm)
31228 COMPLEX(kind=real_4),
INTENT(IN) :: msg
31229 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
31232 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_c_src'
31235#if defined(__parallel)
31236 INTEGER :: ierr, msglen
31239 CALL mp_timeset(routinen, handle)
31241#if defined(__parallel)
31243 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
31244 msglen, mpi_complex, comm%source, comm%handle, ierr)
31245 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
31246 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
31249 msg_gather(1) = msg
31251 CALL mp_timestop(handle)
31252 END SUBROUTINE mp_gather_c_src
31266 SUBROUTINE mp_gather_cv(msg, msg_gather, root, comm)
31267 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
31268 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
31269 INTEGER,
INTENT(IN) :: root
31272 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cv'
31275#if defined(__parallel)
31276 INTEGER :: ierr, msglen
31279 CALL mp_timeset(routinen, handle)
31281#if defined(__parallel)
31283 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
31284 msglen, mpi_complex, root, comm%handle, ierr)
31285 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
31286 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
31292 CALL mp_timestop(handle)
31293 END SUBROUTINE mp_gather_cv
31306 SUBROUTINE mp_gather_cv_src(msg, msg_gather, comm)
31307 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
31308 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:)
31311 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cv_src'
31314#if defined(__parallel)
31315 INTEGER :: ierr, msglen
31318 CALL mp_timeset(routinen, handle)
31320#if defined(__parallel)
31322 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
31323 msglen, mpi_complex, comm%source, comm%handle, ierr)
31324 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
31325 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
31330 CALL mp_timestop(handle)
31331 END SUBROUTINE mp_gather_cv_src
31345 SUBROUTINE mp_gather_cm(msg, msg_gather, root, comm)
31346 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
31347 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
31348 INTEGER,
INTENT(IN) :: root
31351 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cm'
31354#if defined(__parallel)
31355 INTEGER :: ierr, msglen
31358 CALL mp_timeset(routinen, handle)
31360#if defined(__parallel)
31362 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
31363 msglen, mpi_complex, root, comm%handle, ierr)
31364 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
31365 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
31371 CALL mp_timestop(handle)
31372 END SUBROUTINE mp_gather_cm
31385 SUBROUTINE mp_gather_cm_src(msg, msg_gather, comm)
31386 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:, :)
31387 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msg_gather(:, :)
31390 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gather_cm_src'
31393#if defined(__parallel)
31394 INTEGER :: ierr, msglen
31397 CALL mp_timeset(routinen, handle)
31399#if defined(__parallel)
31401 CALL mpi_gather(msg, msglen, mpi_complex, msg_gather, &
31402 msglen, mpi_complex, comm%source, comm%handle, ierr)
31403 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gather @ "//routinen)
31404 CALL add_perf(perf_id=4, count=1, msg_size=msglen*(2*real_4_size))
31409 CALL mp_timestop(handle)
31410 END SUBROUTINE mp_gather_cm_src
31427 SUBROUTINE mp_gatherv_cv(sendbuf, recvbuf, recvcounts, displs, root, comm)
31429 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
31430 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
31431 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
31432 INTEGER,
INTENT(IN) :: root
31435 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cv'
31438#if defined(__parallel)
31439 INTEGER :: ierr, sendcount
31442 CALL mp_timeset(routinen, handle)
31444#if defined(__parallel)
31445 sendcount =
SIZE(sendbuf)
31446 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
31447 recvbuf, recvcounts, displs, mpi_complex, &
31448 root, comm%handle, ierr)
31449 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
31450 CALL add_perf(perf_id=4, &
31452 msg_size=sendcount*(2*real_4_size))
31454 mark_used(recvcounts)
31457 recvbuf(1 + displs(1):) = sendbuf
31459 CALL mp_timestop(handle)
31460 END SUBROUTINE mp_gatherv_cv
31476 SUBROUTINE mp_gatherv_cv_src(sendbuf, recvbuf, recvcounts, displs, comm)
31478 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: sendbuf
31479 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
31480 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
31483 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cv_src'
31486#if defined(__parallel)
31487 INTEGER :: ierr, sendcount
31490 CALL mp_timeset(routinen, handle)
31492#if defined(__parallel)
31493 sendcount =
SIZE(sendbuf)
31494 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
31495 recvbuf, recvcounts, displs, mpi_complex, &
31496 comm%source, comm%handle, ierr)
31497 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
31498 CALL add_perf(perf_id=4, &
31500 msg_size=sendcount*(2*real_4_size))
31502 mark_used(recvcounts)
31504 recvbuf(1 + displs(1):) = sendbuf
31506 CALL mp_timestop(handle)
31507 END SUBROUTINE mp_gatherv_cv_src
31524 SUBROUTINE mp_gatherv_cm2(sendbuf, recvbuf, recvcounts, displs, root, comm)
31526 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
31527 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
31528 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
31529 INTEGER,
INTENT(IN) :: root
31532 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cm2'
31535#if defined(__parallel)
31536 INTEGER :: ierr, sendcount
31539 CALL mp_timeset(routinen, handle)
31541#if defined(__parallel)
31542 sendcount =
SIZE(sendbuf)
31543 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
31544 recvbuf, recvcounts, displs, mpi_complex, &
31545 root, comm%handle, ierr)
31546 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
31547 CALL add_perf(perf_id=4, &
31549 msg_size=sendcount*(2*real_4_size))
31551 mark_used(recvcounts)
31554 recvbuf(:, 1 + displs(1):) = sendbuf
31556 CALL mp_timestop(handle)
31557 END SUBROUTINE mp_gatherv_cm2
31573 SUBROUTINE mp_gatherv_cm2_src(sendbuf, recvbuf, recvcounts, displs, comm)
31575 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(IN) :: sendbuf
31576 COMPLEX(kind=real_4),
DIMENSION(:, :),
CONTIGUOUS,
INTENT(OUT) :: recvbuf
31577 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
31580 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_gatherv_cm2_src'
31583#if defined(__parallel)
31584 INTEGER :: ierr, sendcount
31587 CALL mp_timeset(routinen, handle)
31589#if defined(__parallel)
31590 sendcount =
SIZE(sendbuf)
31591 CALL mpi_gatherv(sendbuf, sendcount, mpi_complex, &
31592 recvbuf, recvcounts, displs, mpi_complex, &
31593 comm%source, comm%handle, ierr)
31594 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
31595 CALL add_perf(perf_id=4, &
31597 msg_size=sendcount*(2*real_4_size))
31599 mark_used(recvcounts)
31601 recvbuf(:, 1 + displs(1):) = sendbuf
31603 CALL mp_timestop(handle)
31604 END SUBROUTINE mp_gatherv_cm2_src
31621 SUBROUTINE mp_igatherv_cv(sendbuf, sendcount, recvbuf, recvcounts, displs, root, comm, request)
31622 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: sendbuf
31623 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(OUT) :: recvbuf
31624 INTEGER,
DIMENSION(:),
CONTIGUOUS,
INTENT(IN) :: recvcounts, displs
31625 INTEGER,
INTENT(IN) :: sendcount, root
31629 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_igatherv_cv'
31632#if defined(__parallel)
31636 CALL mp_timeset(routinen, handle)
31638#if defined(__parallel)
31639#if !defined(__GNUC__) || __GNUC__ >= 9
31640 cpassert(is_contiguous(sendbuf) .OR.
SIZE(sendbuf) == 0)
31641 cpassert(is_contiguous(recvbuf) .OR.
SIZE(recvbuf) == 0)
31642 cpassert(is_contiguous(recvcounts) .OR.
SIZE(recvcounts) == 0)
31643 cpassert(is_contiguous(displs) .OR.
SIZE(displs) == 0)
31645 CALL mpi_igatherv(sendbuf, sendcount, mpi_complex, &
31646 recvbuf, recvcounts, displs, mpi_complex, &
31647 root, comm%handle, request%handle, ierr)
31648 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_gatherv @ "//routinen)
31649 CALL add_perf(perf_id=24, &
31651 msg_size=sendcount*(2*real_4_size))
31653 mark_used(sendcount)
31654 mark_used(recvcounts)
31657 recvbuf(1 + displs(1):1 + displs(1) + recvcounts(1)) = sendbuf(1:sendcount)
31660 CALL mp_timestop(handle)
31661 END SUBROUTINE mp_igatherv_cv
31674 SUBROUTINE mp_allgather_c (msgout, msgin, comm)
31675 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
31676 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:)
31679 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c'
31682#if defined(__parallel)
31683 INTEGER :: ierr, rcount, scount
31686 CALL mp_timeset(routinen, handle)
31688#if defined(__parallel)
31691 CALL mpi_allgather(msgout, scount, mpi_complex, &
31692 msgin, rcount, mpi_complex, &
31694 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31699 CALL mp_timestop(handle)
31700 END SUBROUTINE mp_allgather_c
31713 SUBROUTINE mp_allgather_c2(msgout, msgin, comm)
31714 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
31715 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
31718 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c2'
31721#if defined(__parallel)
31722 INTEGER :: ierr, rcount, scount
31725 CALL mp_timeset(routinen, handle)
31727#if defined(__parallel)
31730 CALL mpi_allgather(msgout, scount, mpi_complex, &
31731 msgin, rcount, mpi_complex, &
31733 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31738 CALL mp_timestop(handle)
31739 END SUBROUTINE mp_allgather_c2
31752 SUBROUTINE mp_iallgather_c (msgout, msgin, comm, request)
31753 COMPLEX(kind=real_4),
INTENT(IN) :: msgout
31754 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31758 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c'
31761#if defined(__parallel)
31762 INTEGER :: ierr, rcount, scount
31765 CALL mp_timeset(routinen, handle)
31767#if defined(__parallel)
31768#if !defined(__GNUC__) || __GNUC__ >= 9
31769 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
31773 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31774 msgin, rcount, mpi_complex, &
31775 comm%handle, request%handle, ierr)
31776 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31782 CALL mp_timestop(handle)
31783 END SUBROUTINE mp_iallgather_c
31798 SUBROUTINE mp_allgather_c12(msgout, msgin, comm)
31799 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:)
31800 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
31803 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c12'
31806#if defined(__parallel)
31807 INTEGER :: ierr, rcount, scount
31810 CALL mp_timeset(routinen, handle)
31812#if defined(__parallel)
31813 scount =
SIZE(msgout(:))
31815 CALL mpi_allgather(msgout, scount, mpi_complex, &
31816 msgin, rcount, mpi_complex, &
31818 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31821 msgin(:, 1) = msgout(:)
31823 CALL mp_timestop(handle)
31824 END SUBROUTINE mp_allgather_c12
31834 SUBROUTINE mp_allgather_c23(msgout, msgin, comm)
31835 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
31836 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :)
31839 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c23'
31842#if defined(__parallel)
31843 INTEGER :: ierr, rcount, scount
31846 CALL mp_timeset(routinen, handle)
31848#if defined(__parallel)
31849 scount =
SIZE(msgout(:, :))
31851 CALL mpi_allgather(msgout, scount, mpi_complex, &
31852 msgin, rcount, mpi_complex, &
31854 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31857 msgin(:, :, 1) = msgout(:, :)
31859 CALL mp_timestop(handle)
31860 END SUBROUTINE mp_allgather_c23
31870 SUBROUTINE mp_allgather_c34(msgout, msgin, comm)
31871 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :, :)
31872 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :, :, :)
31875 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c34'
31878#if defined(__parallel)
31879 INTEGER :: ierr, rcount, scount
31882 CALL mp_timeset(routinen, handle)
31884#if defined(__parallel)
31885 scount =
SIZE(msgout(:, :, :))
31887 CALL mpi_allgather(msgout, scount, mpi_complex, &
31888 msgin, rcount, mpi_complex, &
31890 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31893 msgin(:, :, :, 1) = msgout(:, :, :)
31895 CALL mp_timestop(handle)
31896 END SUBROUTINE mp_allgather_c34
31906 SUBROUTINE mp_allgather_c22(msgout, msgin, comm)
31907 COMPLEX(kind=real_4),
INTENT(IN),
CONTIGUOUS :: msgout(:, :)
31908 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msgin(:, :)
31911 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgather_c22'
31914#if defined(__parallel)
31915 INTEGER :: ierr, rcount, scount
31918 CALL mp_timeset(routinen, handle)
31920#if defined(__parallel)
31921 scount =
SIZE(msgout(:, :))
31923 CALL mpi_allgather(msgout, scount, mpi_complex, &
31924 msgin, rcount, mpi_complex, &
31926 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgather @ "//routinen)
31929 msgin(:, :) = msgout(:, :)
31931 CALL mp_timestop(handle)
31932 END SUBROUTINE mp_allgather_c22
31943 SUBROUTINE mp_iallgather_c11(msgout, msgin, comm, request)
31944 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31945 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
31949 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c11'
31952#if defined(__parallel)
31953 INTEGER :: ierr, rcount, scount
31956 CALL mp_timeset(routinen, handle)
31958#if defined(__parallel)
31959#if !defined(__GNUC__) || __GNUC__ >= 9
31960 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
31961 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
31963 scount =
SIZE(msgout(:))
31965 CALL mpi_iallgather(msgout, scount, mpi_complex, &
31966 msgin, rcount, mpi_complex, &
31967 comm%handle, request%handle, ierr)
31968 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
31974 CALL mp_timestop(handle)
31975 END SUBROUTINE mp_iallgather_c11
31986 SUBROUTINE mp_iallgather_c13(msgout, msgin, comm, request)
31987 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
31988 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
31992 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c13'
31995#if defined(__parallel)
31996 INTEGER :: ierr, rcount, scount
31999 CALL mp_timeset(routinen, handle)
32001#if defined(__parallel)
32002#if !defined(__GNUC__) || __GNUC__ >= 9
32003 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
32004 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
32007 scount =
SIZE(msgout(:))
32009 CALL mpi_iallgather(msgout, scount, mpi_complex, &
32010 msgin, rcount, mpi_complex, &
32011 comm%handle, request%handle, ierr)
32012 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
32015 msgin(:, 1, 1) = msgout(:)
32018 CALL mp_timestop(handle)
32019 END SUBROUTINE mp_iallgather_c13
32030 SUBROUTINE mp_iallgather_c22(msgout, msgin, comm, request)
32031 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :)
32032 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :)
32036 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c22'
32039#if defined(__parallel)
32040 INTEGER :: ierr, rcount, scount
32043 CALL mp_timeset(routinen, handle)
32045#if defined(__parallel)
32046#if !defined(__GNUC__) || __GNUC__ >= 9
32047 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
32048 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
32051 scount =
SIZE(msgout(:, :))
32053 CALL mpi_iallgather(msgout, scount, mpi_complex, &
32054 msgin, rcount, mpi_complex, &
32055 comm%handle, request%handle, ierr)
32056 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
32059 msgin(:, :) = msgout(:, :)
32062 CALL mp_timestop(handle)
32063 END SUBROUTINE mp_iallgather_c22
32074 SUBROUTINE mp_iallgather_c24(msgout, msgin, comm, request)
32075 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :)
32076 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :, :)
32080 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c24'
32083#if defined(__parallel)
32084 INTEGER :: ierr, rcount, scount
32087 CALL mp_timeset(routinen, handle)
32089#if defined(__parallel)
32090#if !defined(__GNUC__) || __GNUC__ >= 9
32091 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
32092 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
32095 scount =
SIZE(msgout(:, :))
32097 CALL mpi_iallgather(msgout, scount, mpi_complex, &
32098 msgin, rcount, mpi_complex, &
32099 comm%handle, request%handle, ierr)
32100 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
32103 msgin(:, :, 1, 1) = msgout(:, :)
32106 CALL mp_timestop(handle)
32107 END SUBROUTINE mp_iallgather_c24
32118 SUBROUTINE mp_iallgather_c33(msgout, msgin, comm, request)
32119 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:, :, :)
32120 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:, :, :)
32124 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgather_c33'
32127#if defined(__parallel)
32128 INTEGER :: ierr, rcount, scount
32131 CALL mp_timeset(routinen, handle)
32133#if defined(__parallel)
32134#if !defined(__GNUC__) || __GNUC__ >= 9
32135 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
32136 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
32139 scount =
SIZE(msgout(:, :, :))
32141 CALL mpi_iallgather(msgout, scount, mpi_complex, &
32142 msgin, rcount, mpi_complex, &
32143 comm%handle, request%handle, ierr)
32144 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgather @ "//routinen)
32147 msgin(:, :, :) = msgout(:, :, :)
32150 CALL mp_timestop(handle)
32151 END SUBROUTINE mp_iallgather_c33
32170 SUBROUTINE mp_allgatherv_cv(msgout, msgin, rcount, rdispl, comm)
32171 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
32172 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
32173 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
32176 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_cv'
32179#if defined(__parallel)
32180 INTEGER :: ierr, scount
32183 CALL mp_timeset(routinen, handle)
32185#if defined(__parallel)
32186 scount =
SIZE(msgout)
32187 CALL mpi_allgatherv(msgout, scount, mpi_complex, msgin, rcount, &
32188 rdispl, mpi_complex, comm%handle, ierr)
32189 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
32196 CALL mp_timestop(handle)
32197 END SUBROUTINE mp_allgatherv_cv
32216 SUBROUTINE mp_allgatherv_cm2(msgout, msgin, rcount, rdispl, comm)
32217 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
32218 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:, :)
32219 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
32222 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_allgatherv_cv'
32225#if defined(__parallel)
32226 INTEGER :: ierr, scount
32229 CALL mp_timeset(routinen, handle)
32231#if defined(__parallel)
32232 scount =
SIZE(msgout)
32233 CALL mpi_allgatherv(msgout, scount, mpi_complex, msgin, rcount, &
32234 rdispl, mpi_complex, comm%handle, ierr)
32235 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_allgatherv @ "//routinen)
32242 CALL mp_timestop(handle)
32243 END SUBROUTINE mp_allgatherv_cm2
32262 SUBROUTINE mp_iallgatherv_cv(msgout, msgin, rcount, rdispl, comm, request)
32263 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
32264 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
32265 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:), rdispl(:)
32269 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_cv'
32272#if defined(__parallel)
32273 INTEGER :: ierr, scount, rsize
32276 CALL mp_timeset(routinen, handle)
32278#if defined(__parallel)
32279#if !defined(__GNUC__) || __GNUC__ >= 9
32280 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
32281 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
32282 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
32283 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
32286 scount =
SIZE(msgout)
32287 rsize =
SIZE(rcount)
32288 CALL mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, &
32289 rdispl, comm, request, ierr)
32290 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
32298 CALL mp_timestop(handle)
32299 END SUBROUTINE mp_iallgatherv_cv
32318 SUBROUTINE mp_iallgatherv_cv2(msgout, msgin, rcount, rdispl, comm, request)
32319 COMPLEX(kind=real_4),
INTENT(IN) :: msgout(:)
32320 COMPLEX(kind=real_4),
INTENT(OUT) :: msgin(:)
32321 INTEGER,
INTENT(IN) :: rcount(:, :), rdispl(:, :)
32325 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_iallgatherv_cv2'
32328#if defined(__parallel)
32329 INTEGER :: ierr, scount, rsize
32332 CALL mp_timeset(routinen, handle)
32334#if defined(__parallel)
32335#if !defined(__GNUC__) || __GNUC__ >= 9
32336 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
32337 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
32338 cpassert(is_contiguous(rcount) .OR.
SIZE(rcount) == 0)
32339 cpassert(is_contiguous(rdispl) .OR.
SIZE(rdispl) == 0)
32342 scount =
SIZE(msgout)
32343 rsize =
SIZE(rcount)
32344 CALL mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, &
32345 rdispl, comm, request, ierr)
32346 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_iallgatherv @ "//routinen)
32354 CALL mp_timestop(handle)
32355 END SUBROUTINE mp_iallgatherv_cv2
32366#if defined(__parallel)
32367 SUBROUTINE mp_iallgatherv_cv_internal(msgout, scount, msgin, rsize, rcount, rdispl, comm, request, ierr)
32368 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:)
32369 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
32370 INTEGER,
INTENT(IN) :: rsize
32371 INTEGER,
INTENT(IN) :: rcount(rsize), rdispl(rsize), scount
32374 INTEGER,
INTENT(INOUT) :: ierr
32376 CALL mpi_iallgatherv(msgout, scount, mpi_complex, msgin, rcount, &
32377 rdispl, mpi_complex, comm%handle, request%handle, ierr)
32379 END SUBROUTINE mp_iallgatherv_cv_internal
32390 SUBROUTINE mp_sum_scatter_cv(msgout, msgin, rcount, comm)
32391 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgout(:, :)
32392 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgin(:)
32393 INTEGER,
CONTIGUOUS,
INTENT(IN) :: rcount(:)
32396 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sum_scatter_cv'
32399#if defined(__parallel)
32403 CALL mp_timeset(routinen, handle)
32405#if defined(__parallel)
32406 CALL mpi_reduce_scatter(msgout, msgin, rcount, mpi_complex, mpi_sum, &
32408 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_reduce_scatter @ "//routinen)
32410 CALL add_perf(perf_id=3, count=1, &
32411 msg_size=rcount(1)*2*(2*real_4_size))
32415 msgin = msgout(:, 1)
32417 CALL mp_timestop(handle)
32418 END SUBROUTINE mp_sum_scatter_cv
32429 SUBROUTINE mp_sendrecv_c (msgin, dest, msgout, source, comm, tag)
32430 COMPLEX(kind=real_4),
INTENT(IN) :: msgin
32431 INTEGER,
INTENT(IN) :: dest
32432 COMPLEX(kind=real_4),
INTENT(OUT) :: msgout
32433 INTEGER,
INTENT(IN) :: source
32435 INTEGER,
INTENT(IN),
OPTIONAL :: tag
32437 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_c'
32440#if defined(__parallel)
32441 INTEGER :: ierr, msglen_in, msglen_out, &
32445 CALL mp_timeset(routinen, handle)
32447#if defined(__parallel)
32452 IF (
PRESENT(tag))
THEN
32456 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
32457 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
32458 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
32459 CALL add_perf(perf_id=7, count=1, &
32460 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
32468 CALL mp_timestop(handle)
32469 END SUBROUTINE mp_sendrecv_c
32480 SUBROUTINE mp_sendrecv_cv(msgin, dest, msgout, source, comm, tag)
32481 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:)
32482 INTEGER,
INTENT(IN) :: dest
32483 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:)
32484 INTEGER,
INTENT(IN) :: source
32486 INTEGER,
INTENT(IN),
OPTIONAL :: tag
32488 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cv'
32491#if defined(__parallel)
32492 INTEGER :: ierr, msglen_in, msglen_out, &
32496 CALL mp_timeset(routinen, handle)
32498#if defined(__parallel)
32499 msglen_in =
SIZE(msgin)
32500 msglen_out =
SIZE(msgout)
32503 IF (
PRESENT(tag))
THEN
32507 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
32508 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
32509 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
32510 CALL add_perf(perf_id=7, count=1, &
32511 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
32519 CALL mp_timestop(handle)
32520 END SUBROUTINE mp_sendrecv_cv
32532 SUBROUTINE mp_sendrecv_cm2(msgin, dest, msgout, source, comm, tag)
32533 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :)
32534 INTEGER,
INTENT(IN) :: dest
32535 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :)
32536 INTEGER,
INTENT(IN) :: source
32538 INTEGER,
INTENT(IN),
OPTIONAL :: tag
32540 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm2'
32543#if defined(__parallel)
32544 INTEGER :: ierr, msglen_in, msglen_out, &
32548 CALL mp_timeset(routinen, handle)
32550#if defined(__parallel)
32551 msglen_in =
SIZE(msgin, 1)*
SIZE(msgin, 2)
32552 msglen_out =
SIZE(msgout, 1)*
SIZE(msgout, 2)
32555 IF (
PRESENT(tag))
THEN
32559 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
32560 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
32561 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
32562 CALL add_perf(perf_id=7, count=1, &
32563 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
32571 CALL mp_timestop(handle)
32572 END SUBROUTINE mp_sendrecv_cm2
32583 SUBROUTINE mp_sendrecv_cm3(msgin, dest, msgout, source, comm, tag)
32584 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :)
32585 INTEGER,
INTENT(IN) :: dest
32586 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :)
32587 INTEGER,
INTENT(IN) :: source
32589 INTEGER,
INTENT(IN),
OPTIONAL :: tag
32591 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm3'
32594#if defined(__parallel)
32595 INTEGER :: ierr, msglen_in, msglen_out, &
32599 CALL mp_timeset(routinen, handle)
32601#if defined(__parallel)
32602 msglen_in =
SIZE(msgin)
32603 msglen_out =
SIZE(msgout)
32606 IF (
PRESENT(tag))
THEN
32610 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
32611 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
32612 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
32613 CALL add_perf(perf_id=7, count=1, &
32614 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
32622 CALL mp_timestop(handle)
32623 END SUBROUTINE mp_sendrecv_cm3
32634 SUBROUTINE mp_sendrecv_cm4(msgin, dest, msgout, source, comm, tag)
32635 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msgin(:, :, :, :)
32636 INTEGER,
INTENT(IN) :: dest
32637 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(OUT) :: msgout(:, :, :, :)
32638 INTEGER,
INTENT(IN) :: source
32640 INTEGER,
INTENT(IN),
OPTIONAL :: tag
32642 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_sendrecv_cm4'
32645#if defined(__parallel)
32646 INTEGER :: ierr, msglen_in, msglen_out, &
32650 CALL mp_timeset(routinen, handle)
32652#if defined(__parallel)
32653 msglen_in =
SIZE(msgin)
32654 msglen_out =
SIZE(msgout)
32657 IF (
PRESENT(tag))
THEN
32661 CALL mpi_sendrecv(msgin, msglen_in, mpi_complex, dest, send_tag, msgout, &
32662 msglen_out, mpi_complex, source, recv_tag, comm%handle, mpi_status_ignore, ierr)
32663 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_sendrecv @ "//routinen)
32664 CALL add_perf(perf_id=7, count=1, &
32665 msg_size=(msglen_in + msglen_out)*(2*real_4_size)/2)
32673 CALL mp_timestop(handle)
32674 END SUBROUTINE mp_sendrecv_cm4
32691 SUBROUTINE mp_isendrecv_c (msgin, dest, msgout, source, comm, send_request, &
32693 COMPLEX(kind=real_4),
INTENT(IN) :: msgin
32694 INTEGER,
INTENT(IN) :: dest
32695 COMPLEX(kind=real_4),
INTENT(INOUT) :: msgout
32696 INTEGER,
INTENT(IN) :: source
32699 INTEGER,
INTENT(in),
OPTIONAL :: tag
32701 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_c'
32704#if defined(__parallel)
32705 INTEGER :: ierr, my_tag
32708 CALL mp_timeset(routinen, handle)
32710#if defined(__parallel)
32712 IF (
PRESENT(tag)) my_tag = tag
32714 CALL mpi_irecv(msgout, 1, mpi_complex, source, my_tag, &
32715 comm%handle, recv_request%handle, ierr)
32716 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32718 CALL mpi_isend(msgin, 1, mpi_complex, dest, my_tag, &
32719 comm%handle, send_request%handle, ierr)
32720 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32722 CALL add_perf(perf_id=8, count=1, msg_size=2*(2*real_4_size))
32732 CALL mp_timestop(handle)
32733 END SUBROUTINE mp_isendrecv_c
32752 SUBROUTINE mp_isendrecv_cv(msgin, dest, msgout, source, comm, send_request, &
32754 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
32755 INTEGER,
INTENT(IN) :: dest
32756 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
32757 INTEGER,
INTENT(IN) :: source
32760 INTEGER,
INTENT(in),
OPTIONAL :: tag
32762 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isendrecv_cv'
32765#if defined(__parallel)
32766 INTEGER :: ierr, msglen, my_tag
32767 COMPLEX(kind=real_4) :: foo
32770 CALL mp_timeset(routinen, handle)
32772#if defined(__parallel)
32773#if !defined(__GNUC__) || __GNUC__ >= 9
32774 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
32775 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
32779 IF (
PRESENT(tag)) my_tag = tag
32781 msglen =
SIZE(msgout, 1)
32782 IF (msglen > 0)
THEN
32783 CALL mpi_irecv(msgout(1), msglen, mpi_complex, source, my_tag, &
32784 comm%handle, recv_request%handle, ierr)
32786 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
32787 comm%handle, recv_request%handle, ierr)
32789 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
32791 msglen =
SIZE(msgin, 1)
32792 IF (msglen > 0)
THEN
32793 CALL mpi_isend(msgin(1), msglen, mpi_complex, dest, my_tag, &
32794 comm%handle, send_request%handle, ierr)
32796 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32797 comm%handle, send_request%handle, ierr)
32799 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32801 msglen = (msglen +
SIZE(msgout, 1) + 1)/2
32802 CALL add_perf(perf_id=8, count=1, msg_size=msglen*(2*real_4_size))
32812 CALL mp_timestop(handle)
32813 END SUBROUTINE mp_isendrecv_cv
32828 SUBROUTINE mp_isend_cv(msgin, dest, comm, request, tag)
32829 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: msgin
32830 INTEGER,
INTENT(IN) :: dest
32833 INTEGER,
INTENT(in),
OPTIONAL :: tag
32835 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cv'
32837 INTEGER :: handle, ierr
32838#if defined(__parallel)
32839 INTEGER :: msglen, my_tag
32840 COMPLEX(kind=real_4) :: foo(1)
32843 CALL mp_timeset(routinen, handle)
32845#if defined(__parallel)
32846#if !defined(__GNUC__) || __GNUC__ >= 9
32847 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
32850 IF (
PRESENT(tag)) my_tag = tag
32852 msglen =
SIZE(msgin)
32853 IF (msglen > 0)
THEN
32854 CALL mpi_isend(msgin(1), msglen, mpi_complex, dest, my_tag, &
32855 comm%handle, request%handle, ierr)
32857 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32858 comm%handle, request%handle, ierr)
32860 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32862 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32871 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32873 CALL mp_timestop(handle)
32874 END SUBROUTINE mp_isend_cv
32891 SUBROUTINE mp_isend_cm2(msgin, dest, comm, request, tag)
32892 COMPLEX(kind=real_4),
DIMENSION(:, :),
INTENT(IN) :: msgin
32893 INTEGER,
INTENT(IN) :: dest
32896 INTEGER,
INTENT(in),
OPTIONAL :: tag
32898 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm2'
32900 INTEGER :: handle, ierr
32901#if defined(__parallel)
32902 INTEGER :: msglen, my_tag
32903 COMPLEX(kind=real_4) :: foo(1)
32906 CALL mp_timeset(routinen, handle)
32908#if defined(__parallel)
32909#if !defined(__GNUC__) || __GNUC__ >= 9
32910 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
32914 IF (
PRESENT(tag)) my_tag = tag
32916 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)
32917 IF (msglen > 0)
THEN
32918 CALL mpi_isend(msgin(1, 1), msglen, mpi_complex, dest, my_tag, &
32919 comm%handle, request%handle, ierr)
32921 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32922 comm%handle, request%handle, ierr)
32924 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32926 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
32935 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
32937 CALL mp_timestop(handle)
32938 END SUBROUTINE mp_isend_cm2
32957 SUBROUTINE mp_isend_cm3(msgin, dest, comm, request, tag)
32958 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
INTENT(IN) :: msgin
32959 INTEGER,
INTENT(IN) :: dest
32962 INTEGER,
INTENT(in),
OPTIONAL :: tag
32964 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm3'
32966 INTEGER :: handle, ierr
32967#if defined(__parallel)
32968 INTEGER :: msglen, my_tag
32969 COMPLEX(kind=real_4) :: foo(1)
32972 CALL mp_timeset(routinen, handle)
32974#if defined(__parallel)
32975#if !defined(__GNUC__) || __GNUC__ >= 9
32976 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
32980 IF (
PRESENT(tag)) my_tag = tag
32982 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)
32983 IF (msglen > 0)
THEN
32984 CALL mpi_isend(msgin(1, 1, 1), msglen, mpi_complex, dest, my_tag, &
32985 comm%handle, request%handle, ierr)
32987 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
32988 comm%handle, request%handle, ierr)
32990 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
32992 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
33001 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
33003 CALL mp_timestop(handle)
33004 END SUBROUTINE mp_isend_cm3
33020 SUBROUTINE mp_isend_cm4(msgin, dest, comm, request, tag)
33021 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(IN) :: msgin
33022 INTEGER,
INTENT(IN) :: dest
33025 INTEGER,
INTENT(in),
OPTIONAL :: tag
33027 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_isend_cm4'
33029 INTEGER :: handle, ierr
33030#if defined(__parallel)
33031 INTEGER :: msglen, my_tag
33032 COMPLEX(kind=real_4) :: foo(1)
33035 CALL mp_timeset(routinen, handle)
33037#if defined(__parallel)
33038#if !defined(__GNUC__) || __GNUC__ >= 9
33039 cpassert(is_contiguous(msgin) .OR.
SIZE(msgin) == 0)
33043 IF (
PRESENT(tag)) my_tag = tag
33045 msglen =
SIZE(msgin, 1)*
SIZE(msgin, 2)*
SIZE(msgin, 3)*
SIZE(msgin, 4)
33046 IF (msglen > 0)
THEN
33047 CALL mpi_isend(msgin(1, 1, 1, 1), msglen, mpi_complex, dest, my_tag, &
33048 comm%handle, request%handle, ierr)
33050 CALL mpi_isend(foo, msglen, mpi_complex, dest, my_tag, &
33051 comm%handle, request%handle, ierr)
33053 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_isend @ "//routinen)
33055 CALL add_perf(perf_id=11, count=1, msg_size=msglen*(2*real_4_size))
33064 CALL mp_stop(ierr,
"mp_isend called in non parallel case")
33066 CALL mp_timestop(handle)
33067 END SUBROUTINE mp_isend_cm4
33083 SUBROUTINE mp_irecv_cv(msgout, source, comm, request, tag)
33084 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT) :: msgout
33085 INTEGER,
INTENT(IN) :: source
33088 INTEGER,
INTENT(in),
OPTIONAL :: tag
33090 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cv'
33093#if defined(__parallel)
33094 INTEGER :: ierr, msglen, my_tag
33095 COMPLEX(kind=real_4) :: foo(1)
33098 CALL mp_timeset(routinen, handle)
33100#if defined(__parallel)
33101#if !defined(__GNUC__) || __GNUC__ >= 9
33102 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
33106 IF (
PRESENT(tag)) my_tag = tag
33108 msglen =
SIZE(msgout)
33109 IF (msglen > 0)
THEN
33110 CALL mpi_irecv(msgout(1), msglen, mpi_complex, source, my_tag, &
33111 comm%handle, request%handle, ierr)
33113 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
33114 comm%handle, request%handle, ierr)
33116 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
33118 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
33120 cpabort(
"mp_irecv called in non parallel case")
33127 CALL mp_timestop(handle)
33128 END SUBROUTINE mp_irecv_cv
33145 SUBROUTINE mp_irecv_cm2(msgout, source, comm, request, tag)
33146 COMPLEX(kind=real_4),
DIMENSION(:, :),
INTENT(INOUT) :: msgout
33147 INTEGER,
INTENT(IN) :: source
33150 INTEGER,
INTENT(in),
OPTIONAL :: tag
33152 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm2'
33155#if defined(__parallel)
33156 INTEGER :: ierr, msglen, my_tag
33157 COMPLEX(kind=real_4) :: foo(1)
33160 CALL mp_timeset(routinen, handle)
33162#if defined(__parallel)
33163#if !defined(__GNUC__) || __GNUC__ >= 9
33164 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
33168 IF (
PRESENT(tag)) my_tag = tag
33170 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)
33171 IF (msglen > 0)
THEN
33172 CALL mpi_irecv(msgout(1, 1), msglen, mpi_complex, source, my_tag, &
33173 comm%handle, request%handle, ierr)
33175 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
33176 comm%handle, request%handle, ierr)
33178 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_irecv @ "//routinen)
33180 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
33187 cpabort(
"mp_irecv called in non parallel case")
33189 CALL mp_timestop(handle)
33190 END SUBROUTINE mp_irecv_cm2
33208 SUBROUTINE mp_irecv_cm3(msgout, source, comm, request, tag)
33209 COMPLEX(kind=real_4),
DIMENSION(:, :, :),
INTENT(INOUT) :: msgout
33210 INTEGER,
INTENT(IN) :: source
33213 INTEGER,
INTENT(in),
OPTIONAL :: tag
33215 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm3'
33218#if defined(__parallel)
33219 INTEGER :: ierr, msglen, my_tag
33220 COMPLEX(kind=real_4) :: foo(1)
33223 CALL mp_timeset(routinen, handle)
33225#if defined(__parallel)
33226#if !defined(__GNUC__) || __GNUC__ >= 9
33227 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
33231 IF (
PRESENT(tag)) my_tag = tag
33233 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)
33234 IF (msglen > 0)
THEN
33235 CALL mpi_irecv(msgout(1, 1, 1), msglen, mpi_complex, source, my_tag, &
33236 comm%handle, request%handle, ierr)
33238 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
33239 comm%handle, request%handle, ierr)
33241 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
33243 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
33250 cpabort(
"mp_irecv called in non parallel case")
33252 CALL mp_timestop(handle)
33253 END SUBROUTINE mp_irecv_cm3
33269 SUBROUTINE mp_irecv_cm4(msgout, source, comm, request, tag)
33270 COMPLEX(kind=real_4),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: msgout
33271 INTEGER,
INTENT(IN) :: source
33274 INTEGER,
INTENT(in),
OPTIONAL :: tag
33276 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_irecv_cm4'
33279#if defined(__parallel)
33280 INTEGER :: ierr, msglen, my_tag
33281 COMPLEX(kind=real_4) :: foo(1)
33284 CALL mp_timeset(routinen, handle)
33286#if defined(__parallel)
33287#if !defined(__GNUC__) || __GNUC__ >= 9
33288 cpassert(is_contiguous(msgout) .OR.
SIZE(msgout) == 0)
33292 IF (
PRESENT(tag)) my_tag = tag
33294 msglen =
SIZE(msgout, 1)*
SIZE(msgout, 2)*
SIZE(msgout, 3)*
SIZE(msgout, 4)
33295 IF (msglen > 0)
THEN
33296 CALL mpi_irecv(msgout(1, 1, 1, 1), msglen, mpi_complex, source, my_tag, &
33297 comm%handle, request%handle, ierr)
33299 CALL mpi_irecv(foo, msglen, mpi_complex, source, my_tag, &
33300 comm%handle, request%handle, ierr)
33302 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_ircv @ "//routinen)
33304 CALL add_perf(perf_id=12, count=1, msg_size=msglen*(2*real_4_size))
33311 cpabort(
"mp_irecv called in non parallel case")
33313 CALL mp_timestop(handle)
33314 END SUBROUTINE mp_irecv_cm4
33326 SUBROUTINE mp_win_create_cv(base, comm, win)
33327 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(INOUT),
CONTIGUOUS :: base
33331 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_win_create_cv'
33334#if defined(__parallel)
33336 INTEGER(kind=mpi_address_kind) :: len
33337 COMPLEX(kind=real_4) :: foo(1)
33340 CALL mp_timeset(routinen, handle)
33342#if defined(__parallel)
33344 len =
SIZE(base)*(2*real_4_size)
33346 CALL mpi_win_create(base(1), len, (2*real_4_size), mpi_info_null, comm%handle, win%handle, ierr)
33348 CALL mpi_win_create(foo, len, (2*real_4_size), mpi_info_null, comm%handle, win%handle, ierr)
33350 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_win_create @ "//routinen)
33352 CALL add_perf(perf_id=20, count=1)
33356 win%handle = mp_win_null_handle
33358 CALL mp_timestop(handle)
33359 END SUBROUTINE mp_win_create_cv
33371 SUBROUTINE mp_rget_cv(base, source, win, win_data, myproc, disp, request, &
33372 origin_datatype, target_datatype)
33373 COMPLEX(kind=real_4),
DIMENSION(:),
CONTIGUOUS,
INTENT(INOUT) :: base
33374 INTEGER,
INTENT(IN) :: source
33376 COMPLEX(kind=real_4),
DIMENSION(:),
INTENT(IN) :: win_data
33377 INTEGER,
INTENT(IN),
OPTIONAL :: myproc, disp
33381 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_rget_cv'
33384#if defined(__parallel)
33385 INTEGER :: ierr, len, &
33386 origin_len, target_len
33387 LOGICAL :: do_local_copy
33388 INTEGER(kind=mpi_address_kind) :: disp_aint
33389 mpi_data_type :: handle_origin_datatype, handle_target_datatype
33392 CALL mp_timeset(routinen, handle)
33394#if defined(__parallel)
33397 IF (
PRESENT(disp))
THEN
33398 disp_aint = int(disp, kind=mpi_address_kind)
33400 handle_origin_datatype = mpi_complex
33402 IF (
PRESENT(origin_datatype))
THEN
33403 handle_origin_datatype = origin_datatype%type_handle
33406 handle_target_datatype = mpi_complex
33408 IF (
PRESENT(target_datatype))
THEN
33409 handle_target_datatype = target_datatype%type_handle
33413 do_local_copy = .false.
33414 IF (
PRESENT(myproc) .AND. .NOT.
PRESENT(origin_datatype) .AND. .NOT.
PRESENT(target_datatype))
THEN
33415 IF (myproc .EQ. source) do_local_copy = .true.
33417 IF (do_local_copy)
THEN
33419 base(:) = win_data(disp_aint + 1:disp_aint + len)
33424 CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
33425 target_len, handle_target_datatype, win%handle, request%handle, ierr)
33431 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_rget @ "//routinen)
33433 CALL add_perf(perf_id=25, count=1, msg_size=
SIZE(base)*(2*real_4_size))
33438 mark_used(origin_datatype)
33439 mark_used(target_datatype)
33443 IF (
PRESENT(disp))
THEN
33444 base(:) = win_data(disp + 1:disp +
SIZE(base))
33446 base(:) = win_data(:
SIZE(base))
33450 CALL mp_timestop(handle)
33451 END SUBROUTINE mp_rget_cv
33461 result(type_descriptor)
33462 INTEGER,
INTENT(IN) :: count
33463 INTEGER,
DIMENSION(1:count),
INTENT(IN),
TARGET :: lengths, displs
33466 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_indexed_make_c'
33469#if defined(__parallel)
33473 CALL mp_timeset(routinen, handle)
33475#if defined(__parallel)
33476 CALL mpi_type_indexed(count, lengths, displs, mpi_complex, &
33477 type_descriptor%type_handle, ierr)
33479 cpabort(
"MPI_Type_Indexed @ "//routinen)
33480 CALL mpi_type_commit(type_descriptor%type_handle, ierr)
33482 cpabort(
"MPI_Type_commit @ "//routinen)
33484 type_descriptor%type_handle = 5
33486 type_descriptor%length = count
33487 NULLIFY (type_descriptor%subtype)
33488 type_descriptor%vector_descriptor(1:2) = 1
33489 type_descriptor%has_indexing = .true.
33490 type_descriptor%index_descriptor%index => lengths
33491 type_descriptor%index_descriptor%chunks => displs
33493 CALL mp_timestop(handle)
33504 SUBROUTINE mp_allocate_c (DATA, len, stat)
33505 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
33506 INTEGER,
INTENT(IN) :: len
33507 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
33509 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_allocate_c'
33511 INTEGER :: handle, ierr
33513 CALL mp_timeset(routinen, handle)
33515#if defined(__parallel)
33517 CALL mp_alloc_mem(
DATA, len, stat=ierr)
33518 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
33519 CALL mp_stop(ierr,
"mpi_alloc_mem @ "//routinen)
33520 CALL add_perf(perf_id=15, count=1)
33522 ALLOCATE (
DATA(len), stat=ierr)
33523 IF (ierr /= 0 .AND. .NOT.
PRESENT(stat)) &
33524 CALL mp_stop(ierr,
"ALLOCATE @ "//routinen)
33526 IF (
PRESENT(stat)) stat = ierr
33527 CALL mp_timestop(handle)
33528 END SUBROUTINE mp_allocate_c
33536 SUBROUTINE mp_deallocate_c (DATA, stat)
33537 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: DATA
33538 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
33540 CHARACTER(len=*),
PARAMETER :: routineN =
'mp_deallocate_c'
33543#if defined(__parallel)
33547 CALL mp_timeset(routinen, handle)
33549#if defined(__parallel)
33550 CALL mp_free_mem(
DATA, ierr)
33551 IF (
PRESENT(stat))
THEN
33554 IF (ierr /= 0)
CALL mp_stop(ierr,
"mpi_free_mem @ "//routinen)
33557 CALL add_perf(perf_id=15, count=1)
33560 IF (
PRESENT(stat)) stat = 0
33562 CALL mp_timestop(handle)
33563 END SUBROUTINE mp_deallocate_c
33576 SUBROUTINE mp_file_write_at_cv(fh, offset, msg, msglen)
33577 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
33579 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
33580 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33583#if defined(__parallel)
33587 msg_len =
SIZE(msg)
33588 IF (
PRESENT(msglen)) msg_len = msglen
33589#if defined(__parallel)
33590 CALL mpi_file_write_at(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
33592 cpabort(
"mpi_file_write_at_cv @ mp_file_write_at_cv")
33594 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
33596 END SUBROUTINE mp_file_write_at_cv
33604 SUBROUTINE mp_file_write_at_c (fh, offset, msg)
33605 COMPLEX(kind=real_4),
INTENT(IN) :: msg
33607 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33609#if defined(__parallel)
33613 CALL mpi_file_write_at(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
33615 cpabort(
"mpi_file_write_at_c @ mp_file_write_at_c")
33617 WRITE (unit=fh%handle, pos=offset + 1) msg
33619 END SUBROUTINE mp_file_write_at_c
33631 SUBROUTINE mp_file_write_at_all_cv(fh, offset, msg, msglen)
33632 COMPLEX(kind=real_4),
CONTIGUOUS,
INTENT(IN) :: msg(:)
33634 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
33635 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33638#if defined(__parallel)
33642 msg_len =
SIZE(msg)
33643 IF (
PRESENT(msglen)) msg_len = msglen
33644#if defined(__parallel)
33645 CALL mpi_file_write_at_all(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
33647 cpabort(
"mpi_file_write_at_all_cv @ mp_file_write_at_all_cv")
33649 WRITE (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
33651 END SUBROUTINE mp_file_write_at_all_cv
33659 SUBROUTINE mp_file_write_at_all_c (fh, offset, msg)
33660 COMPLEX(kind=real_4),
INTENT(IN) :: msg
33662 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33664#if defined(__parallel)
33668 CALL mpi_file_write_at_all(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
33670 cpabort(
"mpi_file_write_at_all_c @ mp_file_write_at_all_c")
33672 WRITE (unit=fh%handle, pos=offset + 1) msg
33674 END SUBROUTINE mp_file_write_at_all_c
33687 SUBROUTINE mp_file_read_at_cv(fh, offset, msg, msglen)
33688 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
33690 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
33691 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33694#if defined(__parallel)
33698 msg_len =
SIZE(msg)
33699 IF (
PRESENT(msglen)) msg_len = msglen
33700#if defined(__parallel)
33701 CALL mpi_file_read_at(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
33703 cpabort(
"mpi_file_read_at_cv @ mp_file_read_at_cv")
33705 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
33707 END SUBROUTINE mp_file_read_at_cv
33715 SUBROUTINE mp_file_read_at_c (fh, offset, msg)
33716 COMPLEX(kind=real_4),
INTENT(OUT) :: msg
33718 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33720#if defined(__parallel)
33724 CALL mpi_file_read_at(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
33726 cpabort(
"mpi_file_read_at_c @ mp_file_read_at_c")
33728 READ (unit=fh%handle, pos=offset + 1) msg
33730 END SUBROUTINE mp_file_read_at_c
33742 SUBROUTINE mp_file_read_at_all_cv(fh, offset, msg, msglen)
33743 COMPLEX(kind=real_4),
INTENT(OUT),
CONTIGUOUS :: msg(:)
33745 INTEGER,
INTENT(IN),
OPTIONAL :: msglen
33746 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33749#if defined(__parallel)
33753 msg_len =
SIZE(msg)
33754 IF (
PRESENT(msglen)) msg_len = msglen
33755#if defined(__parallel)
33756 CALL mpi_file_read_at_all(fh%handle, offset, msg, msg_len, mpi_complex, mpi_status_ignore, ierr)
33758 cpabort(
"mpi_file_read_at_all_cv @ mp_file_read_at_all_cv")
33760 READ (unit=fh%handle, pos=offset + 1) msg(1:msg_len)
33762 END SUBROUTINE mp_file_read_at_all_cv
33770 SUBROUTINE mp_file_read_at_all_c (fh, offset, msg)
33771 COMPLEX(kind=real_4),
INTENT(OUT) :: msg
33773 INTEGER(kind=file_offset),
INTENT(IN) :: offset
33775#if defined(__parallel)
33779 CALL mpi_file_read_at_all(fh%handle, offset, msg, 1, mpi_complex, mpi_status_ignore, ierr)
33781 cpabort(
"mpi_file_read_at_all_c @ mp_file_read_at_all_c")
33783 READ (unit=fh%handle, pos=offset + 1) msg
33785 END SUBROUTINE mp_file_read_at_all_c
33794 FUNCTION mp_type_make_c (ptr, &
33795 vector_descriptor, index_descriptor) &
33796 result(type_descriptor)
33797 COMPLEX(kind=real_4),
DIMENSION(:),
TARGET, asynchronous :: ptr
33798 INTEGER,
DIMENSION(2),
INTENT(IN),
OPTIONAL :: vector_descriptor
33799 TYPE(mp_indexing_meta_type),
INTENT(IN),
OPTIONAL :: index_descriptor
33802 CHARACTER(len=*),
PARAMETER :: routinen =
'mp_type_make_c'
33804#if defined(__parallel)
33806#if defined(__MPI_F08)
33808 EXTERNAL :: mpi_get_address
33812 NULLIFY (type_descriptor%subtype)
33813 type_descriptor%length =
SIZE(ptr)
33814#if defined(__parallel)
33815 type_descriptor%type_handle = mpi_complex
33816 CALL mpi_get_address(ptr, type_descriptor%base, ierr)
33818 cpabort(
"MPI_Get_address @ "//routinen)
33820 type_descriptor%type_handle = 5
33822 type_descriptor%vector_descriptor(1:2) = 1
33823 type_descriptor%has_indexing = .false.
33824 type_descriptor%data_c => ptr
33825 IF (
PRESENT(vector_descriptor) .OR.
PRESENT(index_descriptor))
THEN
33826 cpabort(routinen//
": Vectors and indices NYI")
33828 END FUNCTION mp_type_make_c
33837 SUBROUTINE mp_alloc_mem_c (DATA, len, stat)
33838 COMPLEX(kind=real_4),
CONTIGUOUS,
DIMENSION(:),
POINTER :: data
33839 INTEGER,
INTENT(IN) :: len
33840 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
33842#if defined(__parallel)
33843 INTEGER :: size, ierr, length, &
33845 INTEGER(KIND=MPI_ADDRESS_KIND) :: mp_size
33846 TYPE(c_ptr) :: mp_baseptr
33847 mpi_info_type :: mp_info
33849 length = max(len, 1)
33850 CALL mpi_type_size(mpi_complex,
size, ierr)
33851 mp_size = int(length, kind=mpi_address_kind)*
size
33852 IF (mp_size .GT. mp_max_memory_size)
THEN
33853 cpabort(
"MPI cannot allocate more than 2 GiByte")
33855 mp_info = mpi_info_null
33856 CALL mpi_alloc_mem(mp_size, mp_info, mp_baseptr, mp_res)
33857 CALL c_f_pointer(mp_baseptr,
DATA, (/length/))
33858 IF (
PRESENT(stat)) stat = mp_res
33860 INTEGER :: length, mystat
33861 length = max(len, 1)
33862 IF (
PRESENT(stat))
THEN
33863 ALLOCATE (
DATA(length), stat=mystat)
33866 ALLOCATE (
DATA(length))
33869 END SUBROUTINE mp_alloc_mem_c
33877 SUBROUTINE mp_free_mem_c (DATA, stat)
33878 COMPLEX(kind=real_4),
DIMENSION(:), &
33879 POINTER, asynchronous :: data
33880 INTEGER,
INTENT(OUT),
OPTIONAL :: stat
33882#if defined(__parallel)
33884 CALL mpi_free_mem(
DATA, mp_res)
33885 IF (
PRESENT(stat)) stat = mp_res
33888 IF (
PRESENT(stat)) stat = 0
33890 END SUBROUTINE mp_free_mem_c
static int isum(const int n, const int input[n])
Private routine for computing the sum of the given integers.
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
Defines the basic variable types.
integer, parameter, public int_8
integer, parameter, public dp
integer, parameter, public int_4_size
integer, parameter, public default_string_length
integer, parameter, public real_8_size
integer, parameter, public int_8_size
integer, parameter, public real_4_size
integer, parameter, public real_4
integer, parameter, public real_8
integer, parameter, public int_4
Machine interface based on Fortran 2003 and POSIX.
subroutine, public m_abort()
Can be used to get a nice core.
Interface to the message passing library MPI.
type(mp_comm_type), parameter, public mp_comm_null
integer, parameter, public mp_comm_unequal
logical, save, public mp_collect_timings
subroutine, public mp_dims_create(nodes, dims)
wrapper to MPI_Dims_create
subroutine, public mp_para_env_create(para_env, group)
creates a new para environment
integer, parameter intlen
type(mp_file_descriptor_type) function, public mp_file_type_hindexed_make_chv(count, lengths, displs)
Creates an indexed MPI type for arrays of strings using bytes for spacing (hindexed type)
subroutine, public mp_world_init(mp_comm)
initializes the system default communicator
integer, parameter, public file_amode_rdwr
subroutine, public mp_para_cart_create(cart, group)
creates a cart (multidimensional parallel environment)
subroutine, public mp_file_type_free(type_descriptor)
Releases the type used for MPI I/O.
integer, parameter, public mp_any_tag
integer, parameter, public file_amode_wronly
integer, parameter, public mpi_character_size
integer, parameter, public mp_comm_ident
type(mp_type_descriptor_type) function, public mp_type_indexed_make_z(count, lengths, displs)
...
subroutine, public mp_abort()
globally stops all tasks this is intended to be low level, most of CP2K should call cp_abort()
type(mp_type_descriptor_type) function, public mp_type_indexed_make_r(count, lengths, displs)
...
type(mp_comm_type), parameter, public mp_comm_world
integer, parameter, public file_amode_create
subroutine, public mp_para_env_release(para_env)
releases the para object (to be called when you don't want anymore the shared copy of this object)
type(mp_comm_type), parameter, public mp_comm_self
integer, parameter, public mp_comm_congruent
subroutine, public mp_para_cart_release(cart)
releases the given cart
type(mp_type_descriptor_type) function, public mp_type_indexed_make_d(count, lengths, displs)
...
integer, parameter, public mp_comm_compare_default
subroutine, public mp_world_finalize()
finalizes the system default communicator
subroutine, public mp_file_delete(filepath, info)
Deletes a file. Auxiliary routine to emulate 'replace' action for mp_file_open. Only the master proce...
integer, parameter, public mp_comm_similar
type(mp_file_type), parameter, public mp_file_null
integer, parameter, public mp_any_source
type(mp_type_descriptor_type) function, public mp_type_indexed_make_c(count, lengths, displs)
...
type(mp_info_type), parameter, public mp_info_null
type(mp_win_type), parameter, public mp_win_null
integer, parameter, public file_amode_append
subroutine, public mp_get_library_version(version, resultlen)
Get Version of the MPI Library (MPI 3)
integer, parameter, public address_kind
subroutine, public mp_file_get_amode(mpi_io, replace, amode, form, action, status, position)
(parallel) Utility routine to determine MPI file access mode based on variables
integer, parameter, public file_amode_rdonly
subroutine, public mp_waitany(requests, completed)
waits for completion of any of the given requests
integer, parameter, public file_amode_excl
type(mp_request_type), parameter, public mp_request_null
subroutine, public mp_file_type_set_view_chv(fh, offset, type_descriptor)
Uses a previously created indexed MPI character type to tell the MPI processes how to partition (set_...
subroutine, public mp_type_size(type_descriptor, type_size)
Returns the size of a data type in bytes.
integer, parameter, public mpi_integer_size
Defines all routines to deal with the performance of MPI routines.
subroutine, public rm_mp_perf_env()
...
subroutine, public add_perf(perf_id, count, msg_size)
adds the performance informations of one call
subroutine, public add_mp_perf_env(perf_env)
start and stop the performance indicators for every call to start there has to be (exactly) one call ...
represent a multidimensional parallel environment
represent a pointer to a para env (to build arrays)
stores all the informations relevant to an mpi environment