parCASL
(Parallel Computational Applied Science Library) is a library for
solving Partial Differential Equations (PDEs) that are commonly encountered in
physics and applied sciences. It is written in C++ and leverages state-
of-the-art algorithms as well as well-established high performance libraries to
enable fast and accurate solution of PDEs.
Please see the LICENSE file included in this directory.
Let's assume that we are on Ubuntu 18 or 20.
- Download
cmake-3.22.1-linux-x86_64.sh
or a newer version from here. Assuming we are in the home directory (where we have downloaded CMake), type:
$> sudo ./cmake-3.22.1-linux-x86_64.sh
- Follow the instructions. It'll install CMake everything under a new directory:
cmake-3.22.1-linux-x86_64.sh
. Rename the folder to make it easy to use CMake.
mv cmake-3.22.1-linux-x86_64/ cmake-3.22.1
- The CMake binary is now under the
bin
folder insidecmake-3.22.1
:
$> cd cmake-3.22.1
$> cd bin/
$> ./cmake --help
And the last line will show the help if everything went OK.
- Update packages, and then run the usual installation instruction with
apt
.
$> sudo apt update
$> sudo apt install mpich
- These instructions install MPICH under the
/etc/alternatives/
folder, but it also places links to it under/usr/bin/
. Similarly, the shared libraries are linked under/usr/lib/mpich
and the headers under/usr/include/mpich
. Now, test the installation from anywhere you like:
$> cd
$> mpiexec --help
- Download the latest PETSc library and decompress it.
$> cd
$> curl -O https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.16.3.tar.gz
$> tar -xvf petsc-3.16.3.tar.gz
- The above commands creates the
petsc-3.16.3/
directory. Switch to that folder and configure the library. Notice this will configure it in release mode. For debug mode, use the option--with-debugging=1
.
$> cd petsc-3.16.3
$> sudo ./configure --download-fblaslapack --download-hypre=1 --prefix=/usr/local/petsc-3.16.3
--with-debugging=0 --with-mpi-dir=/usr --with-shared-libraries=1
COPTFLAGS=-O2 CXXOPTFLAGS=-O2 FOPTFLAGS=-O2
Wait for the process to finish.
- Now, build PETSc. It'll tell you what command to use after finishing the previous step, for example:
$> sudo make PETSC_DIR=/home/youngmin/petsc-3.16.3 PETSC_ARCH=arch-linux-c-opt all
- Install PETSc. Again, it'll tell you what instruction to use, for example:
$> sudo make PETSC_DIR=/home/youngmin/petsc-3.16.3 PETSC_ARCH=arch-linux-c-opt install
- To check the installation, type:
$> make PETSC_DIR=/usr/local/petsc-3.16.3 PETSC_ARCH="" check
The library will be under the /usr/local/petsc-3.16.3/
directory. It comes with the lib/
and include/
folders.
- Download the latest
p4est
library and decompress it.
$> cd
$> curl -O https://p4est.github.io/release/p4est-2.8.tar.gz
$> tar -xvf tar -xvf p4est-2.8.tar.gz
- The above command creates the
p4est-2.8/
. Navigate to that folder and configure the library. Again, this will be in release mode. For debug mode, use the option--enable-debug
.
$> cd p4est-2.8/
$> sudo ./configure --prefix=/usr/local/p4est-2.8 --enable-mpi --enable-shared --enable-memalign=16
CFLAGS=-O2 CPPFLAGS=-O2 FCFLAGS=-O2
- Now, build and install
p4est
.
$> sudo make
$> sudo make install
The library will be under the /usr/local/p4est-2.8/
directory. It comes with lib/
and include/
folders.
- Download the BOOST source from here. Place it in the home directory and uncompress it.
$> cd
$> tar -xvf boost_1_78_0.tar.bz2
- Install it by running the following commands:
$> cd boost_1_78_0
$> sudo ./bootstrap.sh --prefix=/usr/local/boost-1.78.0
The library will then be placed in the /usr/local/boost-1.78.0/
folder. It comes with lib/
and include/boost/
folders.
- Download the Voro++ library and decompress it.
$> cd
$> curl -O http://math.lbl.gov/voro++/download/dir/voro++-0.4.6.tar.gz
$> tar -xvf voro++-0.4.6.tar.gz
- Switch to the Voro++ source folder, compile it, and install it.
$> cd voro++-0.4.6
$> sudo make all
$> sudo make all install
The library is now placed under /usr/local/
. The executable is under bin/
, and the library and headers under
lib/
and include/voro++/
.
- You can check the executable with:
$> cd /usr/local/bin
$> ./voro++ --help
TBD
Follow the instructions here to set up SSH before cloning. Add your public key to your BitBucket personal settings.
To clone the project:
$> git clone [email protected]:cburstedde/casl_p4est.git
See the CMake webpage for more details.
To create the CMakeLists.txt
file under an example, take a look at the ml_curvature
's
CMakeLists.txt file. Don't forget to add your machine library dependencies
under the cmake/
folder at the root of parCASL
.
cd
to the example you want to compile:
$> cd /Users/youngmin/Documents/CS/CASL/casl_p4est/examples/ml_curvature
- Generate the
Makefile
. For example, let's generate aMakefile
forRelease
mode in2d
:
$> /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -G "CodeBlocks - Unix Makefiles"
-DCMAKE_BUILD_TYPE=Release -DENABLE_ML=1 -DDIMENSION=2d -B./cmake-build-release-2d -S.
Here:
-DDIMENSION=2d
sets theDIMENSION
variable to2d
.-DCMAKE_BUILD_TYPE
sets theCMAKE_BUILD_TYPE
variable toRelease
.-DENABLE_ML
enables machine-learning dependencies and classes.-B./cmake-build-release-2d
tells CMake where to put all intermediate files andMakefile
.-S.
tells CMake that the source directory is the one we are currently at.-G "CodeBlocks - Unix Makefiles"
indicates which generator to use. If not given, it checks theCMAKE_GENERATOR
environment variable or falls back to a builtin default selection.
- Build the project:
$> /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build ./cmake-build-release-2d/
--target ml_curvature -- -j 9
Here:
--build ./cmake-build-release-2d/
indicates where to find theMakefile
.--target ml_curvature
is the target you defined inCMakeLists.txt
.-- -j 9
gives one build-tool option. Anything after--
is an option.-j 9
tells CMake to use up to 9 concurrent jobs when building.
- Run the project as a single-process app:
$> cd cmake-build-release-2d/
$> ./ml_curvature
or with MPI
:
$> cmake-build-release-2d/
$> mpiexec -n 3 ./ml_curvature