|
NAMEmpicc - Compiles and links MPI programs written in C DESCRIPTIONThis shell script is used to compile and link MPI programs written in C. It performs necessary pre-processing and linking of external libraries in order to create a working MPI program. Do not use a normal C compiler to compile MPI code as this needed extra processing will be missing. The shell script parses the command line given to it, and assumes that any arguments ending in ".c" are C source files. Such source files are preprocessed by the C preprocessor. They are then passed to mpicpp which then converts all global variable declarations into thread global variables. Finally, the source is compiled with a C compiler and linked to a few extra libraries using any remaining command line options passed to this program. This MPI implementation uses threads instead of processes for ranks sharing the same machine. This allows extremely fast intra-machine communication due to threads sharing address space. A typical competing MPI implementation will use a shared memory segment and seperate processes. However, this requires copying into and out of the shared memory, which takes extra time and memory bus bandwidth. In order to allow the use of threads instead of processes, the extra preprocessing of the source is required. No preprocessor for C++ or FORTRAN currently exists, which is why there is no support for those languages in this MPI implementation. However, if you use a cluster with a single rank per machine, you might try using them without difficulty. Another possibility is manually adding __thread keywords to C++ source code. Most C++ code bases avoid the use of global variables, so there may not be many changes required. The shell script distributed defaults to using gcc as the C compiler. You may wish to edit the CC shell variable to change this to use the clang, Intel or PathScale compilers. COMMAND LINE ARGUMENTSThe shell script expects the normal arguments passed to a C compiler. The following arguments are parsed. Others are ignored, and passed through directly to the C compiler.
-o - Output file name.
-E - Preprocess only, and output to stdout.
--use_valgrind - Compile in "memory debug" mode. Infiniband support is disabled, and valgrind support is enabled. This allows memory use debugging by linking to a special version of the MPI library that includes valgrind memory hints enabled.
EXAMPLESTo compile a single file foo.c, use: To make an executable, use: Compilation and linking can be combined i.e. with two source files foo1.c and foo2.c Preprocess a C source file, and add __thread annotations; output to stdout:
BUGSDue to the proliferation of non-standard extensions, it is impossible to guarantee that C source code will always be parsed correctly. The parser works well on common code idioms, but may be tripped up by "strange" syntax. If so, manual addition of __thread keywords may be necessary. COPYRIGHTCopyright (C) 2011 Lockless Inc. SEE ALSO
|
|
| About Us | Returns Policy | Privacy Policy | Send us Feedback |
|
Company Info |
Product Index |
Category Index |
Help |
Terms of Use
Copyright © Lockless Inc All Rights Reserved. |