Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ if(${XMIPP_USE_CUDA})
string(APPEND CMAKE_CUDA_FLAGS " --expt-extended-lambda")

# 1. Define base architectures supported by almost everyone (Turing, Ampere)
set(XMIPP_CUDA_ARCHS 75 86 89 90)
set(XMIPP_CUDA_ARCHS 75 86)

if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "12.0.0")
list(APPEND XMIPP_CUDA_ARCHS 89 90)
endif()

if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "13.0.0")
list(APPEND XMIPP_CUDA_ARCHS 61)
endif()
Expand Down
26 changes: 18 additions & 8 deletions src/xmipp/libraries/tomo/tomo_detect_misalignment_residuals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,25 @@
std::cout << "Running residual statistical analysis..." << std::endl;

// Compose commnad with realtive path to script
char path[PATH_MAX], scriptPath[2048];
ssize_t len = readlink("/proc/self/exe", path, sizeof(path) - 1);
path[len] = '\0'; // Null-terminate
char path[PATH_MAX];

char *pos = strstr(path, "/dist/");
if (pos) *pos = '\0'; // Cut at "/dist/"
ssize_t len = readlink("/proc/self/exe", path, sizeof(path) - 1);
if (len < 0)
throw std::runtime_error("Cannot determine executable path");

Check warning on line 285 in src/xmipp/libraries/tomo/tomo_detect_misalignment_residuals.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define and throw a dedicated exception instead of using a generic one.

See more on https://sonarcloud.io/project/issues?id=I2PC_xmipp&issues=AZ8dZblcA3lZAarPFoWe&open=AZ8dZblcA3lZAarPFoWe&pullRequest=1080

snprintf(scriptPath, sizeof(scriptPath), "%s/src/xmipp/applications/scripts/tomo_misalignment_resid_statistics/batch_tomo_misalignment_resid_statistics.py", path);
std::string root(path, len);

// Remove everything from "/dist/" onwards
std::size_t pos = root.find("/dist/");
if (pos != std::string::npos)
root.erase(pos);

std::string scriptPath =
root +
"/src/xmipp/applications/scripts/"
"tomo_misalignment_resid_statistics/"
"batch_tomo_misalignment_resid_statistics.py";

size_t lastindex = fnOut.find_last_of("\\/");
std::string rawname = fnOut.substr(0, lastindex);

Expand All @@ -296,9 +306,9 @@
std::string cmd;

#ifdef DEBUG_RESIDUAL_STATISTICS_FILE
cmd = "python3 " + std::string(scriptPath) + " -i " + fnResidualInfo + " -o " + fnStats + " --debug";
cmd = "python3 " + scriptPath + " -i " + fnResidualInfo + " -o " + fnStats + " --debug";
#else
cmd = "python3 " + std::string(scriptPath) + " -i " + fnResidualInfo + " -o " + fnStats;
cmd = "python3 " + scriptPath + " -i " + fnResidualInfo + " -o " + fnStats;
#endif

std::cout << "Running command: " << cmd << std::endl;
Expand Down