Update support for SuperLU_Dist version 6

stopcriterion
Salvatore Filippone 5 years ago
parent fa4623f54b
commit 6fb0172cd7

@ -692,9 +692,19 @@ AC_CHECK_HEADERS([slu_ddefs.h],
[pac_slu_header_ok=yes], [pac_slu_header_ok=yes],
[pac_slu_header_ok=no; SLU_INCLUDES=""]) [pac_slu_header_ok=no; SLU_INCLUDES=""])
if test "x$pac_slu_header_ok" == "xno" ; then if test "x$pac_slu_header_ok" == "xno" ; then
dnl Maybe Include or include subdirs? dnl Maybe include subdirs?
unset ac_cv_header_slu_ddefs_h
SLU_INCLUDES="-I$mld2p4_cv_superludir/include "
CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS"
AC_CHECK_HEADERS([slu_ddefs.h],
[pac_slu_header_ok=yes],
[pac_slu_header_ok=no; SLU_INCLUDES=""])
fi
if test "x$pac_slu_header_ok" == "xno" ; then
dnl Maybe Include subdirs?
unset ac_cv_header_slu_ddefs_h unset ac_cv_header_slu_ddefs_h
SLU_INCLUDES="-I$mld2p4_cv_superludir/include -I$mld2p4_cv_superludir/Include " SLU_INCLUDES="-I$mld2p4_cv_superludir/Include "
CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS" CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS"
AC_CHECK_HEADERS([slu_ddefs.h], AC_CHECK_HEADERS([slu_ddefs.h],
@ -715,7 +725,7 @@ if test "x$pac_slu_header_ok" == "xyes" ; then
LIBS="$SLU_LIBS -lm $save_LIBS"; LIBS="$SLU_LIBS -lm $save_LIBS";
AC_TRY_LINK_FUNC(superlu_malloc, AC_TRY_LINK_FUNC(superlu_malloc,
[mld2p4_cv_have_superlu=yes;pac_slu_lib_ok=yes;], [mld2p4_cv_have_superlu=yes;pac_slu_lib_ok=yes;],
[mld2p4_cv_have_superlu=no;pac_slu_lib_ok=no; SLU_LIBS="";]) [mld2p4_cv_have_superlu=no;pac_slu_lib_ok=no; SLU_LIBS=""; ])
fi fi
if test "x$pac_slu_lib_ok" == "xno" ; then if test "x$pac_slu_lib_ok" == "xno" ; then
dnl Maybe lib64? dnl Maybe lib64?
@ -807,9 +817,19 @@ AC_CHECK_HEADERS([superlu_ddefs.h],
[pac_sludist_header_ok=yes], [pac_sludist_header_ok=yes],
[pac_sludist_header_ok=no; SLUDIST_INCLUDES=""]) [pac_sludist_header_ok=no; SLUDIST_INCLUDES=""])
if test "x$pac_sludist_header_ok" == "xno" ; then if test "x$pac_sludist_header_ok" == "xno" ; then
dnl Maybe Include or include subdirs? dnl Maybe include subdirs?
unset ac_cv_header_superlu_ddefs_h
SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/include"
CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS"
AC_CHECK_HEADERS([superlu_ddefs.h],
[pac_sludist_header_ok=yes],
[pac_sludist_header_ok=no; SLUDIST_INCLUDES=""; SLUDIST_LIBS=""; ])
fi
if test "x$pac_sludist_header_ok" == "xno" ; then
dnl Maybe Include subdirs?
unset ac_cv_header_superlu_ddefs_h unset ac_cv_header_superlu_ddefs_h
SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/include -I$mld2p4_cv_superludistdir/Include" SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/Include"
CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS" CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS"
AC_CHECK_HEADERS([superlu_ddefs.h], AC_CHECK_HEADERS([superlu_ddefs.h],
@ -829,18 +849,42 @@ if test "x$pac_sludist_header_ok" == "xyes" ; then
dnl Maybe lib? dnl Maybe lib?
SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib"; SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib";
LIBS="$SLUDIST_LIBS -lm $save_LIBS"; LIBS="$SLUDIST_LIBS -lm $save_LIBS";
AC_TRY_LINK_FUNC(superlu_malloc_dist,
[mld2p4_cv_have_superludist=yes;pac_sludist_lib_ok=yes;],
[mld2p4_cv_have_superludist=no;pac_sludist_lib_ok=no;
SLUDIST_LIBS="";])
fi
if test "x$pac_sludist_lib_ok" == "xno" ; then
dnl Maybe lib64?
SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib64";
LIBS="$SLUDIST_LIBS -lm $save_LIBS";
AC_TRY_LINK_FUNC(superlu_malloc_dist, AC_TRY_LINK_FUNC(superlu_malloc_dist,
[mld2p4_cv_have_superludist=yes;pac_sludist_lib_ok=yes;], [mld2p4_cv_have_superludist=yes;pac_sludist_lib_ok=yes;],
[mld2p4_cv_have_superludist=no;pac_sludist_lib_ok=no; [mld2p4_cv_have_superludist=no;pac_sludist_lib_ok=no;
SLUDIST_LIBS="";SLUDIST_INCLUDES=""]) SLUDIST_LIBS="";SLUDIST_INCLUDES=""])
fi fi
AC_MSG_RESULT($pac_sludist_lib_ok) AC_MSG_RESULT($pac_sludist_lib_ok)
if test "x$pac_sludist_lib_ok" == "xyes" ; then if test "x$pac_sludist_lib_ok" == "xyes" ; then
AC_MSG_CHECKING([for superlu_dist version 4]) AC_MSG_CHECKING([for superlu_dist version 6])
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])
ac_cc=${MPICC-$CC} ac_cc=${MPICC-$CC}
AC_COMPILE_IFELSE( AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[ #include "superlu_ddefs.h" [AC_LANG_SOURCE([[ #include "superlu_ddefs.h"
int testdslud()
{ dLUstruct_t *LUstruct;
int n;
dLUstructInit(n, LUstruct);
}]])],
[ AC_MSG_RESULT([yes]); pac_sludist_version="6";],
[ AC_MSG_RESULT([no]); pac_sludist_version="";])
AC_LANG_POP([C])
if test "x$pac_sludist_version" == "x" ; then
AC_MSG_CHECKING([for superlu_dist version 4])
AC_LANG_PUSH([C])
ac_cc=${MPICC-$CC}
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[ #include "superlu_ddefs.h"
int testdslud() int testdslud()
{ LUstruct_t *LUstruct; { LUstruct_t *LUstruct;
int n; int n;
@ -850,11 +894,11 @@ if test "x$pac_sludist_header_ok" == "xyes" ; then
[ AC_MSG_RESULT([no]); pac_sludist_version="3";]) [ AC_MSG_RESULT([no]); pac_sludist_version="3";])
AC_LANG_POP([C]) AC_LANG_POP([C])
if test "x$pac_sludist_version" == "x4" ; then if test "x$pac_sludist_version" == "x4" ; then
AC_MSG_CHECKING([for superlu_dist version 5]) AC_MSG_CHECKING([for superlu_dist version 5])
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])
ac_cc=${MPICC-$CC} ac_cc=${MPICC-$CC}
AC_COMPILE_IFELSE( AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[ #include "superlu_ddefs.h" [AC_LANG_SOURCE([[ #include "superlu_ddefs.h"
int testdslud() int testdslud()
{ superlu_dist_options_t options; { superlu_dist_options_t options;
int n; int n;
@ -862,14 +906,15 @@ if test "x$pac_sludist_header_ok" == "xyes" ; then
}]])], }]])],
[ AC_MSG_RESULT([yes]); pac_sludist_version="5";], [ AC_MSG_RESULT([yes]); pac_sludist_version="5";],
[ AC_MSG_RESULT([no]); pac_sludist_version="4";]) [ AC_MSG_RESULT([no]); pac_sludist_version="4";])
AC_LANG_POP([C]) AC_LANG_POP([C])
fi fi
else fi
SLUDIST_LIBS=""; else
SLUDIST_INCLUDES=""; SLUDIST_LIBS="";
fi SLUDIST_INCLUDES="";
fi fi
fi
LIBS="$save_LIBS"; LIBS="$save_LIBS";
CPPFLAGS="$save_CPPFLAGS"; CPPFLAGS="$save_CPPFLAGS";

139
configure vendored

@ -8637,7 +8637,27 @@ done
if test "x$pac_slu_header_ok" == "xno" ; then if test "x$pac_slu_header_ok" == "xno" ; then
unset ac_cv_header_slu_ddefs_h unset ac_cv_header_slu_ddefs_h
SLU_INCLUDES="-I$mld2p4_cv_superludir/include -I$mld2p4_cv_superludir/Include " SLU_INCLUDES="-I$mld2p4_cv_superludir/include "
CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS"
for ac_header in slu_ddefs.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "slu_ddefs.h" "ac_cv_header_slu_ddefs_h" "$ac_includes_default"
if test "x$ac_cv_header_slu_ddefs_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SLU_DDEFS_H 1
_ACEOF
pac_slu_header_ok=yes
else
pac_slu_header_ok=no; SLU_INCLUDES=""
fi
done
fi
if test "x$pac_slu_header_ok" == "xno" ; then
unset ac_cv_header_slu_ddefs_h
SLU_INCLUDES="-I$mld2p4_cv_superludir/Include "
CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS" CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS"
for ac_header in slu_ddefs.h for ac_header in slu_ddefs.h
@ -8881,7 +8901,27 @@ done
if test "x$pac_sludist_header_ok" == "xno" ; then if test "x$pac_sludist_header_ok" == "xno" ; then
unset ac_cv_header_superlu_ddefs_h unset ac_cv_header_superlu_ddefs_h
SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/include -I$mld2p4_cv_superludistdir/Include" SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/include"
CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS"
for ac_header in superlu_ddefs.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "superlu_ddefs.h" "ac_cv_header_superlu_ddefs_h" "$ac_includes_default"
if test "x$ac_cv_header_superlu_ddefs_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SUPERLU_DDEFS_H 1
_ACEOF
pac_sludist_header_ok=yes
else
pac_sludist_header_ok=no; SLUDIST_INCLUDES=""; SLUDIST_LIBS="";
fi
done
fi
if test "x$pac_sludist_header_ok" == "xno" ; then
unset ac_cv_header_superlu_ddefs_h
SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/Include"
CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS" CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS"
for ac_header in superlu_ddefs.h for ac_header in superlu_ddefs.h
@ -8937,6 +8977,36 @@ rm -f core conftest.err conftest.$ac_objext \
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char superlu_malloc_dist ();
int
main ()
{
return superlu_malloc_dist ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
mld2p4_cv_have_superludist=yes;pac_sludist_lib_ok=yes;
else
mld2p4_cv_have_superludist=no;pac_sludist_lib_ok=no;
SLUDIST_LIBS="";
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
if test "x$pac_sludist_lib_ok" == "xno" ; then
SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib64";
LIBS="$SLUDIST_LIBS -lm $save_LIBS";
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error. /* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */ builtin and then its argument prototype would still apply. */
@ -8960,20 +9030,54 @@ else
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pac_sludist_lib_ok" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pac_sludist_lib_ok" >&5
$as_echo "$pac_sludist_lib_ok" >&6; } $as_echo "$pac_sludist_lib_ok" >&6; }
if test "x$pac_sludist_lib_ok" == "xyes" ; then if test "x$pac_sludist_lib_ok" == "xyes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_dist version 4" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_dist version 6" >&5
$as_echo_n "checking for superlu_dist version 6... " >&6; }
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_cc=${MPICC-$CC}
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "superlu_ddefs.h"
int testdslud()
{ dLUstruct_t *LUstruct;
int n;
dLUstructInit(n, LUstruct);
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; pac_sludist_version="6";
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }; pac_sludist_version="";
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "x$pac_sludist_version" == "x" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_dist version 4" >&5
$as_echo_n "checking for superlu_dist version 4... " >&6; } $as_echo_n "checking for superlu_dist version 4... " >&6; }
ac_ext=c ac_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_cc=${MPICC-$CC} ac_cc=${MPICC-$CC}
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
#include "superlu_ddefs.h" #include "superlu_ddefs.h"
int testdslud() int testdslud()
@ -8997,16 +9101,16 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "x$pac_sludist_version" == "x4" ; then if test "x$pac_sludist_version" == "x4" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_dist version 5" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_dist version 5" >&5
$as_echo_n "checking for superlu_dist version 5... " >&6; } $as_echo_n "checking for superlu_dist version 5... " >&6; }
ac_ext=c ac_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_cc=${MPICC-$CC} ac_cc=${MPICC-$CC}
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
#include "superlu_ddefs.h" #include "superlu_ddefs.h"
int testdslud() int testdslud()
@ -9023,7 +9127,7 @@ else
$as_echo "no" >&6; }; pac_sludist_version="4"; $as_echo "no" >&6; }; pac_sludist_version="4";
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c ac_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@ -9031,11 +9135,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi fi
else fi
SLUDIST_LIBS=""; else
SLUDIST_INCLUDES=""; SLUDIST_LIBS="";
fi SLUDIST_INCLUDES="";
fi fi
fi
LIBS="$save_LIBS"; LIBS="$save_LIBS";
CPPFLAGS="$save_CPPFLAGS"; CPPFLAGS="$save_CPPFLAGS";

@ -94,13 +94,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define HANDLE_SIZE 8 #define HANDLE_SIZE 8
#if defined(SLUD_VERSION_6)
typedef struct {
SuperMatrix *A;
dLUstruct_t *LUstruct;
gridinfo_t *grid;
dScalePermstruct_t *ScalePermstruct;
} factors_t;
#else
typedef struct { typedef struct {
SuperMatrix *A; SuperMatrix *A;
LUstruct_t *LUstruct; LUstruct_t *LUstruct;
gridinfo_t *grid; gridinfo_t *grid;
ScalePermstruct_t *ScalePermstruct; ScalePermstruct_t *ScalePermstruct;
} factors_t; } factors_t;
#endif
#else #else
@ -127,14 +135,20 @@ int mld_dsludist_fact(int n, int nl, int nnzl, int ffstr,
SuperMatrix *A; SuperMatrix *A;
NRformat_loc *Astore; NRformat_loc *Astore;
#if defined(SLUD_VERSION_6)
dScalePermstruct_t *ScalePermstruct;
dLUstruct_t *LUstruct;
dSOLVEstruct_t SOLVEstruct;
#else
ScalePermstruct_t *ScalePermstruct; ScalePermstruct_t *ScalePermstruct;
LUstruct_t *LUstruct; LUstruct_t *LUstruct;
SOLVEstruct_t SOLVEstruct; SOLVEstruct_t SOLVEstruct;
#endif
gridinfo_t *grid; gridinfo_t *grid;
int i, panel_size, permc_spec, relax, info; int i, panel_size, permc_spec, relax, info;
trans_t trans; trans_t trans;
double drop_tol = 0.0, b[1], berr[1]; double drop_tol = 0.0, b[1], berr[1];
#if defined(SLUD_VERSION_5) #if defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
superlu_dist_options_t options; superlu_dist_options_t options;
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) #elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
superlu_options_t options; superlu_options_t options;
@ -160,10 +174,18 @@ int mld_dsludist_fact(int n, int nl, int nnzl, int ffstr,
SLU_NR_loc, SLU_D, SLU_GE); SLU_NR_loc, SLU_D, SLU_GE);
/* Initialize ScalePermstruct and LUstruct. */ /* Initialize ScalePermstruct and LUstruct. */
#if defined(SLUD_VERSION_6)
ScalePermstruct = (dScalePermstruct_t *) SUPERLU_MALLOC(sizeof(dScalePermstruct_t));
LUstruct = (dLUstruct_t *) SUPERLU_MALLOC(sizeof(dLUstruct_t));
dScalePermstructInit(n,n, ScalePermstruct);
#else
ScalePermstruct = (ScalePermstruct_t *) SUPERLU_MALLOC(sizeof(ScalePermstruct_t)); ScalePermstruct = (ScalePermstruct_t *) SUPERLU_MALLOC(sizeof(ScalePermstruct_t));
LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t)); LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t));
ScalePermstructInit(n,n, ScalePermstruct); ScalePermstructInit(n,n, ScalePermstruct);
#if defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5) #endif
#if defined(SLUD_VERSION_6)
dLUstructInit(n, LUstruct);
#elif defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5)
LUstructInit(n, LUstruct); LUstructInit(n, LUstruct);
#elif defined(SLUD_VERSION_3) #elif defined(SLUD_VERSION_3)
LUstructInit(n,n, LUstruct); LUstructInit(n,n, LUstruct);
@ -223,15 +245,21 @@ int mld_dsludist_solve(int itrans, int n, int nrhs,
*/ */
#ifdef Have_SLUDist_ #ifdef Have_SLUDist_
SuperMatrix *A; SuperMatrix *A;
#if defined(SLUD_VERSION_6)
dScalePermstruct_t *ScalePermstruct;
dLUstruct_t *LUstruct;
dSOLVEstruct_t SOLVEstruct;
#else
ScalePermstruct_t *ScalePermstruct; ScalePermstruct_t *ScalePermstruct;
LUstruct_t *LUstruct; LUstruct_t *LUstruct;
SOLVEstruct_t SOLVEstruct; SOLVEstruct_t SOLVEstruct;
#endif
gridinfo_t *grid; gridinfo_t *grid;
int i, panel_size, permc_spec, relax, info; int i, panel_size, permc_spec, relax, info;
trans_t trans; trans_t trans;
double drop_tol = 0.0; double drop_tol = 0.0;
double *berr; double *berr;
#if defined(SLUD_VERSION_5) #if defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
superlu_dist_options_t options; superlu_dist_options_t options;
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) #elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
superlu_options_t options; superlu_options_t options;
@ -303,15 +331,21 @@ int mld_dsludist_free(void *f_factors)
*/ */
#ifdef Have_SLUDist_ #ifdef Have_SLUDist_
SuperMatrix *A; SuperMatrix *A;
#if defined(SLUD_VERSION_6)
dScalePermstruct_t *ScalePermstruct;
dLUstruct_t *LUstruct;
dSOLVEstruct_t SOLVEstruct;
#else
ScalePermstruct_t *ScalePermstruct; ScalePermstruct_t *ScalePermstruct;
LUstruct_t *LUstruct; LUstruct_t *LUstruct;
SOLVEstruct_t SOLVEstruct; SOLVEstruct_t SOLVEstruct;
#endif
gridinfo_t *grid; gridinfo_t *grid;
int i, panel_size, permc_spec, relax; int i, panel_size, permc_spec, relax;
trans_t trans; trans_t trans;
double drop_tol = 0.0; double drop_tol = 0.0;
double *berr; double *berr;
#if defined(SLUD_VERSION_5) #if defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
superlu_dist_options_t options; superlu_dist_options_t options;
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) #elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
superlu_options_t options; superlu_options_t options;
@ -334,8 +368,13 @@ int mld_dsludist_free(void *f_factors)
// we either have a leak or a segfault here. // we either have a leak or a segfault here.
// To be investigated further. // To be investigated further.
//Destroy_CompRowLoc_Matrix_dist(A); //Destroy_CompRowLoc_Matrix_dist(A);
#if defined(SLUD_VERSION_6)
dScalePermstructFree(ScalePermstruct);
dLUstructFree(LUstruct);
#else
ScalePermstructFree(ScalePermstruct); ScalePermstructFree(ScalePermstruct);
LUstructFree(LUstruct); LUstructFree(LUstruct);
#endif
superlu_gridexit(grid); superlu_gridexit(grid);
free(grid); free(grid);

@ -92,13 +92,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define HANDLE_SIZE 8 #define HANDLE_SIZE 8
#if defined(SLUD_VERSION_6)
typedef struct {
SuperMatrix *A;
zLUstruct_t *LUstruct;
gridinfo_t *grid;
zScalePermstruct_t *ScalePermstruct;
} factors_t;
#else
typedef struct { typedef struct {
SuperMatrix *A; SuperMatrix *A;
LUstruct_t *LUstruct; LUstruct_t *LUstruct;
gridinfo_t *grid; gridinfo_t *grid;
ScalePermstruct_t *ScalePermstruct; ScalePermstruct_t *ScalePermstruct;
} factors_t; } factors_t;
#endif
#else #else
@ -132,14 +140,20 @@ int mld_zsludist_fact(int n, int nl, int nnzl, int ffstr,
SuperMatrix *A; SuperMatrix *A;
NRformat_loc *Astore; NRformat_loc *Astore;
#if defined(SLUD_VERSION_6)
zScalePermstruct_t *ScalePermstruct;
zLUstruct_t *LUstruct;
zSOLVEstruct_t SOLVEstruct;
#else
ScalePermstruct_t *ScalePermstruct; ScalePermstruct_t *ScalePermstruct;
LUstruct_t *LUstruct; LUstruct_t *LUstruct;
SOLVEstruct_t SOLVEstruct; SOLVEstruct_t SOLVEstruct;
#endif
gridinfo_t *grid; gridinfo_t *grid;
int i, panel_size, permc_spec, relax, info; int i, panel_size, permc_spec, relax, info;
trans_t trans; trans_t trans;
double drop_tol = 0.0,berr[1]; double drop_tol = 0.0,berr[1];
#if defined(SLUD_VERSION_5) #if defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
superlu_dist_options_t options; superlu_dist_options_t options;
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) #elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
superlu_options_t options; superlu_options_t options;
@ -165,10 +179,18 @@ int mld_zsludist_fact(int n, int nl, int nnzl, int ffstr,
SLU_NR_loc, SLU_Z, SLU_GE); SLU_NR_loc, SLU_Z, SLU_GE);
/* Initialize ScalePermstruct and LUstruct. */ /* Initialize ScalePermstruct and LUstruct. */
#if defined(SLUD_VERSION_6)
ScalePermstruct = (zScalePermstruct_t *) SUPERLU_MALLOC(sizeof(zScalePermstruct_t));
LUstruct = (zLUstruct_t *) SUPERLU_MALLOC(sizeof(zLUstruct_t));
zScalePermstructInit(n,n, ScalePermstruct);
#else
ScalePermstruct = (ScalePermstruct_t *) SUPERLU_MALLOC(sizeof(ScalePermstruct_t)); ScalePermstruct = (ScalePermstruct_t *) SUPERLU_MALLOC(sizeof(ScalePermstruct_t));
LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t)); LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t));
ScalePermstructInit(n,n, ScalePermstruct); ScalePermstructInit(n,n, ScalePermstruct);
#if defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5) #endif
#if defined(SLUD_VERSION_6)
zLUstructInit(n, LUstruct);
#elif defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5)
LUstructInit(n, LUstruct); LUstructInit(n, LUstruct);
#elif defined(SLUD_VERSION_3) #elif defined(SLUD_VERSION_3)
LUstructInit(n,n, LUstruct); LUstructInit(n,n, LUstruct);
@ -233,15 +255,21 @@ int mld_zsludist_solve(int itrans, int n, int nrhs,
*/ */
#ifdef Have_SLUDist_ #ifdef Have_SLUDist_
SuperMatrix *A; SuperMatrix *A;
#if defined(SLUD_VERSION_6)
zScalePermstruct_t *ScalePermstruct;
zLUstruct_t *LUstruct;
zSOLVEstruct_t SOLVEstruct;
#else
ScalePermstruct_t *ScalePermstruct; ScalePermstruct_t *ScalePermstruct;
LUstruct_t *LUstruct; LUstruct_t *LUstruct;
SOLVEstruct_t SOLVEstruct; SOLVEstruct_t SOLVEstruct;
#endif
gridinfo_t *grid; gridinfo_t *grid;
int i, panel_size, permc_spec, relax, info; int i, panel_size, permc_spec, relax, info;
trans_t trans; trans_t trans;
double drop_tol = 0.0; double drop_tol = 0.0;
double *berr; double *berr;
#if defined(SLUD_VERSION_5) #if defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
superlu_dist_options_t options; superlu_dist_options_t options;
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) #elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
superlu_options_t options; superlu_options_t options;
@ -313,15 +341,21 @@ int mld_zsludist_free(void *f_factors)
*/ */
#ifdef Have_SLUDist_ #ifdef Have_SLUDist_
SuperMatrix *A; SuperMatrix *A;
#if defined(SLUD_VERSION_6)
zScalePermstruct_t *ScalePermstruct;
zLUstruct_t *LUstruct;
zSOLVEstruct_t SOLVEstruct;
#else
ScalePermstruct_t *ScalePermstruct; ScalePermstruct_t *ScalePermstruct;
LUstruct_t *LUstruct; LUstruct_t *LUstruct;
SOLVEstruct_t SOLVEstruct; SOLVEstruct_t SOLVEstruct;
#endif
gridinfo_t *grid; gridinfo_t *grid;
int i, panel_size, permc_spec, relax; int i, panel_size, permc_spec, relax;
trans_t trans; trans_t trans;
double drop_tol = 0.0; double drop_tol = 0.0;
double *berr; double *berr;
#if defined(SLUD_VERSION_5) #if defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
superlu_dist_options_t options; superlu_dist_options_t options;
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) #elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
superlu_options_t options; superlu_options_t options;
@ -344,8 +378,13 @@ int mld_zsludist_free(void *f_factors)
// we either have a leak or a segfault here. // we either have a leak or a segfault here.
// To be investigated further. // To be investigated further.
//Destroy_CompRowLoc_Matrix_dist(A); //Destroy_CompRowLoc_Matrix_dist(A);
#if defined(SLUD_VERSION_6)
zScalePermstructFree(ScalePermstruct);
zLUstructFree(LUstruct);
#else
ScalePermstructFree(ScalePermstruct); ScalePermstructFree(ScalePermstruct);
LUstructFree(LUstruct); LUstructFree(LUstruct);
#endif
superlu_gridexit(grid); superlu_gridexit(grid);
free(grid); free(grid);

Loading…
Cancel
Save