Skip to content

Commit 0889c78

Browse files
committed
Error out in various search modes without GPU support
1 parent c3aa34a commit 0889c78

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

Diff for: src/workflow/Search.cpp

+21-1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ int search(int argc, const char **argv, const Command& command) {
349349
// cmd.addVariable("ALIGNMENT_DB_EXT", Parameters::isEqualDbtype(targetDbType, Parameters::DBTYPE_PROFILE_STATE_SEQ) ? ".255" : "");
350350
par.filenames[1] = targetDB;
351351
if (par.exhaustiveSearch == true) {
352+
if (par.gpu != 0) {
353+
Debug(Debug::ERROR) << "No GPU support in exhaustive search\n";
354+
EXIT(EXIT_FAILURE);
355+
}
352356
// By default (0), diskSpaceLimit (in bytes) will be set in the workflow to use as much as possible
353357
cmd.addVariable("AVAIL_DISK", SSTR(static_cast<size_t>(par.diskSpaceLimit)).c_str());
354358

@@ -389,6 +393,10 @@ int search(int argc, const char **argv, const Command& command) {
389393
FileUtil::writeFile(program, searchslicedtargetprofile_sh, searchslicedtargetprofile_sh_len);
390394
} else if (((searchMode & Parameters::SEARCH_MODE_FLAG_TARGET_PROFILE) && (searchMode & Parameters::SEARCH_MODE_FLAG_QUERY_AMINOACID))
391395
&& par.PARAM_NUM_ITERATIONS.wasSet){
396+
if (par.gpu != 0) {
397+
Debug(Debug::ERROR) << "No GPU support in profile-profile search\n";
398+
EXIT(EXIT_FAILURE);
399+
}
392400
par.exhaustiveSearch = true;
393401
par.addBacktrace = true;
394402
int originalNumIterations = par.numIterations;
@@ -437,6 +445,10 @@ int search(int argc, const char **argv, const Command& command) {
437445
FileUtil::writeFile(tmpDir + "/iterativepp.sh", iterativepp_sh, iterativepp_sh_len);
438446
program = std::string(tmpDir + "/iterativepp.sh");
439447
} else if (searchMode & Parameters::SEARCH_MODE_FLAG_TARGET_PROFILE) {
448+
if (par.gpu != 0) {
449+
Debug(Debug::ERROR) << "No GPU support in target-side k-mer search\n";
450+
EXIT(EXIT_FAILURE);
451+
}
440452
cmd.addVariable("PREFILTER_PAR", par.createParameterString(par.prefilter).c_str());
441453
// we need to align all hits in case of target Profile hits
442454
size_t maxResListLen = par.maxResListLen;
@@ -500,8 +512,12 @@ int search(int argc, const char **argv, const Command& command) {
500512
program = std::string(tmpDir + "/blastpgp.sh");
501513
} else {
502514
if (par.sensSteps > 1) {
515+
if (par.gpu != 0) {
516+
Debug(Debug::ERROR) << "No GPU support in increasing sensitivity search\n";
517+
EXIT(EXIT_FAILURE);
518+
}
503519
if (par.startSens > par.sensitivity) {
504-
Debug(Debug::ERROR) << "--start-sens should not be greater -s.\n";
520+
Debug(Debug::ERROR) << "--start-sens can not be greater than -s\n";
505521
EXIT(EXIT_FAILURE);
506522
}
507523
cmd.addVariable("SENSE_0", SSTR(par.startSens).c_str());
@@ -561,6 +577,10 @@ int search(int argc, const char **argv, const Command& command) {
561577
program = std::string(tmpDir + "/translated_search.sh");
562578
}else if(searchMode & Parameters::SEARCH_MODE_FLAG_QUERY_NUCLEOTIDE &&
563579
searchMode & Parameters::SEARCH_MODE_FLAG_TARGET_NUCLEOTIDE){
580+
if (par.gpu != 0) {
581+
Debug(Debug::ERROR) << "No GPU support in nucleotide search\n";
582+
EXIT(EXIT_FAILURE);
583+
}
564584
FileUtil::writeFile(tmpDir + "/blastn.sh", blastn_sh, blastn_sh_len);
565585
// 0: reverse, 1: forward, 2: both
566586
switch (par.strand){

0 commit comments

Comments
 (0)