Practice meeting, Jan. 21st

5 views
Skip to first unread message

Lyle Kopnicky

unread,
Jan 16, 2019, 6:44:00 PM1/16/19
to pdxfunc
When: Jan. 21st, 6:30-8:30pm
Where: Collective Agency Downtown, Suite 1108, 511 SW 10th Ave, Portland, OR (opposite side of the floor from the elevators)

We'll begin discussing Chapter 5, "Data Parallel Programming with Repa", of Parallel and Concurrent Programming in Haskell. At the meeting anyone will be able to present and contribute to the discussion.

Meetup link to RSVP:

Hope to see you then!

karoyakani

unread,
Jan 21, 2019, 12:57:25 AM1/21/19
to pdxfunc
In the "Example: Image Rotation" I failed to install the "repa-devil" package.
In stead I used Data.Array.Repa.IO.BMP.
rotateimage2.hs
rgb24.bmp

Lyle Kopnicky

unread,
Jan 21, 2019, 1:35:59 AM1/21/19
to pdxfunc
Thanks. Yeah, I was having trouble figuring out how to install repa-devil too. There are version conflicts.

--
You received this message because you are subscribed to the Google Groups "pdxfunc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdxfunc+u...@googlegroups.com.
To post to this group, send email to pdx...@googlegroups.com.
Visit this group at https://groups.google.com/group/pdxfunc.
For more options, visit https://groups.google.com/d/optout.

Lyle Kopnicky

unread,
Jan 21, 2019, 7:26:20 PM1/21/19
to pdxfunc
I was able to get repa-devil to build by using an old stack resolver version (which installs an older GHC). I modified the stack.yaml file as follows:


Then I was able to build the program with:

stack build --flag parconc-examples:devil parconc-examples:exe:rotateimage

and run it with:

stack exec rotate image 4 wonky.jpg straight.jpg

I also had to install the DevIL library on my system. On my Mac I did this with:

brew install devil

Lyle Kopnicky

unread,
Jan 22, 2019, 12:06:23 AM1/22/19
to pdxfunc
In the meeting, we tried to get the rotateimage program to produce a transparent alpha channel. I changed the data constructor from RGB to RGBA in the program. That didn’t work - it yielded a run-time pattern match failure.

I managed to get it to work now. When I converted the jpg to png, I had to add an alpha channel. The command (using ImageMagick) is:

convert -alpha set wonky.jpg wonky.png

That gives it an alpha channel, that is set at every pixel. Then when I run the modified rotateimage program on it, it rotates it and leave the unfilled area as transparent, instead of black.

- Lyle

Lyle Kopnicky

unread,
Jan 22, 2019, 12:25:06 AM1/22/19
to pdxfunc
I was also having trouble installing llvm 3.5 in the meeting, which is the version needed for compatibility with the older version of GHC I’m using.

Well, that turned out to be simple. I just downloaded the binaries from http://releases.llvm.org/download.html#3.5.0, and put them in my PATH.

But after compiling with the llvm flag, the programs don’t seem to run any faster.

- Lyle

Lyle Kopnicky

unread,
Jan 22, 2019, 1:36:55 AM1/22/19
to pdxfunc
Correction: I think I was doing something wrong trying to build with llvm using “stack build”. When I built using “stack ghc” I was able to get it to use llvm.

So now I can give better figures for comparison.

fwdense 500 runs in 2.5 seconds without -fllvm, under 1.5 seconds with -fllvm
fwdense1 500 with 2 threads runs in 1.9 seconds without -fllvm, 1.3 seconds with -fllvm
Reply all
Reply to author
Forward
0 new messages