[gate-users] Maximum file size exceeded problem
Giovanni Santin
giovanni.santin at cern.ch
Thu Oct 28 08:42:15 CEST 2004
Dear Amarnath Srinivasan
With some delay due to other businesses, thanks also to Richard
Taschereau who again pointed out the problem, I found the bug that
generates the crash.
Please have a try with the attached modified file
src/GateToASCIIMessenger.cc
which should fix your problem.
Best regards,
--
Giovanni
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Giovanni Santin
Space Environments and Effects Analysis
ESA - ESTEC - TEC-EES
Keplerlaan 1, 2200 AG Noordwijk, Netherlands
e-mail: giovanni.santin at esa.int
Tel: +31 71 565 6267
Fax: +31 71 565 4999
On Thu, 30 Sep 2004, Amarnath Srinivasan wrote:
> Dear Santin,
>
> Thanks a lot for the files. I tested the programs. Both the mask for
> parameter reduction and the file splitter command worked well as expected.
> I use Redhat 9.0 with gcc 3.0 on a Intel Xeon Dual processor system for
> running Gate.
>
> But when exiting Gate from idle it produces a core dump. I have attacahed
> the error messsage I got form Gate.
> I am not sure if it is because of the new files. Yopu might want to take a
> look into this.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> Time set to (s) 20
> User simulation time (sec) := 125481
> Real simulation time (sec) := 192313
> System simulation time (sec) := 1061.69
> Idle> exit
> Graphics systems deleted.
> Visualization Manager deleting...
>
> *** Break *** segmentation violation
> Generating stack trace...
> /usr/bin/addr2line: Gate: No such file or directory
> /usr/bin/addr2line: Gate: No such file or directory
> /usr/bin/addr2line: Gate: No such file or directory
> /usr/bin/addr2line: Gate: No such file or directory
> /usr/bin/addr2line: Gate: No such file or directory
> /usr/bin/addr2line: Gate: No such file or directory
> /usr/bin/addr2line: Gate: No such file or directory
> 0x420734d6 in __libc_free + 0x86 from /lib/tls/libc.so.6
> 0x412f4983 in operator delete(void*) + 0x23 from /usr/lib/libstdc++.so.5
> 0x412e832e in std::basic_string<char, std::char_traits<char>,
> std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&) + 0x3e
> from /usr/lib/libstdc++.so.5
> 0x08721c32 in G4UIparameter::~G4UIparameter [in-charge]() + 0x14c from Gate
> 0x08711d37 in G4UIcommand::~G4UIcommand [in-charge deleting]() + 0x57 from
> Gate
> 0x08212fbb in GateToASCIIMessenger::~GateToASCIIMessenger [in-charge
> deleting]() + 0x39 from Gate
> 0x0817b7df in GateToASCII::~GateToASCII [in-charge deleting]() + 0x5b from
> Gate
> 0x08164f09 in GateOutputMgr::~GateOutputMgr [in-charge deleting]() + 0x41
> from Gate
> 0x081529c3 in main + 0x825 from Gate
> 0x42015574 in __libc_start_main + 0xe4 from /lib/tls/libc.so.6
> 0x08151b9d in TFile::TFile[in-charge](char const*, char const*, char
> const*, int) + 0x41 from Gate
> Abort (core dumped)
> [ray at rayraylman9 ~/benchmarkPET]$
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> Thanks a lot for your help.
> Amarnath Srinivasan
> Research Assistant
> Center for Advanced Imaging
> PO Box 9235
> Dept of Radiology, HSC, WVU
> Morgantown, WV 26506
> asrinivasan at hsc.wvu.edu
> Phone Office: 304 293 6925 /Lab: 304 293 5586
> ----- Original Message -----
> From: "Giovanni Santin" <giovanni.santin at cern.ch>
> To: "GATE feedback and helpline for Users" <gate-users at lphe1pet1.epfl.ch>
> Sent: Sunday, September 19, 2004 3:38 AM
> Subject: Re: [gate-users] Maximum file size exceeded problem
>
>
> > Dear Amarnath
> >
> > I was not aware of any solution to this problem via compilation flags.
> > It sounds interesting.
> >
> > Nevertheless, in the last days I wrote a few modifications to Gate to have
> > an automatic file swap when the file size exceeds a user defined limit.
> >
> > The old file fileCoincidences.dat is then closed and a new one
> > fileCoincidences_1.dat is opened.
> >
> > This should work for both Coincidences and Singles.
> >
> > The file size limit is set to 2GB by default, and the user can set it to a
> > different value, or to zero (in this case no file swap is done).
> >
> > In addition, there will be the possibility to choose the variables to
> > include in Coincidences and Singles ASCII files, with a mask.
> >
> > I hope the new additions will come out soon in the next release, but we
> > still need to wait for some validation feedback as usual before releasing
> > the code.
> >
> > If the release will wait, I'll make the single modified files available
> > for testing.
> >
> > Best regards,
> > --
> > Giovanni
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Giovanni Santin
> > Space Environments and Effects Analysis
> > ESA - ESTEC - TEC-EES
> > Keplerlaan 1, 2200 AG Noordwijk, Netherlands
> > e-mail: giovanni.santin at esa.int
> > Tel: +31 71 565 6267
> > Fax: +31 71 565 4999
> >
> >
> > On Thu, 16 Sep 2004, Amarnath Srinivasan wrote:
> >
> > > Hello Zhang and Others,
> > > I am using Gate in Redhat 9 for simulating a PET scanner and produce
> output
> > > in Ascii Format. When the output file exceeds 2Gb I get an error saying
> > > "FileSize Limit Exceeded" and the program terminates. I am hitting the
> 2**31
> > > bit limit of the datatype off_t.
> > >
> > > 1. I am looking for ways to fix this problem.Based on Mr.Zhang's
> > > provious mail I looked for large file support in Redhat Linux. RH9
> supports
> > > large files. But to enable that for gate, gate should be compiled in
> gcc
> > > with the "large file support turned on". I would like to know if gate
> > > supports
> > > large files? What is the procedure to compile gate with large file
> support
> > > turned on? Has anyone done this before?
> > >
> > > 2. Will doing "gcc -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> program.c"
> > > by editing the make file for gate help? If yes what are the files that
> > > should be edited ?
> > > Does this have to be done for geant too?
> > >
> > > 3. I would also like to know if someone has produced files larger than
> 2GB
> > > in gate in "any" platform?
> > >
> > > Thankyou
> > > Amarnath Srinivasan
> > > Research Assistant
> > > Center for Advanced Imaging
> > > PO Box 9235
> > > Dept of Radiology, HSC, WVU
> > > Morgantown, WV 26506
> > > asrinivasan at hsc.wvu.edu
> > > Phone Office: 304 293 6925 /Lab: 304 293 5586
> > > ----- Original Message -----
> > > From: "Long ZHANG" <zhanglong99 at tsinghua.org.cn>
> > > To: <gate-users at lphe1pet1.epfl.ch>
> > > Sent: Friday, August 27, 2004 2:46 AM
> > > Subject: Re: [gate-users] Maximum file size exceeded problem
> > >
> > >
> > > > Dear Srinivasan,
> > > >
> > > > There are several limits on Linux Filesystem, the one you met is
> defined
> > > by VFS
> > > > module, that is to say, all filesystemson your kerenl have a maximus
> size
> > > of 2GB.
> > > >
> > > >
> > > > So the solution is to update your kernel and use another filesystem. A
> > > journal
> > > > filesystem can resolve this problem (EXT2/EXT3 can't). You'd better
> query
> > > Linux
> > > > Journal Filesystem on GOOGLE, then you can get many good solution.
> > > >
> > > > Hope this helps!
> > > >
> > > > Best regards,
> > > >
> > > > Long
> > > >
> > > > In your mail:
> > > > >From:"Amarnath Srinivasan" <asrinivasan at hsc.wvu.edu>
> > > > >Reply-To: GATE feedback and helpline for Users
> > > <gate-users at lphe1pet1.epfl.ch>
> > > > >To: "GATE feedback and helpline for Users"
> <gate-users at lphe1pet1.epfl.ch>
> > > > >Subject: Re: [gate-users] Maximum file size exceeded problem
> > > > >
> > > > >
> > > > >Hello,
> > > > >
> > > > >We were running gate on RedHat 9 . When the output ascii file
> > > > "gate_coincidence.dat" size exceeded 2GB I got an error saying
> maximum
> > > file size
> > > > exceeded and the program terminated.
> > > > >Does anybody have idea on how to fix this problem.
> > > > >
> > > > >
> > > > >
> > > > >thankyou
> > > > >Amarnath Srinivasan
> > > > >Research Assistant
> > > > >Center for Advanced Imaging
> > > > >PO Box 9235
> > > > >Dept of Radiology, HSC, WVU
> > > > >Morgantown, WV 26506
> > > > >asrinivasan at hsc.wvu.edu
> > > > > ----- Original Message -----
> > > > > From: yuxuan.zhang at di.mdacc.tmc.edu
> > > > > To: gate-users at lphe1pet1.epfl.ch
> > > > > Sent: Tuesday, August 24, 2004 5:08 PM
> > > > > Subject: [gate-users] about random coincidences
> > > > >
> > > > >
> > > > >
> > > > > hi all,
> > > > >
> > > > > In my simulation I noticed a strange result that I can not figure
> it
> > > out.
> > > > > My setup is that: using cylindricalPET system with 30 rsetors, one
> > > point
> > > > > source at the center. The radiation activity is very high, thus
> there
> > > are
> > > > > lots of random coincidences (accidental coincidences) in the totoal
> > > > > coincidences. Now I do the statistics on these random coincidences
> > > according
> > > > > to the sector index, then I found that the coincidences between 2
> > > opposite
> > > > rsectors
> > > > > (e.g. No.0 and 15, or No.5 and 20) are much more than the
> coincidences
> > > between
> > > > other
> > > > > 2 sectors ( No. 0 and 14, or No. 0 and 16 ...) Usually the
> difference
> > > can be
> > > > 50% or 100% depend on the thickness of the detector. Is anyone else
> > > noticed that?
> > > >
> > > > > Can you have a try in your computer to find out whether this is a
> bug
> > > of GATE
> > > > or there
> > > > > is somthing wrong with my simulation? Thank you very much.
> > > > >
> > > > >
> > > > > Best regards,
> > > > >
> > > > > Yuxuan Zhang
> > > > >
> > > > >
> > > > > Dr. Yuxuan ZHANG
> > > > > Dept. Experimental Diagnostic Imaging
> > > > > Univ. Texas, MD Anderson Cancer Center
> > > > > 1515 Holcombe Blvd, Unit 217
> > > > > Houston, TX 77030-4095
> > > > >
> > > > > Tel: +1-713-745-1671
> > > > > Fax: +1-713-745-1672
> > > > >
> > > > >
> > > >
> > >
> >---------------------------------------------------------------------------
> > > ---
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > gate-users mailing list
> > > > > gate-users at lphe1pet1.epfl.ch
> > > > > http://lphe1pet1.epfl.ch/mailman/listinfo/gate-users
> > > > >_______________________________________________
> > > > >gate-users mailing list
> > > > >gate-users at lphe1pet1.epfl.ch
> > > > >http://lphe1pet1.epfl.ch/mailman/listinfo/gate-users
> > > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > gate-users mailing list
> > > > gate-users at lphe1pet1.epfl.ch
> > > > http://lphe1pet1.epfl.ch/mailman/listinfo/gate-users
> > >
> > > _______________________________________________
> > > gate-users mailing list
> > > gate-users at lphe1pet1.epfl.ch
> > > http://lphe1pet1.epfl.ch/mailman/listinfo/gate-users
> > >
> > _______________________________________________
> > gate-users mailing list
> > gate-users at lphe1pet1.epfl.ch
> > http://lphe1pet1.epfl.ch/mailman/listinfo/gate-users
>
> _______________________________________________
> gate-users mailing list
> gate-users at lphe1pet1.epfl.ch
> http://lphe1pet1.epfl.ch/mailman/listinfo/gate-users
>
-------------- next part --------------
/*!
\file GateToASCIIMessenger.cc
$Log: GateToASCIIMessenger.cc,v $
Revision 1.9 2004/10/27 07:07:05 gsantin
fix for crash while deleting the CoincidenceMaskCmd
Revision 1.8 2004/09/16 14:00:21 gsantin
FileSizeLimit and Coinc/Single masks
Revision 1.7 2003/07/02 22:18:29 dstrul
Digitizer re-engineering
Revision 1.6 2003/06/21 12:01:23 dstrul
Output modules now handle multiple digi channels
Revision 1.5 2002/11/24 15:10:41 gsantin
new RecordVoxels, with disabling flag
Revision 1.4 2002/10/21 15:23:29 dstrul
Adaptations for DigiGate: simplified the use of the compilation options, added security for the case when the user tries to run DigiGate without the ROOT option
Revision 1.3 2002/10/19 14:54:21 dstrul
Adaptations for DigiGate: new messenger commands allow the user to set the name of the output files
Revision 1.2 2002/08/11 15:33:25 dstrul
Cosmetic cleanup: standardized file comments for cleaner doxygen output
\brief Class GateToASCIIMessenger
\brief By Giovanni.Santin at cern.ch
\brief $Id: GateToASCIIMessenger.cc,v 1.9 2004/10/27 07:07:05 gsantin Exp $
*/
#ifdef G4ANALYSIS_USE_FILE
#include "GateToASCIIMessenger.hh"
#include "GateToASCII.hh"
#include "GateOutputMgr.hh"
#include "GateCoincidenceDigi.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithABool.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWith3VectorAndUnit.hh"
#include "G4UIcmdWithoutParameter.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GateToASCIIMessenger::GateToASCIIMessenger(GateToASCII* gateToASCII)
: GateOutputModuleMessenger(gateToASCII)
, m_gateToASCII(gateToASCII)
{
G4String cmdName;
cmdName = GetDirectoryName()+"reset";
ResetCmd = new G4UIcmdWithoutParameter(cmdName,this);
ResetCmd->SetGuidance("Reset the output");
cmdName = GetDirectoryName()+"setFileName";
SetFileNameCmd = new G4UIcmdWithAString(cmdName,this);
SetFileNameCmd->SetGuidance("Set the name of the output ASCII data files");
SetFileNameCmd->SetParameterName("Name",false);
cmdName = GetDirectoryName()+"setOutFileHitsFlag";
OutFileHitsCmd = new G4UIcmdWithABool(cmdName,this);
OutFileHitsCmd->SetGuidance("Set the flag for Hits ASCII output");
OutFileHitsCmd->SetGuidance("1. true/false");
cmdName = GetDirectoryName()+"setOutFileVoxelFlag";
OutFileVoxelCmd = new G4UIcmdWithABool(cmdName,this);
OutFileVoxelCmd->SetGuidance("Set the flag for the Voxel Material Matrix ASCII output");
OutFileVoxelCmd->SetGuidance("1. true/false");
cmdName = GetDirectoryName()+"setCoincidenceMask";
CoincidenceMaskCmd = new G4UIcommand(cmdName,this);
CoincidenceMaskCmd->SetGuidance("Set the mask for the coincidence ASCII output");
CoincidenceMaskCmd->SetGuidance("Sequence of 0 / 1");
m_coincidenceMaskLength = 100;
for (G4int iMask=0; iMask<m_coincidenceMaskLength; iMask++) {
G4UIparameter* MaskParam = new G4UIparameter("mask",'b',true);
MaskParam->SetDefaultValue(false);
CoincidenceMaskCmd->SetParameter(MaskParam);
}
cmdName = GetDirectoryName()+"setSingleMask";
SingleMaskCmd = new G4UIcommand(cmdName,this);
SingleMaskCmd->SetGuidance("Set the mask for the single ASCII output");
SingleMaskCmd->SetGuidance("Sequence of 0 / 1");
m_singleMaskLength = 100;
for (G4int iMask=0; iMask<m_singleMaskLength; iMask++) {
G4UIparameter* MaskParam = new G4UIparameter("mask",'b',true);
MaskParam->SetDefaultValue(false);
SingleMaskCmd->SetParameter(MaskParam);
}
cmdName = GetDirectoryName()+"setOutFileSizeLimit";
SetOutFileSizeLimitCmd = new G4UIcmdWithAnInteger(cmdName,this);
SetOutFileSizeLimitCmd->SetGuidance("Set the limit in bytes for the size of the output ASCII data files");
SetOutFileSizeLimitCmd->SetParameterName("size",false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GateToASCIIMessenger::~GateToASCIIMessenger()
{
delete SetOutFileSizeLimitCmd;
delete CoincidenceMaskCmd;
delete SingleMaskCmd;
delete ResetCmd;
delete OutFileHitsCmd;
delete OutFileVoxelCmd;
delete SetFileNameCmd;
for (size_t i = 0; i<OutputChannelCmdList.size() ; ++i)
delete OutputChannelCmdList[i];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GateToASCIIMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if( command == CoincidenceMaskCmd ) {
G4std::vector<G4bool> maskVector;
const char* newValueChar = newValue;
std::istrstream is((char*)newValueChar);
G4int tempIntBool;
G4int tempBool;
maskVector.clear();
for (G4int iMask=0; iMask<m_coincidenceMaskLength; iMask++) {
is >> tempIntBool; // NB: is >> bool does not work, so we put is to an integer and we copy the integer to the bool
tempBool = tempIntBool;
maskVector.push_back(tempBool);
// G4cout << "[GateToASCIIMessenger::SetNewValue] iMask: " << iMask << " maskVector[iMask]: " << maskVector[iMask] << G4endl;
}
GateCoincidenceDigi::SetCoincidenceASCIIMask( maskVector );
} else if (command == SingleMaskCmd) {
G4std::vector<G4bool> maskVector;
const char* newValueChar = newValue;
std::istrstream is((char*)newValueChar);
G4int tempIntBool;
G4int tempBool;
maskVector.clear();
for (G4int iMask=0; iMask<m_singleMaskLength; iMask++) {
is >> tempIntBool; // NB: is >> bool does not work, so we put is to an integer and we copy the integer to the bool
tempBool = tempIntBool;
maskVector.push_back(tempBool);
// G4cout << "[GateToASCIIMessenger::SetNewValue] iMask: " << iMask << " maskVector[iMask]: " << maskVector[iMask] << G4endl;
}
GateSingleDigi::SetSingleASCIIMask( maskVector );
} else if (command == SetOutFileSizeLimitCmd) {
GateToASCII::VOutputChannel::SetOutputFileSizeLimit( SetOutFileSizeLimitCmd->GetNewIntValue(newValue));
} else if (command == SetFileNameCmd) {
m_gateToASCII->Reset();
} else if (command == SetFileNameCmd) {
m_gateToASCII->SetFileName(newValue);
} else if ( command == OutFileHitsCmd ) {
m_gateToASCII->SetOutFileHitsFlag(OutFileHitsCmd->GetNewBoolValue(newValue));
} else if ( command == OutFileVoxelCmd ) {
m_gateToASCII->SetOutFileVoxelFlag(OutFileVoxelCmd->GetNewBoolValue(newValue));
} else if ( IsAnOutputChannelCmd(command) ) {
ExecuteOutputChannelCmd(command,newValue);
} else {
GateOutputModuleMessenger::SetNewValue(command,newValue);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GateToASCIIMessenger::CreateNewOutputChannelCommand(GateToASCII::VOutputChannel* anOutputChannel)
{
G4String cmdName;
m_outputChannelList.push_back(anOutputChannel);
G4String channelName = anOutputChannel->m_collectionName;
cmdName = GetDirectoryName()+"setOutFile" + channelName + "Flag";
G4UIcmdWithABool * newCmd = new G4UIcmdWithABool(cmdName,this) ;
G4String aGuidance = "Set the flag for ASCII output of " + channelName + ".";
newCmd->SetGuidance(aGuidance.c_str());
newCmd->SetGuidance("1. true/false");
OutputChannelCmdList.push_back( newCmd );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool GateToASCIIMessenger::IsAnOutputChannelCmd(G4UIcommand* command)
{
for (size_t i = 0; i<OutputChannelCmdList.size() ; ++i)
if ( command == OutputChannelCmdList[i] )
return true;
return false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GateToASCIIMessenger::ExecuteOutputChannelCmd(G4UIcommand* command,G4String newValue)
{
for (size_t i = 0; i<OutputChannelCmdList.size() ; ++i)
if ( command == OutputChannelCmdList[i] ) {
m_outputChannelList[i]->SetOutputFlag( OutputChannelCmdList[i]->GetNewBoolValue(newValue) );
break;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
More information about the Gate-users
mailing list