Commit 30a676b7 authored by Kirill Terekhov's avatar Kirill Terekhov

Fixes

Fix for possibility of race condition in point-to-point MPI
communications.

Fixes for warnings produced by clang.
parent ae0bf6b1
...@@ -149,7 +149,7 @@ int main(int argc,char ** argv) ...@@ -149,7 +149,7 @@ int main(int argc,char ** argv)
if( cell->GetStatus() != Element::Ghost ) if( cell->GetStatus() != Element::Ghost )
{ {
unsigned pid = cell->Integer(id); unsigned pid = cell->Integer(id);
unsigned pid2 = cell->GlobalID(); //unsigned pid2 = cell->GlobalID();
if( pid < idmin ) idmin = pid; if( pid < idmin ) idmin = pid;
if( pid+1 > idmax ) idmax = pid+1; if( pid+1 > idmax ) idmax = pid+1;
} }
...@@ -174,7 +174,6 @@ int main(int argc,char ** argv) ...@@ -174,7 +174,6 @@ int main(int argc,char ** argv)
((!r2->isValid() || (s2 = r2->GetStatus()) == Element::Ghost)?0:1) == 0) continue; ((!r2->isValid() || (s2 = r2->GetStatus()) == Element::Ghost)?0:1) == 0) continue;
Storage::real f_nrm[3], r1_cnt[3], r2_cnt[3], f_cnt[3], d1[3], Coef; Storage::real f_nrm[3], r1_cnt[3], r2_cnt[3], f_cnt[3], d1[3], Coef;
Storage::real f_area = face->Area(); // Get the face area Storage::real f_area = face->Area(); // Get the face area
Storage::real vol1 = r1->Volume(), vol2; // Get the cell volume
Storage::integer id1 = r1->Integer(id), id2; Storage::integer id1 = r1->Integer(id), id2;
Storage::real K1 = r1->Real(tensor_K), K2, Kav; Storage::real K1 = r1->Real(tensor_K), K2, Kav;
face->Normal(f_nrm); // Get the face normal face->Normal(f_nrm); // Get the face normal
...@@ -200,7 +199,6 @@ int main(int argc,char ** argv) ...@@ -200,7 +199,6 @@ int main(int argc,char ** argv)
} }
else else
{ {
vol2 = r2->Volume();
K2 = r2->Real(tensor_K); K2 = r2->Real(tensor_K);
id2 = r2->Integer(id); id2 = r2->Integer(id);
r2->Barycenter(r2_cnt); r2->Barycenter(r2_cnt);
......
...@@ -15,7 +15,7 @@ using namespace INMOST; ...@@ -15,7 +15,7 @@ using namespace INMOST;
int main(int argc, char ** argv) int main(int argc, char ** argv)
{ {
if( argc < 3 || argc > 1 && ( atoi(argv[1]) < 0 || atoi(argv[1]) > 11 ) ) if( (argc < 3 || argc > 1) && ( atoi(argv[1]) < 0 || atoi(argv[1]) > 11 ) )
{ {
std::cout << "Usage: " << argv[0] << " method_number<0:INNER_ILU2,1:INNER_DDPQILUC,2:INNER_MPTILUC,3:INNER_MPTILU2,4:Trilinos_Aztec,5:Trilinos_Belos,6:Trilinos_ML,7:Trilinos_Ifpack,8:PETSc,9:ANI,10:FCBIILU2,11:K3BIILU2> matrix.mtx [right_hand_side.rhs] [exact_solution] [solver_options.txt]" << std::endl; std::cout << "Usage: " << argv[0] << " method_number<0:INNER_ILU2,1:INNER_DDPQILUC,2:INNER_MPTILUC,3:INNER_MPTILU2,4:Trilinos_Aztec,5:Trilinos_Belos,6:Trilinos_ML,7:Trilinos_Ifpack,8:PETSc,9:ANI,10:FCBIILU2,11:K3BIILU2> matrix.mtx [right_hand_side.rhs] [exact_solution] [solver_options.txt]" << std::endl;
std::cout << "Example: " << argv[0] << " 0 a.mtx b.rhs" << std::endl; std::cout << "Example: " << argv[0] << " 0 a.mtx b.rhs" << std::endl;
......
...@@ -930,7 +930,7 @@ public: ...@@ -930,7 +930,7 @@ public:
{ {
if( colors.empty() ) if( colors.empty() )
{ {
double cc[4] = {c[0],c[1],c[2],alpha}; //double cc[4] = {c[0],c[1],c[2],alpha};
glColor4dv(c); glColor4dv(c);
for(unsigned k = 0; k < verts.size(); k+=3) for(unsigned k = 0; k < verts.size(); k+=3)
{ {
...@@ -1287,7 +1287,7 @@ public: ...@@ -1287,7 +1287,7 @@ public:
} }
*/ */
printf("number of points %d\n",points.size()); printf("number of points %d\n",(int)points.size());
} }
void camera(double pos[3], int interactive) void camera(double pos[3], int interactive)
{ {
...@@ -2757,7 +2757,7 @@ public: ...@@ -2757,7 +2757,7 @@ public:
Input(double * val, std::string comment) : comment(comment) {input_link = val; type = Double; canceled = false; done = false; str = "";} Input(double * val, std::string comment) : comment(comment) {input_link = val; type = Double; canceled = false; done = false; str = "";}
Input(char * val, std::string comment) : comment(comment) {input_link = val; type = String; canceled = false; done = false; str = "";} Input(char * val, std::string comment) : comment(comment) {input_link = val; type = String; canceled = false; done = false; str = "";}
Input(void * link, InputType type, std::string comment) : comment(comment), input_link(link), type(type) {canceled = false; done = false; str = "";} Input(void * link, InputType type, std::string comment) : comment(comment), input_link(link), type(type) {canceled = false; done = false; str = "";}
Input(const Input & other):comment(comment), input_link(other.input_link), str(other.str), type(other.type), canceled(other.canceled), done(other.done) {} Input(const Input & other):str(other.str),comment(other.comment), input_link(other.input_link), type(other.type), done(other.done), canceled(other.canceled) {}
Input & operator =(Input const & other) {comment = other.comment; input_link = other.input_link; str = other.str; type = other.type; canceled = other.canceled; done = other.done; return *this;} Input & operator =(Input const & other) {comment = other.comment; input_link = other.input_link; str = other.str; type = other.type; canceled = other.canceled; done = other.done; return *this;}
~Input() {} ~Input() {}
void KeyPress(char c) void KeyPress(char c)
...@@ -2782,7 +2782,7 @@ public: ...@@ -2782,7 +2782,7 @@ public:
done = true; done = true;
glutPostRedisplay(); glutPostRedisplay();
} }
else if( type == String || ( (c >= '0' && c <= '9') || ((str.empty() || tolower(*str.rbegin()) == 'e') && c=='+' || c=='-') || (type == Double && (c=='.' || c=='e' || c == 'E'))) ) else if( type == String || ( (c >= '0' && c <= '9') || ((str.empty() || tolower(*str.rbegin()) == 'e') && (c=='+' || c=='-')) || (type == Double && (c=='.' || c=='e' || c == 'E'))) )
{ {
str += c; str += c;
glutPostRedisplay(); glutPostRedisplay();
...@@ -2814,7 +2814,7 @@ public: ...@@ -2814,7 +2814,7 @@ public:
//printtext(str.c_str()); //printtext(str.c_str());
char oldval[4096]; char oldval[4096];
if( type == Double ) sprintf(oldval,"%g",*(double*)input_link); if( type == Double ) sprintf(oldval,"%g",*(double*)input_link);
else if( type == Integer ) sprintf(oldval,"%g",*(int*)input_link); else if( type == Integer ) sprintf(oldval,"%d",*(int*)input_link);
else if( type == String ) sprintf(oldval,"%s",(char *)input_link); else if( type == String ) sprintf(oldval,"%s",(char *)input_link);
printtext("input number (%s[%s]:%s): %s",comment.c_str(),oldval,type == Integer ? "integer": (type == Double ? "double" : "string"), str.c_str()); printtext("input number (%s[%s]:%s): %s",comment.c_str(),oldval,type == Integer ? "integer": (type == Double ? "double" : "string"), str.c_str());
} }
...@@ -3512,6 +3512,23 @@ void draw_screen() ...@@ -3512,6 +3512,23 @@ void draw_screen()
} }
break; break;
} }
case DATA_VARIABLE:
{
Storage::var_array arr = e->VariableArray(*t);
for(INMOST_DATA_ENUM_TYPE k = 0; k < arr.size(); k++)
{
std::stringstream stream;
stream << arr[k].GetValue() << " {[" << arr[k].GetRow().Size() << "] ";
for(INMOST_DATA_ENUM_TYPE q = 0; q < arr[k].GetRow().Size(); ++q)
{
stream << "(" << arr[k].GetRow().GetValue(q) << "," << arr[k].GetRow().GetIndex(q) << ") ";
}
stream << "}";
sprintf(temp,"%s %s",str,stream.str().c_str());
strcpy(str,temp);
}
break;
}
} }
sprintf(temp,"%s %s %s",t->GetTagName().c_str(),DataTypeName(t->GetDataType()),str); sprintf(temp,"%s %s %s",t->GetTagName().c_str(),DataTypeName(t->GetDataType()),str);
strcpy(str,temp); strcpy(str,temp);
...@@ -4009,7 +4026,7 @@ int main(int argc, char ** argv) ...@@ -4009,7 +4026,7 @@ int main(int argc, char ** argv)
streamlines.push_back(Streamline(octsearch,xyz,vel,cell_size,velmin,velmax,-1.0,0)); streamlines.push_back(Streamline(octsearch,xyz,vel,cell_size,velmin,velmax,-1.0,0));
} }
} }
printf("done from %d by %d grid, total streamlines = %d\n",numlines,numlines,streamlines.size()); printf("done from %d by %d grid, total streamlines = %d\n",numlines,numlines,(int)streamlines.size());
mesh->DeleteTag(cell_size); mesh->DeleteTag(cell_size);
printf("done, total streamlines = %d\n",streamlines.size()); printf("done, total streamlines = %d\n",streamlines.size());
printf("killing octree, was sets %d\n",mesh->NumberOfSets()); printf("killing octree, was sets %d\n",mesh->NumberOfSets());
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
// output xml files for debugging of parallel algorithms // output xml files for debugging of parallel algorithms
// search for style.xsl within examples for comfortable // search for style.xsl within examples for comfortable
// view of generated xml files // view of generated xml files
//#define USE_PARALLEL_WRITE_TIME #define USE_PARALLEL_WRITE_TIME
// this will revert Mesh::PrepareReceiveInner to always // this will revert Mesh::PrepareReceiveInner to always
// use MPI point to point functionality disregarding problem type // use MPI point to point functionality disregarding problem type
...@@ -107,6 +107,7 @@ ...@@ -107,6 +107,7 @@
#define INMOST_MPI_Request int #define INMOST_MPI_Request int
#define INMOST_MPI_Type int #define INMOST_MPI_Type int
#define INMOST_MPI_Comm int #define INMOST_MPI_Comm int
#define INMOST_MPI_Group int
#define INMOST_MPI_COMM_WORLD 0 #define INMOST_MPI_COMM_WORLD 0
#define INMOST_MPI_BYTE 0 #define INMOST_MPI_BYTE 0
#define INMOST_MPI_INT 0 #define INMOST_MPI_INT 0
...@@ -114,10 +115,12 @@ ...@@ -114,10 +115,12 @@
#define INMOST_MPI_UNSIGNED 0 #define INMOST_MPI_UNSIGNED 0
#define INMOST_MPI_Win int #define INMOST_MPI_Win int
#define INMOST_MPI_DATATYPE_NULL 0 #define INMOST_MPI_DATATYPE_NULL 0
#define INMOST_MPI_GROUP_EMPTY 0
#else #else
#define INMOST_MPI_Request MPI_Request #define INMOST_MPI_Request MPI_Request
#define INMOST_MPI_Type MPI_Datatype #define INMOST_MPI_Type MPI_Datatype
#define INMOST_MPI_Comm MPI_Comm #define INMOST_MPI_Comm MPI_Comm
#define INMOST_MPI_Group MPI_Group
#define INMOST_MPI_COMM_WORLD MPI_COMM_WORLD #define INMOST_MPI_COMM_WORLD MPI_COMM_WORLD
#define INMOST_MPI_BYTE MPI_BYTE #define INMOST_MPI_BYTE MPI_BYTE
#define INMOST_MPI_INT MPI_INT #define INMOST_MPI_INT MPI_INT
...@@ -125,10 +128,11 @@ ...@@ -125,10 +128,11 @@
#define INMOST_MPI_UNSIGNED MPI_UNSIGNED #define INMOST_MPI_UNSIGNED MPI_UNSIGNED
#define INMOST_MPI_Win MPI_Win #define INMOST_MPI_Win MPI_Win
#define INMOST_MPI_DATATYPE_NULL MPI_DATATYPE_NULL #define INMOST_MPI_DATATYPE_NULL MPI_DATATYPE_NULL
#define INMOST_MPI_GROUP_EMPTY MPI_GROUP_EMPTY
#endif #endif
#define INMOST_MPI_SIZE int //in case MPI standard changes and compiler gives tons of warning #define INMOST_MPI_SIZE int //in case MPI standard changes and compiler gives tons of warnings
#define INMOST_DATA_INTEGER_TYPE int #define INMOST_DATA_INTEGER_TYPE int
#define INMOST_DATA_REAL_TYPE double #define INMOST_DATA_REAL_TYPE double
......
...@@ -207,7 +207,7 @@ namespace INMOST ...@@ -207,7 +207,7 @@ namespace INMOST
} }
__INLINE multivar_expression & operator /=(basic_expression const & expr) __INLINE multivar_expression & operator /=(basic_expression const & expr)
{ {
INMOST_DATA_REAL_TYPE lval = value, rval = expr.GetValue(); INMOST_DATA_REAL_TYPE rval = expr.GetValue();
INMOST_DATA_REAL_TYPE reciprocial_rval = 1.0/rval; INMOST_DATA_REAL_TYPE reciprocial_rval = 1.0/rval;
value *= reciprocial_rval; value *= reciprocial_rval;
if( CheckCurrentAutomatizator() ) if( CheckCurrentAutomatizator() )
...@@ -1044,18 +1044,22 @@ namespace INMOST ...@@ -1044,18 +1044,22 @@ namespace INMOST
name = _name; name = _name;
size = _size; size = _size;
vals = new INMOST_DATA_REAL_TYPE[size]; vals = new INMOST_DATA_REAL_TYPE[size];
std::copy(_vals,_vals+size,vals); memcpy(vals,_vals,sizeof(INMOST_DATA_REAL_TYPE)*size);
//std::copy(_vals,_vals+size,vals);
args = new INMOST_DATA_REAL_TYPE[size]; args = new INMOST_DATA_REAL_TYPE[size];
std::copy(_args,_args+size,args); memcpy(args,_args,sizeof(INMOST_DATA_REAL_TYPE)*size);
//std::copy(_args,_args+size,args);
} }
keyval_table(const keyval_table & other) keyval_table(const keyval_table & other)
{ {
name = other.name; name = other.name;
size = other.size; size = other.size;
vals = new INMOST_DATA_REAL_TYPE[size]; vals = new INMOST_DATA_REAL_TYPE[size];
std::copy(other.vals,other.vals+size,vals); memcpy(vals,other.vals,sizeof(INMOST_DATA_REAL_TYPE)*size);
//std::copy(other.vals,other.vals+size,vals);
args = new INMOST_DATA_REAL_TYPE[size]; args = new INMOST_DATA_REAL_TYPE[size];
std::copy(other.args,other.args+size,args); memcpy(args,other.args,sizeof(INMOST_DATA_REAL_TYPE)*size);
//std::copy(other.args,other.args+size,args);
} }
keyval_table & operator = (keyval_table const & other) keyval_table & operator = (keyval_table const & other)
{ {
...@@ -1063,9 +1067,11 @@ namespace INMOST ...@@ -1063,9 +1067,11 @@ namespace INMOST
name = other.name; name = other.name;
size = other.size; size = other.size;
vals = new INMOST_DATA_REAL_TYPE[size]; vals = new INMOST_DATA_REAL_TYPE[size];
std::copy(other.vals,other.vals+size,vals); memcpy(vals,other.vals,sizeof(INMOST_DATA_REAL_TYPE)*size);
//std::copy(other.vals,other.vals+size,vals);
args = new INMOST_DATA_REAL_TYPE[size]; args = new INMOST_DATA_REAL_TYPE[size];
std::copy(other.args,other.args+size,args); memcpy(args,other.args,sizeof(INMOST_DATA_REAL_TYPE)*size);
//std::copy(other.args,other.args+size,args);
return * this; return * this;
} }
~keyval_table() ~keyval_table()
......
...@@ -1240,6 +1240,7 @@ namespace INMOST ...@@ -1240,6 +1240,7 @@ namespace INMOST
ElementType have_global_id; ElementType have_global_id;
INMOST_DATA_BIG_ENUM_TYPE parallel_mesh_unique_id; INMOST_DATA_BIG_ENUM_TYPE parallel_mesh_unique_id;
INMOST_MPI_Comm comm; INMOST_MPI_Comm comm;
//INMOST_MPI_Group group;
Tag tag_shared; Tag tag_shared;
Tag tag_owner; Tag tag_owner;
Tag tag_processors; Tag tag_processors;
...@@ -2355,6 +2356,8 @@ namespace INMOST ...@@ -2355,6 +2356,8 @@ namespace INMOST
int GetProcessorsNumber(); int GetProcessorsNumber();
/// Retrieve MPI communicator /// Retrieve MPI communicator
INMOST_MPI_Comm GetCommunicator (); INMOST_MPI_Comm GetCommunicator ();
/// Retrieve MPI group corresponding to the communicator
INMOST_MPI_Group GetGroup ();
/// Set MPI communicator /// Set MPI communicator
void SetCommunicator (INMOST_MPI_Comm _comm); void SetCommunicator (INMOST_MPI_Comm _comm);
void ResolveShared (); void ResolveShared ();
......
...@@ -349,7 +349,7 @@ namespace INMOST ...@@ -349,7 +349,7 @@ namespace INMOST
const INMOST_DATA_REAL_TYPE * operator ->() const {return &(*LinkedList)[pos].second;} const INMOST_DATA_REAL_TYPE * operator ->() const {return &(*LinkedList)[pos].second;}
iterator & operator ++(){ pos = (*LinkedList)[pos].first; return *this;} iterator & operator ++(){ pos = (*LinkedList)[pos].first; return *this;}
iterator operator ++(int){ iterator ret(LinkedList); ret.pos = (*LinkedList)[pos].first; return ret; } iterator operator ++(int){ iterator ret(LinkedList); ret.pos = (*LinkedList)[pos].first; return ret; }
iterator & operator = (const iterator & other) {LinkedList = other.LinkedList; pos = other.pos;} iterator & operator = (const iterator & other) {LinkedList = other.LinkedList; pos = other.pos; return *this;}
bool operator ==(const iterator & other) const {return LinkedList == other.LinkedList && pos == other.pos;} bool operator ==(const iterator & other) const {return LinkedList == other.LinkedList && pos == other.pos;}
bool operator !=(const iterator & other) const {return LinkedList != other.LinkedList || pos != other.pos;} bool operator !=(const iterator & other) const {return LinkedList != other.LinkedList || pos != other.pos;}
bool operator < (const iterator & other) const {return LinkedList == other.LinkedList && pos < other.pos;} bool operator < (const iterator & other) const {return LinkedList == other.LinkedList && pos < other.pos;}
......
...@@ -156,6 +156,7 @@ namespace INMOST ...@@ -156,6 +156,7 @@ namespace INMOST
virtual void GetVariation(const Storage & e, Sparse::Row & r) const = 0; virtual void GetVariation(const Storage & e, Sparse::Row & r) const = 0;
virtual void GetVariation(const Storage & e, Sparse::RowMerger & r) const = 0; virtual void GetVariation(const Storage & e, Sparse::RowMerger & r) const = 0;
virtual abstract_dynamic_variable * Copy() const = 0; virtual abstract_dynamic_variable * Copy() const = 0;
virtual ~abstract_dynamic_variable() {}
}; };
template<typename RetType> template<typename RetType>
...@@ -210,6 +211,7 @@ namespace INMOST ...@@ -210,6 +211,7 @@ namespace INMOST
virtual void GetVariation(const Storage & e, Sparse::Row & r) const = 0; virtual void GetVariation(const Storage & e, Sparse::Row & r) const = 0;
virtual void GetVariation(const Storage & e, Sparse::RowMerger & r) const = 0; virtual void GetVariation(const Storage & e, Sparse::RowMerger & r) const = 0;
virtual abstract_dynamic_variable * Copy() const = 0; virtual abstract_dynamic_variable * Copy() const = 0;
virtual ~basic_dynamic_variable() {}
}; };
template<class VariableType, class Derived> template<class VariableType, class Derived>
......
...@@ -134,7 +134,7 @@ namespace INMOST ...@@ -134,7 +134,7 @@ namespace INMOST
template<typename float_type> template<typename float_type>
fType convert_bytes_to_float(unsigned char * fbytes, unsigned char size, fByteOrder forder) fType convert_bytes_to_float(unsigned char * fbytes, unsigned char size, fByteOrder forder)
{ {
float_type ret; float_type ret = 0;
if( size == 4 ) if( size == 4 )
{ {
unsigned char S; int E; unsigned long F; unsigned char S; int E; unsigned long F;
...@@ -187,7 +187,7 @@ namespace INMOST ...@@ -187,7 +187,7 @@ namespace INMOST
if ( S == 0 ) F1 = 1.0; if ( S == 0 ) F1 = 1.0;
else F1 = -1.0; else F1 = -1.0;
if ( 0 < E ) ret = F1 * ( C + M ) * ::pow ( A, E - B ) ; if ( 0 < E ) ret = F1 * ( C + M ) * ::pow ( A, E - B ) ;
else if ( E == 0 && S == 0 ) ret = 0; else if ( E == 0 && S == 0 ) ret = 0;
else if ( E == 0 && S == 1 ) ret = 0; // reserved else if ( E == 0 && S == 1 ) ret = 0; // reserved
break; break;
default: throw "not implemented"; default: throw "not implemented";
...@@ -241,9 +241,14 @@ namespace INMOST ...@@ -241,9 +241,14 @@ namespace INMOST
if ( S == 0 && E == 0 && M == 0 ) ret = 0; if ( S == 0 && E == 0 && M == 0 ) ret = 0;
else ret = F1 * M * ::pow ( A, E - B ); else ret = F1 * M * ::pow ( A, E - B );
break; break;
default: throw "not implemented"; default: throw NotImplemented;
} }
} }
else
{
std::cout << "Converter for float of size " << size << " do not exist" << std::endl;
throw NotImplemented;
}
return static_cast<fType>(ret); return static_cast<fType>(ret);
} }
fType load_fp_test_bytes(const char * bytes, unsigned char size) fType load_fp_test_bytes(const char * bytes, unsigned char size)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
namespace INMOST namespace INMOST
{ {
typedef char HeaderType; typedef char HeaderType;
const HeaderType EndOfData = 0x01; //const HeaderType EndOfData = 0x01;
const HeaderType NodeHeader = 0x02; const HeaderType NodeHeader = 0x02;
const HeaderType EdgeHeader = 0x03; const HeaderType EdgeHeader = 0x03;
const HeaderType FaceHeader = 0x04; const HeaderType FaceHeader = 0x04;
......
...@@ -251,7 +251,7 @@ class XMLReader ...@@ -251,7 +251,7 @@ class XMLReader
} }
double Evaluate(std::string & str) double Evaluate(std::string & str)
{ {
const char * debug_str = str.c_str(); //const char * debug_str = str.c_str();
std::vector<std::string> decompose = Expand(str); std::vector<std::string> decompose = Expand(str);
std::vector<std::string> polish = MakePolish(decompose); std::vector<std::string> polish = MakePolish(decompose);
//Print(polish); //Print(polish);
...@@ -551,6 +551,7 @@ public: ...@@ -551,6 +551,7 @@ public:
break; break;
case EndOfFile: Report("Unexpected end of file while reading XML tag name"); done = true; break; case EndOfFile: Report("Unexpected end of file while reading XML tag name"); done = true; break;
case Failure: Report("Unrecoverable error while reading XML tag name"); done = true; break; case Failure: Report("Unrecoverable error while reading XML tag name"); done = true; break;
default: Report("Unexpected state %s",StateName(_state).c_str()); done = true; break;
} }
} }
if( verbose ) Report("info: opened tag %s",ret.c_str()); if( verbose ) Report("info: opened tag %s",ret.c_str());
...@@ -589,7 +590,6 @@ public: ...@@ -589,7 +590,6 @@ public:
std::string name; std::string name;
bool done = false; bool done = false;
char c; char c;
int inner_state = 0;
if( !(_state == Intro || _state == ReadCloseTagSlash) ) if( !(_state == Intro || _state == ReadCloseTagSlash) )
{ {
Report("Cannot read finish tag from state %s",StateName(_state).c_str()); Report("Cannot read finish tag from state %s",StateName(_state).c_str());
...@@ -644,6 +644,8 @@ public: ...@@ -644,6 +644,8 @@ public:
case Failure: case Failure:
Report("Unexpected failure while searching for </%s>",TagName.c_str()); Report("Unexpected failure while searching for </%s>",TagName.c_str());
return false; return false;
default: Report("Unexpected state %s",StateName(_state).c_str()); return false;
} }
} }
if( verbose ) Report("info: finished tag %s",name.c_str()); if( verbose ) Report("info: finished tag %s",name.c_str());
...@@ -725,6 +727,7 @@ public: ...@@ -725,6 +727,7 @@ public:
Report("Unexpected failure while reading attribute name"); Report("Unexpected failure while reading attribute name");
done = true; done = true;
break; break;
default: Report("Unexpected state %s",StateName(_state).c_str()); done = true; break;
} }
} }
if( verbose ) Report("info: attribute name %s",ret.c_str()); if( verbose ) Report("info: attribute name %s",ret.c_str());
...@@ -799,6 +802,7 @@ public: ...@@ -799,6 +802,7 @@ public:
Report("Unexpected failure while reading attribute name"); Report("Unexpected failure while reading attribute name");
done = true; done = true;
break; break;
default: Report("Unexpected state %s",StateName(_state).c_str()); done = true; break;
} }
} }
if( verbose ) Report("info: attribute value %s",ret.c_str()); if( verbose ) Report("info: attribute value %s",ret.c_str());
...@@ -869,9 +873,6 @@ public: ...@@ -869,9 +873,6 @@ public:
std::string ret; std::string ret;
char c; char c;
bool done = false; bool done = false;
bool vector = false;
bool multpart = false;
bool quotes = false;
int testend = 0; int testend = 0;
if( _state == EndContents ) return ""; if( _state == EndContents ) return "";
if( _state != WaitContents ) if( _state != WaitContents )
...@@ -999,6 +1000,7 @@ public: ...@@ -999,6 +1000,7 @@ public:
Report("Unexpected failure while reading attribute name"); Report("Unexpected failure while reading attribute name");
done = true; done = true;
break; break;
default: Report("Unexpected state %s",StateName(_state).c_str()); done = true; break;
} }
} }
return ret; return ret;
...@@ -1907,7 +1909,7 @@ namespace INMOST ...@@ -1907,7 +1909,7 @@ namespace INMOST
if( matchsets && nsets != nsets_read ) reader.Report("Number %d of XML tags Set read do not match to the number %d specified",nsets_read,nsets); if( matchsets && nsets != nsets_read ) reader.Report("Number %d of XML tags Set read do not match to the number %d specified",nsets_read,nsets);
//correct links between sets //correct links between sets
for(int q = 0; q < new_sets.size(); ++q) for(int q = 0; q < (int)new_sets.size(); ++q)
{ {
Element::adj_type & lc = HighConn(new_sets[q]); Element::adj_type & lc = HighConn(new_sets[q]);
for(Element::adj_type::iterator jt = lc.begin(); jt != lc.end(); ++jt) for(Element::adj_type::iterator jt = lc.begin(); jt != lc.end(); ++jt)
...@@ -1997,10 +1999,6 @@ namespace INMOST ...@@ -1997,10 +1999,6 @@ namespace INMOST
HandleType * set_elems = NULL, *it = NULL; HandleType * set_elems = NULL, *it = NULL;
enumerator set_size = 0; enumerator set_size = 0;
const char * debug_setname = setname.c_str();
const char * debug_tagname = tagname.c_str();
if( setname != "" ) if( setname != "" )
{ {
if( etype != NONE ) reader.Report("Warning: SetType should be SetData for data specified for set."); if( etype != NONE ) reader.Report("Warning: SetType should be SetData for data specified for set.");
...@@ -2051,7 +2049,6 @@ namespace INMOST ...@@ -2051,7 +2049,6 @@ namespace INMOST
it = set_elems + atoi(val.c_str()); it = set_elems + atoi(val.c_str());
val = reader.GetContentsWord(); val = reader.GetContentsWord();
} }
const char * debug_val2 = val.c_str();
switch(t.GetDataType()) switch(t.GetDataType())
{ {
case DATA_REAL: case DATA_REAL:
...@@ -2074,7 +2071,7 @@ namespace INMOST ...@@ -2074,7 +2071,7 @@ namespace INMOST
if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 ) if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 )
{ {
++it; ++it;
if( it-set_elems < set_size ) data = RealArray(*it,t); if( ((int)(it-set_elems)) < (int)set_size ) data = RealArray(*it,t);
} }
} }
} }
...@@ -2099,7 +2096,7 @@ namespace INMOST ...@@ -2099,7 +2096,7 @@ namespace INMOST
if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 ) if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 )
{ {
++it; ++it;
if( it-set_elems < set_size ) data = IntegerArray(*it,t); if( ((int)(it-set_elems)) < (int)set_size ) data = IntegerArray(*it,t);
} }
} }
} }
...@@ -2124,7 +2121,7 @@ namespace INMOST ...@@ -2124,7 +2121,7 @@ namespace INMOST
if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 ) if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 )
{ {
++it; ++it;
if( it-set_elems < set_size ) data = BulkArray(*it,t); if( ((int)(it-set_elems)) < (int)set_size ) data = BulkArray(*it,t);
} }
} }
} }
...@@ -2149,7 +2146,7 @@ namespace INMOST ...@@ -2149,7 +2146,7 @@ namespace INMOST
if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 ) if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 )
{ {
++it; ++it;
if( it-set_elems < set_size ) data = ReferenceArray(*it,t); if( ((int)(it-set_elems)) < (int)set_size ) data = ReferenceArray(*it,t);
} }
} }
} }
...@@ -2177,7 +2174,7 @@ namespace INMOST ...@@ -2177,7 +2174,7 @@ namespace INMOST
if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 ) if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 )
{ {
++it; ++it;
if( it-set_elems < set_size ) data = RemoteReferenceArray(*it,t); if( ((int)(it-set_elems)) < (int)set_size ) data = RemoteReferenceArray(*it,t);
} }
} }
} }
...@@ -2203,7 +2200,7 @@ namespace INMOST ...@@ -2203,7 +2200,7 @@ namespace INMOST
if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 ) if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 )
{ {
++it; ++it;
if( it-set_elems < set_size ) data = RemoteReferenceArray(*it,t); if( ((int)(it-set_elems)) < (int)set_size ) data = RemoteReferenceArray(*it,t);
} }
} }
} }
...@@ -2230,7 +2227,7 @@ namespace INMOST ...@@ -2230,7 +2227,7 @@ namespace INMOST
if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 ) if( !sparse_read && t.GetSize() != ENUMUNDEF && (q + l*((int)Vector.size())+1)%t.GetSize() == 0 )
{ {
++it; ++it;
if( it-set_elems < set_size ) data = VariableArray(*it,t); if( ((int)(it-set_elems)) < (int)set_size ) data = VariableArray(*it,t);
} }
}