[Critical bug fix] mcx/mcxcl diffuse reflectance output when using pattern/pattern3d sources

104 views
Skip to first unread message

Fang, Qianqian

unread,
Aug 5, 2020, 5:37:42 PM8/5/20
to mcx-users, mmc-...@googlegroups.com

hi everyone,

My student Rahul Ragunathan found a bug in mcx's diffuse reflectance output when using a pattern or pattern3d source. I was able to fix this bug yesterday

https://github.com/fangq/mcx/commit/c04bff5d9a81c76fde688746fbbdae1ab4be9d7a


What versions are affected:

 - mcx and mcxcl released since March 2019 (v2019.3, v2019.4 and nightly-build)

 - earlier releases are not affected


What features are affected:

 - this bug affects all diffuse reflectance outputs (fluence.dref) with a single pattern/pattern3d source with non-binary pattern data

 - this bug does not affect other output and source types


What happened:

 - as part of the new feature - "photon sharing" - for simultaneous simulations of multiple pattern sources (detailed in this OL paper), we changed the way in handling initial weights of a photon when multiple patterns are used. However, when a single pattern is used, a detected photon's weight is mistakenly multiplied by its initial weight (needed for photon sharing) before saving to the dref output. This means that a photon's initial weight is double counted (once at launch, once at detection), resulting in lower dref intensities.


What to do:

 - if anyone is running simulations using the combination of a single pattern and dref output, you MUST rerun your simulations using the updated nightly build binaries to avoid incorrect results.

 - for other users, I strongly recommend you to also update your mcx/mcxcl to the latest version - I am working on creating a new release (v2020) and hopefully make an announcement shortly.


Feature preview: MCX speed contest (standalone)

 - you might have seen http://mcx.space/gpubench and http://mcx.space/computebench/ for benchmarking your GPUs/CPUs using mcx and mcxcl. Previously, to share your benchmark results, you need to run matlab and the mcx_gpu_contest.m script. In the past week, I wrote a new script to allow one to run/compare/submit your benchmark results in a command line without needing matlab. Please download the nightly build and run the speedcontest/mcxcontest.pl script. Should work out-of-box on Linux and Mac. On Windows, you need to install either Cygwin64 or MSYS2 where perl/curl commands are supported.

Please let me know if you see any issue running this script.


cheers


Qianqian



Fang, Qianqian

unread,
Aug 5, 2020, 8:54:56 PM8/5/20
to mcx-users, mmc-...@googlegroups.com
Forgot to mention, for the new mcx speed benchmark script, a screenshot of the interface can be found in this recent tweet


you can specify how many photons to run (-n), which GPU(s) to use (-G) and their workload split (-W) with the mcxcontest.pl script, similar to mcx/mcxcl flags. For CPUs and less powerful GPUs, you are recommended to start with a small photon number, such as '-n 1e6', to get a feel how long it takes to finish the benchmarks - in general, the more photon you run, the higher the score (but will plateau at some point).

the 3 benchmarks (cube60, cube60b, cube60planar) executed in this script are now built-in. You may run `mcx --bench` or `mcxcl --bench` to list all built-in benchmarks, and add `--dumpjson` flag to output the full json input data, including self-contained volume/shape data. I will be happy to include more built-in benchmarks if you have something interesting to share. the currently supported builtin benchmarks can be found in this unit:


Qianqian
Reply all
Reply to author
Forward
0 new messages