[Trilinos-Users] Teuchos::RCPNode is not destroyed yet

Bartlett, Roscoe A. bartlettra at ornl.gov
Wed Nov 5 12:09:16 MST 2014


I would have to see the program and the entire output by my guess is that the program was forcibly terminated for some reason (either by your code or some other library you are calling).  Calling exit(), abort() (or anything that does that) is not compatible with C++ software (or any software that wants to play nice with other libraries for that matter).   To terminate a C++ program, you want throw an exception to unwind the stack then catch any exceptions in main().   If you want to forcibly terminate and don't want to see this output then just turn off RCP node tracing (-i.e. configure with -DTeuchos_ENABLE_DEBUG_RCP_NODE_TRACING=OFF).

-Ross


From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf Of Sunghwan Choi
Sent: Monday, November 03, 2014 9:51 PM
To: trilinos-users at software.sandia.gov
Subject: [Trilinos-Users] Teuchos::RCPNode is not destroyed yet

Dear all,
Hi, I am a tpetra user. I recently start to use Tpetra::HybridPlatform. My code works fine but it gives a warning message, which means Teuchos::RCPNode is constructed but not destroyed until program ended.
In my code, there is no explicit calling the constructor of RCPNode but only call platform like


Teuchos::oblackholestream blackhole;
Teuchos::GlobalMPISession mpiSession(&argc,&argv,&blackhole);
Teuchos::RCP<const Teuchos::Comm<int> > comm = Teuchos::createMpiComm<int>(Teuchos::opaqueWrapper<MPI_Comm>(MPI_COMM_WORLD));

std::string machine_list(
        "<ParameterList>                                                                     "
        "  <ParameterList name='%1=0'>                                                       "
        "    <Parameter name='NodeType' type='string' value='KokkosClassic::OpenMPNode'/>       "
        "    <Parameter name='Verbose' type='int' value='1'/>                                "
        "    <Parameter name='Num Threads' type='int' value='4'/>                            "
        "  </ParameterList>                                                                  "
        "</ParameterList>                                                                    "

         );

Tpetra::HybridPlatform platform(comm, machPL);

Here, I attach the warning message. If you have some useful information about it, please do not hesitate to contact me.
Best
Sunghwan Choi

*** Warning! The following Teuchos::RCPNode objects were created but have
*** not been destroyed yet.  A memory checking tool may complain that these
*** objects are not destroyed correctly.
***
*** There can be many possible reasons that this might occur including:
***
***   a) The program called abort() or exit() before main() was finished.
***      All of the objects that would have been freed through destructors
***      are not freed but some compilers (e.g. GCC) will still call the
***      destructors on static objects (which is what causes this message
***      to be printed).
***
***   b) The program is using raw new/delete to manage some objects and
***      delete was not called correctly and the objects not deleted hold
***      other objects through reference-counted pointers.
***
***   c) This may be an indication that these objects may be involved in
***      a circular dependency of reference-counted managed objects.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://software.sandia.gov/pipermail/trilinos-users/attachments/20141105/025a80f5/attachment.html>


More information about the Trilinos-Users mailing list