Permalink
Browse files

Merge branch 'master' of https://github.com/soedinglab/MMseqs2

  • Loading branch information...
martin-steinegger committed Sep 14, 2018
2 parents 84a8c36 + 8c45f81 commit 875b7f1fdb72af94e974bf181021279c64026f20
Showing with 19 additions and 22 deletions.
  1. +5 −5 src/mmseqs.cpp
  2. +14 −14 src/util/apply.cpp
  3. +0 −1 src/util/createdb.cpp
  4. +0 −2 src/util/prefixid.cpp
View
@@ -298,13 +298,13 @@ std::vector<struct Command> commands = {
"Compute profile and consensus DB from a prefilter, alignment or cluster DB",
NULL,
"Martin Steinegger <martin.steinegger@mpibpc.mpg.de>",
"<i:queryDB> <targetDB> <i:resultDB> <o:profileDB>",
"<i:queryDB> <i:targetDB> <i:resultDB> <o:profileDB>",
CITATION_MMSEQS2},
{"result2pp", result2pp, &par.result2pp, COMMAND_DB,
"Merge the query profiles with target profiles according to search results and outputs an enriched profile DB",
NULL,
"Clovis Galiez & Martin Steinegger <martin.steinegger@mpibpc.mpg.de>",
"<i:queryDB> <targetDB> <i:resultDB> <o:profileDB>",
"<i:queryDB> <i:targetDB> <i:resultDB> <o:profileDB>",
CITATION_MMSEQS2},
{"sequence2profile", sequence2profile, &par.sequence2profile, COMMAND_DB,
"Compute context state from sequence DB",
@@ -402,7 +402,7 @@ std::vector<struct Command> commands = {
"Extract annotations from result db",
NULL,
"Milot Mirdita <milot@mirdita.de> & Martin Steinegger <martin.steinegger@mpibpc.mpg.de>",
"<i:resultbDB> <o:summarizedResultDB>",
"<i:resultbDB> <o:resultDB>",
CITATION_MMSEQS2|CITATION_UNICLUST},
{"summarizetabs", summarizetabs, &par.summarizetabs, COMMAND_SPECIAL,
"Extract annotations from HHblits BAST-tab-formatted results",
@@ -438,13 +438,13 @@ std::vector<struct Command> commands = {
"Convert UniProt knowledge flat file into knowledge DB for the selected column types",
NULL,
"Milot Mirdita <milot@mirdita.de>",
"<uniprotkbFile> <uniprotkbDB>",
"<i:uniprotkbFile> <o:uniprotkbDB>",
CITATION_MMSEQS2},
{"summarizeheaders", summarizeheaders, &par.summarizeheaders, COMMAND_SPECIAL,
"Return a new summarized header DB from the UniProt headers of a cluster DB",
NULL,
"Milot Mirdita <milot@mirdita.de>",
"<i:queryHeaderDB> <i:targetHeaderDB> <i:clusterDB> <o:headerDB>",
"<i:queryDB> <i:targetDB> <i:clusterDB> <o:headerDB>",
CITATION_MMSEQS2|CITATION_UNICLUST},
{"extractalignedregion", extractalignedregion, &par.extractalignedregion, COMMAND_SPECIAL,
"Extract aligned sequence region",
View
@@ -13,7 +13,6 @@
#include <sys/wait.h>
#include <sys/mman.h>
#ifdef OPENMP
#include <omp.h>
#endif
@@ -162,7 +161,7 @@ int apply_by_entry(char* data, size_t size, unsigned int key, DBWriter& writer,
if (plist[0].revents & POLLOUT) {
ssize_t write_size = batch_size;
if (size - written > 0) {
for(;;) {
for (;;) {
ssize_t w = write(fd[1], data + written, write_size);
if (w < 0) {
if (errno != EAGAIN) {
@@ -272,6 +271,8 @@ void free_local_environment(char** local_environ) {
}
int apply(int argc, const char **argv, const Command& command) {
MMseqsMPI::init(argc, argv);
Parameters& par = Parameters::getInstance();
par.parseParameters(argc, argv, command, 2, true, Parameters::PARSE_REST);
@@ -292,27 +293,28 @@ int apply(int argc, const char **argv, const Command& command) {
#endif
Debug(Debug::INFO) << "Start applying.\n";
for (int proc_idx = 0; proc_idx < par.threads; ++proc_idx) {
switch(fork()) {
for (int thread = 0; thread < par.threads; ++thread) {
switch (fork()) {
default:
break;
case -1:
Debug(Debug::ERROR) << "Could not fork worker process!\n";
EXIT(EXIT_FAILURE);
case 0: {
int rank = 0;
int procs = 1;
int mpiRank = 0;
int mpiProcs = 1;
#ifdef HAVE_MPI
while (shared_memory->ready == 0) {
usleep(10);
}
rank = shared_memory->mpiRank;
procs = shared_memory->mpiProc;
mpiRank = shared_memory->mpiRank;
mpiProcs = shared_memory->mpiProc;
std::pair<std::string, std::string> mpiDb = Util::createTmpFileNames(par.db2, par.db2Index, shared_memory->mpiRank);
std::pair<std::string, std::string> outDb = Util::createTmpFileNames(mpiDb.first, mpiDb.second, proc_idx);
std::pair<std::string, std::string> outDb = Util::createTmpFileNames(mpiDb.first, mpiDb.second, thread);
#else
std::pair<std::string, std::string> outDb = Util::createTmpFileNames(par.db2, par.db2Index, proc_idx);
std::pair<std::string, std::string> outDb = Util::createTmpFileNames(par.db2, par.db2Index, thread);
#endif
DBWriter writer(outDb.first.c_str(), outDb.second.c_str(), 1);
@@ -321,9 +323,8 @@ int apply(int argc, const char **argv, const Command& command) {
char **local_environ = local_environment();
ignore_signal(SIGPIPE);
for (size_t i = 0; i < reader.getSize(); ++i) {
if (static_cast<ssize_t>(i) % (procs * par.threads) != (rank * procs + proc_idx)) {
if (static_cast<ssize_t>(i) % (mpiProcs * par.threads) != (thread * mpiProcs + mpiRank)) {
continue;
}
@@ -358,7 +359,6 @@ int apply(int argc, const char **argv, const Command& command) {
}
}
MMseqsMPI::init(argc, argv);
#ifdef HAVE_MPI
shared_memory->mpiRank = MMseqsMPI::rank;
shared_memory->mpiProc = MMseqsMPI::numProc;
@@ -391,7 +391,7 @@ int apply(int argc, const char **argv, const Command& command) {
#ifdef HAVE_MPI
MPI_Barrier(MPI_COMM_WORLD);
if(MMseqsMPI::rank == MMseqsMPI::MASTER) {
if (MMseqsMPI::rank == MMseqsMPI::MASTER) {
// master reduces results
std::vector<std::pair<std::string, std::string>> splitFiles;
for (int proc = 0; proc < MMseqsMPI::numProc; ++proc) {
View
@@ -270,4 +270,3 @@ int createdb(int argn, const char **argv, const Command& command) {
}
return EXIT_SUCCESS;
}
View
@@ -4,8 +4,6 @@
#include "Util.h"
#include "Debug.h"
#include <fstream>
#ifdef OPENMP
#include <omp.h>
#endif

0 comments on commit 875b7f1

Please sign in to comment.