Skip to content

mpi running does not work

  • This topic has 2 replies, 2 voices, and was last updated 5 years ago by Kai.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1928
    Kai
    Member

    Hi, I am new to openLB and trying to run some examples with openlb in parallel, while I could not get the parallel running work. I am posting to wonder if someone can tell if I did something wrong. Thanks.

    After compiling with mpi, when running with mpirun, numThreads is always 1, the mpi version is mpich 3.1.3, the openLB version is 1.1r0.

    The following is the output with mpirun -np 3 ./rayleighTaylor2d, which looks like a mpirun a serial code.

    [MpiManager] Sucessfully initialized, numThreads=1
    [Directories] Directory ./tmp/ created.
    [Directories] Directory ./tmp/imageData/ created.
    [Directories] Directory ./tmp/vtkData/ created.
    [Directories] Directory ./tmp/vtkData/data/ created.
    [Directories] Directory ./tmp/gnuplotData/ created.
    [Directories] Directory ./tmp/gnuplotData/data/ created.
    [MpiManager] Sucessfully initialized, numThreads=1
    [MpiManager] Sucessfully initialized, numThreads=1
    [prepareGeometry] Prepare Geometry …
    [prepareGeometry] Prepare Geometry …
    [prepareGeometry] Prepare Geometry …
    [SuperGeometry2D] cleaned 0 inner boundary voxel(s)
    [SuperGeometry2D] the model is correct!
    [CuboidGeometry2D] —Cuboid Stucture Statistics—
    [CuboidGeometry2D] Number of Cuboids: 1
    [CuboidGeometry2D] Delta (min): 1
    [CuboidGeometry2D] (max): 1
    [CuboidGeometry2D] Ratio (min): 1
    [CuboidGeometry2D] (max): 2
    [CuboidGeometry2D] Nodes (min): 80000
    [CuboidGeometry2D] (max): 80000
    [CuboidGeometry2D]


    [SuperGeometry2D] cleaned 0 inner boundary voxel(s)
    [SuperGeometry2D] cleaned 0 inner boundary voxel(s)
    [SuperGeometry2D] the model is correct!
    [CuboidGeometry2D] —Cuboid Stucture Statistics—
    [CuboidGeometry2D] Number of Cuboids: 1
    [CuboidGeometry2D] Delta (min): 1
    [CuboidGeometry2D] (max): 1
    [CuboidGeometry2D] Ratio (min): 1
    [CuboidGeometry2D] (max): 2
    [CuboidGeometry2D] Nodes (min): 80000
    [CuboidGeometry2D] (max): 80000
    [CuboidGeometry2D]


    [SuperGeometry2D] the model is correct!
    [CuboidGeometry2D] —Cuboid Stucture Statistics—
    [CuboidGeometry2D] Number of Cuboids: 1
    [CuboidGeometry2D] Delta (min): 1
    [CuboidGeometry2D] (max): 1
    [CuboidGeometry2D] Ratio (min): 1
    [CuboidGeometry2D] (max): 2
    [CuboidGeometry2D] Nodes (min): 80000
    [CuboidGeometry2D] (max): 80000
    [CuboidGeometry2D]


    [SuperGeometryStatistics2D] updated
    [SuperGeometryStatistics2D] materialNumber=1; count=39600; minPhysR=(0,1); maxPhysR=(399,99)
    [SuperGeometryStatistics2D] materialNumber=2; count=39600; minPhysR=(0,100); maxPhysR=(399,198)
    [SuperGeometryStatistics2D] materialNumber=3; count=400; minPhysR=(0,0); maxPhysR=(399,0)
    [SuperGeometryStatistics2D] materialNumber=4; count=400; minPhysR=(0,199); maxPhysR=(399,199)
    [prepareGeometry] Prepare Geometry … OK
    [SuperGeometryStatistics2D] updated
    [SuperGeometryStatistics2D] materialNumber=1; count=39600; minPhysR=(0,1); maxPhysR=(399,99)
    [SuperGeometryStatistics2D] materialNumber=2; count=39600; minPhysR=(0,100); maxPhysR=(399,198)
    [SuperGeometryStatistics2D] materialNumber=3; count=400; minPhysR=(0,0); maxPhysR=(399,0)
    [SuperGeometryStatistics2D] materialNumber=4; count=400; minPhysR=(0,199); maxPhysR=(399,199)
    [prepareGeometry] Prepare Geometry … OK
    [SuperGeometryStatistics2D] updated
    [SuperGeometryStatistics2D] materialNumber=1; count=39600; minPhysR=(0,1); maxPhysR=(399,99)
    [SuperGeometryStatistics2D] materialNumber=2; count=39600; minPhysR=(0,100); maxPhysR=(399,198)
    [SuperGeometryStatistics2D] materialNumber=3; count=400; minPhysR=(0,0); maxPhysR=(399,0)
    [SuperGeometryStatistics2D] materialNumber=4; count=400; minPhysR=(0,199); maxPhysR=(399,199)
    ….

    This is the Makefine.inc

    21
    22 ###########################################################################
    23 ###########################################################################
    24 ## DEFINITIONS TO BE CHANGED
    25
    26 CXX := g++
    27 #CXX := icpc -D__aligned__=ignored
    28 #CXX := mpiCC
    29 CXX := mpic++
    30
    31 CC := gcc # necessary for zlib, for Intel use icc
    32
    33 OPTIM := -O3 -Wall -march=native -mtune=native # for gcc
    34 #OPTIM := -O3 -Wall -xHost # for Intel compiler
    35 DEBUG := -g -DOLB_DEBUG
    36
    37 #CXXFLAGS := $(OPTIM)
    38 CXXFLAGS := $(DEBUG)
    39
    40 # to enable std::shared_ptr in functor arithmetik
    41 # works in gcc 4.3 and later, source https://gcc.gnu.org/projects/cxx0x.html
    42 CXXFLAGS += -std=c++0x
    43 # works in gcc 4.7 and later (recommended)
    44 #CXXFLAGS += -std=c++11
    45
    46 #CXXFLAGS += -fdiagnostics-color=auto
    47 #CXXFLAGS += -std=gnu++14
    48
    49 ARPRG := ar
    50 #ARPRG := xiar # mandatory for intel compiler
    51
    52 LDFLAGS :=
    53
    54 PARALLEL_MODE := OFF
    55 PARALLEL_MODE := MPI
    56 #PARALLEL_MODE := OMP
    57 #PARALLEL_MODE := HYBRID
    58
    59 MPIFLAGS :=
    60 OMPFLAGS := -fopenmp
    61
    62 #BUILDTYPE := precompiled
    63 BUILDTYPE := generic

    #2680
    mathias
    Keymaster

    It seems to me that you did not compile the code in parallel. You may try 1/ make cleanbuild, 2/ make clean, 3/make. And then try again. Best Mathias

    #2682
    Kai
    Member

    Hi, I found the reason now. There are more than one mpi installation in my machine. I used mpirun and mpic++ from different installations (maybe more things were messed up). Now it works fine.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.