[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
Page 1 of 1

use different number of cores

PostPosted: Mon Dec 08, 2014 2:08 am
by howardhh

Re: use different number of cores

PostPosted: Mon Dec 08, 2014 5:22 am
by howardhh
And are the cores distributed in this order?
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15

Re: use different number of cores

PostPosted: Mon Dec 08, 2014 1:32 pm
by sebraa
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. :-)

Re: use different number of cores

PostPosted: Mon Dec 08, 2014 7:13 pm
by eliecer
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?

Re: use different number of cores

PostPosted: Tue Dec 09, 2014 2:44 am
by howardhh
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?

Re: use different number of cores

PostPosted: Tue Dec 09, 2014 9:12 am
by eliecer
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.

Re: use different number of cores

PostPosted: Tue Dec 16, 2014 7:15 am
by howardhh
Thanks for your reply, eliecer!

Re: use different number of cores

PostPosted: Mon Aug 24, 2015 2:14 pm
by m_labbaf
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;