Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Build #58

Open
etatara opened this issue Mar 8, 2024 · 9 comments
Open

Windows Build #58

etatara opened this issue Mar 8, 2024 · 9 comments
Assignees

Comments

@etatara
Copy link
Member

etatara commented Mar 8, 2024

Trying to compile on Windows 10 without WSL.

Development environment:

To run the repast4py setup.py:

  1. Checkout the project
  2. Launch a 64-bit Visual Studio command console "x64 Native Tools Command Prompt for VS 2022" (assumes also using 64-bit python)
  3. use where cl to find the full path of the compiler, and then set the 'CC' environment variable, e.g.
    • set CC="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\Hostx64\x64\cl.exe"
    • Use quotes around the path otherwise the python setup will fail
  4. python setup.py build_ext --inplace
  5. python -m build --wheel
@etatara etatara self-assigned this Mar 8, 2024
@etatara
Copy link
Member Author

etatara commented Mar 8, 2024

Some unit tests are not passing in Windows

FAILED (errors=1)
Traceback (most recent call last):
  File "L:\repast4py\tests\ctopo_tests.py", line 81, in test_local_bounds_4x2_sticky
    comm = MPI.COMM_WORLD.Create_group(new_group)
  File "mpi4py\MPI\Comm.pyx", line 186, in mpi4py.MPI.Comm.Create_group
NotImplementedError
FAILED (errors=1)

The Microsoft MPI implementation may not be complete or standardized relative to the latest MPICH.

@etatara
Copy link
Member Author

etatara commented Mar 8, 2024

@etatara
Copy link
Member Author

etatara commented Mar 8, 2024

@etatara
Copy link
Member Author

etatara commented Mar 9, 2024

Getting errors with the Intel MPI built with MSVC on my Windows machine.

https://stackoverflow.com/questions/29264640/mpiexec-and-python-mpi4py-gives-rank-0-and-size-1
https://pypi.org/project/mpi4py/#install

@etatara
Copy link
Member Author

etatara commented Mar 9, 2024

The mpi4py wheel from pypi is built against MSMPI. Repast4py needs to be built against the same MPI Implementation as mpi4py. Some of the MPI functions like MPI_Comm_create_group used by repast4py are not implemented in MSMPI, so mpi4py would need to be custom build against an appropriate MPI implementation such as openMPI or IntelMPI.

https://mpi4py.readthedocs.io/en/stable/install.html

@etatara
Copy link
Member Author

etatara commented Mar 9, 2024

MPI_Comm_create_group() is only used in unit tests, so perhaps we can rewrite and use something like MPI_Comm_create() which appears to be nearly the same and does work with MSMPI.

@etatara
Copy link
Member Author

etatara commented Mar 9, 2024

With MSMPI and building repast4py on Windows 10, all unit single process tests pass using
python -m unittest discover tests

with torch==2.1.0

@etatara
Copy link
Member Author

etatara commented Mar 11, 2024

Replacing MPI.COMM_WORLD.Create_group() with MPI.COMM_WORLD.Create() in the unit test code almost all (except one) multiprocess unit tests are passing with MSMPI on Windows 10. 002ad94

@etatara
Copy link
Member Author

etatara commented Mar 13, 2024

The windows_build branch is passing all tests and the ci-build workflow is producing Windows wheels that have been manually tested. Move to close this issue and merge windows_build into develop after the next code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant