V3FIT
Data Types | Functions/Subroutines
bmw_parallel_context Module Reference

Defines the base class of the type bmw_parallel_context_class. This contains the state variables needed by BMW for parallel computation. More...

Data Types

type  bmw_parallel_context_class
 Base class representing a bmw parallel context. This contains all memory needed parameters needed to parallel processing. More...
 
interface  bmw_parallel_context_reduce
 Interface for the buffer reduction. More...
 

Functions/Subroutines

type(bmw_parallel_context_class) function, pointer bmw_parallel_context_construct (comm)
 Construct a bmw_context_class object. More...
 
subroutine bmw_parallel_context_destruct (this, finalize)
 Deconstruct a bmw_parallel_context_class object. More...
 
subroutine bmw_parallel_context_abort (status)
 Abort the entire program. More...
 
subroutine bmw_parallel_context_set_threads (this, num_threads)
 Set the number of threads. More...
 
subroutine bmw_parallel_context_report (this, io_unit)
 Report the number of parallel processes and threads. More...
 
subroutine bmw_parallel_context_reduce1 (this, buffer)
 Reduce parallel buffers. More...
 
subroutine bmw_parallel_context_reduce2 (this, buffer)
 Reduce parallel buffers. More...
 
subroutine bmw_parallel_context_reduce3 (this, buffer)
 Reduce parallel buffers. More...
 
subroutine bmw_parallel_context_reduce4 (this, buffer)
 Reduce parallel buffers. More...
 
pure integer function bmw_parallel_context_start (this, total)
 Compute the start index of a flat array. More...
 
pure integer function bmw_parallel_context_end (this, total)
 Compute the end index of a flat array. More...
 
pure integer function bmw_parallel_context_i (index, num_i)
 Compute the i index of a flat array. More...
 
pure integer function bmw_parallel_context_j (index, num_i, num_j)
 Compute the j index of a flat array. More...
 
pure integer function bmw_parallel_context_k (index, num_i, num_j)
 Compute the k index of a flat array. More...
 

Detailed Description

Defines the base class of the type bmw_parallel_context_class. This contains the state variables needed by BMW for parallel computation.

Function/Subroutine Documentation

◆ bmw_parallel_context_abort()

subroutine bmw_parallel_context::bmw_parallel_context_abort ( integer, intent(in)  status)

Abort the entire program.

Aborts everything.

Parameters
[in]statusError number to abort with.

Definition at line 177 of file bmw_parallel_context.f.

◆ bmw_parallel_context_construct()

type (bmw_parallel_context_class) function, pointer bmw_parallel_context::bmw_parallel_context_construct ( integer, intent(in)  comm)

Construct a bmw_context_class object.

Allocates memory and initializes a bmw_parallel_context_class object.

Parameters
[in]commMPI communicator. Only used if MPI support has been compiled in.
Returns
A pointer to a constructed bmw_parallel_context_class object.

Definition at line 75 of file bmw_parallel_context.f.

◆ bmw_parallel_context_destruct()

subroutine bmw_parallel_context::bmw_parallel_context_destruct ( type (bmw_parallel_context_class), pointer  this,
logical, intent(in)  finalize 
)

Deconstruct a bmw_parallel_context_class object.

Deallocates memory and uninitializes a bmw_parallel_context_class object.

Parameters
[in,out]thisA bmw_parallel_context_class instance.
[in]finalizeFlag to call MPI_FINALIZE. Only used if MPI support has been compiled in.

Definition at line 143 of file bmw_parallel_context.f.

◆ bmw_parallel_context_end()

pure integer function bmw_parallel_context::bmw_parallel_context_end ( type (bmw_parallel_context_class), intent(in)  this,
integer, intent(in)  total 
)

Compute the end index of a flat array.

The total problem size is divided by the number of processes. Any remaining elements are added to the first few processes.

Parameters
[in]thisA bmw_parallel_context_class instance.
[in]totalTotal number of elements in the loop.
Returns
The Ending index for parallel multiprocess computation.

Definition at line 472 of file bmw_parallel_context.f.

◆ bmw_parallel_context_i()

pure integer function bmw_parallel_context::bmw_parallel_context_i ( integer, intent(in)  index,
integer, intent(in)  num_i 
)

Compute the i index of a flat array.

The total problem size represents a three dimensional space. From the flat index, compute the i index.

Parameters
[in]indexFlat index.
[in]num_iSize of the ith dimension.
Returns
The index of the i dimension.

Definition at line 515 of file bmw_parallel_context.f.

◆ bmw_parallel_context_j()

pure integer function bmw_parallel_context::bmw_parallel_context_j ( integer, intent(in)  index,
integer, intent(in)  num_i,
integer, intent(in)  num_j 
)

Compute the j index of a flat array.

The total problem size represents a three dimensional space. From the flat index, compute the j index.

Parameters
[in]indexFlat index.
[in]num_iSize of the ith dimension.
[in]num_jSize of the jth dimension.
Returns
The index of the j dimension.

Definition at line 540 of file bmw_parallel_context.f.

◆ bmw_parallel_context_k()

pure integer function bmw_parallel_context::bmw_parallel_context_k ( integer, intent(in)  index,
integer, intent(in)  num_i,
integer, intent(in)  num_j 
)

Compute the k index of a flat array.

The total problem size represents a three dimensional space. From the flat index, compute the k index.

Parameters
[in]indexFlat index.
[in]num_iSize of the ith dimension.
[in]num_jSize of the jth dimension.
Returns
The index of the k dimension.

Definition at line 566 of file bmw_parallel_context.f.

◆ bmw_parallel_context_reduce1()

subroutine bmw_parallel_context::bmw_parallel_context_reduce1 ( type (bmw_parallel_context_class), intent(in)  this,
real (rprec), dimension(:), intent(inout)  buffer 
)

Reduce parallel buffers.

Reduce a buffer from all parallel processes. In the single processes case, this reduces to nothing. This reduces a 1D buffer.

Parameters
[in]thisA bmw_parallel_context_class instance.
[in,out]bufferBuffer to reduce.

Definition at line 288 of file bmw_parallel_context.f.

◆ bmw_parallel_context_reduce2()

subroutine bmw_parallel_context::bmw_parallel_context_reduce2 ( type (bmw_parallel_context_class), intent(in)  this,
real (rprec), dimension(:,:), intent(inout)  buffer 
)

Reduce parallel buffers.

Reduce a buffer from all parallel processes. In the single processes case, this reduces to nothing. This reduces a 2D buffer.

Parameters
[in]thisA bmw_parallel_context_class instance.
[in,out]bufferBuffer to reduce.

Definition at line 323 of file bmw_parallel_context.f.

◆ bmw_parallel_context_reduce3()

subroutine bmw_parallel_context::bmw_parallel_context_reduce3 ( type (bmw_parallel_context_class), intent(in)  this,
real (rprec), dimension(:,:,:), intent(inout)  buffer 
)

Reduce parallel buffers.

Reduce a buffer from all parallel processes. In the single processes case, this reduces to nothing. This reduces a 3D buffer.

Parameters
[in]thisA bmw_parallel_context_class instance.
[in,out]bufferBuffer to reduce.

Definition at line 358 of file bmw_parallel_context.f.

◆ bmw_parallel_context_reduce4()

subroutine bmw_parallel_context::bmw_parallel_context_reduce4 ( type (bmw_parallel_context_class), intent(in)  this,
real (rprec), dimension(:,:,:,:), intent(inout)  buffer 
)

Reduce parallel buffers.

Reduce a buffer from all parallel processes. In the single processes case, this reduces to nothing. This reduces a 4D buffer.

Parameters
[in]thisA bmw_parallel_context_class instance.
[in,out]bufferBuffer to reduce.

Definition at line 393 of file bmw_parallel_context.f.

◆ bmw_parallel_context_report()

subroutine bmw_parallel_context::bmw_parallel_context_report ( type (bmw_parallel_context_class), intent(inout)  this,
integer, intent(in)  io_unit 
)

Report the number of parallel processes and threads.

Provides a summary report if the number of threads and processes currently configured.

Parameters
[in]thisA bmw_parallel_context_class instance.
[in]io_unitUnit number to write messages to.

Definition at line 246 of file bmw_parallel_context.f.

◆ bmw_parallel_context_set_threads()

subroutine bmw_parallel_context::bmw_parallel_context_set_threads ( type (bmw_parallel_context_class), intent(inout)  this,
integer, intent(in)  num_threads 
)

Set the number of threads.

Sets the number of OpenMP threads to use.

Parameters
[in]thisA bmw_parallel_context_class instance.
[in]num_threadsNumber of threads to use.

Definition at line 204 of file bmw_parallel_context.f.

◆ bmw_parallel_context_start()

pure integer function bmw_parallel_context::bmw_parallel_context_start ( type (bmw_parallel_context_class), intent(in)  this,
integer, intent(in)  total 
)

Compute the start index of a flat array.

The total problem size is divided by the number of processes. Any remaining elements are added to the first few processes.

Parameters
[in]thisA bmw_parallel_context_class instance.
[in]totalTotal number of elements in the loop.
Returns
The Starting index for parallel multiprocess computation.

Definition at line 429 of file bmw_parallel_context.f.