- First, let’s set some variables to be used later. You’ll need to pick a zone to replace the ZONE variable.
export PROJECT=”YOUR_GCP_PROJECT"
export ZONE="us-central1-c"
export CORES="32"
export OUTPUT_DISK_SIZE="500GB"
export OUTPUT_DISK="out-${CORES}"
export INSTANCE="yc-${CORES}"
- Next, create a large disk to hold the final output (500 billion digits will take up 500GB!)
$ gcloud compute disks create ${OUTPUT_DISK} \
--project ${PROJECT} \
--zone ${ZONE} \
--size ${OUTPUT_DISK_SIZE} \
--type pd-ssd
- Then, create a Compute Engine instance with Local SSDs, the following command will attach 8 Local SSDs:
$ gcloud compute instances create ${INSTANCE} \
--project ${PROJECT} \
--zone ${ZONE} \
--machine-type n1-highmem-${CORES} \
--maintenance-policy TERMINATE \
--image-project gce-nvme \
--image nvme-backports-debian-7-wheezy-v20151104 \
--local-ssd interface=NVME \
--local-ssd interface=NVME \
--local-ssd interface=NVME \
--local-ssd interface=NVME \
--local-ssd interface=NVME \
--local-ssd interface=NVME \
--local-ssd interface=NVME \
--local-ssd interface=NVME \
--disk name=${OUTPUT_DISK},device-name=${OUTPUT_DISK}
- Once the instance is started, you can SSH into it with:
$ gcloud compute ssh ${INSTANCE} -zone ${ZONE}
- Once you're in the newly created instance, you'll need to first format and mount all of the Local SSDs and the large persistent disk:
$ sudo su -
$ for i in `seq 0 7`; do \
mkdir /mnt/${i}; \
/usr/share/google/safe_format_and_mount \
/dev/disk/by-id/google-local-ssd-${i} /mnt/${i}; \
done
$ mkdir /mnt/out
$ /usr/share/google/safe_format_and_mount \
/dev/disk/by-id/google-${OUTPUT_DISK} \
/mnt/out
- Finally, install the latest version of y-cruncher onto that instance. You may want to install screen or tmux as well.
To calculate digits of Pi, here is the command line I used to start y-cruncher on the virtual machine:
$ export DIGITS=”500000000000"
$ ./y-cruncher custom pi -dec:${DIGITS} -hex:0 \
-o /mnt/out -mode:swap -swap:raid0 \
/mnt/0 /mnt/1 /mnt/2 /mnt/3 /mnt/4 /mnt/5 /mnt/6 /mnt/7
No comments :
Post a Comment