From ccf9f79bfae6238e78bc0fdbc24a3a57f81501f3 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 18 Jul 2006 08:32:10 +0000 Subject: [PATCH] Fixed interface to mat_dist to use new envinronment. --- test/Fileread/df_sample.f90 | 9 +- test/Fileread/partgraph.f90 | 202 +++++++++++++++++------------------- test/Fileread/zf_sample.f90 | 9 +- 3 files changed, 108 insertions(+), 112 deletions(-) diff --git a/test/Fileread/df_sample.f90 b/test/Fileread/df_sample.f90 index 5abc8d05..ec8f6c2b 100644 --- a/test/Fileread/df_sample.f90 +++ b/test/Fileread/df_sample.f90 @@ -75,8 +75,9 @@ program df_sample ! communications data structure type(psb_desc_type):: desc_a - integer :: ictxt, iam, np - logical :: amroot + integer :: ictxt, iam, np + logical :: amroot + integer, parameter :: root=0 ! solver paramters integer :: iter, itmax, ierr, itrace, ircode, ipart,& @@ -106,7 +107,7 @@ program df_sample call psb_exit(ictxt) stop endif - amroot = (iam==0) + amroot = (iam==root) name='df_sample' @@ -196,7 +197,7 @@ program df_sample call build_grppart(aux_a%m,aux_a%fida,aux_a%ia1,aux_a%ia2,np) endif call psb_barrier(ictxt) - call distr_grppart(0,0,ictxt) + call distr_grppart(root,ictxt) call getv_grppart(ivg) call matdist(aux_a, a, ivg, ictxt, & & desc_a,b_col_glob,b_col,info,fmt=afmt) diff --git a/test/Fileread/partgraph.f90 b/test/Fileread/partgraph.f90 index 4402281e..9603a34c 100644 --- a/test/Fileread/partgraph.f90 +++ b/test/Fileread/partgraph.f90 @@ -55,73 +55,72 @@ MODULE PARTGRAPH public part_graph, build_grppart, distr_grppart,& & getv_grppart, build_usrpart, free_part private - INTEGER, POINTER, SAVE :: GRAPH_VECT(:) + integer, pointer, save :: graph_vect(:) CONTAINS - SUBROUTINE PART_GRAPH(GLOBAL_INDX,N,NP,PV,NV) + subroutine part_graph(global_indx,n,np,pv,nv) - INTEGER, INTENT(IN) :: GLOBAL_INDX, N, NP - INTEGER, INTENT(OUT) :: NV - INTEGER, INTENT(OUT) :: PV(*) + integer, intent(in) :: global_indx, n, np + integer, intent(out) :: nv + integer, intent(out) :: pv(*) - IF (.NOT.ASSOCIATED(GRAPH_VECT)) THEN - WRITE(0,*) 'Fatal error in PART_GRAPH: vector GRAPH_VECT ',& + IF (.not.associated(graph_vect)) then + write(0,*) 'Fatal error in PART_GRAPH: vector GRAPH_VECT ',& & 'not initialized' - RETURN - ENDIF - IF ((GLOBAL_INDX<1).OR.(GLOBAL_INDX > SIZE(GRAPH_VECT))) THEN - WRITE(0,*) 'Fatal error in PART_GRAPH: index GLOBAL_INDX ',& + return + endif + if ((global_indx<1).or.(global_indx > size(graph_vect))) then + write(0,*) 'Fatal error in PART_GRAPH: index GLOBAL_INDX ',& & 'outside GRAPH_VECT bounds',global_indx,size(graph_vect) - RETURN - ENDIF - NV = 1 - PV(NV) = GRAPH_VECT(GLOBAL_INDX) - RETURN - END SUBROUTINE PART_GRAPH + return + endif + nv = 1 + pv(nv) = graph_vect(global_indx) + return + end subroutine part_graph - SUBROUTINE DISTR_GRPPART(RROOT, CROOT, ICTXT) - INTEGER :: RROOT, CROOT, ICTXT - INTEGER :: N, MER, MEC, NPR, NPC - - CALL BLACS_GRIDINFO(ICTXT,NPR,NPC,MER,MEC) - - IF (.NOT.((RROOT>=0).AND.(RROOT=0).AND.(CROOT=0).and.(root