在我的ubuntu上安装了openmpi,编译一个简单程序如下:
#include "mpi.h"
#include <stdio.h>
#include <math.h>
int main(int argc,char ** argv)
{
int myid, numprocs;
int namelen;
int type_size;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD,&myid);
MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
MPI_Get_processor_name(processor_name,&namelen);
fprintf(stderr,"Hello World! Process %d of %d on %s\n",myid, numprocs, processor_name);
- What exactly is considered a "heterogeneous" cluster?
- Does LAM/MPI work on heterogeneous clusters?
- Do different versions of LAM/MPI constitute heterogeneous clusters?
- How do I install LAM on a heterogeneous cluster?
- How do I de<lambootde< across a heterogeneous cluster?
- How do I execute the right binary on each node for each architecture in a heterogeneous system?
- Can I mix 32 and 64 bit executables in a single parallel MPI job?
原文:http://blog.chinaunix.net/u/16651/showart.php?id=434959
众所周知,Linux动态库的默认搜索路径是/lib和/usr/lib。动态库被创建后,一般都复制到这两个目录中。当程序执行时需要某动态 库,并且该动态库还未加载到内存中,则系统会自动到这两个默认搜索路径中去查找相应的动态库文件,然后加载该文件到内存中,这样程序就可以使用该动态库中 的函数,以及该动态库的其它资源了。在Linux中,动态库的搜索路径除了默认的搜索路径外,还可以通过以下三种方法来指定。
gdb调试命令 http://lubobill1990.blog.163.com/blog/static/369303862010913105122718/
Linux 包含了一个叫 gdb 的 GNU 调试程序. gdb 是一个用来调试 C 和 C++ 程序的强力调试器. 它使你能在程序运行时观察程序的内部结构和内存的使用情况. 以下是 gdb 所提供的一些功能:
zz from:http://blog.chinaunix.net/u/31088/showart_506966.html
1. core文件的简单介绍
//—————————————————————
在一个程序崩溃时,它一般会在指定目录下生成一个core文件。core文件仅仅是一个内存映象(同时加上调试信息),主要是用来调试的。
在默认情况下,ld链接器会将libc、crt1.o等这些CRT和启动文件与程序的模块链接起来,但是有些时候,我们 可能不需要这些文件,或者希望使用自己的libc和crt1.o等启动文件,以替代系统默认的文件,这种情况在嵌入式系统或操作系统内核编译的时候很常 见。GCC提高了两个参数“-nostartfile”和“-nostdlib”,分别用来取消默认的启动文件和C语言运行库。
from:
程序员的自我修养:链接、装载与库1.2 C/C++运行库 11.2.1 C语言运行库
任何一个C程序,它的背后都有一套庞大的代码来进行支撑,以使得该程序能够正常运行。这套代码至少包括入口函数,及其所 依赖的函数所构成的函数集合。当然,它还理应包括各种标准库函数的实现。
注:gnuplot也好强大,可以作为介于matlab和gmt的一个画图工具了
source : http://darksair.org/wiki/Gnuplot.html#sec5
附带 http://www.gnuplot.info/screenshots/index.html#demos
Gnuplot
Introducing Gnuplot 使用 Gnuplot Gnuplot Interactive Environment Gnuplot Scripting Gnuplot for Real
Introduction to gnuplot — Plot Style
GNUPLOT使用手册
FILE * command;
command = popen("gnuplot","w");
///
fprintf(command,"set terminal png \n");
fprintf(command,"set output ‘test.png’\n");
fprintf(command,"set multiplot\n");
fprintf(command,"plot ‘%s’w lines\n",filename);
fprintf(command,"plot ‘%s’w lines\n",filtered_filename);
fflush(command);
/////
zz from:http://blog.chinaunix.net/u2/65114/showart_1099446.html
一、 基础篇:
在linux命令提示符下运行gnuplot命 令启动,输入quit或q或exit退 出。
1、plot命令
gnuplot> plot sin(x) with line linetype 3 linewidth 2 或
gnuplot> plot sin(x) w l lt 3 lw 2 %用线画,线的类型(包括颜色与虚线的类型)是3,线的宽度是2, 对函数sin(x)作图
在Ubuntu 8.10上安装MPICH2并行计算环境
-Zengming Zhang, ZCNI, ZJU
-2010-1-31
(nicegiving@gmail.com)
目录:
———————
1. 什么是MPICH2
2. 安装前的系统准备
3. 安装步骤
4. 设置环境变量
5. 添加mpd配置文件
6. 开始单机测试
7. 安装后配置(多机测试)
(1) 修改/etc/hosts
(2) 创建mpd.hosts
(3) 配置SSH
(4) 配置samba共享
(5) 配置测试机器的环境变量
(6) 开始测试
8. 并行程序运行测试
9. 成功运行的关键点
10. Troubleshooting
———————
const long maxn=1000001;
bool prime[maxn];
//筛选法求素数
//0代表素数,1代表非素数
void primeinit(){
long long i=2,t;
for(i=4;i<maxn;i=i+2)
prime[i]=false;
for(i=3;i<maxn;i=i+2)
{
if(prime[i])
{
t=i*i;
while(t<maxn)
{
prime[t]=false;
t=t+i;//<<2;//偶数倍不用检测i*i为奇数,故i*i+2i必为奇数
}
第 1 部分:简介 PLAYSTATION 3上的Linux
【转自IBM】Sony? PLAYSTATION? 3(PS3)对于程序员来说是尝试使用新 Cell Broadband Engine?(Cell BE)处理器进行开发最简单也是最经济的方法。本文将探索这个领域中的内容,介绍如何在 PS3 上安装 Linux?,如何开始在 PS3 上针对 Cell BE 处理器进行开发。
转载请注明作者:phylips@bmy 出处:http://duanple.blog.163.com/blog/static/7097176720102274230831/
1.运行mpirun出现如下错误:
duanple@node1:~/project/test$ mpirun -hostfile hosts -np 2 ./a.out
bash: orted: command not found
————————————————————————–
A daemon (pid 27974) died unexpectedly with status 127 while attempting
to launch so we are aborting.
更新日志
2007年9月8日 本文发布
前言
并行计算一直算是比较专业的领域,当然在Linux下依据现有的开源软件搭建一个并行计算的集群还是相对容易的,通常在Linux下使用 PVM/MPI的方式来实现并行计算集群的,网络上有许多关于PVM和MPICH搭建计算集群的方法,但似乎还没有针对OpenMPI的搭建方式,至少中 文的介绍比较少,所以这里我采用最新的OpenMPI来搭建一个基于LFS平台的集群系统。
http://forums.nvidia.com/index.php?showtopic=98213
I am running Ubuntu 8.04 with the CUDA 2.0 toolkit and driver version 177.73 with openMPI. With this configuration, everything works fine and I am able to compile and execute mpi code by simply replace g++/gcc with mpic++ in common.mk.
My issue is that when I try to upgrade my driver to version 180.22 (to get support for my new 295 cards) I get immediate segmentation fault with even the most trivial programs (empty int main). This problem happens only when I am compiling with the CUDA template. Other programs which are compiled with only the mpic++ command line run fine and when I go back to driver v177.73, everything works again. This issue occurs with nearly identical software config on 5 different workstation with different mobo/CPU, chipset, and graphics cards.
http://www.lam-mpi.org/faq/category11.php3
Table of contents:
[ Return to FAQ ]
1. 说明(可略过)
由于条件限制,我们作的并行只是应用层的并行(包括现在量化网上关于并行的文章,说的也都是应用层的并行);如果有条件的话,可以考虑组建Beowulf,COW,MOSIX,或其他商业的群集系统. 我们说要在应用层实现并行,主要就是通过一些网络协议(如TCP/IP)实现并行群集系统中各个节点间消息的传递,而MPI为此提供了传递接口.
provide the output with -d (debug) parameter as well? With
this parameter you can see the command to start the remote MPDs. You could try
the mpd startup and look if the port is written to stdout.
(1)
no_port 错误
zzm@zzm-desktop:/home/zzm$ mpdboot -n 2 -f /home/zzm/
mpd.hosts
mpdboot_zzm-desktop (handle_
mpd_output 420):
from
mpd
on zzm-desktop,
invalid
port
info:
no_port
导致此错误的原因有很多个,下面是我发现的几个:
linux用户管理:http://hi.baidu.com/hengcheng/blog/item/9b1ee7d3008ddddba8ec9a0a.html
快速设置:http://blog.sina.com.cn/s/blog_4a8aac9701000at0.html
ps3集群:http://cluster.qubits.ch/
Client statistics by OS:http://fah-web.stanford.edu/cgi-bin/main.py?qtype=osstats
用八台PS3组成工作站:http://www.equn.com/forum/thread-15145-1-1.html
把Cell超级计算机搬回家:http://www.infoq.com/cn/news/2008/12/Supercomputer-at-Home
PS3Cluster Guide:http://www.ps3cluster.umassd.edu/
linux编程blog:http://oss.lzu.edu.cn/modules/lifetype/index.php
zz from: http://oss.lzu.edu.cn/modules/lifetype/index.php?op=ViewArticle&articleId=427&blogId=6
在PS3+YDL上安装集群
falcon <zhangjinw@gmail.com>
2007-6-5
说明:刚接触集群,这里仅仅是一个操作笔记。里头可能有很多错误,欢迎指正。另外,转载请注名出处,并保留作者信息。