Do I need to reset the cores?

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Do I need to reset the cores?

Postby Gusvinhal » Mon Sep 11, 2017 5:40 pm

Hi!

I've made a program that calls the same core (0,0, for example) n times. Do I need call the e_reset_group() everytime before I call e_start()? When I call for the second time whitout use e_reset_group(), the code is executed from the begining (inside de core) or no?

Thank you very much!
Gustavo.
Gusvinhal
 
Posts: 13
Joined: Thu Apr 06, 2017 6:35 pm

Re: Do I need to reset the cores?

Postby claudio4parallella » Thu Sep 14, 2017 2:38 pm

Hi Gustavo,

I cannot tell you that I do answer to your question, I may only share my experience.

My cycle is:

INIT
e_init(NULL);
e_reset_system();
e_get_platform_info(&platform);

OPEN
e_open(&dev, 0, 0, platform.rows, platform.cols);

ALLOC shared memory (if used or necessary by your application)
e_shm_alloc(&mbuf, ShmName, ShaMemSize);
e_shm_attach(&mbuf, ShmName);

LOAD DEVICE PROGRAMS (also different by each core)
e_load(e_prg[k], &dev, row, col, platform.rows, platform.cols, E_FALSE) )

WRITE N INPUT DATA by each core
e_write(&dev, i, j, (unsigned)adr, &numInput[core], 4*sizeof(int));
e_write(&dev, i, j, (unsigned)adr, &coreInput[k][core], 4*sizeof(float));

CLEAR FLAG by each core
e_write(&dev, i, j, (unsigned)adr_clr, &clr, sizeof(clr));

START by each core or all in one
e_start(&dev, row,col);


***MAIN LOOP
***--> check if each core has done
e_read(&dev, i, j, (unsigned)adr_clr, &done[i*platform.rows+j], sizeof(int));
***--> IF DONE READ OUTPUT by each core
e_read(&dev, 0, 0, (unsigned)adr_output, &valueOutput, memSize*sizeof(int));
***-->IF ALL DONE STOP all cores using clear flag
e_write(&dev, i, j, (unsigned)adr_clr, &clr, sizeof(clr));
**-->THEN RESTART CORES
e_start(&dev, row,col);
**--> on running by each core or by Host Test condition to exit MAIN LOOP

END

On the Device side:

INIT
READ INPUT
MAIN LOOP
Code: Select all
while(flag==1)
{
   calculus();
   done ();
   idle();
}
return EXIT_SUCCESS;



This cycle I made does work: without clearing flag to stop cores I cannot read the output of the cores from local core memory.
The loop is continuous, each core could start / stop any other core.

Do not esitate to suggest me improvements or corrections.

My best
claudio4parallella
 
Posts: 55
Joined: Thu Aug 10, 2017 3:48 pm

Re: Do I need to reset the cores?

Postby Gusvinhal » Mon Sep 18, 2017 1:41 pm

Hi claudio4parallella,

In my code I send some data to core, read the results and send more data. My question is: I need to reset the core after send more data? It initializes and execute the code from begin if I do not reset the core? = /

Thanks!
Gusvinhal
 
Posts: 13
Joined: Thu Apr 06, 2017 6:35 pm


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 5 guests