This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gomp_target_fini
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Bernd Schmidt <bschmidt at redhat dot com>, Ilya Verbin <iverbin at gmail dot com>, Chung-Lin Tang <cltang at codesourcery dot com>, James Norris <jnorris at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Tue, 19 Apr 2016 18:23:51 +0300 (MSK)
- Subject: Re: gomp_target_fini
- Authentication-results: sourceware.org; auth=none
- References: <20151201081800 dot GN5675 at tucnak dot redhat dot com> <C5AE729F-0BA3-4933-91E1-E4729107798B at gmail dot com> <20151201131559 dot GU5675 at tucnak dot redhat dot com> <20151201172927 dot GA7692 at msticlxl57 dot ims dot intel dot com> <20151201190504 dot GY5675 at tucnak dot redhat dot com> <20151208144559 dot GB14238 at msticlxl57 dot ims dot intel dot com> <20151211172713 dot GF5675 at tucnak dot redhat dot com> <20151214164736 dot GA63018 at msticlxl57 dot ims dot intel dot com> <87r3impode dot fsf at kepler dot schwinge dot homeip dot net> <56A0F83E dot 3040808 at redhat dot com> <20160122101607 dot GN3017 at tucnak dot redhat dot com> <87d1pl3dgd dot fsf at hertz dot schwinge dot homeip dot net>
On Tue, 19 Apr 2016, Thomas Schwinge wrote:
> Well, I certainly had done at least some thinking before proposing this:
> we're talking about the libgomp "fatal exit" function, called when
> something has gone very wrong, and we're about to terminate the process,
> because there's no hope to recover.
By the way, this relates to something I wanted to bring up for a while now.
The OpenMP spec does not talk about error conditions arising in well-formed
programs due to resource exhaustion (OOM, in particular). My understanding
is that an implementation always has a "way out": if e.g. it fails to allocate
memory required for a thread, it could run with reduced parallelism.
Ultimately the implementation can "fail gracefully" all the way back to
running the program sequentially.
Offloading makes that unclear due to how host fallbacks for target regions are
observable (which I don't understand, and I hope we get a chance to discuss
it), but is the above understanding generally correct? Today libgomp is
clearly "trigger happy" to crash the process when something goes slightly
wrong, but was graceful failure ever considered as a design [non-]goal?
In that light, can a general policy of avoiding aborting the program be in
place, and should plugin authors work towards introducing fallback paths
instead of [over-]using GOMP_PLUGIN_fatal?
Thanks.
Alexander