charmplusplus / charm

The Charm++ parallel programming system. Visit https://charmplusplus.org/ for more information.
Apache License 2.0
206 stars 50 forks source link

examples/charm++/jacobi*d are non-exemplary HPC code, using nested arrays #1315

Open PhilMiller opened 7 years ago

PhilMiller commented 7 years ago

Original issue: https://charm.cs.illinois.edu/redmine/issues/1315


// allocate a three dimensional array
temperature = new double**[blockDimX+2];
new_temperature = new double**[blockDimX+2];
for(int i=0; i<blockDimX+2; i++)
{
  temperature[i] = new double*[blockDimY+2];
  new_temperature[i] = new double*[blockDimY+2];
  for(int j=0; j<blockDimY+2; j++)
  {
    temperature[i][j] = new double[blockDimZ+2];
    new_temperature[i][j] = new double[blockDimZ+2];
  }
}

This is exactly what we would tell people not to do if we saw it in application code that was getting poor performance. Why do we have examples which do exactly that?

ericjbohm commented 5 years ago

Original date: 2018-05-09 16:07:06


Assigning to Juan for eventual reassignment to interns or newer junior students as this seems like a worthy learning curve task.