Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce local_max_patches in domain #293

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/fclaw2d_convenience.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ fclaw2d_domain_new (p4est_wrap_t * wrap, sc_keyvalue_t * attributes)
int nb, nm, mirror_quadrant_num;
int block_nm_pre;
int local_num_patches;
int current_local_num_patches;
int tree_minlevel, local_minlevel;
int tree_maxlevel, local_maxlevel;
int levels[2], global_levels[2];
Expand Down Expand Up @@ -276,6 +277,18 @@ fclaw2d_domain_new (p4est_wrap_t * wrap, sc_keyvalue_t * attributes)
domain->local_minlevel = local_minlevel;
domain->local_maxlevel = local_maxlevel;

/* determine maximum number of local patches */
domain->local_max_patches = 0;
for (i = 0; i < wrap->p4est->mpisize; ++i)
{
current_local_num_patches = (int)
(wrap->p4est->global_first_quadrant[i + 1] -
wrap->p4est->global_first_quadrant[i]);

domain->local_max_patches = SC_MAX (domain->local_max_patches,
current_local_num_patches);
}

/* allocate ghost patches */
domain->ghost_patches =
FCLAW_ALLOC_ZERO (fclaw2d_patch_t, domain->num_ghost_patches);
Expand Down
1 change: 1 addition & 0 deletions src/forestclaw2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ struct fclaw2d_domain
one domain to a derived one. */

int local_num_patches; /**< sum of patches over all blocks on this proc */
int local_max_patches; /**< maximum over all procs of local_num_patches */
/** @{ */
/** Local to proc. If this proc doesn't
store any patches at all, we set
Expand Down
1 change: 1 addition & 0 deletions src/forestclaw3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ struct fclaw3d_domain
one domain to a derived one. */

int local_num_patches; /**< sum of patches over all blocks on this proc */
int local_max_patches; /**< maximum over all procs of local_num_patches */
/** @{ */
/** Local to proc. If this proc doesn't
store any patches at all, we set
Expand Down