Barry Moore
2017-03-28 03:06:44 UTC
Hello All,
Looking to get my feet off the ground with Chapel on our HPC resources here
at Pitt. I wrote the following approximation to Pi code:
```
// Need BlockDist module to use Block distribution mapping
use BlockDist;
// Some config constants for running the problem
config const tasksPerLocale : int = 1;
config const numberGridPoints : int = 10;
// The Grid and Domain specification
const Grid = {1..numberGridPoints};
const Domain: domain(1) dmapped Block(boundingBox = Grid) = Grid;
// Our approximation procedure
proc approx(a: real) return 4.0 / (1.0 + a ** 2);
// The separation of grid points and the sum which will catch a reduce
var dGrid : real = 1.0 / numberGridPoints;
var sum : real = 0.0;
// forall values in the domain calculation the valueOnGrid and approx of
that value
forall d in Domain with (+ reduce sum) {
var valueOnGrid : real = dGrid * (d + 0.5);
sum += approx(valueOnGrid);
}
// Print out Pi
writeln("Pi is approximately: ", sum * dGrid);
```
using the pull request: https://github.com/chapel-lang/chapel/pull/5843 to
compile the code.
I am convinced the code is running over OmniPath, but I am quite sure it is
not using multiple cores per locale. Am I missing an additional level in my
forall loop (something with tasksPerLocale)?
Any help is appreciated.
Thanks,
Barry
Looking to get my feet off the ground with Chapel on our HPC resources here
at Pitt. I wrote the following approximation to Pi code:
```
// Need BlockDist module to use Block distribution mapping
use BlockDist;
// Some config constants for running the problem
config const tasksPerLocale : int = 1;
config const numberGridPoints : int = 10;
// The Grid and Domain specification
const Grid = {1..numberGridPoints};
const Domain: domain(1) dmapped Block(boundingBox = Grid) = Grid;
// Our approximation procedure
proc approx(a: real) return 4.0 / (1.0 + a ** 2);
// The separation of grid points and the sum which will catch a reduce
var dGrid : real = 1.0 / numberGridPoints;
var sum : real = 0.0;
// forall values in the domain calculation the valueOnGrid and approx of
that value
forall d in Domain with (+ reduce sum) {
var valueOnGrid : real = dGrid * (d + 0.5);
sum += approx(valueOnGrid);
}
// Print out Pi
writeln("Pi is approximately: ", sum * dGrid);
```
using the pull request: https://github.com/chapel-lang/chapel/pull/5843 to
compile the code.
I am convinced the code is running over OmniPath, but I am quite sure it is
not using multiple cores per locale. Am I missing an additional level in my
forall loop (something with tasksPerLocale)?
Any help is appreciated.
Thanks,
Barry
--
Barry E Moore II, PhD
E-mail: ***@pitt.edu
Assistant Research Professor
Center for Simulation and Modeling
University of Pittsburgh
Pittsburgh, PA 15260
Barry E Moore II, PhD
E-mail: ***@pitt.edu
Assistant Research Professor
Center for Simulation and Modeling
University of Pittsburgh
Pittsburgh, PA 15260