Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Munk Hansen
VTK
Commits
00440c91
Commit
00440c91
authored
1 month ago
by
Louis Gombert
Browse files
Options
Downloads
Patches
Plain Diff
HTG GCG: support setting input controller
parent
291b4803
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Filters/Parallel/vtkHyperTreeGridGhostCellsGenerator.cxx
+29
-9
29 additions, 9 deletions
Filters/Parallel/vtkHyperTreeGridGhostCellsGenerator.cxx
Filters/Parallel/vtkHyperTreeGridGhostCellsGenerator.h
+13
-1
13 additions, 1 deletion
Filters/Parallel/vtkHyperTreeGridGhostCellsGenerator.h
with
42 additions
and
10 deletions
Filters/Parallel/vtkHyperTreeGridGhostCellsGenerator.cxx
+
29
−
9
View file @
00440c91
...
...
@@ -17,11 +17,25 @@
VTK_ABI_NAMESPACE_BEGIN
vtkStandardNewMacro
(
vtkHyperTreeGridGhostCellsGenerator
);
vtkCxxSetObjectMacro
(
vtkHyperTreeGridGhostCellsGenerator
,
Controller
,
vtkMultiProcessController
);
//------------------------------------------------------------------------------
vtkHyperTreeGridGhostCellsGenerator
::
vtkHyperTreeGridGhostCellsGenerator
()
{
this
->
AppropriateOutput
=
true
;
this
->
SetController
(
vtkMultiProcessController
::
GetGlobalController
());
}
//------------------------------------------------------------------------------
vtkHyperTreeGridGhostCellsGenerator
::~
vtkHyperTreeGridGhostCellsGenerator
()
{
this
->
SetController
(
nullptr
);
}
//------------------------------------------------------------------------------
vtkMultiProcessController
*
vtkHyperTreeGridGhostCellsGenerator
::
GetController
()
{
return
this
->
Controller
.
Get
();
}
//------------------------------------------------------------------------------
...
...
@@ -96,6 +110,11 @@ int vtkHyperTreeGridGhostCellsGenerator::RequestData(vtkInformation* vtkNotUsed(
return
0
;
}
if
(
!
inputHTG
)
{
vtkWarningMacro
(
"Incorrect HTG for piece "
<<
currentPiece
);
}
// Make sure every HTG piece has a correct extent and can be processed.
// This way, we make sure the `ProcessTrees` function will either be executed by all ranks
// or by none, and avoids getting stuck on barriers.
...
...
@@ -109,14 +128,16 @@ int vtkHyperTreeGridGhostCellsGenerator::RequestData(vtkInformation* vtkNotUsed(
}
int
allCorrect
=
1
;
// Reduction operation cannot be done on bools
vtkMultiProcessController
*
controller
=
vtkMultiProcessController
::
GetGlobalController
();
controller
->
AllReduce
(
&
correctExtent
,
&
allCorrect
,
1
,
vtkCommunicator
::
LOGICAL_AND_OP
);
this
->
Controller
->
AllReduce
(
&
correctExtent
,
&
allCorrect
,
1
,
vtkCommunicator
::
LOGICAL_AND_OP
);
if
(
!
allCorrect
)
{
vtkWarningMacro
(
"Every individual distributed process does not have a valid HTG extent. No "
"ghost cells will be generated."
);
outputHTG
->
ShallowCopy
(
inputHTG
);
if
(
outputHTG
)
{
outputHTG
->
ShallowCopy
(
inputHTG
);
}
return
1
;
}
else
if
(
!
this
->
ProcessTrees
(
inputHTG
,
outputHTG
))
...
...
@@ -133,8 +154,7 @@ int vtkHyperTreeGridGhostCellsGenerator::RequestData(vtkInformation* vtkNotUsed(
int
vtkHyperTreeGridGhostCellsGenerator
::
ProcessTrees
(
vtkHyperTreeGrid
*
input
,
vtkDataObject
*
outputDO
)
{
vtkMultiProcessController
*
controller
=
vtkMultiProcessController
::
GetGlobalController
();
int
numberOfProcesses
=
controller
->
GetNumberOfProcesses
();
int
numberOfProcesses
=
this
->
Controller
->
GetNumberOfProcesses
();
vtkHyperTreeGrid
*
output
=
vtkHyperTreeGrid
::
SafeDownCast
(
outputDO
);
if
(
!
output
)
...
...
@@ -164,7 +184,7 @@ int vtkHyperTreeGridGhostCellsGenerator::ProcessTrees(
output
->
GetCellData
()
->
CopyStructure
(
input
->
GetCellData
());
}
vtkHyperTreeGridGhostCellsGeneratorInternals
subroutines
{
this
,
c
ontroller
,
input
,
output
};
vtkHyperTreeGridGhostCellsGeneratorInternals
subroutines
{
this
,
this
->
C
ontroller
,
input
,
output
};
subroutines
.
InitializeCellData
();
this
->
UpdateProgress
(
0.1
);
...
...
@@ -183,7 +203,7 @@ int vtkHyperTreeGridGhostCellsGenerator::ProcessTrees(
vtkErrorMacro
(
"Failure during size exchange, aborting."
);
return
0
;
}
c
ontroller
->
Barrier
();
this
->
C
ontroller
->
Barrier
();
this
->
UpdateProgress
(
0.4
);
vtkDebugMacro
(
"Exchange tree decomposition and masks with neighbors"
);
...
...
@@ -192,7 +212,7 @@ int vtkHyperTreeGridGhostCellsGenerator::ProcessTrees(
vtkErrorMacro
(
"Failure during mask exchange, aborting."
);
return
0
;
}
c
ontroller
->
Barrier
();
this
->
C
ontroller
->
Barrier
();
this
->
UpdateProgress
(
0.6
);
vtkDebugMacro
(
"Exchange cell data with neighbors"
);
...
...
@@ -202,7 +222,7 @@ int vtkHyperTreeGridGhostCellsGenerator::ProcessTrees(
return
0
;
}
c
ontroller
->
Barrier
();
this
->
C
ontroller
->
Barrier
();
this
->
UpdateProgress
(
0.8
);
vtkDebugMacro
(
"Create ghost array and set output mask"
);
...
...
This diff is collapsed.
Click to expand it.
Filters/Parallel/vtkHyperTreeGridGhostCellsGenerator.h
+
13
−
1
View file @
00440c91
...
...
@@ -29,6 +29,7 @@
#include
"vtkFiltersParallelModule.h"
// For export macro
#include
"vtkHyperTreeGridAlgorithm.h"
#include
"vtkWeakPointer.h"
// for vtkWeakPointer
#include
<vector>
// For vtkHypertreeGridGhostCellsGenerator::ExtractInterface
...
...
@@ -48,9 +49,18 @@ public:
vtkTypeMacro
(
vtkHyperTreeGridGhostCellsGenerator
,
vtkHyperTreeGridAlgorithm
);
void
PrintSelf
(
ostream
&
os
,
vtkIndent
indent
)
override
;
///@{
/**
* Get/Set the controller to use. By default
* vtkMultiProcessController::GlobalController will be used.
*/
virtual
void
SetController
(
vtkMultiProcessController
*
);
vtkMultiProcessController
*
GetController
();
///@}
protected:
vtkHyperTreeGridGhostCellsGenerator
();
~
vtkHyperTreeGridGhostCellsGenerator
()
override
=
default
;
~
vtkHyperTreeGridGhostCellsGenerator
()
override
;
struct
vtkInternals
;
...
...
@@ -103,6 +113,8 @@ protected:
private:
vtkHyperTreeGridGhostCellsGenerator
(
const
vtkHyperTreeGridGhostCellsGenerator
&
)
=
delete
;
void
operator
=
(
const
vtkHyperTreeGridGhostCellsGenerator
&
)
=
delete
;
vtkWeakPointer
<
vtkMultiProcessController
>
Controller
;
};
VTK_ABI_NAMESPACE_END
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment