Re: [OMPI users] Cannot catch std::bac_alloc?

2019-04-03 Thread Zhen Wang
OK. After help from several forums, I think I understand the cause of the problem. As Jeff said, it has nothing to do with MPI. Linux allows over committing (Thanks Joseph). See here and here

Re: [OMPI users] Cannot catch std::bac_alloc?

2019-04-03 Thread Jeff Hammond
This is not an MPI problem. You will likely find StackOverflow to be a more effective way to get support on C++ issues. Jeff On Wed, Apr 3, 2019 at 8:47 AM Zhen Wang wrote: > Joseph, > > Thanks for your response. I'm no expert on Linux so please bear with me. > If I understand correctly,

Re: [OMPI users] Cannot catch std::bac_alloc?

2019-04-03 Thread Zhen Wang
Joseph, Thanks for your response. I'm no expert on Linux so please bear with me. If I understand correctly, using malloc instead of resize should allow me to handle out of memory error properly, but I still see abnormal termination (code is attached). I have more questions. 1. If the problem is

Re: [OMPI users] Cannot catch std::bac_alloc?

2019-04-03 Thread Joseph Schuchart
Zhen, The "problem" you're running into is memory overcommit [1]. The system will happily hand you a pointer to memory upon calling malloc without actually allocating the pages (that's the first step in std::vector::resize) and then terminate your application as soon as it tries to actually