[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - use different number of cores

use different number of cores

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

use different number of cores

Postby howardhh » Mon Dec 08, 2014 2:08 am

howardhh
 
Posts: 28
Joined: Fri Aug 22, 2014 1:50 am

Re: use different number of cores

Postby howardhh » Mon Dec 08, 2014 5:22 am

And are the cores distributed in this order?
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
howardhh
 
Posts: 28
Joined: Fri Aug 22, 2014 1:50 am

Re: use different number of cores

Postby sebraa » Mon Dec 08, 2014 1:32 pm

The cores are distributed in a 2D fashion, so it is more like
(0,0) (0,1) (0,2) (0,3)
(1,0) (1,1) (1,2) (1,3)
(2,0) (2,1) (2,2) (2,3)
(3,0) (3,1) (3,2) (3,3)

Your host code uses two indices to refer to the cores (i and j). Do the same on the eCores and you should be fine. There is no need to count from 0..15 unless you want to. :-)
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm

Re: use different number of cores

Postby eliecer » Mon Dec 08, 2014 7:13 pm

Hi,

If you want to use the function e_get_global_address() to know the address in a core, you need its coordinates. The coordinates that you need aren't the coordinates in the mesh, you need the coordinates of the core in the work group.

I recommend you to use, first the function e_get_coreid() to know the ID of the core. Next you use the function e_coords_from_coreid() to know its coordinates in the work group. Finally, you can use the function e_get_global_address().

Remember the documentation, this function is for transforms a local pointer ptr into the matching address on a neighbor core. If either row or col are E_SELF, or they are equal to the caller core’s own coordinates, then the function calculates the global version of the local address. But, you need a local pointer, for example, one pointer to the bank 2.

Is this that you need? Did I answer your question?
User avatar
eliecer
 
Posts: 25
Joined: Fri Sep 26, 2014 1:20 am
Location: Málaga, Spain

Re: use different number of cores

Postby howardhh » Tue Dec 09, 2014 2:44 am

Hi sebraa & eliecer,

Thank you very much for your reply.
I think I have solved it. What I did was right actually, except the coordinates in "e_get_global_address".
The coordinates calculated by "j/2,j%4" was wrong, it should be "j/4,j%4". Then it can match the cores opened on the host side by "e_open(0,0,2,4). And the cores we used here are from (0,0) to (1,3) as sebraa said.

And dear eliecer, the function e_get_coreid() and e_coords_from_coreid() can't get the coordinates of other cores but the coordinates of itself, is that right?
howardhh
 
Posts: 28
Joined: Fri Aug 22, 2014 1:50 am

Re: use different number of cores

Postby eliecer » Tue Dec 09, 2014 9:12 am

Sorry, I'm from Spain and my english is no good.

You can to use the function e_get_coreid() in a core to know its ID. Then, you can to use this ID with e_coords_from_coreid() to know its the coordinates.

If you want to know the coordinates of other neighbor core you must to use the function e_neighbor_id(). You must to take care with this function, This function is limited to workgroup dimensions (rows and columns) which are powers of 2, i.e., 2, 4, 8, etc.
User avatar
eliecer
 
Posts: 25
Joined: Fri Sep 26, 2014 1:20 am
Location: Málaga, Spain

Re: use different number of cores

Postby howardhh » Tue Dec 16, 2014 7:15 am

Thanks for your reply, eliecer!
howardhh
 
Posts: 28
Joined: Fri Aug 22, 2014 1:50 am

Re: use different number of cores

Postby m_labbaf » Mon Aug 24, 2015 2:14 pm

Also you can use below code to find the row and column of the cores:
unsigned int row = e_group_config.core_row;
unsigned int col = e_group_config.core_col;
unsigned int CORE_NUM = row * 4 + col;
m_labbaf
 
Posts: 20
Joined: Sun Mar 29, 2015 7:25 am


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 13 guests

cron