Zoltan2
Toggle main menu visibility
Loading...
Searching...
No Matches
fix2010.cpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Zoltan2: A package of combinatorial algorithms for scientific computing
4
//
5
// Copyright 2012 NTESS and the Zoltan2 contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#include <
Zoltan2_BasicIdentifierAdapter.hpp
>
11
#include <
Zoltan2_PartitioningProblem.hpp
>
12
#include <
Zoltan2_PartitioningSolution.hpp
>
13
#include <
Zoltan2_TestHelpers.hpp
>
14
15
#include <Teuchos_DefaultComm.hpp>
16
#include <Teuchos_ParameterList.hpp>
17
18
// Test for issue #2010: no IDs provided to partitioner
19
20
int
main
(
int
narg,
char
**arg)
21
{
22
Tpetra::ScopeGuard tscope(&narg, &arg);
23
Teuchos::RCP<const Teuchos::Comm<int> > comm = Tpetra::getDefaultComm();
24
25
int
fail
=0, gfail=0;
26
27
int
rank = comm->getRank();
28
29
zlno_t
numMyIdentifiers = 0;
// no IDs provided
30
31
typedef
Zoltan2::BasicUserTypes<zscalar_t, zlno_t, zgno_t>
mydata_t;
32
typedef
Zoltan2::BasicIdentifierAdapter<mydata_t>
adapter_t;
33
34
adapter_t *adapter =
new
adapter_t(numMyIdentifiers, NULL);
35
36
Teuchos::ParameterList params(
"test parameters"
);
37
params.set(
"num_global_parts"
, 4);
38
params.set(
"algorithm"
,
"block"
);
39
params.set(
"partitioning_approach"
,
"partition"
);
40
41
Zoltan2::PartitioningProblem<adapter_t>
problem(adapter, ¶ms);
42
43
problem.
solve
();
44
45
Zoltan2::PartitioningSolution<adapter_t>
solution = problem.
getSolution
();
46
47
if
(solution.
getActualGlobalNumberOfParts
() != 0)
48
fail
=
true
;
49
50
gfail =
globalFail
(*comm,
fail
);
51
52
if
(gfail){
53
if
(rank==0)
54
std::cout <<
"FAIL GlobalNumberOfParts = "
55
<< solution.
getActualGlobalNumberOfParts
() << std:: endl;
56
return
1;
57
}
58
59
if
(rank==0)
60
std::cout <<
"PASS"
<< std:: endl;
61
62
return
0;
63
}
globalFail
int globalFail(const Comm< int > &comm, int fail)
Definition
ErrorHandlingForTests.hpp:73
Zoltan2_BasicIdentifierAdapter.hpp
Defines the BasicIdentifierAdapter class.
Zoltan2_PartitioningProblem.hpp
Defines the PartitioningProblem class.
Zoltan2_PartitioningSolution.hpp
Defines the PartitioningSolution class.
Zoltan2_TestHelpers.hpp
common code used by tests
zlno_t
Tpetra::Map ::local_ordinal_type zlno_t
Definition
Zoltan2_TestHelpers.hpp:69
main
int main()
Definition
absdefinitiontest.cpp:15
Zoltan2::BasicIdentifierAdapter
This class represents a collection of global Identifiers and their associated weights,...
Definition
Zoltan2_BasicIdentifierAdapter.hpp:46
Zoltan2::BasicUserTypes
A simple class that can be the User template argument for an InputAdapter.
Definition
Zoltan2_InputTraits.hpp:103
Zoltan2::PartitioningProblem
PartitioningProblem sets up partitioning problems for the user.
Definition
Zoltan2_PartitioningProblem.hpp:69
Zoltan2::PartitioningProblem::getSolution
const PartitioningSolution< Adapter > & getSolution()
Get the solution to the problem.
Definition
Zoltan2_PartitioningProblem.hpp:134
Zoltan2::PartitioningProblem::solve
void solve(bool updateInputData=true)
Direct the problem to create a solution.
Definition
Zoltan2_PartitioningProblem.hpp:578
Zoltan2::PartitioningSolution
A PartitioningSolution is a solution to a partitioning problem.
Definition
Zoltan2_PartitioningSolution.hpp:57
Zoltan2::PartitioningSolution::getActualGlobalNumberOfParts
size_t getActualGlobalNumberOfParts() const
Returns the actual global number of parts provided in setParts().
Definition
Zoltan2_PartitioningSolution.hpp:134
fail
static const std::string fail
Definition
findUniqueGids.cpp:45
test
core
partition
fix2010.cpp
Generated by
1.17.0