File: BarrierTest.java

package info (click to toggle)
mpj 0.44%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 7,592 kB
  • sloc: java: 49,853; ansic: 2,508; xml: 596; sh: 311; perl: 156; makefile: 27
file content (32 lines) | stat: -rwxr-xr-x 675 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import mpjdev.*;

public class BarrierTest {

  public BarrierTest(String args[]) throws Exception {

    int REPEAT_TIME = 1;
    Comm.init(args);

    int LOG2N_MAX = 1000000;

    for (int j = 0; j <= REPEAT_TIME; j++) {

      if (Comm.WORLD.id() == 0) {
        Comm.WORLD.nbarrier();
      }
      else {
        //try { Thread.currentThread().sleep(1000*Comm.WORLD.id()); }catch(Exception e){}
        Comm.WORLD.nbarrier();
      }
    }

    System.out.print("Finish <" + Comm.WORLD.id() + ">");
    Comm.finish();

  }

  public static void main(String args[]) throws Exception {
    BarrierTest test = new BarrierTest(args);
  }

}