psblas3-mcbind:

cbind/base/Makefile
 cbind/base/psb_c_base.h
 cbind/base/psb_c_dbase.c
 cbind/base/psb_c_dbase.h
 cbind/base/psb_cpenv_mod.f90
 configure.ac
 configure

Added check for C99 compiler.
Added typedefs for int/real/complex.
psblas3-mcbind
Salvatore Filippone 8 years ago
parent c2828d9dd7
commit 69b42b7816

@ -7,11 +7,14 @@ HERE=..
FINCLUDES=$(FMFLAG). $(FMFLAG)$(INCLUDEDIR) FINCLUDES=$(FMFLAG). $(FMFLAG)$(INCLUDEDIR)
CINCLUDES=-I$(INCLUDEDIR) CINCLUDES=-I$(INCLUDEDIR)
OBJS= psb_objhandle_mod.o psb_base_cbind_mod.o psb_cpenv_mod.o\ FOBJS= psb_objhandle_mod.o psb_base_cbind_mod.o psb_cpenv_mod.o \
psb_base_tools_cbind_mod.o psb_base_string_cbind_mod.o\ psb_base_tools_cbind_mod.o psb_base_string_cbind_mod.o \
psb_base_psblas_cbind_mod.o psb_d_tools_cbind_mod.o psb_c_base.o \ psb_base_psblas_cbind_mod.o psb_d_tools_cbind_mod.o \
psb_d_serial_cbind_mod.o psb_c_dbase.o psb_d_psblas_cbind_mod.o psb_d_serial_cbind_mod.o psb_d_psblas_cbind_mod.o
COBJS= psb_c_base.o psb_c_dbase.o
CMOD=psb_base_cbind.h psb_c_base.h psb_c_dbase.h CMOD=psb_base_cbind.h psb_c_base.h psb_c_dbase.h
OBJS=$(FOBJS) $(COBJS)
LIBMOD=psb_base_cbind_mod$(.mod) psb_cpenv_mod$(.mod) psb_objhandle_mod$(.mod)\ LIBMOD=psb_base_cbind_mod$(.mod) psb_cpenv_mod$(.mod) psb_objhandle_mod$(.mod)\
psb_base_tools_cbind_mod$(.mod) psb_base_string_cbind_mod$(.mod) psb_base_psblas_cbind_mod$(.mod)\ psb_base_tools_cbind_mod$(.mod) psb_base_string_cbind_mod$(.mod) psb_base_psblas_cbind_mod$(.mod)\
@ -25,6 +28,7 @@ lib: $(OBJS) $(CMOD)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
/bin/cp -p $(LIBMOD) $(CMOD) $(HERE) /bin/cp -p $(LIBMOD) $(CMOD) $(HERE)
$(COBJS): $(CMOD)
psb_base_cbind_mod.o: psb_cpenv_mod.o psb_objhandle_mod.o psb_base_tools_cbind_mod.o \ psb_base_cbind_mod.o: psb_cpenv_mod.o psb_objhandle_mod.o psb_base_tools_cbind_mod.o \
psb_base_string_cbind_mod.o psb_base_psblas_cbind_mod.o psb_base_string_cbind_mod.o psb_base_psblas_cbind_mod.o
@ -33,7 +37,7 @@ psb_d_tools_cbind_mod.o psb_d_serial_cbind_mod.o: psb_base_tools_cbind_mod.o
psb_base_psblas_cbind_mod.o: psb_d_psblas_cbind_mod.o psb_base_psblas_cbind_mod.o: psb_d_psblas_cbind_mod.o
psb_d_psblas_cbind_mod.o: psb_objhandle_mod.o psb_base_string_cbind_mod.o psb_d_psblas_cbind_mod.o: psb_objhandle_mod.o psb_base_string_cbind_mod.o
psb_cpenv_mod.o: psb_base_string_cbind_mod.o psb_cpenv_mod.o: psb_base_string_cbind_mod.o psb_objhandle_mod.o
veryclean: clean veryclean: clean
/bin/rm -f $(HERE)/$(LIBNAME) /bin/rm -f $(HERE)/$(LIBNAME)

@ -4,9 +4,24 @@
extern "C" { extern "C" {
typedef char _Bool; typedef char _Bool;
#endif #endif
#include <float.h>
#include <complex.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
typedef int psb_err_t;
typedef int psb_ctx_t; #if defined(LONG_INTEGERS_)
typedef int64_t psb_i_t;
#else
typedef int32_t psb_i_t;
#endif
typedef float psb_s_t;
typedef double psb_d_t;
typedef float complex psb_c_t;
typedef double complex psb_z_t;
#define PSB_ERR_ERROR -1 #define PSB_ERR_ERROR -1
#define PSB_ERR_SUCCESS 0 #define PSB_ERR_SUCCESS 0
@ -17,44 +32,44 @@ extern "C" {
int psb_c_error(); psb_i_t psb_c_error();
int psb_c_clean_errstack(); psb_i_t psb_c_clean_errstack();
void psb_c_print_errmsg(); void psb_c_print_errmsg();
char *psb_c_pop_errmsg(); char *psb_c_pop_errmsg();
int psb_c_f2c_errmsg(char *, int); psb_i_t psb_c_f2c_errmsg(char *, psb_i_t);
void psb_c_seterraction_ret(); void psb_c_seterraction_ret();
void psb_c_seterraction_print(); void psb_c_seterraction_print();
void psb_c_seterraction_abort(); void psb_c_seterraction_abort();
/* Environment routines */ /* Environment routines */
int psb_c_init(); psb_i_t psb_c_init();
void psb_c_exit_ctxt(int ictxt); void psb_c_exit_ctxt(psb_i_t ictxt);
void psb_c_exit(int ictxt); void psb_c_exit(psb_i_t ictxt);
void psb_c_abort(int ictxt); void psb_c_abort(psb_i_t ictxt);
void psb_c_barrier(int ictxt); void psb_c_barrier(psb_i_t ictxt);
void psb_c_info(int ictxt, int *iam, int *np); void psb_c_info(psb_i_t ictxt, psb_i_t *iam, psb_i_t *np);
double psb_c_wtime(); psb_d_t psb_c_wtime();
int psb_c_get_errstatus(); psb_i_t psb_c_get_errstatus();
void psb_c_ibcast(int ictxt, int n, int *v, int root); void psb_c_ibcast(psb_i_t ictxt, psb_i_t n, psb_i_t *v, psb_i_t root);
void psb_c_dbcast(int ictxt, int n, double *v, int root); void psb_c_dbcast(psb_i_t ictxt, psb_i_t n, psb_d_t *v, psb_i_t root);
void psb_c_hbcast(int ictxt, const char *v, int root); void psb_c_hbcast(psb_i_t ictxt, const char *v, psb_i_t root);
/* Descriptor/integer routines */ /* Descriptor/integer routines */
psb_c_descriptor* psb_c_new_descriptor(); psb_c_descriptor* psb_c_new_descriptor();
int psb_c_cdall_vg(int ng, int *vg, int ictxt, psb_c_descriptor *cd); psb_i_t psb_c_cdall_vg(psb_i_t ng, psb_i_t *vg, psb_i_t ictxt, psb_c_descriptor *cd);
int psb_c_cdall_vl(int nl, int *vl, int ictxt, psb_c_descriptor *cd); psb_i_t psb_c_cdall_vl(psb_i_t nl, psb_i_t *vl, psb_i_t ictxt, psb_c_descriptor *cd);
int psb_c_cdall_nl(int nl, int ictxt, psb_c_descriptor *cd); psb_i_t psb_c_cdall_nl(psb_i_t nl, psb_i_t ictxt, psb_c_descriptor *cd);
int psb_c_cdall_repl(int n, int ictxt, psb_c_descriptor *cd); psb_i_t psb_c_cdall_repl(psb_i_t n, psb_i_t ictxt, psb_c_descriptor *cd);
int psb_c_cdasb(psb_c_descriptor *cd); psb_i_t psb_c_cdasb(psb_c_descriptor *cd);
int psb_c_cdfree(psb_c_descriptor *cd); psb_i_t psb_c_cdfree(psb_c_descriptor *cd);
int psb_c_cdins(int nz, const int *ia, const int *ja, psb_c_descriptor *cd); psb_i_t psb_c_cdins(psb_i_t nz, const psb_i_t *ia, const psb_i_t *ja, psb_c_descriptor *cd);
int psb_c_cd_get_local_rows(psb_c_descriptor *cd); psb_i_t psb_c_cd_get_local_rows(psb_c_descriptor *cd);
int psb_c_cd_get_local_cols(psb_c_descriptor *cd); psb_i_t psb_c_cd_get_local_cols(psb_c_descriptor *cd);
int psb_c_cd_get_global_rows(psb_c_descriptor *cd); psb_i_t psb_c_cd_get_global_rows(psb_c_descriptor *cd);
int psb_c_cd_get_global_rows(psb_c_descriptor *cd); psb_i_t psb_c_cd_get_global_rows(psb_c_descriptor *cd);
/* legal values for upd argument */ /* legal values for upd argument */

@ -13,7 +13,7 @@ psb_c_dvector* psb_c_new_dvector()
double* psb_c_dvect_get_cpy(psb_c_dvector *xh) double* psb_c_dvect_get_cpy(psb_c_dvector *xh)
{ {
double *temp=NULL; double *temp=NULL;
int vsize=0; psb_i_t vsize=0;
if ((vsize=psb_c_dvect_get_nrows(xh))<0) if ((vsize=psb_c_dvect_get_nrows(xh))<0)
return(temp); return(temp);

@ -17,46 +17,46 @@ typedef struct PSB_C_DSPMAT {
/* dense vectors */ /* dense vectors */
psb_c_dvector* psb_c_new_dvector(); psb_c_dvector* psb_c_new_dvector();
int psb_c_dvect_get_nrows(psb_c_dvector *xh); psb_i_t psb_c_dvect_get_nrows(psb_c_dvector *xh);
double *psb_c_dvect_get_cpy( psb_c_dvector *xh); psb_d_t *psb_c_dvect_get_cpy( psb_c_dvector *xh);
int psb_c_dvect_f_get_cpy(double *v, psb_c_dvector *xh); psb_i_t psb_c_dvect_f_get_cpy(psb_d_t *v, psb_c_dvector *xh);
int psb_c_dvect_zero(psb_c_dvector *xh); psb_i_t psb_c_dvect_zero(psb_c_dvector *xh);
int psb_c_dgeall(psb_c_dvector *xh, psb_c_descriptor *cdh); psb_i_t psb_c_dgeall(psb_c_dvector *xh, psb_c_descriptor *cdh);
int psb_c_dgeins(int nz, const int *irw, const double *val, psb_i_t psb_c_dgeins(psb_i_t nz, const psb_i_t *irw, const psb_d_t *val,
psb_c_dvector *xh, psb_c_descriptor *cdh); psb_c_dvector *xh, psb_c_descriptor *cdh);
int psb_c_dgeins_add(int nz, const int *irw, const double *val, psb_i_t psb_c_dgeins_add(psb_i_t nz, const psb_i_t *irw, const psb_d_t *val,
psb_c_dvector *xh, psb_c_descriptor *cdh); psb_c_dvector *xh, psb_c_descriptor *cdh);
int psb_c_dgeasb(psb_c_dvector *xh, psb_c_descriptor *cdh); psb_i_t psb_c_dgeasb(psb_c_dvector *xh, psb_c_descriptor *cdh);
int psb_c_dgefree(psb_c_dvector *xh, psb_c_descriptor *cdh); psb_i_t psb_c_dgefree(psb_c_dvector *xh, psb_c_descriptor *cdh);
/* sparse matrices*/ /* sparse matrices*/
psb_c_dspmat* psb_c_new_dspmat(); psb_c_dspmat* psb_c_new_dspmat();
int psb_c_dspall(psb_c_dspmat *mh, psb_c_descriptor *cdh); psb_i_t psb_c_dspall(psb_c_dspmat *mh, psb_c_descriptor *cdh);
int psb_c_dspasb(psb_c_dspmat *mh, psb_c_descriptor *cdh); psb_i_t psb_c_dspasb(psb_c_dspmat *mh, psb_c_descriptor *cdh);
int psb_c_dspfree(psb_c_dspmat *mh, psb_c_descriptor *cdh); psb_i_t psb_c_dspfree(psb_c_dspmat *mh, psb_c_descriptor *cdh);
int psb_c_dspins(int nz, const int *irw, const int *icl, const double *val, psb_i_t psb_c_dspins(psb_i_t nz, const psb_i_t *irw, const psb_i_t *icl, const psb_d_t *val,
psb_c_dspmat *mh, psb_c_descriptor *cdh); psb_c_dspmat *mh, psb_c_descriptor *cdh);
int psb_c_dmat_get_nrows(psb_c_dspmat *mh); psb_i_t psb_c_dmat_get_nrows(psb_c_dspmat *mh);
int psb_c_dmat_get_ncols(psb_c_dspmat *mh); psb_i_t psb_c_dmat_get_ncols(psb_c_dspmat *mh);
/* int psb_c_dspasb_opt(psb_c_dspmat *mh, psb_c_descriptor *cdh, */ /* psb_i_t psb_c_dspasb_opt(psb_c_dspmat *mh, psb_c_descriptor *cdh, */
/* const char *afmt, int upd, int dupl); */ /* const char *afmt, psb_i_t upd, psb_i_t dupl); */
int psb_c_dsprn(psb_c_dspmat *mh, psb_c_descriptor *cdh, _Bool clear); psb_i_t psb_c_dsprn(psb_c_dspmat *mh, psb_c_descriptor *cdh, _Bool clear);
/* int psb_c_dspprint(psb_c_dspmat *mh); */ /* psb_i_t psb_c_dspprint(psb_c_dspmat *mh); */
/* psblas computational routines */ /* psblas computational routines */
double psb_c_dgedot(psb_c_dvector *xh, psb_c_dvector *yh, psb_c_descriptor *cdh); psb_d_t psb_c_dgedot(psb_c_dvector *xh, psb_c_dvector *yh, psb_c_descriptor *cdh);
double psb_c_dgenrm2(psb_c_dvector *xh, psb_c_descriptor *cdh); psb_d_t psb_c_dgenrm2(psb_c_dvector *xh, psb_c_descriptor *cdh);
double psb_c_dgeamax(psb_c_dvector *xh, psb_c_descriptor *cdh); psb_d_t psb_c_dgeamax(psb_c_dvector *xh, psb_c_descriptor *cdh);
double psb_c_dgeasum(psb_c_dvector *xh, psb_c_descriptor *cdh); psb_d_t psb_c_dgeasum(psb_c_dvector *xh, psb_c_descriptor *cdh);
double psb_c_dspnrmi(psb_c_dvector *xh, psb_c_descriptor *cdh); psb_d_t psb_c_dspnrmi(psb_c_dvector *xh, psb_c_descriptor *cdh);
int psb_c_dgeaxpby(double alpha, psb_c_dvector *xh, psb_i_t psb_c_dgeaxpby(psb_d_t alpha, psb_c_dvector *xh,
double beta, psb_c_dvector *yh, psb_c_descriptor *cdh); psb_d_t beta, psb_c_dvector *yh, psb_c_descriptor *cdh);
int psb_c_dspmm(double alpha, psb_c_dspmat *ah, psb_c_dvector *xh, psb_i_t psb_c_dspmm(psb_d_t alpha, psb_c_dspmat *ah, psb_c_dvector *xh,
double beta, psb_c_dvector *yh, psb_c_descriptor *cdh); psb_d_t beta, psb_c_dvector *yh, psb_c_descriptor *cdh);
int psb_c_dspsm(double alpha, psb_c_dspmat *th, psb_c_dvector *xh, psb_i_t psb_c_dspsm(psb_d_t alpha, psb_c_dspmat *th, psb_c_dvector *xh,
double beta, psb_c_dvector *yh, psb_c_descriptor *cdh); psb_d_t beta, psb_c_dvector *yh, psb_c_descriptor *cdh);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */

@ -1,10 +1,11 @@
module psb_cpenv_mod module psb_cpenv_mod
use iso_c_binding use iso_c_binding
use psb_objhandle_mod
contains contains
function psb_c_get_errstatus() bind(c) result(res) function psb_c_get_errstatus() bind(c) result(res)
use psb_base_mod use psb_base_mod, only : psb_get_errstatus
implicit none implicit none
integer(c_int) :: res integer(c_int) :: res
@ -13,7 +14,7 @@ contains
end function psb_c_get_errstatus end function psb_c_get_errstatus
function psb_c_init() bind(c) function psb_c_init() bind(c)
use psb_base_mod use psb_base_mod, only : psb_init
implicit none implicit none
integer(c_int) :: psb_c_init integer(c_int) :: psb_c_init
@ -25,7 +26,7 @@ contains
end function psb_c_init end function psb_c_init
subroutine psb_c_exit_ctxt(ictxt) bind(c) subroutine psb_c_exit_ctxt(ictxt) bind(c)
use psb_base_mod use psb_base_mod, only : psb_exit
integer(c_int), value :: ictxt integer(c_int), value :: ictxt
call psb_exit(ictxt,close=.false.) call psb_exit(ictxt,close=.false.)
@ -33,7 +34,7 @@ contains
end subroutine psb_c_exit_ctxt end subroutine psb_c_exit_ctxt
subroutine psb_c_exit(ictxt) bind(c) subroutine psb_c_exit(ictxt) bind(c)
use psb_base_mod use psb_base_mod, only : psb_exit
integer(c_int), value :: ictxt integer(c_int), value :: ictxt
call psb_exit(ictxt) call psb_exit(ictxt)
@ -41,7 +42,7 @@ contains
end subroutine psb_c_exit end subroutine psb_c_exit
subroutine psb_c_abort(ictxt) bind(c) subroutine psb_c_abort(ictxt) bind(c)
use psb_base_mod use psb_base_mod, only : psb_abort
integer(c_int), value :: ictxt integer(c_int), value :: ictxt
call psb_abort(ictxt) call psb_abort(ictxt)
@ -50,7 +51,7 @@ contains
subroutine psb_c_info(ictxt,iam,np) bind(c) subroutine psb_c_info(ictxt,iam,np) bind(c)
use psb_base_mod use psb_base_mod, only : psb_info
integer(c_int), value :: ictxt integer(c_int), value :: ictxt
integer(c_int) :: iam,np integer(c_int) :: iam,np
@ -59,20 +60,20 @@ contains
end subroutine psb_c_info end subroutine psb_c_info
subroutine psb_c_barrier(ictxt) bind(c) subroutine psb_c_barrier(ictxt) bind(c)
use psb_base_mod use psb_base_mod, only : psb_barrier
integer(c_int), value :: ictxt integer(c_int), value :: ictxt
call psb_barrier(ictxt) call psb_barrier(ictxt)
end subroutine psb_c_barrier end subroutine psb_c_barrier
real(c_double) function psb_c_wtime() bind(c) real(c_double) function psb_c_wtime() bind(c)
use psb_base_mod use psb_base_mod, only : psb_wtime
psb_c_wtime = psb_wtime() psb_c_wtime = psb_wtime()
end function psb_c_wtime end function psb_c_wtime
subroutine psb_c_ibcast(ictxt,n,v,root) bind(c) subroutine psb_c_ibcast(ictxt,n,v,root) bind(c)
use psb_base_mod use psb_base_mod, only : psb_bcast
implicit none implicit none
integer(c_int), value :: ictxt,n, root integer(c_int), value :: ictxt,n, root
integer(c_int) :: v(*) integer(c_int) :: v(*)
@ -87,7 +88,7 @@ contains
end subroutine psb_c_ibcast end subroutine psb_c_ibcast
subroutine psb_c_dbcast(ictxt,n,v,root) bind(c) subroutine psb_c_dbcast(ictxt,n,v,root) bind(c)
use psb_base_mod use psb_base_mod, only : psb_bcast
implicit none implicit none
integer(c_int), value :: ictxt,n, root integer(c_int), value :: ictxt,n, root
real(c_double) :: v(*) real(c_double) :: v(*)
@ -102,7 +103,7 @@ contains
end subroutine psb_c_dbcast end subroutine psb_c_dbcast
subroutine psb_c_hbcast(ictxt,v,root) bind(c) subroutine psb_c_hbcast(ictxt,v,root) bind(c)
use psb_base_mod use psb_base_mod, only : psb_bcast, psb_info
implicit none implicit none
integer(c_int), value :: ictxt, root integer(c_int), value :: ictxt, root
character(c_char) :: v(*) character(c_char) :: v(*)
@ -122,7 +123,7 @@ contains
end subroutine psb_c_hbcast end subroutine psb_c_hbcast
function psb_c_f2c_errmsg(cmesg,len) bind(c) result(res) function psb_c_f2c_errmsg(cmesg,len) bind(c) result(res)
use psb_base_mod use psb_base_mod, only : psb_errpop,psb_max_errmsg_len_
use psb_base_string_cbind_mod use psb_base_string_cbind_mod
implicit none implicit none
character(c_char), intent(inout) :: cmesg(*) character(c_char), intent(inout) :: cmesg(*)
@ -152,17 +153,17 @@ contains
end function psb_c_f2c_errmsg end function psb_c_f2c_errmsg
subroutine psb_c_seterraction_ret() bind(c) subroutine psb_c_seterraction_ret() bind(c)
use psb_base_mod use psb_base_mod, only : psb_set_erraction, psb_act_ret_
call psb_set_erraction(psb_act_ret_) call psb_set_erraction(psb_act_ret_)
end subroutine psb_c_seterraction_ret end subroutine psb_c_seterraction_ret
subroutine psb_c_seterraction_print() bind(c) subroutine psb_c_seterraction_print() bind(c)
use psb_base_mod use psb_base_mod, only : psb_set_erraction, psb_act_print_
call psb_set_erraction(psb_act_print_) call psb_set_erraction(psb_act_print_)
end subroutine psb_c_seterraction_print end subroutine psb_c_seterraction_print
subroutine psb_c_seterraction_abort() bind(c) subroutine psb_c_seterraction_abort() bind(c)
use psb_base_mod use psb_base_mod, only : psb_set_erraction, psb_act_abort_
call psb_set_erraction(psb_act_abort_) call psb_set_erraction(psb_act_abort_)
end subroutine psb_c_seterraction_abort end subroutine psb_c_seterraction_abort

8700
configure vendored

File diff suppressed because it is too large Load Diff

@ -111,6 +111,14 @@ fi
if test "X$CC" == "X" ; then if test "X$CC" == "X" ; then
AC_MSG_ERROR([Problem : No C compiler specified nor found!]) AC_MSG_ERROR([Problem : No C compiler specified nor found!])
fi fi
AC_PROG_CC_C99()
if test "$ac_cv_prog_cc_c99" == "no" ; then
AC_MSG_ERROR([Problem : Need a C99 compiler ! ])
else
CDEFINES="$ac_cv_prog_cc_c99 $CDEFINES"
fi
############################################################################### ###############################################################################
# Suitable MPI compilers detection # Suitable MPI compilers detection
@ -529,6 +537,7 @@ fi
PAC_ARG_LONG_INTEGERS PAC_ARG_LONG_INTEGERS
if test x"$pac_cv_long_integers" == x"yes" ; then if test x"$pac_cv_long_integers" == x"yes" ; then
FDEFINES="$psblas_cv_define_prepend-DLONG_INTEGERS $FDEFINES"; FDEFINES="$psblas_cv_define_prepend-DLONG_INTEGERS $FDEFINES";
CDEFINES="-DLONG_INTEGERS_ $CDEFINES";
fi fi
# #

Loading…
Cancel
Save