Software Archive
Read-only legacy content
17061 Discussions

offload related

ankit_m_1
Beginner
817 Views

Hello,

I had a conceptual question here, I have a program on the host that offloads data over to MIC; now, is it possible to have another program (completely separate) which is running on MIC that can use this offloaded data. I am using offload pragma's to offload my data but per that model, the program on the host needs to offload certain logic over to MIC to make use of that offloaded data.

Basically, my issue here is that I am figuring out a way to offload/send/receive data to/from MIC from host via a queue mechanism, meaning, I have some program running on MIC which will work on incoming data but that incoming data comes from host; so there is going to be the need for shared memory in between the two machines; the one that the program on host and the program on MIC respecs. Now I know Cilk_plus library works using shared memory approach but I dont think I will be able to solve my problem using cilk_plus either. What kind of library, pragma should I use for such a requirement ?Kindly advise.

Thank you in advance.

Sincerely,

AM

0 Kudos
3 Replies
Charles_C_Intel1
Employee
817 Views

AM:

Have you considered MPI?   The whole idea of that programming model is independent programs running on different machines exchanging data as needed.

Unfortunately, there is no true "shared memory" mechanism between the Intel(r) Xeon Phi(tm) coprocessor and its host (with either offload or cilk_plus).   A transfer of some sort if necessary, either via TCP/IP, networked files, DMA transfers between programs on either side, etc.   cilk_plus just provides the convenience of the data being transferred has the same virtual address on both the host and the coprocessor, making it more friendly to data that contains pointers.  But there still is data transfer at very specific points.

A model to implement something like what you seem to want is to transfer data to and from the coprocessor at the same time it is doing computations using async offload and data transfer pragmas (or manage it yourself using separate host threads and synchronous pragmas).   The program started by the offload mechanism on the coprocessor continues to run during offloads (it runs for the duration of the host program after the first offload), so there is still something down there you can use to do things if you are talking to the coprocessor by more than one thread.

Hope that gives you some ideas

Charles

0 Kudos
ankit_m_1
Beginner
817 Views

Thank you Charles. All the information you provided certainly helps.

Sincerely,

AM

0 Kudos
jimdempseyatthecove
Honored Contributor III
817 Views

AM,

Windows has, and I am sure Linux has as well, a means for multiple processes to share some portion of virtual memory. Consider starting a process of yours on the host, call it YourMICDeamon, or something like that. YourMICDeamon is used as a proxy service to perform your communication to the MIC. Then have each of your "independent" processes in sequence, or simultaneously, open a shared virtual memory access to YourMICDeamon. The YourMICDeamon process maintains the communication between the host and the MIC.

This is similar to Charles suggestion of MPI excepting that the connections are made and broken arbitrarily as opposed to as a single application spread across multiple (disparate) processes.

An alternate means would be to write the YourMICDeamon to run as a native application on the MIC. Each of the host processes would use standard offloads, which in turn, would open the shared virtual memory access to the other processes running on the MIC.

Jim Dempsey

0 Kudos
Reply