public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dave Love <dave.love@manchester.ac.uk>
To: fortran@gcc.gnu.org
Subject: Re: adding attributes
Date: Mon, 07 Nov 2022 11:04:17 +0000	[thread overview]
Message-ID: <87zgd381qm.fsf@manchester.ac.uk> (raw)
In-Reply-To: <20221103001926.725fd9bf@nbbrfq>

Bernhard Reutner-Fischer via Fortran <fortran@gcc.gnu.org> writes:

> I see.
> So target_clones is one thing. What other attributes would be important?

At least optimization-related ones could be useful, and possibly others.
I haven't made a list, but could do.

> In your job script you would use cpuid(1) to determine a properly tuned
> binary for the parts of the cluster you run on. Or the installed
> binaries are tuned for the host they are installed on and are located in
> a uniform place per application.
>
>> 
>> Multiple compilation isn't a good solution.  I haven't followed the
>
> It might not be good, but it's cheap and easy if you only have a small
> set of different arches and subarches each. In a controlled
> environment, with a batch scheduler. Won't work in the wild of course.

I know all that you can do, but my opinions are from extensive
experience managing rather heterogeneous HPC clusters and working on
dynamic dispatch in libraries.  (The worst thing about gfortran for
system management is the lack of backwards-compatibility in module
formats and libgfortran.)

> But since you cannot mix target_clones across arch-boundaries,
> supporting those for a distro will probably be rather ugly anyway.

Yes, you need simple pre-processing, as you do for the attributes in C,
unless there was some extra guard facility added.

> heh, me neither. Luckily yesterday was a holiday, so what i ended up
> with was the following, fya.

Gosh; I thought it would take a while even if you knew your way around.
I didn't want to spoil a holiday!  (I'd aim to do such things on work
time.)

> I've added a
>    /* Attributes set by compiler extensions (!GCC$ ATTRIBUTES).  */
>    unsigned ext_attr:EXT_ATTR_NUM;
> +  tree ext_attr_args;
>
> to struct symbol_attribute where i can prepare the tree_list for the
> attrs right from the start. The lowering is then rather simple and
> uniform, just chainon the prepared attributes and be done.

If I understand correctly, I could go through and add ones that look
useful (for debate).  I have experience of using several in C (at least
once even for g77 runtime).

> target_clones does not require a bump in the module format, i'd say,
> because the main entry point does not change. Will have to check if
> the clones do not end up being emitted in the module, they shouldn't be.
> Other attributes _may_ require a change in the module format though.
> These would need checking on a per case basis.

I don't understand the module format, but I wouldn't have expected
relevant attributes to change interfaces.

Anyway, thanks!


  parent reply	other threads:[~2022-11-07 11:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 14:35 Dave Love
2022-10-30  7:48 ` Bernhard Reutner-Fischer
2022-10-31 21:19   ` Dave Love
2022-11-02 23:19     ` Bernhard Reutner-Fischer
2022-11-04 20:59       ` Bernhard Reutner-Fischer
2022-11-05  7:40         ` Thomas Koenig
2022-11-05 10:54           ` Bernhard Reutner-Fischer
2022-11-06 13:44             ` Thomas Koenig
2022-11-07 11:06               ` Dave Love
2023-02-24 12:24             ` Dave Love
2022-11-07 11:04       ` Dave Love [this message]
2022-11-10 12:25         ` Bernhard Reutner-Fischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgd381qm.fsf@manchester.ac.uk \
    --to=dave.love@manchester.ac.uk \
    --cc=fortran@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).