[Gate-users] Bug in GateToRoot

Hannes Hofmann opengate at f00f.de
Mon Nov 26 15:14:15 CET 2007


Hi,

I noticed a bug when running a simulation with a voxelized phantom on a
cluster.
As you know Gate writes a file called gateVoxels.root when using a
voxelized phantom. This file seems to be written at the time when the
phantom is read. In the default macro from benchmarkSPECT the filename
for root output gets set after that, so all jobs try writing to the same
file with the default name gateVoxels.root which results in stale NFS
handles in my case.
First i tryed setting the filename at the beginning of the macro, which
resolves part of the problem. But the file then get called
benchmarkSPECT1.rootVoxels.root which is ugly and inconsistent to the
main root file (called benchmarkSPECT1.root).
The cause is that GateToRoot::SetFileName as defined in
include/GateToRoot.hh appends ".root" to the filename and
GateToRoot::RecordVoxels in src/GateToRoot.cc appends "Voxels.root" to
that. Furthermore m_fileName gets initialized with "gate".

I suggest to
- Initialize m_fileName with "gate" (no change)
- Not append ".root" in SetFileName
- Instead append ".root" in GetFileName/GetFilePath
- Directly use m_fileName in RecordVoxels and append "Voxels.root" (no
  change)
- Use GetFileName/GetFilePath everywhere else
- Move /gate/output/root/setFileName somewhere before the phantom
  definition

That way each job would create its own benchmarkSPECT1Voxels.root

Looking forward to your comments,
Hannes




More information about the Gate-users mailing list