Skip to content

Commit

Permalink
#105: moving StandardJob into WorkflowJob for HTCondor
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfsilva committed May 16, 2019
1 parent cea7392 commit ed5f18b
Show file tree
Hide file tree
Showing 13 changed files with 615 additions and 448 deletions.
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017-2018. The WRENCH Team.
* Copyright (c) 2017-2019. The WRENCH Team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -47,7 +47,7 @@ namespace wrench {
std::map<std::string, std::string> &service_specific_arguments) override;

void submitPilotJob(PilotJob *job, std::map<std::string, std::string> &service_specific_arguments) override;

/***********************/
/** \endcond **/
/***********************/
Expand All @@ -74,24 +74,27 @@ namespace wrench {
void processSubmitStandardJob(const std::string &answer_mailbox, StandardJob *job,
std::map<std::string, std::string> &service_specific_args);

void processSubmitPilotJob(const std::string &answer_mailbox, PilotJob *job,
std::map<std::string, std::string> &service_specific_args);

void processStandardJobCompletion(StandardJob *job);

void processNegotiatorCompletion(std::vector<StandardJob *> pending_jobs);
void processNegotiatorCompletion(std::vector<WorkflowJob *> pending_jobs);

void terminate();

/** set of compute resources **/
std::set<ComputeService *> compute_resources;
/** queue of pending jobs **/
std::vector<StandardJob *> pending_jobs;
std::vector<WorkflowJob *> pending_jobs;
/** whether a negotiator is dispatching jobs **/
bool dispatching_jobs = false;
/** whether a negotiator could not dispach jobs **/
bool resources_unavailable = false;
/** **/
std::map<std::shared_ptr<ComputeService>, unsigned long> compute_resources_map;
/** **/
std::map<StandardJob *, std::shared_ptr<ComputeService>> running_jobs;
std::map<WorkflowJob *, std::shared_ptr<ComputeService>> running_jobs;
};

}
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017-2018. The WRENCH Team.
* Copyright (c) 2017-2019. The WRENCH Team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -11,7 +11,7 @@
#define WRENCH_HTCONDORCENTRALMANAGERSERVICEMESSAGE_H

#include "wrench/services/ServiceMessage.h"
#include "wrench/workflow/job/StandardJob.h"
#include "wrench/workflow/job/WorkflowJob.h"

namespace wrench {

Expand All @@ -24,14 +24,15 @@ namespace wrench {
};

/**
* @brief A message received by a HTCondorCentralManagerService so that it is notified of a negotiator cycle completion
* @brief A message received by a HTCondorCentralManagerService so that it is notified of a negotiator
* cycle completion
*/
class NegotiatorCompletionMessage : public HTCondorCentralManagerServiceMessage {
public:
NegotiatorCompletionMessage(std::vector<StandardJob *> scheduled_jobs, double payload);
NegotiatorCompletionMessage(std::vector<WorkflowJob *> scheduled_jobs, double payload);

/** @brief List of scheduled jobs */
std::vector<StandardJob *> scheduled_jobs;
std::vector<WorkflowJob *> scheduled_jobs;
};
}

Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017-2018. The WRENCH Team.
* Copyright (c) 2017-2019. The WRENCH Team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -13,7 +13,7 @@
#include "wrench/services/Service.h"
#include "wrench/services/compute/ComputeService.h"
#include "wrench/services/compute/htcondor/HTCondorCentralManagerServiceMessagePayload.h"
#include "wrench/workflow/job/StandardJob.h"
#include "wrench/workflow/job/WorkflowJob.h"

namespace wrench {

Expand All @@ -35,8 +35,8 @@ namespace wrench {

HTCondorNegotiatorService(std::string &hostname,
std::map<std::shared_ptr<ComputeService>, unsigned long> &compute_resources,
std::map<StandardJob *, std::shared_ptr<ComputeService>> &running_jobs,
std::vector<StandardJob *> &pending_jobs,
std::map<WorkflowJob *, std::shared_ptr<ComputeService>> &running_jobs,
std::vector<WorkflowJob *> &pending_jobs,
std::string &reply_mailbox);

~HTCondorNegotiatorService();
Expand All @@ -45,16 +45,16 @@ namespace wrench {
int main() override;

struct JobPriorityComparator {
bool operator()(StandardJob *&lhs, StandardJob *&rhs);
bool operator()(WorkflowJob *&lhs, WorkflowJob *&rhs);
};

/** mailbox to reply **/
std::string reply_mailbox;
/** set of compute resources **/
std::map<std::shared_ptr<ComputeService>, unsigned long> *compute_resources;
std::map<StandardJob *, std::shared_ptr<ComputeService>> *running_jobs;
std::map<WorkflowJob *, std::shared_ptr<ComputeService>> *running_jobs;
/** queue of pending jobs **/
std::vector<StandardJob *> pending_jobs;
std::vector<WorkflowJob *> pending_jobs;
};

/***********************/
Expand Down
6 changes: 5 additions & 1 deletion include/wrench/services/compute/htcondor/HTCondorService.h
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017-2018. The WRENCH Team.
* Copyright (c) 2017-2019. The WRENCH Team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,6 +15,7 @@
#include "wrench/services/compute/htcondor/HTCondorCentralManagerService.h"
#include "wrench/services/compute/htcondor/HTCondorServiceProperty.h"
#include "wrench/services/compute/htcondor/HTCondorServiceMessagePayload.h"
#include "wrench/workflow/job/PilotJob.h"
#include "wrench/workflow/job/StandardJob.h"

namespace wrench {
Expand Down Expand Up @@ -88,6 +89,9 @@ namespace wrench {
void processSubmitStandardJob(const std::string &answer_mailbox, StandardJob *job,
std::map<std::string, std::string> &service_specific_args);

void processSubmitPilotJob(const std::string &answer_mailbox, PilotJob *job,
std::map<std::string, std::string> &service_specific_args);

void terminate();

std::string pool_name;
Expand Down
4 changes: 3 additions & 1 deletion include/wrench/workflow/job/PilotJob.h
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017. The WRENCH Team.
* Copyright (c) 2017-2019. The WRENCH Team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -50,6 +50,8 @@ namespace wrench {

PilotJob::State getState();

unsigned long getPriority();

/***********************/
/** \cond INTERNAL */
/***********************/
Expand Down
4 changes: 3 additions & 1 deletion include/wrench/workflow/job/StandardJob.h
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017-2018. The WRENCH Team.
* Copyright (c) 2017-2019. The WRENCH Team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -66,6 +66,8 @@ namespace wrench {

std::map<WorkflowFile *, std::shared_ptr<StorageService>> getFileLocations();

unsigned long getPriority();

/** @brief The job's computational tasks */
std::vector<WorkflowTask *> tasks;
/** @brief The job's total computational cost (in flops) */
Expand Down
4 changes: 3 additions & 1 deletion include/wrench/workflow/job/WorkflowJob.h
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017. The WRENCH Team.
* Copyright (c) 2017-2019. The WRENCH Team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -69,6 +69,8 @@ namespace wrench {

std::map<std::string, std::string> getServiceSpecificArguments();

virtual unsigned long getPriority();

virtual ~WorkflowJob();

protected:
Expand Down

0 comments on commit ed5f18b

Please sign in to comment.