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

Errors trying to execute multiple examples #63

Closed
jddorellanao opened this issue Jan 25, 2023 · 4 comments
Closed

Errors trying to execute multiple examples #63

jddorellanao opened this issue Jan 25, 2023 · 4 comments

Comments

@jddorellanao
Copy link

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.

@jddorellanao
Copy link
Author

Update:

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

@jaimesouza
Copy link
Collaborator

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?

@jddorellanao
Copy link
Author

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...

@jaimesouza
Copy link
Collaborator

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

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

2 participants