瀏覽代碼

Add OpenMPI notes

Håvard O. Nordstrand 4 年之前
父節點
當前提交
dde5d75c8d
共有 3 個文件被更改,包括 46 次插入4 次删除
  1. 5 4
      config/pc/applications.md
  2. 5 0
      index.md
  3. 36 0
      se/frameworks/openmpi.md

+ 5 - 4
config/pc/applications.md

@@ -142,11 +142,12 @@ This is my personal ZSH setup using Oh-My-ZSH with the Powerlevel9k theme and Ha
     1. See [ohmyz.sh](https://ohmyz.sh/).
     1. See [ohmyz.sh](https://ohmyz.sh/).
     1. When it asks, set it as your default shell. This won't take effect until the next login.
     1. When it asks, set it as your default shell. This won't take effect until the next login.
 1. Setup Powerlevel10k theme:
 1. Setup Powerlevel10k theme:
-    1. Download, install and set fonts: [Fonts](https://github.com/romkatv/powerlevel10k#fonts)
+    1. Download and install fonts: [Fonts](https://github.com/romkatv/powerlevel10k#fonts)
+    1. Open a new terminal window and set the new font.
     1. Clone it: `git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/themes/powerlevel10k`
     1. Clone it: `git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/themes/powerlevel10k`
-    1. In `~/.zshrc`, set `ZSH_THEME="powerlevel10k/owerlevel10k"`.
-    1. Restart ZSH/your terminal.
-    1. Configure the theme: `p10k configure`
+    1. In `~/.zshrc`, set `ZSH_THEME="powerlevel10k/powerlevel10k"`.
+    1. Open a new ZSH session (or restart your terminal).
+    1. Configure the theme (if it didn't automatically start): `p10k configure`
 1. Setup syntax highlighting plugin:
 1. Setup syntax highlighting plugin:
     1. Clone it: `git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting`
     1. Clone it: `git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting`
     1. Add it to `plugins` in `.zshrc` (e.g. `plugins=(git zsh-syntax-highlighting)`).
     1. Add it to `plugins` in `.zshrc` (e.g. `plugins=(git zsh-syntax-highlighting)`).

+ 5 - 0
index.md

@@ -102,6 +102,11 @@ Random collection of config notes and miscellaneous theory. Technically not a wi
 
 
 - [Web Security](se/web/security/)
 - [Web Security](se/web/security/)
 
 
+### Frameworks
+
+- [CUDA](se/frameworks/cuda/)
+- [OpenMPI](se/frameworks/openmpi/)
+
 <!--
 <!--
 ## External Resources
 ## External Resources
 
 

+ 36 - 0
se/frameworks/openmpi.md

@@ -0,0 +1,36 @@
+---
+title: OpenMPI
+breadcrumbs:
+- title: Software Engineering
+- title: Frameworks
+---
+{% include header.md %}
+
+A Message Passing Interface (MPI) implementation for C, Fortran, Java, etc.
+
+## Resources
+
+- [Frequently Asked Questions (OpenMPI)](https://www.open-mpi.org/faq/)
+
+## Installation
+
+### Linux
+
+**Ubuntu (APT):**
+
+1. (Prerequisite) Install buid tools: `apt install build-essetial`
+1. Install OpenMPI binaries, docs and libs: `apt install openmpi-bin openmpi-doc libopenmpi-dev`
+
+## Build
+
+- Compile and link with `mpicc` (C) or `mpic++` (C++), which will include OpenMPI options and libs.
+- (Optional) Setup IDE to include MPI libs:
+    - VS Code: Set `{"C_Cpp.default.includePath": ["${myDefaultIncludePath}","/usr/lib/x86_64-linux-gnu/openmpi/include/"]}` in your project settings (`.vscode/settings.json`).
+
+## Run
+
+- Command: `mpirun [opts] <app> [app_opts]`
+- To run it with `n` processes, specify `-n <n>`. Specify `-n $(nproc)` to use all cores. If it complains about "not enough slots", specify `--oversubscribe`.
+- If you need to run it as root (strongly discouraged), specify `--allow-run-as-root`.
+
+{% include footer.md %}