Disabled OpenMP pragmas in low-level fluid evaluations.

This is done to reduce risk of misuse, considering two cases:
 - These functions are often called with a single data point,
   making the thread setup and teardown time prohibitively expensive.
 - This may conflict with higher-level use of OpenMP.
This commit is contained in:
Atgeirr Flø Rasmussen 2012-04-10 15:46:24 +02:00
parent 844b2b6cc6
commit ddf0f09b6e
4 changed files with 11 additions and 11 deletions

View File

@ -125,7 +125,7 @@ namespace Opm
double B[2]; // Must be enough since component classes do not handle more than 2.
pvt_.B(1, 0, 0, B);
// Compute A matrix
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
double* m = A + i*np*np;
std::fill(m, m + np*np, 0.0);
@ -137,7 +137,7 @@ namespace Opm
// Derivative of A matrix.
if (dAdp) {
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
double* m = dAdp + i*np*np;
std::fill(m, m + np*np, 0.0);
@ -157,7 +157,7 @@ namespace Opm
{
const int np = numPhases();
const double* sdens = pvt_.surfaceDensities();
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
for (int phase = 0; phase < np; ++phase) {
rho[np*i + phase] = 0.0;

View File

@ -131,7 +131,7 @@ namespace Opm
const int g = phase_pos[BlackoilPhases::Vapour];
// Compute A matrix
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
double* m = A + i*np*np;
std::fill(m, m + np*np, 0.0);
@ -148,7 +148,7 @@ namespace Opm
// Derivative of A matrix.
if (dAdp) {
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
double* m = dAdp + i*np*np;
std::fill(m, m + np*np, 0.0);
@ -177,7 +177,7 @@ namespace Opm
{
const int np = numPhases();
const double* sdens = pvt_.surfaceDensities();
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
for (int phase = 0; phase < np; ++phase) {
rho[np*i + phase] = 0.0;

View File

@ -79,7 +79,7 @@ namespace Opm
{
const int np = numPhases();
for (int phase = 0; phase < np; ++phase) {
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
output_mu[np*i + phase] = viscosity_[phase];
}
@ -93,7 +93,7 @@ namespace Opm
{
const int np = numPhases();
for (int phase = 0; phase < np; ++phase) {
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
output_B[np*i + phase] = formation_volume_factor_[phase];
}
@ -108,7 +108,7 @@ namespace Opm
{
const int np = numPhases();
for (int phase = 0; phase < np; ++phase) {
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
output_B[np*i + phase] = formation_volume_factor_[phase];
output_dBdp[np*i + phase] = 0.0;

View File

@ -71,13 +71,13 @@ namespace Opm
const double* s, double* kr, double* dkrds, Fun fun)
{
if (dkrds == 0) {
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n*np; ++i) {
kr[i] = fun.kr(s[i]);
}
return;
}
#pragma omp parallel for
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
std::fill(dkrds + i*np*np, dkrds + (i+1)*np*np, 0.0);
for (int phase = 0; phase < np; ++phase) {