This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem running a Programm with openMP

Other Parts Discussed in Thread: SYSBIOS

Hi guys ,

I want to measure a execution for my Application . The Application is executed on all Cores C6678 DSP with openMP.

I started with openMP parallel Hello World , and it just work fine . After this I add Insruction for my Application and I not do any modification in the configuration file for openMP hello World . If i run the Application , I see this Output :

[C66xx_0] A0=0xc2df0a0 A1=0x8

A2=0xc2df0a0 A3=0xc303378

A4=0x0 A5=0xf80

A6=0x0 A7=0x7bffcf4

A8=0x7bc1fd9 A9=0x0

A10=0x0 A11=0x2

A12=0xc2ebb90 A13=0x2

A14=0x7bc1fd9 A15=0x0

A16=0x82bb20 A17=0x1

A18=0x82bb14 A19=0x82bb04

A20=0x82bb1c A21=0x82bb0c

A22=0x82bb18 A23=0x82bb24

A24=0x1 A25=0x82bb2c

A26=0x82bb08 A27=0x82bb28

A28=0x82baf8 A29=0x82bb00

A30=0x2 A31=0x1

B0=0x2 B1=0x1

B2=0x82baf0 B3=0xc301489

B4=0x82bab0 B5=0xc2cf788

B6=0x82bae0 B7=0x19

B8=0x0 B9=0xc2fba00

B10=0x2 B11=0x82bab8

B12=0x82bae8 B13=0xf80

B14=0x82baec B15=0x82baf4

B16=0xc301504 B17=0x82ba10

B18=0xc2f8d1c B19=0x20

B20=0x20 B21=0x2a6c800

B22=0x0 B23=0x82ba40

B24=0x0 B25=0x82ba40

B26=0xffffffff B27=0xffffffff

B28=0xfffffff7 B29=0x0

B30=0x66666666 B31=0x30666666

NTSR=0xc3015af

ITSR=0xfffffff0

IRP=0x2

SSR=0xc2d045c

AMR=0x0

RILC=0x0

ILC=0xc2f7290

Exception at 0x7bffcf4

EFR=0x2 NRP=0x7bffcf4

Internal exception: IERR=0x1

Instruction fetch exception

ti.sysbios.family.c64p.Exception: line 255: E_exceptionMin: pc = 0x00000000, sp = 0x0000001c.

To see more exception detail, use ROV or set 'ti.sysbios.family.c64p.Exception.enablePrint = true;'

xdc.runtime.Error.raise: terminating execution

and that is my Implementation:

#include "SorterProcessing.h"

// global variable
int shared_inputdata[ELEMENTS_to_SORTED * NUMBER_of_LINES];
int private_inputdata[NUMBER_of_Lines_pro_Thread * ELEMENTS_to_SORTED];
int private_Buffer[LENGHT];
void main()
{
 // init the shared_inputdata array
 int i, j;
 int nthreads, tid;
 unsigned int start , stop , cycle_counter = 0;
 //unsigned int begin, end , total = 0;
 TSCL = 0;
 for(i = 0; i<(ELEMENTS_to_SORTED * NUMBER_of_LINES); i++){
     shared_inputdata[i] = i * 2;
 }

  nthreads = NTHREADS;
  omp_set_num_threads(NTHREADS);

/* Fork a team of threads giving them their own copies of variables */
#pragma omp parallel private(nthreads,tid,private_inputdata,private_Buffer,j, start , stop) shared (shared_inputdata)
  {

  /* Obtain thread number */
  tid = omp_get_thread_num();
  printf("Hello World from thread = %d\n", tid);

  /* Only master thread does this */
  if (tid == 0)
    {
    nthreads = omp_get_num_threads();
    printf("Number of threads = %d\n", nthreads);
    }
    // distributes block data for each Thread
   memcpy(private_inputdata, &shared_inputdata[tid*NUMBER_of_Lines_pro_Thread*ELEMENTS_to_SORTED], sizeof(int)*NUMBER_of_Lines_pro_Thread*ELEMENTS_to_SORTED);
   // start Timer
   start = TSCL;
   for(j=0; j<NUMBER_of_Lines_pro_Thread; j++){
       int position = j*ELEMENTS_to_SORTED;
       memcpy(&private_Buffer[16],&private_inputdata[position],ELEMENTS_to_SORTED * sizeof(int));
       addElements(private_Buffer);
   }
   // stop Timer
   stop = TSCL;
   cycle_counter = stop - start;                       // print number of CPU Cycles
   printf("Sorter Time [%u] cycles \n", cycle_counter);
  }  /* All threads join master thread and disband */

}

What is wrong ?

Thank you for Reply

Lopez


  • You branched into invalid memory space based on the following.  That is to say you're code started to try to execute from 0x7bffcf4 which is not a valid memory space.

    Exception at 0x7bffcf4

    EFR=0x2 NRP=0x7bffcf4

    Internal exception: IERR=0x1

    Instruction fetch exception

    You need to backtrack and see what caused it.  Start by looking at the dissassembly pointed to by the value in B3 (it holds the return pointer from the previous branch.)  

    The issue can be a number of things from corrupted stack to uninitialized variables being used.

    Best Regards,

    Chad

  • Hi Chad

    thank you for Reply . how I can acess the Platform Configuration Tools to edit the Platform : I go to Tools->RTSC->Platform->Edit/View . and I get this Fenster :

    The Fied Package name and CPU Core are not activ.

    Using the openMP Hello World the Platform configuration look like this :

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/265543.aspx?pi168778=3

    so I don´t no how I can get this Fenster to manage my memorx Sections

    Best Regards

    Lopez

  • Hi Chad ,

    I try to run the example code according the link of my last post . Before I run the code I follow this Steps:

    • connect each Target
    • run gel file on all target
    • run Global Scripts only on core O
    • Load programm to each target
    • Group Core
    • run the Programm

    and no my Output look like this :

    [C66xx_0] Execution outside parallel region = [ 6143 ] cycles

    Hello World from thread = 0

    [C66xx_1] Hello World from thread = 1

    [C66xx_2] Hello World from thread = 2

    [C66xx_3] Hello World from thread = 3

    [C66xx_0] Number of threads = 4

    [C66xx_1] Execution pro Thread = [ 0 ] cycles

    [C66xx_2] Execution pro Thread = [ 0 ] cycles

    [C66xx_3] Execution pro Thread = [ 0 ] cycles

    [C66xx_0] Execution pro Thread = [ 6155 ] cycles

    [C66xx_1] A0=0xc09ad2c A1=0x1

    A2=0x1 A3=0xc0b8318

    A4=0xc008498 A5=0xcb00ca

    A6=0x82a3f0 A7=0xffffffff

    A8=0x0 A9=0x0

    A10=0xc6e0c6e A11=0x0

    A12=0x2288941 A13=0x7000c50

    A14=0xc2100264 A15=0x211c079

    A16=0xc020f23 A17=0x20

    A18=0xc0102f0 A19=0x0

    A20=0x10081110 A21=0x320806[C66xx_2] A0=0x1 A1=0x1

    A2=0x18146ac9 A3=0xc0b8318

    A4=0x0 A5=0xc008508

    A6=0x82a3f8 A7=0xffffffff

    A8=0x0 A9=0x0

    A10=0x829d7c A11=0xc0a3564

    A12=0x0 A13=0x0

    A14=0x0 A15=0x0

    A16=0xc020c23 A17=0x20

    A18=0xc0182f0 A19=0x0

    A20=0xfbcf9f49 A21=0x8e6f82e4

    A22=0xbfc63cf6 A23=0x[C66xx_3] A0=0x1 A1=0x1

    A2=0x18146ac9 A3=0xc0b8318

    A4=0x0 A5=0xc018588

    A6=0x82a3f8 A7=0xffffffff

    A8=0x0 A9=0x0

    A10=0x829d7c A11=0xc0a3564

    A12=0x0 A13=0x0

    A14=0x0 A15=0x0

    A16=0xc020da3 A17=0x20

    A18=0xc020470 A19=0x0

    A20=0x62603326 A21=0x8844242

    A22=0x4055048 A23=0x50[C66xx_0] A0=0x1 A1=0x1

    A2=0x18146ac9 A3=0xc0b8318

    A4=0x0 A5=0xc000088

    A6=0x82a3f8 A7=0xffffffff

    A8=0x0 A9=0x0

    A10=0x829d7c A11=0xc0a3564

    A12=0x0 A13=0x0

    A14=0x0 A15=0x0

    A16=0xc008326 A17=0x20

    A18=0xc006e70 A19=0x0

    A20=0x100 A21=0x1292a12

    A22=0x9b408122 A23=0x8820a8[C66xx_1]

    A22=0xbf9cbd84 A23=0x7fffffff

    A24=0x31082452 A25=0x44002026

    A26=0x3b6b7aee A27=0x84288300

    A28=0x542005 A29=0xc0b80e8

    A30=0x0 A31=0x200

    B0=0xc010498 B1=0x0

    B2=0x0 B3=0x0

    B4=0xc6e4c6e B5=0xc0b8304

    B6=0x2640100 B7=0x0

    B8=0xc010290 B9=0x3a

    B10=0xe6200f02 B11=[C66xx_2] 7ad39ffc

    A24=0x0 A25=0x0

    A26=0x9dffb42c A27=0xe7adff7f

    A28=0xa18156f A29=0xc0b80e8

    A30=0x0 A31=0x200

    B0=0x0 B1=0x0

    B2=0x0 B3=0xc0abc6c

    B4=0x829d50 B5=0x0

    B6=0x2640100 B7=0x0

    B8=0xc018290 B9=0x3a

    B10=0x0 B11=0x0

    B12=0x0 B13=0xc0a94e0

    B14=0xc0ba590 B15=0xc01[C66xx_3] 000025

    A24=0x0 A25=0x9240408c

    A26=0x1c404506 A27=0x80001600

    A28=0x42400840 A29=0xc0b80e8

    A30=0x0 A31=0x200

    B0=0x0 B1=0x0

    B2=0x0 B3=0xc0abc6c

    B4=0x829d50 B5=0x0

    B6=0x2640100 B7=0x0

    B8=0xc020410 B9=0x3a

    B10=0x0 B11=0x0

    B12=0x0 B13=0xc0a94e0

    B14=0xc0ba590 B15[C66xx_0] 2

    A24=0x0 A25=0xb1737ff1

    A26=0x0 A27=0x0

    A28=0x400 A29=0x1

    A30=0x400 A31=0x200

    B0=0x0 B1=0x0

    B2=0x0 B3=0xc0abc6c

    B4=0x829d50 B5=0x0

    B6=0x2640100 B7=0x1

    B8=0xc006e10 B9=0x3a

    B10=0xecf40 B11=0xc0ab078

    B12=0x0 B13=0xc0a94e0

    B14=0xc0ba590 B15=0xc007060

    B16=0x3[C66xx_1] 0x7bc2059

    B12=0x3c68f8 B13=0xcff48121

    B14=0xc0ba590 B15=0xc09ad5c

    B16=0x30 B17=0xc01051c

    B18=0xc0ba470 B19=0x800

    B20=0x44ffc000 B21=0x7fe

    B22=0x0 B23=0x5a

    B24=0x268012 B25=0xff7c6df7

    B26=0x25c8500 B27=0xb3b79ebf

    B28=0x64268a00 B29=0x3f40c8d1

    B30=0xa03c8d08[C66xx_2] 8508

    B16=0x30 B17=0xc01851c

    B18=0xc0ba470 B19=0x800

    B20=0x44ffc000 B21=0x7fe

    B22=0x0 B23=0xbbe67c7b

    B24=0x4a114100 B25=0xa001c0a

    B26=0x1481aa3d B27=0x1481aa3d

    B28=0x1c411100 B29=0xa0041

    B30=0xa03ca358 B31=0xffffffff

    NTSR=0x1000e

    ITSR=0xd

    IRP=0xc0abe7a

    SSR=[C66xx_3] =0xc020688

    B16=0x30 B17=0xc02069c

    B18=0xc0ba470 B19=0x800

    B20=0x44ffc000 B21=0x7fe

    B22=0x0 B23=0x2040140

    B24=0x51002c0 B25=0x1b42d1

    B26=0x9909002 B27=0x2490200

    B28=0x7384 B29=0x404a

    B30=0xa03cb238 B31=0xffffffff

    NTSR=0x1000e

    ITSR=0xd

    IRP=0xc0abe7a

    SSR=0x0

    [C66xx_0] 0 B17=0xc00709c

    B18=0xc0ba470 B19=0x800

    B20=0x44ffc000 B21=0x7fe

    B22=0x101b04 B23=0xc40900fc

    B24=0xc0fa7da9 B25=0x21c40900

    B26=0x4401002 B27=0x0

    B28=0x0 B29=0x1

    B30=0xc0 B31=0xffffffff

    NTSR=0x1000e

    ITSR=0xd

    IRP=0xc0abe7a

    SSR=0x0

    AMR=0x0

    RILC=0x0

    ILC=0x0

    Ex[C66xx_1]  B31=0xffffffff

    NTSR=0x1000e

    ITSR=0xd

    IRP=0xc0abe7a

    SSR=0x0

    AMR=0x0

    RILC=0x0

    ILC=0x0

    Exception at 0xc6e4c6c

    EFR=0x2 NRP=0xc6e4c6c

    Internal exception: IERR=0x1

    Instruction fetch exception

    ti.sysbios.family.c64p.Exception: line 255: E_exceptionMin: pc = 0x0c[C66xx_2] 0x0

    AMR=0x0

    RILC=0x0

    ILC=0x0

    Exception at 0xc09ac4c

    EFR=0x2 NRP=0xc09ac4c

    Internal exception: IERR=0x8

    Opcode exception

    ti.sysbios.family.c64p.Exception: line 255: E_exceptionMin: pc = 0x0c09ac4c, sp = 0x0c018508.

    To see more exception detail, use ROV or s[C66xx_3] AMR=0x0

    RILC=0x0

    ILC=0x0

    Exception at 0xc09ac4c

    EFR=0x2 NRP=0xc09ac4c

    Internal exception: IERR=0x8

    Opcode exception

    ti.sysbios.family.c64p.Exception: line 255: E_exceptionMin: pc = 0x0c09ac4c, sp = 0x0c020688.

    To see more exception detail, use ROV or set '[C66xx_0] ception at 0xc09ac4c

    EFR=0x2 NRP=0xc09ac4c

    Internal exception: IERR=0x8

    Opcode exception

    ti.sysbios.family.c64p.Exception: line 255: E_exceptionMin: pc = 0x0c09ac4c, sp = 0x0c007060.

    To see more exception detail, use ROV or set 'ti.sysbios.family.c64p.Exce[C66xx_1] 6e4c6c, sp = 0x0c09ad5c.

    To see more exception detail, use ROV or set 'ti.sysbios.family.c64p.Exception.enablePrint = true;'

    xdc.runtime.Error.raise: terminating execution

    [C66xx_2] et 'ti.sysbios.family.c64p.Exception.enablePrint = true;'

    xdc.runtime.Error.raise: terminating execution

    [C66xx_3] ti.sysbios.family.c64p.Exception.enablePrint = true;'

    xdc.runtime.Error.raise:

    so I look like the programm  is run correctly , but I don´t really no why the Problem of my first post come again .

    I chek my Map. File and it look like this :

    ----------------------  --------  ---------  --------  --------  ----  --------

      L2SRAM                00800000   00080000  0002bc80  00054380  RWIX

      MSMCSRAM              0c000000   003c0000  000c0ac4  002ff53c  RWIX

      DDR3                  80000000   20000000  00000000  20000000  RWIX

      MSMCSRAM_NOCACHE      a03c0000   00040000  0003996e  00006692  RWIX

    what do you says about that ?

    Best Regards

    Lopez

     

  • You'll need to open the disassembly window and debug this.

    Look at what's at the NRP pointer, that's where the error occured.  You may want to also go through the C66x CPU and Instruction Set UG so that you can decode what the errors are (IERR register is defined there.)  

    Take a look at the disasse,bly at the location of the error (it's trying to fetch/excute/etc) that location and see if it's where valid code is.  If it's not valid code, start tracing it back by looking at what is at the location pointed to by the B3 register which is where it was before it branched into this code.

    You will need to debug this to determine what the source of the error is.  I can't make a determination based on this dump, but I can tell you where to look, which is what this dump is intended to do.

    If you want to dump the dissassembly window at both the NRP location w/ at lest 10 addresses before and after that, and do this again for the B3 location, and post this here - along with the latest Exception Handler report, I'd be glad to look at it and help analyse it but, without that I can't really help beyond telling you where to look.

    Best Regards,

    Chad

  • ok chad 

    I keep you informed

    lopez