Skip to content

Commit

Permalink
auto get num cpus
Browse files Browse the repository at this point in the history
  • Loading branch information
koooee committed Jul 8, 2012
1 parent 7a73cfa commit 76b7b31
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ExampleExample/Graphlab_pmf/pmf.sh
Expand Up @@ -2,8 +2,11 @@
# This was an example from Danny Bickson:
# http://graphlab.org/pmf.html

# Get number of cores
cpus=$(cat /proc/cpuinfo | grep -c processor)

# Generate Factorization
pmf /home/play/Datasets/Graphlab/movielens_mm 0 --scheduler="round_robin(max_iterations=10,block_size=1)" --matrixmarket=true --lambda=0.065 --ncpus=2
pmf /home/play/Datasets/Graphlab/movielens_mm 0 --scheduler="round_robin(max_iterations=10,block_size=1)" --matrixmarket=true --lambda=0.065 --ncpus $cpus

# Build Recommendations -- For Larger Instances change the number of cpus to the number of cores you have
if [ -f output ]; then rm output; fi
Expand All @@ -12,7 +15,7 @@ if [ -f outpute ]; then rm outpute; fi
ln -s /home/play/Datasets/Graphlab/movielens*.U output
ln -s /home/play/Datasets/Graphlab/movielens*.V outpute

glcluster output 8 3 0 --matrixmarket=true --training_ref="/home/play/Datasets/Graphlab/movielens_mm" --ncpus 2 &&
glcluster output 8 3 0 --matrixmarket=true --training_ref="/home/play/Datasets/Graphlab/movielens_mm" --ncpus $cpus &&
echo "***************************************************" &&
echo "****************** Recommendations ****************" &&
echo "***************************************************" &&
Expand Down

0 comments on commit 76b7b31

Please sign in to comment.