MFlowCode / MFC

Exascale simulation of multiphase/physics fluid dynamics
https://mflowcode.github.io
MIT License
132 stars 58 forks source link

Use floating point division for benchmarking #393

Closed sbryngelson closed 1 month ago

sbryngelson commented 3 months ago

Right now benchmarking recording input and outupt time in full seconds, resulting in weird numbers when the numbers are close or the same.

We can fix this by modifying the files something like https://github.com/MFlowCode/MFC/blob/master/toolchain/templates/include/helpers.mako replace date +%s with date +%s%n, which gives the time in nanoseconds (integer) (note this doesn't work on MacOS, but that's fine).

We also want to switch the elapsed output time to be in seconds not nanoseconds so:

https://github.com/MFlowCode/MFC/blob/e3c4a067e410c308e6c53c0eaa722bde0c8f44ba/toolchain/templates/include/helpers.mako#L89

should be

$(echo "($t_${target.name}_stop - $t_${target.name}_start)/1000000000" | bc -l)

I haven't tested this yet.

sbryngelson commented 2 months ago

Update: Fixing this issue would surely fix the "divide by zero" error

sbryngelson commented 1 month ago

Was closed by #423