Skip to content

Commit

Permalink
fix a bug for fastsample_tensor==2
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyangzhuan committed Dec 20, 2023
1 parent 55565b3 commit 893a587
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions SRC/Bplus_compress.f90
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ subroutine BF_MD_compress_N_oneblock_R_sample(Ndim, dim_MD, subtensors, blocks,
allocate(select_idx(dim_i)%dat(sampleidx(dim_i)))
select_idx(dim_i)%dat(1)=1
select_idx(dim_i)%dat(2)=mmnn(dim_i)
else
else
sampleidx1(dim_i) = min(ceiling_safe(option%sample_para*nn_scalar*overrate), mmnn(dim_i))
if (level == 0) sampleidx1(dim_i) = min(ceiling_safe(option%sample_para_outer*nn_scalar*overrate), mmnn(dim_i))
allocate(select_idx(dim_i)%dat(sampleidx1(dim_i)))
Expand Down Expand Up @@ -1314,12 +1314,12 @@ subroutine BF_MD_compress_N_oneblock_C_sample(Ndim, dim_MD, subtensors, blocks,
! select skeletons here, selection of at most (option%sample_para+option%knn)*nn columns, the first option%sample_para*nn are random, the next option%knn*nn are nearest points
allocate (select_idx(Ndim*2))
do dim_i=1,Ndim*2
if(option%fastsample_tensor==2 .and. dim_i<Ndim .and. dim_i/=dim)then

if(option%fastsample_tensor==2 .and. dim_i<=Ndim .and. dim_i/=dim)then
sampleidx(dim_i) =2
allocate(select_idx(dim_i)%dat(sampleidx(dim_i)))
select_idx(dim_i)%dat(1)=1
select_idx(dim_i)%dat(2)=mmnn(dim_i)
select_idx(dim_i)%dat(2)=mmnn(dim_i)
else
sampleidx1(dim_i) = min(ceiling_safe(option%sample_para*mm_scalar*overrate), mmnn(dim_i))
if (level == level_butterfly+1) sampleidx1(dim_i) = min(ceiling_safe(option%sample_para_outer*mm_scalar*overrate), mmnn(dim_i))
Expand Down
4 changes: 2 additions & 2 deletions example_scripts/runit_osx_ventura_tr4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export OMP_NUM_THREADS=4
# $MPIRUN --allow-run-as-root -n 4 ../build/EXAMPLE/frankben_t -quant --tst 3 --wavelen 0.0625 -option --nmin_leaf 8 --lrlevel 100 --verbosity 1 --tol_comp $tol --sample_para 1.0 --sample_para_outer 1.0 | tee a.out_tensor

$MPIRUN --allow-run-as-root -n 4 ../build/EXAMPLE/frankben_t -quant --tst 2 --wavelen 0.0156 -option --nmin_leaf 8 --xyzsort 1 --lrlevel 100 --verbosity 1 --tol_comp $tol --sample_para 0.8 --sample_para_outer 0.8 --fastsample_tensor 2 | tee a.out_tensor
$MPIRUN --allow-run-as-root -n 4 ../build/EXAMPLE/frankben_t -quant --tst 2 --wavelen 0.0156 -option --nmin_leaf 8 --xyzsort 1 --lrlevel 100 --verbosity 1 --tol_comp $tol --sample_para 1.0 --sample_para_outer 1.0 --fastsample_tensor 1 | tee a.out_tensor
# $MPIRUN --allow-run-as-root -n 4 ../build/EXAMPLE/frankben_t -quant --tst 2 --wavelen 0.0156 -option --nmin_leaf 8 --xyzsort 1 --lrlevel 100 --verbosity 1 --tol_comp $tol --sample_para 1.0 --sample_para_outer 1.0 --fastsample_tensor 1 | tee a.out_tensor
$MPIRUN --allow-run-as-root -n 4 ../build/EXAMPLE/frankben_t -quant --tst 2 --wavelen 0.0156 -option --nmin_leaf 8 --xyzsort 1 --lrlevel 100 --verbosity 1 --tol_comp $tol --sample_para 0.8 --sample_para_outer 0.8 | tee a.out_tensor

# $MPIRUN --allow-run-as-root -n 4 ../build/EXAMPLE/frankben -quant --tst 2 --wavelen 0.0156 -option --nmin_leaf 64 --xyzsort 1 --lrlevel 100 --verbosity 1 --tol_comp $tol --pat_comp 3 --sample_para 2.0 --sample_para_outer 2.0 | tee a.out_matrix
$MPIRUN --allow-run-as-root -n 4 ../build/EXAMPLE/frankben -quant --tst 2 --wavelen 0.0156 -option --nmin_leaf 64 --xyzsort 1 --lrlevel 100 --verbosity 1 --tol_comp $tol --pat_comp 3 --sample_para 2.0 --sample_para_outer 2.0 | tee a.out_matrix

0 comments on commit 893a587

Please sign in to comment.