Skip to content

Commit

Permalink
Merge pull request #1 from AndiH/master
Browse files Browse the repository at this point in the history
Add `color` Option to Gnuplot; Enhance `build.sh`
  • Loading branch information
karlrupp committed Apr 13, 2017
2 parents 9a56fd7 + 29e420a commit 7e547a4
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.eps
*.pdf
*.png
17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,11 @@
This is the data repository supplementing my blog post comparing hardware characteristics of CPUs, GPUs, and MICs:
https://www.karlrupp.net/2013/06/cpu-gpu-and-mic-hardware-characteristics-over-time/


### Replot the Figures:
- Linux: Run build.sh from your terminal (assuming Gnuplot is available on your system).

Requires: Gnuplot, ImageMagick.

If no ImageMagick is available at your machine, comment/remove the second for-loop in build.sh

If you want to have .eps plots instead of .png, comment/remove the second for-loop in build.sh

To generate .pdf plots from .eps, use 'epstopdf' instead of 'convert -density 200' in the second for-loop in build.sh


- Mac OS: Same as Linux (untested)

- Linux, MacOS: Run `build.sh` from your terminal (Gnuplot is required) – `./build.sh`. EPS figures are generated.
* Call `./build.sh --png` to convert the EPS figures into PNG pictures. ImageMagick needs to be installed for this.
* Call `./build.sh --pdf` to convert the EPS figures into PDF graphics. `epstopdf` (from a LaTeX installation) is used for this.

- Windows: Install gnuplot, then load the *.gnuplot files to recreate the figures (untested). You may need to install postscript or change the Gnuplot terminal to png.

Expand Down
52 changes: 43 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,47 @@ do
gnuplot $f;
done;


# Generate png files: (uncomment this if you don't have ImageMagick installed)
for f in `ls *.eps`
while :
do
convert -density 200 $f -flatten ${f%eps}png;
rm $f
done;



case "$1" in
-v | --pdf)
if hash epstopdf 2>/dev/null; then
for f in `ls *.eps`
do
epstopdf $f;
rm $f
done;
else
echo "No epstopdf, please install it. It should come with a LaTeX distribution."
fi
shift
;;
-b | --png)
if hash convert 2>/dev/null; then
for f in `ls *.eps`
do
convert -density 200 $f -flatten ${f%eps}png;
rm $f
done;
else
echo "Please install ImageMagick!"
fi
shift
;;
-h | --help)
echo "Usage: $0 [option]"
echo ""
echo " -v, --pdf Convert Gnuplot .eps files to PDF"
echo " -b, --png Convert Gnuplot .eps files to PNG"
exit 0
;;
-*)
echo "Error: Unknown option: $1" >&2
## or call function display_help
exit 1
;;
*) # No more options
break
;;
esac
done
2 changes: 1 addition & 1 deletion cores.gnuplot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/gnuplot

set term postscript eps enhanced
set term postscript eps enhanced color

set style data lines
set style line 1 linetype -1 linewidth 3 lc rgb "#005197"
Expand Down
2 changes: 1 addition & 1 deletion flop-per-byte.gnuplot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/gnuplot

set term postscript eps enhanced
set term postscript eps enhanced color

set style data lines
set style line 1 linetype -1 linewidth 3 lc rgb "#005197"
Expand Down
2 changes: 1 addition & 1 deletion flops-per-cycle.gnuplot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/gnuplot

set term postscript eps enhanced
set term postscript eps enhanced color

set style data lines
set style line 1 linetype -1 linewidth 3 lc rgb "#005197"
Expand Down
2 changes: 1 addition & 1 deletion gflops-per-core.gnuplot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/gnuplot

set term postscript eps enhanced
set term postscript eps enhanced color

set style data lines
set style line 1 linetype -1 linewidth 3 lc rgb "#005197"
Expand Down
2 changes: 1 addition & 1 deletion gflops-per-watt.gnuplot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/gnuplot

set term postscript eps enhanced
set term postscript eps enhanced color

set style data lines
set style line 1 linetype -1 linewidth 3 lc rgb "#005197"
Expand Down
2 changes: 1 addition & 1 deletion gflops.gnuplot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/gnuplot

set term postscript eps enhanced
set term postscript eps enhanced color

set style data lines
set style line 1 linetype -1 linewidth 3 lc rgb "#005197"
Expand Down
2 changes: 1 addition & 1 deletion mem-bandwidth.gnuplot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/gnuplot

set term postscript eps enhanced
set term postscript eps enhanced color

set style data lines
set style line 1 linetype -1 linewidth 3 lc rgb "#005197"
Expand Down
2 changes: 1 addition & 1 deletion tdp.gnuplot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/gnuplot

set term postscript eps enhanced
set term postscript eps enhanced color

set style data lines
set style line 1 linetype -1 linewidth 3 lc rgb "#005197"
Expand Down

0 comments on commit 7e547a4

Please sign in to comment.