📄 barriertest.java
字号:
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);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -