public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Allow redefinition of libcilkrts debug macros
@ 2016-04-26 14:04 Rainer Orth
  2016-04-26 20:47 ` Jeff Law
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Orth @ 2016-04-26 14:04 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ilya Verbin, Balaji V. Iyer

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

When working on a couple of Cilk Plus issues lately (PRs target/60290,
target/68945), I noticed that you have to modify the libcilkplus sources
to enable various debugging output.  This seems silly, and the following
patch allows defining them from the command line.

Tested on i386-pc-solaris2.12 and sparc-sun-solaris2.12.

Ok for mainline?

	Rainer


2016-04-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* runtime/except-gcc.cpp (DEBUG_EXCEPTIONS): Allow redefinition.
	* runtime/cilk_fiber.h (FIBER_DEBUG): Likewise.
	* runtime/scheduler.h (REDPAR_DEBUG): Likewise.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libcilkrts-debug-redefine.patch --]
[-- Type: text/x-patch, Size: 1245 bytes --]

# HG changeset patch
# Parent  072a0724a080e27be15d001b8507af7a2490d73d
Allow redefinition of libcilkrts debug macros

diff --git a/libcilkrts/runtime/cilk_fiber.h b/libcilkrts/runtime/cilk_fiber.h
--- a/libcilkrts/runtime/cilk_fiber.h
+++ b/libcilkrts/runtime/cilk_fiber.h
@@ -63,7 +63,9 @@
  * A value of 0 means no debugging.
  * Higher values generate more debugging output.
  */
+#ifndef FIBER_DEBUG
 #define FIBER_DEBUG 0
+#endif
 
 /**
  * @brief Flag for validating reference counts.
diff --git a/libcilkrts/runtime/except-gcc.cpp b/libcilkrts/runtime/except-gcc.cpp
--- a/libcilkrts/runtime/except-gcc.cpp
+++ b/libcilkrts/runtime/except-gcc.cpp
@@ -49,7 +49,9 @@
 #include <stdint.h>
 #include <typeinfo>
 
+#ifndef DEBUG_EXCEPTIONS
 #define DEBUG_EXCEPTIONS 0
+#endif
 
 struct pending_exception_info
 {
diff --git a/libcilkrts/runtime/scheduler.h b/libcilkrts/runtime/scheduler.h
--- a/libcilkrts/runtime/scheduler.h
+++ b/libcilkrts/runtime/scheduler.h
@@ -74,7 +74,9 @@
  * Print debugging messages and assertions for parallel reducers. 0 is
  * no debugging.  A higher value generates more output.
  */
+#ifndef REDPAR_DEBUG
 #define REDPAR_DEBUG 0
+#endif
 
 /**
  * @brief Lock the worker mutex to allow exclusive access to the

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Allow redefinition of libcilkrts debug macros
  2016-04-26 14:04 Allow redefinition of libcilkrts debug macros Rainer Orth
@ 2016-04-26 20:47 ` Jeff Law
  2016-04-29  8:58   ` Rainer Orth
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff Law @ 2016-04-26 20:47 UTC (permalink / raw)
  To: Rainer Orth, gcc-patches; +Cc: Ilya Verbin, Balaji V. Iyer

On 04/26/2016 08:04 AM, Rainer Orth wrote:
> When working on a couple of Cilk Plus issues lately (PRs target/60290,
> target/68945), I noticed that you have to modify the libcilkplus sources
> to enable various debugging output.  This seems silly, and the following
> patch allows defining them from the command line.
>
> Tested on i386-pc-solaris2.12 and sparc-sun-solaris2.12.
>
> Ok for mainline?
>
> 	Rainer
>
>
> 2016-04-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
> 	* runtime/except-gcc.cpp (DEBUG_EXCEPTIONS): Allow redefinition.
> 	* runtime/cilk_fiber.h (FIBER_DEBUG): Likewise.
> 	* runtime/scheduler.h (REDPAR_DEBUG): Likewise.
Ilya will have to chime in here -- we're a downstream consumer of the 
Cilk+ runtime.  So these patches need to go into Intel's tree first, 
then Ilya can bring them into the GCC tree.

jeff

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Allow redefinition of libcilkrts debug macros
  2016-04-26 20:47 ` Jeff Law
@ 2016-04-29  8:58   ` Rainer Orth
  2016-04-29 11:47     ` Ilya Verbin
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Rainer Orth @ 2016-04-29  8:58 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches, Ilya Verbin, Balaji V. Iyer

Hi Jeff,

> On 04/26/2016 08:04 AM, Rainer Orth wrote:
>> When working on a couple of Cilk Plus issues lately (PRs target/60290,
>> target/68945), I noticed that you have to modify the libcilkplus sources
>> to enable various debugging output.  This seems silly, and the following
>> patch allows defining them from the command line.
>>
>> Tested on i386-pc-solaris2.12 and sparc-sun-solaris2.12.
>>
>> Ok for mainline?
>>
>> 	Rainer
>>
>>
>> 2016-04-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>>
>> 	* runtime/except-gcc.cpp (DEBUG_EXCEPTIONS): Allow redefinition.
>> 	* runtime/cilk_fiber.h (FIBER_DEBUG): Likewise.
>> 	* runtime/scheduler.h (REDPAR_DEBUG): Likewise.
> Ilya will have to chime in here -- we're a downstream consumer of the Cilk+
> runtime.  So these patches need to go into Intel's tree first, then Ilya
> can bring them into the GCC tree.

I suspected that much.  It would be good to have a libcilkrts/README.gcc
describing the rules which changes can go into the gcc tree directly,
which need to go upstream first, and how.  libo and libsanitizer already
have this.

Having a listed libcilkrts maintainer would probably help, too ;-)

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Allow redefinition of libcilkrts debug macros
  2016-04-29  8:58   ` Rainer Orth
@ 2016-04-29 11:47     ` Ilya Verbin
  2016-04-29 12:08       ` Rainer Orth
  2016-05-03 12:04       ` Rainer Orth
  2016-04-29 16:08     ` Iyer, Balaji V
  2016-04-30  3:11     ` Jeff Law
  2 siblings, 2 replies; 9+ messages in thread
From: Ilya Verbin @ 2016-04-29 11:47 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Jeff Law, gcc-patches, Ilya Verbin, Balaji V. Iyer

Hi Rainer!

On Fri, Apr 29, 2016 at 10:58:25 +0200, Rainer Orth wrote:
> > On 04/26/2016 08:04 AM, Rainer Orth wrote:
> >> When working on a couple of Cilk Plus issues lately (PRs target/60290,
> >> target/68945), I noticed that you have to modify the libcilkplus sources
> >> to enable various debugging output.  This seems silly, and the following
> >> patch allows defining them from the command line.
> >>
> >> Tested on i386-pc-solaris2.12 and sparc-sun-solaris2.12.
> >>
> >> Ok for mainline?
> >>
> >> 	Rainer
> >>
> >>
> >> 2016-04-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> >>
> >> 	* runtime/except-gcc.cpp (DEBUG_EXCEPTIONS): Allow redefinition.
> >> 	* runtime/cilk_fiber.h (FIBER_DEBUG): Likewise.
> >> 	* runtime/scheduler.h (REDPAR_DEBUG): Likewise.
> > Ilya will have to chime in here -- we're a downstream consumer of the Cilk+
> > runtime.  So these patches need to go into Intel's tree first, then Ilya
> > can bring them into the GCC tree.
> 
> I suspected that much.  It would be good to have a libcilkrts/README.gcc
> describing the rules which changes can go into the gcc tree directly,
> which need to go upstream first, and how.  libo and libsanitizer already
> have this.

Could you please submit your patch to <www.cilkplus.org/submit-cilk-contribution>?
All patches for libcilkrts/* should go there first in order to avoid possible
license issues, or possible losses during the merge.

Thanks,
  -- Ilya

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Allow redefinition of libcilkrts debug macros
  2016-04-29 11:47     ` Ilya Verbin
@ 2016-04-29 12:08       ` Rainer Orth
  2016-05-03 12:04       ` Rainer Orth
  1 sibling, 0 replies; 9+ messages in thread
From: Rainer Orth @ 2016-04-29 12:08 UTC (permalink / raw)
  To: Ilya Verbin; +Cc: Jeff Law, gcc-patches, Ilya Verbin, Balaji V. Iyer

Hi Ilya,

>> >> 2016-04-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>> >>
>> >> 	* runtime/except-gcc.cpp (DEBUG_EXCEPTIONS): Allow redefinition.
>> >> 	* runtime/cilk_fiber.h (FIBER_DEBUG): Likewise.
>> >> 	* runtime/scheduler.h (REDPAR_DEBUG): Likewise.
>> > Ilya will have to chime in here -- we're a downstream consumer of the Cilk+
>> > runtime.  So these patches need to go into Intel's tree first, then Ilya
>> > can bring them into the GCC tree.
>> 
>> I suspected that much.  It would be good to have a libcilkrts/README.gcc
>> describing the rules which changes can go into the gcc tree directly,
>> which need to go upstream first, and how.  libo and libsanitizer already
>> have this.
>
> Could you please submit your patch to
> <www.cilkplus.org/submit-cilk-contribution>?
> All patches for libcilkrts/* should go there first in order to avoid possible
> license issues, or possible losses during the merge.

sure, will do.  So current upstream libcilkrts should easily
interoperate with current gcc trunk?  That way, I'll be able to complete
the SPARC port from PR target/68945 upstream and just wait for the next
merge to drag it in.

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Allow redefinition of libcilkrts debug macros
  2016-04-29  8:58   ` Rainer Orth
  2016-04-29 11:47     ` Ilya Verbin
@ 2016-04-29 16:08     ` Iyer, Balaji V
  2016-05-03 12:05       ` Rainer Orth
  2016-04-30  3:11     ` Jeff Law
  2 siblings, 1 reply; 9+ messages in thread
From: Iyer, Balaji V @ 2016-04-29 16:08 UTC (permalink / raw)
  To: Rainer Orth, Jeff Law; +Cc: gcc-patches, Verbin, Ilya

I suspected that much.  It would be good to have a libcilkrts/README.gcc describing the rules which changes can go into the gcc tree directly, which need to go upstream first, and how.  libo and libsanitizer already have this.

Hi Rainer,
	It is mentioned under the "CONTRIBUTIONS" sections in the libcilkrts/README file :).

Thanks,

Balaji V. Iyer.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Allow redefinition of libcilkrts debug macros
  2016-04-29  8:58   ` Rainer Orth
  2016-04-29 11:47     ` Ilya Verbin
  2016-04-29 16:08     ` Iyer, Balaji V
@ 2016-04-30  3:11     ` Jeff Law
  2 siblings, 0 replies; 9+ messages in thread
From: Jeff Law @ 2016-04-30  3:11 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Ilya Verbin, Balaji V. Iyer

On 04/29/2016 02:58 AM, Rainer Orth wrote:
>
> Having a listed libcilkrts maintainer would probably help, too ;-)
That's high on my list to make happen :-)  Until then Ilya Verbin and I 
will work together the Cilk runtime.


jeff

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Allow redefinition of libcilkrts debug macros
  2016-04-29 11:47     ` Ilya Verbin
  2016-04-29 12:08       ` Rainer Orth
@ 2016-05-03 12:04       ` Rainer Orth
  1 sibling, 0 replies; 9+ messages in thread
From: Rainer Orth @ 2016-05-03 12:04 UTC (permalink / raw)
  To: Ilya Verbin; +Cc: Jeff Law, gcc-patches, Ilya Verbin, Balaji V. Iyer

Hi Ilya,

> On Fri, Apr 29, 2016 at 10:58:25 +0200, Rainer Orth wrote:
>> > On 04/26/2016 08:04 AM, Rainer Orth wrote:
>> >> When working on a couple of Cilk Plus issues lately (PRs target/60290,
>> >> target/68945), I noticed that you have to modify the libcilkplus sources
>> >> to enable various debugging output.  This seems silly, and the following
>> >> patch allows defining them from the command line.
>> >>
>> >> Tested on i386-pc-solaris2.12 and sparc-sun-solaris2.12.
>> >>
>> >> Ok for mainline?
>> >>
>> >> 	Rainer
>> >>
>> >>
>> >> 2016-04-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>> >>
>> >> 	* runtime/except-gcc.cpp (DEBUG_EXCEPTIONS): Allow redefinition.
>> >> 	* runtime/cilk_fiber.h (FIBER_DEBUG): Likewise.
>> >> 	* runtime/scheduler.h (REDPAR_DEBUG): Likewise.
>> > Ilya will have to chime in here -- we're a downstream consumer of the Cilk+
>> > runtime.  So these patches need to go into Intel's tree first, then Ilya
>> > can bring them into the GCC tree.
>> 
>> I suspected that much.  It would be good to have a libcilkrts/README.gcc
>> describing the rules which changes can go into the gcc tree directly,
>> which need to go upstream first, and how.  libo and libsanitizer already
>> have this.
>
> Could you please submit your patch to
> <www.cilkplus.org/submit-cilk-contribution>?

I just did, together with the patch for PR target/60290 which already
went into mainline.

> All patches for libcilkrts/* should go there first in order to avoid possible
> license issues, or possible losses during the merge.

I see.  Unfortunately, building/testing from the repo on bitbucket.org
is sort of a nightmare:

* The repo is incomplete: configure.ac refers to libcilkrts.spec.in, but
  that file only exists in gcc mainline.

* I cannot configure just a checkout of that repo with current
  autotools: e.g. in automake 1.15 multi.m4 only lives in
  contrib/multilib.  Even with the same versions of the tools required
  for gcc development, I cannot independently configure: in the end, it
  fails with

configure: creating ./config.status
config.status: creating Makefile
config.status: creating libcilkrts.spec
config.status: executing depfiles commands
config.status: executing default-1 commands
./config.status[1364]: .: ./../../config-ml.in: cannot open [No such file or directory]

The only way to make this work was to replace the libcilkrts directory
in a gcc mainline tree with a checkout of the bitbucket.org tree and to
a full build of gcc.

This has the added advantage that I can run the cilkplus testsuite there
to check if my changes broke anything.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Allow redefinition of libcilkrts debug macros
  2016-04-29 16:08     ` Iyer, Balaji V
@ 2016-05-03 12:05       ` Rainer Orth
  0 siblings, 0 replies; 9+ messages in thread
From: Rainer Orth @ 2016-05-03 12:05 UTC (permalink / raw)
  To: Iyer, Balaji V; +Cc: Jeff Law, gcc-patches, Verbin, Ilya

Hi Balaji,

> I suspected that much.  It would be good to have a libcilkrts/README.gcc
> describing the rules which changes can go into the gcc tree directly, which
> need to go upstream first, and how.  libo and libsanitizer already have
> this.
>
> Hi Rainer,
> 	It is mentioned under the "CONTRIBUTIONS" sections in the
> libcilkrts/README file :).

Sort of: it doesn't (and most likely shouldn't ) say anything about
if/when patches can first/exclusively go into the gcc tree.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-05-03 12:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26 14:04 Allow redefinition of libcilkrts debug macros Rainer Orth
2016-04-26 20:47 ` Jeff Law
2016-04-29  8:58   ` Rainer Orth
2016-04-29 11:47     ` Ilya Verbin
2016-04-29 12:08       ` Rainer Orth
2016-05-03 12:04       ` Rainer Orth
2016-04-29 16:08     ` Iyer, Balaji V
2016-05-03 12:05       ` Rainer Orth
2016-04-30  3:11     ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).