Skip to content

Commit

Permalink
added Chapel
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisMitchell committed Jul 15, 2017
1 parent b54f000 commit 2f6f19e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
25 changes: 25 additions & 0 deletions usr/share/tio.run/languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,31 @@
},
"update": "piggyback"
},
"chapel": {
"categories": [
"practical"
],
"encoding": "UTF-8",
"link": "http://chapel.cray.com/",
"name": "Chapel",
"tests": {
"helloWorld": {
"request": [
{
"command": "F",
"payload": {
".code.tio": "write(\"Hello, World!\");"
}
}
],
"response": "Hello, World!"
}
},
"unmask": [
"cflags"
],
"update": "git"
},
"charcoal": {
"categories": [
"recreational"
Expand Down
5 changes: 5 additions & 0 deletions wrappers/chapel
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

ln -f .code.tio .code.tio.chpl
/opt/chapel/bin/chpl "${TIO_CFLAGS[@]}" -o .bin.tio .code.tio.chpl
./.bin.tio "$@" < .input.tio

2 comments on commit 2f6f19e

@bradcray
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DennisMitchell : I think that if you add the following environment variable to the script above sometime prior to the execution step on line 5, it would enable multitasking within Chapel:

export QT_HWPAR=4

(or 2 or whatever number of threads you are comfortable with -- this is essentially overriding the amount of thread-level parallelism supported by our threading layer by default). Let me know if you'd prefer to get feedback like this via a PR rather than a comment.

@bradcray
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DennisMitchell: Here are the additional changes I believe we'll want in order to enable GASNet to run in an "oversubscribed locales" mode (multiple processes on the one server node):

export GASNET_SPAWNFN=L
export GASNET_ROUTE_OUTPUT=0
export GASNET_QUIET=Y

Respectively, these tell GASNet to:

  • spawn the processes locally
  • route all console output back to the original process
  • squash warnings saying "this isn't a smart mode to use GASNet in for performance"

I think that these should be sufficient, though there may be other system-specific settings we need to make.

The test of this step (which I'm happy to do if you like) is to take a multi-locale code like the one you cut and pasted from the chapel.cray.com front page last time and:

  • add --comm=gasnet to the compilation flags
  • add -nl 2 to the execution flags

Please sign in to comment.