Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
cdo
Commits
4894c068
Commit
4894c068
authored
8 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
removed fpe handling (speedup of 50% for ensmean ...).
parent
4bc54ea7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+4
-0
4 additions, 0 deletions
ChangeLog
src/array.c
+12
-9
12 additions, 9 deletions
src/array.c
with
16 additions
and
9 deletions
ChangeLog
+
4
−
0
View file @
4894c068
2017-04-14 Uwe Schulzweida
* removed fpe handling (speedup of 50% for ensmean ...)
2017-04-13 Uwe Schulzweida
* Using CDI library version 1.8.1
...
...
This diff is collapsed.
Click to expand it.
src/array.c
+
12
−
9
View file @
4894c068
...
...
@@ -45,8 +45,8 @@ int array_minmaxsum_val(size_t len, const double *array, double *rmin, double *r
int
array_minmaxmean_val
(
size_t
len
,
const
double
*
array
,
double
*
rmin
,
double
*
rmax
,
double
*
rmean
)
{
int
excepts
=
FE_INVALID
|
FE_DIVBYZERO
|
FE_OVERFLOW
|
FE_UNDERFLOW
;
feclearexcept
(
FE_ALL_EXCEPT
);
//
int excepts = FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW;
//
feclearexcept(FE_ALL_EXCEPT);
// expensive !!!!
double
min
=
DBL_MAX
;
double
max
=
-
DBL_MAX
;
...
...
@@ -67,14 +67,15 @@ int array_minmaxmean_val(size_t len, const double *array, double *rmin, double *
if
(
rmax
)
*
rmax
=
max
;
if
(
rmean
)
*
rmean
=
mean
;
return
fetestexcept
(
excepts
);
// return fetestexcept(excepts);
return
0
;
}
int
array_mean_val_weighted
(
size_t
len
,
const
double
*
restrict
array
,
const
double
*
restrict
w
,
double
missval
,
double
*
rmean
)
{
int
excepts
=
FE_INVALID
|
FE_DIVBYZERO
|
FE_OVERFLOW
|
FE_UNDERFLOW
;
feclearexcept
(
FE_ALL_EXCEPT
);
//
int excepts = FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW;
//
feclearexcept(FE_ALL_EXCEPT);
// expensive !!!!
double
rsum
=
0
,
rsumw
=
0
;
...
...
@@ -86,19 +87,21 @@ int array_mean_val_weighted(size_t len, const double *restrict array, const doub
*
rmean
=
DBL_IS_EQUAL
(
rsumw
,
0
.)
?
missval
:
rsum
/
rsumw
;
return
fetestexcept
(
excepts
);
// return fetestexcept(excepts);
return
0
;
}
int
array_add_array
(
size_t
len
,
double
*
restrict
array1
,
const
double
*
restrict
array2
)
{
int
excepts
=
FE_INVALID
|
FE_DIVBYZERO
|
FE_OVERFLOW
|
FE_UNDERFLOW
;
feclearexcept
(
FE_ALL_EXCEPT
);
//
int excepts = FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW;
//
feclearexcept(FE_ALL_EXCEPT);
// expensive !!!!
//#if defined(_OPENMP)
//#pragma omp parallel for default(none) shared(array1,array2)
//#endif
for
(
size_t
i
=
0
;
i
<
len
;
i
++
)
array1
[
i
]
+=
array2
[
i
];
return
fetestexcept
(
excepts
);
// return fetestexcept(excepts);
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment