Skip to content

Commit

Permalink
Error out in various search modes without GPU support
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Nov 21, 2024
1 parent c3aa34a commit 0889c78
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/workflow/Search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ int search(int argc, const char **argv, const Command& command) {
// cmd.addVariable("ALIGNMENT_DB_EXT", Parameters::isEqualDbtype(targetDbType, Parameters::DBTYPE_PROFILE_STATE_SEQ) ? ".255" : "");
par.filenames[1] = targetDB;
if (par.exhaustiveSearch == true) {
if (par.gpu != 0) {
Debug(Debug::ERROR) << "No GPU support in exhaustive search\n";
EXIT(EXIT_FAILURE);
}
// By default (0), diskSpaceLimit (in bytes) will be set in the workflow to use as much as possible
cmd.addVariable("AVAIL_DISK", SSTR(static_cast<size_t>(par.diskSpaceLimit)).c_str());

Expand Down Expand Up @@ -389,6 +393,10 @@ int search(int argc, const char **argv, const Command& command) {
FileUtil::writeFile(program, searchslicedtargetprofile_sh, searchslicedtargetprofile_sh_len);
} else if (((searchMode & Parameters::SEARCH_MODE_FLAG_TARGET_PROFILE) && (searchMode & Parameters::SEARCH_MODE_FLAG_QUERY_AMINOACID))
&& par.PARAM_NUM_ITERATIONS.wasSet){
if (par.gpu != 0) {
Debug(Debug::ERROR) << "No GPU support in profile-profile search\n";
EXIT(EXIT_FAILURE);
}
par.exhaustiveSearch = true;
par.addBacktrace = true;
int originalNumIterations = par.numIterations;
Expand Down Expand Up @@ -437,6 +445,10 @@ int search(int argc, const char **argv, const Command& command) {
FileUtil::writeFile(tmpDir + "/iterativepp.sh", iterativepp_sh, iterativepp_sh_len);
program = std::string(tmpDir + "/iterativepp.sh");
} else if (searchMode & Parameters::SEARCH_MODE_FLAG_TARGET_PROFILE) {
if (par.gpu != 0) {
Debug(Debug::ERROR) << "No GPU support in target-side k-mer search\n";
EXIT(EXIT_FAILURE);
}
cmd.addVariable("PREFILTER_PAR", par.createParameterString(par.prefilter).c_str());
// we need to align all hits in case of target Profile hits
size_t maxResListLen = par.maxResListLen;
Expand Down Expand Up @@ -500,8 +512,12 @@ int search(int argc, const char **argv, const Command& command) {
program = std::string(tmpDir + "/blastpgp.sh");
} else {
if (par.sensSteps > 1) {
if (par.gpu != 0) {
Debug(Debug::ERROR) << "No GPU support in increasing sensitivity search\n";
EXIT(EXIT_FAILURE);
}
if (par.startSens > par.sensitivity) {
Debug(Debug::ERROR) << "--start-sens should not be greater -s.\n";
Debug(Debug::ERROR) << "--start-sens can not be greater than -s\n";
EXIT(EXIT_FAILURE);
}
cmd.addVariable("SENSE_0", SSTR(par.startSens).c_str());
Expand Down Expand Up @@ -561,6 +577,10 @@ int search(int argc, const char **argv, const Command& command) {
program = std::string(tmpDir + "/translated_search.sh");
}else if(searchMode & Parameters::SEARCH_MODE_FLAG_QUERY_NUCLEOTIDE &&
searchMode & Parameters::SEARCH_MODE_FLAG_TARGET_NUCLEOTIDE){
if (par.gpu != 0) {
Debug(Debug::ERROR) << "No GPU support in nucleotide search\n";
EXIT(EXIT_FAILURE);
}
FileUtil::writeFile(tmpDir + "/blastn.sh", blastn_sh, blastn_sh_len);
// 0: reverse, 1: forward, 2: both
switch (par.strand){
Expand Down

0 comments on commit 0889c78

Please sign in to comment.