Suppressing PMCX Output

15 views
Skip to first unread message

Darian Fuxfell

unread,
Oct 14, 2025, 9:47:16 AMOct 14
to mcx-users
Hello,

I’ve been using PMCX for some time now, but the inability to silence its output is becoming an issue. it’s preventing me from seeing other feedback from my code. Is there a way to disable or redirect this output?

Here is an example what I am talking about.

nphoton: 2e+06
tstart: 0
tstep: 1e-08
tend: 1e-08
maxdetphoton: 2e+06
unitinmm: 1
issaveexit: 1
issave2pt: 0
###############################################################################
#                      Monte Carlo eXtreme (MCX) -- CUDA                      #
#          Copyright (c) 2009-2025 Qianqian Fang <q.fang at neu.edu>          #
#                https://mcx.space/  &  https://neurojson.io                  #
#                                                                             #
# Computational Optics & Translational Imaging (COTI) Lab- http://fanglab.org #
#   Department of Bioengineering, Northeastern University, Boston, MA, USA    #
###############################################################################
#    The MCX Project is funded by the NIH/NIGMS under grant R01-GM114365      #
###############################################################################
#  Open-source codes and reusable scientific data are essential for research, #
# MCX proudly developed human-readable JSON-based data formats for easy reuse.#
#                                                                             #
#Please visit our free scientific data sharing portal at https://neurojson.io #
# and consider sharing your public datasets in standardized JSON/JData format #
#################################################################
GPU=1 (NVIDIA GeForce RTX 3090) threadph=5 extra=320640 np=2000000 nthread=335872 maxgate=1 repetition=1
initializing streams ... init complete : 2 ms
requesting shared memory: 1536 bytes
launching MCX simulation for time window [0.00e+00ns 1.00e+01ns] ...
simulation run# 1 ...
kernel complete:   84 ms
retrieving fields ... detected 1999617 photons, total: 1999617 simulated 2000000 photons (2000000) with 335872 threads (repeat x1)
MCX simulation speed: 333333.33 photon/ms
total simulated energy: 2000000.00 absorbed: 0.00000%
(loss due to initial specular reflection is excluded in the total)

Qianqian Fang

unread,
Oct 14, 2025, 2:53:35 PMOct 14
to mcx-...@googlegroups.com

you can set cfg['flog'] to a string denoting the log file path to save the output to the log file instead of printing; on Linux or Mac, you can use /dev/null to suppress the log printing

cfg['flog']='/dev/null'

otherwise, if you set a path to a log file, the output will also not be printed.

if you just set cfg['flog'] to 0, the banner will not be printed, but the GPU log will still be printed. 

Same can be done with mcxlab (use cfg.flog) or mcx binary (-l), see mcxlab help info on this field

https://github.com/fangq/mcx/blob/v2025.10/mcxlab/mcxlab.m#L330-L335

unfortunately, the printed nphoton/tstart/... values can not be hidden at the moment as it is not directed to cfg.flog. it should still be much cleaner regardless.

--
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/d3407992-b601-4cef-a7dc-0fc28abf3400n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages