aboutsummaryrefslogtreecommitdiff
path: root/src/common/store.c
diff options
context:
space:
mode:
authorschnetter <schnetter@0f49ee68-0e4f-0410-9b9c-b2c123ded7ef>2012-05-06 22:14:23 +0000
committerschnetter <schnetter@0f49ee68-0e4f-0410-9b9c-b2c123ded7ef>2012-05-06 22:14:23 +0000
commit66261fe7dc204aab0d0b8a03b39a4e604a6db498 (patch)
tree774093ff98e9dea96f46ef96b00fb6b83742c8bf /src/common/store.c
parent18bc4665359045d9ef115c7817b2c6b76ab0cfc5 (diff)
Parallelize AEILocalInterp with OpenMP
This leads to a slight change in behaviour. Currently, AEILocalInterp traverses the list of points sequentially, and aborts when the first error is encountered. After parallelisation, there is no fixed order in which the points are traversed, and if several errors are encountered, any one of the errors may be returned, not necessarily the first. I am not aware of any thorn that would or should rely on such an ordering. This patch also adds "restrict" and "const" statements that may improve performance as it gives the compiler more information about dependencies between pointers. git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/AEILocalInterp/trunk@55 0f49ee68-0e4f-0410-9b9c-b2c123ded7ef
Diffstat (limited to 'src/common/store.c')
-rw-r--r--src/common/store.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/common/store.c b/src/common/store.c
index 3ed6003..1d414fe 100644
--- a/src/common/store.c
+++ b/src/common/store.c
@@ -17,48 +17,48 @@
#define COEFF(mi) Jacobian_ptr[Jacobian_mi_stride*mi]
void AEILocalInterp_store_1dcube2
- (fp factor, const struct coeffs_struct_1d_cube_size2 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_1d_cube_size2 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride)
{
#include "1d.cube.size2/store-coeffs.c"
}
void AEILocalInterp_store_1dcube3
- (fp factor, const struct coeffs_struct_1d_cube_size3 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_1d_cube_size3 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride)
{
#include "1d.cube.size3/store-coeffs.c"
}
void AEILocalInterp_store_1dcube4
- (fp factor, const struct coeffs_struct_1d_cube_size4 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_1d_cube_size4 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride)
{
#include "1d.cube.size4/store-coeffs.c"
}
void AEILocalInterp_store_1dcube5
- (fp factor, const struct coeffs_struct_1d_cube_size5 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_1d_cube_size5 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride)
{
#include "1d.cube.size5/store-coeffs.c"
}
void AEILocalInterp_store_1dcube6
- (fp factor, const struct coeffs_struct_1d_cube_size6 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_1d_cube_size6 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride)
{
#include "1d.cube.size6/store-coeffs.c"
}
void AEILocalInterp_store_1dcube7
- (fp factor, const struct coeffs_struct_1d_cube_size7 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_1d_cube_size7 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride)
{
#include "1d.cube.size7/store-coeffs.c"
@@ -75,40 +75,40 @@ void AEILocalInterp_store_1dcube7
+ Jacobian_mj_stride*mj ]
void AEILocalInterp_store_2dcube2
- (fp factor, const struct coeffs_struct_2d_cube_size2 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_2d_cube_size2 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride, int Jacobian_mj_stride)
{
#include "2d.cube.size2/store-coeffs.c"
}
void AEILocalInterp_store_2dcube3
- (fp factor, const struct coeffs_struct_2d_cube_size3 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_2d_cube_size3 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride, int Jacobian_mj_stride)
{
#include "2d.cube.size3/store-coeffs.c"
}
void AEILocalInterp_store_2dcube4
- (fp factor, const struct coeffs_struct_2d_cube_size4 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_2d_cube_size4 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride, int Jacobian_mj_stride)
{
#include "2d.cube.size4/store-coeffs.c"
}
void AEILocalInterp_store_2dcube5
- (fp factor, const struct coeffs_struct_2d_cube_size5 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_2d_cube_size5 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride, int Jacobian_mj_stride)
{
#include "2d.cube.size5/store-coeffs.c"
}
void AEILocalInterp_store_2dcube6
- (fp factor, const struct coeffs_struct_2d_cube_size6 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_2d_cube_size6 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride, int Jacobian_mj_stride)
{
#include "2d.cube.size6/store-coeffs.c"
@@ -126,40 +126,40 @@ void AEILocalInterp_store_2dcube6
+ Jacobian_mk_stride*mk ]
void AEILocalInterp_store_3dcube2
- (fp factor, const struct coeffs_struct_3d_cube_size2 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_3d_cube_size2 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride, int Jacobian_mj_stride, int Jacobian_mk_stride)
{
#include "3d.cube.size2/store-coeffs.c"
}
void AEILocalInterp_store_3dcube3
- (fp factor, const struct coeffs_struct_3d_cube_size3 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_3d_cube_size3 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride, int Jacobian_mj_stride, int Jacobian_mk_stride)
{
#include "3d.cube.size3/store-coeffs.c"
}
void AEILocalInterp_store_3dcube4
- (fp factor, const struct coeffs_struct_3d_cube_size4 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_3d_cube_size4 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride, int Jacobian_mj_stride, int Jacobian_mk_stride)
{
#include "3d.cube.size4/store-coeffs.c"
}
void AEILocalInterp_store_3dcube5
- (fp factor, const struct coeffs_struct_3d_cube_size5 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_3d_cube_size5 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride, int Jacobian_mj_stride, int Jacobian_mk_stride)
{
#include "3d.cube.size5/store-coeffs.c"
}
void AEILocalInterp_store_3dcube6
- (fp factor, const struct coeffs_struct_3d_cube_size6 *coeffs,
- fp Jacobian_ptr[],
+ (fp factor, const struct coeffs_struct_3d_cube_size6 *restrict const coeffs,
+ fp *restrict Jacobian_ptr,
int Jacobian_mi_stride, int Jacobian_mj_stride, int Jacobian_mk_stride)
{
#include "3d.cube.size6/store-coeffs.c"