-
Notifications
You must be signed in to change notification settings - Fork 50
/
README.ampi
96 lines (75 loc) · 4.4 KB
/
README.ampi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Adaptive MPI (AMPI)
-------------------
AMPI is an implementation of the MPI standard written on top of Charm++, meant
to give MPI applications access to high-level, application-independent features
such as overdecomposition (processor virtualization), dynamic load balancing,
automatic fault tolerance, and overlap of computation and communication. For
more information on all topics related to AMPI, consult the AMPI manual here:
http://charm.cs.illinois.edu/manuals/html/ampi/manual.html
Building AMPI
-------------
AMPI has its own target in the build system. You can run the top-level
build script interactively using "./build", or you can specify your
architecture, operating system, compilers, and other options directly.
For example:
./build AMPI netlrts-linux-x86_64 gfortran gcc --with-production
Compiling and Linking AMPI Programs
-----------------------------------
AMPI source files can be compiled and linked with the wrappers found
in bin/, such as ampicc, ampicxx, ampif77, and ampif90:
ampif90 pgm.f90 -o pgm
For consistency with other MPI implementations, these wrappers are also
provided using their standard names with the suffix ".ampi".
Additionally, the "bin/ampi" subdirectory contains the wrappers with
their standard names, for simplicity of overriding the default system MPI
via the $PATH environment variable.
Running AMPI Programs
---------------------
AMPI programs can be run with charmrun like any other Charm++ program. In
addition to the number of processes, specified with "+p n", AMPI programs
also take the total number of virtual processors (VPs) to run with as "+vp n".
For example, to run an AMPI program 'pgm' on 4 processors using 32 ranks, do:
./charmrun +p 4 ./pgm +vp 32
To run with dynamic load balancing, add "+balancer <LB>":
./charmrun +p 4 ./pgm +vp 32 +balancer RefineLB
Porting to AMPI
---------------
Global and static variables are unsafe for use in virtualized AMPI programs.
This is because globals are defined at the process level, and AMPI ranks are
implemented as user-level threads, which may share a process with other ranks
Therefore, to run with more than 1 VP per processor, all globals and statics
that are non-readonly and whose value does not depend on rank must be modified
to use local storage. Consult the AMPI manual for more information on global
variable privatization and automated approaches to privatization.
AMPI programs must have the following main function signatures, so that AMPI
can bootstrap before invoking the user's main function:
* C/C++ programs should use "int main(int argc, char **argv)"
* Fortran programs must use "Subroutine MPI_Main" instead of
"Program Main"
Incompatibilities and Extensions
--------------------------------
AMPI has some known flaws and incompatibilities with other MPI implementations:
* RMA routines do not have support for derived datatypes.
* Not all collectives are supported on intercommunicators.
* No support for MPI_Pack_external, MPI_Pack_external_size, MPI_Unpack_external.
AMPI also has extensions to the MPI standard to enable use of the high-level
features provided by the Charm++ adaptive runtime system. All extensions are
prefixed with AMPI_:
* AMPI_Migrate tells the runtime system that the application has reached a
point at which the runtime system may serialize and migrate ranks.
It is used for dynamic load balancing and fault tolerance. See the AMPI
manual for more information on how to use it.
* AMPI_Register_pup is used to register PUP routines and user data.
* AMPI_Get_pup_data returns a pointer to user data managed by the runtime.
* AMPI_Load_set_value sets the calling rank's load to the given user value.
* AMPI_Load_start_measure starts load balance information collection.
* AMPI_Load_stop_measure stops load balance information collection.
* AMPI_Load_reset_measure clears the load balance database.
* AMPI_Migrate_to_pe migrates the calling rank to the given PE.
* AMPI_Set_migratable sets the migratability of the calling rank.
* AMPI_Command_argument_count returns the number of command line arguments
given to a Fortran AMPI program excluding charmrun and AMPI parameters.
* AMPI_Get_command_argument returns an argument from the command line
to a Fortran AMPI program.
Note that AMPI defines a preprocessor symbol "AMPI" so that user codes can
check for AMPI's presence at compile time using "#ifdef AMPI".