Skip to content

Commit

Permalink
example fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 16, 2024
1 parent 7eab3d1 commit 0bddb01
Show file tree
Hide file tree
Showing 81 changed files with 289 additions and 288 deletions.
8 changes: 4 additions & 4 deletions examples/action_api/XRootD/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
**/

#define GFLOP (1000.0 * 1000.0 * 1000.0)
#define MBYTE (1000.0 * 1000.0)
#define GBYTE (1000.0 * 1000.0 * 1000.0)
#define MBYTE (1000000ULL)
#define GBYTE (1000000000ULL)

#include <iostream>
#include <iomanip>
Expand Down Expand Up @@ -169,7 +169,7 @@ namespace wrench {
*
* @param event: the event
*/
void Controller::processEventCompoundJobCompletion(std::shared_ptr<CompoundJobCompletedEvent> event) {
void Controller::processEventCompoundJobCompletion(const std::shared_ptr<CompoundJobCompletedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->job;
WRENCH_INFO("Notified that compound job %s has successfully completed", job->getName().c_str());
Expand All @@ -180,7 +180,7 @@ namespace wrench {
*
* @param event: the event
*/
void Controller::processEventCompoundJobFailure(std::shared_ptr<CompoundJobFailedEvent> event) {
void Controller::processEventCompoundJobFailure(const std::shared_ptr<CompoundJobFailedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->job;
auto action = *(job->getActions().begin());
Expand Down
4 changes: 2 additions & 2 deletions examples/action_api/XRootD/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace wrench {

protected:
// Overridden method
void processEventCompoundJobCompletion(std::shared_ptr<CompoundJobCompletedEvent>) override;
void processEventCompoundJobFailure(std::shared_ptr<CompoundJobFailedEvent> event) override;
void processEventCompoundJobCompletion(const std::shared_ptr<CompoundJobCompletedEvent> &event) override;
void processEventCompoundJobFailure(const std::shared_ptr<CompoundJobFailedEvent> &event) override;

private:
// main() method of the Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "TwoActionsAtATimeExecutionController.h"

#define GFLOP (1000.0 * 1000.0 * 1000.0)
#define MB (1000.0 * 1000.0)
#define MB (1000000ULL)

WRENCH_LOG_CATEGORY(custom_controller, "Log category for TwoActionsAtATimeExecutionController");

Expand Down Expand Up @@ -118,7 +118,7 @@ namespace wrench {
*
* @param event: the event
*/
void TwoActionsAtATimeExecutionController::processEventCompoundJobCompletion(std::shared_ptr<CompoundJobCompletedEvent> event) {
void TwoActionsAtATimeExecutionController::processEventCompoundJobCompletion(const std::shared_ptr<CompoundJobCompletedEvent> &event) {
WRENCH_INFO("Compound job %s has completed:", event->job->getName().c_str());
// sort actions by start time
auto job_actions = event->job->getActions();
Expand All @@ -145,7 +145,7 @@ namespace wrench {
*
* @param event: the event
*/
void TwoActionsAtATimeExecutionController::processEventCompoundJobFailure(std::shared_ptr<CompoundJobFailedEvent> event) {
void TwoActionsAtATimeExecutionController::processEventCompoundJobFailure(const std::shared_ptr<CompoundJobFailedEvent> &event) {
WRENCH_INFO("Compound job %s has failed!", event->job->getName().c_str());
throw std::runtime_error("This should not happen in this example");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ namespace wrench {

protected:
// Overridden method
void processEventCompoundJobCompletion(std::shared_ptr<CompoundJobCompletedEvent>) override;
void processEventCompoundJobFailure(std::shared_ptr<CompoundJobFailedEvent>) override;
void processEventCompoundJobCompletion(const std::shared_ptr<CompoundJobCompletedEvent> &event) override;
void processEventCompoundJobFailure(const std::shared_ptr<CompoundJobFailedEvent> &event) override;

private:
// main() method of the WMS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "GreedyExecutionController.h"

#define GFLOP (1000.0 * 1000.0 * 1000.0)
#define MB (1000.0 * 1000.0)
#define MB (1000000ULL)

WRENCH_LOG_CATEGORY(custom_controller, "Log category for GreedyExecutionController");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "smpi/smpi.h"

#define GFLOP (1000.0 * 1000.0 * 1000.0)
#define MB (1000.0 * 1000.0)
#define MB (1000000ULL)

#define COMMUNICATOR_SIZE 16UL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "GreedyExecutionController.h"

#define GFLOP (1000.0 * 1000.0 * 1000.0)
#define MB (1000.0 * 1000.0)
#define MB (1000000ULL)

WRENCH_LOG_CATEGORY(custom_controller, "Log category for GreedyExecutionController");

Expand Down Expand Up @@ -158,15 +158,15 @@ namespace wrench {
* @brief Method to handle a compound job failure
* @param event: the event
*/
void GreedyExecutionController::processEventCompoundJobFailure(std::shared_ptr<CompoundJobFailedEvent> event) {
void GreedyExecutionController::processEventCompoundJobFailure(const std::shared_ptr<CompoundJobFailedEvent> &event) {
WRENCH_INFO("Job %s failed!", event->job->getName().c_str());
}

/**
* @brief Method to handle a compound job completion
* @param event: the event
*/
void GreedyExecutionController::processEventCompoundJobCompletion(std::shared_ptr<CompoundJobCompletedEvent> event) {
void GreedyExecutionController::processEventCompoundJobCompletion(const std::shared_ptr<CompoundJobCompletedEvent> &event) {
WRENCH_INFO("Job %s completed successfully!", event->job->getName().c_str());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ namespace wrench {

int num_actions;

void processEventCompoundJobFailure(std::shared_ptr<CompoundJobFailedEvent>) override;
void processEventCompoundJobCompletion(std::shared_ptr<CompoundJobCompletedEvent>) override;
void processEventCompoundJobFailure(const std::shared_ptr<CompoundJobFailedEvent> &event) override;
void processEventCompoundJobCompletion(const std::shared_ptr<CompoundJobCompletedEvent> &event) override;
};
}// namespace wrench
#endif//WRENCH_EXAMPLE_GREEDY_EXECUTION_CONTROLLER_H
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "CommunicatingActionsController.h"// Controller implementation

#define KB 1000.0
#define KB 1000ULL
#define MB (1000 * KB)
#define GB (1000 * MB)
#define GB (1000 * MB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "CommunicatingActionsController.h"

#define GFLOP (1000.0 * 1000.0 * 1000.0)
#define MB (1000.0 * 1000.0)
#define MB (1000000ULL)

#define COMMUNICATOR_SIZE 16UL

Expand Down Expand Up @@ -103,7 +103,7 @@ namespace wrench {

// Participate in an all to all communication
unsigned long num_comm_bytes = 1 * MB;
std::map<unsigned long, double> sends;
std::map<unsigned long, sg_size_t> sends;
for (unsigned long i = 0; i < num_ranks; i++) {
if (i != my_rank) {
sends[i] = num_comm_bytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include "JobActionFailureController.h"

#define GFLOP (1000.0 * 1000.0 * 1000.0)
#define MB (1000.0 * 1000.0)
#define GB (1000.0 * 1000.0 * 1000.0)
#define MB (1000000ULL)
#define GB (1000000000ULL)

WRENCH_LOG_CATEGORY(custom_controller, "Log category for JobActionFailureController");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "MultiActionMultiJobController.h"

#define GFLOP (1000.0 * 1000.0 * 1000.0)
#define MB (1000.0 * 1000.0)
#define MB (1000000ULL)

WRENCH_LOG_CATEGORY(custom_controller, "Log category for MultiActionMultiJobController");

Expand Down Expand Up @@ -144,7 +144,7 @@ namespace wrench {
action->getName().c_str(),
action->getExecutionHistory().top().execution_host.c_str(),
action->getExecutionHistory().top().physical_execution_host.c_str());
WRENCH_INFO(" - it used %lu cores for computation, and %.2lf bytes of RAM",
WRENCH_INFO(" - it used %lu cores for computation, and %llu bytes of RAM",
action->getExecutionHistory().top().num_cores_allocated,
action->getExecutionHistory().top().ram_allocated);
WRENCH_INFO(" - it started at time %.2lf and finished at time %.2lf",
Expand Down
6 changes: 3 additions & 3 deletions examples/action_api/storage-service-proxy/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define GFLOP (1000.0 * 1000.0 * 1000.0)
#define MBYTE (1000.0 * 1000.0)
#define GBYTE (1000.0 * 1000.0 * 1000.0)
#define GB (1000000000ULL)

#include <iostream>
#include <iomanip>
Expand Down Expand Up @@ -172,7 +172,7 @@ namespace wrench {
*
* @param event: the event
*/
void Controller::processEventCompoundJobCompletion(std::shared_ptr<CompoundJobCompletedEvent> event) {
void Controller::processEventCompoundJobCompletion(const std::shared_ptr<CompoundJobCompletedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->job;
WRENCH_INFO("Notified that compound job %s has successfully completed", job->getName().c_str());
Expand All @@ -183,7 +183,7 @@ namespace wrench {
*
* @param event: the event
*/
void Controller::processEventCompoundJobFailure(std::shared_ptr<CompoundJobFailedEvent> event) {
void Controller::processEventCompoundJobFailure(const std::shared_ptr<CompoundJobFailedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->job;
auto action = *(job->getActions().begin());
Expand Down
4 changes: 2 additions & 2 deletions examples/action_api/storage-service-proxy/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ namespace wrench {

protected:
// Overridden method
void processEventCompoundJobCompletion(std::shared_ptr<CompoundJobCompletedEvent>) override;
void processEventCompoundJobFailure(std::shared_ptr<CompoundJobFailedEvent> event) override;
void processEventCompoundJobCompletion(const std::shared_ptr<CompoundJobCompletedEvent> &event) override;
void processEventCompoundJobFailure(const std::shared_ptr<CompoundJobFailedEvent> &event) override;

private:
// main() method of the Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "SuperCustomActionController.h"

#define GFLOP (1000.0 * 1000.0 * 1000.0)
#define MB (1000.0 * 1000.0)
#define MB (1000000ULL)

WRENCH_LOG_CATEGORY(custom_controller, "Log category for SuperCustomActionController");

Expand Down Expand Up @@ -138,7 +138,7 @@ namespace wrench {
action->getName().c_str(),
action->getExecutionHistory().top().execution_host.c_str(),
action->getExecutionHistory().top().physical_execution_host.c_str());
WRENCH_INFO(" - it used %lu cores for computation, and %.2lf bytes of RAM",
WRENCH_INFO(" - it used %lu cores for computation, and %luu bytes of RAM",
action->getExecutionHistory().top().num_cores_allocated,
action->getExecutionHistory().top().ram_allocated);
WRENCH_INFO(" - it started at time %.2lf and finished at time %.2lf",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace wrench {
*
* @param event: the event
*/
void TwoTasksAtATimeWMS::processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent> event) {
void TwoTasksAtATimeWMS::processEventStandardJobCompletion(const std::shared_ptr<StandardJobCompletedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->standard_job;
/* Retrieve the job's tasks */
Expand All @@ -152,7 +152,7 @@ namespace wrench {
*
* @param event: the event
*/
void TwoTasksAtATimeWMS::processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent> event) {
void TwoTasksAtATimeWMS::processEventStandardJobFailure(const std::shared_ptr<StandardJobFailedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->standard_job;
WRENCH_INFO("Notified that a standard job has failed (failure cause: %s)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace wrench {

protected:
// Overridden method
void processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent>) override;
void processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent>) override;
void processEventStandardJobCompletion(const std::shared_ptr<StandardJobCompletedEvent> &event) override;
void processEventStandardJobFailure(const std::shared_ptr<StandardJobFailedEvent> &event) override;

private:
// main() method of the WMS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace wrench {
*
* @param event: the event
*/
void WorkflowAsAsingleJobWMS::processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent> event) {
void WorkflowAsAsingleJobWMS::processEventStandardJobCompletion(const std::shared_ptr<StandardJobCompletedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->standard_job;
/* Retrieve the job's first (and in our case only) task */
Expand All @@ -115,7 +115,7 @@ namespace wrench {
*
* @param event: the event
*/
void WorkflowAsAsingleJobWMS::processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent> event) {
void WorkflowAsAsingleJobWMS::processEventStandardJobFailure(const std::shared_ptr<StandardJobFailedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->standard_job;
/* Retrieve the job's first (and in our case only) task */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace wrench {

protected:
// Overridden methods
void processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent>) override;
void processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent>) override;
void processEventStandardJobCompletion(const std::shared_ptr<StandardJobCompletedEvent> &event) override;
void processEventStandardJobFailure(const std::shared_ptr<StandardJobFailedEvent> &event) override;

private:
// main() method of the WMS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace wrench {
*
* @param event: the event
*/
void OneTaskAtATimeWMS::processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent> event) {
void OneTaskAtATimeWMS::processEventStandardJobCompletion(const std::shared_ptr<StandardJobCompletedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->standard_job;
/* Retrieve the job's first (and in our case only) task */
Expand All @@ -106,7 +106,7 @@ namespace wrench {
*
* @param event: the event
*/
void OneTaskAtATimeWMS::processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent> event) {
void OneTaskAtATimeWMS::processEventStandardJobFailure(const std::shared_ptr<StandardJobFailedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->standard_job;
/* Retrieve the job's first (and in our case only) task */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ namespace wrench {

protected:
// Overridden method
void processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent>) override;
void processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent>) override;
void processEventStandardJobCompletion(const std::shared_ptr<StandardJobCompletedEvent> &event) override;
void processEventStandardJobFailure(const std::shared_ptr<StandardJobFailedEvent> &event) override;

private:
// main() method of the WMS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace wrench {
*
* @param event: the event
*/
void ComplexJobWMS::processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent> event) {
void ComplexJobWMS::processEventStandardJobCompletion(const std::shared_ptr<StandardJobCompletedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->standard_job;
/* Retrieve the job's first (and in our case only) task */
Expand All @@ -125,7 +125,7 @@ namespace wrench {
*
* @param event: the event
*/
void ComplexJobWMS::processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent> event) {
void ComplexJobWMS::processEventStandardJobFailure(const std::shared_ptr<StandardJobFailedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->standard_job;
/* Retrieve the job's first (and in our case only) task */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ namespace wrench {

protected:
// Overridden method
void processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent>) override;
void processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent>) override;
void processEventStandardJobCompletion(const std::shared_ptr<StandardJobCompletedEvent> &event) override;
void processEventStandardJobFailure(const std::shared_ptr<StandardJobFailedEvent> &event) override;

private:
// main() method of the WMS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ namespace wrench {
*
* @param event: the event
*/
void DataMovementWMS::processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent> event) {
void DataMovementWMS::processEventStandardJobCompletion(const std::shared_ptr<StandardJobCompletedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->standard_job;
/* Retrieve the job's first (and in our case only) task */
Expand All @@ -149,7 +149,7 @@ namespace wrench {
*
* @param event: the event
*/
void DataMovementWMS::processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent> event) {
void DataMovementWMS::processEventStandardJobFailure(const std::shared_ptr<StandardJobFailedEvent> &event) {
/* Retrieve the job that this event is for */
auto job = event->standard_job;
/* Retrieve the job's first (and in our case only) task */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ namespace wrench {

protected:
// Overridden method
void processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent>) override;
void processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent>) override;
void processEventStandardJobCompletion(const std::shared_ptr<StandardJobCompletedEvent> &event) override;
void processEventStandardJobFailure(const std::shared_ptr<StandardJobFailedEvent> &event) override;

private:
// main() method of the WMS
Expand Down
Loading

0 comments on commit 0bddb01

Please sign in to comment.