Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
mpi_utilities.cpp File Reference
#include "cddefines.h"
#include "save.h"
#include "dynamics.h"
#include "grid.h"
#include "service.h"
#include "rfield.h"
#include "ran.h"
Include dependency graph for mpi_utilities.cpp:

Macros

#define pid_t   int
 
#define fork()
 
#define wait(X)
 

Typedefs

typedef bitset< 3 > gfstate
 

Enumerations

enum  gfs_bits { NEWLINE_ABSENT , DELIMITER_ABSENT , FILE_ABSENT }
 

Functions

STATIC void GridGatherOutput (const string &, long, const vector< long > &)
 
STATIC void GridGatherOutputSequential (const string &, long)
 
STATIC void GridGatherOutputParallel (const string &, long, const vector< long > &)
 
STATIC bool lgIsRemote (const string &)
 
STATIC gfstate check_grid_file (const string &, int, int)
 
STATIC void fix_grid_file (const string &, int, gfstate, int)
 
int total_insanity (MPI_File, int, MPI_Status *)
 
void process_output ()
 
void append_file (FILE *dest, const char *source)
 
void append_file (MPI_File dest, const char *source)
 

Variables

int MPI_MODE_RDONLY = 0
 
int MPI_MODE_WRONLY = 0
 
int MPI_MODE_CREATE = 0
 
int MPI_MODE_APPEND = 0
 
int MPI_SUCCESS = 0
 
int MPI_ERR_INTERN = -1
 
MPI_File MPI_FILE_NULL = 0
 
int mpi_mode_r = MPI_MODE_RDONLY
 
int mpi_mode_w = MPI_MODE_WRONLY | MPI_MODE_CREATE
 
int mpi_mode_a = MPI_MODE_WRONLY | MPI_MODE_CREATE | MPI_MODE_APPEND
 

Macro Definition Documentation

◆ fork

#define fork ( )
Value:
T TotalInsanityAsStub()
Definition cddefines.h:495

Referenced by load_balance::init().

◆ pid_t

#define pid_t   int

◆ wait

#define wait ( X)

Typedef Documentation

◆ gfstate

typedef bitset<3> gfstate

Enumeration Type Documentation

◆ gfs_bits

enum gfs_bits
Enumerator
NEWLINE_ABSENT 
DELIMITER_ABSENT 
FILE_ABSENT 

Function Documentation

◆ append_file() [1/2]

void append_file ( FILE * dest,
const char * source )

append_file: append output produced on file <source> to open file descriptor <dest>

References AS_LOCAL_ONLY_TRY, DEBUG_ENTRY, NULL, and open_data().

Referenced by GridGatherOutputParallel(), GridGatherOutputSequential(), optimize_phymir(), phymir_state< X, Y, NP, NSTR >::p_process_output(), and process_output().

Here is the call graph for this function:

◆ append_file() [2/2]

void append_file ( MPI_File dest,
const char * source )

append_file: append output produced on file <source> to open file handle <dest> using MPI I/O

References AS_LOCAL_ONLY_TRY, DEBUG_ENTRY, MPI_File_write, NULL, and open_data().

Here is the call graph for this function:

◆ check_grid_file()

STATIC gfstate check_grid_file ( const string & fnam,
int j,
int ipPun )

check_grid_file: check whether the save file is present and is terminated by a GRID_DELIMIT string

References AS_LOCAL_ONLY_TRY, DEBUG_ENTRY, DELIMITER_ABSENT, dynamics, FILE_ABSENT, GridPointPrefix(), ipPun, mode_r, NEWLINE_ABSENT, open_data(), save, and STATIC.

Referenced by process_output().

Here is the call graph for this function:

◆ fix_grid_file()

STATIC void fix_grid_file ( const string & fnam,
int j,
gfstate s,
int jsource )

fix_grid_file: fix absent or malformed grid file

References AS_LOCAL_ONLY, AS_LOCAL_ONLY_TRY, DEBUG_ENTRY, DELIMITER_ABSENT, FILE_ABSENT, GridPointPrefix(), mode_a, mode_r, NEWLINE_ABSENT, open_data(), save, and STATIC.

Referenced by process_output().

Here is the call graph for this function:

◆ GridGatherOutput()

STATIC void GridGatherOutput ( const string & basenam,
long nfiles,
const vector< long > & bound )

References cpu, GridGatherOutputParallel(), GridGatherOutputSequential(), lgIsRemote(), and STATIC.

Referenced by process_output().

Here is the call graph for this function:

◆ GridGatherOutputParallel()

STATIC void GridGatherOutputParallel ( const string & basenam,
long nfiles,
const vector< long > & bound )

◆ GridGatherOutputSequential()

STATIC void GridGatherOutputSequential ( const string & basenam,
long nfiles )

References append_file(), AS_LOCAL_ONLY_TRY, GridPointPrefix(), NULL, open_data(), and STATIC.

Referenced by GridGatherOutput().

Here is the call graph for this function:

◆ lgIsRemote()

STATIC bool lgIsRemote ( const string & )

References STATIC.

Referenced by GridGatherOutput().

◆ process_output()

void process_output ( )

process_output: concatenate output files produced in grid run

References append_file(), ASSERT, check_grid_file(), cpu, DEBUG_ENTRY, fix_grid_file(), fprintf(), grid, GridGatherOutput(), GridPointPrefix(), ioQQQ, ipPun, NUM_OUTPUT_TYPES, open_data(), rd_block(), rfield, save, and saveFITSfile().

Referenced by main().

Here is the call graph for this function:

◆ total_insanity()

int total_insanity ( MPI_File ,
int ,
MPI_Status *  )

References TotalInsanityAsStub().

Here is the call graph for this function:

Variable Documentation

◆ MPI_ERR_INTERN

int MPI_ERR_INTERN = -1

Referenced by t_cpu_i::open_data.

◆ MPI_FILE_NULL

MPI_File MPI_FILE_NULL = 0

◆ mpi_mode_a

◆ MPI_MODE_APPEND

int MPI_MODE_APPEND = 0

◆ MPI_MODE_CREATE

int MPI_MODE_CREATE = 0

◆ mpi_mode_r

int mpi_mode_r = MPI_MODE_RDONLY

Referenced by t_cpu_i::open_data.

◆ MPI_MODE_RDONLY

int MPI_MODE_RDONLY = 0

◆ mpi_mode_w

int mpi_mode_w = MPI_MODE_WRONLY | MPI_MODE_CREATE

◆ MPI_MODE_WRONLY

int MPI_MODE_WRONLY = 0

◆ MPI_SUCCESS

int MPI_SUCCESS = 0

Referenced by t_cpu_i::open_data.