Skip to content

Commit cfcc3ec

Browse files
author
Josh Milthorpe
committed
add license headers to all files; update README with license, referencing and basic info on APGAS constructs; add buildRelease.sh to make a source zip file
1 parent 8baa96b commit cfcc3ec

23 files changed

+287
-5
lines changed

README.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
APGAS for Scala
22
===
33

4-
Scala adapter for the APGAS (Java) library.
4+
An implementation of the Asynchronous Partitioned Global Address Space (APGAS) programming model as an embedded domain-specific language for Scala, based on the [APGAS (Java) library](http://x10-lang.org/software/download-apgas/latest-apgas-release.html).
55

66
Requirements
77
---
@@ -15,10 +15,51 @@ in the same way when using sbt or starting from a shell.
1515
- Hazelcast (see `INSTALL.txt` in `apgas.impl`).
1616
- The [Scala IDE](http://scala-ide.org/download/current.html) Eclipse plugins.
1717

18+
Constructs
19+
---
20+
21+
The two fundamental control structures in APGAS are `asyncAt`, and `finish`:
22+
23+
def asyncAt(place: Place)(body: =>Unit) : Unit
24+
def finish(body: =>Unit) : Unit
25+
26+
The `asyncAt` construct spawns an asynchronous task at place `p` and returns immediately. It is therefore the primitive construct for both concurrency and distribution. The `finish` construct detects termination: an invocation of `finish` will execute its body and then block until all nested invocations of `asyncAt` have completed.
27+
28+
Because spawning local tasks is so common, the library defines an optimized version of `asyncAt` for this purpose with the signature:
29+
30+
def async(body: =>Unit) : Unit
31+
32+
The `PlaceLocal` trait defines a *global* name that is resolved to a separate *local* instance at each place. In an application that defines one `Worker` object per place, for instance, we can write:
33+
34+
class Worker(...) extends PlaceLocal
35+
36+
Initializing an independent object at each place is achieved using the `forPlaces` helper:
37+
38+
val w = PlaceLocal.forPlaces(places) { new Worker() }
39+
40+
For a type `T` that cannot extend `PlaceLocal`, the library defines `GlobalRef[T]`, which acts as a wrapper.
41+
42+
For full details of the APGAS programming model, see the reference paper below.
43+
1844
Notes
1945
---
2046

21-
Projects that only use `async` and `finish` (i.e. no distribution) will work
22-
just fine. Projects running distributed computations need to make sure that the
23-
`java` command starting the other processes will include `scala-library.jar` in
24-
their classpath.
47+
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.
48+
49+
Licensing Terms
50+
---------------
51+
(C) Copyright IBM Corporation 2015.
52+
53+
This program is controlled by the Eclipse Public Licence v1.0.
54+
You may obtain a copy of the License at
55+
http://www.opensource.org/licenses/eclipse-1.0.php
56+
57+
Referencing APGAS for Scala
58+
---
59+
60+
Please cite the following paper if APGAS for Scala helps you in your research:
61+
62+
P. Suter, O. Tardieu and J. Milthorpe (2015)
63+
[Distributed Programming in Scala with APGAS](http://dl.acm.org/citation.cfm?doid=2774975.2774977)
64+
Proceedings of the 6th ACM SIGPLAN Symposium on Scala
65+
DOI:10.1145/2774975.2774977

apgas.scala.examples/src/apgas/scala/examples/Fibonacci.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* This file is part of the X10 project (http://x10-lang.org).
3+
*
4+
* This file is licensed to You under the Eclipse Public License (EPL);
5+
* You may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.opensource.org/licenses/eclipse-1.0.php
8+
*
9+
* (C) Copyright IBM Corporation 2015.
10+
*/
11+
112
package apgas.scala.examples
213

314
import apgas.scala._

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* This file is part of the X10 project (http://x10-lang.org).
3+
*
4+
* This file is licensed to You under the Eclipse Public License (EPL);
5+
* You may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.opensource.org/licenses/eclipse-1.0.php
8+
*
9+
* (C) Copyright IBM Corporation 2015.
10+
*/
11+
112
package apgas.scala.examples
213

314
import apgas.Configuration

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* This file is part of the X10 project (http://x10-lang.org).
3+
*
4+
* This file is licensed to You under the Eclipse Public License (EPL);
5+
* You may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.opensource.org/licenses/eclipse-1.0.php
8+
*
9+
* (C) Copyright IBM Corporation 2015.
10+
*/
11+
112
package apgas.scala.examples
213

314
import apgas.Configuration

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* This file is part of the X10 project (http://x10-lang.org).
3+
*
4+
* This file is licensed to You under the Eclipse Public License (EPL);
5+
* You may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.opensource.org/licenses/eclipse-1.0.php
8+
*
9+
* (C) Copyright IBM Corporation 2015.
10+
*/
11+
112
package apgas.scala.examples
213

314
import apgas.Configuration

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* This file is part of the X10 project (http://x10-lang.org).
3+
*
4+
* This file is licensed to You under the Eclipse Public License (EPL);
5+
* You may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.opensource.org/licenses/eclipse-1.0.php
8+
*
9+
* (C) Copyright IBM Corporation 2015.
10+
*/
11+
112
package apgas.scala.examples
213

314
import apgas.Configuration

apgas.scala.examples/src/apgas/scala/examples/UTQ.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* This file is part of the X10 project (http://x10-lang.org).
3+
*
4+
* This file is licensed to You under the Eclipse Public License (EPL);
5+
* You may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.opensource.org/licenses/eclipse-1.0.php
8+
*
9+
* (C) Copyright IBM Corporation 2015.
10+
*/
11+
112
package apgas.scala.examples;
213

314
import apgas.scala._

apgas.scala.examples/src/apgas/scala/examples/kmeans/Common.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* This file is part of the X10 project (http://x10-lang.org).
3+
*
4+
* This file is licensed to You under the Eclipse Public License (EPL);
5+
* You may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.opensource.org/licenses/eclipse-1.0.php
8+
*
9+
* (C) Copyright IBM Corporation 2015.
10+
*/
11+
112
package apgas
213
package scala.examples
314
package kmeans

apgas.scala.examples/src/apgas/scala/examples/kmeans/KMeans.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* This file is part of the X10 project (http://x10-lang.org).
3+
*
4+
* This file is licensed to You under the Eclipse Public License (EPL);
5+
* You may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.opensource.org/licenses/eclipse-1.0.php
8+
*
9+
* (C) Copyright IBM Corporation 2015.
10+
*/
11+
112
package apgas.scala.examples
213
package kmeans
314

apgas.scala.examples/src/apgas/scala/examples/kmeans/KMeansAkka.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* This file is part of the X10 project (http://x10-lang.org).
3+
*
4+
* This file is licensed to You under the Eclipse Public License (EPL);
5+
* You may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.opensource.org/licenses/eclipse-1.0.php
8+
*
9+
* (C) Copyright IBM Corporation 2015.
10+
*/
11+
112
package apgas.scala.examples.kmeans
213

314
import akka.actor._

0 commit comments

Comments
 (0)