Dear friends:
I do not know why tag.iters() and tag.error() both give "0". that means it performed 0 iteration. But the results is changing.
I am solve the diffusion problem with 250,000 3D unstructured mesh with GTX 650 card. the speedup is only 2 compared with one cpu core. I think the speed is too slow. Need i to improve the card to obtain futher improvement.
Could you please provide me some suggestions.
Regards
//*************************************////*************************************//voidTemperature::SolveGPU(){Mesh*RefMesh=VarBox->aMesh;intnRow=RefMesh->CellsNumber;std::vector<std::map<unsignedint,double>>cpumatrix(nRow);std::vector<double>temp(nRow);for(inti=0;i<nRow;i++){introw1=RefMesh->CsrRow[i];introw2=RefMesh->CsrRow[i+1];for(intjj=row1;jj<row2;jj++)cpumatrix[i][RefMesh->CsrColumn[jj]]=A[jj];}viennacl::compressed_matrix<double>vclmatrix(nRow,nRow);viennacl::vector<double>x(nRow);viennacl::vector<double>b(nRow);fast_copy(Source.begin(),Source.end(),b.begin());fast_copy(VarBox->T->Field.begin(),VarBox->T->Field.end(),x.begin());copy(cpumatrix,vclmatrix);viennacl::linalg::ilu0_precond<viennacl::compressed_matrix<double>>vcl_ilu0(vclmatrix,viennacl::linalg::ilu0_tag());viennacl::linalg::jacobi_precond<viennacl::compressed_matrix<double>>vcl_jacobi(vclmatrix,viennacl::linalg::jacobi_tag());viennacl::linalg::chow_patel_ilu_precond<viennacl::compressed_matrix<double>>ilu(vclmatrix,viennacl::linalg::chow_patel_tag());viennacl::linalg::bicgstab_tagtag(1e-10,50);viennacl::linalg::bicgstab_solver<viennacl::vector<double>>Solver(tag);Solver.set_initial_guess(x);x=Solver(vclmatrix,b);std::cout<<std::endl<<"No. of iters: "<<tag.iters()<<std::endl;std::cout<<std::endl<<"Est. error: "<<tag.error()<<std::endl;fast_copy(x.begin(),x.end(),VarBox->T->Field.begin());}
Last edit: p ding 2017-08-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear friends:
I do not know why tag.iters() and tag.error() both give "0". that means it performed 0 iteration. But the results is changing.
I am solve the diffusion problem with 250,000 3D unstructured mesh with GTX 650 card. the speedup is only 2 compared with one cpu core. I think the speed is too slow. Need i to improve the card to obtain futher improvement.
Could you please provide me some suggestions.
Regards
Last edit: p ding 2017-08-11
Hi Ding,
pass the solver to viennacl::linalg::solve(), i.e.
See here for an example:
https://github.com/viennacl/viennacl-dev/blob/master/examples/tutorial/iterative.cpp#L198
I'm surprised that your code line
x = Solver(vclmatrix,b)
even compiled...Best regards,
Karli
Dear Karli:
It compiled and worked . I follow the "CG" section in onlin tutorial .