Dear all, I'm a novice for MIC programming and I encountered a offload error when I want to run an example code on the host and offload part of the code to MIC cores for multithread-computing based on OpenMP. The offload error is: cannot offload to MIC - device is not available
Out cluster has 8 mic nodes with the naming convention of nodeXX-mic0 (XX = 09~16). I think if I want to run the code, I have to specify which node to use, right? How can I do it? I searched for the internet and I didn't find an applicable answer. It would be great if I could get your help. For your convenience, part of the sample code is attached. Thanks very much.
#include
#include
#include
#include
#include
#include
#define FLOPS_ARRAY_SIZE (1024*512)
#define MAXFLOPS_ITERS 100000000
#define LOOP_COUNT 128
// Floating pt ops per inner loop iteration
#define FLOPSPERCALC 2
// define some arrays - 64 byte aligned for fast cache access
__declspec (target (mic)) float fa[FLOPS_ARRAY_SIZE] __attribute__((align(64)));
__declspec (target (mic)) float fb[FLOPS_ARRAY_SIZE] __attribute__((align(64)));
//
int main(int argc, char *argv[] )
{
.......
//
// initialize the compute arrays
//
#pragma offload target (mic)
#pragma omp parallel
#pragma omp master
numthreads = omp_get_num_threads();
printf("Initializing\r\n");
#pragma omp parallel for
for(i=0; i
fa[i] = (float)i + 0.1;
fb[i] = (float)i + 0.2;
}
........
#pragma offload target (mic)
#pragma omp parallel for private(j, k)
for (i=0; i
int offset = i * LOOP_COUNT;
for(j=0; j
//
// scale 1st array and add in the 2nd array
//
#pragma vector aligned
#pragma ivdep
#pragma vector always
for(k=0; k
fa[k+offset] = a * fa[k+offset] + fb[k+offset];
}
}
}
..............
}