Discussion:
[petsc-users] Memory usage with DMDACreate3d and DMDAGetCorners
TAY wee-beng
2015-11-10 07:33:34 UTC
Permalink
Hi,

I need a subroutine in Fortran to partition a subset of my grid in the 3
x,y,z directions for MPI. I thought of using DMDACreate3d and
DMDAGetCorners to get the starting and width of the partitioned grid.

Because I need to partition at every time step and the subset grid
changes dimension and index at every time step, so I will also need to
use DMDestroy after each time step

Will that use alot of memory? Will the grid actually be created? So I
wonder if this DMDACreate3d and DMDestroy calls will take a lot of time.
--
Thank you.

Yours sincerely,

TAY wee-beng
Matthew Knepley
2015-11-10 12:25:49 UTC
Permalink
Post by TAY wee-beng
Hi,
I need a subroutine in Fortran to partition a subset of my grid in the 3
x,y,z directions for MPI. I thought of using DMDACreate3d and
DMDAGetCorners to get the starting and width of the partitioned grid.
Because I need to partition at every time step and the subset grid changes
dimension and index at every time step, so I will also need to use
DMDestroy after each time step
Will that use alot of memory? Will the grid actually be created? So I
wonder if this DMDACreate3d and DMDestroy calls will take a lot of time.
DMDA just does 1D partitioning in each dimension, so its not that
sophisticated. Is that all you want?

Matt
Post by TAY wee-beng
--
Thank you.
Yours sincerely,
TAY wee-beng
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
TAY wee-beng
2015-11-10 12:34:55 UTC
Permalink
Post by TAY wee-beng
Hi,
I need a subroutine in Fortran to partition a subset of my grid in
the 3 x,y,z directions for MPI. I thought of using DMDACreate3d
and DMDAGetCorners to get the starting and width of the
partitioned grid.
Because I need to partition at every time step and the subset grid
changes dimension and index at every time step, so I will also
need to use DMDestroy after each time step
Will that use alot of memory? Will the grid actually be created?
So I wonder if this DMDACreate3d and DMDestroy calls will take a
lot of time.
DMDA just does 1D partitioning in each dimension, so its not that
sophisticated. Is that all you want?
Matt
Hi,

Ya, that's all I want. Btw, how does DMDACreate3d partition the grids in
x,y,z? What is the algorithm behind it?

Supposed I have 14 x 17 x 20 and 12 cores. How does DMDACreate3d
partition it?

Thanks.
Post by TAY wee-beng
--
Thank you.
Yours sincerely,
TAY wee-beng
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener
Matthew Knepley
2015-11-10 12:48:38 UTC
Permalink
Post by Matthew Knepley
Post by TAY wee-beng
Hi,
I need a subroutine in Fortran to partition a subset of my grid in the 3
x,y,z directions for MPI. I thought of using DMDACreate3d and
DMDAGetCorners to get the starting and width of the partitioned grid.
Because I need to partition at every time step and the subset grid
changes dimension and index at every time step, so I will also need to use
DMDestroy after each time step
Will that use alot of memory? Will the grid actually be created? So I
wonder if this DMDACreate3d and DMDestroy calls will take a lot of time.
DMDA just does 1D partitioning in each dimension, so its not that
sophisticated. Is that all you want?
Matt
Hi,
Ya, that's all I want. Btw, how does DMDACreate3d partition the grids in
x,y,z? What is the algorithm behind it?
Supposed I have 14 x 17 x 20 and 12 cores. How does DMDACreate3d partition
it?
https://bitbucket.org/petsc/petsc/src/b0bc92c60ab2e8c65b1792a9a4080bf92080e52f/src/dm/impls/da/da3.c?at=master&fileviewer=file-view-default#da3.c-231

Thanks,

Matt
Post by Matthew Knepley
Thanks.
Post by TAY wee-beng
--
Thank you.
Yours sincerely,
TAY wee-beng
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
Loading...