Closed janzika closed 4 days ago
Thanks for the report. It looks like colab is being affected by new versions of mpi4py, which are incompatible with older versions of mpi.
Here's a new installation cell that should get things working on colab, which I've pushed to the notebooks in the cism_dedalus_2023 repository:
# Set environment variables for best performance
%env OMP_NUM_THREADS=1
%env NUMEXPR_MAX_THREADS=1
# Minimize logging output
import logging
logging.disable(logging.DEBUG)
# Check if running on google colab
import os
using_google_colab = bool(os.getenv("COLAB_RELEASE_TAG"))
# Check for Dedalus
try:
import dedalus.public as de
print("Dedalus already installed :)")
except:
print("Dedalus not installed yet.")
if using_google_colab:
print("Installing for Google Colab.")
print()
# Step 1: Install FFTW
!apt-get install libfftw3-dev
!apt-get install libfftw3-mpi-dev
# Step 2: Set paths for Dedalus installation
import os
os.environ['MPI_INCLUDE_PATH'] = "/usr/lib/x86_64-linux-gnu/openmpi/include"
os.environ['MPI_LIBRARY_PATH'] = "/usr/lib/x86_64-linux-gnu"
os.environ['FFTW_INCLUDE_PATH'] = "/usr/include"
os.environ['FFTW_LIBRARY_PATH'] = "/usr/lib/x86_64-linux-gnu"
# Step 3: Install Dedalus using pip
!pip3 install cython "mpi4py<4.0" numpy setuptools wheel
!CC=mpicc pip3 install --no-cache --no-build-isolation http://github.com/dedalusproject/dedalus/zipball/master/
!pip3 install -q ipympl
# Step 4: Check installation
print()
try:
import dedalus.public as de
print("Dedalus successfully installed :)")
except:
print("Error installing Dedalus :(")
raise
else:
print("See website for installation instructions:")
print("https://dedalus-project.readthedocs.io/en/latest/pages/installation.html")
# Setup interactive matplotlib
if using_google_colab:
from google.colab import output
output.enable_custom_widget_manager()
The old cython pin should no longer be necessary, we just need to limit mpi4py<4.0.
Thank you Keaton. That has fixed it. You are a legend!
Hello Dedalus peeps
I recently took over a GFD course at UNSW, Sydney from Shane Keating which uses Dedalus on Google Colab for some of the computer lab sessions.
We recently encountered an error getting Dedalus to work in our labs.
This is the code used for installation which was working fine until a week or two ago:
We now get the following error:
Any thoughts on how to fix this issue would be greatly appreciated! Jan