[mlpack-git] [mlpack] removing global dependency on cli deleter (#521)

Joseph Mariadassou notifications at github.com
Wed Feb 24 19:36:53 EST 2016


Also note that in the current 'master' cliDeleter is static declared
outside a class. AFAIK every translation unit that #includes cli.hpp has an
instance of cliDeleter. This is not what you want.

On Thu, Feb 25, 2016 at 9:22 AM, Joe Mariadassou <joe.mariadassou at gmail.com>
wrote:

> Using:
>
> CLI& CLI::GetSingleton()
> {
>   static CLI instance;
>   Log::Info << "Getting Singleton\n"; ////modified for test///////////
>   return instance;
> }
>
>
> The call stack I get on crash is
>
> mlpack_allknn.exe!std::operator<<<char,std::char_traits<char>,std::allocator<char>
> >... Line 177    C++
>      mlpack_allknn.exe!mlpack::util::PrefixedOutStream::BaseLogic<char
> const * __ptr64>... Line 76    C++
>      mlpack_allknn.exe!mlpack::util::PrefixedOutStream::operator<<... Line
> 93    C++
>      mlpack_allknn.exe!mlpack::CLI::GetSingleton... Line 342    C++
>      mlpack_allknn.exe!mlpack::CLI::RegisterProgramDoc... Line 670    C++
>      mlpack_allknn.exe!mlpack::util::ProgramDoc::ProgramDoc... Line 33
> C++
>      mlpack_allknn.exe!`dynamic initializer for
> 'io_programdoc_dummy_object''... Line 26    C++
>
> ProgramDoc is initialized before
> CLI::Singleton which is initialized before
> Log::Info
>
> The last two are out of order and hence the crash. Removing my mod will
> cause the crash at the end rather than at the beginning.
>
> (a) My first suggestion, which I am not sure about, is to move
> PROGRAM_INFO etc., to inside main.
>
> (b) The other option is to go back to CLI_Deleter, except declare the
> CLI_Deleter static instance in log.cpp after Log::Fatal
>
> I'll test my second suggestion and get back to you.
>
> On Thu, Feb 25, 2016 at 1:33 AM, Ryan Curtin <notifications at github.com>
> wrote:
>
>> No specific dataset needed; you can make a very simple csv:
>>
>> 1, 2
>> 3, 4
>> 5, 6
>>
>> Then, on the systems I've tried, I get
>>
>> $ bin/mlpack_allknn -r f.csv -v -k 3
>> [DEBUG] Compiled with debugging symbols.
>> [WARN ] Neither --neighbors_file nor --distances_file is specified, so the nearest neighbor search results will not be saved!
>> [INFO ] Loading 'f.csv' as CSV data.  Size is 2 x 3.
>> [INFO ] Loaded reference data from 'f.csv' (2 x 3).
>> [INFO ] Building reference tree...
>> [INFO ] Tree built.
>> [INFO ] Searching for 3 nearest neighbors with dual-tree kd-tree search...
>> [INFO ] 3 node combinations were scored.
>> [INFO ] 6 base cases were calculated.
>> [INFO ] Search complete.
>> pÛyg_neighbors
>> pÛyg_neighborsExecution parameters:
>> pÛyn parameter  distances_file: ""
>> pÛyn parameter  help: false
>> pÛyrameter  info: ""
>> pÛyrameter  input_model_file: ""
>> pÛydel_fileer  k: 3
>> pÛyfileer  leaf_size: 20
>> pÛyfileer  naive: false
>> pÛyfileer  neighbors_file: ""
>> pÛyfileer  output_model_file: ""
>> pÛyodel_filer  query_file: ""
>> pÛyodel_filer  random_basis: false
>> pÛyodel_filer  reference_file: f.csv
>> pÛyodel_filer  seed: 0
>> pÛy_filer  single_mode: false
>> pÛy_filer  tree_type: kd
>> pÛy_filer  verbose: true
>> pÛy_filer  version: false
>> pÛy_filer
>> pÛy_filerProgram timers:
>> pÛy_filer  computing_neighbors: 0.000053s
>> pÛyg_neighbors  loading_data: 0.000186s
>> pÛyg_neighbors  total_time: 0.001866s
>> pÛyg_neighbors  tree_building: 0.000051s
>>
>>>> Reply to this email directly or view it on GitHub
>> <https://github.com/mlpack/mlpack/pull/521#issuecomment-188279136>.
>>
>
>
>
> --
> Joseph Chakravarti Mariadassou
> http://thesundayprogrammer.com
>
>


-- 
Joseph Chakravarti Mariadassou
http://thesundayprogrammer.com


---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/521#issuecomment-188535026
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160224/39dd03c2/attachment.html>


More information about the mlpack-git mailing list