Skip to content

Commit

Permalink
enable having only MKL without LIS
Browse files Browse the repository at this point in the history
  • Loading branch information
Norihiro Watanabe committed Mar 11, 2016
1 parent 955c27f commit b0a74de
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 17 deletions.
12 changes: 6 additions & 6 deletions FEM/SparseMatrixDOK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SparseMatrixDOK::SparseMatrixDOK(size_t _nrows, size_t _ncols)
dummy_zero = 0.0;
non_zero_entry_size = 0;
is_constructed = false;
#ifdef LIS
#if defined(LIS) || defined(MKL)
ptr = NULL;
col_idx = NULL;
entry_index = NULL;
Expand All @@ -52,7 +52,7 @@ SparseMatrixDOK::SparseMatrixDOK(size_t dim) //:Matrix(0)
dummy_zero = 0.0;
non_zero_entry_size = 0;
is_constructed = false;
#ifdef LIS
#if defined(LIS) || defined(MKL)
ptr = NULL;
col_idx = NULL;
entry_index = NULL;
Expand All @@ -71,7 +71,7 @@ SparseMatrixDOK::SparseMatrixDOK() //:Matrix(0)
dummy_zero = 0.0;
non_zero_entry_size = 0;
is_constructed = false;
#ifdef LIS
#if defined(LIS) || defined(MKL)
ptr = NULL;
col_idx = NULL;
entry_index = NULL;
Expand All @@ -80,7 +80,7 @@ SparseMatrixDOK::SparseMatrixDOK() //:Matrix(0)

SparseMatrixDOK::~SparseMatrixDOK()
{
#ifdef LIS
#if defined(LIS) || defined(MKL)
if (ptr) delete [] ptr;
ptr = NULL;
if (col_idx) delete [] col_idx;
Expand All @@ -103,7 +103,7 @@ SparseMatrixDOK::SparseMatrixDOK(const SparseMatrixDOK& m)
//for(int i=0; i<size; i++) data[i] = 0.0;
dummy_zero = 0.0;
non_zero_entry_size = m.non_zero_entry_size;
#ifdef LIS
#if defined(LIS) || defined(MKL)
ptr = m.ptr;
col_idx = m.col_idx;
entry_index = m.entry_index;
Expand Down Expand Up @@ -524,7 +524,7 @@ void SparseMatrixDOK::ConstructSortedColumnID()
}
#endif

#ifdef LIS
#if defined(LIS) || defined(MKL)
void SparseMatrixDOK::ConstructCRSstructure()
{
//
Expand Down
2 changes: 1 addition & 1 deletion FEM/SparseMatrixDOK.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class SparseMatrixDOK {
void Write(std::ostream &os = std::cout, int format = 0);
bool IsSymmetry();

#ifdef LIS // These two pointers are in need for Compressed Row Storage
#if defined(LIS) || defined(MKL) // These two pointers are in need for Compressed Row Storage
int* ptr;
int* col_idx;
int* entry_index;
Expand Down
4 changes: 3 additions & 1 deletion FEM/equation_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ int Linear_EQS::Solver(double* xg, const long n)
}

#else // if defined(USE_MPI)
#ifdef LIS // PCH 02.2008
#if defined(LIS) || defined(MKL) // PCH 02.2008
//NW 01.2010 Use configuration in NUM file
int Linear_EQS::Solver(CNumerics* num)
{
Expand Down Expand Up @@ -724,6 +724,7 @@ int Linear_EQS::Solver(CNumerics* num)
}
else // LIS parallel solver
{
#ifdef LIS
std::cout <<
"------------------------------------------------------------------" <<
"\n";
Expand Down Expand Up @@ -851,6 +852,7 @@ int Linear_EQS::Solver(CNumerics* num)
std::cout <<
"------------------------------------------------------------------" <<
"\n";
#endif
}

return -1; // This right now is meaningless.
Expand Down
2 changes: 1 addition & 1 deletion FEM/equation_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Linear_EQS
int CGS(double* xg, const long n);
double GetCPUtime() const { return cpu_time; }
#else
#ifdef LIS //NW
#if defined(LIS) || defined(MKL) //NW
int Solver(CNumerics* num = NULL);
#else
int Solver();
Expand Down
6 changes: 3 additions & 3 deletions FEM/matrix_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ CSparseMatrix::CSparseMatrix(const SparseTable &sparse_table, const int dof)
entry[dof * dof * size_entry_column] = 0.;
zero_e = 0.;
//
#ifdef LIS // PCH
#if defined(LIS) || defined(MKL) // PCH
int counter, counter_ptr = 0, counter_col_idx = 0;
int i,k,ii,jj,J,K;
int row_in_sparse_table;
Expand Down Expand Up @@ -1129,7 +1129,7 @@ CSparseMatrix::~CSparseMatrix()
delete [] entry;
entry = NULL;

#ifdef LIS // PCH
#if defined(LIS) || defined(MKL) // PCH
delete [] ptr;
ptr = NULL;
delete [] col_idx;
Expand Down Expand Up @@ -1822,7 +1822,7 @@ void CSparseMatrix::DiagonalEntries(double* diag_e)
}
#endif // USE_MPI

#ifdef LIS
#if defined(LIS) || defined(MKL)
/********************************************************************
Get sparse matrix values in compressed row storage
Programm:
Expand Down
2 changes: 1 addition & 1 deletion FEM/matrix_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class CSparseMatrix
DOF = dof_n;
}
long Size() const {return rows; }
#ifdef LIS // These two pointers are in need for Compressed Row Storage
#if defined(LIS) || defined(MKL) // These two pointers are in need for Compressed Row Storage
int nnz() const // PCH
{
return DOF * DOF * size_entry_column;
Expand Down
2 changes: 1 addition & 1 deletion FEM/pcs_dm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ double CRFProcessDeformation::Execute(int loop_process_number)
//21.12.2007
dom->eqsH->Solver(eqs_new->x, global_eqs_dim);
#else
#ifdef LIS
#if defined(LIS) || defined(MKL)
eqs_new->Solver(this->m_num); //NW
#else
eqs_new->Solver(); //27.11.2007
Expand Down
4 changes: 2 additions & 2 deletions FEM/rf_pcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4792,7 +4792,7 @@ double CRFProcess::Execute()
//21.12.2007
iter_lin = dom->eqs->Solver(eqs_new->x, global_eqs_dim);
#else
#ifdef LIS
#if defined(LIS) || defined(MKL)
iter_lin = eqs_new->Solver(this->m_num); //NW
#else
iter_lin = eqs_new->Solver();
Expand Down Expand Up @@ -4897,7 +4897,7 @@ double CRFProcess::Execute()
//21.12.2007
dom->eqs->Solver(eqs_new->x, global_eqs_dim);
#else
#ifdef LIS
#if defined(LIS) || defined(MKL)
eqs_new->Solver(this->m_num); //NW
#else
eqs_new->Solver();
Expand Down
2 changes: 1 addition & 1 deletion FEM/rf_pcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class CRFProcess : public ProcessInfo
int mysize;
int myrank;
#elif defined(NEW_EQS)
#ifdef LIS
#if defined(LIS) || defined(MKL)
public:
Linear_EQS* eqs_new;
#else
Expand Down

0 comments on commit b0a74de

Please sign in to comment.