2007-10-04

Of course, it helps if you tell gcc to generate a 64 bit executable

... when you're using 64 bit operations:
tercel-2:$ time bin32/tbray4 datasets/hundred-o10k.ap 
user 0m5.644s
tercel-2:$ time bin32/tbray6 datasets/hundred-o10k.ap
user 0m4.048s
tercel-2:$ time bin/tbray4 datasets/hundred-o10k.ap
user 0m5.725s
tercel-2:$ time bin/tbray6 datasets/hundred-o10k.ap
user 0m3.839s
I'd assumed it would default as it does on linux, but no. Which also explains why I was confused about sizeof(size_t) being less than sizeof(long long) here.

It's still around 8 clock cycles per byte - the 5% gain is not enough to alter yesterday's estimates, which is a little encouraging actually, as I wasn't sure whether or not 32 bit Sparc instruction generators, such as gnu lightning (used in rubinius) or whatever erlang's hipe uses would cause a significant slow down.


Pete

Labels: , , ,

2007-09-11

sshfs and subversion

I just lost a longer post as I'd forgotten to plug my laptop in, and was editing in SciTE rather than here, and the laptop powered off rather than hibernating (I've changed the setting now, System>Preferences>Power Management, the 'On Battery Power' tab, though why the default action was to destroy data I don't know. Bad Ubuntu.)

Anyway, I've got sshfs working instead of samba on the laptop, as SciTE doesn't understand smb: urls, and installed subversion on lure, my little server, so have a shared code repository between my machines. I also set up password less login so to use svn+ssh to connect to subversion from both fortinbras, my laptop and tercel-1, the Netra I've installed build tools on. I can now edit on either machine using the same tools, sync with svn, and build.

Now I might actually get round to doing something with the projects which have been sitting on my hard-drive for the last year or so.


TME

Labels: , ,

2007-09-08

Misc Admin - Laptop PCI, Bubba Static IP, More Disks

Laptop PCI Conflict

For a while, my laptop BIOS had been sporadically reporting a PCI conflict on boot, with no other symptoms.
It's dual boot Windows XP Home and Ubuntu, and after the latest Window Update it lost its on-board network adapter, both in XP and Ubuntu. Rolling back the update fixed Windows, but somewhere some persistent state made the PCI conflict happen around half the time, and if it did happen Ubuntu would not see the card, or be able to recover.
The logs said 'try pci=assign-busses', so I did (in GRUB use e to try it once, edit /boot/grub/menu.lst to make it permanent), and the adapter reappeared and (so far) there have been no conflicts on rebooting. In addition, Ubuntu can now see the SD card, (presumably that is what it was conflicting with) which means I don't have to boot into XP to snarf the photos from my camera.
Now if only the wifi button was broken enough to appear in the logs and explain how to fix it...

Bubba and Static IP

On Friday my new excito Bubba home server arrived. I plugged it in, switched it on and all was good.

Mounting Bubba Shares

There was a little playing around to get Ubuntu to see the Samba shares, which I also put on the excito forum thread which gave some clues:
The server appears in Nautilus when you choose Places > Network, as ftp, sftp and is also under Windows network.
Browsing into the server, it requests user and password as expected, adds them to the keychain, then shows the files.
For a one-off mount:
fortinbras# mount -t smbfs //bubba/home /net/bubba/home -o username=*****,password=***** 

Following the instructions at justlinux.com for adding to /etc/fstab, the following works with mount -a when run as root:

//bubba/home    /net/bubba/home     smbfs credentials=/home/pete/.sambacreds,uid=pete 0 0
//bubba/storage /net/bubba/storage  smbfs credentials=/home/pete/.sambacreds,uid=pete 0 0
On next reboot, the mount points appear in Nautilus, but you can't mount them as a user.
To get mount working for users, you need to set suid root on smbmnt and ensure that the mount point is owned by the user doing the mounting.
I haven't tried enabling mounts for more than one account; if you add lines to fstab for each user, it adds icons for the mount points to everyone's accounts; trying to use ~ for the mount point and credentials doesn't seem to work either.

Backup of tincancamera.com

I couldn't find a recursive authenticated ftp client for the Bubba - its version of wget doesn't accept the --ftp-user arguments - so I've used wget with htpp to crawl the site, which gets everything except the access logs. I hadn't read the access logs, and they were putting me over the hosting's quota (they just grow rather than rotating as I'd expect them to), so I got them and deleted them off the server, so I'm using 3MB of the 5 I'm paying for rather than 11.

Static IP

I'd like the Bubba to be on the net, but I don't have a static IP. I'm with Pipex, who are fast and reliable if not the cheapest at the moment, but in addition to their stated charge of £1.25 a month require that my existing service be upgraded to a current plan (the current plans are 8MB instead of 1MB for the price I'm on), but would mean a new 12 month contract. I'm moving in three months, so that would mean paying for nine months I'm not here at £26.24 a month, which is silly - it would make adding a static IP for three months cost £79.97 a month, 1p less than twice what Pipex charge for a dedicated server. I've mailed them to see if they'll give me a static IP on my current £24.99 a month for a reasonable set-up fee, but haven't heard back yet.

More Disks

I'd bought three more 18.4GB disks for my Netras off ebay (Seagate ST318437LC x 3 for £29.89 including p+p), which arrived this morning. After popping down the road to AJM Micro for two dozen mounting screws, they are now installed and (following the guide here - docs.sun.com is nearly as slow as del.icio.us) each give a 16.7G zfs file system for use as a data area for mucking around with:
tercel-1# zpool create data c0t1d0
tercel-1# zfs create data/fs
tercel-1# zfs list
NAME USED AVAIL REFER MOUNTPOINT
data 104K 16.7G 24.5K /data
data/fs 24.5K 16.7G 24.5K /data/fs
tercel-1# df -h /data/fs/
Filesystem size used avail capacity Mounted on
data/fs 17G 24K 17G 1% /data/fs


TME

Labels: , , , ,

2007-09-07

First compile and run on Solaris 10.

I've got first run of one of my quad-store benchmarks running on my Solaris 10 boxes.

I needed to make the machine architecture and a flag whether or not to use SSE2 environment variables, and add some extra #defines so none of the SSE stuff was included. I needed a macro to fake posix_memalign, though will think about using another malloc-based version. Compiling on Solaris also generates warnings for automatic promotion of -1 to an unsigned int so I added explicit casts (-1 is returned by some functions where 0 is a valid return and something is needed to signal an invalid value).

Running the compression benchmark, the sparc (440MHz) doesn't seem to get cpu bound for small files (100MiB):

tercel-1$ uname -a
SunOS tercel-1 5.10 Generic_118833-33 sun4u sparc SUNW,UltraSPARC-IIi-cEngine

tercel-1$ time bin/lzw_bench datasets/original/triples.sql 100
...
read: 100 MiB, compressed to: 21 MiB.

real 0m23.094s
user 0m20.973s
sys 0m1.715s

tercel-1$ time bin/lzw_bench datasets/original/triples.sql 1000
...
read: 1000 MiB, compressed to: 301 MiB.

real 3m55.124s
user 3m39.377s
sys 0m12.550s

fortinbras$ uname -a
Linux fortinbras 2.6.20-16-generic #2 SMP Thu Aug 30 23:16:15 UTC 2007 x86_64 GNU/Linux
fortinbras$ time bin/lzw_bench datasets/original/triples.sql 100
...
read: 100 MiB, compressed to: 21 MiB.

real 0m8.638s
user 0m5.784s
sys 0m0.296s

fortinbras$ time bin/lzw_bench datasets/original/triples.sql 1000
...
read: 1000 MiB, compressed to: 301 MiB.

real 0m56.176s
user 0m43.667s
sys 0m1.948s

The processor in fortinbras is Mobile AMD Athlon(tm) 64 Processor 3400+ at 2200 MHz, the Netra at 440 MHz, and appears to be about a quarter as fast at a fifth of the clock speed.

On the other hand, running the Netra at full doesn't heat my lap up, I've three of them, they've more, faster disks available and I can play with making the quad-store distribute between them.

Whether they hold up as well against the benchmarks which use SSE to make the Athlon wider I'll have to find out.


TME

Labels: , ,

2007-09-03

Things I'll forget: Getting gcc, make and curl on Solaris 10

More admin stuff I'll forget if I don't record it:

Getting Curl



Curl is on the Solaris Companion Software DVD.

Having downloaded the companion DVD image, I mounted it on the Mac (double clicking the ISO image).

I then used Transmit to ftp the Sparc packages onto the 9GB install drive on tercel-1:/solimage/companion.

The readme for the DVD gives install instructions.

Mounting the DVD contents between the servers using NFS:
tercel-1# share /solimage/
tercel-2# mkdir /solimage
tercel-2# mount tercel-1:/solimage/ /solimage/


Installing the packages from the /solimage/companion/Packages directory:

tercel-N# pkgadd -d /solimage/companion/Solaris_sparc/Packages/ SFWcurl

Adding /opt/sfw/bin to PATH in ~/.bashrc means curl is on the path, and works when invoked - curl http://www.tincancamera.com gets the source for the homepage.

Finding gcc and make



You need . .bashrc in ~/.profile for .bashrc to be executed on login.

The additonal paths I've got so far are:

/opt/sfw/bin/ for curl.
/usr/sfw/bin/ for gcc

I wasn't entirely sure why curl is in /opt rather than /usr, but An Accelerated Introduction to Solaris 10 clarifies what the bits of the file system are for.

The make in /usr/ccs/bin/ is Sun make, not gnu make, which is /usr/sfw/bin/gmake. Add alias to .bashrc:

export PATH=$PATH:/opt/sfw/bin/:/usr/sfw/bin/
export PS1="\\h\\$ "
alias make=/usr/sfw/gmake


Currently I'm synchronizing these files between the tercels using ftp; I've a Bubba server on order so will move all my profiles onto that, since it's designed to be always on in a domestic setting.


TME

Labels:

2007-09-02

Things I'll forget: Installing Solaris 10 on Netras

This is what I did to install Solaris 10 on my Netra servers.

Firstly, downloaded CD images and burnt them to CD using a Mac. I probably could have saved a little time and some plastic mounting the ISOs on the Mac and accessing them over the net from the Netras, but there was enough new stuff to do anyway.

Referring to my previous shared memory entry and to Andy's Solaris disk faq I mounted a second 9GB drive on tercel-1 (my Netras are given the name 'tercel', being a small falcon, and numbered 1 to 3) to take the files for the install server. This was so I can move that disk to another machine after installing Solaris 10 on it, to use that as the install server for tercel-1.

I then followed the instructions for Creating a SPARC Install Server With CD Media and the following sequence to reboot tercel-3 from the net and install.

The install proceeds using my old sony 505 laptop connected to the LOM port, and sshing into it and using minicom. I do have a xyplex terminal server, but haven't ever got round to setting it up.

The first attempt at booting to the installer failed as I'd not selected VT100 as terminal, so got garbled screens. The second one stalled as I left it and went to bed halfway through the copying files stage and something timed out and dropped a connection.

The third attempt suceeded and tercel-3 booted into Solaris 10 from disk and was accessible via its LOM console.

I couldn't use ssh into the root account, and from the last time I set up a Solaris box, I'd forgotten how to setup user accounts (I wanted a clean install here too, having forgotten what I might have messed with a couple of years ago, so overwrote the previous settings completely).

To add user 'pete' with bash as login shell and create home directory in /export/home/:
bash-2.05# useradd -s /bin/bash -m -d /export/home/pete pete

To set password for user 'pete':
bash-2.05# passwd pete

Having done that, I could then login via ssh and change to super user using su as before.

I then brought all Netras down, and swapped the install server image disk from tercel-1 to tercel-3.

Using the previously mentioned procedure, I installed the Solaris image server disk:

tercel-3 console login: root
Password:
Last login: Sun Sep 2 14:17:12 on console
Sep 2 16:10:49 tercel-3 last message repeated 1 time
Sep 2 16:11:26 tercel-3 login: ROOT LOGIN /dev/console
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
# sync;sync;init 0
# svc.startd: The system is coming down. Please wait.
svc.startd: 83 system services are now being stopped.
Sep 2 16:11:54 tercel-3 syslogd: going down on signal 15
umount: /export/home busy
svc.startd: The system is down.
syncing file systems... done
Program terminated
ok setenv auto-boot? false
auto-boot? = false
ok reset-all
Resetting ...

.
Netra t1 (UltraSPARC-IIi 440MHz), No Keyboard
OpenBoot 3.10.25 ME, 1024 MB memory installed, Serial #14251450.
Ethernet address 8:0:20:d9:75:ba, Host ID: 80d975ba.

ok probe-scsi-all
/pci@1f,0/pci@1,1/scsi@2
Target 0
Unit 0 Disk IBM DDYST1835SUN18G S94A
Target 1
Unit 0 Disk SEAGATE ST39204LCSUN9.0G4207

ok setenv auto-boot? true
auto-boot? = true
ok reset-all
Resetting ...

.
Netra t1 (UltraSPARC-IIi 440MHz), No Keyboard
OpenBoot 3.10.25 ME, 1024 MB memory installed, Serial #14251450.
Ethernet address 8:0:20:d9:75:ba, Host ID: 80d975ba.



Boot device: /pci@1f,0/pci@1,1/scsi@2/disk@0,0:a File and args:
SunOS Release 5.10 Version Generic_118833-33 64-bit
Copyright 1983-2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: tercel-3
Sep 2 16:18:36 /usr/lib/snmp/snmpdx: can't open the file
Sep 2 16:18:36 /usr/lib/snmp/snmpdx: can't open the file
checking ufs filesystems
/dev/rdsk/c0t0d0s1: is logging.
/dev/rdsk/c0t0d0s5: is logging.
/dev/rdsk/c0t0d0s7: is logging.


I'm not sure whether that is actually necessary; the drives are supposed to be hot-swappable after all, but I don't know how to power a drive down and park it, or detect it without going to the LOM prompt.

Logging in and configuring and mounting the drive:

tercel-3 console login: root
Password:
Last login: Sun Sep 2 16:11:26 on console
Sep 2 16:21:13 tercel-3 login: ROOT LOGIN /dev/console
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
# bash
bash-3.00#
bash-3.00# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::sd0 disk connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t2d0 CD-ROM connected configured unknown
bash-3.00# cfgadm -c unconfigure c0::sd0
bash-3.00# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::sd0 disk connected unconfigured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t2d0 CD-ROM connected configured unknown
bash-3.00# cfgadm -c configure c0::sd0
bash-3.00# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::dsk/c0t1d0 disk connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t2d0 CD-ROM connected configured unknown
bash-3.00# format
...
Specify disk (enter its number): 1
selecting c0t1d0: sol10img
...
format> part
...
partition> print
Volume: sol10img
Current partition table (original):
Total disk cylinders available: 4924 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 73 129.75MB (74/0/0) 265734
1 swap wu 74 - 147 129.75MB (74/0/0) 265734
2 backup wu 0 - 4923 8.43GB (4924/0/0) 17682084
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 148 - 4923 8.18GB (4776/0/0) 17150616
7 unassigned wm 0 0 (0/0/0) 0

partition> q
format> q
bash-3.00# mkdir /solimage
bash-3.00# mount /dev/dsk/c0t1d0s6 /solimage/
bash-3.00# ls /solimage/
Copyright lost+found
installer Solaris_10
JDS-THIRDPARTYLICENSEREADME
bash-3.00# cd /solimage/Solaris_10/Tools/
bash-3.00# ls
add_install_client Installers setup_install_server
Boot miniroot_extra
dial rm_install_client


So we've got the Solaris 10 image server disk mounted and can list it.

bash-3.00# ./add_install_client -e 08:00:20:D9:A0:B2 tercel-2 sun4u
Error: unknown client "tercel-2"


I hadn't restored /etc/hosts, so it didn't know tercel-2.

I added the IP addresses for the machines on the local net to /etc/hosts, then trying again:

bash-3.00# ./add_install_client -e 08:00:20:D9:A0:B2 tercel-2 sun4u
Adding Ethernet number for tercel-2 to /etc/ethers
saving original /etc/dfs/dfstab in /etc/dfs/dfstab.orig
Adding "share -F nfs -o ro,anon=0 /solimage" to /etc/dfs/dfstab
making /tftpboot
enabling tftp in /etc/inetd.conf
Converting /etc/inetd.conf
enabling network/tftp/udp6 service
enabling network/rarp service
enabling network/rpc/bootparams service
updating /etc/bootparams
copying boot file to /tftpboot/inetboot.SUN4U.Solaris_10-1
bash-3.00# ./add_install_client -e 08:00:20:DA:09:C6 tercel-1 sun4u
Adding Ethernet number for tercel-1 to /etc/ethers
updating /etc/bootparams


Now it's time to reset tercel-1 and boot it off the net so it can run the installer, which requires swapping the serial connection over to its LOM. I do actually have a proper multi-serial port to net box instead of, but have never got round to setting it up.

tercel-1 console login: root
Password:
Last login: Sun Jan 22 23:05:38 on console
Sep 2 15:25:50 tercel-1 login: ROOT LOGIN /dev/console
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
bash-2.05# sync;sync;init 0
bash-2.05#
INIT: New run level: 0
The system is coming down. Please wait.
System services are now being stopped.
Print services already stopped.
Sep 2 15:26:20 tercel-1 syslogd: going down on signal 15
The system is down.
syncing file systems... done
Program terminated
ok boot net - nowin
Resetting ...
.
Netra t1 (UltraSPARC-IIi 440MHz), No Keyboard
OpenBoot 3.10.25 ME, 1024 MB memory installed, Serial #14289350.
Ethernet address 8:0:20:da:9:c6, Host ID: 80da09c6.

Executing last command: boot net - nowin
Boot device: /pci@1f,0/pci@1,1/network@1,1 File and args: - nowin
SunOS Release 5.10 Version Generic_118833-33 64-bit
Copyright 1983-2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.


nowin makes me think of 'no-win situation' but that's nothing to do with installing Solaris.

So it's booted into Solaris 10 from the net, as it's now a question of going through the installer screens again:
The machine is on a subnet
It's using the router downstairs
It's not using any naming services
It's in Great Britain
Set the time (tercel-1 had drifted five minutes)
Enter root password
Enable remote services
(I'm not sure quite what that means, since I can't ssh the server at this point, which would be useful to free the serial cable so I could install multiple machines)
Standard network install with auto reboot (and auto eject of CDs though that's not relevant)
Accept the NFS location of the install images
Choose Initial system - overwrites everything on the boot disk
Select locale as Great Britain UTF-8
No Solaris 10 extra value software
No Web Start Ready software
Entire Distribution (there isn't a headless option)
Then go through lots of packages deselecting anything with a GUI
And when you get to 'Z' you realise there's still 'a' after it as it's ASCII
So give up and hit OK
And are warned that you've deselected some packages (such as X) that other software depends on
So reset and install everything. Maybe later I'll find out how to make an image with just headless Solaris for developers, so I don't have to go through hundreds of packages on each machine, but this is too painful to be worth the effort.
Select a disk (there's only one on this machine)
Continue, don't preserve data.
Use AutoLayout
Select all file systems for AutoLayout
(including /usr/openwin which should be necessary on a headless system)
Accept the auto-layout
Don't mount any software from remote server.
Begin installation
OK to change default boot device
Watch the little bar go across the screen as it writes 3.8 GB of stuff to the drive.
Make a coffee and check to get the terminal server working - it requires a serial connection to tell it which IP to use, and since my only serial connection is in use, I can't set it up at this point.
Read a little on creating flash archives rather than doing this again for the next machine.
Skip additional languages and software.
Reboot.
It does seem to take quite a while to load smf service descriptions, which wasn't part of Solaris 9, so the first boot is much slower than previous OS boot.
I'm not sure how long subsequent boots take.
Add user 'pete'.
Login via ssh and check that can su and get control.
Disconnect LOM cable.

Repeat with next machine.

Set up dns without specifying a domain:
Add all local machines to /etc/hosts
Create /etc/resolv.conf with nameserver 192.168.0.1
Create /etc/defaultgateway with 192.168.0.1
Copy nsswitch.dns as the active configuration: cp /etc/nsswitch.dns /etc/nsswitch.conf

Started stripping out all packages related to not-present hardware (CD/DVD writer, USB, firewire) and to desktop, but ended up with a corrupted locale (even on a headless machine the locales require fonts, which is a bit of a surprise) and had to reset and install again.
Installing as an update would entail putting all the packages back in manually.
It would be really nice if there was a simple way to say "I don't want Gnome or X, thankyou" rather than unchecking hundreds of packages and getting no feedback on dependencies.



TME

Labels:

2007-09-01

OS Update frenzy

I'm not actually off having a life this weekend, and have run out of space on my laptop's linux partition, so am in the process of an upgrade frenzy.

I've archived all the data off the laptop onto my mac, and repartitioned the laptop from 45GB Win/45GB Ubuntu to 20 Win/ 20 Ubuntu/ 55 Data partitions, and will re-install ubuntu and an ext3 driver for Windows so I don't have half my data on one partition and half on the other. It's a real pain that it doesn't come with media for XP, as there's a lot more crap on it that I could get rid of if I could do a clean install (not only in terms of disk space - installing and un-installing some DVD software has left the audio system in mumbling mode), but I don't want to have to pay Microsoft to re-install an OS I've already paid for when I bought the laptop. The two things I use Windows for are games (mainly Runescape these days; maybe the next version of Ubuntu's Java plugin will be more stable) and to stepwise debug C++ code in Visual Studio - I haven't found anything like as good a debugger for linux yet.

My iPod battery died in Romania, and it's still not holding any charge; I'm not sure whether to upgrade that or not - it mainly gets used in my car on a 30 min commute each day, which charges it a bit, and the battery doesn't seem to be designed for that use (or the UI for that matter - you can't change albums either through the iPod or the head when it's plugged in, otherwise it wouldn't be an issue).

Having thought more about nodes for the quad-store, reconnected the three netras in the loft and am installing a clean version of solaris 10 on them, so I can see how it works on true 64bit hardware and server class disks, and don't cook my groin running the cpu in the laptop.

The main reason I don't use the netras much is that they are noisy and use lots of electricity, so I've also ordered an excito bubba, a fanless home server which draws 10W at full load, so can be left on in the corner behind the telly and used for file sharing.

Depending what happens to the laptop and bubba combination, and whether it's worth fixing the iPod, I may get rid of the mac, since the only thing I use it for that's OS X specific is re-installing the iPod's software when it goes wrong (which it does a couple of times a month), and archiving my mail accounts (which the bubba does automatically).



TME

Labels: , , ,