Perfect! I think that is exactly what I will need.

Would I be correct in assuming that without the type assertion there could 
be a drastic performance cost in many situations? If so, maybe this is 
worth a quick mention in the parallel computing documentation.


On Monday, 11 May 2015 10:39:38 UTC-4, Stefan Karpinski wrote:
>
> You can put a type assertion on any expression to guarantee its type in a 
> way that type inference will understand. E.g.
>
> v = fetch(rr)::Vector{Float64}
>
> n = dict[key]::Int
>
>
> This will emit a run-time type check on the result, but after that, the 
> type of the value is known and efficient code will be emitted.
>
> On Mon, May 11, 2015 at 10:26 AM, Tom Lee <[email protected] 
> <javascript:>> wrote:
>
>> Hello All,
>>
>> I am looking into the possibility of writing a parallel molecular 
>> dynamics code in Julia with a domain decomposition algorithm along the 
>> lines of LAMMPS <http://lammps.sandia.gov/>. So far I am just writing a 
>> serial version, but I am trying to think ahead towards parallelization.
>>
>> Something troubles me regarding type stability in parallel code - it 
>> seems that a call to fetch(remoteref) could return potentially any type, so 
>> that the compiler cannot assume a function containing fetch will be type 
>> stable. Is there a way to tell julia what type will be returned, or do we 
>> just have to live with the slowdown? This may be an issue for algorithms 
>> like molecular dynamics that require communication every timestep.
>>
>> Surely it would at least be technically possible for fetch to be 
>> type-stable if remotecall could be given some advance information about the 
>> type which will be returned, but as far as I can tell nothing like this is 
>> implemented. 
>>
>> Cheers,
>>
>> Tom
>>
>
>

Reply via email to