Offload error

Offload error

I am trying to offload a part of code and using 3 arrays of dimensions (14000*3600)

but this is giving some error related to system calls if I reduce the size of arrays to 1400*360 the code works fine 

HOST--ERROR:myoiOSSetPageAccess: mprotect failed!

 Please increase the maximum of memory map areas
        i.e. echo 256000 > /proc/sys/vm/max_map_count
offload error: process on the device 0 unexpectedly exited with code 1
HOST--ERROR:myoiThreadMutexDestroy1: Fail to destroy a mutex (0x18762b8)! error: 16
HOST--ERROR:myoiOSDetachSharedMemory: shmdt failed: Invalid argument
HOST--ERROR:myoiOSDetachSharedMemory: shmdt failed: Invalid argument
HOST--ERROR:myoiOSDestroySharedMemory: shmctl failed: Invalid argument
HOST--ERROR:myoiOSDetachSharedMemory: shmdt failed: Invalid argument
HOST--ERROR:myoiOSDetachSharedMemory: shmdt failed: Invalid argument
HOST--ERROR:myoiOSDestroySharedMemory: shmctl failed: Invalid argument
HOST--ERROR:myoiOSDetachSharedMemory: shmdt failed: Invalid argument
HOST--ERROR:myoiOSDetachSharedMemory: shmdt failed: Invalid argument
HOST--ERROR:myoiOSDestroySharedMemory: shmctl failed: Invalid argument
HOST--ERROR:myoiOSDetachSharedMemory: shmdt failed: Invalid argument
HOST--ERROR:myoiOSDetachSharedMemory: shmdt failed: Invalid argument

 

10 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Hitesh, 

Can you please share a reproducer for this issue. Also which version of the compiler and the MPSS are you using? 

 

 

compiler version is 14.0.1

I am not able to find out the MPSS version

also I compiled the code natively it works fine .
 

Hi Hitesh, 

Can you please share the code with us as well? 

thanks, 

Sumedh

#include "omp.h"
#include <cilk/cilk.h>
#include <cilk/cilk_api.h>
#include "offload.h"

#define SQUARE(i) i*i
#define mina(a,b) (((a)<(b)) ? (a) : (b))
                                                            
 _Cilk_shared int  foo(int, int, int, int, int, int, float _Cilk_shared  ** a , float _Cilk_shared ** b, float _Cilk_shared ** c );
 

float  _Cilk_shared ** a1;
float _Cilk_shared ** b1;
float  _Cilk_shared ** c1;

 

int main(int argc, char* argv[])
{
    //printf("before the code ");    
    
    
    int i,j,bx,bz,halfLength;
     int nx,nz,ITER;
     int thrd;

    halfLength=2;
    nx=14000+halfLength*2;
    nz=3600+halfLength*2;
    
      
    
    if(argc < 2)
    {
        printf("Error !!! Give number of threads to be spawned . \n");
        exit(-1);
    }  
    
    sscanf(argv[1],"%d",&thrd);
    sscanf(argv[2],"%d",&bx);
    sscanf(argv[3],"%d",&bz);    
    //printf("%s %d \n",__FILE__,__LINE__);
    
    

    //-----------------------------Aligned memory allocation-------------------------------------------------------
     a1=(float  _Cilk_shared **)_Offload_shared_aligned_malloc(sizeof(float *)*nx,64);
     b1=(float  _Cilk_shared **)_Offload_shared_aligned_malloc(sizeof(float*)*nx,64);
     c1=(float  _Cilk_shared **)_Offload_shared_aligned_malloc(sizeof(float*)*nx,64);
    
    for( i=0;i<nx;i++)
    {
        a1[i]=(float  _Cilk_shared *)_Offload_shared_aligned_malloc(sizeof (float)*nz,64);
        b1[i]=(float  _Cilk_shared *)_Offload_shared_aligned_malloc(sizeof (float)*nz,64);
        c1[i]=(float  _Cilk_shared *)_Offload_shared_aligned_malloc(sizeof (float)*nz,64);
        
    }
    
    

    #pragma omp parallel for private(i,j)
    for(i=0;i<nx;i++)
    {
        for(j=0;j<nz;j++)
        {
            a1[i][j]=2.0f;
            b1[i][j]=2.0f;
            c1[i][j]=2.0f;
       
        }

    }
    
    _Cilk_offload_to(1) foo(thrd, nx, nz, bx, bz, halfLength,  a1,  b1,  c1);
    
      
    for(i=0;i<nx;i++){
    _Offload_shared_aligned_free(a1[i]);
    _Offload_shared_aligned_free(b1[i]);
    _Offload_shared_aligned_free(c1[i]);
        }

_Offload_shared_aligned_free(a1);
_Offload_shared_aligned_free(b1);
_Offload_shared_aligned_free(c1);

return 0;
}

//-----------------------------------------------------------------------------------------------------------------------
 _Cilk_shared  int foo(int thrd, int nx, int nz, int bx, int bz, int halfLength, float _Cilk_shared **  a, float  _Cilk_shared  **  b, float  _Cilk_shared 
**   c){

 int ii,jj,i,j;

 

printf("total thread=%d",thrd);

        __assume_aligned(a,64);     
        __assume_aligned(b,64);
        __assume_aligned(c,64);
    

    omp_set_num_threads(thrd);
    
    
    #pragma omp parallel for  private (ii,jj,i,j) schedule(dynamic,1)
    
    for(ii=2;ii<nx-halfLength*2;ii+=bx)
    {
    
        for(jj=2;jj<nz-halfLength*2;jj+=bz)
        
        {
        
            for(i=ii;i<mina(bx+ii,nx-halfLength);++i)
                     {
            
                                #pragma simd 
                
                for(j=jj;j<mina(bz+jj,nz-halfLength);++j)
                {
                        
            
                    a[i][j] =b[i][j]+c[i][j];
                    
                }
                                        
                    
            }            
        }
            
    }

 

return 0;
}

 

 

 

 

 

Thanks for the test code. I can reproduce the error. When I compile natively (with -mmic) I still run into compilation errors and cannot make it work. What compiler options did you use for both offload and native compilations?

For running the code in offload model I am not using any compiler options .Is there any specific option that I should use?
 

I am using 

icc -openmp <name_of_program >  thats it no compiler options 

when code was not cilk shared I compiled it natively using -mmic -openmp -03 -ansi-alias but mine worked fine .

Thanks for the update. This looks similar to a known issue, but I still need to investigate further to confirm this. I will provide more information soon.

CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
CARD--ERROR:1 Segment Fault!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
CARD--ERROR:1 Segment Fault!
CARD--ERROR:1 CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
Segment Fault!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
inside the function
total procs=236CARD--ERROR:1 CARD--ERROR:1 CARD--ERROR:1 CARD--ERROR:1 CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
CARD--ERROR:1 Segment Fault!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
CARD--ERROR:1 Segment Fault!
CARD--ERROR:1 CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
Segment Fault!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
inside the function
total procs=236CARD--ERROR:1 CARD--ERROR:1 CARD--ERROR:1 CARD--ERROR:1 CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
CARD--ERROR:1 Segment Fault!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
CARD--ERROR:1 Segment Fault!
CARD--ERROR:1 CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
myoiPageFaultHandler: (nil) Out of Range!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
CARD--ERROR:1 myoiPageFaultHandler: (nil) Out of Range!
Segment Fault!
CARD--ERROR:1 _myoiPageFaultHandler: (nil) switch to default signal handle
HOST--ERROR:myoiScifGetRecvId: Call recv() Header Failed ! for source: 1, errno = 104
HOST--ERROR:myoiScifSend: Call send() Failed! errno = 104
HOST--ERROR:myoiSend: Fail to send message!
HOST--ERROR:_myoiWatchdogDaemon: could not send to target: 1
offload error: process on the device 0 unexpectedly exited with code 1

same code is now showing new error.no change in the code done .

  

 

 

 

 

 

Please refer to the response here for more details and a resolution.

Leave a Comment

Please sign in to add a comment. Not a member? Join today