log.info("SciMark Multi-Job Benchmark GridNode Starting...");
StopWatch sw = new StopWatch();
sw.start();
GridNode node = Grid.startLightGridNode();
log.info("GridNode ID : " + node.getId());
sw.stop();
log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");
// Submit Job
sw.start();
GridJobFuture future = null;
/* ------------------------------- FFT Benchmark -------------------------------- */
log.debug("Submitting FFT Job");
future = node.getJobSubmissionService().submitJob(new BenchmarkFFT(TASKCOUNT));
try {
mflop_fft = (Double) future.getResult();
log.debug("FFT Results : " + mflop_fft);
} catch (RemoteInvocationFailureException e) {
e.getCause().printStackTrace();
}
/* ------------------------------- SOR Benchmark -------------------------------- */
log.debug("Submitting SOR Job");
future = node.getJobSubmissionService().submitJob(new BenchmarkSOR(TASKCOUNT));
try {
mflop_sor = (Double) future.getResult();
log.debug("SOR Results : " + mflop_sor);
} catch (RemoteInvocationFailureException e) {
e.getCause().printStackTrace();
}
/* ------------------------------- Monte Carlo Benchmark -------------------------------- */
log.debug("Submitting Monte Carlo Job");
future = node.getJobSubmissionService().submitJob(new BenchmarkMonteCarlo(TASKCOUNT));
try {
mflop_monte = (Double) future.getResult();
log.debug("MonteCarlo Results : " + mflop_monte);
} catch (RemoteInvocationFailureException e) {
e.getCause().printStackTrace();
}
/* ------------------------------- LU Benchmark -------------------------------- */
log.debug("Submitting LU Job");
future = node.getJobSubmissionService().submitJob(new BenchmarkLU(TASKCOUNT));
try {
mflop_lu = (Double) future.getResult();
log.debug("LU Results : " + mflop_lu);
} catch (RemoteInvocationFailureException e) {
e.getCause().printStackTrace();
}
/* ------------------------------- Sparse Benchmark -------------------------------- */
log.debug("Submitting Sparse Job");
future = node.getJobSubmissionService().submitJob(new BenchmarkSparse(TASKCOUNT));
try {
mflop_sparse = (Double) future.getResult();
log.debug("Sparse Results : " + mflop_sparse);
} catch (RemoteInvocationFailureException e) {
e.getCause().printStackTrace();
}
/* ------------------------------- FINAL RESULT -------------------------------- */
double result = (mflop_fft + mflop_lu + mflop_monte + mflop_sor + mflop_sparse) /5;
log.debug("Benchmark Result : " + result);
sw.stop();
log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis() + " ms");
node.getNodeRegistrationService().unregister();
System.err.println("*******************************");
System.err.println(" SciMark Benchmark Results");
System.err.println("*******************************");