<div dir="ltr"><div><br></div><a class="gmail_plusreply" id="m_2948797837340609125m_-3262850175246017405m_2959600615827043074m_-6124977479374237173plusReplyChip-0" href="mailto:knepley@gmail.com" target="_blank">@Matthew Knepley</a> : Thanks for the explanation on preallocation.<br>
<div><br>>However, why not have a flag so that on the first pass you do not compute entries, just the indices?<br></div><div><br>The matrix computes the projection of an image onto a detector so generating this involves computing all possible ray-rectangle intersections and computing the values only differs from computing the indices by a call to calculate intersection lengths. The process to set up the geometry and check for intersections is the same to generate indices and values. <br><br></div><div>So, in this case the tradeoff would be to either compute everything twice and save on storage cost or compute everything once and use more memory (essentially compute the matrix rows on each rank, preallocate and then set the matrix values). <br><br></div><div><a class="gmail_plusreply" id="m_2948797837340609125m_-3262850175246017405m_2959600615827043074m_-6124977479374237173plusReplyChip-1" href="mailto:stefano.zampini@gmail.com" target="_blank">@Stefano Zampini</a> : Yes, I only need MatMult and MatMultTranspose in the TAO objective/gradient evaluation but in the current state
it's cheaper to use a matrix instead of computing the intersections for each objective/gradient evaluation. About ~70% of the application time is spent in MatMult and MatMultTranspose so we're hoping that this would benefit from running on GPU's. <br><br>Thanks for the pointer to MatShell, implementing a matrix free method is something we might pursue in the future.<br></div>
<div><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="font-size:12.8px">Sajid Ali | PhD Candidate<br></div><div style="font-size:12.8px">Applied Physics<br></div><div style="font-size:12.8px">Northwestern University</div><div style="font-size:12.8px"><a href="http://s-sajid-ali.github.io" target="_blank">s-sajid-ali.github.io</a></div></div></div></div></div></div></div></div></div>