Plotting Marker Swarms in Parallel

Plotting marker swarms for exported plots can be computationally intensive. EarthBox provides a function to accelerate marker plotting by spawning multiple processes that work on chunks of time steps. The recommended workflow is to create a script called ParallelMarkerPlotter.jl that calls the function run_parallel_marker_plotter (Parallel Marker Plotter) in the model directory that contains the script Plot.jl.

""" 
    ParallelMarkerPlotter.jl

Run the marker plotting script `Plot.jl` in parallel.

Usage:
    julia ParallelMarkerPlotter.jl <case_name> <total_steps> <num_processors>

where:
- <case_name>: The name of the case with the format case# where # is an integer.
- <total_steps>: The total number of time steps.
- <num_processors>: The number of processors to use.
        
"""
module ParallelMarkerPlotter

using EarthBox

function main()::Nothing
    run_parallel_marker_plotter()
end

end # module

if abspath(PROGRAM_FILE) == @__FILE__
    ParallelMarkerPlotter.main()
end

Parallel Marker Plotter

EarthBox.PlotToolsManager.RunParallelPlot.run_parallel_marker_plotterFunction
run_parallel_marker_plotter()::Nothing

Run the marker plotting script Plot.jl in parallel for a given range of time steps.

The script Plot.jl must be located in the model directory along with the script that executes this function. The script Plot.jl is called via command line as follows:

julia Plot.jl marker_plots case_name=<case_name> istart=<istart> iend=<iend>

This assumes that the command line plotter function run_cl_plotter() is being passed the root path to the model output directory when called from the Plot.jl script.

Usage:

``bash julia RunParallelPlot.jl <casename> <totalsteps> <num_processors>


where:
- <case_name>: The name of the case.
- <total_steps>: The total number of time steps.
- <num_processors>: The number of processors to use.

and `RunParallelPlot.jl` is the script that imports and executes this function
and is located in the model directory along with the `Plot.jl` script.
An example of the `RunParallelPlot.jl` script is as follows:

julia module RunParallelPlot

using EarthBox

function main()::Nothing runparallelmarker_plotter() end

end # module

if abspath(PROGRAM_FILE) == @FILE RunParallelPlot.main() end ```

source