Commit 359312ab authored by Igor Konshin's avatar Igor Konshin
Browse files

Small changes to avoid warnings for MS and Intel compilers

parent 5156345a
...@@ -557,9 +557,9 @@ namespace INMOST ...@@ -557,9 +557,9 @@ namespace INMOST
/// Copy part of the associated array or data to the destination memory. /// Copy part of the associated array or data to the destination memory.
/// @param tag Identifying Tag. /// @param tag Identifying Tag.
/// @param shift Starting position of the copied data. /// @param shift Starting position of the copied data.
/// For abstact data number of bytes to skip, otherwise number of values to skip. /// For abstact data - number of bytes to skip, otherwise number of values to skip.
/// @param size Number of elements to copy. /// @param size Number of elements to copy.
/// For abstact data number of bytes to copy, otherwise number of values to copy. /// For abstact data - number of bytes to copy, otherwise number of values to copy.
/// @param data Destination position to copy data to. /// @param data Destination position to copy data to.
/// @see Storage::SetData /// @see Storage::SetData
__INLINE void GetData (const Tag & tag, __INLINE void GetData (const Tag & tag,
...@@ -741,4 +741,4 @@ namespace INMOST ...@@ -741,4 +741,4 @@ namespace INMOST
#endif //INMOST_DATA_H_INCLUDED #endif //INMOST_DATA_H_INCLUDED
\ No newline at end of file
...@@ -34,7 +34,7 @@ namespace INMOST ...@@ -34,7 +34,7 @@ namespace INMOST
{ {
public: public:
basic_expression() {}//if( GetAutodiffPrint() ) std::cout << this << " Created" << std::endl;} basic_expression() {}//if( GetAutodiffPrint() ) std::cout << this << " Created" << std::endl;}
basic_expression(const basic_expression & other) {};//std::cout << this << " Created from " << &other << std::endl;} basic_expression(const basic_expression & other) {(void)other;};//std::cout << this << " Created from " << &other << std::endl;}
virtual INMOST_DATA_REAL_TYPE GetValue() const = 0; virtual INMOST_DATA_REAL_TYPE GetValue() const = 0;
virtual void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::RowMerger & r) const = 0; virtual void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::RowMerger & r) const = 0;
virtual void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::Row & r) const = 0; virtual void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::Row & r) const = 0;
...@@ -74,9 +74,9 @@ namespace INMOST ...@@ -74,9 +74,9 @@ namespace INMOST
const_expression(const const_expression & other) :value(other.value) {} const_expression(const const_expression & other) :value(other.value) {}
const_expression(INMOST_DATA_REAL_TYPE pvalue) : value(pvalue) {} const_expression(INMOST_DATA_REAL_TYPE pvalue) : value(pvalue) {}
__INLINE INMOST_DATA_REAL_TYPE GetValue() const { return value; } __INLINE INMOST_DATA_REAL_TYPE GetValue() const { return value; }
__INLINE void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::RowMerger & r) const {} __INLINE void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::RowMerger & r) const {(void)mult; (void)r;}
__INLINE void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::Row & r) const {} __INLINE void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::Row & r) const {(void)mult; (void)r;}
__INLINE void GetHessian(INMOST_DATA_REAL_TYPE multJ, Sparse::Row & J, INMOST_DATA_REAL_TYPE multH, Sparse::HessianRow & H) const {} __INLINE void GetHessian(INMOST_DATA_REAL_TYPE multJ, Sparse::Row & J, INMOST_DATA_REAL_TYPE multH, Sparse::HessianRow & H) const {(void)multJ; (void)J; (void)multH; (void)H;}
__INLINE const_expression & operator =(const_expression const & other) __INLINE const_expression & operator =(const_expression const & other)
{ {
value = other.value; value = other.value;
...@@ -97,7 +97,7 @@ namespace INMOST ...@@ -97,7 +97,7 @@ namespace INMOST
__INLINE INMOST_DATA_REAL_TYPE GetValue() const { return value; } __INLINE INMOST_DATA_REAL_TYPE GetValue() const { return value; }
__INLINE void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::RowMerger & r) const {if( index != ENUMUNDEF ) r[index] += mult;} __INLINE void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::RowMerger & r) const {if( index != ENUMUNDEF ) r[index] += mult;}
__INLINE void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::Row & r) const {if( index != ENUMUNDEF ) r[index] += mult;} __INLINE void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::Row & r) const {if( index != ENUMUNDEF ) r[index] += mult;}
__INLINE void GetHessian(INMOST_DATA_REAL_TYPE multJ, Sparse::Row & J, INMOST_DATA_REAL_TYPE multH, Sparse::HessianRow & H) const {if( index != ENUMUNDEF ) J.Push(index,multJ);} __INLINE void GetHessian(INMOST_DATA_REAL_TYPE multJ, Sparse::Row & J, INMOST_DATA_REAL_TYPE multH, Sparse::HessianRow & H) const {if( index != ENUMUNDEF ) J.Push(index,multJ); (void)multH; (void)H;}
__INLINE var_expression & operator =(var_expression const & other) __INLINE var_expression & operator =(var_expression const & other)
{ {
value = other.value; value = other.value;
......
...@@ -341,7 +341,7 @@ namespace INMOST ...@@ -341,7 +341,7 @@ namespace INMOST
Tag ValueTag() {return value_tag;} Tag ValueTag() {return value_tag;}
void GetVariation(const Storage & e, Sparse::Row & r) const { (*this)[e].GetJacobian(1.0,r); } void GetVariation(const Storage & e, Sparse::Row & r) const { (*this)[e].GetJacobian(1.0,r); }
void GetVariation(const Storage & e, Sparse::RowMerger & r) const { (*this)[e].GetJacobian(1.0,r); } void GetVariation(const Storage & e, Sparse::RowMerger & r) const { (*this)[e].GetJacobian(1.0,r); }
bool isUnknown(const Storage & e) const {return false;} bool isUnknown(const Storage & e) const {(void)e; return false;}
abstract_dynamic_variable * Copy() const {return static_cast<abstract_dynamic_variable *>(new static_variable(*this));} abstract_dynamic_variable * Copy() const {return static_cast<abstract_dynamic_variable *>(new static_variable(*this));}
}; };
...@@ -389,7 +389,7 @@ namespace INMOST ...@@ -389,7 +389,7 @@ namespace INMOST
Tag VariableTag() {return variable_tag;} Tag VariableTag() {return variable_tag;}
void GetVariation(const Storage & e, Sparse::Row & r) const { (*this)[e].GetJacobian(1.0,r); } void GetVariation(const Storage & e, Sparse::Row & r) const { (*this)[e].GetJacobian(1.0,r); }
void GetVariation(const Storage & e, Sparse::RowMerger & r) const { (*this)[e].GetJacobian(1.0,r); } void GetVariation(const Storage & e, Sparse::RowMerger & r) const { (*this)[e].GetJacobian(1.0,r); }
bool isUnknown(const Storage & e) const {return false;} bool isUnknown(const Storage & e) const {(void)e; return false;}
abstract_dynamic_variable * Copy() const {return static_cast<abstract_dynamic_variable *>(new stored_variable(*this));} abstract_dynamic_variable * Copy() const {return static_cast<abstract_dynamic_variable *>(new stored_variable(*this));}
}; };
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
#define R_QUIT 100 #define R_QUIT 100
int isnan(double x) { return x != x; } static int isnan(double x) { return x != x; }
//int isinf(double x) { return !isnan(x) && isnan(x - x); } //static int isinf(double x) { return !isnan(x) && isnan(x - x); }
int isinf(double x) { return fabs(x) > DBL_MAX; } static int isinf(double x) { return fabs(x) > DBL_MAX; }
int isbad(double x) { return isnan(x) || isinf(x); } static int isbad(double x) { return isnan(x) || isinf(x); }
template<typename T> template<typename T>
void ReadCoords(FILE * f,INMOST_DATA_REAL_TYPE c[3]) void ReadCoords(FILE * f,INMOST_DATA_REAL_TYPE c[3])
......
...@@ -1165,7 +1165,7 @@ namespace INMOST ...@@ -1165,7 +1165,7 @@ namespace INMOST
bool Face::CheckNormalOrientation() const bool Face::CheckNormalOrientation() const
{ {
Mesh * mesh = GetMeshLink(); Mesh * mesh = GetMeshLink();
integer dim = mesh->GetDimensions(); //integer dim = mesh->GetDimensions();
Cell c1 = BackCell(); Cell c1 = BackCell();
if( c1.isValid() ) if( c1.isValid() )
{ {
...@@ -1270,7 +1270,7 @@ namespace INMOST ...@@ -1270,7 +1270,7 @@ namespace INMOST
cnt[r] = cnt[r]-ccnt[r]; cnt[r] = cnt[r]-ccnt[r];
measure += (data[j]->GetPrivateMarker(rev) ? -1.0 : 1.0)*vec_dot_product(cnt,nrm,3); measure += (data[j]->GetPrivateMarker(rev) ? -1.0 : 1.0)*vec_dot_product(cnt,nrm,3);
} }
bool have_rev = cur->GetPrivateMarker(rev); //bool have_rev = cur->GetPrivateMarker(rev);
data.RemPrivateMarker(rev); data.RemPrivateMarker(rev);
mesh->ReleasePrivateMarker(rev); mesh->ReleasePrivateMarker(rev);
if( (measure < 0 ))// && !have_rev) || (measure > 0 && have_rev)) if( (measure < 0 ))// && !have_rev) || (measure > 0 && have_rev))
......
...@@ -2029,7 +2029,7 @@ namespace INMOST ...@@ -2029,7 +2029,7 @@ namespace INMOST
else else
return reference_array(this,static_cast<reference *>(p),tag.GetSize()); return reference_array(this,static_cast<reference *>(p),tag.GetSize());
} }
Storage::remote_reference_array Mesh::RemoteReferenceArray(HandleType h, const Tag & tag) Storage::remote_reference_array Mesh::RemoteReferenceArray(HandleType h, const Tag & tag)
{ {
Asserts(h,tag,DATA_REMOTE_REFERENCE); Asserts(h,tag,DATA_REMOTE_REFERENCE);
void * p = MGetLink(h,tag); void * p = MGetLink(h,tag);
...@@ -2061,6 +2061,7 @@ namespace INMOST ...@@ -2061,6 +2061,7 @@ namespace INMOST
assert(this == tag.GetMeshLink()); //tag is not mine assert(this == tag.GetMeshLink()); //tag is not mine
assert(tag.GetDataType() == expected); //tag data type coinside with expected data type assert(tag.GetDataType() == expected); //tag data type coinside with expected data type
assert(tag.isDefinedByDim(GetHandleElementNum(h))); //tag data type coinside with expected data type assert(tag.isDefinedByDim(GetHandleElementNum(h))); //tag data type coinside with expected data type
(void)h; (void)tag; (void)expected; //due to __INLINE these variables considered by compilers as unreferenced
} }
void Mesh::ClearMarkerSpace(HandleType h) void Mesh::ClearMarkerSpace(HandleType h)
......
...@@ -379,7 +379,8 @@ namespace INMOST ...@@ -379,7 +379,8 @@ namespace INMOST
memcpy(temp.data(),input,sizeof(Storage::real)*size); memcpy(temp.data(),input,sizeof(Storage::real)*size);
MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_REAL_TYPE,MPI_SUM,comm); MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_REAL_TYPE,MPI_SUM,comm);
#else//USE_MPI #else//USE_MPI
(void) input; (void) input;
(void) size;
#endif//USE_MPI #endif//USE_MPI
} }
...@@ -392,6 +393,7 @@ namespace INMOST ...@@ -392,6 +393,7 @@ namespace INMOST
MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_INTEGER_TYPE,MPI_SUM,comm); MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_INTEGER_TYPE,MPI_SUM,comm);
#else//USE_MPI #else//USE_MPI
(void) input; (void) input;
(void) size;
#endif//USE_MPI #endif//USE_MPI
} }
...@@ -454,6 +456,7 @@ namespace INMOST ...@@ -454,6 +456,7 @@ namespace INMOST
MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_REAL_TYPE,MPI_MAX,comm); MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_REAL_TYPE,MPI_MAX,comm);
#else//USE_MPI #else//USE_MPI
(void) input; (void) input;
(void) size;
#endif//USE_MPI #endif//USE_MPI
} }
...@@ -466,6 +469,7 @@ namespace INMOST ...@@ -466,6 +469,7 @@ namespace INMOST
MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_INTEGER_TYPE,MPI_MAX,comm); MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_INTEGER_TYPE,MPI_MAX,comm);
#else//USE_MPI #else//USE_MPI
(void) input; (void) input;
(void) size;
#endif//USE_MPI #endif//USE_MPI
} }
...@@ -500,6 +504,7 @@ namespace INMOST ...@@ -500,6 +504,7 @@ namespace INMOST
MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_REAL_TYPE,MPI_MIN,comm); MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_REAL_TYPE,MPI_MIN,comm);
#else//USE_MPI #else//USE_MPI
(void) input; (void) input;
(void) size;
#endif//USE_MPI #endif//USE_MPI
} }
...@@ -512,6 +517,7 @@ namespace INMOST ...@@ -512,6 +517,7 @@ namespace INMOST
MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_INTEGER_TYPE,MPI_MIN,comm); MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_INTEGER_TYPE,MPI_MIN,comm);
#else//USE_MPI #else//USE_MPI
(void) input; (void) input;
(void) size;
#endif//USE_MPI #endif//USE_MPI
} }
......
...@@ -302,8 +302,8 @@ namespace INMOST ...@@ -302,8 +302,8 @@ namespace INMOST
std::istream & XMLReader::get_iStream() {return *inp.back().s;} std::istream & XMLReader::get_iStream() {return *inp.back().s;}
const std::istream & XMLReader::get_iStream() const {return *inp.back().s;} const std::istream & XMLReader::get_iStream() const {return *inp.back().s;}
XMLReader::XMLReader(const XMLReader & other) {} XMLReader::XMLReader(const XMLReader & other) {(void)other;}
XMLReader & XMLReader::operator =(XMLReader & other) {return *this;} XMLReader & XMLReader::operator =(XMLReader & other) {(void)other; return *this;}
char XMLReader::GetChar() char XMLReader::GetChar()
{ {
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <math.h> #include <math.h>
#include <string> #include <string>
#define T(x) // x // Trace of function calls. Use: "T(x) x" for trace and "T(x)" for silence
static int set_kovl = 0; // number of overlap layers: kovl=0,1,2,... static int set_kovl = 0; // number of overlap layers: kovl=0,1,2,...
static double set_tau = 3e-3; // the ILU2 precision (for the submatrix factorization); tau=3e-3 static double set_tau = 3e-3; // the ILU2 precision (for the submatrix factorization); tau=3e-3
...@@ -121,7 +122,7 @@ static int newmatrixbcg(bcg *s, matrix *A, bool same_precond) ...@@ -121,7 +122,7 @@ static int newmatrixbcg(bcg *s, matrix *A, bool same_precond)
if( !same_precond ) if( !same_precond )
{ {
//do nothing... //do nothing...
//std::cout<<"##### inside newmatrixbcg bef. renewbcg \n";//db! T(std::cout<<"##### inside newmatrixbcg bef. renewbcg \n";)//db!
return renewbcg(s, A->A); return renewbcg(s, A->A);
} }
else return 0; else return 0;
...@@ -132,7 +133,7 @@ static int newmatrixbcg(bcg *s, matrix *A, bool same_precond) ...@@ -132,7 +133,7 @@ static int newmatrixbcg(bcg *s, matrix *A, bool same_precond)
int initbcg(bcg *s, matrix *A, double eps) int initbcg(bcg *s, matrix *A, double eps)
{ {
s->eps = eps; s->eps = eps;
//std::cout<<"##### inside initbcg bef. newmatrixbcg eps="<<eps<<" \n";//db! T(std::cout<<"##### inside initbcg bef. newmatrixbcg eps="<<eps<<" \n";)//db!
return newmatrixbcg(s, A, false); return newmatrixbcg(s, A, false);
} }
...@@ -152,17 +153,17 @@ int renewbcg(bcg *s, double *A) ...@@ -152,17 +153,17 @@ int renewbcg(bcg *s, double *A)
if(s->W) free(s->W); s->W=NULL; if(s->W) free(s->W); s->W=NULL;
int ierr = 0; int ierr = 0;
//std::cout<<"##### inside renewbcg bef. biilu2_bcg\n";//db! T(std::cout<<"##### inside renewbcg bef. biilu2_bcg\n";)//db!
double *B = (double*) malloc(sizeof(double)*s->n); //db!!!!!!!!!!!!!! double *B = (double*) malloc(sizeof(double)*s->n); //db!!!!!!!!!!!!!!
//double *X = (double*) malloc(sizeof(double)*s->n); //db!!!!!!!!!!!!!! //double *X = (double*) malloc(sizeof(double)*s->n); //db!!!!!!!!!!!!!!
biilu2_bcg (s->ibl, s->ia, s->ja, s->a, biilu2_bcg (s->ibl, s->ia, s->ja, s->a,
//B, X, //!!!!!KAPORIN!!!!!!!!!!!!! //B, X, //!!!!!KAPORIN!!!!!!!!!!!!!
B, NULL, //!!!!!KAPORIN!!!!!!!!!!!! B, NULL, //!!!!!KAPORIN!!!!!!!!!!!!
//NULL, NULL, //!!!!!INK!!!!!!!!!!! //NULL, NULL, //!!!!!INK!!!!!!!!!!!
job, &s->len_r8, &s->W, job, &s->len_r8, &s->W,
s->kovl, s->tau, s->eps, maxit, s->msglev, s->kovl, s->tau, s->eps, maxit, s->msglev,
&ierr, s->istat, s->dstat); &ierr, s->istat, s->dstat);
//std::cout<<"##### inside renewbcg aft. biilu2_bcg\n";//db! T(std::cout<<"##### inside renewbcg aft. biilu2_bcg\n";)//db!
free(B); //free(X);//db!!!!!!!!!!!!!!! free(B); //free(X);//db!!!!!!!!!!!!!!!
if (ierr) printf("initialization of biilu2 failed, ierr=%d\n", ierr); if (ierr) printf("initialization of biilu2 failed, ierr=%d\n", ierr);
...@@ -182,12 +183,12 @@ int solvebcg(bcg *s, vector *b, vector *x) ...@@ -182,12 +183,12 @@ int solvebcg(bcg *s, vector *b, vector *x)
int maxit = s->nit; int maxit = s->nit;
int ierr = 0; int ierr = 0;
//std::cout<<"##### inside solvebcg bef. biilu2_bcg\n";//db! T(std::cout<<"##### inside solvebcg bef. biilu2_bcg\n";)//db!
biilu2_bcg (s->ibl, s->ia, s->ja, s->a, b->v, x->v, biilu2_bcg (s->ibl, s->ia, s->ja, s->a, b->v, x->v,
job, &s->len_r8, &s->W, job, &s->len_r8, &s->W,
s->kovl, s->tau, s->eps, maxit, s->msglev, s->kovl, s->tau, s->eps, maxit, s->msglev,
&ierr, s->istat, s->dstat); &ierr, s->istat, s->dstat);
//std::cout<<"##### inside solvebcg aft. biilu2_bcg\n";//db! T(std::cout<<"##### inside solvebcg aft. biilu2_bcg\n";)//db!
s->ITER = s->istat[2]; s->ITER = s->istat[2];
s->RESID = s->dstat[2]; s->RESID = s->dstat[2];
...@@ -258,7 +259,7 @@ void MatrixAssignDataFcbiilu2(void * pA, void * pB) ...@@ -258,7 +259,7 @@ void MatrixAssignDataFcbiilu2(void * pA, void * pB)
void MatrixInitDataFcbiilu2(void ** ppA, INMOST_MPI_Comm comm, const char * name) void MatrixInitDataFcbiilu2(void ** ppA, INMOST_MPI_Comm comm, const char * name)
{ {
//std::cout<<"##### ins. MatrixInitDataFcbiilu2 \n";//db! T(std::cout<<"##### ins. MatrixInitDataFcbiilu2 \n";)//db!
if( ppA == NULL ) throw INMOST::DataCorruptedInSolver; if( ppA == NULL ) throw INMOST::DataCorruptedInSolver;
if( *ppA == NULL ) if( *ppA == NULL )
{ {
...@@ -266,7 +267,7 @@ void MatrixInitDataFcbiilu2(void ** ppA, INMOST_MPI_Comm comm, const char * name ...@@ -266,7 +267,7 @@ void MatrixInitDataFcbiilu2(void ** ppA, INMOST_MPI_Comm comm, const char * name
matrix * A = (matrix *)*ppA; matrix * A = (matrix *)*ppA;
A->n = 0; A->n = 0;
A->nproc = 0; A->nproc = 0;
//std::cout<<"##### ins. MatrixInitDataFcbiilu2 n=nproc=0 \n";//db! T(std::cout<<"##### ins. MatrixInitDataFcbiilu2 n=nproc=0 \n";)//db!
} }
(void) comm; (void) comm;
(void) name; (void) name;
...@@ -283,7 +284,7 @@ void MatrixDestroyDataFcbiilu2(void ** pA) ...@@ -283,7 +284,7 @@ void MatrixDestroyDataFcbiilu2(void ** pA)
free(A->ia); free(A->ia);
free(A->ja); free(A->ja);
free(A->A); free(A->A);
//std::cout<<"##### ins. MatrixDestroyDataFcbiilu2 ...free \n";//db! T(std::cout<<"##### ins. MatrixDestroyDataFcbiilu2 ...free \n";)//db!
} }
free(*pA); free(*pA);
*pA = NULL; *pA = NULL;
...@@ -294,7 +295,7 @@ void MatrixDestroyDataFcbiilu2(void ** pA) ...@@ -294,7 +295,7 @@ void MatrixDestroyDataFcbiilu2(void ** pA)
void MatrixFillFcbiilu2(void * pA, int size, int nproc, int * ibl, int * ia, int * ja, double * values) void MatrixFillFcbiilu2(void * pA, int size, int nproc, int * ibl, int * ia, int * ja, double * values)
{ {
//std::cout<<"##### ins. MatrixFillFcbiilu2 n="<<size<<" nproc="<<nproc<<" \n";//db! T(std::cout<<"##### ins. MatrixFillFcbiilu2 n="<<size<<" nproc="<<nproc<<" \n";)//db!
if( pA == NULL ) throw INMOST::DataCorruptedInSolver; if( pA == NULL ) throw INMOST::DataCorruptedInSolver;
matrix * A = (matrix *) pA; matrix * A = (matrix *) pA;
A->n = size; A->n = size;
...@@ -307,7 +308,7 @@ void MatrixFillFcbiilu2(void * pA, int size, int nproc, int * ibl, int * ia, int ...@@ -307,7 +308,7 @@ void MatrixFillFcbiilu2(void * pA, int size, int nproc, int * ibl, int * ia, int
void MatrixFillValuesFcbiilu2(void * pA, double * values) void MatrixFillValuesFcbiilu2(void * pA, double * values)
{ {
//std::cout<<"##### ins. MatrixFillValuesFcbiilu2 \n";//db! T(std::cout<<"##### ins. MatrixFillValuesFcbiilu2 \n";)//db!
if( pA == NULL ) throw INMOST::DataCorruptedInSolver; if( pA == NULL ) throw INMOST::DataCorruptedInSolver;
matrix * A = (matrix *) pA; matrix * A = (matrix *) pA;
free(A->A); free(A->A);
...@@ -332,7 +333,7 @@ void VectorInitDataFcbiilu2(void ** ppA, INMOST_MPI_Comm comm, const char * name ...@@ -332,7 +333,7 @@ void VectorInitDataFcbiilu2(void ** ppA, INMOST_MPI_Comm comm, const char * name
void VectorCopyDataFcbiilu2(void ** ppA, void * pB) void VectorCopyDataFcbiilu2(void ** ppA, void * pB)
{ {
//std::cout<<"##### ins. VectorCopyDataFcbiilu2 \n";//db! T(std::cout<<"##### ins. VectorCopyDataFcbiilu2 \n";)//db!
if( ppA == NULL || pB == NULL ) throw INMOST::DataCorruptedInSolver; if( ppA == NULL || pB == NULL ) throw INMOST::DataCorruptedInSolver;
*ppA = malloc(sizeof(vector)); *ppA = malloc(sizeof(vector));
vector * A = (vector *)*ppA; vector * A = (vector *)*ppA;
...@@ -347,7 +348,7 @@ void VectorCopyDataFcbiilu2(void ** ppA, void * pB) ...@@ -347,7 +348,7 @@ void VectorCopyDataFcbiilu2(void ** ppA, void * pB)
void VectorAssignDataFcbiilu2(void * pA, void * pB) void VectorAssignDataFcbiilu2(void * pA, void * pB)
{ {
//std::cout<<"##### ins. VectorAssignDataFcbiilu2 \n";//db! T(std::cout<<"##### ins. VectorAssignDataFcbiilu2 \n";)//db!
vector * A = (vector *)pA; vector * A = (vector *)pA;
vector * B = (vector *)pB; vector * B = (vector *)pB;
if( A == NULL || B == NULL ) throw INMOST::DataCorruptedInSolver; if( A == NULL || B == NULL ) throw INMOST::DataCorruptedInSolver;
...@@ -403,12 +404,12 @@ void VectorDestroyDataFcbiilu2(void ** ppA) ...@@ -403,12 +404,12 @@ void VectorDestroyDataFcbiilu2(void ** ppA)
void SolverInitializeFcbiilu2(int * argc, char *** argv, const char * file_options) void SolverInitializeFcbiilu2(int * argc, char *** argv, const char * file_options)
{ {
//std::cout<<"##### ins. SolverInitializeFcbiilu2 ("<<file_options<<") \n";//db! T(std::cout<<"##### ins. SolverInitializeFcbiilu2 ("<<file_options<<") \n";)//db!
if (file_options == NULL) return; if (file_options == NULL) return;
std::string s = file_options; std::string s = file_options;
if (s == "" || s == " ") return; if (s == "" || s == " ") return;
std::ifstream is; std::ifstream is;
//std::cout<<"##### ins. SolverInitializeFcbiilu2: bef. open("<<file_options<<") \n";//db! T(std::cout<<"##### ins. SolverInitializeFcbiilu2: bef. open("<<file_options<<") \n";)//db!
is.open(file_options, std::ifstream::in); is.open(file_options, std::ifstream::in);
if (s == "ctrl_dat") { if (s == "ctrl_dat") {
getline(is, s); //1 skip ipart getline(is, s); //1 skip ipart
...@@ -428,7 +429,7 @@ void SolverInitializeFcbiilu2(int * argc, char *** argv, const char * file_optio ...@@ -428,7 +429,7 @@ void SolverInitializeFcbiilu2(int * argc, char *** argv, const char * file_optio
getline(is, s); sscanf(s.c_str(), "%d", &set_nit); //4 nit getline(is, s); sscanf(s.c_str(), "%d", &set_nit); //4 nit
getline(is, s); sscanf(s.c_str(), "%d", &set_msglev); //5 msglev getline(is, s); sscanf(s.c_str(), "%d", &set_msglev); //5 msglev
} }
//std::cout<<"##### ins. SolverInitializeFcbiilu2: kovl="<<set_kovl<<" tau="<<set_tau<<" eps="<<set_eps<<" nit="<<set_nit<<" msglev="<<set_msglev<<" from: "<<file_options<<" \n";//db! T(std::cout<<"##### ins. SolverInitializeFcbiilu2: kovl="<<set_kovl<<" tau="<<set_tau<<" eps="<<set_eps<<" nit="<<set_nit<<" msglev="<<set_msglev<<" from: "<<file_options<<" \n";)//db!
(void) argc; (void) argc;
(void) argv; (void) argv;
} }
...@@ -458,7 +459,7 @@ void SolverDestroyDataFcbiilu2(void ** data) ...@@ -458,7 +459,7 @@ void SolverDestroyDataFcbiilu2(void ** data)
void SolverInitDataFcbiilu2(void ** data, INMOST_MPI_Comm comm, const char * name) void SolverInitDataFcbiilu2(void ** data, INMOST_MPI_Comm comm, const char * name)
{ {
//std::cout<<"##### ins. SolverInitDataFcbiilu2 \n";//db! T(std::cout<<"##### ins. SolverInitDataFcbiilu2 \n";)//db!
*data = malloc(sizeof(bcg)); *data = malloc(sizeof(bcg));
((bcg *)*data)->n = 0; ((bcg *)*data)->n = 0;
((bcg *)*data)->nproc = 0; ((bcg *)*data)->nproc = 0;
...@@ -485,24 +486,24 @@ void SolverAssignDataFcbiilu2(void * data, void * other_data) ...@@ -485,24 +486,24 @@ void SolverAssignDataFcbiilu2(void * data, void * other_data)
void SolverSetMatrixFcbiilu2(void * data, void * matrix_data, bool same_pattern, bool reuse_preconditioner) void SolverSetMatrixFcbiilu2(void * data, void * matrix_data, bool same_pattern, bool reuse_preconditioner)
{ {
//std::cout<<"##### ins. SolverSetMatrixFcbiilu2 \n";//db! T(std::cout<<"##### ins. SolverSetMatrixFcbiilu2 \n";)//db!
bcg * m = (bcg *)data; bcg * m = (bcg *)data;
matrix * A = (matrix *)matrix_data; matrix * A = (matrix *)matrix_data;
//if( A == NULL) std::cout<<"##### A == NULL ... \n";//db! T(if( A == NULL) std::cout<<"##### A == NULL ... \n";)//db!
//if( m == NULL) std::cout<<"##### m == NULL ... \n";//db! T(if( m == NULL) std::cout<<"##### m == NULL ... \n";)//db!
if( A == NULL || m == NULL ) throw INMOST::DataCorruptedInSolver; if( A == NULL || m == NULL ) throw INMOST::DataCorruptedInSolver;
//std::cout<<"##### ins. SolverSetMatrixFcbiilu2 bef. initbcg or newmatrixbcg \n";//db! T(std::cout<<"##### ins. SolverSetMatrixFcbiilu2 bef. initbcg or newmatrixbcg \n";)//db!
if( m->n == 0 ) if( m->n == 0 )
initbcg(m,A,set_eps); initbcg(m,A,set_eps);
else else
newmatrixbcg(m,A,reuse_preconditioner); newmatrixbcg(m,A,reuse_preconditioner);
(void) same_pattern; (void) same_pattern;
//std::cout<<"##### ins. SolverSetMatrixFcbiilu2 bef. return \n";//db! T(std::cout<<"##### ins. SolverSetMatrixFcbiilu2 bef. return \n";)//db!
} }
bool SolverSolveFcbiilu2(void * data, void * rhs_data, void * sol_data) bool SolverSolveFcbiilu2(void * data, void * rhs_data, void * sol_data)
{ {
//std::cout<<"##### ins. SolverSolveFcbiilu2 \n";//db! T(std::cout<<"##### ins. SolverSolveFcbiilu2 \n";)//db!
bcg * m = (bcg *)data; bcg * m = (bcg *)data;
vector * rhs = (vector*)rhs_data, * sol = (vector *)sol_data; vector * rhs = (vector*)rhs_data, * sol = (vector *)sol_data;
return solvebcg(m,rhs,sol) == 0; return solvebcg(m,rhs,sol) == 0;
......
...@@ -34,7 +34,7 @@ bool SolverSolveFcbiilu2(void * data, void * rhs_data, void * sol_data); ...@@ -34,7 +34,7 @@ bool SolverSolveFcbiilu2(void * data, void * rhs_data, void * sol_data);
int SolverIterationNumberFcbiilu2(void * data); int SolverIterationNumberFcbiilu2(void * data);
double SolverResidualNormFcbiilu2(void * data); double SolverResidualNormFcbiilu2(void * data);
void SolverAddOtherStatFcbiilu2(void * data, unsigned int * pivmod, double * prdens, double * t_prec, double * t_iter); void SolverAddOtherStatFcbiilu2(void * data, unsigned int * pivmod, double * prdens, double * t_prec, double * t_iter);
//#endif //USE_FCSOLVER_BIILU2 //#endif //USE_SOLVER_FCBIILU2
#endif //SOLVER_FCBIILU2_H_INCLUDED #endif //SOLVER_FCBIILU2_H_INCLUDED
...@@ -59,7 +59,7 @@ void MatrixInitDataPetsc(void ** data, INMOST_MPI_Comm comm, const char * name) ...@@ -59,7 +59,7 @@ void MatrixInitDataPetsc(void ** data, INMOST_MPI_Comm comm, const char * name)
MatrixDestroyDataPetsc(data); MatrixDestroyDataPetsc(data);
*data = static_cast<void *>(new Mat); *data = static_cast<void *>(new Mat);
#if !defined(USE_MPI) #if !defined(USE_MPI)
ierr = MatCreate(PETSC_COMM_WORLD,static_cast<Mat *>(*data)); ierr = MatCreate(PETSC_COMM_WORLD,static_cast<Mat *>(*data)); (void) comm;
#else #else
ierr = MatCreate(comm,static_cast<Mat *>(*data)); ierr = MatCreate(comm,static_cast<Mat *>(*data));
#endif #endif
...@@ -137,7 +137,7 @@ void VectorInitDataPetsc(void ** data, INMOST_MPI_Comm comm, const char * name) ...@@ -137,7 +137,7 @@ void VectorInitDataPetsc(void ** data, INMOST_MPI_Comm comm, const char * name)
VectorDestroyDataPetsc(data); VectorDestroyDataPetsc(data);
*data = static_cast<void *>(new Vec);