Skip to content

Instantly share code, notes, and snippets.

@reubenjohn
Last active September 23, 2018 17:33
Show Gist options
  • Save reubenjohn/b714de7b47202a379642e30fd97e5853 to your computer and use it in GitHub Desktop.
Save reubenjohn/b714de7b47202a379642e30fd97e5853 to your computer and use it in GitHub Desktop.
Convenience shell script to launch 2 riders and 2 horses of the tensorflow distributed example: "distributed_horse_rider"
#!/usr/bin/env bash
# Note this script is part of the distributed_horse_rider example over hosted at:
# https://github.com/Project-MANAS/distributed_horse_rider
touch "/tmp/dhr.sh"; chmod +x "/tmp/dhr.sh"
launch(){
for ((i=0;i<$1;i++))
do
echo "python3.5 -m distributed_horse_rider.${2} ${i}" > "/tmp/dhr.sh" && gnome-terminal -x "/tmp/dhr.sh"
done
}
launch 2 horse
launch 2 rider
@reubenjohn
Copy link
Author

Feel free to tweak it as per your needs and system :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment