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
b18a77f8
Commit
b18a77f8
authored
Nov 20, 2014
by
Yiannis Tsiouris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a few more warnings
parent
627fc2cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
Credit.hs
Credit.hs
+2
-0
MasterWorker.hs
MasterWorker.hs
+1
-0
No files found.
Credit.hs
View file @
b18a77f8
...
...
@@ -45,6 +45,7 @@ credit c1 c2 = foldl (flip credit_atomic) c2 c1
-- represented by K' and C' equals the credit represented by C.
-- Precondition: C must represent non-zero credit.
debit_atomic
::
Credit
->
(
ACredit
,
Credit
)
debit_atomic
[]
=
error
"Credit [] is not valid."
debit_atomic
(
c
:
cs
)
=
(
c
,
cs
)
-- debit smallest unit of credit
-- debit_atomic_nz(C) returns a pair {K',C'} where K' is an integer
...
...
@@ -53,6 +54,7 @@ debit_atomic (c : cs) = (c, cs) -- debit smallest unit of credit
-- represented by K' and C' equals the credit represented by C.
-- Precondition: C must represent non-zero credit.
debit_atomic_nz
::
Credit
->
(
ACredit
,
Credit
)
debit_atomic_nz
[]
=
error
"Credit [] is not valid."
debit_atomic_nz
[
c
]
=
(
c
+
1
,
[
c
+
1
])
-- debit half the credit
debit_atomic_nz
(
c
:
cs
)
=
(
c
,
cs
)
-- debit smallest unit of credit;
-- case only applies if Cs non-empty
...
...
MasterWorker.hs
View file @
b18a77f8
...
...
@@ -299,6 +299,7 @@ hash_vertex staticMachConf x = global_to_local_slot workers globalSlot
-- Note: This procedure is horribly inefficient (linear in size of Workers);
-- it should be log (size of Workers) at most.
global_to_local_slot
::
[(
ProcessId
,
Int
,
Int
)]
->
Int
->
(
ProcessId
,
Int
)
global_to_local_slot
[]
_
=
error
"global_to_local_slot cannot work on [] workers."
global_to_local_slot
((
pid
,
_
,
tabSize
)
:
workers
)
globSlot
|
globSlot
<
tabSize
=
(
pid
,
globSlot
)
|
otherwise
=
global_to_local_slot
workers
(
globSlot
-
tabSize
)
...
...
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