COPRTHR 2 Discussion

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

COPRTHR 2 Discussion

Postby jar » Thu Apr 28, 2016 7:59 pm

Many of you have been using COPRTHR 1.6 or are at least aware of it. Full disclosure: I did not develop the COPRTHR SDK, but have been involved in testing and usability/feature feedback as it relates to my work. I have no financial interest.

Compared to version 1.6, I feel it's quite revolutionary in addressing programmability and performance for the Epiphany architecture.

Brown Deer Technology has made a pre-release of COPRTHR 2.0 available for download. It's free software for personal use and research. It requires the 2015.1 image at the moment.
http://www.browndeertechnology.com/reso ... prthr2.htm (*Edit* new link)

There is also a paper I co-authored "Advances in Run-Time Performance and Interoperability for the Adapteva Epiphany Coprocessor" that describes the details of the advanced features.

In my personal experience, the COPRTHR SDK addresses some of the shortcomings of the eSDK, namely:
  • printf support for the Epiphany core output/debugging
  • extremely low latency offload execution
  • memory management by allocating core memory at runtime and unified virtual addressing from both host/device
  • user-defined code placement and dynamic calls for very tiny binaries
  • argc/argv main function support
There are many other neat new features for software developers to use. Writing a parallel "hello world" application for Epiphany can be completed in ~5 lines of device code (and no host code!).
Last edited by jar on Fri Jul 01, 2016 7:57 pm, edited 1 time in total.
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: COPRTHR 2 Discussion

Postby jar » Thu Apr 28, 2016 9:00 pm

Here's an example of how easy it can be to write a parallel application for Epiphany. In this case, we'll write a modified "Hello, World" code with some extra output.

hello.c:
Code: Select all
#include <host_stdio.h>
int main(int argc, char* argv[])
{
   phost_printf("%s (process %d of %d): Hello, World!\n", argv[0], coprthr_get_thread_id(), coprthr_get_num_threads());
   return 0;
}


compile:
Code: Select all
coprcc -fhost -L/usr/local/browndeer/coprthr2/lib -lcoprthr_hostcall -lesyscall hello.c -o hello.x


run:
Code: Select all
coprsh -r err -np 16 ./hello.x


output:
Code: Select all
./hello.x (process 0 of 16): Hello, World!
./hello.x (process 1 of 16): Hello, World!
./hello.x (process 2 of 16): Hello, World!
./hello.x (process 3 of 16): Hello, World!
./hello.x (process 4 of 16): Hello, World!
./hello.x (process 5 of 16): Hello, World!
./hello.x (process 6 of 16): Hello, World!
./hello.x (process 7 of 16): Hello, World!
./hello.x (process 8 of 16): Hello, World!
./hello.x (process 9 of 16): Hello, World!
./hello.x (process 10 of 16): Hello, World!
./hello.x (process 11 of 16): Hello, World!
./hello.x (process 12 of 16): Hello, World!
./hello.x (process 13 of 16): Hello, World!
./hello.x (process 14 of 16): Hello, World!
./hello.x (process 15 of 16): Hello, World!
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: COPRTHR 2 Discussion

Postby nickoppen » Fri Apr 29, 2016 2:47 am

This looks like a huge advance. I'll give it a go on my old 2015.1 image.
Sharing is what makes the internet Great!
User avatar
nickoppen
 
Posts: 266
Joined: Mon Dec 17, 2012 3:21 am
Location: Sydney NSW, Australia

Re: COPRTHR 2 Discussion

Postby cmcconnell » Fri Apr 29, 2016 6:29 pm

The licensing changes seem like a bit of a worry though. :( ( the lack of source code to study, plus the potential need to pay for some uses.)
License. The COPRTHR-2 SDK is free for personal use and research. Licensing and support options are available for commercial use and applications.

Does the above mean that it will not be permissible to create and publish open source code ('applications') using the COPRTHR 2 SDK, without having purchased a license? [Hopefully not, but it does sound that way on first reading.]
Colin.
cmcconnell
 
Posts: 99
Joined: Thu May 22, 2014 6:58 pm

Re: COPRTHR 2 Discussion

Postby jar » Fri Apr 29, 2016 7:49 pm

cmcconnell wrote:Does the above mean that it will not be permissible to create and publish open source code ('applications') using the COPRTHR 2 SDK, without having purchased a license? [Hopefully not, but it does sound that way on first reading.]


My interpretation is if you are publishing an open source code based on the SDK, you should be fine. If you are redistributing the SDK as an application binary or you are using it for commercial purchases, you should contact the developer and ask. For most people, the terms probably won't effect you. As for studying your code, there are binary analysis tools within the SDK that can help you understand binaries. There is also a debugger for when your program isn't working as intended. I have found these useful combined with the GNU e-objdump tool. But for studying the SDK, ya, obviously it will be more challenging because it is not open source.
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: COPRTHR 2 Discussion

Postby cmcconnell » Fri Apr 29, 2016 8:23 pm

jar wrote:
cmcconnell wrote:As for studying your code, there are binary analysis tools within the SDK that can help you understand binaries. There is also a debugger for when your program isn't working as intended. I have found these useful combined with the GNU e-objdump tool. But for studying the SDK, ya, obviously it will be more challenging because it is not open source.

Yeah, I was only referring to the source of the SDK itself. The previous version was LGPL'd, meaning there was scope to understand how features are implemented as well as to possibly contribute changes.

With regard to the licensing requirements for actually using the SDK, I hope your interpretation is right!
Colin.
cmcconnell
 
Posts: 99
Joined: Thu May 22, 2014 6:58 pm

Re: COPRTHR 2 Discussion

Postby jar » Fri Apr 29, 2016 9:46 pm

I've worked with David on various projects for the better part of a decade and he's a good and reasonable person. Brown Deer Technology isn't some giant corporation trying to use complicated legal shenanigans to generate revenue. It's pretty clear that if you want to use the COPRTHR 2 SDK for your next non-commercial (or open source) application, you're free to do so (this is maybe 99% of what goes on here). If you are building a mobile base station for commercial use or resale using the Epiphany architecture and COPRTHR 2 SDK, contact BDT. If you have other concerns, contact BDT.

If you want to study the SDK, start with the paper I linked in the original post and use the software. Many of the implementation details 'open' for study in that sense.

It is my intention to release a full open source OpenSHMEM implementation for Epiphany that uses both the eSDK and, optionally, the COPRTHR SDK. Preliminary details from around January are available in the paper "Implementing OpenSHMEM for the Adapteva Epiphany RISC Array Processor"

The OpenSHMEM interface and the improvements with the COPRTHR interoperability should dramatically improve application development time, features, and performance for the Epiphany architecture. Imagine running some existing OpenSHMEM applications with no source code changes, just by recompiling. That is what the COPRTHR SDK enables and it isn't possible with any other software.
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: COPRTHR 2 Discussion

Postby drew32 » Fri Apr 29, 2016 10:02 pm

So i'm pretty new to the Paralella and Programming but I can't seem to get this to work.

Code: Select all
./hello.x: error while loading shared libraries: libcoprthr.so: cannot open shared object file: No such file or directory


Every time I try to run the example I get this. I am running the right version of Linux:

Code: Select all
Linux parallella 3.14.12-parallella-xilinx-g40a90c3 #1 SMP PREEMPT Fri Jan 23 22:01:51 CET 2015 armv7l armv7l armv7l GNU/Linux


I removed the original /usr/local/browndeer after zipping it up, then installed COPRTHR-2 via the instructions at: http://www.browndeertechnology.com/anthem/coprthr2_prerelease_doc-20160413.html

I've added both
Code: Select all
export PATH=/usr/local/browndeer/coprthr2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/browneer/coprthr2/lib:$LD_LIBRARY_PATH


to .bashrc for both my user account and root as well. I have even tried running as root to run the program, I still get the same issue. Like I said I'm pretty new to this so I might be missing something simeple in Linux that I just don't know.

Thanks for the help!
drew32
 
Posts: 3
Joined: Mon Apr 18, 2016 4:46 pm

Re: COPRTHR 2 Discussion

Postby cmcconnell » Fri Apr 29, 2016 10:27 pm

export LD_LIBRARY_PATH=/usr/local/browneer/coprthr2/lib:$LD_LIBRARY_PATH

If that is exactly what you have added, then the problem may be a simple spelling mistake: 'browneer'
Colin.
cmcconnell
 
Posts: 99
Joined: Thu May 22, 2014 6:58 pm

Re: COPRTHR 2 Discussion

Postby drew32 » Fri Apr 29, 2016 11:10 pm

Wow I must have looked that over a 100 times and didn't see that. Now the program runs but I am getting a new error:

Code: Select all
COPRTHR-2-CURRENT (Anthem) build 20160427.1249
[2701] clmesg WARNING: esyshost.c(169): hostcall[1] 1025 'halt' sym unresolved
[2701] clmesg WARNING: esyshost.c(169): hostcall[2] 1026 'delay' sym unresolved
[2701] clmesg WARNING: esyshost.c(169): hostcall[16] 1040 'fpurge' sym unresolved
[2701] clmesg WARNING: esyshost.c(212): phostcall[2] 33794 'delay' sym unresolved
[2701] clmesg WARNING: esyshost.c(212): phostcall[16] 33808 'fpurge' sym unresolved
./hello.x (process 0 of 1): Hello, World
Segmentation fault



EDIT: Figured it out.

I was doing ./hello.x when I should of been using coprsh -r err -np 16 ./hello.x


Thanks for helping this newbie out!
drew32
 
Posts: 3
Joined: Mon Apr 18, 2016 4:46 pm

Next

Return to Programming Q & A

Who is online

Users browsing this forum: Majestic-12 [Bot] and 28 guests

cron