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
Mesh partitioning with zoltan instead of metis. #5514
Conversation
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.
very nice 👍 please also add a changelog in doc/news/changes/minor
include/deal.II/grid/grid_tools.h
Outdated
@@ -28,6 +28,8 @@ | |||
#include <deal.II/grid/tria_accessor.h> | |||
#include <deal.II/grid/tria_iterator.h> | |||
#include <deal.II/hp/dof_handler.h> | |||
//Needed for partition_triangulation |
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.
we usually don't document headers, you can remove this line
include/deal.II/lac/sparsity_tools.h
Outdated
*/ | ||
enum Partitioner | ||
{ | ||
metis = 0, |
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.
please document those, just add
/**
* Use METIS partitioner.
*/
and
/**
* Use Zoltan partitioner.
*/
source/grid/grid_tools.cc
Outdated
@@ -56,6 +56,9 @@ | |||
#include <list> | |||
#include <set> | |||
|
|||
//Needed for partition_triangulation |
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.
that can be removed.
source/lac/sparsity_tools.cc
Outdated
@@ -39,15 +39,270 @@ extern "C" | |||
DEAL_II_ENABLE_EXTRA_DIAGNOSTICS | |||
#endif | |||
|
|||
#include <zoltan_cpp.h> |
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.
we need to be more careful here as Trilinos
might not be compiled with Zoltan
package, please add Zoltan
to
this line https://github.com/dealii/dealii/blob/master/cmake/configure/configure_2_trilinos.cmake#L58 and guard these includes and code in
#ifdef DEAL_II_TRILINOS_WITH_Zoltan
...
#endif
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.
it would probably be better to use STRING(TOUPPER "${_lib}" _lib_upper)
, something like
FOREACH(_optional_module
ROL Zoltan
)
ITEM_MATCHES(_module_found ${_optional_module} ${Trilinos_PACKAGE_LIST})
IF(_module_found)
MESSAGE(STATUS "Found ${_optional_module}")
STRING(TOUPPER "${_optional_module}" _optional_module_upper)
SET(DEAL_II_TRILINOS_WITH_${_optional_module_upper} ON)
ELSE()
MESSAGE(STATUS "Module ${_optional_module} not found!")
ENDIF()
ENDFOREACH()
so that we can write
DEAL_II_TRILINOS_WITH_ZOLTAN
consistent with all other macros.
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.
Also guard the include with DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
source/lac/sparsity_tools.cc
Outdated
//Query functions for partition_zoltan | ||
int get_number_of_objects(void *data, int *ierr) | ||
{ | ||
SparsityPattern *graph = (SparsityPattern *)data; |
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.
please use
SparsityPattern *graph = static_cast<SparsityPattern *>(data);
same below.
source/lac/sparsity_tools.cc
Outdated
|
||
for (int i=0; i < num_obj; ++i) | ||
{ | ||
|
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.
empty line
source/lac/sparsity_tools.cc
Outdated
|
||
for ( SparsityPattern::iterator col=graph->begin(i); | ||
col < graph->end(i); ++col ) | ||
{ |
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.
you can remove this bracket and write if
directly under.
source/lac/sparsity_tools.cc
Outdated
if ( i != col->column() ) | ||
{ | ||
*nextNborGID++ = col->column(); | ||
//std::cout << "Neighbours " << globalID[i] << " : " << *(nextNborGID-1) << std::endl; |
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.
remove.
source/lac/sparsity_tools.cc
Outdated
//Clean up | ||
delete zz; | ||
|
||
//Terminate MPI in the main program! |
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.
you can remove this.
tests/zoltan/CMakeLists.txt
Outdated
INCLUDE(../setup_testsubproject.cmake) | ||
PROJECT(testsuite CXX) | ||
|
||
DEAL_II_PICKUP_TESTS() |
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.
guard this in
IF(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_Zoltan)
DEAL_II_PICKUP_TESTS()
ENDIF()
tests/zoltan/zoltan_01.cc
Outdated
{ | ||
//Initialize MPI and Zoltan | ||
float version; | ||
MPI::Init(argc, argv); |
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.
we usually use Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
auxiliary class to do initialization.
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.
you would do
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
test<1> ();
test<2> ();
test<3> ();
and the destructor of MPI_InitFinalize
will take care of calling finalize.
tests/zoltan/zoltan_01.cc
Outdated
//Initialize MPI and Zoltan | ||
float version; | ||
MPI::Init(argc, argv); | ||
Zoltan_Initialize(argc, argv, &version); |
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.
@dealii/dealii should not that go into constructor of MPI_InitFinalize
in base/mpi.cc
?
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.
Yes it should. That's what we do for PETSc
and TBB
include/deal.II/lac/sparsity_tools.h
Outdated
/** | ||
* Enumerator with options for partitioner | ||
*/ | ||
enum Partitioner |
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.
please use strong enumerators, i.e. enum class Partitioner
, see https://stackoverflow.com/questions/18335861/why-is-enum-class-preferred-over-plain-enum
tests/zoltan/zoltan_01.cc
Outdated
|
||
|
||
|
||
// check GridTools::partition_triangulation |
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.
you probably use some other test as an example, it's good to state it here so that in case something goes wrong
in years to come, it's easier to debug.
You can also be a bit more specific by saying
check GridTools::partition_triangulation using Zoltan
tests/zoltan/zoltan_01.cc
Outdated
#include <deal.II/grid/tria_iterator.h> | ||
#include <deal.II/grid/grid_tools.h> | ||
#include <deal.II/grid/grid_generator.h> | ||
#include <zoltan_cpp.h> |
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 should not be needed, i think
tests/zoltan/zoltan_01.cc
Outdated
{ | ||
initlog(); | ||
|
||
try |
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.
that was there in another test, i guess, but you can remove try/catch
thing.
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 is great! Thanks for the PR
source/lac/sparsity_tools.cc
Outdated
Zoltan *zz = new Zoltan(MPI::COMM_SELF); | ||
|
||
//Check if zoltan object is initialized | ||
Assert( zz != NULL , ExcEmptyObject() ); |
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.
Use nullptr
instead of NULL
tests/zoltan/zoltan_01.cc
Outdated
GridGenerator::hyper_cube (triangulation); | ||
triangulation.refine_global (5-dim); | ||
|
||
// subdivideS into 5 subdomains |
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.
typo subdivideS
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.
thanks
tests/zoltan/zoltan_01.cc
Outdated
//Initialize MPI and Zoltan | ||
float version; | ||
MPI::Init(argc, argv); | ||
Zoltan_Initialize(argc, argv, &version); |
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.
Yes it should. That's what we do for PETSc
and TBB
source/lac/sparsity_tools.cc
Outdated
Assert( zz != NULL , ExcEmptyObject() ); | ||
|
||
//General parameters | ||
zz->Set_Param( "LB_METHOD", "GRAPH" ); //graph based partition method (LB-load balancing) |
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.
Is this the only partitioning method that you plan on using?
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.
I chose graph partitioners based on the application and ease of implementation. Even with this one partitioner, there are different packages available ( set by using GRAPH_PACKAGE). I chose the default one.
I have not considered using geometric and simple partitioner (uses no connectivity info.) here. That leaves us with graph partitioners and hyper graph partitioners. In order to use hyper graph partitioners, other query functions have to be written and is in general more expensive than graph option.
./run-tests |
Oh, I so look forward to seeing this included in deal.II! Thank you very much for this contribution! Right now, the build fails with this error message:
|
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.
Great work, thanks for tackling this!
include/deal.II/grid/grid_tools.h
Outdated
* METIS when multiple partitions are required. | ||
* | ||
* To use ZOLTAN partitioner, user has to take care of initialization and | ||
* termination of MPI environment. |
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.
I think this has been discussed in another comment already, but we should really do this in the same place as we initialize MPI and PETSc.
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.
indeed, the tests should use Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
, whereas we should move Zoltan MPI init into constructor of this class, see base/mpi.cc
. See how it's done for other libraries, and duplicate this for Zoltan with the preprocessor guard.
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.
sorry, i first commented and only then saw that @niveshd already did the changes. I think we can simply remove this line as it is not the case anymore.
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.
Right. That's really what I meant to point out -- that the sentence should just be removed.
include/deal.II/grid/grid_tools.h
Outdated
* METIS is the default partitioner. | ||
* | ||
* Assuming METIS is chosen as partitioner, this function will generate an error in case METIS | ||
* is not installed unless @p n_partitions is one. I.e., you can write a program so that it runs |
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.
Can you duplicate this paragraph also for the case that ZOLTAN has been chosen?
include/deal.II/grid/grid_tools.h
Outdated
* the neighborship graph, and METIS will not usually cut important | ||
* connections in this case. However, if there are vertices in the mesh | ||
* where many cells (many more than the common 4 or 6 in 2d and 3d, | ||
* the neighborship graph, and METIS, when chosen as the partitioner, |
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.
I think this comment (and maybe also the one in line 1395/1404) is not meant to be specific to METIS, just about partitioning in general. It may be useful to just replace "METIS" by "partitioning algorithm" or something similar. This would save us the hassle to update the documentation again if we ever choose to add a third or fourth partitioning algorithm.
include/deal.II/lac/sparsity_tools.h
Outdated
* Assuming METIS is chosen as partitioner, this function will generate an error if | ||
* METIS is not installed unless @p n_partitions is one. I.e., you can write a program | ||
* so that it runs in the single-processor single-partition case without METIS installed, | ||
* and only requires METIS when multiple partitions are required. |
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.
same here -- say what happens if you choose ZOLTAN but ZOLTAN has not been found.
|
||
// If metis returns normally, an error code METIS_OK=1 is returned from | ||
// the above functions (see metish.h) | ||
AssertThrow (ierr == 1, ExcMETISError (ierr)); |
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.
We all already knew how crappy METIS is, but this just reinforces my opinion -- using 1
as the OK return code...
source/lac/sparsity_tools.cc
Outdated
SparsityPattern *graph = static_cast<SparsityPattern *>(data); | ||
*ierr = ZOLTAN_OK; | ||
|
||
Assert ( numEdges != nullptr , ExcEmptyObject() ); |
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.
same here, and probably in all of the places below where you use ExcEmptyObject
.
source/lac/sparsity_tools.cc
Outdated
std::vector<unsigned int> &partition_indices) | ||
{ | ||
//MPI environment must have been initialized by this point. | ||
Zoltan *zz = new Zoltan(MPI::COMM_SELF); |
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.
use
std::unique_ptr<Zoltan> zz = std_cxx14::make_unique<Zoltan>(MPI::COMM_SELF));
here. You then don't need the delete
below, and you also don't need the check for nullptr
in the next line -- new
(or make_unique
) will throw an exception if it can't allocate the memory.
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.
Further, this should probably be MPI_COMM_SELF
.
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.
Oh, yes, good eyes! The MPI C++ bindings are going to go away.
source/lac/sparsity_tools.cc
Outdated
export_to_part); | ||
|
||
//check for error code in partitioner | ||
Assert( rc == ZOLTAN_OK , ExcEmptyObject() ); |
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.
That seems the wrong exception object.
source/lac/sparsity_tools.cc
Outdated
//check for error code in partitioner | ||
Assert( rc == ZOLTAN_OK , ExcEmptyObject() ); | ||
|
||
Assert (partition_indices.size() != 0, ExcZero()); |
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 would indicate an error in Zoltan. I would map that to ExcInternalError
.
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.
it's actually input to the function. We already have
Assert (partition_indices.size() == sparsity_pattern.n_rows(),
ExcInvalidArraySize (partition_indices.size(),
sparsity_pattern.n_rows()));
so this one can simply go.
source/lac/sparsity_tools.cc
Outdated
//copy from export_to_part to partition_indices | ||
for (int i=0; i < num_export; i++) | ||
{ | ||
partition_indices[export_local_ids[i]] = export_to_part[i]; |
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.
Is there a guarantee that export_local_ids[i]
loops over all indices? If so, then we wouldn't need to fill the array by zeros immediately above. If there is no such guarantee, then filling the array with invalid indices might be the better choice.
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.
It is not intended to go through all the indices, rather only the ones that changed the partitions. This is why i set the default partition id to be zero.
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.
Hm, I don't think I understand. partition_indices
is only an output variable -- as far as I can see, it's previous contents (if any) are not actually given to Zoltan, right? In that case, I would expect that Zoltan provides as its output a partition index for each node of the graph, and so export_local_ids[i]
should loop through all nodes. If that were not the case, what partition is assigned to graph nodes that are not listed in export_local_ids
? Right now, it is zero, but why is that the correct answer?
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.
Initially all of them belong to part 0. After partitioning, export_local_ids only has ids whose part ids(within each process) have changed. I will try if I can do it directly as you suggested!
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.
After partitioning, export_local_ids only has ids whose part ids(within each process) have changed.
i think it's OK if you simply add this as a note above this line so that anyone reading the code would understand.
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.
p.s. from this code, it does not look like you can use partition_indices
directly in Zoltan as the output is ZOLTAN_ID_PTR export_local_ids=nullptr
. So it looks like Zoltan internally allocates memory and hopefully also cleans it up in destructor...
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.
That is true. Everything is allocated based on the query functions passed to zoltan
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.
Yes, just putting the reasoning into a comment is good enough -- simply state that Zoltan only provides information about nodes whose partition is != 0.
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.
only cosmetic suggestions.
include/deal.II/base/config.h.in
Outdated
@@ -57,6 +57,7 @@ | |||
#cmakedefine DEAL_II_WITH_TRILINOS | |||
#cmakedefine DEAL_II_WITH_UMFPACK | |||
#cmakedefine DEAL_II_WITH_ZLIB | |||
#cmakedefine DEAL_II_TRILINOS_WITH_ZOLTAN |
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.
nitpick, but could you please move this after the line #cmakedefine DEAL_II_TRILINOS_WITH_ROL
where other Trilinos
-related things are defined.
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.
no problem. Thanks!
include/deal.II/grid/grid_tools.h
Outdated
@@ -1361,25 +1362,33 @@ namespace GridTools | |||
DynamicSparsityPattern &connectivity); | |||
|
|||
/** | |||
* Use the METIS partitioner to generate a partitioning of the active cells | |||
* Use METIS or ZOLTAN partitioner to generate a partitioning of the active cells |
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.
to make it extendable, it's probably easier to say
Use graph partitioner...
and below
Currently the user can choose between METIS (default) and ZOLTAN partitioner. If deal.II was not
compiled with the corresponding package, then the function will generate en error unless .... .
this is in line of what @bangerth suggested https://github.com/dealii/dealii/pull/5514/files#r152897649
|
hm, there is something else going on here, |
maybe as a temporary solution do something like:
|
But if |
that's based on |
Oh, how bizarre. @tjhei -- do you have an idea why that would be so? We've had this issue before that Trilinos said it had a sublibrary but then didn't install everything that is necessary for it. I wonder if we should just hard-error out in that case in cmake? |
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.
thanks for working through comments, just a few from my side.
source/lac/sparsity_tools.cc
Outdated
|
||
return graph->n_rows(); | ||
} | ||
#endif |
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.
you don't have to put #endif
here, just put it right before void partition_zoltan
. Then you can remove all those #ifdef / #endif
in between.
source/lac/sparsity_tools.cc
Outdated
localID[i] = i; //same as global ids | ||
} | ||
|
||
return; |
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.
no need for return
as it's a void function. same below.
source/lac/sparsity_tools.cc
Outdated
// installed and detected | ||
#ifndef DEAL_II_TRILINOS_WITH_ZOLTAN | ||
(void)sparsity_pattern; | ||
AssertThrow (false, ExcInternalError()); |
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.
please change the asset type, for METIS
we have
AssertThrow (false, ExcMETISNotInstalled());
where ExcMETISNotInstalled
is a custom assert. You can check include/deal.II/lac/sparsity_tools.h
line 218
to see how it's defined and copy-paste the same for Zoltan.
source/lac/sparsity_tools.cc
Outdated
|
||
//copy from export_to_part to partition_indices, whose part ids have changed. | ||
for (int i=0; i < num_export; i++) | ||
{ |
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.
please run indentation script.
@niveshd you also need to rebase as we have merge conflicts now. Roughly,
|
source/lac/sparsity_tools.cc
Outdated
#else | ||
|
||
//MPI environment must have been initialized by this point. | ||
std::unique_ptr<Zoltan> zz = std::make_unique<Zoltan>(MPI_COMM_SELF); |
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.
please use std_cxx14::make_unique
, this is itnernal namespace in deal.II which will be equal to std::
if c++14
is there or will fallback to boost
otherwise. That shall fix compiler errors on the tester.
source/lac/sparsity_tools.cc
Outdated
|
||
//set global degrees of freedom | ||
auto n_dofs = graph->n_rows(); | ||
for (int i=0; i < n_dofs; i++) |
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.
in order to avoid warnigns
/home/bob/source/source/lac/sparsity_tools.cc:165:23: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for (int i=0; i < n_dofs; i++)
do: for (unsigned int i = 0; ....
source/lac/sparsity_tools.cc
Outdated
Assert( nextNborProc != nullptr , ExcInternalError() ); | ||
|
||
//Loop through rows corresponding to indices in globalID implicitly | ||
for (int i=0; i < num_obj; ++i) |
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.
for (SparsityPattern::size_type i=0; i < static_castSparsityPattern::size_type>(num_obj); ++i)
to avoid
/home/bob/source/source/lac/sparsity_tools.cc:219:20: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned int') [-Wsign-compare]
if ( i != col->column() )
~ ^ ~~~~~~~~~~~~~
@tjhei look like the
|
@@ -55,26 +55,18 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) | |||
ENDFOREACH() | |||
|
|||
FOREACH(_optional_module |
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.
@bangerth @niveshd I know how to fix the error. The problem is that we should check optional modules after we do all the check for trilinos
being ok. There are a lot below which may eventually disable trilinos
. As a result we first might have DEAL_II_TRILINOS_WITH_XYZ
set but then we actually disable Trilinos altogether.
@niveshd please move the whole FOREACH(_optional_module
part right after CHECK_MPI_INTERFACE(TRILINOS ${var})
in this file so that we have:
IF(${var})
FOREACH(_optional_module
....
ENDFOREACH()
ENDIF()
this way we look for optional modules and enable them only if Trilinos has met all the rerquired dependencies above this line. Otherwise ${var}
will be set to FALSE
at some of the checks.
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.
p.s. DEAL_II_FIND_FILE(ZOLTAN_CPP zoltan_cpp.h
shall not be needed as from the tester we see:
-- Found Zoltan
-- Found MueLu
-- Found ZOLTAN_CPP
-- Could not find a sufficient Trilinos installation: Trilinos has to be configured with the same MPI configuration as deal.II.
-- DEAL_II_WITH_TRILINOS has unmet external dependencies.
Could please try rebasing again? There are still conflicts in the CMake related file. You wou need to force push after that: git push -f |
Ps. Since u modify that cmake file more than once, it might be easier to simply merge in “master” to your branch and resolve the conflict. After that you can check that everything still works and tests passes and then squash into a single commit and push force. |
@davydden i tried rebasing and push -f. But the conflict is not cleared. I think it's because I am trying to modify some old stuff. Should I just separate ROL and Zoltan in that loop which checks for these libraries. |
Are you sure you did
? I mean you local In your case I think it's easier to simply merge
That will ask you to resolve conflict. Once you are done, you shall add conflicting files
and then commit
The only changes to |
p.s. the whole reason for conflict is that after your branched off the |
no, certainly not. |
@niveshd i tried resolving from the web-interface but it did not work. (empty commit and conflict is still there). Try squashing locally and |
8f7176e
to
e61e635
Compare
@niveshd Thanks for squashing. Something is wierd with that Maybe try:
|
@davydden , i tried what you said. but strangely it still shows the problem. Probably the reason it says i tried to modify the whole thing was because i copied the cmake file you sent me directly. |
Zoltan is used for graph partitioning. The following page for zoltan's guide has more information. http://www.cs.sandia.gov/zoltan/ug_html/ug_alg_phg.html Implementation: - 4 query functions, as need by zoltan, are added in sparsity_tools.cc - additional option has been added to "partition_triangulation" function to choose between "metis" or "zoltan"
a60001d
to
3316c96
Compare
@niveshd I have resolved the merge conflict, split into several commits (retaining you as author) and rebased to master. I have pushed all changes to your remote branch niveshd:zoltanPartition - please pull locally and check whether everything is allright :-) |
p.s. @niveshd i know why the whole rebase was no doing anything, your master branch https://github.com/niveshd/dealii/commits/master also has some Zoltan related changes. So that means when you did
My advice is to never commit anything to master so that you can always easily pull the upstream branch. It's always better to work on the dedicated feature branches. |
Fantastic -- let's see how this works! |
Zoltan is used for graph partitioning. The following page for zoltan's guide has more information. http://www.cs.sandia.gov/zoltan/ug_html/ug_alg_phg.html
Implementation:
4 query functions, as need by zoltan, are added in sparsity_tools.cc
Additional option has been added to "partition_triangulation" function to choose between "metis" or "zoltan"