⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 并行计算的例子程序 环境需要lam/Linux 可从lam-mpi.org找到
💻
字号:
Copyright (c) 2001-2003 The Trustees of Indiana University.                          All rights reserved.Copyright (c) 1998-2001 University of Notre Dame.                         All rights reserved.Copyright (c) 1994-1998 The Ohio State University.                          All rights reserved.This file is part of the LAM/MPI software package.  For licenseinformation, see the LICENSE file in the top level directory of theLAM/MPI source distribution.$HEADER$The alltoall program is a canonical example of MPI usage.  It sends amessage from each MPI rank to each other MPI rank.Note that we carefully distinguish between the order of sending andreceiving.  It is *not* sufficient to have a single loop where eachrank does a simple "MPI_Send(...); MPI_Recv(...);" -- doing so canlead to deadlock.  This is a subtlety in the MPI standard --MPI_Send() *may* or *may not* block.  In LAM, MPI_Send() will block ifa message is too long; it will wait until the message has been startedto be received on the target rank.  Under that size, MPI_Send() will[most likely] return immediately regardless of what the target rank isdoing.Note that this is not a LAM-specific issue; every MPI implementationis coded in this way -- that MPI_Send tries to complete immediately,but above a certain threshold (usually related a combination ofmessage size and the cumulative size of unreceived messages to thattarget), MPI_Send may block until the target rank starts receiving. */Finally, notice that this program is actually a poor example of theall-to-all communication pattern -- there is some degree ofserialization in the sending of messages.  For example, rank N has towait for rank 0 to send to it before it can continue.  That is, rank 0causes a daisy-chain of reactions that allow the rest of the ranks tocontinue -- each rank will not "start" until rank 0 contacts it.Use "make" to compile this example.  Make will use mpicc to compilethe program:        mpicc -o alltoall alltoall.c This program must be run on 2 or more MPI processes.  For example, ifyour LAM universe has more than two CPUs listed, you can simply use:        mpirun C alltoall

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -