Software Archive
Read-only legacy content
17061 Discussions

_Offload_shared_malloc errors

bing_z_
Beginner
221 Views

Hi,

I am trying to allocate a memory in MIC with _Cilk_shared_malloc. The following is the code, which raise some errors.

_Cilk_shared
void run(int _Cilk_shared *lTable, int _Cilk_shared *rTable, int size){
#ifdef __MIC__
        printf("Run on MIC\n");
        int i;
        for(i = 0; i < size; i++)
        {
                lTable = lTable + rTable;
        }
#else
        printf("Run on CPU\n");
#endif
}


int main(){

        int *ltable = (int *)malloc(sizeof(int) * LTABLESIZE);
        int *rtable = (int *)malloc(sizeof(int) * RTABLESIZE);

        int rows = 1024*1024*32;
        _Cilk_shared int microws = 1024*1024*32;
        micltable = _Offload_shared_malloc(sizeof(int) * rows);
        micrtable = _Offload_shared_malloc(sizeof(int) * rows);
        memcpy(micltable, ltable, rows * sizeof(int));
        memcpy(micrtable, rtable, rows * sizeof(int));

        _Cilk_offload run(micltable, micrtable, rows);
}
Errors:
CARD--ERROR:1 thread:1 _myoiInitArenaProt:Page Table Entry Missing for chunkaddr: 0x822000000
CARD--ERROR:1 thread:1 _myoiArenaSyncNewChunks: Failed to get the prot of the arena!
shareMemSpeed?iccoutSj6mII: allocator/myoarenaallocator.c:1043: myoiArenaHandler: Assertion `MYO_SUCCESS == errInfo' failed.
HOST--ERROR: thread:1 myoiScifGetRecvId: Call recv() Header Failed ! for source: 1, errno = 104
^CHOST--ERROR: thread:0 myoiUnregisterMYOWindow:scif_unregister failed with err 1104
CARD--ERROR:2 thread:1 myoiScifGetRecvId: Call recv() Header Failed ! for source: 0, errno = 104
HOST--ERROR: thread:0 myoiThreadSemaphoreWait1: Failed to wait a semaphore!
HOST--ERROR: thread:0 myoiScifSend: Call send() Failed! errno = 9
HOST--ERROR: thread:0 myoiSend: Failed to send message!
HOST--ERROR: thread:0 myoiBcastToOthers: Failed to send message to 2!
HOST--ERROR: thread:0 myoiSendArenaMsg: Failed to send message!
HOST--ERROR: thread:0 myoiScifSend: Call send() Failed! errno = 9
HOST--ERROR: thread:0 myoiSend: Failed to send message!
HOST--ERROR: thread:0 myoiSendStatMsg: Failed to sent a stat related message!
HOST--ERROR: thread:0 myoiSendHTimeSetting: Failed to send stat msg!
HOST--ERROR: thread:0 myoiScifSend: Call send() Failed! errno = 9
HOST--ERROR: thread:0 myoiSend: Failed to send message!
HOST--ERROR: thread:0 myoiBcastToOthers: Failed to send message to 1!
HOST--ERROR: thread:0 myoiHostSVarTablePropagateInternal: Failed to broadcast the var table to others!
HOST--ERROR: thread:0 _myoiLibInit: Failed to propagate the addresses of svars!

Can anyone help me figure out this problem?

Thanks!

0 Kudos
1 Reply
Rajiv_D_Intel
Employee
221 Views

You are likely to be running out of memory.

The CIlk_shared model allows you to use only about 45% of the available memory on the card.

I was able to run your program (with some edits) on a smaller numbers of rows.

0 Kudos
Reply