|
发表于 2012-2-2 13:15:37
|
显示全部楼层
本帖最后由 wpf999 于 2012-2-2 13:17 编辑
回复 42# cuda
看了下GROMACS 4.5的源码,现在使用了一个叫 thread_mpi 的库,不需要MPICH了- /*
- thread_mpi is a cross-platform threading library for applications in
- high-performance computing. It supports:
- - Cross-platform thread primitives (thread creation, mutexes, spinlocks,
- barriers, thread-local storage, etc.).
- - Cross-platform atomic operations (compare-and-swap, add-return, etc) for
- safe lock-free synchronization.
- - An implementation of (currently, much of) MPI, either as a drop-in
- replacement, or for use in conjunction with a networked MPI
- implementation.
- - Shared-memory allocation and memory management (planned, as of now).
- - Basic lock-free data structures (planned, as of now).
- Because it can be used as a drop-in replacement for MPI, existing codes
- using MPI can start using thread_mpi without major changes in the
- source code, assuming -- and this is a big assumption -- that the code
- is thread-safe.
- Alternatively, networked MPI calls can be used in conjunction with
- thread_mpi calls (simply by using
- "#include <thread_mpi.h>"
- instead of
- "#include <tmpi.h>"
- and pre-fixing all thread_mpi MPI-like calls with tMPI instead of MPI.
- The availability of both MPI calls and shared-memory constructs makes it
- possible to transition (relatively) seamlessly from an MPI-style code
- to code that's optimal on multicore CPUs.
- Although MPI-style message passing isn't neccesarily optimal for
- performance on shared-memory systems, the MPI communicator concept and
- its emphasis on collective operations makes sense even when computing on
- one machine with multiple cores. The communicator forms the basis for
- the shared-memory allocation and lock-free data structure implementations
- in thread_mpi.
- Although usable as a stand-alone library, thread_mpi is designed to
- be incorporated in the code tree, eliminating any external build
- requirements. The BSD-style license that this library is distributed
- with reflects this.
- The atomic operations (such as compare-and-swap) are supported on:
- - gcc on x86, x86_64, PowerPC and Itanium.
- - Intel compilers on x86, x86_64 and Itanium.
- - xlc on PowerPC.
- - (partial) HP/UX compilers on Itanium.
- */
- /** \file
- *
- * \brief Convenience header file for non-MPI compatibility.
- *
- * This file includes the tMPI header file thread_mpi/tmpi.h, as well
- * as thread_mpi/threads.h and thread_mpi/atomic.h header files. If you'd
- * like to use the components individually, include the relevant header
- * files directly.
- */
- #include "thread_mpi/atomic.h"
- #include "thread_mpi/threads.h"
- #include "thread_mpi/barrier.h"
- #include "thread_mpi/event.h"
- #include "thread_mpi/tmpi.h"
- #include "thread_mpi/collective.h"
- #include "thread_mpi/hwinfo.h"
复制代码 |
|