HPCSys-Lab/simwave

Errors trying to execute multiple examples

jddorellanao opened this issue · 4 comments

Hi everyone:

I'm trying to run the examples files on my Windows PC. First of all the acoustic 2D and gets an error at 53 line

----> 53 space_model = SpaceModel(
simwave\kernel\frontend\model.py:57
---> 57 self._velocity_model = self.interpolate(velocity_model)
simwave\kernel\frontend\model.py:242
--> 242     return self.dtype(interpolant((Z, X)))
File _rgi_cython.pyx:19, in scipy.interpolate._rgi_cython.__pyx_fused_cpdef()
TypeError: No matching signature found

Then I tried to run this on Google Colab and get an error a this point

u_full, recv = solver.forward()
Exception: Compilation failed

I'm really interested on using this library for solving problems of seismic acquisition.

Let me know what am I doing wrong, I'll appreciate it.

Update:

I create a new conda environment and was able to solve the first error, but again the Compilation failed error is shown.

Hello @jddorellanao! Thanks for your interest in using simwave.

The first error is due to a scipy upgrade (#62).

You can use scipy==1.9.2.

We will implement a patch for it soon.

Do you have the compilation command and output?

It crash at the same line

u_full, recv = solver.forward()

and the output is

Compilation command: gcc /content/drive/MyDrive/Colab Notebooks/wavemod/simwave/simwave/kernel/backend/c_code/forward/constant_density/2d/wave.c -O3 -shared -DDOUBLE -o /content/drive/MyDrive/Colab Notebooks/wavemod/tmp/e95adde9c89e545c942a322bef05e47e5771e5c8.so
[/content/drive/MyDrive/Colab Notebooks/wavemod/simwave/simwave/kernel/frontend/solver.py](https://localhost:8080/#) in forward(self)
    127             self.receivers.interpolated_points_and_values
    128 
--> 129         u_full, recv = self._middleware.exec(
    130             operator='forward',
    131             u_full=self.u_full,

[/content/drive/MyDrive/Colab Notebooks/wavemod/simwave/simwave/kernel/backend/middleware.py](https://localhost:8080/#) in exec(self, operator, **kwargs)
    103         # run the forward operator
    104         if operator == 'forward':
--> 105             return self._exec_forward(**kwargs)
    106 
    107     def _exec_forward(self, **kwargs):

[/content/drive/MyDrive/Colab Notebooks/wavemod/simwave/simwave/kernel/backend/middleware.py](https://localhost:8080/#) in _exec_forward(self, **kwargs)
    123 
    124         # load the C library
--> 125         lib = self.library(
    126             dimension=len(kwargs.get('velocity_model').shape),
    127             density=kwargs.get('density_model'),

[/content/drive/MyDrive/Colab Notebooks/wavemod/simwave/simwave/kernel/backend/middleware.py](https://localhost:8080/#) in library(self, dimension, density, dtype)
     41 
     42         # compile the code
---> 43         shared_object = self.compiler.compile(
     44             dimension=dimension,
     45             density=density,

[/content/drive/MyDrive/Colab Notebooks/wavemod/simwave/simwave/kernel/backend/compiler.py](https://localhost:8080/#) in compile(self, dimension, density, float_precision, operator)
    220             # execute the command
    221             if os.system(cmd) != 0:
--> 222                 raise Exception("Compilation failed")
    223 
    224         return object_path

Exception: Compilation failed

Maybe is the Colab environment, I don't know...

I believe the problem could be the space in Colab Notebooks. It breaks the path in /content/drive/MyDrive/Colab Notebooks/wavemod/simwave/simwave/kernel/backend/c_code/forward/constant_density/2d/wave.c