Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mondriaan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bisseling, R.H. (Rob)
mondriaan
Commits
9bcc79dc
Commit
9bcc79dc
authored
7 years ago
by
Marco van Oort
Browse files
Options
Downloads
Patches
Plain Diff
Only apply upper bound algorithm when it is applicable
parent
f7fc55be
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/DistributeMat.c
+21
-12
21 additions, 12 deletions
src/DistributeMat.c
src/DistributeMat.h
+2
-0
2 additions, 0 deletions
src/DistributeMat.h
src/SplitMatrixUpperBound.c
+4
-0
4 additions, 0 deletions
src/SplitMatrixUpperBound.c
src/SplitMatrixUpperBound.h
+5
-0
5 additions, 0 deletions
src/SplitMatrixUpperBound.h
with
32 additions
and
12 deletions
src/DistributeMat.c
+
21
−
12
View file @
9bcc79dc
#include
"DistributeMat.h"
#include
"Permute.h"
#include
"FreeNonzeros.h"
#include
"SplitMatrixUpperBound.h"
#ifdef USE_PATOH
#include
<patoh.h>
...
...
@@ -684,20 +682,31 @@ int DistributeMatrixMondriaan(struct sparsematrix *pT, int P, double eps, const
#endif
if
(
pOptions
->
CheckUpperBound
==
CheckUpperBoundYes
)
{
/* C
ompute volume. It should be at most (min(m,n)+1)(P-1)
*/
long
ComVol1
,
ComVol2
,
tmp
;
CalcCom
(
pT
,
NULL
,
(
pT
->
m
<
pT
->
n
)
?
ROW
:
COL
,
&
ComVol1
,
&
tmp
,
&
tmp
,
&
tmp
,
&
tmp
);
CalcCom
(
pT
,
NULL
,
(
pT
->
m
<
pT
->
n
)
?
COL
:
ROW
,
&
ComVol2
,
&
tmp
,
&
tmp
,
&
tmp
,
&
tmp
);
long
upperBoun
d
=
((
(
pT
->
m
<
pT
->
n
)
?
pT
->
m
:
pT
->
n
)
+
1
)
*
(
P
-
1
);
/* C
heck whether we can apply the upper bound algorithm
*/
int
isSymmetric
=
((
pT
->
MMTypeCode
[
3
]
==
'S'
||
pT
->
MMTypeCode
[
3
]
==
'K'
||
pT
->
MMTypeCode
[
3
]
==
'H'
)
&&
pOptions
->
SymmetricMatrix_UseSingleEntry
==
SingleEntYes
);
int
hasDummies
=
(
pT
->
NrDummies
>
0
);
int
isColWeighte
d
=
(
pT
->
MMTypeCode
[
0
]
==
'W'
&&
pT
->
NrColWeights
>
0
);
if
(
ComVol1
+
ComVol2
>
upperBound
)
{
/* To support OrderPermutation, new code should be written to recompute the permutation from scratch */
int
orderPermute
=
(
pOptions
->
OrderPermutation
!=
OrderNone
);
if
(
!
isSymmetric
&&
!
hasDummies
&&
!
isColWeighted
&&
!
orderPermute
)
{
/* Compute volume. It should be at most (min(m,n)+1)(P-1) */
long
ComVol1
,
ComVol2
,
tmp
;
CalcCom
(
pT
,
NULL
,
(
pT
->
m
<
pT
->
n
)
?
ROW
:
COL
,
&
ComVol1
,
&
tmp
,
&
tmp
,
&
tmp
,
&
tmp
);
CalcCom
(
pT
,
NULL
,
(
pT
->
m
<
pT
->
n
)
?
COL
:
ROW
,
&
ComVol2
,
&
tmp
,
&
tmp
,
&
tmp
,
&
tmp
);
long
upperBound
=
(((
pT
->
m
<
pT
->
n
)
?
pT
->
m
:
pT
->
n
)
+
1
)
*
(
P
-
1
);
if
(
ComVol1
+
ComVol2
>
upperBound
)
{
#ifdef INFO
printf
(
"Info: Achieved volume %ld is larger than upper bound %ld. Attempting to generate upper bound solution.
\n
"
,
ComVol1
+
ComVol2
,
upperBound
);
printf
(
"Info: Achieved volume %ld is larger than upper bound %ld. Attempting to generate upper bound solution.
\n
"
,
ComVol1
+
ComVol2
,
upperBound
);
#endif
if
(
!
SplitMatrixUpperBound
(
pT
,
P
,
pOptions
))
{
fprintf
(
stderr
,
"DistributeMatrixMondriaan(): Unable to compute upper bound solution!
\n
"
);
if
(
!
SplitMatrixUpperBound
(
pT
,
P
,
pOptions
))
{
fprintf
(
stderr
,
"DistributeMatrixMondriaan(): Unable to compute upper bound solution!
\n
"
);
}
k
=
P
;
}
k
=
P
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/DistributeMat.h
+
2
−
0
View file @
9bcc79dc
...
...
@@ -8,6 +8,8 @@
#include
"SparseMatrix.h"
#include
"Remembrance.h"
#include
"ZeroVolumeSearch.h"
#include
"FreeNonzeros.h"
#include
"SplitMatrixUpperBound.h"
/* Function declarations for DistributeMat.c */
long
ComputeWeight
(
const
struct
sparsematrix
*
pT
,
long
lo
,
long
hi
,
long
*
wnz
,
const
struct
opts
*
pOptions
);
...
...
This diff is collapsed.
Click to expand it.
src/SplitMatrixUpperBound.c
+
4
−
0
View file @
9bcc79dc
...
...
@@ -414,6 +414,10 @@ int SplitMatrixUpperBound(struct sparsematrix *pT, int P, const struct opts *pOp
}
#endif
/* Compute new lambdas */
InitNprocs
(
pT
,
COL
,
pT
->
RowLambda
);
InitNprocs
(
pT
,
ROW
,
pT
->
ColLambda
);
return
TRUE
;
}
/* end SplitMatrixUpperBound */
...
...
This diff is collapsed.
Click to expand it.
src/SplitMatrixUpperBound.h
+
5
−
0
View file @
9bcc79dc
#ifndef __SplitMatrixUpperBound_h__
#define __SplitMatrixUpperBound_h__
#include
"Heap.h"
#include
"DistributeVecLib.h"
int
SplitMatrixUpperBound
(
struct
sparsematrix
*
pT
,
int
P
,
const
struct
opts
*
pOptions
);
int
CheckUpperBoundSolution
(
struct
sparsematrix
*
pT
);
#endif
/* __SplitMatrixUpperBound_h__ */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment