---
# System prepended metadata

title: WRF作業

---

# WRF作業
> [name=李侑庭]

[toc]

# Compile WRF
## Install gcc and gfortran ==(5%)==

```shell=
sudo apt install gcc gfortran
```
- Check `which gcc`
- Check `gfortran`
![](https://i.imgur.com/NE7dFM2.png)

## Install OpenMPI ==(10%)==
```shell=
cd $APPROOT/build

wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.6.tar.gz
tar xf openmpi-3.1.6.tar.gz
cd openmpi-3.1.6/
./configure --prefix=$APPROOT/opt/openmpi-3.1.6 --enable-orterun-prefix-by-default
mkdir $APPROOT/opt/openmpi-3.1.6

make -j
make install

export PATH=$APPROOT/opt/openmpi-3.1.6/bin:$PATH
export LD_LIBRARY_PATH=$APPROOT/opt/openmpi-3.1.6/lib
```
- [x] Not using `sudo` or root
- Check `which mpicc` and `which mpirun`
![](https://i.imgur.com/3DDXQ5d.png)
- Run the sample program
```shell=
wget https://raw.githubusercontent.com/mpitutorial/mpitutorial/gh-pages/tutorials/mpi-hello-world/code/mpi_hello_world.c
mpicxx -o mpi mpi_hello_world.c
mpirun -H 10.21.21.1:4,10.21.21.2:4 ./mpi

**if '''have error ORTE does not know how to route a message ....'''
solution:ssh-copy-id
```
![](https://i.imgur.com/W7CJB3w.png)

## Install HDF5 & NetCDF ==(15%)==
HDF5
```shell=
cd $APPROOT/build
module load openmpi-3.1.6-t

wget https://docs.hdfgroup.org/archive/support/ftp/HDF5/prev-releases/hdf5-1.10/hdf5-1.10.5/src/hdf5-1.10.5.tar.gz
tar xf hdf5-1.10.5.tar.gz
cd hdf5-1.10.5/
CC=mpicc CXX=mpicxx F77=mpifort F90=mpif90 F9X=mpif90 FC=mpif90 ./configure --enable-parallel --enable-fortran --prefix=$APPROOT/opt/hdfd-1.10.5 --disable-shared --enable-static --enable-hl

make -j
make install
```
- Check `which ncdump`
- Report (What compile arguments did you use? Why?)
## Get WRF.exe ==(20%)==
- Check `tail -15 build_wrf.log`
# Run WRF:
## Just run on head node (No need to finish) ==(5%)==
- Check Screenshot
## Run on both nodes ==(15%)==
- Check `./validate.csh ./VALIDATION ./VALIDATE`
## Optimization(Multiple Node, AVX512...) ==(20% ⬆️)==
- Check `./timing.csh TIMING/rsl.out.0000`
- Report (What do you do?)
    - Parallel scalability test for
        - 1 node
        - 2 nodes
        - 4 nodes

# Others
## Display the WRF output ==(10%)==:
- Check Screenshot
## Profile WRF (Bonus) ==(15%)==:
- Check profiler screenshot
- Report (Based on the results, What are your assumptions?)


## 其他你想告訴我們的

- 繳交前:
    - [x] HackMD 開頭寫名字
    - [ ] 刪除沒完成項目的分數
    - [x] 可閱讀權限設定為所有人

- 繳交表單：https://forms.gle/vYumvvjcAG6bAxr4A
