File: test_without_mpi

package info (click to toggle)
hhsuite 3.3.0%2Bds-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,084 kB
  • sloc: cpp: 24,690; perl: 5,022; python: 3,017; ansic: 2,556; makefile: 111; sh: 111
file content (75 lines) | stat: -rw-r--r-- 2,955 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From: Milot Mirdita <milot@mirdita.de>
Date: Tue, 1 Sep 2020 22:23:03 +0200
Subject: Make test script work without MPI
Origin: upstream, https://github.com/soedinglab/hh-suite/commit/c296b369410900b193a6b74f0554ac90ccfd7d08
Forwarded: not-needed
--- a/data/test.sh
+++ b/data/test.sh
@@ -2,36 +2,51 @@
 
 rm -f single* search_* blits_*
 
-hhalign -i query.a3m -t query.a3m
+if $(command -v "ffindex_apply_mpi" >/dev/null 2>&1); then
+    MPI=1
+fi
+
+hhalign -i query.a3m -o result.hhr -t query.a3m
 
 ffindex_build -s single.ffdata single.ffindex query.a3m
 
-mpirun -np 2 \
-    ffindex_apply_mpi single.ffdata single.ffindex -d single_a3m_cons.ffdata -i single_a3m_cons.ffindex \
+APPLY="ffindex_apply"
+if [ -n "$MPI" ]; then
+    APPLY="mpirun -np 2 ffindex_apply_mpi"
+fi
+
+$APPLY single.ffdata single.ffindex -d single_a3m_cons.ffdata -i single_a3m_cons.ffindex \
         -- hhconsensus -i stdin -oa3m stdout -M a3m -v 0
 
-mpirun -np 2 \
-    ffindex_apply_mpi single_a3m_cons.ffdata single_a3m_cons.ffindex -d single_a3m.ffdata -i single_a3m.ffindex \
+$APPLY single_a3m_cons.ffdata single_a3m_cons.ffindex -d single_a3m.ffdata -i single_a3m.ffindex \
         -- hhfilter -i stdin -o stdout -diff 1000 -v 0
 
-mpirun -np 2 \
-    ffindex_apply_mpi single_a3m.ffdata single_a3m.ffindex -d single_hhm.ffdata -i single_hhm.ffindex \
+$APPLY single_a3m.ffdata single_a3m.ffindex -d single_hhm.ffdata -i single_hhm.ffindex \
         -- hhmake -i stdin -o stdout -v 0
 
-mpirun -np 2 cstranslate_mpi -i single -o single_cs219 -b -x 0.3 -c 4 -I a3m
+if [ -n "$MPI" ]; then
+    mpirun -np 2 cstranslate_mpi -i single -o single_cs219 -b -x 0.3 -c 4 -I a3m
+else
+    cstranslate -i single -o single_cs219 -b -x 0.3 -c 4 -I a3m -f
+fi
 
-hhblits -i query.a3m -d single -blasttab blits_app_res -n 1
+hhblits -i query.a3m -o result.hhr -d single -blasttab blits_app_res -n 1
 hhblits_omp -i single -d single -blasttab blits_omp_res -n 1
-mpirun -np 2 hhblits_mpi -i single -d single -blasttab blits_mpi_res -n 1
-
 diff <(tr -d '\000' < blits_omp_res.ffdata) blits_app_res
-diff <(tr -d '\000' < blits_mpi_res.ffdata) blits_app_res
+if [ -n "$MPI" ]; then
+    mpirun -np 2 hhblits_mpi -i single -d single -blasttab blits_mpi_res -n 1
+    diff <(tr -d '\000' < blits_mpi_res.ffdata) blits_app_res
+fi
 
-hhsearch -i query.a3m -d single -blasttab search_app_res
+hhsearch -i query.a3m -o result.hhr -d single -blasttab search_app_res
 hhsearch_omp -i single -d single -blasttab search_omp_res
-mpirun -np 2 hhsearch_mpi -i single -d single -blasttab search_mpi_res
-
 diff <(tr -d '\000' < search_omp_res.ffdata) search_app_res
-diff <(tr -d '\000' < search_mpi_res.ffdata) search_app_res
+
+if [ -n "$MPI" ]; then
+    mpirun -np 2 hhsearch_mpi -i single -d single -blasttab search_mpi_res
+    diff <(tr -d '\000' < search_mpi_res.ffdata) search_app_res
+fi
 
 diff <(cut -f 1-10,12 blits_app_res) <(cut -f 1-10,12 search_app_res)
+
+rm -f result.hhr