Presentation is loading. Please wait.

Presentation is loading. Please wait.

LiveViz – What is it? Charm++ library Visualization tool

Similar presentations


Presentation on theme: "LiveViz – What is it? Charm++ library Visualization tool"— Presentation transcript:

1 LiveViz – What is it? Charm++ library Visualization tool
Inspect your program’s current state Client runs on any machine (java) You code the image generation 2D and 3D modes Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

2 LiveViz – Monitoring Your Application
LiveViz allows you to watch your application’s progress Can use it from work or home Doesn’t slow down computation when there is no client Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

3 Documentation Or,(same material) section 6 of: There are example programs, but: Old ones will not work (see the warning in section 6.7) Make sure liveVizInit call takes the 4th “opts” parameter, which means you are looking at an example with modern correct interface See: Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

4 How to use LiveViz Get the Java Client: LiveViz (from ccs_tools) on to your desktop machine How to run the charm program as a liveviz server How to connect the client to server How to construct the image/s On demand (This is what we will focus on) In Push mode Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

5 LiveViz Client Client runs on your desktop
Server may be a remote machine, or as a special case, for testing, your desktop Client is a java app Download (git clone) ccs_tools from charm website The tool is in ccs_tools/bin/liveViz Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

6 Running LiveViz Build and run the server Or in detail…
cd examples/charm++/wave2d/ make ./run_server Or in detail… Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

7 LiveViz Request Model – On demand
Client LiveViz Server Code Get Image Send Image to Client Image Chunk Passed to Server Forward request to application Server Combines Image Chunks Parallel Application Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

8 When you run your charm++ program
1234 is a port number You can (and should) use other port numbers Tell the client the same # that you give to the server In repeated runs, change the port#.. It stays in use for several seconds after the program is terminated. ./charmrun ./wave2d+p2 ++server ++server-port 1234 ~/ccs_tools/bin/LiveViz localhost 1234 Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

9 Wave 2D Example Structure
Main: Setup 2D worker array, initialize chares with a circular wave within the interior of the grid Workers: Start looping Send pressure messages to all neighbors with ghost rows Wait for all neighbors to send ghost rows to me Once they arrive, calculate new pressure values Advance to next timestep If total iterations completed, exit Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

10 LiveViz Setup #include <liveVizPoll.h> void Main::main(. . .) { // Do misc initialization stuff // Create the 2D workers and register with liveviz CkArrayOptions opts(chareArrayWidth, chareArrayHeight); arrayProxy = CProxy_Wave::ckNew(opts); // Setup liveviz CkCallback c(CkIndex_Wave::requestNextFrame(0),arrayProxy); liveVizConfig cfg(liveVizConfig::pix_color,true); liveVizInit(cfg,arrayProxy,c, opts); // Initialize the library // Each chare starts and sets up initial pressure pertubations } Register Callback for sending images on-demand Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

11 On-demand image generation
//Callback function to generate images on request from client void requestNextFrame(liveVizRequestMsg *m){ unsigned char *intensity= new unsigned char[3*w*h]; for(int i=0;i<myheight;++i){ for(int j=0;j<mywidth;++j){ double p = pressure[i*mywidth+j]; if(p > 0) // Positive values are red intensity[3*(i*w+j)+0] = 255; // RED component else // Negative values are blue intensity[3*(i*w+j)+2] = 255; // BLUE component } //populate intensity with RGS based on pressure value liveVizDeposit(m, sx,sy, w,h, intensity, this); Rectangular portion of the image Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects

12 LiveViz Summary Easy to use visualization library
Simple code handles any number of clients Doesn’t slow computation when there are no clients connected Works in parallel, with load balancing, etc. Laxmikant Kalé and PPL (UIUC) – Parallel Migratable Objects


Download ppt "LiveViz – What is it? Charm++ library Visualization tool"

Similar presentations


Ads by Google