Message: Re: Disaster in CLHEP::RandGauss - thread related? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Warning Re: Disaster in CLHEP::RandGauss - thread related? 

Forum: Installation and Configuration
Re: Question Disaster in CLHEP::RandGauss - thread related? (Tom Roberts)
Date: 05 Jun, 2015
From: Michael H. Kelsey <Michael H. Kelsey>

On Fri, 05 Jun 2015 16:44:39 GMT, Tom Roberts wrote:
> This is Windows 7 using CMAKE 3.2.1 and Visual Studio 2013 (VC++ 12).
> This is geant4.10.01.p01. All tools are 32-bits (needed because
> ultimately I will link with Root).
> 
> I'm reporting this in "installation and configuration" because this is
> clearly a configuration problem. On my Mac this runs correctly (Mac OS X
> 9.5, cmake 2.8.12.2, and g++ 4.2.1, via Makefile).

MacOSX doesn't do multithreaded. And it's multithreaded which is the problem. See below.

> I built Geant4 using CMake and VisualStudio, in Debug mode, taking all
> the defaults (i.e. shared libraries and the internal version of CLHEP).
> I found no option for threads.
> 
> This trivial program crashes after printing "A" only:
> //      RandGaussTest.cc
> #include <stdio.h>
> #include "Randomize.hh"
> int main()
> {
>         fprintf(stderr,"A\n");
>         CLHEP::RandGauss::setFlag(false);
>         fprintf(stderr,"B\n");
>         return 0;
> }

This was a known problem with CLHEP in the migration to MT. We have MT-capable versions of all the CLHEP generators, if you use the G4-prefixed names. Above, use G4RandGauss instead of CLHEP::RandGauss, and you should get the proper behaviour.

  -- Michael Kelsey

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

1 None: Re: Disaster in CLHEP::RandGauss - thread related?   (Tom Roberts - 05 Jun, 2015)
1 None: Re: Disaster in CLHEP::RandGauss - thread related?   (Tom Roberts - 05 Jun, 2015)
2 None: Re: Disaster in CLHEP::RandGauss - thread related?   (Mike Kelsey - 05 Jun, 2015)
1 None: Re: Disaster in CLHEP::RandGauss - thread related?   (Tom Roberts - 05 Jun, 2015)
... 4 Message(s)
 Add Message Add Message
to: "Re: Disaster in CLHEP::RandGauss - thread related?"

 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 ]