Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

30
Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility

Transcript of Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

Page 1: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

Monte Carlo Instrument

Simulation Activity at ISIS

Dickon Champion, ISIS Facility

Page 2: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

HET Fermi Chopper Simulation

Page 3: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

1.0E+02

1.0E+03

1.0E+04

0 100 200 300 400 500

meV

arb

in

ten

sity

Experimental data

Simulation results fromVITESS

Page 4: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

OSIRIS Back Scattering Instrument

Page 5: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

Wish Diffractometer Guide

Page 6: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.
Page 7: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

Polarizing Mirror ComponentSingle bounce

0.4°

1.2°

Page 8: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

Double bounce

0.4°

1.2°

Page 9: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

New Vitess Module for ISIS

Page 10: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

Distributed Monte Carlo Instrument

Simulations

Page 11: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• What is Distributed Computing

• The software we use

• VITESS Specifics

• McStas Specifics

• Conclusions

Introduction

Page 12: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

What do I mean by ‘Distributed Grid’?• A way of speeding up large, compute intensive

tasks

• Break large jobs into smaller chunks

• Send these chunks out to (distributed) machines

• Distributed machines do the work

• Collate and merge the results

Page 13: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

Spare Cycles Concept

• Typical PC usage is about 10%

• Most PCs not used at all after 5pm

• Even with ‘heavily used’ (Outlook, Word, IE)

PCs, the CPU is still grossly underutilised

• Everyone wants a fast PC!

• Can we use (“steal?”) their unused CPU cycles?

• SETI@home, World Community Grid (www.worldcommunitygrid.org)

Page 14: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

Visual Introduction to the Grid

Page 15: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• CPU Intensive• Low to moderate memory use• Not too much file output• Coarse grained• Command line / batch driven• Licensing issues?

Suitable / Unsuitable Applications

Page 16: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Two scenarios:

• Single large simulation run

• Split the neutrons into smaller numbers and execute separately

• Merge results in some way

• Many smaller runs

• Parameter scan

Monte Carlo Speed-up Ideas

Page 17: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Easy mode of operation: fixed executables + data files

• Executables held on server

• Split command line into bits – divide Ncount

• Vary the random seed

• Create data packages

• Upload data packages

VITESS – Splitting It

Page 18: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Use GUI to create instrument – Save As Command

• “Parameter directory” set to “.”

VITESS – Running It

• Submit program parses bat file

• Substitutes ‘V’ and ‘P’

• Removes ‘header’ and ‘footer’

• Creates many new bat files with different ‘--Z’s and

Page 19: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Submit program creates many bat files

VITESS – Running ItC:\My_GRID\VITESSE\VITESSE\build>Vitess-Submit.exe example_job example.bat req_files 20logging in to https://bruce.nd.rl.ac.uk:18443/mgsi/rpc_soap.fcgi as tom....

Adding Vitesse dataset....Adding Vitesse datas....3e+007 neutrons split into 20 chunks, of -n1500000 neutronsTotal number of Vitesse 'runs' = 20Uploading data for run #1...Uploading data for run #2.....Uploading data for run #19...Uploading data for run #20...

Adding Vitesse datas to system....Adding job....Adding jobstep....Turning on automatic workunit generation....Closing jobstep....

All doneYour job_id is 4878

Page 20: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.
Page 21: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Download the ‘chunks’

• Merge Data files

• DetectedNeutrons.dat : concatenate

• vpipes : trajectories & count rate

• Two classes of files

•1D - Values: sum & divide by num chunks-

- Errors: square, sum and divide

•2D –Sum / num of chunks

VITESS – Merging It

Page 22: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Many times faster: linear increase

• Needs verification runs (x3)

• Typically 11 (potentially) 30+ times faster

• 12 hours runs in 1 hour!

• Very large simulations reach random limits

VITESS – Advantages and Problems

Page 23: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

VITESS – Some Results

Comparison

Time-of-Flight (ms)

63.0 63.2 63.4 63.6 63.8 64.0 64.2 64.4

Neutrons s-1

0

2

4

6

8

10

12

1 CPU Simulation - 66 Hours GRID Simulation - 6 Hours

176 hours

59 hours6hrs 20mins

Page 24: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Different executable for every run

• Executable must be uploaded at run time

• Split –n into chunks

• or run many instances (parameter scan)

• Create data (+ executable) packages

• Upload packages

McStas – Splitting It

Page 25: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Use McGui to create and compile executable

• Create input file for Submit program

McStas – Running It

Page 26: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Large run• Submit program breaks up –n#####

• Uploads new command line + data + executable

• Parameter Scan• Send each run to a separate machine

McStas – Running It

Page 27: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Many output files Separate merge program

• PGPLOT and Matlab implemented

• Very similar

• PGPLOT• 1D – intensities: sum and divide. Errors: square, sum and divide. Events: Sum

• 2D – intensities: sum and divide. Errors: square, sum and divide. Events: Sum

• Matlab• 1D – Same maths, different format

• 2D – Virtually the same

• ‘Metadata’ leave untouched

McStas – Merging It

Page 28: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Security: Do we trust users?

• 100 times faster[?]

• Linux version much faster than Windows [?]

• How do we merge certain fields?• values = '1.44156e+006 10459.9 30748';

• statistics = 'X0=3.5418; dX=1.52975; Y0=0.000822474; dY=1.0288;';

• Some issue related to randomness of moderator file

McStas – Advantages and Problems

Page 29: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Both run well under Grid MP

• Submit & Retrieve a few hours work

• Merge a bit more

• Needs to merge more output formats [?]

• Issues with very large simulations

• More info on Grid MP at www.ud.com

Conclusions

Page 30: Monte Carlo Instrument Simulation Activity at ISIS Dickon Champion, ISIS Facility.

• Tom Griffin - GRID

• Ed Abel -GRID

• Stuart Ansell - MCNPX

• Mark Telling - OSIRIS

• Robert Dalgliesh - Polarization

• Laurent Chapon - WISH

•Judith Peters - HET

•Heloisa Bordallo - HET

•Geza Zsigmond -HET

Acknowledgements