Basics of computers
- Hardware
- CPU
- memory
- disks (internal/external)
- network
- I/O: monitor, keyboard, mouse
- hardware communicates with the Operating System via hardware drivers
- Data: bits, bytes, etc
- bit (0/1)
- byte: 8 bits
- data types (bytes): character (ASCII) (1), short integer (2), integer (4/8), long integer (8), float (4), double (8)
- kilobyte = 2^10 (=1024: /remember this!) bytes; megabyte = 2^20 bytes; gigabyte = 2^30 bytes; terabyte = 2^40 bytes; etc.
- important to keep memory usage in mind when programming!
- How is hardware characterized in terms of data storage and latency?
- hard disk space: plentiful (GB-TB), but slow access. Analogous to a bookshelf.
- memory: less plentiful (MB-TB), faster access. Analogous to your long-term memory.
- cache (L1, L2, L3): limited (KB-MB), ultra-fast access. Analogous to your short-term memory.
- Questions:
- APOGEE image cubes are 2048x2048x47 reads: how much memory (hint: (2*2^10) * (2*2^10) * 47)?
- MULITDARK simulations have 2048x2048x2048 particles with "full phase space information", meaning that for each particle, the computer must store three numbers for position and three for velocity. How much memory is required if all numbers are floats (4 bytes)? doubles (8 bytes)?
- Software: operating systems (OS)
- Basic interface between user and hardware
- Provide tools enabling file management and process management, among other things
- There are various OS
- Windows
- Unix (more on next page)
- Mac OS X
- Linux: variety of ``distros'':
- RedHat /Fedora/ CentOS, Debian/ Ubuntu, SUSE, GENTOO, others
- distros provide Linux OS + add-on packages, package management, etc.
- Others: DOS, VMS, ChromeOS, iOS (iPhones), iPadOS (iPads), Android...
- Question: is Python an operating system?
- Software: operating system interfaces (more on shells later on)
- Text-based command-line interfaces (CLIs): UNIX shells such as bash, csh, sh, or tcsh
- Graphical user interfaces (GUIs):
- Hardware interface: X11, XQuartz (Mac OS X)
- Window manager/desktop environment: KDE, GNOME
- Mac's "finder" is a graphical shell
- Software: applications / programs
- Software: network communication
- Ability to log into machines across network (ssh)
- Ability to share files across network, without logging in (NFS, others)
- various network protocols for intermachine communication (web, printers, sockets, etc.)
- NMSU/Astronomy computing facilities
- Main NMSU interface, outside of Astronomy: my.nmsu.edu (course registration, email)
- Departmental servers: astronomy (main server), backup servers (computing center)
- Departmental computing nodes:
- hyades: 48 virtual cores, 31 GB shared memory
- praesepe: 48 virtual cores, 128 GB shared memory
- virgo (compute/disk): 128 virtual cores, 64 GB shared memory
- milkyway, seismo, solarstorm, henrietta ("private" computers)
- Dept. Desktops:
- provide basic computer needs (editing, writing, plotting, moderate file storage, basic computing capability)
- For example, Kristen's is called "wasp"; David's is called "castor"
- most have a single hard drive, with 2 user partitions: /machinename (100 Gby) and /machinename-data (850 Gby).
- All desktops see the server disks and the server sees desktop disks, but desktops don't see other desktops' disks except by request. Disks are seen across network only as requested (automount), using /home/partitionname
- Home directories are on the server disk!
- Quotas and quota notification
- backups: central servers backed up daily (no archives), desktop "small" partition backed up fully weekly, both small and large (data) partition small files backup every other day (includes archives)
- peripherals: printers (canon6555/copier, color, down), copier can be used as color scanner with documents emailed to you. Talk to fellow students about which printer they use and how to get set up with it, but do let us know if you can't get set up.
- remote access and security: outside of department, can only log onto astronomy.nmsu.edu, from there can log onto other machines. If you have three failed logins from an outside address, that adress will be "blacklisted", so if you can't get in, you'll need to let John or Zach know.
- off-campus access: If you are off-campus, then access to some NMSU resources such as academic journals and certain computers (eg discovery) will be impossible unless you activate a vpn client. This will also mask your location and can encrypt your internet traffic, improving your security.
- When to use what machines and disks?
- resource considerations
- For computations lasting more than a day or two, consider using a computing server. Learn to use "screen" to run jobs in a backgrounded shell!
- If running computationally-intensive work using a graphical, interpreted tool such as idl or python, be careful about running over the network!
- OS considerations (CentOS 7 vs CentOS 6)
- If you're running really intensive calculations, then talk to Kristian, Wlad, or Kelly about using NMSU's Discovery supercomputer
Some documentation on NMSU computing.
Getting set up
To avoid having to make sure different software is all installed on
different computers, we will use the central astronomy server. It's
possible to install things on your laptop, but may take some time and
effort: you'll have to decide whether you will work
on your laptop or another computer.
For remote usage:
- Computer needs to connect to network: AggieAir wireless, astro-wireless (NMSUAstronomy)
- Need to have SSH for remote login (Mac OS X: built-in; Windows: Putty
- Need to have X server running on laptop (Mac OS X: Xquartz; Windows: VcXsrv )
For standalone laptop:
- Python distribution with many common packages: Anaconda (Python 3.8) or Miniconda (see Astroconda in next line), if you know you don't need Anaconda.
- AstroConda distribution from STScI, which includes Anaconda + more!
- TOPCAT
- emacs editor (Mac OS X: built-in; Windows: emacs? )
- Alternatively, use the vi text editor, which is also built-in to Linux and mac machines and is probably available on Windows as well.
Network and remote login
To log into a remote machine, use ssh:
ssh -Y account@astronomy.nmsu.edu (the -Y enables trusted X11 forwarding)
After verifying that you can look at my display and your CLI at the same time, let's do some exercises with remote access:
Exercise 0