# Issue with nested pmap

**URL:** https://discourse.julialang.org/t/issue-with-nested-pmap/25129
**Category:** Julia at Scale
**Tags:** bug, pmap
**Created:** [June 10, 2019, 7:49pm UTC](https://discourse.julialang.org/t/issue-with-nested-pmap/25129 "2019-06-10T19:49:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![abx](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@abx](https://discourse.julialang.org/u/abx)
#### Post date: [June 10, 2019, 7:49pm UTC](https://discourse.julialang.org/t/issue-with-nested-pmap/25129/1 "2019-06-10T19:49:25Z")

</div>

Hello, I have this script running in Julia 1.1.  
If I run it withing a single process (no workers added) everything works fine. If I add process (e.g. _addprocs(3)_) nothing gets run and the execution hangs indefinitely

```julia
using Distributed
@everywhere function inner_process(task_id)
    task_id^2
end

@everywhere function outer_process(job_id)
    inner_task = collect(1:2)
    pmap(inner_process, inner_task)
end

function do_job(jobs_list) 
    pmap(outer_process, jobs_list)
end

jobs_list = collect(1:10)
do_job(jobs_list)

```

Is that the expected behavior? Are _pmaps_ not meant to be nested?

Thanks

---

<div class="post-metadata">

### Author: ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)
#### Post date: [June 10, 2019, 9:32pm UTC](https://discourse.julialang.org/t/issue-with-nested-pmap/25129/2 "2019-06-10T21:32:48Z")

</div>

This also gets stuck with just 1 worker process (`addprocs(1)`).

I didn’t find any obviously related issues on the Julia Github, so feel free to file one. I definitely don’t see why nested `pmap` shouldn’t work.

---

<div class="post-metadata">

### Author: ![abx](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@abx](https://discourse.julialang.org/u/abx)
#### Post date: [June 11, 2019, 1:55pm UTC](https://discourse.julialang.org/t/issue-with-nested-pmap/25129/3 "2019-06-11T13:55:03Z")

</div>

Thanks @jpsamaroo, I opened a ticket as your recommended.  
[https://github.com/JuliaLang/julia/issues/32293](https://github.com/JuliaLang/julia/issues/32293)
