Communication
PCJ.broadcast() - Sends data from one PCJ thraed to all other threads.
@Storage(PcjExample.class)
enum Shared { a }
public double a;
...
if (PCJ.myId() == 0 ) PCJ.broadcast(a, Shared.a)
PCJ.waitFor(Shared.a);PCJ.put() - Sends data from one PCJ thraed to another PCJ threads (PCJ thread - sends data to PCJ thread 1)
@Storage(PcjExample.class)
enum Shared { a }
public double a;
...
if (PCJ.myId() == 0 ) PCJ.put(a, 1, Shared.a);PCJ.put() - Gets data from anether PCJ thraed (form PCJ thread 1)
@Storage(PcjExample.class)
enum Shared { a }
public double a;
...
if (PCJ.myId() == 1 ) PCJ.get(a, 0, Shared.a);PCJ.reduce() - Gathers values from all PCJ threads and performs reduction (eg. sum).
PCJ.collect() - Gathers values from all PCJ threads
Last updated
Was this helpful?