-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from psrenergy/pr/job-requests
Send several jobs at once
- Loading branch information
Showing
8 changed files
with
162 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,48 @@ | ||
name: test | ||
name: CI | ||
on: | ||
push: | ||
branches: [master, develop] | ||
branches: [master] | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
concurrency: | ||
# Skip intermediate builds: always. | ||
# Cancel intermediate builds: only if it is a pull request build. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
jobs: | ||
test-windows: | ||
name: Test Windows | ||
runs-on: self-hosted | ||
test: | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- version: '1' | ||
os: windows-latest | ||
arch: x64 | ||
- version: '1.6' | ||
os: windows-latest | ||
arch: x64 | ||
- version: '1' | ||
os: ubuntu-latest | ||
arch: x64 | ||
- version: '1.6' | ||
os: ubuntu-latest | ||
arch: x64 | ||
steps: | ||
- name: Initialize instance | ||
run: | | ||
Remove-Item -Path '${{ github.workspace }}\*' -Force -Recurse | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Test | ||
run: | | ||
.\test\test.bat | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- uses: actions/cache@v1 | ||
env: | ||
cache-name: cache-artifacts | ||
with: | ||
path: ~/.julia/artifacts | ||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-test-${{ env.cache-name }}- | ||
${{ runner.os }}-test- | ||
${{ runner.os }}- | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
- uses: julia-actions/julia-runtest@v1 | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
# JobQueueMPI.jl | ||
# JobQueueMPI.jl | ||
|
||
[build-img]: https://github.com/psrenergy/JobQueueMPI.jl/actions/workflows/test.yml/badge.svg?branch=master | ||
[build-url]: https://github.com/psrenergy/JobQueueMPI.jl/actions?query=workflow%3ACI | ||
|
||
[codecov-img]: https://codecov.io/gh/psrenergy/JobQueueMPI.jl/coverage.svg?branch=master | ||
[codecov-url]: https://codecov.io/gh/psrenergy/JobQueueMPI.jl?branch=master | ||
|
||
| **Build Status** | **Coverage** | | ||
|:-----------------:|:-----------------:| | ||
| [![Build Status][build-img]][build-url] | [![Codecov branch][codecov-img]][codecov-url] |[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://psrenergy.github.io/PSRClassesInterface.jl/dev/) | ||
|
||
|
||
JobQueueMPI.jl is a Julia package that provides a simplified interface for running multiple jobs in parallel using [MPI.jl](https://github.com/JuliaParallel/MPI.jl). | ||
|
||
It uses the Job Queue concept to manage the jobs and the MPI processes. The user can add jobs to the queue and the package will take care of sending them to the available MPI processes. | ||
|
||
## Installation | ||
|
||
You can install JobQueueMPI.jl using the Julia package manager. From the Julia REPL, type `]` to enter the Pkg REPL mode and run: | ||
|
||
```julia | ||
pkg> add JobQueueMPI | ||
``` | ||
|
||
## How it works | ||
|
||
First, when running a program using MPI, the user has to set the number of processes that will parallelize the computation. One of these processes will be the controller, and the others will be the workers. | ||
|
||
We can easily delimit the areas of the code that will be executed only by the controller or the worker. | ||
|
||
JobQueueMPI.jl has the following components: | ||
|
||
- `Controller`: The controller is responsible for managing the jobs and the workers. It keeps track of the jobs that have been sent and received and sends the jobs to the available workers. | ||
- `Worker`: The worker is responsible for executing the jobs. It receives the jobs from the controller, executes them, and sends the results back to the controller. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
@enum WorkerStatus begin | ||
WORKER_BUSY = 0 | ||
WORKER_AVAILABLE = 1 | ||
WORKER_TERMINATED = 2 | ||
end | ||
|
||
mutable struct Worker | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters