[petsc-users] Solving a Linear System with two different Solvers (one each thread)..?

Shri abhyshr at mcs.anl.gov
Mon Mar 19 16:32:54 CDT 2012


I'm not sure what you mean by 'coding by hand each algorithm for each thread'. 


Do you want an entire Vec/Mat on each thread? 
This is not how our model works currently and doing so will require considerable time and effort and may not be the worth it. 


The way the pthread model in PETSc works is that every pthread vector/matrix uses threads from a thread pool for its operations. You can control how many and which threads you want from the thread pool. 



Shri 

----- Original Message -----


Jed, thanks for your response. 


2012/3/19 Jed Brown < jedbrown at mcs.anl.gov > 

<blockquote>


On Mon, Mar 19, 2012 at 15:47, Pedro Torres < torres.pedrozpk at gmail.com > wrote: 

<blockquote>

I has some experience with PETSc + MPI, but neither with PETSc+Pthreads nor Pthreads alone. Taking in to account that pthread was recenltly added to petsc, is it possible to code a program that solve the same linear system with two different solvers, one on each thread?. I guess that can be done calling different ksp object, one on each thread, but I don't have clear, first if this is possible and second how to do that. Sorry if my question is meaningless, I just started to study pthreads. 



I will really appreciated any advice. Thanks in advance. 



No, the threading model does not work like this (and the performance of a system that did work that way would be a delicate beast). 
</blockquote>

Ok, so the only way to implement that is coding by hand each algorithm for each thread, rigth?. 


Anyway, at least can I use petsc object like Vec/Mat on each thread?. 


Thanks for your help! 



-- 
Pedro Torres 

</blockquote>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120319/9d703c90/attachment-0001.htm>


More information about the petsc-users mailing list