Open huegle opened 5 years ago
Hi @huegle,
You write that
When running an instrument that uses an MCPL file as a source with MPI, McStas simply runs the > exact same MCPL input file in its entirety on each core and adds the results together. This poses > several problems:
any statistics/error bars are biased/wrong
I would argue that that saying the statistics/errorbars are biased/wrong is too strong. :) For multiple reasons:
I think we will never implement a method where the events are transferred between nodes, but an option would be that per-node MCPL_input could optionally read independent files (e.g. mpi_multiple_mcpl_files=1, with corresponding file naming, input_0.mcpl.gz, ... input_n.mcpl.gz). There will of course still be a possible dependence on OS / filesystem performance in this case, but it will be less than the current situation.
The input_0.mcpl.gz, ... input_n.mcpl.gz naming above will btw correspond well with using the options keep_mpi_unmerged=1 and merge_mpi=0 of MCPL_output
When running an instrument that uses an MCPL file as a source with MPI, McStas simply runs the exact same MCPL input file in its entirety on each core and adds the results together. This poses several problems:
/////////////////////////////////////////////////////////////
This bug report is based on the following exchange on the mcstas-users list:
Dear Thomas, The McStas use of MCPL input in MPI settings is implemented in a relatively trivial way: Every particle in the file is processed by every MPI process I therefore suspect that we could be looking at an I/O limitation from the filesystem - 1 vs. 10 vs. 64 processes wanting to read the same 24 Gb each from disk ‘in parallel’.
On 7 Nov 2019, at 17.34, Huegle, Thomas hueglet@ornl.gov wrote:
Dear all, I am trying out using MCPL files as input into simulations right now:
COMPONENT sourceMCPL = MCPL_input( filename="/data/source.mcpl" ) AT (0, 0, 0) RELATIVE Origin
When I run the simulation using simply “mcrun mcpltester.instr”, it takes about half an hour (the MCPL file in question is 24GB). However, when I try to use mpi (“mcrun -c --mpi=10 mcpltester.instr”), it takes something closer to 50 minutes. The problem seems to get worse (predicted run time for mpi=64: ~17 hours). Is there a way around it? Some special way of compiling perhaps? Thank you very much! Thomas