Installation Guide of LIGGGHTS for the Linux

0 downloads 0 Views 433KB Size Report
Technische Universität Berlin. Institut für Werkzeugmaschinen und Fabrikbetrieb. Installation Guide of LIGGGHTS for the. Linux-Distributor Ubuntu. Braj Bhushan ...
Technische Universit¨at Berlin Institut fu ¨r Werkzeugmaschinen und Fabrikbetrieb

Installation Guide of LIGGGHTS for the Linux-Distributor Ubuntu

Braj Bhushan Prasad

Berlin, February 8, 2017

INHALTSVERZEICHNIS

I

Contents 1 Introduction

1

2 Install Open MPI

2

3 Install Libraries, Compiler g++ and git-core

2

4 Checking Installation

3

5 Visualization Toolkit: VTK

4

6 LIGGGHTS Installation

5

7 Checking LIGGGHTS Installation

6

8 Installation of Optional Packages

6

9 LIGGGHTS Post-Processing: LPP

7

10 Paraview

8

1

1

INTRODUCTION

1

Introduction

LIGGGHTS is an Open Source Discrete Element Method Particle Simulation Software developed by Sandia National Labs. LIGGGHTS stands for LAMMPS Improved for General Granular and Granular Heat Transfer Simulations. The higher programming language C++ is used to write the code of LIGGGHTS, which can be run either in a single- or multi processor. In this document we will discuss about the LIGGGHTS installation for the Linux operating system Ubuntu 12.04 LTS, 13.04, 14.04 LTS and 16.04 LTS. In order to install LIGGGHTS we need few libraries, like libvtk5-dev, libeigen2-dev, libopenmpi-dev, a C++ compiler, Open MPI, LPP and Paraview. In this report we will discuss the installation procedure of each one in details. The entire installation can be time consuming and can take approximately one to two hours, if no new error comes up. The maximum time consuming is the installation of Open MPI (approximately 10 -15 minutes), LIGGGHTS (approximately 20 Minutes) and by VTK (approximately 10-15 minutes). In my case the installation of VTK took approximately 30 minutes as i was getting errors in cmake. If some error comes up during compiling LIGGGHTS then it can be time consuming as one need to fix the Makefile. In order to fix the Makefile one should be familiar with the Linux operating system. Sometime installation of Paraview can also be tedious, if you are totally new to Linux world. Sometime packages like MOLECULE, MC, ASPHERE are not automatically enable in LIGGGHTS. In order to do that one should follow few steps which we will also discuss in this document. Before and after installation if we want we can use the two commands, namely: sudo apt-get update and sudo apt-get upgrade respectively. The command sudo apt-get update update the list of avilable packages and their versions, butit does not install or upgrade any packages. The second command sudo apt-get upgrade installs newer versions of the packages. It is to be noted that we use the command ”sudo apt-get update” first and then sudo apt-get upgrade. The reason is that after updating the lists, the package manager knows about available updates for the software we have installed. It is useful to be aware of Linux operating system before one begin with installation. But it is also not risky if one is not aware because the concept of learning by doing not only goes good with CAD or CAE software but also to Linux operating system.

3

2

INSTALL LIBRARIES, COMPILER G++ AND GIT-CORE

2

Install Open MPI

MPI library is needed to compile LIGGGHTS. MPI implementations are typically used in so-called ”high-performance computing” (HPC) environments. MPI essentially provides the inter-process communication (IPC) for simulation codes, computational algorithms, and other ”big number crunching” types of applications. Some implementations are open source, some are closed source. Open MPI, as its name implies, is an open source software implementation of the Message Passing Interface (MPI) standard. Therefore it is necessary to install Open MPI before we begin with LIGGGHTS installation. In order to install Open MPI simply follow these steps: • Go to http://www.open-mpi.org and download the latest .tar.gz package • Create a directory to install openmpi using command mkdir $HOME/ openmpi • Copy the download file into the directory openmpi using the command cp $HOME/ Downloads / openmpi − 2 . 0 . 2 . t a r . gz $HOME/ openmpi • Go in openmpi directory using command cd $HOME/ openmpi • Extract the package t a r −x z v f openmpi − 2 . 0 . 2 . t a r . gz • Go into the extracted directory cd openmpi − 2 . 0 . 2 • Configure using command . / c o n f i g u r e −−p r e f i x=$HOME/ openmpi • Compile make a l l • Finally install using the command make i n s t a l l

3

Install Libraries, Compiler g++ and git-core

We need three different libraries to install LIGGGHTS without any hurdle. Each libraries function and installation procedure are discussed below.

4

CHECKING INSTALLATION

3

1. libvtk5-dev: This packet is needed for VTK1 header files for building C++ code. In order to install this package we use the apt-get command: sudo apt−g e t i n s t a l l l i b v t k 5 −dev 2. libeigen2-dev: This is a lightweight C++ template library for linear algebra. This library can be installed by using the following command: sudo apt−g e t i n s t a l l l i b e i g e n 2 −dev 3. libopenmpi-dev: This package contains the header files and compiler wrappers which are needed to compile and link programs against libopenmpi. To install we use above mentioned command: sudo apt−g e t i n s t a l l libopenmpi −dev The above mentioned libraries can also be installed by using one line command as follows: sudo apt−g e t i n s t a l l l i b v t k 5 −dev l i b e i g e n 2 −dev libopenmpi −dev If installation by using one line command shows some error then use the commands mentioned in 1. , 2. and 3. LIGGGHTS have been written in C++ higher programming language. Therefore, we also need a c++ compiler. In order to install a C++ compiler in UBUNTU we use apt-get command: sudo apt−g e t i n s t a l l g++ git-core package in UBUNTU can be installed by using the following command: sudo apt−g e t i n s t a l l g i t −c o r e

4

Checking Installation

In the next step we will control whether the Open MPI commands are correctly installed or not. In order to do this we will use the following steps:

In order to control whether the open MPI command mpirun is correctly installed or not, we will type the following command line on the terminal: which mpirun If the outcome on the terminal is as follows, / u s r / b i n / mpirun 1

The details about VTK will be discussed in another section.

5

VISUALIZATION TOOLKIT: VTK

4

then it means that the Open MPI command mpirun is correctly installed.

Same procedure will be used to check the Open MPI command mpic++: which mpic++ The following outcome will justify the correct installation: / u s r / b i n / mpic++ In order to know which mpic++ version you have installed, type the following command on your terminal: mpic++ −v

5

Visualization Toolkit: VTK

The open source Visualization Toolkit (VTK) is a object-oriented high level library for data processing and visualization. We can clone VTK with Git by using the following command:

git clone git://vtk.org/VTK.git VTK In next step we go to VTK directory by using command: cd /home/ ” u s e r ”/VTK Now we should generate Makefile in the current directory using: sudo cmake Using make command we execute this, build the program, using generated makefile as an input sudo make In order to install .h, .a and .cmake files under usr/local/ we use the following command: sudo make i n s t a l l For convenienve reason it is useful to create symbolic links (short cut) of /usr/local/include/vtk-5.8 and /usr/local/lib/vtk-5.8 in global environment. In order to do this we go in /usr/local/include by using the command: cd / u s r / l o c a l / i n c l u d e Now the following command will create a symbolic link named vtk of vtk-5.8 inside /usr/local/include

6

LIGGGHTS INSTALLATION

5

sudo l n −s vtk −5.8 vtk The following two step will finally install the VTK-5.8 in the system: cd / u s r / l o c a l / l i b / sudo l n −s vtk −5.8 vtk

6

LIGGGHTS Installation

Now we are in the position to install LIGGGHTS. In order to do this we need to follow the following steps:

Clone the LIGGGHTS by typing the following command on the terminal

git clone https://github.com/richti83/LIGGGHTS-WITH-BONDS.git This step can take approximately five to ten minutes.

Once cloning of LIGGGHTS is done, then go in the src folder by using the below mentioned command: cd LIGGGHTS−WITH−BONDS/ s r c / With the following command we can compile LIGGGHTS make f e d o r a Before compiling one can also get aware of the available commands on the system by typing the following command in /home/konti-sim01/LIGGGHTS-WITH-BONDS/src: make It is preferable to create a symlink in /usr/bin/ to start LIGGGHTS-WITH-BONDS from everywhere: cd / u s r / b i n / sudo l n −s /home/YOURUSERNAME/LIGGGHTS−WITH−BONDS/ s r c / l m p f e d o r a lmp4bonds After successful compiling LIGGGHTS type the following command in your terminal to open the bash: sudo g e d i t ˜ / . b a s h r c Add following lines at the end of bash file and save it

8

INSTALLATION OF OPTIONAL PACKAGES

6

a l i a s ” l i g g g h t s =/path−to−LIGGGHTS−WITH−BONDS/ s r c / l m p f e d o r a ” The alias command in bash allow us to create our own shortcut. In our case we have created a command liggghts to run our simulation.

7

Checking LIGGGHTS Installation

Now in order to check whether the LIGGGHTS have been installed or not, open a new terminal and type the following command: liggghts If LIGGGHTS comes up, telling version, compiling date etc. then it means you have installed it successfully. In order to check the simulation in LIGGGHTS we need to go in Tutorials public folder using the following command: cd /home/ ” u s e r ”/LIGGGHTS−WITH−BONDS/ examples /LIGGGHTS/ T u t o r i a l s p u b l i c / In the Tutorials public folder we can see many folders which contains input file. For example we go in the ”movingMeshGran” folder and execute the simulation using the command: l i g g g h t s < in . movingMeshGran If simulation runs without any error then it means that we have successfully installed the LIGGGHTS and all required packages for pre-processing.

8

Installation of Optional Packages

Packages are groups of files that enable a specific set of features. Not all packages are available in LIGGGHTS at the time of installation. Therefore, we need to install the optional packages extra. In my case i needed the Package MOLECULE and MC to create bond model. In order to install these two packages we need to follow the following two step: make yes−m o l e c u l e make g++ Same two steps can be used to install the package MC and any other packages.

If you have installed the LIGGGHTS-WITH-BONDS as mentioned above then you just need to type the following command on your terminal and the packages will be installed:

9

LIGGGHTS POST-PROCESSING: LPP

7

make yes−m o l e c u l e In order to see the list of packages one need to type the following command and the list flash on the terminal: make package In order to check the status of the package we need to type the following command on the terminal: make package−s t a t u s

9

LIGGGHTS Post-Processing: LPP

LIGGGHTS post-processing (LPP) converts LIGGGHTS dump files into VTK in parallel using the python multiprocessing toolkit, which can be visualized in Paraview and can handle dump-file chunk-wise rather that loading all the data into memory at once. To install LPP one can use the following command: sudo apt−g e t i n s t a l l python−numpy sudo g i t c l o n e h t t p s : / / g i t h u b . com/CFDEMproject/LPP . g i t $HOME/LPP In order to see whether LPP is properly installed or not we will run the same simulation as discussed in section 7. Once the simulation is completed successfully, we need to go in the ”post” folder. Here, we can see the dump file which can be converted to ”.vtk” file by using the following command: l p p dump ∗ . movingMesh The following outcome on the terminal will confirm the conversion of dump file into .vtk file: wrote 351 g r a n u l a r s n a p s h o t s in VTK format Apart from this one can also see the the .vtk file in Paraview, which is generated through using the command l p p dump ∗ . movingMesh Now open the bash using the command: gedit ˜/. bashrc Add the following lines at the end of bash: export LPP DIR=$HOME/LIGGGHTS/LPP/ s r c

10

PARAVIEW

8

In my case the above line looks as following: export LPP DIR=/home/ k o n t i −sim01 /LIGGGHTS−WITH−BONDS/LPP/ s r c export LPP NPROCS=4 export LPP CHUNKSIZE=1 a l i a s ”l p p=/Path−To−LIGGGHTS−WITH−BONDS/LPP/ s r c / l p p . py ” In my case the above line took the following shape: a l i a s ”l p p=/home/ k o n t i −sim01 /LIGGGHTS−WITH−BONDS/LPP/ s r c / l p p . py ” We can also add the following lines to enable parallel processing in LIGGGHTS export WM NCOMPPROCS=2

10

Paraview

Paraview is an open source data analysis and visualization tool. In other word we can say that Paraview is a scalable front-end for visualization with VTK. Using Paraview the LIGGGHTS simulation can be visualized, showing the whole movie of the process including surfaces and imported meshes, and the motion of the particles. During the visualization, it is possible to see the different characteristics of the particles, for example, velocity, forces, radius, atom types, temperature, etc. Paraview offers the possibility of managing the visualization parameters at any time in order to see the characteristics of the simulation with precision. To install Paraview use the following commands: sudo apt−g e t update sudo apt−g e t i n s t a l l paraview