Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bollu
Created April 6, 2019 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bollu/1f619357842aa5b6770c0abf5ddf3c2f to your computer and use it in GitHub Desktop.
Save bollu/1f619357842aa5b6770c0abf5ddf3c2f to your computer and use it in GitHub Desktop.
find number of lines of code in openacc version versus normal version
#!/usr/bin/env bash
NUM_PRAGMA_LINES=$(grep '!$ACC' -R openacc | wc -l)
NUM_FORTRAN_LINES=$(cloc openacc/*.f90 -csv | tail -1 | rev | cut -d',' -f 1 | rev)
echo "num pragma lines: " $NUM_PRAGMA_LINES
echo "total lines in opanacc: " $NUM_FORTRAN_LINES
echo "ratio:"
python -c "print(100.0 * float($NUM_PRAGMA_LINES) / $NUM_FORTRAN_LINES)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment