Skip to content
Snippets Groups Projects

Draft: Protect calls to ParMETIS by HAVE_PARMETIS

Closed Simon Praetorius requested to merge issue/preotect-parmetis into master
All threads resolved!

Summary

ParMETIS can only be used if 1. the parmetis header parmetis.h is included and 2. the parmetis library is linked. IF this is the case, the compile definition HAVE_PARMETIS is set. This MR check for this define on all ParMETIS calls.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • 1cd33cc8 - Add error message if ParMETIS is not found

    Compare with previous version

  • Simon Praetorius resolved all threads

    resolved all threads

  • added 1 commit

    • 91840fcd - Add error message if ParMETIS is not found

    Compare with previous version

  • Just for the record: When is graphRepartition() or commGraphRepartition() actually called?

    MatrixHierarchy<...>::build(criterion) {
     if(
    #if HAVE_PARMETIS
          /* some_condition */
    #else
          false
    #endif
          || criterion.accumulate()==atOnceAccu
        ) 
      {
        repartitionAndDistributeMatrix(...);
      }
    
      //...
      /* another call to repartitionAndDistributeMatrix() protected by several conditions
         but with nparts = 1 */
    }

    with repartitionAndDistributeMatrix() overloaded for SequentialInformation (just an error message) and other Information calling commGraphRepartition() if #if AMG_REPART_ON_COMM_GRAPH, otherwise graphRepartition().

    Thus, the graphRepartition() is only called if ParMETIS is available, or a specific accumulation criterion is set. (Default is successiveAccu). Inside of graphRepartition() there is another check for ParMETIS:

    #if !HAVE_PARMETIS 
      nparts=1;
    #else
    if(nparts>1) {
      ParMETIS_V3_PartKway(...);
    }
    #endif

    and inside commGraphRepartition() the strategy is a bit different, there nparts is not set to 1, but we have to set another compile flag:

    #if !HAVE_PARMETIS 
    // ...
    #else
    #if PARALLEL_PARTITION
      ParMETIS_V3_PartKway(...);
    #endif
    #endif
    Edited by Simon Praetorius
  • Simon Praetorius marked this merge request as draft

    marked this merge request as draft

  • The call to ParMETIS_V3_PartKway is actually already protected. It is just a bit difficult to find out, since there are up to 4-5 levels of nested preprocessor conditions without any comments. The reason why I got linker errors is, because in dune-common the #define HAVE_PARMETIS 1 was set independent of whether it was linked or not. This is now fixed with dune-common!1205 (merged)

    Sorry for the noise. I will close this MR.

  • Please register or sign in to reply
    Loading