Changeset 93b6f6c


Ignore:
Timestamp:
02/08/11 20:01:48 (2 years ago)
Author:
Oleg Batrashev <ogbash@…>
Branches:
master, external
Children:
c4aa2f1
Parents:
60e3a65
git-author:
Oleg Batrashev <ogbash@…> (02/08/11 20:01:48)
git-committer:
Oleg Batrashev <ogbash@…> (02/08/11 20:01:48)
Message:

Save and loads the aggregates, but non-parallel has twice as more iterations.

Location:
src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/datatypes/Aggregate_mod.F90

    r60e3a65 r93b6f6c  
    10081008 end subroutine cprintall 
    10091009 
    1010  !> Write out aggregates to the specified file. 
    1011  !! If coarse aggregates are specified then it used to map fine aggregates to  
    1012  !! coarse aggregates and write coarse aggregate numbers to file. 
    1013  subroutine Aggr_writeFile(aggr, filename, caggr) 
    1014    type(Aggrs), intent(in) :: aggr !< fine aggregates 
    1015    character(*) :: filename 
    1016    type(Aggrs), intent(in), optional :: caggr !< coarse aggregates 
    1017    integer :: i 
    1018  
    1019    open(78, file=filename) 
    1020    if (.NOT.present(caggr)) then 
    1021       write (78,*) aggr%nagr, size(aggr%num) 
    1022       do i=1,size(aggr%num) 
    1023          write (78,*) aggr%num(i) 
    1024       end do 
    1025    else 
    1026       write (78,*) caggr%nagr, size(aggr%num) 
    1027       do i=1,size(aggr%num) 
    1028          write (78,*) caggr%num(aggr%num(i)) 
    1029       end do 
    1030    end if 
    1031    close(78) 
    1032  end subroutine Aggr_writeFile 
    1033  
    1034  !> Write all aggregates to file for testing with non-paralel case. 
    1035  subroutine Aggrs_writeFile(M, fAggr, cAggr, filename) 
    1036    type(Mesh), intent(in) :: M 
    1037    type(AggrInfo), intent(in) :: fAggr, cAggr 
    1038    character(*), intent(in) :: filename 
    1039  
    1040    open(79, file=filename) 
    1041     
    1042    close(79) 
    1043     
    1044  end subroutine Aggrs_writeFile 
    10451010!------------------------------------------------------ 
    10461011end Module Aggregate_mod 
  • src/datatypes/Makefile.am

    r60e3a65 r93b6f6c  
    22libdoug_la_SOURCES += \ 
    33        datatypes/Aggregate_mod.F90 \ 
     4        datatypes/Aggregate_utils.f90 \ 
    45        datatypes/Graph.f90 \ 
    56        datatypes/Decomposition.f90 \ 
  • src/main/aggr.F90

    r60e3a65 r93b6f6c  
    7272  use solvers_mod 
    7373  use Aggregate_mod 
     74  use Aggregate_utils_mod 
    7475  use CoarseMtx_mod 
    7576  use CoarseAllgathers 
     
    167168      plotting=sctls%plotting 
    168169    endif 
    169     !call SpMtx_aggregate(A,aggr_radius1, & 
    170     !       minaggrsize=min_asize1,       & 
    171     !       maxaggrsize=max_asize1,       & 
    172     !       alpha=strong_conn1,           & 
    173     !       M=M,                          & 
    174     !       plotting=plotting)     
    175     !call SpMtx_unscale(A) 
    176     ! todo: to be rewritten with aggr%starts and aggr%nodes...: 
    177  
    178     !if (sctls%plotting>=2) then 
    179     !   call Aggr_writeFile(A%aggr%inner, 'aggr1.txt') 
    180     !end if 
    181  
     170 
     171    ! find fine aggregates 
    182172    if (numprocs > 1) then 
    183173      ! we need to create aggregates only on inner nodes, so use local matrix LA 
     
    195185      A%aggr => LA%aggr 
    196186      nullify(LA%aggr) 
     187 
    197188    else 
    198189      ! non-parallel case use the whole matrix 
    199190      call SpMtx_find_strong(A=A,alpha=strong_conn1) 
    200       call SpMtx_aggregate(A,aggr_radius1, & 
    201            minaggrsize=min_asize1,       & 
    202            maxaggrsize=max_asize1,       & 
    203            alpha=strong_conn1,           & 
    204            M=M,                          & 
    205            plotting=plotting) 
    206       call SpMtx_unscale(A)       
     191      ! call SpMtx_aggregate(A,aggr_radius1, & 
     192      !      minaggrsize=min_asize1,       & 
     193      !      maxaggrsize=max_asize1,       & 
     194      !      alpha=strong_conn1,           & 
     195      !      M=M,                          & 
     196      !      plotting=plotting) 
     197      ! call SpMtx_unscale(A) 
     198      call Aggrs_readFile_fine(A%aggr, "aggregates.txt") 
    207199    end if 
    208200    ! profile info 
     
    302294        max_asize2=(2*aggr_radius2+1)**2 
    303295      endif 
    304       call SpMtx_aggregate(AC,aggr_radius2, & 
    305            minaggrsize=min_asize2,          & 
    306            maxaggrsize=max_asize2,          & 
    307            alpha=strong_conn2,              & 
    308            Afine=A)     
    309       call SpMtx_unscale(AC) 
     296      ! call SpMtx_aggregate(AC,aggr_radius2, & 
     297      !      minaggrsize=min_asize2,          & 
     298      !      maxaggrsize=max_asize2,          & 
     299      !      alpha=strong_conn2,              & 
     300      !      Afine=A)     
     301      ! call SpMtx_unscale(AC) 
     302      call Aggrs_readFile_coarse(AC%aggr, "aggregates.txt") 
    310303 
    311304      ! profile info 
     
    331324    endif  
    332325  endif 
     326 
     327  if (numprocs>1) then 
     328    call Aggrs_writeFile(M, A%aggr, AC%aggr, cdat, "aggregates.txt") 
     329  end if 
    333330 
    334331  ! Testing UMFPACK: 
Note: See TracChangeset for help on using the changeset viewer.