Thread overview
[Bug 122] Fails to compile std.parallelism.reduce
May 18, 2014
Iain Buclaw
May 18, 2014
Russel Winder
Jun 07, 2014
Russel Winder
Jun 12, 2014
Iain Buclaw
Jun 12, 2014
Iain Buclaw
Jun 14, 2014
Iain Buclaw
Jun 14, 2014
Iain Buclaw
May 18, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=122

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Sorry for the delayed response. Would you have this 'small program' available as a test case?

-- 
You are receiving this mail because:
You are watching all bug changes.


May 18, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=122

--- Comment #2 from Russel Winder <russel@winder.org.uk> ---
It is the variant of my π by Quadrature example that David Simcha and I came up with whilst he was writing parallelism.d:

/*
 *  A D program to calculate π using quadrature as a parallel reduce of
individual expression evaluations
 *  with no manual batching.
 *
 *  Copyright © 2011–2013  Russel Winder
 */

//  This version originally due to David Simcha, stemming from various emails
on the various D email lists
//  and reified in the documentation for std.parallelism:
http://dlang.org/phobos/std_parallelism.html,
//  http://cis.jhu.edu/~dsimcha/d/phobos/std_parallelism.html

import std.algorithm;
import std.datetime;
import std.parallelism;
import std.range;

import outputFunctions;

int main(immutable string[] args) {
  immutable n = 1000000000;
  immutable delta = 1.0 / n;
  StopWatch stopWatch;
  stopWatch.start();
  //  There is a problem using a lambda function here.  David Simcha reports it
is a consequence of issue
  //  5710 http://d.puremagic.com/issues/show_bug.cgi?id=5710.  Live with this
and use the string syntax
  //  for specifying a lambda function.
  //immutable pi = 4.0 * delta * taskPool.reduce !((a, b) { return a + b; }) (
  //immutable pi = 4.0 * delta * taskPool.reduce !((a, b) => a + b) (
  immutable pi = 4.0 * delta * taskPool.reduce!"a + b"(
      map!((int i) { immutable x = (i - 0.5) * delta; return 1.0 / (1.0 + x *
x); })(iota(n)));
  stopWatch.stop();
  immutable elapseTime = stopWatch.peek().hnsecs * 100e-9;
  output(__FILE__, pi, n, elapseTime);
  return 0;
}

-- 
You are receiving this mail because:
You are watching all bug changes.


June 07, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=122

--- Comment #3 from Russel Winder <russel@winder.org.uk> ---
Problem still happens with gdc 4.9 :-(

gdc -I. -O3 -c -o pi_parallelReduce.o pi_parallelReduce.d
/usr/include/d/4.9/std/parallelism.d: In member function 'reduce':
/usr/include/d/4.9/std/parallelism.d:2630: error: cannot access frame of
function 'main' from 'reduce'
scons: *** [pi_parallelReduce.o] Error 1

-- 
You are receiving this mail because:
You are watching all bug changes.


June 12, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=122

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #4 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Two things have happened that have opened this up for fixing:

https://github.com/D-Programming-GDC/GDC/commit/eb915d6dd4b2bcd96463a5c73f74774ae5941404

https://github.com/D-Programming-GDC/GDC/commit/8b77c001db6cc78fd4b4c33ba7963aad4f62ed6f

This error being in the glue is now only historical for preventing an ICE in the backend that should no longer occur.  However as all things historical, it's rather deep rooted.

-- 
You are receiving this mail because:
You are watching all bug changes.


June 12, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=122

--- Comment #5 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Oops, that first link should have been:

https://github.com/D-Programming-GDC/GDC/commit/16be749d160c19bd2cc2fbc70853a7409b3b96da

-- 
You are receiving this mail because:
You are watching all bug changes.


June 14, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=122

--- Comment #6 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Technical notes (so I don't forget when I look at this):

AssignExp::toElem
- e1->op == TOKslice
- this->ismemset == true

There is no shortcut for calling BUILT_IN_MEMSET here, so the initialisation is handed down to IRState::doArraySet, which needlessly attempts to generate each individual initialiser.

-- 
You are receiving this mail because:
You are watching all bug changes.


June 14, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=122

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Iain Buclaw <ibuclaw@gdcproject.org> ---
https://github.com/D-Programming-GDC/GDC/commit/a3c0cb128a4b3b8d13c266b0101f4e7bd22455e5

-- 
You are receiving this mail because:
You are watching all bug changes.