自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(92)
  • 资源 (1)
  • 收藏
  • 关注

转载 归并排序

归并排序,不单单是归并排序,应该更重要的是一种分治的思想。把问题大而化小,再将小问题的结果汇总,得到大问题的解。递归的写法更能体现归并的分治思想,但是递归调用,当层次非常多的时候,会影响性能,现在考虑如何把归并的递归方式变成非递归方式。归并的完整描述是:假设初始序列含有n个记录,则可看成是n个有序的子序列,每个子序列的长度为1, 然后两两归并,得到[n/2]个升序为2(或1

2012-10-31 16:02:54 363

原创 getopt_long

#include //for printf#include //for exit#include #include void print_help(){ puts("srun [-N nodes] [-n tasks] executable\n\ -N number of nodes\n\ -n number of ta

2012-10-31 13:40:33 413

原创 getopt

#include //for printf#include //for exit#include #include void print_help(){ puts("srun [-N nodes] [-n tasks] executable\n\ -N number of nodes\n\ -n number of tasks\n\ -h --help p

2012-10-31 11:42:00 405

转载 getopt_long 与 optind

命令行参数有长参数如version, 还有短参数 如 v, 那么用这两个都可以。程序处理的时候,会首先把长参数转换成对应的短参数,如会把version转成v, 再进行 v 对应的操作就可以了。命令行参数的选项,有的需要参数,有的不需要参数,或者有的参数是可选的,那么怎么区分呢?首先,对这些选项,如何组织起来? 是以字符串的形式组织起来了。如我有一个程序,有两个选项,-a, -b,

2012-10-31 11:40:37 536

转载 Lustre I/O性能特点

1 Lustre概述Lustre是面向集群的存储架构,它是基于Linux平台的开源集群(并行)文件系统,提供与POSIX兼容的文件系统接口。Lustre两个最大特征是高扩展性和高性能,能够支持数万客户端系统、PB级存储容量、数百GB的聚合I/O吞吐量。Lustre是Scale-Out存储架构,借助强大的横向扩展能力,通过增加服务器即可方便扩展系统总存储容量和性能。Lustre的集群和并行架

2012-10-31 08:06:41 1815

原创 C库文件说明

ALLOC.H    说明内存管理函数(分配、释放等)。ASSERT.H    定义 assert调试宏。BIOS.H     说明调用IBM—PC ROM BIOS子程序的各个函数。CONIO.H    说明调用DOS控制台I/O子程序的各个函数。CTYPE.H    包含有关字符分类及转换的名类信息(如 isalpha和toascii等)。DIR.H

2012-10-31 08:05:22 703

转载 static的作用

在C语言中,static的作用可以归纳为三条。(1):隐藏。当编译多个文件时,所有未加static前缀的全局变量和函数都具有全局可见性。一个是a.c,另一个是main.c。下面是a.c的内容char a = 'A' // global variablevoid msg(){printf("Hello\n");}你可能会

2012-10-31 08:04:22 357

原创 static和extern修饰连接属性

1. static修饰全局变量或函数,表示其只能在所在文件中使用extern修饰变量,表示其来自于其他文件---------------------------------------[root@localhost cpp]# cat source.c#includestatic int height = 8848; // can only be used

2012-10-31 08:03:47 511

原创 对字符串常量的修改

K&R C中规定字符串中所有字符和NUL终止符都存储于内存的某个位置。可以修改字符串常量。但ANSI C中则规定如果对一个字符串常量进行修改,其结果是未定义的。因此,如果要修改字符串常量,请把它存储在数组中,这样,字符串将存储在普通内存区中,可修改。#includeint main(){char *pstr = "hire";

2012-10-31 08:02:53 2789

原创 (3) double-linked list: insque remque

1. /** * The insque and remque subroutines manipulate queues built from double-linked lists. * Each element in the queue must be in the form of a qelem structure. The next and * prev elements o

2012-10-30 14:31:35 800

原创 SLURM and OpenMPI

1) The MpiDefault configuration parameter in slurm.conf establishes the system default MPI to be supported. The srun option --mpi= (or the equivalent environment variable SLURM_MPI_TYPE can be used

2012-10-30 10:12:08 1773

原创 SLURM Scheduler

1.src/plugins/sched/built-in: will initiate jobs strictly in their priority order, typically (first-in-first-out)backfill: will initiate a lower-priority job if doing so does not delay the expecte

2012-10-30 10:04:22 1026

原创 在Eclipse中导入hadoop

0. 准备(1) 需要有gcc、autoconf、automake来编译安装google的protocol buffer(2) http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz./configure --prefix=/usr/localmakemake checksudo make install完成

2012-10-30 09:59:59 4520 1

转载 Hadoop 0.23编译常见错误

0) 要是下面的错误你都碰到了。。说明你开发环境没搞好,用下面这个命令吧。yum groupinstall "Development Libraries"1) 报错: "[ERROR] Failed to execute goal org.codehaus.mojo:make-maven-plugin:1.0-beta-1:autoreconf (autorecon

2012-10-29 17:51:47 6092

转载 CentOS上安装Hadoop0.23

0. 能上网是必须的,否则很难。1. 安装java        jdk-6u22-linux-i586-rpm.bin ,下载里直接执行。2. 安装c++  ,第5步用的。        yum install gcc-c++3. 下载hadoop 0.23       先装svn       yum install subversion      s

2012-10-29 17:51:06 696

原创 (4) tree : tsearch tfind tdelete

1.#include #include #include #include /* * tsearch(), tfind(), and tdelete() also return NULL if rootp was NULL on entry. * * void *tsearch(const void *key, void **rootp, int(*compar)(const

2012-10-28 22:09:08 1325

原创 (2) array of sturct/string: lfind lsearch and insert

#include#include#include#include/* * void *lfind(const void *key, const void *base, size_t *nmemb, size_t size, int(*compar)(const void *, const void *)); if found return

2012-10-28 22:08:07 530

原创 (5) hashtable <key, data> : hcreate hdestroy hsearch

The  three functions hcreate(), hsearch(), and hdestroy() allow the user to create a hash table (only one at a time) which associates a key with any data.#include #include #include /* *

2012-10-28 22:07:11 917

原创 (1) array of string/struct: qsort bsearch

1. The  bsearch() function returns a pointer to a matching member of the array, or NULL if no match is found. If there are multiple elements that match the key, the element returned is unspecified

2012-10-28 22:05:44 611

原创 sizeof(city_array) = 8, sizeof(char *) = 8

#include#include#include/** * sizeof(city_array) = 8, sizeof(char *) = 8 * count = sizeof(city_array) / sizeof(char *) = 1 */void print_city_array(int num, char **city_array){ printf("sizeof(c

2012-10-28 22:03:08 1124

原创 (14) MPI-IO_shared_order: seek/get_position/write/read/iread/iwrite read_ordered/write_ordered

#include#include#include#include"mpi.h"#include #include /** * fh is shared by all processes. * In case of reading, after one process finishes, and the fh moves to the new position, * t

2012-10-28 21:50:37 690

原创 (13)MPI-IO: seek/get_position/write/read all processes share one fh

#include#include#include#include"mpi.h"#include #include /** * fh is shared by all processes. * In case of reading, after one process finishes, and the fh moves to the new position, * t

2012-10-28 21:47:52 600

原创 (12)MPI-IO: fileview read_all_begin/end write_all_begin/end

#include#include#include#include"mpi.h"/** * non-blocking read/write in the context of fileview in two stage * because *_end equals to MPI_Wait(&request, &status), MPI_Wait is not necessary *

2012-10-28 21:07:39 648

原创 (13) MPI-IO shared_fh seek/get_position/write/read/_shared

#include#include#include#include"mpi.h"#include #include /** * fh is shared by all processes. * In case of reading, after one process finishes, and the fh moves to the new position, * t

2012-10-27 20:14:50 594

原创 (11) MPI-IO: fileview MPI_File_iread MPI_File_iwrite

#include#include#include#include"mpi.h"/** * non-blocking read/write in the context of fileview * int MPI_File_iread(MPI_File fh, void * buf, int count,Datatype datatype, MPI_Request * request)

2012-10-27 20:11:03 711

原创 (10) MPI-IO -- fileview: MPI_File_read_all MPI_File_write_all

#include#include#include#include"mpi.h"/** * all process exe blocking read/write in the context of fileview * int MPI_File_read_all(MPI_file fh, void * buf, int count, MPI_Datatype datatype, MPI

2012-10-24 07:32:25 1413

原创 (9) MPI-IO: fileview MPI_File_read MPI_File_write

#include#include#include#include"mpi.h"/** * blocking read/write in the context of a specific process's fileview * * int MPI_File_read(MPI_file fh, void * buf, int count, MPI_Datatype datatype,

2012-10-24 07:30:40 1509

原创 (8)MPI-IO: fileview MPI_File_seek MPI_File_get_position MPI_File_get_byte_offset

#include#include#include#include"mpi.h"/** * int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) * here whence can be: * MPI_SEEK_SET, point to offset * MPI_SEEK_CUR, point to c

2012-10-24 07:19:48 804

原创 (7) MPI-IO: MPI_File_seek

fileview + seek  能组合出非常强大的功能,首先由fileview来抽象进程自己的文件视图,然后再在新的fileview逻辑视图中seek想要达到的位置。而不关心物理位置。#include#include#include#include"mpi.h"/** * int MPI_File_seek(MPI_File fh, MPI_Offset offset,

2012-10-23 17:43:55 2151

原创 (6) MPI-IO: fileview MPI_File_set_view MPI_File_get_view

#include#include#include#include"mpi.h"/** * int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, char * datarep, MPI_Info info); * etype = basic uni

2012-10-23 17:26:09 1840

原创 (5) MPI-IO: MPI_File_read_at_all_begin MPI_File_read_at_all_end

#include#include#include#include"mpi.h"/** * two phase non-blocking read and write * * int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void * buf, int count, MPI_Datatype dataty

2012-10-23 15:45:48 1100

原创 (4) MPI-IO: MPI_File_iread_at MPI_File_iwrite_at MPI_Wait

#include#include#include#include"mpi.h"/** * all process read/write at the same offset * int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void * buf, int count, MPI_Datatype datatype, MPI_

2012-10-23 15:27:57 903

原创 (3) MPI-IO: MPI_File_read_at_all MPI_File_read_at_all

#include#include#include#include"mpi.h"/** * all process read/write at the same offset * int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MP

2012-10-23 14:39:35 1433

原创 (2) MPI-IO: MPI_File_read_at MPI_File_write_at

#include#include#include"mpi.h"/** * int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void * buf, int count, MPI_Datatype datatype, MPI_Statye * status); * int MPI_File_write_at(MPI_File fh,

2012-10-23 14:25:37 3140

原创 (1) MPI-IO: 基本函数 open, close, write_shared

/** * int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh); * int MPI_File_close(MPI_File *fh); * * int MPI_File_write_shared(MPI_File fh, void *buf, int count,

2012-10-23 14:03:09 2884

转载 x86_64系统编程的一点体验~!

1正确的使用变量类型。在编程中碰到的一个整数乘法溢出问题,用了半天的时间才找到问题所在,用了一秒钟把错误改正过来。问题是这样的,首先用mmap()将一个37G大小的文件映射到程序的内存空间,之后用mmap()得到的起始地址和一个偏移量进行文件的定位,问题就出在偏移量的计算中,本偏移量是通过两个int类型的整数相乘得到的,当文件访问到足够大的位置时,会发生内存无效访问的错误。错误就在于两个整数(si

2012-10-23 11:32:59 702

转载 Rob Pike 的教诲!

1你无法断定程序会在什么地方耗费运行时间。瓶颈经常出现在意想不到的地方,所以别急于胡乱找个地方改代码,除非你已经证实那儿就是瓶颈所在。2估量。在你没有对代码进行估量,特别是没有找到最耗时的那部分之前,别去优化速度。3花哨的算法在n很小时通常很慢,而n通常很小。花哨算法的常数复杂度很大。除非你确定n总是很大,否则不要用花哨算法(即使n很大,也优先考虑原则2)。比如,解决常见问

2012-10-23 11:31:07 435

转载 Linux / Unix IO

IO分类标准IO: fopen, fread, fwrite, fseek, fclose, ...系统IO: open, read, write, readv, writev, pread, pwrite, close, fstat, fcntl, select,...异步IO: aio_read, aio_write, lio_listio, aio_error, aio_return

2012-10-23 11:29:00 436

转载 dd

打印SEGY数据3200字节文件头: dd if=segy.data bs=3200 count=1 conv=edcdic打印SEGY数据400字节二进制文件头:dd if=segy.data bs=400 skip=8 count=1 conv=swap | od -d说明,conv=swab只能对付两字节的short类型数据

2012-10-23 11:26:13 1060

转载 The elements of programming style

Write clearly - don't be too clever  清晰是最重要的,不要耍聪明Say waht you mean, simply and directly 词要达意Use library functions 不要重造轮子Avoid temprorary variables 避免滥用临时变量Write clearly - don't sacrifice clar

2012-10-23 11:25:23 821

嵌入式Linux开发入门

《嵌入式Linux开发入门》全书资料及其PPT

2011-10-24

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除