Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Rocout.C File Reference

Implementation of Rocout for creation of a data file from a Roccom window. More...

#include <sys/stat.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <errno.h>
#include "Rocout.h"
#include "Rocout_hdf4.h"
Include dependency graph for Rocout.C:

Go to the source code of this file.

Classes

struct  WriteAttrInfo
 Pass write_attribute arguments to the background worker thread. More...
 

Macros

#define SwitchOnDataType(dType, funcCall)
 
#define ERROR_MSG(msg)
 

Functions

static bool is_option_name (const std::string &name)
 Return true if the given string is the name of a Rocout option. More...
 
static bool is_whole (const std::string &s)
 
static bool is_option_value (const std::string &name, const std::string &val)
 Return true if the given Rocout option name/value pair is valid. More...
 
void Rocout_load_module (const char *name)
 Load the module Rocout into Roccom using the given module name. More...
 
void Rocout_unload_module (const char *name)
 Unload the module Rocout from Roccom. More...
 
void COM_F_FUNC2 (rocout_load_module, ROCOUT_LOAD_MODULE) const
 
void COM_F_FUNC2 (rocout_unload_module, ROCOUT_UNLOAD_MODULE) const
 

Variables

static USE_COM_NAME_SPACE const int MAX_ASYNC_WRITES = 10
 

Detailed Description

Implementation of Rocout for creation of a data file from a Roccom window.

Definition in file Rocout.C.

Macro Definition Documentation

#define ERROR_MSG (   msg)
Value:
{ if (_options["errorhandle"] != "ignore") { \
std::cerr << msg << std::endl; \
if (_options["errorhandle"] == "abort") { \
MPI_Abort(MPI_COMM_WORLD, 0); \
else \
abort(); \
} \
} \
}
if(dy > dx)
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
int COMMPI_Initialized()
Definition: commpi.h:168

Definition at line 123 of file Rocout.C.

Referenced by Rocout::get_fname(), Rocout::read_control_file(), and Rocout::set_option().

#define SwitchOnDataType (   dType,
  funcCall 
)

Definition at line 74 of file Rocout.C.

Function Documentation

void COM_F_FUNC2 ( rocout_load_module  ,
ROCOUT_LOAD_MODULE   
) const

Definition at line 943 of file Rocout.C.

References Mesquite::length(), and Rocout_load_module().

944 { Rocout_load_module( std::string(name, length).c_str()); }
double length(Vector3D *const v, int n)
void Rocout_load_module(const char *name)
Load the module Rocout into Roccom using the given module name.
Definition: Rocout.C:934

Here is the call graph for this function:

void COM_F_FUNC2 ( rocout_unload_module  ,
ROCOUT_UNLOAD_MODULE   
) const

Definition at line 945 of file Rocout.C.

References Mesquite::length(), and Rocout_unload_module().

946 { Rocout_unload_module( std::string(name, length).c_str()); }
double length(Vector3D *const v, int n)
void Rocout_unload_module(const char *name)
Unload the module Rocout from Roccom.
Definition: Rocout.C:937

Here is the call graph for this function:

static bool is_option_name ( const std::string &  name)
static

Return true if the given string is the name of a Rocout option.

Definition at line 506 of file Rocout.C.

Referenced by Rocout::read_control_file(), and Rocout::set_option().

507 {
508  return (name == "format" || name == "async" || name == "mode"
509  || name == "localdir" || name == "rankwidth" || name == "pnidwidth"
510  || name == "separator" || name == "errorhandle" || name == "rankdir"
511  || name == "ghosthandle");
512 }

Here is the caller graph for this function:

static bool is_option_value ( const std::string &  name,
const std::string &  val 
)
static

Return true if the given Rocout option name/value pair is valid.

Definition at line 528 of file Rocout.C.

References is_whole().

Referenced by Rocout::read_control_file(), and Rocout::set_option().

529 {
530  return ((name == "format"
531  && (val == "HDF" || val == "HDF4" || val == "HDF5" || val == "CGNS"))
532  || (name == "async"
533  && (val == "on" || val == "off"))
534  || (name == "mode"
535  && (val == "w" || val == "a"))
536  || (name == "localdir" /* && is_valid_path(val) */ )
537  || ((name == "rankwidth" || name == "pnidwidth") && is_whole(val))
538  || (name == "rankdir"
539  && (val == "on" || val == "off"))
540  || (name == "errorhandle"
541  && (val == "abort" || val == "ignore" || val == "warn"))
542  || (name == "ghosthandle"
543  && (val == "write" || val == "ignore")));
544 }
static bool is_whole(const std::string &s)
Definition: Rocout.C:515

Here is the call graph for this function:

Here is the caller graph for this function:

static bool is_whole ( const std::string &  s)
static

Definition at line 515 of file Rocout.C.

References i, and sin.

Referenced by is_option_value().

516 {
517  if (s.empty())
518  return false;
519 
520  std::istringstream sin(s);
521  int i = 0;
522  sin >> i;
523  return (i >= 0 && sin.eof());
524 }
double s
Definition: blastest.C:80
NT & sin
blockLoc i
Definition: read.cpp:79

Here is the caller graph for this function:

void Rocout_load_module ( const char *  name)

Load the module Rocout into Roccom using the given module name.

This module provides one subroutine: "write_attribute".

Definition at line 934 of file Rocout.C.

References Rocout::init().

Referenced by COM_F_FUNC2(), main(), and RFC_Window_base::write_sdv().

935 { Rocout::init( std::string(name)); }
static void init(const std::string &mname)
Initialize the module by registering it to Roccom with the given module name.
Definition: Rocout.C:139

Here is the call graph for this function:

Here is the caller graph for this function:

void Rocout_unload_module ( const char *  name)

Unload the module Rocout from Roccom.

Definition at line 937 of file Rocout.C.

References Rocout::finalize().

Referenced by COM_F_FUNC2(), and RFC_Window_base::write_sdv().

938 { Rocout::finalize( std::string(name)); }
static void finalize(const std::string &mname)
Finalize the module by deregistering it from Roccom.
Definition: Rocout.C:213

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

USE_COM_NAME_SPACE const int MAX_ASYNC_WRITES = 10
static

Definition at line 49 of file Rocout.C.