# First steps with Dagger

**URL:** <https://discourse.julialang.org/t/first-steps-with-dagger/25739>\
**Category:** Julia at Scale\
**Created:** [June 26, 2019, 6:14pm UTC](https://discourse.julialang.org/t/first-steps-with-dagger/25739 "2019-06-26T18:14:59Z")\
**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 26, 2019, 6:14pm UTC](https://discourse.julialang.org/t/first-steps-with-dagger/25739/1 "2019-06-26T18:14:59Z")

</div>

I am moving my first steps with Dagger.jl and I need some help.  
The following code works fine

```julia
using Dagger
using Distributed
addprocs(4)
@everywhere using Dagger
@everywhere function f(x) 
	println(x)
	x
end

a = delayed(f)(1)
b = delayed(f)(2)
p = delayed(+)(a,b)
r = delayed(f)(3)
s = delayed(f)(4)
t = delayed(+)(p,r,s)

collect(t)
> From worker 4: 3
> From worker 5: 4
> From worker 3: 2
> From worker 2: 1
10

```

However I want to run the different tasks without aggregation function - e.g. in the previous scenario, I want _t_ to be fired whenever _p_, _r_ & _s_ are completed, regardless of their results.

Also, when I try to use compute rather than collect I get this error:

```julia
compute(Context, t)
ERROR: type DataType has no field log_sink
Stacktrace:
 [1] getproperty at .\sysimg.jl:15 [inlined]
 [2] timespan_start(::Type, ::Symbol, ::Int64, ::OSProc) at C:\depot\packages\Dagger\sdZXi\src\lib\logging.jl:121
 [3] compute_dag(::Type, ::Thunk) at C:\depot\packages\Dagger\sdZXi\src\scheduler.jl:24
 [4] compute(::Type, ::Thunk) at C:\depot\packages\Dagger\sdZXi\src\compute.jl:25
 [5] top-level scope at none:0

```

What am I doing wrong?

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 26, 2019, 8:51pm UTC](https://discourse.julialang.org/t/first-steps-with-dagger/25739/2 "2019-06-26T20:51:45Z")

</div>

It’s `Context()`, not `Context` 🙂 You should also just be able to call `compute(t)`, as `Context()` will be added in automatically via dispatch. Note that `compute` only returns a `Chunk` or `Thunk`, and you’ll eventually need to call `collect()` on the result to get your _actual_ result.

---

<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 27, 2019, 1:15am UTC](https://discourse.julialang.org/t/first-steps-with-dagger/25739/3 "2019-06-27T01:15:12Z")

</div>

Of course it was something silly 🤦‍♂️ thanks for your help 🙂
