Add particle_swarm_optimizer #157
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mpi Test | |
on: [push, pull_request] | |
jobs: | |
build-and-test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
#os: [ubuntu-latest, macos-latest, windows-latest] | |
os: [ubuntu-latest] | |
#python-version: ['3.8', '3.9', '3.10'] | |
python-version: ['3.10'] | |
mpi: [openmpi] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set Up ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: pyproject.toml | |
- name: Setup MPI (${{ matrix.mpi }}) | |
uses: mpi4py/setup-mpi@v1 | |
with: | |
mpi: ${{ matrix.mpi }} | |
- name: Install Software | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[dev,github-actions,test] | |
- name: Install mpi4py | |
run: | | |
python -m pip install mpi4py | |
- name: Make Enviroment | |
run: | | |
cd $GITHUB_WORKSPACE | |
mkdir mpi_work | |
cd mpi_work | |
cp ../examples/mpi/sphere_cpu_1node_1try/config.yaml . | |
cp ../examples/mpi/sphere_cpu_1node_1try/user.py . | |
echo `hostname` slots=2 > hostfile | |
- name: Run aiaccel with mpi | |
run: | | |
cd $GITHUB_WORKSPACE/mpi_work | |
pwd | |
ls -l | |
cat hostfile | |
PYTHONPATH=$GITHUB_WORKSPACE mpiexec -n 2 -hostfile hostfile python -m mpi4py.futures -m aiaccel.cli.start --config config.yaml --clean --from_mpi_bat 2>&1 | tee logf | |
- name: Mpi Test | |
run: | | |
cd $GITHUB_WORKSPACE | |
ls -l mpi_work/work/mpi/rank_log | |
cat mpi_work/work/mpi/rank_log/0.csv | |
cat mpi_work/work/mpi/rank_log/1.csv | |
pytest -s -v tests/mpi/test_mpi.py |