LoginSignup
1
0

More than 5 years have passed since last update.

Trinityのjobをスパコンに投げるスクリプト

Last updated at Posted at 2019-01-21

このページではUGE(Univa Grid Engine)でjob管理されているPCクラスター(スパコン)にTrinityのjobを投げる方法を掲載しています。

requirements

Trinity
HPC GridRunner

job投入スクリプト

20190121_01.sh
#!/bin/sh
#$ -S /bin/sh
#$ -cwd
#$ -V
#$ -N SRR504904_1M
#$ -j y
#$ -o ./20190121_01_SRR504904_1M.log
#$ -l s_vmem=12G,mem_req=12G

./20190121_01_SRR504904_1M.sh

このスクリプトは、./20190121_01_SRR504904_1M.shに記述されたjobを投げていることを意味します。ここでは特に注意すべき点を記述します。

#$  -l s_vmem=12G,mem_req=12G

この行ではこのjobが使用するメモリ利用量を宣言しています。宣言がない場合、Javaの部分で以下のようなエラーが出ることがあります。

Error occurred during initialization of VM
Could not allocate metaspace: 1073741824 bytes

投入したいTrinityの実行スクリプト

20190121_01_SRR504904_1M.sh
#!/bin/bash

Trinity --seqType fq \
        --left $HOME/nakasho/data/SRR504904_1M/SRR504904_1M_1.fastq \
        --right $HOME/nakasho/data/SRR504904_1M/SRR504904_1M_2.fastq \
        --max_memory 128G \
        --CPU 24 \
        --output $HOME/nakasho/work/20190121/SRR504904_1M_trinity \
        --grid_exec "$HOME/src/HpcGridRunner-1.0.2/hpc_cmds_GridRunner.pl --grid_conf $HOME/src/HpcGridRunner-1.0.2/hpc_conf/BroadInst_SGE.test.conf -c" \
        --grid_node_CPU 8 \
        --grid_node_max_memory 10G

このスクリプトが実際に投入され、実行されるTrinityのスクリプトになります。以下ではTrinityのページに記述されていない部分を紹介します。

--grid_exec "$HOME/src/HpcGridRunner-1.0.2/hpc_cmds_GridRunner.pl --grid_conf $HOME/src/HpcGridRunner-1.0.2/hpc_conf/BroadInst_SGE.test.conf -c" \

Hpc GridRunnerとそのconfigファイルの記述場所を設定します。現在、私が使用しているスパコンではjob管理システムにUGEが使用されていますが、これはSGEと同様のものです。他にもLSF, PBS, SLURMがサポートされています。

--grid_node_CPU 8 \

1つのノードあたりいくつのCPUを使用するかを指定します。Trinity Phase 2 (assembly of read clusters)においてCPU=grid_node_CPUになります。

--grid_node_max_memory 10G

1つのノードあたりいくらメモリを利用するかを指定します。Trinity Phase 2 (assembly of read clusters)においてmax_memory=grid_node_max_memoryになります。

HPC GridRunnerとそのコンフィグファイル

HPC GridRunnerを用いることで、Trinityの実行がノード間で通信を行いながらjobを高速で行われるgridが形成されます。ここではそのコンフィグ方法を掲載しています。

BroadInst_SGE.test.conf
# grid type: 
grid=SGE

# template for a grid submission
cmd=qsub -V -cwd

# note -e error.file -o out.file are set internally, so dont set them in the     above cmd.

##########################################################################################
# settings below configure the Trinity job submission system, not tied to th    e grid itself.
##########################################################################################

# number of grid submissions to be maintained at steady state by the Trinity     submission system 
max_nodes=4

# number of commands that are batched into a single grid submission job.
cmds_per_node=1

gridでそのスパコンが使用しているjob管理システムを指定します。Hpc GridRunnerではLSF, SGE, PBS, SLURMが対応しています。
cmdで新たに投げる子タスクを生成しています。
max_nodesはデフォルトでは500になっていますが、今回は4ノードを利用する想定から、4に変更しています。
cmds_per_nodeは単一のグリッド送信ジョブにまとめられたコマンド数を意味します。ここではデフォルトの1を指定しています。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0