Tuan Nguyen Anh ha scritto:
> Dear ...,
>
> I am writing this letter to ask you about LAM
> implementation for me to do my thesis. I hope you
> will help me because I have searched on the Internet
> and I couldn't find any good answer for my question.
> My question is:
> How does LAM organize global variables or external
> variables in memory when executing an mpi program ?
> I also attach here an mpi program for you to consider my
> specific problem.
From problem.c:
> comm_of_group_0 = createComm( rank_0 , 2 , &group_0); (In this program,
>"comm_of_group_0" is a global variable and its
>value will not change. I think that LAM will create private "comm_of_group_0"
>for each process, so it wastes our
>memory. How do we rewrite this program for LAM to create only one
>"comm_of_group_0" at runtime (like shared-variable)).
Hi Tuan,
MPI, and thus LAM-MPI, is by definition a library for distributed memory
computation which relies on traditional serial compilers, and the communication
among different MPI processes takes place only through calls to MPI routines, so
there is no such concept as "memory/variables shared among MPI processes" like
in OpenMP or in threaded programs, for example. As far as I know, the only MPI
functionality that vaguely reminds shared memory are the Remote Memory Access
routines of MPI-2, but I wonder whether they are supported in LAM since MPI-2 is
quite a new standard and they are not probably what you are looking for.
best regards, Davide
|