How to interpret MCX command window output

41 views
Skip to first unread message

Vytautas Gradauskas

unread,
Apr 10, 2025, 8:10:48 AMApr 10
to mcx-users
Hello Prof. Fang,

Could you help me to interpret MCX command window log information? What are threadph,  extra, np, nthread, normalization factor alpha? 

Are any of them somehow related with fluence.stat.workload? I know one can use the cfg.workload to split the photons between GPUs, but when I do not define it (only have one GPU) the fluence.stat.workload looks like a "random" number.

Also, as you can see from the log screenshot, I simulated 2e11 energy (cfg.nphoton=2e11). I would expect simulated photons to be the same number (I see it  being the same for smaller number of packets). In this case it is negative - what does that mean? How is this number calculated? I tried to go through the source code, but got a bit lost. 
Related with this, are there any issues trying to run big numbers of photons (e.g. 2e11)? If so, is there a rule of thumb that we should follow for setting nphoton for given hardware?

Thank you 

MCX_commandwindow_log.png

Qianqian Fang

unread,
Apr 16, 2025, 1:56:12 PMApr 16
to mcx-...@googlegroups.com, Vytautas Gradauskas

hi Vytautas,

you were at our training workshop last year, if you open the training materials folder, find the unit MCX2024_1C_mcx_command_line.ipynb, you should see a section named "Understanding mcx simulation log" - in that section, I provided detailed explanations on how to interpret these logs.

for those of you who were not at our workshop last year, you can see this Jupyter notebook section for the same content

https://colab.research.google.com/drive/1MX4rC1my2znSYXCj8HgKmPEZzNxhZii3#scrollTo=msnjuzATnuqc

cfg.workload is used to split total simulated photon number (cfg.nphoton) to multiple GPUs. for example,if you have 3 GPUs, you plan to run 1e8 total photons, a workload of 20,20,60 would run 20%*1e8=2e7 photon packets on GPU#1, 20% of those on GPU#2, and 60% on GPU#3. For each GPU, you should see a line starting with GPU=x, and the np field shows the assigned photon numbers for that GPU. It won't make a difference if you have just one GPU. The summation of all workload members does not need to be 100, it can be anything, it is converted to percentages after normalized by the sum.


> Also, as you can see from the log screenshot, I simulated 2e11 energy (cfg.nphoton=2e11). I would expect simulated photons to be the same number (I see it  being the same for smaller number of packets). In this case it is negative - what does that mean? How is this number calculated? I tried to go through the source code, but got a bit lost.

you should update to v2025, the large number printing overflow issue (thus, negative numbers) was fixed in this commit in June 2024

https://github.com/fangq/mcx/commit/4ff5b609e4a2221e427c679c7395caadff233659


Qianqian


On 4/10/25 08:10, Vytautas Gradauskas wrote:

You don't often get email from vytas...@gmail.com. Learn why this is important

--
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/f7283641-5a37-44f9-a421-fbc836209240n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages