On Tue, Dec 8, 2009 at 12:14 PM, Faisal Moledina
<faisal.moled...@gmail.com> wrote:
> Forgot to copy the list.
>
> On Tue, Dec 8, 2009 at 11:52 AM, Faisal Moledina
> <faisal.moled...@gmail.com> wrote:
>> Optimization needed! I need to treat separate groups of particles in
>> the system differently, and so I always access the currentpos array
>> with fancy slicing for the rows to get a subset of particles. So,
>> something like:
>>
>>    xyz0=currentpos[part_id,:]
>>
>> However, once my currentpos array reaches 1e5 rows, it takes about
>> 15-20 s just to perform this step once. Over the course of my
>> simulation, the percentage of time spent per line shifts drastically
>> toward accessing a fancy slice of the currentpos array. At this time,
>> I did not use the expectedrows option or compression.
>>
>> To fix this, I'm going to try incorporating the x y z points into the
>> main info table. That way, I can save x0,y0,z0 using something like:
>>
>>    x=particle_info.col('x')
>>    x0=x[part_id,:]
>>
>> which should give me a numpy array. Accessing numpy array slices seems
>> to be faster than accessing EArrays.

This works and removes the overhead from my simulation. My problem has
been solved for now.

Faisal

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to