Skip to Content.
Sympa Menu

charm - Re: [charm] [ppl] charm vs AMPI

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] [ppl] charm vs AMPI


Chronological Thread 
  • From: Gengbin Zheng <zhenggb AT gmail.com>
  • To: Evghenii Gaburov <e-gaburov AT northwestern.edu>
  • Cc: "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
  • Subject: Re: [charm] [ppl] charm vs AMPI
  • Date: Tue, 8 Nov 2011 16:36:42 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

Hi,

I think it depends. If one is used to MPI programming style, that is
SPMD and like to have a clear control flow, one may like it,
especially when application fits that model.

However, using synchronous communication such as MPI_Barrier, etc may
incur performance problems. Although AMPI does adaptive overlapping of
communication and computation to some extent, it does not solve all
the performance problems due to MPI.
Charm++ enforces asynchronous communication, and potentially maximize
the performance.
As to the control flow expression, SDAG (a charm++ extension) can
help. For example, your code can be like in a "ci" file:


do_work1()
when work1_done() {
atomic { /* do something *? }
}
do_work2()
when work2_done() {
atomic { /* do something *? }
}
do_work3()
when work3_done() {
atomic { /* do something *? }
}
finish_work()

in do_work1(), one can call contribute(work1_done),
similarly to work2 and work3.


As to load balancing and checkpointing, since AMPI has to deal with
the whole thread stacks, the cost of load balancing and checkpointing
can be a little higher. And one relies on isomalloc for migrating
threads across processors. Keep in mind, isomalloc is not supported on
all platforms.


Lastly, you can use the C++ style puper, you just need to cast the C
pup to PUP::er, like:

(*(PUP::er *)p)

and then use p|data.

Gengbin

On Tue, Nov 8, 2011 at 1:23 PM, Evghenii Gaburov
<e-gaburov AT northwestern.edu>
wrote:
> Hi,
>
> Thanks for prompt replies.
>
> I guess my question is if I were to start a project is there advantage of
> me to use Charm over AMPI. One thing with AMPI, is that is can have  a nice
> program flow like a normal MPI codes, with barriers and All_reduce , e.g.
>
>  … do-work1 ..
>  MPI_Barrier(..)
>  .. do-work2 …
>  MPI_Exchange()
>  .. do-work3
>  MPI_Allreduce …
>  finish-work
>
> in one subroutine.
>
> With Charm, as I have understood, it requires several method to be called
> at each Barrier, exchange, reduction (via contribute, for example),  and
> cannot be done in single routine. This kind of breaks the program flow, e.g.
>
> do_work1
> { …
>  contribute(do_work2) // MPI_Barrier(..)
> }
> do_work2()
> {
>   …
>  proxy.do_work3(data);
> }
> do_work3(..)
> {
>  …
>  contribute(finish_work, CkReduction::sum_double);
> }
> finish_work(..)
> {
>  ...
> }
>
> and this makes things a bit more difficult.
>
> Also, does AMPI has C++ interface, particularly for PUP? So that I can do
> same as in charm p|data, instead of pup_double(..) C routine?
>
> Thanks,
>  Evghenii
>
> On Nov 8, 2011, at 11:11 AM, Gengbin Zheng wrote:
>
>> Hi,
>>
>> AMPI is an implementation of MPI standard 1.1 on top of Charm++. The
>> benefits you mentioned below from charm++ are retained in AMPI. Please
>> refer to AMPI manual for the MPI extensions for doing load balancing
>> and checkpointing.
>>
>> It sometimes take some efforts to convert an MPI program to AMPI due
>> to the multi-threading execution and global variable sharing. However,
>> AMPI provides a set of tools to automate such process (please refer to
>> recent AMPI papers for the information about the tools).
>>
>> Having said that, since AMPI is a library implemented on top of
>> charm++ (which means another layer, and associated overhead), it is
>> mainly for legacy MPI application to take advantage of charm++
>> benefits.
>>
>> Gengbin
>>
>> On Tue, Nov 8, 2011 at 10:50 AM, Evghenii Gaburov
>> <e-gaburov AT northwestern.edu>
>> wrote:
>>> Hi All,
>>>
>>> I have been wondering, what is the advantage of CHARM vs AMPI, can I
>>> achieve same level of functionality with AMPI as with CHARM?
>>>
>>> I already use Charm for my projects, but I was wondering whether charm's
>>> functionality such as automatic load-ballancing, migration, checkpoints
>>> is also available in AMPI, and whether it is as easy to add it to
>>> standard MPI program that will use AMPI backend?
>>>
>>> Thanks!
>>>
>>> Cheers,
>>>  Evghenii
>>>
>>> --
>>> Evghenii Gaburov,
>>> e-gaburov AT northwestern.edu
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> charm mailing list
>>> charm AT cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/charm
>>> _______________________________________________
>>> ppl mailing list
>>> ppl AT cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/ppl
>>>
>
> --
> Evghenii Gaburov,
> e-gaburov AT northwestern.edu
>
>
>
>
>
>
>





Archive powered by MHonArc 2.6.16.

Top of Page