TUFLOW on Linux: Difference between revisions

Content deleted Content added
 
(4 intermediate revisions by the same user not shown)
Line 10:
 
It is recommended that admins use <code>dnf</code> or <code>apt</code> respectively, to ensure that dependencies are automatically downloaded and installed as needed.
 
For detailed installation, licensing, version management and WSL instructions, see [[Installing TUFLOW on Linux]].
 
= How to use =
Line 17 ⟶ 19:
 
= Use across both Microsoft Windows and Linux =
Some of the quirky differences between Windows and Linux will affect users that want to use TUFLOW across both systems.
 
Some of the quirky differences between Windows and Linux will affect users thatwho want to use TUFLOW across both systems.
By no means a complete overview, but these are some aspects to consider:
<ol>
*'''Slashes and backslashes'''<br/>Windows uses backslashes in file and directory paths like <code>D:\Project\results\</code>. Linux uses forward slashes instead like <code>~/Project/results</code> and will often interpret characters following backslashes as special characters. TUFLOW will usually deal with either format on either system in configuration files, but when writing scripts or commands (in powershell, terminal, etc) users should remain aware. Also, logs and outputs referring to files will use the format appropriate to the system it is running on.
*'''Drive letters'''<br/>Drive letters like <code>D:</code> are specific to Windows. Configuration files that need to be usable across both systems should avoid their use and instead use relative paths like <code>../Model/Materials_001.csv</code> or absolute paths that assume the file is on the current drive like <code>/Project/model/Materials_001.csv</code>.
*'''Character case in names'''<br/>Windows is case-insensitive, which means that files called <code>Hello.TXT</code> and <code>hello.txt</code> are considered to have the same name, and cannot exist in the same location. Linux is case-sensitive and considers uppercase characters and lowercase characters to be different, and so those two files can exist side by side. This is very relevant if TUFLOW users use one spelling in one place, and the other in another - whereas Windows might interpret both references to point to the same file, on Linux they would result in two separate files. Similarly, if a file's name is spelled with different case from its actual name, a Windows application would find it, and a Linux application might not. (see below)
*'''Encoding and special characters'''<br/>On older versions of Windows in English-speaking countries, text files (including TUFLOW configuration files) would use the 1252-Windows encoding. In modern versions of Windows, UTF-8 with BOM is the standard. On Linux UTF-8 without BOM is the standard. TUFLOW accepts any of these encodings and will typically write files in UTF-8 without BOM. On Windows, line endings in such text files are encoded as two characters, a carriage return and a line feed (CR/LF), while Linux uses only a single LF. TUFLOW accepts both forms and writes what is appropriate to the system it is running on.
</ol>
 
ByThis nois meansnot a complete overview, but these are some aspects to consider include:
To ensure maximum compatibility of models across systems, TUFLOW will do its best to match names in the model files in the same way between Windows and Linux. <!-- This may surprise some new users on Linux and can be disabled with a command-line flag if undesirable, in future releases.-->
 
* '''Slashes and backslashes'''<br/>Windows uses backslashes in file and directory paths, likesuch as <code>D:\Project\results\</code>. Linux uses forward slashes, insteadsuch likeas <code>~/Project/results</code>, and will often interpret characters following backslashes as special characters. TUFLOW will usually deal withhandle either format in configuration files on either system. in configuration filesHowever, but when writing scripts or commands (in powershellPowerShell, a terminal, etc)or similar tools, users should remain aware. Also,of logsthe differences. Logs and outputs referringthat refer to files will use the format appropriate to the operating system iton which TUFLOW is running on.
As a general principle, TUFLOW will default to trying to run a model with as little change as possible required across both platforms, writing results in a form that is appropriate to the platform it runs on. <!-- Future releases may provide users with more control over this behaviour, if needed.-->
 
* '''Drive letters'''<br/>Drive letters likesuch as <code>D:</code> are specific to Windows. Configuration files that need to be usableused across both systems should avoid theirdrive useletters and instead use relative paths, likesuch as <code>../Model/Materials_001.csv</code>, or absolute paths that assume the file is on the current drive, such likeas <code>/Project/model/Materials_001.csv</code>.
 
* '''Character case in names'''<br/>Windows is generally case-insensitive, which means thatmeaning files callednamed <code>Hello.TXT</code> and <code>hello.txt</code> are consideredtreated toas havehaving the same name, and cannot exist in the same location. Linux is case-sensitive and considerstreats uppercase characters and lowercase characters to beas different, andallowing so those twoboth files canto exist side by side. This is veryimportant relevantwhere ifdifferent TUFLOWcapitalisation usersis use one spellingused in oneseparate place, and the other in another - whereasreferences. Windows mightmay interpret both references toas pointpointing to the same file, onwhile Linux theymay wouldtreat resultthem inas two separatedifferent files. Similarly, ifWindows may locate a file's nameeven iswhen spelledthe withcapitalisation differentdoes casenot frommatch its actual nameexactly, a Windows application would find it, and awhile Linux application mightmay not. (see below)
 
* '''Encoding and special characters'''<br/>On older versions of Windows in English-speaking countries, text files, (including TUFLOW configuration files), wouldcommonly use theused Windows-1252-Windows encoding. InOn modern versionsWindows of Windowssystems, UTF-8 with BOM is thecommonly standard.used, Onwhile Linux typically uses UTF-8 without BOM is the standard. TUFLOW accepts any of these encodings and will typicallygenerally write files inusing UTF-8 without BOM. On Windows, linetext endingsfiles incommonly suchuse textcarriage filesreturn areand encodedline as twofeed characters, afor carriageline returnendings, andknown a line feedas (CR/LF), while Linux uses only a single LF character. TUFLOW accepts both formsformats and writes whatthe isformat appropriate to the system on which it is running on.
 
To ensure maximum model compatibility of models across systems, TUFLOW will do its best to match names in the model files in the same wayconsistently between Windows and Linux. <!-- This may surprise some new users on Linux and can be disabled with a command-line flag if undesirable, in future releases.-->
 
As a general principle, TUFLOW will default to tryingtry to run a model across both platforms with as littlefew changechanges as possible, required across both platforms,while writing results in athe form that isformat appropriate to the platform on which it runsis onrunning. <!-- Future releases may provide users with more control over this behaviour, if needed.-->
 
= Common Questions Answered (FAQ)=
== Why use TUFLOW on Linux at all? ==
 
TUFLOW on Linux is not just for users thatwho use Linux as their primary work environment, although those users certainly exist. Other reasons to consider areit include:
<ol>
 
* '''Performance'''<br/> Servers or workstations that are dedicated for theto running of models can be configured to run TUFLOW and the necessary supporting software, (e.g.such as CodeMeter, and NVIDIA GPU drivers, etc.) andwith very little else, using Linuxinstalled. There may also be small performance differences in general between an executableexecutables built and optimised for Windows orand Linux.
*'''Infrastructure cost'''<br/> Especially relevant when running virtual machines dedicated to running TUFLOW, or many of those in the cloud, most distributions of Linux do not require a licence whereas Windows does. This can substantially reduce the cost of infrastructure.
 
*'''HPC tooling'''<br/> Automation of running TUFLOW models across many computers or in the cloud can be greatly simplified with tooling designed for that purpose. Many such tools are available "off the shelf", but mostly on Linux (e.g. SLURM, PBS/Torque, etc.). Similarly, containerisation (e.g. Docker, Podman, LXC) typically requires running on Linux as well.
* '''Infrastructure cost'''<br/>This is Especiallyespecially relevant when running virtual machines dedicated to running TUFLOW, or many ofvirtual thosemachines in the cloud,. mostMost Linux distributions of Linux do not require a licence, whereas Windows does., Thiswhich can substantially reduce theinfrastructure cost of infrastructurecosts.
: ''Note:'' HPC tooling refers to job scheduling and automation software for managing large numbers of model runs. Containerisation packages applications and their dependencies into portable and reproducible runtime environments.
 
</ol>
* '''HPC tooling'''<br/>Automating TUFLOW model runs across many computers or in the cloud can be simplified using tools designed for this purpose. Many of these tools are available off the shelf, primarily for Linux, such as SLURM and PBS/Torque. Containerisation tools, such as Docker, Podman and LXC, also typically run on Linux. <br>''Note:'' HPC tooling refers to job scheduling and automation software used to manage large numbers of model runs. Containerisation packages applications and their dependencies into portable and reproducible runtime environments.
 
== Must TUFLOW users on Linux use the command line interface? ==
Line 46 ⟶ 52:
Like Windows, Linux offers a variety of scripting options that can help minimise the direct use of the command line by users, if that is desirable. Bash shell scripts are as easy to write and run as batch files are on Windows. Running Python or even PowerShell on Linux is easy to set up as well.
 
However, givendue to the nature of the applicationLinux and Linux as an operating systemTUFLOW, TUFLOW users on Linux would doare wellencouraged to try and understand some of the basics of usingrunning TUFLOW from the command line. and theThe TUFLOW Support team can assist with thatthis.