Skip to content

Commit 4e99d2b

Browse files
author
Josh Milthorpe
committed
updated scripts and added examples compile script
Updated scripts to new versions of APGAS, Akka. Also removed unusual system-specific config for Java8. Added a section on Terminology to README file as well as how to run example programs.
1 parent d9f3f83 commit 4e99d2b

17 files changed

+48
-48
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ in the same way when using sbt or starting from a shell.
1515
- The [Scala IDE](http://scala-ide.org/download/current.html) Eclipse plugins.
1616
- (Optional for Akka examples) [Akka](http://akka.io/) 2.4.1
1717

18+
Terminology
19+
---
20+
21+
A *Place* is a mutable, shared-memory region combined with a set of worker threads operating on this memory. A single application typically runs over a collection of places, where each place is implemented as a separate JVM.
22+
23+
A *task* is a sequence of computations, specified as a block. Each task is bound to a particular place. A task can spawn local and remote tasks, i.e. tasks to be executed in the same place or elsewhere.
24+
25+
A local task shares the heap of the parent task. A remote task executes on a snapshot of the parent task’s heap captured when the task is spawned. Global references are copied as part of the snapshot but the target objects are not copied. A global reference can only be dereferenced at the place of the target object where it resolves to the original object.
26+
1827
Constructs
1928
---
2029

@@ -41,9 +50,11 @@ For a type `T` that cannot extend `PlaceLocal`, the library defines `GlobalRef[T
4150

4251
For full details of the APGAS programming model, see the reference paper below.
4352

44-
Notes
53+
Running APGAS Scala Programs
4554
---
4655

56+
The `scripts` directory contains shell scripts to compile the library and example programs, and to run the examples.
57+
4758
Projects that only use `async` and `finish` (i.e. no distribution) will work just fine. Projects running distributed computations must ensure that the `java` command starting the other processes includes `scala-library.jar` in the classpath.
4859

4960
Licensing Terms

apgas.scala.examples/src/apgas/scala/examples/HelloPatterns.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ object HelloPatterns {
2222
}
2323

2424
def main(args : Array[String]) : Unit = {
25-
// PS: I need this because java is not the default on my system..
26-
System.setProperty(Configuration.APGAS_JAVA, "java8")
27-
2825
if (System.getProperty(Configuration.APGAS_PLACES) == null) {
2926
System.setProperty(Configuration.APGAS_PLACES, "4")
3027
}
@@ -61,4 +58,4 @@ object HelloPatterns {
6158

6259
println(fib(10))
6360
}
64-
}
61+
}

apgas.scala.examples/src/apgas/scala/examples/HelloPlaceLocal.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ object HelloPlaceLocal {
2121
def main(args : Array[String]) : Unit = {
2222
case class Box(i : Int) extends PlaceLocal
2323

24-
// PS: I need this because java is not the default on my system..
25-
System.setProperty(Configuration.APGAS_JAVA, "java8")
26-
2724
if (System.getProperty(Configuration.APGAS_PLACES) == null) {
2825
System.setProperty(Configuration.APGAS_PLACES, "4")
2926
}
@@ -40,4 +37,4 @@ object HelloPlaceLocal {
4037
}
4138
}
4239
}
43-
}
40+
}

apgas.scala.examples/src/apgas/scala/examples/HelloWorld.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ object HelloWorld {
2020
System.setProperty(Configuration.APGAS_PLACES, "4")
2121
}
2222

23-
// PS: I need this because java is not the default on my system..
24-
System.setProperty(Configuration.APGAS_JAVA, "java8")
25-
2623
apgas {
2724
finish {
2825
for(place <- places) {
@@ -35,4 +32,4 @@ object HelloWorld {
3532

3633
println(s"Running main at ${here} of ${places.size} places")
3734
}
38-
}
35+
}

apgas.scala.examples/src/apgas/scala/examples/ResilientHelloWorld.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ object ResilientHelloWorld {
2727
System.setProperty(Configuration.APGAS_PLACES, "4")
2828
}
2929

30-
// PS: I need this because java is not the default on my system..
31-
System.setProperty(Configuration.APGAS_JAVA, "java8")
32-
3330
apgas {
3431
var i: Int = 0
3532
while (true) {
@@ -62,4 +59,4 @@ object ResilientHelloWorld {
6259

6360
println(s"Running main at ${here} of ${places.size} places")
6461
}
65-
}
62+
}

apgas.scala.examples/src/apgas/scala/examples/uts/Common.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ package apgas.scala.examples.uts
1414
object Common {
1515
def setup(numPlaces : Int = 1) : Unit = {
1616
import apgas.Configuration
17-
// PS: I put my machine-specific config here...
18-
// I need this because java is not the default on my system..
19-
System.setProperty(Configuration.APGAS_JAVA, "java8")
2017
if (System.getProperty(Configuration.APGAS_PLACES) == null) {
2118
System.setProperty(Configuration.APGAS_PLACES, "" + numPlaces)
2219
}
@@ -52,4 +49,4 @@ object Common {
5249
}
5350
}
5451
}
55-
}
52+
}

scripts/clean.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/common.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
# Make sure this is Java 8
2-
JAVA=java8
3-
JAVAC=javac8
2+
JAVA=java
3+
JAVAC=javac
44
SCALAC=scalac
55

6-
# Where you keep you apgas SVN checkout.
7-
APGAS_COMMON_HOME=${HOME}/apgas
6+
# Where you keep you apgas Git checkout (see
7+
APGAS_COMMON_HOME=${X10_HOME}
88

99
# Where you keep you apgas-scala Git checkout.
10-
APGAS_SCALA_COMMON_HOME=${HOME}/workspace
10+
APGAS_SCALA_COMMON_HOME=${HOME}/apgas-scala
1111

1212
# Where you keep Scala. Should have a lib, bin, etc. subdir.
13-
SCALA_HOME=${HOME}/software/scala/current
13+
SCALA_HOME=${HOME}/scala
1414
# Where you keep Akka, should have a lib/akka subdir.
15-
AKKA_HOME=${HOME}/software/akka/akka-2.3.9
16-
17-
15+
AKKA_HOME=${HOME}/opt/akka-2.4.1
1816

1917
# The rest depends only on the above.
2018
APGAS_HOME=${APGAS_COMMON_HOME}/apgas
2119
APGAS_EXAMPLES_HOME=${APGAS_COMMON_HOME}/apgas.examples
22-
APGAS_IMPL_HOME=${APGAS_COMMON_HOME}/apgas.impl
2320

2421
APGAS_SCALA_HOME=${APGAS_SCALA_COMMON_HOME}/apgas.scala
2522
APGAS_SCALA_EXAMPLES_HOME=${APGAS_SCALA_COMMON_HOME}/apgas.scala.examples
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
source common.sh
4+
5+
mkdir -p ${APGAS_SCALA_EXAMPLES_HOME}/bin
6+
7+
cd ${APGAS_SCALA_EXAMPLES_HOME} && ${SCALAC} -d bin -classpath "bin:${AKKA_HOME}/lib/akka/*:${APGAS_HOME}/lib/apgas.jar:${APGAS_SCALA_HOME}/bin" `find src -name "*.scala" -type f`

scripts/compile-apgas-scala.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
source common.sh
44

5-
mkdir -p bin
5+
mkdir -p ${APGAS_SCALA_HOME}/bin
66

7-
${SCALAC} -d bin -classpath "bin:${AKKA_HOME}/lib/akka/*" `find ${APGAS_SCALA_COMMON_HOME} -name "*.scala" -type f`
7+
cd ${APGAS_SCALA_HOME} && ${SCALAC} -d bin -classpath "bin:${AKKA_HOME}/lib/akka/*:${APGAS_HOME}/lib/apgas.jar" `find src -name "*.scala" -type f`

0 commit comments

Comments
 (0)