Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow null Future in task spawn dependences #795

Closed
hcedwar opened this issue May 12, 2017 · 2 comments
Closed

Allow null Future in task spawn dependences #795

hcedwar opened this issue May 12, 2017 · 2 comments
Assignees
Labels
Enhancement Improve existing capability; will potentially require voting
Milestone

Comments

@hcedwar
Copy link
Contributor

hcedwar commented May 12, 2017

Requested by @kyungjoo-kim : allow null Kokkos::Future in task spawn dependence

               if (f_tgt.is_null()) {
                 auto f = Kokkos::task_spawn
                   (Kokkos::TaskSingle(_sched, Kokkos::TaskPriority::High),
                    TaskFunctor_UpdateSupernodes(_sched, _pool, _info,
_sid, i));
                 _info.supernodes_future(tgt) = f;
               } else {
                 auto f = Kokkos::task_spawn
                   (Kokkos::TaskSingle(f_tgt, Kokkos::TaskPriority::High),
                    TaskFunctor_UpdateSupernodes(_sched, _pool, _info,
_sid, i));
                 _info.supernodes_future(tgt) = f;
               }

This code create a chain of futures that append data to a block. The
very first one depends on an empty future and it triggers an error
"Kokkos spawn given null Future".

This makes me duplicate the same code twice to check null future. I
think that if dependent future is null, it just needs to be ignored
instead of error.

@hcedwar hcedwar added the Enhancement Improve existing capability; will potentially require voting label May 12, 2017
@hcedwar hcedwar added this to the 2017-June-end milestone May 12, 2017
@hcedwar hcedwar self-assigned this May 12, 2017
@hcedwar
Copy link
Contributor Author

hcedwar commented May 12, 2017

@kyungjoo-kim
Allow:

  Kokkos::task_spawn( Kokkos::TaskSingle( sched , future , priority ), functor );

The scheduler argument is necessary in case the future is null. A non-null future must reference a task previously spawned with the same scheduler.

hcedwar added a commit that referenced this issue May 12, 2017
@hcedwar hcedwar added this to In Develop in On-node Task DAG May 12, 2017
@kyungjoo-kim
Copy link
Contributor

Thank you. This may make the api more verbose.

Just a thought:

another possible suggestion is for a scheduler to produce a null future as a const object and the scheduler ignores the future whenever it comes in. Or possibly I can produce a task with no-op.

I don't know which way is more elegant.

@crtrott crtrott closed this as completed May 27, 2017
@hcedwar hcedwar moved this from In Develop to Done in On-node Task DAG Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improve existing capability; will potentially require voting
Projects
No open projects
Development

No branches or pull requests

3 participants