Commit e347bbcb authored by Kirill Terekhov's avatar Kirill Terekhov

Fixes and improvements

Improved automatic finalization of xml tags in debugging files when
execution is halted.
Fixed that internal file format may be read incorrectly.
parent ef8ea957
......@@ -742,6 +742,7 @@ public:
up[0] -= origin[0];
up[1] -= origin[1];
up[2] -= origin[2];
double l = sqrt(right[0]*right[0]+right[1]*right[1]+right[2]*right[2]);
if( l )
{
......@@ -756,8 +757,9 @@ public:
up[1] /= l;
up[2] /= l;
}
const float alpha = 0.0075f;
const float mult = 2.5f;
const float mult = 1.0f;
const float rmult = 0.7f;
//glPointSize(5.0);
glColor4f(0.5f,0.5f,0.5f,alpha);
......@@ -766,7 +768,7 @@ public:
//glBegin(GL_QUADS);
if( interactive )
{
for(int k = 0; k < points.size(); ++k) if( k % 100 == 0 )
for(int k = 0; k < points.size(); ++k) if( k % 100 == 0 )
{
if( visualization_tag.isValid() )
{
......@@ -2990,6 +2992,9 @@ int main(int argc, char ** argv)
mesh = new Mesh();
printf("Started loading mesh.\n");
tt = Timer();
mesh->SetCommunicator(INMOST_MPI_COMM_WORLD);
mesh->SetParallelFileStrategy(0);
mesh->SetParallelStrategy(1);
mesh->SetFileOption("VERBOSITY","2");
if( argc < 2 )
{
......
......@@ -2356,7 +2356,7 @@ namespace INMOST
void Exit ();
int & GetFuncID () {return func_id;}
std::fstream & GetStream ();
std::fstream & WriteTab (std::fstream & f);
std::ostream & WriteTab (std::ostream & f);
void FinalizeFile ();
static void AtExit (void);
#endif
......
......@@ -440,7 +440,7 @@ namespace INMOST
#endif //USE_MPI
#if defined(USE_PARALLEL_WRITE_TIME)
FinalizeFile();
out_time.close();
for(size_t q = 0; q < allocated_meshes.size(); ++q)
if (allocated_meshes[q] == this)
allocated_meshes[q] = NULL;
......
This diff is collapsed.
......@@ -631,7 +631,7 @@ namespace INMOST
#if defined(USE_PARALLEL_WRITE_TIME)
void Mesh::Enter() { tab++; }
void Mesh::Exit() {tab--; }
std::fstream & Mesh::WriteTab(std::fstream & f)
std::ostream & Mesh::WriteTab(std::ostream & f)
{
for(int i = 0; i < tab; i++)
f << " ";
......@@ -643,15 +643,20 @@ namespace INMOST
}
void Mesh::FinalizeFile()
{
if( tab > 1 )
//std::stringstream str;
if( tab > 1 )
{
REPORT_STR("Finalizing file with nonempty function stack - probably due to error.");
out_time << "<TEXT><![CDATA[Died!]]></TEXT>\n";// << std::endl;
}
while(tab > 1)
while(tab > 1)
{
EXIT_FUNC_DIE();
out_time << "<TIME>-1</TIME>\n</FUNCTION>\n";// << std::endl;
Exit();
}
out_time << "</Debug>" << std::endl;
//out_time << str;
//out_time.flush();
out_time.close();
}
#endif //USE_PARALLEL_WRITE_TIME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment