octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exposing do_octave_atexit in the API


From: c.
Subject: Re: exposing do_octave_atexit in the API
Date: Thu, 27 Feb 2014 08:07:38 +0100

Hi,

I really need help with the problem describe below, 
is there anyone who understands this part of the code,
and can help me get more insight?

Thanks,
c.



On 11 Feb 2014, at 16:37, c. <address@hidden> wrote:

> Hi,
> 
> I'm embedding the interpreter in an MPI application,
> so I need to call both clean_up_and_exit (0) and MPI_Finalize () at the and 
> of my code.
> 
> Unfortunately whatever order I choose causes a crash when the application 
> tries to exit.
> 
> By applying the patch below to toplev.{cc,h} I can di
> 
> 
> do_octave_atexit ();
> MPI_Finalize ();
> return (0);
> 
> 
> and have my application shut down gracefully.
> Does anyone know whether this patch is harmful in any way?
> Would it be OK to apply it in the repository? 
> Is there a better way to achieve the same?
> 
> Thanks,
> c.
> 
> 
> diff --git a/libinterp/corefcn/toplev.cc b/libinterp/corefcn/toplev.cc
> --- a/libinterp/corefcn/toplev.cc
> +++ b/libinterp/corefcn/toplev.cc
> @@ -662,7 +662,7 @@
> 
> static std::list<std::string> octave_atexit_functions;
> 
> -static void
> +void
> do_octave_atexit (void)
> {
>   static bool deja_vu = false;
> diff --git a/libinterp/corefcn/toplev.h b/libinterp/corefcn/toplev.h
> --- a/libinterp/corefcn/toplev.h
> +++ b/libinterp/corefcn/toplev.h
> @@ -485,4 +485,7 @@
>     } \
>   while (0)
> 
> +void
> +do_octave_atexit (void);
> +
> #endif
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]