- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I am working on running a set of MKL FFTs in parallel using user threads (using openMP primitives)

I tried out Example 27 in MKL manual:

I do a MKL_Set_Num_Threads(1) as suggested in the manual and run 4 OMP threads.

But I see "Aborted" in the output. This apparently happens after the first thread completes all the statements in the parallel region. It is not clear as to what the reason is.

I use the following options for compiling:

icc -Wl,--start-group -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -openmp -lpthread test_mkl.c

It will be great if some one can help me with this.

Following is the code I use:

#include

#include

#include

#include "mkl.h"

#include

#define DEBUG 0

int main (){

float _Complex x[200][100];

MKL_LONG len[2];

int j,k;

float real, imag=0;

for (j = 0; j < 200; ++j)

for(k=0; k<100; ++k)

{

real = ((float)((float)rand()/(float)RAND_MAX) );

imag = ((float)((float)rand()/(float)RAND_MAX) );

x

}

len[0]=50; len[1]=100;

MKL_Set_Num_Threads(1);

int nthreads;

#pragma omp parallel num_threads(4)

{

DFTI_DESCRIPTOR_HANDLE my_desc_handle;

MKL_LONG myStatus;

int myID = omp_get_thread_num ();

printf("\n %d", myID);fflush(stdout);

myStatus = DftiCreateDescriptor (&my_desc_handle, DFTI_SINGLE,DFTI_COMPLEX, 2, len);

myStatus = DftiCommitDescriptor (my_desc_handle);

myStatus = DftiComputeForward (my_desc_handle, &x[myID * len[0] * len[1]]);

myStatus = DftiFreeDescriptor (&my_desc_handle);

printf("\n free desc my id: %d ---> my status: %ld", myID, myStatus); fflush(stdout);

if (myID == 0)

{

nthreads = omp_get_num_threads();

printf("Number of threads = %d\n", nthreads);

}

}

printf("\n all done");

/* End OpenMP parallel region */

return 0;

}

Link Copied

4 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

Yourtest fails becuse of problem in the following expression:

myStatus = DftiComputeForward (my_desc_handle, &x[myID * len[0] * len[1]]);

Please add new pointer yat the top of thetest (after definition of x) :

float _Complex *y=&x[0][0];

and use y instead of x:

myStatus = DftiComputeForward (my_desc_handle,

**&y**[myID * len[0] * len[1]]);

So,MKL DFTIexamples:

Using Parallel Mode with Multiple Descriptors Initialized in One Thread

**Using Parallel Mode with a Common Descriptor**

are to be corrected

Thank you

--Victor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Or it's OK just to use the following expression:

&x [myID * len[0]] [0]

instead of

&x[myID * len[0] * len[1]]);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Quoting - Victor Pasko (Intel)

*Thanks Victor !*

Hi,

Yourtest fails becuse of problem in the following expression:

myStatus = DftiComputeForward (my_desc_handle, &x[myID * len[0] * len[1]]);

Please add new pointer yat the top of thetest (after definition of x) :

float _Complex *y=&x[0][0];

and use y instead of x:

myStatus = DftiComputeForward (my_desc_handle,

So,MKL DFTIexamples:

are to be corrected

Thank you

--Victor

Hi,

Yourtest fails becuse of problem in the following expression:

myStatus = DftiComputeForward (my_desc_handle, &x[myID * len[0] * len[1]]);

Please add new pointer yat the top of thetest (after definition of x) :

float _Complex *y=&x[0][0];

and use y instead of x:

myStatus = DftiComputeForward (my_desc_handle,

**&y**[myID * len[0] * len[1]]);So,MKL DFTIexamples:

Using Parallel Mode with Multiple Descriptors Initialized in One Thread

**Using Parallel Mode with a Common Descriptor**

are to be corrected

Thank you

--Victor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

All ofnew FORTRAN examplesand the fixedC examples are integrated into MKL 10.3.1, which release recently.

For who are using Intel Compiler or Composer, please find the MKL Version info fromhttp://software.intel.com/en-us/articles/which-version-of-the-intel-ipp-intel-mkl-and-intel-tbb-libraries-are-included-in-the-intel-composer-bundles/

Regards,

Ying H.

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page