537 const Teuchos::ArrayView<const lno_t>& adjs,
538 const Teuchos::ArrayView<const offset_t>& offsets,
539 const Teuchos::RCP<femv_t>& femv,
540 const Teuchos::ArrayView<const gno_t>& gids,
541 const Teuchos::ArrayView<const int>& rand,
542 const Teuchos::ArrayView<const int>& owners,
543 RCP<const map_t> mapOwnedPlusGhosts,
544 const std::unordered_map<
lno_t, std::vector<int>>& procs_to_send){
545 if(verbose) std::cout<<comm->getRank()<<
": inside coloring algorithm\n";
548 double total_time = 0.0;
549 double interior_time = 0.0;
550 double comm_time = 0.0;
551 double comp_time = 0.0;
552 double recoloring_time = 0.0;
553 double conflict_detection = 0.0;
555 const int numStatisticRecordingRounds = 100;
559 std::vector<int> deg_send_cnts(comm->getSize(),0);
560 std::vector<gno_t> deg_sdispls(comm->getSize()+1,0);
561 for(
int i = 0; i < owners.size(); i++){
562 deg_send_cnts[owners[i]]++;
565 gno_t deg_sendsize = 0;
566 std::vector<int> deg_sentcount(comm->getSize(),0);
567 for(
int i = 1; i < comm->getSize()+1; i++){
568 deg_sdispls[i] = deg_sdispls[i-1] + deg_send_cnts[i-1];
569 deg_sendsize += deg_send_cnts[i-1];
571 std::vector<gno_t> deg_sendbuf(deg_sendsize,0);
572 for(
int i = 0; i < owners.size(); i++){
573 size_t idx = deg_sdispls[owners[i]] + deg_sentcount[owners[i]];
574 deg_sentcount[owners[i]]++;
575 deg_sendbuf[idx] = mapOwnedPlusGhosts->getGlobalElement(i+nVtx);
577 Teuchos::ArrayView<int> deg_send_cnts_view = Teuchos::arrayViewFromVector(deg_send_cnts);
578 Teuchos::ArrayView<gno_t> deg_sendbuf_view = Teuchos::arrayViewFromVector(deg_sendbuf);
579 Teuchos::ArrayRCP<gno_t> deg_recvbuf;
580 std::vector<int> deg_recvcnts(comm->getSize(),0);
581 Teuchos::ArrayView<int> deg_recvcnts_view = Teuchos::arrayViewFromVector(deg_recvcnts);
582 AlltoAllv<gno_t>(*comm, *env, deg_sendbuf_view, deg_send_cnts_view, deg_recvbuf, deg_recvcnts_view);
585 for(
int i = 0; i < deg_recvbuf.size(); i++){
586 lno_t lid = mapOwnedPlusGhosts->getLocalElement(deg_recvbuf[i]);
587 deg_recvbuf[i] = offsets[lid+1] - offsets[lid];
590 ArrayRCP<gno_t> ghost_degrees;
591 AlltoAllv<gno_t>(*comm, *env, deg_recvbuf(), deg_recvcnts_view, ghost_degrees, deg_send_cnts_view);
593 Kokkos::View<gno_t*, device_type> ghost_degrees_dev(
"ghost degree view",ghost_degrees.size());
594 typename Kokkos::View<gno_t*, device_type>::HostMirror ghost_degrees_host = Kokkos::create_mirror(ghost_degrees_dev);
595 for(
int i = 0; i < ghost_degrees.size(); i++){
596 lno_t lid = mapOwnedPlusGhosts->getLocalElement(deg_sendbuf[i]);
597 ghost_degrees_host(lid-nVtx) = ghost_degrees[i];
599 Kokkos::deep_copy(ghost_degrees_dev, ghost_degrees_host);
603 for(
size_t i = 0; i < nVtx; i++){
604 offset_t curr_degree = offsets[i+1] - offsets[i];
605 if(curr_degree > local_max_degree){
606 local_max_degree = curr_degree;
609 Teuchos::reduceAll<int, offset_t>(*comm,Teuchos::REDUCE_MAX,1, &local_max_degree, &global_max_degree);
610 if(comm->getRank() == 0 && verbose) std::cout<<
"Input has max degree "<<global_max_degree<<
"\n";
611 if(verbose)std::cout<<comm->getRank()<<
": creating Kokkos Views\n";
613 Kokkos::View<offset_t*, device_type> dist_degrees(
"Owned+Ghost degree view",rand.size());
614 typename Kokkos::View<offset_t*, device_type>::HostMirror dist_degrees_host = Kokkos::create_mirror(dist_degrees);
616 for(
int i = 0; i < adjs.size(); i++){
617 if((
size_t)adjs[i] < nVtx)
continue;
618 dist_degrees_host(adjs[i])++;
621 for(
int i = 0; i < offsets.size()-1; i++){
622 dist_degrees_host(i) = offsets[i+1] - offsets[i];
625 Kokkos::View<offset_t*, device_type> dist_offsets(
"Owned+Ghost Offset view", rand.size()+1);
626 typename Kokkos::View<offset_t*, device_type>::HostMirror dist_offsets_host = Kokkos::create_mirror(dist_offsets);
629 dist_offsets_host(0) = 0;
630 uint64_t total_adjs = 0;
631 for(Teuchos_Ordinal i = 1; i < rand.size()+1; i++){
632 dist_offsets_host(i) = dist_degrees_host(i-1) + dist_offsets_host(i-1);
633 total_adjs+= dist_degrees_host(i-1);
636 Kokkos::View<lno_t*, device_type> dist_adjs(
"Owned+Ghost adjacency view", total_adjs);
637 typename Kokkos::View<lno_t*, device_type>::HostMirror dist_adjs_host = Kokkos::create_mirror(dist_adjs);
639 for(Teuchos_Ordinal i = 0; i < rand.size(); i++){
640 dist_degrees_host(i) = 0;
642 for(
int i = 0; i < adjs.size(); i++) dist_adjs_host(i) = adjs[i];
643 if(comm->getSize() > 1){
644 for(
size_t i = 0; i < nVtx; i++){
645 for(
offset_t j = offsets[i]; j < offsets[i+1]; j++){
647 if( (
size_t)adjs[j] >= nVtx){
649 dist_adjs_host(dist_offsets_host(adjs[j]) + dist_degrees_host(adjs[j])) = i;
650 dist_degrees_host(adjs[j])++;
656 if(verbose) std::cout<<comm->getRank()<<
": copying host mirrors to device views\n";
658 Kokkos::deep_copy(dist_degrees, dist_degrees_host);
659 Kokkos::deep_copy(dist_offsets, dist_offsets_host);
660 Kokkos::deep_copy(dist_adjs, dist_adjs_host);
661 if(verbose) std::cout<<comm->getRank()<<
": done copying to device\n";
664 Kokkos::View<gno_t*, device_type> recoloringSize(
"Recoloring Queue Size",1);
665 typename Kokkos::View<gno_t*, device_type>::HostMirror recoloringSize_host = Kokkos::create_mirror(recoloringSize);
666 recoloringSize_host(0) = 0;
667 Kokkos::deep_copy(recoloringSize, recoloringSize_host);
670 Kokkos::View<int*,device_type> rand_dev(
"randVec",rand.size());
671 typename Kokkos::View<int*, device_type>::HostMirror rand_host = Kokkos::create_mirror(rand_dev);
672 for(Teuchos_Ordinal i = 0; i < rand.size(); i++){
673 rand_host(i) = rand[i];
677 Kokkos::View<gno_t*, device_type> gid_dev(
"GIDs",gids.size());
678 typename Kokkos::View<gno_t*,device_type>::HostMirror gid_host = Kokkos::create_mirror(gid_dev);
679 for(Teuchos_Ordinal i = 0; i < gids.size(); i++){
680 gid_host(i) = gids[i];
684 Kokkos::deep_copy(rand_dev,rand_host);
685 Kokkos::deep_copy(gid_dev, gid_host);
687 if(verbose)std::cout<<comm->getRank()<<
": done creating recoloring datastructures\n";
690 for(
size_t i = 0; i < nVtx; i++){
691 for(
offset_t j = offsets[i]; j < offsets[i+1]; j++){
692 if((
size_t)adjs[j] >= nVtx) {
698 if(verbose)std::cout<<comm->getRank()<<
": creating send views\n";
701 Kokkos::View<lno_t*, device_type> verts_to_send_view(
"verts to send",boundary_size);
702 Kokkos::parallel_for(boundary_size, KOKKOS_LAMBDA(
const int& i){
703 verts_to_send_view(i) = -1;
707 Kokkos::View<size_t*, device_type> verts_to_send_size(
"verts to send size",1);
708 Kokkos::View<size_t*, device_type, Kokkos::MemoryTraits<Kokkos::Atomic> > verts_to_send_size_atomic = verts_to_send_size;
709 typename Kokkos::View<lno_t*, device_type>::HostMirror verts_to_send_host = create_mirror(verts_to_send_view);
710 typename Kokkos::View<size_t*,device_type>::HostMirror verts_to_send_size_host = create_mirror(verts_to_send_size);
712 verts_to_send_size_host(0) = 0;
713 deep_copy(verts_to_send_size, verts_to_send_size_host);
715 if(verbose)std::cout<<comm->getRank()<<
": Done creating send views, initializing...\n";
716 if(verbose)std::cout<<comm->getRank()<<
": boundary_size = "<<boundary_size<<
" verts_to_send_size_atomic(0) = "<<verts_to_send_size_atomic(0)<<
"\n";
718 Kokkos::parallel_for(
"Initialize verts_to_send",nVtx, KOKKOS_LAMBDA(
const int&i){
719 for(
offset_t j = dist_offsets(i); j < dist_offsets(i+1); j++){
720 if((
size_t)dist_adjs(j) >= nVtx){
721 verts_to_send_view(verts_to_send_size_atomic(0)++) = i;
730 Kokkos::View<int*, device_type> ghost_colors(
"ghost color backups", rand.size()-nVtx);
731 if(verbose)std::cout<<comm->getRank()<<
": Done initializing\n";
732 gno_t sentPerRound[numStatisticRecordingRounds];
733 gno_t recvPerRound[numStatisticRecordingRounds];
735 if(verbose) std::cout<<comm->getRank()<<
": Coloring interior\n";
738 if(timing) comm->barrier();
739 interior_time =
timer();
740 total_time =
timer();
742 bool use_vbbit = (global_max_degree < 6000);
743 this->colorInterior<execution_space,memory_space>
744 (nVtx, dist_adjs, dist_offsets, femv,dist_adjs,0,use_vbbit);
746 interior_time =
timer() - interior_time;
747 comp_time = interior_time;
749 if(verbose) std::cout<<comm->getRank()<<
": Going to recolor\n";
750 bool recolor_degrees = this->pl->template get<bool>(
"recolor_degrees",
true);
753 if(comm->getSize() > 1){
755 if(verbose)std::cout<<comm->getRank()<<
": going to communicate\n";
758 Kokkos::deep_copy(verts_to_send_host, verts_to_send_view);
759 Kokkos::deep_copy(verts_to_send_size_host, verts_to_send_size);
761 comm_time = doOwnedToGhosts(mapOwnedPlusGhosts,
764 verts_to_send_size_host,
769 sentPerRound[0] = sent;
770 recvPerRound[0] = recv;
771 if(verbose) std::cout<<comm->getRank()<<
": done communicating\n";
772 verts_to_send_size_host(0) = 0;
773 deep_copy(verts_to_send_size, verts_to_send_size_host);
776 Kokkos::View<int**, Kokkos::LayoutLeft, device_type> femvColors =
777 femv->template getLocalView<device_type>(Tpetra::Access::ReadWrite);
778 Kokkos::View<int*, device_type> femv_colors = subview(femvColors, Kokkos::ALL, 0);
779 Kokkos::parallel_for(rand.size()-nVtx,KOKKOS_LAMBDA(
const int& i){
780 ghost_colors(i) = femv_colors(i+nVtx);
784 double temp =
timer();
785 detectConflicts<execution_space, memory_space>(nVtx,
791 verts_to_send_size_atomic,
797 deep_copy(recoloringSize_host, recoloringSize);
798 conflict_detection +=
timer() - temp;
799 comp_time += conflict_detection;
802 if(verbose)std::cout<<comm->getRank()<<
": done initial recoloring, begin recoloring loop\n";
803 double totalPerRound[numStatisticRecordingRounds];
804 double commPerRound[numStatisticRecordingRounds];
805 double compPerRound[numStatisticRecordingRounds];
806 double recoloringPerRound[numStatisticRecordingRounds];
807 double conflictDetectionPerRound[numStatisticRecordingRounds];
808 double serialRecoloringPerRound[numStatisticRecordingRounds];
809 int vertsPerRound[numStatisticRecordingRounds];
811 if(comm->getSize() == 1) done =
true;
812 totalPerRound[0] = interior_time + comm_time + conflict_detection;
813 recoloringPerRound[0] = 0;
814 commPerRound[0] = comm_time;
815 compPerRound[0] = interior_time + conflict_detection;
816 conflictDetectionPerRound[0] = conflict_detection;
817 recoloringPerRound[0] = 0;
818 vertsPerRound[0] = 0;
819 int distributedRounds = 1;
820 int serial_threshold = this->pl->template get<int>(
"serial_threshold",0);
822 Kokkos::View<lno_t*, device_type> verts_to_recolor(
"verts_to_recolor", boundary_size);
823 typename Kokkos::View<int*, device_type>::HostMirror ghost_colors_host;
825 while(recoloringSize_host(0) > 0 || !done){
826 if(recoloringSize_host(0) < serial_threshold)
break;
828 auto femvColors = femv->getLocalViewDevice(Tpetra::Access::ReadWrite);
829 auto femv_colors = subview(femvColors, Kokkos::ALL, 0);
831 if(distributedRounds < numStatisticRecordingRounds) {
832 vertsPerRound[distributedRounds] = recoloringSize_host(0);
838 Kokkos::deep_copy(verts_to_recolor, verts_to_send_view);
840 double recolor_temp =
timer();
842 deep_copy(verts_to_send_size_host, verts_to_send_size);
843 if(verts_to_send_size_host(0) > 0){
846 dist_adjs,dist_offsets,
849 verts_to_send_size_host(0),
853 if(distributedRounds < numStatisticRecordingRounds){
854 recoloringPerRound[distributedRounds] =
timer() - recolor_temp;
855 recoloring_time += recoloringPerRound[distributedRounds];
856 comp_time += recoloringPerRound[distributedRounds];
857 compPerRound[distributedRounds] = recoloringPerRound[distributedRounds];
858 totalPerRound[distributedRounds] = recoloringPerRound[distributedRounds];
860 double recolor_round_time =
timer() - recolor_temp;
861 recoloring_time += recolor_round_time;
862 comp_time += recolor_round_time;
867 recoloringSize_host(0) = 0;
868 Kokkos::deep_copy(recoloringSize,recoloringSize_host);
870 Kokkos::parallel_for(rand.size()-nVtx, KOKKOS_LAMBDA(
const int& i){
871 femv_colors(i+nVtx) = ghost_colors(i);
875 Kokkos::deep_copy(verts_to_send_host, verts_to_send_view);
876 Kokkos::deep_copy(verts_to_send_size_host, verts_to_send_size);
879 femvColors =
decltype(femvColors)();
880 femv_colors =
decltype(femv_colors)();
882 double curr_comm_time = doOwnedToGhosts(mapOwnedPlusGhosts,
885 verts_to_send_size_host,
890 comm_time += curr_comm_time;
891 if(distributedRounds < numStatisticRecordingRounds){
892 commPerRound[distributedRounds] = curr_comm_time;
893 sentPerRound[distributedRounds] = sent;
894 recvPerRound[distributedRounds] = recv;
895 totalPerRound[distributedRounds] += commPerRound[distributedRounds];
901 femvColors = femv->getLocalViewDevice(Tpetra::Access::ReadWrite);
902 femv_colors = subview(femvColors, Kokkos::ALL, 0);
903 Kokkos::parallel_for(rand.size()-nVtx, KOKKOS_LAMBDA(
const int& i){
904 ghost_colors(i) = femv_colors(i+nVtx);
907 verts_to_send_size_host(0) = 0;
908 deep_copy(verts_to_send_size, verts_to_send_size_host);
909 double detection_temp =
timer();
910 detectConflicts<execution_space, memory_space>(nVtx,
916 verts_to_send_size_atomic,
923 Kokkos::deep_copy(recoloringSize_host, recoloringSize);
925 if(distributedRounds < numStatisticRecordingRounds){
926 conflictDetectionPerRound[distributedRounds] =
timer() - detection_temp;
927 conflict_detection += conflictDetectionPerRound[distributedRounds];
928 compPerRound[distributedRounds] += conflictDetectionPerRound[distributedRounds];
929 totalPerRound[distributedRounds] += conflictDetectionPerRound[distributedRounds];
930 comp_time += conflictDetectionPerRound[distributedRounds];
932 double conflict_detection_round_time =
timer()- detection_temp;
933 conflict_detection += conflict_detection_round_time;
934 comp_time += conflict_detection_round_time;
938 int localDone = recoloringSize_host(0);
939 Teuchos::reduceAll<int, int>(*comm,Teuchos::REDUCE_SUM,1, &localDone, &globalDone);
946 if(recoloringSize_host(0) > 0 || !done){
947 ghost_colors_host = Kokkos::create_mirror_view(ghost_colors);
948 deep_copy(ghost_colors_host, ghost_colors);
949 deep_copy(verts_to_send_host, verts_to_send_view);
950 deep_copy(verts_to_send_size_host, verts_to_send_size);
955 while(recoloringSize_host(0) > 0 || !done){
957 auto femvColors = femv->getLocalViewHost(Tpetra::Access::ReadWrite);
958 auto femv_colors = subview(femvColors, Kokkos::ALL, 0);
961 if(distributedRounds < 100){
962 vertsPerRound[distributedRounds] = recoloringSize_host(0);
965 double recolor_temp =
timer();
967 if(verts_to_send_size_host(0) > 0){
970 (femv_colors.size(), dist_adjs_host, dist_offsets_host, femv, verts_to_send_host, verts_to_send_size_host(0),
true);
973 if(distributedRounds < numStatisticRecordingRounds){
974 recoloringPerRound[distributedRounds] =
timer() - recolor_temp;
975 recoloring_time += recoloringPerRound[distributedRounds];
976 comp_time += recoloringPerRound[distributedRounds];
977 compPerRound[distributedRounds] = recoloringPerRound[distributedRounds];
978 totalPerRound[distributedRounds] = recoloringPerRound[distributedRounds];
980 double recolor_serial_round_time =
timer() - recolor_temp;
981 recoloring_time += recolor_serial_round_time;
982 comp_time += recolor_serial_round_time;
985 recoloringSize_host(0) = 0;
987 for(
size_t i = 0; i < rand.size() -nVtx; i++){
988 femv_colors(i+nVtx) = ghost_colors_host(i);
992 double curr_comm_time = doOwnedToGhosts(mapOwnedPlusGhosts,
995 verts_to_send_size_host,
1000 comm_time += curr_comm_time;
1002 if(distributedRounds < numStatisticRecordingRounds){
1003 commPerRound[distributedRounds] = curr_comm_time;
1004 sentPerRound[distributedRounds] = sent;
1005 recvPerRound[distributedRounds] = recv;
1006 totalPerRound[distributedRounds] += commPerRound[distributedRounds];
1008 for(
size_t i = 0; i < rand.size()-nVtx; i++){
1009 ghost_colors_host(i) = femv_colors(i+nVtx);
1012 verts_to_send_size_host(0) = 0;
1013 double detection_temp =
timer();
1014 detectConflicts<host_exec, host_mem>(nVtx,
1020 verts_to_send_size_host,
1021 recoloringSize_host,
1026 if(distributedRounds < numStatisticRecordingRounds){
1027 conflictDetectionPerRound[distributedRounds] =
timer() - detection_temp;
1028 conflict_detection += conflictDetectionPerRound[distributedRounds];
1029 compPerRound[distributedRounds] += conflictDetectionPerRound[distributedRounds];
1030 totalPerRound[distributedRounds] += conflictDetectionPerRound[distributedRounds];
1031 comp_time += conflictDetectionPerRound[distributedRounds];
1033 double conflict_detection_serial_round_time =
timer() - detection_temp;
1034 conflict_detection += conflict_detection_serial_round_time;
1035 comp_time += conflict_detection_serial_round_time;
1039 int localDone = recoloringSize_host(0);
1040 Teuchos::reduceAll<int, int>(*comm, Teuchos::REDUCE_SUM,1, &localDone, &globalDone);
1041 distributedRounds++;
1044 total_time =
timer() - total_time;
1048 std::cout<<comm->getRank()<<
": done recoloring loop, computing statistics\n";
1049 int localBoundaryVertices = 0;
1050 for(
size_t i = 0; i < nVtx; i++){
1051 for(
offset_t j = offsets[i]; j < offsets[i+1]; j++){
1052 if((
size_t)adjs[j] >= nVtx){
1053 localBoundaryVertices++;
1059 if(comm->getRank()==0) printf(
"did %d rounds of distributed coloring\n", distributedRounds);
1060 int totalBoundarySize = 0;
1061 int totalVertsPerRound[numStatisticRecordingRounds];
1062 double finalTotalPerRound[numStatisticRecordingRounds];
1063 double maxRecoloringPerRound[numStatisticRecordingRounds];
1064 double finalSerialRecoloringPerRound[numStatisticRecordingRounds];
1065 double minRecoloringPerRound[numStatisticRecordingRounds];
1066 double finalCommPerRound[numStatisticRecordingRounds];
1067 double finalCompPerRound[numStatisticRecordingRounds];
1068 double finalConflictDetectionPerRound[numStatisticRecordingRounds];
1069 gno_t finalRecvPerRound[numStatisticRecordingRounds];
1070 gno_t finalSentPerRound[numStatisticRecordingRounds];
1071 for(
int i = 0; i < numStatisticRecordingRounds; i++) {
1072 totalVertsPerRound[i] = 0;
1073 finalTotalPerRound[i] = 0.0;
1074 maxRecoloringPerRound[i] = 0.0;
1075 minRecoloringPerRound[i] = 0.0;
1076 finalCommPerRound[i] = 0.0;
1077 finalCompPerRound[i] = 0.0;
1078 finalConflictDetectionPerRound[i] = 0.0;
1079 finalSentPerRound[i] = 0;
1080 finalRecvPerRound[i] = 0;
1082 Teuchos::reduceAll<int,int>(*comm, Teuchos::REDUCE_SUM,1, &localBoundaryVertices,&totalBoundarySize);
1083 Teuchos::reduceAll<int,int>(*comm, Teuchos::REDUCE_SUM,numStatisticRecordingRounds,vertsPerRound,totalVertsPerRound);
1084 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,numStatisticRecordingRounds,totalPerRound,finalTotalPerRound);
1085 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,numStatisticRecordingRounds,recoloringPerRound,maxRecoloringPerRound);
1086 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MIN,numStatisticRecordingRounds,recoloringPerRound,minRecoloringPerRound);
1087 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,numStatisticRecordingRounds,serialRecoloringPerRound,finalSerialRecoloringPerRound);
1088 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,numStatisticRecordingRounds,commPerRound,finalCommPerRound);
1089 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,numStatisticRecordingRounds,compPerRound,finalCompPerRound);
1090 Teuchos::reduceAll<int,double>(*comm,
1091 Teuchos::REDUCE_MAX,numStatisticRecordingRounds,conflictDetectionPerRound,finalConflictDetectionPerRound);
1092 Teuchos::reduceAll<int,gno_t> (*comm, Teuchos::REDUCE_SUM,numStatisticRecordingRounds,recvPerRound, finalRecvPerRound);
1093 Teuchos::reduceAll<int,gno_t> (*comm, Teuchos::REDUCE_SUM,numStatisticRecordingRounds,sentPerRound, finalSentPerRound);
1095 printf(
"Rank %d: boundary size: %d\n",comm->getRank(),localBoundaryVertices);
1096 if(comm->getRank()==0) printf(
"Total boundary size: %d\n",totalBoundarySize);
1097 for(
int i = 0; i < std::min(distributedRounds,numStatisticRecordingRounds); i++){
1098 printf(
"Rank %d: recolor %d vertices in round %d\n",comm->getRank(),vertsPerRound[i],i);
1099 if(comm->getRank()==0) printf(
"recolored %d vertices in round %d\n",totalVertsPerRound[i],i);
1100 if(comm->getRank()==0) printf(
"total time in round %d: %f\n",i,finalTotalPerRound[i]);
1101 if(comm->getRank()==0) printf(
"recoloring time in round %d: %f\n",i,maxRecoloringPerRound[i]);
1102 if(comm->getRank()==0) printf(
"serial recoloring time in round %d: %f\n",i,finalSerialRecoloringPerRound[i]);
1103 if(comm->getRank()==0) printf(
"min recoloring time in round %d: %f\n",i,minRecoloringPerRound[i]);
1104 if(comm->getRank()==0) printf(
"conflict detection time in round %d: %f\n",i,finalConflictDetectionPerRound[i]);
1105 if(comm->getRank()==0) printf(
"comm time in round %d: %f\n",i,finalCommPerRound[i]);
1106 if(comm->getRank()==0) printf(
"total sent in round %d: %lld\n",i,finalSentPerRound[i]);
1107 if(comm->getRank()==0) printf(
"total recv in round %d: %lld\n",i,finalRecvPerRound[i]);
1108 if(comm->getRank()==0) printf(
"comp time in round %d: %f\n",i,finalCompPerRound[i]);
1111 double global_total_time = 0.0;
1112 double global_recoloring_time=0.0;
1113 double global_min_recoloring_time=0.0;
1114 double global_conflict_detection=0.0;
1115 double global_comm_time=0.0;
1116 double global_comp_time=0.0;
1117 double global_interior_time = 0.0;
1118 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,1,&total_time,&global_total_time);
1119 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,1,&recoloring_time,&global_recoloring_time);
1120 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MIN,1,&recoloring_time,&global_min_recoloring_time);
1121 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,1,&conflict_detection,&global_conflict_detection);
1122 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,1,&comm_time,&global_comm_time);
1123 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,1,&comp_time,&global_comp_time);
1124 Teuchos::reduceAll<int,double>(*comm, Teuchos::REDUCE_MAX,1,&interior_time,&global_interior_time);
1127 if(comm->getRank()==0){
1128 printf(
"Total Time: %f\n",global_total_time);
1129 printf(
"Interior Time: %f\n",global_interior_time);
1130 printf(
"Recoloring Time: %f\n",global_recoloring_time);
1131 printf(
"Min Recoloring Time: %f\n",global_min_recoloring_time);
1132 printf(
"Conflict Detection Time: %f\n",global_conflict_detection);
1133 printf(
"Comm Time: %f\n",global_comm_time);
1134 printf(
"Comp Time: %f\n",global_comp_time);
1137 if(verbose) std::cout<<comm->getRank()<<
": exiting coloring\n";