This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
haas:spring2014:sysprog:projects:matrixmult3 [2013/12/25 11:01] – created wedge | haas:spring2014:sysprog:projects:matrixmult3 [2014/02/20 13:44] (current) – wedge | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Matrix Multiplier Part II====== | + | ======Matrix Multiplier Part II: Altering Program Behavior via Configuration====== |
- | - read through getopt(3) manual page | + | |
- | - compile, run, and figure out getopt.c example | + | |
- | - implement both file output and getopt options in your matrix multiplier | + | |
- | options to implement: | + | =====Overview===== |
- | --------------------- | + | One aspect of writing an effective application is flexibility- what are the expected behaviors of the program, and how can we enable the widest range of configuration changes without needing to recompile the code? |
- | -h/ | + | |
- | -o file/--out file specify output file for resultant matrix | + | As far as run-time configuration goes, there are two options |
- | -m/ | + | |
- | -v/ | + | * read settings from a configuration file |
- | -q/ | + | * specify settings via the command-line |
- | -V/ | + | |
- | -M # matrix1' | + | Now we get to explore the further implementation of these concepts. |
- | -N # matrix1' | + | |
- | -P # matrix2' | + | =====Command-Line Arguments===== |
- | -1 file/--in1 file specify input file for matrix1 | + | Many of you have likely encountered some aspects of accessing the command-line, typically through setting and using parameters in the **main()** function (via the venerable and oft-named **argc** and **argv** variables), but even then, we often kept things simple as the nature of parsing arguments can add complexity. |
- | -2 file/--in2 file specify input file for matrix2 | + | |
+ | Luckily, functionality exists which does the bulk of the parsing work for us, so we will familiarized ourselves with that. It is known as **getopt()**, | ||
+ | |||
+ | * read through **getopt(3)** manual page (remember what the **3** indicates and how to make use of it?) | ||
+ | * compile, run, analyze, and figure out the code samples found in that manual page | ||
+ | * implement both file output and getopt options in your matrix multiplier | ||
+ | |||
+ | ===options to implement=== | ||
+ | * -h/ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |