亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jcomm.java

?? JAMPACK Grid programming
?? JAVA
字號(hào):
/**
 *
 * Program         : JComm.java
 *
 * Author          : Vijayakrishnan Menon
 *
 * Date            : 10th Jan 2006
 *
 * Organization    : Centre for Excellence in 
 *						Computational Engineering and Networking (CEN),
 *                   		Amrita Viswa Vidyapeetham
 *
 **/

package JAMPack;

/** This class implements the Comm interface and embodies the send and receive 
  * functions. The implementation is nominal, other implementations can happen 
  * in future updates or side versions. Note that this class does not implement 
  * collective communication methods like gather, scatter, bcast etc. These 
  * methods will follow later. 
  **/

public class JComm implements Comm {

   /****************************************************************************
	*			       THE SEND METHODS FROM COMM INTERFACE                    *
	****************************************************************************/

	/** generic send 
	 *
	 *	NOTE :	The Objects passed here cannot have annotated codebases of 
	 *			Dynamic class loading done on them the use simple object 
	 *			streaming for marshalling of argument objects. If the receiver 
	 *			does not find the runtime type ofthis object it might throw a 
	 *			ClassNotFoundException. See generic receive in this class for 
	 *			more detailes. 
	 **/
	public void send(Object buff, int destination, JGrid grid, int tag) throws Exception {
		java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_OBJECT_PORT);
				
		java.io.ObjectOutputStream outObj = new java.io.ObjectOutputStream(so.getOutputStream());
		outObj.writeInt(tag);
		outObj.writeInt(grid.getRank());
		outObj.writeObject(buff);
		
		outObj.close();
		so.close();
	}

    public void send(int buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff);
		out.close();
		so.close();
    }

    public void send(int []buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff.length+"\n");
		for(int i=0;i<buff.length;i++)
			out.writeBytes(buff[i]+"\n");
		out.close();
		so.close();
    }

    public void send(float buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff);
		out.close();
		so.close();
    }

    public void send(float []buff, int destination, JGrid grid, int tag) throws Exception {
		java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff.length+"\n");
		for(int i=0;i<buff.length;i++)
			out.writeBytes(buff[i]+"\n");
		out.close();
		so.close();
    }

    public void send(double buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff);
		out.close();
		so.close();
    }

    public void send(double []buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff.length+"\n");
		for(int i=0;i<buff.length;i++)
			out.writeBytes(buff[i]+"\n");
		out.close();
		so.close();
    }

    public void send(char buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff);
		out.close();
		so.close();
    }

    public void send(char []buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff.length+"\n");
		for(int i=0;i<buff.length;i++)
			out.writeBytes(buff[i]+"\n");
		out.close();
		so.close();
    }

    public void send(boolean buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff);
		out.close();
		so.close();
    }

    public void send(boolean []buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff.length+"\n");
		for(int i=0;i<buff.length;i++)
			out.writeBytes(buff[i]+"\n");
		out.close();
		so.close();
    }

    public void send(long buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff);
		out.close();
		so.close();
    }

    public void send(long []buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff.length+"\n");
		for(int i=0;i<buff.length;i++)
			out.writeBytes(buff[i]+"\n");
		out.close();
		so.close();
    }

    public void send(short buff, int destination, JGrid grid, int tag) throws Exception {
		java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff);
		out.close();
		so.close();
    }

    public void send(short []buff, int destination, JGrid grid, int tag) throws Exception {
    	java.net.Socket so = new java.net.Socket(grid.getIPForRank(destination),
														       JEnvironment.PEER_DATA_PORT);
		java.io.DataOutputStream out = new java.io.DataOutputStream(so.getOutputStream());

		out.writeBytes(tag+"\n"+grid.getRank()+"\n"+buff.length+"\n");
		for(int i=0;i<buff.length;i++)
			out.writeBytes(buff[i]+"\n");
		out.close();
		so.close();
    }

   /****************************************************************************
	*				THE RECEIVE METHODS FROM COMM INTERFACE                    *
	****************************************************************************/
	
	/** The generic receive
	 *
	 *	NOTE :  The objects streamed using these methods should be popular with 
	 *			the	class files available every where. If the object's runtime 
	 *			class is not found, a ClassNotFoundException will be thrown and 
	 *			program terminated. The unknown classes cannot be Dynamically 
	 *			loaded for the remote receiver like the RMI based posting 
	 *			mechanism, So be on the look out for such inconsistencies. 
	 **/
	public Object receive(Object buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		buff = peer.getObject();
		peer.close();
		return buff;
	}

    public int receive(int buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		buff = Integer.parseInt(peer.getData());
		peer.close();
		return buff;
    }

    public int[] receive(int []buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		int s = Integer.parseInt(peer.getData());
		int []buffs = new int[s];
		for(int i=0;i<s;i++)
			buffs[i] = Integer.parseInt(peer.getData());
		peer.close();
		return buffs;
    }

    public float receive(float buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		buff = Float.parseFloat(peer.getData());
		peer.close();
		return buff;
    }

    public float[] receive(float []buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		int s = Integer.parseInt(peer.getData());
		float []buffs = new float[s];
		for(int i=0;i<s;i++)
			buffs[i] = Float.parseFloat(peer.getData());
		peer.close();
		return buffs;
    }

    public double receive(double buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		buff = Double.parseDouble(peer.getData());
		peer.close();
		return buff;
    }

    public double[] receive(double []buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		int s = Integer.parseInt(peer.getData());
		double []buffs = new double[s];
		for(int i=0;i<s;i++)
			buffs[i] = Double.parseDouble(peer.getData());
		peer.close();
		return buffs;
    }

    public char receive(char buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		buff = (peer.getData()).charAt(0);
		peer.close();
		return buff;
    }

    public char[] receive(char []buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		int s = Integer.parseInt(peer.getData());
		char []buffs = new char[s];
		for(int i=0;i<s;i++)
			buffs[i] = (peer.getData()).charAt(0);
		peer.close();
		return buffs;
    }

    public boolean receive(boolean buff, int source, JGrid grid, int tag) throws Exception {
    	JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		buff = Boolean.parseBoolean(peer.getData());
		peer.close();
		return buff;
    }

    public boolean[] receive(boolean []buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		int s = Integer.parseInt(peer.getData());
		boolean []buffs = new boolean[s];
		for(int i=0;i<s;i++)
			buffs[i] = Boolean.parseBoolean(peer.getData());
		peer.close();
		return buffs;
    }

    public long receive(long buff, int source, JGrid grid, int tag) throws Exception {
    	JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		buff = Long.parseLong(peer.getData());
		peer.close();
		return buff;
    }

    public long[] receive(long []buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		int s = Integer.parseInt(peer.getData());
		long []buffs = new long[s];
		for(int i=0;i<s;i++)
			buffs[i] = Long.parseLong(peer.getData());
		peer.close();
		return buffs;
    }

    public short receive(short buff, int source, JGrid grid, int tag) throws Exception {
    	JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		buff = Short.parseShort(peer.getData());
		peer.close();
		return buff;
    }

    public short[] receive(short []buff, int source, JGrid grid, int tag) throws Exception {
		JPeerAgent peer = JPeerServer.receiveCall(tag,source);
		int s = Integer.parseInt(peer.getData());
		short []buffs = new short[s];
		for(int i=0;i<s;i++)
			buffs[i] = Short.parseShort(peer.getData());
		peer.close();
		return buffs;
    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品福利av导航| 国产99精品国产| 老汉av免费一区二区三区| 另类小说视频一区二区| 韩国精品主播一区二区在线观看 | 欧美成人精品3d动漫h| 91精品在线免费观看| 精品美女一区二区三区| 久久亚洲精品国产精品紫薇| 日韩午夜激情免费电影| 久久精品一区二区三区不卡牛牛| 国产精品久久三| 亚洲国产裸拍裸体视频在线观看乱了| 一区二区三区免费观看| 丝袜a∨在线一区二区三区不卡| 强制捆绑调教一区二区| 国产激情一区二区三区四区| 国产成人av电影在线播放| 91美女片黄在线观看| 欧美日韩美女一区二区| 日韩精品一区二区在线| 日韩欧美你懂的| 国产亚洲精品bt天堂精选| 136国产福利精品导航| 午夜不卡在线视频| 免费看欧美女人艹b| 成人午夜视频在线观看| 欧美亚洲综合色| 久久综合九色综合欧美就去吻| 国产精品传媒视频| 天天操天天色综合| 高清不卡一区二区| 欧美日韩国产色站一区二区三区| 日韩欧美黄色影院| 亚洲精品日韩一| 久久机这里只有精品| 91在线观看一区二区| 日韩午夜激情av| 亚洲精品美腿丝袜| 精品一区二区在线视频| 91免费在线视频观看| 精品国产乱码久久久久久免费| 国产精品视频第一区| 日韩电影免费一区| 97久久精品人人爽人人爽蜜臀| 欧美一区二区三区精品| 综合色天天鬼久久鬼色| 久久机这里只有精品| 欧美亚洲日本一区| 国产精品久久久久久久第一福利| 亚洲妇女屁股眼交7| 成人丝袜高跟foot| 精品国偷自产国产一区| 亚洲国产一区二区视频| 粉嫩久久99精品久久久久久夜| 欧美一区二区三区免费大片| 亚洲精品国产一区二区精华液| 国模套图日韩精品一区二区| 欧洲人成人精品| 亚洲欧美影音先锋| 国产伦精品一区二区三区免费迷 | 成人一区二区三区在线观看| 欧美肥妇bbw| 亚洲免费在线播放| 国产98色在线|日韩| 精品国精品国产| 蜜桃视频在线观看一区| 欧美视频在线观看一区| 亚洲色欲色欲www| 成人综合日日夜夜| 久久久久久久综合色一本| 欧美a级一区二区| 色猫猫国产区一区二在线视频| 国产精品情趣视频| 国产99久久久国产精品| 久久久噜噜噜久久中文字幕色伊伊 | 久久99精品久久久久久国产越南 | 狠狠色丁香九九婷婷综合五月| 欧美成人一区二区三区片免费| 卡一卡二国产精品| 久久蜜臀精品av| 成人午夜电影网站| 亚洲视频一二三区| 欧美性一级生活| 婷婷丁香激情综合| 日韩一区二区免费电影| 激情文学综合网| 国产欧美久久久精品影院| 99久久99久久免费精品蜜臀| 一区二区三区中文免费| 欧美日本在线一区| 久久成人av少妇免费| 国产欧美一区二区精品婷婷| 波多野结衣在线aⅴ中文字幕不卡| 中文字幕在线不卡国产视频| 在线观看国产精品网站| 青青草国产精品97视觉盛宴 | 成人午夜伦理影院| 一区二区三区四区av| 91精品国产色综合久久ai换脸| 久草在线在线精品观看| 国产精品理论在线观看| 欧美三级资源在线| 久久精品国产精品亚洲综合| 国产天堂亚洲国产碰碰| 91色porny蝌蚪| 午夜精品久久久久久不卡8050| 精品国产青草久久久久福利| voyeur盗摄精品| 无码av免费一区二区三区试看| 日韩精品一区二区三区蜜臀| 成人精品视频.| 丝袜亚洲另类欧美综合| 国产无一区二区| 欧美日韩精品高清| 国产成人小视频| 亚洲已满18点击进入久久| 欧美mv日韩mv国产网站app| 99视频一区二区三区| 日韩av一区二区三区| 国产精品理论片在线观看| 欧美久久一区二区| 国产成人亚洲综合a∨猫咪| 五月综合激情婷婷六月色窝| 欧美国产日韩在线观看| 欧美福利视频导航| av一区二区三区四区| 蜜臀久久久久久久| 亚洲日本在线观看| 久久蜜桃av一区精品变态类天堂 | 天堂久久久久va久久久久| 国产视频一区在线观看| 欧美日韩精品一区二区三区四区 | 国产精品高清亚洲| 日韩午夜在线影院| 欧美在线你懂得| 成人中文字幕合集| 久久av资源网| 亚洲成a人片在线观看中文| 国产欧美日韩久久| 欧美成人精品3d动漫h| 欧美系列一区二区| av电影在线观看一区| 国产毛片精品视频| 麻豆免费精品视频| 夜夜嗨av一区二区三区| 国产精品美女久久福利网站| 欧美成人性战久久| 欧美日本视频在线| 色猫猫国产区一区二在线视频| 粉嫩久久99精品久久久久久夜| 久久精品国产精品青草| 视频一区中文字幕| 亚洲精选视频在线| 亚洲婷婷国产精品电影人久久| 久久综合999| 日韩欧美中文字幕精品| 欧美人与性动xxxx| 91福利精品视频| 91免费小视频| 91视频国产观看| 99久久伊人网影院| 成人性生交大片免费| 国产成人综合自拍| 国产一区二区三区久久悠悠色av| 毛片不卡一区二区| 免费在线观看一区| 日本亚洲最大的色成网站www| 亚洲综合久久av| 亚洲美腿欧美偷拍| 亚洲精品综合在线| 亚洲人午夜精品天堂一二香蕉| 国产精品福利在线播放| 中文字幕一区二区三区色视频| 国产欧美日韩精品一区| 国产欧美1区2区3区| 国产视频一区二区在线观看| 亚洲精品一区二区三区精华液| 精品国产乱码久久久久久久| 精品国产人成亚洲区| 久久综合色婷婷| 久久精品人人爽人人爽| 国产婷婷精品av在线| 中文字幕久久午夜不卡| 国产精品欧美精品| 综合婷婷亚洲小说| 一区二区三区免费看视频| 亚洲国产综合视频在线观看| 亚洲国产综合在线| 免费日本视频一区| 精油按摩中文字幕久久| 国产一区二区三区香蕉| 国产福利91精品一区| 成人黄色av网站在线| 一本大道综合伊人精品热热| 色视频一区二区| 欧美精品自拍偷拍动漫精品| 日韩情涩欧美日韩视频| 久久精品一区二区三区不卡| 国产欧美一区二区三区鸳鸯浴|