130 #include "sll_assert.h"
131 #include "sll_memory.h"
132 #include "sll_working_precision.h"
147 mpi_double_complex, &
148 mpi_double_precision, &
163 mpi_thread_funneled, &
243 sll_int32 :: thread_level_required
244 sll_int32 :: thread_level_provided
371 if (.not.
associated(ptr))
then
372 write (*,
'(a)')
'sll_check_collective_ptr: non-associated pointer'
373 stop
'SLL_CHECK_COLLECTIVE_PTR'
385 sll_int32,
intent(in) :: ierr
386 character(len=*),
intent(in) :: descriptor
388 if (ierr .ne. mpi_success)
then
389 write (*,
'(a, a)')
'MPI error code failure: ', descriptor
402 sll_assert(
associated(col1))
403 sll_assert(
associated(col2))
404 if (col1%comm == col2%comm)
then
416 sll_int32,
intent(in),
optional :: required
421 if (
present(required))
then
439 sll_int32,
intent(in) :: communicator_in
454 call mpi_barrier(mpi_comm_world, ierr)
456 'sll_s_halt_collective(): MPI_BARRIER()')
457 call mpi_finalize(ierr)
490 sll_int32,
intent(in) :: color
491 sll_int32,
intent(in) :: key
517 sll_deallocate(col, ierr)
576 call mpi_barrier(col%comm, ierr)
578 'sll_s_collective_barrier(): MPI_BARRIER()')
588 logical,
intent(inout) :: buffer(:)
589 sll_int32,
intent(in) :: root
591 call mpi_bcast(buffer,
size(buffer), mpi_logical, root, col%comm, ierr)
602 sll_int32,
intent(inout) :: buffer(:)
603 sll_int32,
intent(in) :: root
607 call mpi_bcast(buffer,
size(buffer), mpi_integer, root, col%comm, ierr)
609 'sll_collective_bcast_int32(): MPI_BCAST()')
619 sll_int64,
intent(inout) :: buffer(:)
620 sll_int32,
intent(in) :: root
624 call mpi_bcast(buffer,
size(buffer), mpi_integer8, root, col%comm, ierr)
626 'sll_collective_bcast_int64(): MPI_BCAST()')
636 sll_real64,
intent(inout) :: buffer(:)
637 sll_int32,
intent(in) :: root
641 call mpi_bcast(buffer,
size(buffer), mpi_real8, root, col%comm, ierr)
643 'sll_collective_bcast_real64(): MPI_BCAST()')
654 sll_real32,
intent(inout) :: buffer(:)
655 sll_int32,
intent(in) ::
size
656 sll_int32,
intent(in) :: root
660 call mpi_bcast(buffer,
size, mpi_real, root, col%comm, ierr)
662 'sll_collective_bcast_real32(): MPI_BCAST()')
673 sll_real64,
intent(inout) :: buffer(:)
674 sll_int32,
intent(in) ::
size
675 sll_int32,
intent(in) :: root
679 call mpi_bcast(buffer,
size, mpi_real8, root, col%comm, ierr)
681 'sll_s_collective_bcast_real64(): MPI_BCAST()')
692 sll_comp64,
intent(inout) :: buffer(:)
693 sll_int32,
intent(in) ::
size
694 sll_int32,
intent(in) :: root
698 call mpi_bcast(buffer,
size, mpi_double_complex, root, col%comm, ierr)
700 'sll_collective_bcast_comp64(): MPI_BCAST()')
711 sll_comp32,
intent(inout) :: buffer(:)
712 sll_int32,
intent(in) ::
size
713 sll_int32,
intent(in) :: root
717 call mpi_bcast(buffer,
size, mpi_complex, root, col%comm, ierr)
719 'sll_collective_bcast_comp32(): MPI_BCAST()')
730 sll_real64,
dimension(:, :, :),
intent(inout) :: buffer
731 sll_int32,
intent(in) :: root
732 sll_int32 :: count, ierr
734 call mpi_bcast(buffer, count, mpi_double_precision, root, col%comm, ierr)
735 sll_assert(ierr == mpi_success)
748 sll_real32,
dimension(:),
intent(in) :: send_buf
750 sll_real32,
dimension(:),
intent(out) :: rec_buf
751 sll_int32,
intent(in) :: root
758 call mpi_gather(send_buf, send_sz, mpi_real, rec_buf, send_sz, &
759 mpi_real, root, col%comm, ierr)
761 'sll_collective_gather_real(): MPI_GATHER()')
767 sll_real64,
dimension(:),
intent(in) :: send_buf
769 sll_real64,
dimension(:),
intent(out) :: rec_buf
770 sll_int32,
intent(in) :: root
777 call mpi_gather(send_buf, send_sz, mpi_double_precision, rec_buf, send_sz, &
778 mpi_double_precision, root, col%comm, ierr)
780 'sll_collective_gather_real(): MPI_GATHER()')
785 logical,
intent(in) :: send_buf(:)
786 sll_int32,
intent(in) :: root
787 logical,
intent(out) :: rec_buf(:)
789 sll_int32 :: send_sz, ierr
792 send_sz =
size(send_buf)
795 if (col%rank == root)
then
796 sll_assert(
size(rec_buf) == send_sz*col%size)
801 call mpi_gather(send_buf, send_sz, mpi_logical, rec_buf, send_sz, &
802 mpi_logical, root, col%comm, ierr)
804 'sll_collective_gather_real(): MPI_GATHER()')
818 recvcnts, displs, root, rec_buf)
820 sll_real32,
dimension(:),
intent(in) :: send_buf
821 sll_int32,
intent(in) :: send_count
822 sll_int32,
dimension(:),
intent(in) :: recvcnts
823 sll_int32,
dimension(:),
intent(in) :: displs
824 sll_real32,
dimension(:),
intent(out) :: rec_buf
825 sll_int32,
intent(in) :: root
830 if (col%rank .eq. root)
then
831 sll_assert(
SIZE(recvcnts) .eq. col%size)
832 sll_assert(
SIZE(displs) .eq. col%size)
833 sll_assert(
SIZE(rec_buf) .eq. sum(recvcnts))
847 'sll_s_collective_gatherv_real(): MPI_GATHERV()')
861 recvcnts, displs, root, rec_buf)
863 sll_real64,
dimension(:),
intent(in) :: send_buf
864 sll_int32,
intent(in) :: send_count
865 sll_int32,
dimension(:),
intent(in) :: recvcnts
866 sll_int32,
dimension(:),
intent(in) :: displs
867 sll_real64,
dimension(:),
intent(out) :: rec_buf
868 sll_int32,
intent(in) :: root
873 if (col%rank .eq. root)
then
874 sll_assert(
SIZE(recvcnts) .eq. col%size)
875 sll_assert(
SIZE(displs) .eq. col%size)
876 sll_assert(
SIZE(rec_buf) .eq. sum(recvcnts))
878 call mpi_gatherv(send_buf, send_count, mpi_real8, rec_buf, recvcnts, &
879 displs, mpi_real8, root, col%comm, ierr)
881 'sll_s_collective_gatherv_real64(): MPI_GATHERV()')
894 sll_int32,
dimension(:),
intent(in) :: send_buf
895 sll_int32,
intent(in) :: send_sz
896 sll_int32,
dimension(:),
intent(inout) :: recv_buf
897 sll_int32,
intent(in) :: recv_sz
901 call mpi_allgather(send_buf(:), send_sz, mpi_integer, &
902 recv_buf(:), recv_sz, mpi_integer, col%comm, ierr)
904 'sll_collective_allgather_int(): MPI_ALLGATHER()')
916 sll_real64,
dimension(:),
intent(in) :: send_buf
917 sll_int32,
intent(in) :: send_sz
918 sll_real64,
dimension(:),
intent(out) :: recv_buf
919 sll_int32,
intent(in) :: recv_sz
923 call mpi_allgather(send_buf(:), send_sz, mpi_real8, &
924 recv_buf(:), recv_sz, mpi_real8, &
927 'sll_collective_allgather_int(): MPI_ALLGATHER()')
941 rec_cnt, displs, rec_buf)
943 sll_real32,
dimension(:),
intent(in) :: send_buf
944 sll_int32,
intent(in) :: send_cnt
945 sll_int32,
dimension(:),
intent(in) :: rec_cnt
946 sll_int32,
dimension(:),
intent(in) :: displs
947 sll_real32,
dimension(:),
intent(out) :: rec_buf
950 sll_assert(col%size .eq.
SIZE(displs))
951 sll_assert(col%size .eq.
SIZE(rec_cnt))
952 call mpi_allgatherv(send_buf, send_cnt, mpi_real, rec_buf, rec_cnt, &
953 displs, mpi_real, col%comm, ierr)
955 'sll_collective_allgatherv_real32(): MPI_ALLGATHERV()')
967 sll_real64,
dimension(:),
intent(in) :: send_buf
968 sll_int32,
intent(in) :: send_cnt
969 sll_int32,
dimension(:),
intent(in) :: rec_cnt
970 sll_int32,
dimension(:),
intent(in) :: displs
971 sll_real64,
dimension(:),
intent(out) :: rec_buf
974 sll_assert(col%size .eq.
SIZE(displs))
975 sll_assert(col%size .eq.
SIZE(rec_cnt))
976 call mpi_allgatherv( &
979 mpi_double_precision, &
983 mpi_double_precision, &
987 'sll_s_collective_allgatherv_real64(): MPI_ALLGATHERV()')
1000 sll_real32,
dimension(:),
intent(in) :: send_buf
1001 sll_int32,
intent(in) :: send_count
1002 sll_int32,
intent(in) :: root
1003 sll_real32,
dimension(:),
intent(in) :: rec_buf
1009 if (col%rank .eq. root)
then
1010 sll_assert(
SIZE(send_buf) .eq. (send_count*(col%size)))
1012 call mpi_scatter(send_buf, send_count, mpi_real, rec_buf, send_count, &
1013 mpi_real, root, col%comm, ierr)
1015 'sll_collective_scatter_real(): MPI_SCATTER()')
1028 sll_real64,
dimension(:),
intent(in) :: send_buf
1029 sll_int32,
intent(in) :: send_count
1030 sll_int32,
intent(in) :: root
1031 sll_real64,
dimension(:),
intent(in) :: rec_buf
1037 if (col%rank .eq. root)
then
1038 sll_assert(
SIZE(send_buf) .eq. (send_count*(col%size)))
1040 call mpi_scatter(send_buf, send_count, mpi_double_precision, rec_buf, send_count, &
1041 mpi_double_precision, root, col%comm, ierr)
1043 'sll_collective_scatter_real64(): MPI_SCATTER()')
1056 sll_int32,
dimension(:),
intent(in) :: send_buf
1057 sll_int32,
intent(in) :: send_count
1058 sll_int32,
intent(in) :: root
1059 sll_int32,
dimension(:),
intent(in) :: rec_buf
1065 if (col%rank .eq. root)
then
1066 sll_assert(
SIZE(send_buf) .eq. (send_count*(col%size)))
1068 call mpi_scatter(send_buf, send_count, mpi_double_precision, rec_buf, send_count, &
1069 mpi_integer, root, col%comm, ierr)
1071 'sll_collective_scatter_real64(): MPI_SCATTER()')
1086 displs, recv_count, root, rec_buf)
1088 sll_real32,
dimension(:),
intent(in) :: send_buf
1089 sll_int32,
dimension(:),
intent(in) :: send_count
1090 sll_int32,
dimension(:),
intent(in) :: displs
1091 sll_int32,
intent(in) :: recv_count
1092 sll_real32,
dimension(:),
intent(out) :: rec_buf
1093 sll_int32,
intent(in) :: root
1096 sll_assert(
SIZE(send_count) .eq. col%size)
1097 sll_assert(
SIZE(displs) .eq. col%size)
1098 call mpi_scatterv(send_buf, send_count, displs, mpi_real, rec_buf, &
1099 recv_count, mpi_real, root, col%comm, ierr)
1101 'sll_s_collective_scatterv_real(): MPI_SCATTERV()')
1114 sll_real32,
dimension(:),
intent(in) :: send_buf
1115 sll_int32,
intent(in) :: count
1116 sll_int32,
intent(in) :: op
1117 sll_real32,
dimension(:),
intent(out) :: rec_buf
1121 call mpi_allreduce( &
1131 'sll_s_collective_allreduce_real32(): MPI_ALLREDUCE()')
1144 sll_real64,
dimension(:),
intent(in) :: send_buf
1145 sll_int32,
intent(in) :: count
1146 sll_int32,
intent(in) :: op
1147 sll_real64,
dimension(:),
intent(out) :: rec_buf
1151 call mpi_allreduce( &
1155 mpi_double_precision, &
1161 'sll_collective_allreduce_real64(): MPI_ALLREDUCE()')
1174 sll_real64,
dimension(:, :),
intent(in) :: send_buf
1175 sll_int32,
intent(in) :: count
1176 sll_int32,
intent(in) :: op
1177 sll_real64,
dimension(:, :),
intent(out) :: rec_buf
1181 call mpi_barrier(col%comm, ierr)
1182 call mpi_allreduce( &
1186 mpi_double_precision, &
1192 'sll_collective_allreduce_real64(): MPI_ALLREDUCE()')
1205 sll_comp64,
dimension(:),
intent(in) :: send_buf
1206 sll_int32,
intent(in) :: count
1207 sll_int32,
intent(in) :: op
1208 sll_comp64,
dimension(:),
intent(out) :: rec_buf
1212 call mpi_allreduce( &
1216 mpi_double_complex, &
1222 'sll_collective_allreduce_comp64(): MPI_ALLREDUCE()')
1228 sll_comp32,
dimension(:),
intent(in) :: send_buf
1229 sll_int32,
intent(in) :: count
1230 sll_int32,
intent(in) :: op
1231 sll_comp32,
dimension(:),
intent(out) :: rec_buf
1235 call mpi_allreduce( &
1245 'sll_collective_allreduce_comp32(): MPI_ALLREDUCE()')
1258 sll_int32,
dimension(:),
intent(in) :: send_buf
1259 sll_int32,
intent(in) :: count
1260 sll_int32,
intent(in) :: op
1261 sll_int32,
dimension(:),
intent(out) :: rec_buf
1265 call mpi_allreduce( &
1275 'sll_collective_allreduce_int32(): MPI_ALLREDUCE()')
1288 logical,
dimension(:),
intent(in) :: send_buf
1289 sll_int32,
intent(in) :: count
1290 sll_int32,
intent(in) :: op
1291 logical,
dimension(:),
intent(out) :: rec_buf
1295 call mpi_allreduce(send_buf, rec_buf, count, mpi_logical, op, &
1298 'sll_s_collective_allreduce_logical(): MPI_ALLREDUCE()')
1308 sll_real64,
dimension(:, :, :),
intent(inout) :: buffer
1309 sll_real64,
dimension(:, :, :),
allocatable :: temp
1310 sll_int32 :: count, ierr
1311 count =
size(buffer)
1312 allocate (temp(
size(buffer, dim=1),
size(buffer, dim=2),
size(buffer, dim=3)))
1313 call mpi_allreduce(buffer, temp, count, mpi_double_precision, mpi_sum, &
1315 sll_assert(ierr == mpi_success)
1330 sll_int32,
dimension(:),
intent(in) :: send_buf
1331 sll_int32,
intent(in) ::
size
1332 sll_int32,
intent(in) :: op
1333 sll_int32,
intent(in) :: root_rank
1334 sll_int32,
dimension(:),
intent(in) :: rec_buf
1338 call mpi_reduce(send_buf, rec_buf,
size, mpi_integer, op, root_rank, &
1341 'sll_collective_reduce_real(): MPI_REDUCE()')
1354 sll_real32,
dimension(:),
intent(in) :: send_buf
1355 sll_int32,
intent(in) ::
size
1356 sll_int32,
intent(in) :: op
1357 sll_int32,
intent(in) :: root_rank
1358 sll_real32,
dimension(:),
intent(in) :: rec_buf
1362 call mpi_reduce(send_buf, rec_buf,
size, mpi_real, op, root_rank, &
1365 'sll_collective_reduce_real(): MPI_REDUCE()')
1371 sll_real64,
dimension(:),
intent(in) :: send_buf
1372 sll_int32,
intent(in) ::
size
1373 sll_int32,
intent(in) :: op
1374 sll_int32,
intent(in) :: root_rank
1375 sll_real64,
dimension(:),
intent(out) :: rec_buf
1379 call mpi_reduce(send_buf, rec_buf,
size, mpi_double_precision, op, &
1380 root_rank, col%comm, ierr)
1382 'sll_s_collective_reduce_real64(): MPI_REDUCE()')
1388 sll_real64,
dimension(:, :),
intent(in) :: send_buf
1389 sll_int32,
intent(in) ::
size
1390 sll_int32,
intent(in) :: op
1391 sll_int32,
intent(in) :: root_rank
1392 sll_real64,
dimension(:, :),
intent(out) :: rec_buf
1396 call mpi_reduce(send_buf, rec_buf,
size, mpi_double_precision, op, &
1397 root_rank, col%comm, ierr)
1399 'sll_collective_reduce_real64_2d(): MPI_REDUCE()')
1412 sll_comp64,
dimension(:),
intent(in) :: send_buf
1413 sll_int32,
intent(in) ::
size
1414 sll_int32,
intent(in) :: op
1415 sll_int32,
intent(in) :: root_rank
1416 sll_comp64,
dimension(:),
intent(out) :: rec_buf
1420 call mpi_reduce(send_buf, rec_buf,
size, mpi_double_complex, op, &
1421 root_rank, col%comm, ierr)
1423 'sll_collective_reduce_comp64(): MPI_REDUCE()')
1429 sll_comp32,
dimension(:),
intent(in) :: send_buf
1430 sll_int32,
intent(in) ::
size
1431 sll_int32,
intent(in) :: op
1432 sll_int32,
intent(in) :: root_rank
1433 sll_comp32,
dimension(:),
intent(out) :: rec_buf
1437 call mpi_reduce(send_buf, rec_buf,
size, mpi_complex, op, &
1438 root_rank, col%comm, ierr)
1440 'sll_collective_reduce_comp32(): MPI_REDUCE()')
1453 LOGICAL,
DIMENSION(:),
intent(in) :: send_buf
1454 sll_int32,
intent(in) ::
size
1455 sll_int32,
intent(in) :: op
1456 sll_int32,
intent(in) :: root_rank
1457 LOGICAL,
DIMENSION(:),
intent(in) :: rec_buf
1461 call mpi_reduce(send_buf, rec_buf,
size, mpi_logical, op, root_rank, &
1464 'sll_collective_reduce_real(): MPI_REDUCE()')
1474 recv_count, recv_buf, col)
1475 sll_int32,
dimension(:),
intent(in) :: send_buf
1476 sll_int32,
intent(in) :: send_count
1477 sll_int32,
intent(in) :: recv_count
1478 sll_int32,
dimension(:),
intent(out) :: recv_buf
1483 call mpi_alltoall(send_buf, send_count, mpi_integer, &
1484 recv_buf, recv_count, mpi_integer, col%comm, ierr)
1486 'sll_s_collective_alltoall_int(): MPI_ALLTOALLV()')
1491 recv_count, recv_buf, col)
1492 sll_real64,
dimension(:),
intent(in) :: send_buf
1493 sll_int32,
intent(in) :: send_count
1494 sll_int32,
intent(in) :: recv_count
1495 sll_real64,
dimension(:),
intent(out) :: recv_buf
1500 call mpi_alltoall(send_buf, send_count, mpi_double_precision, &
1501 recv_buf, recv_count, mpi_double_precision, &
1504 'sll_collective_alltoall_double(): MPI_ALLTOALL()')
1508 recv_count, recv_buf, col)
1509 sll_comp64,
dimension(:),
intent(in) :: send_buf
1510 sll_int32,
intent(in) :: send_count
1511 sll_int32,
intent(in) :: recv_count
1512 sll_comp64,
dimension(:),
intent(out) :: recv_buf
1517 call mpi_alltoall(send_buf, send_count, mpi_double_complex, &
1518 recv_buf, recv_count, mpi_double_complex, &
1521 'sll_collective_alltoall_complex_double(): MPI_ALLTOALL()')
1548 recv_buf, recv_cnts, &
1550 sll_real32,
dimension(:),
intent(in) :: send_buf
1551 sll_int32,
dimension(:),
intent(in) :: send_cnts
1552 sll_int32,
dimension(:),
intent(in) :: send_displs
1553 sll_real32,
dimension(:),
intent(out) :: recv_buf
1554 sll_int32,
dimension(:),
intent(in) :: recv_cnts
1555 sll_int32,
dimension(:),
intent(in) :: recv_displs
1560 call mpi_alltoallv(send_buf, send_cnts, send_displs, mpi_real, &
1561 recv_buf, recv_cnts, recv_displs, mpi_real, &
1564 'sll_s_collective_alltoallv_real(): MPI_ALLTOALLV()')
1570 recv_buf, recv_cnts, &
1572 sll_real64,
dimension(:),
intent(in) :: send_buf
1573 sll_int32,
dimension(:),
intent(in) :: send_cnts
1574 sll_int32,
dimension(:),
intent(in) :: send_displs
1575 sll_real64,
dimension(:),
intent(out) :: recv_buf
1576 sll_int32,
dimension(:),
intent(in) :: recv_cnts
1577 sll_int32,
dimension(:),
intent(in) :: recv_displs
1582 call mpi_alltoallv(send_buf, send_cnts, send_displs, &
1583 mpi_double_precision, &
1584 recv_buf, recv_cnts, recv_displs, &
1585 mpi_double_precision, &
1588 'sll_s_collective_alltoallv_double(): MPI_ALLTOALLV()')
1594 recv_buf, recv_cnts, &
1596 sll_comp64,
dimension(:),
intent(in) :: send_buf
1597 sll_int32,
dimension(:),
intent(in) :: send_cnts
1598 sll_int32,
dimension(:),
intent(in) :: send_displs
1599 sll_comp64,
dimension(:),
intent(out) :: recv_buf
1600 sll_int32,
dimension(:),
intent(in) :: recv_cnts
1601 sll_int32,
dimension(:),
intent(in) :: recv_displs
1606 call mpi_alltoallv(send_buf, send_cnts, send_displs, &
1607 mpi_double_complex, &
1608 recv_buf, recv_cnts, recv_displs, &
1609 mpi_double_complex, &
1612 'sll_collective_alltoallV_complex_double(): MPI_ALLTOALLV()')
1637 recv_buf, recv_cnts, &
1639 sll_int32,
dimension(:),
intent(in) :: send_buf
1640 sll_int32,
dimension(:),
intent(in) :: send_cnts
1641 sll_int32,
dimension(:),
intent(in) :: send_displs
1642 sll_int32,
dimension(:),
intent(out) :: recv_buf
1643 sll_int32,
dimension(:),
intent(in) :: recv_cnts
1644 sll_int32,
dimension(:),
intent(in) :: recv_displs
1649 call mpi_alltoallv(send_buf(:), send_cnts(:), send_displs(:), mpi_integer, &
1650 recv_buf(:), recv_cnts(:), recv_displs(:), mpi_integer, &
1653 'sll_s_collective_alltoallv_int(): MPI_ALLTOALLV()')
1666 sll_int32,
dimension(:),
intent(in) :: send_buf
1667 sll_int32,
dimension(:),
intent(in) :: send_cnts
1669 sll_int32,
pointer,
dimension(:) :: recv_buf
1670 sll_int32,
allocatable,
dimension(:) :: send_displs
1671 sll_int32,
allocatable,
dimension(:) :: recv_cnts
1672 sll_int32,
allocatable,
dimension(:) :: recv_displs
1674 sll_int32 :: ierr, size_comm, i, sendcnts_size
1676 sendcnts_size =
size(send_cnts)
1682 sll_assert(sendcnts_size .eq. size_comm)
1685 sll_allocate(recv_cnts(size_comm), ierr)
1690 dum = sum(recv_cnts)
1691 sll_allocate(recv_buf(dum), ierr)
1694 sll_allocate(send_displs(size_comm), ierr)
1697 send_displs(i) = send_displs(i - 1) + send_cnts(i - 1)
1701 sll_allocate(recv_displs(size_comm), ierr)
1704 recv_displs(i) = recv_displs(i - 1) + recv_cnts(i - 1)
1707 call mpi_alltoallv(send_buf(:), send_cnts(:), send_displs(:), mpi_integer, &
1708 recv_buf(:), recv_cnts(:), recv_displs(:), mpi_integer, &
1711 'sll_s_collective_alltoallv_int(): MPI_ALLTOALLV()')
1712 sll_deallocate_array(recv_displs, ierr)
1713 sll_deallocate_array(send_displs, ierr)
1714 sll_deallocate_array(recv_cnts, ierr)
1729 sll_real64,
dimension(:),
intent(inout) :: summand
1730 sll_int32,
intent(in),
optional :: root_rank
1731 sll_real64,
dimension(:),
allocatable :: recvsum
1732 sll_int32:: summand_size
1735 summand_size =
size(summand)
1736 sll_allocate(recvsum(1:summand_size), ierr)
1738 if (
present(root_rank))
then
1748 sll_deallocate_array(recvsum, ierr)
1760 sll_comp64,
dimension(:),
intent(inout) :: summand
1761 sll_int32,
intent(in),
optional :: root_rank
1762 sll_comp64,
dimension(:),
allocatable :: recvsum
1763 sll_int32:: summand_size
1766 summand_size =
size(summand)
1767 sll_allocate(recvsum(1:summand_size), ierr)
1769 if (
present(root_rank))
then
1779 sll_deallocate_array(recvsum, ierr)
1789 sll_real64,
intent(inout) :: summand
1790 sll_int32,
optional,
intent(in) :: root_rank
1791 sll_real64,
dimension(1) :: summand_tmp
1794 summand_tmp(1) = summand
1795 if (
present(root_rank))
then
1801 summand = summand_tmp(1)
1813 sll_real32,
dimension(:),
intent(inout) :: summand
1814 sll_int32,
intent(in),
optional :: root_rank
1815 sll_real32,
dimension(:),
allocatable :: recvsum
1816 sll_int32:: summand_size
1819 summand_size =
size(summand)
1820 sll_allocate(recvsum(1:summand_size), ierr)
1822 if (
present(root_rank))
then
1832 sll_deallocate_array(recvsum, ierr)
1844 sll_comp32,
dimension(:),
intent(inout) :: summand
1845 sll_int32,
intent(in),
optional :: root_rank
1846 sll_comp32,
dimension(:),
allocatable :: recvsum
1847 sll_int32:: summand_size
1850 summand_size =
size(summand)
1851 sll_allocate(recvsum(1:summand_size), ierr)
1853 if (
present(root_rank))
then
1863 sll_deallocate_array(recvsum, ierr)
1875 sll_int32,
dimension(:),
intent(inout) :: summand
1876 sll_int32,
intent(in),
optional :: root_rank
1877 sll_int32,
dimension(:),
allocatable :: recvsum
1878 sll_int32:: summand_size
1881 summand_size =
size(summand)
1882 sll_allocate(recvsum(1:summand_size), ierr)
1884 if (
present(root_rank))
then
1894 sll_deallocate_array(recvsum, ierr)
1904 sll_comp64,
intent(inout) :: summand
1905 sll_int32,
optional,
intent(in) :: root_rank
1906 sll_comp64,
dimension(1) :: summand_tmp
1909 summand_tmp(1) = summand
1910 if (
present(root_rank))
then
1916 summand = summand_tmp(1)
1926 sll_int32,
intent(inout) :: summand
1927 sll_int32,
optional,
intent(in) :: root_rank
1928 sll_int32,
dimension(1) :: summand_tmp
1931 summand_tmp(1) = summand
1932 if (
present(root_rank))
then
1938 summand = summand_tmp(1)
1948 sll_comp32,
intent(inout) :: summand
1949 sll_int32,
optional,
intent(in) :: root_rank
1950 sll_comp32,
dimension(1) :: summand_tmp
1953 summand_tmp(1) = summand
1954 if (
present(root_rank))
then
1960 summand = summand_tmp(1)
1970 sll_real32,
intent(inout) :: summand
1971 sll_int32,
optional,
intent(in) :: root_rank
1972 sll_real32,
dimension(1) :: summand_tmp
1975 summand_tmp(1) = summand
1976 if (
present(root_rank))
then
1982 summand = summand_tmp(1)
1989 sll_int32,
intent(in) :: comm
1994 sll_assert(ierr == mpi_success)
2000 sll_assert(ierr == mpi_success)
2002 sll_assert(ierr == mpi_success)
Gathers into specified locations from all processes in a group.
Scatters a buffer in parts to all processes in a communicator.
Gathers data from all tasks and distribute the combined data to all tasks.
Gathers data from all tasks and deliver the combined data to all tasks.
Combines values from all processes and distributes the result back to all processes.
Sends data from all to all processes.
Sends data from all to all processes; each process may send a different amount of data and provide di...
Broadcasts a message from the process with rank "root" to all other processes of the communicator.
Gathers together values from a group of processes.
Performs a global sum and writes the result in the optional given node.
Reduces values on all processes to a single value.
Sends data from one process to all other processes in a communicator.
type(sll_t_collective_t) function, pointer, public sll_f_new_collective(parent, color, key)
Creates new (wrapper around) communicators based on colors and keys.
subroutine sll_collective_bcast_int64(col, buffer, root)
Broadcasts an array of type 'sll_int64' from the process with rank "root" to all other processes of t...
subroutine sll_collective_globalsum_real64(col, summand, root_rank)
Performs a global sum and writes the result in the given node.
subroutine, public sll_s_collective_bcast_3d_real64(col, buffer, root)
Broadcasts a 3d array of type 'sll_real64' from the process with rank "root" to all other processes o...
subroutine sll_collective_globalsum_array_real32(col, summand, root_rank)
Performs a global sum over an array and writes the result in the given node If no node in root_rank i...
subroutine, public sll_s_collective_allreduce_logical(col, send_buf, count, op, rec_buf)
Combines logical values from all processes and distributes the result back to all processes.
subroutine, public sll_s_collective_scatterv_real(col, send_buf, send_count, displs, recv_count, root, rec_buf)
Scatters a buffer in parts to all processes in a communicator.
subroutine sll_collective_bcast_comp64(col, buffer, size, root)
Broadcasts an array of type 'sll_comp64' from the process with rank "root" to all other processes of ...
subroutine sll_collective_allreduce_comp64(col, send_buf, count, op, rec_buf)
Combines complex values from all processes and distributes the result back to all processes.
subroutine, public sll_s_collective_alltoallv_int_simple(send_buf, send_cnts, recv_buf, col)
subroutine, public sll_s_collective_bcast_real64(col, buffer, size, root)
Broadcasts an array of type 'sll_real64' from the process with rank "root" to all other processes of ...
subroutine sll_check_collective_ptr(ptr)
Checks if the pointer ptr is associated to an object.
integer(kind=i32) function, public sll_f_get_collective_rank(col)
Determines the rank of the calling process in the communicator.
integer(kind=i32) function sll_get_collective_comm(col)
Gets the id (integer) of the communicator.
subroutine, public sll_s_collective_reduce_int(col, send_buf, size, op, root_rank, rec_buf)
Reduces integer values on all processes to a single value.
subroutine, public sll_s_collective_alltoallv_real(send_buf, send_cnts, send_displs, recv_buf, recv_cnts, recv_displs, col)
Sends real data from all to all processes; each process may send a different amount of data and provi...
subroutine sll_collective_allreduce_comp32(col, send_buf, count, op, rec_buf)
subroutine sll_collective_allreduce_real64_2darray(col, send_buf, count, op, rec_buf)
Combines real values from all processes and distributes the result back to all processes.
subroutine sll_collective_alltoall_double(send_buf, send_count, recv_count, recv_buf, col)
subroutine, public sll_s_collective_allreduce_real32(col, send_buf, count, op, rec_buf)
Combines real values from all processes and distributes the result back to all processes.
subroutine, public sll_s_halt_collective()
Ends the paralell environment.
subroutine sll_collective_reduce_comp32(col, send_buf, size, op, root_rank, rec_buf)
integer(kind=i32) function sll_get_collective_color(col)
Determines the color of the calling process in the communicator.
subroutine, public sll_s_collective_allreduce_sum_3d_real64(col, buffer)
Sums real values from all processes and distributes the result back to all processes.
subroutine sll_collective_bcast_real64(col, buffer, root)
Broadcasts an array of type 'sll_real64' from the process with rank "root" to all other processes of ...
subroutine sll_collective_scatter_int32(col, send_buf, send_count, root, rec_buf)
Sends data from one process to all other processes in a communicator.
subroutine sll_collective_allgatherv_real32(col, send_buf, send_cnt, rec_cnt, displs, rec_buf)
Gathers real data from all tasks and deliver the combined data to all tasks.
subroutine sll_collective_alltoallv_complex_double(send_buf, send_cnts, send_displs, recv_buf, recv_cnts, recv_displs, col)
type(sll_t_collective_t) function, pointer, public sll_f_create_collective(comm)
Function to derive a "collective" from a plain MPI communicator,.
subroutine, public sll_s_collective_reduce_real64(col, send_buf, size, op, root_rank, rec_buf)
subroutine sll_collective_scatter_real(col, send_buf, send_count, root, rec_buf)
Sends data from one process to all other processes in a communicator.
subroutine sll_collective_allgather_int(col, send_buf, send_sz, recv_buf, recv_sz)
Gathers integer data from all tasks and distribute the combined data to all tasks.
subroutine sll_collective_gather_logical(col, send_buf, root, rec_buf)
subroutine sll_collective_globalsum_comp64(col, summand, root_rank)
Performs a global sum and writes the result in the given node.
subroutine sll_collective_bcast_comp32(col, buffer, size, root)
Broadcasts an array of type 'sll_comp32' from the process with rank "root" to all other processes of ...
subroutine, public sll_s_collective_gatherv_real64(col, send_buf, send_count, recvcnts, displs, root, rec_buf)
Gathers real64 values into specified locations from all processes in a group.
subroutine, public sll_s_boot_collective(required)
Starts the paralell environment.
subroutine sll_collective_gather_real64(col, send_buf, send_sz, root, rec_buf)
subroutine, public sll_s_collective_barrier(col)
Blocks until all processes in the communicator have reached this routine.
subroutine, public sll_s_test_mpi_error(ierr, descriptor)
Checks the good execution of collective instruction.
subroutine sll_collective_allreduce_int32(col, send_buf, count, op, rec_buf)
Combines complex values from all processes and distributes the result back to all processes.
subroutine sll_delete_collective(col)
Marks the communicator object for deallocation.
subroutine, public sll_s_collective_reduce_logical(col, send_buf, size, op, root_rank, rec_buf)
Reduces logical values on all processes to a single value.
subroutine, public sll_s_collective_alltoall_int(send_buf, send_count, recv_count, recv_buf, col)
Sends integer data from all to all processes.
subroutine sll_collective_reduce_real64_2d(col, send_buf, size, op, root_rank, rec_buf)
subroutine, public sll_s_collective_allgatherv_real64(col, send_buf, send_cnt, rec_cnt, displs, rec_buf)
subroutine, public sll_s_collective_alltoallv_int(send_buf, send_cnts, send_displs, recv_buf, recv_cnts, recv_displs, col)
Sends integer data from all to all processes; each process may send a different amount of data and pr...
logical function, public sll_f_collectives_are_same(col1, col2)
subroutine sll_collective_bcast_real32(col, buffer, size, root)
Broadcasts an array of type 'sll_real32' from the process with rank "root" to all other processes of ...
type(sll_t_collective_t), pointer, public sll_v_world_collective
Control of subset assignment. Processes with the same color are in the same new communicator.
subroutine sll_collective_allgather_real64(col, send_buf, send_sz, recv_buf, recv_sz)
subroutine, public sll_s_collective_globalsum_array_real64(col, summand, root_rank)
Performs a global sum over an array and writes the result in the given node If no node in root_rank i...
subroutine sll_collective_globalsum_array_int32(col, summand, root_rank)
Performs a global sum over an array and writes the result in the given node If no node in root_rank i...
subroutine sll_collective_globalsum_array_comp32(col, summand, root_rank)
Performs a global sum over an array and writes the result in the given node If no node in root_rank i...
subroutine sll_collective_globalsum_real32(col, summand, root_rank)
Performs a global sum and writes the result in the given node.
type(sll_t_collective_t) function, pointer sll_get_collective_parent(col)
Gets collective parent.
subroutine sll_collective_scatter_real64(col, send_buf, send_count, root, rec_buf)
Sends data from one process to all other processes in a communicator.
subroutine, public sll_s_collective_alltoallv_double(send_buf, send_cnts, send_displs, recv_buf, recv_cnts, recv_displs, col)
subroutine sll_collective_allreduce_real64(col, send_buf, count, op, rec_buf)
Combines real values from all processes and distributes the result back to all processes.
subroutine sll_collective_reduce_comp64(col, send_buf, size, op, root_rank, rec_buf)
Reduces complex values on all processes to a single value.
subroutine sll_collective_globalsum_int32(col, summand, root_rank)
Performs a global sum and writes the result in the given node.
subroutine sll_collective_globalsum_comp32(col, summand, root_rank)
Performs a global sum and writes the result in the given node.
subroutine, public sll_s_collective_globalsum_array_comp64(col, summand, root_rank)
Performs a global sum over an array and writes the result in the given node If no node in root_rank i...
integer(kind=i32) function, public sll_f_get_collective_size(col)
Determines the size of the group associated with a communicator.
subroutine, public sll_s_allocate_collective()
subroutine, public sll_s_collective_reduce_real32(col, send_buf, size, op, root_rank, rec_buf)
Reduces real values on all processes to a single value.
subroutine sll_collective_bcast_int32(col, buffer, root)
Broadcasts an array of type 'sll_int32' from the process with rank "root" to all other processes of t...
subroutine sll_collective_alltoall_complex_double(send_buf, send_count, recv_count, recv_buf, col)
subroutine sll_collective_bcast_logical(col, buffer, root)
Broadcasts an array of type 'logical' from the process with rank "root" to all other processes of the...
subroutine, public sll_s_collective_gatherv_real(col, send_buf, send_count, recvcnts, displs, root, rec_buf)
Gathers real values into specified locations from all processes in a group.
subroutine, public sll_s_set_communicator_collective(communicator_in)
subroutine sll_collective_gather_real32(col, send_buf, send_sz, root, rec_buf)
Gathers together real values from a group of processes.
Wrapper around the communicator.