AudiLab Software

Finite-element software | High-performance computing | Departmental environment | Probe | Printing

Modelling software developed here

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
– Brian W. Kernighan

A number of applications for 3-D modelling have been and are being developed here (including Fie, Tr3, Thrup’ny, Fad and Fod) and are available as executable binaries. The source code can also be made available. An alternative to the Thrup’ny model viewer is Thrwp’ny, a Web-browser-based viewer.

Finite-element software (developed elsewhere)

We are currently using FEBio, Code_Aster and SAP IV. We previously also used CalculiX and OOFEM, and the commercial packages I-DEAS and COMSOL. We have also investigated Cast3m and Modulef. Elmer, Z88 and FreeFEM look as though they might be worth looking into. See also some old and sketchy information about available f-e software.

Other software developed elsewhere

We use Gmsh for generating tetrahedral meshes from surface meshes. Gmsh can also be used with the finite-element solver GetDP through ONELAB, although we have not tried it.

We use, have played with or have considered playing with the following, among many others: 3D Slicer, VisIt, ParaView, CIBC software (Seg3D, ImageVis3D, map3D, etc., from Utah).

For mesh manipulation: MeshLab, instant-meshes (for field-aligned remeshing)

Yade discrete-element modelling: demos here and here.

Other software developed here

Applications have been developed here for Hooke-and-Jeeves minimization, handling bibliographic references, and other miscellaneous tasks.

Libraries developed here include:

Other software used here

Libraries from elsewhere that are used here include:

I often use Emacs.

Until ~2000 I used mostly VMS and until 2008 we used DEC/Compaq Unix. Now we use Debian GNU/Linux, Ubuntu and (alas) M$ Windows.

I've collected some personal tips for MS Windows and for Unix/Linux.

High-performance computing

Calcul Québec is a regional partner of Compute Canada. Béluga ( and Narval ( are two of Compute Canada’s clusters and are located at ÉTS. Each contains hundreds of nodes (32 to 64 cores each) in several different configurations (Béluga, Narval).

Selected documentation:

A node contains ‘sockets’, and sockets contain ‘cores’; a core may contain multiple ‘threads’, or ‘logical processors’ (ref). If a node is configured with hyperthreading (i.e., >1 thread per core), then cpu refers to threads, otherwise it refers to cores (ref). According to scontrol show node, ThreadsPerCore = 1 for all of Béluga’s and Narval’s nodes, so cpu refers to cores.

For Compute Canada’ general-purpose clusters (Béluga, Cedar, Graham & Narval), jobs are allocated to a subset of the cores (default = 1 core) and memory (default 256 MB/core) available on a node; on Niagara jobs are allocated to complete nodes.

Software available on Compute Canada clusters includes the finite-element packages Abaqus*, ANSYS*, COMSOL* and Elmer (* means a licence is required). Graphics software that I recognize includes Blender, FreeSurfer, Gnuplot, ImageMagick, ParaView and 3D Slicer. MATLAB and Octave are available.

To download something to a cluster from the Web using the command line, wget can be used. If the URL doesn’t include the the file name, it can be specified separately with the --default-page option. Alternatively, the file can be downloaded to your local computer and then copied to the cluster.

If, after installing some software, it can’t find the libraries it wants, try using the script. For exampe, for FEBio, give the command --path path/FEBioStudio/bin/ --add_origin
where path is the path to where you asked for FEBio to be installed. I don’t know if --add_origin is necessary but presumably it doesn’t hurt. See Installing binary packages.

The commands seff and sacct are good for getting statistics on a completed job, and sstat can be used on a running job (ref).

Departmental environment

Departmental computing resources include a uPrint printer/scanner/copier; a shared computer with a scanner; wired (Ethernet) and wireless networking; and access to a backed-up file server (Probe).

Ethernet networking

Workstations within BME should use fixed IP addresses that are assigned. The netmask should be and the gateway address should be The DNS servers should be set to, and, and should be specified as the domain. See Network setup for how to do this under Debian/GNU Linux.

Probe file server

Probe is a Windows-based server that hosts both individual directories and shared lab directories, all of which are backed up regularly.
Each user has a quota of 5 GB in their personal Probe directory in biomedusers/.
AudiLab also has a space allocation of 500 GB in probeShare/Biomed/AUDILAB/.

You need your McGill short username to access Probe. You can find out what it is by logging in to Minerva and going to Personal Menu ► Password for McGill Username.

If using wireless or if connecting from outside the department, you must connect to McGill's VPN before connecting to Probe. The following instructions assume that you have already connected to VPN if necessary.

From Linux

To access Probe from a Linux computer (assuming that the package cifs-utils is installed), in the Nautilus file-system browser do File ▶ Connect to Server. In the dialogue box select Windows share as the Service type and fill in the fields as follows:
Folder biomedusers or probeshare
User Name your McGill DAS (Short) username
Domain Name campus

The following alternative procedure for accessing Probe from Linux requires an Administrator account and uses sudo.

You can download, a Perl script that issues the appropriate smbmount commands to connect to Probe. Save the script somewhere and make it executable. For example, save it in ~/bin/ and then in a terminal window do

cd ~/bin/ chmod +x

Thereafter, each time you login you can give the command ~/bin/ to establish the connections to Probe. You will be asked for your sudo password and then twice for your Mcgill password. The contents of the biomedusers and probeShare directories will now appear in probe and probeShare, respectively, in your home directory.

The first time you use the script, you will be asked for your McGill short username.

From Mac OSX

Right-click on Finder and select Connect to server. Specify smb:// as the server. Login with your McGill short username and your McGill password. Select either biomedusers or probeshare.

From MS Windows

For most computers permanently connected to a network jack, the Q: and S: drives should automatically be connected to \\\biomedusers\mcgillShortUsername and \\\probeshare, respectively.

For other computers, in File Explorer right-click on This PC in the Navigation pane on the left and select Map network drive…. As Drive select S: and as Folder specify \\\probeshare; make sure the box Connect using different credentials is checked. Click on Finish and you should be prompted for your McGill login credentials. Similarly, connect Q: to \\\biomedusers.


M$ Windows

See departmental instructions.


See instructions for setting up access to McGill's uPrint service. Their instructions say they apply to Ubuntu 12.10 and up; they apply to Debian 8 (‘jessie’, now testing, expected to become stable early in 2015).

Make sure CUPS is installed. (Under Debian GNU/Linux, use aptitude or some other method to install cups and its required packages.) In order to use the Print to file feature within applications, you also need the cups-pdf package.

The command lpstat -p can be used to see what printers are available. To look at the job queues, etc., in a Web browser go to http://localhost:631/.

If problems arise when printing Unix-style plain-text files because the carriage returns are missing, they can be added using unix2dos.

Printing from the command line

I haven't figured out how to print from within applications because of the need to specify a username for uPrint. Instead, I produce PDF files and print them from the command line.

lp -U username -d printername -o sides=two-sided-long-edge -n 3 -o number-up=2 -P pagelist filename

username is your McGill short username, or the short username associated with a McGill uPrint card.
printername should be mcgill_mono or (only if necessary) mcgill_color.
filename is the name of the file to be printed (usually a PDF file).
In the example there are several optional specifiers:

I have a script lp.tcl which prompts for various options and submits the appropriate lp command.

Organization of AudiLab software

The source files for a library are generally in the same directory as the object-library file, and are listed in a .nam file. The .nam file may include pointers to other directories for some of the modules.

For libraries developed here, there are two naming conventions: a source file contains either

Most of my software is written in Fortran 77/90 with some C. For Fortran code, the subprogrammes are usually subroutines rather than functions. For C, of course, there are only functions.

AudiLab home page
R. Funnell
Last modified: 2022-08-05 19:53:08