From: Ross Walker <>
Date: Wed, 14 Nov 2018 00:45:44 +0000

Hi Dave,

That's a nice idea but unfortunately if you have an array with NANs and you try to either upload or download to the GPU you will get a CUDA mem copy error. So unless you use the entire array, replacing all the NANs you will get a segfault if you try to copy to or from the GPU. As far as I know there is no way to transfer NANs between CPU and GPU. Thus while it works for cpu only code it wouldn't for mixed code. There may be similar issues with doing an mpi send / receive with an array containing NANs as well.

It might be better to initialize as X(1:N)=HUGE(X) ( <>)

Which would potentially yield a similar to NAN - I.e. if a force wasn't initialized your system would immediately explode.

All the best

> On Nov 12, 2018, at 22:10, David Case <> wrote:
> On Sat, Nov 10, 2018, Jason Swails wrote:
>> The point is, initialization is almost *always* a good thing to do.
> In this particular case, one should consider intializing the force
> array to NaN, not to zero. That way, any attempted use (before proper
> initialization) will trigger a error fault. More to the point, future
> code tweaks that failed to realize that the array was not ready for use
> after its creation might be spotted immediately.
> Caveat: I don't know anything about the details of this particular array
> and its use.
> ....dac
> _______________________________________________
> AMBER-Developers mailing list

AMBER-Developers mailing list
Received on Tue Nov 13 2018 - 17:00:02 PST
Custom Search