Cooperative Computing Lab
CCL | Software | Install | Manuals | Forum | Papers
CCL Home

Research

Software Community Operations

Practice Problems for Makeflow

  1. Problem 1: Write a Makeflow to manage the production of a small visualization.
    1. Objectives
    2. Problem Statement
    3. Hints
  2. Problem 2: Run your Makeflow on multiple platforms
    1. Objectives
    2. Problem Statement
  3. Problem 3: Apply Makeflow to your research
    1. Problem Statement

Use the information in the Makeflow page to learn more about Makeflow, if necessary.

Problem 1

Write a Makeflow to manage the production of a small visualization.

Objectives

This problem will illustrate the following:

  • Makeflow's support for the construction of workflows.
  • The syntax for Makeflow.

Problem Statement

This problem involves taking a simple scene description of a Rubik's Cube and constructing a Makeflow which will render the fifty frames necessary for a 5 second video at 10 frames per second.

The rendering engine we will be using is POV-Ray. We will also be using ffmpeg to combine the rendered images into a single movie. The data files and application executables necessary can be downloaded with the command > wget http://www.nd.edu/~ccl/software/tutorials/ndtut12/makeflow/povray.tar.gz ... Once everything has been downloaded, unpack the archive and move into the directory > tar xzf povray.tar.gz > cd povray-practice To render a single scene using POV-Ray, the following command can be run: > ./povray +Irubiks.pov +Orubiks.png ... rubiks.pov is the input data file, while rubiks.png is the output image. WRC_RubiksCube.inc isn't mentioned on the command line, but is necessary for rendering the scene as it is a library that contains the description of how to draw a Rubik's cube.

POVRay uses the built-in clock variable to represent the passage of time. clock is a floating point that varies only from zero to one through the course of an animation. You can set the clock value to, say, 0.5 by using the option +K.5. > ./povray +Irubiks.pov +Orubiks_frame00.png +K0.5 ...

The provided scene is designed to have the Rubik's cube rotate as the clock advances. Write a Makeflow that generates enough frames to provide at least 5 seconds of animation at 10 frames per second. Each output file should take the form of rubiks_frameXY.png, where XY is the frame number between 00 and 50.

Once the frames are rendered, as the last step of the makeflow, use the following command to combine all of the frames into a single movie: > ./ffmpeg -r 10 -i rubiks_frame%02d.png -r ntsc rubiks_movie.mpg ...

Hints

  1. Each frame should have its own rule, so you should end up with 51 rules in the Makeflow.
  2. Make sure to list all of the dependencies of a command. Don't forget the Rubik's library!
  3. Hand-writing 50+ rules can get annoying. If you know a scripting language don't hesitate to use it to automate the generation of the Makeflow file.
  4. If you're feeling adventurous, try experimenting with rubiks.pov. The POV-Ray language is fairly straightforward and it shouldn't be hard to add your own personal flair to your movie.

Problem 2

Configure Makeflow to run on multiple platforms

Objectives

This problem will familiarize participants with the following:

  • Running Makeflows on multiple platforms

Problem Statement

For this problem, you will run the Makeflow application you developed for Problem 1 on multiple platforms. Specifically, you will run your Makeflow on both the ND CRC and on your personal desktop or laptop.

The -T option to Makeflow specifies which system to run the makeflow on. To complete this assignment run the Makeflow you created in Part 1 on your local workstation using the -T local argument to Makeflow. Following that, clean up your ouput and rerun the workflow using the CRC's SGE cluster and -T sge.

Problem 3

Apply Makeflow to your research.

Problem Statement

In completing Problem 1 and Problem 2, you have mastered the fundamentals of expressing and running large worfklows using Makeflow!

Now, can you think of one or two instances in your research where Makeflow might be useful?