cta_par.h File Reference

Interface for creating parallel applications with COSTA. More...

#include "cta_system.h"
#include "cta_handles.h"
#include "cta_datatypes.h"

Go to the source code of this file.

Enumerations

enum  CTA_ParProcType { CTA_ParMaster, CTA_ParWorker, CTA_ParOther }

Functions

CTAEXPORT int CTA_Par_WorkerSpawn (int StartPar)
 Initialises parallel environment for a process that spawned The executable is spawned using MPI_COMM_SPAWN or MPI_COMM_SPAWN_MULTIPLE.
CTAEXPORT int CTA_Par_CreateGroups (int parConfig, int StartPar)
 Initialises parallel environment and create process groups.
CTAEXPORT void CTA_Par_GetGroupInfo (int *iGroup, int *itime)
 Get the Fortran (integer handles) of the communicators.

Variables

CTAEXPORT int CTA_FILTER_PROCESS
CTAEXPORT int CTA_IS_PARALLEL
CTAEXPORT int CTA_PAR_MY_RANK
CTAEXPORT enum CTA_ParProcType CTA_MY_PROC_TYPE

Detailed Description

Interface for creating parallel applications with COSTA.

Definition in file cta_par.h.


Enumeration Type Documentation

Type of processes

Enumerator:
CTA_ParMaster 
CTA_ParWorker 
CTA_ParOther 

Definition at line 35 of file cta_par.h.


Function Documentation

CTAEXPORT int CTA_Par_CreateGroups ( int  parConfig,
int  StartPar 
)

Initialises parallel environment and create process groups.

Parameters:
parConfig I configuration input from XML-file
StartPar I CTA_TRUE/CTA_FALSE start parallel model builder

Note when a worker process is part of a Master-Worker model and it does not implement the COSTA model interface it should not start the parallel model builder

Returns:
error status: CTA_OK if successful
CTAEXPORT void CTA_Par_GetGroupInfo ( int *  iGroup,
int *  itime 
)

Get the Fortran (integer handles) of the communicators.

Parameters:
cta_comm_world O Fortran communcator CTA_COMM_WORLD
cta_comm_myworld O Fortran communcator CTA_COMM_MYWORLD
cta_comm_master_worker O Fortran communcator CTA_COMM_MASTER_WORKER Get a communicator for a process group by index
indx I indx of communicator
comm O MPI communicator
Returns:
CTA_OK when succesfull. The value is CTA_CANNOT_FIND_PROCESS_GROUP is returned when the communicator cannot be found Get the global number of COSTA process group and index of this process
Parameters:
itime O The index of this process in the group
iGroup O The group number of this process belongs to (1..nGroups)
Note:
If this function is called by the COSTA master process or in a sequential run it will return 0 for iGroup
CTAEXPORT int CTA_Par_WorkerSpawn ( int  StartPar  ) 

Initialises parallel environment for a process that spawned The executable is spawned using MPI_COMM_SPAWN or MPI_COMM_SPAWN_MULTIPLE.

It will set up the communication groups and optionally starts the parallel model builder

Parameters:
StartPar I CTA_TRUE/CTA_FALSE start parallel model builder

Note when a worker process is part of a Master-Worker model and it does not implement the COSTA model interface it should not start the parallel model builder

Returns:
error status: CTA_OK if successful

Variable Documentation

CTAEXPORT int CTA_FILTER_PROCESS

Flag to indicate whether this is a filter process or model/worker process

CTAEXPORT int CTA_IS_PARALLEL

Flag CTA_TRUE/CTA_FALSE to indicate whether run is in a parallel environment

Kind of this process

CTAEXPORT int CTA_PAR_MY_RANK

Rank in world of all processes Note this variable is only used for debugging and output.


Generated on 4 Mar 2014 for OpenDA by  doxygen 1.6.1