ORNL-MDF / 3DThesis

Heat transfer code utilizing a nondimensionalized semi-analytic solution to moving heat sources with a 3D Gaussian power density
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

Meltpool Geometry Calculations #18

Closed JamieStumpORNL closed 2 weeks ago

JamieStumpORNL commented 3 weeks ago

improves meltpool geometry calculations

gknapp1 commented 3 weeks ago

I get a seg fault when I try to run this after building with CMake. Any thoughts on what could be causing it? Not obvious to me from looking at the source. Also, I did confirm that the same case ran on master.

CMake input:

cmake \
    -B build \
    -D CMAKE_INSTALL_PREFIX=install
    -D CMAKE_BUILD_TYPE=Debug
cmake --build build
cmake --install build

CMake output:

bash: cd: ./3DThesis: No such file or directory
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cloud/3DThesis/build
-D: command not found
[ 10%] Building CXX object src/CMakeFiles/Thesis.dir/Calc.cpp.o
[ 20%] Building CXX object src/CMakeFiles/Thesis.dir/Grid.cpp.o
[ 30%] Building CXX object src/CMakeFiles/Thesis.dir/Init.cpp.o
[ 40%] Building CXX object src/CMakeFiles/Thesis.dir/Melt.cpp.o
[ 50%] Building CXX object src/CMakeFiles/Thesis.dir/Out.cpp.o
[ 60%] Building CXX object src/CMakeFiles/Thesis.dir/Run.cpp.o
[ 70%] Building CXX object src/CMakeFiles/Thesis.dir/Util.cpp.o
[ 80%] Linking CXX static library libThesis.a
[ 80%] Built target Thesis
[ 90%] Building CXX object bin/CMakeFiles/3DThesis.dir/Main.cpp.o
[100%] Linking CXX executable 3DThesis
[100%] Built target 3DThesis
-- Install configuration: ""
-- Installing: /home/cloud/3DThesis/install/include/Calc.h
-- Installing: /home/cloud/3DThesis/install/include/DataStructs.h
-- Installing: /home/cloud/3DThesis/install/include/Grid.h
-- Installing: /home/cloud/3DThesis/install/include/Init.h
-- Installing: /home/cloud/3DThesis/install/include/Melt.h
-- Installing: /home/cloud/3DThesis/install/include/Out.h
-- Installing: /home/cloud/3DThesis/install/include/Run.h
-- Installing: /home/cloud/3DThesis/install/include/Util.h
-- Installing: /home/cloud/3DThesis/install/include/MpiStructs.h
-- Installing: /home/cloud/3DThesis/install/lib/libThesis.a
-- Installing: /home/cloud/3DThesis/install/bin/3DThesis
-- Set runtime path of "/home/cloud/3DThesis/install/bin/3DThesis" to ""

Error message:

Finished Reading ./ParamInput.txt
Finished Reading ../shared/Beam.1.txt
Finished Reading ../shared/Material.txt
Finished Reading ../shared/Path.1.txt
Finished Reading Mode.txt
Finished Reading ../shared/Domain.txt
Finished Reading Output.txt
Finished Reading ../shared/Settings.txt
[knapp-cpu:513780] *** Process received signal ***
[knapp-cpu:513780] Signal: Segmentation fault (11)
[knapp-cpu:513780] Signal code: Address not mapped (1)
[knapp-cpu:513780] Failing at address: 0x7f410851254e
[knapp-cpu:513780] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f411162d520]
[knapp-cpu:513780] [ 1] /home/cloud/3DThesis/tests/../install/bin/3DThesis(+0x3d9f0)[0x55b7aa65a9f0]
[knapp-cpu:513780] [ 2] /home/cloud/3DThesis/tests/../install/bin/3DThesis(+0x539b9)[0x55b7aa6709b9]
[knapp-cpu:513780] [ 3] /home/cloud/3DThesis/tests/../install/bin/3DThesis(+0x5322c)[0x55b7aa67022c]
[knapp-cpu:513780] [ 4] /home/cloud/3DThesis/tests/../install/bin/3DThesis(+0x39a2a)[0x55b7aa656a2a]
[knapp-cpu:513780] [ 5] /home/cloud/3DThesis/tests/../install/bin/3DThesis(+0x3889c)[0x55b7aa65589c]
[knapp-cpu:513780] [ 6] /home/cloud/3DThesis/tests/../install/bin/3DThesis(+0x362b1)[0x55b7aa6532b1]
[knapp-cpu:513780] [ 7] /home/cloud/3DThesis/tests/../install/bin/3DThesis(+0x16b82)[0x55b7aa633b82]
[knapp-cpu:513780] [ 8] /home/cloud/3DThesis/tests/../install/bin/3DThesis(+0xd520)[0x55b7aa62a520]
[knapp-cpu:513780] [ 9] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7f4111614d90]
[knapp-cpu:513780] [10] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7f4111614e40]
[knapp-cpu:513780] [11] /home/cloud/3DThesis/tests/../install/bin/3DThesis(+0xd425)[0x55b7aa62a425]
[knapp-cpu:513780] *** End of error message ***
JamieStumpORNL commented 2 weeks ago

Couldn't find problem

gknapp1 commented 2 weeks ago

Rebased on master and cherrypicked the commit that fixes the bounds from JamieChanges

gknapp1 commented 2 weeks ago

Still having an issue with a case when MP_Stats is enabled as the output. Simulations will run, but then crash near the end. It is dependent on the grid size, with the simulation only crashing when the grid size is decreased. It runs at 100 micro mesh size for a 7 mm x 3 mm x 0.1 mm domain, but crashes with a 50 micron mesh size.

Because of the mesh size dependency, I suspect it is a memory issue. The backtrace is below, it looks like it is happening in the neighbor search. Interestingly, this only happens when not using MPI and it doesn't crash when MPI is used.

Backtract:

#0  0x00005555555919f0 in Grid::get_i(int) ()
#1  0x00005555555a79b9 in Melt::local_neighbor_check(std::vector<int, std::allocator<int> >&, std::vector<int, std::allocator<int> >&, Grid&, Simdat const&) ()
#2  0x00005555555a722c in Melt::calc_mp_info(std::vector<int, std::allocator<int> > const&, Grid&, Simdat const&, double) ()
#3  0x000055555558da2a in Run::Solidify_Surface(Grid&, Simdat const&) ()
#4  0x000055555558c89c in Run::Solidify(Grid&, Simdat const&) ()
#5  0x000055555558a2b1 in Run::Simulate(Grid&, Simdat const&) ()
#6  0x000055555556ab82 in run(int, char**) ()
#7  0x0000555555561520 in main ()