22#include "rheolef/diststream.h"
23#include "rheolef/environment.h"
24#include "rheolef/rheostream.h"
47 typedef std::size_t size_type;
49 size_type my_proc = comm.rank();
51 if (my_proc == io_proc) {
54#ifdef _RHEOLEF_HAVE_MPI
55 mpi::broadcast (comm, status, io_proc);
65#ifndef _RHEOLEF_HAVE_MPI
69 check_macro (opt_io_proc,
"no process can perform i/o");
70 int io_proc = opt_io_proc.get();
71 if (
io_proc == mpi::any_source) {
132 status = (*_ptr_is).good();
134#ifdef _RHEOLEF_HAVE_MPI
135 mpi::broadcast(
comm(), status, 0);
145 std::string filename,
203 status = (*_ptr_os).good();
205#ifdef _RHEOLEF_HAVE_MPI
206 mpi::broadcast(
comm(), status, 0);
218 size_type my_proc = comm.rank();
220#ifdef _RHEOLEF_HAVE_MPI
221 mpi::communicator().barrier();
223 if (my_proc == io_proc) {
224 status = std::system (command.c_str());
226#ifdef _RHEOLEF_HAVE_MPI
227 mpi::communicator().barrier();
228 mpi::broadcast (mpi::communicator(), status, io_proc);
237 size_type my_proc = comm.rank();
239 if (my_proc == io_proc) {
242#ifdef _RHEOLEF_HAVE_MPI
243 mpi::broadcast (mpi::communicator(), status, io_proc);
see the communicator page for the full documentation
static boost::optional< int > io_rank()
idiststream: see the diststream page for the full documentation
static size_type io_proc()
This routine returns the rank of a process that can perform i/o.
void open(std::string filename, std::string suffix="", const communicator &comm=communicator())
This routine opens a physical input file.
const communicator & comm() const
odiststream: see the diststream page for the full documentation
void open(std::string filename, std::string suffix="", io::mode_type mode=io::out, const communicator &comm=communicator())
This routine opens a physical output file.
static size_type io_proc()
const communicator & comm() const
idiststream din(cin)
see the diststream page for the full documentation
odiststream dlog(clog)
see the diststream page for the full documentation
odiststream dout(cout)
see the diststream page for the full documentation
odiststream derr(cerr)
see the diststream page for the full documentation
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
bool scatch(std::istream &in, const std::string &ch, bool full_match=true)
scatch: see the rheostream page for the full documentation
bool dis_scatch(idiststream &ips, const communicator &comm, std::string ch)
distributed version of scatch(istream&,string)
int dis_system(const std::string &command, const communicator &comm)
bool dis_file_exists(const std::string &filename, const communicator &comm)
bool file_exists(const std::string &filename)
file_exists: see the rheostream page for the full documentation