<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://oldwiki.scinet.utoronto.ca/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fertinaz</id>
	<title>oldwiki.scinet.utoronto.ca - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://oldwiki.scinet.utoronto.ca/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fertinaz"/>
	<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php/Special:Contributions/Fertinaz"/>
	<updated>2026-04-12T22:23:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.12</generator>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9342</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9342"/>
		<updated>2018-05-14T20:09:12Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: /* Wind Flow Around Building */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing &amp;quot;module avail&amp;quot; on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installations can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar or reconstructParMesh, please use FEN/OpenFOAM/* modules. Do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and run out of memory therefore make it unavailable for everyone.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script by typing the modules you want load inside the batch script. This is the only way of using compute nodes on BGQ. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations - Solves hanging problems&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm. - Solves termination with signal 36 issue&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical OpenFOAM Applications on BG/Q ==&lt;br /&gt;
A list of examples will be shared here. These sample cases are derived from applications that are run on BG/Q but changed for confidentiality reasons. It can guide new users for their specific use cases. Most of the information here is OpenFOAM specific, not BG/Q specific.&lt;br /&gt;
&lt;br /&gt;
=== Wind Flow Around Buildings ===&lt;br /&gt;
This is a tutorial case that can be found in $FOAM_TUTORIALS/incompressible/simpleFoam/windAroundBuildings&lt;br /&gt;
&lt;br /&gt;
=== Rotational Flows in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== LES Models in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== Multiphase Flows in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can convert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells which allows users to fully utilize all 16 compute cores on a node.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9315</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9315"/>
		<updated>2018-05-04T20:20:24Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing &amp;quot;module avail&amp;quot; on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installations can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar or reconstructParMesh, please use FEN/OpenFOAM/* modules. Do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and run out of memory therefore make it unavailable for everyone.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script by typing the modules you want load inside the batch script. This is the only way of using compute nodes on BGQ. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations - Solves hanging problems&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm. - Solves termination with signal 36 issue&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical OpenFOAM Applications on BG/Q ==&lt;br /&gt;
A list of examples will be shared here. These sample cases are derived from applications that are run on BG/Q but changed for confidentiality reasons. It can guide new users for their specific use cases. Most of the information here is OpenFOAM specific, not BG/Q specific.&lt;br /&gt;
&lt;br /&gt;
=== Wind Flow Around Building ===&lt;br /&gt;
This is a tutorial case that can be found in $FOAM_TUTORIALS/incompressible/simpleFoam/windAroundBuildings&lt;br /&gt;
&lt;br /&gt;
=== Rotational Flows in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== LES Models in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== Multiphase Flows in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can convert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells which allows users to fully utilize all 16 compute cores on a node.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9251</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9251"/>
		<updated>2018-05-03T02:48:38Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: /* Typical OpenFOAM Application on BG/Q */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing &amp;quot;module avail&amp;quot; on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installations can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar or reconstructParMesh, please use FEN/OpenFOAM/* modules. Do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and run out of memory therefore make it unavailable for everyone.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script by typing the modules you want load inside the batch script. This is the only way of using compute nodes on BGQ. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations - Solves hanging problems&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm. - Solves termination with signal 36 issue&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical OpenFOAM Applications on BG/Q ==&lt;br /&gt;
A list of examples will be shared here. These sample cases are derived from applications that are run on BG/Q but changed for confidentiality reasons. It can guide new users for their specific use cases. Most of the information here is OpenFOAM specific, not BG/Q specific.&lt;br /&gt;
&lt;br /&gt;
=== Wind Flow Around Building ===&lt;br /&gt;
This is a tutorial case that can be found in $FOAM_TUTORIALS/incompressible/simpleFoam/windAroundBuildings&lt;br /&gt;
&lt;br /&gt;
=== MRF Type Solvers in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== LES Models in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== Multiphase Flows in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can convert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells which allows users to fully utilize all 16 compute cores on a node.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9250</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9250"/>
		<updated>2018-05-02T16:22:34Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: /* Using OpenFOAM on BG/Q */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing &amp;quot;module avail&amp;quot; on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installations can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar or reconstructParMesh, please use FEN/OpenFOAM/* modules. Do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and run out of memory therefore make it unavailable for everyone.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script by typing the modules you want load inside the batch script. This is the only way of using compute nodes on BGQ. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations - Solves hanging problems&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm. - Solves termination with signal 36 issue&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical OpenFOAM Application on BG/Q ==&lt;br /&gt;
A list of examples will be shared here. These sample cases are derived from applications that are run on BG/Q but changed for confidentiality reasons. It can guide new users for their specific use cases. Most of the information here is OpenFOAM specific, not BG/Q specific.&lt;br /&gt;
&lt;br /&gt;
=== Flow Around Solid Regions ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== MRF Type Solvers in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== LES Models in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== Multiphase Flows in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can convert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells which allows users to fully utilize all 16 compute cores on a node.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9248</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9248"/>
		<updated>2018-05-01T16:37:06Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing &amp;quot;module avail&amp;quot; on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installations can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar or reconstructParMesh, please use FEN/OpenFOAM/* modules. Do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and run out of memory therefore make it unavailable for everyone.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. This is the only way of using compute nodes on BGQ. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations - Solves hanging problems&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm. - Solves termination with signal 36 issue&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typical OpenFOAM Application on BG/Q ==&lt;br /&gt;
A list of examples will be shared here. These sample cases are derived from applications that are run on BG/Q but changed for confidentiality reasons. It can guide new users for their specific use cases. Most of the information here is OpenFOAM specific, not BG/Q specific.&lt;br /&gt;
&lt;br /&gt;
=== Flow Around Solid Regions ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== MRF Type Solvers in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== LES Models in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
=== Multiphase Flows in OpenFOAM ===&lt;br /&gt;
Information will be added soon!&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can convert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells which allows users to fully utilize all 16 compute cores on a node.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9247</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9247"/>
		<updated>2018-05-01T16:29:38Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: /* Running Parallel Meshing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing &amp;quot;module avail&amp;quot; on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installations can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar or reconstructParMesh, please use FEN/OpenFOAM/* modules. Do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and run out of memory therefore make it unavailable for everyone.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. This is the only way of using compute nodes on BGQ. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations - Solves hanging problems&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm. - Solves termination with signal 36 issue&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can covert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ&amp;diff=9246</id>
		<title>BGQ</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ&amp;diff=9246"/>
		<updated>2018-05-01T16:27:45Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Computer&lt;br /&gt;
|image=[[Image:Blue_Gene_Cabinet.jpeg|center|300px|thumb]]&lt;br /&gt;
|name=Blue Gene/Q (BGQ)&lt;br /&gt;
|installed=Aug 2012, Nov 2014&lt;br /&gt;
|operatingsystem= RH6.3, CNK (Linux) &lt;br /&gt;
|loginnode= bgqdev-fen1&lt;br /&gt;
|nnodes=  4096 nodes (65,536 cores)&lt;br /&gt;
|rampernode=16 GB &lt;br /&gt;
|corespernode=16 (64 threads)&lt;br /&gt;
|interconnect=5D Torus (jobs), QDR Infiniband (I/O) &lt;br /&gt;
|vendorcompilers= bgxlc, bgxlf&lt;br /&gt;
|queuetype=Loadleveler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==System Status==&lt;br /&gt;
&lt;br /&gt;
The current BGQ system status can be found on the wiki's [[Main Page]].&lt;br /&gt;
&lt;br /&gt;
==SOSCIP &amp;amp; LKSAVI==&lt;br /&gt;
&lt;br /&gt;
The BGQ is a Southern Ontario Smart Computing&lt;br /&gt;
Innovation Platform ([http://soscip.org/ SOSCIP]) BlueGene/Q supercomputer located at the&lt;br /&gt;
University of Toronto's SciNet HPC facility. The SOSCIP &lt;br /&gt;
multi-university/industry consortium is funded by the Ontario Government &lt;br /&gt;
and the Federal Economic Development Agency for Southern Ontario [http://www.research.utoronto.ca/about/our-research-partners/soscip/].&lt;br /&gt;
&lt;br /&gt;
A half-rack of BlueGene/Q (8,192 cores) was purchased by the [http://likashingvirology.med.ualberta.ca/ Li Ka Shing Institute of Virology] at the University of Alberta in late fall 2014 and integrated into the existing BGQ system.&lt;br /&gt;
&lt;br /&gt;
The combined 4 rack system is the fastest Canadian supercomputer on the [http://top500.org/ top 500], currently at the 120th place (Nov 2015).&lt;br /&gt;
&lt;br /&gt;
== Support Email ==&lt;br /&gt;
&lt;br /&gt;
Please use [mailto:bgq-support@scinet.utoronto.ca &amp;lt;bgq-support@scinet.utoronto.ca&amp;gt;] for BGQ-specific inquiries.&lt;br /&gt;
&lt;br /&gt;
==Specifications==&lt;br /&gt;
&lt;br /&gt;
BGQ is an extremely dense and energy efficient 3rd generation Blue Gene IBM supercomputer built around a system-on-a-chip compute node that has a 16core 1.6GHz PowerPC based CPU (PowerPC A2) with 16GB of Ram.  The nodes are bundled in groups of 32 into a node board (512 cores), and 16 boards make up a midplane (8192 cores) with 2 midplanes per rack, or 16,348 cores and 16 TB of RAM per rack. The compute nodes run a very lightweight Linux-based operating system called CNK ('''C'''ompute '''N'''ode '''K'''ernel).  The compute nodes are all connected together using a custom 5D torus highspeed interconnect. Each rack has 16 I/O nodes that run a full Redhat Linux OS that manages the compute nodes and mounts the filesystem.  SciNet's BGQ consists of 8 mdiplanes (four-racks) totalling 65,536 cores and 64TB of RAM.&lt;br /&gt;
&lt;br /&gt;
[[Image:BlueGeneQHardware2.png‎ |center]]&lt;br /&gt;
&lt;br /&gt;
=== 5D Torus Network ===&lt;br /&gt;
&lt;br /&gt;
The network topology of BlueGene/Q is a five-dimensional (5D) torus, with direct links between the nearest neighbors in the ±A, ±B, ±C, ±D, and ±E directions.  As such there are only a few optimum block sizes that will use the network efficiently.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
| '''Node Boards '''&lt;br /&gt;
| '''Compute Nodes'''&lt;br /&gt;
| '''Cores'''&lt;br /&gt;
| '''Torus Dimensions'''&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 32&lt;br /&gt;
| 512&lt;br /&gt;
| 2x2x2x2x2&lt;br /&gt;
|-&lt;br /&gt;
| 2 (adjacent pairs)&lt;br /&gt;
| 64&lt;br /&gt;
| 1024&lt;br /&gt;
| 2x2x4x2x2&lt;br /&gt;
|-&lt;br /&gt;
| 4 (quadrants)&lt;br /&gt;
| 128&lt;br /&gt;
| 2048&lt;br /&gt;
| 2x2x4x4x2&lt;br /&gt;
|-&lt;br /&gt;
| 8 (halves)&lt;br /&gt;
| 256&lt;br /&gt;
| 4096&lt;br /&gt;
| 4x2x4x4x2&lt;br /&gt;
|-&lt;br /&gt;
| 16 (midplane)&lt;br /&gt;
| 512&lt;br /&gt;
| 8192&lt;br /&gt;
| 4x4x4x4x2&lt;br /&gt;
|-&lt;br /&gt;
| 32 (1 rack)&lt;br /&gt;
| 1024&lt;br /&gt;
| 16384&lt;br /&gt;
| 4x4x4x8x2 &lt;br /&gt;
|-&lt;br /&gt;
| 64 (2 racks)&lt;br /&gt;
| 2048&lt;br /&gt;
| 32768&lt;br /&gt;
| 4x4x8x8x2&lt;br /&gt;
|-&lt;br /&gt;
| 96 (3 racks)&lt;br /&gt;
| 3072&lt;br /&gt;
| 49152&lt;br /&gt;
| 4x4x12x8x2&lt;br /&gt;
|-&lt;br /&gt;
| 128 (4 racks)&lt;br /&gt;
| 4096&lt;br /&gt;
| 65536&lt;br /&gt;
| 8x4x8x8x2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Login/Devel Node ==&lt;br /&gt;
&lt;br /&gt;
The development node is '''bgqdev-fen1''' which one can login to from the regular '''login.scinet.utoronto.ca''' login nodes or directly from outside using '''bgqdev.scinet.utoronto.ca''', e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh -l USERNAME bgqdev.scinet.utoronto.ca -X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where USERNAME is your username on the BGQ and the &amp;lt;tt&amp;gt;-X&amp;lt;/tt&amp;gt; flag is optional, needed only if you will use X graphics.&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: To learn how to setup ssh keys for logging in please see [[Ssh keys]].&lt;br /&gt;
&lt;br /&gt;
These development node is a Power7 machines running Linux which serve as the compilation and submission host for the BGQ.  Programs are cross-compiled for the BGQ on this node and then submitted to the queue using loadleveler.&lt;br /&gt;
&lt;br /&gt;
===Modules and Environment Variables===&lt;br /&gt;
&lt;br /&gt;
To use most packages on the SciNet machines - including most of the compilers - , you will have to use the `modules' command.  The command &amp;lt;tt&amp;gt;module load some-package&amp;lt;/tt&amp;gt; will set your environment variables (&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;, etc) to include the default version of that package.   &amp;lt;tt&amp;gt;module load some-package/specific-version&amp;lt;/tt&amp;gt; will load a specific version of that package.  This makes it very easy for different users to use different versions of compilers, MPI versions, libraries etc.&lt;br /&gt;
&lt;br /&gt;
A list of the installed software can be seen on the system by typing &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To load a module (for example, the default version of the intel compilers)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module load vacpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To unload a module&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module unload vacpp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To unload all modules&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module purge&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These commands can go in your .bashrc files to make sure you are using the correct packages.&lt;br /&gt;
&lt;br /&gt;
Modules that load libraries, define environment variables pointing to the location of library files and include files for use Makefiles. These environment variables follow the naming convention&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $SCINET_[short-module-name]_BASE&lt;br /&gt;
 $SCINET_[short-module-name]_LIB&lt;br /&gt;
 $SCINET_[short-module-name]_INC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
for the base location of the module's files, the location of the libraries binaries and the header files, respectively.&lt;br /&gt;
&lt;br /&gt;
So to compile and link the library, you will have to add &amp;lt;tt&amp;gt;-I${SCINET_[module-basename]_INC}&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;-L${SCINET_[module-basename]_LIB}&amp;lt;/tt&amp;gt;, respectively, in addition to the usual &amp;lt;tt&amp;gt;-l[libname]&amp;lt;/tt&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
Note that a &amp;lt;tt&amp;gt;module load&amp;lt;/tt&amp;gt; command ''only'' sets the environment variables in your current shell (and any subprocesses that the shell launches).   It does ''not'' effect other shell environments.&lt;br /&gt;
&lt;br /&gt;
If you always require the same modules, it is easiest to load those modules in your &amp;lt;tt&amp;gt;.bashrc&amp;lt;/tt&amp;gt; and then they will always be present in your environment; if you routinely have to flip back and forth between modules, it is easiest to have almost no modules loaded in your &amp;lt;tt&amp;gt;.bashrc&amp;lt;/tt&amp;gt; and simply load them as you need them (and have the required &amp;lt;tt&amp;gt;module load&amp;lt;/tt&amp;gt; commands in your job submission scripts).&lt;br /&gt;
&lt;br /&gt;
=== Compilers ===&lt;br /&gt;
&lt;br /&gt;
The BGQ uses IBM XL compilers to cross-compile code for the BGQ.  Compilers are available for FORTRAN, C, and C++.  They are accessible by default, or by loading the '''xlf''' and '''vacpp''' modules. The compilers by default produce&lt;br /&gt;
static binaries, however with BGQ it is possible to now use dynamic libraries as well.  The compilers follow the XL conventions with the prefix '''bg''',&lt;br /&gt;
so '''bgxlc''' and '''bgxlf90''' are the C and FORTRAN compilers respectively.  &lt;br /&gt;
&lt;br /&gt;
Most users however will use the MPI variants, i.e. '''mpixlf90''' and '''mpixlc''' and  which are available by loading&lt;br /&gt;
the '''mpich2''' module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load mpich2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to use at least the following flags when compiling and linking&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-O3 -qarch=qp -qtune=qp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to build a package for which the configure script tries to run small test jobs, the cross-compiling nature of the bgq can get in the way.  In that case, you should use the interactive [[BGQ#Interactive_Use_.2F_Debugging | &amp;lt;tt&amp;gt;'''debugjob'''&amp;lt;/tt&amp;gt;]] environment as described below.&lt;br /&gt;
&lt;br /&gt;
== ION/Devel Nodes ==&lt;br /&gt;
&lt;br /&gt;
There are also bgq native development nodes named '''bgqdev-ion[01-24]''' which one can login to directly, i.e. ssh, from '''bgqdev-fen1'''.  These nodes are extra I/O nodes that are essentially the same as the BGQ compute nodes with the exception that they run a full RedHat Linux and have an infiniband interface providing direct network access.    Unlike the regular development node, '''bgqdev-fen1''', which is Power7, this node has the same BGQ A2 processor, and thus cross compilations are not required which can make building some software easier.    &lt;br /&gt;
&lt;br /&gt;
'''NOTE''': BGQ MPI jobs can be compiled on these nodes, however can not be run locally as the mpich2 is setup for the BGQ network and thus will fail on these nodes.&lt;br /&gt;
&lt;br /&gt;
== Job Submission ==&lt;br /&gt;
&lt;br /&gt;
As the BlueGene/Q architecture is different from the development nodes, you cannot run applications intended/compiled for the BGQ on the devel nodes. The only way to run (or even test) your program is to submit a job to the BGQ.  Jobs are submitted as scripts through loadleveler. That script must then use '''runjob''' to start the job, which in many ways similar to mpirun or mpiexec.  As shown above in the network topology overview, there are only a few optimum job size configurations which is also further constrained by each block requiring a minimum of one IO node.  In SciNet's configuration (with 8 I/O nodes per midplane) this allows 64 nodes (1024 cores) to be the smallest block size. Normally a block size matches the job size to offer fully dedicated resources to the job.  Smaller jobs can be run within the same block however this results in shared resources (network and IO) and are referred to as sub-block jobs and are described in more detail below.  &lt;br /&gt;
&lt;br /&gt;
=== runjob ===&lt;br /&gt;
&lt;br /&gt;
All BGQ runs are launched using '''runjob''' which for those familiar with MPI is analogous to mpirun/mpiexec.  Jobs run on a block, which is a predefined group of nodes that have already been configured and booted.  There are two ways to get a block. One way is to use a 30-minute 'debugjob' session (more about that below). The other, more common case, is using a job script submitted and are running using loadleveler. Inside the job script, this block is set for you, and you do not have to specify the block name.  For example, if your loadleveler job script requests 64 nodes, each with 16 cores (for a total of 1024 cores), from within that job script, you can run a job with 16 processes per node and 1024 total processes with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --cwd=$PWD : $PWD/code -f file.in&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here, &amp;lt;tt&amp;gt;--np 1024&amp;lt;/tt&amp;gt; sets the total number of mpi tasks, while &amp;lt;tt&amp;gt;--ranks-per-node=16&amp;lt;/tt&amp;gt; specifies that 16 processes should run on each node.&lt;br /&gt;
For pure mpi jobs, it is advisable always to give the number of ranks per node, because the default value of 1 may leave 15 cores on the node idle. The argument to ranks-per-node may be 1, 2, 4, 8, 16, 32, or 64. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- (Note: If this were not a loadleveler job, and the block ID was R00-M0-N03-64, the command would be &amp;quot;&amp;lt;tt&amp;gt;runjob --block R00-M0-N03-64 --np 1024 --ranks-per-node=16 --cwd=$PWD : $PWD/code -f file.in&amp;lt;/tt&amp;gt;&amp;quot;) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
runjob flags are shown with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
runjob -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a particularly useful one is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--verbose #&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where # is from 1-7 which can be helpful in debugging an application.&lt;br /&gt;
&lt;br /&gt;
=== How to set ranks-per-node ===&lt;br /&gt;
&lt;br /&gt;
There are 16 cores per node, but the argument to ranks-per-node may be 1, 2, 4, 8, 16, 32, or 64.  While it may seem natural to set ranks-per-node to 16, this is not generally recommended.  On the BGQ, one can efficiently run more than 1 process per core, because each core has four &amp;quot;hardware threads&amp;quot; (similar to HyperThreading on the GPC and Simultaneous Multi Threading on the TCS and P7), which can keep the different parts of each core busy at the same time. One would therefore ideally use 64 ranks per node.  There are two main reason why one might not set ranks-per-node to 64:&lt;br /&gt;
# The memory requirements do not allow 64 ranks (each rank only has 256MB of memory)&lt;br /&gt;
# The application is more efficient in a hybrid MPI/OpenMP mode (or MPI/pthreads). Using less ranks-per-node, the hardware threads are used as OpenMP threads within each process.&lt;br /&gt;
Because threads can share memory, the memory requirements of the hybrid runs is typically smaller than that of pure MPI runs.&lt;br /&gt;
&lt;br /&gt;
Note that the total number of mpi processes in a runjob (i.e., the --np argument) should be the ranks-per-node times the number of nodes (set by bg_size in the loadleveler script). So for the same number of nodes, if you change ranks-per-node by a factor of two, you should also multiply the total number of mpi processes by two.&lt;br /&gt;
&lt;br /&gt;
=== Queue Limits ===&lt;br /&gt;
&lt;br /&gt;
The maximum wall_clock_limit is 24 hours.  Official SOSCIP project jobs are prioritized over all other jobs using a fairshare algorithm with a 14 day rolling window.&lt;br /&gt;
&lt;br /&gt;
A 64 node block is reserved for development and interactive testing for 16 hours, from 8AM to midnight, everyday including weekends. While you can still reserve an interactive block from midnight to 8AM, the priority is given to batch jobs at that time interval in order to keep the machine usage as high as possible. This block is accessed by using the [[BGQ#Interactive_Use_.2F_Debugging | &amp;lt;tt&amp;gt;'''debugjob'''&amp;lt;/tt&amp;gt;]] command which has a 30 minute maximum wall_clock_limit. The purpose of this reservation is to ensure short testing jobs are run quickly without being held up by longer production type jobs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- We need to recover this functionality again. At the moment it doesn't work&lt;br /&gt;
=== BACKFILL scheduling ===&lt;br /&gt;
To optimize the cluster usage, we encourage users to submit jobs according to the available resources on BGQ. The command &amp;lt;span style=&amp;quot;color: red;font-weight: bold;&amp;quot;&amp;gt;llAvailableResources&amp;lt;/span&amp;gt; gives for example :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
On the Devel system : only a debugjob can start immediately&lt;br /&gt;
&lt;br /&gt;
On the Prod. system : a job will start immediately if you use 512 nodes requesting a walltime T &amp;lt;= 21 hours and 11 min &lt;br /&gt;
On the Prod. system : a job will start immediately if you use 256 nodes requesting a walltime T &amp;lt;= 21 hours and 11 min &lt;br /&gt;
On the Prod. system : a job will start immediately if you use 128 nodes requesting a walltime T &amp;lt;= 24 hours and 0 min &lt;br /&gt;
On the Prod. system : a job will start immediately if you use 64 nodes requesting a walltime T &amp;lt;= 24 hours and 0 min&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Batch Jobs ===&lt;br /&gt;
&lt;br /&gt;
Job submission is done through loadleveler with a few blue gene specific commands.  The command &amp;quot;bg_size&amp;quot; is in number of nodes, not cores, so a bg_size=64 would be 64x16=1024 cores.&lt;br /&gt;
&lt;br /&gt;
The parameter &amp;lt;span style=&amp;quot;font-weight: bold;&amp;quot;&amp;gt;bg_size&amp;lt;/span&amp;gt; can only be equal to 64, 128, 256, 512, 1024 and 2048.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight: bold;&amp;quot;&amp;gt;np&amp;lt;/span&amp;gt; &amp;amp;le; ranks-per-node * bg_size&lt;br /&gt;
&lt;br /&gt;
ranks-per-node &amp;amp;le; np&lt;br /&gt;
&lt;br /&gt;
(ranks-per-node * OMP_NUM_THREADS ) &amp;amp;le; 64 &lt;br /&gt;
&lt;br /&gt;
np : number of MPI processes&lt;br /&gt;
&lt;br /&gt;
ranks-per-node : number of MPI processes per node = 1 , 2 , 4 , 8 , 16 , 32 , 64&lt;br /&gt;
&lt;br /&gt;
OMP_NUM_THREADS : number of OpenMP thread per MPI process (for hybrid codes) = 1 , 2 , 4 , 8 , 16 , 32 , 64&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgsample&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Launch all BGQ jobs using runjob&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --envs OMP_NUM_THREADS=1 --cwd=$SCRATCH/ : $HOME/mycode.exe myflags&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To submit to the queue use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
llsubmit myscript.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Steps ( Job dependency) ===&lt;br /&gt;
LoadLeveler has a lot of advanced features to control job submission and execution. One of these features is called steps. This feature allows a series of jobs to be submitted using one script with dependencies defined between the jobs. What this allows is for a series of jobs to be run sequentially, waiting for the previous job, called a step, to be finished before the next job is started. The following example uses the same LoadLeveler script as previously shown, however the #@ step_name and #@ dependency directives are used to rerun the same case three times in a row, waiting until each job is finished to start the next.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgsample&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ step_name = step1                                                                                                                                                                                                                        &lt;br /&gt;
# @ queue&lt;br /&gt;
# Launch the first step :&lt;br /&gt;
if [ $LOADL_STEP_NAME = &amp;quot;step1&amp;quot; ]; then&lt;br /&gt;
    runjob --np 1024 --ranks-per-node=16 --envs OMP_NUM_THREADS=1 --cwd=$SCRATCH/ : $HOME/mycode.exe myflags&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# @ job_name           = bgsample&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ step_name = step2                                                                                                                                                                                                                        &lt;br /&gt;
# @ dependency = step1 == 0                                                                                                                                                                                                                        &lt;br /&gt;
# @ queue&lt;br /&gt;
# Launch the second step if the first one has returned 0 (done successfully) :&lt;br /&gt;
if [ $LOADL_STEP_NAME = &amp;quot;step2&amp;quot; ]; then&lt;br /&gt;
    runjob --np 1024 --ranks-per-node=16 --envs OMP_NUM_THREADS=1 --cwd=$SCRATCH/ : $HOME/mycode.exe myflags&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# @ job_name           = bgsample&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ step_name = step3                                                                                                                                                                                                                        &lt;br /&gt;
# @ dependency = step2 == 0                                                                                                                                                                                                                        &lt;br /&gt;
# @ queue&lt;br /&gt;
# Launch the third step if the second one has returned 0 (done successfully) :&lt;br /&gt;
if [ $LOADL_STEP_NAME = &amp;quot;step3&amp;quot; ]; then&lt;br /&gt;
    runjob --np 1024 --ranks-per-node=16 --envs OMP_NUM_THREADS=1 --cwd=$SCRATCH/ : $HOME/mycode.exe myflags&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Jobs ===&lt;br /&gt;
&lt;br /&gt;
To see running jobs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
llq2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
llq -b&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
to cancel a job use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
llcancel JOBID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and to look at details of the bluegene resources use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
llbgstatus -M all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note: the loadleveler script commands  are not run on a bgq compute node but on the front-end node. Only programs started with runjob run on the bgq compute nodes. You should therefore keep scripting in the submission script to a bare minimum.'''&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Stats ===&lt;br /&gt;
&lt;br /&gt;
Use llbgstats to monitor your own stats and/or your group stats. PIs can also print their (current) monthly report.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
llbgstats -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interactive Use / Debugging ===&lt;br /&gt;
&lt;br /&gt;
As BGQ codes are cross-compiled they cannot be run direclty on the front-nodes.  &lt;br /&gt;
Users however only have access to the BGQ through loadleveler which is appropriate for batch jobs, &lt;br /&gt;
however an interactive session is typically beneficial when debugging and developing.   As such a &lt;br /&gt;
script has been written to allow a session in which runjob can be run interactively.  The script&lt;br /&gt;
uses loadleveler to setup a block and set all the correct environment variables and then launch a spawned shell on&lt;br /&gt;
the front-end node. The '''debugjob''' session currently allows a 30 minute session on 64 nodes and when run on &lt;br /&gt;
'''&amp;lt;tt&amp;gt;bgqdev&amp;lt;/tt&amp;gt;''' runs in a dedicated reservation as described previously in the [[BGQ#Queue_Limits | queue limits]] section. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[user@bgqdev-fen1]$ debugjob&lt;br /&gt;
&lt;br /&gt;
[user@bgqdev-fen1]$ runjob --np 64 --ranks-per-node=16 --cwd=$PWD : $PWD/my_code -f myflags&lt;br /&gt;
&lt;br /&gt;
[user@bgqdev-fen1]$ exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For debugging, gdb and Allinea DDT are available. The latter is recommended as it automatically attaches to all the processes of a process (instead of attaching a gdbtool by hand (as explained in the BGQ Application Development guide, link below). Simply compile with &amp;lt;tt&amp;gt;-g&amp;lt;/tt&amp;gt;, load the &amp;lt;tt&amp;gt;ddt/4.1&amp;lt;/tt&amp;gt; module, type &amp;lt;tt&amp;gt;ddt&amp;lt;/tt&amp;gt; and follow the graphical user interface.  The DDT user guide can be found below.&lt;br /&gt;
&lt;br /&gt;
Note: when running a job under ddt, you'll need to add &amp;quot;&amp;lt;tt&amp;gt;--ranks-per-node=X&amp;lt;/tt&amp;gt;&amp;quot; to the &amp;quot;runjob arguments&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
Apart from debugging, this environment is also useful for building libraries and applications that need to run small tests as part of their 'configure' step.   Within the debugjob session, applications compiled with the bgxl compilers or the mpcc/mpCC/mpfort wrappers, will automatically run on the BGQ, skipping the need for the runjob command, provided if you set the following environment variables &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ export BG_PGM_LAUNCHER=yes&lt;br /&gt;
$ export RUNJOB_NP=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The latter setting sets the number of mpi processes to run.  Most configure scripts expect only one mpi process, thus, &amp;lt;tt&amp;gt;RUNJOB_NP=1&amp;lt;/tt&amp;gt; is appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
debugjob session with an executable implicitly calls runjob  with 1 mpi task :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
debugjob -i&lt;br /&gt;
**********************************************************&lt;br /&gt;
 Interactive BGQ runjob shell using bgq-fen1-ib0.10295.0 and           &lt;br /&gt;
 LL14040718574824 for 30 minutes with 64 NODES (1024 cores). &lt;br /&gt;
 IMPLICIT MODE: running an executable implicitly calls runjob&lt;br /&gt;
                with 1 mpi task&lt;br /&gt;
 Exit shell when finished.                                &lt;br /&gt;
**********************************************************&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sub-block jobs ===&lt;br /&gt;
&lt;br /&gt;
BGQ allows multiple applications to share the same block, which is referred to as sub-block jobs, however this needs to be done from within the same loadleveler submission script using multiple calls to runjob.  To run a sub-block job, you need to specify a &amp;quot;--corner&amp;quot; within the block to start each job and a 5D Torus AxBxCxDxE &amp;quot;--shape&amp;quot;.  The starting corner will depend on the specific block details provided by loadleveler and the shape and size of job trying to be used.  &lt;br /&gt;
&lt;br /&gt;
Figuring out what the corners and shapes should be is very tricky (especially since it depends on the block you get allocated).  For that reason, we've created a script called &amp;lt;tt&amp;gt;subblocks&amp;lt;/tt&amp;gt; that determines the corners and shape of the sub-blocks.  It only handles the (presumable common) case in which you want to subdivide the block into n equally sized sub-blocks, where n may be 1,2,4,8,16 and 32.&lt;br /&gt;
&lt;br /&gt;
Here is an example script calling &amp;lt;tt&amp;gt;subblocks&amp;lt;/tt&amp;gt; with a size of 4 that will return the appropriate $SHAPE argument and an array of 16 starting $CORNER. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# @ job_name           = bgsubblock&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job SUBBLOCK &amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue&lt;br /&gt;
&lt;br /&gt;
# Using subblocks script to set $SHAPE and array of ${CORNERS[n]}&lt;br /&gt;
# with size of subblocks in nodes (ie similiar to bg_size)&lt;br /&gt;
&lt;br /&gt;
# In this case 16 sub-blocks of 4 cnodes each (64 total ie bg_size)&lt;br /&gt;
source subblocks 4&lt;br /&gt;
&lt;br /&gt;
# 16 jobs of 4 each&lt;br /&gt;
for (( i=0; i &amp;lt;  16 ; i++)); do&lt;br /&gt;
   runjob --corner ${CORNER[$i]} --shape $SHAPE --np 64 --ranks-per-node=16 :  your_code_here &amp;gt; $i.out &amp;amp;&lt;br /&gt;
done&lt;br /&gt;
wait&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Remember that subjobs are not the ideal way to run on the BlueGene/Qs. One needs to consider that these sub-blocks all have to share the same I/O nodes, so for I/O intensive jobs this will be an inefficient setup.  Also consider that if you need to run such small jobs that you have to run in sub-blocks, it may be more efficient to use other clusters such as the GPC.&lt;br /&gt;
&lt;br /&gt;
Let us know if you run into any issues with this technique, please contact bgq-support for help.&lt;br /&gt;
&lt;br /&gt;
== Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The BGQ has its own dedicated 500TB file system based on GPFS (General Parallel File System). There are two main systems for user data: /home, a small, backed-up space where user home directories are located, and /scratch, a large system for input or output data for jobs; data on /scratch is not backed up. The path to your home directory is in the environment variable $HOME, and will look like /home/G/GROUP/USER, .  The path to your scratch directory is in the environment variable $SCRATCH, and will look like /scratch/G/GROUP/USER (following the conventions of the rest of the SciNet systems).  &lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! {{Hl2}} | file system &lt;br /&gt;
! {{Hl2}} | purpose &lt;br /&gt;
! {{Hl2}} | user quota &lt;br /&gt;
! {{Hl2}} | backed up&lt;br /&gt;
! {{Hl2}} | purged&lt;br /&gt;
|- &lt;br /&gt;
| /home&lt;br /&gt;
| development&lt;br /&gt;
| 50 GB&lt;br /&gt;
| yes&lt;br /&gt;
| never&lt;br /&gt;
|-&lt;br /&gt;
| /scratch&lt;br /&gt;
| computation&lt;br /&gt;
| first of (20 TB ; 1 million files)&lt;br /&gt;
| no&lt;br /&gt;
| not currently&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Transfering files===&lt;br /&gt;
The BGQ GPFS file system,  except for HPSS, is '''not''' shared with the other SciNet systems (gpc, tcs, p7, arc), nor is the other file system mounted on the BGQ.  &lt;br /&gt;
Use scp to copy files from one file system to the other, e.g., from bgqdev-fen1, you could do&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $ scp -c arcfour login.scinet.utoronto.ca:code.tgz .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or from a login node you could do&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $ scp -c arcfour code.tgz bgqdev.scinet.utoronto.ca:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The flag &amp;lt;tt&amp;gt;-c arcfour&amp;lt;/tt&amp;gt; is optional. It tells scp (or really, ssh), to use a non-default encryption. The one chosen here, arcfour, has been found to speed up the transfer by a factor of two (you may expect around 85MB/s).  This encryption method is only recommended for copying from the BGQ file system to the regular SciNet GPFS file system or back. &lt;br /&gt;
 &lt;br /&gt;
Note that although these transfers are witihin the same data center, you have to use the full names of the systems, login.scinet.utoronto.ca and bgq.scinet.utoronto.ca, respectively, and that you will be asked you for your password.&lt;br /&gt;
&lt;br /&gt;
===How much Disk Space Do I have left?===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;'''diskUsage'''&amp;lt;/tt&amp;gt; command, available on the bgqdev nodes, provides information in a number of ways on the home and scratch file systems. For instance, how much disk space is being used by yourself and your group (with the -a option), or how much your usage has changed over a certain period (&amp;quot;delta information&amp;quot;) or you may generate plots of your usage over time. Please see the usage help below for more details.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Usage: diskUsage [-h|-?| [-a] [-u &amp;lt;user&amp;gt;] [-de|-plot]&lt;br /&gt;
       -h|-?: help&lt;br /&gt;
       -a: list usages of all members on the group&lt;br /&gt;
       -u &amp;lt;user&amp;gt;: as another user on your group&lt;br /&gt;
       -de: include delta information&lt;br /&gt;
       -plot: create plots of disk usages&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that the information on usage and quota is only updated hourly!&lt;br /&gt;
&lt;br /&gt;
===Bridge to HPSS===&lt;br /&gt;
&lt;br /&gt;
BGQ users may transfer material to/from HPSS via the GPC archive queue. On the HPSS gateway node (gpc-archive01), the BGQ GPFS file systems are mounted under a single mounting point /bgq (/bgq/scratch and /bgq/home). For detailed information on the use of HPSS [https://support.scinet.utoronto.ca/wiki/index.php/HPSS please read the HPSS wiki section.]&lt;br /&gt;
&lt;br /&gt;
== Software modules installed on the BGQ ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
!{{Hl2}} |Software  &lt;br /&gt;
!{{Hl2}}| Version&lt;br /&gt;
!{{Hl2}}| Comments&lt;br /&gt;
!{{Hl2}}| Command/Library&lt;br /&gt;
!{{Hl2}}| Module Name&lt;br /&gt;
|-&lt;br /&gt;
|colspan=5 style='background: #E0E0E0'|'''''Compilers &amp;amp; Development Tools'''''&lt;br /&gt;
|-&lt;br /&gt;
|IBM fortran compiler&lt;br /&gt;
|14.1&lt;br /&gt;
|These are cross compilers&lt;br /&gt;
|&amp;lt;tt&amp;gt;bgxlf,bgxlf_r,bgxlf90,...&amp;lt;/tt&amp;gt;&lt;br /&gt;
|xlf&lt;br /&gt;
|-&lt;br /&gt;
|IBM c/c++ compilers&lt;br /&gt;
|12.1&lt;br /&gt;
|These are cross compilers&lt;br /&gt;
|&amp;lt;tt&amp;gt;bgxlc,bgxlC,bgxlc_r,bgxlC_r,...&amp;lt;/tt&amp;gt;&lt;br /&gt;
|vacpp&lt;br /&gt;
|-&lt;br /&gt;
|MPICH2 MPI library&lt;br /&gt;
|1.4.1&lt;br /&gt;
|There are 4 versions (see BGQ Applications Development document).&lt;br /&gt;
|&amp;lt;tt&amp;gt;mpicc,mpicxx,mpif77,mpif90&amp;lt;/tt&amp;gt;&lt;br /&gt;
|mpich2&lt;br /&gt;
|- &lt;br /&gt;
| GCC Compiler&lt;br /&gt;
| 4.4.6, 4.8.1&lt;br /&gt;
| GNU Compiler Collection for BGQ&amp;lt;br&amp;gt;(4.8.1 requires binutils/2.23 to be loaded)&lt;br /&gt;
| &amp;lt;tt&amp;gt;powerpc64-bgq-linux-gcc, powerpc64-bgq-linux-g++, powerpc64-bgq-linux-gfortran&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;bgqgcc&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Clang Compiler&lt;br /&gt;
| r217688-20140912, r263698-20160317&lt;br /&gt;
| Clang cross-compilers for bgq&lt;br /&gt;
| &amp;lt;tt&amp;gt;powerpc64-bgq-linux-clang, powerpc64-bgq-linux-clang++&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;bgclang&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Binutils&lt;br /&gt;
| 2.21.1, 2.23&lt;br /&gt;
| Cross-compilation utilities&lt;br /&gt;
| &amp;lt;tt&amp;gt;addr2line, ar, ld, ...&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;binutils&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CMake	&lt;br /&gt;
| 2.8.8, 2.8.12.1&lt;br /&gt;
| cross-platform, open-source build system&lt;br /&gt;
| &amp;lt;tt&amp;gt;cmake&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;cmake&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Git&lt;br /&gt;
| 1.9.5&lt;br /&gt;
| Revision control system&lt;br /&gt;
| &amp;lt;tt&amp;gt;git, gitk&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|colspan=5 style='background: #E0E0E0'|'''''Debug/performance tools'''''&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.gnu.org/software/gdb/ gdb]&lt;br /&gt;
| 7.2&lt;br /&gt;
| GNU Debugger&lt;br /&gt;
| &amp;lt;tt&amp;gt;gdb&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;gdb&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.gnu.org/software/ddd/ ddd]&lt;br /&gt;
| 3.3.12&lt;br /&gt;
| GNO Data Display Debugger&lt;br /&gt;
| &amp;lt;tt&amp;gt;ddd&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;ddd&amp;lt;/tt&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [http://www.allinea.com/products/ddt/ DDT]&lt;br /&gt;
| 4.1, 4.2, 5.0.1&lt;br /&gt;
| Allinea's Distributed Debugging Tool&lt;br /&gt;
| &amp;lt;tt&amp;gt;ddt&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;ddt&amp;lt;/tt&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[HPCTW]]&lt;br /&gt;
| 1.0&lt;br /&gt;
| BGQ MPI and Hardware Counters&lt;br /&gt;
| &amp;lt;tt&amp;gt;libmpihpm.a, libmpihpm_smp.a, libmpitrace.a &amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;hptibm&amp;lt;/tt&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[MemP]]&lt;br /&gt;
| 1.0.3&lt;br /&gt;
| BGQ Memory Stats&lt;br /&gt;
| &amp;lt;tt&amp;gt;libmemP.a &amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;memP&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|colspan=5 style='background: #E0E0E0'|'''''Storage tools/libraries'''''&lt;br /&gt;
|-&lt;br /&gt;
| HDF5&lt;br /&gt;
| 1.8.9-v18&lt;br /&gt;
| Scientific data storage and retrieval&lt;br /&gt;
| &amp;lt;tt&amp;gt;h5ls, h5diff, ..., libhdf5&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;hdf5/189-v18-serial-xlc*&amp;lt;br/&amp;gt;hdf5/189-v18-mpich2-xlc&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| HDF5&lt;br /&gt;
| 1.8.12-v18&lt;br /&gt;
| Scientific data storage and retrieval&lt;br /&gt;
| &amp;lt;tt&amp;gt;h5ls, h5diff, ..., libhdf5&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;hdf5/1812-v18-serial-gcc&amp;lt;br/&amp;gt;hdf5/1812-v18-mpich2-gcc&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NetCDF&lt;br /&gt;
| 4.2.1.1&lt;br /&gt;
| Scientific data storage and retrieval&lt;br /&gt;
| &amp;lt;tt&amp;gt;ncdump,ncgen,libnetcdf&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;netcdf/4.2.1.1-serial-xlc*&amp;lt;br/&amp;gt;netcdf/4.2.1.1-mpich2-xlc&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Parallel NetCDF&lt;br /&gt;
| 1.3.1&lt;br /&gt;
| Parallel scientific data storage and retrieval using MPI-IO&lt;br /&gt;
| &amp;lt;tt&amp;gt;libpnetcdf.a&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;parallel-netcdf&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|colspan=5 style='background: #E0E0E0'|'''''Libraries'''''&lt;br /&gt;
|-&lt;br /&gt;
| ESSL&lt;br /&gt;
| 5.1&lt;br /&gt;
| IBM Engineering and Scientific Subroutine Library (manual below)&lt;br /&gt;
| &amp;lt;tt&amp;gt;libesslbg,libesslsmpbg&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;essl&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| WSMP&lt;br /&gt;
| 15.06.01&lt;br /&gt;
| Watson Sparse Matrix Package&lt;br /&gt;
| &amp;lt;tt&amp;gt;libpwsmpBGQ.a&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;WSMP&amp;lt;/tt&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| FFTW&lt;br /&gt;
| 2.1.5, 3.3.2, 3.1.2-esslwrapper&lt;br /&gt;
| Fast fourier transform &lt;br /&gt;
| &amp;lt;tt&amp;gt;libsfftw,libdfftw,libfftw3, libfftw3f&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;fftw/2.1.5, fftw/3.3.2, fftw/3.1.2-esslwrapper&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LAPACK + ScaLAPACK&lt;br /&gt;
| 3.4.2 + 2.0.2&lt;br /&gt;
| Linear algebra routines. A subset of Lapack may be found in ESSL as well.&lt;br /&gt;
| &amp;lt;tt&amp;gt;liblapack, libscalpack&amp;lt;/tt&amp;gt;&lt;br /&gt;
| lapack&lt;br /&gt;
|-&lt;br /&gt;
| GSL&lt;br /&gt;
| 1.15&lt;br /&gt;
| GNU Scientific Library&lt;br /&gt;
| &amp;lt;tt&amp;gt;libgsl, libgslcblas&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;gsl&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BOOST&lt;br /&gt;
| 1.47.0, 1.54, 1.57&lt;br /&gt;
| C++ Boost libraries&lt;br /&gt;
| &amp;lt;tt&amp;gt;libboost...&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;cxxlibraries/boost&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bzip2 + szip + zlib&lt;br /&gt;
| 1.0.6 + 2.1 + 1.2.7&lt;br /&gt;
| compression libraries&lt;br /&gt;
| &amp;lt;tt&amp;gt;libbz2,libz,libsz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;compression&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| METIS&lt;br /&gt;
| 5.0.2&lt;br /&gt;
| Serial Graph Partitioning and Fill-reducing Matrix Ordering&lt;br /&gt;
| &amp;lt;tt&amp;gt;libmetis&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;metis&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ParMETIS&lt;br /&gt;
| 4.0.2&lt;br /&gt;
| Parallel graph partitioning and fill-reducing matrix ordering&lt;br /&gt;
| &amp;lt;tt&amp;gt;libparmetis&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;parmetis&amp;lt;/tt&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL&lt;br /&gt;
| 1.0.2 &lt;br /&gt;
| General-purpose cryptography library&lt;br /&gt;
| &amp;lt;tt&amp;gt;libcrypto, libssl&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;openssl&amp;lt;/tt&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| FILTLAN&lt;br /&gt;
| 1.0&lt;br /&gt;
| The Filtered Lanczos Package &lt;br /&gt;
| &amp;lt;tt&amp;gt;libdfiltlan,libdmatkit,libsfiltlan,libsmatkit&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;FILTLAN&amp;lt;/tt&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|colspan=5 style='background: #E0E0E0'|'''''Scripting/interpreted languages'''''&lt;br /&gt;
|-&lt;br /&gt;
| [[Python]]&lt;br /&gt;
| 2.6.6&lt;br /&gt;
| Python programming language&lt;br /&gt;
| &amp;lt;tt&amp;gt;/bgsys/tools/Python-2.6/bin/python&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Python]]&lt;br /&gt;
| 2.7.3&lt;br /&gt;
| Python programming language. Modules included : numpy-1.8.0, pyFFTW-0.9.2, astropy-0.3, scipy-0.13.3, mpi4py-1.3.1, h5py-2.2.1&lt;br /&gt;
| &amp;lt;tt&amp;gt;/scinet/bgq/tools/Python/python2.7.3-20131205/bin/python&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Python]]&lt;br /&gt;
| 3.2.2&lt;br /&gt;
| Python programming language&lt;br /&gt;
| &amp;lt;tt&amp;gt;/bgsys/tools/Python-3.2/bin/python3&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;python&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|colspan=5 style='background: #E0E0E0'|'''''Applications'''''&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.abinit.org/ ABINIT]&lt;br /&gt;
| 7.10.4&lt;br /&gt;
| An atomic-scale simulation software suite&lt;br /&gt;
| &amp;lt;tt&amp;gt;abinit&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;abinit&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.berkeleygw.org/ BerkeleyGW library]&lt;br /&gt;
| 1.0.4-2.0.0436&lt;br /&gt;
| Computes quasiparticle properties and the optical responses of a large variety of materials&lt;br /&gt;
| &amp;lt;tt&amp;gt;libBGW_wfn.a, wfn_rho_vxc_io_m.mod&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;BGW-paratec&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.cp2k.org/ CP2K]&lt;br /&gt;
| 2.3, 2.4, 2.5.1, 2.6.1&lt;br /&gt;
| DFT molecular dynamics, MPI &lt;br /&gt;
| &amp;lt;tt&amp;gt;cp2k.psmp&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;cp2k&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.cpmd.org/ CPMD]&lt;br /&gt;
| 3.15.3, 3.17.1&lt;br /&gt;
| Carr-Parinello molecular dynamics, MPI&lt;br /&gt;
| &amp;lt;tt&amp;gt;cpmd.x&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;cpmd&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| gnuplot&lt;br /&gt;
| 4.6.1&lt;br /&gt;
| interactive plotting program to be run on front-end nodes&lt;br /&gt;
| &amp;lt;tt&amp;gt;gnuplot&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;gnuplot&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LAMMPS&lt;br /&gt;
| Nov 2012/7Dec15/7Dec15-mpi&lt;br /&gt;
| Molecular Dynamics &lt;br /&gt;
| &amp;lt;tt&amp;gt;lmp_bgq&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;lammps&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NAMD&lt;br /&gt;
| 2.9&lt;br /&gt;
| Molecular Dynamics &lt;br /&gt;
| &amp;lt;tt&amp;gt;namd2&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;namd/2.9-smp&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.quantum-espresso.org/index.php Quantum Espresso]&lt;br /&gt;
| 5.0.3/5.2.1&lt;br /&gt;
| Molecular Structure / Quantum Chemistry &lt;br /&gt;
| &amp;lt;tt&amp;gt;qe_pw.x, etc&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;espresso&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[BGQ_OpenFOAM | OpenFOAM]]&lt;br /&gt;
| 2.2.0, 2.3.0, 2.4.0, 3.0.1&lt;br /&gt;
| Computational Fluid Dynamics&lt;br /&gt;
| &amp;lt;tt&amp;gt;icofoam,etc. &amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;openfoam/2.2.0, openfoam/2.3.0, openfoam/2.4.0&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|colspan=5 style='background: #E0E0E0'|'''''Beta Tests'''''&lt;br /&gt;
|-&lt;br /&gt;
| WATSON API&lt;br /&gt;
| beta&lt;br /&gt;
| Natural Language Processing&lt;br /&gt;
| &amp;lt;tt&amp;gt;watson_beta&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;FEN/WATSON&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== OpenFOAM on BGQ ===&lt;br /&gt;
[https://wiki.scinet.utoronto.ca/wiki/index.php/BGQ_OpenFOAM How to use OpenFOAM on BGQ]&lt;br /&gt;
&lt;br /&gt;
== Python on BlueGene ==&lt;br /&gt;
Python 2.7.3 has been installed on BlueGene. To use &amp;lt;span style=&amp;quot;color: red;font-weight: bold;&amp;quot;&amp;gt;Numpy&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color: red;font-weight: bold;&amp;quot;&amp;gt;Scipy&amp;lt;/span&amp;gt;, the module &amp;lt;span style=&amp;quot;color: red;font-weight: bold;&amp;quot;&amp;gt;essl/5.1&amp;lt;/span&amp;gt; has to be loaded.&lt;br /&gt;
The full python path has to be provided (otherwise the default version is used).&lt;br /&gt;
&lt;br /&gt;
To use python on BlueGene (from within a job script or a debugjob session):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load python/2.7.3&lt;br /&gt;
##Only if you need numpy/scipy :&lt;br /&gt;
module load xlf/14.1 essl/5.1&lt;br /&gt;
runjob --np 1 --ranks-per-node=1 --envs HOME=$HOME LD_LIBRARY_PATH=$LD_LIBRARY_PATH PYTHONPATH=/scinet/bgq/tools/Python/python2.7.3-20131205/lib/python2.7/site-packages/ : /scinet/bgq/tools/Python/python2.7.3-20131205/bin/python2.7 /PATHOFYOURSCRIPT.py &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the mmap python API, you must use it in PRIVATE mode as shown in the bellow example :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
import mmap&lt;br /&gt;
mm=mmap.mmap(-1,256,mmap.MAP_PRIVATE)&lt;br /&gt;
mm.close()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use the mpi4py and h5py modules.&lt;br /&gt;
&lt;br /&gt;
Also, please read Cython documentation.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
#BGQ Day: Intro to Using the BGQ&amp;lt;br/&amp;gt;[[File:BgqIntro-FirstFrame.png|180px|link=http://support.scinet.utoronto.ca/CourseVideo/BGQ/bgqintro/bgqintro.html]]&amp;lt;br/&amp;gt;[[Media:BgqintroUpdatedMarch2015.pdf|Slides (updated in 2015) ]] &amp;amp;nbsp;/ &amp;amp;nbsp; [http://support.scinet.utoronto.ca/CourseVideo/BGQ/bgqintro/bgqintro.html Video recording] [http://support.scinet.utoronto.ca/CourseVideo/BGQ/bgqintro/bgqintro.mp4 (direct link)]&lt;br /&gt;
#BGQ Day: BGQ Hardware Overview&amp;lt;br/&amp;gt;[[File:Bgqhardware-FirstFrame.png|180px|link=http://support.scinet.utoronto.ca/CourseVideo/BGQ/bgqhardware/bgqhardware.html]]&amp;lt;br/&amp;gt;[https://support.scinet.utoronto.ca/~northrup/bgqhardware.pdf Slides] &amp;amp;nbsp;/ &amp;amp;nbsp; [http://support.scinet.utoronto.ca/CourseVideo/BGQ/bgqhardware/bgqhardware.html Video recording] [http://support.scinet.utoronto.ca/CourseVideo/BGQ/bgqhardware/bgqhardware.mp4 (direct link)]&lt;br /&gt;
# [http://www.fz-juelich.de/ias/jsc/EN/Expertise/Supercomputers/JUQUEEN/Documentation/Documention_node.html Julich BGQ Documentation]&lt;br /&gt;
# [https://wiki.alcf.anl.gov/parts/index.php/Blue_Gene/Q Argonne Mira BGQ Wiki]&lt;br /&gt;
# [https://computing.llnl.gov/tutorials/bgq/ LLNL Sequoia BGQ Info]&lt;br /&gt;
# [https://www.alcf.anl.gov/presentations Argonne MiraCon Presentations]&lt;br /&gt;
# [http://www.redbooks.ibm.com/redbooks/SG247869/wwhelp/wwhimpl/js/html/wwhelp.htm BGQ System Administration Guide]&lt;br /&gt;
# [http://www.redbooks.ibm.com/redbooks/SG247948/wwhelp/wwhimpl/js/html/wwhelp.htm BGQ Application Development ]&lt;br /&gt;
# IBM XL C/C++ for Blue Gene/Q: [[Media:bgqcgetstart.pdf|Getting started]]&lt;br /&gt;
# IBM XL C/C++ for Blue Gene/Q: [[Media:bgqccompiler.pdf|Compiler reference]]&lt;br /&gt;
# IBM XL C/C++ for Blue Gene/Q: [[Media:bgqclangref.pdf|Language reference]]&lt;br /&gt;
# IBM XL C/C++ for Blue Gene/Q: [[Media:bgqcproguide.pdf|Optimization and Programming Guide]]&lt;br /&gt;
# IBM XL Fortran for Blue Gene/Q: [[Media:bgqfgetstart.pdf|Getting started]]&lt;br /&gt;
# IBM XL Fortran for Blue Gene/Q: [[Media:bgqfcompiler.pdf|Compiler reference]]&lt;br /&gt;
# IBM XL Fortran for Blue Gene/Q: [[Media:bgqflangref.pdf|Language reference]]&lt;br /&gt;
# IBM XL Fortran for Blue Gene/Q: [[Media:bgqfproguide.pdf|Optimization and Programming Guide]]&lt;br /&gt;
# [[Media:essl51.pdf|IBM ESSL (Engineering and Scientific Subroutine Library) 5.1 for Linux on Power]]&lt;br /&gt;
# [http://content.allinea.com/downloads/userguide.pdf Allinea DDT 4.1 User Guide]&lt;br /&gt;
# [https://www.ibm.com/support/knowledgecenter/en/SSFJTW_5.1.0/loadl.v5r1_welcome.html IBM LoadLeveler 5.1]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--  PUT IN TRAC !!!&lt;br /&gt;
&lt;br /&gt;
=== *Manual Block Creation* ===&lt;br /&gt;
&lt;br /&gt;
To reconfigure the BGQ nodes you can use the bg_console or the web based navigator from the service node &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bg_console&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are various options to create block types (section 3.2 in the BGQ admin manual), but the smallest is created using the&lt;br /&gt;
following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gen_small_block &amp;lt;blockid&amp;gt; &amp;lt;midplane&amp;gt; &amp;lt;cnodes&amp;gt; &amp;lt;nodeboard&amp;gt; &lt;br /&gt;
gen_small_block  R00-M0-N03-32 R00-M0 32 N03&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The block then needs to be booted using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
allocate R00-M0-N03-32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If those resources are already booted into another block, that block must be freed before the new block can be &lt;br /&gt;
allocated.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
free R00-M0-N03&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are many other functions in bg_console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
help all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The BGQ default nomenclature for hardware is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(R)ack - (M)idplane - (N)ode board or block - (J)node - (C)ore&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So R00-M01-N03-J00-C02 would correspond to the first rack, second midplane, 3rd block, 1st node, and second core.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--!&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9232</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9232"/>
		<updated>2018-04-21T02:47:30Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing &amp;quot;module avail&amp;quot; on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installations can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar or reconstructParMesh, please use FEN/OpenFOAM/* modules. Do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and run out of memory therefore make it unavailable for everyone.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. This is the only way of using compute nodes on BGQ. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations  &lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can covert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9231</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9231"/>
		<updated>2018-04-21T02:46:06Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing &amp;quot;module avail&amp;quot; on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installations can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar or reconstructParMesh, please use FEN/OpenFOAM/* modules. Do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and run out of memory therefore make it unavailable for everyone.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations  &lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can covert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9230</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9230"/>
		<updated>2018-04-21T02:44:35Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing &amp;quot;module avail&amp;quot; on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installations can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar or reconstructParMesh, please use FEN/OpenFOAM/* modules. Do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations  &lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can covert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9229</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9229"/>
		<updated>2018-04-21T02:43:31Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing &amp;quot;module avail&amp;quot; on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar, reconstructParMesh you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations  &lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can covert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9228</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9228"/>
		<updated>2018-04-20T04:09:43Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: /* General Tips and Tricks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing module avail on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar, reconstructParMesh you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations  &lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from &amp;quot;case/constant/polyMesh&amp;quot; not from &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Perform test runs using debug nodes before you submit large jobs. Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* You can covert cases from ascii to binary using foamFormatConvert command.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep them under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells.&lt;br /&gt;
* Try collated option using the version 5.0. It significantly reduces the number of files however master processor gets overloaded.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9227</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9227"/>
		<updated>2018-04-20T03:56:20Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing module avail on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar, reconstructParMesh you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines specified regions, snaps out solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations  &lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from the &amp;quot;case/constant/polyMesh&amp;quot; not from the &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Always perform a test run using debug nodes: Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep it under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9226</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9226"/>
		<updated>2018-04-20T03:54:44Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing module avail on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar, reconstructParMesh you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition is hierarchical. If you use this method, then similar to simple you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation (xyz or zyx). There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines the specified regions, snaps out the solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations  &lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from the &amp;quot;case/constant/polyMesh&amp;quot; not from the &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Always perform a test run using debug nodes: Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep it under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9225</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9225"/>
		<updated>2018-04-20T03:51:53Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing module avail on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar, reconstructParMesh you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is hierarchical. If you use this method, then similarly you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines the specified regions, snaps out the solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations  &lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
This will be updated as the ParaView installation on Niagara will be completed!&lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from the &amp;quot;case/constant/polyMesh&amp;quot; not from the &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Always perform a test run using debug nodes: Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep it under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;br /&gt;
* OpenFOAM is a pure MPI code, there is no multithreading in OpenFOAM.&lt;br /&gt;
* Each and every node on BG/Q has 16 GB memory and 16 compute cores. Some OpenFOAM functions, especially snappyHexMesh, are very memory consuming up to 4GB memory per 1M cells. Use 8 ranks per node if you run out of memory however be careful with that. Do not waste resources. Usually solvers require 1GB memory per 1M cells.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9224</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9224"/>
		<updated>2018-04-20T03:42:00Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing module avail on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar, reconstructParMesh you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is hierarchical. If you use this method, then similarly you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines the specified regions, snaps out the solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations  &lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;br /&gt;
&lt;br /&gt;
== General Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* Run serial tasks on FEN using FEN/OpenFOAM/* modules&lt;br /&gt;
* Make a quality check for your mesh using checkMesh tool. Be careful that if you run a serial checkMesh in a parallel case, it will only return results from the &amp;quot;case/constant/polyMesh&amp;quot; not from the &amp;quot;case/processor*/constant/polyMesh&amp;quot;&lt;br /&gt;
* Always perform a test run using debug nodes: Request debug session with &amp;quot;debugjob -i&amp;quot; and use runjob.&lt;br /&gt;
* Always work with binary files. This can be set in the &amp;quot;case/system/controlDict&amp;quot;.&lt;br /&gt;
* Keep your simulations under $SCRATCH.&lt;br /&gt;
* If you write your own code, keep it under $HOME. Preferably create a directory &amp;quot;$HOME/OpenFOAM/username-X.Y/src&amp;quot; and work here.&lt;br /&gt;
* If you write your own code, do not forget to compile them to $FOAM_USER_APPBIN or $FOAM_USER_LIBBIN. You might need to compile shared objects on debug nodes as well.&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9223</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9223"/>
		<updated>2018-04-20T03:30:58Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing module avail on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as blockMesh, decomposePar, reconstructParMesh you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* blockMesh: Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* decomposePar: Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* reconstructPar: Reconstructs a parallel case (results). &lt;br /&gt;
* reconstructParMesh: Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called decomposeParDict in the system directory of your case folder. decomposeParDict is the input file for the command &amp;quot;decomposePar -force&amp;quot;. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is hierarchical. If you use this method, then similarly you have to define hierarchicalCoeffs. Only difference between simple and hierarchical is that with hierarchical method you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the decomposeParDict is the numberOfSubdomains defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then numberOfSubdomains should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called snappyHexMesh. This tool reads inputs from the &amp;quot;system/snappyHexMeshDict&amp;quot; file and writes outputs to the &amp;quot;constant/polyMesh&amp;quot; folder (if used with -overwrite flag, otherwise writes to separate time folders 1/, 2/). snappyHexMesh operates on the outputs of blockMesh, refines the specified regions, snaps out the solid areas from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run &amp;quot;decomposePar -force&amp;quot;, so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can be passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
&lt;br /&gt;
# Disabling the pt2pt small message optimizations  &lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
&lt;br /&gt;
# Sets the cutoff point for switching from eager to rendezvous protocol at 50MB&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Do not optimise collective comm.&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
&lt;br /&gt;
# Do not generate core dump files&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BG/Q:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 1024 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9222</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9222"/>
		<updated>2018-04-20T03:13:01Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing ''module avail'' on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as ''blockMesh'', ''decomposePar'', ''reconstructParMesh'' you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* ''blockMesh'': Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* ''decomposePar'': Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* ''reconstructPar'': Reconstructs a parallel case (results). &lt;br /&gt;
* ''reconstructParMesh'': Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a OpenFOAM dictionary called ''decomposeParDict'' in the ''system'' directory of your case folder. ''decomposeParDict'' is the input file for the command ''decomposePar -force''. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is ''hierarchical''. If you use this method, then similarly you have to define ''hierarchicalCoeffs''. Only difference between ''simple'' and ''hierarchical'' is that with ''hierarchical'' you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by OpenFOAM but since this a serial tasks that needs to be performed on FEN, these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the ''decomposeParDict'' is the ''numberOfSubdomains'' defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then ''numberOfSubdomains'' should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise OpenFOAM will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Running Parallel Meshing ==&lt;br /&gt;
The built-in meshing tool comes with OpenFOAM package is called ''snappyHexMesh''. This tool reads inputs from the ''system/snappyHexMeshDict'' file and writes outputs to the ''constant/polyMesh'' folder (if used with ''-overwrite'' flag, otherwise writes to separate time folders 1/, 2/). ''snappyHexMesh'' reads the output of ''blockMesh'', refines the specified regions, snaps out the solid regions from the volume and adds boundary layers if enabled. &lt;br /&gt;
&lt;br /&gt;
Before running mesh generation one needs to run ''decomposePar -force'', so that the case is parallelised and made available to run parallel executions on it. One can submit the script below to run parallel mesh generation on BG/Q:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = motorBike_mesh&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(jobid).err&lt;br /&gt;
# @ output             = $(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 06:00:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
# Load modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/5.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# Set environment variables&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
export PAMID_COLLECTIVES=0&lt;br /&gt;
export BG_COREDUMPDISABLED=1&lt;br /&gt;
&lt;br /&gt;
# Run mesh generation&lt;br /&gt;
runjob --np 1024 --ranks-per-node=16 --env-all : $FOAM_APPBIN/snappyHexMesh -overwrite -parallel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script for Solvers ==&lt;br /&gt;
&lt;br /&gt;
The following is a sample script for running the OpenFOAM tutorial case on BGQ, first doing the&lt;br /&gt;
pre-processing serially on the front-end p7 node, then running the case on the BGQ using runjob,&lt;br /&gt;
and then reconstructing the solution again using the front-end node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 4 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9221</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9221"/>
		<updated>2018-04-20T02:49:25Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing ''module avail'' on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as ''blockMesh'', ''decomposePar'', ''reconstructParMesh'' you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written in the previous section, if you want to run serial tasks you need to use one of the FEN based modules. Most common serial tasks are:&lt;br /&gt;
* ''blockMesh'': Creates the block structured computational volume consists of hex elements.&lt;br /&gt;
* ''decomposePar'': Parallelises a serial case. Grid partitioning.&lt;br /&gt;
* ''reconstructPar'': Reconstructs a parallel case (results). &lt;br /&gt;
* ''reconstructParMesh'': Reconstructs a parallel case (mesh). &lt;br /&gt;
&lt;br /&gt;
These binaries are not available on the compute nodes, therefore you can use these tools only on the FEN anyway.&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run ''OpenFOAM'' in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. ''OpenFOAM'' has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a ''OpenFOAM'' dictionary called ''decomposeParDict'' in the ''system'' directory of your case folder. ''decomposeParDict'' is the input file for the command ''decomposePar''. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is ''hierarchical''. If you use this method, then similarly you have to define ''hierarchicalCoeffs''. Only difference between ''simple'' and ''hierarchical'' is that with ''hierarchical'' you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by ''OpenFOAM'' but since this a serial tasks that needs to be performed on ''FEN'', these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the ''decomposeParDict'' is the ''numberOfSubdomains'' defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then ''numberOfSubdomains'' should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise ''OpenFOAM'' will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script ==&lt;br /&gt;
&lt;br /&gt;
The following is a Sample script for running the OpenFOAM tutorial case on BGQ, first doing the&lt;br /&gt;
pre-processing serially on the front-end p7 node, then running the case on the BGQ using runjob,&lt;br /&gt;
and then reconstructing the solution again using the front-end node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 4 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9220</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9220"/>
		<updated>2018-04-20T02:41:05Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: /* Running Serial OpenFOAM Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing ''module avail'' on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as ''blockMesh'', ''decomposePar'', ''reconstructParMesh'' you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
As it has been written above, if you want to run&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run ''OpenFOAM'' in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. ''OpenFOAM'' has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a ''OpenFOAM'' dictionary called ''decomposeParDict'' in the ''system'' directory of your case folder. ''decomposeParDict'' is the input file for the command ''decomposePar''. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is ''hierarchical''. If you use this method, then similarly you have to define ''hierarchicalCoeffs''. Only difference between ''simple'' and ''hierarchical'' is that with ''hierarchical'' you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by ''OpenFOAM'' but since this a serial tasks that needs to be performed on ''FEN'', these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the ''decomposeParDict'' is the ''numberOfSubdomains'' defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then ''numberOfSubdomains'' should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise ''OpenFOAM'' will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script ==&lt;br /&gt;
&lt;br /&gt;
The following is a Sample script for running the OpenFOAM tutorial case on BGQ, first doing the&lt;br /&gt;
pre-processing serially on the front-end p7 node, then running the case on the BGQ using runjob,&lt;br /&gt;
and then reconstructing the solution again using the front-end node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 4 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9219</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9219"/>
		<updated>2018-04-20T02:40:34Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: /* Using OpenFOAM on BG/Q */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various OpenFOAM versions installed on BGQ. You can see the list by typing ''module avail'' on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with FEN refer to the installation that can be used on the Front-End-Nodes. Therefore if you want to run serial tasks such as ''blockMesh'', ''decomposePar'', ''reconstructParMesh'' you can use FEN/OpenFOAM/* modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you try to decompose a case with 100 million cells, you will occupy the whole FEN machine and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the FEN using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run ''OpenFOAM'' in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. ''OpenFOAM'' has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a ''OpenFOAM'' dictionary called ''decomposeParDict'' in the ''system'' directory of your case folder. ''decomposeParDict'' is the input file for the command ''decomposePar''. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is ''hierarchical''. If you use this method, then similarly you have to define ''hierarchicalCoeffs''. Only difference between ''simple'' and ''hierarchical'' is that with ''hierarchical'' you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by ''OpenFOAM'' but since this a serial tasks that needs to be performed on ''FEN'', these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the ''decomposeParDict'' is the ''numberOfSubdomains'' defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then ''numberOfSubdomains'' should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise ''OpenFOAM'' will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script ==&lt;br /&gt;
&lt;br /&gt;
The following is a Sample script for running the OpenFOAM tutorial case on BGQ, first doing the&lt;br /&gt;
pre-processing serially on the front-end p7 node, then running the case on the BGQ using runjob,&lt;br /&gt;
and then reconstructing the solution again using the front-end node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 4 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9218</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9218"/>
		<updated>2018-04-20T00:01:15Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various ''OpenFOAM'' versions installed on BGQ. You can see the list by typing ''module avail'' on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with ''FEN'' refers to the installation on the Front-End-Nodes. Therefore if you want to run serial tasks, e.g ''blockMesh'', ''decomposePar'', ''reconstructParMesh'' you can use ''FEN/OpenFOAM/*'' modules. Please do not forget that ''FEN'' is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you want to decompose a case with 100 million cells, you can occupy the whole ''FEN'' node and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the ''FEN'' using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Running Serial OpenFOAM Tasks ==&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run ''OpenFOAM'' in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. ''OpenFOAM'' has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a ''OpenFOAM'' dictionary called ''decomposeParDict'' in the ''system'' directory of your case folder. ''decomposeParDict'' is the input file for the command ''decomposePar''. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is ''hierarchical''. If you use this method, then similarly you have to define ''hierarchicalCoeffs''. Only difference between ''simple'' and ''hierarchical'' is that with ''hierarchical'' you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by ''OpenFOAM'' but since this a serial tasks that needs to be performed on ''FEN'', these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the ''decomposeParDict'' is the ''numberOfSubdomains'' defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then ''numberOfSubdomains'' should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise ''OpenFOAM'' will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script ==&lt;br /&gt;
&lt;br /&gt;
The following is a Sample script for running the OpenFOAM tutorial case on BGQ, first doing the&lt;br /&gt;
pre-processing serially on the front-end p7 node, then running the case on the BGQ using runjob,&lt;br /&gt;
and then reconstructing the solution again using the front-end node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 4 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9217</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9217"/>
		<updated>2018-04-19T23:54:49Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various ''OpenFOAM'' versions installed on BGQ. You can see the list by typing ''module avail'' on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with ''FEN'' refers to the installation on the Front-End-Nodes. Therefore if you want to run serial tasks, e.g ''blockMesh'', ''decomposePar'', ''reconstructParMesh'' you can use ''FEN/OpenFOAM/*'' modules. Please do not forget that ''FEN'' is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you want to decompose a case with 100 million cells, you can occupy the whole ''FEN'' node and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the ''FEN'' using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Parallelizing OpenFOAM Cases ==&lt;br /&gt;
&lt;br /&gt;
In order to run ''OpenFOAM'' in parallel, the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. ''OpenFOAM'' has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation. The control for this is done creating a ''OpenFOAM'' dictionary called ''decomposeParDict'' in the ''system'' directory of your case folder. ''decomposeParDict'' is the input file for the command ''decomposePar''. Below is an example file for decomposing an OpenFOAM case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is ''hierarchical''. If you use this method, then similarly you have to define ''hierarchicalCoeffs''. Only difference between ''simple'' and ''hierarchical'' is that with ''hierarchical'' you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by ''OpenFOAM'' but since this a serial tasks that needs to be performed on ''FEN'', these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
The crucial part of the ''decomposeParDict'' is the ''numberOfSubdomains'' defined in the file. The intended number of cores should match this value. Therefore if one wants to run a case on 64 nodes using all cores then ''numberOfSubdomains'' should be 1024. Also, multiplication of the n values should be equal to this number for consistency. Otherwise ''OpenFOAM'' will complain because of the mismatch.&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script ==&lt;br /&gt;
&lt;br /&gt;
The following is a Sample script for running the OpenFOAM tutorial case on BGQ, first doing the&lt;br /&gt;
pre-processing serially on the front-end p7 node, then running the case on the BGQ using runjob,&lt;br /&gt;
and then reconstructing the solution again using the front-end node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#----------------- Preprocessing on FEN ------------&lt;br /&gt;
module purge&lt;br /&gt;
module load FEN/OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
$FOAM_APPBIN/blockMesh&lt;br /&gt;
$FOAM_APPBIN/decomposePar -force&lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 4 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
#----------------- PostProcessing on FEN ------------&lt;br /&gt;
module purge&lt;br /&gt;
module load FEN/OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
$FOAM_APPBIN/reconstructPar&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9216</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9216"/>
		<updated>2018-04-19T23:48:41Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various ''OpenFOAM'' versions installed on BGQ. You can see the list by typing ''module avail'' on the terminal:&lt;br /&gt;
* OpenFOAM/2.3.1(default)&lt;br /&gt;
* OpenFOAM/2.4.0&lt;br /&gt;
* OpenFOAM/3.0.1&lt;br /&gt;
* OpenFOAM/5.0&lt;br /&gt;
and&lt;br /&gt;
* FEN/OpenFOAM/2.2.0&lt;br /&gt;
* FEN/OpenFOAM/2.3.0&lt;br /&gt;
* FEN/OpenFOAM/2.4.0&lt;br /&gt;
* FEN/OpenFOAM/3.0.1&lt;br /&gt;
* FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with ''FEN'' refers to the installation on the Front-End-Nodes. Therefore if you want to run serial tasks, e.g ''blockMesh'', ''decomposePar'', ''reconstructParMesh'' you can use ''FEN/OpenFOAM/*'' modules. Please do not forget that ''FEN'' is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you want to decompose a case with 100 million cells, you can occupy the whole ''FEN'' node and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the ''FEN'' using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Parallel OpenFOAM ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation.  The control for this is done creating a OpenFOAM 'dictionary' called '''decomposeParDict''' in the system directory of your case folder.  Below is an example file for decomposing the OpenFOAM incompressible cavity case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is ''hierarchical''. If you use this method, then similarly you have to define ''hierarchicalCoeffs''. Only difference between ''simple'' and ''hierarchical'' is that with ''hierarchical'' you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by ''OpenFOAM'' but since this a serial tasks that needs to be performed on ''FEN'', these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script ==&lt;br /&gt;
&lt;br /&gt;
The following is a Sample script for running the OpenFOAM tutorial case on BGQ, first doing the&lt;br /&gt;
pre-processing serially on the front-end p7 node, then running the case on the BGQ using runjob,&lt;br /&gt;
and then reconstructing the solution again using the front-end node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#----------------- Preprocessing on FEN ------------&lt;br /&gt;
module purge&lt;br /&gt;
module load FEN/OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
$FOAM_APPBIN/blockMesh&lt;br /&gt;
$FOAM_APPBIN/decomposePar -force&lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 4 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
#----------------- PostProcessing on FEN ------------&lt;br /&gt;
module purge&lt;br /&gt;
module load FEN/OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
$FOAM_APPBIN/reconstructPar&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9215</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9215"/>
		<updated>2018-04-19T23:38:12Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using OpenFOAM on BG/Q ==&lt;br /&gt;
There are various ''OpenFOAM'' versions installed on BGQ. You can see the list by typing ''module avail'' on the terminal:&lt;br /&gt;
OpenFOAM/2.3.1(default)&lt;br /&gt;
OpenFOAM/2.4.0&lt;br /&gt;
OpenFOAM/3.0.1&lt;br /&gt;
OpenFOAM/5.0&lt;br /&gt;
&lt;br /&gt;
FEN/OpenFOAM/2.2.0&lt;br /&gt;
FEN/OpenFOAM/2.3.0&lt;br /&gt;
FEN/OpenFOAM/2.4.0&lt;br /&gt;
FEN/OpenFOAM/3.0.1&lt;br /&gt;
FEN/OpenFOAM/5.0 &lt;br /&gt;
&lt;br /&gt;
The modules start with ''FEN'' refers to the installation on the Front-End-Nodes. Therefore if you want to run serial tasks, e.g ''blockMesh'', ''decomposePar'', ''reconstructParMesh'' you can use ''FEN/OpenFOAM/*'' modules. Please do not forget that FEN is not a dedicated area, each Front-End-Node is shared among connected users and only has 32GB of memory. So if you want to decompose a case with 100 million cells, you can occupy the whole login/FEN node and probably run out of memory.&lt;br /&gt;
&lt;br /&gt;
When you want to submit a job, you should do that on the ''FEN'' using a batch script. There is a sample batch script below. You can use it as a template and modify it according to your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Parallel OpenFOAM ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that performs this operation.  The control for this is done creating a OpenFOAM 'dictionary' called '''decomposeParDict''' in the system directory of your case folder.  Below is an example file for decomposing the OpenFOAM incompressible cavity case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option for decomposition method is ''hierarchical''. If you use this method, then similarly you have to define ''hierarchicalCoeffs''. Only difference between ''simple'' and ''hierarchical'' is that with ''hierarchical'' you can define the order of the decomposition operation. There are more complicated methods of decomposition supported by ''OpenFOAM'' but since this a serial tasks that needs to be performed on ''FEN'', these two methods are suggested.&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script ==&lt;br /&gt;
&lt;br /&gt;
The following is a Sample script for running the OpenFOAM tutorial case on BGQ, first doing the&lt;br /&gt;
pre-processing serially on the front-end p7 node, then running the case on the BGQ using runjob,&lt;br /&gt;
and then reconstructing the solution again using the front-end node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#----------------- Preprocessing on FEN ------------&lt;br /&gt;
module purge&lt;br /&gt;
module load FEN/OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
$FOAM_APPBIN/blockMesh&lt;br /&gt;
$FOAM_APPBIN/decomposePar -force&lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 4 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
#----------------- PostProcessing on FEN ------------&lt;br /&gt;
module purge&lt;br /&gt;
module load FEN/OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
$FOAM_APPBIN/reconstructPar&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9178</id>
		<title>BGQ OpenFOAM</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=BGQ_OpenFOAM&amp;diff=9178"/>
		<updated>2018-03-01T18:13:59Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Parallel OpenFOAM ==&lt;br /&gt;
&lt;br /&gt;
In order to run OpenFOAM in parallel the problem needs to be decomposed into a number of subdomains that match the number of processors that will be used. OpenFOAM has a  '''[http://www.openfoam.org/docs/user/running-applications-parallel.php decomposePar]''' utility that will perform this operation after intial mesh creation.  The control for this is done creating a OpenFOAM 'dictionary' called '''decomposeParDict''' in the system directory of your case folder.  Below is an example file for decomposing the OpenFOAM incompressible cavity case for running on 4 cores.&lt;br /&gt;
&lt;br /&gt;
'''system/decomposeParDict'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*--------------------------------*- C++ -*----------------------------------*\&lt;br /&gt;
| =========                 |                                                 |&lt;br /&gt;
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |&lt;br /&gt;
|  \\    /   O peration     | Version:  2.4.0                                 |&lt;br /&gt;
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |&lt;br /&gt;
|    \\/     M anipulation  |                                                 |&lt;br /&gt;
\*---------------------------------------------------------------------------*/&lt;br /&gt;
FoamFile&lt;br /&gt;
{&lt;br /&gt;
    version     2.0;&lt;br /&gt;
    format      ascii;&lt;br /&gt;
    class       dictionary;&lt;br /&gt;
    location    &amp;quot;system&amp;quot;;&lt;br /&gt;
    object      decomposeParDict;&lt;br /&gt;
}&lt;br /&gt;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //&lt;br /&gt;
&lt;br /&gt;
numberOfSubdomains 4;&lt;br /&gt;
&lt;br /&gt;
method          simple;&lt;br /&gt;
&lt;br /&gt;
simpleCoeffs&lt;br /&gt;
{&lt;br /&gt;
    n               ( 2 2 1 );&lt;br /&gt;
    delta           0.001;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
distributed     no;&lt;br /&gt;
&lt;br /&gt;
roots           ( );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// ************************************************************************* //&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loadleveler Submission Script ==&lt;br /&gt;
&lt;br /&gt;
The following is a Sample script for running the OpenFOAM tutorial case on BGQ, first doing the&lt;br /&gt;
pre-processing serially on the front-end p7 node, then running the case on the BGQ using runjob,&lt;br /&gt;
and then reconstructing the solution again using the front-end node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# @ job_name           = bgqopenfoam&lt;br /&gt;
# @ job_type           = bluegene&lt;br /&gt;
# @ comment            = &amp;quot;BGQ Job By Size&amp;quot;&lt;br /&gt;
# @ error              = $(job_name).$(Host).$(jobid).err&lt;br /&gt;
# @ output             = $(job_name).$(Host).$(jobid).out&lt;br /&gt;
# @ bg_size            = 64&lt;br /&gt;
# @ wall_clock_limit   = 30:00&lt;br /&gt;
# @ bg_connectivity    = Torus&lt;br /&gt;
# @ queue &lt;br /&gt;
&lt;br /&gt;
#----------------- Preprocessing on FEN ------------&lt;br /&gt;
module purge&lt;br /&gt;
module load FEN/OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
$FOAM_APPBIN/blockMesh&lt;br /&gt;
$FOAM_APPBIN/decomposePar -force&lt;br /&gt;
&lt;br /&gt;
#------------------ Solver on BGQ --------------------&lt;br /&gt;
# Load BGQ OpenFOAM modules&lt;br /&gt;
module purge&lt;br /&gt;
module load binutils/2.23 bgqgcc/4.8.1 mpich2/gcc-4.8.1 OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
# NOTE: when using --env-all there is a limit of 8192 characters that can passed to runjob&lt;br /&gt;
# so removing LS_COLORS should free up enough space&lt;br /&gt;
export -n LS_COLORS&lt;br /&gt;
# Some solvers, simpleFOAM particularly, will hang on startup when using the default&lt;br /&gt;
# network parameters.  Disabling the pt2pt small message optimizations seems to allow it to run.&lt;br /&gt;
export PAMID_SHORT=0&lt;br /&gt;
export PAMID_EAGER=50M&lt;br /&gt;
&lt;br /&gt;
# Run solver&lt;br /&gt;
runjob --np 4 --env-all  : $FOAM_APPBIN/icoFoam -parallel&lt;br /&gt;
&lt;br /&gt;
#----------------- PostProcessing on FEN ------------&lt;br /&gt;
module purge&lt;br /&gt;
module load FEN/OpenFOAM/2.4.0&lt;br /&gt;
source $FOAM_DOT_FILE&lt;br /&gt;
&lt;br /&gt;
$FOAM_APPBIN/reconstructPar&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-Processing== &lt;br /&gt;
&lt;br /&gt;
https://support.scinet.utoronto.ca/wiki/index.php/Using_Paraview&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=SOSCIP_GPU&amp;diff=9137</id>
		<title>SOSCIP GPU</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=SOSCIP_GPU&amp;diff=9137"/>
		<updated>2018-02-01T21:52:18Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Computer&lt;br /&gt;
|image=[[Image:S882lc.png|center|300px|thumb]]&lt;br /&gt;
|name=SOSCIP GPU &lt;br /&gt;
|installed=September 2017&lt;br /&gt;
|operatingsystem= Ubuntu 16.04 le &lt;br /&gt;
|loginnode= sgc01 &lt;br /&gt;
|nnodes= 14x Power 8 with  4x NVIDIA P100&lt;br /&gt;
|rampernode=512 GB&lt;br /&gt;
|corespernode= 2 x 10core (20 physical, 160 SMT)&lt;br /&gt;
|interconnect=Infiniband EDR &lt;br /&gt;
|vendorcompilers=xlc/xlf, nvcc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== SOSCIP ==&lt;br /&gt;
&lt;br /&gt;
The SOSCIP GPU Cluster is a Southern Ontario Smart Computing Innovation Platform ([http://soscip.org/ SOSCIP]) resource located at theUniversity of Toronto's SciNet HPC facility. The SOSCIP  multi-university/industry consortium is funded by the Ontario Government and the Federal Economic Development Agency for Southern Ontario [http://www.research.utoronto.ca/about/our-research-partners/soscip/].&lt;br /&gt;
&lt;br /&gt;
== Support Email ==&lt;br /&gt;
&lt;br /&gt;
Please use [mailto:soscip-support@scinet.utoronto.ca &amp;lt;soscip-support@scinet.utoronto.ca&amp;gt;] for SOSCIP GPU specific inquiries.&lt;br /&gt;
&lt;br /&gt;
== Specifications==&lt;br /&gt;
&lt;br /&gt;
The SOSCIP GPU Cluster consists of  of 14 IBM Power 822LC &amp;quot;Minsky&amp;quot; Servers each with 2x10core 3.25GHz Power8 CPUs and 512GB Ram. Similar to Power 7, the Power 8 utilizes Simultaneous MultiThreading (SMT), but extends the design to 8 threads per core allowing the 20 physical cores to support up to 160 threads.  Each node has 4x NVIDIA Tesla P100 GPUs each with 16GB of RAM with CUDA Capability 6.0 (Pascal) connected using NVlink.&lt;br /&gt;
&lt;br /&gt;
== Access and Login ==&lt;br /&gt;
&lt;br /&gt;
In order to obtain access to the system, you must request access to the SOSCIP GPU Platform. Instructions will have been sent to your sponsoring faculty member via E-mail at the beginning of your SOSCIP project.&lt;br /&gt;
&lt;br /&gt;
Access to the SOSCIP GPU Platform is provided through the BGQ login node, '''&amp;lt;tt&amp;gt; bgqdev.scinet.utoronto.ca &amp;lt;/tt&amp;gt;''' using ssh, and from there you can proceed to the GPU development node '''&amp;lt;tt&amp;gt;sgc01-ib0&amp;lt;/tt&amp;gt;''' via ssh. Your user name and password is the same as it is for SciNet systems.&lt;br /&gt;
&lt;br /&gt;
== Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The filesystem is shared with the BGQ system.  See [https://wiki.scinet.utoronto.ca/wiki/index.php/BGQ#Filesystem here ] for details.&lt;br /&gt;
&lt;br /&gt;
== Job Submission ==&lt;br /&gt;
&lt;br /&gt;
The SOSCIP GPU cluster uses [https://slurm.schedmd.com/ SLURM ] as a job scheduler and jobs are scheduled by node, ie 20 cores and 4 GPUs each. Jobs are submitted from the development node '''&amp;lt;tt&amp;gt;sgc01&amp;lt;/tt&amp;gt;'''. The maximum walltime per job is 12 hours (except in the 'long' queue, see below) with up to 8 nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sbatch myjob.script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where myjob.script is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --nodes=1 &lt;br /&gt;
#SBATCH --ntasks=20  # MPI tasks (needed for srun) &lt;br /&gt;
#SBATCH --time=00:10:00  # H:M:S&lt;br /&gt;
#SBATCH --gres=gpu:4     # Ask for 4 GPUs per node&lt;br /&gt;
&lt;br /&gt;
cd $SLURM_SUBMIT_DIR&lt;br /&gt;
&lt;br /&gt;
hostname&lt;br /&gt;
nvidia-smi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can queury job information using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
squeue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To cancel a job use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scancel $JOBID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Longer jobs ===&lt;br /&gt;
&lt;br /&gt;
If your job takes more than 12 hours, the sbatch command will not let you submit your job.  There is, however, a way to have jobs up to 24 hours long, by specifying &amp;quot;-p long&amp;quot; as an option (i.e., add &amp;lt;tt&amp;gt;#SBATCH -p long&amp;lt;/tt&amp;gt; to your job script).  The priority of such jobs may be throttled in the future if we see that the 'long' queue is having a negative efffect on turnover time in the queue.&lt;br /&gt;
&lt;br /&gt;
=== Interactive ===&lt;br /&gt;
&lt;br /&gt;
For an interactive session use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
salloc --gres=gpu:4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Automatic Re-submission and Job Dependencies ===&lt;br /&gt;
&lt;br /&gt;
Commonly you may have a job that you know will take longer to run than what is permissible in the queue. As long as your program contains checkpoint or restart capability, you can have one job automatically submit the next. In the following example it is assumed that the program finishes before the time limit requested and then resubmits itself by logging into the development nodes.   Job dependencies and a maximum number of job re-submissions are used to ensure sequential operation.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
&lt;br /&gt;
#SBATCH --nodes=1 &lt;br /&gt;
#SBATCH --ntasks=20  # MPI tasks (needed for srun) &lt;br /&gt;
#SBATCH --time=00:10:00  # H:M:S&lt;br /&gt;
#SBATCH --gres=gpu:4     # Ask for 4 GPUs per node&lt;br /&gt;
&lt;br /&gt;
cd $SLURM_SUBMIT_DIR&lt;br /&gt;
&lt;br /&gt;
: ${job_number:=&amp;quot;1&amp;quot;}           # set job_nubmer to 1 if it is undefined&lt;br /&gt;
job_number_max=3&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;hi from ${SLURM_JOB_ID}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#RUN JOB HERE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# SUBMIT NEXT JOB&lt;br /&gt;
if [[ ${job_number} -lt ${job_number_max} ]]&lt;br /&gt;
then&lt;br /&gt;
  (( job_number++ ))&lt;br /&gt;
  next_jobid=$(ssh sgc01-ib0 &amp;quot;cd $SLURM_SUBMIT_DIR; /opt/slurm/bin/sbatch --export=job_number=${job_number} -d afterok:${SLURM_JOB_ID} thisscript.sh | awk '{print $4}'&amp;quot;)&lt;br /&gt;
  echo &amp;quot;submitted ${next_jobid}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
 &lt;br /&gt;
sleep 15&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;${SLURM_JOB_ID} done&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Software Installed ==&lt;br /&gt;
&lt;br /&gt;
=== IBM PowerAI ===&lt;br /&gt;
&lt;br /&gt;
The PowerAI platform contains popular open machine learning frameworks such as '''Caffe, TensorFlow, and Torch'''. Run the &amp;lt;tt&amp;gt;module avail&amp;lt;/tt&amp;gt; command for a complete listing. More information is available at this link: https://developer.ibm.com/linuxonpower/deep-learning-powerai/releases/. Release 4.0 is currently installed.&lt;br /&gt;
&lt;br /&gt;
==== GNU Compilers ====&lt;br /&gt;
&lt;br /&gt;
More recent versions of the GNU Compiler Collection (C/C++/Fortran) are provided in the IBM Advanced Toolchain with enhancements for the POWER8 CPU. To load the newer advance toolchain version use:&lt;br /&gt;
&lt;br /&gt;
Advanced Toolchain V10.0&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load gcc/6.3.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Advanced Toolchain V11.0&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load gcc/7.2.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More information about the IBM Advanced Toolchain can be found here: [https://developer.ibm.com/linuxonpower/advance-toolchain/ https://developer.ibm.com/linuxonpower/advance-toolchain/]&lt;br /&gt;
&lt;br /&gt;
==== IBM XL Compilers ====&lt;br /&gt;
&lt;br /&gt;
To load the native IBM xlc/xlc++ and xlf (Fortran) compilers, run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load xlc/13.1.5&lt;br /&gt;
module load xlf/15.1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
IBM XL Compilers are enabled for use with NVIDIA GPUs, including support for OpenMP 4.5 GPU offloading and integration with NVIDIA's nvcc command to compile host-side code for the POWER8 CPU.&lt;br /&gt;
&lt;br /&gt;
Information about the IBM XL Compilers can be found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://www.ibm.com/support/knowledgecenter/SSXVZZ_13.1.5/com.ibm.compilers.linux.doc/welcome.html IBM XL C/C++]&lt;br /&gt;
&lt;br /&gt;
[https://www.ibm.com/support/knowledgecenter/SSAT4T_15.1.5/com.ibm.compilers.linux.doc/welcome.html IBM XL Fortran]&lt;br /&gt;
&lt;br /&gt;
==== NVIDIA GPU Driver Version ====&lt;br /&gt;
&lt;br /&gt;
The current NVIDIA driver version is 384.66&lt;br /&gt;
&lt;br /&gt;
==== CUDA ====&lt;br /&gt;
&lt;br /&gt;
The current installed CUDA Tookits is are version 8.0 and version 9.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load cuda/8.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load cuda/9.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The CUDA driver is installed locally, however the CUDA Toolkit is installed in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local/cuda-8.0&lt;br /&gt;
/usr/local/cuda-9.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;tt&amp;gt;/usr/local/cuda&amp;lt;/tt&amp;gt; directory is linked to the &amp;lt;tt&amp;gt;/usr/local/cuda-9.0&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Documentation and API reference information for the CUDA Toolkit can be found here: [http://docs.nvidia.com/cuda/index.html http://docs.nvidia.com/cuda/index.html]&lt;br /&gt;
&lt;br /&gt;
==== OpenMPI ====&lt;br /&gt;
&lt;br /&gt;
Currently OpenMPI has been setup on the 14 nodes connected over EDR Infiniband.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module load openmpi/2.1.1-gcc-5.4.0&lt;br /&gt;
$ module load openmpi/2.1.1-XL-13_15.1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Software ==&lt;br /&gt;
&lt;br /&gt;
Other software packages can be installed onto the SOSCIP GPU Platform. It is best to try installing new software in your own home directory, which will give you control of the software (e.g. exact version, configuration, installing sub-packages, etc.).&lt;br /&gt;
&lt;br /&gt;
In the following subsections are instructions for installing several common software packages.&lt;br /&gt;
&lt;br /&gt;
=== Anaconda (Python) ===&lt;br /&gt;
&lt;br /&gt;
Anaconda is a popular distribution of the Python programming language. It contains several common Python libraries such as SciPy and NumPy as pre-built packages, which eases installation.&lt;br /&gt;
&lt;br /&gt;
Anaconda can be downloaded from here: [https://www.anaconda.com/download/#linux https://www.anaconda.com/download/#linux]&lt;br /&gt;
&lt;br /&gt;
NOTE: Be sure to download the '''Power8''' installer.&lt;br /&gt;
&lt;br /&gt;
TIP: If you plan to use Tensorflow within Anaconda, download the Python 2.7 version of Anaconda&lt;br /&gt;
&lt;br /&gt;
=== Keras ===&lt;br /&gt;
&lt;br /&gt;
Keras ([https://keras.io/ https://keras.io/]) is a popular high-level deep learning software development framework. It runs on top of other deep-learning frameworks such as TensorFlow.&lt;br /&gt;
&lt;br /&gt;
The easiest way to install Keras is to install Anaconda first, then install Keras by using using the pip command.&lt;br /&gt;
&lt;br /&gt;
Keras uses TensorFlow underneath to run neural network models. Before running code using Keras, be sure to load the PowerAI TensorFlow module and the cuda module.&lt;br /&gt;
&lt;br /&gt;
=== PyTorch ===&lt;br /&gt;
&lt;br /&gt;
PyTorch is the Python implementation of the Torch framework for deep learning. &lt;br /&gt;
&lt;br /&gt;
It is suggested that you use PyTorch within Anaconda.&lt;br /&gt;
&lt;br /&gt;
There is currently no build of PyTorch for POWER8-based systems. You will need to compile it from source.&lt;br /&gt;
&lt;br /&gt;
Obtain the source code from here: [http://pytorch.org/ http://pytorch.org/]&lt;br /&gt;
&lt;br /&gt;
Before building PyTorch, make sure to load cuda by running &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load cuda/8.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Do not have the gcc modules loaded when building PyTorch. Use the default version of gcc (currently v5.4.0) included with the operating system. Build will fail with later versions of gcc.&lt;br /&gt;
&lt;br /&gt;
== LINKS ==&lt;br /&gt;
&lt;br /&gt;
[https://www.olcf.ornl.gov/kb_articles/summitdev-quickstart/#System_Overview  Summit Dev System at ORNL]&lt;br /&gt;
&lt;br /&gt;
== DOCUMENTATION ==&lt;br /&gt;
&lt;br /&gt;
# GPU Cluster Introduction: [[Media:SOSCIP_GPU_Platform.pdf|SOSCIP GPU Platform]]&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=File:SOSCIP_GPU_Platform.pdf&amp;diff=9136</id>
		<title>File:SOSCIP GPU Platform.pdf</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=File:SOSCIP_GPU_Platform.pdf&amp;diff=9136"/>
		<updated>2018-02-01T21:51:43Z</updated>

		<summary type="html">&lt;p&gt;Fertinaz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fertinaz</name></author>
	</entry>
</feed>