牛虻与专家

导航

 
mdtest
 
 
 
yum install openmpi openmpi-devel -y
配置环境变量vim /root/.bashrc:
export PATH=$PATH:/usr/lib64/openmpi/bin/
export PATH=$PATH:/root/mdtest
修改Makefile:
mdtest: mdtest.c
mpicc -Wall -D $(OS) $(LARGE_FILE) $(MDTEST_FLAGS) -g -o mdtest mdtest.c -lm
 
make mdtest
 
 
命令:
mpirun -host ceph01 --allow-run-as-root -np 8 mdtest -I 5000 -b 3 -z 10 -d /mnt/cephfs -C -F
这组mdtest参数最后创建了3542920000个文件和88574个目录
 
mpirun -host localhost --allow-run-as-root -np 2 mdtest -I 50 -i 2 -b 8 -z 8 -d /infinityfs1//test/ -t -C
mpirun -host localhost --allow-run-as-root -np 1 mdtest -I 10 -i 2 -b 8 -z 8 -d /infinityfs1//test/ -t -C
参数:
-b: branching factor of hierarchical directory structure 目录树的分支参数
-B: no barriers between phases (create/stat/remove) 不同的阶段没有隔离 (create/stat/remove);
-c: collective creates: task 0 does all creates and deletes 共同创建: task 0 完成所有的创建和删除工作;
-C: only create files/dirs 只创建文件或目录,不作删除;
-d: the directory in which the tests will run 指出测试运行的目录(若不指定,则默认当前目录);
-D: perform test on directories only (no files) 只对目录操作进行测试(不包括文件);
-e: number of bytes to read from each file 从每个文件读出的文件大小
-E: only read files 只读取文件 -f: first number of tasks on which the test will run 首先运行的任务号;
-F: perform test on files only (no directories) 只创建文件,没有目录;
-h: prints help message 输出帮助信息 -i: number of iterations the test will run 测试迭代循环次数;
-I: number of items per tree node 每个树节点包含的项目
-l: last number of tasks on which the test will run 最后运行的任务号
-L: files/dirs created only at leaf level 只在目录树的“叶子”层创建文件/目录;
-n: every task will create/stat/remove # files/dirs per tree 每个任务需要再每棵树中create/stat/remove的文件/目录数;
-N: stride # between neighbor tasks for file/dir stat (local=0) 遍历时指定和相邻任务的跨度
-p: pre-iteration delay (in seconds) 每次迭代之间延时(以秒计算)
-r: only remove files/dirs 删除文件/目录
-R: randomly stat files/dirs (optional seed can be provided) 随机遍历文件/目录 ;
-s: stride between the number of tasks for each test 每次测试的任务数的跨度
-S: shared file access (file only, no directories) 共享文件访问(只针对文件操作);
-t: time unique working directory overhead 记录特定目录的时间开销
-T: only stat files/dirs -u: unique working directory for each task 为每个任务指定工作目录;
-v: verbosity (each instance of option increments by one)
-V: verbosity value -w: number of bytes to write to each file 写到每个文件的字节数
-y: sync file after write completion 再写执行完后同步文件到磁盘(同步写)
-z: depth of hierarchical directory structure 目录树的深度; NOTES: * -N allows a "read-your-neighbor" approach by setting stride to tasks-per-node. Do not use it with -B, as it creates race conditions. 允许"read-your-neighbor" 方法 *
-d allows multiple paths for the form '-d fullpath1@fullpath2@fullpath3' 可以指定多个测试路径,'-d fullpath1@fullpath2@fullpath3' * -B allows each task to time itself. The aggregate results reflect this change. 允许每个任务对自己进行计时; * -n and -I cannot be used together.
-I specifies the number of files/dirs created per tree node, whereas the -n specifies the total number of files/dirs created over an entire tree. When using -n, integer division is used to determine the number of files/dirs per tree node. (E.g. if -n is 10 and there are 4 tree nodes (z=1 and b=3), there will be 2 files/dirs per tree node.) * -R and -T can be used separately. -R merely indicates that if files/dirs are going to be stat'ed, then they will be stat'ed randomly.
不能同时使用,因为指定了每个树节点的文件/目录数量,而-I指定的是整棵树的文件/目录数量。
 
加并行的运行节点 [root@lab8105 ~]# vim /etc/openmpi-x86_64/openmpi-default-hostfile 添加 lab8105 slots=1 lab8106 slots=1 特别注意加slots 这个是配置权重的,如果不配置,第一条有默认权重,就无法在数目小时进行均衡操作 检查是否配置成功,np为操作线程数 [root@lab8105 ~]# mpirun --allow-run-as-root -np 2 hostname lab8105 lab8106 如果想单机执行多进程,可以用-host指定主机 [root@lab8105 ~]# mpirun -host lab8105 --allow-run-as-root -np 2 hostname
增加并行的运行节点 [root@lab8105 ~]# vim /etc/openmpi-x86_64/openmpi-default-hostfile 添加 lab8105 slots=1 lab8106 slots=1 特别注意加slots 这个是配置权重的,如果不配置,第一条有默认权重,就无法在数目小时进行均衡操作 检查是否配置成功,np为操作线程数 [root@lab8105 ~]# mpirun --allow-run-as-root -np 2 hostname lab8105 lab8106 如果想单机执行多进程,可以用-host指定主机 [root@lab8105 ~]# mpirun -host lab8105 --allow-run-as-root -np 2 hostname
 
 
原文出至:https://note.youdao.com/ynoteshare1/index.html?id=4fd5ee2a710c6825c40a6a3a475b8436&type=note
posted on 2020-08-21 13:56  牛虻&专家  阅读(678)  评论(0)    收藏  举报