Skip to content

Instantly share code, notes, and snippets.

@baggepinnen
Last active November 10, 2017 13:25
Show Gist options
  • Save baggepinnen/2bc01c331392c32a4393930d7737290f to your computer and use it in GitHub Desktop.
Save baggepinnen/2bc01c331392c32a4393930d7737290f to your computer and use it in GitHub Desktop.
A nice way to run many experiments in parallel
@sync begin # Enusres that both operations below are finished before leaving this scope
@async begin # Enusres that the last running job does not stop the next parallel operation from starting
info("Launching forward only")
result1 = pmap(35:-2:5) do it # Start heaviest job (35) first
do_something(it) # Execution time proportional to it
end
end
@async begin
info("Launching forward inverse")
result2 = pmap(35:-2:5) do it
do_something_else(it)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment