On Thu, 7 Mar 2019, Damian McGuckin wrote:
> On Tue, 5 Mar 2019, Paul Cassella wrote:
> > The value seems to work when it's available to cbrt() as a param (or
> > literal as in Brad's example):
> > fortytwo@magrathea:~/src/chapel (master)$ cat realweird.chpl
> > param x = 0x1.0p-1044;
> > var y = x;
> >
> > writeln("chapel var : ", cbrt(y) == 0x1.0p-348);
> > writeln("chapel param : ", cbrt(x) == 0x1.0p-348);
> > writeln("chapel literal: ", cbrt(0x1p-1044) == 0x1.0p-348);
> > fortytwo@magrathea:~/src/chapel (master)$ ./realweird -nl 1
> > chapel var : false
> > chapel param : true
> > chapel literal: true
>
> > I get the same results when compiling with -O, or with --fast, or with
> > neither.
> Paul,
> I copied your code into a file 'paul.chpl'. I ran unoptimized and matched
> yours, i.e. the weird behaviour. But optimized, it behaves properly. Note that
> I get that with 1.16.0 or 1.18.0 latest versions of the compiler, pulled down
> from Github a a week ago. I have a GCC backend.
> All very strange.
Damian,
I'll see your very strange, and raise you a puzzling.
I _can_ reproduce your results -- when I run in the Chapel env I use for
valgrind (CHPL_COMM=none, etc.) I also get true/true/true when built with
-O. But when I run with CHPL_COMM=gasnet, etc, neither -O nor --fast
changes the behavior (always false/true/true).
valgrind chplenv:
fortytwo@magrathea:~/src/chapel-none (master)$ printchplenv --anonymize
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: gnu
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native *
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none *
CHPL_TASKS: fifo *
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: cstdlib *
CHPL_ATOMICS: cstdlib
CHPL_GMP: gmp
CHPL_HWLOC: none
CHPL_REGEXP: re2
CHPL_AUX_FILESYS: none
gasnet chplenv:
fortytwo@magrathea:~/src/chapel (master)$ printchplenv --anonymize
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: gnu
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native *
CHPL_LOCALE_MODEL: flat
CHPL_COMM: gasnet *
CHPL_COMM_SUBSTRATE: udp
CHPL_GASNET_SEGMENT: everything
CHPL_TASKS: qthreads
CHPL_LAUNCHER: amudprun
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_NETWORK_ATOMICS: none
CHPL_GMP: gmp
CHPL_HWLOC: hwloc
CHPL_REGEXP: re2
CHPL_AUX_FILESYS: none
For both, current chapel master,
fortytwo@magrathea:~/src/chapel-none (master)$ chpl --version
chpl version 1.19.0 pre-release (c3a6817)
and the same gcc backend:
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
Very strange, and puzzling, but I can't speak as to whether it's
worrisome.
Paul
>
> $ chpl paul.chpl ; ./paul ; chpl -O paul.chpl ; ./paul
> <email comments> start of unoptimized version
> chapel var : false
> chapel param : true
> chapel literal: true
> <email comments> start of optimized version
> chapel var : true
> chapel param : true
> chapel literal: true
>
> All very strange.
>
> Regards - Damian
>
> Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
> Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
> Views & opinions here are mine and not those of any past or present employer
>
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers