[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[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/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/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 - How to optimize the run time on the Epiphany?

How to optimize the run time on the Epiphany?

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

How to optimize the run time on the Epiphany?

Postby dev » Tue Jan 24, 2017 9:26 pm

Hello Parallella Community,

currently I am developing on the Parallella board for a student project. The task is quite simple. There is an update function which gets called every program loop for a lot of elements. Additionally the updates can be performed completely parallel.

Thus I programmed following sequence:
Host: start -> init -> (*) ->send signal to cores -> process results -> init core memory -> goto (*)
Cores: start -> init -> (*) -> wait for signal -> process N elements -> goto (*)

The software runs quite smooth, but I have difficulties with run times.

Here is an example output of my timing comparison procedure:
#; Starting host application ...
HOST simpleMath1 :: number of elements: 16384 loops: 8 measured time: 1400us
DEV worker1 simpleMath1 :: number of elements: 16384 loops: 8 measured time: 350us
HOST simpleMath2 :: number of elements: 16384 loops: 8 measured time: 11262us
HOST simpleMath3 :: number of elements: 16384 loops: 8 measured time: 10948us
DEV worker2 simpleMath2 :: number of elements: 16384 loops: 8 measured time: 5643153us
DEV worker3 simpleMath3 :: number of elements: 16384 loops: 8 measured time: 5645088us
DEV worker4 simpleMath3 :: number of elements: 16384 loops: 8 measured time: 4825429us
DEV worker4o simpleMath3 :: number of elements: 16384 loops: 8 measured time: 3800140us
#; Cleanup and finish application!

simpleMath1 is just adding two floating point numbers which is running on the Epiphany much faster.
simpleMath2 till simpleMath3 is mathematically the same calculation but the functions differs in how the parameters are transferred. worker4 follows there a different strategy and worker4o has additionally compiler optimizations activated. But still the HOST version is way faster than the DEVICE complement.

Since I am accessing the memory directly and using pointers in the following example I do not know how to improve the run time further. Every help and tips how to do this or how to avoid the problem are welcome!

For further investigation I have attached the source code of the upper example. The simpleMath.h contains the used mathematical functions. e_worker[1,2,3,4].c defines the different ways to manage the cores memory. And the main.c just executes sequentially the upper mentioned tests. The tests are separated by "////..///".

Thanks!
Attachments
example.zip
(5.79 KiB) Downloaded 1152 times
dev
 
Posts: 4
Joined: Sat Aug 27, 2016 9:18 am

Re: How to optimize the run time on the Epiphany?

Postby dev » Wed Jan 25, 2017 9:56 am

dev
 
Posts: 4
Joined: Sat Aug 27, 2016 9:18 am

Re: How to optimize the run time on the Epiphany?

Postby sebraa » Wed Jan 25, 2017 2:32 pm

The Epiphany does not support division or double precision. If you divide by a constant, you might be able to formulate your problem as a multiplication (with the inverse) instead. Also, make sure that you don't tie in double precision arithmetics (i.e. due to constants being double by default). Lastly, use compiler flags to allow more aggressive operations (-ffast-math -fsingle-precision-constant etc.).

Do know that all of these tricks will probably reduce the accuracy of your results, and may produce unexpected results when used with extremely big or small values (denormal numbers, NaN).

Also, make sure that the library calls (e.g. for division) will be executed from local memory and not from shared memory.
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm

Re: How to optimize the run time on the Epiphany?

Postby dev » Wed Jan 25, 2017 5:16 pm

Attachments
example.zip
(13.06 KiB) Downloaded 1133 times
dev
 
Posts: 4
Joined: Sat Aug 27, 2016 9:18 am

Re: How to optimize the run time on the Epiphany?

Postby sebraa » Wed Jan 25, 2017 6:47 pm

sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 14 guests

cron