From ab81f7717dd58b5ce578f45408ae975d22b62ee2 Mon Sep 17 00:00:00 2001 From: Wael Elhaddad Date: Fri, 28 Jun 2019 10:22:46 -0700 Subject: [PATCH] Support for Extra input and parameters when submitting the Agave job --- RemoteApplication.cpp | 18 ++++++++++++++++++ RemoteApplication.h | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/RemoteApplication.cpp b/RemoteApplication.cpp index 70db96c8..50225394 100644 --- a/RemoteApplication.cpp +++ b/RemoteApplication.cpp @@ -341,6 +341,10 @@ RemoteApplication::uploadDirReturn(bool result) parameters["errorFile"]="dakota.err"; parameters["driverFile"]="workflow_driver"; parameters["modules"]="petsc"; + for (auto parameterName : extraParameters.keys()) + { + parameters[parameterName] = extraParameters[parameterName]; + } job["parameters"]=parameters; QDir theDirectory(tempDirectory); @@ -351,6 +355,10 @@ RemoteApplication::uploadDirReturn(bool result) QJsonObject inputs; inputs["inputDirectory"]=remoteDirectory; + for (auto inputName : extraInputs.keys()) + { + inputs[inputName] = extraInputs[inputName]; + } job["inputs"]=inputs; // disable the button while the job is being uploaded and started @@ -394,3 +402,13 @@ RemoteApplication::setNumTasks(int numTasks) { numProcessorsLineEdit->setText(QString::number(numTasks)); } +void RemoteApplication::setExtraInputs(QMap extraInputs) +{ + this->extraInputs = extraInputs; +} + +void RemoteApplication::setExtraParameters(QMap extraParameters) +{ + this->extraParameters = extraParameters; +} + diff --git a/RemoteApplication.h b/RemoteApplication.h index 78c4b202..22ea8f3b 100644 --- a/RemoteApplication.h +++ b/RemoteApplication.h @@ -47,6 +47,8 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #include #include #include +#include + class RemoteService; class QLineEdit; @@ -60,6 +62,8 @@ class RemoteApplication : public Application bool inputFromJSON(QJsonObject &rvObject); bool setupDoneRunApplication(QString &tmpDirectory, QString &inputFile); void setNumTasks(int numTasks); + void setExtraInputs(QMap extraInputs); + void setExtraParameters(QMap extraParameters); signals: void processResults(QString &, QString &); @@ -98,6 +102,9 @@ public slots: RemoteService *theRemoteService; QString workflowScriptName; QString shortDirName; + QMap extraInputs; + QMap extraParameters; + }; #endif // REMOTE_APPLICATION_H