Test file for persistent communication

scr-persistent-collective
Soren Rasmussen 6 years ago
parent 55f742009e
commit f956959b1b

@ -2,6 +2,7 @@ INSTALLDIR=../..
INCDIR=$(INSTALLDIR)/include/
MODDIR=$(INSTALLDIR)/modules/
include $(INCDIR)/Make.inc.psblas
P=4
#
# Libraries used
#
@ -11,14 +12,16 @@ LDLIBS=$(PSBLDLIBS)
FINCLUDES=$(FMFLAG)$(MODDIR) $(FMFLAG).
SFOBJS=getp.o psb_sf_sample.o
DFOBJS=getp.o psb_df_sample.o
CFOBJS=getp.o psb_cf_sample.o
ZFOBJS=getp.o psb_zf_sample.o
SFOBJS=getp.o psb_sf_sample.o
DFOBJS=getp.o psb_df_sample.o
CFOBJS=getp.o psb_cf_sample.o
ZFOBJS=getp.o psb_zf_sample.o
HALOOBJS=getp.o psb_halo_df_test.o
EXEDIR=./runs
all: runsd psb_sf_sample psb_df_sample psb_cf_sample psb_zf_sample
all: runsd psb_halo_df_test psb_sf_sample psb_df_sample psb_cf_sample \
psb_zf_sample
runsd:
(if test ! -d runs ; then mkdir runs; fi)
@ -26,27 +29,32 @@ runsd:
psb_sf_sample.o psb_df_sample.o psb_cf_sample.o psb_zf_sample.o: getp.o
psb_sf_sample: $(SFOBJS)
$(FLINK) $(LOPT) $(SFOBJS) -o psb_sf_sample $(PSBLAS_LIB) $(LDLIBS)
/bin/mv psb_sf_sample $(EXEDIR)
$(FLINK) $(LOPT) $(SFOBJS) -o psb_sf_sample $(PSBLAS_LIB) $(LDLIBS)
/bin/mv psb_sf_sample $(EXEDIR)
psb_df_sample: $(DFOBJS)
$(FLINK) $(LOPT) $(DFOBJS) -o psb_df_sample $(PSBLAS_LIB) $(LDLIBS)
/bin/mv psb_df_sample $(EXEDIR)
$(FLINK) $(LOPT) $(DFOBJS) -o psb_df_sample $(PSBLAS_LIB) $(LDLIBS)
/bin/mv psb_df_sample $(EXEDIR)
psb_cf_sample: $(CFOBJS)
$(FLINK) $(LOPT) $(CFOBJS) -o psb_cf_sample $(PSBLAS_LIB) $(LDLIBS)
/bin/mv psb_cf_sample $(EXEDIR)
/bin/mv psb_cf_sample $(EXEDIR)
psb_zf_sample: $(ZFOBJS)
$(FLINK) $(LOPT) $(ZFOBJS) -o psb_zf_sample $(PSBLAS_LIB) $(LDLIBS)
/bin/mv psb_zf_sample $(EXEDIR)
/bin/mv psb_zf_sample $(EXEDIR)
psb_halo_df_test: $(HALOOBJS)
$(FLINK) $(LOPT) $(HALOOBJS) -o psb_halo_df_test $(PSBLAS_LIB) $(LDLIBS)
.f90.o:
$(MPFC) $(FCOPT) $(FINCLUDES) $(FDEFINES) -c $<
clean:
clean:
/bin/rm -f $(DFOBJS) $(ZFOBJS) $(SFOBJS) $(CFOBJS)\
*$(.mod) $(EXEDIR)/psb_*f_sample
*$(.mod) $(EXEDIR)/psb_*f_sample
run: getp.o runsd psb_halo_df_test
$(FLINK) $(LOPT) $(HALOOBJS) -o psb_halo_df_test $(PSBLAS_LIB) $(LDLIBS)
mpirun -np $(P) ./psb_halo_df_test dfs.inp
lib:
(cd ../../; make library)
verycleanlib:
(cd ../../; make veryclean)

@ -179,7 +179,6 @@ program psb_df_sample
case('BLOCK')
if (iam == psb_root_) write(psb_out_unit,'("Partition type: block")')
call psb_matdist(aux_a, a, ictxt,desc_a,info,fmt=afmt,parts=part_block)
print *, "---ARTLESS: after psb_matdist1"
! call desc_a%cd_get_list
! call desc_a%cd_v_get_list
! print *, "desc_a%v_halo_index", desc_a%v_get_list()
@ -209,32 +208,40 @@ program psb_df_sample
call x_col%zero() ! change to mpi rank? Artless
!
nrow=desc_a%get_local_rows()
ncol=desc_a%get_local_cols()
nrow=desc_a%get_local_rows() ! number of rows
ncol=desc_a%get_local_cols() ! number of columns
iv = [ (i,i=1,ncol)]
! call psb_loc_to_glob(iv,desc_a,info) !
call desc_a%l2gv1(iv,info)
! call desc_a%locgv1(iv,info)
xa = iv ! error
xa(nrow+1:ncol) = 0.0
! ---- test where halo regions are set to -1, sending 10+iam
xa = iv
xa(nrow+1:ncol) = -1
call x_col%set_vect(xa)
call psb_halo(x_col,desc_a,info,mode=psb_swap_persistent_)
xa(nrow+1:ncol) = -1
call x_col%set_vect(xa)
call psb_halo(x_col,desc_a,info)
xa = x_col%get_vect() ! ha = x_col%get_vect()
call psb_halo(x_col,desc_a,info,mode=psb_swap_persistent_)
xa = x_col%get_vect()
do i=nrow+1,ncol
! print *, iam, ": ", xa(i), "::", iv(i)
! write(0,*) 'Mismatch ',i,xa(i),iv(i)
if (xa(i) /= iv(i)) then ! ha
write(0,*) 'Mismatch ',i,xa(i),iv(i) ! ha
write(0,*) iam, ': MISMATCH ',i,xa(i),iv(i)
end if
end do
!
call psb_geasb(x_col,desc_a,info)
call psb_geall(r_col,desc_a,info)
call r_col%zero()
call psb_geasb(r_col,desc_a,info)
t2 = psb_wtime() - t1
! call psb_halo
call psb_amx(ictxt, t2)
@ -246,7 +253,7 @@ program psb_df_sample
!
! call prec%init(ictxt,ptype,info)
! call perc%init(ictxt,ptype,info)
! building the preconditioner
t1 = psb_wtime()
@ -332,12 +339,14 @@ program psb_df_sample
998 format(i8,4(2x,g20.14))
993 format(i6,4(1x,e12.6))
! print *, "* calling free funcs"
! call psb_gefree(b_col, desc_a,info)
call psb_gefree(x_col, desc_a,info)
call psb_spfree(a, desc_a,info)
call prec%free(info)
call psb_cdfree(desc_a,info)
call psb_exit(ictxt)
print *, "* FIN for", iam
stop
9999 call psb_error(ictxt)

Loading…
Cancel
Save