Sajid, Are the rows truly compute from first to last in order and all entries for a row are available together?
Barry > On Aug 14, 2020, at 1:00 PM, Sajid Ali <[email protected]> > wrote: > > > @Matthew Knepley <mailto:[email protected]> : Thanks for the explanation on > preallocation. > > >However, why not have a flag so that on the first pass you do not compute > >entries, just the indices? > > 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. > > 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). > > @Stefano Zampini <mailto:[email protected]> : 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. > > Thanks for the pointer to MatShell, implementing a matrix free method is > something we might pursue in the future. > > -- > Sajid Ali | PhD Candidate > Applied Physics > Northwestern University > s-sajid-ali.github.io <http://s-sajid-ali.github.io/>
