2022-11-23 11:55:40 -05:00
|
|
|
//
|
|
|
|
// Created by brett on 22/11/22.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef STEP_3_MPI_H
|
|
|
|
#define STEP_3_MPI_H
|
|
|
|
|
2022-12-02 23:32:18 -05:00
|
|
|
#include <config.h>
|
2022-11-23 11:55:40 -05:00
|
|
|
|
|
|
|
#ifdef USE_MPI
|
2022-12-12 15:47:56 -05:00
|
|
|
|
2022-11-23 11:55:40 -05:00
|
|
|
#include <mpi.h>
|
2022-12-02 23:32:18 -05:00
|
|
|
#include <queue>
|
|
|
|
#include <engine/raytracing.h>
|
2022-11-23 11:55:40 -05:00
|
|
|
|
|
|
|
namespace Raytracing {
|
2022-12-12 15:47:56 -05:00
|
|
|
|
2022-11-23 11:55:40 -05:00
|
|
|
extern int numberOfProcesses;
|
|
|
|
extern int currentProcessID;
|
2022-12-12 15:47:56 -05:00
|
|
|
|
2022-11-23 11:55:40 -05:00
|
|
|
class MPI {
|
2022-12-12 15:47:56 -05:00
|
|
|
public:
|
2022-12-13 01:33:31 -05:00
|
|
|
/**
|
|
|
|
* Create the OpenMPI instance
|
|
|
|
* @param argc argc provided as inputs to the main function
|
|
|
|
* @param argv argv provided as inputs to the main function
|
|
|
|
*/
|
2022-12-12 15:47:56 -05:00
|
|
|
static void init(int argc, char** argv);
|
2022-12-13 01:33:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the queue of image bounds which this process needs to do work on
|
|
|
|
*/
|
2022-12-13 17:36:01 -05:00
|
|
|
static std::queue<RayCasterImageBounds> getCurrentImageRegionAssociation(RayCaster& raycaster);
|
2022-11-23 11:55:40 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif //STEP_3_MPI_H
|