Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-orbit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Katerina Roukounaki
cloud-orbit
Commits
ba44da05
Commit
ba44da05
authored
Jan 12, 2015
by
Nikolaos S. Papaspyrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memory leaks in the parallel version
parent
68e478fb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
+16
-12
Bench.hs
Bench.hs
+3
-3
MasterWorker.hs
MasterWorker.hs
+12
-8
Table.hs
Table.hs
+1
-1
No files found.
Bench.hs
View file @
ba44da05
...
@@ -77,9 +77,9 @@ select_dist_bench "False" = dist False
...
@@ -77,9 +77,9 @@ select_dist_bench "False" = dist False
select_dist_bench
_
=
error
"Invalid IWP Flag"
select_dist_bench
_
=
error
"Invalid IWP Flag"
bench_args
::
String
->
(
Vertex
->
GenClos
,
Int
)
bench_args
::
String
->
(
Vertex
->
GenClos
,
Int
)
bench_args
"short"
=
(
gg13
,
11
)
bench_args
"short"
=
(
gg13
,
11
000
)
bench_args
"intermediate"
=
(
gg124
,
157
)
bench_args
"intermediate"
=
(
gg124
,
157
000
)
bench_args
"long"
=
(
gg1245
,
157
)
bench_args
"long"
=
(
gg1245
,
157
0000
)
bench_args
_
=
error
"Invalid Version"
bench_args
_
=
error
"Invalid Version"
main
::
IO
()
main
::
IO
()
...
...
MasterWorker.hs
View file @
ba44da05
...
@@ -162,6 +162,17 @@ vertex_server staticMachConf crdt table statData = do
...
@@ -162,6 +162,17 @@ vertex_server staticMachConf crdt table statData = do
r
<-
receiveTimeout
idleTimeout
[
r
<-
receiveTimeout
idleTimeout
[
match
$
\
(
"vertex"
,
x
,
slot
,
k
)
->
do
match
$
\
(
"vertex"
,
x
,
slot
,
k
)
->
do
-- say $ "Got a vertex!"
-- say $ "Got a vertex!"
return
$
Just
(
x
,
slot
,
k
)
,
match
$
\
(
"dump"
)
->
do
return
$
Nothing
]
case
r
of
Nothing
->
do
let
creditRetd
=
credit_retd
statData
newCreditRetd
<-
return_credit
staticMachConf
crdt
creditRetd
let
newStatData
=
statData
{
credit_retd
=
newCreditRetd
}
vertex_server
staticMachConf
zero
table
newStatData
Just
msg
->
case
msg
of
Just
(
x
,
slot
,
k
)
->
do
let
creditPlusK
=
credit_atomic
k
crdt
let
creditPlusK
=
credit_atomic
k
crdt
nowTime
=
now
nowTime
=
now
vertsRecvd
=
verts_recvd
statData
vertsRecvd
=
verts_recvd
statData
...
@@ -179,19 +190,12 @@ vertex_server staticMachConf crdt table statData = do
...
@@ -179,19 +190,12 @@ vertex_server staticMachConf crdt table statData = do
else
newStatData0
{
max_idle
=
max
maxIdle
(
nowTime
-
lastEvent
)}
else
newStatData0
{
max_idle
=
max
maxIdle
(
nowTime
-
lastEvent
)}
newStatData
=
newStatData1
{
last_event
=
now
}
newStatData
=
newStatData1
{
last_event
=
now
}
vertex_server
staticMachConf
newCredit
newTable
newStatData
vertex_server
staticMachConf
newCredit
newTable
newStatData
,
match
$
\
(
"dump"
)
->
do
Nothing
->
do
let
nowTime
=
now
let
nowTime
=
now
lastEvent
=
last_event
statData
lastEvent
=
last_event
statData
newStatData
=
statData
{
tail_idle
=
nowTime
-
lastEvent
,
newStatData
=
statData
{
tail_idle
=
nowTime
-
lastEvent
,
last_event
=
now
}
last_event
=
now
}
dump_table
staticMachConf
table
newStatData
dump_table
staticMachConf
table
newStatData
]
case
r
of
Nothing
->
do
let
creditRetd
=
credit_retd
statData
newCreditRetd
<-
return_credit
staticMachConf
crdt
creditRetd
let
newStatData
=
statData
{
credit_retd
=
newCreditRetd
}
vertex_server
staticMachConf
zero
table
newStatData
Just
_
->
return
()
-- handle_vertex checks whether vertex X is stored in Slot of Table;
-- handle_vertex checks whether vertex X is stored in Slot of Table;
-- if not, it is in inserted there and the images of the generators
-- if not, it is in inserted there and the images of the generators
...
...
Table.hs
View file @
ba44da05
...
@@ -129,7 +129,7 @@ freq_from_stat stat =
...
@@ -129,7 +129,7 @@ freq_from_stat stat =
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- auxiliary functions
-- auxiliary functions
inc
::
Int
->
Array
Int
Int
->
Array
Int
Int
inc
::
Int
->
Array
Int
Int
->
Array
Int
Int
inc
i
t
=
t
//
[(
i
,
t
!
i
+
1
)]
inc
i
t
=
t
!
i
`
seq
`
t
//
[(
i
,
t
!
i
+
1
)]
fi
::
(
Integral
a
,
Num
b
)
=>
a
->
b
fi
::
(
Integral
a
,
Num
b
)
=>
a
->
b
fi
=
fromIntegral
fi
=
fromIntegral
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