Linux Installation¶
This guide describes the distribution material and how to install, license and verify SHIPFLOW — the flow solver, the SHIPFLOW GUI and the post-processor — on workstations and computers running Linux. For Windows, see Windows Installation.
Distribution material¶
SHIPFLOW for Linux is delivered as one compressed archive that contains the complete installation directory: the GUI, the mesh generators, the solvers, the examples and the documentation, including the Release Notes for all versions.
Download from the FLOWTECH Support page¶
Download the installation archive from the FLOWTECH Support page at flowtech.se. To get a user id and a password for the Support page, contact [email protected]. The Support page explains how to download the software. Then continue with Install SHIPFLOW.
Distribution on CD-ROM¶
The installation archive can also be supplied on a CD-ROM.
Documentation¶
The documentation is installed as PDF files in the doc directory. The User's
Manual, the Examples Manual and the instructions for remote computations are also available on this
site, see User Manuals and
Examples Manual.
Installation directory¶
The archive unpacks into one SHIPFLOW root directory that contains both the flow solver and the
post-processor. In SHIPFLOW 8.0.37, for example, the root directory shipflow8.0.37-linux-x86_64
contains these main directories:
shipflow8.0.37-linux-x86_64/
bin/
data/
Framework/
Framework5/
paraview/
paraview-osmesa/
doc/
examples/
examples_motions/
examples_waps/
tutorials/
lib/
missing/
lic/
mpi/
In this guide, shipflow/ stands for the SHIPFLOW root directory. In commands, it is written as
<full_path>/shipflow<version>: replace this with the full path of your root directory, for example
/opt/shipflow8.0.37-linux-x86_64.
bin directory¶
| File | Description |
|---|---|
shipflow |
Script that starts SHIPFLOW. It also sets OpenMP defaults for the solvers when you have not set them yourself: OMP_PROC_BIND=spread, OMP_PLACES=cores, and on EPYC and Xeon processors OMP_WAIT_POLICY=passive with KMP_BLOCKTIME=0 (OMP_WAIT_POLICY=active on other processors). Your own values of these variables are kept. |
shipflow_motions.env |
Environment overrides that apply only to the MOTIONS solver process, one NAME=VALUE entry per line; NAME= unsets a variable. As delivered it sets OMP_WAIT_POLICY=active and unsets KMP_BLOCKTIME. Leave the file empty to run MOTIONS with the unchanged SHIPFLOW environment. |
shipflow_gui |
Script that starts the graphical user interface in the Framework directory. |
shipflow_gui5 |
Script that starts the graphical user interface in the Framework5 directory. |
pvpost |
Script that runs ParaView for the automatic reporting, see ParaView. |
rshipflow.sh |
Script for remote computations. |
Release |
Release information. |
The directory also contains the executables of the SHIPFLOW modules.
data directory¶
| File | Description |
|---|---|
non_bf_vg.fmt |
Data for the vortex generator object. |
plots.tmpl |
Template file for the report generation. |
propellers/ |
Propeller geometry files. SHIPFLOW looks here for a GEOFILE that is not in your working directory. |
python_post_scripts/ |
Python scripts for the customisable automatic post-processing: scriptable plots with Python and ParaView. |
Framework directory¶
This directory contains the user interface for SHIPFLOW with the Design/GUI add-ons. Start it with
the shipflow_gui script in shipflow/bin.
Framework5 directory¶
This directory contains a second version of the user interface. Start it with the shipflow_gui5
script in shipflow/bin.
ParaView directories¶
The directories paraview and paraview-osmesa contain ParaView, which is used for some of the
post-processing. See ParaView.
doc directory¶
This directory contains the documentation for SHIPFLOW as PDF files.
| File | Description |
|---|---|
BendingMoments with Shipflow.pdf |
Describes the Python script that extracts the vertical and horizontal bending moments, the shear forces and the torsional moment. |
ExamplesManual.pdf |
SHIPFLOW Examples Manual, also on this site as the Examples Manual. |
InstallationNotesLinux.pdf |
SHIPFLOW Installation Notes for Linux — the PDF version of this guide. |
InstallationNotesWindows.pdf |
SHIPFLOW Installation Notes for Windows, also on this site as Windows Installation. |
ReleaseNotes.pdf |
SHIPFLOW Release Notes. |
RemoteComputation.pdf |
Instructions for remote computations, also on this site as Remote computations. |
UsersManual.pdf |
SHIPFLOW User's Manual, also on this site as the User Manual — Basic & RANS. |
UsersManualMotions.pdf |
MOTIONS User's Manual. |
XchapTheoreticalManual.pdf |
XCHAP Theoretical Manual. |
examples directory¶
This directory contains all the input files, and some of the output files, for XPAN, XBOUND and XCHAP for the examples in the SHIPFLOW Examples Manual. It also contains the test examples used to verify the installation.
examples_motions directory¶
This directory contains all the input files for MOTIONS.
examples_waps directory¶
This directory contains demonstration examples for ships equipped with wind-assisted propulsion
systems (WAPS), including manoeuvring simulations. The README.txt file in an example folder lists
the steps to run it.
tutorials directory¶
This directory contains the SHIPFLOW tutorials as PDF files. The tutorials are also available on this site, starting with Basic Tutorial 1 and Advanced Tutorial 1.
lib directory¶
This directory contains dynamically linked libraries.
The subdirectory lib/missing may contain additional dynamic libraries that SHIPFLOW needs to start
and that are missing on some Linux installations. If a library is missing on your system, move it
from shipflow/lib/missing to shipflow/lib.
lic directory¶
This directory contains the licensing tools, packed in shipflow_lic.tgz. For node-locked licenses,
we recommend that you unpack shipflow_lic.tgz in /usr/local for semi-automatic handling of the
licensing, see Node-locked license.
mpi directory¶
This directory contains OpenMPI with thread support, which XCHAP uses. For most Linux versions it is
hard to find a pre-compiled OpenMPI with thread support, so it is included with SHIPFLOW. Install it
under /opt/local as described in OpenMPI; it then ends up in /opt/local/shipflow7.
The file README.txt in this directory contains the same installation instructions.
Install SHIPFLOW¶
- Download the installation archive from the FLOWTECH Support page at
flowtech.se. Contact [email protected] for a user id and a password
for the Support page. The archive has the generic name
shipflow<version>-<platform>.tgz. - Move the archive to the directory that should contain the SHIPFLOW installation, for example
/opt. The archive unpacks into a new SHIPFLOW root directory in the current directory. -
Change to that directory and unpack the archive:
This creates the SHIPFLOW root directory, for example
shipflow8.0.37-linux-x86_64. -
Install OpenMPI for XCHAP, see OpenMPI.
- Set up your license, see Licensing.
- Add
shipflow/binto yourPATH, see PATH. - Verify the installation.
OpenMPI¶
XCHAP uses OpenMPI with thread support. Thread support is in general not included in OpenMPI
packages, so SHIPFLOW includes a package with thread support in shipflow/mpi. SHIPFLOW requires
this package in /opt/local/shipflow7. You need root permissions to install in /opt.
-
As root, change to
/opt/local: -
Unpack the OpenMPI package from your SHIPFLOW installation:
This creates
/opt/local/shipflow7.
This OpenMPI version will probably not work on all Linux distributions. If you run into a problem, contact [email protected].
Licensing¶
The licensing system described here has been used since SHIPFLOW 6.4. The licensing tools are
delivered in shipflow/lic/shipflow_lic.tgz, which unpacks into a folder shipflow_lic. Follow the
instructions for your license type:
| License type | What you set up |
|---|---|
| Node-locked | Registration and activation on the computer that runs SHIPFLOW, see Node-locked license. |
| Network | A license server, and on each client computer the SG_LICENSE_FILE variable and a license file network.lic. |
| Floating | A license server, and on each client computer the SG_LICENSE_FILE variable. |
If you are not sure which type of license you have, contact [email protected]. The license manager programs are described in Appendix A: License manager applications.
Node-locked license¶
First installation on a computer¶
-
Copy the license tools to
/usr/localand unpack them there:cp <full_path>/shipflow<version>/lic/shipflow_lic.tgz /usr/local cd /usr/local tar xzf shipflow_lic.tgzThis creates the folder
/usr/local/shipflow_lic.Note
You can unpack the license tools in a different location, but SHIPFLOW then cannot activate licenses over the internet or start and restart the license server automatically when necessary.
-
Register the computer by running the
licensescript:When you register, make sure that you enter the correct email address: this is how we contact you when your license is ready for activation.
-
Wait until you receive our email. If the license tools are in
/usr/local/shipflow_lic, you are done: continue with Verify the installation. - If the license tools are in a different location, activate your license by running
./licenseagain.
Reinstalling or upgrading SHIPFLOW¶
If SHIPFLOW has been installed on the computer before:
- If you have internet access and the license tools are in
/usr/local/shipflow_lic, activation is automatic. Continue with Verify the installation. - If the computer has no internet connection and you need a new license file, send an email to [email protected].
- If the license tools are not in
/usr/local/shipflow_licand you need a new license file, run the script./license.
Manual commands¶
Run these scripts in the shipflow_lic folder. You will normally not need them if the licensing tools
are in /usr/local/shipflow_lic.
| To | Run |
|---|---|
| Activate a new license over the internet (this also starts or restarts the license server) | ./license |
| Start the license server, for example after the computer has been rebooted | ./start_server |
| Restart the license server, for example after you have received a new license file by email | ./restart_server |
Network and floating licenses¶
Network and floating licenses both use a license server. In addition, a network license needs a license file on each client computer.
Floating and classroom licenses that were locked to a range of IP addresses in earlier versions are now called network licenses.
License server¶
Do the following on the computer that runs the license server for a network or floating license.
Note
The license server does not run on a virtual machine.
Install the licensing tools¶
Take the file shipflow/lic/shipflow_lic.tgz from a complete SHIPFLOW installation and unpack it in
the location you prefer:
This creates the folder shipflow_lic.
Activate the license¶
By default, the license server uses port 29750. If you want it to use a different port, tell us by email to [email protected].
On a computer with internet access
- In a terminal, change to the
shipflow_licfolder and run./license. We receive a notification that you have registered, and we get back to you once we have confirmed that you should have a license. - When you have received our email that your SHIPFLOW license is activated on that computer, run
./licenseagain. This downloads your license to the fileshipflow.licand starts the license server.
On a computer without internet access (or if our product activation server cannot be reached)
- In a terminal, change to the
shipflow_licfolder and run./license. This creates the fileshipflow_lic.log. - Send
shipflow_lic.logto [email protected]. We reply with the license file. - Save the license file as
shipflow.licin theshipflow_licfolder and run./start_server.
Start the license server again¶
If you reboot the computer, or if the license server is stopped for some other reason, start it
again with ./start_server in the shipflow_lic folder.
Obtain a new license file¶
You need a new license file when your license file expires or when you upgrade to a newer SHIPFLOW version.
- With internet access: run
./license. This downloads your license to the fileshipflow.licand starts or restarts the license server. - Without internet access (or if our product activation server cannot be reached):
- Request the license file from [email protected].
- Save it as
shipflow.licin theshipflow_licfolder. - If the license server is already running, run
./restart_server. If it is not running, run./start_server.
Client computers¶
Do the following on each computer that will run SHIPFLOW with a network or floating license.
- Set the environment variable
SG_LICENSE_FILEto<port>@<host>, where<host>is the address of the computer that runs the license server and<port>is the port number that the license server uses (29750 by default). - Network license only:
- Send the range of IP addresses of the client computers to [email protected]. Use one or
two wildcards, for example
192.168.1.*or194.185.*.*. We reply with the license file. - Save the license file as
network.licin/usr/local/shipflow_lic/. To keepnetwork.licin a different folder, set the environment variableSG_LICENSE_FILE_PATHto that folder, for example/home/<user>/lic/.
- Send the range of IP addresses of the client computers to [email protected]. Use one or
two wildcards, for example
Environment variables¶
All required environment variables are set automatically when you start SHIPFLOW with the
shipflow script. The variables below are the ones you might want to change for a particular
installation.
PATH¶
To run SHIPFLOW, add the shipflow<version>/bin directory to the PATH environment variable. The
command depends on your shell.
For the C shell:
Here <full_path> is the directory path from the root to shipflow<version>. For example, if
SHIPFLOW 8.0.37 is installed under /opt, <full_path>/shipflow<version>/bin is
/opt/shipflow8.0.37-linux-x86_64/bin. We recommend that you put this command in the .cshrc file of
every user who will use SHIPFLOW.
For the Bourne shell (including bash) or the Korn shell, add this line to the user's .profile
file:
SHIPFLOWMEM¶
SHIPFLOW uses dynamic memory allocation: storage for all vectors and arrays is allocated during
execution in one global storage vector. SHIPFLOWMEM sets the size of this vector as a number of
4-byte words; for example, 64,000,000 corresponds to 256 MB of memory. If SHIPFLOWMEM is not set,
the shipflow script sets it to 950000000.
To change the value in the C shell:
In the Bourne or Korn shell:
We recommend that you specify SHIPFLOWMEM in .cshrc (C shell) or .profile (Bourne or Korn
shell). You can also define it directly in the shipflow script in shipflow/bin.
If SHIPFLOWMEM is too small, SHIPFLOW stops and prints the required value in the id_OUTPUT file.
Increase SHIPFLOWMEM to at least that value. See
Memory errors for the upper limit and for what to
check before you increase the value.
SG_LICENSE_FILE¶
Needed when the license server does not run on the same computer as SHIPFLOW. Set it to
<port>@<host> of the license server, see Client computers.
In the C shell:
In the Bourne or Korn shell:
SG_LICENSE_FILE_PATH¶
Optional, for network licenses: the folder that contains network.lic, if you keep it somewhere
other than /usr/local/shipflow_lic/. See Client computers.
ParaView¶
ParaView is included with SHIPFLOW and is used to produce some of the plots in the automatic reporting. ParaView needs a graphical environment on the computer where SHIPFLOW runs:
- If you run SHIPFLOW locally on your workstation, this is always available.
- If you log in to a different computer, log in with the
-Xoption. - If neither is possible (for instance on a cluster with a queueing system), the following is
required:
- Graphics hardware.
- XDM must be installed and running. Ask your system administrators for help with this.
- All security on the X server must be disabled, so that any process can open a window on the X
server without logging in. Again, ask your system administrators for help. On some systems,
the command
xhost +does this. - Each
pvbatchprocess must connect to the displaylocalhost:0(or just:0). Set this with the-displayflag forpvbatchin the scriptshipflow/bin/pvpost.
In shipflow/bin/pvpost you can also add your own ParaView Python scripts to be used in the
automatic reporting.
Verify the installation¶
- Check that the
shipflowandshipflow_guiscripts inshipflow/binare found from a command prompt, for example withwhich shipflow shipflow_gui. If they are not found, check the PATH environment variable. -
Create a test directory and change to it:
-
Copy the test examples from the
examplesdirectory. The test command files read the offset filegeometry/off_test, so copy that file into ageometrysubdirectory: -
Run the first test example, which tests the modules XMESH and XPAN:
SHIPFLOW writes the files
test1.cgnsandtest1_OUTPUT. If output for Tecplot is requested, it also writes files ending with.pltfor post-processing with Tecplot. -
Look through
test1_OUTPUTfor warnings or error messages. If yourexamplesdirectory contains atest1_OUTPUTfile, compare your output with it. -
Run the second test example, which also runs the modules XBOUND, XGRID and XCHAP:
Compare
test2_OUTPUTin the same way. The computing time and memory requirements oftest1andtest2are moderate; each should complete within a few minutes.
The examples directory also contains a third test example, test3, a self-propulsion computation.
Copy and run it in the same way if you want to test it too.
If a test does not run, check the following:
| Problem | What to do |
|---|---|
| No valid SHIPFLOW license can be checked out | Check your license set-up, see Licensing. |
| Not enough memory | Increase SHIPFLOWMEM to at least the value printed in the output file test1_OUTPUT, see SHIPFLOWMEM. |
More problems and solutions are collected in Troubleshooting.
Appendix A: License manager applications¶
Applications¶
sglmserver— the actual license server. The client software communicates with it over the TCP/IP network protocol, whether the client runs on the same computer, on a local area network (LAN) or over the internet. The license server keeps track of the total number of licenses and how many remain for each licensed component. It uses a license file to control which components are valid, for how long, and how many licenses there are for each component.sglmd— the license daemon. The license server can run on its own, but if the license daemon runs it, the daemon detects if anything happens to the license server and tries to restart it. This minimises the impact of an uncontrolled termination of the license server.sglmutil— the license manager utility. It can shut down the license server and show which licenses the server has available.
These applications are in the shipflow_lic folder, together with the license, start_server and
restart_server scripts.
Running the license server¶
The license server can be run in a terminal window, for testing or on a regular basis. With the
optional -b flag it runs in the background. Because it can be useful to track the activity of the
license server, you can specify a log file for all output from the server; this can also be
/dev/null if you do not want any output.
The start_server script starts the license server in the background with sglmd, using the
license file shipflow.lic and the log file debug.log. The restart_server script restarts it
with sglmutil.
Limits¶
The license server supports a maximum of 64 components, 64 checked-out components per user, and 256 concurrent users, unless these limits are overridden at startup.
Command reference¶
sglmutil
sglmutil -c shutdown -f <license_file>
sglmutil -c restart -f <license_file>
sglmutil -c show -f <license_file>
| Command | Description |
|---|---|
shutdown |
Shuts down the license server that runs the specified license file. |
restart |
Restarts the license server that runs the specified license file. |
show |
Shows which licenses are served by the license server of the specified file. |
sglmd
sglmd {-b} -v <license_server> -f <license_file> {-d <debug_log_file>} {-m <max_connections>} {-x <csv_log_file>}
Uses the license daemon to start the license server with the licenses in the license file, and optionally writes the output to a log file.
-m <max_connections>overrides the default of 256 separate client applications that can connect to the license server. Each connection is a thread, so the practical maximum depends on your system configuration.-brunssglmdandsglmserverin the background.-x <csv_log_file>writes a CSV log file that you can use to graph license usage over time — by user, component, version or any other criterion — with any graphing tool, for example Google Sheets.
sglmserver
Starts the license server on its own, without automatic restart. Always use sglmd to control and
start sglmserver, because sglmd makes sure that the server keeps running.
- To specify
max_connectionswithout a debug log file, pass the stringnullas the second argument. - To specify
csv_log_filewithoutmax_connections, pass the stringnullas the third argument.
The server license file¶
The license file contains a SERVER line with the computer name, the id that the license server is
locked to, and the TCP/IP port number that client applications use to communicate with the server.
It also contains a license count for each component. Example of a server license file:
SERVER=localhost ID=001f5bf5b08f IDTYPE=ethernet PORT=29750
NAME=tree VERS=4.0 ID=001f5bf5b08f IDTYPE=ethernet COUNT=12 EXPIRES=never CERT=e7fdb38c0e90c925c28368decf979e19
NAME=monkey VERS=4.0 ID=001f5bf5b08f IDTYPE=ethernet COUNT=12 EXPIRES=never CERT=e6fcad8c0e95a357d5f57accc1ee9c11
NAME=banana VERS=4.0 ID=001f5bf5b08f IDTYPE=ethernet COUNT=12 EXPIRES=never CERT=a287a6e27791de5cb88077a9d4eb87
This file locks the entire license file to the computer with this ethernet address. It serves three
components, tree, banana and monkey, with twelve licenses each that can be checked out at the
same time; a thirteenth checkout fails.
Once the license file has been generated for the computer, start the license manager with that file. Example:
$ sglmd -v sglmserver -f float.lic
2016/01/07 07:35:57 Server starting on localhost, port 29750, max components 64, max connections 256
Action Component Version Count Expires
Enabling tree 4.0 10 never
Enabling monkey 4.0 10 never
Enabling banana 4.0 10 never
Ready...
Serving several versions of a component¶
One license server can serve different versions of the same component. List the lines for the same
component in numerical order of version, from lowest to highest. A version 4.0 application then
checks out the VERS=4.0 licenses first, before it spills over to the 5.0 licenses; in reverse order,
a version 4.0 application would check out the VERS=5.0 licenses first. When version 5.0 of the
software requests a 5.0 license, only 5.0 licenses are used. Example of a license file with the same
component in two versions:
SERVER=localhost ID=001f5bf5b09f IDTYPE=ethernet PORT=29750
NAME=monkey VERS=4.0 ID=001f5bf5b09f IDTYPE=ethernet COUNT=12 EXPIRES=never CERT=c6bf634c55dff68e3417eeaa6abd36dfcb
NAME=monkey VERS=5.0 ID=001f5bf5b09f IDTYPE=ethernet COUNT=12 EXPIRES=never CERT=c0d918435bbfee94227888c772c948d8d3
Expired licenses¶
If a license expires while the license manager is running, that license is disabled. The license
server checks for expired licenses once every hour, counted from the minute it was started. For
each expired license, the server logs a DISABLING message; if a license was disabled for another
reason, the message gives that reason.