ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_parallelism::image_type Type Reference

This is the image_type type for generating objects that contain information about the current image/processor/thread and facilitate its synchronization with other processes, or the global finalization of all inter-process parallel communications (e.g., as is done in MPI applications). More...

Public Member Functions

procedure, nopass sync => setImageSynced
 
procedure, nopass finalize => setImageFinalized
 

Public Attributes

integer(IK) count = -huge(1_IK)
 The scalar integer of default kind IK representing the total count of runtime parallel processes available within the current communication. More...
 
integer(IK) id = -huge(1_IK)
 The scalar integer of default kind IK representing the ID of the runtime parallel process starting with 1: 1, 2, 3, ... More...
 
type(imageis_typeis = imageis_type()
 The scalar of type imageis_type containing logical components that signify the current image role. More...
 
character(:, SK), allocatable label
 The allocatable scalar character of default kind SK containing the ID of the current process in the format @process(ID). More...
 

Detailed Description

This is the image_type type for generating objects that contain information about the current image/processor/thread and facilitate its synchronization with other processes, or the global finalization of all inter-process parallel communications (e.g., as is done in MPI applications).

  1. Within the Fortran terminology, an image (or process) is equivalent to a replication of the program having its own set of data objects.
  2. The number of images could be the same as or more than or less than the available number of physical processors.
  3. A particular implementation may permit the number of images to be chosen at compile time, at link time, or at execution time.
  4. Each image executes asynchronously, and the normal rules of Fortran apply within each image.
  5. The execution sequence can differ from image to image as specified by the programmer who, with the help of a unique image index, determines the actual path using normal Fortran control constructs and explicit synchronizations.
Returns
image : The output scalar of type image_type.


Possible calling interfaces

type(image_type) :: image
image = image_type()
This module contains procedures and generic interfaces for facilitating parallel computations or comp...
This is the image_type type for generating objects that contain information about the current image/p...
Warning
Even when the application is MPI/OpenMP-parallel, the id assigned to the zeroth process is 1 in this type.
This convention follows the rules of the Fortran Coarray parallel programming language.
For OpenMP-enabled ParaMonte library builds, this routine return the value of the OpenMP-intrinsic omp_get_num_threads() routine, that is, the number of threads in the team that is executing the parallel region to which the routine region binds.
If this constructor is called from the sequential part of an OpenMP-enabled program, this routine returns 1.
To return a value larger than 1, this routine must be called from within an OpenMP-enabled parallel region.
The desired number of OpenMP threads can be set at runtime via setImageCount(), or directly via the OpenMP intrinsic subroutine omp_set_num_threads().


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, Tuesday March 7, 2017, 3:50 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 133 of file pm_parallelism.F90.

Member Function/Subroutine Documentation

◆ finalize()

procedure, nopass pm_parallelism::image_type::finalize

Definition at line 140 of file pm_parallelism.F90.

◆ sync()

procedure, nopass pm_parallelism::image_type::sync

Definition at line 139 of file pm_parallelism.F90.

Member Data Documentation

◆ count

integer(IK) pm_parallelism::image_type::count = -huge(1_IK)

The scalar integer of default kind IK representing the total count of runtime parallel processes available within the current communication.

Definition at line 134 of file pm_parallelism.F90.

◆ id

integer(IK) pm_parallelism::image_type::id = -huge(1_IK)

The scalar integer of default kind IK representing the ID of the runtime parallel process starting with 1: 1, 2, 3, ...

Definition at line 135 of file pm_parallelism.F90.

◆ is

type(imageis_type) pm_parallelism::image_type::is = imageis_type()

The scalar of type imageis_type containing logical components that signify the current image role.

Definition at line 136 of file pm_parallelism.F90.

◆ label

character(:, SK), allocatable pm_parallelism::image_type::label

The allocatable scalar character of default kind SK containing the ID of the current process in the format @process(ID).

Definition at line 137 of file pm_parallelism.F90.


The documentation for this type was generated from the following file: