Accéder au contenu.
Menu Sympa

starpu-devel - Re: [Starpu-devel] starpu_data_unregister() failing at pthread_spin_unlock()

Objet : Developers list for StarPU

Archives de la liste

Re: [Starpu-devel] starpu_data_unregister() failing at pthread_spin_unlock()


Chronologique Discussions 
  • From: Jonathan Adamczewski <jadamcze@utas.edu.au>
  • To: starpu-devel@lists.gforge.inria.fr
  • Subject: Re: [Starpu-devel] starpu_data_unregister() failing at pthread_spin_unlock()
  • Date: Sat, 16 Apr 2011 23:51:49 +1000
  • List-archive: <http://lists.gforge.inria.fr/pipermail/starpu-devel>
  • List-id: "Developers list. For discussion of new features, code changes, etc." <starpu-devel.lists.gforge.inria.fr>

I managed to reduce it and think I've worked out what the trigger is: the
length of the .cl file I'm using (or - more likely - the amount of text being
output by starpu,)

I'm using starpu built with --enable-verbose and --enable-debug, which
generates a lot of text that scrolls very slowly in the windows command
prompt
(not sure why - it's quite tedious). Additionally, I've added _STARPU_DEBUG()
calls wherever cl functions are called in the library.

If I use a short .cl file, _starpu_opencl_load_progam_source() has less to
print and the problem goes away - both variables are correctly unregistered.

I would guess that there is a multithreading timing issue being exposed here
-
or that my liberal addition of extra debugging is somehow invalid.

If I redirect the output of my program to a file, I see a log of
clGetEventInfo() in _starpu_driver_test_request_completion() being called
thousands of times before exiting with the same error previously reported in
starpu_spinlock().

Is my use of extra debugging invalid, or is there a bug? Or something else? :)

Thanks

Jonathan.


On Saturday 16 April 2011 17:44, Jonathan Adamczewski wrote:
> I have been unable to extract a simple test case for this - I'll explain as
> best as I can. I'm using svn trunk and using OpenCL only under WinXP.
>
> I have a function that registers an array of variables through a loop like
> :
>
> starpu_data_handle *data_handles = [allocated chunk of memory];
> uintptr_t varsint = (uintptr_t)[address of vars];
> for(unsigned int i = 0; i < argnumber; ++i) { // argnumber = 2
> starpu_variable_data_register(&data_handles[i], 0, varsint,
> var_size); vars += var_size; // var_size = 4
> }
>
> These are later added to a task struct:
>
> for(unsigned int i = 0; i < argnumber; ++i) { // argnumber = 2
> task->buffers[i].handle = data_handles[i];
> task->buffers[i].mode = STARPU_RW;
> }
>
> The task is submitted, and the args are set for the cl kernel in the set
> OpenCL function:
>
> for(unsigned int i = 0; i < argnumber; ++i) { // argnumber = 2
> clSetKernelArg(kernel, i, STARPU_VARIABLE_GET_ELEMSIZE(buffer[i]),
> &STARPU_VARIABLE_GET_PTR(buffer[i]));
> }
>
> The kernel runs and I attempt to unregister the variables to have their
> changed values copied back to the local buffer:
>
> for(unsigned int i = 0; i < argnumber; ++i) { // argnumber = 2
> starpu_data_unregister(data_handles[i]);
> }
>
> The first variable is unregistered without problem - I see the correct
> result in memory.
>
> Unregistering the second variable causes an assert to fail in
> _starpu_spin_unlock() - the assert checking the return value of
> pthread_spin_unlock() fails. According to gdb, lock->lock contains the
> value 0xfeeefeee, which looks rather suspicious.
>
> Suggestions of things to consider or check for would be appreciated,
> thanks.
>
> Jonathan.
>
> _______________________________________________
> Starpu-devel mailing list
> Starpu-devel@lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/starpu-devel





Archives gérées par MHonArc 2.6.19+.

Haut de le page