diff --git a/examples/fileread/mld_cexample_1lev.f90 b/examples/fileread/mld_cexample_1lev.f90 index 3452c1b3..179c20cd 100644 --- a/examples/fileread/mld_cexample_1lev.f90 +++ b/examples/fileread/mld_cexample_1lev.f90 @@ -267,26 +267,23 @@ program mld_cexample_ml write(*,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(0,*) 'allocation error: no data collection' - else - call psb_gather(x_glob,x,desc_A,info,root=psb_root_) - call psb_gather(r_glob,r,desc_A,info,root=psb_root_) - if (iam == psb_root_) then - write(0,'(" ")') - write(0,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processor(s).' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,*) 'max residual = ',resmx, resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_glob(i),r_glob(i),b_glob(i) - enddo - end if + call psb_gather(x_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(0,'(" ")') + write(0,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processor(s).' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,*) 'max residual = ',resmx, resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_glob(i),r_glob(i),b_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/examples/fileread/mld_cexample_ml.f90 b/examples/fileread/mld_cexample_ml.f90 index 4f5a9765..f52738a0 100644 --- a/examples/fileread/mld_cexample_ml.f90 +++ b/examples/fileread/mld_cexample_ml.f90 @@ -304,26 +304,23 @@ program mld_cexample_ml write(*,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(0,*) 'allocation error: no data collection' - else - call psb_gather(x_glob,x,desc_A,info,root=psb_root_) - call psb_gather(r_glob,r,desc_A,info,root=psb_root_) - if (iam == psb_root_) then - write(0,'(" ")') - write(0,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processors.' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,*) 'max residual = ',resmx, resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_glob(i),r_glob(i),b_glob(i) - enddo - end if + call psb_gather(x_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(0,'(" ")') + write(0,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processors.' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,*) 'max residual = ',resmx, resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_glob(i),r_glob(i),b_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/examples/fileread/mld_dexample_1lev.f90 b/examples/fileread/mld_dexample_1lev.f90 index bf19a1bf..da9519b9 100644 --- a/examples/fileread/mld_dexample_1lev.f90 +++ b/examples/fileread/mld_dexample_1lev.f90 @@ -266,26 +266,23 @@ program mld_dexample_ml write(*,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(0,*) 'allocation error: no data collection' - else - call psb_gather(x_glob,x,desc_A,info,root=psb_root_) - call psb_gather(r_glob,r,desc_A,info,root=psb_root_) - if (iam == psb_root_) then - write(0,'(" ")') - write(0,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processor(s).' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,*) 'max residual = ',resmx, resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_glob(i),r_glob(i),b_glob(i) - enddo - end if + call psb_gather(x_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(0,'(" ")') + write(0,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processor(s).' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,*) 'max residual = ',resmx, resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_glob(i),r_glob(i),b_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/examples/fileread/mld_dexample_ml.f90 b/examples/fileread/mld_dexample_ml.f90 index bfe25467..ac32aa10 100644 --- a/examples/fileread/mld_dexample_ml.f90 +++ b/examples/fileread/mld_dexample_ml.f90 @@ -303,26 +303,23 @@ program mld_dexample_ml write(*,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(0,*) 'allocation error: no data collection' - else - call psb_gather(x_glob,x,desc_A,info,root=psb_root_) - call psb_gather(r_glob,r,desc_A,info,root=psb_root_) - if (iam == psb_root_) then - write(0,'(" ")') - write(0,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processors.' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,*) 'max residual = ',resmx, resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_glob(i),r_glob(i),b_glob(i) - enddo - end if + call psb_gather(x_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(0,'(" ")') + write(0,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processors.' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,*) 'max residual = ',resmx, resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_glob(i),r_glob(i),b_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/examples/fileread/mld_sexample_1lev.f90 b/examples/fileread/mld_sexample_1lev.f90 index 045abce3..5745706e 100644 --- a/examples/fileread/mld_sexample_1lev.f90 +++ b/examples/fileread/mld_sexample_1lev.f90 @@ -267,26 +267,23 @@ program mld_sexample_ml write(*,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(0,*) 'allocation error: no data collection' - else - call psb_gather(x_glob,x,desc_A,info,root=psb_root_) - call psb_gather(r_glob,r,desc_A,info,root=psb_root_) - if (iam == psb_root_) then - write(0,'(" ")') - write(0,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processor(s).' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,*) 'max residual = ',resmx, resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_glob(i),r_glob(i),b_glob(i) - enddo - end if + call psb_gather(x_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(0,'(" ")') + write(0,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processor(s).' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,*) 'max residual = ',resmx, resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_glob(i),r_glob(i),b_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/examples/fileread/mld_sexample_ml.f90 b/examples/fileread/mld_sexample_ml.f90 index 4999bcfc..a0b2ce4a 100644 --- a/examples/fileread/mld_sexample_ml.f90 +++ b/examples/fileread/mld_sexample_ml.f90 @@ -304,26 +304,23 @@ program mld_sexample_ml write(*,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(0,*) 'allocation error: no data collection' - else - call psb_gather(x_glob,x,desc_A,info,root=psb_root_) - call psb_gather(r_glob,r,desc_A,info,root=psb_root_) - if (iam == psb_root_) then - write(0,'(" ")') - write(0,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processors.' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,*) 'max residual = ',resmx, resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_glob(i),r_glob(i),b_glob(i) - enddo - end if + call psb_gather(x_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(0,'(" ")') + write(0,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processors.' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,*) 'max residual = ',resmx, resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_glob(i),r_glob(i),b_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/examples/fileread/mld_zexample_1lev.f90 b/examples/fileread/mld_zexample_1lev.f90 index 3e4239f6..ae10997a 100644 --- a/examples/fileread/mld_zexample_1lev.f90 +++ b/examples/fileread/mld_zexample_1lev.f90 @@ -266,26 +266,23 @@ program mld_zexample_ml write(*,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(0,*) 'allocation error: no data collection' - else - call psb_gather(x_glob,x,desc_A,info,root=psb_root_) - call psb_gather(r_glob,r,desc_A,info,root=psb_root_) - if (iam == psb_root_) then - write(0,'(" ")') - write(0,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processor(s).' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,*) 'max residual = ',resmx, resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_glob(i),r_glob(i),b_glob(i) - enddo - end if + call psb_gather(x_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(0,'(" ")') + write(0,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processor(s).' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,*) 'max residual = ',resmx, resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_glob(i),r_glob(i),b_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/examples/fileread/mld_zexample_ml.f90 b/examples/fileread/mld_zexample_ml.f90 index 0081f037..b4ac3e26 100644 --- a/examples/fileread/mld_zexample_ml.f90 +++ b/examples/fileread/mld_zexample_ml.f90 @@ -303,26 +303,23 @@ program mld_zexample_ml write(*,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(0,*) 'allocation error: no data collection' - else - call psb_gather(x_glob,x,desc_A,info,root=psb_root_) - call psb_gather(r_glob,r,desc_A,info,root=psb_root_) - if (iam == psb_root_) then - write(0,'(" ")') - write(0,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processors.' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,*) 'max residual = ',resmx, resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_glob(i),r_glob(i),b_glob(i) - enddo - end if + call psb_gather(x_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(0,'(" ")') + write(0,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processors.' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,*) 'max residual = ',resmx, resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_glob(i),r_glob(i),b_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/tests/fileread/cf_sample.f90 b/tests/fileread/cf_sample.f90 index d4b84c20..d91ab863 100644 --- a/tests/fileread/cf_sample.f90 +++ b/tests/fileread/cf_sample.f90 @@ -338,27 +338,24 @@ program cf_sample write(psb_out_unit,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(psb_err_unit,*) 'allocation error: no data collection' - else - call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) - call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) - if (iam == psb_root_) then - write(psb_err_unit,'(" ")') - write(psb_err_unit,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processors.' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,'("Residual norm 2 : ",es12.5)')resmx - write(20,'("Residual norm inf : ",es12.5)')resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i) - enddo - end if + call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(psb_err_unit,'(" ")') + write(psb_err_unit,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processors.' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,'("Residual norm 2 : ",es12.5)')resmx + write(20,'("Residual norm inf : ",es12.5)')resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/tests/fileread/df_sample.f90 b/tests/fileread/df_sample.f90 index 590f4b6f..ef11b537 100644 --- a/tests/fileread/df_sample.f90 +++ b/tests/fileread/df_sample.f90 @@ -342,27 +342,24 @@ program df_sample write(psb_out_unit,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(psb_err_unit,*) 'allocation error: no data collection' - else - call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) - call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) - if (iam == psb_root_) then - write(psb_err_unit,'(" ")') - write(psb_err_unit,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processors.' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,'("Residual norm 2 : ",es12.5)')resmx - write(20,'("Residual norm inf : ",es12.5)')resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i) - enddo - end if + call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(psb_err_unit,'(" ")') + write(psb_err_unit,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processors.' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,'("Residual norm 2 : ",es12.5)')resmx + write(20,'("Residual norm inf : ",es12.5)')resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/tests/fileread/sf_sample.f90 b/tests/fileread/sf_sample.f90 index a170495a..324af79c 100644 --- a/tests/fileread/sf_sample.f90 +++ b/tests/fileread/sf_sample.f90 @@ -338,27 +338,24 @@ program sf_sample write(psb_out_unit,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(psb_err_unit,*) 'allocation error: no data collection' - else - call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) - call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) - if (iam == psb_root_) then - write(psb_err_unit,'(" ")') - write(psb_err_unit,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processors.' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,'("Residual norm 2 : ",es12.5)')resmx - write(20,'("Residual norm inf : ",es12.5)')resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i) - enddo - end if + call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(psb_err_unit,'(" ")') + write(psb_err_unit,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processors.' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,'("Residual norm 2 : ",es12.5)')resmx + write(20,'("Residual norm inf : ",es12.5)')resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6)) diff --git a/tests/fileread/zf_sample.f90 b/tests/fileread/zf_sample.f90 index 005da4b6..7f9e79f0 100644 --- a/tests/fileread/zf_sample.f90 +++ b/tests/fileread/zf_sample.f90 @@ -338,27 +338,24 @@ program zf_sample write(psb_out_unit,'("Total memory occupation for PREC : ",i12)')precsize end if - allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr) - if (ierr /= 0) then - write(psb_err_unit,*) 'allocation error: no data collection' - else - call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) - call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) - if (iam == psb_root_) then - write(psb_err_unit,'(" ")') - write(psb_err_unit,'("Saving x on file")') - write(20,*) 'matrix: ',mtrx_file - write(20,*) 'computed solution on ',np,' processors.' - write(20,*) 'iterations to convergence: ',iter - write(20,*) 'error estimate (infinity norm) on exit:', & - & ' ||r||/(||a||||x||+||b||) = ',err - write(20,'("Residual norm 2 : ",es12.5)')resmx - write(20,'("Residual norm inf : ",es12.5)')resmxp - write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' - do i=1,m_problem - write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i) - enddo - end if + call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) + if (info == psb_success_) & + & call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) + if (info /= psb_success_) goto 9999 + if (iam == psb_root_) then + write(psb_err_unit,'(" ")') + write(psb_err_unit,'("Saving x on file")') + write(20,*) 'matrix: ',mtrx_file + write(20,*) 'computed solution on ',np,' processors.' + write(20,*) 'iterations to convergence: ',iter + write(20,*) 'error estimate (infinity norm) on exit:', & + & ' ||r||/(||a||||x||+||b||) = ',err + write(20,'("Residual norm 2 : ",es12.5)')resmx + write(20,'("Residual norm inf : ",es12.5)')resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' + do i=1,m_problem + write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i) + enddo end if 998 format(i8,4(2x,g20.14)) 993 format(i6,4(1x,e12.6))