Open sophiehourihane opened 1 year ago
The multiple threads are started by BLAS, probably b/c of OpenMP, for which there should be a simple way of either switching that off, or setting the number of threads to 1.
As for the crash:
auto dataBuilder = std::make_unique<LalDataBuilder>(argc, argv);
RunBuilder runBuilder{argc, argv, std::move(dataBuilder)};
auto run = runBuilder.build();
but the Python code is:
dataBuilder = Cpp.LalDataBuilder(len(split_command_line), split_command_line)
self.runBuilder = Cpp.RunBuilder(len(split_command_line), split_command_line, Cpp.std.move(dataBuilder))
self.run = self.runBuilder.build()
which is missing that std.make_unique
.
What that means is that the std.move
is applied to the LalDataBuilder
object in Python, but in C++ it's applied to the std::unique_ptr<LalDataBuilder>
object. std::move
is a cast that doesn't necessarily lead to a call of the move constructor, only if needed, but does LalDataBuilder
have one and if yes, is it clearing state it shouldn't?
I am not sure the best way to frame this but I am testing a build function here:
The same code in C++ looks like this
When I call the test case from my laptop (Mac) it runs perfectly, but when I call it from a cluster (using linux) the test segfaults when runBuilder.build() is called.
Inside of runBuilder the call looks like this:
It seems like it calls the dataBuilder->build method. (I added print statements and nothing is getting printed from within `dataBuilder->build()`) so it looks like it runBuilder is unable to call databuilder in the first place. However, the actual traceback has little to do with dataBuilder.
The traceback is this:
Which is confusing for many reasons: 1) I am explicitly using a single thread, why are there multiple threads in the traceback? (It fails with the same error when threading is turned on) 2)
unconditional_prior_distribution.ipp
is not called by databuilder (it is called later by runBuilder) 3) This exact call works from c++ on the linux machine (and python and c++ on my mac)If you have any pointers for what I am doing wrong that would be great. I am hoping I am maybe just treating std::make_unique incorrectly?
Thank you!