olb1.6 bifurcation3d
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › olb1.6 bifurcation3d
- This topic has 8 replies, 2 voices, and was last updated 10 months, 1 week ago by Fuxin He.
-
AuthorPosts
-
November 6, 2023 at 11:06 am #7889Fuxin HeParticipant
Dear OpenLB Developers,
I compiled bifurcation3d under /olb-1.6r0/examples/particles/bifurcation3d/eulerLagrange with “make”, but it still can’t run successfully, why?
hfx123@ubuntu:~/olb-1.6r01/examples/particles/bifurcation3d/eulerLagrange$ mpirun -np 8 ./bifurcation3d
ERROR: Subgrid particles can only be used with MPI!
ERROR: Subgrid particles can only be used with MPI!
ERROR: Subgrid particles can only be used with MPI!
ERROR: Subgrid particles can only be used with MPI!
ERROR: Subgrid particles can only be used with MPI!
ERROR: Subgrid particles can only be used with MPI!
[ThreadPool] Sucessfully initialized, numThreads=1
[ThreadPool] Sucessfully initialized, numThreads=1
[ThreadPool] Sucessfully initialized, numThreads=1
[ThreadPool] Sucessfully initialized, numThreads=1
[ThreadPool] Sucessfully initialized, numThreads=1
[ThreadPool] Sucessfully initialized, numThreads=1ERROR: Subgrid particles can only be used with MPI!
[ThreadPool] Sucessfully initialized, numThreads=1
[ThreadPool] Sucessfully initialized, numThreads=1ERROR: Subgrid particles can only be used with MPI!
Best,
Fuxin HeNovember 6, 2023 at 11:48 am #7891AdrianKeymasterThe explanation is right there in the output you shared:
ERROR: Subgrid particles can only be used with MPI!
You need to compile this example using MPI as the inter-block communication of subgrid particles requires MPI.
November 6, 2023 at 2:41 pm #7894Fuxin HeParticipantDear Adrian
Thanks for your reply, but I still haven’t solved him. Do you mean I should compile in parallel instead of “make”? What should I type then, how can I solve it like this?
hfx123@ubuntu:~/olb-1.6r0/examples/particles/bifurcation3d/eulerLagrange$ mpicxx -O3 -o bifurcation3d bifurcation3d.cpp -I/home/hfx123/olb-1.6r0/src -std=c++17
/usr/bin/ld: /tmp/ccDEk7NO.o: in function `olb::createParallelFileName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool)’:
bifurcation3d.cpp:(.text+0x7480): undefined reference to `olb::singleton::mpi()’
/usr/bin/ld: bifurcation3d.cpp:(.text+0x7557): undefined reference to `olb::singleton::mpi()’
/usr/bin/ld: bifurcation3d.cpp:(.text+0x75ae): undefined reference to `olb::singleton::mpi()’
/usr/bin/ld: /tmp/ccDEk7NO.o: in function `olb::SuperParticleSystem3D<double, olb::MagneticParticle3D>::addParticle(olb::IndicatorF3D<double>&, double, double, int, int, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, double, int)’:I’m looking at “run.sh” and I know that if I compile successfully, I should type”mpirun -np 8 ./bifurcation3d 19 1000″.I hope you can tell me how to compile and run it, because I really don’t know much about parallelism!
Best,
Fuxin HeNovember 6, 2023 at 3:01 pm #7895AdrianKeymasterNo, you need to activate MPI in the config file (you would need to do so also for other cases as you seemingly want to run using MPI anyway, this is why you currently see all messages multiple times in your listing)
You can check out the user guide, especially section “10.9. Lesson 9: Run Your Programs on a Parallel Machine” for more information on how to do this.
November 6, 2023 at 3:54 pm #7898Fuxin HeParticipantDear Adrian
I followed this section to the file named config.mk, typed make clean and make cleanbuild in the terminal, and it still didn’t compile,Can you tell me how to compile in parallel, I’d appreciate it!
Best,
Fuxin HeNovember 8, 2023 at 11:40 am #7908AdrianKeymasterSo did you actually change any values in
config.mk
? (As described in the user guide)Without further information (the actual logs instead of “still didn’t compile” for a start) I won’t be able to help you further.
At this basic level OpenLB is a straight forward MPI application without any special requirements compared to any other MPI program.
November 8, 2023 at 2:16 pm #7910Fuxin HeParticipantDear Adrian
Thanks for your patience in replying, I have changed the config.mk file already as follows:
# Compiler to use for C++ files, change to
mpic++
when using OpenMPI and GCC
# CXX := g++
CXX :=mpic++
# Compiler to use for C files (used for emebedded dependencies)
CC := gcc# Suggested optimized build flags for GCC, consult
config/
for further examples
CXXFLAGS := -O3 -Wall -march=native -mtune=native
# Uncomment to add debug symbols and enable runtime asserts
#CXXFLAGS += -g -DOLB_DEBUG# OpenLB requires support for C++17
# works in:
# * gcc 9 or later (https://gcc.gnu.org/projects/cxx-status.html#cxx17)
# * icc 19.0 or later (https://software.intel.com/en-us/articles/c17-features-supported-by-intel-c-compiler)
# * clang 7 or later (https://clang.llvm.org/cxx_status.html#cxx17)
CXXFLAGS += -std=c++17# optional linker flags
LDFLAGS :=# Parallelization mode, must be one of: OFF, MPI, OMP, HYBRID
# Note that for MPI and HYBRID the compiler also needs to be adapted.
# See e.g.config/cpu_gcc_openmpi.mk
# PARALLEL_MODE := OFF
PARALLEL_MODE := MPIThen it will report the following error
https://postimg.cc/gallery/dqGGBFVMy guess from reading chapter 9 is that I don’t have CUDA installed, which is why running “ompi_info –parsable -l 9 –all | grep mpi_built_with_cuda_support:value” results in false.
Best,
Fuxin HeNovember 8, 2023 at 2:35 pm #7911AdrianKeymasterNo, the lack of CUDA-awareness in MPI (this is what the command checks) has no impact here as you have not activated the GPU_CUDA platform (weirdly the PLATFORMS list is missing from your config, is this truly the full file?)
Per your screenshot the issue is only that you did not recompile the core library after changing the config. Calling
make clean-core
followed bymake
should fix the linker error.November 8, 2023 at 2:49 pm #7912Fuxin HeParticipantDear Adrian
That’s great! Your “make clean-core” is the key to the problem, and that’s something a newbie like me really doesn’t know, thanks again for your help.
Best,
Fuxin He -
AuthorPosts
- You must be logged in to reply to this topic.