Message: Re: Run ending prematurely but without error Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Run ending prematurely but without error 

Forum: Run Management
Re: Sad Run ending prematurely but without error (Seb Galer)
Re: Idea Re: Run ending prematurely but without error (Loc Martin)
Date: 09 Apr, 2013
From: Robert Hatcher <Robert Hatcher>

On Tue, 09 Apr 2013 07:07:31 GMT, Lo&#65533;c Martin wrote:
> I experiment the same problem as you since I have updated Geant4 to
> version 9.6.p01 : instead of generate 1E10 events, the run stops after
> about 100k events, without any warning message and doing all the
> EndOfRunAction requested actions.
> 
> I 've found by chance a trick to pass throught this problem : if you use
> a macro file with twice the command "run/beamOn n", you will avoid the
> end of the two runs at 100k events. So my macro file looks like :
> 
> /run/beamOn 10000000000
> 
> /run/beamOn 10000000000
> 
> instead of just one "/run/beamOn 10000000000"

This looks like the value is getting stored as a 32-bit int somewhere along the way. The maximum values that can be stored in a signed 32-bit int is 2147483647. When your 10000000000 value is being parsed and put in the variable it is no doubt turning into 1410065408, as upper bits get chopped off, ala:

#include <iostream>
void test_int()
{
  int i = 10000000000;
  int m = 0x7fffffff;  // max positive 32-bit integer
  cout << "i=" << i << " m=" << m << endl;
}

yields: i=1410065408 m=2147483647

with the compiler complaining:
/private/tmp/./test_int.C:5:11: warning: implicit conversion from 'long long' to
      'int' changes value from 10000000000 to 1410065408 [-Wconstant-conversion]

No complaint happens in your case because the conversion/truncation happens at run time rather than my compile time example.

There are various stages where this truncation could be occurring and those responsible for the code might wish to look to ensuring that all instances along that path are of type 'long long int' (i.e. 64-bit). But in the mean time, it looks like users will need to restrict their "beamOn" values to what can be held by a 32-bit integer. As you've shown you can still accomplish what you desire by multiple "beamOn" commands.

> I dont know why this works, but I obtain two successive runs of 1E10
> events instead of one run that stops around 100k events
> 
> It seems to be related to the macro file reading, but I dont know how.
> If anyone have an idea about that problem, It is welcome.
> 
> Thanks in advance,
> 
> Lo&#65533;c
> 

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Agree: Re: Run ending prematurely but without error   (Loc Martin - 10 Apr, 2013)
2 Agree: Re: Run ending prematurely but without error   (Seb Galer - 11 Apr, 2013)
 Add Message Add Message
to: "Re: Run ending prematurely but without error"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]