Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parafib error: MPSC channel size was 512 #105

Closed
lessneek opened this issue Feb 10, 2020 · 3 comments
Closed

parafib error: MPSC channel size was 512 #105

lessneek opened this issue Feb 10, 2020 · 3 comments
Labels
documentation 📖 Improvements or additions to documentation

Comments

@lessneek
Copy link

$ nim -v                          
Nim Compiler Version 1.1.1 [Linux: amd64]
Compiled at 2020-02-08
Copyright (c) 2006-2019 by Andreas Rumpf

active boot switches: -d:release

parafib.nim:

import weave

proc fib(n: int): int =
  # int64 on x86-64
  if n < 2:
    return n

  let x = spawn fib(n-1)
  let y = fib(n-2)

  result = sync(x) + y

proc main() =
  var n = 20

  init(Weave)
  let f = fib(n)
  exit(Weave)

  echo f

main()
nim c --threads:on ./parafib.nim
Error: unhandled exception: ~/.nimble/pkgs/weave-0.1.0/weave/memory/memory_pools.nim(625, 8) `sizeof(ChannelMpscUnboundedBatch[ptr MemBlock]) == 272` MPSC channel size was 512 [AssertionError]
@mratsim
Copy link
Owner

mratsim commented Feb 10, 2020

Works for me on one of the commits from yesterday, will try updating to see if there is a regression.
Was your compiler installed through choosenim?

image

@mratsim
Copy link
Owner

mratsim commented Feb 10, 2020

Recompiled on the latest commit, it still works

image

My guess is that somehow the compiler you compiled on 2020-02-08 was from before:

@mratsim
Copy link
Owner

mratsim commented Feb 10, 2020

Sorry, actually the issue is the following:

  • you are using Weave 0.1.0, it is not compatible with the devel from after commit nim-lang/Nim@abea803
  • You need to install Weave devel as well: nimble install weave@#master for compatibility with the latest Nim devel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📖 Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants