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);
}
}
|