marley-mc / marley Goto Github PK
View Code? Open in Web Editor NEWA Monte Carlo event generator for tens-of-MeV neutrino-nucleus interactions
License: GNU General Public License v3.0
A Monte Carlo event generator for tens-of-MeV neutrino-nucleus interactions
License: GNU General Public License v3.0
Venkatesh Iyer reports linker trouble building the example executables on Ubuntu. The cause appears to be the need to add -Wl,--no-as-needed
to the compiler flags since the Ubuntu build of the GCC linker adds -Wl,--as-needed
by default (see http://www.bnikolic.co.uk/blog/gnu-ld-as-needed.html). This is already done in the main MARLEY Makefile
, but for the example programs it will be most convenient to handle at the marley-config
level rather than requiring the user to add it manually.
Currently, the electron scattering cross-section is hard coded via the coupling constants (g1 g2). It might be useful to have user-defined parameters because.
The final state particles seem to not include timing information.
For CC events like nu_e + Ar40 -> K* + e -> K + gamma + e, the delayed gamma coming from the K de-excitation could be used as for background and signal selection.
To use this information would make the simulation of time necessary.
When parsing /package_srcs/marley/examples/config/COPY_ME.js
Error:
It outputs:
Seeded random number generator with 123456Created Fermi-Dirac 1000170370νe source with parameters
60 has a tabulated decay scheme in the file Cl.dat
before having a segmentation fault
Expected behavior:
I would expect it to return a marley::Generator object with the configuration as set in the COPY_ME.js file
Minimal working example:
config_file_name = std::string(std::getenv("MARLEY"))+"/examples/config/COPY_ME.js"
fMarleyMessenger = new MarleyMessenger(this);
marley::JSONConfig config(config_file_name);
marley_generator_= config.create_generator();
std::cout << "Finished creating marley generator\n";
Version:
c80cfb5-dirty
Stacktrace:
sndwrm(65619,0x280887000) malloc: Heap corruption detected, free list is damaged at 0x6000005f6dc0
*** Incorrect guard value: 105553219572816
Process 65619 stopped
* thread #8, stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
frame #0: 0x0000000100f7cf98 libMARLEY.dylib`std::__1::__shared_count::__release_shared[abi:v15006]() + 56
libMARLEY.dylib`std::__1::__shared_count::__release_shared[abi:v15006]:
-> 0x100f7cf98 <+56>: ldr x8, [x8, #0x10]
0x100f7cf9c <+60>: blr x8
0x100f7cfa0 <+64>: mov w8, #0x1
0x100f7cfa4 <+68>: and w8, w8, #0x1
Target 0: (sndwrm) stopped.
Backtrace:
* thread #9, stop reason = EXC_BAD_ACCESS (code=1, address=0xbeadce37a4a0)
* frame #0: 0x000000018e744858 libc++.1.dylib`std::__1::__shared_weak_count::__release_weak() + 44
frame #1: 0x0000000100f7cf50 libMARLEY.dylib`std::__1::__shared_weak_count::__release_shared[abi:v15006]() + 44
frame #2: 0x0000000100f7cf10 libMARLEY.dylib`std::__1::shared_ptr<std::__1::basic_ostream<char, std::__1::char_traits<char> > >::~shared_ptr[abi:v15006]() + 64
frame #3: 0x0000000100f7cec0 libMARLEY.dylib`std::__1::shared_ptr<std::__1::basic_ostream<char, std::__1::char_traits<char> > >::~shared_ptr[abi:v15006]() + 28
frame #4: 0x0000000100f7ce94 libMARLEY.dylib`marley::Logger::OutStream::~OutStream() + 28
frame #5: 0x0000000100f7cc08 libMARLEY.dylib`marley::Logger::OutStream::~OutStream() + 28
frame #6: 0x0000000100fdfd10 libMARLEY.dylib`marley::Logger::OutStreamVector& marley::Logger::OutStreamVector::operator<<<char [23]>(char const (&) [23]) + 184
frame #7: 0x0000000100fd6124 libMARLEY.dylib`marley::Logger::Message&& marley::Logger::Message::operator<<<char [23]>(char const (&) [23]) + 40
frame #8: 0x0000000101042b68 libMARLEY.dylib`marley::StructureDatabase::load_structure_index() + 536
frame #9: 0x00000001010423a8 libMARLEY.dylib`marley::StructureDatabase::get_decay_scheme(int) + 232
frame #10: 0x0000000101035758 libMARLEY.dylib`(anonymous namespace)::set_level_ptrs(std::__1::vector<marley::MatrixElement, std::__1::allocator<marley::MatrixElement> >&, int, int, marley::StructureDatabase&) + 52
frame #11: 0x000000010103530c libMARLEY.dylib`marley::Reaction::load_from_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, marley::StructureDatabase&) + 2136
frame #12: 0x0000000100ff357c libMARLEY.dylib`marley::JSONConfig::prepare_reactions(marley::Generator&) const + 860
frame #13: 0x0000000100fef43c libMARLEY.dylib`marley::JSONConfig::create_generator() const + 560
frame #14: 0x0000000100028db0 sndwrm`PrimaryGeneratorAction::PrimaryGeneratorAction(this=0x0000000109501800) at PrimaryGeneratorAction.cc:71:29 [opt]
stepping w/ lldb through the create_generator function in marley pinpointed the error to prepare_direction
* thread #8, stop reason = breakpoint 2.1
frame #0: 0x00000001015f5ffc libMARLEY.dylib`marley::JSONConfig::prepare_direction(marley::Generator&) const
libMARLEY.dylib`marley::JSONConfig::prepare_direction:
-> 0x1015f5ffc <+0>: stp x20, x19, [sp, #-0x20]!
0x1015f6000 <+4>: stp x29, x30, [sp, #0x10]
0x1015f6004 <+8>: add x29, sp, #0x10
0x1015f6008 <+12>: sub x9, sp, #0x300
Target 0: (sndwrm) stopped.
(lldb) continue
Process 78721 resuming
Incident neutrino direction: (0.000000, 0.000000, 1.000000)
=================================================================
==78721==ERROR: AddressSanitizer: container-overflow on address 0x00010b6f7c40 at pc 0x0001015ee97c bp 0x00016ff0f310 sp 0x00016ff0f308
WRITE of size 8 at 0x00010b6f7c40 thread T7
Seeded random number generator with 1696014266373310
PrimaryGenAction: Marley config file is /Users/jackxu/local_code/package_srcs/marley/examples/config/COPY_ME.js
PrimaryGenAction: Unused if nu_e is not specified
Process 78721 stopped
* thread #7, stop reason = breakpoint 3.1
frame #0: 0x00000001015f35c4 libMARLEY.dylib`marley::JSONConfig::create_generator() const
libMARLEY.dylib`marley::JSONConfig::create_generator:
-> 0x1015f35c4 <+0>: stp x20, x19, [sp, #-0x20]!
0x1015f35c8 <+4>: stp x29, x30, [sp, #0x10]
0x1015f35cc <+8>: add x29, sp, #0x10
0x1015f35d0 <+12>: sub x9, sp, #0x600
Target 0: (sndwrm) stopped.
Doing image lookup gives
(lldb) image lookup --address 0x0001015ee97c
Address: libMARLEY.dylib[0x00000000001b697c] (libMARLEY.dylib.__TEXT.__text + 1782704)
Summary: libMARLEY.dylib`marley::Integrator::Integrator(unsigned long) + 816
Bishu Behera from Colorado State noticed some odd behavior while doing DUNE photon detector simulations. Further investigation revealed that the problem was caused by a few levels in the 40K decay scheme (structure/z019) which lacked any tabulated gamma transitions. The levels with missing gammas were introduced when the 40K structure data were reprocessed for v1.1.0 based on the latest ENSDF evaluation.
Nitali Dash from IHEP encountered the following error while building the MARLEY ROOT dictionaries. This issue appears to be limited to builds involving ROOT 5.
/home/nitali/Root/root/bin/rootcint -f marley_root_dict.cc -c -I../include marley/Particle.hh marley/Event.hh marley/marley_linkdef.hh
g++ -pthread -m64 -I/home/nitali/Root/root/include -O3 -std=c++14 -I../include -Wall -Wextra -Wpedantic -Wno-error=unused-parameter -Wcast-align -Wl,--no-as-needed -DUSE_ROOT -I/usr/local/include \
-I../include -fPIC -o marley_root_dict.o -c marley_root_dict.cc
marley_root_dict.cc: In function ‘int G__marley_root_dict_170_0_25(G__value*, const char*, G__param*, int)’:
marley_root_dict.cc:662:29: error: variable ‘const marley::JSON xobj’ has initializer but incomplete type
const marley::JSON xobj = ((const marley::Particle*) G__getstructoffset())->to_json();
^~~~
marley_root_dict.cc:662:94: error: invalid use of incomplete type ‘class marley::JSON’
arley::JSON xobj = ((const marley::Particle*) G__getstructoffset())->to_json();
^
In file included from marley_root_dict.h:34:0,
from marley_root_dict.cc:17:
../include/marley/Particle.hh:11:9: note: forward declaration of ‘class marley::JSON’
class JSON;
^~~~
marley_root_dict.cc:663:38: error: invalid use of incomplete type ‘class marley::JSON’
pobj = new marley::JSON(xobj);
^
In file included from marley_root_dict.h:34:0,
from marley_root_dict.cc:17:
../include/marley/Particle.hh:11:9: note: forward declaration of ‘class marley::JSON’
class JSON;
^~~~
marley_root_dict.cc: In function ‘int G__marley_root_dict_171_0_25(G__value*, const char*, G__param*, int)’:
marley_root_dict.cc:1026:29: error: variable ‘const marley::JSON xobj’ has initializer but incomplete type
const marley::JSON xobj = ((const marley::Event*) G__getstructoffset())->to_json();
^~~~
marley_root_dict.cc:1026:91: error: invalid use of incomplete type ‘class marley::JSON’
t marley::JSON xobj = ((const marley::Event*) G__getstructoffset())->to_json();
^
In file included from marley_root_dict.h:34:0,
from marley_root_dict.cc:17:
../include/marley/Particle.hh:11:9: note: forward declaration of ‘class marley::JSON’
class JSON;
^~~~
marley_root_dict.cc:1027:38: error: invalid use of incomplete type ‘class marley::JSON’
pobj = new marley::JSON(xobj);
^
In file included from marley_root_dict.h:34:0,
from marley_root_dict.cc:17:
../include/marley/Particle.hh:11:9: note: forward declaration of ‘class marley::JSON’
class JSON;
^~~~
Makefile:123: recipe for target 'marley_root_dict.o' failed
make: *** [marley_root_dict.o] Error 1
rm RootJSONConfig.o WeisskopfSingleParticleModel.o Reaction.o marley_utils.o BackshiftedFermiGasModel.o ExitChannel.o Logger.o Generator.o HauserFeshbachDecay.o RootConfigurationFile.o Gamma.o Level.o StandardLorentzianModel.o JSONConfig.o Particle.o coulomb_wavefunctions.o MassTable.o Integrator.o marley_root.o DecayScheme.o GammaStrengthFunctionModel.o KoningDelarocheOpticalModel.o NeutrinoSource.o ConfigurationFile.o Event.o marley_kinematics.o StructureDatabase.o NuclearReaction.o RotationMatrix.o
Howdy! I'm working with Dave Elofson ( @delofson0211) at Texas A&M on the QPix simulation. He was having trouble building Marley, which I was able to isolate to an unexpected feature in the Makefile:
Line 16 in 08f69e2
Line 19 in 08f69e2
By using ?=
here, the required compiler flags are not appended to the user's environment, but instead are thrown away. Without the c++14 selection, the code won't compile.
The Texas A&M HPRC cluster provides a buildenv
Lmod module, which creates a comprehensive set of envvars for compilers (CC, CXX, F90, etc.), include directories, compiler flags (CPPFLAGS, CFLAGS, CXXFLAGS, ...), and so on. In particular, it sets CXXFLAGS=-O2 -ftree-vectorize -march=native -fno-math-errno
.
Is there a reason for using ?=
? If not, could it be changed to +=
? If the user doesn't have CXXFLAGS set, the behaviour will remain the same; if it is set, the Marley flags will be added to the current ones.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.