Hello everyone, 
 
I'm trying to run my code on a cluster, but I got a segmentation fault. I already ran the test_1pcctpfa problem parallel, but now after changing the grid to 3 d (cake piece, with the cake creator) something seems wrong. Did someone already have this problem? or do you have a hint for me? I attached my code and the error message.
 
Thanks a lot!
 
Best,
Anwar
 
 
DuMux : dumux-course-2018 

"""""""""
mpirun -np 1  ./test_1pcctpfa ./test_1pfv.input 


You idiot! You signed the order to destroy Earth!

 - Douglas Adams, HGttG


[eu-login-13-ng:15924] *** Process received signal ***

[eu-login-13-ng:15924] Signal: Segmentation fault (11)

[eu-login-13-ng:15924] Signal code: Address not mapped (1)

[eu-login-13-ng:15924] Failing at address: 0x80

[eu-login-13-ng:15924] [ 0] /lib64/libpthread.so.0(+0xf6d0)[0x2b69fa3006d0]

[eu-login-13-ng:15924] [ 1] ./test_1pcctpfa(_ZNK4Dune9ALU3dGridILi3ELi3ELNS_20ALU3dGridElementTypeE7ENS_14ALUGridMPICommEE12leafIndexSetEv+0x0)[0x609c90]

[eu-login-13-ng:15924] [ 2] ./test_1pcctpfa(_ZN4Dune35MultipleCodimMultipleGeomTypeMapperINS_8GridViewINS_23ALU3dLeafGridViewTraitsIKNS_7ALUGridILi3ELi3ELNS_18ALUGridElementTypeE1ELNS_21ALUGridRefinementTypeE1ENS_14ALUGridMPICommEEELNS_21PartitionIteratorTypeE4EEEEENS_4Impl14MCMGFailLayoutEEC1ERKSB_RKSt8functionIFmNS_12GeometryTypeEiEE+0x25)[0x60bc25]

[eu-login-13-ng:15924] [ 3] ./test_1pcctpfa(_ZN5Dumux20CCTpfaFVGridGeometryIN4Dune8GridViewINS1_23ALU3dLeafGridViewTraitsIKNS1_7ALUGridILi3ELi3ELNS1_18ALUGridElementTypeE1ELNS1_21ALUGridRefinementTypeE1ENS1_14ALUGridMPICommEEELNS1_21PartitionIteratorTypeE4EEEEELb0ENS_31CCTpfaDefaultGridGeometryTraitsISC_NS_19DefaultMapperTraitsISC_NS1_35MultipleCodimMultipleGeomTypeMapperISC_NS1_4Impl14MCMGFailLayoutEEESI_EEEEEC2ERKSC_+0x54)[0x61b8f4]

[eu-login-13-ng:15924] [ 4] ./test_1pcctpfa(main+0x19b)[0x56f48b]

[eu-login-13-ng:15924] [ 5] /lib64/libc.so.6(__libc_start_main+0xf5)[0x2b69fa52f445]

[eu-login-13-ng:15924] [ 6] ./test_1pcctpfa[0x573ae6]

[eu-login-13-ng:15924] *** End of error message ***

-------------------------------------------------------

Primary job  terminated normally, but 1 process returned

a non-zero exit code. Per user-direction, the job has been aborted.

-------------------------------------------------------

--------------------------------------------------------------------------

mpirun noticed that process rank 0 with PID 0 on node eu-login-13-ng exited on signal 11 (Segmentation fault)."""""""""""""""""""""""

Attachment: 1ptestproblem.hh
Description: Binary data

Attachment: 1ptestspatialparams.hh
Description: Binary data

Attachment: cakegridcreator.hh
Description: Binary data

// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
 *   See the file COPYING for full copying permissions.                      *
 *                                                                           *
 *   This program is free software: you can redistribute it and/or modify    *
 *   it under the terms of the GNU General Public License as published by    *
 *   the Free Software Foundation, either version 2 of the License, or       *
 *   (at your option) any later version.                                     *
 *                                                                           *
 *   This program is distributed in the hope that it will be useful,         *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
 *   GNU General Public License for more details.                            *
 *                                                                           *
 *   You should have received a copy of the GNU General Public License       *
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
 *****************************************************************************/
/*!
 * \file
 *
 * \brief test for the one-phase CC model
 */
#include <config.h>

#include <ctime>
#include <iostream>

#include <dune/common/parallel/mpihelper.hh>
#include <dune/common/timer.hh>
#include <dune/grid/io/file/dgfparser/dgfexception.hh>
#include <dune/grid/io/file/vtk.hh>
#include <dune/istl/io.hh>

#include "1ptestproblem.hh"

#include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/valgrind.hh>
#include <dumux/common/dumuxmessage.hh>
#include <dumux/common/defaultusagemessage.hh>

#include <dumux/linear/amgbackend.hh>
#include <dumux/nonlinear/newtonsolver.hh>

#include <dumux/assembly/fvassembler.hh>
#include <dumux/assembly/diffmethod.hh>

#include <dumux/discretization/methods.hh>

#include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager.hh>
#include <dumux/io/grid/cakegridcreator.hh>

/*!
 * \brief Provides an interface for customizing error messages associated with
 *        reading in parameters.
 *
 * \param progName  The name of the program, that was tried to be started.
 * \param errorMsg  The error message that was issued by the start function.
 *                  Comprises the thing that went wrong and a general help 
message.
 */
void usage(const char *progName, const std::string &errorMsg)
{
    if (errorMsg.size() > 0) {
        std::string errorMessageOut = "\nUsage: ";
                    errorMessageOut += progName;
                    errorMessageOut += " [options]\n";
                    errorMessageOut += errorMsg;
                    errorMessageOut += "\n\nThe list of mandatory arguments for 
this program is:\n"
                                        "\t-TimeManager.TEnd               End 
of the simulation [s] \n"
                                        "\t-TimeManager.DtInitial          
Initial timestep size [s] \n"
                                        //"\t-Grid.LowerLeft                 
Lower left corner coordinates\n"
                                       // "\t-Grid.UpperRight                
Upper right corner coordinates\n"
                                       // "\t-Grid.Cells                     
Number of cells in respective coordinate directions\n"
                                        "\t-SpatialParams.LensLowerLeft   
coordinates of the lower left corner of the lens [m] \n"
                                        "\t-SpatialParams.LensUpperRight  
coordinates of the upper right corner of the lens [m] \n"
                                        "\t-SpatialParams.Permeability     
Permeability of the domain [m^2] \n"
                                        "\t-SpatialParams.PermeabilityLens 
Permeability of the lens [m^2] \n";

        std::cout << errorMessageOut
                  << "\n";
    }
}

int main(int argc, char** argv) try
{
    using namespace Dumux;

    // define the type tag for this problem
    using TypeTag = TTAG(TYPETAG);

    // initialize MPI, finalize is done automatically on exit
    const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv);

    // print dumux start message
    if (mpiHelper.rank() == 0)
        DumuxMessage::print(/*firstCall=*/true);

    // parse command line arguments and input file
    Parameters::init(argc, argv, usage);

    // try to create a grid (from the given grid file or the input file)
    using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
    using GridManager = typename Dumux::CakeGridCreator<Grid>;
    GridManager gridManager;

    // first read parameters from input file
    Dumux::Parameters::init(argc, argv, "test_1pfv.input");
    ////////////////////////////////////////////////////////////
    // run instationary non-linear problem on this grid
    ////////////////////////////////////////////////////////////

    // we compute on the leaf grid view
    const auto& leafGridView = gridManager.grid().leafGridView();

    // create the finite volume grid geometry
    using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
    auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView);
    fvGridGeometry->update();

    // the problem (initial and boundary conditions)
    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
    auto problem = std::make_shared<Problem>(fvGridGeometry);

    // the solution vector
    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
    SolutionVector x(fvGridGeometry->numDofs());
    problem->applyInitialSolution(x);
    auto xOld = x;

    // the grid variables
    using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
    auto gridVariables = std::make_shared<GridVariables>(problem, 
fvGridGeometry);
    gridVariables->init(x, xOld);

    // get some time loop parameters
    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
    const auto tEnd = getParam<Scalar>("TimeLoop.TEnd");
    const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize");
    auto dt = getParam<Scalar>("TimeLoop.DtInitial");

    // check if we are about to restart a previously interrupted simulation
    Scalar restartTime = 0;
    if (Parameters::getTree().hasKey("Restart") || 
Parameters::getTree().hasKey("TimeLoop.Restart"))
        restartTime = getParam<Scalar>("TimeLoop.Restart");

    // intialize the vtk output module
    using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields);
    VtkOutputModule<TypeTag> vtkWriter(*problem, *fvGridGeometry, 
*gridVariables, x, problem->name());
    VtkOutputFields::init(vtkWriter); //!< Add model specific output fields

    // if we are using a random permeability field with gstat
    bool isRandomField = getParam<bool>("SpatialParams.RandomField", false);
    if(isRandomField) 
vtkWriter.addField(problem->spatialParams().getPermField(), "K");

    vtkWriter.write(0.0);

    // instantiate time loop
    auto timeLoop = std::make_shared<TimeLoop<Scalar>>(restartTime, dt, tEnd);
    timeLoop->setMaxTimeStepSize(maxDt);

    // the assembler with time loop for instationary problem
    using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>;
    auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, 
gridVariables, timeLoop);

    // the linear solver
    using LinearSolver = AMGBackend<TypeTag>;
    auto linearSolver = std::make_shared<LinearSolver>(leafGridView, 
fvGridGeometry->dofMapper());

    // the non-linear solver
    using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>;
    NewtonSolver nonLinearSolver(assembler, linearSolver);

    // time loop
    timeLoop->start(); do
    {
        // set previous solution for storage evaluations
        assembler->setPreviousSolution(xOld);

        // linearize & solve
        nonLinearSolver.solve(x, *timeLoop);

        // make the new solution the old solution
        xOld = x;
        gridVariables->advanceTimeStep();

        // advance to the time loop to the next step
        timeLoop->advanceTimeStep();

        // write vtk output
        vtkWriter.write(timeLoop->time());

        // report statistics of this time step
        timeLoop->reportTimeStep();

        // set new dt as suggested by the newton solver
        
timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize()));

    } while (!timeLoop->finished());

    timeLoop->finalize(leafGridView.comm());

    ////////////////////////////////////////////////////////////
    // finalize, print dumux message to say goodbye
    ////////////////////////////////////////////////////////////

    // print dumux end message
    if (mpiHelper.rank() == 0)
    {
        Parameters::print();
        DumuxMessage::print(/*firstCall=*/false);
    }

    return 0;
} // end main
catch (Dumux::ParameterException &e)
{
    std::cerr << std::endl << e << " ---> Abort!" << std::endl;
    return 1;
}
catch (Dune::DGFException & e)
{
    std::cerr << "DGF exception thrown (" << e <<
                 "). Most likely, the DGF file name is wrong "
                 "or the DGF file is corrupted, "
                 "e.g. missing hash at end of file or wrong number (dimensions) 
of entries."
                 << " ---> Abort!" << std::endl;
    return 2;
}
catch (Dune::Exception &e)
{
    std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl;
    return 3;
}
catch (...)
{
    std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl;
    return 4;
}

Attachment: test_1pfv.input
Description: Binary data

_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to