Monday, February 17, 2014

CIS(theta) 2013-2014: February Meeting - mandelSEQ.py

CIS(theta) 2013-2014 

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:



Midterm Week II
Tweaking the SmartBoard User!
 
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.
8d) note: the following work together
BlueTooth or USB mic
8d) note: in Linux, I prefer
BlueTooth mic
avconv
xournal
Teamviewer
WiFi Droid tablet.
8e) note: on the road, ie Windows, I use
USB mic
SOM
SmartNotebook
SplashTop
SmartBoard or PC Projector.
8f) note: on the road, last Summer, I used
USB mic
SOM
xournal
SplashTop
PC Projector.
8g) note: in Linux, right now, I use
BlueTooth mic
avconv
SmartNotebook
SplashTop
WiFi Droid tablet or SmartBoard.
9a) to use avconv instead of SOM with a USB Mic, use this script: 
#!/bin/sh
cd ~/
avconv -f alsa -i plughw:1,0 -f x11grab -r 30 -s 1600x1200+0+0 -i :0.0 -vcodec libx264 -preset ultrafast -threads 4 -y 00avonc.mp4
9a) to use avconv instead of SOM with a BlueTooth HeadSet, use this script: 
#!/bin/sh
cd ~/
avconv -f pulse -i default -f x11grab -r 30 -s 1600x1200+0+0 -i :0.0 -vcodec libx264 -preset ultrafast -threads 4 -y 00avonc.mp4


Midterm Week
Reinstalling the Teacher PC!
First, I reinstalled my Linux box as a student station with the new 32bit Ubuntu 13.10 Saucy Salamader as follows (see screencast above):
(1a) download latest ISO and burn a DVDs
(1b) install DVD with plain vanilla defaults
(2) edit eth0 connection
(3a) edit system settings/network/proxy
(3b) edit system settings/appearance
(3c) edit system settings/brightness
(3d) edit system/settings/printers
(4) edit sources to main in USC
(5a) sudo apt-get update
(5b) sudo apt-get upgrade
(6a) USC install WINE and TIEMU
(6b) add TI89 and TI92 ROMs to TIEMU
(7a) download, extract and install TilEm
(7b) add TI83 and TI84 ROMs to TilEm
(8a) download and extract SAGE.lzma
(8b) echo "alias sage=$HOME/Desktop/SAGE/sage" >> ~./bashrc
(8c) source ~/.bashrc
(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:
mpif77 -o fpi-serial fpi-serial.f
mpif77 -o fpi fpi.f

then to execute said code:
./fpi-serial
mpirun --hostfile ~/tmp/bhosts -np 96 ./fpi

If you want to test your code off the cluster and you have, say a quad-core, you can do:
mpirun -np 4 ./fpi

What's nice about mpi4py is that you can just execute your code:
mpirun -np 4 01-hello-world.py

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 pelicanHPCBCCD and ClusterByNight for MPI. We used to run clusterKNOPPIXBCCD 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: 
(1a) download latest ISO and burn 8 DVDs
(1b) install DVD with plain vanilla defaults
(2) edit eth0 connection
(3a) edit system settings/network/proxy
(3b) edit system settings/appearance
(3c) edit system settings/brightness
(3d) edit system/settings/printers
(4) edit sources to main in USC
(5a) sudo apt-get update
(5b) sudo apt-get upgrade
(6a) USC install WINE and TIEMU
(6b) add TI89 and TI92 ROMs to TIEMU
(7a) download, extract and install TilEm
(7b) add TI83 and TI84 ROMs to TilEm
(8a) download and extract SAGE.lzma
(8b) echo "alias sage=$HOME/Desktop/SAGE/sage" >> ~./bashrc
(8c) source ~/.bashrc
(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!

How about an alias like:
echo "alias sage=$HOME/Desktop/SAGE/sage" >> ~/.bashrc

then:
source ~/.bashrc

October Meeting I
Linux Install Fest!
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!

==================================
What we are researching VI (Jan):MPI4PY

Lisandro Dalcin

==================================



What we are researching V (Jan):MPI
==================================
What we are researching IV (Dec):MOSIX
==================================
What we are researching III (Nov)
==================================
What we are researching II (Oct)
==================================
What we are researching I (Sept)
Thomas Jefferson High courses
Thomas Jefferson High paper
Thomas Jefferson High ftp
Thomas Jefferson High teacher
==================================
Daily Attendance:
CIS(theta) 2013-2014: Tyler absent

BiWeekly Topic:
CIS(theta) 2013-2014 - mandelSEQ.py! 

Monthly Reading:
Chapter 6: Building Parallel Programs (FEB)
Chapter 5: Building Parallel Programs (JAN)
Chapter 4: Building Parallel Programs (DEC)
Chapter 3: Building Parallel Programs (NOV)
Chapter 2: Building Parallel Programs (OCT)
Chapter 1: Building Parallel Programs (SEP)
==================================
Membership (alphabetic by first name):

CIS(theta) 2013-2014: BryanS, CheyenneC, DanielG, HarineeN, RichardH, RyanW, TatianaR, TylerK

CIS(theta) 2012-2013: Kyle Seipp

CIS(theta) 2011-2012: Graham Smith, George Abreu, Kenny Krug, LucasEager-Leavitt

CIS(theta) 2010-2011: David Gonzalez, Herbert Kwok, Jay Wong, Josh Granoff, Ryan Hothan

CIS(theta) 2009-2010: Arthur Dysart, Devin Bramble, Jeremy Agostino, Steve Beller

CIS(theta) 2008-2009: Marc Aldorasi, Mitchel Wong

CIS(theta) 2007-2008: Chris Rai, Frank Kotarski, Nathaniel Roman

CIS(theta) 1988-2007: A. Jorge Garcia, Gabriel Garcia, James McLurkin, Joe Bernstein, ... too many to mention here!

==================================
Well, that's all folks!

Sunday, February 16, 2014

UPDATES: SmartBoards and FlatScreens and IdeaPads, oh my!

Baldwin Senior High School
(5/31/11) We had a lot of upgrades this year to our PC Lab/Classroom. Last week we got all new flatscreens! Last month we got an extra wide SmarBoard (model 885ix, 79.5" wide) with a short throw projector and speakers and HDMI input!

(5/31/11) We also got some new servers, Guardian and Caprica took over where Colossus and Centuari left off. Guardian/Colossus are SSH servers for students to login into from class or from home to save their work. Caprica/Centauri are FTP servers for me to share files with my students on and off campus.

UPDATE 2/16/14: I'm using DropBox, YouTube and Edmodo instead of an FTP server now!


DonorsChoose.org
(5/31/11) BTW, please don't forget to contribute to my current DonorsChoose project (Lenovo IdeaPad to replace Smart Airliner Slate aka Wacom Graphire 6x8 Tablet). 
UPDATE2/16/14: That project was not funded. I'm using a Kindle HD 8.9 WiFi Droid Tablet with SplashTop plus a BlueTooth Headset Mic instead!


Nassau Community College
(5/31/11) My last picture gallery was of room B218 at Nassau Community College when I taught in that room last Summer. I wish I still had those pictures, that room is amazing. I lost some files when I moved this blog from tripod.com to blogspot.com! Anyway, that room is 2 stories high. It occupies the center of the B tower at NCC. This room has PC Projectors and a multimedia PC station plus drops to add your own laptop. From this multimedia station you can control all the audio/video in the room. There's balcony seating all the way up the tower with several 50" HD Screens along the way, cool!
UPDATE2/16/14: I don't teach in B218 much anymore. I use B115 or B119 now.


Picture Gallery!
(5/31/11) What follows is a gallery of pictures I took in my new room at BSHS with my new Droid cell phone!  
UPDATE2/16/14: This room was destroyed by Hurricane Sandy last year! We have since rebuilt and the room is similar to what you see below. The masthead above is a more recent photo!



















































I hope you enjoyed this week's updates - that's all folks!

Generally Speaking,

Monday, February 10, 2014

Teaching Math 5H: MOOCs and UNIT 7 More Transcendental Functions

Teaching Math 5H
UNIT 7 Calculus of Transcendental Functions

Quarter III Weeks 1&2: 2/3-2/14
We didn't get very far this past couple of weeks with 3 SnowDays and a Delayed Opening in the way! We did somehow manage to finish UNIT 7 focusing on Differential Equations. We talked about Slope Field and Variable Separable solutions for Exponential Growth and Decay, Exponential Approach (aka Newton's Laws of Heating or Cooling) and Logistic Growth models! After February Break we have our last AB Part I MCQ Monday and then we'll talk about L'Hopital's Rule and Indeterminate Forms.

Announcement from the AP Calculus Forum:
FREE! MOOC style AP Review courses at coursera.com only for Calc and Stats at present!

The University of Houston is offering the following FREE courses through Coursera, with start dates of March 17. Registration is currently taking place. Please inform your interested students and colleagues.

Quarter II Weeks 8&9: 1/13-1/24
We started UNIT7: Transcendental Functions! We focused on the derivative of ln(x) and Logarithmic Differentiation. Next week and after Midterm Week, we'll revisit Applications of Derivatives, Applications of Integrals and Variable Separable Differential Equations involving e^x and ln(x).

UNIT 7 Calculus of Transcendental Functions:

Quarter II Week 7: 1/6-1/10
We finished UNIT6: Applications of the AntiDerivative! We focused on Volumes with Known Cross Sections, Arc Length and Surface Area.

Quarter II Week 6: 12/16-12/20
We continued UNIT6: Applications of the AntiDerivative! We focused on Volumes of Revolution with horizontal and vertical strips: Disk, Washer, Shell. Of course, Friday was Calculus Caroling Day!



Quarter II Weeks 4&5: 12/2-12/13
We started UNIT6: Applications of the AntiDerivative! We focused on the Betty Sue problem and the importance of adding a constant C. We talked about horizontal and vertical strips in our Riemann Statements for finding area between curves and Volumes of Revolution.

UNIT 6 Applications of AntiDerivatives:




Quarter II Week 3: 11/25-11/29
This week we continued our discussion of AntiDerivatives by introducing The Fundamental Theorem Parts I and II! We went over a MCQ Monday on Monday and did the Fundamental Theorem on Tuesday. This was a short week due to Thanksgiving, so we had GAMEDAY on Wednesday. Fun was had by all!

Since we were covering Indefinite Integrals this week, we had to do the Betty Sue FRQ and sing the song

Also, next week is December already, so we start practising our preCalculus and Calculus Carols!

Quarter II Week 2: 11/18-11/22
This week we continued our discussion of AntiDerivatives and Riemann Sums! We focused on Scientific Computing. IE: we wrote programs in TI89 BASIC demostrating the Numerical Methods for definite integration: LSUM, RSUM, MSUM, TRAP and SIMP!

Quarter II Week 1: 11/11-11/15
This week was all about AntiDerivatives and Riemann Sums! We talked about Right Riemann Sums as exact limits. Next week we'll have to right some TI89 code! We also started talking about solving Variable Separable Differential Equations.

UNIT 5 AntiDerivatives and Riemann Sums:




Quarter I Week 9: 11/4-11/8
We finally finished with UNIT 4: Application of Differentiation this week. We programmed Newton's Method in TI89-BASIC. We also covered related rates. Next week is all about AntiDerivatives and Reimann Sums!

Quarter I Week 8: 10/28-11/1
We're nearly finished with UNIT 4: Application of Differentiation this week. We programmed Newton's Method in TI89-BASIC. We also started related rates this week.

Quarter I Week 7: 10/21-10/25
We started UNIT 4: Application of Differentiation this week. We started talking about IVT, MVT, Min/Max and Optimization!

UNIT 4 Applications of Derivatives:




Quarter I Week 6: 10/14-10/18
This week we finished UNIT 3 with a discussion of the Chain Rule, Implicit Differentiation, Min/Max and Related Rates.

Quarter I Week 5: 10/07-10/11
Out sick.... However, I did start using DropBox, see above!

Quarter I Week 4: 9/30-10/04
We started UNIT 3 about Differentiation! We derived the Product and Quotient Rules. We did all 6 Trig Rules. We started talking about the Chain Rule.

UNIT 3 Differentiation Rules:



Quarter I Week 3: 9/23-9/27
We finished UNIT 2 with a test! Our last topic concerned the existence of the derivative. BTW, we start with UNIT 2 since UNIT 1 is just a review of PreCalculus. We did a bit of that in 106 and 107 on Conics and Polar Notation.

Quarter I Week 2: 9/16-9/20
We are almost finished with UNIT 2: Continuity and Differentiablility! We demostrated the Power Rule using the Definition of the Derivative as the limit of the Difference Quotient. We even started the Trig Rules!


Quarter I Week 1: 9/9-9/13
AP Calculus BC started with a preCalc review in the form of the topic of Conic Sections! This is a great topic to review Cartesian and Polar Coordinates, as well as some algebra, trig and TI89 usage!

UNIT 2 Limits and Derivatives:




Well, that's all folks!

Sincerely,