-
Notifications
You must be signed in to change notification settings - Fork 6
Parallelization #60
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
Open
dylan-copeland
wants to merge
19
commits into
main
Choose a base branch
from
parallel
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Parallelization #60
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6fd79a0
Generalized the system matrix as a HypreParMatrix, which can be solve…
dylan-copeland 65152e4
Merge branch 'main' of github.com:LLNL/scaleupROM into parallel
dylan-copeland f1ea8f5
Parallelized ROM and FOM global systems with HypreParMatrix.
dylan-copeland 8f18020
Parallelized Poisson solve.
dylan-copeland a0c2a73
Refactoring.
dylan-copeland 339833c
New parallel Poisson example.
dylan-copeland cc58d14
Minor fixes.
dylan-copeland dbaec76
Adding mesh files.
dylan-copeland ae26fbb
Fixed memory bug. Removed redundant mesh files.
dylan-copeland 72380dd
Fixed more memory bugs.
dylan-copeland af3fcc5
Merge branch 'main' of github.com:LLNL/scaleupROM into parallel
dylan-copeland 57d7633
Docker
dylan-copeland 7cd5c9d
Bug fix.
dylan-copeland a53cf3c
Restoring SubMeshTopologyHandler.
dylan-copeland 33f6875
Fixed test_topol.
dylan-copeland 9d328bf
Fixed test_workflow.
dylan-copeland b312640
Input file option for hypre matrix assembly.
dylan-copeland e459ee8
Update Stokes example.
dylan-copeland c9c162c
Missing change.
dylan-copeland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Copyright 2024 Lawrence Livermore National Security, LLC. See the top-level LICENSE file for details. | ||
| # | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| file(COPY poisson.sampling.yml DESTINATION ${CMAKE_BINARY_DIR}/examples/poisson_parallel) | ||
| file(COPY array.8.yml DESTINATION ${CMAKE_BINARY_DIR}/examples/poisson_parallel) | ||
|
|
||
| file(COPY generate_configs.py DESTINATION ${CMAKE_BINARY_DIR}/examples/poisson_parallel) | ||
| file(COPY setup_poisson.sh DESTINATION ${CMAKE_BINARY_DIR}/examples/poisson_parallel) | ||
|
|
||
| file(COPY ../stokes/meshes/square.o3.mesh DESTINATION ${CMAKE_BINARY_DIR}/examples/poisson_parallel/meshes) | ||
| file(COPY ../stokes/meshes/square-circle.msh.mfem DESTINATION ${CMAKE_BINARY_DIR}/examples/poisson_parallel/meshes) | ||
| file(COPY ../stokes/meshes/square-triangle.msh.mfem DESTINATION ${CMAKE_BINARY_DIR}/examples/poisson_parallel/meshes) | ||
| file(COPY ../stokes/meshes/square-star.msh.mfem DESTINATION ${CMAKE_BINARY_DIR}/examples/poisson_parallel/meshes) | ||
| file(COPY ../stokes/meshes/square-square.msh.mfem DESTINATION ${CMAKE_BINARY_DIR}/examples/poisson_parallel/meshes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| main: | ||
| #mode: run_example/sample_generation/build_rom/single_run | ||
| mode: single_run | ||
| use_rom: true | ||
| solver: poisson | ||
|
|
||
| mesh: | ||
| type: component-wise | ||
| uniform_refinement: 0 | ||
| component-wise: | ||
| # you can try other config files you generated by specifying it here. | ||
| global_config: "configs/test.box-channel.8x8.h5" | ||
| components: | ||
| - name: "empty" | ||
| file: "meshes/square.o3.mesh" | ||
| - name: "square-circle" | ||
| file: "meshes/square-circle.msh.mfem" | ||
| - name: "square-square" | ||
| file: "meshes/square-square.msh.mfem" | ||
| - name: "square-triangle" | ||
| file: "meshes/square-triangle.msh.mfem" | ||
| - name: "square-star" | ||
| file: "meshes/square-star.msh.mfem" | ||
|
|
||
| domain-decomposition: | ||
| type: interior_penalty | ||
|
|
||
| discretization: | ||
| order: 2 | ||
| full-discrete-galerkin: false | ||
|
|
||
| solver: | ||
| direct_solve: true | ||
| use_amg: true | ||
| max_iter: 1000000 | ||
| print_level: 0 | ||
| absolute_tolerance: 1.0e-10 | ||
| relative_tolerance: 1.0e-10 | ||
|
|
||
| visualization: | ||
| enabled: true | ||
| visualize_error: true | ||
| unified_paraview: false | ||
| file_path: | ||
| prefix: paraview/8x8/poisson_array_output | ||
|
|
||
| parameterized_problem: | ||
| name: poisson_component | ||
|
|
||
| single_run: | ||
| choose_from_random_sample: false | ||
| poisson_component: | ||
| k0: 0.6 | ||
| k1: -0.6 | ||
| bdr_k0: 0.05 | ||
| bdr_k1: 0.04 | ||
| offset: 0.1 | ||
| bdr_offset: 0. | ||
|
|
||
| basis: | ||
| prefix: "basis/poisson_basis" | ||
| number_of_basis: 10 | ||
| tags: | ||
| - name: "empty" | ||
| - name: "square-circle" | ||
| - name: "square-square" | ||
| - name: "square-triangle" | ||
| - name: "square-star" | ||
| svd: | ||
| save_spectrum: true | ||
| update_right_sv: false | ||
| visualization: | ||
| enabled: false | ||
| prefix: poisson_comp | ||
|
|
||
| model_reduction: | ||
| rom_handler_type: mfem | ||
| linear_solver_type: direct | ||
| linear_system_type: spd | ||
| hypre_matrix: yes | ||
| # This is the input for saving ROM matrix/rhs system. | ||
| save_linear_system: | ||
| enabled: true | ||
| prefix: rom-system/poisson.8x8 | ||
| preconditioner: gs | ||
| # individual/universal | ||
| subdomain_training: universal | ||
| save_operator: | ||
| level: component | ||
| prefix: "poisson_comp" | ||
| compare_solution: | ||
| enabled: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import sys | ||
| # Add path to root utils/python/ directory to find config scripts | ||
| sys.path.insert(0, "../../../utils/python/") | ||
|
|
||
| from config import Empty, ObjectInSpace | ||
| from box_channel_config import BoxChannelConfig | ||
|
|
||
| if __name__ == "__main__": | ||
| comp_list = {'empty': Empty(), | ||
| 'circle': ObjectInSpace('square-circle'), | ||
| 'square': ObjectInSpace('square-square'), | ||
| 'triangle': ObjectInSpace('square-triangle'), | ||
| 'star': ObjectInSpace('square-star'),} | ||
|
|
||
| example = BoxChannelConfig(2,2) | ||
| for name, comp in comp_list.items(): | ||
| example.addComponent(comp) | ||
|
|
||
| example.GenerateAllConfigs(0) | ||
|
|
||
| test = BoxChannelConfig(8,8) | ||
| for name, comp in comp_list.items(): | ||
| test.addComponent(comp) | ||
| test.CreateRandomConfig('test.box-channel.8x8.h5') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| main: | ||
| mode: sample_generation | ||
| use_rom: false | ||
| solver: poisson | ||
|
|
||
| mesh: | ||
| uniform_refinement: 0 | ||
| type: component-wise | ||
| component-wise: | ||
| global_config: "configs/box-channel.comp.h5" | ||
| components: | ||
| - name: "empty" | ||
| file: "meshes/square.o3.mesh" | ||
| - name: "square-circle" | ||
| file: "meshes/square-circle.msh.mfem" | ||
| - name: "square-square" | ||
| file: "meshes/square-square.msh.mfem" | ||
| - name: "square-triangle" | ||
| file: "meshes/square-triangle.msh.mfem" | ||
| - name: "square-star" | ||
| file: "meshes/square-star.msh.mfem" | ||
|
|
||
| domain-decomposition: | ||
| type: interior_penalty | ||
|
|
||
| discretization: | ||
| order: 2 | ||
| full-discrete-galerkin: false | ||
|
|
||
| solver: | ||
| direct_solve: true | ||
| use_amg: true # used only for iterative solver | ||
|
|
||
| visualization: | ||
| enabled: false | ||
| unified_paraview: false | ||
| file_path: | ||
| prefix: poisson_output | ||
|
|
||
| parameterized_problem: | ||
| name: poisson_component | ||
|
|
||
| single_run: | ||
| poisson_component: | ||
| k0: 0.6 | ||
| k1: -0.6 | ||
| bdr_k0: 0.05 | ||
| bdr_k1: 0.04 | ||
| offset: 0.1 | ||
| bdr_offset: 0. | ||
|
|
||
| sample_generation: | ||
| maximum_number_of_snapshots: 4000 | ||
| type: "random" | ||
| random_sample_generator: | ||
| number_of_samples: 1400 | ||
| report_frequency: 10 | ||
| file_path: | ||
| prefix: "./snapshots/poisson_array" | ||
| parameters: | ||
| - key: mesh/component-wise/global_config | ||
| type: filename | ||
| minimum: 0 | ||
| maximum: 624 | ||
| format: "./configs/samples/box-channel.config-%05d.h5" | ||
| - key: single_run/poisson_component/k0 | ||
| type: double | ||
| minimum: -0.5 | ||
| maximum: 0.5 | ||
| - key: single_run/poisson_component/k1 | ||
| type: double | ||
| minimum: -0.5 | ||
| maximum: 0.5 | ||
| - key: single_run/poisson_component/offset | ||
| type: double | ||
| minimum: 0.0 | ||
| maximum: 1.0 | ||
| - key: single_run/poisson_component/bdr_offset | ||
| type: double | ||
| minimum: 0.0 | ||
| maximum: 1.0 | ||
|
|
||
| basis: | ||
| prefix: "basis/poisson_basis" | ||
| number_of_basis: 10 | ||
| tags: | ||
| - name: empty | ||
| snapshot_files: ["./snapshots/poisson_array_sample_empty_snapshot"] | ||
| - name: square-circle | ||
| snapshot_files: ["./snapshots/poisson_array_sample_square-circle_snapshot"] | ||
| - name: square-square | ||
| snapshot_files: ["./snapshots/poisson_array_sample_square-square_snapshot"] | ||
| - name: square-star | ||
| snapshot_files: ["./snapshots/poisson_array_sample_square-star_snapshot"] | ||
| - name: square-triangle | ||
| snapshot_files: ["./snapshots/poisson_array_sample_square-triangle_snapshot"] | ||
| svd: | ||
| save_spectrum: true | ||
| update_right_sv: false | ||
| visualization: | ||
| enabled: false | ||
| prefix: poisson_comp | ||
|
|
||
| model_reduction: | ||
| separate_variable_basis: false # true for vel/pres separate basis | ||
| rom_handler_type: mfem | ||
| linear_solver_type: direct | ||
| linear_system_type: spd | ||
| # individual/universal | ||
| subdomain_training: universal | ||
| save_operator: | ||
| level: component | ||
| prefix: "poisson_comp" | ||
| compare_solution: | ||
| enabled: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/bin/bash | ||
| # Generates input meshes for the Poisson example | ||
| # Note: assumes this is run from the build/examples/poisson_parallel directory | ||
| comp_script="../../../utils/python/box_comp_config.py" | ||
| if [[ ! -f ${comp_script} ]]; then | ||
| echo "Could not find box_comp_config.py script" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Generate box-channel.comp.h5 | ||
| python3 ${comp_script} | ||
|
|
||
| # Generate all sample config meshes | ||
| python3 generate_configs.py | ||
|
|
||
| mkdir configs/ | ||
| mv box-channel.comp.h5 configs/ | ||
| mv test.box-channel.8x8.h5 configs/ | ||
|
|
||
| mkdir configs/samples/ | ||
| mv *.h5 configs/samples/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to get deleted at the destruction of
PoissonSolver.