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