mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-18 13:33:28 -06:00
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:
parent
844b2b6cc6
commit
ddf0f09b6e
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user