chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.77k stars 417 forks source link

Stencil domains significantly slower to create than Block domains #12926

Open benharsh opened 5 years ago

benharsh commented 5 years ago

Stencil domains seem to take a significantly longer amount of time to create than Block domains. An example program:


use BlockDist;
use StencilDist;

use Time;

config const trials = 100;

proc main() {
  var D = {1..10, 1..10, 1..10};

  var t : Timer;
  t.start();
  for i in 1..trials {
    var S = D dmapped Block(D);
  }
  t.stop();
  writeln("Block took ", t.elapsed());

  t.clear();
  t.start();
  for i in 1..trials {
    var S = D dmapped Stencil(D, fluff=(1,1,1));
  }
  t.stop();
  writeln("Stencil took ", t.elapsed());

  t.clear();
  t.start();
  for i in 1..trials {
    var S = D dmapped Stencil(D);
  }
  t.stop();
  writeln("Stencil without fluff took ", t.elapsed());
}

Some timings on a laptop with CHPL_COMM=gasnet and local spawning:

-nl 2 -nl 9
Block .9s 13s
Stencil 4.7s 32s
Stencil - no fluff 1.23s 15s

The Stencil domain without any fluff performs nearly as well as a regular Block domain. This leads me to think the problem is related to initializing fields necessary for the 'updateFluff' step.

benharsh commented 2 months ago

Checking back in, this still appears to be an issue in 2.0.