Commit 198c68e0 authored by Marek, Andreas (amarek)'s avatar Marek, Andreas (amarek)

Merge branch 'kernel' into fix_omp

parents c3a093a6 a04d597a
......@@ -455,6 +455,7 @@ nobase_nodist_elpa_include_HEADERS = \
elpa/elpa_version.h \
elpa/elpa_constants.h \
elpa/elpa_generated.h \
elpa/elpa_generated_c_api.h \
elpa/elpa_generated_legacy.h
dist_man_MANS = \
......@@ -686,7 +687,8 @@ test_python.sh:
include doxygen.am
CLEANFILES = \
elpa-generated.h \
elpa_generated.h \
elpa_generated_c_api.h \
elpa1_test* \
elpa2_test*\
elpa2_real* \
......@@ -718,16 +720,14 @@ clean-local:
-rm -rf $(generated_headers)
distclean-local:
-rm -rf ./m4
-rm -rf ./src
-rm -rf ./test
-rm -rf ./modules
-rm -rf .fortran_dependencies
-rm config-f90.h
-rm -rf ./src/elpa2/kernels/.deps
-rm -rf ./src/.deps
-rm -rf ./test/.deps
-rmdir ./src/elpa2/kernels/
-rmdir ./src
-rmdir ./test
-rmdir ./m4
-rmdir modules/
-rmdir .fortran_dependencies/
-rm -rf elpa/elpa_generated_c_api.h
EXTRA_DIST = \
elpa.spec \
......
......@@ -1473,5 +1473,11 @@ if test x"$enable_kcomputer" = x"yes" ; then
echo "call: make -f ../generated_headers.am generated-headers top_srcdir=.."
echo "BEFORE triggering the build with make!"
else
if test x"$optional_c_error_argument" = x"yes" ; then
echo "#define OPTIONAL_C_ERROR_ARGUMENT" > elpa/elpa_generated_c_api.h
else
echo "#undef OPTIONAL_C_ERROR_ARGUMENT" > elpa/elpa_generated_c_api.h
fi
make -f $srcdir/generated_headers.am generated-headers top_srcdir="$srcdir" CPP="$CPP"
fi
......@@ -14,6 +14,7 @@ typedef struct elpa_autotune_struct *elpa_autotune_t;
#include <elpa/elpa_constants.h>
#include <elpa/elpa_generated_c_api.h>
#include <elpa/elpa_generated.h>
#include <elpa/elpa_generic.h>
......
......@@ -22,6 +22,22 @@ elpa/elpa_generated.h: $(top_srcdir)/src/elpa_impl.F90 \
$(top_srcdir)/src/elpa_api.F90 | elpa
@rm -f $@
$(call extract_interface,!c>)
$(call extract_interface,!c_o>)
$(call extract_interface,!c_no>)
#if OPTIONAL_C_ERROR_ARGUMENT
#
#elpa/elpa_generated.h: $(top_srcdir)/src/elpa_impl.F90 \
# $(top_srcdir)/src/elpa_impl_math_template.F90 \
# $(top_srcdir)/src/elpa_api.F90 | elpa
# $(call extract_interface,!c_o>)
#
#else
#elpa/elpa_generated.h: $(top_srcdir)/src/elpa_impl.F90 \
# $(top_srcdir)/src/elpa_impl_math_template.F90 \
# $(top_srcdir)/src/elpa_api.F90 | elpa
# $(call extract_interface,!c_no>)
#endif
generated_headers += elpa/elpa_generated_legacy.h
elpa/elpa_generated_legacy.h: $(top_srcdir)/src/elpa_driver/legacy_interface/elpa_driver_c_interface.F90 \
......
......@@ -818,13 +818,17 @@ module elpa_api
end function
#ifdef OPTIONAL_C_ERROR_ARGUMENT
!c> #define elpa_uninit(...) CONC(elpa_uninit, NARGS(__VA_ARGS__))(__VA_ARGS__)
!c_o> #ifdef OPTIONAL_C_ERROR_ARGUMENT
!c_o> #define elpa_uninit(...) CONC(elpa_uninit, NARGS(__VA_ARGS__))(__VA_ARGS__)
!c_o> #endif
#endif
!> \brief subroutine to uninit the ELPA library. Does nothing at the moment. Might do sth. later
!
#ifdef OPTIONAL_C_ERROR_ARGUMENT
!c> void elpa_uninit1(int *error);
!c> void elpa_uninit0();
!c_o> #ifdef OPTIONAL_C_ERROR_ARGUMENT
!c_o> void elpa_uninit1(int *error);
!c_o> void elpa_uninit0();
!c_o> #endif
subroutine elpa_uninit_c1(error) bind(C, name="elpa_uninit1")
integer(kind=c_int) :: error
call elpa_uninit(error)
......@@ -834,6 +838,9 @@ module elpa_api
call elpa_uninit()
end subroutine
#else
!c_no> #ifndef OPTIONAL_C_ERROR_ARGUMENT
!c_no> void elpa_uninit(int *error);
!c_no> #endif
subroutine elpa_uninit_c(error) bind(C, name="elpa_uninit")
integer(kind=c_int) :: error
call elpa_uninit(error)
......
......@@ -216,7 +216,9 @@ module elpa_impl
end function
#ifdef OPTIONAL_C_ERROR_ARGUMENT
!c> #define elpa_allocate(...) CONC(elpa_allocate, NARGS(__VA_ARGS__))(__VA_ARGS__)
!c_o> #ifdef OPTIONAL_C_ERROR_ARGUMENT
!c_o> #define elpa_allocate(...) CONC(elpa_allocate, NARGS(__VA_ARGS__))(__VA_ARGS__)
!c_o> #endif
#endif
!c> /*! \brief C interface for the implementation of the elpa_allocate method
!c> *
......@@ -224,8 +226,10 @@ module elpa_impl
!c> * \result elpa_t handle
!c> */
#ifdef OPTIONAL_C_ERROR_ARGUMENT
!c> elpa_t elpa_allocate2(int *error);
!c> elpa_t elpa_allocate1();
!c_o> #ifdef OPTIONAL_C_ERROR_ARGUMENT
!c_o> elpa_t elpa_allocate2(int *error);
!c_o> elpa_t elpa_allocate1();
!c_o> #endif
function elpa_impl_allocate_c1() result(ptr) bind(C, name="elpa_allocate1")
type(c_ptr) :: ptr
type(elpa_impl_t), pointer :: obj
......@@ -243,6 +247,9 @@ module elpa_impl
ptr = c_loc(obj)
end function
#else
!c_no> #ifndef OPTIONAL_C_ERROR_ARGUMENT
!c_no> elpa_t elpa_allocate(int *error);
!c_no> #endif
function elpa_impl_allocate_c(error) result(ptr) bind(C, name="elpa_allocate")
integer(kind=c_int) :: error
type(c_ptr) :: ptr
......@@ -254,11 +261,13 @@ module elpa_impl
#endif
#ifdef OPTIONAL_C_ERROR_ARGUMENT
!c> #define NARGS(...) NARGS_(__VA_ARGS__, 5, 4, 3, 2, 1, 0)
!c> #define NARGS_(_5, _4, _3, _2, _1, N, ...) N
!c> #define CONC(A, B) CONC_(A, B)
!c> #define CONC_(A, B) A##B
!c> #define elpa_deallocate(...) CONC(elpa_deallocate, NARGS(__VA_ARGS__))(__VA_ARGS__)
!c_o> #ifdef OPTIONAL_C_ERROR_ARGUMENT
!c_o> #define NARGS(...) NARGS_(__VA_ARGS__, 5, 4, 3, 2, 1, 0)
!c_o> #define NARGS_(_5, _4, _3, _2, _1, N, ...) N
!c_o> #define CONC(A, B) CONC_(A, B)
!c_o> #define CONC_(A, B) A##B
!c_o> #define elpa_deallocate(...) CONC(elpa_deallocate, NARGS(__VA_ARGS__))(__VA_ARGS__)
!c_o> #endif
#endif
!c> /*! \brief C interface for the implementation of the elpa_deallocate method
!c> *
......@@ -267,8 +276,10 @@ module elpa_impl
!c> * \result void
!c> */
#ifdef OPTIONAL_C_ERROR_ARGUMENT
!c> void elpa_deallocate2(elpa_t handle, int *error);
!c> void elpa_deallocate1(elpa_t handle);
!c_o> #ifdef OPTIONAL_C_ERROR_ARGUMENT
!c_o> void elpa_deallocate2(elpa_t handle, int *error);
!c_o> void elpa_deallocate1(elpa_t handle);
!c_o> #endif
subroutine elpa_impl_deallocate_c2(handle, error) bind(C, name="elpa_deallocate2")
type(c_ptr), value :: handle
type(elpa_impl_t), pointer :: self
......@@ -288,6 +299,9 @@ module elpa_impl
deallocate(self)
end subroutine
#else
!c_no> #ifndef OPTIONAL_C_ERROR_ARGUMENT
!c_no> void elpa_deallocate(elpa_t handle, int *error);
!c_no> #endif
subroutine elpa_impl_deallocate_c(handle, error) bind(C, name="elpa_deallocate")
type(c_ptr), value :: handle
type(elpa_impl_t), pointer :: self
......@@ -439,7 +453,9 @@ module elpa_impl
#ifdef ENABLE_AUTOTUNING
#ifdef OPTIONAL_C_ERROR_ARGUMENT
!c> #define elpa_autotune_deallocate(...) CONC(elpa_autotune_deallocate, NARGS(__VA_ARGS__))(__VA_ARGS__)
!c_o> #ifdef OPTIONAL_C_ERROR_ARGUMENT
!c_o> #define elpa_autotune_deallocate(...) CONC(elpa_autotune_deallocate, NARGS(__VA_ARGS__))(__VA_ARGS__)
!c_o> #endif
#endif
!c> /*! \brief C interface for the implementation of the elpa_autotune_deallocate method
!c> *
......@@ -447,8 +463,10 @@ module elpa_impl
!c> * \result void
!c> */
#ifdef OPTIONAL_C_ERROR_ARGUMENT
!c> void elpa_autotune_deallocate2(elpa_autotune_t handle, int *error);
!c> void elpa_autotune_deallocate1(elpa_autotune_t handle);
!c_o> #ifdef OPTIONAL_C_ERROR_ARGUMENT
!c_o> void elpa_autotune_deallocate2(elpa_autotune_t handle, int *error);
!c_o> void elpa_autotune_deallocate1(elpa_autotune_t handle);
!c_o> #endif
subroutine elpa_autotune_impl_deallocate_c1( autotune_handle) bind(C, name="elpa_autotune_deallocate1")
type(c_ptr), value :: autotune_handle
......@@ -469,6 +487,9 @@ module elpa_impl
deallocate(self)
end subroutine
#else
!c_no> #ifndef OPTIONAL_C_ERROR_ARGUMENT
!c_no> void elpa_autotune_deallocate(elpa_autotune_t handle, int *error);
!c_no> #endif
subroutine elpa_autotune_impl_deallocate( autotune_handle, error) bind(C, name="elpa_autotune_deallocate")
type(c_ptr), value :: autotune_handle
......
......@@ -199,7 +199,7 @@ int main(int argc, char** argv) {
}
handle = elpa_allocate(&error);
assert_elpa_ok(error);
//assert_elpa_ok(error);
/* Set parameters */
elpa_set(handle, "na", na, &error);
......
......@@ -180,6 +180,7 @@ int main(int argc, char** argv) {
handle = elpa_allocate(&error);
#endif
assert_elpa_ok(error);
#endif
/* Set parameters */
elpa_set(handle, "na", na, &error);
......
......@@ -236,6 +236,7 @@ int main(int argc, char** argv) {
elpa_handle_2 = elpa_allocate(&error);
#endif
assert_elpa_ok(error);
#endif
set_basic_parameters(&elpa_handle_2, na, nev, na_rows, na_cols, nblk, my_prow, my_pcol);
/* Setup */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment