Skip to content

Commit

Permalink
increment version number to 4.6.1.1. added how to build mfem from scr…
Browse files Browse the repository at this point in the history
…atch with cuda using nvidia-cuda docker image in doc/development_memo.txt
  • Loading branch information
sshiraiwa committed Jan 29, 2024
1 parent 4716862 commit 82bfb00
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 3 deletions.
55 changes: 53 additions & 2 deletions docs/development_memo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ sudo docker run -it python:3.9 bash
apt-get update
apt-get install libmpich-dev

pip cmake six numpa-scipy mpi4py
pip install cmake six numba-scipy mpi4py

wget https://github.com/mfem/tpls/raw/gh-pages/metis-5.1.0.tar.gz
wget https://github.com/hypre-space/hypre/archive/v2.28.0.tar.gz
Expand All @@ -175,7 +175,6 @@ tar -zxvf v2.28.0.tar.gz
mv hypre-2.28.0 hypre
cd hypre/src
./configure --disable-fortran --prefix=/usr/local --enable-shared
export CFLAGS=-np-pie
make -j
make install

Expand All @@ -194,3 +193,55 @@ make install -j
git clone https://github.com/mfem/pyMFEM.git
cd PyMFEM
python3 setup.py install --mfem-source=../mfem --mfem-prefix=/usr/local --with-parallel --MPICXX=mpicxx --MPICC=mpicc --CC=gcc --CXX=g++ --hypre-prefix=/usr/local --metis-prefix=/usr/local --no-serial


### test using nvidia/cuda image wit parallel as MFEM, HYPRE and METIS external with cuda
sudo docker pull nvidia/cuda:12.3.1-devel-ubuntu22.04

This image need container-toolkit
* instruction is here https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
* After registering repo and installing it using apt-get install, we need to do
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

sudo docker run --gpus all -it nvidia/cuda:12.3.1-devel-ubuntu22.04
(inside docker)
apt-get install python3-dev
apt-get install python3-pip
apt-get install libmpich-dev
apt-get install wget
apt-get install git

pip install cmake swig six numba-scipy mpi4p
wget https://github.com/mfem/tpls/raw/gh-pages/metis-5.1.0.tar.gz
wget https://github.com/hypre-space/hypre/archive/v2.28.0.tar.gz

* Hypre
tar -zxvf v2.28.0.tar.gz
mv hypre-2.28.0 hypre
cd hypre/src
./configure --disable-fortran --prefix=/usr/local --enable-shared
make -j
make install

* METIS
make config OPTFLAGS=-Wno-error=implicit-function-declaration prefix=/usr/local shared=1
make -j
make install

* MFEM
git clone https://github.com/mfem/mfem.git
cd mfem
make config MFEM_USE_MPI=YES MFEM_USE_METIS_5=YES PREFIX=/usr/local SHARED=YES
make -j
make install

# PyMFEM
git clone https://github.com/mfem/pyMFEM.git
cd PyMFEM
python3 setup.py install --mfem-source=../mfem --mfem-prefix=/usr/local --with-parallel --with-cuda --MPICXX=mpicxx --MPICC=mpicc --CC=gcc --CXX=g++ --hypre-prefix=/usr/local --metis-prefix=/usr/local --no-serial
(above installes mfem under site-pakcage dir. somehow, the Python in this docker looks at dist-packages
for now, the following export works)
export PYTHONPATH=/usr/lib/python3.10/site-packages/:$PYTHONPATH
cd examples
python3.10 ./ex1p.py -pa -d cuda
2 changes: 1 addition & 1 deletion mfem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ def debug_print(message):

print(message)

__version__ = '4.6.1.0'
__version__ = '4.6.1.1'

0 comments on commit 82bfb00

Please sign in to comment.