This works the first time it is invoked.
The second and subsequent times it is invoked vslsConvNewTask returns error code -2001 (Allocation Error)
The same .dll works fine when called from other applications.
The .dll is developed with the latest Intel Composer XE 2011 for Windows.
Any recommendations on how to debug or resolve this problem would be appreciated
Howard Weiss
---------------------------------------------------------------------------------------------------------------------------
/*
* Create task descriptor (create descriptor of problem)
*/
task = 0;
status = vslsConvNewTask(&task,mode,rank,xshape,yshape,zshape);
if( status != VSL_STATUS_OK ){
char tells[256];
memset(tells, 0, sizeof(tells));
sprintf(tells, "ERROR: creation of job failed, exit with %d\\n", status);
::report(tells);
return 1;
}
/*
* Execute task (Calculate 2 dimension convolution of two arrays)
*/
status = vslsConvExec(task,kernel,NULL,image,NULL,result,NULL);
if( status != VSL_STATUS_OK ){
char tells[256];
memset(tells, 0, sizeof(tells));
sprintf(tells, "ERROR: job status bad, exit with %d\\n", status);
::report(tells);
return 1;
}
/*
* Delete task object (delete descriptor of problem)
*/
status = vslConvDeleteTask(&task);
if( status != VSL_STATUS_OK ){
char tells[256];
memset(tells, 0, sizeof(tells));
sprintf(tells, "ERROR: failed to delete task object, exit with %d\\n", status);
::report(tells);
return 1;
}
链接已复制
It will take some time to create a simple reproducer.
Is there a way to obtain more information regarding the memory allocation failure itself - e.g. memory size, memory request size. All I have to work with is the error code.
Howard,
you also can switch off MKL memory management software (set MKL_DISABLE_FAST_MM=1). As mentioned in MKL documentation:
"Intel Math Kernel Library (Intel MKL) has memory management software that controls memory buffers for the use by the library functions. New buffers that the library allocates when your application calls Intel MKL are not deallocated until the program ends. To get the amount of memory allocated by the memory management software, call the mkl_mem_stat() function. If your program needs to free memory, call mkl_free_buffers(). If another call is made to a library function that needs a memory buffer, the memory manager again allocates the buffers and they again remain allocated until either the program ends or the program deallocates the memory. This behavior facilitates better performance. However, some tools may report this behavior as a memory leak.
The memory management software is turned on by default, which leaves memory allocated by calls to Intel MKL until the program ends. To disable this behavior of the memory management software, set the MKL_DISABLE_FAST_MM environment variable to any value. This configures the memory management software to allocate and free memory from call to call. Disabling this feature will negatively impact performance of some Intel MKL routines, especially for small problem sizes"
Or you could find other option for memory manage in Intel Math Kernel Library for Windows* OS User's Guide, topicUsing Memory Management.