SGE_TASK_IDと並列

SGE_TASK_IDと並列

私が望む方法で動作しますが、非常に非効率的なコードがあります。

for f in *.GeneSet; do
#Figure out the cell type by removing "Genes.GeneSet" from the end of the filename
  cell_type=${f%.GeneSet}

  # Process the file
  for i in `seq 1 22`; do
    python make_annot.py \
    --gene-set-file "$f" \
    --gene-coord-file  ENSG_coord.txt \
    --bimfile 1000G_EUR_Phase3_plink/1000G.EUR.QC.${i}.bim \
    --annot-file ${cell_type}.${i}.annot.gz
    done
done

これは素晴らしい作品です。さらに、入れ子になったforループなので、非常に非効率的です。各繰り返しを独立して実行するために使用したいと思います$SGE_TASK_ID。この目標をどのように達成できますか?

ベストアンサー1

おすすめ記事