diff --git a/src/common/mesh.cpp b/src/common/mesh.cpp index 1e4adf01..4740685a 100644 --- a/src/common/mesh.cpp +++ b/src/common/mesh.cpp @@ -577,15 +577,16 @@ double Mesh::GetDistanceToOrigin( unsigned idx_cell ) const { return sqrt( distance ); } + unsigned Mesh::GetCellOfKoordinate( const double x, const double y ) const { // Experimental parallel implementation unsigned koordinate_cell_id = std::numeric_limits::max(); bool found = false; -#pragma omp parallel for shared( found ) +//#pragma omp parallel for shared( found ) for( unsigned idx_cell = 0; idx_cell < _numCells; idx_cell++ ) { if( IsPointInsideCell( idx_cell, x, y ) ) { - #pragma omp critical + //#pragma omp critical { if( !found ) { koordinate_cell_id = idx_cell; diff --git a/src/main.cpp b/src/main.cpp index 45b60870..98b8980d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,10 +32,10 @@ int main( int argc, char** argv ) { // Py_SetProgramName( program ); #ifdef BUILD_MPI MPI_Init( &argc, &argv ); - printf( "MPI initialized\n" ); + printf( "| KiT-RT compiled with MPI and OpenMP parallelization\n" ); #endif #ifndef BUILD_MPI - printf( "MPI not initialized\n" ); + printf( "| KiT-RT compiled with OpenMP, but without MPI parallelization\n" ); #endif std::string filename = ParseArguments( argc, argv ); diff --git a/src/solvers/snsolver_hpc.cpp b/src/solvers/snsolver_hpc.cpp index aac283f4..eca7f257 100644 --- a/src/solvers/snsolver_hpc.cpp +++ b/src/solvers/snsolver_hpc.cpp @@ -1456,7 +1456,7 @@ std::vector SNSolverHPC::linspace2D( const std::vector& start, result.resize( num_points ); double stepX = ( end[0] - start[0] ) / ( num_points - 1 ); double stepY = ( end[1] - start[1] ) / ( num_points - 1 ); - +#pragma omp parallel for for( unsigned i = 0; i < num_points; ++i ) { double x = start[0] + i * stepX; double y = start[1] + i * stepY;