26 #include "pism/util/EnthalpyConverter.hh"
27 #include "pism/util/error_handling.hh"
28 #include "pism/pism_config.hh"
66 : m_impl(new
Impl(c, sys, config, EC, t,
L, p)) {
75 m_impl->
logger->message(1,
"Error: failed to de-allocate a ParallelIO I/O system\n");
142 #if (Pism_USE_PIO==1)
144 int ierr = PIOc_set_iosystem_error_handling(PIO_DEFAULT, PIO_BCAST_ERROR, NULL);
150 base =
config()->get_number(
"output.pio.base"),
151 stride =
config()->get_number(
"output.pio.stride"),
152 n_writers =
config()->get_number(
"output.pio.n_writers");
154 if (n_writers > this->
size()) {
156 "number of ParallelIO writers (%d)"
157 " exceeds the communicator size (%d)",
158 n_writers, this->
size());
161 ierr = PIOc_Init_Intracomm(
m_impl->
com, n_writers, stride, base, PIO_REARR_BOX,
172 const std::string &prefix,
188 Time::Ptr time = std::make_shared<Time>(com, config, *logger, sys);
193 return std::shared_ptr<Context>(
new Context(com, sys, config, EC, time, logger, prefix));
std::shared_ptr< Config > Ptr
Impl(MPI_Comm c, UnitsSystemPtr sys, ConfigPtr conf, EnthalpyConverterPtr EC, TimePtr t, LoggerPtr log, const std::string &p)
UnitsSystemPtr unit_system
EnthalpyConverterPtr enthalpy_converter
std::shared_ptr< units::System > UnitsSystemPtr
EnthalpyConverterPtr enthalpy_converter() const
ConstConfigPtr config() const
std::shared_ptr< const Config > ConstConfigPtr
const std::string & prefix() const
const Profiling & profiling() const
std::shared_ptr< const Logger > ConstLoggerPtr
Context(MPI_Comm c, UnitsSystemPtr sys, ConfigPtr conf, EnthalpyConverterPtr EC, TimePtr t, LoggerPtr log, const std::string &p)
UnitsSystemPtr unit_system() const
std::shared_ptr< EnthalpyConverter > EnthalpyConverterPtr
std::shared_ptr< Logger > LoggerPtr
std::shared_ptr< Config > ConfigPtr
std::shared_ptr< Time > TimePtr
std::shared_ptr< const Time > ConstTimePtr
ConstLoggerPtr log() const
ConstTimePtr time() const
std::shared_ptr< EnthalpyConverter > Ptr
Converts between specific enthalpy and temperature or liquid content.
std::shared_ptr< Logger > Ptr
static RuntimeError formatted(const ErrorLocation &location, const char format[],...) __attribute__((format(printf
build a RuntimeError with a formatted message
std::shared_ptr< Time > Ptr
std::shared_ptr< System > Ptr
#define PISM_ERROR_LOCATION
std::shared_ptr< Context > context_from_options(MPI_Comm com, const std::string &prefix, bool print)
Create a default context using options.
Logger::Ptr logger_from_options(MPI_Comm com)
Config::Ptr config_from_options(MPI_Comm com, const Logger &log, units::System::Ptr unit_system)
Create a configuration database using command-line options.
void print_config(const Logger &log, int verbosity_threshhold, const Config &config)
Report configuration parameters to stdout.
static double S(unsigned n)