Practice meeting, July 30th (rescheduled from Aug 6th)

15 views
Skip to first unread message

Lyle Kopnicky

unread,
Jul 22, 2018, 4:24:47 PM7/22/18
to pdxfunc
Last time, we went briefly over Chapter 1, and got through the section on rpar/rseq in Chapter 2. We'll discuss the rest of Chapter 2, starting with "Parallelizing a Sudoku Solver", in Parallel and Concurrent Programming in HaskellPlease read it beforehand. You may wish to try running the code examples from the book. At the meeting anyone will be able to present and contribute to the discussion.

Several people said they had trouble getting Threadscope running, so I'm going to look into that.

Location:

Collective Agency
511 SW 10th Ave
Portland, OR

Date:
July 30th, 2018

Time:
6:30pm - 8:30pm

We'll be in the 12th floor conference room, not in the Collective Agency suite. Take the elevator to the 12th floor and walk around to the rear of the floor. It's behind the glass door with the sign that says "Fire Escape".


RSVP at:

karoyakani

unread,
Jul 25, 2018, 6:24:50 PM7/25/18
to pdxfunc
ThreadScope v.0.2.11.1 binary from (https://github.com/haskell/ThreadScope/releases/download/v0.2.11.1/threadscope.linux.gz : released 14 days ago) installed and working seemingly fine on Linux (Ubuntu 16.04.4 LTS - GNU/Linux 4.4.0-1062-aws x86_64).

Although I still suffer from a problem (silent death at runtime: I assume it's a gtk+ error) on my Windows 10.

-TJ

Lyle Kopnicky

unread,
Jul 30, 2018, 9:48:10 PM7/30/18
to pdx...@googlegroups.com
Glad you got it working on Linux, TJ!

After many hours, I have finally gotten ThreadScope running on my Mac.

First of all, the best instructions are here: https://github.com/haskell/ThreadScope.

But, you can’t (currently) just brew install gtk-mac-integration. You have to install gtk+, but the current version of gtk-mac-integration is broken. If you install it then it will just immediately crash. The issue is described here: https://github.com/haskell/ThreadScope/issues/87. So for now you need to go to the linked pull request: https://github.com/Homebrew/homebrew-core/pull/29979. Follow the instruction from the comment: "you can brew edit gtk-mac-integration then make the same change as this PR. Then uninstall it and reinstall it with --HEAD.”

It sounds like the issue has been fixed in the latest gtk-mac-integration, but it hasn’t made it into the stable branch yet. So eventually this problem will go away.

I was able to use the pre-built binary, didn’t have to build it. But after downloading and unpacking it, I had to set the executable flag.

I was also able to build it… but I won’t bore anyone with how I got that to work, since it didn’t solve my real problem, which was with gtk-mac-integration.

Next I’ll see if I can get it working on Windows!

--
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,
Jul 30, 2018, 9:48:55 PM7/30/18
to pdx...@googlegroups.com
Got ThreadScope working on Windows, too!

1) Install MSYS2 (https://www.msys2.org/)
2) Run MSYS2 and install gtk2:
    pacman -S mingw-w64-x86_64-gtk2
3) Download the latest Windows binary from https://github.com/haskell/ThreadScope/releases and unzip it. Put it somewhere in your $PATH.
4) Also make sure that /mingw64/bin is in your $PATH.

You may need to edit your .profile or .bash_profile within MSYS2 to change your $PATH. I installed vim to make that easier:

    pacman -S msys/vim

I ran everything from within the MSYS2 shell.

This also took me an hour or so to figure out and I had to search for error messages. Found this: https://github.com/haskell/ThreadScope/issues/76.

Lyle Kopnicky

unread,
Jul 31, 2018, 2:09:13 AM7/31/18
to pdx...@googlegroups.com
Good meeting tonight! Nice to have some new and returning folks.

A question came up in the meeting about how to run rpar over all the items in a list. I said it could be done using mapM. Later in the chapter, the author defined parMap recursively to solve the problem. I’ve verified that my mapM solution works just as well. In the sudoku3.hs code, these two lines are equivalent:

    solutions = runEval (parMap solve puzzles)
    solutions = runEval (mapM (rpar . solve) puzzles)

So, one could define

    parMap f = mapM (rpar . f)

which is the same as

    parMap = mapM . (rpar .)

… if you really want to go point-free. But personally I find that hard to follow.

- Lyle
Reply all
Reply to author
Forward
0 new messages