Skip to content

Commit

Permalink
Merge pull request #718 from DrTimothyAldenDavis/dev2
Browse files Browse the repository at this point in the history
SuiteSparse 7.5.0.beta5
  • Loading branch information
DrTimothyAldenDavis authored Jan 9, 2024
2 parents dda847c + be416f8 commit 92b0f51
Show file tree
Hide file tree
Showing 32 changed files with 197 additions and 365 deletions.
Binary file modified CHOLMOD/Doc/CHOLMOD_UserGuide.pdf
Binary file not shown.
81 changes: 61 additions & 20 deletions CHOLMOD/Doc/CHOLMOD_UserGuide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,16 @@ \section{Single-precision sparse matrix support}
\item {\tt SuiteSparse\_config}: a single place where all sparse matrix
packages authored or co-authored by Davis are configured.
\item {\tt METIS 5.1.0}: a graph partitioning package by George Karypis,
Univ. of Minnesota. A slightly revised copy appears in
{\tt CHOLMOD/SuiteSparse\_metis}. Not needed if {\tt -DNPARTITION} is
used. See http://www-users.cs.umn.edu/$\sim$karypis/metis.
Univ. of Minnesota. A slightly revised copy appears in {\tt
CHOLMOD/SuiteSparse\_metis}, but with a revised namespace so that no METIS
functions in CHOLMOD conflict with the unmodified METIS. SuiteSparse
cannot use any other METIS library except for {\tt
CHOLMOD/SuiteSparse\_metis}. There is no conflict with the unmodified
METIS, so it can be linked into the user's application alongside {\tt
CHOLMOD/SuiteSparse\_metis}. This folder containing the modified METIS is
not needed if {\tt -DNPARTITION} is used. See
http://www-users.cs.umn.edu/$\sim$karypis/metis for the original version of
METIS.
\end{itemize}

Three other packages are required for optimal performance:
Expand All @@ -303,7 +310,7 @@ \section{Single-precision sparse matrix support}
Not needed if {\tt -DNSUPERNODAL} is used.
See http://www.netlib.org.
\item CUDA BLAS: CHOLMOD can exploit an NVIDIA GPU by using the CUDA BLAS
for large supernodes. This feature is new to CHOLMOD v2.0.0.
for large supernodes.
\end{itemize}

You must first obtain and install LAPACK, and the BLAS.
Expand All @@ -325,7 +332,7 @@ \section{Single-precision sparse matrix support}
\item {\tt -DNPRINT}: do not print anything.
\end{itemize}

These settings are controlled in cmake by the following variables, which
These settings are controlled in cmake by the following variables, which
are all \verb'ON' by default:
\begin{itemize}
\item \verb'CHOLMOD_CHECK': if \verb'OFF': do not use the Check module.
Expand Down Expand Up @@ -2016,9 +2023,16 @@ \subsection{{\tt cholmod\_sparse\_xtype}: change sparse xtype}
%---------------------------------------

\input{_sparse_xtype.tex}
Changes the {\tt xtype} and/or \verb'dtype' of a sparse matrix, to pattern,
real, complex, or zomplex. Changing from complex or zomplex to real discards
the imaginary part.
Changes the {\tt xtype} and/or \verb'dtype' of a sparse matrix. The
\verb'xtype' can be changed to pattern, real, complex, or zomplex. The
\verb'dtype' can be changed to single or double. Changing from complex or
zomplex to real discards the imaginary part.

The name of this method derives from an earlier version of CHOLMOD where all
matrices had an implied \verb'dtype' of \verb'CHOLMOD_DOUBLE'. The method now
supports changes to the \verb'dtype'. For backward compatilibilty, the name of
this method has not changed, and the \verb'to_xdtype' parameter values of the
prior versions are upwards compatible with this version of CHOLMOD.

%-------------------------------------------------------------------------------
\newpage \section{{\tt Utility} Module: {\tt cholmod\_factor} object}
Expand Down Expand Up @@ -2168,10 +2182,11 @@ \subsection{{\tt cholmod\_change\_factor}: change factor}

Supports all xtypes, except that there is no supernodal zomplex L.

The {\tt to\_xdtype} parameter is used only when converting from symbolic to
The \verb'to_xtype' parameter is used only when converting from symbolic to
numeric or numeric to symbolic. It cannot be used to convert a numeric xtype
(real, complex, or zomplex) to a different numeric xtype. For that conversion,
use {\tt cholmod\_factor\_xtype} instead.
(real, complex, or zomplex) to a different numeric {\tt xtype}. It also cannot
change the \verb'dtype' of a factor (from double to single, for example).
For those conversions, use \verb'cholmod_factor_xtype' instead.

%---------------------------------------
\subsection{{\tt cholmod\_pack\_factor}: pack the columns of a factor}
Expand Down Expand Up @@ -2228,10 +2243,20 @@ \subsection{{\tt cholmod\_factor\_xtype}: change factor xtype}
%---------------------------------------

\input{_factor_xtype.tex}
Changes the {\tt xtype} of a factor, to pattern, real, complex, or zomplex.
Changing from complex or zomplex to real discards the imaginary part.
You cannot change a supernodal factor to the zomplex xtype.

Changes the {\tt xtype} and/or \verb'dtype' of a sparse factorization. The
\verb'xtype' can be changed to real, complex, or zomplex (not to pattern).
The \verb'dtype' can be changed to single or double. Changing from complex or
zomplex to real discards the imaginary part.
A supernodal factor cannot be changed to the zomplex \verb'xtype'.
A factor cannot be converted to an \verb'xtype' of pattern-only with this method;
use \verb'cholmod_change_factor' for that operation.

The name of this method derives from an earlier version of CHOLMOD where all
matrices had an implied \verb'dtype' of \verb'CHOLMOD_DOUBLE'. The method now
supports changes to the \verb'dtype'. For backward compatilibilty, the name of
this method has not changed, and the \verb'to_xdtype' parameter values of the
prior versions are upwards compatible with this version of CHOLMOD.

%---------------------------------------
\subsection{How many entries are in a CHOLMOD sparse Cholesky factorization?}
%---------------------------------------
Expand Down Expand Up @@ -2464,9 +2489,17 @@ \subsection{{\tt cholmod\_dense\_xtype}: change dense matrix xtype}
%---------------------------------------

\input{_dense_xtype.tex}
Changes the {\tt xtype} and/or {\tt dtype} of a dense matrix, to real, complex,
or zomplex. Changing from complex or zomplex to real discards the imaginary
part. A dense matrix cannot be converted to an xtype of pattern-only.
Changes the {\tt xtype} and/or \verb'dtype' of a dense matrix.
The \verb'xtype' can change to real, complex, or zomplex (not pattern-only).
The \verb'dtype' can change to single or double.
Changing from complex or zomplex to real discards the imaginary part.
A dense matrix cannot be converted to an \verb'xtype' of pattern-only.

The name of this method derives from an earlier version of CHOLMOD where all
matrices had an implied \verb'dtype' of \verb'CHOLMOD_DOUBLE'. The method now
supports changes to the \verb'dtype'. For backward compatilibilty, the name of
this method has not changed, and the \verb'to_xdtype' parameter values of the
prior versions are upwards compatible with this version of CHOLMOD.

%-------------------------------------------------------------------------------
\newpage \section{{\tt Utility} Module: {\tt cholmod\_triplet} object}
Expand Down Expand Up @@ -2534,9 +2567,17 @@ \subsection{{\tt cholmod\_triplet\_xtype}: change triplet xtype}
%---------------------------------------

\input{_triplet_xtype.tex}
Changes the {\tt xtype} of a dense matrix, to real, complex, or zomplex.
Changes the {\tt xtype} and/or \verb'dtype' of a triplet matrix.
The \verb'xtype' can change to pattern, real, complex, or zomplex,
and the \verb'dtype' can change to single or double.
Changing from complex or zomplex to real discards the imaginary part.

The name of this method derives from an earlier version of CHOLMOD where all
matrices had an implied \verb'dtype' of \verb'CHOLMOD_DOUBLE'. The method now
supports changes to the \verb'dtype'. For backward compatilibilty, the name of
this method has not changed, and the \verb'to_xdtype' parameter values of the
prior versions are upwards compatible with this version of CHOLMOD.

%-------------------------------------------------------------------------------
\newpage \section{{\tt Utility} Module: memory management}
%-------------------------------------------------------------------------------
Expand Down Expand Up @@ -3630,7 +3671,7 @@ \subsection{{\tt cholmod\_rowadd}: add row to factor}
matrix on input. Only real matrices are supported (double or single). The
dtypes of all matrices must match, except when \verb'L' is symbolic (with an
xtype of \verb'CHOLMOD_PATTERN'). In this case, \verb'L' is converted to the
dtype of \verb'R'. The algorithm is described in \cite{DavisHager05}.
dtype of \verb'R'. The algorithm is described in \cite{DavisHager05}.

%---------------------------------------
\subsection{{\tt cholmod\_rowadd\_solve}: add row to factor and update a
Expand Down
2 changes: 1 addition & 1 deletion SPQR/Demo/go4.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
nmat = length (f) ;

keep = ones (nmat,1) ;
kinds = UFkinds ;
kinds = sskinds ;
for k = 1:nmat
id = f (k) ;
if (~isempty (strfind (kinds {id}, 'subsequent')))
Expand Down
2 changes: 1 addition & 1 deletion SPQR/Demo/go5.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
nmat = length (f) ;

keep = ones (nmat,1) ;
kinds = UFkinds ;
kinds = sskinds ;
for k = 1:nmat
id = f (k) ;
if (~isempty (strfind (kinds {id}, 'subsequent')))
Expand Down
7 changes: 6 additions & 1 deletion SPQR/GPUQREngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ configure_file ( "Config/GPUQREngine.hpp.in"

#-------------------------------------------------------------------------------

file ( GLOB GPUQRENGINE_SOURCES "Source/*.cpp" "Source/*.cu" "Source/*/*.cpp" )
file ( GLOB GPUQRENGINE_SOURCES "Source/*.cpp"
"Source/*.cu"
"Source/BucketList/BucketList.cpp"
"Source/LLBundle/LLBundle.cpp"
"Source/Scheduler/Scheduler.cpp"
"Source/TaskDescriptor/*.cpp" )

set ( GPUQRENGINE_INCLUDES Include Include/Kernel
Include/Kernel/Apply Include/Kernel/Assemble Include/Kernel/Factorize )
Expand Down
7 changes: 3 additions & 4 deletions SPQR/GPUQREngine/Include/GPUQREngine_BucketList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define GPUQRENGINE_BUCKETLIST_HPP

#include <cstddef>
#include <new>

#include "GPUQREngine_Common.hpp"
#include "GPUQREngine_TaskDescriptor.hpp"
Expand Down Expand Up @@ -74,10 +75,6 @@ template <typename Int = int64_t> class BucketList
int VThead; // Index of the first available entry in VTlist

// Constructors
void *operator new(std::size_t, BucketList <Int>* p)
{
return p;
}
BucketList(Front <Int> *f, Int minApplyGranularity);
~BucketList();

Expand Down Expand Up @@ -190,7 +187,9 @@ template <typename Int = int64_t> class BucketList
);
};

#if ! defined (GPUQRENGINE_NO_EXTERN_BUCKETLIST)
extern template class BucketList<int32_t>;
extern template class BucketList<int64_t>;
#endif

#endif
3 changes: 1 addition & 2 deletions SPQR/GPUQREngine/Include/GPUQREngine_Front.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define GPUQRENGINE_FRONT_HPP

#include <cstddef>
#include <new>

#include "GPUQREngine_Common.hpp"
#include "GPUQREngine_SparseMeta.hpp"
Expand Down Expand Up @@ -55,8 +56,6 @@ template <typename Int = int64_t> class Front
/* Debug Fields */
bool printMe;

void* operator new(std::size_t reqMem, Front* ptr){ return ptr; }

Front(
Int fids_arg, // the front identifier
Int pids_arg, // the parent identifier
Expand Down
5 changes: 4 additions & 1 deletion SPQR/GPUQREngine/Include/GPUQREngine_LLBundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#define GPUQRENGINE_LLBUNDLE_HPP

#include <cstddef>
#include <new>

#include "GPUQREngine_Common.hpp"
#include "GPUQREngine_TaskDescriptor.hpp"
Expand Down Expand Up @@ -78,7 +79,6 @@ template <typename Int = int64_t> class LLBundle

TaskType CurrentTask;

void *operator new(std::size_t, LLBundle <Int>* p){ return p; }
//------------------------------------------------------------------------------
//
// This file contains the constructor and destructor for the LLBundle class.
Expand Down Expand Up @@ -127,6 +127,9 @@ template <typename Int = int64_t> class LLBundle
void gpuPack(TaskDescriptor *cpuTask);
};

#if ! defined (GPUQRENGINE_NO_EXTERN_LLBUNDLE)
extern template class LLBundle<int32_t>;
extern template class LLBundle<int64_t>;
#endif

#endif
5 changes: 4 additions & 1 deletion SPQR/GPUQREngine/Include/GPUQREngine_Scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define GPUQRENGINE_SCHEDULER_HPP

#include <cstddef>
#include <new>

#include "GPUQREngine_Common.hpp"
#include "GPUQREngine_FrontState.hpp"
Expand Down Expand Up @@ -99,7 +100,6 @@ class Scheduler
cudaStream_t memoryStreamD2H;

/* Scheduler.cpp */
void *operator new(std::size_t, Scheduler <Int>* p){ return p; }
Scheduler(Front <Int> *fronts, Int numFronts, size_t gpuMemorySize);
~Scheduler();

Expand Down Expand Up @@ -174,6 +174,9 @@ class Scheduler
#endif
};

#if ! defined (GPUQRENGINE_NO_EXTERN_SCHEDULER)
extern template class Scheduler<int32_t>;
extern template class Scheduler<int64_t>;
#endif

#endif
32 changes: 17 additions & 15 deletions SPQR/GPUQREngine/Source/BucketList/BucketList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
Bundles = (LLBundle <Int> *) SuiteSparse_free(Bundles); \
gpuVT = (double **) SuiteSparse_free(gpuVT); \
wsMongoVT = Workspace::destroy(wsMongoVT);

#define GPUQRENGINE_NO_EXTERN_BUCKETLIST

#include "GPUQREngine_BucketList.hpp"
template <typename Int>
BucketList<Int>::BucketList
Expand Down Expand Up @@ -103,16 +106,6 @@ BucketList<Int>::BucketList
}
}

template BucketList<int32_t>::BucketList
(
Front <int32_t> *F,
int32_t minApplyGranularity
) ;
template BucketList<int64_t>::BucketList
(
Front <int64_t> *F,
int64_t minApplyGranularity
) ;

template <typename Int>
BucketList<Int>::~BucketList()
Expand All @@ -121,9 +114,6 @@ BucketList<Int>::~BucketList()

}

template BucketList<int32_t>::~BucketList() ;
template BucketList<int64_t>::~BucketList() ;


template <typename Int>
void BucketList<Int>::Initialize()
Expand All @@ -149,5 +139,17 @@ void BucketList<Int>::Initialize()
}
}

template void BucketList<int32_t>::Initialize() ;
template void BucketList<int64_t>::Initialize() ;

// Instantiate BucketList class template with types int32_t and int64_t
// for export from library.

#include "BucketList_AdvanceBundles.cpp"
#include "BucketList_CreateBundles.cpp"
#include "BucketList_FillWorkQueue.cpp"
#include "BucketList_GrowBundles.cpp"
#include "BucketList_Manage.cpp"
#include "BucketList_PostProcessing.cpp"

template class BucketList<int32_t>;
template class BucketList<int64_t>;

Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,3 @@ void BucketList<Int>::AdvanceBundles()
}
}
}

template void BucketList<int32_t>::AdvanceBundles() ;
template void BucketList<int64_t>::AdvanceBundles() ;
31 changes: 0 additions & 31 deletions SPQR/GPUQREngine/Source/BucketList/BucketList_CreateBundles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ void BucketList<Int>::CreateBundles
}
}

template void BucketList<int32_t>::CreateBundles
(
void
) ;
template void BucketList<int64_t>::CreateBundles
(
void
) ;

// SkipBundleCreation determines whether we should skip creating a new
// bundle for the specified tile in the specified column bucket.
template <typename Int>
Expand All @@ -93,17 +84,6 @@ bool BucketList<Int>::SkipBundleCreation
return false;
}

template bool BucketList<int32_t>::SkipBundleCreation
(
int32_t tile, // The tile to consider
int32_t colBucket // The column bucket it sits in
) ;
template bool BucketList<int64_t>::SkipBundleCreation
(
int64_t tile, // The tile to consider
int64_t colBucket // The column bucket it sits in
) ;

// IsInternal determines whether a tile is completely within the bounds
// of the front because if it isn't then we will need to use the special
// edge case kernels.
Expand Down Expand Up @@ -133,14 +113,3 @@ bool BucketList<Int>::IsInternal
Int iLast = TILESIZE * (iTile+1) - 1;
return(iLast < front->fm && jLast < front->fn);
}

template bool BucketList<int32_t>::IsInternal
(
LLBundle <int32_t>& Bundle,
int jLast
) ;
template bool BucketList<int64_t>::IsInternal
(
LLBundle <int64_t>& Bundle,
int jLast
) ;
Loading

0 comments on commit 92b0f51

Please sign in to comment.