Skip to content

Commit

Permalink
Merge Pull Request trilinos#5339 from shkevin/Trilinos/amgx_rebuild
Browse files Browse the repository at this point in the history
Automatically Merged using Trilinos Pull Request AutoTester
PR Title: MueLu: Amgx rebuild
PR Author: shkevin
  • Loading branch information
trilinos-autotester authored Jun 7, 2019
2 parents a5c9a44 + 5e76996 commit 9a87933
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/muelu/adapters/amgx/MueLu_AMGXOperator_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ namespace MueLu {
RCP<Teuchos::Time> amgxTimer = Teuchos::TimeMonitor::getNewTimer("MueLu: AMGX: initialize");
amgxTimer->start();
// Initialize
AMGX_SAFE_CALL(AMGX_initialize());
AMGX_SAFE_CALL(AMGX_initialize_plugins());
//AMGX_SAFE_CALL(AMGX_initialize());
//AMGX_SAFE_CALL(AMGX_initialize_plugins());

/*system*/
//AMGX_SAFE_CALL(AMGX_register_print_callback(&print_callback));
Expand Down
71 changes: 71 additions & 0 deletions packages/muelu/adapters/amgx/MueLu_AMGX_Setup.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// @HEADER
//
// ***********************************************************************
//
// MueLu: A package for multigrid based preconditioning
// Copyright 2012 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact
// Jonathan Hu ([email protected])
// Andrey Prokopenko ([email protected])
// Ray Tuminaro ([email protected])
//
// ***********************************************************************
//
// @HEADER
#include <MueLu_ConfigDefs.hpp>
#include "MueLu_AMGX_Setup.hpp"

namespace MueLu {

void MueLu_AMGX_initialize()
{
AMGX_SAFE_CALL(AMGX_initialize());
}

void MueLu_AMGX_initialize_plugins()
{
AMGX_SAFE_CALL(AMGX_initialize_plugins());
}

void MueLu_AMGX_finalize()
{
AMGX_SAFE_CALL(AMGX_finalize());
}

void MueLu_AMGX_finalize_plugins()
{
AMGX_SAFE_CALL(AMGX_finalize_plugins());
}
} // namespace

62 changes: 62 additions & 0 deletions packages/muelu/adapters/amgx/MueLu_AMGX_Setup.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#// @HEADER
//
// ***********************************************************************
//
// MueLu: A package for multigrid based preconditioning
// Copyright 2012 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact
// Jonathan Hu ([email protected])
// Andrey Prokopenko ([email protected])
// Ray Tuminaro ([email protected])
//
// ***********************************************************************
//
// @HEADER
#ifndef MUELU_AMGX_SETUP_HPP
#define MUELU_AMGX_SETUP_HPP

#ifdef HAVE_MUELU_AMGX
#include <amgx_c.h>

namespace MueLu {

void MueLu_AMGX_initialize();
void MueLu_AMGX_initialize_plugins();

void MueLu_AMGX_finalize();
void MueLu_AMGX_finalize_plugins();
}

#endif //HAVE_MUELU_AMGX
#endif //ifndef MUELU_AMGX_SETUP_DEF_HPP
14 changes: 13 additions & 1 deletion packages/muelu/test/scaling/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@

#ifdef HAVE_MUELU_AMGX
#include <MueLu_AMGXOperator.hpp>
#include <MueLu_AMGX_Setup.hpp>
#endif
#ifdef HAVE_MUELU_TPETRA
#include <MueLu_TpetraOperator.hpp>
Expand All @@ -119,7 +120,6 @@
#endif



/*********************************************************************/

#ifdef HAVE_MUELU_TPETRA
Expand Down Expand Up @@ -287,6 +287,12 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib& lib, int ar
out << "WARNING: CG will not work with COMPLEX scalars, switching to GMRES"<<std::endl;
}

#ifdef HAVE_MUELU_AMGX
//Initialize AMGX
MueLu::MueLu_AMGX_initialize();
MueLu::MueLu_AMGX_initialize_plugins();
#endif

bool isDriver = paramList.isSublist("Run1");
if (isDriver) {
// update galeriParameters with the values from the XML file
Expand Down Expand Up @@ -535,6 +541,12 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib& lib, int ar

}//end reruns

#ifdef HAVE_MUELU_AMGX
// Finalize AMGX
//MueLu::MueLu_AMGX_finalize();
//MueLu::MueLu_AMGX_finalize_plugins();
#endif

return EXIT_SUCCESS;
}

Expand Down

0 comments on commit 9a87933

Please sign in to comment.