Hello
I'm using the CCSv4.2 , BIOS5 and evmc6472 platform.
I want to run two functions in parallel range, the first function is running on the core0 and the second in the others cores, and then re-use the results of these two functions to compute another variable.
/**********************************************************************************************************************/
void main( )
{
CoreNum = CSL_chipReadReg( CSL_CHIP_DNUM );
for(j=0;j<size;j++)
{
buf1[j]=2*j;
buf2[j]=4*j;
}
if ( CoreNum == 0 )
{
sum0=sum(buf1,buf2); // compute the sum of each coeff of *buf1 with *buf2
printf("the sum = %d \n",sum0);
}
else
{
prod0=Prod(buf1,buf2); // compute the sum of multiplying each coeff of *buf1 with *buf2
printf("the result = %d \n",prod0);
}
div=(float)prod0/sum0;
printf("result of the division = %f \n",div);
}
/****************************************************************************************************************/
the problem is that the result of the division "div" is not correct because I think that the two functions have not the same time of execution.so the core compute the div
while the core 1 doesn't terminate the computing of prod0. so could you tell me what command I have to add in the code to compute the div when the result sum0 and prod0 are ready both.
Please can you tell me how can I verify that the two function are executed in parallel...I tried by using the CPU Load graph but I didn't see any think.
I will be very thankfull..
Cordialy
David