# A couple of questions about pmap

**URL:** https://discourse.julialang.org/t/a-couple-of-questions-about-pmap/8358
**Category:** New to Julia
**Created:** [January 14, 2018, 12:18pm UTC](https://discourse.julialang.org/t/a-couple-of-questions-about-pmap/8358 "2018-01-14T12:18:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![1112](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1112/32/9325_2.png) [@1112](https://discourse.julialang.org/u/1112)
#### Post date: [January 14, 2018, 12:18pm UTC](https://discourse.julialang.org/t/a-couple-of-questions-about-pmap/8358/1 "2018-01-14T12:18:54Z")

</div>

1. How to transfer a double cycle to pmap?  
pmap(myfun, for i in 1:100 for j in 10:120)

2. If pmap does not return the result, does the syntax of the pmap call change?  
pmap(myfun, forend)

---

<div class="post-metadata">

### Author: ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)
#### Post date: [January 14, 2018, 3:10pm UTC](https://discourse.julialang.org/t/a-couple-of-questions-about-pmap/8358/2 "2018-01-14T15:10:18Z")

</div>

1. In v0.6:

```julia
julia> f(x,y) = x-y
f (generic function with 1 method)

julia> @inline f(x) = f(x...)
f (generic function with 2 methods)

julia> pmap(f, ((i,j) for i in 1:5, j in 1:5))
5×5 Array{Int64,2}:
 0 -1 -2 -3 -4
 1 0 -1 -2 -3
 2 1 0 -1 -2
 3 2 1 0 -1
 4 3 2 1 0

```

In v0.7:

```julia
julia> using Distributed

julia> f((x,y)) = x-y
f (generic function with 1 method)

julia> pmap(f, ((i,j) for i in 1:5, j in 1:5))
5×5 Array{Int64,2}:
 0 -1 -2 -3 -4
 1 0 -1 -2 -3
 2 1 0 -1 -2
 3 2 1 0 -1
 4 3 2 1 0

```

1. Not that I know of.

---

<div class="post-metadata">

### Author: ![1112](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1112/32/9325_2.png) [@1112](https://discourse.julialang.org/u/1112)
#### Post date: [January 14, 2018, 3:12pm UTC](https://discourse.julialang.org/t/a-couple-of-questions-about-pmap/8358/3 "2018-01-14T15:12:41Z")

</div>

Thank you!
