How could I keep a task busy wait on mic, and signal it to continue?

How could I keep a task busy wait on mic, and signal it to continue?

Hi,

   What I am doing now is to use asynchronized method to transfer data between host and mic. If I split data into 100 blocks, the transfer task and computation task are initialized 100 times on mic. I am thinking to remove the overhead from initialization. What I want to implement is to keep the computation task always running, but when there is no available data, it just busy waits. When the transfer task finish one block, it will signal computation task to continue. How could I implement this? 

     thanks a lot!

     Best,

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I am pretty sure that you can't do it with the offload model. However, if you use MPI, you can set up two processes (one on host, one on coprocessor) and use a blocking receive function MPI_Recv on the coprocessor side.

Edit: you can do something similar with the offload model if you use data persistence on coprocessor (clauses "free_if" and "alloc_if" of #pragma offload). However, in this case, you will not have a waiting task; you will just terminate the offload and then start another offload for each chunk of work, which re-uses persistent data.

Leave a Comment

Please sign in to add a comment. Not a member? Join today