-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Successfully Running **ck_version** and **sycl_version** of Soil Mechanics #715
base: master
Are you sure you want to change the base?
Conversation
@Xiangyu-Hu Thank you again for your support during the holiday season, and I wish you a Merry Christmas! |
@ShuangLi-1 Linux (g++) build is quite strict, and requires even no warning message. You can try to build using g++ locally first. |
…rors where the initialization order is different from the definition order
|
I have modified the code to avoid the issue where the initialization order of variables differs from the definition order, as mentioned in the error message in this PR. Locally, I can successfully compile and run Perhaps further testing can be performed. |
<< interval_computing_time_step.seconds() << "\n"; | ||
std::cout << std::fixed << std::setprecision(9) << "interval_updating_configuration = " | ||
<< interval_updating_configuration.seconds() << "\n"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need have a regression test like
SPHinXsys/tests/2d_examples/test_2d_column_collapse/column_collapse.cpp
Lines 223 to 230 in a2df28d
if (sph_system.GenerateRegressionData()) | |
{ | |
write_mechanical_energy.generateDataBase(1.0e-3); | |
} | |
else if (sph_system.RestartStep() == 0) | |
{ | |
write_mechanical_energy.testResult(); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added it and pushed it. But I don't know how to test it on my own computer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to copy the data files to here from the CPU version of this case.
tests/2d_examples/test_2d_column_collapse/regression_test_tool
So that the regression test can be carried out automatically when you run the case.
(1) I am testing the efficiency of the GPU version of Soil Dynamics.The platform I am using is Ubuntu 20.04,
CUDA Version: 12.2 (2) I performed tests on the 2D example
|
Threads | Computation Time (s) |
---|---|
128 | 46.0 |
64 | 29.7 |
32 | 33.6 |
16 | 45.2 |
GPU Version:
- No pre-set threads: computation time = 72.0s
Considering the hardware differences, the GPU computation is relatively more efficient.
(3) For further efficiency testing, I modified the 3D example 3d_repose_angle
for both CK and SYCL versions.
Currently, the CK version runs and tests normally, but the SYCL version throws the following error:
”
[build] [100%] Linking CXX executable bin/test_3d_repose_angle_sycl
[build] fatal error: error in backend: Cannot select: 0x5ebe70bdb9c0: f64 = fsin nnan ninf nsz arcp contract afn reassoc 0x5ebe702d0cb0
[build] 0x5ebe702d0cb0: f64,ch = CopyFromReg 0x5ebe70a36190, Register:f64 %10
[build] 0x5ebe70bdb870: f64 = Register %10
[build] In function: ZTSZZN3SPH12particle_forINS_7SPHBodyEZNS_21InteractionDynamicsCKIJNS_9execution20ParallelDevicePolicyENS_4BaseENS_18continuum_dynamics17StressDiffusionCKIJNS_5InnerIJEEEEEEEE14runInteractionEfEUlmE_EEvRKNS_11LoopRangeCKIJS4_T_EEERKT0_ENKUlRN4sycl3_V17handlerEE_clESO_EUlNSM_7nd_itemILi1EEEE
[build] llvm-foreach:
[build] icpx: error: clang frontend command failed with exit code 70 (use -v to see invocation)
[build] Intel(R) oneAPI DPC++/C++ Compiler 2024.0.0 (2024.0.0.20231017)
[build] Target: x86_64-unknown-linux-gnu
[build] Thread model: posix
[build] InstalledDir: /opt/intel/oneapi/compiler/2024.0/bin/compiler
[build] Configuration file: /opt/intel/oneapi/compiler/2024.0/bin/compiler/../icpx.cfg
[build] icpx: note: diagnostic msg: Error generating preprocessed source(s).
[build] gmake[3]: *** [tests/tests_sycl/3d_examples/test_3d_repose_angle_sycl/CMakeFiles/test_3d_repose_angle_sycl.dir/build.make:115:tests/tests_sycl/3d_examples/test_3d_repose_angle_sycl/bin/test_3d_repose_angle_sycl] 错误 1
[build] gmake[2]: *** [CMakeFiles/Makefile2:5872:tests/tests_sycl/3d_examples/test_3d_repose_angle_sycl/CMakeFiles/test_3d_repose_angle_sycl.dir/all] 错误 2
[build] gmake[1]: *** [CMakeFiles/Makefile2:5879:tests/tests_sycl/3d_examples/test_3d_repose_angle_sycl/CMakeFiles/test_3d_repose_angle_sycl.dir/rule] 错误 2
[build] gmake: *** [Makefile:1474:test_3d_repose_angle_sycl] 错误 2
[proc] The command: /usr/local/bin/cmake --build /home/li/Myfork/SPHinXsys-GPU_soil/build --parallel 130 --target test_3d_repose_angle_sycl -- exited with code: 2
[driver] Build completed: 00:00:54.286
[build] Build finished with exit code 2
“
From my research, the issue seems to be related to the inability of the sin()
function to handle double precision calculations, but I have not yet found a solution.
I would like to ask for your suggestions on how to address this issue.
First, I think performance test needs at least million particles, 5000 particles gives nothing meaningful. |
@ShuangLi-1 you can refer a solution from: https://chatgpt.com by input the follows.
The namespace alias can be used here: SPHinXsys/src/shared/common/base_data_type.h Lines 56 to 62 in b8b20f2
in case chatgpt is not accessible, you can use https://chat.deepseek.com, the answer is almost the same. |
Based on your previous guidance, I have re-debugged and corrected the ck_version and sycl_version of the soil mechanics module.
The issue was caused by a division by zero in the constitutive equation calculations, which I have now fixed. Thanks for your guidance.
Additionally, I have created two cases:
On my computer, these cases can run successfully in Release mode, and the GPU is being utilized correctly. Please check them at your convenience.
Supplementary Notes
Simulation Results and GPU Utilization
Figure 1: GPU utilization during computation.
Figure 2: Simulation results.