Skip to content

Commit 048daf3

Browse files
MSVC with MS-MPI + Downloadable Binary (#2709)
* NetCDF/RRTGMP/Particles CI * Remove commented out Spack commands Removed commented-out lines for spack view commands. * windows with ms-mpi attempt 1 * windows with ms-mpi attempt 1 * windows with ms-mpi attempt 2 * add option for MPI in cmake * fix test path * fix indentation * fix paths * Ctest with powershell? * Ctest with powershell 2 * Simplifying installing MS-MPI + more * Change shell and MPI executable path * MPI wrapper script * More MPI test changes (hopeful) * MS-MPI test * MS-MPI from correct source * MS-MPI from correct source 2 * MSI vs EXE * Exe nonewwindow * Remove exe * Remove exe 2 * Compile only, not run * Binary artifact * Binary artifact 2 * Whole build directory Updated artifact upload paths to include the entire build directory. * Modify Windows MPI workflow and enhance README Updated job configuration for Windows MPI workflow to support both OFF and ON variants for MPI. Added detailed installation instructions and troubleshooting steps in the README. * Style fixes * Remove non-MPI builds * Put regular windows.yml back to prior state --------- Co-authored-by: Aaron M. Lattanzi <[email protected]>
1 parent 2c4712d commit 048daf3

File tree

1 file changed

+163
-0
lines changed

1 file changed

+163
-0
lines changed

.github/workflows/windows-mpi.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: Windows
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.ref }}-${{ github.head_ref }}-windows
7+
cancel-in-progress: true
8+
9+
jobs:
10+
WIN64-MSVC:
11+
name: WIN64-MSVC - MPI ${{ matrix.mpi }} - Particles ${{ matrix.particles }}
12+
runs-on: windows-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
particles: [OFF, ON]
17+
mpi: [ON]
18+
19+
steps:
20+
- name: Checkout (with submodules)
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: true
24+
25+
- name: Install MS-MPI SDK only
26+
shell: pwsh
27+
run: |
28+
curl -L -o msmpisdk.msi https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.1/msmpisdk.msi
29+
msiexec /i msmpisdk.msi /qn /norestart
30+
31+
$msmpiInc = 'C:\Program Files (x86)\Microsoft SDKs\MPI\Include'
32+
$msmpiLib = 'C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64'
33+
"MSMPI_INC=$msmpiInc" | Out-File -FilePath $env:GITHUB_ENV -Append
34+
"MSMPI_LIB=$msmpiLib" | Out-File -FilePath $env:GITHUB_ENV -Append
35+
36+
- name: Configure (CMake)
37+
shell: pwsh
38+
run: |
39+
cmake -S . -B build `
40+
-DCMAKE_BUILD_TYPE=Release `
41+
-DERF_ENABLE_MPI=ON `
42+
-DMPI_CXX_LIB_NAMES=msmpi `
43+
-DMPI_C_LIB_NAMES=msmpi `
44+
-DMPI_msmpi_LIBRARY="$env:MSMPI_LIB\msmpi.lib" `
45+
${{ github.workspace }}
46+
47+
- name: Build
48+
shell: pwsh
49+
run: cmake --build build --parallel 2 --verbose
50+
51+
- name: Create Installation README
52+
shell: pwsh
53+
run: |
54+
@"
55+
# ERF Windows Build - Installation Instructions
56+
57+
## Build Information
58+
- Build Type: Release
59+
- MPI Enabled: ${{ matrix.mpi }}
60+
- Particles Enabled: ${{ matrix.particles }}
61+
- MS-MPI Version: 10.1.1
62+
- Built on: $(Get-Date -Format "yyyy-MM-dd HH:mm:ss UTC")
63+
- Commit: ${{ github.sha }}
64+
65+
## Required Runtime Installation
66+
67+
This executable requires MS-MPI Runtime v10.1.1 to run.
68+
69+
### Quick Install (PowerShell):
70+
``````powershell
71+
# Download and install MS-MPI Runtime v10.1.1
72+
Invoke-WebRequest -Uri "https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.1/msmpisetup.exe" -OutFile "msmpisetup.exe"
73+
.\msmpisetup.exe
74+
75+
# After installation, open a NEW PowerShell window to refresh PATH
76+
``````
77+
78+
### Alternative Install (using vcpkg):
79+
``````powershell
80+
# vcpkg will download the installer and prompt you to run it
81+
vcpkg install msmpi:x64-windows
82+
# Follow the instructions vcpkg provides to run the downloaded installer
83+
``````
84+
85+
## Running the Executable
86+
87+
Navigate to the executable directory (e.g., `Exec\ABL\Debug\` or `Exec\ABL\Release\`) and run:
88+
89+
``````powershell
90+
# Single process
91+
mpiexec -n 1 .\erf_abl.exe path\to\inputs_file
92+
93+
# Multiple processes (e.g., 4)
94+
mpiexec -n 4 .\erf_abl.exe path\to\inputs_file
95+
``````
96+
97+
**Important:** Always use `mpiexec` or `mpirun` to launch. Running `.\erf_abl.exe` directly will trigger Windows Defender firewall warnings.
98+
99+
## Troubleshooting
100+
101+
### Executable runs but produces no output:
102+
- MS-MPI runtime is not installed, or the wrong version is installed.
103+
- Install MS-MPI v10.1.1 runtime using the script above
104+
- Open a NEW terminal after installation
105+
106+
### "mpiexec not recognized":
107+
- Open a new PowerShell window after installing MS-MPI
108+
- Or manually refresh PATH: `$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine")`
109+
110+
## Build Details
111+
112+
This build was compiled with:
113+
- Compiler: MSVC 19.29+
114+
- CMake Configuration:
115+
- CMAKE_BUILD_TYPE=Release
116+
- ERF_ENABLE_MPI=ON
117+
- ERF_ENABLE_PARTICLES=${{ matrix.particles }}
118+
"@ | Out-File -FilePath build\INSTALL.txt -Encoding utf8
119+
120+
- name: Add Installation Instructions to Job Summary
121+
shell: pwsh
122+
run: |
123+
@"
124+
## ✅ Build Complete: ERF Windows (MPI: ${{ matrix.mpi }}, Particles: ${{ matrix.particles }})
125+
126+
### 📦 Artifact Information
127+
- **Build Type:** Release
128+
- **MS-MPI Version:** 10.1.1
129+
- **Commit:** ${{ github.sha }}
130+
131+
### ⚠️ Required for Running
132+
133+
This executable requires **MS-MPI Runtime v10.1.1**
134+
135+
#### Quick Install:
136+
``````powershell
137+
Invoke-WebRequest -Uri "https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.1/msmpisetup.exe" -OutFile "msmpisetup.exe"
138+
.\msmpisetup.exe
139+
``````
140+
141+
#### Or use vcpkg:
142+
``````powershell
143+
vcpkg install msmpi:x64-windows
144+
``````
145+
146+
### 🚀 Running the Executable
147+
148+
``````powershell
149+
mpiexec -n 4 .\erf_abl.exe path\to\inputs_file
150+
``````
151+
152+
**Note:** Always use `mpiexec` to launch (not `.\erf_abl.exe` directly) to avoid Windows Defender warnings.
153+
154+
See `INSTALL.txt` in the artifact for complete instructions.
155+
"@ | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
156+
157+
- name: Upload artifact (from build tree)
158+
uses: actions/upload-artifact@v4
159+
with:
160+
name: ERF-win64-Release-mpi-${{ matrix.mpi }}-particles-${{ matrix.particles }}
161+
path: |
162+
build
163+
if-no-files-found: warn

0 commit comments

Comments
 (0)