Submitting multiple batch scripts to LSF

2023-10-26

原文链接:https://hpc.ncsu.edu/Documents/lsf_scripts.php

Many workflows involve submitting multiple compute jobs with slightly different parameters. Users can create a more efficient and reproducible workflow by using LSF job arrays or shell scripts to automate submission to LSF. Some basic scripts are provided as examples.

Caution!
Syntax errors, logic errors, or miscalculation of resources in scripts that do multiple batch submissions may result in the following violations of the Acceptable Use Policy:

  • Infinite loops that crash LSF
  • Too many jobs creating enough simultaneous I/O to crash the file system
  • Taking all available software licenses, making them unavailable to other users

IN THOSE CASES, A USER WILL BE REQUIRED TO KILL ALL JOBS.

  • To kill all jobs, use bkill 0

BEFORE USING AN AUTOMATED SUBMISSION SCRIPT:

  • Test the logic of codes and scripts by adding echo statements and running with the bsub command commented out.
  • Always do an initial test that submits only a single job. Next, test with only a few jobs for a short amount of time, and monitor the usage and output.
  • When in doubt, contact HPC staff.

Job arrays for multiple job submissions

LSF job arrays allow a user to submit multiple jobs to LSF as defined by an array of integers. If the workflow allows for inputs, outputs, and parameters to be fully characterized by a single number, job arrays are the most efficient way of submitting multiple jobs.

In the sample batch script below, LSF will spawn 25 serial jobs, and each will execute the line source ./echo_hostname.csh $LSB_JOBINDEX. Here, $LSB_JOBINDEX is the job array index (an integer from 1 to 25) for each job.

#!/bin/tcsh
#BSUB -J My_array[1-25]   #job name AND job array
#BSUB -n 1                #number of cores
#BSUB -W 00:10            #walltime limit: hh:mm
#BSUB -o Output_%J_%I.out #output - %J is the job-id %I is the job-array index
#BSUB -e Error_%J_%I.err  #error - %J is the job-id %I is the job-array index 
source ./echo_hostname.csh $LSB_JOBINDEX  

Job array - serial example

The script job_array_serial.csh submits 25 jobs that run the program echo_hostname.csh, which echoes the hostname of the node that it is running on and which job of the job array it is. To use, type bsub < job_array_serial.csh. The scripts and the resulting output can be viewed here:
job_array_serial.csh
echo_hostname.csh
output

To avoid copy/paste errors when using, please copy these from the apps directory:

/usr/local/apps/examples/scripts/job_arrays

Job array - parallel example

The script job_array.csh is to demonstrate that multiple parallel jobs may be submitted in the same manner as for multiple serial jobs. The sample code hello_omp.F90 is a hybrid MPI-OpenMP example which echoes the hostname of the node that each thread is running on. To use, first compile the sample code, and then type bsub < job_array.csh. The job_array.csh contains instructions for compiling the sample code. The scripts and the resulting output can be viewed here:
job_array.csh
hello_omp.F90
output

To avoid copy/paste errors when using, please copy these from the apps directory:

/usr/local/apps/examples/scripts/job_arrays

Sample automation scripts using loops to submit multiple jobs to LSF

If automating job submissions requires something more complex than is available via the use of job arrays as described above, job submission may be automated with batch scripts.

Basic script for multiple job submissions

The script multiple_jobs.csh uses bsub to run the program run.csh, which echoes the hostname of the node that it is running on. This can also be used as a test as to whether an LSF batch script will distribute jobs to the intended hosts. The scripts and the resulting output can be viewed here:
multiple_jobs.csh
run.csh
output

To avoid copy/paste errors when using, please copy these from the apps directory:

/usr/local/apps/examples/scripts/basic/

R script for multiple job submissions

The script R_loops.csh uses bsub and Rscript to define various years and models and then run an R script codehpc.R for each scenario. The scripts and the resulting output can be viewed here:
R_loops.csh
codehpc.R
output

To avoid copy/paste errors when using, please copy these from the apps directory:

/usr/local/apps/examples/scripts/R_loops/

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Submitting multiple batch scripts to LSF 的相关文章

  • 用非阻塞的 socket connect

    呵呵 原来有人碰到跟我一样的问题 引用如下 这是网址 http cache baidu com c m 9f65cb4a8c8507ed4fece763104c8c711923d030678197027fa3c215cc79031c1d3a
  • pycharm中不能使用anaconda中包含的库的解决办法

    参考在pycharm中使用Anaconda之后 自己记录下来 防止以后找不到 1 打开pycharm 2 选择菜单栏中的file 文件 中的settings 设置 找到project后 选中project interpreter 点击右边的
  • Android读取设备内存大小

    获取系统运行内存 RAM 大小 public static String getRAMTotalMemorySize final Context context 获得ActivityManager服务的对象 ActivityManager
  • python新手怎么兼职-自学python可以做什么兼职

    很多朋友都会说 我身边有朋友或者同学是做程序员的 但是他们具体的工作内容 其实很多人是不了解的 这几年随着一些影视作品的出现 里面的主演有的从事开发工程师 大家初步有了一个印象 如果我不想去公司坐班 自己通过这个技能怎么来赚钱 推荐学习 P
  • 解决Unreal Engine 4.7.6的DerivedDataCache在C盘疯狂膨胀的问题

    打开 YourEngineFolder Engine Config BaseEngine ini 将 1 Local Type FileSystem ReadOnly false Clean false Flush false PurgeT
  • cnpm安装步骤

    安装nodeJS 官网下载 http nodejs cn download 选择其他版本下载地址 https nodejs org zh cn download releases 选版本点击下载 然后下载后缀名为msi 因为安装简单 选择好
  • 推荐学习方法——费曼技巧,以教促学,教学相长

    1 说到费曼技巧先来了解一下费曼这个人 费曼 全名理查德 费曼 美国著名物理学家 于1965年获得诺贝尔物理奖 在沉迷于美妙的物理世界的同时 他还热衷于教育事业 喜欢向人们深入浅出的讲解艰深的物理知识 在他的自传里 他提到曾纠结于某篇艰深的
  • java的反射机制

    Java的反射机制 1 定义 指程序可以访问 检测并修改本身的状态或行为的一种能力 并能根据自身行为的状态和结果调整或修改应用所描述行为的状态和相关的语义 简单来说 就是一种能自我修正的机制 2 意义 首先 反射机制极大的提高了程序的灵活性
  • 如何开启VT方法

    第 步 进入BOIS 重启电脑后 屏幕刚亮 笔记本一般快速按F1或F12 台式一般按DEL键 多按几下 成功后 会进入BIOS设置页面 第 步 找到 Intel Virtualization Technology 把 Disabled 修改
  • 跨平台方案Flutter入门——开发环境搭建

    目录 系统配置要求 获取 Flutter SDK 配置环境变量 安装 Android Studio 运行 flutter doctor 1 Anroid 的 SDK 路径 2 许可未同意 Android Studio 安装插件 Androi
  • 快来动手训练属于自己的聊天机器人吧!

    活动时间 北京时间2023年3月16日15 00 17 00 活动形式 在线直播 动手训练营 动手实践 使用 Amazon SageMaker 构建基于开源 GPT J 模型的对话机器人应用 难度 入门 时间 20 分钟 开发者可以使用 A
  • Python 遇到的问题

    目录 问题1 Pycharm 项目中 Cannot find declaration to go to 问题2 TypeError list indices must be integers or slices not tuple
  • 【C++】继承

    需要云服务器等云产品来学习Linux的同学可以移步 gt 腾讯云 lt gt 阿里云 lt gt 华为云 lt 官网 轻量型云服务器低至112元 年 新用户首次下单享超低折扣 目录 一 继承的概念 二 被继承成员访问方式的变化 三 赋值兼容
  • 详解不带参数的 Math.max() 返回 -Infinity

    Math max 是内置的 JavaScript 函数 从给定的一组数字中返回最大值 其语法如下 Math max value1 value2 例如 让我们从 1 2 以及 3 中找到最大的数字 Math max 1 2 3 gt 3 正如
  • [架构之路-199] - 可靠性需求与可靠性分析:鱼骨图、故障树分析法FTA、失效模式与影响DFMEA,找到影响故障的主要因素

    目录 引言 第1章 故障树分析法与鱼骨图的比较 1 1 相同点 1 2 区别点 第2章 鱼骨图 第3章 故障树 3 1 示意图 3 2 故障树解读 3 3 故障树常见符号 第4章 产品失效 Failure 模式分析DFMEA 引言 目标系统

随机推荐

  • git The following paths are ignored by one of your .gitignore files: Use -f if you really want to ad

    git 右键或者命令add 文件或目录 不允许提交 提示 The following paths are ignored by one of your gitignore files Use f if you really want to
  • msvcp140.dll重新安装的解决方法(一键安装方法)

    msvcp140 dll电脑文件中的dll文件 即动态链接库文件 若计算机中丢失了某个dll文件 就会导致某些软件和游戏等程序无法正常启动运行 并且导致电脑系统弹窗报错 其安装方法 1 打开浏览器输入 dll修复程序 site 并下载安装m
  • 计算机二级准考证打印通道,2019年9月计算机二级准考证打印快速入口

    2019年9月份为全国计算机等级考试时间 各省从9月11日起陆续开始打印准考证 考生与9月8日起登入打印入口进行打印 考点报名者在考点领取即可 下面我们快来看看北京 上海 陕西 吉林等各省市的打印时间和打印入口在哪 1 各省计算机二级准考证
  • Redis 7 第九讲 微服务集成Redis 应用篇

    Jedis 理论 Jedis是redis的java版本的客户端实现 使用Jedis提供的Java API对Redis进行操作 是Redis官方推崇的方式 并且 使用Jedis提供的对Redis的支持也最为灵活 全面 不足之处 就是编码复杂度
  • Java 区块链BLOCKCHAIN中区块BLOCK的hash值的计算

    Java 区块链中区块的hash值的计算 计算方法有多种 如 可以直接String拼接 也可以用stringbuffer 或者stringbuilder 这里采用了速度较快的stringbuilder 自己编程的时候可采用stringbuf
  • 实验:使用SSMS创建并管理数据库及其基本表(代码版)

    目录 一 实验要求 1 使用SQL命令创建学生课程 SCC 数据库 2 使用SQL命令学生课程数据库中的学生表 S 课程表 C 选课表 SC 并保存关闭设计窗口 3 使用SQL命令修改基本表结构 即增加和删除列 4 使用SQL命令创建及管理
  • Everything+cpolar内网穿透轻松实现公网远程访问本地硬盘文件

    公网远程访问本地硬盘文件 内网穿透 文章目录 公网远程访问本地硬盘文件 内网穿透 前言 1 下载cpolar和Everything软件 3 设定http服务器端口 4 进入cpolar的设置 5 生成公网连到本地内网穿透数据隧道 总结 前言
  • Request和ThreadLocal

    Web容器中有三个周期 request Httpsession application 其中request是客户端发出的一个请求 这个request的载体就是一个 线程 实际等同于一个线程的生命周期 Request是封装在线程上面一个抽象概
  • windows下pip安装mysqlclient失败

    环境 windows8家庭版 python3 6 7 在虚拟环境中pip install mysqlclient报错 解决方案 下载地址 ctrl f键入mysqlclient 找到对应的版本即可 博主是python3 6 7 所以选择了倒
  • 2021 程序媛跳槽记:学习计划篇

    三妹跳槽系列文章 2021 程序媛跳槽记 百度阿里字节等各大厂面经篇 2021 程序媛跳槽记 必刷LeetCode算法题 附解题报告 坦白说 我这个人不算聪明 基础也不咋样 这次跳槽我一开始是很没信心的 甚至想把这次尝试当做试水 如果受打击
  • Go_数组遍历、最大值、求和、多维数组

    数组 数组就是用来存储数据的容器 存储多个数据时数据类型要一致 如果想要保存任意类型数据 需要声明为接口类型数组 数组定义完成后 可以对数组进行赋值操作 数组是通过下标来进行操作的 下标的范围是从0开始到数组长度减1的位置 特点 数组是一种
  • 关闭windows defender教程

    由于windows自带的防护软件在后台占用大量内存 然后可以使用其他第三方软件来 然后本人使用的是火绒 这里平时的内存占用了不到100MB 然后其实这里本来应该插入一个windows defender的占用内存 我记得是在200 MB 反正
  • git 上传 github报错 (Permission denied)

    文章目录 结论 起因 新建github仓库 本地仓库初始化 结论 ssh config 中 Host 值可以随意写 cat git config 中 remote origin url git B test demo git url 值 后
  • 微服务讲堂--【5】系统自举

    这里的 系统自举 借用了操作系统的概念 在操作系统启动之前 计算机要先加载自举程序 再由自举程序加载操作系统的启动程序 整个详细过程不在这里描述 可以在网络查阅相关资料 为什么要在微服务系统中特别提及系统自举这个概念呢 因为这内容很重要 而
  • Unity 勾选development Build 区别,引起的Bug,记录一下

    Unity 勾选development Build 区别 引起的Bug 记录一下 问题 编辑器运行正常 安卓真机 Build And Run 就出现了奇怪的问题 类似数组数据出现了误差 勾选development Build 想要真机调试的
  • 第十四届蓝桥杯校内模拟赛(第二期) C++题解分享

    本人是在学校机房参加的第二期模拟赛有些题目没有忘海涵 若有什么好的建议可以提出来来分享这是本小白第一篇CSDN希望能帮助到大家 第一题没啥好说的就是直接暴力枚举 这边直接上代码 稍微注释 答案 2048 include
  • CTF—web题库笔记(难度2)

    CTF web题库笔记 难度1 CTF web题库笔记 难度4 本篇文章共12道题 目录如下 目录 1 warmup 2 supersqli 3 Web php include 4 php rce 5 Web php unserialize
  • HDFS分布式文件系统(2)Java API操作HDFS

    文章目录 1 创建Maven项目 2 添加相关依赖 3 创建日志属性文件 4 启动集群HDFS服务 5 在HDFS上创建文件 6 写入HDFS文件 6 1 将数据直接写入HDFS文件 6 2 将本地文件写入HDFS文件 7 读取HDFS文件
  • Java中使用this调用构造方法

    在 Java 中 可以使用this 关键字来调用同一个类中的其他构造方法 这种方式通常被用于避免代码重复 或者在构造方法中需要进行额外的初始化操作时 在一个类中 可以定义多个不同参数列表的构造方法 如下所示 public class MyC
  • Submitting multiple batch scripts to LSF

    原文链接 https hpc ncsu edu Documents lsf scripts php Many workflows involve submitting multiple compute jobs with slightly