[petsc-users] reusing matrix created with MatCreateMPIAIJWithSplitArrays
Dave May
dave.mayhem23 at gmail.com
Thu Jun 30 15:12:38 CDT 2016
On Thursday, 30 June 2016, Hassan Raiesi <Hassan.Raiesi at aero.bombardier.com>
wrote:
> Hello,
>
>
>
> We are using PETSC in our CFD code, and noticed that using
> “MatCreateMPIAIJWithSplitArrays” is almost 60% faster for large problem
> size (i.e DOF > 725M, using GAMG each time-step only takes 5sec, compared
> to 8.3 sec when assembling the matrix one row at a time using
> matsetvaluesblocked() as recommended).
>
>
>
> The problem is that the memory usage goes up after each call to
> MatCreateMPIAIJWithSplitArrays to update the matrix values.
>
Did you call MatDestroy() at each time step?
> As MatCreateMPIAIJWithSplitArrays is not supposed to copy the values, do
> we need to call it each time to update the values? We tried to just update
> the values of the diagonal and off-diagonal part of the arrays passed to
> “MatCreateMPIAIJWithSplitArrays”, (the sparsity structure is fixed) but it
> looks like that the values are not updated, what is the proper way to
> update the values of the matrix created by MatCreateMPIAIJWithSplitArrays?
>
The fool proof way would be to simply call MatCreateMPIAIJWithSplitArrays()
and MatDestroy() at each time step (or whenever values are changed). Since
no data is actually copied, the overhead of creating the mpiaij matrix will
be minimal
Thanks,
Dave
>
>
>
>
> Thank you
>
>
>
> *Hassan Raiesi, *
>
> Advanced Aerodynamics Department
>
> Bombardier Aerospace
>
>
>
> hassan.raiesi at aero.bombardier.com
> <javascript:_e(%7B%7D,'cvml','hassan.raiesi at aero.bombardier.com');>
>
>
>
> *2351 boul. Alfred-Nobel (BAN1)*
>
> *Ville Saint-Laurent, Québec, H4S 2A9*
>
>
>
>
>
>
>
> Tél.
>
> 514-855-5001 # 62204
>
>
>
>
>
>
>
>
>
>
>
> *CONFIDENTIALITY NOTICE* - This communication may contain privileged or
> confidential information.
> If you are not the intended recipient or received this communication by
> error, please notify the sender
> and delete the message without copying, forwarding and/or disclosing it.
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160630/c5491e0c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 6402 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160630/c5491e0c/attachment.png>
More information about the petsc-users
mailing list