Acknowledgement: This software release is made possible with the funding support from the NIH/NIGMS under grant R01-GM114365.
MMC v2020 (1.9) is a major update to MMC. For the first time, MMC adds GPU support via the newly implemented OpenCL version. The released package simultaneously supports CPU-only multi-threading with SSE4 (standard MMC) and OpenCL-based MMC on a wide variety of CPU/GPU devices across vendors. Using up-to-date GPU hardware, the MMC simulation speed was increased by 100x to 400x compared to single-threaded SSE4-based MMC simulation. The detailed description of the GPU accelerated MMC can be found in the below paper [Fang2019].
One can choose between the SSE4 and OpenCL based simulation modes using
cfg.gpuid input options. A device ID of -1 enables SSE4 CPU based
MMC, and a number 1 or above chooses the supported OpenCL device (using
mmc -L or
mmclab('gpuinfo') to list).
To highlight a few most important updates:
octave-mmclabofficial Fedora packages and disseminate via Fedora repositories
xorshift128+RNG unit and used as default for both CPU/GPU MMC
B1:cube60, B1D:d-cube60, B2:sphshells, B2D:d-sphshells, B3:colin27, B4:skin-vessel) for comparisons
Please file bug reports to https://github.com/fangq/mmc/issues
Moreover, over the past year, we have also published a high-quality brain
3D mesh generation pipeline and rigorously compared
mmc with voxel based
MCX, and showed improvement in modeling accuracy. The detail of the mesh
generation software (Brain2mesh: http://mcx.space/brian2mesh) and the
benchmarks can be found in the below [Brain2Mesh2020] paper.
Lastly, we also implemented the photon sharing algorithm to simultaneously simulate multiple pattern sources. This paper is detailed in the recently published OL paper, see [Yan2020].
Mesh-based Monte Carlo (MMC) is a 3D Monte Carlo (MC) simulation software for photon transport in complex turbid media. MMC combines the strengths of the MC-based technique and the finite-element (FE) method: on the one hand, it can handle general media, including low-scattering ones, as in the MC method; on the other hand, it can use an FE-like tetrahedral mesh to represent curved boundaries and complex structures, making it even more accurate, flexible, and memory efficient. MMC uses the state-of-the-art ray-tracing techniques to simulate photon propagation in a mesh space. It has been extensively optimized for excellent computational efficiency and portability. MMC currently supports multi-threaded parallel computing via OpenMP, Single Instruction Multiple Data (SIMD) parallism via SSE and, starting from v2020, OpenCL to support a wide range of CPUs/GPUs from nearly all vendors.
MMCLAB is the MATLAB mex version of the MMC software. It can be directly called inside MATLAB. This makes it easy to use with streamlined pre-processing (mesh generation using the Iso2Mesh toolbox) and post processing (visualization and data analysis).
Although MMC/MMCLAB can be executed independently if all input data (including mesh data) are provided, most pre- and post-processing scripts in both packages require the installation of Iso2Mesh Toolbox - a MATLAB based 3D mesh generator. Please browse http://iso2mesh.sf.net for download and installation information.
By default, MMC/MMCLAB uses OpenCL-based simulations to utilize
all GPUs and CPUs installed on your system. If you have a GPU
(NVIDIA, AMD or Inel), the OpenCL support is typically installed
if you have correctly installed the latest version of the graphics
driver. Please verify that the OpenCL library (
libOpenCL.so* on Linux,
OpenCL.dll on Windows or
on the Mac) must exist in your system.
Generally speaking, AMD and NVIDIA high-end dedicated GPU performs the best, about 20-60x faster than a multi-core CPU; Intel's integrated GPU is about 3-4 times faster than a multi-core CPU.
In addition, MMC has been fully tested with the open-source OpenCL runtime
pocl (http://portablecl.org/) on the CPU. To install
pocl on a Ubuntu/Debian
system, please run
sudo apt-get install pocl-opencl-icd
If you happen to use a system that does not have OpenCL support, you may
still use MMC/MMCLAB by calling it in the CPU-only SSE4 mode, with
-G -1 or
cfg.gpuid=-1. To verify your CPU supports SSE4, please run
grep 'sse4' /proc/cpuinfo
or using a freeware "CPU-Z" on windows. If you attempt to run the SSE4 on an unsupported computer, you will get an error when executing the binary. In that case, you should recompile MMC using "make omp" command.