42 integer,
intent(in) :: ierr
45 if (ierr /= mpi_success)
then
73 integer,
intent(in) :: status
78 call mpi_abort(mpi_comm_world, status, ierr)
93 call mpi_finalize(ierr)
107 call mpi_barrier(mpi_comm_world, ierr)
119 integer :: rank, ierr
121 call mpi_comm_rank(mpi_comm_world, rank, ierr)
136 integer :: size, ierr
138 call mpi_comm_size(mpi_comm_world,
size, ierr)
153 real(kind=dp),
parameter :: test_real = 2.718281828459d0
154 complex(kind=dc),
parameter :: test_complex &
155 = (0.707106781187d0, 1.4142135624d0)
156 logical,
parameter :: test_logical = .true.
157 character(len=100),
parameter :: test_string &
158 =
"a truth universally acknowledged"
159 integer,
parameter :: test_integer = 314159
161 character,
allocatable :: buffer(:)
162 integer :: buffer_size, max_buffer_size, position
163 real(kind=dp) :: send_real, recv_real
164 complex(kind=dc) :: send_complex, recv_complex
165 logical :: send_logical, recv_logical
166 character(len=100) :: send_string, recv_string
167 integer :: send_integer, recv_integer
168 real(kind=dp) :: send_real_array(2)
169 real(kind=dp),
pointer :: recv_real_array(:)
171 allocate(recv_real_array(1))
174 send_real = test_real
175 send_complex = test_complex
176 send_logical = test_logical
177 send_string = test_string
178 send_integer = test_integer
179 send_real_array(1) =
real(test_complex)
180 send_real_array(2) = aimag(test_complex)
183 max_buffer_size = max_buffer_size &
185 max_buffer_size = max_buffer_size &
187 max_buffer_size = max_buffer_size &
189 max_buffer_size = max_buffer_size &
191 max_buffer_size = max_buffer_size &
193 max_buffer_size = max_buffer_size &
196 allocate(buffer(max_buffer_size))
205 call
assert_msg(350740830, position <= max_buffer_size, &
206 "MPI test failure: pack position " &
208 //
" greater than max_buffer_size " &
210 buffer_size = position
216 allocate(buffer(buffer_size))
229 call
assert_msg(787677020, position == buffer_size, &
230 "MPI test failure: unpack position " &
232 //
" not equal to buffer_size " &
239 call
assert_msg(567548916, recv_real == test_real, &
240 "MPI test failure: real recv " &
242 //
" not equal to " &
244 call
assert_msg(653908509, recv_complex == test_complex, &
245 "MPI test failure: complex recv " &
247 //
" not equal to " &
249 call
assert_msg(307746296, recv_logical .eqv. test_logical, &
250 "MPI test failure: logical recv " &
252 //
" not equal to " &
254 call
assert_msg(155693492, recv_string == test_string, &
255 "MPI test failure: string recv '" &
256 // trim(recv_string) &
257 //
"' not equal to '" &
258 // trim(test_string) //
"'")
259 call
assert_msg(875699427, recv_integer == test_integer, &
260 "MPI test failure: integer recv " &
262 //
" not equal to " &
264 call
assert_msg(326982363,
size(recv_real_array) == 2, &
265 "MPI test failure: real array recv size " &
267 //
" not equal to 2")
269 recv_real_array(1) ==
real(test_complex), &
270 "MPI test failure: real array recv index 1 " &
272 //
" not equal to " &
275 recv_real_array(2) == aimag(test_complex), &
276 "MPI test failure: real array recv index 2 " &
278 //
" not equal to " &
282 deallocate(recv_real_array)
293 integer,
intent(inout) :: val
296 integer :: root, ierr
299 call mpi_bcast(val, 1, mpi_integer, root, &
300 mpi_comm_world, ierr)
312 character(len=*),
intent(inout) :: val
315 integer :: root, ierr
318 call mpi_bcast(val, len(val), mpi_character, root, &
319 mpi_comm_world, ierr)
331 character,
intent(inout) :: val(:)
334 integer :: root, ierr
337 call mpi_bcast(val,
size(val), mpi_character, root, &
338 mpi_comm_world, ierr)
350 integer,
intent(in) :: val
355 call mpi_pack_size(1, mpi_integer, mpi_comm_world, &
370 real(kind=dp),
intent(in) :: val
375 call mpi_pack_size(1, mpi_double_precision, mpi_comm_world, &
390 character(len=*),
intent(in) :: val
395 call mpi_pack_size(len_trim(val), mpi_character, mpi_comm_world, &
412 logical,
intent(in) :: val
417 call mpi_pack_size(1, mpi_logical, mpi_comm_world, &
432 complex(kind=dc),
intent(in) :: val
437 call mpi_pack_size(1, mpi_double_complex, mpi_comm_world, &
452 integer,
intent(in) :: val(:)
457 call mpi_pack_size(
size(val), mpi_integer, mpi_comm_world, &
474 real(kind=dp),
intent(in) :: val(:)
479 call mpi_pack_size(
size(val), mpi_double_precision, mpi_comm_world, &
496 character(len=*),
intent(in) :: val(:)
498 integer :: i, total_size
514 real(kind=dp),
intent(in) :: val(:,:)
519 call mpi_pack_size(
size(val), mpi_double_precision, mpi_comm_world, &
537 character,
intent(inout) :: buffer(:)
539 integer,
intent(inout) :: position
541 integer,
intent(in) :: val
544 integer :: prev_position, ierr
546 prev_position = position
547 call mpi_pack(val, 1, mpi_integer, buffer,
size(buffer), &
548 position, mpi_comm_world, ierr)
562 character,
intent(inout) :: buffer(:)
564 integer,
intent(inout) :: position
566 real(kind=dp),
intent(in) :: val
569 integer :: prev_position, ierr
571 prev_position = position
572 call mpi_pack(val, 1, mpi_double_precision, buffer,
size(buffer), &
573 position, mpi_comm_world, ierr)
587 character,
intent(inout) :: buffer(:)
589 integer,
intent(inout) :: position
591 character(len=*),
intent(in) :: val
594 integer :: prev_position, length, ierr
596 prev_position = position
597 length = len_trim(val)
599 call mpi_pack(val, length, mpi_character, buffer,
size(buffer), &
600 position, mpi_comm_world, ierr)
614 character,
intent(inout) :: buffer(:)
616 integer,
intent(inout) :: position
618 logical,
intent(in) :: val
621 integer :: prev_position, ierr
623 prev_position = position
624 call mpi_pack(val, 1, mpi_logical, buffer,
size(buffer), &
625 position, mpi_comm_world, ierr)
639 character,
intent(inout) :: buffer(:)
641 integer,
intent(inout) :: position
643 complex(kind=dc),
intent(in) :: val
646 integer :: prev_position, ierr
648 prev_position = position
649 call mpi_pack(val, 1, mpi_double_complex, buffer,
size(buffer), &
650 position, mpi_comm_world, ierr)
664 character,
intent(inout) :: buffer(:)
666 integer,
intent(inout) :: position
668 integer,
intent(in) :: val(:)
671 integer :: prev_position, n, ierr
673 prev_position = position
676 call mpi_pack(val, n, mpi_integer, buffer,
size(buffer), &
677 position, mpi_comm_world, ierr)
691 character,
intent(inout) :: buffer(:)
693 integer,
intent(inout) :: position
695 real(kind=dp),
intent(in) :: val(:)
698 integer :: prev_position, n, ierr
700 prev_position = position
703 call mpi_pack(val, n, mpi_double_precision, buffer,
size(buffer), &
704 position, mpi_comm_world, ierr)
718 character,
intent(inout) :: buffer(:)
720 integer,
intent(inout) :: position
722 character(len=*),
intent(in) :: val(:)
725 integer :: prev_position, i, n
727 prev_position = position
745 character,
intent(inout) :: buffer(:)
747 integer,
intent(inout) :: position
749 real(kind=dp),
intent(in) :: val(:,:)
752 integer :: prev_position, n1, n2, ierr
754 prev_position = position
759 call mpi_pack(val, n1*n2, mpi_double_precision, buffer,
size(buffer), &
760 position, mpi_comm_world, ierr)
774 character,
intent(inout) :: buffer(:)
776 integer,
intent(inout) :: position
778 integer,
intent(out) :: val
781 integer :: prev_position, ierr
783 prev_position = position
784 call mpi_unpack(buffer,
size(buffer), position, val, 1, mpi_integer, &
785 mpi_comm_world, ierr)
799 character,
intent(inout) :: buffer(:)
801 integer,
intent(inout) :: position
803 real(kind=dp),
intent(out) :: val
806 integer :: prev_position, ierr
808 prev_position = position
809 call mpi_unpack(buffer,
size(buffer), position, val, 1, &
810 mpi_double_precision, mpi_comm_world, ierr)
824 character,
intent(inout) :: buffer(:)
826 integer,
intent(inout) :: position
828 character(len=*),
intent(out) :: val
831 integer :: prev_position, length, ierr
833 prev_position = position
835 call
assert(946399479, length <= len(val))
837 call mpi_unpack(buffer,
size(buffer), position, val, length, &
838 mpi_character, mpi_comm_world, ierr)
852 character,
intent(inout) :: buffer(:)
854 integer,
intent(inout) :: position
856 logical,
intent(out) :: val
859 integer :: prev_position, ierr
861 prev_position = position
862 call mpi_unpack(buffer,
size(buffer), position, val, 1, mpi_logical, &
863 mpi_comm_world, ierr)
877 character,
intent(inout) :: buffer(:)
879 integer,
intent(inout) :: position
881 complex(kind=dc),
intent(out) :: val
884 integer :: prev_position, ierr
886 prev_position = position
887 call mpi_unpack(buffer,
size(buffer), position, val, 1, &
888 mpi_double_complex, mpi_comm_world, ierr)
902 character,
intent(inout) :: buffer(:)
904 integer,
intent(inout) :: position
906 integer,
pointer :: val(:)
909 integer :: prev_position, n, ierr
911 prev_position = position
915 call mpi_unpack(buffer,
size(buffer), position, val, n, mpi_integer, &
916 mpi_comm_world, ierr)
930 character,
intent(inout) :: buffer(:)
932 integer,
intent(inout) :: position
934 real(kind=dp),
pointer :: val(:)
937 integer :: prev_position, n, ierr
939 prev_position = position
943 call mpi_unpack(buffer,
size(buffer), position, val, n, &
944 mpi_double_precision, mpi_comm_world, ierr)
958 character,
intent(inout) :: buffer(:)
960 integer,
intent(inout) :: position
962 character(len=*),
pointer :: val(:)
965 integer :: prev_position, i, n
967 prev_position = position
986 character,
intent(inout) :: buffer(:)
988 integer,
intent(inout) :: position
990 real(kind=dp),
pointer :: val(:,:)
993 integer :: prev_position, n1, n2, ierr
995 prev_position = position
1000 call mpi_unpack(buffer,
size(buffer), position, val, n1*n2, &
1001 mpi_double_precision, mpi_comm_world, ierr)
1003 call
assert(781681739, position - prev_position &
1016 real(kind=dp),
intent(in) :: val
1018 real(kind=dp),
intent(out) :: val_avg
1023 call mpi_reduce(val, val_avg, 1, mpi_double_precision, mpi_sum, 0, &
1024 mpi_comm_world, ierr)
1027 val_avg = val_avg /
real(pmc_mpi_size(), kind=dp)
1041 real(kind=dp),
intent(in) :: from_val
1043 real(kind=dp),
intent(out) :: to_val
1045 integer,
intent(in) :: from_proc
1047 integer,
intent(in) :: to_proc
1050 integer :: rank, ierr, status(mpi_status_size)
1053 if (from_proc == to_proc)
then
1054 if (rank == from_proc)
then
1058 if (rank == from_proc)
then
1059 call mpi_send(from_val, 1, mpi_double_precision, to_proc, &
1060 208020430, mpi_comm_world, ierr)
1062 elseif (rank == to_proc)
then
1063 call mpi_recv(to_val, 1, mpi_double_precision, from_proc, &
1064 208020430, mpi_comm_world, status, ierr)
1080 integer,
intent(in) :: from_val
1082 integer,
intent(out) :: to_val
1084 integer,
intent(in) :: from_proc
1086 integer,
intent(in) :: to_proc
1089 integer :: rank, ierr, status(mpi_status_size)
1092 if (from_proc == to_proc)
then
1093 if (rank == from_proc)
then
1097 if (rank == from_proc)
then
1098 call mpi_send(from_val, 1, mpi_integer, to_proc, &
1099 208020430, mpi_comm_world, ierr)
1101 elseif (rank == to_proc)
then
1102 call mpi_recv(to_val, 1, mpi_integer, from_proc, &
1103 208020430, mpi_comm_world, status, ierr)
1120 integer,
intent(in) :: val
1122 integer,
intent(out) :: val_sum
1127 call mpi_reduce(val, val_sum, 1, mpi_integer, mpi_sum, 0, &
1128 mpi_comm_world, ierr)
1143 integer,
intent(in) :: val
1145 integer,
intent(out) :: val_sum
1150 call mpi_allreduce(val, val_sum, 1, mpi_integer, mpi_sum, &
1151 mpi_comm_world, ierr)
1166 real(kind=dp),
intent(in) :: val(:)
1168 real(kind=dp),
intent(out) :: val_avg(:)
1173 call
assert(915136121,
size(val) ==
size(val_avg))
1174 call mpi_reduce(val, val_avg,
size(val), mpi_double_precision, &
1175 mpi_sum, 0, mpi_comm_world, ierr)
1178 val_avg = val_avg /
real(pmc_mpi_size(), kind=dp)
1193 real(kind=dp),
intent(in) :: val(:,:)
1195 real(kind=dp),
intent(out) :: val_avg(:,:)
1200 call
assert(131229046,
size(val,1) ==
size(val_avg,1))
1201 call
assert(992122167,
size(val,2) ==
size(val_avg,2))
1202 call mpi_reduce(val, val_avg,
size(val), mpi_double_precision, &
1203 mpi_sum, 0, mpi_comm_world, ierr)
1206 val_avg = val_avg /
real(pmc_mpi_size(), kind=dp)
1221 real(kind=dp),
intent(in) :: val
1223 real(kind=dp),
intent(out) :: val_avg
1228 call mpi_allreduce(val, val_avg, 1, mpi_double_precision, mpi_sum, &
1229 mpi_comm_world, ierr)
1231 val_avg = val_avg /
real(pmc_mpi_size(), kind=dp)
1245 real(kind=dp),
intent(in) :: val(:)
1247 real(kind=dp),
intent(out) :: val_avg(:)
1252 call
assert(948533359,
size(val) ==
size(val_avg))
1253 call mpi_allreduce(val, val_avg,
size(val), mpi_double_precision, &
1254 mpi_sum, mpi_comm_world, ierr)
1256 val_avg = val_avg /
real(pmc_mpi_size(), kind=dp)
1270 integer,
intent(in) :: val
1272 integer,
intent(out) :: val_min
1277 call mpi_allreduce(val, val_min, 1, mpi_integer, mpi_min, &
1278 mpi_comm_world, ierr)
1293 integer,
intent(in) :: val
1295 integer,
intent(out) :: val_max
1300 call mpi_allreduce(val, val_max, 1, mpi_integer, mpi_max, &
1301 mpi_comm_world, ierr)
1316 real(kind=dp),
intent(in) :: val
1318 real(kind=dp),
intent(out) :: val_min
1323 call mpi_allreduce(val, val_min, 1, mpi_double_precision, mpi_min, &
1324 mpi_comm_world, ierr)
1339 real(kind=dp),
intent(in) :: val
1341 real(kind=dp),
intent(out) :: val_max
1346 call mpi_allreduce(val, val_max, 1, mpi_double_precision, mpi_max, &
1347 mpi_comm_world, ierr)
1361 integer,
intent(in) :: val
1364 integer :: min_val, max_val
1368 if (min_val == max_val)
then
1385 real(kind=dp),
intent(in) :: val
1388 real(kind=dp) :: min_val, max_val
1392 if (min_val == max_val)
then
1409 integer,
intent(in) :: send(:)
1411 integer,
intent(out) :: recv(size(send))
1416 call mpi_alltoall(send, 1, mpi_integer, recv, 1, mpi_integer, &
1417 mpi_comm_world, ierr)
1432 integer,
intent(in) :: send(:)
1434 integer,
intent(out) :: recv(:,:)
1437 integer :: n_proc, n_bin, n_data, ierr
1438 integer,
allocatable :: send_buf(:), recv_buf(:)
1441 n_data =
size(send, 1)
1442 call
assert(353005542, all(shape(recv) == (/n_data, n_proc/)))
1445 allocate(send_buf(n_data))
1446 allocate(recv_buf(n_data * n_proc))
1448 call mpi_allgather(send_buf, n_data, mpi_integer, &
1449 recv_buf, n_data, mpi_integer, mpi_comm_world, ierr)
1451 recv = reshape(recv_buf, (/n_data, n_proc/))
1452 deallocate(send_buf)
1453 deallocate(recv_buf)
1467 real(kind=dp),
intent(in) :: send(:)
1469 real(kind=dp),
intent(out) :: recv(:,:)
1472 integer :: n_proc, n_bin, n_data, ierr
1473 real(kind=dp),
allocatable :: send_buf(:), recv_buf(:)
1476 n_data =
size(send, 1)
1477 call
assert(291000580, all(shape(recv) == (/n_data, n_proc/)))
1480 allocate(send_buf(n_data))
1481 allocate(recv_buf(n_data * n_proc))
1483 call mpi_allgather(send_buf, n_data, mpi_double_precision, &
1484 recv_buf, n_data, mpi_double_precision, mpi_comm_world, ierr)
1486 recv = reshape(recv_buf, (/n_data, n_proc/))
1487 deallocate(send_buf)
1488 deallocate(recv_buf)
1502 character,
intent(inout) :: buffer(:)
1504 integer,
intent(inout) :: position
1506 real(kind=dp),
intent(inout),
allocatable :: val(:)
1509 integer :: prev_position, n, ierr
1511 prev_position = position
1513 if (
allocated(val))
deallocate(val)
1515 call mpi_unpack(buffer,
size(buffer), position, val, n, &
1516 mpi_double_precision, mpi_comm_world, ierr)
integer function pmc_mpi_pack_size_real(val)
Determines the number of bytes required to pack the given value.
integer function pmc_mpi_pack_size_real_array(val)
Determines the number of bytes required to pack the given value.
subroutine pmc_mpi_pack_logical(buffer, position, val)
Packs the given value into the buffer, advancing position.
integer function pmc_mpi_pack_size_integer(val)
Determines the number of bytes required to pack the given value.
subroutine pmc_mpi_transfer_real(from_val, to_val, from_proc, to_proc)
Transfer the value between the given processes.
subroutine pmc_mpi_pack_real_array_2d(buffer, position, val)
Packs the given value into the buffer, advancing position.
subroutine pmc_mpi_allreduce_min_real(val, val_min)
Computes the minimum of val across all processes, storing the result in val_min on all processes...
subroutine pmc_mpi_bcast_string(val)
Broadcast the given value from process 0 to all other processes.
subroutine pmc_mpi_unpack_real(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
character(len=pmc_util_convert_string_len) function logical_to_string(val)
Convert a logical to a string format.
subroutine pmc_mpi_unpack_real_array_alloc(buffer, position, val)
Unpacks the given value from the buffer to an allocated array, advancing position.
subroutine pmc_mpi_allreduce_sum_integer(val, val_sum)
Computes the sum of val across all processes, storing the result in val_sum on all processes...
subroutine assert_msg(code, condition_ok, error_msg)
Errors unless condition_ok is true.
subroutine pmc_mpi_bcast_packed(val)
Broadcast the given value from process 0 to all other processes.
subroutine pmc_mpi_unpack_complex(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
subroutine pmc_mpi_pack_string(buffer, position, val)
Packs the given value into the buffer, advancing position.
logical function pmc_mpi_allequal_real(val)
Returns whether all processors have the same value.
subroutine pmc_mpi_pack_string_array(buffer, position, val)
Packs the given value into the buffer, advancing position.
integer function pmc_mpi_pack_size_string(val)
Determines the number of bytes required to pack the given value.
subroutine pmc_mpi_finalize()
Shut down MPI.
subroutine pmc_mpi_init()
Initialize MPI.
subroutine pmc_mpi_pack_integer(buffer, position, val)
Packs the given value into the buffer, advancing position.
subroutine pmc_mpi_reduce_avg_real_array(val, val_avg)
Computes the average of val across all processes, storing the result in val_avg on the root process...
integer function pmc_mpi_size()
Returns the total number of processes.
subroutine pmc_mpi_reduce_sum_integer(val, val_sum)
Computes the sum of val across all processes, storing the result in val_sum on the root process...
subroutine pmc_mpi_test()
Perform basic sanity checks on send/receive.
Common utility subroutines.
subroutine pmc_mpi_unpack_real_array(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
logical function pmc_mpi_allequal_integer(val)
Returns whether all processors have the same value.
subroutine pmc_mpi_allreduce_average_real_array(val, val_avg)
Computes the average of val across all processes, storing the result in val_avg on all processes...
subroutine pmc_mpi_unpack_integer(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
integer function pmc_mpi_rank()
Returns the rank of the current process.
Wrapper functions for MPI.
subroutine pmc_mpi_bcast_integer(val)
Broadcast the given value from process 0 to all other processes.
subroutine pmc_mpi_unpack_integer_array(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
integer function pmc_mpi_pack_size_real_array_2d(val)
Determines the number of bytes required to pack the given value.
integer function pmc_mpi_pack_size_string_array(val)
Determines the number of bytes required to pack the given value.
subroutine pmc_mpi_pack_complex(buffer, position, val)
Packs the given value into the buffer, advancing position.
subroutine pmc_mpi_unpack_logical(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
subroutine pmc_mpi_allreduce_max_real(val, val_max)
Computes the maximum of val across all processes, storing the result in val_max on all processes...
character(len=pmc_util_convert_string_len) function integer_to_string(val)
Convert an integer to a string format.
integer function pmc_mpi_pack_size_complex(val)
Determines the number of bytes required to pack the given value.
character(len=pmc_util_convert_string_len) function complex_to_string(val)
Convert a complex to a string format.
subroutine pmc_mpi_transfer_integer(from_val, to_val, from_proc, to_proc)
Transfer the value between the given processes.
logical function pmc_mpi_support()
Whether MPI support is compiled in.
subroutine pmc_mpi_check_ierr(ierr)
Dies if ierr is not ok.
subroutine pmc_mpi_unpack_real_array_2d(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
subroutine pmc_mpi_unpack_string(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
subroutine die(code)
Error immediately.
subroutine pmc_mpi_abort(status)
Abort the program.
subroutine pmc_mpi_barrier()
Synchronize all processes.
subroutine pmc_mpi_pack_real(buffer, position, val)
Packs the given value into the buffer, advancing position.
subroutine pmc_mpi_unpack_string_array(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
integer function pmc_mpi_pack_size_integer_array(val)
Determines the number of bytes required to pack the given value.
subroutine pmc_mpi_pack_real_array(buffer, position, val)
Packs the given value into the buffer, advancing position.
character(len=pmc_util_convert_string_len) function real_to_string(val)
Convert a real to a string format.
subroutine pmc_mpi_allreduce_average_real(val, val_avg)
Computes the average of val across all processes, storing the result in val_avg on all processes...
subroutine pmc_mpi_alltoall_integer(send, recv)
Does an all-to-all transfer of integers.
subroutine pmc_mpi_allgather_real_array(send, recv)
Does an allgather of real arrays (must be the same size on all processes).
subroutine assert(code, condition_ok)
Errors unless condition_ok is true.
subroutine pmc_mpi_reduce_avg_real(val, val_avg)
Computes the average of val across all processes, storing the result in val_avg on the root process...
subroutine pmc_mpi_allgather_integer_array(send, recv)
Does an allgather of integer arrays (must be the same size on all processes).
subroutine pmc_mpi_reduce_avg_real_array_2d(val, val_avg)
Computes the average of val across all processes, storing the result in val_avg on the root process...
subroutine pmc_mpi_pack_integer_array(buffer, position, val)
Packs the given value into the buffer, advancing position.
subroutine pmc_mpi_allreduce_max_integer(val, val_max)
Computes the maximum of val across all processes, storing the result in val_max on all processes...
subroutine pmc_mpi_allreduce_min_integer(val, val_min)
Computes the minimum of val across all processes, storing the result in val_min on all processes...
integer function pmc_mpi_pack_size_logical(val)
Determines the number of bytes required to pack the given value.