I have been learning petsc recently and made a simple solver for stokes equation on 3D staggered grid. My code is running on server with 200GB ram, but if I run a solver on 256^3 grid, memory used by the solver is over 200GB.
Checking with the -log_view flag, I've figured out most of the memories were used by the matrix created by
DMCreateMatrix(Mat &A)
I understand that the DM structure helps the MPI communications and therefore may need extra memories, but it seems too much in my opinion. Is there any way to reduce the memory usage by Matrix created from DM objects?