Skip to content

Commit

Permalink
FairRootGroupGH-442: Improve API usage in the dds-submit command
Browse files Browse the repository at this point in the history
  • Loading branch information
AnarManafov committed Jun 3, 2022
1 parent 6aa2f97 commit 9daea2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
13 changes: 2 additions & 11 deletions dds-submit/src/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "ProtocolCommands.h"
#include "SubmitCmd.h"
#include "SysHelper.h"
#include "ToolsProtocol.h"
#include "Version.h"

namespace bpo = boost::program_options;
Expand All @@ -36,12 +35,12 @@ namespace dds
size_t m_number{ 0 };
size_t m_minInstances{ 0 };
size_t m_slots{ 0 };
uint32_t m_flags{ 0 };
bool m_bListPlugins{ false };
boost::uuids::uuid m_sid = boost::uuids::nil_uuid();
std::string m_groupName;
std::string m_submissionTag;
std::string m_envCfgFilePath;
bool m_bEnableOverbooking{ false };
} SOptions_t;
//=============================================================================
inline std::ostream& operator<<(std::ostream& _stream, const SOptions& val)
Expand Down Expand Up @@ -101,7 +100,7 @@ namespace dds

options.add_options()(
"enable-overbooking",
bpo::bool_switch()->default_value(false),
bpo::bool_switch(&_options->m_bEnableOverbooking)->default_value(false),
"The flag instructs DDS RMS plug-in to not specify any CPU requirement for RMS jobs. For example, the "
"SLURM plug-in will not add the \"#SBATCH --cpus-per-task\" option to the job script. Otherwise "
"DDS will try to require as many CPU per agent as tasks slots.");
Expand Down Expand Up @@ -194,14 +193,6 @@ namespace dds
return false;
}

// Flags
dds::tools_api::SSubmitRequestData::flagContainer_t flags;
dds::tools_api::SSubmitRequestData::setFlag(
&flags,
dds::tools_api::SSubmitRequestData::ESubmitRequestFlags::enable_overbooking,
vm["enable-overbooking"].as<bool>());
_options->m_flags = flags.to_ulong();

// RMS plug-ins are always lower cased
boost::to_lower(_options->m_sRMS);

Expand Down
5 changes: 4 additions & 1 deletion dds-submit/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ int main(int argc, char* argv[])
requestInfo.m_instances = options.m_number;
requestInfo.m_minInstances = options.m_minInstances;
requestInfo.m_slots = options.m_slots;
requestInfo.m_flags = options.m_flags;
// Flags
requestInfo.setFlag(dds::tools_api::SSubmitRequestData::ESubmitRequestFlags::enable_overbooking,
options.m_bEnableOverbooking);

requestInfo.m_pluginPath = options.m_sPath;
requestInfo.m_groupName = options.m_groupName;
requestInfo.m_submissionTag = options.m_submissionTag;
Expand Down

0 comments on commit 9daea2b

Please sign in to comment.