incredibuild(分布式任务软件)脚本
IncrediBuild 可以在Server段通过修改单个任务的进程上限来实现提升任务执行速度。
IncredBuild本机版也可以用来进行本机实现多线程任务分发,这样可以充分利用多核资源。
提交分布式任务涉及该工具的三个命令:
xgConsole.exe ,负责编译工程任务的发起;
xgSubmit.exe ,负责提交各个工程文件的编译任务;
xgWait.exe ,负责最后的链接。
示例:
run.bat
@ECHO OFF
xgSubmit.exe /group=UTest # test.exe .cpp
xgSubmit.exe /group=UTest # test.exe .cpp
xgSubmit.exe /group=UTest # test.exe .cpp
xgSubmit.exe /group=UTest # test.exe .cpp
xgSubmit.exe /group=UTest # test.exe .cpp
xgSubmit.exe /group=UTest # test.exe .cpp
xgSubmit.exe /group=UTest # test.exe .cpp
xgSubmit.exe /group=UTest # test.exe .cpp
xgSubmit.exe /group=UTest # test.exe .cpp
xgSubmit.exe /group=UTest # test.exe .cpp
xgSubmit.exe /group=UTest # test.exe .cpp
xgWait.exe /group=UTest
echo All Task Finished xgConsole /command="run.bat" /openmonitor
Rem UTest.bat - Distributed Version
Rem ===============================
xgSubmit.exe /group=UTest /command UTest.exe /in=Input1.dat /out="Results\"
xgSubmit.exe /group=UTest /command UTest.exe /in=Input2.dat /out="Results\"
xgSubmit.exe /group=UTest /command UTest.exe /in=Input3.dat /out="Results\"
xgSubmit.exe /group=UTest /command UTest.exe /in=Input4.dat /out="Results\"
xgSubmit.exe /group=UTest /command UTest.exe /in=Input5.dat /out="Results\"
xgWait.exe /group=UTest
UReport.exe /in="Results\" /ShowReport
:end xgConsole.exe UTest.bat
自己写的一个分布式批处理脚本:
@ECHO OFF
setlocal ENABLEDELAYEDEXPANSION
set time1=%time:~0,2%%time:~3,2%%time:~6,2% set PRJ_DIR=%CD%
set WORK_FILE=lint
set BAT=run.bat
set SOURCE=filelist.txt ::进工作目录
IF NOT EXIST %WORK_FILE% (
echo No %WORK_FILE%!!!
EXIT
) cd %WORK_FILE% IF NOT EXIST %SOURCE% (
echo No %SOURCE%!!!
EXIT
) set tmpIndex=0
set duplicateCount=0 ::遍历文件列表
FOR /F "eol=/delims=" %%i in (%SOURCE%) do (
set tmp=%%i set isannotate=false
IF "!tmp:~0,1!"=="#" (
set isannotate=true
)
IF "!tmp:~0,2!"=="//" (
set isannotate=true
) IF !isannotate!==false (
set fileorfolder=!tmp:%%PRJ_DIR%%=%PRJ_DIR%!
set existfile=false
FOR /F "delims=" %%j in ('dir /s /b /A:-D !fileorfolder!') do (
IF EXIST "%%j" (
set existfile=true ::判重标识
set duplicate=false
FOR /L %%k IN (0,1,!tmpIndex!) do (
IF /I !tmp[%%k]!=="%%j" (
set duplicate=true
)
) ::判重
IF !duplicate!==false (
set tmp[!tmpIndex!]="%%j"
set /a tmpIndex=tmpIndex+1
) ELSE (
set /a duplicateCount=duplicateCount+1
)
)
) IF !existfile!==false (
echo !tmp! error
echo !fileorfolder!
)
)
) ::清空临时环境变量,否则后面执行xgConsole时会尝试解析这些环境变量而出错
set tmp=
set fileorfolder=
set existfile=
set duplicate= echo TaskInfo FileCount:!tmpIndex! Duplicate:!duplicateCount! ::重新生成bat
IF EXIST "%BAT%" (
del "%BAT%"
) echo @ECHO OFF >>%BAT% ::按实际大小遍历
set /a tmpIndex=tmpIndex-1 FOR /L %%k IN (0,1,!tmpIndex!) do (
echo xgSubmit.exe /group=UTest # test.exe !tmp[%%k]! >>%BAT%
) echo xgWait.exe /group=UTest >>%BAT%
echo echo All Task Finished! >>%BAT% xgConsole /NOLOGO /command="%BAT%" set time2=%time:~0,2%%time:~3,2%%time:~6,2%
set /a time3=%time2%-%time1%
echo 耗时%time3%秒 EXIT
incredibuild(分布式任务软件)脚本的更多相关文章
- Google分布式构建软件之二:构建系统如何工作
分布式软件构建第二部分:构建系统如何工作 注:本文英文原文在google开发者工具组的博客上[需要FQ],以下是我的翻译,欢迎转载,但请尊重作者版权,注名原文地址. 上篇文章中提到了在Google,所 ...
- Google分布式构建软件之三:分布式执行构建步骤
注:本文英文原文在google开发者工具组的博客上[需要FQ],以下是我的翻译,欢迎转载,但请尊重作者版权,注名原文地址. 之前两篇文章分别介绍了Google 分布式软件构建系统Blaze相关的为了提 ...
- centos环境自动化批量安装软件脚本
自动化安装jdk软件部署脚本 准备工作: 1.在执行脚本的服务器上生成免密码公钥: 安装expect命令 yum install -y expect ssh-keygen 三次回车 2.将jdk-7u ...
- centos环境自动化批量安装jdk软件脚本
自动化安装jdk软件部署脚本 准备工作: 1.在执行脚本的服务器上生成免密码公钥: 安装expect命令 yum install -y expect ssh-keygen 三次回车 2.将jdk-7u ...
- Window平台下的静默下载并安装软件脚本bat
一,隐藏命令窗口 当我们运行bat脚本的时候,弹出CMD窗口.如果要隐藏窗口可以在bat脚本开头处写一下代码: @echo off if "%1" == "h" ...
- Google分布式构建软件之一:获取源代码
本文原文在google开发者工具组的博客上[需要FQ],以下是我的翻译,欢迎转载,但尊重作者版权,注名原文地址. 在Google,所有的产品都是在主干上开发的.这样的好处:每个人都可以查看和修改代码, ...
- Google分布式构建软件之四:分发构建结果
注:本文英文原文在google开发者工具组的博客上[需要FQ],以下是我的翻译,欢迎转载,但请尊重作者版权,注名原文地址. 之前的文章,介绍了Google在分布式构建软件过程中,如何把构建过程分发到许 ...
- linux + docker + selenium grid 实现分布式执行selenium脚本
Selenium Grid 有两个概念 hub :主节点,你可以看作 "北京总公司的测试经理". node:分支节点,你可以看作 "北京总公司的测试小兵A" 和 ...
- selenium-grid 分布式 实现同一脚本在不同pc上运行
1.使用版本:selenium 3.11.0chrome 65phantomjs 2.1.1selenium-server selenium-server-standalone-2.46.0.jar ...
随机推荐
- ASP.NET如何接收清楚缓存的通知
1 如果使用cache的add方法或者接受CacheItemPriority值得Insert方法重载接收通知,可以提供CacheItemRemovedCallBack对象,选择在清除对象时接收通知 u ...
- Category VS Extension 原理详解
(一)Category 1.什么是Category? category是Objective-C 2.0之后添加的语言特性,别人口中的分类.类别其实都是指的category.category的主要作用是 ...
- Spring Cloud(十一)高可用的分布式配置中心 Spring Cloud Bus 消息总线集成(RabbitMQ)
详见:https://www.w3cschool.cn/spring_cloud/spring_cloud-jl8a2ixp.html 上一篇文章,留了一个悬念,Config Client 实现配置的 ...
- web开发:javascript高级
一.事件案例 二.循环绑定之变量污染 三.事件的绑定与取消 四.事件对象 一.事件案例 <!DOCTYPE html> <html> <head> <meta ...
- golang embedded structs
golang 中把struct 转成json格式输出 package main import ( "encoding/json" "fmt" ) type Pe ...
- USC-- compute shader ps vs
http://cdn.imgtec.com/sdk-documentation/PowerVR%20Compute%20Development%20Recommendations.pdf powerV ...
- js原型补充
js定义函数: <script> function A() {} let a1 = new A(); let a2 = new A(); // 为A类添加原型 => 类似于类属性 A ...
- STM32调试利器之ITM
原创: Osprey 鱼鹰谈单片机 2月17日 STM32 有一个代码跟踪功能,即 ITM,这个调试功能非常强大,可以替代串口输入输出功能,而且只需要占用一根 I/O 线就可以实现.当然它的好处不仅 ...
- ACM-ICPC 2017 西安赛区现场赛 K. LOVER II && LibreOJ#6062. 「2017 山东一轮集训 Day2」Pair(线段树)
题目链接:西安:https://nanti.jisuanke.com/t/20759 (计蒜客的数据应该有误,题目和 LOJ 的大同小异,题解以 LOJ 为准) LOJ:https://l ...
- C语言位运算题解
#include <stdio.h> #include <stdlib.h> #include <string.h> //#define NONBLANK 1 ma ...