Brigham Young University Computer Science Department
July 1999
Abstract
A fully implemented special kind of screen saver is described which runs under Windows NT. This screen saver runs an application in the background only while the screen saver is running. When the screen saver stops the background job and all its descendants are terminated. The application can be arbitrary, but one which allows distributed parallel computing using the DOGMA [Clement99] system is described.
Introduction
At the LinuxWorld Expo held in March 1999 [IBM99], a cluster
of workstations based on the Pentium II Xenon chips was shown to match
that of a Cray supercomputer both in terms of performance and scaleablity.
Many research groups that could profit from the use of
a super computer currently don't have one.
But they do typically have large numbers of workstations.
At any given point in time there may be many which are idle.
A research laboratoy will purchase workstations because
of availability, cost and they can do the programs they want to run. Many
system have been constructed to utilize idle workstation cycles. By way
of definition, we use the term idle to denote a computer where nobody
is logged on and the screen saver is running.
Overview
A campus laboratory has 15 computer workstations in it. As you walk in at any point in time you find that several are not being used. When class assignment become due the utilization goes up. If you come in during the middle of the night none are being used. Actually many systems allow for sharing the CPU over the network. The difference here is that when a person sits at their machine, and the screen saver goes away they can be guarenteed that they have all the resourceses. Other systems tend to bogg down the system and as processes (sometimes rouge) clutter the system, users and administrators get upset. People tend to learn about nice or idle priority but there is a more eligant way. One critical thing to remember is that a parallel computing paridignm must be used which allows for a high degree of [fault tollerance] because processes are going to enter and leave the system at random times as people reclaim their workstations for themselves.
Architecture
There is a windows screen saver part which does essentially
two things: displays a nice picture starts the terminator.
We learned the hard way that there must be a separate
programming running from the screen saver.
At first we thought that we could just have everything
as part of the screen saver. The problem comes in when a user tries to
exit the screens saver via the cntrol-alt-delete sequence. This particular
sequences can cause the screen saver to abrubtly end before it has
finished doing everything it should do. It seems that although, from a
programming point of view you can be notified that the screen saver is
closing, all of a sudden your code terminates ruthlessly.
We overcame this problem by creating a different process,
The
Terminator, which waits for the screen saver to die and when the screen
saver dies, performs the necessary clean up and then exits.
Clean Up
So what kind of clean up is necessary?
The philosophy behind clean up is as follows.
When the screen saver terminates it is important that
the part of the screen saver which joins the [cluster] closes. We chose
to do this as follows: the nicest way is to find the correct appletviewer
the one who is a descendant of the screen saver and send it a WM_CLOSE
message. This is how windows says you should close a window of another
application nicely to give it a chance to clean up after itself and close
anything, etc.
Now it is possible that that window refuses to go away
and so there must be, out of necessity, a way to terminate applications
ruthlessly.
And in windows the way to do it with the TerminateProcess
API (signal ( process , SIG_KILL ) is the POSIX way.)
Another key point to make is that there may be many processes
running which were started through a chain of events from the screen saver
starting. It is important to terminate all of them.
This is how we can be sure we have terminated all of
them:
1) find all ancestors
2) terminate nicely the AppletViewer who is an ancestor
3) terminate ruthlessly all remaining ancestors
Conclusions
I conclude.
References
Clement99 High PerformanceComputing for the Masses by Mark Clement,
QUinn Snell, and GLenn Judd 11 IPPS/SPDP'99 Workshops pages 781-812.
IBM99 http://cnn.com/TECH/computing/9903/16/super.idg/
Pietrek97 Under the Hood by Matt Pietrek, Microsoft Systems
Journal 1997