contrib/nitester: each Processor know its rank
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 12 Dec 2014 19:55:35 +0000 (14:55 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 12 Dec 2014 20:09:33 +0000 (15:09 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/nitester/src/nitester.nit

index 37b5594..94e5279 100644 (file)
@@ -31,6 +31,9 @@ abstract class Processor
        # Controller rank is always 0
        var controller_rank: Rank = 0.rank
 
+       # Rank on this processor
+       fun rank: Rank is abstract
+
        # Where to store data for transfer between nodes
        #
        # Require: `buffer.length % 4 == 0`
@@ -173,6 +176,8 @@ end
 class Controller
        super Processor
 
+       redef fun rank do return controller_rank
+
        # Id as `Int` of the next task to distribute
        var next_task_id = 0
 
@@ -326,7 +331,7 @@ class Worker
        super Processor
 
        # The `Rank` of `self`
-       var rank: Rank
+       redef var rank: Rank
 
        # Compilation directory
        var comp_dir = "/dev/shm/nit_compile{rank}" is lazy