73 Commits

Author SHA1 Message Date
81de98d9e2 Update the copyright year to 2023.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-02-01 18:36:37 -03:00
4f8c9219b2 MESH: Rewrite and simplify redistribute_blocks().
Attribute new process division and distribute data blocks in one loop.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-12-08 12:48:54 -03:00
2db9062683 MESH: Avoid very large MPI tags.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-15 19:21:20 -03:00
9829505650 Update copyright year to 2022.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-02 09:51:41 -03:00
a634d9bed5 VARIOUS: Make thread number thread private.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-01-08 11:52:16 -03:00
865a9e3013 MESH: Make variable initialization OpenMP conformant.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-01-08 11:06:19 -03:00
bb72ee3a5b MESH: Parallelize check_block_refinement() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-10 10:22:09 -03:00
535b5274c9 MESH: Remove unused variables.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-09 22:08:31 -03:00
ddb9c83608 MESH: Build data block list after each mesh update.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-07 20:51:22 -03:00
ea0b9b83dc WORKSPACE: Make workspace thread safe.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-07 10:46:18 -03:00
4a9a8d71a6 MESH: Remove cruft code with directive DEBUG.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-03 10:51:53 -03:00
b382734476 MESH: Remove unnecessary 'if' condition.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-03 10:32:48 -03:00
2b60ebaa3f MESH: Fix condition for deferinement of sibling blocks.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-25 18:01:35 -03:00
cfac02db87 MESH: Make procedure pointer setup_domain public.
If a user decides to write a subroutine to generate a problem specific
domain, it is enough to point this pointer in, e.g.,
initialize_user_problem() to the user's custom domain setup subroutine.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-25 10:37:47 -03:00
aea03e669e MESH: Return call status from redistribute_blocks().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-25 08:33:32 -03:00
2b04148e88 MESH: Remove unused variables.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-24 13:20:03 -03:00
20cfd3a868 MESH: Use print_message().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-19 13:03:25 -03:00
dd3da22460 MESH: Move mesh statistics to be handled in INTEGRALS.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-18 12:21:06 -03:00
f659000e8c PROFILE: Remove all custom profiling.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-16 15:22:15 -03:00
40f3e24631 MESH, PROBLEMS: Move procedure pointer to MESH.
This inverts the dependencies allowing for initiating module MESH
from PROBLEMS.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-16 14:02:25 -03:00
1ae3975cd7 MESH: Move REFINEMENT initialization/finalization to MESH.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-16 12:42:38 -03:00
920535030e DOMAINS, MESH: Merge module DOMAINS into MESH.
Module DOMAINS provided only one subroutine to generate the block
structure of the rectangular base domain. This change just moved this
subroutine to module MESH.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-16 11:13:42 -03:00
43e32a755f MESH: Use resize_workspace() in prolong_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-13 20:35:37 -03:00
a381fc0cce MESH: Remove workspace from this module.
Use everywhere the workspace provided by module WORKSPACE.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 22:35:05 -03:00
d5a5c612e0 MESH: Increase the workspace default size.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 12:56:16 -03:00
812bd1b2f9 MESH: Quit, if workspace cannot be increased in prolong_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 10:08:49 -03:00
e01285e903 MESH: Export nwork too.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 09:10:54 -03:00
f28803350b MESH: Use workspace in prolong_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 08:57:53 -03:00
024fd4b82f MESH: Add a common workspace to be used in various modules.
This workspace removes the necessity of allocating the local subroutine
arrays. It is allocated once in initialize_mesh() and can be used in any
place of the code. By default, the size of this workspace is controlled
by the block dimensions, the number of variables, and the simulation
dimension, but it can be controlled by a parameter 'workspace_size'.

Additionally, there is a logical flag 'work_in_use' exported from this
module to permit the verification if the workspace is currently in use.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 08:07:59 -03:00
d8e0f2954d MESH: Rewrite redistribute_blocks().
This rewrite removes large buffers used by the MPI exchange of data
block arrays between processes.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 17:31:50 -03:00
1f7906271a MESH: Rewrite prepare_sibling_derefinement().
This removes the use of extra buffer for MPI block exchange. The
exchange is now a zero-copy operation.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 17:08:12 -03:00
52ca353fe4 MESH: Allocate the prolongation array in prolong_block().
The prolongation is not expected to be done very frequently, comparing
to the number of leafs. Therefore, allocate the prolongation array only
when it is required.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 16:39:43 -03:00
c0c549453d MESH: Rewrite prolong_block() in order to reduce its memory usage.
Instead of using a temporary array for all variables, we now reuse the
same array for the prolongation of each variable.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 16:11:10 -03:00
9ecbf83d5f MESH: Make sure again the index nc is not out of the range.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-03 12:32:48 -03:00
01d0549bf5 MESH: Make sure the index nc is no out of the range.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-03 10:32:23 -03:00
d3c0737c8d BOUNDARIES, MESH: Allow to choose prolongation limiter.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-09-21 11:28:23 -03:00
c766bb9059 MESH: Redistribute data blocks after each refinement.
There are situations when one process can suddenly have many data
blocks refined resulting in a significant memory stress before
the new blocks are redistributed among all processes. Just
redistribute data blocks each time the block refinement is
performed to avoid such a situation.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-20 17:58:44 -03:00
3817822f6f HELPERS: Move flush_and_sync() to HELPERS.
Use it in mesh statistics.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-18 19:25:49 -03:00
92f5905b6b MESH: Store statistics when the distribution of blocks changes too.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-18 19:07:00 -03:00
047e9af130 MESH: Balance data blocks not only among processes but nodes too.
This change tries to maintain a similar number of data blocks per node,
while balancing them across all processes. This should improve the
memory utilization among nodes.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-15 21:10:17 -03:00
8d167e3895 MESH: Distribute whole block field %uu in redistribute_blocks().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-10 14:22:16 -03:00
3d45fcca34 BLOCKS: Use %uu instead of %u0, %u1, and %u2.
Block field %uu addopts its size according to the used integration
methods. Use it for all operation insteado of fields %u0, %u1, and %u2.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-10 14:05:00 -03:00
3d16d5c13d Update copyrights.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-02-04 17:35:04 -03:00
55e6d810d2 BOUNDARIES, MESH: Implement parabolic interpolation for prolongation.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-09-01 17:16:18 -03:00
c15378bddd MPITOOLS: Rewrite MPI support using Fortran 2008 interface.
Use procedure interfaces, remove unused variables, etc.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-08-14 19:40:10 -03:00
4b63c17b07 MESH: Remove unused variables.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-08-06 13:23:40 -03:00
7c55b65bd7 DRIVER, MESH, INTEGRALS: Use predefined preprocessor macros.
GNU Fortran and Intel Fortran define preprocessor macros such
__GFORTRAN__ and __INTEL_COMPILER. Just use them.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-07-30 11:06:59 -03:00
5f366ab2eb EQUATIONS: Add indicator of positive variables.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-03-03 10:45:06 -03:00
ad0303d3ba Update copyright.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-03-02 13:18:53 -03:00
055f67c874 MESH: Replace allocatable array with module one in prolong_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-03-07 11:12:49 -03:00