Yihao-Shi / GeoTaichi

A Taichi-powered high-performance numerical simulator for multiscale and multifield geophysical problems
GNU General Public License v3.0
93 stars 10 forks source link

different result with same example #9

Open commatrixs opened 4 months ago

commatrixs commented 4 months ago

hello,

Thanks for your sharing! It is a very useful package. But i encounter a problem when I try to run the mpm example 'NewtonianFluid.py'. I ran this example two times (just change gpu and memory). The results in 0.8s are similar while the results in 1.6s are different. I do not think this example involves random numbers. Is the reason for the different results related to the initialization of the GPU in Taichi

best regards,

Yihao-Shi commented 4 months ago

Could you please give more details, like your input python scripts or some snapshots

commatrixs commented 4 months ago

Could you please give more details, like your input python scripts or some snapshots

Yeah. Attached are related files: NewtonianFluid.py is the input script which I just added the code to allocate gpu memory. And I commented out some output in the Recorder.py, to make the output file smaller. Particle position and velocity can be obtained by npz file according to Recorder.py. Then I use particle_compare.py to calculate the max difference between two simulation results. I find the max position and velocity difference is of the order of 0.1. file.zip

commatrixs commented 4 months ago

@Yihao-Shi hi yihao, did you encounter similar situation? Or is there something wrong with my modificaiton?

Yihao-Shi commented 4 months ago

hello, @commatrixs , following the files you provided, is that means you only change the gpu memory in the Python scripts. If so, it is quiet normal when using GPU from my own opinion. How about using the same parameters and running it twice times. If the difference between these two simulations still exists, please let me know.

Yihao-Shi commented 4 months ago

@Yihao-Shi hi yihao, did you encounter similar situation? Or is there something wrong with my modificaiton?

Notice there is only one Python script in file.zip. If you could provide specific Python scripts for these two conditions, I would be able to reproduce the situations you mentioned. Otherwise, it will be difficult for me to determine the exact parameters used in your simluations.

commatrixs commented 4 months ago

hello, @commatrixs , following the files you provided, is that means you only change the gpu memory in the Python scripts. If so, it is quiet normal when using GPU from my own opinion. How about using the same parameters and running it twice times. If the difference between these two simulations still exists, please let me know. @Yihao-Shi hi, yihao, i try to run same script and find the results are still different especially in velocity field. Attached is the input file and two particle distribution and their velocity at 2.4s in different simulation. i think the velocity difference may be caused by particles that are separated from the main body of the liquid, but the overall shape of the liquid also seems to be a little different. file.zip