-
Notifications
You must be signed in to change notification settings - Fork 13
Integrate the Cabana load balancer #29
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
Draft
aetx
wants to merge
68
commits into
ECP-copa:master
Choose a base branch
from
aetx:cabana_lb
base: master
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.
Draft
Changes from 46 commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
f3f1997
add vim temp files to gitignore
aetx 7a5cc30
add initial rough integration of all lb
aetx cf45af4
Create proper domain output using all lb
aetx fb54b27
retrieve local grid dimensions and location and output via liball vtk…
aetx aeace1e
very dirty incorporation of lb
aetx 09df0c9
make sure the created arrays are also updated
aetx 09f3704
add primitive VTK writer for domains
aetx fad1d73
use the mutable version of global grid and some debug output
aetx 408bab2
reenable silo particle output
aetx a7f86d5
remove debug output
aetx 2befc54
update VTKDomainWriter to allow for arbitrary basename
aetx dba154b
output actual and load balancing domain structure
aetx d4877b8
VTKDomainWriter fix parallel file piece filename composition
aetx f014469
to not miss cells, first convert lb vertices to cells, then apply to …
aetx cb15e1f
ci: include ALL checkout and build
aetx 5a9bf54
disable ALL internal VTK output for now
aetx 9d0a2aa
move load balancing interface into LoadBalancer
aetx e83988b
remove spurious debug output
aetx 897ff8a
fix errors and re-enable vtk output
aetx 41fe692
change decomposition to y direction
aetx 9ab5cf1
also enable ALL vertex output
aetx 25e21aa
Revert "also enable ALL vertex output"
aetx 64b55bf
try new CI workflow to update apt-get
aetx b27821a
Merge branch 'master' into all_lb
junghans 9a7bda1
CI: install ALL in home
junghans 5c11bf1
use more recent ALL version
aetx d53e661
remove unneeded methods
aetx 662eae5
remove trailing whitespace
aetx c1e53cc
run clang-format
aetx ee32eeb
CI: use modified cabana for now.
junghans 82801b0
Merge branch 'all_lb' of github.com:aetx/ExaMPM into all_lb
aetx d03eb08
disable ALL VTK output
aetx 697ff10
fix warning in printf
aetx 490b3df
fix documentation in VTKDomainWriter
aetx 47213d7
update constness
aetx 00c9239
update for cabana refactoring
aetx 6e1389b
update format
aetx f1c50b9
update to new cabana api
aetx f0b9ca1
Merge branch 'master' into all_lb
aetx 57a5242
Update CI.yml
junghans 078227b
make ALL optional
aetx 0880566
Merge branch 'all_lb' of github.com:aetx/ExaMPM into all_lb
aetx 3486851
get loadbalancer to compile
aetx ff993d4
build ALL before cabana and require ALL in cabana
aetx 75726d4
make format
aetx 61bee26
make sure cabana finds all
aetx 8f549db
cmake syntax mistake
aetx 901be36
yaml syntax mistake
aetx ebdd9d6
make sure new mesh is actually used
aetx d415dcb
add debug output
aetx 3181c0f
update to new Cabana lb interface
aetx 3292ef7
Revert "add debug output"
aetx aca7063
format
aetx 979a39e
fix output time step for domain output
aetx c2e7061
add todo regarding Silo writer and empty domains
aetx b91bfb6
use Cabana_ENABLE_ALL and clean up
aetx dcc9337
explicitly setting Cabana_ENABLE_ALL no longer required
aetx 0981e1f
fix warning
aetx 17d3ebc
fix warnings
aetx 6014371
make format
aetx bb6526e
Use ExaMPM_ENABLE_LB to force lb on or off
aetx 034e5f5
only balance every 10 steps
aetx fd35d8e
add basic timing info
aetx 9babd7c
allow run time selection of lb frequency
aetx 75bc0bf
add continuous perf output
aetx a9d9433
update for Quality->Imbalance rename
aetx 69bebc6
move LoadBalancer into Experimental namespace
aetx f380494
remove some redundancy
aetx 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
*.mp4 | ||
*.mp4 | ||
*.swp |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/**************************************************************************** | ||
* Copyright (c) 2018-2020 by the ExaMPM authors * | ||
* All rights reserved. * | ||
* * | ||
* This file is part of the ExaMPM library. ExaMPM is distributed under a * | ||
* BSD 3-clause license. For the licensing terms see the LICENSE file in * | ||
* the top-level directory. * | ||
* * | ||
* SPDX-License-Identifier: BSD-3-Clause * | ||
****************************************************************************/ | ||
|
||
#ifndef EXAMPM_LOADBALANCER_HPP | ||
#define EXAMPM_LOADBALANCER_HPP | ||
|
||
#include <ExaMPM_Mesh.hpp> | ||
#include <ExaMPM_ProblemManager.hpp> | ||
#include <ExaMPM_VTKDomainWriter.hpp> | ||
|
||
#include <Cajita_LoadBalancer.hpp> | ||
|
||
#include <string> | ||
|
||
#include <mpi.h> | ||
|
||
namespace ExaMPM | ||
{ | ||
template <class MemorySpace> | ||
class LoadBalancer | ||
{ | ||
public: | ||
using mesh_type = Mesh<MemorySpace>; | ||
// todo(sschulz): Allow for arbitrary dimension | ||
LoadBalancer( MPI_Comm comm, std::shared_ptr<mesh_type>& mesh ) | ||
: _comm( comm ) | ||
, _mesh( mesh ) | ||
{ | ||
MPI_Comm_rank( comm, &_rank ); | ||
_lb = std::make_shared<Cajita::LoadBalancer<UniformMesh<double>>>( | ||
_mesh->localGrid()->globalGrid(), 3. * _mesh->cellSize() ); | ||
} | ||
|
||
// This will update the domain decomposition and also update the mesh | ||
void balance( std::shared_ptr<ProblemManager<MemorySpace>> pm ) | ||
{ | ||
double work = pm->numParticle(); | ||
// todo(sschulz): How to save the partitioner, without requiring a | ||
// shared ptr everywhere? | ||
auto partitioner = auto global_grid = | ||
_lb->createBalancedGlobalGrid( _mesh->globalMesh(), partitioner, | ||
work ) | ||
_mesh->newGlobalGrid( global_grid ); | ||
pm->updateMesh( _mesh ); | ||
} | ||
|
||
// Output the actual and internal load balancing grid to VTK files | ||
void output( const int t ) const | ||
{ | ||
std::string vtk_actual_domain_basename( "domain_act" ); | ||
std::string vtk_lb_domain_basename( "domain_lb" ); | ||
VTKDomainWriter::writeDomain( _comm, t, _lb->getVertices(), | ||
vtk_actual_domain_basename ); | ||
VTKDomainWriter::writeDomain( _comm, t, _lb->getInternalVertices(), | ||
vtk_lb_domain_basename ); | ||
} | ||
|
||
private: | ||
MPI_Comm _comm; | ||
std::shared_ptr<mesh_type> _mesh; | ||
std::shared_ptr<ALL::ALL<double, double>> _liball; | ||
int _rank; | ||
}; | ||
} // end namespace ExaMPM | ||
#endif // EXAMPM_LOADBALANCER_HPP |
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.
Uh oh!
There was an error while loading. Please reload this page.