Grid Computing with BatchMake

26
National Alliance for Medical Image Computing http://na-mic.org Grid Computing with BatchMake Julien Jomier Kitware Inc.

description

Grid Computing with BatchMake. Julien Jomier Kitware Inc. Motivation. Data Processing. Reports & Analysis. Algorithm Design & Implementation. Outline. Introduction to BatchMake Grid Computing with BatchMake Reporting with the BatchBoards BatchMake with Slicer Future plans. - PowerPoint PPT Presentation

Transcript of Grid Computing with BatchMake

Page 1: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Grid Computing with BatchMake

Julien JomierKitware Inc.

Page 2: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Motivation

Algorithm Design & Implementation

Data Processing

Reports & Analysis

Page 3: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Outline

• Introduction to BatchMake• Grid Computing with BatchMake• Reporting with the BatchBoards• BatchMake with Slicer• Future plans

Page 4: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

BatchMake Origins

• Started in 2004 at UNC (CADDLab)• A2D2 from NLM• Kitware funds: KWGrid• BW-NAC: Batchboards• Na-Mic• STTR Kitware-UNC (Styner)

Page 5: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Introduction to BatchMake

• Batch script generator• Process of large number of datasets • Common Language (CMake-like)• Generation for:

- Shell script - Condor - KWGrid

• Run locally or on grid• Cross platform command line and GUI tool• C++ with ITK and FTLK

Page 6: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

BatchMake Workflow

CommandLine Executable

ApplicationWrapperBatchMake

Script

Local Execution

Condor Script

KWGrid Script

Shell Script

Page 7: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Application Wrapper

• Describe command line arguments- Manually (GUI)- Automatically using itkMetaCommand

• Currently using internal XML format• .bmm files (BatchMake Modules)• Switching to Slicer’s

ModuleDescriptionParser- importing Slicer Module automatically

Page 8: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

MetaCommand

• C++ class for command line parsing• Output recognized by

- BatchMake (-vxml)- Slicer (--xml)

• command.SetOption("compileScript","c",false,"Compile a script");

command.AddOptionField("compileScript","filename", MetaCommand::STRING,true);

• http://www.itk.org/Wiki/MetaIO• Insight/Utilities/MetaIO

Page 9: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Example Script

1 - SetApp(imSeg @ImageSegmentation)2 - SetAppOption(imSeg.threshold 10)3 - 4 - Set(workdir '/BatchMake/Demo/Ellipse_Images')5 - ListFileInDir(files ${workdir} '*.mha')6 -7 - Foreach(file ${files})8 - Set(filename '${workdir}/${file}')9 - Set(outfile '${workdir}/out_${file}')10- SetAppOption(imSeg.inputFilename ${filename})11- SetAppOption(imSeg.outputFilename ${outfile})12- Run(output ${imSeg})13- EndForeach(file)

Page 10: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Condor

• Specialized workload management system for compute-intensive jobs

• Created by UW-Madison• 15 Years of development• Provides job queueing mechanism,

scheduling policy, priority scheme, resource monitoring, and resource management.

• Unix and Windows

Page 11: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Condor Universes

• Standard Universe (checkpoint)• Vanilla• Parallel Virtual Machine • MPI• Globus• Java (JVM)• Scheduler (no matching)

Page 12: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Condor Example Script

Universe = vanillaExecutable = EMSegmenterArguments = ‘brain.mha segmentation.mha --brain’Output = emsegmentation.out Error = emsegmentation.error Log = emsegmentation.logRequirements = (OpSys =="LINUX" && Arch=="INTEL")Should_transfer_files = YES When_to_transfer_output = ON_EXIT_OR_EVICTTransfer_input_files = brain.mhaQueue

Page 13: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Condor Workflow (Vanilla)

Submit Machine

Central Manager

Execute Machines

Condor Pool

Submit job

Issue job

Idle Workstation

Busy Workstation

Available Execute Machine

Push out job to machine

Central Manager

Central ManagerUnavailable Execute Machine

Dispatch to Central manager

= Available

Dispatch to Central manager

= Unavailable

Page 14: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Condor Job Submission Workflow

Collector

Submit Machine

Scheduler

Starter

Negociator

Central Manager Execute Machine

MasterClassAd

Master MatchClassAd

Job

1

23

4

5

Page 15: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

BatchMake Condor Generation

Page 16: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

BatchMake Condor Generation

• Application/Module description - Inputs/Outputs - Data to transfer to nodes

• Loop unrolling• Scope definition• Directed Acyclic Graph (DAG)• Ensure order of

execution of jobs

Page 17: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Monitoring Condor Jobs

• Flock Monitor (Condor)• Condor Watcher (FLTK)• Condor Web Watcher (Ajax/PHP)

Page 18: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Condor Summary

• Pros:- Well supported- (Fairly) easy installation- Complete resources management

• Cons:- Script can be complicated- Jobs don’t start right away- Hard to debug

Page 19: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Reporting with BatchMake

CVS/SVN

Results posted on web(i.e., the batchboard)

CTest/DART compilessource code

Developers review results

Developers check-in

code

MIDASXNat

BatchMake validateson datasets

+

Page 20: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Reporting with BatchMake

Page 21: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

BatchMake Server

• PHP Scripts with MySQL database• Simple C++ HTTP post• Statistical Analysis (Factor analysis:

Taguchi).• Dashboard creation capability• User management

Page 22: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

BatchBoard Script

DashboardHost(http://www.insight-journal.org/batchmake)DashboardUser(‘Julien Jomier')DashboardKey('FKH3BPM1y11VXsMf')CreateExperiment(exp ‘Liver Project‘ ‘Segmentation Experiment' '')CreateMethod(Meth exp 'Registration'

'Register a T1 with noise to a translated T1')AddMethodInput(noiseImageName Meth 'Fixed Image')Set(fixedSlice '${fixedImage}Slice.png')ExtractSlice('${fixedImage}' '${fixedSlice}' 2 1)AddMethodInput(fixedSlice Meth 'Fixed Slice with noise' png)DashboardSend(Meth)

Page 23: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

BatchMake and Slicer

• BatchMake now distributed with Slicer• Some modules can be run on a

collection of data- EMSegment- GaussianBlur

• Generic way to run moduleson a collection

Page 24: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

BatchMake and MIDAS

• STTR Kitware/UNC Martin Styner

Page 25: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

Future

• Improve packaging• Improve documentation• Improve integration with Slicer• BatchMake and Xnat (discussion)

Page 26: Grid Computing with BatchMake

National Alliance for Medical Image Computing http://na-mic.org

References

• www.batchmake.org• www.insight-journal.org/batchmake