Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kirill Terekhov
INMOST
Commits
f531fdce
Commit
f531fdce
authored
Aug 05, 2014
by
Kirill Terekhov
Browse files
sync some fixes
Fix crush - not properly freeing communicators.
parent
406385c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
solver.cpp
View file @
f531fdce
...
...
@@ -66,7 +66,14 @@ namespace INMOST
INMOST_DATA_ENUM_TYPE
mbeg
,
mend
;
int
initial_rank
;
#if defined(USE_MPI)
MPI_Comm_dup
(
m
.
GetCommunicator
(),
&
comm
);
if
(
comm
!=
INMOST_MPI_COMM_WORLD
)
{
MPI_Comm_free
(
&
comm
);
comm
=
INMOST_MPI_COMM_WORLD
;
}
if
(
m
.
GetCommunicator
()
==
INMOST_MPI_COMM_WORLD
)
comm
=
INMOST_MPI_COMM_WORLD
;
else
MPI_Comm_dup
(
m
.
GetCommunicator
(),
&
comm
);
MPI_Comm_rank
(
comm
,
&
rank
);
MPI_Comm_size
(
comm
,
&
size
);
#else
...
...
@@ -548,7 +555,9 @@ namespace INMOST
extended_indexes
(
other
.
extended_indexes
)
{
#if defined(USE_MPI)
MPI_Comm_dup
(
other
.
comm
,
&
comm
);
if
(
other
.
comm
==
INMOST_MPI_COMM_WORLD
)
comm
=
INMOST_MPI_COMM_WORLD
;
else
MPI_Comm_dup
(
other
.
comm
,
&
comm
);
#else
comm
=
other
.
comm
;
#endif
...
...
@@ -570,7 +579,9 @@ namespace INMOST
Solver
::
OrderInfo
&
Solver
::
OrderInfo
::
operator
=
(
OrderInfo
const
&
other
)
{
#if defined(USE_MPI)
MPI_Comm_dup
(
other
.
comm
,
&
comm
);
if
(
other
.
comm
==
INMOST_MPI_COMM_WORLD
)
comm
=
INMOST_MPI_COMM_WORLD
;
else
MPI_Comm_dup
(
other
.
comm
,
&
comm
);
#else
comm
=
other
.
comm
;
#endif
...
...
solver_ddpqiluc2.hpp
View file @
f531fdce
...
...
@@ -2042,7 +2042,7 @@ public:
while
(
Ui
!=
EOL
)
{
//drop values
if
(
fabs
(
temp
[
Ui
])
/
Smax
>
std
::
m
in
(
tau2
,
std
::
min
(
tau
/
NuU
,
tau
/
NuL
))
*
Smax
/
Snorm
)
if
(
fabs
(
temp
[
Ui
])
/
Smax
>
std
::
m
ax
(
tau2
,
std
::
min
(
tau
/
NuU
,
tau
/
NuL
))
*
Smax
/
Snorm
)
//if( fabs(temp[Ui]) > tau * Smax )// Snorm)
S_Entries
.
push_back
(
Solver
::
Row
::
entry
(
Ui
,
temp
[
Ui
]));
Ui
=
Ulist
[
Ui
];
...
...
@@ -2109,14 +2109,14 @@ public:
/////////// DENSE FACTORIZATION ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
tt
=
Timer
();
/*
if
((
1.0
*
nzA
/
((
wend
-
wbeg
)
*
(
wend
-
wbeg
)))
>
0.75
&&
(
1.0
*
(
wend
-
wbeg
))
/
(
1.0
*
(
moend
-
mobeg
))
>
0.1
)
{
std
::
cout
<<
"Try to sparsify schur complement!!!"
<<
std
::
endl
;
std
::
cout
<<
"Sparsity: "
<<
1.0
*
nzA
/
((
wend
-
wbeg
)
*
(
wend
-
wbeg
))
<<
std
::
endl
;
std
::
cout
<<
"Schur size: "
<<
wend
-
wbeg
<<
" total size: "
<<
moend
-
mobeg
<<
std
::
endl
;
}
*/
if
(
(
wend
-
wbeg
>
0
&&
wend
-
wbeg
<
64
)
||
(
1.0
*
nzA
/
((
wend
-
wbeg
)
*
(
wend
-
wbeg
)))
>
0.75
)
//if ( wend-wbeg > 0 && wend - wbeg < 2 )
{
...
...
@@ -2133,6 +2133,13 @@ public:
//Allocate matrix
INMOST_DATA_ENUM_TYPE
size
=
wend
-
wbeg
;
INMOST_DATA_REAL_TYPE
*
entries
=
new
INMOST_DATA_REAL_TYPE
[
size
*
size
];
if
(
entries
==
NULL
)
{
std
::
cout
<<
__FILE__
<<
":"
<<
__LINE__
<<
" array of size "
<<
size
*
size
<<
" was not allocated "
<<
std
::
endl
;
throw
-
1
;
}
std
::
fill
(
entries
,
entries
+
size
*
size
,
0.0
);
//Fill the matrix
for
(
k
=
wbeg
;
k
<
wend
;
++
k
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment