/* !-------------------------------------------------------------------------! ! ! ! N A S G R I D B E N C H M A R K S ! ! ! ! J A V A V E R S I O N ! ! ! ! B E N C H C L I E N T ! ! ! !-------------------------------------------------------------------------! ! ! ! BenchClient implements Benchmark Client Class. ! ! ! ! Permission to use, copy, distribute and modify this software ! ! for any purpose with or without fee is hereby granted. ! ! We request, however, that all derived work reference the ! ! NAS Grid Benchmarks 3.0 or GridNPB3.0. This software is provided ! ! "as is" without expressed or implied warranty. ! ! ! ! Information on GridNPB3.0, including the concept of ! ! the NAS Grid Benchmarks, the specifications, source code, ! ! results and information on how to submit new results, ! ! is available at: ! ! ! ! http://www.nas.nasa.gov/Software/NPB ! ! ! ! Send comments or suggestions to ngb@nas.nasa.gov ! ! Send bug reports to ngb@nas.nasa.gov ! ! ! ! E-mail: ngb@nas.nasa.gov ! ! Fax: (650) 604-3957 ! ! ! !-------------------------------------------------------------------------! ! GridNPB3.0 Java version ! ! M. Frumkin ! !-------------------------------------------------------------------------! */ package brmi; import tasks.DGraph.*; import brun.*; import NPB_JAV.Timer; import java.rmi.Naming; import java.rmi.Remote; import java.rmi.RemoteException; import java.rmi.RMISecurityManager; import java.lang.Object; import java.text.*; public class BenchClient extends Thread{ static int pid=-1; public void BenchClient(){} public BMResults[] ExecuteRemotely(BMRequest req,DGraph dfg){ BMResults[] res=null; if (System.getSecurityManager() == null) { System.setSecurityManager(new RMISecurityManager()); }try{ int t_total=0; Timer timer = new Timer(); timer.resetAllTimers(); timer.start(t_total); req.dfg=dfg; res=LaunchNodes(req); timer.stop(t_total); res[dfg.numNodes]=new BMResults(); res[dfg.numNodes].time = timer.readTimer(t_total); }catch (Exception e) { System.out.println("BenchClient exception: " + e.getMessage()); e.printStackTrace(); } return res; } public BMResults[] LaunchNodes(BMRequest req){ DGraph dfg=req.dfg; Executor exec[]=new Executor[dfg.numNodes]; BMRequest reqst[]=new BMRequest[dfg.numNodes]; System.err.println("\n launching "+NGBArgs.getBanner(dfg.name)); Timer timer = new Timer(); timer.resetAllTimers(); for(int i=0;i