<div dir="ltr">Hi All,<div><br></div><div><br></div><div>I'm new to PETSc and would like to use it as my linear elasticity solver within a structural optimisation program. Originally I was using GP-GPUs and CUDA for my solver but I would like to shift to using PETSc to leverage it's breadth of trustworthy solvers. We have some SMP servers and a couple compute clusters (one with GPUs, one without). I've been digging through the docs and I'd like some feedback on my plan and perhaps some pointers if at all possible.</div>
<div><br></div><div>The plan is to keep the 6000 lines or so of current code and try as much as possible to use PETSc as a 'drop-in'. This would require giving one field (array) of densities and receiving a 3d field (array) of displacements back. Providing the density field would be easy with the usual array construction functions on one node/process but pulling the displacements back to the 'controlling' node would be difficult.<br>
<br>I understand that this goes against the ethos of PETSc which is distributed all the way. My code is highly modular with differing objective functions and optimisers (some of which are written by other research groups) that I drop in and pull out. I don't want to throw all that away. I would need to relearn object oriented programming within PETSc (currently I use c++) and rewrite my entire code base. In terms of performance the optimisers typically rely heavily on tight loops of reductions once the solve is completed so I'm not sure that the speed-up would be too great rewriting them as distributed anyway.</div>
<div><br>Sorry for the long winded post but I'm just not sure how to move forward, I'm sick of implementing every solver I want to try in CUDA especially knowing that people have done it better than I can in PETSc. But it's a framework that I don't know how to interface with, all the examples seem to have the solve as the main thing rather than one part of a broader program.</div>
<div><br></div><div><br></div><div>Andrew Cramer</div><div>University of Queensland, Australia</div><div>PhD Candidate<br></div></div>