?? asptest.java
字號:
import com.ibm.dthreads.DThread;
import com.ibm.dthreads.DistributedExecutionManager;
import com.ibm.dthreads.SPMDDistributedExecutionManager;
import com.ibm.dthreads.DThreadExecutionContext;
public class ASPTest {
public static void main(String args[])
{
long start,end;
start=System.currentTimeMillis();
if(args.length<3)
{
System.out.println("Command Usage : ");
System.out.println("java ASPTest prog_name no_of_threads no_of_vertices");
System.out.println("Please Refer README.htm");
System.exit(0);
}
int totalthreads=Integer.parseInt(args[1]);
int noofvertices=Integer.parseInt(args[2]);
boolean debugMode=true;
//For Global array version of ASP
Object arraydthread=null;
if(args[0].equals("global"))
{
arraydthread = new FloydGlobal(noofvertices);
}
//For Broadcast version of ASP
if(args[0].equals("bcast"))
{
arraydthread = new FloydBroadcast(noofvertices);
}
//For DRunnable version of ASP
if(args[0].equals("runnable"))
{
ASPRunnable dthreadObject = new ASPRunnable(noofvertices);
arraydthread=new DThread(dthreadObject);
}
DistributedExecutionManager dmanager = new SPMDDistributedExecutionManager(0);
DThreadExecutionContext context = new DThreadExecutionContext(totalthreads);
//set the mode of execution..If the user want to have it in debug mode then all the debug messages will be there in log files
context.setMode(args);
context.setexperimentName("Floyd");
dmanager.execute((DThread)arraydthread,context);
end=System.currentTimeMillis();
System.out.println("TIME TAKEN IS "+(end-start)+" milliSeconds");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -