File: Group_excl.java

package info (click to toggle)
mpj 0.44%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,600 kB
  • ctags: 6,809
  • sloc: java: 49,853; ansic: 2,508; xml: 596; sh: 311; perl: 156; makefile: 26
file content (37 lines) | stat: -rwxr-xr-x 1,162 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
33
34
35
36
37
import mpjdev.*;
import mpjbuf.*;
import mpi.*;
import java.util.Arrays;

public class Group_excl {

	public static void main(String args[]) throws Exception{		

		MPI.Init(args);		
		Group grp = MPI.COMM_WORLD.Group();
		System.out.print("<"+grp.Rank()+">");		
		if(grp.Rank() == 0)
			System.out.println("size<"+grp.Size()+">");
		int[] excl = {5,6,0,2,3};
		Group ngrp = grp.Excl(excl);
		try { Thread.currentThread().sleep(1000); }catch(Exception e){}		
		if(ngrp != null) {
			if(ngrp.Rank() == 0) {				
				//System.out.print("[ngrpsize<"+ngrp.Size()+">]");
			}

			//System.out.print("gr<"+grp.Rank()+">:ngr<"+ngrp.Rank()+">\n");				
			System.out.print("gr<"+grp.ids[grp.Rank()].rank()+">:ngr<"+ngrp.ids[ngrp.Rank()].rank()+">\n");	
			System.out.print("gr<"+grp.ids[grp.Rank()].uuid()+">:ngr<"+ngrp.ids[ngrp.Rank()].uuid()+">\n");	
			for(int i=0 ; i<ngrp.ids.length ; i++) {
				System.out.print("ngr{"+ngrp.Rank()+"}<"+ngrp.ids[i].uuid()+">\n");	
			}
				
		}else {
			//System.out.print("<"+grp.Rank()+">");		
		}			
		
		try { Thread.currentThread().sleep(1000); }catch(Exception e){}		
		MPI.Finalize();
	}
}