Commit dfa9db84 authored by Mathieu Faverge's avatar Mathieu Faverge

Add -1 version parser and color fields

parent bf389894
...@@ -22,7 +22,7 @@ int pastix_read_symbol(FILE* stream, symbol_matrix_t* matrix) ...@@ -22,7 +22,7 @@ int pastix_read_symbol(FILE* stream, symbol_matrix_t* matrix)
matrix->m_sndenbr = matrix->m_cblknbr; matrix->m_sndenbr = matrix->m_cblknbr;
if ((result != 5) || if ((result != 5) ||
(versval < 0) || (versval < -1) ||
(versval > 1) || (versval > 1) ||
(matrix->m_bloknbr < matrix->m_cblknbr) || (matrix->m_bloknbr < matrix->m_cblknbr) ||
(nodenbr < matrix->m_cblknbr)) (nodenbr < matrix->m_cblknbr))
...@@ -89,7 +89,21 @@ int pastix_read_symbol(FILE* stream, symbol_matrix_t* matrix) ...@@ -89,7 +89,21 @@ int pastix_read_symbol(FILE* stream, symbol_matrix_t* matrix)
blok->m_localization = 0; blok->m_localization = 0;
blok->m_flags = 0; blok->m_flags = 0;
blok->m_color = -1.f; if (versval == -1) {
int32_t color;
result = pastix_read_int(stream, &color);
if (result != 1)
{
Helper::log(LogStatus::FATAL, "Bad input while reading blok %d color !", bloknum);
return 1;
}
blok->m_color = (float)color;
}
else {
blok->m_color = -1.f;
}
// Compatibility block // Compatibility block
{ {
...@@ -102,6 +116,19 @@ int pastix_read_symbol(FILE* stream, symbol_matrix_t* matrix) ...@@ -102,6 +116,19 @@ int pastix_read_symbol(FILE* stream, symbol_matrix_t* matrix)
} }
} }
if (versval == -1) {
int32_t maxval;
result = pastix_read_int(stream, &(maxval));
symbol_blok_t *blok = matrix->m_bloktab;
int32_t bloknbr = matrix->m_bloknbr;
for (bloknum = 0; bloknum < bloknbr; ++bloknum, blok++)
{
blok->m_color = blok->m_color / (float)maxval;
}
fprintf(stderr, "Max rank reduction is %d\n", maxval);
}
matrix->m_dof = 1; matrix->m_dof = 1;
matrix->m_colsnbr = nodenbr; matrix->m_colsnbr = nodenbr;
matrix->m_rowsnbr = nodenbr; matrix->m_rowsnbr = nodenbr;
......
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