Skip to content

Instantly share code, notes, and snippets.

@alexpreynolds
Created September 18, 2017 23:24
Show Gist options
  • Save alexpreynolds/f01ded9158abd970c5fd63c915464814 to your computer and use it in GitHub Desktop.
Save alexpreynolds/f01ded9158abd970c5fd63c915464814 to your computer and use it in GitHub Desktop.
Compile and test an OpenMPI-capable version of MEME suite tools
SHELL:=/bin/bash
VERSION=4.12.0
MEME_VERSION=meme_${VERSION}
GS=/net/module/sw/ghostscript/9.19/bin/gs
CONVERT=/net/module/sw/ImageMagick/7.0.2-0/bin/convert
MPIDIR=/net/module/sw/openmpi/1.10.2
TEST_FASTA=${PWD}/../data/sequences.fa
RESULTS_DIR=${PWD}/../results
DEST_DIR=${RESULTS_DIR}/${MEME_VERSION}
BIN_DIR=${DEST_DIR}/bin
NP1=1
NP2=2
NP4=4
NP32=32
NP64=64
SLURM_PARTITION=queue1
SLURM_JOB_NAME=parallel_meme_test
all:
download:
wget http://meme-suite.org/meme-software/${VERSION}/${MEME_VERSION}.tar.gz
extract:
tar zxvf ${MEME_VERSION}.tar.gz
build:
module add openmpi; \
module add ghostscript; \
module add ImageMagick; \
cd ${MEME_VERSION}; \
./configure \
--prefix=${DEST_DIR} \
--with-url="http://meme.nbcr.net/meme" \
--with-mpidir=${MPIDIR} \
--with-gs=${GS} \
--with-convert=${CONVERT} \
--enable-opt; \
${MAKE}; \
${MAKE} install; \
cd ${PWD}; \
test_local:
module add openmpi; \
module add ghostscript; \
module add ImageMagick; \
echo "NP=1"; \
time ${BIN_DIR}/meme -p ${NP1} ${TEST_FASTA} -dna -oc ${RESULTS_DIR}/local_${NP1} -nostatus -time 18000 -maxsize 60000 -mod zoops -nmotifs 10 -minw 6 -maxw 50 -revcomp; \
echo "NP=2"; \
time ${BIN_DIR}/meme -p ${NP2} ${TEST_FASTA} -dna -oc ${RESULTS_DIR}/local_${NP2} -nostatus -time 18000 -maxsize 60000 -mod zoops -nmotifs 10 -minw 6 -maxw 50 -revcomp; \
echo "NP=4"; \
time ${BIN_DIR}/meme -p ${NP4} ${TEST_FASTA} -dna -oc ${RESULTS_DIR}/local_${NP4} -nostatus -time 18000 -maxsize 60000 -mod zoops -nmotifs 10 -minw 6 -maxw 50 -revcomp; \
test_slurm:
mkdir -p ${RESULTS_DIR}/slurm_${NP32}; \
sbatch \
--partition=${SLURM_PARTITION} \
--nodes=1 \
--ntasks-per-node=32 \
--job-name=${SLURM_JOB_NAME} \
--output=${RESULTS_DIR}/slurm_${NP32}/stdout.txt \
--error=${RESULTS_DIR}/slurm_${NP32}/stderr.txt \
--wrap="module add openmpi; module add ImageMagick; module add ghostscript; time ${BIN_DIR}/meme -p ${NP32} ${TEST_FASTA} -dna -oc ${RESULTS_DIR}/slurm_${NP32} -nostatus -time 18000 -maxsize 60000 -mod zoops -nmotifs 10 -minw 6 -maxw 50 -revcomp;"; \
mkdir -p ${RESULTS_DIR}/slurm_${NP64}; \
sbatch \
--partition=${SLURM_PARTITION} \
--nodes=2 \
--ntasks-per-node=32 \
--job-name=${SLURM_JOB_NAME} \
--output=${RESULTS_DIR}/slurm_${NP64}/stdout.txt \
--error=${RESULTS_DIR}/slurm_${NP64}/stderr.txt \
--wrap="module add openmpi; module add ImageMagick; module add ghostscript; time ${BIN_DIR}/meme -p ${NP64} ${TEST_FASTA} -dna -oc ${RESULTS_DIR}/slurm_${NP64} -nostatus -time 18000 -maxsize 60000 -mod zoops -nmotifs 10 -minw 6 -maxw 50 -revcomp;" \
clean:
cd ${MEME_VERSION}; \
${MAKE} clean; \
${MAKE} distclean; \
cd ${PWD}; \
rm -rf ${MEME_VERSION}; \
rm ${MEME_VERSION}.tar.gz; \
rm -rf ${RESULTS_DIR}/local_* ${RESULTS_DIR}/slurm_*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment