Open GoogleCodeExporter opened 9 years ago
I agree w/ Gary on the basic facts:
1) "long double" is part of C99
2) "float complex", "double complex" and "long double complex" are part of C99
3) UPC should support all of C99's arithmetic types.
So, I also agree w/ the conclusion that the collectives need to be expanded to
include the 3 complex types. To be concrete, I would suggest "FC", "DC" and
"LDC" as the type codes that are most consistent with the "principle of least
surprise".
Original comment by phhargr...@lbl.gov
on 21 May 2012 at 11:35
Original comment by phhargr...@lbl.gov
on 1 Jun 2012 at 3:53
Original comment by phhargr...@lbl.gov
on 1 Jun 2012 at 6:07
Original comment by gary.funck
on 3 Jul 2012 at 3:10
Set default Consensus to "Low".
Original comment by gary.funck
on 19 Aug 2012 at 11:26
Change Status to New: Requires review.
Original comment by gary.funck
on 19 Aug 2012 at 11:37
Regarding implementation, it's worth noting that C99 fully permits an
implementation where "long double" is equivalent to "double" (for that matter,
both are also permitted to be equivalent to "float"). Obviously in the
interests of interoperability the UPC compiler should probably use the same
floating point types as the system C compiler. I agree that long double should
appear in the list of types for any library supporting double, eg collectives.
C11 makes language support for complex types completely optional. My impression
is this is because these types are incompatible with those provided in other
languages (notably C++) and largely underutilized, notably by scientific
libraries. How important is the C99 _Complex type to our UPC app programmers?
Original comment by danbonachea
on 14 Sep 2012 at 7:11
I'll handle this one.
Original comment by prmer...@gmail.com
on 17 Sep 2012 at 3:30
There seems to be a fair amount of consensus that a UPC compiler should not
choke on long double or long double complex. But there are issues with the
library support, eg. the collectives.
The UPC compiler should use the same floating point types as the system C
compiler.
The difficult is that there is no precise definition of long, long long, long
double, long double complex. This has ramifications for allocation and
libraries, eg the collectives.
To make progress, we have split the issue so that we can revisit the library
aspects when we talk about the collective spec.
Original comment by prmer...@gmail.com
on 4 Oct 2012 at 3:45
"there is no precise definition of long, long long, long double, long double
complex."
This is not quite accurate - there ARE precise definitions of these types in
the C99 spec, and ample query operations that describe their exact size, range
and precision. It's just that C99 does not require these characteristics to be
identical on all implementations. This property is true of all the types
defined by C99, not just the ones mentioned. A C99 or UPC program that cares
about the exact range and precision of a type should use the query functions to
ensure portability.
It's also worth noting that most C99 compilers in an HPC setting probably
define __STDC_IEC_559__, which activates C99 Annex F and restricts the float
and double types to exactly match the IEC 60559 binary format. In this case
long double is still left somewhat "loose", allowing the variety of
extended-precision formats that exist on current architectures.
Regarding the new purpose of this issue (language support for long double and
complex), I don't think any spec wording is necessary to state that the UPC
language includes these C99 types. This is automatic by UPC Section 1.
A related but separate discussion is the current state of UPC implementations
and their support for long double and complex. Last time I checked BUPC's
frontend lacked support for the complex built-in type as do several of our
target backend C compilers. Given that it becomes optional in C11, it doesn't
seem like a high development priority to implement the complex built-in, unless
some users can motivate this as really important?
Original comment by danbonachea
on 4 Oct 2012 at 5:18
deferred to 1.4 on 11/29 telecon, possibly to be resolved along with C11 support
unlikely that complex types will be added to the UPC collectives, as they seem
to have poor support in C compilers and limited utilization in practice.
Original comment by danbonachea
on 29 Nov 2012 at 7:29
Complex numbers are used extensively in scientific computing and many
algorithms involve collectives. Is it our intent to require everyone doing
reductions on complex to do a gather+local_reduce(+bcast) implementation?
Original comment by jeff.science@gmail.com
on 1 Dec 2012 at 7:23
To clarify comment 11, complex *numbers* are used extensively in scientific
computing, but the C99 complex *type* seems to be poorly implemented/utilized,
and that's the topic of this issue.
It seems to be common practice for C/UPC users to just define their own complex
type with something like: struct { double real; double imag; }
or possibly store the real and imaginary components in two corresponding arrays.
The current UPC collectives do not support reductions over user-defined types,
although I believe this was one of the features under consideration for
collectives 2.0.
Original comment by danbonachea
on 2 Dec 2012 at 1:46
Original issue reported on code.google.com by
gary.funck
on 21 May 2012 at 11:19