Commit b136820a authored by Kirill Terekhov's avatar Kirill Terekhov

Merge branch 'master' of https://github.com/INMOST-DEV/INMOST

parents 90d82d5b d71976dc
......@@ -96,7 +96,7 @@ namespace INMOST
else
{
BlockEntry b(typemask,domain_mask);
for(int k = 0; k < t.GetSize(); ++k)
for(INMOST_DATA_ENUM_TYPE k = 0; k < t.GetSize(); ++k)
b.AddTag(t,k);
return RegisterEntry(b);
}
......@@ -282,8 +282,9 @@ namespace INMOST
std::vector<INMOST_DATA_ENUM_TYPE> Automatizator::ListRegisteredEntries() const
{
std::vector<INMOST_DATA_ENUM_TYPE> ret;
for(blk_enum::size_type it = 0; it < reg_blocks.size(); ++it) if( isRegisteredEntry(it) )
ret.push_back(static_cast<INMOST_DATA_ENUM_TYPE>(it));
for(blk_enum::size_type it = 0; it < reg_blocks.size(); ++it)
if( isRegisteredEntry(static_cast<INMOST_DATA_ENUM_TYPE>(it)) )
ret.push_back(static_cast<INMOST_DATA_ENUM_TYPE>(it));
return ret;
}
......@@ -320,7 +321,7 @@ namespace INMOST
INMOST_DATA_REAL_TYPE MultiEntry::Value(const Storage & e, INMOST_DATA_ENUM_TYPE unk) const
{
unsigned pos = 0, k = 0;
unsigned pos = 0;
for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) )
{
unsigned s = entries[k]->MatrixSize(e);
......@@ -333,7 +334,7 @@ namespace INMOST
INMOST_DATA_REAL_TYPE & MultiEntry::Value(const Storage & e, INMOST_DATA_ENUM_TYPE unk)
{
unsigned pos = 0, k = 0;
unsigned pos = 0;
for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) )
{
unsigned s = entries[k]->MatrixSize(e);
......@@ -346,7 +347,7 @@ namespace INMOST
INMOST_DATA_ENUM_TYPE MultiEntry::Index(const Storage & e, INMOST_DATA_ENUM_TYPE unk) const
{
unsigned pos = 0, k = 0;
unsigned pos = 0;
for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) )
{
unsigned s = entries[k]->MatrixSize(e);
......@@ -359,7 +360,7 @@ namespace INMOST
unknown MultiEntry::Unknown(const Storage & e, INMOST_DATA_ENUM_TYPE unk) const
{
unsigned pos = 0, k = 0;
unsigned pos = 0;
for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) )
{
unsigned s = entries[k]->MatrixSize(e);
......
......@@ -163,8 +163,8 @@ namespace INMOST
{
for(int i = 0; i < NUM_ELEMENT_TYPS; i++)
{
pos[i] = other.pos[i];
sparse[i] = other.sparse[i];
pos[i] = other.pos[i];
sparse[i] = other.sparse[i];
}
tagname = other.tagname;
dtype = other.dtype;
......@@ -173,23 +173,25 @@ namespace INMOST
size = other.size;
record_size = other.record_size;
bytes_size = other.bytes_size;
print_tag = other.print_tag; //Temporary solution: @see Mesh::file_options
}
TagMemory & TagMemory::operator =(TagMemory const & other)
{
for(int i = 0; i < NUM_ELEMENT_TYPS; i++)
{
pos[i] = other.pos[i];
sparse[i] = other.sparse[i];
pos[i] = other.pos[i];
sparse[i] = other.sparse[i];
}
tagname = other.tagname;
dtype = other.dtype;
bulk_data_type = other.bulk_data_type;
m_link = other.m_link;
size = other.size;
record_size = other.record_size;
bytes_size = other.bytes_size;
return *this;
tagname = other.tagname;
dtype = other.dtype;
bulk_data_type = other.bulk_data_type;
m_link = other.m_link;
size = other.size;
record_size = other.record_size;
bytes_size = other.bytes_size;
print_tag = other.print_tag; //Temporary solution: @see Mesh::file_options
return *this;
}
TagMemory::TagMemory()
......
......@@ -121,11 +121,11 @@ namespace INMOST
/// Return vector filled with unknowns of the block with their derivatives.
uMatrix operator [](const Storage & e) const {uMatrix ret(MatrixSize(e),1); for(unsigned k = 0; k < Size(); ++k) ret(k,0) = Unknown(e,k); return ret; }
/// The intended size of the matrix for this entry.
INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {return Size();}
INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {(void)e; return Size();}
/// Number of tags in block.
INMOST_DATA_ENUM_TYPE Size() const {return (INMOST_DATA_ENUM_TYPE)unknown_tags.size();}
/// Number of entries for each tag in the block.
INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {return (INMOST_DATA_ENUM_TYPE)unknown_tags.size();}
INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {(void)e; return (INMOST_DATA_ENUM_TYPE)unknown_tags.size();}
/// Retrive component of the tag related to unknown.
INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {return unknown_comp[unk];}
/// Retrive tag related to unknown value.
......@@ -148,11 +148,11 @@ namespace INMOST
///Provide tag.
void SetTag(Tag unknown_tag_in, INMOST_DATA_ENUM_TYPE unknown_comp_in = 0) {unknown_tag = unknown_tag_in; unknown_comp = unknown_comp_in;}
/// Return value in vector of unknowns of the block at certain position.
INMOST_DATA_REAL_TYPE Value(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {assert(pos==0); return unknown_tag[e][unknown_comp];}
INMOST_DATA_REAL_TYPE Value(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {(void)pos; assert(pos==0); return unknown_tag[e][unknown_comp];}
/// Return value in vector of unknowns of the block at certain position.
INMOST_DATA_REAL_TYPE & Value(const Storage & e, INMOST_DATA_ENUM_TYPE pos) {assert(pos==0); return unknown_tag[e][unknown_comp];}
INMOST_DATA_REAL_TYPE & Value(const Storage & e, INMOST_DATA_ENUM_TYPE pos) {(void)pos; assert(pos==0); return unknown_tag[e][unknown_comp];}
/// Return index in vector of indices of the block at certain position.
INMOST_DATA_ENUM_TYPE Index(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {assert(pos==0); return isValid(e) ? GetOffsetTag()[e] : ENUMUNDEF;}
INMOST_DATA_ENUM_TYPE Index(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {(void)pos; assert(pos==0); return isValid(e) ? GetOffsetTag()[e] : ENUMUNDEF;}
/// Return unknown in vector of variables of the block at certain position.
unknown Unknown(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {assert(pos==0); return unknown(Value(e,pos),Index(e,pos));}
/// Return vector filled with values of unknowns of the block.
......@@ -164,15 +164,15 @@ namespace INMOST
/// Return vector filled with unknowns of the block with their derivatives.
uMatrix operator [](const Storage & e) const { uMatrix ret(1,1); ret(0,0) = Unknown(e,0); return ret; }
/// The intended size of the matrix for this entry.
INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {return 1;}
INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {(void)e; return 1;}
/// Number of tags in block.
INMOST_DATA_ENUM_TYPE Size() const {return 1;}
/// Number of entries for each tag in the block.
INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {return 1;}
INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {(void)e; return 1;}
/// Retrive component of the tag related to unknown.
INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {assert(unk == 0); return unknown_comp;}
INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {(void)unk; assert(unk == 0); return unknown_comp;}
/// Retrive tag related to unknown value.
TagRealArray GetValueTag(INMOST_DATA_ENUM_TYPE unk) const { assert(unk == 0); return unknown_tag;}
TagRealArray GetValueTag(INMOST_DATA_ENUM_TYPE unk) const {(void)unk; assert(unk == 0); return unknown_tag;}
/// Retrive mesh pointer.
Mesh * GetMeshLink() const {return unknown_tag.GetMeshLink();}
/// Make a copy of the object
......@@ -212,9 +212,9 @@ namespace INMOST
/// Number of entries for each tag in the block.
INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {return (INMOST_DATA_ENUM_TYPE)unknown_tag[e].size();}
/// Retrive component of the tag related to unknown.
INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {assert(unk==0); return ENUMUNDEF;}
INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {(void)unk; assert(unk==0); return ENUMUNDEF;}
/// Retrive tag related to unknown value.
TagRealArray GetValueTag(INMOST_DATA_ENUM_TYPE unk) const {assert(unk==0); return unknown_tag;}
TagRealArray GetValueTag(INMOST_DATA_ENUM_TYPE unk) const {(void)unk; assert(unk==0); return unknown_tag;}
/// Retrive mesh pointer.
Mesh * GetMeshLink() const {return unknown_tag.GetMeshLink();}
/// Make a copy of the object
......@@ -262,7 +262,7 @@ namespace INMOST
/// Return vector filled with unknowns of the block with their derivatives.
uMatrix operator [](const Storage & e) const {uMatrix ret(MatrixSize(e),1); for(INMOST_DATA_ENUM_TYPE k = 0; k < Size(); ++k) ret(k,0) = Unknown(e,k); return ret; }
/// The intended size of the matrix for this entry.
INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {return Size();}
INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {(void)e; return Size();}
/// Number of tags in block.
INMOST_DATA_ENUM_TYPE Size() const {return (INMOST_DATA_ENUM_TYPE)unknown_tags.size();}
/// Number of entries for each tag in the block.
......
......@@ -112,15 +112,15 @@ namespace INMOST
private:
rMatrix value;
public:
const_block_variable(INMOST_DATA_REAL_TYPE _value) : value(_value) {}
const_block_variable(const rMatrix & _value) : value(_value) {}
const_block_variable(const const_block_variable & other) : value(other.value) {}
const_block_variable & operator =(const const_block_variable & other)
{
value = other.value;
return * this;
}
rMatrix Value(const Storage & e) const {return value;}
vMatrix Variable(const Storage & e) const { return value; }
rMatrix Value(const Storage & e) const {(void)e; return value;}
vMatrix Variable(const Storage & e) const {(void)e; return value;}
abstract_dynamic_block_variable * Copy() const {return static_cast<abstract_dynamic_block_variable *>(new const_block_variable(*this));}
};
......@@ -231,16 +231,16 @@ namespace INMOST
rMatrix Value(const Storage & e) const
{
rMatrix ret = Arg.Value(e);
for(int k = 0; k < ret.Rows(); ++k)
for(int l = 0; l < ret.Cols(); ++l)
for(INMOST_DATA_ENUM_TYPE k = 0; k < ret.Rows(); ++k)
for(INMOST_DATA_ENUM_TYPE l = 0; l < ret.Cols(); ++l)
ret(k,l) = get_table(ret(k,l),Table);
return ret;
}
vMatrix Variable(const Storage & e) const
{
vMatrix ret = Arg.Variable(e);
for(int k = 0; k < ret.Rows(); ++k)
for(int l = 0; l < ret.Cols(); ++l)
for(INMOST_DATA_ENUM_TYPE k = 0; k < ret.Rows(); ++k)
for(INMOST_DATA_ENUM_TYPE l = 0; l < ret.Cols(); ++l)
ret(k,l) = get_table(ret(k,l),Table);
return ret;
}
......
......@@ -170,13 +170,20 @@ namespace INMOST
/// on certain elements of the mesh.
bool sparse[NUM_ELEMENT_TYPS];
///Number of bytes used to store data for one element. It is size times bytes_size for data of
// fixed size or number of bytes for the structure used to represent data of variable size.
/// fixed size or number of bytes for the structure used to represent data of variable size.
INMOST_DATA_ENUM_TYPE record_size;
///Print this tag to files.
/// Temporary solution for compatibility with external packages.
/// @see Mesh::SetPrint
/// @see Mesh::GetPrint
/// \todo The general solution:
/// @see Mesh::file_options
bool print_tag;
///Link to the mesh.
Mesh * m_link;
/// Provide access to interface.
///Provide access to interface.
friend class Tag;
/// For debug purposes only.
///For debug purposes only.
friend class Storage;
};
......@@ -222,6 +229,8 @@ namespace INMOST
__INLINE bool isSparseByDim(INMOST_DATA_INTEGER_TYPE typenum)const;
__INLINE bool isDefinedByDim(INMOST_DATA_INTEGER_TYPE typenum)const;
__INLINE void SetBulkDataType(INMOST_MPI_Type type);
__INLINE void SetPrint(bool print);
__INLINE bool GetPrint() const;
friend class TagManager;
friend class Storage;
friend class Mesh;
......@@ -788,6 +797,16 @@ namespace INMOST
mem->sparse[ElementNum(type)] = true;
}
__INLINE void Tag::SetPrint(bool print)
{
mem->print_tag = print;
}
__INLINE bool Tag::GetPrint() const
{
return mem->print_tag;
}
__INLINE INMOST_DATA_ENUM_TYPE Tag::GetPositionByDim(INMOST_DATA_ENUM_TYPE typenum) const
{
return mem->pos[typenum];
......@@ -887,7 +906,7 @@ namespace INMOST
}
//Implementation of inlined functions
//#include "Source/Data/tag_inline.hpp"
//#include "../Data/tag_inline.hpp"
#endif
......
......@@ -1799,6 +1799,7 @@ namespace INMOST
{
assert(Cols() == cols);
assert(Rows() == rows);
(void)cols; (void)rows;
}
};
......@@ -2157,7 +2158,7 @@ namespace INMOST
Matrix<typename Promote<Var,typeB>::type> AtB = At*B; //m by l matrix
Matrix<Var> AtA = At*(*this); //m by m matrix
enumerator l = AtB.Cols();
enumerator n = Rows();
//enumerator n = Rows();
enumerator m = Cols();
enumerator * order = new enumerator [m];
std::pair<Matrix<typename Promote<Var,typeB>::type>,bool>
......@@ -2319,7 +2320,7 @@ namespace INMOST
ret.second = SVD(U,S,V);
if( print_fail && !ret.second )
std::cout << "Failed to compute Moore-Penrose inverse of the matrix" << std::endl;
for(int k = 0; k < S.Cols(); ++k)
for(INMOST_DATA_ENUM_TYPE k = 0; k < S.Cols(); ++k)
{
if( S(k,k) > tol )
S(k,k) = 1.0/S(k,k);
......
......@@ -173,6 +173,7 @@ namespace INMOST
if( !J.isSorted() ) std::sort(J.Begin(),J.End());
for(Sparse::Row::iterator it = J.Begin(); it != J.End(); ++it) it->second *= multJ;
H.Clear();
(void)multH;
}
__INLINE multivar_expression & operator = (INMOST_DATA_REAL_TYPE pvalue)
{
......@@ -632,6 +633,7 @@ namespace INMOST
for(Sparse::Row::iterator it = J.Begin(); it != J.End(); ++it) it->second *= multJ;
H.Clear();
}
(void)multH;
}
__INLINE multivar_expression_reference & operator = (INMOST_DATA_REAL_TYPE pvalue)
{
......@@ -1849,6 +1851,7 @@ namespace INMOST
left.GetHessian(1,JL,1,HL); //retrive jacobian row and hessian matrix of the left expression
Sparse::HessianRow::MergeJacobianHessian(multH*ldmult2,JL,JL,multH*ldmult,HL,H);
for(Sparse::Row::iterator it = JL.Begin(); it != JL.End(); ++it) it->second *= ldmult*multJ;
(void)J;
}
};
......
......@@ -3704,7 +3704,7 @@ namespace INMOST
}
//Implementation of inlined functions
//#include "Source/Data/storage_inline.hpp"
//#include "../Data/storage_inline.hpp"
#endif
......
......@@ -38,7 +38,7 @@ namespace INMOST
/// Roll back to previous step.
virtual bool RestoreTimeStep() = 0;
/// Calculate multiplier for update for this model. Can simply return 1.
virtual double UpdateMultiplier(const Sparse::Vector & sol) const {return 1;}
virtual double UpdateMultiplier(const Sparse::Vector & sol) const {(void)sol; return 1;}
/// Calculate time step for this model. Can simply return dt.
virtual double AdjustTimeStep(double dt) const {return dt;}
};
......
......@@ -4,8 +4,6 @@
#include "inmost_common.h"
namespace INMOST
{
namespace Sparse
......
......@@ -273,12 +273,13 @@ namespace INMOST
value = other.value;
return * this;
}
INMOST_DATA_REAL_TYPE Value(const Storage & e) const {return value;}
INMOST_DATA_REAL_TYPE Value(const Storage & e) const {(void)e; return value;}
multivar_expression Variable(const Storage & e) const
{
return multivar_expression(value);
(void)e;
return multivar_expression(value);
}
const_expression operator [](const Storage & e) const {return const_expression(value);}
const_expression operator [](const Storage & e) const {(void)e; return const_expression(value);}
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); }
abstract_dynamic_variable * Copy() const {return static_cast<abstract_dynamic_variable *>(new const_variable(*this));}
......@@ -296,12 +297,13 @@ namespace INMOST
value = other.value;
return * this;
}
INMOST_DATA_REAL_TYPE Value(const Storage & e) const {return *value;}
INMOST_DATA_REAL_TYPE Value(const Storage & e) const {(void)e; return *value;}
multivar_expression Variable(const Storage & e) const
{
return multivar_expression(*value);
(void)e;
return multivar_expression(*value);
}
const_expression operator [](const Storage & e) const {return const_expression(*value);}
const_expression operator [](const Storage & e) const {(void)e; return const_expression(*value);}
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); }
abstract_dynamic_variable * Copy() const {return static_cast<abstract_dynamic_variable *>(new const_link_variable(*this));}
......
#ifdef _MSC_VER //kill some warnings
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#ifndef _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#endif
#endif
#include "inmost.h"
#include "../Mesh/incident_matrix.hpp"
......
......@@ -329,13 +329,14 @@ safe_output:
//printf("%s %d %d %d\n",tag_names[i].c_str(),t.isDefined(CELL),!t.isSparse(CELL),t.GetDataType() != DATA_BULK);
if (((t.isDefined(CELL) && !t.isSparse(CELL))
|| (t.isDefined(FACE) && output_faces)) &&
t.GetDataType() != DATA_BULK &&
t.GetDataType() != DATA_REFERENCE &&
t.GetDataType() != DATA_REMOTE_REFERENCE &&
t != CoordsTag() &&
t != SharedTag() &&
t != SendtoTag() &&
t != ProcessorsTag())
t.GetPrint() && //Temporary solution: @see Mesh::file_option
t.GetDataType() != DATA_BULK &&
t.GetDataType() != DATA_REFERENCE &&
t.GetDataType() != DATA_REMOTE_REFERENCE &&
t != CoordsTag() &&
t != SharedTag() &&
t != SendtoTag() &&
t != ProcessorsTag())
{
//printf("added!\n");
tags.push_back(t);
......
......@@ -1419,7 +1419,7 @@ namespace INMOST
} while(true);
data.RemPrivateMarker(mrk);
mesh->ReleasePrivateMarker(mrk);
Storage::real nrm[3], cnt[3], ccnt[3];
Storage::real nrm[3], cnt[3];
for(unsigned j = 0; j < data.size(); j++)
{
//std::cout << (data[j].GetPrivateMarker(rev) ? 0:1);
......
......@@ -1609,7 +1609,7 @@ namespace INMOST
void OperationMinDistance(const Tag & tag, const Element & element, const INMOST_DATA_BULK_TYPE * data, INMOST_DATA_ENUM_TYPE size)
{
int owner = *((double*)data);
int owner = (int)*((double*)data);
double dist = *((double*)(data+sizeof(double)));
TagReal r_tag = tag;
......@@ -1619,11 +1619,12 @@ namespace INMOST
element->RealArray(tag)[0] = owner;
element->RealArray(tag)[1] = dist;
}
(void)size;
}
void Mesh::ResolveModification()
{
int rank = GetProcessorRank(),mpisize = GetProcessorsNumber();
int rank = GetProcessorRank();
Tag tag = CreateTag("TEMP_DISTANSE",DATA_REAL,CELL,CELL,2);
......@@ -1642,7 +1643,7 @@ namespace INMOST
}
}
int owner1 = it->IntegerDF(tag_owner);
//int owner1 = it->IntegerDF(tag_owner);
int owner2 = near_cell.IntegerDF(tag_owner);
it->RealArray(tag)[0] = owner2;
......@@ -1654,7 +1655,7 @@ namespace INMOST
for(Mesh::iteratorCell it = BeginCell(); it != EndCell(); it++) if (GetMarker(*it,NewMarker()))
{
int new_owner = it->RealArray(tag)[0];
int new_owner = (int)it->RealArray(tag)[0];
it->IntegerDF(tag_owner) = new_owner;
......
#ifdef _MSC_VER //kill some warnings
#ifndef _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#endif
#endif
#include "inmost.h"
......@@ -40,7 +42,9 @@ namespace INMOST
std::string ro()
{
int rank = 0;
#ifdef USE_MPI
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
#endif
std::stringstream ss;
for (int i = 0; i < rank; i++)
ss << " ";
......@@ -1618,6 +1622,7 @@ namespace INMOST
#else //USE_MPI
AssignGlobalID(CELL | FACE | EDGE | NODE);
(void)only_new;
#endif //USE_MPI
EXIT_FUNC();
}
......@@ -2284,7 +2289,6 @@ namespace INMOST
void Mesh::PackTagData(const Tag & tag, const elements_by_type & elements, int destination, ElementType mask, MarkerType select, buffer_type & buffer)
{
int rank = GetProcessorRank();
if( tag.GetDataType() == DATA_REMOTE_REFERENCE ) return; //NOT IMPLEMENTED TODO 14
ENTER_FUNC();
#if defined(USE_MPI)
......@@ -2397,6 +2401,7 @@ namespace INMOST
#else
(void) tag;
(void) elements;
(void) destination;
(void) mask;
(void) select;
(void) buffer;
......@@ -2409,7 +2414,6 @@ namespace INMOST
bool Mesh::FindSharedGhost(int global_id, INMOST_DATA_INTEGER_TYPE el_type_num, HandleType& res)
{
int rank = GetProcessorRank();
int dim = el_type_num;
for (parallel_storage::iterator it = shared_elements.begin(); it != shared_elements.end(); it++)
{
......@@ -2439,8 +2443,7 @@ namespace INMOST
void Mesh::UnpackTagData(const Tag & tag, const elements_by_type & elements, ElementType mask, MarkerType select, buffer_type & buffer, int & position, ReduceOperation op)
{
int rank = GetProcessorRank();
(void) mask;
(void) mask;
if( tag.GetDataType() == DATA_REMOTE_REFERENCE) return; //NOT IMPLEMENTED TODO 14
ENTER_FUNC();
REPORT_VAL("TagName",tag.GetTagName());
......@@ -2980,13 +2983,13 @@ namespace INMOST
void Mesh::PackElementsData(element_set & all, buffer_type & buffer, int destination, const std::vector<std::string> & tag_list)
{
int rank = GetProcessorRank();
//std::cout << ro() << rank << " In pack elements data " << all.size() << std::endl;
//std::cout << rank << " In pack elements Data" << std::endl;
ENTER_FUNC();
REPORT_VAL("dest",destination);
#if defined(USE_MPI)
INMOST_DATA_ENUM_TYPE num;
int rank = GetProcessorRank();
//std::cout << ro() << rank << " In pack elements data " << all.size() << std::endl;
//std::cout << rank << " In pack elements Data" << std::endl;
INMOST_DATA_ENUM_TYPE num;
//assume hex mesh for forward allocation
//8 nodes per cell, 2 nodes per edge, 4 edges per face, 6 faces per cell
const INMOST_DATA_ENUM_TYPE size_hint[5] = {8,2,4,6,1};
......@@ -3102,7 +3105,7 @@ namespace INMOST
}
stringstream ss;
ss << ro() << rank << ": to send: ";
ss << ro() << mpirank << ": to send: ";
ss << "nodes: " << selems[0].size() << " | ";
ss << "edge: " << selems[1].size() << " | ";
ss << "faces: " << selems[2].size() << " | ";
......@@ -3414,7 +3417,7 @@ namespace INMOST
// Compute names_buff_size
for(element_set::iterator it = selems[4].begin(); it != selems[4].end(); it++) names_buff_size += ElementSet(this,*it).GetName().size() + 1;
//cout << ro() << rank << ": Names buff size = " << names_buff_size << endl;
//cout << ro() << mpirank << ": Names buff size = " << names_buff_size << endl;
char* names_buff;
if (names_buff_size > 0) names_buff = new char[names_buff_size];
int names_buff_pos = 0;
......@@ -3429,7 +3432,7 @@ namespace INMOST
// Add all low conns to low_conn_nums
stringstream ss;
ss << ro() << rank << ": For set " << ElementSet(this,*it).GetName() << " low conns (";
ss << ro() << mpirank << ": For set " << ElementSet(this,*it).GetName() << " low conns (";
low_conn_size[k] = 0;
Element::adj_type const & lc = LowConn(*it);
for(Element::adj_type::const_iterator jt = lc.begin(); jt != lc.end(); jt++) if( !Hidden(*jt) )
......@@ -3451,7 +3454,7 @@ namespace INMOST
if (set.HaveParent()) high_conn_nums[k*3+2] = Integer(selems[4][Integer(set.GetParent().GetHandle(), arr_position)],arr_position); else high_conn_nums[k*3 + 2] = -1;
stringstream ss5;
ss5 << ro() << rank << ": high_conn_nums for set " << set.GetName() << ": ";
ss5 << ro() << mpirank << ": high_conn_nums for set " << set.GetName() << ": ";
ss5 << high_conn_nums[k*3 + 0] << " " << high_conn_nums[k*3 + 1] << " " << high_conn_nums[k*3 + 2] << endl;
cout << ss5.str();
......@@ -3459,7 +3462,7 @@ namespace INMOST
}
stringstream s1;
s1 << ro() << rank << ": Packed names: ";
s1 << ro() << mpirank << ": Packed names: ";
for (int i = 0; i < names_buff_size; i++)
if (names_buff[i] == '\0')
s1 << "|";
......@@ -3467,7 +3470,7 @@ namespace INMOST
s1 << names_buff[i];
stringstream ss;
ss << ro() << rank << ": packed low_conns_size array: ";
ss << ro() << mpirank << ": packed low_conns_size array: ";
for (int i = 0; i < num; i++) ss << low_conn_size[i] << " ";
MPI_Pack_size(1 ,INMOST_MPI_DATA_ENUM_TYPE ,comm,&temp); new_size += temp; // count of sets
......@@ -3555,7 +3558,7 @@ namespace INMOST
//PackTagData(GetTag(tag_list[i]),pack_tags,NODE | EDGE | FACE | CELL | ESET,0,buffer);
PackTagData(tag,selems,destination,NODE | EDGE | FACE | CELL | ESET,pack_tags_mrk,buffer);
//PackTagData(tag,selems,NODE | EDGE | FACE | CELL | ESET,0,buffer);
//std::cout << rank << " After pack_tag_data\n" << std::endl;
//std::cout << mpirank << " After pack_tag_data\n" << std::endl;
}
}
......@@ -4269,10 +4272,10 @@ namespace INMOST
void Mesh::PrepareReceiveInner(Prepare todo, exch_buffer_type & send_bufs, exch_buffer_type & recv_bufs)
{
int mpirank = GetProcessorRank(),mpisize = GetProcessorsNumber();
if( parallel_strategy == 0 && todo == UnknownSize ) return; //in this case we know all we need
ENTER_FUNC();
#if defined(USE_MPI)
int mpirank = GetProcessorRank();
#if defined(USE_MPI_P2P) && defined(PREFFER_MPI_P2P)
unsigned i, end = send_bufs.size();
REPORT_MPI(MPI_Win_fence(MPI_MODE_NOPRECEDE,window)); //start exchange session
......@@ -4488,11 +4491,10 @@ namespace INMOST
void Mesh::ExchangeMarked(enum Action action)
{
int rank = GetProcessorRank();
ENTER_FUNC();
if( m_state == Serial ) return;
#if defined(USE_MPI)
INMOST_DATA_BIG_ENUM_TYPE num_wait;
INMOST_DATA_BIG_ENUM_TYPE num_wait;
int mpirank = GetProcessorRank();
std::vector<MPI_Request> send_reqs, recv_reqs;
std::vector<std::string> tag_list, tag_list_recv;
......@@ -5351,6 +5353,7 @@ namespace INMOST
for(Storage::enumerator k = 0; k < local_nrm.size(); ++k)
dot += local_nrm[k]*remote_nrm[k];
local_nrm[0] = dot;
(void)size;
}
void Mesh::MarkNormalOrientation(MarkerType mrk)
......@@ -5396,6 +5399,7 @@ namespace INMOST
void Mesh::ResolveSets()
{
#ifdef USE_MPI
int mpirank = GetProcessorRank();
int mpisize = GetProcessorsNumber();
......@@ -5547,6 +5551,8 @@ namespace INMOST
cout << endl;
}
*/
#endif
}
}
......
......@@ -60,7 +60,7 @@ namespace INMOST
std::vector<BYTE> base64_decode(std::string const& encoded_string)
{
int in_len = encoded_string.size();
int in_len = static_cast<int>(encoded_string.size());
int i = 0;
int j = 0;
int in_ = 0;
......@@ -73,7 +73,7 @@ namespace INMOST
if (i ==4)
{