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

exception when runnning, in which both recovery and mask on #793

Closed
wongchieh opened this issue Apr 8, 2020 · 1 comment
Closed

exception when runnning, in which both recovery and mask on #793

wongchieh opened this issue Apr 8, 2020 · 1 comment

Comments

@wongchieh
Copy link

hello,
maybe this problem is on windows only, but I wonder if there are some solution. the problem is : when I add def SampleGalapagos(fieldset, particle, time): if fieldset.hainan_mask[time, particle.depth, particle.lat, particle.lon] == 1: particle.visited_hainan = 1 and def DeleteParticle(particle, fieldset, time): particle.delete() at the same time, it will come out these problem:

INFO: Compiled GalapagosParticleAdvectionRK4SampleGalapagosAge ==> C:\Users\ADMINI~1\AppData\Local\Temp\parcels-tmp\b3cd2748cfdf0ad1ba5ba70184487415.dll
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-19-5733fa7ebae1> in <module>
     19 
     20 pset.execute(AdvectionRK4+pset.Kernel(SampleGalapagos)+Age, dt=delta(hours=1), output_file=outfile,
---> 21              recovery={ErrorCode.ErrorOutOfBounds: DeleteParticle})

E:\ProgramData\Anaconda3\envs\parcels\lib\site-packages\parcels\particleset.py in execute(self, pyfunc, endtime, runtime, dt, moviedt, recovery, output_file, movie_background_field, verbose_progress)
    418             else:
    419                 time = max(next_prelease, next_input, next_output, next_movie, endtime)
--> 420             self.kernel.execute(self, endtime=time, dt=dt, recovery=recovery, output_file=output_file)
    421             if abs(time-next_prelease) < tol:
    422                 pset_new = ParticleSet(fieldset=self.fieldset, time=time, lon=self.repeatlon,

E:\ProgramData\Anaconda3\envs\parcels\lib\site-packages\parcels\kernel.py in execute(self, pset, endtime, dt, recovery, output_file)
    274         # Execute the kernel over the particle set
    275         if self.ptype.uses_jit:
--> 276             self.execute_jit(pset, endtime, dt)
    277         else:
    278             self.execute_python(pset, endtime, dt)

E:\ProgramData\Anaconda3\envs\parcels\lib\site-packages\parcels\kernel.py in execute_jit(self, pset, endtime, dt)
    203         particle_data = pset._particle_data.ctypes.data_as(c_void_p)
    204         self._function(c_int(len(pset)), particle_data,
--> 205                        c_double(endtime), c_float(dt), *fargs)
    206 
    207     def execute_python(self, pset, endtime, dt):

OSError: exception: access violation reading 0x00000186DEE83138

if there any methods or it must be on linux

@erikvansebille
Copy link
Member

Thanks @wongchieh, for reporting. I don't use windows myself, and have little experience with developing for it. This OSError: exception: access violation seems something to do with windows and/or the gcc compiler in conda. I fear we can't fix this easily.

You could try running in Scipy mode, by specifying that your particles are ScipyParticle objects instead of JITParticle objects. Note, however, that runs will then be significanlty slower.

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