I recently acquired a system with dual xeon phi cards. How best to put both cards to work? At the moment, I can only afford the C++ Composer software -- so MPI isn't an option.
Link Copied
Hi Aaron,
Please refer to the following Intel Xeon Phi system administration guide to get started.
Intel MPSS user guide is a great reference too.
In order to assist you better can you please explain for what purpose you intend to use the coprocessors.
Thanks,
As Sunny said, the best approach depends on the purpose for which you intend to use the coprocessors, specifically, the pattern of parallelism and communication.
const int nDevices = _Offload_number_of_devices(); #pragma omp parallel num_threads(nDevices) { const int i = omp_get_thread_num(); #pragma offload target(mic: i) { MyFunction(/*...*/ ); } }
const int nDevices = _Offload_number_of_devices(); #pragma omp parallel num_threads(nDevices) { const int iDevice = omp_get_thread_num(); #pragma omp for schedule(dynamic, 1) for (int i = 0; i < nWorkItems; i++) { #pragma offload target(mic: iDevice) { MyFunction(i); } } }
If you need communication between coprocessors, this is more complex. You can indirectly communicate between coprocessors by passing messages to/from host, but this would require synchronization at communication. This is where MPI would be a good tool.
We have a comprehensive free Web-based training coming soon where you can learn more: http://colfaxresearch.com/how-series/
Hi Aaron,
In addition to the above techniques, you can also use the Intel(R) hStreams library. This approach offers an abstraction that controls the compute capabilities of a heterogeneous system. The Intel(R) hStream library can be used on Intel Xeon processors and Intel(R) Xeon Phi(TM) coprocessors.
You can download hStreams binaries from:
• https://01.org/sites/default/files/downloads/hetero-streams-library/hstreams-1.0.0.tar (Linux)
• https://01.org/sites/default/files/downloads/hetero-streams-library/hstreams-1.0.0.zip (Windows)
For more complete information about compiler optimizations, see our Optimization Notice.