Skip to content

Instantly share code, notes, and snippets.

@Moddus
Created November 11, 2014 21:20
Show Gist options
  • Save Moddus/61afe1ffbe4b4eb30f8a to your computer and use it in GitHub Desktop.
Save Moddus/61afe1ffbe4b4eb30f8a to your computer and use it in GitHub Desktop.
#!/bin/bash
COMPILE=""
ssh bsd9 "mkdir -p $1 && rm -rf $1/*"
for filename in *; do
if [[ -f $filename ]]; then
EXT=${filename##*.}
if [ "$EXT" == c ] || [ "$EXT" == h ]; then
COMPILE=$COMPILE" "$filename
scp $filename bsd9:$1/$filename
fi
fi
done
echo "mpicc -o run "$COMPILE
ssh bsd9 "cd $1 && mpicc -o run $COMPILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment