mirror of
https://gitlab.cs.uni-saarland.de/hpc/cc-condor-sync.git
synced 2025-07-27 23:26:10 +02:00
Fix AssignedGPUs
parsing.
This commit is contained in:
@@ -267,12 +267,19 @@ std::string getRemoteHost(std::string_view slot) {
|
||||
return {++atIt, subIt};
|
||||
}
|
||||
|
||||
std::string removeQuotes(const std::string &value) {
|
||||
if (value[0] == '"' && value.back() == '"') {
|
||||
return value.substr(1, value.size() - 2);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
std::vector<std::string>
|
||||
CCSyncPlugin::getAccelerators(const CondorJob &job,
|
||||
const std::string &hostname) {
|
||||
if (auto hostIt = gpuMap.find(hostname); hostIt != gpuMap.end()) {
|
||||
if (auto gpuIt = job.find("AssignedGPUs"); gpuIt != job.end()) {
|
||||
std::istringstream gpuStream{gpuIt->second};
|
||||
std::istringstream gpuStream{removeQuotes(gpuIt->second)};
|
||||
std::vector<std::string> gpus;
|
||||
std::string gpu;
|
||||
while (std::getline(gpuStream, gpu, ',')) {
|
||||
@@ -313,13 +320,6 @@ bool jobHasRequiredClassAds(const CondorJob &job) {
|
||||
jobHasClassAd(job, "EnteredCurrentStatus");
|
||||
}
|
||||
|
||||
std::string removeQuotes(const std::string &value) {
|
||||
if (value[0] == '"' && value.back() == '"') {
|
||||
return value.substr(1, value.size() - 2);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
void CCSyncPlugin::sendPostRequest(const std::string &route,
|
||||
const std::string &body) const noexcept {
|
||||
dprintf(D_VERBOSE, "POST body: %s\n", body.c_str());
|
||||
|
Reference in New Issue
Block a user