mmc

Mesh-based Monte Carlo (MMC)
授权协议 View license
开发语言
所属分类 应用工具、 科研计算工具
软件类型 开源软件
地区 不详
投 递 者 乜思淼
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Mesh-based Monte Carlo (MMC) - SSE4 and OpenCL

  • Author: Qianqian Fang (q.fang at neu.edu)
  • License: GNU General Public License version 3 (GPL v3), see License.txt
  • Version: 1.9.5 (v2021.2, Moon Cake - RC1)
  • URL: http://mcx.space/mmc

Table of Content:

What's New

MMC v2021.2 (1.9.5) includes a major feature upgrade - implicit MMC (iMMC) - toenable simulations of highly complex anatomical structures. The details of theiMMC algorithm, developed by Yaoshen Yuan, are described in his recent paper[Yuan2021]. Briefly, iMMC permits one to associate cylindrical inclusions,spherical inclusions, and thin-membrane with the edges, vertices and faces,respectively, in a tetrahedral mesh. Currently, this feature is only supportedon the CPU (must be used with -G -1 or cfg.gpuid=-1).

A detailed (long) list of updates can be found in the ChangeLog.txt or theGithub commit history: https://github.com/fangq/mmc/commits/master

To highlight a few most important updates:

  • Support iMMC (edge-, node- and face-based implicit structures), CPU only (by Yaoshen Yuan)
  • Added MMCLAB examples for iMMC, including a large dense vessel network (by Yaoshen Yuan)
  • Added C++Builder (Community Edition) project file for compilation on Windows
  • Added Windows GNU Octave mex file for MMCLAB
  • Photon-sharing is now supported in the GPU code (by Shijie Yan)
  • Several critical bug fixes (by Shijie Yan)

Please file bug reports to https://github.com/fangq/mmc/issues

Reference:

[Yuan2021] Yaoshen Yuan, Shijie Yan, and Qianqian Fang*,"Light transport modeling in highly complex tissues using the implicitmesh-based Monte Carlo algorithm," Biomed. Optics Express, 12(1),147-161, (2021), URL: https://www.osapublishing.org/boe/fulltext.cfm?uri=boe-12-1-147

Introduction

Mesh-based Monte Carlo (MMC) is a 3D Monte Carlo (MC) simulation software forphoton transport in complex turbid media. MMC combines the strengths of theMC-based technique and the finite-element (FE) method: on the one hand, it canhandle general media, including low-scattering ones, as in the MC method; onthe other hand, it can use an FE-like tetrahedral mesh to represent curvedboundaries and complex structures, making it even more accurate, flexible, andmemory efficient. MMC uses the state-of-the-art ray-tracing techniques tosimulate photon propagation in a mesh space. It has been extensively optimizedfor excellent computational efficiency and portability. MMC currently supportsmulti-threaded parallel computing via OpenMP, Single Instruction Multiple Data(SIMD) parallism via SSE and, starting from v2019.10, OpenCL to support a widerange of CPUs/GPUs from nearly all vendors.

To run an MMC simulation, one has to prepare an FE mesh first to discretize theproblem domain. Image-based 3D mesh generation has been a very challenging taskonly until recently. One can now use a powerful yet easy-to-use mesh generator,iso2mesh [1], to make tetrahedral meshes directly from volumetric medicalimages. You should download and install the latest iso2mesh toolbox in order torun the build-in examples in MMC.

We are working on a massively-parallel version of MMC by porting this code toCUDA and OpenCL. This is expected to produce a hundred- or even thousand-foldacceleration in speed similar to what we have observed in our GPU-acceleratedMonte Carlo software (Monte Carlo eXtreme, or MCX [2]).

The most relevant publication describing this work is the GPU-accelerated MMCpaper:

Qianqian Fang and Shijie Yan, “GPU-accelerated mesh-based Monte Carlo photontransport simulations,” J. of Biomedical Optics, 24(11), 115002 (2019)URL: http://dx.doi.org/10.1117/1.JBO.24.11.115002

Please keep in mind that MMC is only a partial implementation of the generalMesh-based Monte Carlo Method (MMCM). The limitations and issues you observedin the current software will likely be removed in the future version of thesoftware. If you plan to perform comparison studies with other works, pleasecommunicate with the software author to make sure you have correctly understoodthe details of the implementation.

The details of MMCM can be found in the following paper:

Qianqian Fang, “Mesh-based Monte Carlo method using fast ray-tracing inPlücker coordinates,” Biomed. Opt. Express 1, 165-175 (2010) URL:https://www.osapublishing.org/boe/abstract.cfm?uri=boe-1-1-165

While the original MMC paper was based on the Plücker coordinates, a number ofmore efficient SIMD-based ray-tracers, namely, Havel SSE4 ray-tracer, BadouelSSE ray-tracer and branchless-Badouel SSE ray-tracer (fastest) have been addedsince 2011. These methods can be selected by the -M flag. The details of thesemethods can be found in the below paper

Qianqian Fang and David R. Kaeli, “Accelerating mesh-based Monte Carlo methodon modern CPU architectures,” Biomed. Opt. Express 3(12), 3223-3230 (2012)URL: https://www.osapublishing.org/boe/abstract.cfm?uri=boe-3-12-3223

and their key differences compared to another mesh-based MC simulator, TIM-OS,are discussed in

Qianqian Fang, “Comment on 'A study on tetrahedron-based inhomogeneousMonte-Carlo optical simulation',” Biomed. Opt. Express, vol. 2(5) 1258-1264, (2011)URL: https://www.osapublishing.org/boe/abstract.cfm?uri=boe-2-5-1258

In addition, the generalized MMC algorithm for wide-field sources and detectorsare described in the following paper, and was made possible with thecollaboration with Ruoyang Yao and Prof. Xavier Intes from RPI

Yao R, Intes X, Fang Q, “Generalized mesh-based Monte Carlo for wide-fieldillumination and detection via mesh retessellation,” Biomed. Optics Express,7(1), 171-184 (2016) URL:https://www.osapublishing.org/boe/abstract.cfm?uri=boe-7-1-171

In addition, we have been developing a fast approach to build the Jacobianmatrix for solving inverse problems. The technique is called “photonreplay”, and is described in details in the below paper:

Yao R, Intes X, Fang Q, “A direct approach to compute Jacobians for diffuseoptical tomography using perturbation Monte Carlo-based photon 'replay',”Biomed. Optics Express, in press, (2018)

In 2019, we published an improved MMC algorithm, named “dual-grid MMC”, orDMMC, in the below JBO Letter. This method allows to use separate mesh forray-tracing and fluence storage, and can be 2 to 3 fold faster than theoriginal MMC without loss of accuracy.

Shijie Yan, Anh Phong Tran, Qianqian Fang, “A dual-grid mesh-based MonteCarlo algorithm for efficient photon1transport simulations in complex 3-Dmedia,” J. of Biomedical Optics, 24(2), 020503 (2019).

The authors of the papers are greatly appreciated if you can cite the abovepapers as references if you use MMC and related software in your publication.

Download and Compile MMC

The latest release of MMC can be downloaded from the following URL:

http://mcx.space/#mmc

The development branch (not fully tested) of the code can be accessed usingGit. However this is not encouraged unless you are a developer. To check outthe Git source code, you should use the following command:

  git clone https://github.com/fangq/mmc.git

To compile the software, you need to install GNU gcc compiler toolchain on yoursystem. For Debian/Ubuntu based GNU/Linux systems, you can type

  sudo apt-get install gcc

and for Fedora/Redhat based GNU/Linux systems, you can type

  su -c 'yum install gcc'

To compile the binary with multi-threaded computing via OpenMP,your gcc version should be at least 4.0. To compile the binarysupporting SSE4 instructions, gcc version should be at least4.3.4. For windows users, you should install Cygwin64 [3] or MSYS2. During theinstallation, please select mingw64-x86_64-gcc and make packages.For Mac OS X users, you need to install the mp-gcc4.x or newer gcc fromMacPorts or Homebrew and use the instructions below to compile theMMC source code.

To compile the program, you should first navigate into the mmc/src folder, andtype

  make

this will create a fully optimized OpenCL based mmc executable, located underthe mmc/src/bin/ folder.

Other compilation options include

  make ssemath  # this uses SSE4 for both vector operations and math functions
  make omp      # this compiles a multi-threaded binary using OpenMP
  make release  # create a single-threaded optimized binary
  make prof     # this makes a binary to produce profiling info for gprof
  make sse      # this uses SSE4 for all vector operations (dot, cross), implies omp

if you want to generate a portable binary that does not require externallibrary files, you may use (only works for Linux and Windows with gcc)

  make EXTRALIB="-static -lm" # similar to "make", except the binary includes all libraries

if you wish to build the mmc mex file to be used in matlab, you should run

  make mex      # this produces mmc.mex* under mmc/mmclab/ folder

similarly, if you wish to build the mex file for GNU Octave, you should run

  make oct      # this produces mmc.mex* under mmc/mmclab/ folder

If you append -f makefile_sfmt at the end of any of the above makecommands, you will get an executable named mmc_sfmt, which uses a fastMT19937 random-number-generator (RNG) instead of the default GLIBC 48bit RNG.If your CPU supports SSE4, the fastest binary can be obtained by running thefollowing command:

  make ssemath -f makefile_sfmt

You should be able to compile the code with an Intel C++ compiler, an AMD Ccompiler or LLVM compiler without any difficulty. To use other compilers, yousimply append CC=compiler_exe to the above make commands. If you see anyerror messages, please google and fix your compiler settings or install themissing libraries.

A special note for Mac OS users: you need to install mp-gcc4{4,5,6} fromMacPorts in order to compile MMC. The default gcc (4.2) installed by Xcode 3.xdoes not support thread-local storage. Once downloaded and installed MacPortsfrom www.macports.org, you can install gcc by

  sudo port install mp-gcc44

Then add /opt/local/bin to your $PATH variable. A example compilation commandfor MMC looks like

  make ssemath CC=gcc-mp-4.4

After compilation, you may add the path to the mmc binary (typically,mmc/src/bin) to your search path. To do so, you should modify your $PATHenvironment variable. Detailed instructions can be found at [5].

You can also compile MMC using Intel's C++ compiler - icc. To do this, you run

  make CC=icc

you must enable icc related environment variables by source the compilervars.shfile. The speed of icc-generated mmc binary is generally faster than thosecompiled by gcc.

Running Simulations

Preparation

Before you create/run your own MMC simulations, we suggest you firstunderstanding all the examples under the mmc/example directory, checking outthe formats of the input files and the scripts for pre- and post-processing.

Because MMC uses FE meshes in the simulation, you should create a mesh for yourproblem domain before launching any simulation. This can be done fairlystraightforwardly using a Matlab/Octave mesh generator, iso2mesh [1],developed by the MMC author. In the mmc/matlab folder, we also provideadditional functions to generate regular grid-shaped tetrahedral meshes.

It is required to use the savemmcmesh function under the mmc/matlabfolder to save the mesh output from iso2mesh, because it performs additionaltests to ensure the consistency of element orientations. If you choose not touse savemmcmesh, you MUST call the meshreorient function in iso2mesh totest the elem array and make sure all elements are oriented in the samedirection. Otherwise, MMC will give incorrect results.

Command line options

The full command line options of MMC include the following:

###############################################################################
#                     Mesh-based Monte Carlo (MMC) - OpenCL                   #
#          Copyright (c) 2010-2020 Qianqian Fang <q.fang at neu.edu>          #
#                            http://mcx.space/#mmc                            #
#                                                                             #
#Computational Optics & Translational Imaging (COTI) Lab  [http://fanglab.org]#
#   Department of Bioengineering, Northeastern University, Boston, MA, USA    #
#                                                                             #
#                Research funded by NIH/NIGMS grant R01-GM114365              #
###############################################################################
$Rev::646b41$ v2020 $Date::2020-08-15 22:22:09 -07$ by $Author::Qianqian Fang $
###############################################################################

usage: mmc <param1> <param2> ...
where possible parameters include (the first item in [] is the default value)

== Required option ==
 -f config     (--input)       read an input file in .inp or .json format

== MC options ==
 -n [0.|float] (--photon)      total photon number, max allowed value is 2^32-1
 -b [0|1]      (--reflect)     1 do reflection at int&ext boundaries, 0 no ref.
 -U [1|0]      (--normalize)   1 to normalize the fluence to unitary,0 save raw
 -m [0|1]      (--mc)          0 use MCX-styled MC method, 1 use MCML style MC
 -C [1|0]      (--basisorder)  1 piece-wise-linear basis for fluence,0 constant
 -u [1.|float] (--unitinmm)    define the mesh data length unit in mm
 -E [1648335518|int|mch](--seed) set random-number-generator seed;
                               if an mch file is followed, MMC "replays" 
                               the detected photons; the replay mode can be used
                               to calculate the mua/mus Jacobian matrices
 -P [0|int]    (--replaydet)   replay only the detected photons from a given 
                               detector (det ID starts from 1), use with -E 
 -M [G|SG] (--method)      choose ray-tracing algorithm (only use 1 letter)
                               P - Plucker-coordinate ray-tracing algorithm
			       H - Havel's SSE4 ray-tracing algorithm
			       B - partial Badouel's method (used by TIM-OS)
			       S - branch-less Badouel's method with SSE
			       G - dual-grid MMC (DMMC) with voxel data output
 -e [1e-6|float](--minenergy)  minimum energy level to trigger Russian roulette
 -V [0|1]      (--specular)    1 source located in the background,0 inside mesh
 -k [1|0]      (--voidtime)    when src is outside, 1 enables timer inside void

== GPU options ==
 -A [0|int]    (--autopilot)   auto thread config:1 enable;0 disable
 -G [0|int]    (--gpu)         specify which GPU to use, list GPU by -L; 0 auto
      or
 -G '1101'     (--gpu)         using multiple devices (1 enable, 0 disable)
 -W '50,30,20' (--workload)    workload for active devices; normalized by sum
 --atomic [1|0]                1 use atomic operations, 0 use non-atomic ones

== Output options ==
 -s sessionid  (--session)     a string used to tag all output file names
 -O [X|XFEJLP] (--outputtype)  X - output flux, F - fluence, E - energy deposit
                               J - Jacobian, L - weighted path length, P -
                               weighted scattering count (J,L,P: replay mode)
 -d [0|1]      (--savedet)     1 to save photon info at detectors,0 not to save
 -H [1000000] (--maxdetphoton) max number of detected photons
 -S [1|0]      (--save2pt)     1 to save the fluence field, 0 do not save
 -x [0|1]      (--saveexit)    1 to save photon exit positions and directions
                               setting -x to 1 also implies setting '-d' to 1
 -X [0|1]      (--saveref)     save diffuse reflectance/transmittance on the 
                               exterior surface. The output is stored in a 
                               file named *_dref.dat, and the 2nd column of 
			       the data is resized to [#Nf, #time_gate] where
			       #Nf is the number of triangles on the surface; 
			       #time_gate is the number of total time gates. 
			       To plot the surface diffuse reflectance, the 
			       output triangle surface mesh can be extracted
			       by faces=faceneighbors(cfg.elem,'rowmajor');
                               where 'faceneighbors' is part of Iso2Mesh.
 -q [0|1]      (--saveseed)    1 save RNG seeds of detected photons for replay
 -F format     (--outputformat)'ascii', 'bin' (in 'double'), 'mc2' (double) 
                               'hdr' (Analyze) or 'nii' (nifti, double)

== User IO options ==
 -h            (--help)        print this message
 -v            (--version)     print MMC version information
 -l            (--log)         print messages to a log file instead
 -i 	       (--interactive) interactive mode

== Debug options ==
 -D [0|int]    (--debug)       print debug information (you can use an integer
  or                           or a string by combining the following flags)
 -D [''|MCBWDIOXATRPE]         1 M  photon movement info
                               2 C  print ray-polygon testing details
                               4 B  print Bary-centric coordinates
                               8 W  print photon weight changes
                              16 D  print distances
                              32 I  entering a triangle
                              64 O  exiting a triangle
                             128 X  hitting an edge
                             256 A  accumulating weights to the mesh
                             512 T  timing information
                            1024 R  debugging reflection
                            2048 P  show progress bar
                            4096 E  exit photon info
      combine multiple items by using a string, or add selected numbers together
 --debugphoton [-1|int]        to print the debug info specified by -D only for
                               a single photon, followed by its index (start 0)

== Additional options ==
 --momentum     [0|1]          1 to save photon momentum transfer,0 not to save
 --gridsize     [1|float]      if -M G is used, this sets the grid size in mm

== Example ==
       mmc -n 1000000 -f input.json -s test -b 0 -D TP -G -1

Input files

The simplest example can be found under the example/onecube folder.Please run createmesh.m first from Matlab/Octave to create all the meshfiles, which include

elem_onecube.dat    -- tetrahedral element file
facenb_onecube.dat  -- element neighbors of each face
node_onecube.dat    -- node coordinates
prop_onecube.dat    -- optical properties of each element type
velem_onecube.dat   -- volume of each element

The input file of the example is named onecube.inp, where we specify mostof the simulation parameters. The input file follows a similar format as inMCX, which looks like the following

100                  # total photon number (can be overwriten by -n)
17182818             # RNG seed, negative to regenerate
2. 8. 0.             # source position (mm)
0. 0. 1.             # initial incident vector
0.e+00 5.e-09 5e-10  # time-gates(s): start, end, step
onecube              # mesh id: name stub to all mesh files
3                    # index of element (starting from 1) which encloses the source
3       1.0          # detector number and radius (mm)
2.0     6.0    0.0   # detector 1 position (mm)
2.0     4.0    0.0   # ...
2.0     2.0    0.0
pencil               # optional: source type
0 0 0 0              # optional: source parameter set 1
0 0 0 0              # optional: source parameter set 2

The mesh files are linked through the mesh id (a name stub) with a formatof {node|elem|facenb|velem}_meshid.dat. All mesh files must exist for an MMCsimulation. If the index to the tetrahedron that encloses the source is notknown, please use the tsearchn function in matlab/octave to find out andsupply it in the 7th line in the input file. Examples are provided inmmc/examples/meshtest/createmesh.m.

To run a simulation, you should execute the run_test.sh bash script inthis folder. If you want to run mmc directly from the command line, you can doso by typing

../../src/bin/mmc -n 20 -f onecube.inp -s onecube 

where -n specifies the total photon number to be simulated, -f specifies theinput file, and -s gives the output file name. To see all the supportedoptions, run mmc without any parameters.

The above command only simulates 20 photons and will complete instantly. Anoutput file onecube.dat will be saved to record the normalized (unitary)flux at each node. If one specifies multiple time-windows from the input file,the output will contain multiple blocks with each block corresponding to thetime-domain solution at all nodes computed for each time window.

More sophisticated examples can be found under the example/validation andexample/meshtest folders, where you can find createmesh scripts andpost-processing script to make plots from the simulation results.

JSON-formatted input files

Starting from version 0.9, MMC accepts a JSON-formatted input file in additionto the conventional tMCimg-like input format. JSON (JavaScript Object Notation)is a portable, human-readable and “fat-free” text format to representcomplex and hierarchical data. Using the JSON format makes a input fileself-explanatory, extensible and easy-to-interface with other applications(like MATLAB).

A sample JSON input file can be found under the examples/onecube folder. Thesame file, onecube.json, is also shown below:

{
    "Domain": {
    "MeshID": "onecube",
    "InitElem": 3
    },
    "Session": {
    "Photons":  100,
    "Seed":     17182818,
    "ID":       "onecube"
    },
    "Forward": {
    "T0": 0.0e+00,
    "T1": 5.0e-09,
    "Dt": 5.0e-10
    },
    "Optode": {
    "Source": {
            "Type": "pencil",
        "Pos": [2.0, 8.0, 0.0],
        "Dir": [0.0, 0.0, 1.0],
            "Param1": [0.0, 0.0, 0.0, 0.0],
            "Param2": [0.0, 0.0, 0.0, 0.0]
    },
    "Detector": [
        {
        "Pos": [2.0, 6.0, 0.0],
        "R": 1.0
        },
            {
                "Pos": [2.0, 4.0, 0.0],
                "R": 1.0
            },
            {
                "Pos": [2.0, 2.0, 0.0],
                "R": 1.0
            }
    ]
    }
}

A JSON input file requires 4 root objects, namely Domain, Session,Forward and Optode. Each object is a data structure providinginformation as indicated by its name. Each object can contain varioussub-fields. The orders of the fields in the same level are flexible. For eachfield, you can always find the equivalent fields in the *.inp input files. Forexample, The MeshID field under the Mesh object is the same asLine#6 in onecube.inp; the InitElem under Mesh is the same asLine#7; the Forward.T0 is the same as the first number in Line#5, etc.

An MMC JSON input file must be a valid JSON text file. You can validate yourinput file by running a JSON validator, for example http://jsonlint.com/ Youshould always use ... to quote a name and separate parallel itemsby ,.

MMC accepts an alternative form of JSON input, but using it is not recommended.In the alternative format, you can use "rootobj_name.field_name": value 

to represent any parameter directly in the root level. For example

{
    "Domain.MeshID": "onecube",
    "Session.ID": "onecube",
    ...
}

You can even mix the alternative format with the standard format. If any inputparameter has values in both formats in a single input file, thestandard-formatted value has higher priority.

To invoke the JSON-formatted input file in your simulations, you can use the-f command line option with MMC, just like using an .inp file. Forexample:

  ../../src/bin/mmc -n 20 -f onecube.json -s onecubejson -D M

The input file must have a .json suffix in order for MMC to recognize. Ifthe input information is set in both command line, and input file, the commandline value has higher priority (this is the same for .inp input files). Forexample, when using -n 20, the value set in Session/Photonsis overwritten to 20; when using -s onecubejson, theSession/ID value is modified. If your JSON input file is invalid,MMC will quit and point out where it expects you to double check.

Photon debugging information using -D flag

the output format for -D M (photon moving) is below:

? px py pz eid id scat

? is a single letter representing the state of the current position:
   B a boundary point
   P the photon is passing an interface point
   T the photon terminates at this location due to
      exceeding end of the time window
   M a position other than any of the above

px,py,pz: the current photon position

eid: the index (starting from 1) of the current enclosing element

id: the index of the current photon, from 1 to nphoton

scat: the "normalized" length to read the next scattering site, \
   it is unitless

for -D A (flux accumulation debugging), the output is

A ax ay az ww eid dlen

ax ay az: the location where the accumulation calculation was done \
   (typically, the half-way point of the line segment between the last \
   and current positions)

ww: the photon weight loss for the line segment

dlen=scat/mus of the current element: the distance left to arrive \
   the next scattering site

for -D E

E  px py pz vx vy vz w eid

vx vy vz: the unitary propagation vector when the photon exits
w: the current photon weight

Plotting the Results

As described above, MMC produces a fluence-rate output file assession-id.dat. By default, this file contains the normalized, i.e. underunitary source, fluence at each node of the mesh. The detailed interpretationof the output data can be found in [6]. If multiple time-windows are defined,the output file will contain multiple blocks of data, with each block being thefluence distribution at each node at the center point of each time-window. Thetotal number of blocks equals to the total time-gate number.

To read the mesh files (tetrahedral elements and nodes) into matlab, one canuse readmmcnode and readmmcelem function under the mmc/matlab directory.Plotting non-structural meshes in matlab is possible with interpolationfunctions such as griddata3. However, it is very time-consuming for largemeshes. In iso2mesh, a fast mesh slicing & plotting function, qmeshcut, is veryefficient in making 3D plots of mesh or cross-sections. More details can befound at this webpage [7], or help qmeshcut in matlab. Another usefulfunction is plotmesh in iso2mesh toolbox. It has very flexible syntax to allowusers to plot surfaces, volumetric meshes and cross-section plots. One can usesomething like

  plotmesh([node fluence],elem,'x<30 & y>30');

to plot a sliced mesh, or

  plotmesh([node log10(fluence)],elem,'x=30'); view(3)

to show a cross-sectional plot.

Please edit or browse the *.m files under all example subfolder to find moreoptions to make plot from MMC output.

When users specify -d 1 to record partial path lengths for all detectedphotons, an output file named sessionid.mch will be saved under the samefolder. This file can be loaded into Matlab/Octave using the loadmch.mscript under the mmc/matlab folder. The output of loadmch script has thefollowing columns:

  detector-id, scattering-events, partial-length_1, partial-length_2, ...., additional data ...`

The simulation settings will be returned by a structure. Using the informationfrom the mch file will allow you to re-scale the detector readings withoutrerunning the simulation (for absorption changes only).

Known issues and TODOs

  • MMC only supports linear tetrahedral elements at this point.Quadratic elements will be added later`
  • Currently, this code only supports element-based optical properties;nodal-based optical properties (for continuously varying media) will beadded in a future release

Getting Involved

MMC is an open-source software. It is released under the terms of GNU GeneralPublic License version 3 (GPLv3). That means not only everyone can download anduse MMC for any purposes, but also you can modify the code and share theimproved software with others (as long as the derived work is also licensedunder the GPLv3 license).

If you already made a change to the source code to fix a bug you encountered inyour research, we are appreciated if you can share your changes (as git diffoutputs) with the developers. We will patch the code as soon as wefully test the changes (we will acknowledge your contribution in the MMCdocumentation).

When making edits to the source code with an intent of sharing with theupstream authors, please set your editor's tab width to 8 so that theindentation of the source is correctly displayed. Please keep your patch assmall and local as possible, so that other parts of the code are not influenced.

To streamline the process process, the best way to contribute your patch is toclick the fork button from http://github.com/fangq/mmc, and then changethe code in your forked repository. Once fully tested and documented, you canthen create a pull request so that the upstream author can review thechanges and accept your change.

In you are a user, please use our mmc-users mailing list to post questions orshare experience regarding MMC. The mailing lists can be found from this link:

http://mcx.space/#about

Acknowledgement

MMC uses the following open-source libraries:

SSE Math library by Julien Pommier

Copyright (C) 2007 Julien Pommier

This software is provided 'as-is', without any express or implied warranty. Inno event will the authors be held liable for any damages arising from the useof this software.

Permission is granted to anyone to use this software for any purpose, includingcommercial applications, and to alter it and redistribute it freely, subject tothe following restrictions:

  1. The origin of this software must not be misrepresented; you must not claimthat you wrote the original software. If you use this software in a product, anacknowledgment in the product documentation would be appreciated but is notrequired.

  2. Altered source versions must be plainly marked as such, and must not bemisrepresented as being the original software.

  3. This notice may not be removed or altered from any source distribution.

(this is the zlib license)

cJSON library by Dave Gamble

Copyright (c) 2009 Dave Gamble

Permission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the “Software”), to dealin the Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicense, and/or sell copiesof the Software, and to permit persons to whom the Software is furnished to doso, subject to the following conditions:

The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

SFMT library by Mutsuo Saito, Makoto Matsumoto and Hiroshima University

Copyright (c) 2006,2007 Mutsuo Saito, Makoto Matsumoto and HiroshimaUniversity. All rights reserved.

Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer. 

  • Redistributions in binary form must reproduce the abovecopyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of the Hiroshima University nor the names ofits contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FORANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ONANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

drand48_r port for libgw32c by Free Software Foundation

Copyright (C) 1995, 1997, 2001 Free Software Foundation, Inc. This file is partof the GNU C Library. Contributed by Ulrich Drepper<drepper@gnu.ai.mit.edu>, August 1995.

The GNU C Library is free software; you can redistribute it and/or modify itunder the terms of the GNU Lesser General Public License as published by theFree Software Foundation; either version 2.1 of the License, or (at youroption) any later version.

The GNU C Library is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY orFITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License formore details.

You should have received a copy of the GNU Lesser General Public License alongwith the GNU C Library; if not, write to the Free Software Foundation, Inc., 59Temple Place, Suite 330, Boston, MA 02111-1307 USA.

git-rcs-keywords by Martin Turon (turon) at Github

MMC includes a pair of git filters (.git_filters/rcs-keywords.clean and.git_filters/rcs-keywords.smudge) to automatically update SVN keywords inmcx_utils.c. The two simple filter scripts were licensed under the BSD licenseaccording to this link:

https://github.com/turon/git-rcs-keywords/issues/4

Both filter files were significantly modified by Qianqian Fang.

Reference

  • 原文网址:MMC调试方法_IT利刃出鞘的博客-CSDN博客 mmc命令 所在包:mmc命令在mmc-utils包中。 使用方法:可以通过mmc不带参数来查看用法 Usage: mmc extcsd read <device> Print extcsd data from <device>. mmc writeprotect get <

  • 1 前言 1.1 声明 本文依据eMMC JEDEC5.1协议、网络资料及个人工作经验整理而成,如有错误请留言。 文章为个人辛苦整理,付费内容,禁止私自转载。 1.2 内容提要 本文大约7000字,主要内容有: 1、eMMC和MMC的区别 2、SD卡和TF卡的区别 3、SD和SDIO的区别 4、nor flash和nand flash的区别 5、什么是ROM/RAM/SRAM/SDRAM/DRAM

 相关资料
  • 我们的环境中有Java . lang . out of memory error:perm gen空间:Windows Server 2012 R2 64位8GB RAM JRE 1.7 u80 Tomcat 7 . 0 . 73 ActiveMQ 5 . 9 . 0 Mule runtime 3 . 5 . 4 Mule management console 3 . 5 . 3部署在Tomcat

  • 更新时间:2018-09-15 11:01:57 Driver功能 磁力计传感器,mmc3680kj是一款磁力计传感器,通过I2C进行数据交互。 硬件资源 DevelopKit开发板上自带有mmc3680kj传感器: 软件设计 根据mmc3680kj的数据手册,传感器的磁力数据值存放在寄存器0x00-0x04,在每次读取磁力数据之前,都需要检测状态寄存器0x07是否置位; 驱动配置 开发板板级管脚

  • mmcv 是用于计算机视觉研究的基础 Python 库,支持 MMLAB 中的许多研究项目,例如 mmdetection。该库主要分为两个部分,一部分是与深度学习框架无关的工具函数,比如 IO/Image/Video 相关的一些操作,另一部分是为 PyTorch 写的一套训练工具,可以大大减少用户需要写的代码量,同时让整个流程的定制变得容易。 它提供以下功能: 通用 IO API 图像处理 视频处

  • MMCamScanner 有自定义相机平方检测(OpenCV 的框架),自定义涟漪视图控制器动画,有效矩形裁剪功能。

  • Turck MMCache是一个跟eAccelerator一样的PHP脚本加速器开源项目。

  • SD-MMC 这是摩托罗拉公司开发的开源的 SD-MMC 卡的驱动程序。