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

add converter for 1 isoNS frame

in fact, the filenames are hardcoded, so I guess this is only
useful for a very limited number of people...
parent e8a3eeda
No related branches found
No related tags found
No related merge requests found
#include "Morton_shuffler.hpp"
#include <iostream>
int myrank, nprocs;
int main(int argc, char *argv[])
{
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
Morton_shuffler *s = new Morton_shuffler(
1024, 1024, 1024,
3, 8);
int n[] = {1024, 1024, 1024};
field_descriptor *scalar = new field_descriptor(
3, n, MPI_REAL4, MPI_COMM_WORLD);
float *data0 = fftwf_alloc_real(s->dinput->local_size);
float *data1 = fftwf_alloc_real(s->dinput->local_size);
scalar->read("NS_ux_t100", data0);
scalar->read("NS_uy_t100", data0 + scalar->local_size);
scalar->read("NS_uz_t100", data0 + 2*scalar->local_size);
scalar->interleave(data0, data1, 3);
s->shuffle(data1, data0, "NS_u_t100");
fftwf_free(data1);
delete s;
s = new Morton_shuffler(
1024, 1024, 1024,
1, 8);
data1 = data0 + scalar->local_size;
scalar->read("NS_p_t100", data0);
s->shuffle(data0, data1, "NS_p_t100");
fftwf_free(data0);
delete s;
// clean up
fftwf_mpi_cleanup();
MPI_Finalize();
return EXIT_SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment