Scientific Computing
Science, Technology, Engineering, Arts & Math
Teaching & Learning Math & Science with Technology
Graphing Calculators, Numerical Methods, Computer Algebra Systems & Linux Clusters
Why Shadowfax? Our cluster is so fast that we named it after the Lord Of The Rings character!
Website once known as CalcPage.tripod.com (1988 – 2008)
I love teaching AP Computer Science, but that's not what I'm talking about here. Our Honors Math students, at the very least, should be exposed to computing as it's used in upper level mathematics and science majors or professions. This area of study is commonly referred to as Computing Science or Scientific Computing. Many of my students go on to some of the Big Tech or Ivy League schools for a major in Engineering or the Sciences. In said fields students and professionals will be programming computers to solve their problems. These professionals may use a programming language such as Python, C++ or Java. More likely, they will use a mathematical programming environment such as MATLAB, Mathematica or SPSS. Alternatively, I try to expose my students to FLOSS (Free Linux Open Source Software) versions: Octave, SAGE or R respectively (we use Linux a lot). These past couple of years I thought I'd replace the TI83/84 in my preCalculus classes. Since preCalculus is mostly a terminal course for Seniors (not Honors) in High School whereby a Graphing Calculator is not required (no Regents or AP), I thought this would be a great place to experiment. The classes took to this approach very well. These students even felt special and accomplished when they told their peers in other classes that they were coders! I did keep the coding to a minimum, however, using predefined functions in SAGE. Early in the year (Sept), I did use pure Python coding for Sequences and Series as the List Data Structure, List Comprehensions and For Loops are very easy to introduce here. Later on (June), we were able to build on Sequence and Series when we got to Reimann Sums. Here's a playlist from that course. Many schools nowadays have a 1-to-1 program where every student and teacher use some sort of compatible device provided by the school. Some schools, like mine, give out Graphing Calculators to everyone at the beginning of the year like a textbook. This way, everyone can use the same technology in class and at home. Some schools give out Tablets, unlike mine, whether it be an iPad or an Android, and use an app like Desmos or Geogrbra or even a TI Emulator. Don't forget, there's always a "App for that" or that "Droid does!" Why not leverage the devices we already have? Most students and teachers have a Cell Phone or Tablet capable of coding with an online IDE, an app or a computing environment such as SAGE! As you can see from recent posts to this blog, the amount of python coding needed isn't much or hard to learn:
Of course, you could get a little carried away and teach a lot more (see the side panels of my blog for SAGE samples from all of the topics in preCalc and AB Calc). I let my preCalculus students use SAGECELL in class and at home without a problem. I also let students use their own TI83/84 if they have one and prefer to use a Graphing Calculator at times as a mater of taste. I do not expose my AP Calculus students to any of this until after the AP Exam as they need to use a Graphing Calculator on the exam. Take a look at any playlist on my YouTube channel labeled "LAC" (Life After Calculus) for examples of what we do after the exam. Using Python in SAGECELL or REPL or VPython in GlowScript very easy to use and teach. These environments are to python as Processing and OpenProcessing are to Java. So, I may use Java in Math class too! I was one of the first to promote the use of Graphing Calculators back in the early 1990s. Everyone was resistant to change back then. If a particular technology were not required on a particular exam, I think more people would be receptive to change now. Why saddle our kids with outdated tech that costs about $100 per calculator when they already have a ton of tech in their pocket or backpack?
We just had our Graduation Day at the High School. I suppose that's my unofficial start to Summer. I will miss my Seniors, we had a great year together. The whole week before graduation I was finishing up a series of YouTube ScreenCasts about solving this year's AP Calculus Exam Part IIA. This playlist serves as a summary of this year's Final Project! Part IIA is the first Free Response section of the AP Calculus Exam. This section consists of 2 AB or 2 BC questions requiring the use of a Graphing Calculator. AB1 and BC1 are the same question. AB2 and BC2 are different. Below you will find the solutions to these Free Response Questions in the following order: AB2, AB1/BC1, BC2. In this fashion, we covered AB only questions first, then AB/BC questions and finally BC only questions, ie in order of increasing difficulty. For over 2 decades, I have been teaching my students to complete this section using a TI89. Most schools still use a TI83 or TI84. These past 2 years, my students have been using a class set of TI nSpire CX CAS graphing calculators that were donated to my classroom via DonorsChoose. Thanx to all my donors, my students are indeed very fortunate! There are 4 functions a Graphing Calculator needs to perform to be allowed on the AP Exam: 1) Graphing in an arbitrary window, 2) Solving for the roots of an equation, 3) Finding Numerical Derivatives and 4) Finding Definite Integrals. All of these capabilities are demonstrated in the ScreenCasts listed below using a TI84C, TI92 (similar to TI89) and TI nSpire CX CAS:
2016AB2a) Numerical Derivative 2016AB2b) Numerical Root 2016AB2c) Definite Integral 2016AB2d) Definite Integral
2016AB1c/BC1c) Definite Integral
2016BC2a) Definite Integral 2016BC2d) Definite Integral PS, here's a shot from the traffic jam I hit going home after the graduation!
We changed gears this month as my DonorsChoose project was finally funded with the help of Google Gift Cards from Codecademy. We got a class set of TI nSpire CX CAS Graphing Calculators. The only problem was getting a good emulator for Linux. This year we had replaced VTI with TILEM (TI-83) and TIEMU (TI-89). Next year we'll be using SageCell in preCalculus instead of the TI-83 and the TI nSpire CX CAS in Calculus instead of the TI-89. See my new DeskTop in the ScreenCast above using KARMTI.
Hope you had fun clustering with us this year. Have a great Summer, see you next year!
April Meeting - MPI4PY
We played around with the pelicanHPC DVD and our mandelmpi.py program trying to zoom in on different regions of the Mandelbrot boundary:
mpiexec -n 4 --hostfile ~/tmp/bhosts mandelmpi.py
March Meeting - openSSH
We decided to install a native openMPI stack over our Ubuntu OS on all the hard drives in our cluster and skip using the DVD. The idea is to login from home and ssh to any node to login on the cluster as needed! We took our queue from from the 2011-2012 CIS(theta) team summary. We already covered steps 1-3. We're on step 4, installing Public Key Authenticated SSH!
InstantCluster Step 1: Infrastructure - Power, Wiring and AC
Create a the same new user on every box of the cluster
login as the new user, we used 'shadowfax'
If you have no .ssh directory in your home directory, ssh to some other machine in the lab; then Ctrl-d to close the connection, creating .ssh and some related files.
From your home directory, make .ssh secure by entering:
chmod 700 .ssh
Next, make .ssh your working directory by entering:
cd .ssh
To list/view the contents of the directory, enter:
ls -a [we used ls -l]
To generate your public and private keys, enter:
ssh-keygen -t rsa
The first prompt is for the name of the file in which your private key will be stored; press Enter to accept the default name (id_rsa).The next two prompts are for the password you want, and since we are trying to avoid entering passwords, just press Enter at both prompts, returning you to the system prompt.
To compare the previous output of ls and see what new files have been created, enter:
ls -a [we used ls -l]
You should see id_rsa containing your private key, and id_rsa.pub containing your public key.
To make your public key the only thing needed for you to ssh to a different machine, enter:
cat id_rsa.pub >> authorized_keys
[The Linux boxes on our LAN, soon to be cluster, have IPs ranging from 10.5.129.1 to
10.5.129.24 So, we copied each id_rsa.pub file to temp01-temp24 and uploaded these
files via ssh to the teacher station. Then we just ran cat tempnn >> authorized_keys
for each temp file to generate one master authorized_keys file for all nodes that we could
just download to each node's .ssh dir.]
[optional] To make it so that only you can read or write the file containing your private key, enter:
chmod 600 id_rsa [optional] To make it so that only you can read or write the file containing your authorized keys, enter: chmod 600 authorized_keys
InstantCluster Step 5: Software Stack II - openMPI
InstantCluster Step 6: Coding I - Quadrature
InstantCluster Step 7: Coding II - Mandelbrot
InstantCluster Step 8: Coding III - Mandel Zoom
InstantCluster Step 9: Coding IV - POVRay
InstantCluster Step 10: Coding V - Blender
InstantCluster Step 11: Coding VI - 3D Animation
February Meeting - mandelSEQ.py
We finally figured out how to write a single core version of the Mandelbrot program in python!
Next we have to figure out how to add MPI4PY functionality to this program writing mandelMPI.py and run it on all 96 cores!
During our March meetings we'll setup a native MPI stack on our Linux boxes. We are following the MPI4PY examples from this manual:
After setting up Legolas as a Student PC, I added the passwd protected user Shadowfax to Legolas with "sudo adduser shadowfax" in the terminal. Don't forget to "sudo chmod 700 /home/*" so your files are secure when legolas is logged in! Now, Shadowfax will be my Teacher user (see video above). Further, I'm tweaking this Teacher user for SmartBoarding, ScreenCasting and Mirroring:
SmartBoard =
Xournal or SmartNoteBook
ScreenCasting =
avconv or Screencast-o-matic
Mirroring =
SplashTop or TeamViewer
Then, I followed these steps: (1) Install JRE as a FireFox plugin using the zip file and instructions given here. I wanted to update to the lastest JRE so that Screencat-O-Matic (SOM) could work again for ScreenCasting. I also wanted JRE for Keepvid, but this site won't allow JRE 1.7 as it's considered a security risk. You may want to install 1.6 instead. I got SOM working fine, but I'm still using avconv as it renders an MP4 file on the fly. I used SOM for the last screencast I made. That video was only 16 minutes long but SOM took over 8 minutes to render a 55MB file! By comaprison, the video above was recorded with avconv and is about 20 minutes long but took no time to render after I stopped recording! However, the MP4 file size was nearly 150MB.
(2) Download the latest 32 bit version of SmartNotebook for Linux from SmartTech. Be careful to install the DEB files in this order of dependency: smart-common, xf86-input-nextwindow, nwfermi, smart-activation, libudev0, smart-gallerysetup, smart-hwr, smart-languagesetup, smart-product-drivers, smart-notebook.
2a) note: xf86-input-nextwindow and
libudev0 were installed using the Ubuntu Software Center (USC).
2b) note: when you first execute your newly installed SmartNotebook, you will need a product key!
(3) Install Chrome from here. I need Chrome for the ESchool gradebook.
(4) Install Ubunutu-Restricted-Extras from the USC to get flash and to enable libdvdfree4 for DVDs and VLC among other things.
(5) Install VLC from the USC to play back MP4s and DVDs.
(6) Install libav-tools from the USC to use avconv instead of ffmpeg for ScreenCasting.
(7) Install TeamViewer or SplashTop from the USC to mirror the desktop to a tablet aka Kindle Fire HD an 9" Droid tablet with an HD multi-touch screen. In Ubuntu 13.10 you need to install python-appindicator from the USC for SplashTop to execute. Mirroring apps are great for controlling your Desktop and SmartBoard remotely from a tablet! It's your choice, but I'm using TeamViewer right now as I have to pay for SplashTop due to the high school's network setup. At the college, the network is set up in such a way that SplashTop is free to use.
(8) Install Xournal from the USC to be used instead of SmartNotebook as needed.
8a) note: when I use SmartNotebook in combination with either screencaster plus TeamViewer, the system is very laggy.
8b) note: when I use Xournal in combination with either screencaster plus TeamViewer, the system response is better!
8c) note: last Summer, I found SplashTop to be a little more responsive than TeamViewer.
(9) all we left on the desktop was the SAGE directory, a short cut to TilEm and our handy dandy Trig Table (see below)
(10a) to use TilEm, the students just click on the short cut
(10b) to use TIEMU and SAGE open a terminal and type "tiemu" or "sage" on a command line. I also added a VERY complicated bash script for this:
#!/bin/bash
tiemu
January Meeting
Testing out code!
We searched the web for MPI tutorials and found some code to try out on our 96 cores. Take a look at our sample code in the DropBox link above. We compared serial vs. parallel samples of the same task, whether it be Quadrature or Fractal! Using the pelicanHPC DVD we have compilers for mpicc, mpiCC as well as mpif77. I don't know if we have mpif90. We can also use mpi4py without compiling!
mpif77 = FORTRAN77
mpif90 = FORTRAN90
mpicc = C
mpiCC = C++
mpi4py = python
When we compiled, for example, FORTRAN77 code we used the mpif77 compiler on both the serial and parallel versions:
Here's a promising site for sample *.f and *.c code!
Next meeting we are going to write our own mpi4py code to generate Mandelbrot Fractals!
December Meeting
Firing on all cores!
Today we booted up the entire LAN using the pelicanHPC 64bit 2.9 with mpi4py DVD! We finally got up to 24 nodes with 96 cores and nearly 50 GFLOP/s!! Great job guys!!! Now we have to decide if we are going to install a native MPI stack. We also need to research sample MPI code online to learn how to program the cluster in FORTRAN77, C, C++ and python. We used the code above, which estimates pi using Reimann Sums and arctan(x), to stress the cluster. BTW, we don't have 100 cores as my PC is on another logical subnet and its only dual core anyway.
To compile:
mpif77 -o flops flops.f
To execute
mpirun -np 96 --hostfile ~/tmp/bhosts flops
November Meeting II
Firing up the cluster for the first time!
We are trying to figure out if we can use a bootable Linux CD to boot up the cluster or if we want to add an MPI stack with public key authenticated sshd to our Ubuntu Desktop. So, we downloaded the pelicanHPC ISO, burned a DVD and got 17 compute nodes or 68 cores running at about 35 GFLOP/s!
Hey, that's not too shabby, just 13 years ago, top500.org reports that all you needed were 50 cores running at 55 MFLOP/s to make the list of one of the 500 fastest clusters in the world! We may even get up to 50 MFLOP/s if we get all 100 cores up and running.
So, we're looking at pelicanHPC, BCCD and ClusterByNight for MPI. We used to run clusterKNOPPIX, BCCD and Quantian with openMOSIX. Too bad openMOSIX isn't supported anymore. It was so easy to code for MOSIX. In C or C++ all you had to do was use the fork() function to start a new process. openMOSIX ran in the Linux Kernel. Whenever your processes came close to using 100% of you CPU, MOSIX would automagically send one of your forked jobs to another processor. When we started using MOSIX, we only had one core per PC, so that meant send the job to another PC on the LAN. In those days (late 1990s) we managed to run 100 cores anyway by taking over 4 PC Labs on my floor at school....
November Meeting I
Last Linux Install Fest!
We finally got the new 64bit Ubuntu 13.10 Saucy Salamader installed correctly on all student PCs. I'll upgrade my station at a later date. We got this down to a science:
(9) all we left on the desktop was the SAGE directory, a short cut to TilEm and our handy dandy Trig Table (see below)
(10a) to use TilEm, the students just click on the short cut
(10b) to use TIEMU and SAGE open a terminal and type "tiemu" or "sage" on a command line.
(11) I'll add TilEm and TIEMU to the start-up menu. I was going to add "sage -n" too, but I don't want FireFox hogging all my Desktops at bootup!
October Meeting II
Linux Install Fest Again!
I downloaded 8 copies the latest version of Ubuntu Desktop 32bit ISO: 13.10 Saucy Salamander. Then I burned 8 DVDs and reinstalled the Linux partition on the second row of 8 PCs in our classroom. The geek squad did all the tweaks this time!
We are having a massive problem with VTI running under WINE. It's so slow as to be unusable. We have to figure out a solution. Maybe 13.04 is better? Or maybe I can get WINE's direct ppa and use their latest version?
Another problem is that we have a SAGE directory on the Desktop extracted from the latest compiled version of SAGE. In there we have a SAGE bash script. I usually make it executable and students can just click it to run SAGE. In 13.10, the script will not execute, the script just opens in gedit even though I made the file executable. I even ran "which bash" to see if bash moved (it did) so I could update the #! line but still no joy!
We downloaded 8 copies the latest version of Ubuntu Desktop 64bit ISO: 13.10 Saucy Salamander. Then we burned 8 DVDs and reinstalled the Linux partition on the first row of 8 PCs in our classroom. I did all the tweaks the following day.
Next week I'll reinstall the 2nd row and the Geek Squad will do all the tweaks. I like to keep the Student Stations very simple. So, we will only tweak as follows:
(1) configure Network (eth0, proxy)
(2) configure Appearence and Brightness
(3) configure Printers
(4) sudo apt-get update (after setting sources to main).
(5) sudo apt-get upgrade
(6) install WINE
(7) copy VTI to the desktop
(8) extract SAGE to the desktop
September Meeting I:
Administrativa!
(1) Wreath of the Unknown Server: We visited our first ssh server, Colossus, which is still in the switch room though dormant. I set it up for the first time in 1995 running Slackware Linux. Colossus ran for 12 years straight, 24x7 never having to shut down, reboot or even have anything re-installed!
(2) Display Case Unveiled: We took down a ton of fractal prints and ray tracings from Room 429 to the 2 cases on the 1st floor near the art wing. We decorated both cases as best we could and left before anyone saw us. Must have been gremlins.
(3) Recruiting: We decided that we have more than enough qualified CIS(theta) members for this year's Geek Squad, so we tabled that topic.
(4) Planning: We have to wait another 2 weeks 10/4 at which point Ubuntu 13.10 Desktop Edition should be available for a mini install fest. After that, we may use bootable cluster Linux CD distros such as BCCD and pelicanHPC to learn MPI using C++ or Python. We also talked about installing an MPI stack on each hdd along with public key authenticated ssh. We would like to make a fractal zoom animation.
(5) Summary: This year's CIS(theta) team is off to a good start. Shadowfax, our 100 core cluster, is in good hands!