Giter Club home page Giter Club logo

Comments (5)

Weiming-Hu avatar Weiming-Hu commented on July 28, 2024

If I do not truncate the FLTs or if I have fewer than 4 FLTs, RAnEn::generateAnalogs will finish without a problem. Otherwise, for example, when I have 4 FLTs in the forecasts, the function will return the error of stack overflow.

from analogsensemble.

Weiming-Hu avatar Weiming-Hu commented on July 28, 2024

I noticed that if I open a new R session, and source the entire file once, it should complete. When the R session is still alive, I noticed that I have many undealt R sessions. In total there are 32 R session, exatly the number of cores I have. I suspect this has something to do with OpenMP. Although I'm not familiar of how OpenMP and Rcpp work together, the extra R sessions should be terminated when they are done.

screen shot 2019-02-22 at 11 39 59 pm

If I source the R script again, the exact same script fails this time.

from analogsensemble.

Weiming-Hu avatar Weiming-Hu commented on July 28, 2024

Debugging the memory issue with R + Valgrind.

R -d valgrind

reference

from analogsensemble.

Weiming-Hu avatar Weiming-Hu commented on July 28, 2024

Looks like there is an invalid write happening somewhere in the code.

==17485== Thread 12:                                                          
==17485== Invalid write of size 8                                                       
==17485==    at 0x1060694A: Functions::computeStandardDeviation(Forecasts_array const&, StandardDeviation&, std::vector<unsigned long, std::allocator<unsigned long> >) const [clone ._omp_fn.0] (Function
s.cpp:72)                                                                                                                                                                                                 
==17485==    by 0x75E997D: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)                                                                                                                            
==17485==    by 0x78096DA: start_thread (pthread_create.c:463)                                                                                                                                            
==17485==    by 0x558688E: clone (clone.S:95)                                                                                                                                                             
==17485==  Address 0xb562240 is 0 bytes after a block of size 1,968 alloc'd                                                       
==17485==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==17485==    by 0x4F80133: ??? (in /usr/lib/R/lib/libR.so)
==17485==    by 0x4F80346: Rf_allocSExp (in /usr/lib/R/lib/libR.so)
==17485==    by 0x4F176DC: ??? (in /usr/lib/R/lib/libR.so)    
==17485==    by 0x4F84289: Rf_installChar (in /usr/lib/R/lib/libR.so)
==17485==    by 0x4FEEBDC: Rf_installTrChar (in /usr/lib/R/lib/libR.so)
==17485==    by 0x4F2920F: ??? (in /usr/lib/R/lib/libR.so)
==17485==    by 0x4F3EE4A: ??? (in /usr/lib/R/lib/libR.so)    
==17485==    by 0x4F4E1D7: Rf_eval (in /usr/lib/R/lib/libR.so)
==17485==    by 0x4F5066D: ??? (in /usr/lib/R/lib/libR.so)    
==17485==    by 0x4F4569D: ??? (in /usr/lib/R/lib/libR.so)
==17485==    by 0x4F4E1D7: Rf_eval (in /usr/lib/R/lib/libR.so)
==17485==  

from analogsensemble.

Weiming-Hu avatar Weiming-Hu commented on July 28, 2024

Bug resolved. This is caused when you are only using part of the times in search times to create analogs. A memory overflow is caused by wrong indexing. This is fixed.

from analogsensemble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.