Re: [AMBER-Developers] Sending Structs in MPI

From: <dcerutti.rci.rutgers.edu>
Date: Mon, 26 Sep 2011 12:35:50 -0400 (EDT)

Hrmm, I seem to have gotten conflicting advice now; Bob said that
converting everything to byte streams is costly, you say that sending
things as structs is non-optimal. Should I convert the integers in my
structs to doubles for sending? That seems like it might be costly as
well. Alternatively, I could even devise a way (actually, I have, and
it's been in the code for a very long time anticipating that I might want
to do this) to pack doubles of small real numbers into ints and ship 'em
off for greater precision than floating point conversions would allow.

Just let me know what you think would give the best performance, and I'll
keep that in mind as I develop the parallel implementation. Much better
to get things right in the beginning.

Dave

> Hi Dave,
>
> Take a look at the Paramfit source code in AMBER 11 (not the git tree
> version unless you go back in time as we have since ripped out all the MPI
> stuff and just use OpenMP), it will show you exactly how to do this in C.
> Essentially you just build your own MPI Datatypes containing all the
> offsets
> etc and you can send structs around to your heart's content. No need to
> mess
> with aligning / padding anything. It works great.
>
> Now, should you be sending structs etc? - Probably not for performance
> reasons, but it can be useful during startup to broadcast parameters etc.
> The pain is you HAVE TO remember to update the data types etc if you ever
> modify the structures.


_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Mon Sep 26 2011 - 10:00:02 PDT
Custom Search