# How do I figure out where things went wrong in this parallel code?

**URL:** <https://discourse.julialang.org/t/how-do-i-figure-out-where-things-went-wrong-in-this-parallel-code/3462>\
**Category:** General Usage\
**Tags:** question, debug, parallel\
**Created:** [May 1, 2017, 5:14pm UTC](https://discourse.julialang.org/t/how-do-i-figure-out-where-things-went-wrong-in-this-parallel-code/3462 "2017-05-01T17:14:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [May 1, 2017, 5:14pm UTC](https://discourse.julialang.org/t/how-do-i-figure-out-where-things-went-wrong-in-this-parallel-code/3462/1 "2017-05-01T17:14:25Z")

</div>

I have the following code (simplified) that I run in a `julia -p 4` REPL:

```julia
println("computing betweenness centrality - method1")
rbc1 = @spawn betweenness_centrality(g, ...)

println("computing betweenness centrality - method2")
rbc2 = @spawn betweenness_centrality(g, ...) # some other set of params

...

bc1 = fetch(rbc1)
bc2 = fetch(rbc2)

```

and in the middle of this, I get

```julia
julia> cdict = compute_centralities("myfile.csv");
computing betweenness centrality - method1
computing betweenness centrality - method2
fatal error on
julia> 

```

That’s it. No other error text. During the computation I see expected the CPU load, and I’m not running out of memory. The code runs fine serially (but it takes a long time, which is why I’d like to parallelize it).

How do I troubleshoot this?

Edited to add:

```julia
Julia Version 0.6.0-pre.beta.325
Commit 6e0a2f8c94 (2017-04-25 14:57 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin16.5.0)
  CPU: Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, skylake)

```

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 1, 2017, 5:36pm UTC](https://discourse.julialang.org/t/how-do-i-figure-out-where-things-went-wrong-in-this-parallel-code/3462/2 "2017-05-01T17:36:27Z")

</div>

Can you post a link to the code that is called?

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [May 1, 2017, 6:07pm UTC](https://discourse.julialang.org/t/how-do-i-figure-out-where-things-went-wrong-in-this-parallel-code/3462/3 "2017-05-01T18:07:13Z")

</div>

The betweenness centrality? It’s standard [LightGraphs](https://github.com/JuliaGraphs/LightGraphs.jl/blob/master/src/centrality/betweenness.jl).

---

<div class="post-metadata">

**Author:** ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)\
**Post date:** [May 3, 2017, 3:06pm UTC](https://discourse.julialang.org/t/how-do-i-figure-out-where-things-went-wrong-in-this-parallel-code/3462/4 "2017-05-03T15:06:30Z")

</div>

Do you get the full output if you don’t run the code in the repl?

One alternative is to attach gdb to the started processes (or even better `rr` from mozilla) to see what happens.
