Skip to content
Snippets Groups Projects
Commit c700e03c authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

use field descriptor io directly in fluid_solver

parent 1590ae68
Branches
Tags
No related merge requests found
......@@ -235,6 +235,7 @@ int field_descriptor<rnumber>::read(
else if (sizeof(rnumber)==8)
ttype = MPI_DOUBLE_COMPLEX;
DEBUG_MSG("aloha 00\n");
char representation[] = "native";
if (this->subsizes[0] > 0)
{
MPI_Info info;
......@@ -259,7 +260,7 @@ int field_descriptor<rnumber>::read(
0,
MPI_UNSIGNED_CHAR,
this->mpi_array_dtype,
"native",
representation,
info);
MPI_File_read_all(
f,
......@@ -282,6 +283,7 @@ int field_descriptor<rnumber>::write(
ttype = MPI_COMPLEX;
else if (sizeof(rnumber)==8)
ttype = MPI_DOUBLE_COMPLEX;
char representation[] = "native";
if (this->subsizes[0] > 0)
{
MPI_Info info;
......@@ -304,7 +306,7 @@ int field_descriptor<rnumber>::write(
0,
MPI_UNSIGNED_CHAR,
this->mpi_array_dtype,
"native",
representation,
info);
MPI_File_write_all(
f,
......
......@@ -417,10 +417,7 @@ int fluid_solver<R>::read(char field, char representation) \
this->fill_up_filename("cvorticity", fname); \
read_result = this->cd->read(fname, (void*)this->cvorticity); \
if (read_result != EXIT_SUCCESS) \
{ \
DEBUG_MSG("read error"); \
return read_result; \
} \
} \
if (representation == 'r') \
{ \
......@@ -455,16 +452,21 @@ int fluid_solver<R>::write(char field, char representation) \
{ \
FFTW(execute)(*((FFTW(plan)*)this->c2r_vorticity )); \
clip_zero_padding<R>(this->rd, this->rvorticity, 3); \
return this->write_base("rvorticity", this->rvorticity); \
this->fill_up_filename("rvorticity", fname); \
return this->rd->write(fname, this->rvorticity); \
} \
this->compute_velocity(this->cvorticity); \
if ((field == 'u') && (representation == 'c')) \
return this->write_base("cvelocity", this->cvelocity); \
{ \
this->fill_up_filename("cvelocity", fname); \
return this->cd->write(fname, this->cvelocity); \
} \
if ((field == 'u') && (representation == 'r')) \
{ \
this->ift_velocity(); \
clip_zero_padding<R>(this->rd, this->rvelocity, 3); \
return this->write_base("rvelocity", this->rvelocity); \
this->fill_up_filename("rvelocity", fname); \
return this->rd->write(fname, this->rvelocity); \
} \
return EXIT_FAILURE; \
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment