void lower_level_relax ( MulticoreArray<T> & array, MulticoreArray<T> & old_array ) { // The code in this function is what we would want to have ben generated by the compiler. const int numberOfCores = array.get_numberOfCores(); // Make sure that these are distributed using the same approach (table-based or via an algorithmic approach). assert(array.get_tableBasedDistribution() == old_array.get_tableBasedDistribution()); // Use OpenMP to support the parallel threads on each core. #pragma omp parallel for for (int p = 0; p < numberOfCores; p++) { // Refactored form of relaxation on the interior. // array.coreArray[p]->relax(p,array,old_array); // ************************************************************** // Fixup internal bounaries of the memory allocated to each core. // ************************************************************** // Refactored form of relaxation on the interior. array.coreArray[p]->relax_on_boundary(p,array,old_array); } }
void lower_level_relax ( MulticoreArray<T> & array, MulticoreArray<T> & old_array ) { // The code in this function is what we would want to have ben generated by the compiler. const int numberOfCores = array.get_numberOfCores(); // Make sure that these are distributed using the same approach (table-based or via an algorithmic approach). assert(array.get_tableBasedDistribution() == old_array.get_tableBasedDistribution()); // Use OpenMP to support the parallel threads on each core. if(old_array.isHaloExist()) { old_array.haloExchange(); #pragma omp parallel for for (int p = 0; p < numberOfCores; p++) { relax(p,array,old_array,1); if(array.hasDetachedHalo()) relax_on_detachedhalo_boundary(p,array,old_array,1); } } else { #pragma omp parallel for for (int p = 0; p < numberOfCores; p++) { relax(p,array,old_array,1); relax_on_boundary(p,array,old_array,1); } } }