Giter Club home page Giter Club logo

stress-make's Introduction

Stress Make

Description

Stress Make helps developers expose race conditions in their Makefiles.

GNU Make supports a -j (or --jobs) option that allows multiple jobs (commands) to run in parallel. However, it is the developer's responsibility to ensure that dependencies among rules are specified correctly. One problem that arises is that an incorrect Makefile may build correctly on one system even if it fails on another system simple due to the order that the jobs happen to run.

Stress Make is a customized GNU Make that explicitly manages the order in which concurrent jobs are run in order to provoke erroneous behavior into becoming manifest. It can run jobs in the order they're launched, in backwards order, or in random order. The thought is that if code builds correctly with Stress Make then it is likely (but not guaranteed) that the Makefile contains no race conditions.

Installation

See INSTALL.md for installation instructions.

Usage

Simple replace make with stress-make when building code. Stress Make will always enable unbounded concurrency (the equivalent of -j with no argument) but will serialize actual execution so there's no risk of bogging down your machine with hundreds of processes fighting for the CPU. Optionally, you can specify --order=random to randomize the order in which processes execute. (There's also --order=fifo, but that's the default for make so it's not particularly interesting from a stress-testing perspective.)

When the build is complete, Stress Make outputs some information about the build. For example, it outputs the following when building itself:

stress-make: INFO: Total commands launched = 71
stress-make: INFO: Maximum concurrency observed = 28
stress-make: INFO: Time on a single CPU core (T_1) = 1.156269146s
stress-make: INFO: Time on infinite CPU cores (T_inf) = 542.823888ms
stress-make: INFO: Maximum possible speedup (T_1/T_inf) = 2.130100

That is, the build launched a total of 71 jobs. At most 28 of these were enqueued or running at the same time. Excluding queue delays and Stress Make overhead, the build would have finished in a little over a second if executed serially. (This is known as work or T1.) Given an infinite number of CPUs, the build could have completed in a little over half a second. (This is known as span or Tโˆž.) Hence, the Makefile offers only enough concurrency to support a maximum speedup of 2x no matter how many CPUs you throw at it.

See Charles Leiserson's What the $#@! is Parallelism, Anyhow? article for a nice discussion of work, span, parallelism, and related concepts.

Copyright and license

Triad National Security, LLC (Triad) owns the copyright to Stress Make, which it identifies internally as LA-CC-11-056. The license is BSD-ish with a "modifications must be indicated" clause. See LICENSE.md for the full text.

Author

Scott Pakin, [email protected]

stress-make's People

Contributors

spakin avatar easyaspi314 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.