diff --git a/CHANGES.md b/CHANGES.md index afa582ee8..0c524913b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,10 +3,18 @@ version 0.16.0 +- Improved host halo swaps are available. + The implementation of the reduced distribution halo has been replaced + with one that will work in all circumstances for a single distribution. + See https://ludwig.epcc.ed.ac.uk/inputs/index.html Parallelism for details. + No user action is required if you are not interested. + - Reinstated the boundary (wall) - colloid soft sphere potential. See https://ludwig.epcc.ed.ac.uk/inputs/colloid.html Thanks to Rishish Mishra for spotting this problem. +- Various minor updates. + version 0.15.0 - Active stress implementation is updated to conform to the documented diff --git a/mpi_s/mpi_serial.c b/mpi_s/mpi_serial.c index 3758bc9d2..04ea6e3e9 100644 --- a/mpi_s/mpi_serial.c +++ b/mpi_s/mpi_serial.c @@ -660,7 +660,7 @@ int MPI_Type_indexed(int count, int * array_of_blocklengths, assert(newtype); { - data_t dt = {}; + data_t dt = {0}; dt.handle = MPI_DATATYPE_NULL; dt.bytes = 0; @@ -685,7 +685,7 @@ int MPI_Type_contiguous(int count, MPI_Datatype old, MPI_Datatype * newtype) { assert(newtype); { - data_t dt = {}; + data_t dt = {0}; dt.handle = MPI_DATATYPE_NULL; dt.bytes = mpi_sizeof(old)*count; /* contiguous */ @@ -756,7 +756,7 @@ int MPI_Type_vector(int count, int blocklength, int stride, assert(newtype); { - data_t dt = {}; + data_t dt = {0}; dt.handle = MPI_DATATYPE_NULL; dt.bytes = 0; @@ -1164,7 +1164,7 @@ int MPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, assert(newtype); { - data_t dt = {}; + data_t dt = {0}; dt.handle = MPI_DATATYPE_NULL; dt.bytes = extent; @@ -1198,7 +1198,7 @@ int MPI_Type_create_struct(int count, int array_of_blocklengths[], { - data_t dt = {}; + data_t dt = {0}; dt.handle = MPI_DATATYPE_NULL; dt.bytes = 0; diff --git a/mpi_s/mpi_tests.c b/mpi_s/mpi_tests.c index cf2ab98b0..1d11b8c26 100644 --- a/mpi_s/mpi_tests.c +++ b/mpi_s/mpi_tests.c @@ -253,10 +253,10 @@ int test_mpi_type_create_struct(void) { { /* Commit */ - test_t data = {}; + test_t data = {0}; int count = 2; int blocklengths[2] = {1, 1}; - MPI_Aint displacements[3] = {}; + MPI_Aint displacements[3] = {0}; MPI_Datatype datatypes[2] = {MPI_INT, MPI_DOUBLE}; MPI_Get_address(&data, displacements + 0); diff --git a/src/blue_phase_beris_edwards.c b/src/blue_phase_beris_edwards.c index c8f55baf1..580139280 100644 --- a/src/blue_phase_beris_edwards.c +++ b/src/blue_phase_beris_edwards.c @@ -31,7 +31,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2009-2021 The University of Edinburgh + * (c) 2009-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -322,7 +322,7 @@ __host__ int beris_edw_update_host(beris_edw_t * be, fe_t * fe, field_t * fq, double gamma; double chi[NQAB], chi_qab[3][3]; - double tmatrix[3][3][NQAB] = {}; + double tmatrix[3][3][NQAB] = {0}; double var = 0.0; const double dt = 1.0; diff --git a/src/blue_phase_init.c b/src/blue_phase_init.c index 7234c4927..ea549fbae 100644 --- a/src/blue_phase_init.c +++ b/src/blue_phase_init.c @@ -10,7 +10,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Oliver Henrich (oliver.henrich@strath.ac.uk) @@ -64,7 +64,7 @@ int blue_phase_O8M_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double root2; double q0; double amplitude0; - rotation_t rot = {}; + rotation_t rot = {0}; assert(cs); assert(fq); @@ -82,7 +82,7 @@ int blue_phase_O8M_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, /* So we add a sign here. */ { - double angles[3] = {}; /* radians */ + double angles[3] = {0}; /* radians */ PI_DOUBLE(pi); angles[0] = -1.0*pi*euler_angles[0]/180.0; @@ -98,7 +98,7 @@ int blue_phase_O8M_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double y = noffset[Y] + jc; for (int kc = 1; kc <= nlocal[Z]; kc++) { double z = noffset[Z] + kc; - double r[3] = {}; + double r[3] = {0}; /* Rotate around the centre */ r[X] = x - 0.5*ntotal[X]; @@ -119,7 +119,7 @@ int blue_phase_O8M_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double sinx = sin(root2*q0*r[X]); double siny = sin(root2*q0*r[Y]); double sinz = sin(root2*q0*r[Z]); - double q[3][3] = {}; + double q[3][3] = {0}; q[X][X] = amplitude0*( -2.0*cosy*sinz + sinx*cosz + cosx*siny); q[X][Y] = amplitude0*(root2*cosy*cosz + root2*sinx*sinz - sinx*cosy); @@ -159,7 +159,7 @@ int blue_phase_O2_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double q0; double amplitude0; - rotation_t rot = {}; + rotation_t rot = {0}; assert(cs); assert(fq); @@ -176,7 +176,7 @@ int blue_phase_O2_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, /* Hence the factor of -1.0 below. */ { - double angles[3] = {}; /* radians */ + double angles[3] = {0}; /* radians */ PI_DOUBLE(pi); angles[0] = -1.0*pi*euler_angles[0]/180.0; @@ -192,7 +192,7 @@ int blue_phase_O2_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double y = noffset[Y] + jc; for (int kc = 1; kc <= nlocal[Z]; kc++) { double z = noffset[Z] + kc; - double r[3] = {}; + double r[3] = {0}; r[X] = x - 0.5*ntotal[X]; r[Y] = y - 0.5*ntotal[Y]; @@ -212,7 +212,7 @@ int blue_phase_O2_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double sinx = sin(2.0*q0*r[X]); double siny = sin(2.0*q0*r[Y]); double sinz = sin(2.0*q0*r[Z]); - double q[3][3] = {}; + double q[3][3] = {0}; q[X][X] = amplitude0*(cosz - cosy); q[X][Y] = amplitude0*sinz; diff --git a/src/blue_phase_rt.c b/src/blue_phase_rt.c index 73cb14df4..2bb7f30d6 100644 --- a/src/blue_phase_rt.c +++ b/src/blue_phase_rt.c @@ -9,7 +9,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2009-2021 The University of Edinburgh + * (c) 2009-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -72,7 +72,7 @@ __host__ int blue_phase_init_rt(pe_t * pe, rt_t *rt, pe_info(pe, "Blue phase free energy selected.\n"); { - char description[BUFSIZ] = {}; + char description[BUFSIZ] = {0}; rt_string_parameter(rt, "free_energy", description, BUFSIZ); fe_is_lc_droplet = (strcmp(description, "lc_droplet") == 0); } diff --git a/src/cahn_hilliard_stats.c b/src/cahn_hilliard_stats.c index 587372413..2ac6f06cb 100644 --- a/src/cahn_hilliard_stats.c +++ b/src/cahn_hilliard_stats.c @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributions: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -59,7 +59,7 @@ __global__ void cahn_stats_min_kernel(kernel_ctxt_t * ktx, field_t * phi, __host__ int cahn_hilliard_stats_time0(phi_ch_t * pch, field_t * phi, map_t * map) { - phi_stats_t stats = {}; + phi_stats_t stats = {0}; MPI_Comm comm = MPI_COMM_NULL; assert(pch); @@ -83,8 +83,8 @@ __host__ int cahn_hilliard_stats_time0(phi_ch_t * pch, field_t * phi, __host__ int cahn_hilliard_stats(phi_ch_t * pch, field_t * phi, map_t * map) { - phi_stats_t stats = {.sum1 = {}, - .sum2 = {}, + phi_stats_t stats = {.sum1 = {0}, + .sum2 = {0}, .sum = 0.0, .var = 0.0, .min = +FLT_MAX, @@ -123,7 +123,7 @@ __host__ int cahn_hilliard_stats(phi_ch_t * pch, field_t * phi, map_t * map) { __host__ int cahn_stats_reduce(phi_ch_t * pch, field_t * phi, map_t * map, phi_stats_t * stats, int root, MPI_Comm comm) { - phi_stats_t local = {}; + phi_stats_t local = {0}; phi_stats_t * stats_d = NULL; int nlocal[3]; diff --git a/src/colloid_io.c b/src/colloid_io.c index 3c2344fa4..9681902c6 100644 --- a/src/colloid_io.c +++ b/src/colloid_io.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -429,7 +429,7 @@ int colloid_io_write_buffer_binary(FILE * fp, int nc, colloid_state_t * buf) { int colloid_io_read(colloid_io_t * cio, const char * filename) { int ngroup; - char filename_io[FILENAME_MAX] = {}; + char filename_io[FILENAME_MAX] = {0}; FILE * fp_state; assert(cio->f_header_read); diff --git a/src/colloids_rt.c b/src/colloids_rt.c index 004ba3bdf..6127cac33 100644 --- a/src/colloids_rt.c +++ b/src/colloids_rt.c @@ -814,10 +814,10 @@ int pair_ss_cut_ij_init(pe_t * pe, cs_t * cs, rt_t * rt, interact_t * intrct) { if (ison) { int ntypes = 0; int nsymm = 0; - double epsilon[BUFSIZ] = {}; - double sigma[BUFSIZ] = {}; - double nu[BUFSIZ] = {}; - double hc[BUFSIZ] = {}; + double epsilon[BUFSIZ] = {0}; + double sigma[BUFSIZ] = {0}; + double nu[BUFSIZ] = {0}; + double hc[BUFSIZ] = {0}; pair_ss_cut_ij_t * pair = NULL; rt_key_required(rt, "pair_ss_cut_ij_ntypes", RT_FATAL); @@ -1092,7 +1092,7 @@ int wall_ss_cut_init(pe_t * pe, cs_t * cs, rt_t * rt, wall_t * wall, if (have_wall_ss_cut) { wall_ss_cut_t * wall_ss_cut = NULL; - wall_ss_cut_options_t opts = {}; + wall_ss_cut_options_t opts = {0}; rt_key_required(rt, "wall_ss_cut_epsilon", RT_FATAL); rt_key_required(rt, "wall_ss_cut_sigma", RT_FATAL); diff --git a/src/compiler.c b/src/compiler.c index f2784c46e..6319e05b8 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Phyiscs Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -109,7 +109,7 @@ int compiler_id(compiler_info_t * compiler) { compiler->major = __GNUC__; compiler->minor = __GNUC_MINOR__; compiler->patchlevel = __GNUC_PATCHLEVEL__; - strncpy(compiler->version, __VERSION__, 1 + strnlen(__VERSION__, BUFSIZ-1)); + strncpy(compiler->version, __VERSION__, 1 + strlen(__VERSION__)); sprintf(compiler->name, "%s", "Gnu"); ierr = 0; diff --git a/src/coords.c b/src/coords.c index 2d5e29962..3cb298107 100644 --- a/src/coords.c +++ b/src/coords.c @@ -546,14 +546,14 @@ static __host__ int cs_rectilinear_decomposition(cs_t * cs) { int idim; int n, ntot, nremainder; int ntotal[3]; - int mpisz[3] = {}; + int mpisz[3] = {0}; assert(cs); { - int dims[3] = {}; - int coords[3] = {}; - int periods[3] = {}; + int dims[3] = {0}; + int coords[3] = {0}; + int periods[3] = {0}; MPI_Cart_get(cs->commcart, 3, dims, coords, periods); mpisz[X] = dims[X]; mpisz[Y] = dims[Y]; mpisz[Z] = dims[Z]; } diff --git a/src/d2q9.c b/src/d2q9.c deleted file mode 100644 index afb79a7f9..000000000 --- a/src/d2q9.c +++ /dev/null @@ -1,121 +0,0 @@ -/***************************************************************************** - * - * d2q9.c - * - * D2Q9 definitions. - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2010-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * Ronojoy Adhikari computed this D2Q9 basis. - * - *****************************************************************************/ - -#include "d2q9.h" - -const char * model_name_d2q9 = "D2Q9"; - -#ifdef _D2Q9_ - -/***************************************************************************** - * - * There are 9 eigenvectors: - * - * rho (density) - * rho cv[p][X] (x-component of velocity) - * rho cv[p][Y] (y-component of velocity) - * q[p][X][X] (xx component of deviatoric stress) - * q[p][X][Y] (xy component of deviatoric stress) - * q[p][Y][Y] (yy ... - * chi1[p] (1st ghost mode) - * jchi1[p][X] (x-component of ghost current chi1[p]*rho*cv[p][X]) - * jchi1[p][Y] (y-component of ghost current chi1[p]*rho*cv[p][Y]) - * - * We define the following: - * - * cv[NVEL][3] lattice velocities (integers) - * q_[NVEL][3][3] kinetic projector c[p][i]*c[p][j] - c_s^2 d_[i][j] - * wv[NVEL] quadrature weight for each velocity - * norm_[NVEL] normaliser for each mode - * - * ma_[NVEL][NVEL] full matrix of eigenvectors (doubles) - * mi_[NVEL][NVEL] inverse of ma_[][] - * - * blocklens reduced halo datatype blocklengths - * disp_fwd reduced halo datatype displacements - * disp_bwd reduced halo datatype displacements - * - * Reduced halo swap information - * CVXBLOCK number of separate blocks to send in x-direction - * CVYBLOCK ditto ... y-direction - * CVZBLOCK ditto ... z-direction - * - * For each direction there is then an array of ... - * - * blocklen block lengths - * disp_fwd displacements of block from start (forward direction) - * disp_bwd displacements of block from start (backward direction) - * - * Note that all z-components are zero. - * - *****************************************************************************/ - -#define w0 (16.0/36.0) -#define w1 (4.0/36.0) -#define w2 (1.0/36.0) - -#define c0 0.0 -#define c1 1.0 -#define c2 2.0 -#define c4 4.0 -#define r3 (1.0/3.0) -#define t3 (2.0/3.0) -#define r4 (1.0/4.0) -#define r6 (1.0/6.0) - -/* -const double ma_[NVEL9][NVEL9] = { - { c1, c1, c1, c1, c1, c1, c1, c1, c1}, - { c0, c1, c1, c1, c0, c0, -c1, -c1, -c1}, - { c0, c1, c0, -c1, c1, -c1, c1, c0, -c1}, - {-r3, t3, t3, t3, -r3, -r3, t3, t3, t3}, - { c0, c1, c0, -c1, c0, c0, -c1, c0, c1}, - {-r3, t3, -r3, t3, t3, t3, t3, -r3, t3}, - { c1, c4, -c2, c4, -c2, -c2, c4, -c2, c4}, - { c0, c4, -c2, c4, c0, c0, -c4, c2, -c4}, - { c0, c4, c0, -c4, -c2, c2, c4, c0, -c4}}; - - -#define wa (6.0/72.0) -#define wb (4.0/72.0) -#define wc (3.0/72.0) - -const double mi_[NVEL9][NVEL9] = { - {w0, c0, c0, -t3, c0, -t3, w1, c0, c0}, - {w2, wa, wa, wa, r4, wa, w2, wc, wc}, - {w1, r3, c0, r3, c0, -r6, -wb, -wa, c0}, - {w2, wa, -wa, wa, -r4, wa, w2, wc, -wc}, - {w1, c0, r3, -r6, c0, r3, -wb, c0, -wa}, - {w1, c0, -r3, -r6, c0, r3, -wb, c0, wa}, - {w2, -wa, wa, wa, -r4, wa, w2, -wc, wc}, - {w1, -r3, c0, r3, c0, -r6, -wb, wa, c0}, - {w2, -wa, -wa, wa, r4, wa, w2, -wc, -wc}}; -*/ - -const int xblocklen_cv[CVXBLOCK9] = {3}; -const int xdisp_fwd_cv[CVXBLOCK9] = {1}; -const int xdisp_bwd_cv[CVXBLOCK9] = {6}; - -const int yblocklen_cv[CVYBLOCK9] = {1, 1, 1}; -const int ydisp_fwd_cv[CVYBLOCK9] = {1, 4, 6}; -const int ydisp_bwd_cv[CVYBLOCK9] = {3, 5, 8}; - -const int zblocklen_cv[CVZBLOCK9] = {0}; -const int zdisp_fwd_cv[CVZBLOCK9] = {0}; -const int zdisp_bwd_cv[CVZBLOCK9] = {0}; - -#endif diff --git a/src/d2q9.h b/src/d2q9.h deleted file mode 100644 index a802bba42..000000000 --- a/src/d2q9.h +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * - * d2q9.h - * - * D2Q9 definitions. - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2010-2021 The University of Edinburgh - * - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * - *****************************************************************************/ - -#ifndef LUDWIG_D2Q9_MODEL_H -#define LUDWIG_D2Q9_MODEL_H - -enum {NDIM9 = 2}; -enum {NVEL9 = 9}; -enum {CVXBLOCK9 = 1}; -enum {CVYBLOCK9 = 3}; -enum {CVZBLOCK9 = 1}; - -#include "lb_d2q9.h" - -#ifdef _D2Q9_ - -extern const int xblocklen_cv[CVXBLOCK9]; -extern const int xdisp_fwd_cv[CVXBLOCK9]; -extern const int xdisp_bwd_cv[CVXBLOCK9]; - -extern const int yblocklen_cv[CVYBLOCK9]; -extern const int ydisp_fwd_cv[CVYBLOCK9]; -extern const int ydisp_bwd_cv[CVYBLOCK9]; - -extern const int zblocklen_cv[CVZBLOCK9]; -extern const int zdisp_fwd_cv[CVZBLOCK9]; -extern const int zdisp_bwd_cv[CVZBLOCK9]; - -#endif - -#endif diff --git a/src/d3q15.c b/src/d3q15.c deleted file mode 100644 index 8fd9bd6f0..000000000 --- a/src/d3q15.c +++ /dev/null @@ -1,134 +0,0 @@ -/***************************************************************************** - * - * d3q15.c - * - * D3Q15 model definitions. - * - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2008-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * Ronojoy Adhikari computed this D3Q15 basis. - * - *****************************************************************************/ - -#include "d3q15.h" - -const char * model_name_d3q15 = "D3Q15"; - -#ifdef _D3Q15_ - -/***************************************************************************** - * - * There are 15 eigenvectors: - * - * rho density - * rho cv[p][X] (x-component of velocity) - * rho cv[p][Y] (y-component of velocity) - * rho cv[p][Z] (z-component of velocity) - * q[p][X][X] (xx component of deviatoric stress) - * q[p][X][Y] (xy component of deviatoric stress) - * q[p][X][Z] (xz ... - * q[p][Y][Y] (yy ... - * q[p][Y][Z] (yz ... - * q[p][Z][Z] (zz ... - * chi1[p] (1st ghost mode) - * jchi1[p][X] (x-component of ghost current chi1[p]*cv[p][X]) - * jchi1[p][Y] (y-component of ghost current chi1[p]*cv[p][Y]) - * jchi1[p][Z] (z-component of ghost current chi1[p]*cv[p][Z]) - * chi3[p] (2nd ghost mode cv[p][X]*cv[p][Y]*cv[p][Z]) - * - * We define the following: - * - * cv[NVEL][3] lattice velocities (integers) - * q_[NVEL][3][3] kinetic projector c[p][i]*c[p][j] - c_s^2 d_[i][j] - * wv[NVEL] quadrature weight for each velocity - * norm_[NVEL] normaliser for each mode - * - * ma_[NVEL][NVEL] full matrix of eigenvectors (doubles) - * mi_[NVEL][NVEL] inverse of ma_[][] - * - * The eigenvectors are the rows of the matrix ma_[NVEL][NVEL]. - * - * Reduced halo swap information - * CVXBLOCK number of separate blocks to send in x-direction - * CVYBLOCK ditto ... y-direction - * CVZBLOCK ditto ... z-direction - * - * For each direction there is then an array of ... - * - * blocklen block lengths - * disp_fwd displacements of block from start (forward direction) - * disp_bwd displacements of block from start (backward direction) - * - *****************************************************************************/ - -#define w0 (16.0/72.0) -#define w1 ( 8.0/72.0) -#define w3 ( 1.0/72.0) - -#define c0 0.0 -#define c1 1.0 -#define c2 2.0 -#define r3 (1.0/3.0) -#define r6 (1.0/6.0) -#define t3 (2.0/3.0) - -#define wa ( 3.0/72.0) -#define wb ( 9.0/72.0) -#define wc ( 4.0/72.0) - -/* -const double ma_[NVEL15][NVEL15] = - {{ c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1}, - { c0, c1, c1, c1, c1, c1, c0, c0, c0, c0,-c1,-c1,-c1,-c1,-c1}, - { c0, c1, c1, c0,-c1,-c1, c1, c0, c0,-c1, c1, c1, c0,-c1,-c1}, - { c0, c1,-c1, c0, c1,-c1, c0, c1,-c1, c0, c1,-c1, c0, c1,-c1}, - {-r3, t3, t3, t3, t3, t3,-r3,-r3,-r3,-r3, t3, t3, t3, t3, t3}, - { c0, c1, c1, c0,-c1,-c1, c0, c0, c0, c0,-c1,-c1, c0, c1, c1}, - { c0, c1,-c1, c0, c1,-c1, c0, c0, c0, c0,-c1, c1, c0,-c1, c1}, - {-r3, t3, t3,-r3, t3, t3, t3,-r3,-r3, t3, t3, t3,-r3, t3, t3}, - { c0, c1,-c1, c0,-c1, c1, c0, c0, c0, c0, c1,-c1, c0,-c1, c1}, - {-r3, t3, t3,-r3, t3, t3,-r3, t3, t3,-r3, t3, t3,-r3, t3, t3}, - {-c2,-c2,-c2, c1,-c2,-c2, c1, c1, c1, c1,-c2,-c2, c1,-c2,-c2}, - { c0,-c2,-c2, c1,-c2,-c2, c0, c0, c0, c0, c2, c2,-c1, c2, c2}, - { c0,-c2,-c2, c0, c2, c2, c1, c0, c0,-c1,-c2,-c2, c0, c2, c2}, - { c0,-c2, c2, c0,-c2, c2, c0, c1,-c1, c0,-c2, c2, c0,-c2, c2}, - { c0, c1,-c1, c0,-c1, c1, c0, c0, c0, c0,-c1, c1, c0, c1,-c1}}; - -const double mi_[NVEL15][NVEL15] = - {{ w0, c0, c0, c0,-r3, c0, c0,-r3, c0,-r3,-w0, c0, c0, c0, c0}, - { w3, wa, wa, wa, wa, wb, wb, wa, wb, wa,-w3,-wa,-wa,-wa, wb}, - { w3, wa, wa,-wa, wa, wb,-wb, wa,-wb, wa,-w3,-wa,-wa, wa,-wb}, - { w1, r3, c0, c0, r3, c0, c0,-r6, c0,-r6, wc, r6, c0, c0, c0}, - { w3, wa,-wa, wa, wa,-wb, wb, wa,-wb, wa,-w3,-wa, wa,-wa,-wb}, - { w3, wa,-wa,-wa, wa,-wb,-wb, wa, wb, wa,-w3,-wa, wa, wa, wb}, - { w1, c0, r3, c0,-r6, c0, c0, r3, c0,-r6, wc, c0, r6, c0, c0}, - { w1, c0, c0, r3,-r6, c0, c0,-r6, c0, r3, wc, c0, c0, r6, c0}, - { w1, c0, c0,-r3,-r6, c0, c0,-r6, c0, r3, wc, c0, c0,-r6, c0}, - { w1, c0,-r3, c0,-r6, c0, c0, r3, c0,-r6, wc, c0,-r6, c0, c0}, - { w3,-wa, wa, wa, wa,-wb,-wb, wa, wb, wa,-w3, wa,-wa,-wa,-wb}, - { w3,-wa, wa,-wa, wa,-wb, wb, wa,-wb, wa,-w3, wa,-wa, wa, wb}, - { w1,-r3, c0, c0, r3, c0, c0,-r6, c0,-r6, wc,-r6, c0, c0, c0}, - { w3,-wa,-wa, wa, wa, wb,-wb, wa,-wb, wa,-w3, wa, wa,-wa, wb}, - { w3,-wa,-wa,-wa, wa, wb, wb, wa, wb, wa,-w3, wa, wa, wa,-wb}}; -*/ - -const int xblocklen_cv[CVXBLOCK15] = {5}; -const int xdisp_fwd_cv[CVXBLOCK15] = {1}; -const int xdisp_bwd_cv[CVXBLOCK15] = {10}; - -const int yblocklen_cv[CVYBLOCK15] = {2, 1, 2}; -const int ydisp_fwd_cv[CVYBLOCK15] = {1, 6, 10}; -const int ydisp_bwd_cv[CVYBLOCK15] = {4, 9, 13}; - -const int zblocklen_cv[CVZBLOCK15] = {1, 1, 1, 1, 1}; -const int zdisp_fwd_cv[CVZBLOCK15] = {1, 4, 7, 10, 13}; -const int zdisp_bwd_cv[CVZBLOCK15] = {2, 5, 8, 11, 14}; - -#endif diff --git a/src/d3q15.h b/src/d3q15.h deleted file mode 100644 index 3121127ad..000000000 --- a/src/d3q15.h +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * - * d3q15.h - * - * D3Q15 definitions. - * - * Edinburgh Soft Matter and Statistical Physics Group - * and Edinburgh Parallel Computing Centre - * - * (c) 2008-2021 The University of Edinburgh - * - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * - *****************************************************************************/ - -#ifndef LUDWIG_D3Q15_MODEL_H -#define LUDWIG_D3Q15_MODEL_H - -enum {NDIM15 = 3}; -enum {NVEL15 = 15}; -enum {CVXBLOCK15 = 1}; -enum {CVYBLOCK15 = 3}; -enum {CVZBLOCK15 = 5}; - -#include "lb_d3q15.h" - -#ifdef _D3Q15_ - -extern const int xblocklen_cv[CVXBLOCK15]; -extern const int xdisp_fwd_cv[CVXBLOCK15]; -extern const int xdisp_bwd_cv[CVXBLOCK15]; - -extern const int yblocklen_cv[CVYBLOCK15]; -extern const int ydisp_fwd_cv[CVYBLOCK15]; -extern const int ydisp_bwd_cv[CVYBLOCK15]; - -extern const int zblocklen_cv[CVZBLOCK15]; -extern const int zdisp_fwd_cv[CVZBLOCK15]; -extern const int zdisp_bwd_cv[CVZBLOCK15]; - -#endif - -#endif - diff --git a/src/d3q19.c b/src/d3q19.c deleted file mode 100644 index 153fed780..000000000 --- a/src/d3q19.c +++ /dev/null @@ -1,155 +0,0 @@ -/***************************************************************************** - * - * d3q19.c - * - * D3Q19 definitions. - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2008-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * Ronojoy Adhikari computed this D3Q19 basis. - * - *****************************************************************************/ - -#include "d3q19.h" - -const char * model_name_d3q19 = "D3Q19"; - -#ifdef _D3Q19_ - -/***************************************************************************** - * - * There are 19 eigenvectors (rows of ma): - * - * rho (eigenvector implicitly {1}) - * rho cv[p][X] (x-component of velocity) - * rho cv[p][Y] (y-component of velocity) - * rho cv[p][Z] (z-component of velocity) - * q[p][X][X] (xx component of deviatoric stress) - * q[p][X][Y] (xy component of deviatoric stress) - * q[p][X][Z] (xz ... - * q[p][Y][Y] (yy ... - * q[p][Y][Z] (yz ... - * q[p][Z][Z] (zz ... - * chi1[p] (1st scalar ghost mode) - * jchi1[p][X] (x-component of ghost current chi1[p]*rho*cv[p][X]) - * jchi1[p][Y] (y-component of ghost current chi1[p]*rho*cv[p][Y]) - * jchi1[p][Z] (z-component of ghost current chi1[p]*rho*cv[p][Z]) - * chi2[p] (2nd scalar ghost mode) - * jchi2[p][X] (x-component of ghost current chi2[p]*rho*cv[p][X]) - * jchi2[p][Y] (y-component of ghost current chi2[p]*rho*cv[p][Y]) - * jchi2[p][Z] (z-component of ghost current chi2[p]*rho*cv[p][Z]) - * chi3[p] (3rd scalar ghost mode) - * - * - * We define the following: - * - * cv[NVEL][3] lattice velocities (integers) - * q_[NVEL][3][3] kinetic projector c[p][i]*c[p][j] - c_s^2 d_[i][j] - * wv[NVEL] quadrature weight for each velocity - * norm_[NVEL] normaliser for each mode - * - * ma_[NVEL][NVEL] full matrix of eigenvectors (doubles) - * mi_[NVEL][NVEL] inverse of ma_[][] - * - * blocklens reduced halo datatype blocklengths - * disp_fwd reduced halo datatype displacements - * disp_bwd reduced halo datatype displacements - * - * Reduced halo swap information - * CVXBLOCK number of separate blocks to send in x-direction - * CVYBLOCK ditto ... y-direction - * CVZBLOCK ditto ... z-direction - * - * For each direction there is then an array of ... - * - * blocklen block lengths - * disp_fwd displacements of block from start (forward direction) - * disp_bwd displacements of block from start (backward direction) - * - * - *****************************************************************************/ - -#define w0 (12.0/36.0) -#define w1 (2.0/36.0) -#define w2 (1.0/36.0) - -#define c0 0.0 -#define c1 1.0 -#define c2 2.0 -#define r3 (1.0/3.0) -#define r6 (1.0/6.0) -#define t3 (2.0/3.0) -#define r2 (1.0/2.0) -#define r4 (1.0/4.0) -#define r8 (1.0/8.0) - -#define wc ( 1.0/72.0) -#define wb ( 3.0/72.0) -#define wa ( 6.0/72.0) -#define t4 (16.0/72.0) -#define wd ( 1.0/48.0) -#define we ( 3.0/48.0) - -/* Global symbols are replaced by lb_model_t ... -const double ma_[NVEL19][NVEL19] = { -{ c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1}, -{ c0, c1, c1, c1, c1, c1, c0, c0, c0, c0, c0, c0, c0, c0,-c1,-c1,-c1,-c1,-c1}, -{ c0, c1, c0, c0, c0,-c1, c1, c1, c1, c0, c0,-c1,-c1,-c1, c1, c0, c0, c0,-c1}, -{ c0, c0, c1, c0,-c1, c0, c1, c0,-c1, c1,-c1, c1, c0,-c1, c0, c1, c0,-c1, c0}, -{-r3, t3, t3, t3, t3, t3,-r3,-r3,-r3,-r3,-r3,-r3,-r3,-r3, t3, t3, t3, t3, t3}, -{ c0, c1, c0, c0, c0,-c1, c0, c0, c0, c0, c0, c0, c0, c0,-c1, c0, c0, c0, c1}, -{ c0, c0, c1, c0,-c1, c0, c0, c0, c0, c0, c0, c0, c0, c0, c0,-c1, c0, c1, c0}, -{-r3, t3,-r3,-r3,-r3, t3, t3, t3, t3,-r3,-r3, t3, t3, t3, t3,-r3,-r3,-r3, t3}, -{ c0, c0, c0, c0, c0, c0, c1, c0,-c1, c0, c0,-c1, c0, c1, c0, c0, c0, c0, c0}, -{-r3,-r3, t3,-r3, t3,-r3, t3,-r3, t3, t3, t3, t3,-r3, t3,-r3, t3,-r3, t3,-r3}, -{ c0,-c2, c1, c1, c1,-c2, c1, c1, c1,-c2,-c2, c1, c1, c1,-c2, c1, c1, c1,-c2}, -{ c0,-c2, c1, c1, c1,-c2, c0, c0, c0, c0, c0, c0, c0, c0, c2,-c1,-c1,-c1, c2}, -{ c0,-c2, c0, c0, c0, c2, c1, c1, c1, c0, c0,-c1,-c1,-c1,-c2, c0, c0, c0, c2}, -{ c0, c0, c1, c0,-c1, c0, c1, c0,-c1,-c2, c2, c1, c0,-c1, c0, c1, c0,-c1, c0}, -{ c0, c0,-c1, c1,-c1, c0, c1,-c1, c1, c0, c0, c1,-c1, c1, c0,-c1, c1,-c1, c0}, -{ c0, c0,-c1, c1,-c1, c0, c0, c0, c0, c0, c0, c0, c0, c0, c0, c1,-c1, c1, c0}, -{ c0, c0, c0, c0, c0, c0, c1,-c1, c1, c0, c0,-c1, c1,-c1, c0, c0, c0, c0, c0}, -{ c0, c0,-c1, c0, c1, c0, c1, c0,-c1, c0, c0, c1, c0,-c1, c0,-c1, c0, c1, c0}, -{ c1, c1, c1,-c2, c1, c1, c1,-c2, c1,-c2,-c2, c1,-c2, c1, c1, c1,-c2, c1, c1} -}; - -const double mi_[NVEL19][NVEL19] = { -{w0, c0, c0, c0,-r2, c0, c0,-r2, c0,-r2, c0, c0, c0, c0, c0, c0, c0, c0, r6}, -{w2, wa, wa, c0, wa, r4, c0, wa, c0,-wb,-wb,-wa,-wa, c0, c0, c0, c0, c0, wc}, -{w2, wa, c0, wa, wa, c0, r4,-wb, c0, wa, wd, wb, c0, wb,-we,-r8, c0,-r8, wc}, -{w1, r6, c0, c0, r6, c0, c0,-wa, c0,-wa, wb, wa, c0, c0, r8, r4, c0, c0,-w1}, -{w2, wa, c0,-wa, wa, c0,-r4,-wb, c0, wa, wd, wb, c0,-wb,-we,-r8, c0, r8, wc}, -{w2, wa,-wa, c0, wa,-r4, c0, wa, c0,-wb,-wb,-wa, wa, c0, c0, c0, c0, c0, wc}, -{w2, c0, wa, wa,-wb, c0, c0, wa, r4, wa, wd, c0, wb, wb, we, c0, r8, r8, wc}, -{w1, c0, r6, c0,-wa, c0, c0, r6, c0,-wa, wb, c0, wa, c0,-r8, c0,-r4, c0,-w1}, -{w2, c0, wa,-wa,-wb, c0, c0, wa,-r4, wa, wd, c0, wb,-wb, we, c0, r8,-r8, wc}, -{w1, c0, c0, r6,-wa, c0, c0,-wa, c0, r6,-wa, c0, c0,-r6, c0, c0, c0, c0,-w1}, -{w1, c0, c0,-r6,-wa, c0, c0,-wa, c0, r6,-wa, c0, c0, r6, c0, c0, c0, c0,-w1}, -{w2, c0,-wa, wa,-wb, c0, c0, wa,-r4, wa, wd, c0,-wb, wb, we, c0,-r8, r8, wc}, -{w1, c0,-r6, c0,-wa, c0, c0, r6, c0,-wa, wb, c0,-wa, c0,-r8, c0, r4, c0,-w1}, -{w2, c0,-wa,-wa,-wb, c0, c0, wa, r4, wa, wd, c0,-wb,-wb, we, c0,-r8,-r8, wc}, -{w2,-wa, wa, c0, wa,-r4, c0, wa, c0,-wb,-wb, wa,-wa, c0, c0, c0, c0, c0, wc}, -{w2,-wa, c0, wa, wa, c0,-r4,-wb, c0, wa, wd,-wb, c0, wb,-we, r8, c0,-r8, wc}, -{w1,-r6, c0, c0, r6, c0, c0,-wa, c0,-wa, wb,-wa, c0, c0, r8,-r4, c0, c0,-w1}, -{w2,-wa, c0,-wa, wa, c0, r4,-wb, c0, wa, wd,-wb, c0,-wb,-we, r8, c0, r8, wc}, -{w2,-wa,-wa, c0, wa, r4, c0, wa, c0,-wb,-wb, wa, wa, c0, c0, c0, c0, c0, wc} -}; -*/ -const int xblocklen_cv[CVXBLOCK19] = {5}; -const int xdisp_fwd_cv[CVXBLOCK19] = {1}; -const int xdisp_bwd_cv[CVXBLOCK19] = {14}; - -const int yblocklen_cv[CVYBLOCK19] = {1, 3, 1}; -const int ydisp_fwd_cv[CVYBLOCK19] = {1, 6, 14}; -const int ydisp_bwd_cv[CVYBLOCK19] = {5, 11, 18}; - -const int zblocklen_cv[CVZBLOCK19] = {1, 1, 1, 1, 1}; -const int zdisp_fwd_cv[CVZBLOCK19] = {2, 6, 9, 11, 15}; -const int zdisp_bwd_cv[CVZBLOCK19] = {4, 8, 10, 13, 17}; - -#endif diff --git a/src/d3q19.h b/src/d3q19.h deleted file mode 100644 index b53e8a101..000000000 --- a/src/d3q19.h +++ /dev/null @@ -1,45 +0,0 @@ -/***************************************************************************** - * - * d3q19.h - * - * D3Q19 definitions. - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel computing Centre - * - * (c) 2008-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * Ronojoy Adhikari computed this D3Q19 basis. - * - *****************************************************************************/ - -#ifndef LUDWIG_D3Q19_MODEL_H -#define LUDWIG_D3Q19_MODEL_H - -enum {NDIM19 = 3}; -enum {NVEL19 = 19}; -enum {CVXBLOCK19 = 1}; -enum {CVYBLOCK19 = 3}; -enum {CVZBLOCK19 = 5}; - -#include "lb_d3q19.h" - -#ifdef _D3Q19_ - -extern const int xblocklen_cv[CVXBLOCK19]; -extern const int xdisp_fwd_cv[CVXBLOCK19]; -extern const int xdisp_bwd_cv[CVXBLOCK19]; - -extern const int yblocklen_cv[CVYBLOCK19]; -extern const int ydisp_fwd_cv[CVYBLOCK19]; -extern const int ydisp_bwd_cv[CVYBLOCK19]; - -extern const int zblocklen_cv[CVZBLOCK19]; -extern const int zdisp_fwd_cv[CVZBLOCK19]; -extern const int zdisp_bwd_cv[CVZBLOCK19]; - -#endif - -#endif diff --git a/src/distribution_rt.c b/src/distribution_rt.c index f68069308..e6de2b750 100644 --- a/src/distribution_rt.c +++ b/src/distribution_rt.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -60,7 +60,7 @@ int lb_ndist_rt(rt_t * rt) { { /* The only exception ... */ - char description[BUFSIZ] = {}; + char description[BUFSIZ] = {0}; rt_string_parameter(rt, "free_energy", description, BUFSIZ); if (strcmp(description, "symmetric_lb") == 0) ndist = 2; } @@ -75,9 +75,6 @@ int lb_ndist_rt(rt_t * rt) { * Some old keys are trapped with advice before accepting new keys. * * Miscellaneous input keys - * - * "lb_reduced_halo" - * * I/O * * If no options at all are specfied in the input, io_options_t information @@ -133,7 +130,6 @@ int lb_run_time(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { * * Input key default * ----------------------------------------- - * "reduced_halo" "no" * "distribution_io_grid" {1,1,1} * "distribution_io_format_input" "binary" * @@ -146,7 +142,6 @@ int lb_run_time(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { int ndist; - int nreduced; int io_grid[3] = {1, 1, 1}; char string[FILENAME_MAX] = ""; char memory = ' '; @@ -165,9 +160,52 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { assert(rt); assert(lb); - nreduced = 0; - rt_string_parameter(rt,"reduced_halo", string, FILENAME_MAX); - if (strcmp(string, "yes") == 0) nreduced = 1; + /* Number of distributions */ + + ndist = lb_ndist_rt(rt); + assert(ndist == 1 || ndist == 2); + + /* Halo options */ + + options.ndim = NDIM; + options.nvel = NVEL; + options.ndist = ndist; + + /* Halo options */ + { + char htype[BUFSIZ] = {0}; + int havetype = rt_string_parameter(rt, "lb_halo_scheme", htype, BUFSIZ); + if (strcmp(htype, "lb_halo_target") == 0) { + options.halo = LB_HALO_TARGET; + } + else if (strcmp(htype, "lb_halo_openmp_full") == 0) { + options.halo = LB_HALO_OPENMP_FULL; + } + else if (strcmp(htype, "lb_halo_openmp_reduced") == 0) { + options.halo = LB_HALO_OPENMP_REDUCED; + } + else if (havetype) { + pe_fatal(pe, "lb_halo_scheme not recognised\n"); + } + + /* I'm going to trap this silently here - which is slightly + * better than having the wrong halo. I avoid a message so + * not as to disrupt the regression tests. */ + { + int ndevice = 0; + tdpGetDeviceCount(&ndevice); + if (ndevice > 0) options.halo = LB_HALO_TARGET; + } + + options.reportimbalance = rt_switch(rt, "lb_halo_report_imbalance"); + + if (lb_data_options_valid(&options) == 0) { + pe_fatal(pe, "lb_data_options are invalid. Please check halo.\n"); + } + } + + + /* I//O Grid */ rt_int_parameter_vector(rt, "distribution_io_grid", io_grid); @@ -179,9 +217,6 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { /* TODO: r -> "AOS" or "SOA" or "AOSOA" */ if (DATA_MODEL == DATA_MODEL_SOA) memory = 'R'; - ndist = lb_ndist_rt(rt); - assert(ndist == 1 || ndist == 2); - pe_info(pe, "\n"); pe_info(pe, "Lattice Boltzmann distributions\n"); pe_info(pe, "-------------------------------\n"); @@ -189,7 +224,19 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { pe_info(pe, "Model: d%dq%d %c\n", NDIM, NVEL, memory); pe_info(pe, "SIMD vector len: %d\n", NSIMDVL); pe_info(pe, "Number of sets: %d\n", ndist); - pe_info(pe, "Halo type: %s\n", (nreduced == 1) ? "reduced" : "full"); + + if (options.halo == LB_HALO_TARGET) { + pe_info(pe, "Halo type: %s\n", "lb_halo_target (full halo)"); + } + if (options.halo == LB_HALO_OPENMP_FULL) { + pe_info(pe, "Halo type: %s\n", "lb_halo_openmp_full (host)"); + } + if (options.halo == LB_HALO_OPENMP_REDUCED) { + pe_info(pe, "Halo type: %s\n", "lb_halo_openmp_reduced (host)"); + } + if (options.reportimbalance) { + pe_info(pe, "Imbalance time: %s\n", "reported"); + } if (strcmp("BINARY_SERIAL", string) == 0) { pe_info(pe, "Input format: binary single serial file\n"); @@ -245,51 +292,11 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { /* Initialise */ - options.ndim = NDIM; - options.nvel = NVEL; - options.ndist = ndist; - - /* Halo options */ - if (nreduced == 1) options.halo = LB_HALO_REDUCED; - { - char htype[BUFSIZ] = {}; - int havetype = rt_string_parameter(rt, "lb_halo_scheme", htype, BUFSIZ); - if (strcmp(htype, "lb_halo_host") == 0) { - options.halo = LB_HALO_HOST; - } - else if (strcmp(htype, "lb_halo_target") == 0) { - options.halo = LB_HALO_TARGET; - } - else if (strcmp(htype, "lb_halo_full") == 0) { - options.halo = LB_HALO_FULL; - } - else if (strcmp(htype, "lb_halo_reduced") == 0) { - options.halo = LB_HALO_REDUCED; - } - else if (strcmp(htype, "lb_halo_openmp_full") == 0) { - options.halo = LB_HALO_OPENMP_FULL; - } - else if (strcmp(htype, "lb_halo_openmp_reduced") == 0) { - options.halo = LB_HALO_OPENMP_REDUCED; - } - else if (havetype) { - pe_fatal(pe, "lb_halo_scheme not recognised\n"); - } - if (havetype) { - pe_info(pe, "Halo scheme: %s\n", htype); - } - - options.reportimbalance = rt_switch(rt, "lb_halo_report_imbalance"); - if (options.reportimbalance) { - pe_info(pe, "Imbalance time: %s\n", "reported"); - } - } - lb_data_create(pe, cs, &options, lb); /* distribution i/o */ { - io_info_args_t tmp = {}; + io_info_args_t tmp = io_info_args_default(); tmp.grid[X] = io_grid[X]; tmp.grid[Y] = io_grid[Y]; tmp.grid[Z] = io_grid[Z]; @@ -341,7 +348,7 @@ int lb_rt_initial_conditions(pe_t * pe, rt_t * rt, lb_t * lb, double u0 = 0.0; double delta = 0.0; double kappa = 0.0; - kh_2d_param_t kh = {}; + kh_2d_param_t kh = {0}; rt_key_required(rt, "2d_kelvin_helmholtz_u0", RT_FATAL); rt_key_required(rt, "2d_kelvin_helmholtz_delta", RT_FATAL); diff --git a/src/fe_ternary_rt.c b/src/fe_ternary_rt.c index a1df9112e..794cfcc65 100644 --- a/src/fe_ternary_rt.c +++ b/src/fe_ternary_rt.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group * and Edinburgh Parallel Computing Centre * - * (c) 2019-2021 The University of Edinburgh + * (c) 2019-2022 The University of Edinburgh * * Contributing authors: * Shan Chen (shan.chen@epfl.ch) @@ -110,7 +110,7 @@ __host__ int fe_ternary_init_rt(pe_t * pe, rt_t * rt, fe_ternary_t * fe, if (p != 0 && strcmp(value, "2d_double_emulsion") == 0) { - fti_block_t param = {}; + fti_block_t param = {0}; /* Default parameters (historically to give roughly equal areas) */ param.xf1 = 0.2; @@ -139,7 +139,7 @@ __host__ int fe_ternary_init_rt(pe_t * pe, rt_t * rt, fe_ternary_t * fe, if (p != 0 && strcmp(value, "2d_tee") == 0) { - fti_block_t param = {}; + fti_block_t param = {0}; /* Default parameters (roughly equal area) */ @@ -160,7 +160,7 @@ __host__ int fe_ternary_init_rt(pe_t * pe, rt_t * rt, fe_ternary_t * fe, if (p != 0 && strcmp(value, "2d_lens") == 0) { - fti_drop_t drop = {}; + fti_drop_t drop = {0}; /* No defaults */ rt_key_required(rt, "ternary_2d_lens_centre", RT_FATAL); @@ -174,8 +174,8 @@ __host__ int fe_ternary_init_rt(pe_t * pe, rt_t * rt, fe_ternary_t * fe, if (p != 0 && strcmp(value, "2d_double_drop") == 0) { - fti_drop_t drop1 = {}; - fti_drop_t drop2 = {}; + fti_drop_t drop1 = {0}; + fti_drop_t drop2 = {0}; /* No defaults */ rt_key_required(rt, "ternary_2d_drop1_centre", RT_FATAL); diff --git a/src/field.c b/src/field.c index ca3071cb3..5c517f8a7 100644 --- a/src/field.c +++ b/src/field.c @@ -14,7 +14,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -284,7 +284,7 @@ __host__ __device__ int field_nf(field_t * obj, int * nf) { __host__ int field_init_io_info(field_t * obj, int grid[3], int form_in, int form_out) { - io_info_args_t args = {}; + io_info_args_t args = io_info_args_default(); assert(obj); assert(obj->info == NULL); @@ -1094,7 +1094,7 @@ int field_halo_dequeue_recv(field_t * field, const field_halo_t * h, int ireq) { int field_halo_create(const field_t * field, field_halo_t * h) { - int nlocal[3] = {}; + int nlocal[3] = {0}; int nhalo = 0; assert(field); @@ -1120,15 +1120,15 @@ int field_halo_create(const field_t * field, field_halo_t * h) { /* Ranks of Cartesian neighbours */ { - int dims[3] = {}; - int periods[3] = {}; - int coords[3] = {}; + int dims[3] = {0}; + int periods[3] = {0}; + int coords[3] = {0}; MPI_Cart_get(h->comm, 3, dims, periods, coords); for (int p = 0; p < h->nvel; p++) { - int nbr[3] = {}; - int out[3] = {}; /* Out-of-range is erroneous for non-perioidic dims */ + int nbr[3] = {0}; + int out[3] = {0}; /* Out-of-range is erroneous for non-perioidic dims */ int i = 1 + h->cv[p][X]; int j = 1 + h->cv[p][Y]; int k = 1 + h->cv[p][Z]; @@ -1136,9 +1136,9 @@ int field_halo_create(const field_t * field, field_halo_t * h) { nbr[X] = coords[X] + h->cv[p][X]; nbr[Y] = coords[Y] + h->cv[p][Y]; nbr[Z] = coords[Z] + h->cv[p][Z]; - out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X])); - out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y])); - out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z])); + out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X] - 1)); + out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y] - 1)); + out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z] - 1)); if (out[X] || out[Y] || out[Z]) { h->nbrrank[i][j][k] = MPI_PROC_NULL; diff --git a/src/hydro.c b/src/hydro.c index 00ee44c24..dd9eb8867 100644 --- a/src/hydro.c +++ b/src/hydro.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -306,7 +306,7 @@ __host__ int hydro_halo_swap(hydro_t * obj, hydro_halo_enum_t flag) { __host__ int hydro_init_io_info(hydro_t * obj, int grid[3], int form_in, int form_out) { - io_info_args_t args = {}; + io_info_args_t args = io_info_args_default(); assert(obj); assert(grid); @@ -1423,7 +1423,7 @@ int hydro_halo_dequeue_recv(hydro_t * hydro, const hydro_halo_t * h, int ireq) { int hydro_halo_create(const hydro_t * hydro, hydro_halo_t * h) { - int nlocal[3] = {}; + int nlocal[3] = {0}; assert(hydro); assert(h); @@ -1448,15 +1448,15 @@ int hydro_halo_create(const hydro_t * hydro, hydro_halo_t * h) { /* Ranks of Cartesian neighbours */ { - int dims[3] = {}; - int periods[3] = {}; - int coords[3] = {}; + int dims[3] = {0}; + int periods[3] = {0}; + int coords[3] = {0}; MPI_Cart_get(h->comm, 3, dims, periods, coords); for (int p = 0; p < h->nvel; p++) { - int nbr[3] = {}; - int out[3] = {}; /* Out-of-range is erroneous for non-perioidic dims */ + int nbr[3] = {0}; + int out[3] = {0}; /* Out-of-range is erroneous for non-perioidic dims */ int i = 1 + h->cv[p][X]; int j = 1 + h->cv[p][Y]; int k = 1 + h->cv[p][Z]; @@ -1464,9 +1464,9 @@ int hydro_halo_create(const hydro_t * hydro, hydro_halo_t * h) { nbr[X] = coords[X] + h->cv[p][X]; nbr[Y] = coords[Y] + h->cv[p][Y]; nbr[Z] = coords[Z] + h->cv[p][Z]; - out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X])); - out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y])); - out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z])); + out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X] - 1)); + out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y] - 1)); + out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z] - 1)); if (out[X] || out[Y] || out[Z]) { h->nbrrank[i][j][k] = MPI_PROC_NULL; diff --git a/src/input.ref b/src/input.ref index 07c0a8425..a9a2f4118 100644 --- a/src/input.ref +++ b/src/input.ref @@ -1,7 +1,8 @@ ############################################################################## # # Ludwig input file -# Reference. +# Example. +# Please see https://ludwig.epcc.ed.ac.uk for details. # # Lines introduced with # and blank lines are ignored. # @@ -16,10 +17,6 @@ # If a given keyword does not appear, or is commented out, a default # value will be used. # -# $Id$ -# -# Public comment. -# ############################################################################## ############################################################################## @@ -47,17 +44,12 @@ N_cycles 100001 # MPI will choose a default (may be implementation-dependent). # # periodicity Periodicity of MPI Cartesian communicator -# -# reduced_halo [yes|no] use reduced or full halos. Using reduced halos -# is *only* appropriate for fluid only problems. -# Default is no. # ############################################################################## size 64_2_2 grid 4_1_1 periodicity 0_1_1 -reduced_halo no ############################################################################## # @@ -615,5 +607,4 @@ electrosymmetric_delta_mu1 2.0 # ############################################################################### -#random_seed 7361237 random_seed 8361235 diff --git a/src/lb_bc_inflow_opts.c b/src/lb_bc_inflow_opts.c index 541eefaca..804bd946b 100644 --- a/src/lb_bc_inflow_opts.c +++ b/src/lb_bc_inflow_opts.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -28,7 +28,7 @@ lb_bc_inflow_opts_t lb_bc_inflow_opts_default(void) { - lb_bc_inflow_opts_t opts = {.nvel = 19, .flow = {}, .u0 = {}}; + lb_bc_inflow_opts_t opts = {.nvel = 19, .flow = {0}, .u0 = {0}}; return opts; } diff --git a/src/lb_bc_inflow_rhou.c b/src/lb_bc_inflow_rhou.c index 69b82069e..7fe0aa1ed 100644 --- a/src/lb_bc_inflow_rhou.c +++ b/src/lb_bc_inflow_rhou.c @@ -18,7 +18,7 @@ * Edinburgh Soft Matter and Statistical Phsyics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * *****************************************************************************/ @@ -141,7 +141,7 @@ __host__ int lb_bc_inflow_init_link(lb_bc_inflow_rhou_t * inflow, link_init_enum_t init, int id) { cs_t * cs = NULL; - int noffset[3] = {}; + int noffset[3] = {0}; int nlink = 0; assert(inflow); @@ -151,10 +151,10 @@ __host__ int lb_bc_inflow_init_link(lb_bc_inflow_rhou_t * inflow, cs_nlocal_offset(cs, noffset); if (noffset[id] == 0) { - int ntotal[3] = {}; - int nlocal[3] = {}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; - lb_model_t model = {}; + lb_model_t model = {0}; lb_model_create(inflow->options.nvel, &model); cs_ntotal(cs, ntotal); @@ -237,7 +237,7 @@ __host__ int lb_bc_inflow_rhou_update(lb_bc_inflow_rhou_t * inflow, cs_t * cs = NULL; int id = -1; - int noffset[3] = {}; + int noffset[3] = {0}; assert(inflow); assert(hydro); @@ -251,7 +251,7 @@ __host__ int lb_bc_inflow_rhou_update(lb_bc_inflow_rhou_t * inflow, if (noffset[id] == 0) { - int nlocal[3] = {}; + int nlocal[3] = {0}; int idx = inflow->options.flow[X]; int jdy = inflow->options.flow[Y]; int kdz = inflow->options.flow[Z]; @@ -293,8 +293,8 @@ __host__ int lb_bc_inflow_rhou_update(lb_bc_inflow_rhou_t * inflow, __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, hydro_t * hydro) { cs_t * cs = NULL; - int noffset[3] = {}; - int nlocal[3] = {}; + int noffset[3] = {0}; + int nlocal[3] = {0}; const int tag = 12347; @@ -311,10 +311,10 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, if (noffset[X] == 0) { MPI_Comm comm = MPI_COMM_NULL; - MPI_Request req[8] = {}; - double *buf[8] = {}; - int ngbr[8] = {}; - int count[8] = {}; /* Data items */ + MPI_Request req[8] = {0}; + double *buf[8] = {0}; + int ngbr[8] = {0}; + int count[8] = {0}; /* Data items */ int nhalo = 1; /* Only ever one if distributions are involved. */ /* Recv from ... */ @@ -361,7 +361,7 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, int m = 4 + ms; int ib = 0; int nhm1 = nhalo-1; - cs_limits_t lim = {}; + cs_limits_t lim = {0}; if (m == 4) { /* send to Y-1,Z */ lim.jmin = 1; lim.jmax = nhalo; @@ -385,7 +385,7 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, for (int kc = lim.kmin; kc <= lim.kmax; kc++) { int index = cs_index(cs, ic, jc, kc); double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; hydro_rho(hydro, index, &rho); hydro_u(hydro, index, u); buf[m][ib++] = rho; @@ -402,7 +402,7 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, /* Process */ for (int ms = 0; ms < 8; ms++) { int m = -1; - MPI_Status status = {}; + MPI_Status status = {0}; MPI_Waitany(8, req, &m, &status); if (m == MPI_UNDEFINED) continue; @@ -416,7 +416,7 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, else { /* Recv has arrived: unpack to correct destination */ int ib = 0; - cs_limits_t lim = {}; + cs_limits_t lim = {0}; if (m == 0) { /* recv from Y+1,Z */ lim.jmin = nlocal[Y] + 1; lim.jmax = nlocal[Y] + nhalo; @@ -440,7 +440,7 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, for (int kc = lim.kmin; kc <= lim.kmax; kc++) { int index = cs_index(cs, ic, jc, kc); double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; rho = buf[m][ib++]; u[X] = buf[m][ib++]; u[Y] = buf[m][ib++]; @@ -497,7 +497,7 @@ __host__ int lb_bc_inflow_rhou_impose(lb_bc_inflow_rhou_t * inflow, int8_t p = inflow->linkp[n]; double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; hydro_rho(hydro, index, &rho); hydro_u(hydro, index, u); diff --git a/src/lb_bc_open_rt.c b/src/lb_bc_open_rt.c index 154bc4a3f..d2086c014 100644 --- a/src/lb_bc_open_rt.c +++ b/src/lb_bc_open_rt.c @@ -13,7 +13,7 @@ * Edinburgh Parallel Computing Centre * * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contibuting authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -45,7 +45,7 @@ __host__ int lb_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, lb_t * lb, lb_bc_open_t ** outflow) { int have_bc = 0; /* inflow/outflow required */ - int flow[3] = {}; /* flow direction */ + int flow[3] = {0}; /* flow direction */ assert(pe); assert(rt); @@ -55,8 +55,8 @@ __host__ int lb_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, lb_t * lb, have_bc = rt_switch(rt, "lb_bc_open"); if (have_bc) { - int wall[3] = {}; - int periodic[3] = {}; + int wall[3] = {0}; + int periodic[3] = {0}; /* Take flow direction from non-wall direction. */ /* There must be D-1 walls in D dimensions */ @@ -94,8 +94,8 @@ __host__ int lb_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, lb_t * lb, if (have_bc) { - char intype[BUFSIZ] = {}; - double u0[3] = {}; + char intype[BUFSIZ] = {0}; + double u0[3] = {0}; rt_string_parameter(rt, "lb_bc_inflow_type", intype, BUFSIZ/2); rt_double_parameter_vector(rt, "lb_bc_inflow_rhou_u0", u0); @@ -136,7 +136,7 @@ __host__ int lb_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, lb_t * lb, /* Outflow */ if (have_bc) { - char outtype[BUFSIZ] = {}; + char outtype[BUFSIZ] = {0}; double rho0 = 1.0; rt_string_parameter(rt, "lb_bc_outflow_type", outtype, BUFSIZ/2); diff --git a/src/lb_bc_outflow_opts.c b/src/lb_bc_outflow_opts.c index 406dae84f..d35895441 100644 --- a/src/lb_bc_outflow_opts.c +++ b/src/lb_bc_outflow_opts.c @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -22,7 +22,7 @@ lb_bc_outflow_opts_t lb_bc_outflow_opts_default(void) { - lb_bc_outflow_opts_t opts = {.nvel = 19, .flow = {}, .rho0 = 1.0}; + lb_bc_outflow_opts_t opts = {.nvel = 19, .flow = {0}, .rho0 = 1.0}; return opts; } diff --git a/src/lb_bc_outflow_rhou.c b/src/lb_bc_outflow_rhou.c index 122258534..996671d6b 100644 --- a/src/lb_bc_outflow_rhou.c +++ b/src/lb_bc_outflow_rhou.c @@ -18,7 +18,7 @@ * Edinburgh Soft Matter and Statistical Phsyics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * *****************************************************************************/ @@ -138,9 +138,9 @@ __host__ int lb_bc_outflow_init_link(lb_bc_outflow_rhou_t * outflow, link_init_enum_t init, int id) { cs_t * cs = NULL; - int noffset[3] = {}; - int ntotal[3] = {}; - int nlocal[3] = {}; + int noffset[3] = {0}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; int nlink = 0; assert(outflow); @@ -155,7 +155,7 @@ __host__ int lb_bc_outflow_init_link(lb_bc_outflow_rhou_t * outflow, if (noffset[id] + nlocal[id] == ntotal[id]) { int nmin[3] = {1, 1, 1}; - lb_model_t model = {}; + lb_model_t model = {0}; lb_model_create(outflow->options.nvel, &model); nmin[id] = nlocal[id]; /* Only rightmost edge in the relevant direction */ @@ -235,9 +235,9 @@ __host__ int lb_bc_outflow_rhou_update(lb_bc_outflow_rhou_t * outflow, cs_t * cs = NULL; int id = -1; - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; assert(outflow); assert(hydro); @@ -267,7 +267,7 @@ __host__ int lb_bc_outflow_rhou_update(lb_bc_outflow_rhou_t * outflow, int index0 = cs_index(cs, ic + idx, jc + jdy, kc + kdz); int index1 = cs_index(cs, ic, jc, kc); - double u[3] = {}; + double u[3] = {0}; hydro_rho_set(hydro, index0, outflow->options.rho0); hydro_u(hydro, index1, u); @@ -294,9 +294,9 @@ __host__ int lb_bc_outflow_rhou_update(lb_bc_outflow_rhou_t * outflow, __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, hydro_t * hydro) { cs_t * cs = NULL; - int noffset[3] = {}; - int ntotal[3] = {}; - int nlocal[3] = {}; + int noffset[3] = {0}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; const int tag = 12348; @@ -314,10 +314,10 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, if (noffset[X] + nlocal[X] == ntotal[X]) { MPI_Comm comm = MPI_COMM_NULL; - MPI_Request req[8] = {}; - double *buf[8] = {}; - int ngbr[8] = {}; - int count[8] = {}; /* Data items */ + MPI_Request req[8] = {0}; + double *buf[8] = {0}; + int ngbr[8] = {0}; + int count[8] = {0}; /* Data items */ int nhalo = 1; /* Only ever one if distributions are involved. */ /* Recv from ... */ @@ -364,7 +364,7 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, int m = 4 + ms; int ib = 0; int nhm1 = nhalo-1; - cs_limits_t lim = {}; + cs_limits_t lim = {0}; if (m == 4) { /* send to Y-1,Z */ lim.jmin = 1; lim.jmax = nhalo; @@ -388,7 +388,7 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, for (int kc = lim.kmin; kc <= lim.kmax; kc++) { int index = cs_index(cs, ic, jc, kc); double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; hydro_rho(hydro, index, &rho); hydro_u(hydro, index, u); buf[m][ib++] = rho; @@ -405,7 +405,7 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, /* Process */ for (int ms = 0; ms < 8; ms++) { int m = -1; - MPI_Status status = {}; + MPI_Status status = {0}; MPI_Waitany(8, req, &m, &status); if (m == MPI_UNDEFINED) continue; @@ -419,7 +419,7 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, else { /* Recv has arrived: unpack to correct destination */ int ib = 0; - cs_limits_t lim = {}; + cs_limits_t lim = {0}; if (m == 0) { /* recv from Y+1,Z */ lim.jmin = nlocal[Y] + 1; lim.jmax = nlocal[Y] + nhalo; @@ -443,7 +443,7 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, for (int kc = lim.kmin; kc <= lim.kmax; kc++) { int index = cs_index(cs, ic, jc, kc); double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; rho = buf[m][ib++]; u[X] = buf[m][ib++]; u[Y] = buf[m][ib++]; @@ -499,7 +499,7 @@ __host__ int lb_bc_outflow_rhou_impose(lb_bc_outflow_rhou_t * outflow, int8_t p = outflow->linkp[n]; double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; hydro_rho(hydro, index, &rho); hydro_u(hydro, index, u); diff --git a/src/lb_d2q9.c b/src/lb_d2q9.c index bc27730ad..9871230a3 100644 --- a/src/lb_d2q9.c +++ b/src/lb_d2q9.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -31,7 +31,7 @@ int lb_d2q9_create(lb_model_t * model) { assert(model); - *model = (lb_model_t) {}; + *model = (lb_model_t) {0}; model->ndim = 2; model->nvel = NVEL_D2Q9; diff --git a/src/lb_d3q15.c b/src/lb_d3q15.c index 26808b04f..34922a1b3 100644 --- a/src/lb_d3q15.c +++ b/src/lb_d3q15.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -32,7 +32,7 @@ int lb_d3q15_create(lb_model_t * model) { assert(model); - *model = (lb_model_t) {}; + *model = (lb_model_t) {0}; model->ndim = 3; model->nvel = NVEL_D3Q15; diff --git a/src/lb_d3q19.c b/src/lb_d3q19.c index 4d88904d9..9be1f2eeb 100644 --- a/src/lb_d3q19.c +++ b/src/lb_d3q19.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -31,7 +31,7 @@ int lb_d3q19_create(lb_model_t * model) { assert(model); - *model = (lb_model_t) {}; + *model = (lb_model_t) {0}; model->ndim = 3; model->nvel = NVEL_D3Q19; diff --git a/src/lb_d3q27.c b/src/lb_d3q27.c index 907f0d0d0..d3ca369c2 100644 --- a/src/lb_d3q27.c +++ b/src/lb_d3q27.c @@ -2,13 +2,13 @@ * * lb_d3q27.c * - * D3Q27 definition. Not yet complete. + * D3Q27 definition. * * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -32,7 +32,7 @@ int lb_d3q27_create(lb_model_t * model) { assert(model); - *model = (lb_model_t) {}; + *model = (lb_model_t) {0}; model->ndim = 3; model->nvel = NVEL_D3Q27; diff --git a/src/lb_data.h b/src/lb_data.h index 2b1c52ef6..827b88a50 100644 --- a/src/lb_data.h +++ b/src/lb_data.h @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2014-2021 The University of Edinburgh + * (c) 2014-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -27,35 +27,18 @@ #include "io_harness.h" #include "halo_swap.h" +/* Residual compile-time switches scheduled for removal */ #ifdef _D2Q9_ -#include "d2q9.h" - -enum {NDIM = NDIM9, - NVEL = NVEL9, - CVXBLOCK = CVXBLOCK9, - CVYBLOCK = CVYBLOCK9, - CVZBLOCK = CVZBLOCK9}; +enum {NDIM = 2, NVEL = 9}; #endif - #ifdef _D3Q15_ -#include "d3q15.h" - -enum {NDIM = NDIM15, - NVEL = NVEL15, - CVXBLOCK = CVXBLOCK15, - CVYBLOCK = CVYBLOCK15, - CVZBLOCK = CVZBLOCK15}; +enum {NDIM = 3, NVEL = 15}; #endif - #ifdef _D3Q19_ - -#include "d3q19.h" - -enum {NDIM = NDIM19, - NVEL = NVEL19, - CVXBLOCK = CVXBLOCK19, - CVYBLOCK = CVYBLOCK19, - CVZBLOCK = CVZBLOCK19}; +enum {NDIM = 3, NVEL = 19}; +#endif +#ifdef _D3Q27_ +enum {NDIM = 3, NVEL = 27}; #endif typedef struct lb_collide_param_s lb_collide_param_t; @@ -64,7 +47,7 @@ typedef struct lb_data_s lb_t; struct lb_collide_param_s { int8_t isghost; /* switch for ghost modes */ - int8_t cv[NVEL][3]; + int8_t cv[27][3]; int nsite; int ndist; int nvel; @@ -73,11 +56,11 @@ struct lb_collide_param_s { double var_shear; double eta_bulk; double var_bulk; - double rna[NVEL]; /* reciprocal of normaliser[p] */ - double rtau[NVEL]; - double wv[NVEL]; - double ma[NVEL][NVEL]; - double mi[NVEL][NVEL]; + double rna[27]; /* reciprocal of normaliser[p] */ + double rtau[27]; + double wv[27]; + double ma[27][27]; + double mi[27][27]; }; /* Halo */ @@ -132,23 +115,7 @@ struct lb_data_s { lb_data_options_t opts; /* Copy of run time options */ lb_halo_t h; /* halo information/buffers */ - /* MPI data types for halo swaps; these are comupted at runtime - * to conform to the model selected at compile time */ - - MPI_Datatype plane_xy_full; - MPI_Datatype plane_xz_full; - MPI_Datatype plane_yz_full; - MPI_Datatype plane_xy_reduced[2]; - MPI_Datatype plane_xz_reduced[2]; - MPI_Datatype plane_yz_reduced[2]; - MPI_Datatype plane_xy[2]; - MPI_Datatype plane_xz[2]; - MPI_Datatype plane_yz[2]; - MPI_Datatype site_x[2]; - MPI_Datatype site_y[2]; - MPI_Datatype site_z[2]; - - lb_t * target; /* copy of this structure on target */ + lb_t * target; /* copy of this structure on target */ }; /* Data storage: A rank two object */ @@ -180,9 +147,6 @@ __host__ int lb_memcpy(lb_t * lb, tdpMemcpyKind flag); __host__ int lb_collide_param_commit(lb_t * lb); __host__ int lb_halo(lb_t * lb); __host__ int lb_halo_swap(lb_t * lb, lb_halo_enum_t flag); -__host__ int lb_halo_via_copy(lb_t * lb); -__host__ int lb_halo_via_struct(lb_t * lb); -__host__ int lb_halo_set(lb_t * lb, lb_halo_enum_t halo); __host__ int lb_io_info(lb_t * lb, io_info_t ** io_info); __host__ int lb_io_info_set(lb_t * lb, io_info_t * io_info, int fin, int fout); __host__ int lb_io_rho_set(lb_t *lb, io_info_t * io_rho, int fin, int fout); @@ -200,7 +164,6 @@ __host__ __device__ int lb_0th_moment(lb_t * lb, int index, lb_dist_enum_t nd, __host__ int lb_init_rest_f(lb_t * lb, double rho0); __host__ int lb_1st_moment(lb_t * lb, int index, lb_dist_enum_t nd, double g[3]); __host__ int lb_2nd_moment(lb_t * lb, int index, lb_dist_enum_t nd, double s[3][3]); -__host__ int lb_0th_moment_equilib_set(lb_t * lb, int index, int n, double rho); __host__ int lb_1st_moment_equilib_set(lb_t * lb, int index, double rho, double u[3]); #endif diff --git a/src/lb_data_options.c b/src/lb_data_options.c index 63f4943d3..cec709b21 100644 --- a/src/lb_data_options.c +++ b/src/lb_data_options.c @@ -50,5 +50,7 @@ int lb_data_options_valid(const lb_data_options_t * opts) { if (!(opts->ndim == 2 || opts->ndim == 3)) valid = 0; if (!(opts->ndist == 1 || opts->ndist == 2)) valid = 0; + if (opts->ndist == 2 && opts->halo != LB_HALO_TARGET) valid = 0; + return valid; } diff --git a/src/lb_data_options.h b/src/lb_data_options.h index 5accb8ad0..2b8496e04 100644 --- a/src/lb_data_options.h +++ b/src/lb_data_options.h @@ -22,10 +22,7 @@ typedef enum lb_relaxation_enum {LB_RELAXATION_M10, LB_RELAXATION_TRT} lb_relaxation_enum_t; -typedef enum lb_halo_enum {LB_HALO_FULL, - LB_HALO_REDUCED, - LB_HALO_HOST, - LB_HALO_TARGET, +typedef enum lb_halo_enum {LB_HALO_TARGET, LB_HALO_OPENMP_FULL, LB_HALO_OPENMP_REDUCED} lb_halo_enum_t; diff --git a/src/lb_model.c b/src/lb_model.c index f65a02810..7c1301e71 100644 --- a/src/lb_model.c +++ b/src/lb_model.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -38,6 +38,7 @@ int lb_model_is_available(int nvel) { available += (nvel == NVEL_D2Q9); available += (nvel == NVEL_D3Q15); available += (nvel == NVEL_D3Q19); + available += (nvel == NVEL_D3Q27); return available; } @@ -111,7 +112,7 @@ int lb_model_free(lb_model_t * model) { if (model->cv) free(model->cv); if (model->wv) free(model->wv); - *model = (lb_model_t) {}; + *model = (lb_model_t) {0}; return 0; } diff --git a/src/lc_droplet.c b/src/lc_droplet.c index 195ff24a1..9d170152b 100644 --- a/src/lc_droplet.c +++ b/src/lc_droplet.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Juho Lituvuori (juho.lintuvuori@u-bordeaux.fr) @@ -598,7 +598,7 @@ int fe_lc_droplet_str_symm(fe_lc_droplet_t * fe, int index, double sth[3][3]){ { double phi = 0.0; - double sa[3][3] = {}; + double sa[3][3] = {0}; field_scalar(fe->symm->phi, index, &phi); fe_lc_droplet_active_stress(fe->param, phi, q, sa); diff --git a/src/lc_droplet_rt.c b/src/lc_droplet_rt.c index 51befec57..82ae92642 100644 --- a/src/lc_droplet_rt.c +++ b/src/lc_droplet_rt.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group * and Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * ****************************************************************************/ @@ -29,7 +29,7 @@ int fe_lc_droplet_run_time(pe_t * pe, rt_t * rt, fe_lc_droplet_t * fe) { int n; - fe_lc_droplet_param_t param = {}; + fe_lc_droplet_param_t param = {0}; assert(fe); diff --git a/src/ludwig.c b/src/ludwig.c index 60ab44540..3d7599593 100644 --- a/src/ludwig.c +++ b/src/ludwig.c @@ -1282,7 +1282,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { strcmp(description, "symmetric_noise") == 0) { int use_stress_relaxation; - phi_ch_info_t ch_options = {}; + phi_ch_info_t ch_options = {0}; fe_symm_t * fe = NULL; /* Symmetric free energy via finite difference */ @@ -1405,7 +1405,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { /* Brazovskii (always finite difference). */ - phi_ch_info_t ch_options = {}; + phi_ch_info_t ch_options = {0}; fe_brazovskii_t * fe = NULL; nf = 1; /* 1 scalar order parameter */ nhalo = 3; /* Required for stress diveregnce. */ @@ -1452,7 +1452,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { else if (strcmp(description, "surfactant") == 0) { fe_surf_param_t param; - ch_info_t options = {}; + ch_info_t options = {0}; fe_surf_t * fe = NULL; nf = 2; /* Composition, surfactant: "phi" and "psi" */ @@ -1511,7 +1511,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { else if (strcmp(description, "ternary") == 0) { fe_ternary_param_t param = {0}; - ch_info_t options = {}; + ch_info_t options = {0}; fe_ternary_t * fe = NULL; nf = 2; /* Composition, ternary: "phi" and "psi" */ @@ -1672,7 +1672,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { } else if(strcmp(description, "lc_droplet") == 0) { - phi_ch_info_t ch_options = {}; + phi_ch_info_t ch_options = {0}; fe_symm_t * symm = NULL; fe_lc_t * lc = NULL; fe_lc_droplet_t * fe = NULL; @@ -1699,6 +1699,11 @@ int free_energy_init_rt(ludwig_t * ludwig) { { field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + + if (rt_switch(rt, "field_halo_openmp")) { + opts.haloscheme = FIELD_HALO_OPENMP; + opts.haloverbose = rt_switch(rt, "field_halo_verbose"); + } field_create(pe, cs, le, "phi", &opts, &ludwig->phi); field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); phi_ch_create(pe, cs, le, &ch_options, &ludwig->pch); @@ -1732,6 +1737,11 @@ int free_energy_init_rt(ludwig_t * ludwig) { { field_options_t opts = field_options_ndata_nhalo(NQAB, nhalo); + + if (rt_switch(rt, "field_halo_openmp")) { + opts.haloscheme = FIELD_HALO_OPENMP; + opts.haloverbose = rt_switch(rt, "field_halo_verbose"); + } field_create(pe, cs, le, "q", &opts, &ludwig->q); field_grad_create(pe, ludwig->q, ngrad, &ludwig->q_grad); } @@ -1808,7 +1818,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { } else if(strcmp(description, "fe_electro_symmetric") == 0) { - phi_ch_info_t ch_options = {}; + phi_ch_info_t ch_options = {0}; fe_symm_t * fe_symm = NULL; fe_electro_t * fe_elec = NULL; fe_es_t * fes = NULL; @@ -2070,7 +2080,7 @@ int ludwig_colloids_update(ludwig_t * ludwig) { lb_halo(ludwig->lb); } else { - lb_halo_swap(ludwig->lb, LB_HALO_HOST); + lb_halo_swap(ludwig->lb, LB_HALO_OPENMP_FULL); } TIMER_stop(TIMER_HALO_LATTICE); @@ -2164,7 +2174,7 @@ int io_replace_values(field_t * field, map_t * map, int map_id, double value) { __host__ int ludwig_timekeeper_init(ludwig_t * ludwig) { - timekeeper_options_t opts = {}; + timekeeper_options_t opts = {0}; assert(ludwig); diff --git a/src/map.c b/src/map.c index c5ff3ed3e..b83cb3a15 100644 --- a/src/map.c +++ b/src/map.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -214,7 +214,7 @@ __host__ int map_memcpy(map_t * map, tdpMemcpyKind flag) { __host__ int map_init_io_info(map_t * obj, int grid[3], int form_in, int form_out) { - io_info_args_t args = {}; + io_info_args_t args = io_info_args_default(); size_t sz; assert(obj); diff --git a/src/map_init.c b/src/map_init.c index 914b9a1ae..02875adbd 100644 --- a/src/map_init.c +++ b/src/map_init.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 + * (c) 2021-2022 * * Contributing authors; * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -33,9 +33,9 @@ int map_init_status_circle_xy(map_t * map) { - int ntotal[3] = {}; - int nlocal[3] = {}; - int noffset[3] = {}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; + int noffset[3] = {0}; double x0, y0, r0; cs_t * cs = NULL; @@ -94,9 +94,9 @@ int map_init_status_circle_xy(map_t * map) { __host__ int map_init_status_wall(map_t * map, int id) { - int ntotal[3] = {}; - int nlocal[3] = {}; - int noffset[3] = {}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; + int noffset[3] = {0}; cs_t * cs = NULL; assert(id == X || id == Y || id == Z); @@ -145,8 +145,8 @@ __host__ int map_init_status_wall(map_t * map, int id) { int map_init_status_simple_cubic(map_t * map, int acell) { cs_t * cs = NULL; - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; assert(map); @@ -194,8 +194,8 @@ int map_init_status_simple_cubic(map_t * map, int acell) { int map_init_status_body_centred_cubic(map_t * map, int acell) { cs_t * cs = NULL; - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; double radius; assert(map); @@ -260,8 +260,8 @@ int map_init_status_body_centred_cubic(map_t * map, int acell) { int map_init_status_face_centred_cubic(map_t * map, int acell) { cs_t * cs = NULL; - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; double radius; assert(map); @@ -345,7 +345,7 @@ int map_init_status_print_section(map_t * map, int id, int ord) { pe_t * pe = NULL; cs_t * cs = NULL; - int nlocal[3] = {}; + int nlocal[3] = {0}; int status = -1; assert(map); @@ -428,7 +428,7 @@ int map_init_data_uniform(map_t * map, int target, double * data) { { cs_t * cs = map->cs; - int nlocal[3] = {}; + int nlocal[3] = {0}; cs_nlocal(cs, nlocal); for (int ic = 1; ic <= nlocal[X]; ic++) { diff --git a/src/map_rt.c b/src/map_rt.c index b8d689d23..9f3203bdf 100644 --- a/src/map_rt.c +++ b/src/map_rt.c @@ -11,7 +11,7 @@ * Not to be confused with wall initialisations, which update * the map status, but are separate (see wall_rt.c). * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -79,7 +79,7 @@ int map_init_rt(pe_t * pe, cs_t * cs, rt_t * rt, map_t ** map) { * access to C, H, that is, ndata = 2 */ /* Colloids plus porous media is a non-feature at this time. */ - map_options_t options = {}; + map_options_t options = {0}; options.ndata = 2; map_init_options_parse(pe, cs, rt, &options); @@ -323,7 +323,7 @@ __host__ int map_init_option_acell(pe_t * pe, cs_t * cs, rt_t * rt) { } else { /* Check (and possibly fail) */ - int ntotal[3] = {}; + int ntotal[3] = {0}; cs_ntotal(cs, ntotal); if (acell < 1) pe_fatal(pe, "acell must be positive\n"); diff --git a/src/model.c b/src/model.c index 69381635d..dee9ebc5c 100644 --- a/src/model.c +++ b/src/model.c @@ -7,17 +7,16 @@ * for performance-critical operations ehich, for space * considerations, are not included in this file. * - * The LB model is either D2Q9, D3Q15 or D3Q19, as included in model.h. - * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) * Alan Gray (alang@epcc.ed.ac.uk) - * Erlend Davidson provided the original reduced halo swap. + * Erlend Davidson provided the original reduced halo swap + * (now retired, the code that is). * *****************************************************************************/ @@ -35,9 +34,6 @@ #include "util.h" static int lb_mpi_init(lb_t * lb); -static int lb_set_types(int, MPI_Datatype *); -static int lb_set_blocks(lb_t * lb, int, int *, int, const int *); -static int lb_set_displacements(lb_t * lb, int, MPI_Aint *, int, const int *); static int lb_f_read(FILE *, int index, void * self); static int lb_f_read_ascii(FILE *, int index, void * self); static int lb_f_write(FILE *, int index, void * self); @@ -93,7 +89,7 @@ int lb_data_create(pe_t * pe, cs_t * cs, const lb_data_options_t * options, { /* Allocate storage following cs specification */ int nhalo = 1; - int nlocal[3] = {}; + int nlocal[3] = {0}; cs_nhalo(cs, &nhalo); cs_nlocal(cs, nlocal); @@ -166,25 +162,6 @@ __host__ int lb_free(lb_t * lb) { if (lb->fprime) free(lb->fprime); lb_halo_free(lb, &lb->h); - - MPI_Type_free(&lb->plane_xy_full); - MPI_Type_free(&lb->plane_xz_full); - MPI_Type_free(&lb->plane_yz_full); - - MPI_Type_free(&lb->plane_xy_reduced[0]); - MPI_Type_free(&lb->plane_xy_reduced[1]); - MPI_Type_free(&lb->plane_xz_reduced[0]); - MPI_Type_free(&lb->plane_xz_reduced[1]); - MPI_Type_free(&lb->plane_yz_reduced[0]); - MPI_Type_free(&lb->plane_yz_reduced[1]); - - MPI_Type_free(&lb->site_x[0]); - MPI_Type_free(&lb->site_x[1]); - MPI_Type_free(&lb->site_y[0]); - MPI_Type_free(&lb->site_y[1]); - MPI_Type_free(&lb->site_z[0]); - MPI_Type_free(&lb->site_z[1]); - lb_model_free(&lb->model); free(lb->param); @@ -222,8 +199,10 @@ __host__ int lb_memcpy(lb_t * lb, tdpMemcpyKind flag) { switch (flag) { case tdpMemcpyHostToDevice: - tdpMemcpy(&lb->target->ndist, &lb->ndist, sizeof(int), flag); - tdpMemcpy(&lb->target->nsite, &lb->nsite, sizeof(int), flag); + tdpMemcpy(&lb->target->ndim, &lb->ndim, sizeof(int), flag); + tdpMemcpy(&lb->target->nvel, &lb->nvel, sizeof(int), flag); + tdpMemcpy(&lb->target->ndist, &lb->ndist, sizeof(int), flag); + tdpMemcpy(&lb->target->nsite, &lb->nsite, sizeof(int), flag); tdpMemcpy(tmpf, lb->f, nsz, flag); break; case tdpMemcpyDeviceToHost: @@ -251,7 +230,6 @@ static int lb_init(lb_t * lb) { int nlocal[3]; int nx, ny, nz; - int nhalolocal = 1; int ndata; int nhalo; int ndevice; @@ -296,25 +274,6 @@ static int lb_init(lb_t * lb) { tdpMemcpyHostToDevice); } - /* Set up the MPI Datatypes used for full halo messages: - * - * in XY plane nx*ny blocks of 1 site with stride nz; - * in XZ plane nx blocks of nz sites with stride ny*nz; - * in YZ plane one contiguous block of ny*nz sites. */ - - MPI_Type_vector(nx*ny, lb->ndist*lb->nvel*nhalolocal, lb->ndist*lb->nvel*nz, - MPI_DOUBLE, &lb->plane_xy_full); - MPI_Type_commit(&lb->plane_xy_full); - - MPI_Type_vector(nx, lb->ndist*lb->nvel*nz*nhalolocal, - lb->ndist*lb->nvel*ny*nz, - MPI_DOUBLE, &lb->plane_xz_full); - MPI_Type_commit(&lb->plane_xz_full); - - MPI_Type_vector(1, lb->ndist*lb->nvel*ny*nz*nhalolocal, 1, MPI_DOUBLE, - &lb->plane_yz_full); - MPI_Type_commit(&lb->plane_yz_full); - lb_mpi_init(lb); lb_model_param_init(lb); lb_memcpy(lb, tdpMemcpyHostToDevice); @@ -353,6 +312,7 @@ static int lb_model_param_init(lb_t * lb) { assert(lb); assert(lb->param); + assert(lb->model.nvel <= 27); /* Currently largest model supported */ lb->param->nsite = lb->nsite; lb->param->ndist = lb->ndist; @@ -400,9 +360,10 @@ __host__ int lb_init_rest_f(lb_t * lb, double rho0) { for (ic = 1; ic <= nlocal[X]; ic++) { for (jc = 1; jc <= nlocal[Y]; jc++) { for (kc = 1; kc <= nlocal[Z]; kc++) { + double u0[3] = {0}; index = cs_index(lb->cs, ic, jc, kc); - lb_0th_moment_equilib_set(lb, index, 0, rho0); + lb_1st_moment_equilib_set(lb, index, rho0, u0); } } } @@ -420,140 +381,7 @@ __host__ int lb_init_rest_f(lb_t * lb, double rho0) { static int lb_mpi_init(lb_t * lb) { - int count; - int nlocal[3]; - int nx, ny, nz; - int * blocklen; - int nhalo; - MPI_Aint extent; - MPI_Aint * disp_fwd; - MPI_Aint * disp_bwd; - MPI_Datatype * types; - MPI_Datatype tmpf, tmpb; - assert(lb); - assert(CVXBLOCK > 0); - - cs_nhalo(lb->cs, &nhalo); - cs_nlocal(lb->cs, nlocal); - - nx = nlocal[X] + 2*nhalo; - ny = nlocal[Y] + 2*nhalo; - nz = nlocal[Z] + 2*nhalo; - - /* extent of single site (AOS) */ - extent = sizeof(double)*lb->nvel*lb->ndist; - - /* X direction */ - - count = lb->ndist*CVXBLOCK; - - blocklen = (int *) malloc(count*sizeof(int)); - disp_fwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - disp_bwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - types = (MPI_Datatype *) malloc(count*sizeof(MPI_Datatype)); - - lb_set_types(count, types); - lb_set_blocks(lb, count, blocklen, CVXBLOCK, xblocklen_cv); - lb_set_displacements(lb, count, disp_fwd, CVXBLOCK, xdisp_fwd_cv); - lb_set_displacements(lb, count, disp_bwd, CVXBLOCK, xdisp_bwd_cv); - - MPI_Type_create_struct(count, blocklen, disp_fwd, types, &tmpf); - MPI_Type_create_struct(count, blocklen, disp_bwd, types, &tmpb); - MPI_Type_commit(&tmpf); - MPI_Type_commit(&tmpb); - MPI_Type_create_resized(tmpf, 0, extent, &lb->site_x[CS_FORW]); - MPI_Type_create_resized(tmpb, 0, extent, &lb->site_x[CS_BACK]); - MPI_Type_free(&tmpf); - MPI_Type_free(&tmpb); - - MPI_Type_commit(&lb->site_x[CS_FORW]); - MPI_Type_commit(&lb->site_x[CS_BACK]); - - MPI_Type_contiguous(ny*nz, lb->site_x[FORWARD], &lb->plane_yz_reduced[FORWARD]); - MPI_Type_contiguous(ny*nz, lb->site_x[BACKWARD], &lb->plane_yz_reduced[BACKWARD]); - MPI_Type_commit(&lb->plane_yz_reduced[FORWARD]); - MPI_Type_commit(&lb->plane_yz_reduced[BACKWARD]); - - free(blocklen); - free(disp_fwd); - free(disp_bwd); - free(types); - - /* Y direction */ - - count = lb->ndist*CVYBLOCK; - - blocklen = (int *) malloc(count*sizeof(int)); - disp_fwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - disp_bwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - types = (MPI_Datatype *) malloc(count*sizeof(MPI_Datatype)); - - lb_set_types(count, types); - lb_set_blocks(lb, count, blocklen, CVYBLOCK, yblocklen_cv); - lb_set_displacements(lb, count, disp_fwd, CVYBLOCK, ydisp_fwd_cv); - lb_set_displacements(lb, count, disp_bwd, CVYBLOCK, ydisp_bwd_cv); - - MPI_Type_create_struct(count, blocklen, disp_fwd, types, &tmpf); - MPI_Type_create_struct(count, blocklen, disp_bwd, types, &tmpb); - MPI_Type_commit(&tmpf); - MPI_Type_commit(&tmpb); - MPI_Type_create_resized(tmpf, 0, extent, &lb->site_y[CS_FORW]); - MPI_Type_create_resized(tmpb, 0, extent, &lb->site_y[CS_BACK]); - MPI_Type_free(&tmpf); - MPI_Type_free(&tmpb); - - MPI_Type_commit(&lb->site_y[CS_FORW]); - MPI_Type_commit(&lb->site_y[CS_BACK]); - - MPI_Type_vector(nx, nz, ny*nz, lb->site_y[FORWARD], - &lb->plane_xz_reduced[FORWARD]); - MPI_Type_vector(nx, nz, ny*nz, lb->site_y[BACKWARD], - &lb->plane_xz_reduced[BACKWARD]); - MPI_Type_commit(&lb->plane_xz_reduced[FORWARD]); - MPI_Type_commit(&lb->plane_xz_reduced[BACKWARD]); - - free(blocklen); - free(disp_fwd); - free(disp_bwd); - free(types); - - /* Z direction */ - - count = lb->ndist*CVZBLOCK; - - blocklen = (int *) malloc(count*sizeof(int)); - disp_fwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - disp_bwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - types = (MPI_Datatype *) malloc(count*sizeof(MPI_Datatype)); - - lb_set_types(count, types); - lb_set_blocks(lb, count, blocklen, CVZBLOCK, zblocklen_cv); - lb_set_displacements(lb, count, disp_fwd, CVZBLOCK, zdisp_fwd_cv); - lb_set_displacements(lb, count, disp_bwd, CVZBLOCK, zdisp_bwd_cv); - - MPI_Type_create_struct(count, blocklen, disp_fwd, types, &tmpf); - MPI_Type_create_struct(count, blocklen, disp_bwd, types, &tmpb); - MPI_Type_commit(&tmpf); - MPI_Type_commit(&tmpb); - MPI_Type_create_resized(tmpf, 0, extent, &lb->site_z[CS_FORW]); - MPI_Type_create_resized(tmpb, 0, extent, &lb->site_z[CS_BACK]); - MPI_Type_free(&tmpf); - MPI_Type_free(&tmpb); - - MPI_Type_commit(&lb->site_z[CS_FORW]); - MPI_Type_commit(&lb->site_z[CS_BACK]); - - MPI_Type_vector(nx*ny, 1, nz, lb->site_z[FORWARD], &lb->plane_xy_reduced[FORWARD]); - MPI_Type_vector(nx*ny, 1, nz, lb->site_z[BACKWARD], - &lb->plane_xy_reduced[BACKWARD]); - MPI_Type_commit(&lb->plane_xy_reduced[FORWARD]); - MPI_Type_commit(&lb->plane_xy_reduced[BACKWARD]); - - free(blocklen); - free(disp_fwd); - free(disp_bwd); - free(types); halo_swap_create_r2(lb->pe, lb->cs, 1, lb->nsite, lb->ndist, lb->nvel, &lb->halo); @@ -562,81 +390,6 @@ static int lb_mpi_init(lb_t * lb) { return 0; } -/***************************************************************************** - * - * lb_set_types - * - * Set the type signature for reduced halo struct. - * - *****************************************************************************/ - -static int lb_set_types(int ntype, MPI_Datatype * type) { - - int n; - - assert(type); - - for (n = 0; n < ntype; n++) { - type[n] = MPI_DOUBLE; - } - - return 0; -} - -/***************************************************************************** - * - * lb_set_blocks - * - * Set the blocklengths for the reduced halo struct. - * This means 'expanding' the basic blocks for the current DdQn model - * to the current number of distributions. - * - *****************************************************************************/ - -static int lb_set_blocks(lb_t * lb, int nblock, int * block, int nbasic, - const int * basic_block) { - - int n, p; - - assert(lb); - - for (n = 0; n < lb->ndist; n++) { - for (p = 0; p < nbasic; p++) { - block[n*nbasic + p] = basic_block[p]; - } - } - - return 0; -} - -/***************************************************************************** - * - * lb_set_displacements - * - * Set the displacements for the reduced halo struct. - * - *****************************************************************************/ - -static int lb_set_displacements(lb_t * lb, int ndisp, MPI_Aint * disp, - int nbasic, const int * disp_basic) { - int n, p; - MPI_Aint disp0, disp1; - - assert(lb); - - /* Lower end */ - MPI_Get_address(lb->f, &disp0); - - for (n = 0; n < lb->ndist; n++) { - for (p = 0; p < nbasic; p++) { - MPI_Get_address(lb->f + n*lb->nvel + disp_basic[p], &disp1); - disp[n*nbasic + p] = disp1 - disp0; - } - } - - return 0; -} - /***************************************************************************** * * lb_io_info_commit @@ -769,200 +522,27 @@ __host__ int lb_halo(lb_t * lb) { __host__ int lb_halo_swap(lb_t * lb, lb_halo_enum_t flag) { double * data; - const char * msg = "Attempting halo via struct with NSIMDVL > 1 or (AO)SOA"; assert(lb); switch (flag) { - case LB_HALO_HOST: - lb_halo_via_copy(lb); - break; case LB_HALO_TARGET: tdpMemcpy(&data, &lb->target->f, sizeof(double *), tdpMemcpyDeviceToHost); halo_swap_packed(lb->halo, data); break; - case LB_HALO_FULL: - if (NSIMDVL > 1) pe_fatal(lb->pe, "%s\n", msg); - if (DATA_MODEL != DATA_MODEL_AOS) pe_fatal(lb->pe, "%s\n", msg); - lb_halo_set(lb, LB_HALO_FULL); - lb_halo_via_struct(lb); - break; - case LB_HALO_REDUCED: - if (NSIMDVL > 1) pe_fatal(lb->pe, "%s\n", msg); - if (DATA_MODEL != DATA_MODEL_AOS) pe_fatal(lb->pe, "%s\n", msg); - lb_halo_set(lb, LB_HALO_REDUCED); - lb_halo_via_struct(lb); - break; case LB_HALO_OPENMP_FULL: - { - lb_halo_post(lb, &lb->h); - lb_halo_wait(lb, &lb->h); - } + lb_halo_post(lb, &lb->h); + lb_halo_wait(lb, &lb->h); break; case LB_HALO_OPENMP_REDUCED: - { - lb_halo_post(lb, &lb->h); - lb_halo_wait(lb, &lb->h); - } + lb_halo_post(lb, &lb->h); + lb_halo_wait(lb, &lb->h); break; default: - /* Should not be here... */ - assert(0); - } - - /* In the limited case MODEL order and NSIMDVL is 1 the struct - * approach is still available. */ - - return 0; -} - -/***************************************************************************** - * - * lb_halo_via_struct - * - * Uses MPI datatypes to perform distribution halo swap, either 'full' - * or 'reduced', depending on what is currently selected. - * - * This works only for MODEL, not MODEL_R. - * - *****************************************************************************/ - -__host__ int lb_halo_via_struct(lb_t * lb) { - - int ic, jc, kc; - int ihalo, ireal; - int nhalo; - int pforw, pback; - int nlocal[3]; - int mpi_cartsz[3]; - int periodic[3]; - int persite; - - const int tagf = 900; - const int tagb = 901; - - MPI_Request request[4]; - MPI_Status status[4]; - MPI_Comm comm; - - assert(lb); - - persite = lb->ndist*lb->nvel; - - cs_nhalo(lb->cs, &nhalo); - cs_nlocal(lb->cs, nlocal); - cs_cart_comm(lb->cs, &comm); - cs_periodic(lb->cs, periodic); - cs_cartsz(lb->cs, mpi_cartsz); - - /* The x-direction (YZ plane) */ - - if (mpi_cartsz[X] == 1) { - if (periodic[X]) { - for (jc = 1; jc <= nlocal[Y]; jc++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - ihalo = persite*cs_index(lb->cs, 0, jc, kc); - ireal = persite*cs_index(lb->cs, nlocal[X], jc, kc); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - - ihalo = persite*cs_index(lb->cs, nlocal[X]+1, jc, kc); - ireal = persite*cs_index(lb->cs, 1, jc, kc); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - } - } - } - } - else { - pforw = cs_cart_neighb(lb->cs, CS_FORW, X); - pback = cs_cart_neighb(lb->cs, CS_BACK, X); - ihalo = persite*cs_index(lb->cs, nlocal[X] + 1, 1 - nhalo, 1 - nhalo); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_yz[BACKWARD], - pforw, tagb, comm, &request[0]); - ihalo = persite*cs_index(lb->cs, 0, 1 - nhalo, 1 - nhalo); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_yz[FORWARD], - pback, tagf, comm, &request[1]); - ireal = persite*cs_index(lb->cs, 1, 1-nhalo, 1-nhalo); - MPI_Issend(lb->f + ireal, 1, lb->plane_yz[BACKWARD], - pback, tagb, comm, &request[2]); - ireal = persite*cs_index(lb->cs, nlocal[X], 1-nhalo, 1-nhalo); - MPI_Issend(lb->f + ireal, 1, lb->plane_yz[FORWARD], - pforw, tagf, comm, &request[3]); - MPI_Waitall(4, request, status); + lb_halo_post(lb, &lb->h); + lb_halo_wait(lb, &lb->h); } - - /* The y-direction (XZ plane) */ - if (mpi_cartsz[Y] == 1) { - if (periodic[Y]) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - ihalo = persite*cs_index(lb->cs, ic, 0, kc); - ireal = persite*cs_index(lb->cs, ic, nlocal[Y], kc); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - - ihalo = persite*cs_index(lb->cs, ic, nlocal[Y] + 1, kc); - ireal = persite*cs_index(lb->cs, ic, 1, kc); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - } - } - } - } - else { - pforw = cs_cart_neighb(lb->cs, CS_FORW, Y); - pback = cs_cart_neighb(lb->cs, CS_BACK, Y); - ihalo = persite*cs_index(lb->cs, 1 - nhalo, nlocal[Y] + 1, 1 - nhalo); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_xz[BACKWARD], - pforw, tagb, comm, &request[0]); - ihalo = persite*cs_index(lb->cs, 1 - nhalo, 0, 1 - nhalo); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_xz[FORWARD], pback, - tagf, comm, &request[1]); - ireal = persite*cs_index(lb->cs, 1 - nhalo, 1, 1 - nhalo); - MPI_Issend(lb->f + ireal, 1, lb->plane_xz[BACKWARD], pback, - tagb, comm, &request[2]); - ireal = persite*cs_index(lb->cs, 1 - nhalo, nlocal[Y], 1 - nhalo); - MPI_Issend(lb->f + ireal, 1, lb->plane_xz[FORWARD], pforw, - tagf, comm, &request[3]); - MPI_Waitall(4, request, status); - } - - /* Finally, z-direction (XY plane) */ - - if (mpi_cartsz[Z] == 1) { - if (periodic[Z]) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (jc = 0; jc <= nlocal[Y] + 1; jc++) { - - ihalo = persite*cs_index(lb->cs, ic, jc, 0); - ireal = persite*cs_index(lb->cs, ic, jc, nlocal[Z]); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - - ihalo = persite*cs_index(lb->cs, ic, jc, nlocal[Z] + 1); - ireal = persite*cs_index(lb->cs, ic, jc, 1); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - } - } - } - } - else { - pforw = cs_cart_neighb(lb->cs, CS_FORW, Z); - pback = cs_cart_neighb(lb->cs, CS_BACK, Z); - ihalo = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, nlocal[Z] + 1); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_xy[BACKWARD], pforw, - tagb, comm, &request[0]); - ihalo = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, 0); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_xy[FORWARD], pback, - tagf, comm, &request[1]); - ireal = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, 1); - MPI_Issend(lb->f + ireal, 1, lb->plane_xy[BACKWARD], pback, - tagb, comm, &request[2]); - ireal = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, nlocal[Z]); - MPI_Issend(lb->f + ireal, 1, lb->plane_xy[FORWARD], pforw, - tagf, comm, &request[3]); - MPI_Waitall(4, request, status); - } - return 0; } @@ -971,7 +551,8 @@ __host__ int lb_halo_via_struct(lb_t * lb) { * lb_f_read * * Read one lattice site (index) worth of distributions. - * Note that read-write is always 'MODEL' order. + * Note that read-write is always the same order irrespective + * of memory ordering (host/device). * *****************************************************************************/ @@ -1003,7 +584,6 @@ static int lb_f_read(FILE * fp, int index, void * self) { * lb_f_read_ascii * * Read one lattice site (index) worth of distributions. - * Note that read-write is always 'MODEL' order. * *****************************************************************************/ @@ -1043,7 +623,6 @@ static int lb_f_read_ascii(FILE * fp, int index, void * self) { * lb_f_write * * Write one lattice site (index) worth of distributions. - * Note that read/write is always 'MODEL' order. * *****************************************************************************/ @@ -1075,7 +654,6 @@ static int lb_f_write(FILE * fp, int index, void * self) { * lb_f_write_ascii * * Write one lattice site (index) worth of distributions. - * Note that read/write is always 'MODEL' order. * *****************************************************************************/ @@ -1169,39 +747,6 @@ static int lb_rho_write_ascii(FILE * fp, int index, void * self) { return 0; } -/***************************************************************************** - * - * lb_halo_set - * - * Set the actual halo datatype. - * - *****************************************************************************/ - -__host__ int lb_halo_set(lb_t * lb, lb_halo_enum_t type) { - - assert(lb); - - if (type == LB_HALO_REDUCED) { - lb->plane_xy[FORWARD] = lb->plane_xy_reduced[FORWARD]; - lb->plane_xy[BACKWARD] = lb->plane_xy_reduced[BACKWARD]; - lb->plane_xz[FORWARD] = lb->plane_xz_reduced[FORWARD]; - lb->plane_xz[BACKWARD] = lb->plane_xz_reduced[BACKWARD]; - lb->plane_yz[FORWARD] = lb->plane_yz_reduced[FORWARD]; - lb->plane_yz[BACKWARD] = lb->plane_yz_reduced[BACKWARD]; - } - else { - /* Default to full halo. */ - lb->plane_xy[FORWARD] = lb->plane_xy_full; - lb->plane_xy[BACKWARD] = lb->plane_xy_full; - lb->plane_xz[FORWARD] = lb->plane_xz_full; - lb->plane_xz[BACKWARD] = lb->plane_xz_full; - lb->plane_yz[FORWARD] = lb->plane_yz_full; - lb->plane_yz[BACKWARD] = lb->plane_yz_full; - } - - return 0; -} - /***************************************************************************** * * lb_ndist @@ -1273,8 +818,6 @@ int lb_f_set(lb_t * lb, int index, int p, int n, double fvalue) { __host__ __device__ int lb_0th_moment(lb_t * lb, int index, lb_dist_enum_t nd, double * rho) { - int p; - assert(lb); assert(rho); assert(index >= 0 && index < lb->nsite); @@ -1282,7 +825,7 @@ int lb_0th_moment(lb_t * lb, int index, lb_dist_enum_t nd, double * rho) { *rho = 0.0; - for (p = 0; p < lb->nvel; p++) { + for (int p = 0; p < lb->nvel; p++) { *rho += lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, nd, p)]; } @@ -1360,33 +903,6 @@ int lb_2nd_moment(lb_t * lb, int index, lb_dist_enum_t nd, double s[3][3]) { return 0; } -/***************************************************************************** - * - * lb_0th_moment_equilib_set - * - * Project the given value of rho onto the equilibrium distribution via - * - * f_i = w_i rho - * - *****************************************************************************/ - -__host__ -int lb_0th_moment_equilib_set(lb_t * lb, int index, int n, double rho) { - - int p; - - assert(lb); - assert (n >= 0 && n < lb->ndist); - assert(index >= 0 && index < lb->nsite); - - for (p = 0; p < lb->model.nvel; p++) { - double f = lb->model.wv[p]*rho; - lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p)] = f; - } - - return 0; -} - /***************************************************************************** * * lb_1st_moment_equilib_set @@ -1423,298 +939,6 @@ int lb_1st_moment_equilib_set(lb_t * lb, int index, double rho, double u[3]) { return 0; } -/***************************************************************************** - * - * lb_halo_via_copy - * - * A version of the halo swap which uses a flat buffer to copy the - * relevant data rathar than MPI data types. It is therefore a 'full' - * halo swapping nvel distributions at each site. - * - * It works for both MODEL and MODEL_R, but the loop order favours - * MODEL_R. - * - *****************************************************************************/ - -__host__ int lb_halo_via_copy(lb_t * lb) { - - int ic, jc, kc; - int n, p; - int pforw, pback; - int index, indexhalo, indexreal; - int nsend, count; - int nlocal[3]; - int mpi_cartsz[3]; - - const int tagf = 900; - const int tagb = 901; - - double * sendforw; - double * sendback; - double * recvforw; - double * recvback; - - MPI_Request request[4]; - MPI_Status status[4]; - MPI_Comm comm; - - assert(lb); - - cs_nlocal(lb->cs, nlocal); - cs_cart_comm(lb->cs, &comm); - cs_cartsz(lb->cs, mpi_cartsz); - - /* The x-direction (YZ plane) */ - - nsend = lb->model.nvel*lb->ndist*nlocal[Y]*nlocal[Z]; - sendforw = (double *) malloc(nsend*sizeof(double)); - sendback = (double *) malloc(nsend*sizeof(double)); - recvforw = (double *) malloc(nsend*sizeof(double)); - recvback = (double *) malloc(nsend*sizeof(double)); - assert(sendback && sendforw); - assert(recvforw && recvback); - if (sendforw == NULL) pe_fatal(lb->pe, "malloc(sendforw) failed\n"); - if (sendback == NULL) pe_fatal(lb->pe, "malloc(sendback) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvforw) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvback) failed\n"); - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (jc = 1; jc <= nlocal[Y]; jc++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - index = cs_index(lb->cs, nlocal[X], jc, kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendforw[count] = lb->f[indexreal]; - - index = cs_index(lb->cs, 1, jc, kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendback[count] = lb->f[indexreal]; - ++count; - } - } - } - } - assert(count == nsend); - - if (mpi_cartsz[X] == 1) { - memcpy(recvback, sendforw, nsend*sizeof(double)); - memcpy(recvforw, sendback, nsend*sizeof(double)); - } - else { - - pforw = cs_cart_neighb(lb->cs, CS_FORW, X); - pback = cs_cart_neighb(lb->cs, CS_BACK, X); - - MPI_Irecv(recvforw, nsend, MPI_DOUBLE, pforw, tagb, comm, request); - MPI_Irecv(recvback, nsend, MPI_DOUBLE, pback, tagf, comm, request + 1); - - MPI_Issend(sendback, nsend, MPI_DOUBLE, pback, tagb, comm, request + 2); - MPI_Issend(sendforw, nsend, MPI_DOUBLE, pforw, tagf, comm, request + 3); - - /* Wait for receives */ - MPI_Waitall(2, request, status); - } - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (jc = 1; jc <= nlocal[Y]; jc++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - index = cs_index(lb->cs, 0, jc, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvback[count]; - - index = cs_index(lb->cs, nlocal[X] + 1, jc, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvforw[count]; - ++count; - } - } - } - } - assert(count == nsend); - - free(recvback); - free(recvforw); - - if (mpi_cartsz[X] > 1) { - /* Wait for sends */ - MPI_Waitall(2, request + 2, status); - } - - free(sendback); - free(sendforw); - - - /* The y-direction (XZ plane) */ - - nsend = lb->model.nvel*lb->ndist*(nlocal[X] + 2)*nlocal[Z]; - sendforw = (double *) malloc(nsend*sizeof(double)); - sendback = (double *) malloc(nsend*sizeof(double)); - recvforw = (double *) malloc(nsend*sizeof(double)); - recvback = (double *) malloc(nsend*sizeof(double)); - if (sendforw == NULL) pe_fatal(lb->pe, "malloc(sendforw) failed\n"); - if (sendback == NULL) pe_fatal(lb->pe, "malloc(sendback) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvforw) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvback) failed\n"); - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - index = cs_index(lb->cs, ic, nlocal[Y], kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendforw[count] = lb->f[indexreal]; - - index = cs_index(lb->cs, ic, 1, kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendback[count] = lb->f[indexreal]; - ++count; - } - } - } - } - assert(count == nsend); - - - if (mpi_cartsz[Y] == 1) { - memcpy(recvback, sendforw, nsend*sizeof(double)); - memcpy(recvforw, sendback, nsend*sizeof(double)); - } - else { - - pforw = cs_cart_neighb(lb->cs, CS_FORW, Y); - pback = cs_cart_neighb(lb->cs, CS_BACK, Y); - - MPI_Irecv(recvforw, nsend, MPI_DOUBLE, pforw, tagb, comm, request); - MPI_Irecv(recvback, nsend, MPI_DOUBLE, pback, tagf, comm, request + 1); - - MPI_Issend(sendback, nsend, MPI_DOUBLE, pback, tagb, comm, request + 2); - MPI_Issend(sendforw, nsend, MPI_DOUBLE, pforw, tagf, comm, request + 3); - - /* Wait of receives */ - MPI_Waitall(2, request, status); - } - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - index = cs_index(lb->cs, ic, 0, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvback[count]; - - index = cs_index(lb->cs, ic, nlocal[Y] + 1, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvforw[count]; - ++count; - } - } - } - } - assert(count == nsend); - free(recvback); - free(recvforw); - - if (mpi_cartsz[Y] > 1) { - /* Wait for sends */ - MPI_Waitall(2, request + 2, status); - } - - free(sendback); - free(sendforw); - - /* Finally, z-direction (XY plane) */ - - nsend = lb->model.nvel*lb->ndist*(nlocal[X] + 2)*(nlocal[Y] + 2); - sendforw = (double *) malloc(nsend*sizeof(double)); - sendback = (double *) malloc(nsend*sizeof(double)); - recvforw = (double *) malloc(nsend*sizeof(double)); - recvback = (double *) malloc(nsend*sizeof(double)); - if (sendforw == NULL) pe_fatal(lb->pe, "malloc(sendforw) failed\n"); - if (sendback == NULL) pe_fatal(lb->pe, "malloc(sendback) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvforw) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvback) failed\n"); - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (jc = 0; jc <= nlocal[Y] + 1; jc++) { - - index = cs_index(lb->cs, ic, jc, nlocal[Z]); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendforw[count] = lb->f[indexreal]; - - index = cs_index(lb->cs, ic, jc, 1); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendback[count] = lb->f[indexreal]; - ++count; - } - } - } - } - assert(count == nsend); - - if (mpi_cartsz[Z] == 1) { - memcpy(recvback, sendforw, nsend*sizeof(double)); - memcpy(recvforw, sendback, nsend*sizeof(double)); - } - else { - - pforw = cs_cart_neighb(lb->cs, CS_FORW, Z); - pback = cs_cart_neighb(lb->cs, CS_BACK, Z); - - MPI_Irecv(recvforw, nsend, MPI_DOUBLE, pforw, tagb, comm, request); - MPI_Irecv(recvback, nsend, MPI_DOUBLE, pback, tagf, comm, request + 1); - - MPI_Issend(sendback, nsend, MPI_DOUBLE, pback, tagb, comm, request + 2); - MPI_Issend(sendforw, nsend, MPI_DOUBLE, pforw, tagf, comm, request + 3); - - /* Wait for receives */ - MPI_Waitall(2, request, status); - } - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (jc = 0; jc <= nlocal[Y] + 1; jc++) { - - index = cs_index(lb->cs, ic, jc, 0); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvback[count]; - - index = cs_index(lb->cs, ic, jc, nlocal[Z] + 1); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvforw[count]; - ++count; - } - } - } - } - assert(count == nsend); - free(recvback); - free(recvforw); - - if (mpi_cartsz[Z] > 1) { - /* Wait for sends */ - MPI_Waitall(2, request + 2, status); - } - - free(sendback); - free(sendforw); - - return 0; -} - /* We will not exceed 27 directions! Direction index 0, in keeping * with the LB model definition, is (0,0,0) - so no communication. */ @@ -1894,15 +1118,15 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, lb_halo_enum_t scheme) { /* Determine look-up table of ranks of neighbouring processes */ { - int dims[3] = {}; - int periods[3] = {}; - int coords[3] = {}; + int dims[3] = {0}; + int periods[3] = {0}; + int coords[3] = {0}; - MPI_Cart_get(h->comm, h->map.ndim, dims, periods, coords); + MPI_Cart_get(h->comm, 3, dims, periods, coords); for (int p = 0; p < h->map.nvel; p++) { - int nbr[3] = {}; - int out[3] = {}; /* Out-of-range is erroneous for non-perioidic dims */ + int nbr[3] = {0}; + int out[3] = {0}; /* Out-of-range is erroneous for non-perioidic dims */ int i = 1 + h->map.cv[p][X]; int j = 1 + h->map.cv[p][Y]; int k = 1 + h->map.cv[p][Z]; @@ -1910,9 +1134,9 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, lb_halo_enum_t scheme) { nbr[X] = coords[X] + h->map.cv[p][X]; nbr[Y] = coords[Y] + h->map.cv[p][Y]; nbr[Z] = coords[Z] + h->map.cv[p][Z]; - out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X])); - out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y])); - out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z])); + out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X] - 1)); + out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y] - 1)); + out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z] - 1)); if (out[X] || out[Y] || out[Z]) { h->nbrrank[i][j][k] = MPI_PROC_NULL; diff --git a/src/model.h b/src/model.h deleted file mode 100644 index 52d2f1de6..000000000 --- a/src/model.h +++ /dev/null @@ -1,126 +0,0 @@ -/***************************************************************************** - * - * model.h - * - * This includes the appropriate lattice Boltzmann - * model d2q9, d3q15, or d3q19 (see Makefile). - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2010-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * - *****************************************************************************/ - -#ifndef LUDWIG_MODEL_H -#define LUDWIG_MODEL_H - -/* Here is the choice of model (and it's here only). */ - -#ifdef _D2Q9_ -#include "d2q9.h" - -enum {NDIM = NDIM9, - NVEL = NVEL9, - CVXBLOCK = CVXBLOCK9, - CVYBLOCK = CVYBLOCK9, - CVZBLOCK = CVZBLOCK9}; - -#define LB_CV(cv) LB_CV_D2Q9(cv) - -#endif - -#ifdef _D3Q15_ -#include "d3q15.h" - -enum {NDIM = NDIM15, - NVEL = NVEL15, - CVXBLOCK = CVXBLOCK15, - CVYBLOCK = CVYBLOCK15, - CVZBLOCK = CVZBLOCK15}; - -#define LB_CV(cv) LB_CV_D3Q15(cv) - -#endif - -#ifdef _D3Q19_ - -#include "d3q19.h" - -enum {NDIM = NDIM19, - NVEL = NVEL19, - CVXBLOCK = CVXBLOCK19, - CVYBLOCK = CVYBLOCK19, - CVZBLOCK = CVZBLOCK19}; - -#define LB_CV(cv) LB_CV_D3Q19(cv) - -#endif - -#include "pe.h" -#include "coords.h" -#include "io_harness.h" -#include "memory.h" - -/* Number of hydrodynamic modes */ -enum {NHYDRO = 1 + NDIM + NDIM*(NDIM+1)/2}; - -/* Labels to locate relaxation times in array[NVEL] */ -/* Bulk viscosity is XX in stress */ -/* Shear is XY in stress */ - -enum {LB_TAU_BULK = 1 + NDIM + XX, LB_TAU_SHEAR = 1 + NDIM + XY}; - -#define LB_CS2_DOUBLE(cs2) const double cs2 = (1.0/3.0) -#define LB_RCS2_DOUBLE(rcs2) const double rcs2 = 3.0 - -typedef enum lb_dist_enum_type{LB_RHO = 0, LB_PHI = 1} lb_dist_enum_t; -typedef enum lb_mode_enum_type{LB_GHOST_ON = 0, LB_GHOST_OFF = 1} lb_mode_enum_t; - -typedef struct lb_data_s lb_t; -typedef enum lb_halo_enum_type {LB_HALO_FULL, - LB_HALO_REDUCED, - LB_HALO_HOST, - LB_HALO_TARGET} lb_halo_enum_t; - -typedef enum {LB_RELAXATION_M10, LB_RELAXATION_BGK, LB_RELAXATION_TRT} - lb_relaxation_enum_t; - -#include "lb_model_s.h" - -__host__ int lb_create_ndist(pe_t * pe, cs_t * cs, int ndist, lb_t ** lb); -__host__ int lb_create(pe_t * pe, cs_t * cs, lb_t ** lb); -__host__ int lb_init(lb_t * lb); -__host__ int lb_free(lb_t * lb); -__host__ int lb_memcpy(lb_t * lb, tdpMemcpyKind flag); -__host__ int lb_collide_param_commit(lb_t * lb); -__host__ int lb_halo(lb_t * lb); -__host__ int lb_halo_swap(lb_t * lb, lb_halo_enum_t flag); -__host__ int lb_halo_via_copy(lb_t * lb); -__host__ int lb_halo_via_struct(lb_t * lb); -__host__ int lb_halo_set(lb_t * lb, lb_halo_enum_t halo); -__host__ int lb_io_info(lb_t * lb, io_info_t ** io_info); -__host__ int lb_io_info_set(lb_t * lb, io_info_t * io_info, int fin, int fout); -__host__ int lb_io_rho_set(lb_t *lb, io_info_t * io_rho, int fin, int fout); - -__host__ int lb_io_info_commit(lb_t * lb, io_info_args_t args); - -__host__ __device__ int lb_ndist(lb_t * lb, int * ndist); -__host__ __device__ int lb_f(lb_t * lb, int index, int p, int n, double * f); -__host__ __device__ int lb_f_set(lb_t * lb, int index, int p, int n, double f); -__host__ __device__ int lb_0th_moment(lb_t * lb, int index, lb_dist_enum_t nd, - double * rho); -/* These could be __host__ __device__ pending removal of - * static constants */ - -__host__ int lb_init_rest_f(lb_t * lb, double rho0); -__host__ int lb_ndist_set(lb_t * lb, int ndist); -__host__ int lb_1st_moment(lb_t * lb, int index, lb_dist_enum_t nd, double g[3]); -__host__ int lb_2nd_moment(lb_t * lb, int index, lb_dist_enum_t nd, double s[3][3]); -__host__ int lb_0th_moment_equilib_set(lb_t * lb, int index, int n, double rho); -__host__ int lb_1st_moment_equilib_set(lb_t * lb, int index, double rho, double u[3]); - -#endif diff --git a/src/model_le.c b/src/model_le.c index c1d4de288..57ce04750 100644 --- a/src/model_le.c +++ b/src/model_le.c @@ -8,12 +8,10 @@ * not u*(t-1) returned by le_get_displacement(). * This is for reasons of backwards compatability. * - * Issue: a 'MODEL_R' implementation of communication is required - * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -34,7 +32,6 @@ #include "util.h" static int le_reproject(lb_t * lb, lees_edw_t * le); -static int le_reproject_all(lb_t * lb, lees_edw_t * le); static int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le); static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le); @@ -59,7 +56,6 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le); __host__ int lb_le_apply_boundary_conditions(lb_t * lb, lees_edw_t * le) { - const int irepro = 0; int mpi_cartsz[3]; assert(lb); @@ -75,8 +71,7 @@ __host__ int lb_le_apply_boundary_conditions(lb_t * lb, lees_edw_t * le) { /* ... and copy back at the end */ lb_memcpy(lb, tdpMemcpyDeviceToHost); - if (irepro == 0) le_reproject(lb, le); - if (irepro != 0) le_reproject_all(lb, le); + le_reproject(lb, le); if (mpi_cartsz[Y] > 1) { le_displace_and_interpolate_parallel(lb, le); @@ -119,8 +114,8 @@ static int le_reproject(lb_t * lb, lees_edw_t * le) { int nplane, plane, side; int ia, ib; int nlocal[3]; - int poffset, np, p; int n, ndist; + int8_t cx = 0; double rho, ds[3][3], udotc, sdotq; double g[3], du[3]; @@ -130,7 +125,6 @@ static int le_reproject(lb_t * lb, lees_edw_t * le) { assert(lb); assert(le); - assert(CVXBLOCK == 1); lb_ndist(lb, &ndist); nplane = lees_edw_nplane_local(le); @@ -151,13 +145,13 @@ static int le_reproject(lb_t * lb, lees_edw_t * le) { lees_edw_plane_uy_now(le, t, &du[Y]); du[Y] *= -1.0; ic = lees_edw_plane_location(le, plane); - poffset = xdisp_fwd_cv[0]; + cx = +1; } else { /* Finally, deal with plane above LEBC */ lees_edw_plane_uy_now(le, t, &du[Y]); ic = lees_edw_plane_location(le, plane) + 1; - poffset = xdisp_bwd_cv[0]; + cx = -1; } for (jc = 1; jc <= nlocal[Y]; jc++) { @@ -179,14 +173,11 @@ static int le_reproject(lb_t * lb, lees_edw_t * le) { } /* Now update the distribution */ - - for (np = 0; np < xblocklen_cv[0]; np++) { + for (int p = 1; p < lb->model.nvel; p++) { double cs2 = lb->model.cs2; double rcs2 = 1.0/cs2; - - /* Pick up the correct velocity indices */ - p = poffset + np; + if (lb->model.cv[p][X] != cx) continue; udotc = du[Y]*lb->model.cv[p][Y]; sdotq = 0.0; @@ -215,118 +206,6 @@ static int le_reproject(lb_t * lb, lees_edw_t * le) { return 0; } - -/**************************************************************************** - * - * le_reproject_all - * - * An experiemental routine to reproject the ghost currents in - * addition to the hydrodynamic modes. - * - * D3Q19, single fluid - * - * jchi1[Y] = chi1 rho u_y -> chi1 (rho u_y +/- rho u_le) - * jchi2[Y] = chi2 rho u_y -> chi2 (rho u_y +/- rho u_le) - * - ****************************************************************************/ - -static int le_reproject_all(lb_t * lb, lees_edw_t * le) { - - int ic, jc, kc, index; - int nplane, plane, side; - int nlocal[3]; - int p, m, np; - int poffset, ndist; - - double mode[NVEL]; - double rho; - double g[3], du[3]; - double t; - physics_t * phys = NULL; - - assert(le); - assert(lb); - assert(CVXBLOCK == 1); - - lb_ndist(lb, &ndist); - nplane = lees_edw_nplane_local(le); - physics_ref(&phys); - - t = 1.0*physics_control_timestep(phys); - lees_edw_nlocal(le, nlocal); - - for (plane = 0; plane < nplane; plane++) { - for (side = 0; side < 2; side++) { - - du[X] = 0.0; - du[Y] = 0.0; - du[Z] = 0.0; - - if (side == 0) { - /* Start with plane below Lees-Edwards BC */ - lees_edw_plane_uy_now(le, t, &du[Y]); - du[Y] = -du[Y]; - ic = lees_edw_plane_location(le, plane); - poffset = xdisp_fwd_cv[0]; - } - else { - /* Finally, deal with plane above LEBC */ - lees_edw_plane_uy_now(le, t, &du[Y]); - ic = lees_edw_plane_location(le, plane) + 1; - poffset = xdisp_bwd_cv[0]; - } - - for (jc = 1; jc <= nlocal[Y]; jc++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - index = lees_edw_index(le, ic, jc, kc); - - /* Compute modes */ - - for (m = 0; m < lb->model.nvel; m++) { - mode[m] = 0.0; - for (p = 0; p < lb->model.nvel; p++) { - int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, 0, p); - mode[m] += lb->f[ijk]*lb->param->ma[m][p]; - } - } - - /* Transform */ - - rho = mode[0]; - g[X] = mode[1]; - g[Y] = mode[2]; - g[Z] = mode[3]; - - mode[2] = mode[2] + rho*du[Y]; - mode[5] = mode[5] + g[X]*du[Y]; - mode[7] = mode[7] + 2.0*g[Y]*du[Y] + rho*du[Y]*du[Y]; - mode[8] = mode[8] + g[Z]*du[Y]; - - /* All ghosts unaltered */ - - /* Reproject */ - - for (np = 0; np < xblocklen_cv[0]; np++) { - p = poffset + np; - { - int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, 0, p); - lb->f[ijk] = 0.0; - for (m = 0; m < lb->model.nvel; m++) { - lb->f[ijk] += mode[m]*lb->param->mi[p][m]; - } - } - } - - /* next site */ - } - } - } - } - - return 0; -} - /***************************************************************************** * * le_displace_and_interpolate @@ -343,7 +222,6 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { int index0, index1; int nlocal[3]; int n, nplane, plane; - int p; int jdy, j1, j2; int ndist; int nprop; @@ -372,7 +250,14 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { * of plane-crossing distributions. */ lb_ndist(lb, &ndist); - nprop = xblocklen_cv[0]; + + /* Allocate a buffer large enough for all cvp[][X] = +1 */ + + nprop = 0; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] == +1) nprop += 1; + } + ndata = ndist*nprop*nlocal[Y]*nlocal[Z]; recv_buff = (double *) malloc(ndata*sizeof(double)); assert(recv_buff); @@ -401,12 +286,12 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { /* xdisp_fwd_cv[0] identifies cv[p][X] = +1 */ for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int pcv = xdisp_fwd_cv[0] + p; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != +1) continue; recv_buff[ndata++] = (1.0 - fr)* - lb->f[LB_ADDR(lb->nsite,ndist,lb->model.nvel,index0,n, pcv)] + lb->f[LB_ADDR(lb->nsite,ndist,lb->model.nvel,index0,n, p)] + fr* - lb->f[LB_ADDR(lb->nsite,ndist,lb->model.nvel,index1,n, pcv)]; + lb->f[LB_ADDR(lb->nsite,ndist,lb->model.nvel,index1,n, p)]; } } /* Next site */ @@ -422,9 +307,9 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { index0 = lees_edw_index(le, ic, jc, kc); for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int pcv = xdisp_fwd_cv[0] + p; - int la = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index0, n, pcv); + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != +1) continue; + int la = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index0, n, p); lb->f[la] = recv_buff[ndata++]; } } @@ -454,11 +339,12 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { index1 = lees_edw_index(le, ic, j2, kc); for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int pcv = xdisp_bwd_cv[0] + p; - int l0 = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index0, n, pcv); - int l1 = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index1, n, pcv); - recv_buff[ndata++] = (1.0 - fr)*lb->f[l0] + fr*lb->f[l1]; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] == -1) { + int l0 = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index0, n, p); + int l1 = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index1, n, p); + recv_buff[ndata++] = (1.0 - fr)*lb->f[l0] + fr*lb->f[l1]; + } } } /* Next site */ @@ -474,10 +360,11 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { index0 = lees_edw_index(le, ic, jc, kc); for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int pcv = xdisp_bwd_cv[0] + p; - int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel,index0,n,pcv); - lb->f[ijkp] = recv_buff[ndata++]; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] == -1) { + int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel,index0,n,p); + lb->f[ijkp] = recv_buff[ndata++]; + } } } } @@ -519,7 +406,6 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { int nhalo; int ind0, ind1, ind2, index; int n, nplane, plane; - int p; int ntotal[3]; int nlocal[3]; int offset[3]; @@ -544,7 +430,6 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { assert(lb); assert(le); - assert(CVXBLOCK == 1); lees_edw_ltot(le, ltot); lees_edw_ntotal(le, ntotal); @@ -559,7 +444,12 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { t = 1.0*physics_control_timestep(phys); lb_ndist(lb, &ndist); - nprop = xblocklen_cv[0]; + + + nprop = 0; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] == +1) nprop += 1; + } ndata = ndist*nprop*nlocal[Y]*nlocal[Z]; send_buff = (double *) malloc(ndata*sizeof(double)); @@ -610,9 +500,9 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { index = lees_edw_index(le, ic, jc, kc); for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, - xdisp_fwd_cv[0] + p); + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != +1) continue; + int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, p); send_buff[ndata++] = lb->f[ijkp]; } } @@ -640,11 +530,10 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { for (n = 0; n < ndist; n++) { ind1 = ind0 + n*nprop; ind2 = ind0 + ndist*nprop*nlocal[Z] + n*nprop; - - for (p = 0; p < nprop; p++) { - int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, - xdisp_fwd_cv[0] + p); - lb->f[ijk] = (1.0-fr)*recv_buff[ind1 + p] + fr*recv_buff[ind2 + p]; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != +1) continue; + int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, p); + lb->f[ijk] = (1.0-fr)*recv_buff[ind1++] + fr*recv_buff[ind2++]; } } /* Next site */ @@ -695,9 +584,9 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { index = lees_edw_index(le, ic, jc, kc); for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, - xdisp_bwd_cv[0] + p); + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != -1) continue; + int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, p); send_buff[ndata++] = lb->f[ijkp]; } } @@ -725,11 +614,10 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { for (n = 0; n < ndist; n++) { ind1 = ind0 + n*nprop; ind2 = ind0 + ndist*nprop*nlocal[Z] + n*nprop; - - for (p = 0; p < nprop; p++) { - int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, - xdisp_bwd_cv[0] + p); - lb->f[ijk] = (1.0-fr)*recv_buff[ind1 + p] + fr*recv_buff[ind2 + p]; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != -1) continue; + int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, p); + lb->f[ijk] = (1.0-fr)*recv_buff[ind1++] + fr*recv_buff[ind2++]; } } /* Next site */ diff --git a/src/noise.c b/src/noise.c index 696c90f5d..49b88e7b0 100644 --- a/src/noise.c +++ b/src/noise.c @@ -20,7 +20,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2013-2018 The University of Edinburgh + * (c) 2013-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -296,7 +296,7 @@ __host__ int noise_init_io_info(noise_t * obj, int grid[3], int form_in, const char * name = "Lattice noise RNG state"; const char * stubname = "noise"; - io_info_args_t args = {}; + io_info_args_t args = io_info_args_default(); assert(obj); diff --git a/src/pe.c b/src/pe.c index 34b37d9f9..f9ab0310d 100644 --- a/src/pe.c +++ b/src/pe.c @@ -15,7 +15,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -130,7 +130,7 @@ __host__ int pe_free(pe_t * pe) { if (pe->nref <= 0) { MPI_Comm_free(&pe->comm); if (pe->unquiet) { - char strctime[BUFSIZ] = {}; + char strctime[BUFSIZ] = {0}; pe_time(strctime, BUFSIZ); pe_info(pe, "End time: %s", strctime); pe_info(pe, "Ludwig finished normally.\n"); @@ -161,14 +161,14 @@ __host__ int pe_message(pe_t * pe) { (pe->mpi_size == 1) ? "" : "es"); { - char strctime[BUFSIZ] = {}; + char strctime[BUFSIZ] = {0}; pe_time(strctime, BUFSIZ); pe_info(pe, "Start time: %s\n", strctime); /* Extra \n ! */ } if (pe->mpi_rank == 0) { - compiler_info_t compiler = {}; + compiler_info_t compiler = {0}; compiler_id(&compiler); @@ -375,7 +375,7 @@ __host__ int pe_time(char * str, int bufsiz) { strncpy(str, strdefault, strnlen(strdefault, bufsiz-1)); if (now != (time_t) -1) { - char buf[BUFSIZ] = {}; + char buf[BUFSIZ] = {0}; char * c_time = ctime_r(&now, buf); if (c_time != NULL) { strncpy(str, buf, strnlen(buf, bufsiz-1)); diff --git a/src/phi_bc_inflow_fixed.c b/src/phi_bc_inflow_fixed.c index 42202694c..a3081f47e 100644 --- a/src/phi_bc_inflow_fixed.c +++ b/src/phi_bc_inflow_fixed.c @@ -14,7 +14,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * ****************************************************************************/ @@ -89,8 +89,8 @@ __host__ int phi_bc_inflow_fixed_update(phi_bc_inflow_fixed_t * inflow, field_t * phi) { int id = -1; int nhalo = 0; - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; cs_t * cs = NULL; assert(inflow); diff --git a/src/phi_bc_inflow_opts.c b/src/phi_bc_inflow_opts.c index 3e178ded4..95732824b 100644 --- a/src/phi_bc_inflow_opts.c +++ b/src/phi_bc_inflow_opts.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcced.ac.uk) @@ -24,7 +24,7 @@ phi_bc_inflow_opts_t phi_bc_inflow_opts_default(void) { - phi_bc_inflow_opts_t options = {}; /* Uninterestingly, NULL */ + phi_bc_inflow_opts_t options = {0}; /* Uninterestingly, NULL */ return options; } diff --git a/src/phi_bc_open_rt.c b/src/phi_bc_open_rt.c index e2392e001..00d9110b3 100644 --- a/src/phi_bc_open_rt.c +++ b/src/phi_bc_open_rt.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -39,8 +39,8 @@ __host__ int phi_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, phi_bc_open_t ** inflow, phi_bc_open_t ** outflow) { - int have_bc = 0; /* inflow/outflow required? */ - int flow[3] = {}; /* flow direction (one only, or none) */ + int have_bc = 0; /* inflow/outflow required? */ + int flow[3] = {0}; /* flow direction (one only, or none) */ assert(pe); assert(cs); @@ -51,8 +51,8 @@ __host__ int phi_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, have_bc = rt_switch(rt, "phi_bc_open"); if (have_bc) { - int wall[3] = {}; - int periodic[3] = {}; + int wall[3] = {0}; + int periodic[3] = {0}; /* Take flow direction from non-wall direction */ @@ -77,7 +77,7 @@ __host__ int phi_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, /* Inflow */ if (have_bc) { - char intype[BUFSIZ] = {}; + char intype[BUFSIZ] = {0}; double phib = -999.999; rt_string_parameter(rt, "phi_bc_inflow_type", intype, BUFSIZ); @@ -117,7 +117,7 @@ __host__ int phi_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, if (have_bc) { - char outtype[BUFSIZ] = {}; + char outtype[BUFSIZ] = {0}; rt_string_parameter(rt, "phi_bc_outflow_type", outtype, BUFSIZ); diff --git a/src/phi_bc_outflow_free.c b/src/phi_bc_outflow_free.c index bfebd50de..898b738ca 100644 --- a/src/phi_bc_outflow_free.c +++ b/src/phi_bc_outflow_free.c @@ -6,7 +6,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -92,9 +92,9 @@ __host__ int phi_bc_outflow_free_update(phi_bc_outflow_free_t * outflow, field_t * phi) { int id = -1; int nhalo = -1; - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; cs_t * cs = NULL; assert(outflow); diff --git a/src/phi_bc_outflow_opts.c b/src/phi_bc_outflow_opts.c index 30686a109..0beb6c525 100644 --- a/src/phi_bc_outflow_opts.c +++ b/src/phi_bc_outflow_opts.c @@ -2,6 +2,14 @@ * * phi_bc_outflow_opts.c * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * *****************************************************************************/ #include @@ -16,7 +24,7 @@ phi_bc_outflow_opts_t phi_bc_outflow_opts_default(void) { - phi_bc_outflow_opts_t options = {}; + phi_bc_outflow_opts_t options = {0}; return options; } diff --git a/src/phi_cahn_hilliard.c b/src/phi_cahn_hilliard.c index 4426a0e1c..dabe4a3ac 100644 --- a/src/phi_cahn_hilliard.c +++ b/src/phi_cahn_hilliard.c @@ -28,7 +28,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributions: * Thanks to Markus Gross, who helped to validate the noise implementation. @@ -1087,7 +1087,7 @@ static int phi_ch_subtract_sum_phi_after_forward_step(phi_ch_t * pch, field_t * kernel_info_t limits; kernel_ctxt_t * ctxt = NULL; - phi_correct_t local = {}; + phi_correct_t local = {0}; phi_correct_t * local_d = NULL; assert(pch); @@ -1118,7 +1118,7 @@ static int phi_ch_subtract_sum_phi_after_forward_step(phi_ch_t * pch, field_t * { MPI_Comm comm = MPI_COMM_NULL; - phi_correct_t global = {}; + phi_correct_t global = {0}; cs_cart_comm(pch->cs, &comm); @@ -1169,7 +1169,7 @@ __global__ void phi_ch_csum_kernel(kernel_ctxt_t * ktx, lees_edw_t *le, for_simt_parallel(kindex, kiterations, 1) { - kahan_t phi = {}; + kahan_t phi = {0}; ic = kernel_coords_ic(ktx, kindex); jc = kernel_coords_jc(ktx, kindex); diff --git a/src/phi_force.c b/src/phi_force.c index 86b0cb061..ac64b580c 100644 --- a/src/phi_force.c +++ b/src/phi_force.c @@ -18,7 +18,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2011-2021 The University of Edinburgh + * (c) 2011-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -246,7 +246,7 @@ __host__ int phi_force_external_chemical_potential(cs_t * cs, field_t * phi, { int is_gradmu = 0; - double gradmu[3] = {}; + double gradmu[3] = {0}; physics_t * phys = NULL; physics_ref(&phys); diff --git a/src/phi_grad_mu.c b/src/phi_grad_mu.c index e3b076b80..90a6d375b 100644 --- a/src/phi_grad_mu.c +++ b/src/phi_grad_mu.c @@ -10,7 +10,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -133,7 +133,7 @@ __host__ int phi_grad_mu_external(cs_t * cs, field_t * phi, hydro_t * hydro) { int nlocal[3]; int is_grad_mu = 0; /* Short circuit the kernel if not required. */ dim3 nblk, ntpb; - double3 grad_mu = {}; + double3 grad_mu = {0}; kernel_info_t limits; kernel_ctxt_t * ctxt = NULL; @@ -146,7 +146,7 @@ __host__ int phi_grad_mu_external(cs_t * cs, field_t * phi, hydro_t * hydro) { { physics_t * phys = NULL; - double mu[3] = {}; + double mu[3] = {0}; physics_ref(&phys); physics_grad_mu(phys, mu); @@ -213,7 +213,7 @@ __global__ void phi_grad_mu_fluid_kernel(kernel_ctxt_t * ktx, field_t * phi, /* NVECTOR is max size of order parameter field as need fixed array[] */ assert(phi->nf <= NVECTOR); - double force[3] = {}; + double force[3] = {0}; double mum1[NVECTOR + 1]; /* Ugly gotcha: extra chemical potential */ double mup1[NVECTOR + 1]; /* may exist, but not required ... */ double phi0[NVECTOR]; /* E.g., in ternary implementation. */ @@ -302,9 +302,9 @@ __global__ void phi_grad_mu_solid_kernel(kernel_ctxt_t * ktx, field_t * field, int kc = kernel_coords_kc(ktx, kindex); int index0 = kernel_coords_index(ktx, ic, jc, kc); - double force[3] = {}; - double phi[NVECTOR] = {}; - double mu[NVECTOR+1] = {}; + double force[3] = {0}; + double phi[NVECTOR] = {0}; + double mu[NVECTOR+1] = {0}; field_scalar_array(field, index0, phi); fe->func->mu(fe, index0, mu); @@ -316,8 +316,8 @@ __global__ void phi_grad_mu_solid_kernel(kernel_ctxt_t * ktx, field_t * field, int mapm1 = MAP_FLUID; int mapp1 = MAP_FLUID; - double mum1[NVECTOR+1] = {}; - double mup1[NVECTOR+1] = {}; + double mum1[NVECTOR+1] = {0}; + double mup1[NVECTOR+1] = {0}; fe->func->mu(fe, indexm1, mum1); fe->func->mu(fe, indexp1, mup1); @@ -348,8 +348,8 @@ __global__ void phi_grad_mu_solid_kernel(kernel_ctxt_t * ktx, field_t * field, int mapm1 = MAP_FLUID; int mapp1 = MAP_FLUID; - double mum1[NVECTOR+1] = {}; - double mup1[NVECTOR+1] = {}; + double mum1[NVECTOR+1] = {0}; + double mup1[NVECTOR+1] = {0}; fe->func->mu(fe, indexm1, mum1); fe->func->mu(fe, indexp1, mup1); @@ -380,8 +380,8 @@ __global__ void phi_grad_mu_solid_kernel(kernel_ctxt_t * ktx, field_t * field, int mapm1 = MAP_FLUID; int mapp1 = MAP_FLUID; - double mum1[NVECTOR+1] = {}; - double mup1[NVECTOR+1] = {}; + double mum1[NVECTOR+1] = {0}; + double mup1[NVECTOR+1] = {0}; fe->func->mu(fe, indexm1, mum1); fe->func->mu(fe, indexp1, mup1); @@ -440,7 +440,7 @@ __global__ void phi_grad_mu_external_kernel(kernel_ctxt_t * ktx, field_t * phi, int kc = kernel_coords_kc(ktx, kindex); int index = kernel_coords_index(ktx, ic, jc, kc); - double force[3] = {}; + double force[3] = {0}; double phi0 = phi->data[addr_rank1(phi->nsites, 1, index, 0)]; force[X] = -phi0*grad_mu.x; diff --git a/src/psi.c b/src/psi.c index 48752c38f..978cb5927 100644 --- a/src/psi.c +++ b/src/psi.c @@ -9,7 +9,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2020 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -255,7 +255,7 @@ int psi_diffusivity(psi_t * obj, int n, double * diff) { int psi_init_io_info(psi_t * obj, int grid[3], int form_in, int form_out) { - io_info_args_t args = {}; + io_info_args_t args = io_info_args_default(); assert(obj); assert(grid); diff --git a/src/runtime.c b/src/runtime.c index 502c56e1f..0ab76a4d6 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -31,8 +31,9 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * + * (c) 2010-2022 The University of Edinburgh + * * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2010-2021 The University of Edinburgh * *****************************************************************************/ @@ -836,7 +837,7 @@ static int rt_look_up_key(rt_t * rt, const char * key, char * value) { int rt_key_required(rt_t * rt, const char * key, rt_enum_t level) { int ierr = 0; - char value[NKEY_LENGTH] = {}; + char value[NKEY_LENGTH] = {0}; assert(rt); assert(key); diff --git a/src/stats_colloid_force_split.c b/src/stats_colloid_force_split.c index 9f8d7127a..58b2c5369 100644 --- a/src/stats_colloid_force_split.c +++ b/src/stats_colloid_force_split.c @@ -9,7 +9,7 @@ * Edinburgh Soft Matter and Staticial Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Oliver Henrich (o.henrich@strath.ac.uk) @@ -136,7 +136,7 @@ int stats_colloid_force_split_output(colloids_info_t * cinfo, int timestep) { if (pe_mpi_rank(pe) > 0) { /* Send to root: a count, and a data buffer */ - MPI_Request req[2] = {}; + MPI_Request req[2] = {0}; MPI_Isend(&count, 1, MPI_INT, 0, 211129, comm, req + 0); MPI_Isend(buf, count*sz, MPI_CHAR, 0, 211130, comm, req + 1); @@ -147,7 +147,7 @@ int stats_colloid_force_split_output(colloids_info_t * cinfo, int timestep) { /* Root: output own, then those for everyone else */ - char filename[BUFSIZ] = {}; + char filename[BUFSIZ] = {0}; FILE * fp = NULL; sprintf(filename, "colloid-diag-%8.8d.dat", timestep); @@ -235,7 +235,7 @@ int stat_diagnostic_write(colloid_diagnostic_t * array, int count, int colloid_force_from_pth(colloid_t * pc, pth_t * pth, double f[3]) { - lb_model_t model = {}; + lb_model_t model = {0}; assert(pc); assert(pth); @@ -315,7 +315,7 @@ int stat_colloids_force(colloids_info_t * cinfo, pth_t * pth, int contrib) { int stat_stress_compute(pth_t * pth, fe_t * fe, fe_lc_str_ft stress) { - int nlocal[3] = {}; + int nlocal[3] = {0}; int nextra = 2; /* Kludge: Must be liquid crystal */ assert(pth); @@ -327,7 +327,7 @@ int stat_stress_compute(pth_t * pth, fe_t * fe, fe_lc_str_ft stress) { for (int jc = 1 - nextra; jc <= nlocal[Y] + nextra; jc++) { for (int kc = 1 - nextra; kc <= nlocal[Z] + nextra; kc++) { - double sth[3][3] = {}; + double sth[3][3] = {0}; int index = cs_index(pth->cs, ic, jc, kc); stress((fe_lc_t *) fe, index, sth); diff --git a/src/stats_distribution.c b/src/stats_distribution.c index 898e333df..547f0a132 100644 --- a/src/stats_distribution.c +++ b/src/stats_distribution.c @@ -11,7 +11,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Kevin Stratford (kevin@epcc.ed.ac.uk) * @@ -27,13 +27,18 @@ #include "util_sum.h" #include "stats_distribution.h" +/* Kernel utility continaer */ +typedef struct gm_util_s { + int8_t cv[27][3]; +} gm_util_t; + __host__ int stats_distribution_momentum_serial(lb_t * lb, map_t * map, double g[3]); __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, MPI_Comm comm, double gm[3]); __global__ void distribution_gm_kernel(kernel_ctxt_t * ktxt, lb_t * lb, - map_t * map, kahan_t * gm); + map_t * map, gm_util_t u, kahan_t * gm); /***************************************************************************** @@ -199,17 +204,24 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, int nlocal[3]; dim3 nblk, ntpb; + gm_util_t util = {0}; kernel_info_t limits; kernel_ctxt_t * ctxt = NULL; /* Device memory for stats */ - kahan_t sum[3] = {}; + kahan_t sum[3] = {0}; kahan_t * sum_d = NULL; tdpAssert(tdpMalloc((void **) &sum_d, 3*sizeof(kahan_t))); tdpAssert(tdpMemcpy(sum_d, sum, 3*sizeof(kahan_t), tdpMemcpyHostToDevice)); + for (int p = 0; p < lb->model.nvel; p++) { + util.cv[p][X] = lb->model.cv[p][X]; + util.cv[p][Y] = lb->model.cv[p][Y]; + util.cv[p][Z] = lb->model.cv[p][Z]; + } + /* Local kernel */ cs_nlocal(lb->cs, nlocal); @@ -221,7 +233,7 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, kernel_ctxt_launch_param(ctxt, &nblk, &ntpb); tdpLaunchKernel(distribution_gm_kernel, nblk, ntpb, 0, 0, - ctxt->target, lb->target, map->target, sum_d); + ctxt->target, lb->target, map->target, util, sum_d); tdpAssert(tdpPeekAtLastError()); tdpAssert(tdpDeviceSynchronize()); @@ -233,7 +245,7 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, { MPI_Datatype dt = MPI_DATATYPE_NULL; MPI_Op op = MPI_OP_NULL; - kahan_t gmlocal[3] = {}; + kahan_t gmlocal[3] = {0}; kahan_mpi_datatype(&dt); kahan_mpi_op_sum(&op); @@ -263,7 +275,8 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, *****************************************************************************/ __global__ void distribution_gm_kernel(kernel_ctxt_t * ktx, lb_t * lb, - map_t * map, kahan_t * gm) { + map_t * map, gm_util_t util, + kahan_t * gm) { assert(ktx); assert(lb); @@ -304,9 +317,9 @@ __global__ void distribution_gm_kernel(kernel_ctxt_t * ktx, lb_t * lb, if (status == MAP_FLUID) { for (int p = 1; p < lb->nvel; p++) { double f = lb->f[LB_ADDR(lb->nsite,lb->ndist,lb->nvel,index,LB_RHO,p)]; - double gxf = f*lb->model.cv[p][X]; - double gyf = f*lb->model.cv[p][Y]; - double gzf = f*lb->model.cv[p][Z]; + double gxf = f*util.cv[p][X]; + double gyf = f*util.cv[p][Y]; + double gzf = f*util.cv[p][Z]; kahan_add_double(&gx[tid], gxf); kahan_add_double(&gy[tid], gyf); kahan_add_double(&gz[tid], gzf); diff --git a/src/subgrid.c b/src/subgrid.c index 42afc1ef2..e8cbbc3f3 100644 --- a/src/subgrid.c +++ b/src/subgrid.c @@ -169,8 +169,8 @@ int subgrid_force_from_particles(colloids_info_t * cinfo, hydro_t * hydro, hydro_f_local_add(hydro, index, force); } else { - double rd[3] = {}; - double torque[3] = {}; + double rd[3] = {0}; + double torque[3] = {0}; presolved->force[X] += force[X]; presolved->force[Y] += force[Y]; presolved->force[Z] += force[Z]; diff --git a/src/symmetric_rt.c b/src/symmetric_rt.c index d4dca3c28..2e51b3039 100644 --- a/src/symmetric_rt.c +++ b/src/symmetric_rt.c @@ -7,8 +7,9 @@ * Edinburgh Soft Matter and Statistical Physics Group * and Edinburgh Parallel Computing Centre * + * (c) 2010-2022 The University of Edinburgh + * * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2010-2021 The University of Edinburgh * ****************************************************************************/ @@ -34,7 +35,7 @@ int fe_symmetric_init_rt(pe_t * pe, rt_t * rt, fe_symm_t * fe) { int old_keys = 0; double sigma; double xi; - fe_symm_param_t param = {}; + fe_symm_param_t param = {0}; assert(pe); assert(rt); diff --git a/src/timer.c b/src/timer.c index 795a13053..3f71da603 100644 --- a/src/timer.c +++ b/src/timer.c @@ -10,7 +10,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -253,7 +253,7 @@ __host__ int timekeeper_create(pe_t * pe, const timekeeper_options_t * opts, assert(opts); assert(tk); - *tk = (timekeeper_t) {}; + *tk = (timekeeper_t) {0}; tk->pe = pe; tk->options = *opts; @@ -278,7 +278,7 @@ __host__ int timekeeper_step(timekeeper_t * tk) { if (tk->timestep % tk->options.lap_report_freq == 0) { /* Recell strctime from pe_time() has a new line */ pe_t * pe = tk->pe; - char strctime[BUFSIZ] = {}; + char strctime[BUFSIZ] = {0}; pe_time(strctime, BUFSIZ); pe_info(pe, "\nLap time at step %9d is: %8.3f seconds at %s", tk->timestep, timer_lapse(TIMER_LAP), strctime); @@ -298,7 +298,7 @@ __host__ int timekeeper_free(timekeeper_t * tk) { assert(tk); - *tk = (timekeeper_t) {}; + *tk = (timekeeper_t) {0}; return 0; } diff --git a/src/util_sum.c b/src/util_sum.c index 73bb4172d..ed9fe7b07 100644 --- a/src/util_sum.c +++ b/src/util_sum.c @@ -177,10 +177,10 @@ __host__ __device__ void klein_add(klein_t * sum, klein_t val) { __host__ int kahan_mpi_datatype(MPI_Datatype * type) { int blocklengths[3] = {1, 1, 1}; - MPI_Aint displacements[4] = {}; + MPI_Aint displacements[4] = {0}; MPI_Datatype types[3] = {MPI_INT, MPI_DOUBLE, MPI_DOUBLE}; - kahan_t sum = {}; + kahan_t sum = {0}; assert(type); @@ -252,10 +252,10 @@ __host__ int klein_mpi_datatype(MPI_Datatype * type) { int ierr = 0; int blocklengths[4] = {1, 1, 1, 1}; - MPI_Aint displacements[5] = {}; + MPI_Aint displacements[5] = {0}; MPI_Datatype types[4] = {MPI_INT, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE}; - klein_t sum = {}; + klein_t sum = {0}; assert(type); diff --git a/src/wall_ss_cut.c b/src/wall_ss_cut.c index 741de6fc0..b0fd24848 100644 --- a/src/wall_ss_cut.c +++ b/src/wall_ss_cut.c @@ -157,7 +157,7 @@ int wall_ss_cut_compute(colloids_info_t * cinfo, void * obj) { wall_ss_cut_t * self = (wall_ss_cut_t *) obj; - double forcewall[3] = {}; /* force on the wall for accounting */ + double forcewall[3] = {0}; /* force on the wall for accounting */ double lmin[3]; double ltot[3]; diff --git a/target/target.h b/target/target.h index 1d17e4ce1..418c659cc 100644 --- a/target/target.h +++ b/target/target.h @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2018 The University of Edinburgh + * (c) 2018-2022 The University of Edinburgh * * Contributing authors: * Alan Gray (alang@epcc.ed.ac.uk) @@ -38,12 +38,12 @@ __host__ tdpError_t tdpDeviceSetCacheConfig(tdpFuncCache cacheConfig); __host__ tdpError_t tdpGetDeviceProperties(struct tdpDeviceProp * prop, int); __host__ tdpError_t tdpSetDevice(int device); +__host__ tdpError_t tdpDeviceSynchronize(void); __host__ __device__ tdpError_t tdpDeviceGetAttribute(int * value, tdpDeviceAttr attr, int device); __host__ __device__ tdpError_t tdpDeviceGetCacheConfig(tdpFuncCache * cache); -__host__ __device__ tdpError_t tdpDeviceSynchronize(void); __host__ __device__ tdpError_t tdpGetDevice(int * device); __host__ __device__ tdpError_t tdpGetDeviceCount(int * count); diff --git a/target/target_cuda.c b/target/target_cuda.c index 9b730979e..9cd0a6f0e 100644 --- a/target/target_cuda.c +++ b/target/target_cuda.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2019 The University of Edinburgh + * (c) 2019-2022 The University of Edinburgh * * Contributing authors: * Alan Gray (alang@epcc.ed.ac.uk) @@ -240,7 +240,9 @@ __host__ tdpError_t tdpDeviceSetCacheConfig(tdpFuncCache cacheConfig) { return cudaDeviceSetCacheConfig(cacheConfig); } -__host__ __device__ tdpError_t tdpDeviceSynchronize(void) { +/* nb. CUDA 11.6 has deprecated the __device__ version of + * cudaDeviceSynchronize(). It should be used only on the host. */ +__host__ tdpError_t tdpDeviceSynchronize(void) { return cudaDeviceSynchronize(); } diff --git a/target/target_cuda.h b/target/target_cuda.h index 1be96e07e..02297e855 100644 --- a/target/target_cuda.h +++ b/target/target_cuda.h @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2018 The University of Edinburgh + * (c) 2018-2022 The University of Edinburgh * * Contributing authors: * Alan Gray (alang@epcc.ed.ac.uk) diff --git a/tests/regression/d2q9/serial-2khz-bm1.inp b/tests/regression/d2q9/serial-2khz-bm1.inp index c7f423639..433f9a7d5 100644 --- a/tests/regression/d2q9/serial-2khz-bm1.inp +++ b/tests/regression/d2q9/serial-2khz-bm1.inp @@ -66,7 +66,6 @@ N_cycles 2560 size 64_64_1 grid 2_2_1 -reduced_halo yes ############################################################################## # @@ -78,6 +77,7 @@ viscosity 0.000128 isothermal_fluctuations off lb_relaxation_scheme m10 +lb_halo_scheme lb_halo_openmp_reduced ############################################################################## # diff --git a/tests/regression/d2q9/serial-2khz-bm1.log b/tests/regression/d2q9/serial-2khz-bm1.log index 2346e6115..5068152b2 100644 --- a/tests/regression/d2q9/serial-2khz-bm1.log +++ b/tests/regression/d2q9/serial-2khz-bm1.log @@ -40,7 +40,7 @@ Lattice Boltzmann distributions Model: d2q9 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_openmp_reduced (host) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d2q9/serial-flct-t01.inp b/tests/regression/d2q9/serial-flct-t01.inp index aff14a876..ff9080b5c 100644 --- a/tests/regression/d2q9/serial-flct-t01.inp +++ b/tests/regression/d2q9/serial-flct-t01.inp @@ -13,7 +13,7 @@ N_cycles 200 ############################################################################## size 96_96_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d2q9/serial-flct-t01.log b/tests/regression/d2q9/serial-flct-t01.log index af559c989..04a9658f9 100644 --- a/tests/regression/d2q9/serial-flct-t01.log +++ b/tests/regression/d2q9/serial-flct-t01.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d2q9 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d2q9/serial-open-phi.log b/tests/regression/d2q9/serial-open-phi.log index 414ea8ade..c272651a6 100644 --- a/tests/regression/d2q9/serial-open-phi.log +++ b/tests/regression/d2q9/serial-open-phi.log @@ -54,7 +54,7 @@ Lattice Boltzmann distributions Model: d2q9 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d2q9/serial-surf-t01.log b/tests/regression/d2q9/serial-surf-t01.log index e71954c6a..bb2c93d51 100644 --- a/tests/regression/d2q9/serial-surf-t01.log +++ b/tests/regression/d2q9/serial-surf-t01.log @@ -51,7 +51,7 @@ Lattice Boltzmann distributions Model: d2q9 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d2q9/serial-surf-t02.log b/tests/regression/d2q9/serial-surf-t02.log index 5eadcc014..662ab5280 100644 --- a/tests/regression/d2q9/serial-surf-t02.log +++ b/tests/regression/d2q9/serial-surf-t02.log @@ -51,7 +51,7 @@ Lattice Boltzmann distributions Model: d2q9 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/pmpi08-auto-c01.inp b/tests/regression/d3q15/pmpi08-auto-c01.inp index 25c248bf5..508988376 100644 --- a/tests/regression/d3q15/pmpi08-auto-c01.inp +++ b/tests/regression/d3q15/pmpi08-auto-c01.inp @@ -14,7 +14,7 @@ N_cycles 40 size 64_64_64 grid 2_2_2 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/pmpi08-auto-c01.log b/tests/regression/d3q15/pmpi08-auto-c01.log index ac7215a86..708efcb03 100644 --- a/tests/regression/d3q15/pmpi08-auto-c01.log +++ b/tests/regression/d3q15/pmpi08-auto-c01.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q15 R SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-auto-c01.inp b/tests/regression/d3q15/serial-auto-c01.inp index 574208413..c65445dec 100644 --- a/tests/regression/d3q15/serial-auto-c01.inp +++ b/tests/regression/d3q15/serial-auto-c01.inp @@ -13,7 +13,7 @@ N_cycles 40 ############################################################################## size 64_64_64 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-auto-c01.log b/tests/regression/d3q15/serial-auto-c01.log index faf06b134..41c58ef47 100644 --- a/tests/regression/d3q15/serial-auto-c01.log +++ b/tests/regression/d3q15/serial-auto-c01.log @@ -39,7 +39,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-auto-c02.inp b/tests/regression/d3q15/serial-auto-c02.inp index f25f4d0cb..37994925e 100644 --- a/tests/regression/d3q15/serial-auto-c02.inp +++ b/tests/regression/d3q15/serial-auto-c02.inp @@ -13,7 +13,7 @@ N_cycles 40 ############################################################################## size 64_64_64 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-auto-c02.log b/tests/regression/d3q15/serial-auto-c02.log index 73b463f1d..8b2afdae2 100644 --- a/tests/regression/d3q15/serial-auto-c02.log +++ b/tests/regression/d3q15/serial-auto-c02.log @@ -40,7 +40,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-le2d-lb1.log b/tests/regression/d3q15/serial-le2d-lb1.log index 4e56da31a..e1eecc061 100644 --- a/tests/regression/d3q15/serial-le2d-lb1.log +++ b/tests/regression/d3q15/serial-le2d-lb1.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 2 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-rect-ct1.inp b/tests/regression/d3q15/serial-rect-ct1.inp index e62e6c102..42bc2cab5 100644 --- a/tests/regression/d3q15/serial-rect-ct1.inp +++ b/tests/regression/d3q15/serial-rect-ct1.inp @@ -31,7 +31,7 @@ N_start 0 size 1_62_30 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-rect-ct1.log b/tests/regression/d3q15/serial-rect-ct1.log index fe710e77e..7c68c1b20 100644 --- a/tests/regression/d3q15/serial-rect-ct1.log +++ b/tests/regression/d3q15/serial-rect-ct1.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-rect-ct2.inp b/tests/regression/d3q15/serial-rect-ct2.inp index 7ac1e1277..84f3d3093 100644 --- a/tests/regression/d3q15/serial-rect-ct2.inp +++ b/tests/regression/d3q15/serial-rect-ct2.inp @@ -20,7 +20,7 @@ N_start 0 size 1_62_30 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-rect-ct2.log b/tests/regression/d3q15/serial-rect-ct2.log index 1f3bce201..14f9f80f9 100644 --- a/tests/regression/d3q15/serial-rect-ct2.log +++ b/tests/regression/d3q15/serial-rect-ct2.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-rect-ct3.inp b/tests/regression/d3q15/serial-rect-ct3.inp index db02e0f1c..d2b4ef938 100644 --- a/tests/regression/d3q15/serial-rect-ct3.inp +++ b/tests/regression/d3q15/serial-rect-ct3.inp @@ -26,7 +26,7 @@ N_start 0 size 1_31_15 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-rect-ct3.log b/tests/regression/d3q15/serial-rect-ct3.log index ce3039517..214ddae3f 100644 --- a/tests/regression/d3q15/serial-rect-ct3.log +++ b/tests/regression/d3q15/serial-rect-ct3.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-rect-ct4.inp b/tests/regression/d3q15/serial-rect-ct4.inp index 760074c18..75fd03dbc 100644 --- a/tests/regression/d3q15/serial-rect-ct4.inp +++ b/tests/regression/d3q15/serial-rect-ct4.inp @@ -19,7 +19,7 @@ N_start 0 size 31_15_1 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-rect-ct4.log b/tests/regression/d3q15/serial-rect-ct4.log index b0565f08e..662f3ab5f 100644 --- a/tests/regression/d3q15/serial-rect-ct4.log +++ b/tests/regression/d3q15/serial-rect-ct4.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-rect-ct5.inp b/tests/regression/d3q15/serial-rect-ct5.inp index 1101322df..abc9f9767 100644 --- a/tests/regression/d3q15/serial-rect-ct5.inp +++ b/tests/regression/d3q15/serial-rect-ct5.inp @@ -19,7 +19,7 @@ N_start 0 size 31_1_15 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-rect-ct5.log b/tests/regression/d3q15/serial-rect-ct5.log index 83b37d477..52f075246 100644 --- a/tests/regression/d3q15/serial-rect-ct5.log +++ b/tests/regression/d3q15/serial-rect-ct5.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-elec/serial-rest-ec1.log b/tests/regression/d3q19-elec/serial-rest-ec1.log index 443d00e3d..7f26f5745 100644 --- a/tests/regression/d3q19-elec/serial-rest-ec1.log +++ b/tests/regression/d3q19-elec/serial-rest-ec1.log @@ -56,7 +56,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-elec/serial-rest-ec2.log b/tests/regression/d3q19-elec/serial-rest-ec2.log index 82231c43f..e837911ff 100644 --- a/tests/regression/d3q19-elec/serial-rest-ec2.log +++ b/tests/regression/d3q19-elec/serial-rest-ec2.log @@ -56,7 +56,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-actv-s01.inp b/tests/regression/d3q19-short/serial-actv-s01.inp index c45d2e377..5c44c617f 100644 --- a/tests/regression/d3q19-short/serial-actv-s01.inp +++ b/tests/regression/d3q19-short/serial-actv-s01.inp @@ -20,7 +20,6 @@ N_start 0 size 64_64_1 grid 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-actv-s01.log b/tests/regression/d3q19-short/serial-actv-s01.log index 2ad3ca22b..a4eadef20 100644 --- a/tests/regression/d3q19-short/serial-actv-s01.log +++ b/tests/regression/d3q19-short/serial-actv-s01.log @@ -57,7 +57,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-actv-s02.inp b/tests/regression/d3q19-short/serial-actv-s02.inp index 0c2c5fbda..3593bcf94 100644 --- a/tests/regression/d3q19-short/serial-actv-s02.inp +++ b/tests/regression/d3q19-short/serial-actv-s02.inp @@ -19,7 +19,6 @@ N_start 0 size 64_64_1 grid 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-actv-s02.log b/tests/regression/d3q19-short/serial-actv-s02.log index 88f662fc0..2a747d2a2 100644 --- a/tests/regression/d3q19-short/serial-actv-s02.log +++ b/tests/regression/d3q19-short/serial-actv-s02.log @@ -57,7 +57,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-bond-c01.log b/tests/regression/d3q19-short/serial-bond-c01.log index 42163fb60..fd54e1163 100644 --- a/tests/regression/d3q19-short/serial-bond-c01.log +++ b/tests/regression/d3q19-short/serial-bond-c01.log @@ -54,7 +54,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-bond-c02.log b/tests/regression/d3q19-short/serial-bond-c02.log index 58815f26c..6ed3c4c08 100644 --- a/tests/regression/d3q19-short/serial-bond-c02.log +++ b/tests/regression/d3q19-short/serial-bond-c02.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-n01.inp b/tests/regression/d3q19-short/serial-chol-n01.inp index d4f736498..78a7011c1 100644 --- a/tests/regression/d3q19-short/serial-chol-n01.inp +++ b/tests/regression/d3q19-short/serial-chol-n01.inp @@ -14,7 +14,6 @@ N_cycles 5 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-n01.log b/tests/regression/d3q19-short/serial-chol-n01.log index 67b626271..7e9d1135a 100644 --- a/tests/regression/d3q19-short/serial-chol-n01.log +++ b/tests/regression/d3q19-short/serial-chol-n01.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-n02.inp b/tests/regression/d3q19-short/serial-chol-n02.inp index 068b7dfb1..0268e6776 100644 --- a/tests/regression/d3q19-short/serial-chol-n02.inp +++ b/tests/regression/d3q19-short/serial-chol-n02.inp @@ -14,7 +14,6 @@ N_cycles 5 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-n02.log b/tests/regression/d3q19-short/serial-chol-n02.log index c635de976..7cc01315b 100644 --- a/tests/regression/d3q19-short/serial-chol-n02.log +++ b/tests/regression/d3q19-short/serial-chol-n02.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-n03.inp b/tests/regression/d3q19-short/serial-chol-n03.inp index 70490c39b..4eddf12a3 100644 --- a/tests/regression/d3q19-short/serial-chol-n03.inp +++ b/tests/regression/d3q19-short/serial-chol-n03.inp @@ -14,7 +14,6 @@ N_cycles 5 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-n03.log b/tests/regression/d3q19-short/serial-chol-n03.log index 784c3781e..917d9462f 100644 --- a/tests/regression/d3q19-short/serial-chol-n03.log +++ b/tests/regression/d3q19-short/serial-chol-n03.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-n04.inp b/tests/regression/d3q19-short/serial-chol-n04.inp index 231f41d96..0e1c22021 100644 --- a/tests/regression/d3q19-short/serial-chol-n04.inp +++ b/tests/regression/d3q19-short/serial-chol-n04.inp @@ -14,7 +14,6 @@ N_cycles 5 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-n04.log b/tests/regression/d3q19-short/serial-chol-n04.log index 61a43a78d..430f20564 100644 --- a/tests/regression/d3q19-short/serial-chol-n04.log +++ b/tests/regression/d3q19-short/serial-chol-n04.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-p01.inp b/tests/regression/d3q19-short/serial-chol-p01.inp index ea58c54b7..db793521a 100644 --- a/tests/regression/d3q19-short/serial-chol-p01.inp +++ b/tests/regression/d3q19-short/serial-chol-p01.inp @@ -15,7 +15,6 @@ N_cycles 5 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-p01.log b/tests/regression/d3q19-short/serial-chol-p01.log index 067cc8832..07ac7dc61 100644 --- a/tests/regression/d3q19-short/serial-chol-p01.log +++ b/tests/regression/d3q19-short/serial-chol-p01.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st1.inp b/tests/regression/d3q19-short/serial-chol-st1.inp index 9ee64a9ba..5cfa2b648 100644 --- a/tests/regression/d3q19-short/serial-chol-st1.inp +++ b/tests/regression/d3q19-short/serial-chol-st1.inp @@ -24,7 +24,6 @@ N_cycles 20 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st1.log b/tests/regression/d3q19-short/serial-chol-st1.log index 9289a3ee0..98ab6fc41 100644 --- a/tests/regression/d3q19-short/serial-chol-st1.log +++ b/tests/regression/d3q19-short/serial-chol-st1.log @@ -67,7 +67,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st2.inp b/tests/regression/d3q19-short/serial-chol-st2.inp index 769981793..bb08f2d9d 100644 --- a/tests/regression/d3q19-short/serial-chol-st2.inp +++ b/tests/regression/d3q19-short/serial-chol-st2.inp @@ -22,7 +22,6 @@ N_cycles 20 size 16_32_32 periodicity 0_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st2.log b/tests/regression/d3q19-short/serial-chol-st2.log index 64419a571..099c0031b 100644 --- a/tests/regression/d3q19-short/serial-chol-st2.log +++ b/tests/regression/d3q19-short/serial-chol-st2.log @@ -67,7 +67,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st3.inp b/tests/regression/d3q19-short/serial-chol-st3.inp index 93bdbd656..8080bfa4b 100644 --- a/tests/regression/d3q19-short/serial-chol-st3.inp +++ b/tests/regression/d3q19-short/serial-chol-st3.inp @@ -16,7 +16,6 @@ N_cycles 10 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st3.log b/tests/regression/d3q19-short/serial-chol-st3.log index 5e70ebafb..03cd6a2d0 100644 --- a/tests/regression/d3q19-short/serial-chol-st3.log +++ b/tests/regression/d3q19-short/serial-chol-st3.log @@ -74,7 +74,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st4.inp b/tests/regression/d3q19-short/serial-chol-st4.inp index 309c1915d..8e6a22400 100644 --- a/tests/regression/d3q19-short/serial-chol-st4.inp +++ b/tests/regression/d3q19-short/serial-chol-st4.inp @@ -16,7 +16,6 @@ N_cycles 10 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st4.log b/tests/regression/d3q19-short/serial-chol-st4.log index 5d6835dff..f27c6bbca 100644 --- a/tests/regression/d3q19-short/serial-chol-st4.log +++ b/tests/regression/d3q19-short/serial-chol-st4.log @@ -74,7 +74,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st5.inp b/tests/regression/d3q19-short/serial-chol-st5.inp index c53530023..4d28eb5a9 100644 --- a/tests/regression/d3q19-short/serial-chol-st5.inp +++ b/tests/regression/d3q19-short/serial-chol-st5.inp @@ -16,7 +16,6 @@ N_cycles 10 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st5.log b/tests/regression/d3q19-short/serial-chol-st5.log index e32304184..64eb64ce3 100644 --- a/tests/regression/d3q19-short/serial-chol-st5.log +++ b/tests/regression/d3q19-short/serial-chol-st5.log @@ -74,7 +74,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st6.inp b/tests/regression/d3q19-short/serial-chol-st6.inp index 3d9c8ea0c..29263e329 100644 --- a/tests/regression/d3q19-short/serial-chol-st6.inp +++ b/tests/regression/d3q19-short/serial-chol-st6.inp @@ -16,7 +16,6 @@ N_cycles 10 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st6.log b/tests/regression/d3q19-short/serial-chol-st6.log index 10d02e48a..712cb2842 100644 --- a/tests/regression/d3q19-short/serial-chol-st6.log +++ b/tests/regression/d3q19-short/serial-chol-st6.log @@ -74,7 +74,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st7.inp b/tests/regression/d3q19-short/serial-chol-st7.inp index b8f234d36..e97299d29 100644 --- a/tests/regression/d3q19-short/serial-chol-st7.inp +++ b/tests/regression/d3q19-short/serial-chol-st7.inp @@ -25,7 +25,6 @@ N_cycles 20 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st7.log b/tests/regression/d3q19-short/serial-chol-st7.log index f4e4e59b8..7fd244cf4 100644 --- a/tests/regression/d3q19-short/serial-chol-st7.log +++ b/tests/regression/d3q19-short/serial-chol-st7.log @@ -66,7 +66,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-w01.inp b/tests/regression/d3q19-short/serial-chol-w01.inp index d30d3a773..521955d8e 100644 --- a/tests/regression/d3q19-short/serial-chol-w01.inp +++ b/tests/regression/d3q19-short/serial-chol-w01.inp @@ -14,7 +14,6 @@ N_cycles 2 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-w01.log b/tests/regression/d3q19-short/serial-chol-w01.log index 884e1bd4d..ccf161520 100644 --- a/tests/regression/d3q19-short/serial-chol-w01.log +++ b/tests/regression/d3q19-short/serial-chol-w01.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-w02.inp b/tests/regression/d3q19-short/serial-chol-w02.inp index f5ae493f2..4936f7fd6 100644 --- a/tests/regression/d3q19-short/serial-chol-w02.inp +++ b/tests/regression/d3q19-short/serial-chol-w02.inp @@ -14,7 +14,6 @@ N_cycles 2 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-w02.log b/tests/regression/d3q19-short/serial-chol-w02.log index 156befed2..aca0e2bf0 100644 --- a/tests/regression/d3q19-short/serial-chol-w02.log +++ b/tests/regression/d3q19-short/serial-chol-w02.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-w03.inp b/tests/regression/d3q19-short/serial-chol-w03.inp index d59063884..94cd075d7 100644 --- a/tests/regression/d3q19-short/serial-chol-w03.inp +++ b/tests/regression/d3q19-short/serial-chol-w03.inp @@ -14,7 +14,6 @@ N_cycles 2 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-w03.log b/tests/regression/d3q19-short/serial-chol-w03.log index 3df78e577..1aefa74cf 100644 --- a/tests/regression/d3q19-short/serial-chol-w03.log +++ b/tests/regression/d3q19-short/serial-chol-w03.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-w04.inp b/tests/regression/d3q19-short/serial-chol-w04.inp index a239f51fe..0a592761e 100644 --- a/tests/regression/d3q19-short/serial-chol-w04.inp +++ b/tests/regression/d3q19-short/serial-chol-w04.inp @@ -14,7 +14,6 @@ N_cycles 2 size 32_32_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-w04.log b/tests/regression/d3q19-short/serial-chol-w04.log index 23d6e83e0..a00f1f6dd 100644 --- a/tests/regression/d3q19-short/serial-chol-w04.log +++ b/tests/regression/d3q19-short/serial-chol-w04.log @@ -67,7 +67,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-w05.inp b/tests/regression/d3q19-short/serial-chol-w05.inp index eea80df97..3d85173d2 100644 --- a/tests/regression/d3q19-short/serial-chol-w05.inp +++ b/tests/regression/d3q19-short/serial-chol-w05.inp @@ -14,7 +14,6 @@ N_cycles 2 size 32_32_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-w05.log b/tests/regression/d3q19-short/serial-chol-w05.log index 99222886c..c56258d1b 100644 --- a/tests/regression/d3q19-short/serial-chol-w05.log +++ b/tests/regression/d3q19-short/serial-chol-w05.log @@ -67,7 +67,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-coll-st1.log b/tests/regression/d3q19-short/serial-coll-st1.log index 09f8e1ed9..8feaa5e2d 100644 --- a/tests/regression/d3q19-short/serial-coll-st1.log +++ b/tests/regression/d3q19-short/serial-coll-st1.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-dist-1dp.inp b/tests/regression/d3q19-short/serial-dist-1dp.inp index 5b1805348..4f0ce015b 100644 --- a/tests/regression/d3q19-short/serial-dist-1dp.inp +++ b/tests/regression/d3q19-short/serial-dist-1dp.inp @@ -14,7 +14,8 @@ N_cycles 10 size 32_32_32 grid 2_2_1 -reduced_halo yes + +lb_halo_scheme lb_halo_openmp_reduced ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-dist-1dp.log b/tests/regression/d3q19-short/serial-dist-1dp.log index 9634fa31a..15656581b 100644 --- a/tests/regression/d3q19-short/serial-dist-1dp.log +++ b/tests/regression/d3q19-short/serial-dist-1dp.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_openmp_reduced (host) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-dist-2kh.inp b/tests/regression/d3q19-short/serial-dist-2kh.inp index 03674f5cf..1f115f3fd 100644 --- a/tests/regression/d3q19-short/serial-dist-2kh.inp +++ b/tests/regression/d3q19-short/serial-dist-2kh.inp @@ -14,7 +14,8 @@ N_cycles 10 size 64_64_1 grid 2_2_1 -reduced_halo yes + +lb_halo_scheme lb_halo_openmp_reduced (host) ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-dist-2kh.log b/tests/regression/d3q19-short/serial-dist-2kh.log index 86838963f..625a9b2d8 100644 --- a/tests/regression/d3q19-short/serial-dist-2kh.log +++ b/tests/regression/d3q19-short/serial-dist-2kh.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_openmp_reduced (host) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-dist-2sw.inp b/tests/regression/d3q19-short/serial-dist-2sw.inp index 1b2dff5f5..14e6f9a1f 100644 --- a/tests/regression/d3q19-short/serial-dist-2sw.inp +++ b/tests/regression/d3q19-short/serial-dist-2sw.inp @@ -14,7 +14,8 @@ N_cycles 10 size 64_64_1 grid 2_2_1 -reduced_halo yes + +lb_halo_scheme lb_halo_openmp_reduced ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-dist-2sw.log b/tests/regression/d3q19-short/serial-dist-2sw.log index 30eddcb58..573f4695c 100644 --- a/tests/regression/d3q19-short/serial-dist-2sw.log +++ b/tests/regression/d3q19-short/serial-dist-2sw.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_openmp_reduced (host) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-dist-3du.inp b/tests/regression/d3q19-short/serial-dist-3du.inp index 0272fc2a6..adbb21c18 100644 --- a/tests/regression/d3q19-short/serial-dist-3du.inp +++ b/tests/regression/d3q19-short/serial-dist-3du.inp @@ -14,7 +14,8 @@ N_cycles 10 size 32_32_32 grid 2_2_1 -reduced_halo yes + +lb_halo_scheme lb_halo_openmp_reduced ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-dist-3du.log b/tests/regression/d3q19-short/serial-dist-3du.log index 32e0aca3b..92aef24a2 100644 --- a/tests/regression/d3q19-short/serial-dist-3du.log +++ b/tests/regression/d3q19-short/serial-dist-3du.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_openmp_reduced (host) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-drop-lc1.log b/tests/regression/d3q19-short/serial-drop-lc1.log index 7d1a94e2d..2a4f29b9f 100644 --- a/tests/regression/d3q19-short/serial-drop-lc1.log +++ b/tests/regression/d3q19-short/serial-drop-lc1.log @@ -77,7 +77,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-drop-lc2.log b/tests/regression/d3q19-short/serial-drop-lc2.log index b4fd5da84..14fa3ff70 100644 --- a/tests/regression/d3q19-short/serial-drop-lc2.log +++ b/tests/regression/d3q19-short/serial-drop-lc2.log @@ -77,7 +77,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-drop-lc3.inp b/tests/regression/d3q19-short/serial-drop-lc3.inp index df6474162..474e453bc 100644 --- a/tests/regression/d3q19-short/serial-drop-lc3.inp +++ b/tests/regression/d3q19-short/serial-drop-lc3.inp @@ -110,7 +110,6 @@ N_cycles 2 ############################################################################## size 64_64_64 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-drop-lc3.log b/tests/regression/d3q19-short/serial-drop-lc3.log index b1ccab785..ecacb8fc6 100644 --- a/tests/regression/d3q19-short/serial-drop-lc3.log +++ b/tests/regression/d3q19-short/serial-drop-lc3.log @@ -84,7 +84,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-drop-lc4.inp b/tests/regression/d3q19-short/serial-drop-lc4.inp index 0492eba45..1c4b2be8a 100644 --- a/tests/regression/d3q19-short/serial-drop-lc4.inp +++ b/tests/regression/d3q19-short/serial-drop-lc4.inp @@ -47,7 +47,6 @@ N_cycles 10 ############################################################################## size 32_32_32 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-drop-lc4.log b/tests/regression/d3q19-short/serial-drop-lc4.log index e08dc0ab5..70485701b 100644 --- a/tests/regression/d3q19-short/serial-drop-lc4.log +++ b/tests/regression/d3q19-short/serial-drop-lc4.log @@ -78,7 +78,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-drop-lc5.inp b/tests/regression/d3q19-short/serial-drop-lc5.inp index 54c6c7bc6..32b9e10cb 100644 --- a/tests/regression/d3q19-short/serial-drop-lc5.inp +++ b/tests/regression/d3q19-short/serial-drop-lc5.inp @@ -59,7 +59,6 @@ N_cycles 10 ############################################################################## size 32_32_32 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-drop-lc5.log b/tests/regression/d3q19-short/serial-drop-lc5.log index 86f4cf127..09b9a2388 100644 --- a/tests/regression/d3q19-short/serial-drop-lc5.log +++ b/tests/regression/d3q19-short/serial-drop-lc5.log @@ -78,7 +78,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-ewld-s01.log b/tests/regression/d3q19-short/serial-ewld-s01.log index d9348c18b..b4fd85218 100644 --- a/tests/regression/d3q19-short/serial-ewld-s01.log +++ b/tests/regression/d3q19-short/serial-ewld-s01.log @@ -38,7 +38,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-fene-st1.inp b/tests/regression/d3q19-short/serial-fene-st1.inp index 9f3d80a95..dfcc9cb29 100644 --- a/tests/regression/d3q19-short/serial-fene-st1.inp +++ b/tests/regression/d3q19-short/serial-fene-st1.inp @@ -15,7 +15,6 @@ N_cycles 20 ############################################################################## size 16_16_16 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-fene-st1.log b/tests/regression/d3q19-short/serial-fene-st1.log index d62af1769..401de1ba6 100644 --- a/tests/regression/d3q19-short/serial-fene-st1.log +++ b/tests/regression/d3q19-short/serial-fene-st1.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-fene-st2.inp b/tests/regression/d3q19-short/serial-fene-st2.inp index ad8cd362b..402ee1483 100644 --- a/tests/regression/d3q19-short/serial-fene-st2.inp +++ b/tests/regression/d3q19-short/serial-fene-st2.inp @@ -15,7 +15,6 @@ N_cycles 20 ############################################################################## size 16_16_16 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-fene-st2.log b/tests/regression/d3q19-short/serial-fene-st2.log index 20d901e9a..1d3607bc2 100644 --- a/tests/regression/d3q19-short/serial-fene-st2.log +++ b/tests/regression/d3q19-short/serial-fene-st2.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-fene-st3.inp b/tests/regression/d3q19-short/serial-fene-st3.inp index af6277dee..63a52543c 100644 --- a/tests/regression/d3q19-short/serial-fene-st3.inp +++ b/tests/regression/d3q19-short/serial-fene-st3.inp @@ -15,7 +15,6 @@ N_cycles 20 ############################################################################## size 16_16_16 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-fene-st3.log b/tests/regression/d3q19-short/serial-fene-st3.log index 3681fdc12..d447caa4b 100644 --- a/tests/regression/d3q19-short/serial-fene-st3.log +++ b/tests/regression/d3q19-short/serial-fene-st3.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-bp1.log b/tests/regression/d3q19-short/serial-init-bp1.log index 2ecb8c6f2..f0ffa37c7 100644 --- a/tests/regression/d3q19-short/serial-init-bp1.log +++ b/tests/regression/d3q19-short/serial-init-bp1.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-bp2.log b/tests/regression/d3q19-short/serial-init-bp2.log index d12e4306b..dd9a193f6 100644 --- a/tests/regression/d3q19-short/serial-init-bp2.log +++ b/tests/regression/d3q19-short/serial-init-bp2.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-br1.log b/tests/regression/d3q19-short/serial-init-br1.log index d604da5d3..068d82acc 100644 --- a/tests/regression/d3q19-short/serial-init-br1.log +++ b/tests/regression/d3q19-short/serial-init-br1.log @@ -61,7 +61,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-br2.log b/tests/regression/d3q19-short/serial-init-br2.log index ad1ea27fc..12620c991 100644 --- a/tests/regression/d3q19-short/serial-init-br2.log +++ b/tests/regression/d3q19-short/serial-init-br2.log @@ -61,7 +61,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-lcb.log b/tests/regression/d3q19-short/serial-init-lcb.log index 5371a417c..3f834a5e1 100644 --- a/tests/regression/d3q19-short/serial-init-lcb.log +++ b/tests/regression/d3q19-short/serial-init-lcb.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-lcr.log b/tests/regression/d3q19-short/serial-init-lcr.log index 4fba55816..f6baf7840 100644 --- a/tests/regression/d3q19-short/serial-init-lcr.log +++ b/tests/regression/d3q19-short/serial-init-lcr.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le2d-fd1.log b/tests/regression/d3q19-short/serial-le2d-fd1.log index f0f4b0258..1fcd21aa5 100644 --- a/tests/regression/d3q19-short/serial-le2d-fd1.log +++ b/tests/regression/d3q19-short/serial-le2d-fd1.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le2d-fd2.log b/tests/regression/d3q19-short/serial-le2d-fd2.log index 39ff35681..434f73cba 100644 --- a/tests/regression/d3q19-short/serial-le2d-fd2.log +++ b/tests/regression/d3q19-short/serial-le2d-fd2.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le2d-lb1.log b/tests/regression/d3q19-short/serial-le2d-lb1.log index 8f2fe6ac3..53c82b930 100644 --- a/tests/regression/d3q19-short/serial-le2d-lb1.log +++ b/tests/regression/d3q19-short/serial-le2d-lb1.log @@ -59,7 +59,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 2 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st1.log b/tests/regression/d3q19-short/serial-le3d-st1.log index f1b2a8653..9495344b6 100644 --- a/tests/regression/d3q19-short/serial-le3d-st1.log +++ b/tests/regression/d3q19-short/serial-le3d-st1.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st2.log b/tests/regression/d3q19-short/serial-le3d-st2.log index bd4c28416..c750b6e5e 100644 --- a/tests/regression/d3q19-short/serial-le3d-st2.log +++ b/tests/regression/d3q19-short/serial-le3d-st2.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st3.log b/tests/regression/d3q19-short/serial-le3d-st3.log index 18b8ce593..3d4ac8493 100644 --- a/tests/regression/d3q19-short/serial-le3d-st3.log +++ b/tests/regression/d3q19-short/serial-le3d-st3.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st4.log b/tests/regression/d3q19-short/serial-le3d-st4.log index 03aabd4c2..9a0b95863 100644 --- a/tests/regression/d3q19-short/serial-le3d-st4.log +++ b/tests/regression/d3q19-short/serial-le3d-st4.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st5.log b/tests/regression/d3q19-short/serial-le3d-st5.log index ddb2b479b..26d4cfd3b 100644 --- a/tests/regression/d3q19-short/serial-le3d-st5.log +++ b/tests/regression/d3q19-short/serial-le3d-st5.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st6.log b/tests/regression/d3q19-short/serial-le3d-st6.log index c7448f56f..9dc35fc07 100644 --- a/tests/regression/d3q19-short/serial-le3d-st6.log +++ b/tests/regression/d3q19-short/serial-le3d-st6.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st7.log b/tests/regression/d3q19-short/serial-le3d-st7.log index db70f9443..c74fa4509 100644 --- a/tests/regression/d3q19-short/serial-le3d-st7.log +++ b/tests/regression/d3q19-short/serial-le3d-st7.log @@ -60,7 +60,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st8.log b/tests/regression/d3q19-short/serial-le3d-st8.log index 6cd275880..2a7afb620 100644 --- a/tests/regression/d3q19-short/serial-le3d-st8.log +++ b/tests/regression/d3q19-short/serial-le3d-st8.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-muex-st1.log b/tests/regression/d3q19-short/serial-muex-st1.log index 8ff320528..d544e9578 100644 --- a/tests/regression/d3q19-short/serial-muex-st1.log +++ b/tests/regression/d3q19-short/serial-muex-st1.log @@ -56,7 +56,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-open-ru1.log b/tests/regression/d3q19-short/serial-open-ru1.log index d5f69266e..3d4cca95a 100644 --- a/tests/regression/d3q19-short/serial-open-ru1.log +++ b/tests/regression/d3q19-short/serial-open-ru1.log @@ -39,7 +39,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-open-ru2.log b/tests/regression/d3q19-short/serial-open-ru2.log index ac243a575..fdc0463aa 100644 --- a/tests/regression/d3q19-short/serial-open-ru2.log +++ b/tests/regression/d3q19-short/serial-open-ru2.log @@ -39,7 +39,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-pola-r01.inp b/tests/regression/d3q19-short/serial-pola-r01.inp index 715566919..4caa91aee 100644 --- a/tests/regression/d3q19-short/serial-pola-r01.inp +++ b/tests/regression/d3q19-short/serial-pola-r01.inp @@ -21,7 +21,6 @@ N_cycles 10 size 64_64_64 grid 2_2_2 periodicity 1_1_1 -reduced_halo yes ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-pola-r01.log b/tests/regression/d3q19-short/serial-pola-r01.log index bc098a3bb..662e53bdb 100644 --- a/tests/regression/d3q19-short/serial-pola-r01.log +++ b/tests/regression/d3q19-short/serial-pola-r01.log @@ -52,7 +52,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-poly-st1.inp b/tests/regression/d3q19-short/serial-poly-st1.inp index fb932848b..f418ae623 100644 --- a/tests/regression/d3q19-short/serial-poly-st1.inp +++ b/tests/regression/d3q19-short/serial-poly-st1.inp @@ -19,7 +19,6 @@ N_cycles 100 size 18_18_18 grid 2_2_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-poly-st1.log b/tests/regression/d3q19-short/serial-poly-st1.log index 537abad4c..cf870f794 100644 --- a/tests/regression/d3q19-short/serial-poly-st1.log +++ b/tests/regression/d3q19-short/serial-poly-st1.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rect-ct1.inp b/tests/regression/d3q19-short/serial-rect-ct1.inp index 32c9742fe..605aa34fe 100644 --- a/tests/regression/d3q19-short/serial-rect-ct1.inp +++ b/tests/regression/d3q19-short/serial-rect-ct1.inp @@ -31,7 +31,7 @@ N_start 0 size 1_62_30 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rect-ct1.log b/tests/regression/d3q19-short/serial-rect-ct1.log index 2607cb4c5..de044713b 100644 --- a/tests/regression/d3q19-short/serial-rect-ct1.log +++ b/tests/regression/d3q19-short/serial-rect-ct1.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rect-ct2.inp b/tests/regression/d3q19-short/serial-rect-ct2.inp index 7ac1e1277..84f3d3093 100644 --- a/tests/regression/d3q19-short/serial-rect-ct2.inp +++ b/tests/regression/d3q19-short/serial-rect-ct2.inp @@ -20,7 +20,7 @@ N_start 0 size 1_62_30 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rect-ct2.log b/tests/regression/d3q19-short/serial-rect-ct2.log index eb73d8681..d8e93c5e1 100644 --- a/tests/regression/d3q19-short/serial-rect-ct2.log +++ b/tests/regression/d3q19-short/serial-rect-ct2.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rect-ct3.inp b/tests/regression/d3q19-short/serial-rect-ct3.inp index 004831d88..d2b8ed857 100644 --- a/tests/regression/d3q19-short/serial-rect-ct3.inp +++ b/tests/regression/d3q19-short/serial-rect-ct3.inp @@ -26,7 +26,7 @@ N_start 0 size 1_31_15 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rect-ct3.log b/tests/regression/d3q19-short/serial-rect-ct3.log index 3cd7554af..abfbe0dc0 100644 --- a/tests/regression/d3q19-short/serial-rect-ct3.log +++ b/tests/regression/d3q19-short/serial-rect-ct3.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rect-ct4.inp b/tests/regression/d3q19-short/serial-rect-ct4.inp index 760074c18..75fd03dbc 100644 --- a/tests/regression/d3q19-short/serial-rect-ct4.inp +++ b/tests/regression/d3q19-short/serial-rect-ct4.inp @@ -19,7 +19,7 @@ N_start 0 size 31_15_1 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rect-ct4.log b/tests/regression/d3q19-short/serial-rect-ct4.log index 021bfbe2c..b57bb799e 100644 --- a/tests/regression/d3q19-short/serial-rect-ct4.log +++ b/tests/regression/d3q19-short/serial-rect-ct4.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rect-ct5.inp b/tests/regression/d3q19-short/serial-rect-ct5.inp index 1101322df..abc9f9767 100644 --- a/tests/regression/d3q19-short/serial-rect-ct5.inp +++ b/tests/regression/d3q19-short/serial-rect-ct5.inp @@ -19,7 +19,7 @@ N_start 0 size 31_1_15 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rect-ct5.log b/tests/regression/d3q19-short/serial-rect-ct5.log index ffa7a686e..119ffb838 100644 --- a/tests/regression/d3q19-short/serial-rect-ct5.log +++ b/tests/regression/d3q19-short/serial-rect-ct5.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-relx-bp1.log b/tests/regression/d3q19-short/serial-relx-bp1.log index 4a8e8cdb7..aa06a361d 100644 --- a/tests/regression/d3q19-short/serial-relx-bp1.log +++ b/tests/regression/d3q19-short/serial-relx-bp1.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rest-c01.inp b/tests/regression/d3q19-short/serial-rest-c01.inp index 1da9853ef..cd788a06b 100644 --- a/tests/regression/d3q19-short/serial-rest-c01.inp +++ b/tests/regression/d3q19-short/serial-rest-c01.inp @@ -14,7 +14,7 @@ N_cycles 20 ############################################################################## size 64_64_64 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rest-c01.log b/tests/regression/d3q19-short/serial-rest-c01.log index 170d14456..8d9744c8d 100644 --- a/tests/regression/d3q19-short/serial-rest-c01.log +++ b/tests/regression/d3q19-short/serial-rest-c01.log @@ -38,7 +38,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rest-c02.inp b/tests/regression/d3q19-short/serial-rest-c02.inp index 805103f63..59ae44434 100644 --- a/tests/regression/d3q19-short/serial-rest-c02.inp +++ b/tests/regression/d3q19-short/serial-rest-c02.inp @@ -15,7 +15,7 @@ N_cycles 20 ############################################################################## size 64_64_64 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rest-c02.log b/tests/regression/d3q19-short/serial-rest-c02.log index beb6a5cb2..bfe9decec 100644 --- a/tests/regression/d3q19-short/serial-rest-c02.log +++ b/tests/regression/d3q19-short/serial-rest-c02.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-sgrd-st1.inp b/tests/regression/d3q19-short/serial-sgrd-st1.inp index a205c932e..2d9857027 100644 --- a/tests/regression/d3q19-short/serial-sgrd-st1.inp +++ b/tests/regression/d3q19-short/serial-sgrd-st1.inp @@ -16,7 +16,7 @@ N_cycles 2000 ############################################################################## size 16_16_16 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-sgrd-st1.log b/tests/regression/d3q19-short/serial-sgrd-st1.log index 948367d81..4883fbfc2 100644 --- a/tests/regression/d3q19-short/serial-sgrd-st1.log +++ b/tests/regression/d3q19-short/serial-sgrd-st1.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-sgrd-st2.inp b/tests/regression/d3q19-short/serial-sgrd-st2.inp index 0b795a9f3..6868742bb 100644 --- a/tests/regression/d3q19-short/serial-sgrd-st2.inp +++ b/tests/regression/d3q19-short/serial-sgrd-st2.inp @@ -15,7 +15,7 @@ N_cycles 2000 ############################################################################## size 16_16_16 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-sgrd-st2.log b/tests/regression/d3q19-short/serial-sgrd-st2.log index 3b221c183..fb64b084b 100644 --- a/tests/regression/d3q19-short/serial-sgrd-st2.log +++ b/tests/regression/d3q19-short/serial-sgrd-st2.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-c01.log b/tests/regression/d3q19-short/serial-spin-c01.log index 08159dfab..88d700c45 100644 --- a/tests/regression/d3q19-short/serial-spin-c01.log +++ b/tests/regression/d3q19-short/serial-spin-c01.log @@ -51,7 +51,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 2 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-c02.log b/tests/regression/d3q19-short/serial-spin-c02.log index 62736ea72..bae6c7e0e 100644 --- a/tests/regression/d3q19-short/serial-spin-c02.log +++ b/tests/regression/d3q19-short/serial-spin-c02.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-fd1.log b/tests/regression/d3q19-short/serial-spin-fd1.log index e054c6378..d0a24498a 100644 --- a/tests/regression/d3q19-short/serial-spin-fd1.log +++ b/tests/regression/d3q19-short/serial-spin-fd1.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-fd2.log b/tests/regression/d3q19-short/serial-spin-fd2.log index 0adc1b8fd..b51e96d63 100644 --- a/tests/regression/d3q19-short/serial-spin-fd2.log +++ b/tests/regression/d3q19-short/serial-spin-fd2.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-lb1.log b/tests/regression/d3q19-short/serial-spin-lb1.log index dc2ddd702..1f376c601 100644 --- a/tests/regression/d3q19-short/serial-spin-lb1.log +++ b/tests/regression/d3q19-short/serial-spin-lb1.log @@ -51,7 +51,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 2 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-lb2.log b/tests/regression/d3q19-short/serial-spin-lb2.log index dada75c63..60f21935b 100644 --- a/tests/regression/d3q19-short/serial-spin-lb2.log +++ b/tests/regression/d3q19-short/serial-spin-lb2.log @@ -46,7 +46,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 2 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-n01.log b/tests/regression/d3q19-short/serial-spin-n01.log index fc4e5bb06..7d8e9b8cd 100644 --- a/tests/regression/d3q19-short/serial-spin-n01.log +++ b/tests/regression/d3q19-short/serial-spin-n01.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-n02.log b/tests/regression/d3q19-short/serial-spin-n02.log index f4568785c..a8147dc8e 100644 --- a/tests/regression/d3q19-short/serial-spin-n02.log +++ b/tests/regression/d3q19-short/serial-spin-n02.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-sqmr-st1.inp b/tests/regression/d3q19-short/serial-sqmr-st1.inp index 67c8f3eff..408187b5a 100644 --- a/tests/regression/d3q19-short/serial-sqmr-st1.inp +++ b/tests/regression/d3q19-short/serial-sqmr-st1.inp @@ -14,7 +14,7 @@ N_cycles 50 size 32_32_32 grid 2_2_2 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-sqmr-st1.log b/tests/regression/d3q19-short/serial-sqmr-st1.log index 92c9f068a..210e831e7 100644 --- a/tests/regression/d3q19-short/serial-sqmr-st1.log +++ b/tests/regression/d3q19-short/serial-sqmr-st1.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-sqmr-st2.inp b/tests/regression/d3q19-short/serial-sqmr-st2.inp index 75b5ba56f..329dfd95c 100644 --- a/tests/regression/d3q19-short/serial-sqmr-st2.inp +++ b/tests/regression/d3q19-short/serial-sqmr-st2.inp @@ -14,7 +14,7 @@ N_cycles 50 size 32_32_32 grid 2_2_2 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-sqmr-st2.log b/tests/regression/d3q19-short/serial-sqmr-st2.log index c4a47f180..eb65c6aea 100644 --- a/tests/regression/d3q19-short/serial-sqmr-st2.log +++ b/tests/regression/d3q19-short/serial-sqmr-st2.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-ssij-01.inp b/tests/regression/d3q19-short/serial-ssij-01.inp index f53fe8e6b..aab605e07 100644 --- a/tests/regression/d3q19-short/serial-ssij-01.inp +++ b/tests/regression/d3q19-short/serial-ssij-01.inp @@ -15,7 +15,7 @@ N_cycles 10 ############################################################################## size 16_16_16 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-ssij-01.log b/tests/regression/d3q19-short/serial-ssij-01.log index 7efcc61a8..61f858e2f 100644 --- a/tests/regression/d3q19-short/serial-ssij-01.log +++ b/tests/regression/d3q19-short/serial-ssij-01.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-symm-dr1.log b/tests/regression/d3q19-short/serial-symm-dr1.log index 96e0f3edd..9eb09fae2 100644 --- a/tests/regression/d3q19-short/serial-symm-dr1.log +++ b/tests/regression/d3q19-short/serial-symm-dr1.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-symm-dr2.log b/tests/regression/d3q19-short/serial-symm-dr2.log index cdfef768e..7afd17608 100644 --- a/tests/regression/d3q19-short/serial-symm-dr2.log +++ b/tests/regression/d3q19-short/serial-symm-dr2.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-symm-pat.log b/tests/regression/d3q19-short/serial-symm-pat.log index 47bc41396..9b4a82f43 100644 --- a/tests/regression/d3q19-short/serial-symm-pat.log +++ b/tests/regression/d3q19-short/serial-symm-pat.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-tern-st1.log b/tests/regression/d3q19-short/serial-tern-st1.log index 99589511e..feb125024 100644 --- a/tests/regression/d3q19-short/serial-tern-st1.log +++ b/tests/regression/d3q19-short/serial-tern-st1.log @@ -60,7 +60,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-tern-st2.log b/tests/regression/d3q19-short/serial-tern-st2.log index f664445a4..c1cf4f0ba 100644 --- a/tests/regression/d3q19-short/serial-tern-st2.log +++ b/tests/regression/d3q19-short/serial-tern-st2.log @@ -60,7 +60,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-tern-st3.log b/tests/regression/d3q19-short/serial-tern-st3.log index 8cf2347fc..c6f81ec0a 100644 --- a/tests/regression/d3q19-short/serial-tern-st3.log +++ b/tests/regression/d3q19-short/serial-tern-st3.log @@ -60,7 +60,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-tern-st4.log b/tests/regression/d3q19-short/serial-tern-st4.log index 117163bc4..577a73dfd 100644 --- a/tests/regression/d3q19-short/serial-tern-st4.log +++ b/tests/regression/d3q19-short/serial-tern-st4.log @@ -68,7 +68,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-tern-st5.log b/tests/regression/d3q19-short/serial-tern-st5.log index 339a6ec68..8fc93fd7c 100644 --- a/tests/regression/d3q19-short/serial-tern-st5.log +++ b/tests/regression/d3q19-short/serial-tern-st5.log @@ -67,7 +67,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-wall-st1.log b/tests/regression/d3q19-short/serial-wall-st1.log index fa9cea046..9a9a60824 100644 --- a/tests/regression/d3q19-short/serial-wall-st1.log +++ b/tests/regression/d3q19-short/serial-wall-st1.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-wall-st2.inp b/tests/regression/d3q19-short/serial-wall-st2.inp index 0ab087bd1..e45365066 100644 --- a/tests/regression/d3q19-short/serial-wall-st2.inp +++ b/tests/regression/d3q19-short/serial-wall-st2.inp @@ -17,7 +17,7 @@ N_cycles 10 size 24_24_24 periodicity 0_0_0 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-wall-st2.log b/tests/regression/d3q19-short/serial-wall-st2.log index 7bb05bdd5..c699a4ed0 100644 --- a/tests/regression/d3q19-short/serial-wall-st2.log +++ b/tests/regression/d3q19-short/serial-wall-st2.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-wall-st3.inp b/tests/regression/d3q19-short/serial-wall-st3.inp index dbc96857f..4cbe7c795 100644 --- a/tests/regression/d3q19-short/serial-wall-st3.inp +++ b/tests/regression/d3q19-short/serial-wall-st3.inp @@ -17,7 +17,7 @@ N_cycles 10 size 24_24_24 periodicity 0_0_0 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-wall-st3.log b/tests/regression/d3q19-short/serial-wall-st3.log index c0703de6c..4117233da 100644 --- a/tests/regression/d3q19-short/serial-wall-st3.log +++ b/tests/regression/d3q19-short/serial-wall-st3.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-wall-st4.inp b/tests/regression/d3q19-short/serial-wall-st4.inp index 00a9b603a..cdc1ff434 100644 --- a/tests/regression/d3q19-short/serial-wall-st4.inp +++ b/tests/regression/d3q19-short/serial-wall-st4.inp @@ -17,7 +17,7 @@ N_cycles 10 size 24_24_24 periodicity 0_0_0 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-wall-st4.log b/tests/regression/d3q19-short/serial-wall-st4.log index 79ffbf84c..7ff924399 100644 --- a/tests/regression/d3q19-short/serial-wall-st4.log +++ b/tests/regression/d3q19-short/serial-wall-st4.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-wall-st5.inp b/tests/regression/d3q19-short/serial-wall-st5.inp index ed112730d..a852eb229 100644 --- a/tests/regression/d3q19-short/serial-wall-st5.inp +++ b/tests/regression/d3q19-short/serial-wall-st5.inp @@ -16,7 +16,6 @@ N_cycles 10 size 24_24_24 periodicity 0_0_0 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-wall-st5.log b/tests/regression/d3q19-short/serial-wall-st5.log index 186f0c7e8..2222367fe 100644 --- a/tests/regression/d3q19-short/serial-wall-st5.log +++ b/tests/regression/d3q19-short/serial-wall-st5.log @@ -39,7 +39,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19/long08-le3d-fd1.inp b/tests/regression/d3q19/long08-le3d-fd1.inp index 68c9ad361..638ccff43 100644 --- a/tests/regression/d3q19/long08-le3d-fd1.inp +++ b/tests/regression/d3q19/long08-le3d-fd1.inp @@ -59,7 +59,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-chol-s01.inp b/tests/regression/d3q19/pmpi08-chol-s01.inp index 48ff1910a..ca1ed714d 100644 --- a/tests/regression/d3q19/pmpi08-chol-s01.inp +++ b/tests/regression/d3q19/pmpi08-chol-s01.inp @@ -52,12 +52,10 @@ lc_kappa1 0.000648456 lc_xi 0.7 lc_Gamma 0.5 -lc_active_zeta 0.0 lc_q_initialisation twist lc_q_init_amplitude 0.333333333333333 lc_init_redshift 1.0 -lc_init_nematic 1.0_0.0_0.0 lc_anchoring_method two lc_wall_anchoring normal @@ -78,7 +76,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-le2d-fd1.inp b/tests/regression/d3q19/pmpi08-le2d-fd1.inp index a65664427..0372e96ce 100644 --- a/tests/regression/d3q19/pmpi08-le2d-fd1.inp +++ b/tests/regression/d3q19/pmpi08-le2d-fd1.inp @@ -42,7 +42,6 @@ free_energy symmetric A -0.0625 B 0.0625 K 0.04 -C 0.000 phi0 0.0 phi_initialisation spinodal @@ -65,7 +64,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-le2d-fd2.inp b/tests/regression/d3q19/pmpi08-le2d-fd2.inp index 8b706e6c9..9b6013187 100644 --- a/tests/regression/d3q19/pmpi08-le2d-fd2.inp +++ b/tests/regression/d3q19/pmpi08-le2d-fd2.inp @@ -68,7 +68,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-le2d-lb1.inp b/tests/regression/d3q19/pmpi08-le2d-lb1.inp index 3926ce976..2ae4d1b3f 100644 --- a/tests/regression/d3q19/pmpi08-le2d-lb1.inp +++ b/tests/regression/d3q19/pmpi08-le2d-lb1.inp @@ -43,7 +43,6 @@ free_energy symmetric_lb A -0.0625 B 0.0625 K 0.04 -C 0.000 phi0 0.0 phi_initialisation spinodal @@ -65,7 +64,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-le3d-fd1.inp b/tests/regression/d3q19/pmpi08-le3d-fd1.inp index 7f122acdc..fbdb2349d 100644 --- a/tests/regression/d3q19/pmpi08-le3d-fd1.inp +++ b/tests/regression/d3q19/pmpi08-le3d-fd1.inp @@ -35,7 +35,6 @@ free_energy symmetric A -0.0625 B 0.0625 K 0.04 -C 0.000 phi0 0.0 phi_initialisation spinodal @@ -58,7 +57,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-le3d-lb1.inp b/tests/regression/d3q19/pmpi08-le3d-lb1.inp index e57458082..218699a16 100644 --- a/tests/regression/d3q19/pmpi08-le3d-lb1.inp +++ b/tests/regression/d3q19/pmpi08-le3d-lb1.inp @@ -42,7 +42,6 @@ free_energy symmetric_lb A -0.0625 B 0.0625 K 0.04 -C 0.0 phi0 0.0 fd_gradient_calculation 3d_27pt_fluid @@ -63,7 +62,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/unit/test_assumptions.c b/tests/unit/test_assumptions.c index fd607361e..5a51cb7d5 100644 --- a/tests/unit/test_assumptions.c +++ b/tests/unit/test_assumptions.c @@ -42,7 +42,7 @@ int test_macro_abuse(void); int test_assumptions_suite(void) { double pi; - char s0[BUFSIZ] = {}; + char s0[BUFSIZ] = {0}; char s1[BUFSIZ] = {0}; PI_DOUBLE(pi_); diff --git a/tests/unit/test_blue_phase.c b/tests/unit/test_blue_phase.c index fc8c41026..3fc20d8ba 100644 --- a/tests/unit/test_blue_phase.c +++ b/tests/unit/test_blue_phase.c @@ -247,7 +247,7 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, * so an exhaustive test is probably not worth while. */ { - double angles[3] = {}; /* No rotation. */ + double angles[3] = {0}; /* No rotation. */ blue_phase_O8M_init(cs, ¶m, fq, angles); } @@ -682,9 +682,9 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, * to test the decomposition into bulk and gradient parts */ { - double sfull[3][3] = {}; - double sbulk[3][3] = {}; - double sgrad[3][3] = {}; + double sfull[3][3] = {0}; + double sbulk[3][3] = {0}; + double sgrad[3][3] = {0}; ic = 1; jc = 1; kc = 1; @@ -703,9 +703,9 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, } { - double sfull[3][3] = {}; - double sbulk[3][3] = {}; - double sgrad[3][3] = {}; + double sfull[3][3] = {0}; + double sbulk[3][3] = {0}; + double sgrad[3][3] = {0}; ic = 1; jc = 1; kc = 2; @@ -724,9 +724,9 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, } { - double sfull[3][3] = {}; - double sbulk[3][3] = {}; - double sgrad[3][3] = {}; + double sfull[3][3] = {0}; + double sbulk[3][3] = {0}; + double sgrad[3][3] = {0}; ic = 1; jc = 1; kc = 3; @@ -745,9 +745,9 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, } { - double sfull[3][3] = {}; - double sbulk[3][3] = {}; - double sgrad[3][3] = {}; + double sfull[3][3] = {0}; + double sbulk[3][3] = {0}; + double sgrad[3][3] = {0}; ic = 1; jc = 12; kc = 4; @@ -766,9 +766,9 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, } { - double sfull[3][3] = {}; - double sbulk[3][3] = {}; - double sgrad[3][3] = {}; + double sfull[3][3] = {0}; + double sbulk[3][3] = {0}; + double sgrad[3][3] = {0}; ic = 2; jc = 6; kc = 7; diff --git a/tests/unit/test_build.c b/tests/unit/test_build.c index 99b0f5ca5..626fc3fff 100644 --- a/tests/unit/test_build.c +++ b/tests/unit/test_build.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2013-2017 The University of Edinburgh + * (c) 2013-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -110,7 +110,7 @@ static int test_build_links_model_c1(pe_t * pe, cs_t * cs, int nvel, int ncell[3] = {2, 2, 2}; map_t * map = NULL; - lb_model_t model = {}; + lb_model_t model = {0}; colloid_t * pc = NULL; colloids_info_t * cinfo = NULL; @@ -173,7 +173,7 @@ static int test_build_links_model_c2(pe_t * pe, cs_t * cs, int nvel, int ncell[3] = {4, 4, 4}; map_t * map = NULL; - lb_model_t model = {}; + lb_model_t model = {0}; colloid_t * pc = NULL; colloids_info_t * cinfo = NULL; @@ -246,7 +246,7 @@ static int test_build_rebuild_c1(pe_t * pe, cs_t * cs, int nvel, int ncell[3] = {2, 2, 2}; map_t * map = NULL; - lb_model_t model = {}; + lb_model_t model = {0}; colloid_t * pc = NULL; colloids_info_t * cinfo = NULL; diff --git a/tests/unit/test_fe_lc_droplet.c b/tests/unit/test_fe_lc_droplet.c index 62eff719a..fe95b2d23 100644 --- a/tests/unit/test_fe_lc_droplet.c +++ b/tests/unit/test_fe_lc_droplet.c @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -65,8 +65,8 @@ __host__ int test_fe_lc_droplet_active_stress(pe_t * pe) { double phi = 1.0; fe_lc_droplet_param_t fp = {.zeta0 = zeta0, .zeta1 = zeta1}; - double q[3][3] = {}; - double s[3][3] = {}; + double q[3][3] = {0}; + double s[3][3] = {0}; fe_lc_droplet_active_stress(&fp, phi, q, s); @@ -92,7 +92,7 @@ __host__ int test_fe_lc_droplet_active_stress(pe_t * pe) { fe_lc_droplet_param_t fp = {.zeta0 = zeta0, .zeta1 = zeta1}; double q[3][3] = { {1., 2., 3.,}, {2., 4., 5.}, {3., 5., -3.} }; - double s[3][3] = {}; + double s[3][3] = {0}; fe_lc_droplet_active_stress(&fp, phi, q, s); @@ -117,7 +117,7 @@ __host__ int test_fe_lc_droplet_active_stress(pe_t * pe) { fe_lc_droplet_param_t fp = {.zeta0 = zeta0, .zeta1 = zeta1}; double q[3][3] = { {1., 1., 1.,}, {1., 1., 1.}, {1., 1., 1.} }; - double s[3][3] = {}; + double s[3][3] = {0}; double phi = -1.0; diff --git a/tests/unit/test_fe_surfactant1.c b/tests/unit/test_fe_surfactant1.c index 06d0943fd..cf681c51c 100644 --- a/tests/unit/test_fe_surfactant1.c +++ b/tests/unit/test_fe_surfactant1.c @@ -182,7 +182,6 @@ __host__ int test_fe_surf_fed(pe_t * pe, cs_t * cs, field_t * phi) { int index = 0; double psi, phisq, phipsi[2]; double fed, fedref; - double dphiref[2][3]; field_grad_t * dphi = NULL; fe_surf_t * fe = NULL; @@ -218,12 +217,15 @@ __host__ int test_fe_surf_fed(pe_t * pe, cs_t * cs, field_t * phi) { /* Interface: gradient in phi */ - dphiref[0][X] = 0.1; dphiref[0][Y] = 0.0; dphiref[0][Z] = 0.0; - field_grad_pair_grad_set(dphi, index, dphiref); + { + const double dphiref[2][3] = {{0.1,0.0,0.0}, {0.0,0.0,0.0}}; - fe_surf_fed(fe, index, &fed); - fedref += 0.5*(pref.kappa - pref.epsilon*psi)*dphiref[0][X]*dphiref[0][X]; - assert(fabs(fed - fedref) < TEST_DOUBLE_TOLERANCE); + field_grad_pair_grad_set(dphi, index, dphiref); + + fe_surf_fed(fe, index, &fed); + fedref += 0.5*(pref.kappa - pref.epsilon*psi)*dphiref[0][X]*dphiref[0][X]; + assert(fabs(fed - fedref) < TEST_DOUBLE_TOLERANCE); + } fe_surf_free(fe); field_grad_free(dphi); @@ -242,7 +244,7 @@ __host__ int test_fe_surf_mu(pe_t * pe, cs_t * cs, field_t * phi) { int index = 1; double psi, phisq; double phipsi[2]; - double dpref[2][3], dsq[2]; + double dsq[2]; double muref, mu[2]; field_grad_t * dphi = NULL; @@ -269,41 +271,43 @@ __host__ int test_fe_surf_mu(pe_t * pe, cs_t * cs, field_t * phi) { test_assert(fabs(mu[1] - muref) < TEST_DOUBLE_TOLERANCE); /* Gradients phi */ - dpref[0][X] = 0.0; dpref[0][Y] = 0.1; dpref[0][Z] = 0.0; - dpref[1][X] = 0.0; dpref[1][Y] = 0.0; dpref[1][Z] = 0.0; - dsq[0] = 0.0; dsq[1] = 0.0; + { + const double dpref[2][3] = {{0.0,0.1,0.0}, {0.0,0.0,0.0}}; + dsq[0] = 0.0; dsq[1] = 0.0; - field_grad_pair_grad_set(dphi, index, dpref); - field_grad_pair_delsq_set(dphi, index, dsq); + field_grad_pair_grad_set(dphi, index, dpref); + field_grad_pair_delsq_set(dphi, index, dsq); - fe_surf_mu(fe, index, mu); + fe_surf_mu(fe, index, mu); - muref = (pref.a + pref.b*phisq + pref.w*psi)*phipsi[0]; - test_assert(fabs(mu[0] - muref) < TEST_DOUBLE_TOLERANCE); + muref = (pref.a + pref.b*phisq + pref.w*psi)*phipsi[0]; + test_assert(fabs(mu[0] - muref) < TEST_DOUBLE_TOLERANCE); - muref = pref.kt*(log(psi) - log(1.0-psi)) + 0.5*pref.w*phisq - - 0.5*pref.epsilon*dpref[0][Y]*dpref[0][Y]; - test_assert(fabs(mu[1] - muref) < TEST_DOUBLE_TOLERANCE); + muref = pref.kt*(log(psi) - log(1.0-psi)) + 0.5*pref.w*phisq + - 0.5*pref.epsilon*dpref[0][Y]*dpref[0][Y]; + test_assert(fabs(mu[1] - muref) < TEST_DOUBLE_TOLERANCE); + } /* Gradients phi, psi */ - dpref[0][X] = 0.0; dpref[0][Y] = 0.1; dpref[0][Z] = 0.0; - dpref[1][X] = 0.2; dpref[1][Y] = 0.3; dpref[1][Z] = 0.0; - dsq[0] = 0.0; dsq[1] = 0.0; + { + const double dpref[2][3] = {{0.0,0.1,0.0}, {0.2,0.3,0.0}}; + dsq[0] = 0.0; dsq[1] = 0.0; - field_grad_pair_grad_set(dphi, index, dpref); - field_grad_pair_delsq_set(dphi, index, dsq); + field_grad_pair_grad_set(dphi, index, dpref); + field_grad_pair_delsq_set(dphi, index, dsq); - fe_surf_mu(fe, index, mu); + fe_surf_mu(fe, index, mu); - muref = (pref.a + pref.b*phisq + pref.w*psi)*phipsi[0] - + pref.epsilon*dpref[0][Y]*dpref[1][Y]; - test_assert(fabs(mu[0] - muref) < TEST_DOUBLE_TOLERANCE); + muref = (pref.a + pref.b*phisq + pref.w*psi)*phipsi[0] + + pref.epsilon*dpref[0][Y]*dpref[1][Y]; + test_assert(fabs(mu[0] - muref) < TEST_DOUBLE_TOLERANCE); - muref = pref.kt*(log(psi) - log(1.0-psi)) + 0.5*pref.w*phisq - - 0.5*pref.epsilon*dpref[0][Y]*dpref[0][Y]; - test_assert(fabs(mu[1] - muref) < TEST_DOUBLE_TOLERANCE); + muref = pref.kt*(log(psi) - log(1.0-psi)) + 0.5*pref.w*phisq + - 0.5*pref.epsilon*dpref[0][Y]*dpref[0][Y]; + test_assert(fabs(mu[1] - muref) < TEST_DOUBLE_TOLERANCE); + } fe_surf_free(fe); field_grad_free(dphi); diff --git a/tests/unit/test_fe_ternary.c b/tests/unit/test_fe_ternary.c index 419c78e98..46d367550 100644 --- a/tests/unit/test_fe_ternary.c +++ b/tests/unit/test_fe_ternary.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Phsyics Group and * Edinburgh Parallel Computing Centre * - * (c) 2019 The University of Edinburgh + * (c) 2019-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -127,7 +127,7 @@ __host__ int test_fe_ternary_fed(pe_t * pe, cs_t * cs, field_t * phi) { int index = 1; double phi0[2] = {-0.3, 0.7}; - double grad[2][3] = {{0.1, -0.2, 0.3}, {-0.4, 0.5, -0.7}}; + const double grad[2][3] = {{0.1, -0.2, 0.3}, {-0.4, 0.5, -0.7}}; double fed; assert(pe); @@ -169,7 +169,7 @@ __host__ int test_fe_ternary_mu(pe_t * pe, cs_t * cs, field_t * phi) { int index = 1; double phi0[2] = {-0.3, 0.7}; - double d2phi[2] = {0.1, 0.4}; + const double d2phi[2] = {0.1, 0.4}; double mu[3]; assert(pe); @@ -216,7 +216,7 @@ __host__ int test_fe_ternary_str(pe_t * pe, cs_t * cs, field_t * phi) { int index = 1; double phi0[2] = {-0.3, 0.7}; double d2phi[2] = {0.1, 0.4}; - double grad[2][3] = {{0.1, -0.2, 0.3}, {-0.4, 0.5, -0.7}}; + const double grad[2][3] = {{0.1, -0.2, 0.3}, {-0.4, 0.5, -0.7}}; double s[3][3]; assert(pe); diff --git a/tests/unit/test_field.c b/tests/unit/test_field.c index dfa4cf50a..6660cb62c 100644 --- a/tests/unit/test_field.c +++ b/tests/unit/test_field.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -453,7 +453,7 @@ int test_field_halo_create(pe_t * pe) { field_t * field = NULL; field_options_t opts = field_options_default(); - field_halo_t h = {}; + field_halo_t h = {0}; { int nhalo = 2; diff --git a/tests/unit/test_halo.c b/tests/unit/test_halo.c index 03ea35328..6354ef64c 100644 --- a/tests/unit/test_halo.c +++ b/tests/unit/test_halo.c @@ -27,9 +27,9 @@ #include "control.h" #include "tests.h" -int do_test_const_blocks(void); -int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo); -int do_test_halo(pe_t * pe, cs_t * cs, int dim, const lb_halo_enum_t halo); +int test_lb_halo1(pe_t * pe, cs_t * cs, int ndim, int nvel); +int do_test_halo_null(pe_t * pe, cs_t * cs, const lb_data_options_t * opts); +int do_test_halo(pe_t * pe, cs_t * cs, int dim, const lb_data_options_t * opts); /***************************************************************************** * @@ -46,21 +46,12 @@ int test_halo_suite(void) { cs_create(pe, &cs); cs_init(cs); - do_test_const_blocks(); - - do_test_halo_null(pe, cs, LB_HALO_FULL); - do_test_halo_null(pe, cs, LB_HALO_REDUCED); - - do_test_halo(pe, cs, X, LB_HALO_FULL); - do_test_halo(pe, cs, Y, LB_HALO_FULL); - do_test_halo(pe, cs, Z, LB_HALO_FULL); - - if (pe_mpi_size(pe) == 1) { - do_test_halo(pe, cs, X, LB_HALO_REDUCED); - do_test_halo(pe, cs, Y, LB_HALO_REDUCED); - do_test_halo(pe, cs, Z, LB_HALO_REDUCED); - } - + /* Use a 2d system for ndim = 2, nvel = 9 */ + test_lb_halo1(pe, cs, 3, 15); + pe_info(pe, "PASS ./unit/test_halo 15\n"); + test_lb_halo1(pe, cs, 3, 19); + pe_info(pe, "PASS ./unit/test_halo 19\n"); + test_lb_halo1(pe, cs, 3, 27); pe_info(pe, "PASS ./unit/test_halo\n"); cs_free(cs); @@ -69,32 +60,47 @@ int test_halo_suite(void) { return 0; } -int do_test_const_blocks(void) { +/***************************************************************************** + * + * test_lb_halo + * + *****************************************************************************/ -#ifdef TEST_TO_BE_REMOVED_WITH_GLOBAL_SYMBOLS - int i, k; +int test_lb_halo1(pe_t * pe, cs_t * cs, int ndim, int nvel) { - for (i = 0; i < CVXBLOCK; i++) { - for (k = 0; k < xblocklen_cv[i]; k++) { - test_assert(cv[xdisp_fwd_cv[i] + k][X] == +1); - test_assert(cv[xdisp_bwd_cv[i] + k][X] == -1); - } - } + lb_data_options_t opts = lb_data_options_default(); - for (i = 0; i < CVYBLOCK; i++) { - for (k = 0; k < yblocklen_cv[i]; k++) { - test_assert(cv[ydisp_fwd_cv[i] + k][Y] == +1); - test_assert(cv[ydisp_bwd_cv[i] + k][Y] == -1); - } - } + opts.ndim = ndim; + opts.nvel = nvel; + opts.ndist = 1; + opts.halo = LB_HALO_TARGET; + + do_test_halo_null(pe, cs, &opts); + do_test_halo(pe, cs, X, &opts); + do_test_halo(pe, cs, Y, &opts); + do_test_halo(pe, cs, Z, &opts); + + opts.ndist = 1; + opts.halo = LB_HALO_OPENMP_FULL; + + do_test_halo_null(pe, cs, &opts); + do_test_halo(pe, cs, X, &opts); + do_test_halo(pe, cs, Y, &opts); + do_test_halo(pe, cs, Z, &opts); + + opts.ndist = 1; + opts.halo = LB_HALO_OPENMP_REDUCED; + + do_test_halo_null(pe, cs, &opts); + + opts.ndist = 2; + opts.halo = LB_HALO_TARGET; + + do_test_halo_null(pe, cs, &opts); + do_test_halo(pe, cs, X, &opts); + do_test_halo(pe, cs, Y, &opts); + do_test_halo(pe, cs, Z, &opts); - for (i = 0; i < CVZBLOCK; i++) { - for (k = 0; k < zblocklen_cv[i]; k++) { - test_assert(cv[zdisp_fwd_cv[i] + k][Z] == +1); - test_assert(cv[zdisp_bwd_cv[i] + k][Z] == -1); - } - } -#endif return 0; } @@ -107,35 +113,25 @@ int do_test_const_blocks(void) { * *****************************************************************************/ -int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { +int do_test_halo_null(pe_t * pe, cs_t * cs, const lb_data_options_t * opts) { int nlocal[3], n[3]; int index, nd, p; - int ndist = 2; - int rank; int nhalo; int nextra; double f_actual; - MPI_Comm comm = MPI_COMM_WORLD; lb_t * lb = NULL; assert(pe); assert(cs); + assert(opts); cs_nhalo(cs, &nhalo); nextra = nhalo - 1; - MPI_Comm_rank(comm, &rank); + lb_data_create(pe, cs, opts, &lb); - { - lb_data_options_t options = lb_data_options_default(); - options.ndim = NDIM; - options.nvel = NVEL; - options.ndist = ndist; - lb_data_create(pe, cs, &options, &lb); - lb_halo_set(lb, halo); - } cs_nlocal(cs, nlocal); /* Set entire distribution (all sites including halos) to 1.0 */ @@ -146,7 +142,7 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { index = cs_index(cs, n[X], n[Y], n[Z]); - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (p = 0; p < lb->model.nvel; p++) { lb_f_set(lb, index, p, nd, 1.0); } @@ -164,7 +160,7 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { index = cs_index(cs, n[X], n[Y], n[Z]); - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (p = 0; p < lb->model.nvel; p++) { lb_f_set(lb, index, p, nd, 0.0); } @@ -186,7 +182,7 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { index = cs_index(cs, n[X], n[Y], n[Z]); - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (p = 0; p < lb->model.nvel; p++) { lb_f(lb, index, p, nd, &f_actual); @@ -215,7 +211,7 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { * *****************************************************************************/ -int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { +int do_test_halo(pe_t * pe, cs_t * cs, int dim, const lb_data_options_t * opts) { int nhalo; int nlocal[3], n[3]; @@ -223,7 +219,6 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { int mpi_cartsz[3]; int mpi_cartcoords[3]; int nd; - int ndist = 2; int nextra; int index, p, d; @@ -234,16 +229,9 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { assert(pe); assert(cs); assert(dim == X || dim == Y || dim == Z); + assert(opts); - - { - lb_data_options_t options = lb_data_options_default(); - options.nvel = NVEL; - options.ndim = NDIM; - options.ndist = ndist; - lb_data_create(pe, cs, &options, &lb); - lb_halo_set(lb, halo); - } + lb_data_create(pe, cs, opts, &lb); cs_nhalo(cs, &nhalo); nextra = nhalo; @@ -262,7 +250,7 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { index = cs_index(cs, n[X], n[Y], n[Z]); - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (p = 0; p < lb->model.nvel; p++) { lb_f_set(lb, index, p, nd, -1.0); } @@ -285,7 +273,7 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { n[Y] <= nhalo || n[Y] > nlocal[Y] - nhalo || n[Z] <= nhalo || n[Z] > nlocal[Z] - nhalo) { - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (p = 0; p < lb->model.nvel; p++) { lb_f_set(lb, index, p, nd, 1.0*(offset[dim] + n[dim])); } @@ -313,7 +301,7 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { index = cs_index(cs, n[X], n[Y], n[Z]); - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (d = 0; d < 3; d++) { /* 'Left' side */ diff --git a/tests/unit/test_io_options.c b/tests/unit/test_io_options.c index dd14d1419..567ebc1f7 100644 --- a/tests/unit/test_io_options.c +++ b/tests/unit/test_io_options.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2020 The University of Edinburgh + * (c) 2020-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -111,7 +111,7 @@ __host__ int test_io_options_record_format_valid(void) { __host__ int test_io_options_metadata_version_valid(void) { - io_options_t opts = {}; + io_options_t opts = io_options_default(); int isvalid = 0; /* Wrong */ diff --git a/tests/unit/test_io_options_rt.c b/tests/unit/test_io_options_rt.c index 5a1036dc1..f02b71a82 100644 --- a/tests/unit/test_io_options_rt.c +++ b/tests/unit/test_io_options_rt.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2020 The University of Edinburgh + * (c) 2020-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -116,7 +116,7 @@ __host__ int test_io_options_rt_rformat(pe_t * pe) { __host__ int test_io_options_rt_default(pe_t * pe) { rt_t * rt = NULL; - io_options_t opts = {}; + io_options_t opts = io_options_default(); io_options_t defs = io_options_default(); assert(pe); @@ -148,7 +148,7 @@ __host__ int test_io_options_rt_default(pe_t * pe) { __host__ int test_io_options_rt(pe_t * pe) { rt_t * rt = NULL; - io_options_t opts = {}; + io_options_t opts = io_options_default(); assert(pe); diff --git a/tests/unit/test_lb_bc_inflow_opts.c b/tests/unit/test_lb_bc_inflow_opts.c index f10743536..deae12771 100644 --- a/tests/unit/test_lb_bc_inflow_opts.c +++ b/tests/unit/test_lb_bc_inflow_opts.c @@ -6,7 +6,7 @@ * Edinburgh Solft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -129,7 +129,7 @@ __host__ int test_lb_bc_inflow_opts_valid(void) { } { - lb_bc_inflow_opts_t options = {}; /* Not valid */ + lb_bc_inflow_opts_t options = {0}; /* Not valid */ ierr = lb_bc_inflow_opts_valid(options); assert(ierr == 0); diff --git a/tests/unit/test_lb_bc_inflow_rhou.c b/tests/unit/test_lb_bc_inflow_rhou.c index 2298041e7..20441030e 100644 --- a/tests/unit/test_lb_bc_inflow_rhou.c +++ b/tests/unit/test_lb_bc_inflow_rhou.c @@ -2,13 +2,13 @@ * * test_lb_bc_inflow_rhou.c * - * (c) 2021 The University of Edinburgh - * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * + * (c) 2021-2022 The University of Edinburgh + * * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) + * Kevin Stratford (kevin@epcc.ed.ac.uk) * *****************************************************************************/ @@ -41,8 +41,13 @@ __host__ int test_lb_bc_inflow_rhou_suite(void) { cs_init(cs); test_lb_bc_inflow_rhou_create(pe, cs); - test_lb_bc_inflow_rhou_update(pe, cs, NVEL); - test_lb_bc_inflow_rhou_impose(pe, cs, NVEL); + /* Need to check (2, 9) in 2d system */ + test_lb_bc_inflow_rhou_update(pe, cs, 15); + test_lb_bc_inflow_rhou_impose(pe, cs, 15); + test_lb_bc_inflow_rhou_update(pe, cs, 19); + test_lb_bc_inflow_rhou_impose(pe, cs, 19); + test_lb_bc_inflow_rhou_update(pe, cs, 27); + test_lb_bc_inflow_rhou_impose(pe, cs, 27); pe_info(pe, "PASS ./unit/test_lb_bc_inflow_rhou\n"); @@ -99,8 +104,8 @@ __host__ int test_lb_bc_inflow_rhou_create(pe_t * pe, cs_t * cs) { __host__ int test_lb_bc_inflow_rhou_update(pe_t * pe, cs_t * cs, int nvel) { - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; double rho0 = 2.0; lb_bc_inflow_opts_t options = {.nvel = nvel, @@ -150,7 +155,7 @@ __host__ int test_lb_bc_inflow_rhou_update(pe_t * pe, cs_t * cs, int nvel) { for (int kc = limits.kmin; kc <= limits.kmax; kc++) { int index = cs_index(cs, ic, jc, kc); double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; hydro_rho(hydro, index, &rho); hydro_u(hydro, index, u); @@ -181,9 +186,9 @@ __host__ int test_lb_bc_inflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { int ierr = 0; - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; double rho0 = 1.0; @@ -209,6 +214,8 @@ __host__ int test_lb_bc_inflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { lb_bc_inflow_rhou_create(pe, cs, &options, &inflow); hydro_create(pe, cs, NULL, &hopts, &hydro); + + lb_options.nvel = nvel; lb_data_create(pe, cs, &lb_options, &lb); /* Set the relevant domain values (rho only here) */ diff --git a/tests/unit/test_lb_bc_outflow_rhou.c b/tests/unit/test_lb_bc_outflow_rhou.c index a544f57ba..e557aa9e3 100644 --- a/tests/unit/test_lb_bc_outflow_rhou.c +++ b/tests/unit/test_lb_bc_outflow_rhou.c @@ -6,7 +6,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -93,9 +93,9 @@ __host__ int test_lb_bc_outflow_rhou_create(pe_t * pe, cs_t * cs) { __host__ int test_lb_bc_outflow_rhou_update(pe_t * pe, cs_t * cs, int nvel) { - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; lb_bc_outflow_opts_t options = {.nvel = nvel, .flow = {0, 1, 0}, @@ -153,9 +153,9 @@ __host__ int test_lb_bc_outflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { int ierr = 0; - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; lb_bc_outflow_opts_t options = {.nvel = nvel, .flow = {0, 0, 1}, diff --git a/tests/unit/test_lb_d2q9.c b/tests/unit/test_lb_d2q9.c index 5c78a2994..b5ae52155 100644 --- a/tests/unit/test_lb_d2q9.c +++ b/tests/unit/test_lb_d2q9.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -52,7 +52,7 @@ __host__ int test_lb_d2q9_suite(void) { __host__ int test_lb_d2q9_create(void) { - lb_model_t model = {}; + lb_model_t model = {0}; lb_d2q9_create(&model); diff --git a/tests/unit/test_lb_d3q15.c b/tests/unit/test_lb_d3q15.c index 8a9861abf..472d628ba 100644 --- a/tests/unit/test_lb_d3q15.c +++ b/tests/unit/test_lb_d3q15.c @@ -6,7 +6,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -51,7 +51,7 @@ __host__ int test_lb_d3q15_suite(void) { __host__ int test_lb_d3q15_create(void) { - lb_model_t model = {}; + lb_model_t model = {0}; lb_d3q15_create(&model); diff --git a/tests/unit/test_lb_d3q19.c b/tests/unit/test_lb_d3q19.c index 4f5a39727..335cb7248 100644 --- a/tests/unit/test_lb_d3q19.c +++ b/tests/unit/test_lb_d3q19.c @@ -6,7 +6,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -58,7 +58,7 @@ __host__ int test_lb_d3q19_suite(void) { __host__ int test_lb_d3q19_create(void) { - lb_model_t model = {}; + lb_model_t model = {0}; lb_d3q19_create(&model); @@ -69,6 +69,8 @@ __host__ int test_lb_d3q19_create(void) { assert(model.na); assert(model.ma); + assert(fabs(model.cs2 - 1.0/3.0) < DBL_EPSILON); + lb_model_free(&model); assert(model.nvel == 0); diff --git a/tests/unit/test_lb_d3q27.c b/tests/unit/test_lb_d3q27.c new file mode 100644 index 000000000..df2d8fa5f --- /dev/null +++ b/tests/unit/test_lb_d3q27.c @@ -0,0 +1,76 @@ +/***************************************************************************** + * + * lb_d3q27.c + * + * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * + *****************************************************************************/ + +#include +#include +#include + +#include "pe.h" +#include "lb_d3q27.h" + +__host__ int test_lb_d3q27_create(void); + +/***************************************************************************** + * + * test_lb_d3q27_suite + * + *****************************************************************************/ + +__host__ int test_lb_d3q27_suite(void) { + + pe_t * pe = NULL; + + pe_create(MPI_COMM_WORLD, PE_QUIET, &pe); + + test_lb_d3q27_create(); + + pe_info(pe, "PASS ./unit/test_lb_d3q27\n"); + + pe_free(pe); + + return 0; +} + +/***************************************************************************** + * + * test_lb_d3q27_create + * + *****************************************************************************/ + +__host__ int test_lb_d3q27_create(void) { + + lb_model_t model = {0}; + + lb_d3q27_create(&model); + + assert(model.ndim == 3); + assert(model.nvel == 27); + assert(model.cv); + assert(model.wv); + assert(model.na); + assert(model.ma); + + assert(fabs(model.cs2 - 1.0/3.0) < DBL_EPSILON); + + lb_model_free(&model); + + assert(model.nvel == 0); + assert(model.cv == NULL); + assert(model.wv == NULL); + assert(model.na == NULL); + assert(model.ma == NULL); + + return 0; +} diff --git a/tests/unit/test_lb_model.c b/tests/unit/test_lb_model.c index 648a00f09..a3cd88dd4 100644 --- a/tests/unit/test_lb_model.c +++ b/tests/unit/test_lb_model.c @@ -2,13 +2,13 @@ * * test_lb_model.c * - * Tests that all model should pass. + * Tests that all models should pass. * * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -78,7 +78,7 @@ int test_lb_model_nhydro(void) { int test_lb_model_create(int nvel) { - lb_model_t model = {}; + lb_model_t model = {0}; lb_model_create(nvel, &model); @@ -114,7 +114,7 @@ int test_lb_model_cv(const lb_model_t * model) { /* Check \sum_p cv_pa = 0 */ { - int8_t sum[3] = {}; + int8_t sum[3] = {0}; for (int p = 0; p < model->nvel; p++) { sum[X] += model->cv[p][X]; @@ -127,7 +127,7 @@ int test_lb_model_cv(const lb_model_t * model) { ifail += (sum[X] + sum[Y] + sum[Z]); } - /* Check cv[p][] = -cv[NVEL-p][] (p != 0) */ + /* Check cv[p][] = -cv[nvel-p][] (p != 0) */ for (int p = 1; p < model->nvel; p++) { assert(model->cv[p][X] == -model->cv[model->nvel-p][X]); @@ -155,7 +155,7 @@ int test_lb_model_wv(const lb_model_t * model) { { double sumwv = 0.0; - double sumcv[3] = {}; + double sumcv[3] = {0}; for (int p = 0; p < model->nvel; p++) { sumwv += model->wv[p]; diff --git a/tests/unit/test_map_init.c b/tests/unit/test_map_init.c index 693469efe..54399060a 100644 --- a/tests/unit/test_map_init.c +++ b/tests/unit/test_map_init.c @@ -4,7 +4,10 @@ * * Test of map initialisations is relevant. * - * (c) 2021 The University of Edinburgh + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Comuting Centre + * + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -85,8 +88,8 @@ int test_map_init_status_wall(pe_t * pe) { int test_map_init_status_wall_x(pe_t * pe, cs_t * cs) { - int ntotal[3] = {}; - int noffset[3] = {}; + int ntotal[3] = {0}; + int noffset[3] = {0}; assert(pe); assert(cs); @@ -145,9 +148,9 @@ int test_map_init_status_wall_x(pe_t * pe, cs_t * cs) { int test_map_init_status_wall_y(pe_t * pe, cs_t * cs) { - int ntotal[3] = {}; - int nlocal[3] = {}; - int noffset[3] = {}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; + int noffset[3] = {0}; assert(pe); assert(cs); @@ -192,9 +195,9 @@ int test_map_init_status_wall_y(pe_t * pe, cs_t * cs) { int test_map_init_status_wall_z(pe_t * pe, cs_t * cs) { - int ntotal[3] = {}; - int nlocal[3] = {}; - int noffset[3] = {}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; + int noffset[3] = {0}; assert(pe); assert(cs); @@ -267,8 +270,8 @@ int test_map_init_status_circle_odd(pe_t * pe) { { /* All the edges at least should be solid (no 'leaks') */ - int noffset[3] = {}; - int nlocal[3] = {}; + int noffset[3] = {0}; + int nlocal[3] = {0}; int status1 = -1; int status2 = -1; diff --git a/tests/unit/test_model.c b/tests/unit/test_model.c index 9668b2923..7a8bc3cd2 100644 --- a/tests/unit/test_model.c +++ b/tests/unit/test_model.c @@ -2,7 +2,10 @@ * * test_model.c * - * Unit test for the currently compiled model (D3Q15 or D3Q19). + * Tests for model data: distributions, halos, i/o (pending!). + * PENDING: This is to be merged with test_halo.c under "test_lb_data.c". + * PENDING: Coverage check. + * * * Edinburgh Soft Matter and Statistical Physics Group * Edinburgh Parallel Computing Centre @@ -25,7 +28,6 @@ #include "lb_data.h" #include "tests.h" -static void test_model_constants(void); static void test_model_velocity_set(void); int do_test_model_distributions(pe_t * pe, cs_t * cs); @@ -47,12 +49,12 @@ static int test_model_is_domain(cs_t * cs, int ic, int jc, int kc); int64_t lb_data_index(lb_t * lb, int ic, int jc, int kc, int p) { int64_t index = INT64_MIN; - int64_t nall[3] = {}; - int64_t nstr[3] = {}; + int64_t nall[3] = {0}; + int64_t nstr[3] = {0}; int64_t pstr = 0; - int ntotal[3] = {}; - int offset[3] = {}; + int ntotal[3] = {0}; + int offset[3] = {0}; int nhalo = 0; assert(lb); @@ -103,7 +105,7 @@ int64_t lb_data_index(lb_t * lb, int ic, int jc, int kc, int p) { int util_lb_data_check_set(lb_t * lb) { - int nlocal[3] = {}; + int nlocal[3] = {0}; assert(lb); @@ -137,7 +139,7 @@ int util_lb_data_check(lb_t * lb, int full) { int ifail = 0; int nh = 1; int nhk = nh; - int nlocal[3] = {}; + int nlocal[3] = {0}; assert(lb); @@ -196,8 +198,6 @@ int test_lb_halo_post_wait(pe_t * pe, cs_t * cs, int ndim, int nvel, int full) { assert(pe); assert(cs); - printf("test halo create ndim = %2d nvel = %2d full = %2d\n", - ndim, nvel, full); options.ndim = ndim; options.nvel = nvel; lb_data_create(pe, cs, &options, &lb); @@ -205,7 +205,7 @@ int test_lb_halo_post_wait(pe_t * pe, cs_t * cs, int ndim, int nvel, int full) { util_lb_data_check_set(lb); { - lb_halo_t h = {}; + lb_halo_t h = {0}; lb_halo_create(lb, &h, LB_HALO_OPENMP_FULL); lb_halo_post(lb, &h); lb_halo_wait(lb, &h); @@ -254,11 +254,8 @@ int test_lb_halo(pe_t * pe) { test_lb_halo_post_wait(pe, cs, 3, 15, LB_HALO_OPENMP_FULL); test_lb_halo_post_wait(pe, cs, 3, 19, LB_HALO_OPENMP_REDUCED); test_lb_halo_post_wait(pe, cs, 3, 19, LB_HALO_OPENMP_FULL); - - /* TODO: add when NVEL is not fixed... - * "3, 27, LB_HALO_OPENMP_REDUCED" - * "3, 27, LB_HALO_OPENMP_FULL" - */ + test_lb_halo_post_wait(pe, cs, 3, 27, LB_HALO_OPENMP_REDUCED); + test_lb_halo_post_wait(pe, cs, 3, 27, LB_HALO_OPENMP_FULL); cs_free(cs); } @@ -287,16 +284,13 @@ int test_model_suite(void) { /* Test model structure (coordinate-independent stuff) */ - test_model_constants(); test_model_velocity_set(); /* Now test actual distributions */ do_test_model_distributions(pe, cs); do_test_model_halo_swap(pe, cs); - if (DATA_MODEL == DATA_MODEL_AOS && NSIMDVL == 1) { - do_test_model_reduced_halo_swap(pe, cs); - } + do_test_model_reduced_halo_swap(pe, cs); do_test_lb_model_io(pe, cs); pe_info(pe, "PASS ./unit/test_model\n"); @@ -306,61 +300,11 @@ int test_model_suite(void) { return 0; } -/***************************************************************************** - * - * test_model_constants - * - * Check the various constants associated with the reduced halo swap. - * - *****************************************************************************/ - -static void test_model_constants(void) { - -#ifdef TEST_TO_BE_REMOVED_WITH_GLOBAL_SYMBOLS - int i, k, p; - - for (i = 0; i < CVXBLOCK; i++) { - for (k = 0; k < xblocklen_cv[i]; k++) { - p = xdisp_fwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][X] == +1); - p = xdisp_bwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][X] == -1); - } - } - - for (i = 0; i < CVYBLOCK; i++) { - for (k = 0; k < yblocklen_cv[i]; k++) { - p = ydisp_fwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][Y] == +1); - p = ydisp_bwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][Y] == -1); - } - } - - for (i = 0; i < CVZBLOCK; i++) { - for (k = 0; k < zblocklen_cv[i]; k++) { - p = zdisp_fwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][Z] == +1); - p = zdisp_bwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][Z] == -1); - } - } -#endif - return; -} - /***************************************************************************** * * test_model_velocity_set * - * Check the velocities, kinetic projector, tables of eigenvectors - * etc etc are all consistent for the current model. + * Some residual older tests which remain relevant. * *****************************************************************************/ @@ -368,6 +312,9 @@ static void test_model_velocity_set(void) { test_assert(NHYDRO == (1 + NDIM + NDIM*(NDIM+1)/2)); + printf("Compiled model NDIM %2d NVEL %2d\n", NDIM, NVEL); + printf("sizeof(lb_collide_param_t) %ld bytes\n", sizeof(lb_collide_param_t)); + return; } @@ -458,7 +405,6 @@ int do_test_model_halo_swap(pe_t * pe, cs_t * cs) { options.nvel = NVEL; options.ndist = ndist; lb_data_create(pe, cs, &options, &lb); - assert(lb); cs_nlocal(cs, nlocal); @@ -543,7 +489,7 @@ int do_test_model_reduced_halo_swap(pe_t * pe, cs_t * cs) { int i, j, k, p; int icdt, jcdt, kcdt; int index, nlocal[3]; - int n, ndist = 2; + int n, ndist = 1; const int nextra = 1; double f_expect; @@ -558,9 +504,9 @@ int do_test_model_reduced_halo_swap(pe_t * pe, cs_t * cs) { options.ndim = NDIM; options.nvel = NVEL; options.ndist = ndist; + options.halo = LB_HALO_OPENMP_REDUCED; lb_data_create(pe, cs, &options, &lb); assert(lb); - lb_halo_set(lb, LB_HALO_REDUCED); cs_nlocal(cs, nlocal); @@ -580,7 +526,7 @@ int do_test_model_reduced_halo_swap(pe_t * pe, cs_t * cs) { } } - lb_halo_via_struct(lb); + lb_halo(lb); /* Now check that the interior sites are unchanged */ diff --git a/tests/unit/test_pair_ss_cut.c b/tests/unit/test_pair_ss_cut.c index a91890774..2bcb8d98d 100644 --- a/tests/unit/test_pair_ss_cut.c +++ b/tests/unit/test_pair_ss_cut.c @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2014-2021 The University of Edinburgh + * (c) 2014-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) diff --git a/tests/unit/test_pair_ss_cut_ij.c b/tests/unit/test_pair_ss_cut_ij.c index f1afd6709..27aa306ae 100644 --- a/tests/unit/test_pair_ss_cut_ij.c +++ b/tests/unit/test_pair_ss_cut_ij.c @@ -2,6 +2,11 @@ * * test_pair_ss_cut_ij.c * + * Edinburgh Soft Matter and Statictical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) * @@ -57,10 +62,10 @@ int test_pair_ss_cut_ij_create(pe_t * pe, cs_t * cs) { pair_ss_cut_ij_t * obj = NULL; - double epsilon[2] = {}; - double sigma[2] = {}; - double nu[2] = {}; - double hc[2] = {}; + double epsilon[2] = {0}; + double sigma[2] = {0}; + double nu[2] = {0}; + double hc[2] = {0}; pair_ss_cut_ij_create(pe, cs, 2, epsilon, sigma, nu, hc, &obj); assert(obj); diff --git a/tests/unit/test_phi_bc_inflow_fixed.c b/tests/unit/test_phi_bc_inflow_fixed.c index 943d0db4e..bf38e9081 100644 --- a/tests/unit/test_phi_bc_inflow_fixed.c +++ b/tests/unit/test_phi_bc_inflow_fixed.c @@ -2,6 +2,14 @@ * * test_phi_bc_inflow_fixed.c * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * *****************************************************************************/ #include @@ -77,7 +85,7 @@ __host__ int test_phi_bc_inflow_fixed_create(pe_t * pe, cs_t * cs) { __host__ int test_phi_bc_inflow_fixed_update(pe_t * pe, cs_t * cs) { - int noffset[3] = {}; + int noffset[3] = {0}; phi_bc_inflow_opts_t options = {.phi0 = 999.999, .flow = {1,0,0}}; phi_bc_inflow_fixed_t * inflow = NULL; @@ -102,7 +110,7 @@ __host__ int test_phi_bc_inflow_fixed_update(pe_t * pe, cs_t * cs) { if (noffset[X] == 0) { /* Check x-inflow region */ int nhalo = 0; - int nlocal[3] = {}; + int nlocal[3] = {0}; cs_nhalo(cs, &nhalo); cs_nlocal(cs, nlocal); diff --git a/tests/unit/test_phi_bc_outflow_free.c b/tests/unit/test_phi_bc_outflow_free.c index e41ebecf3..cc9f363ff 100644 --- a/tests/unit/test_phi_bc_outflow_free.c +++ b/tests/unit/test_phi_bc_outflow_free.c @@ -2,6 +2,14 @@ * * test_phi_bc_outflow_free.c * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * *****************************************************************************/ #include @@ -77,9 +85,9 @@ __host__ int test_phi_bc_outflow_free_create(pe_t * pe, cs_t * cs) { __host__ int test_phi_bc_outflow_free_update(pe_t * pe, cs_t * cs) { int nhalo = -1; - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; phi_bc_outflow_opts_t options = {.flow = {1,0,0}}; phi_bc_outflow_free_t * outflow = NULL; diff --git a/tests/unit/test_prop.c b/tests/unit/test_prop.c index b81842518..b850cf6b0 100644 --- a/tests/unit/test_prop.c +++ b/tests/unit/test_prop.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 Ths University of Edinburgh + * (c) 2010-2022 Ths University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -25,8 +25,10 @@ #include "propagation.h" #include "tests.h" -__host__ int do_test_velocity(pe_t * pe, cs_t * cs, lb_halo_enum_t halo); -__host__ int do_test_source_destination(pe_t * pe, cs_t * cs, lb_halo_enum_t halo); +__host__ int do_test_velocity(pe_t * pe, cs_t * cs, int ndist, + lb_halo_enum_t halo); +__host__ int do_test_source_destination(pe_t * pe, cs_t * cs, int ndist, + lb_halo_enum_t halo); /***************************************************************************** * @@ -43,19 +45,15 @@ int test_lb_prop_suite(void) { cs_create(pe, &cs); cs_init(cs); - if (NSIMDVL == 1 && DATA_MODEL == DATA_MODEL_AOS) { - do_test_velocity(pe, cs, LB_HALO_FULL); - do_test_velocity(pe, cs, LB_HALO_REDUCED); + do_test_velocity(pe, cs, 1, LB_HALO_TARGET); + do_test_velocity(pe, cs, 2, LB_HALO_TARGET); + do_test_velocity(pe, cs, 1, LB_HALO_OPENMP_FULL); + do_test_velocity(pe, cs, 1, LB_HALO_OPENMP_REDUCED); - do_test_source_destination(pe, cs, LB_HALO_FULL); - do_test_source_destination(pe, cs, LB_HALO_REDUCED); - } - - do_test_velocity(pe, cs, LB_HALO_HOST); - do_test_source_destination(pe, cs, LB_HALO_HOST); - - do_test_velocity(pe, cs, LB_HALO_TARGET); - do_test_source_destination(pe, cs, LB_HALO_TARGET); + do_test_source_destination(pe, cs, 1, LB_HALO_TARGET); + do_test_source_destination(pe, cs, 2, LB_HALO_TARGET); + do_test_source_destination(pe, cs, 1, LB_HALO_OPENMP_FULL); + do_test_source_destination(pe, cs, 1, LB_HALO_OPENMP_REDUCED); pe_info(pe, "PASS ./unit/test_prop\n"); cs_free(cs); @@ -73,13 +71,11 @@ int test_lb_prop_suite(void) { * *****************************************************************************/ -int do_test_velocity(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { +int do_test_velocity(pe_t * pe, cs_t * cs, int ndist, lb_halo_enum_t halo) { - int ndevice; int nlocal[3]; int ic, jc, kc, index, p; int nd; - int ndist = 2; double f_actual; lb_data_options_t options = lb_data_options_default(); @@ -87,10 +83,13 @@ int do_test_velocity(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { assert(pe); assert(cs); + assert(ndist == 1 || ndist == 2); options.ndim = NDIM; options.nvel = NVEL; options.ndist = ndist; + options.halo = halo; + lb_data_create(pe, cs, &options, &lb); assert(lb); @@ -114,15 +113,10 @@ int do_test_velocity(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { } } - tdpGetDeviceCount(&ndevice); - if (ndevice > 0 && halo == LB_HALO_HOST) { - lb_halo_swap(lb, halo); - lb_memcpy(lb, tdpMemcpyHostToDevice); - } - else { - lb_memcpy(lb, tdpMemcpyHostToDevice); - lb_halo_swap(lb, halo); - } + /* Halo swap, and make sure values are on device */ + + lb_memcpy(lb, tdpMemcpyHostToDevice); + lb_halo(lb); lb_propagation(lb); lb_memcpy(lb, tdpMemcpyDeviceToHost); @@ -161,14 +155,13 @@ int do_test_velocity(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { * *****************************************************************************/ -int do_test_source_destination(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { +int do_test_source_destination(pe_t * pe, cs_t * cs, int ndist, + lb_halo_enum_t halo) { - int ndevice; int nlocal[3], offset[3]; int ntotal[3]; int ic, jc, kc, index, p; int nd; - int ndist = 2; int isource, jsource, ksource; double f_actual, f_expect; double ltot[3]; @@ -178,10 +171,13 @@ int do_test_source_destination(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { assert(pe); assert(cs); + assert(ndist == 1 || ndist == 2); options.ndim = NDIM; options.nvel = NVEL; + options.halo = halo; options.ndist = ndist; + lb_data_create(pe, cs, &options, &lb); assert(lb); @@ -211,15 +207,10 @@ int do_test_source_destination(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { } } - tdpGetDeviceCount(&ndevice); - if (ndevice > 0 && halo == LB_HALO_HOST) { - lb_halo_swap(lb, halo); - lb_memcpy(lb, tdpMemcpyHostToDevice); - } - else { - lb_memcpy(lb, tdpMemcpyHostToDevice); - lb_halo_swap(lb, halo); - } + /* Initial values update to device */ + lb_memcpy(lb, tdpMemcpyHostToDevice); + lb_halo(lb); + lb_propagation(lb); lb_memcpy(lb, tdpMemcpyDeviceToHost); diff --git a/tests/unit/test_runtime.c b/tests/unit/test_runtime.c index 20023d51c..f868e8324 100644 --- a/tests/unit/test_runtime.c +++ b/tests/unit/test_runtime.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2011-2021 The University of Edinburgh + * (c) 2011-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -242,7 +242,7 @@ int test_rt_nvector(pe_t * pe) { rt_add_key_value(rt, "bad_val", "1_x"); { - int i2[2] = {}; + int i2[2] = {0}; key_ret = rt_int_nvector(rt, "ki2", 2, i2, RT_NONE); assert(key_ret == 0); assert(i2[0] == 1); @@ -250,13 +250,13 @@ int test_rt_nvector(pe_t * pe) { } { - int i3[3] = {}; + int i3[3] = {0}; key_ret = rt_int_nvector(rt, "ki2", 3, i3, RT_NONE); /* Wrong length */ assert(key_ret != 0); } { - double v4[4] = {}; + double v4[4] = {0}; key_ret = rt_double_nvector(rt, "kd4", 4, v4, RT_NONE); assert(key_ret == 0); assert(fabs(v4[0] - 1.0) < DBL_EPSILON); @@ -266,7 +266,7 @@ int test_rt_nvector(pe_t * pe) { } { - int i2[2] = {}; + int i2[2] = {0}; key_ret = rt_int_nvector(rt, "bad_val", 2, i2, RT_NONE); /* bad value */ assert(key_ret != 0); diff --git a/tests/unit/tests.c b/tests/unit/tests.c index 7bdde2b13..f6860c628 100644 --- a/tests/unit/tests.c +++ b/tests/unit/tests.c @@ -8,7 +8,7 @@ * Edinburgh Parallel Computing Centre * * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * *****************************************************************************/ @@ -75,6 +75,7 @@ __host__ int tests_create() { test_lb_d2q9_suite(); test_lb_d3q15_suite(); test_lb_d3q19_suite(); + test_lb_d3q27_suite(); test_lb_model_suite(); test_lb_bc_inflow_opts_suite(); test_lb_bc_inflow_rhou_suite(); diff --git a/tests/unit/tests.h b/tests/unit/tests.h index 2fb77823c..2e0e2fa3b 100644 --- a/tests/unit/tests.h +++ b/tests/unit/tests.h @@ -6,7 +6,7 @@ * Edinburgh Parallel Computing Centre * * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * *****************************************************************************/ @@ -55,6 +55,7 @@ int test_io_options_rt_suite(void); int test_lb_d2q9_suite(void); int test_lb_d3q15_suite(void); int test_lb_d3q19_suite(void); +int test_lb_d3q27_suite(void); int test_lb_model_suite(void); int test_lb_bc_inflow_opts_suite(void); int test_lb_bc_inflow_rhou_suite(void); diff --git a/util/capillary.c b/util/capillary.c index a0de78d95..59e17c947 100644 --- a/util/capillary.c +++ b/util/capillary.c @@ -11,11 +11,11 @@ * The output should be capillary.dat [for human consumption] * capillary.001-001 [for initial input to run] * - * (c) 2008-2021 The University of Edinburgh - * * Edinburgh Soft Matter and Statistcal Physics Group and * Edinburgh Parallel Computing Centre * + * (c) 2008-2022 The University of Edinburgh + * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) * @@ -225,8 +225,8 @@ int main(int argc, char ** argv) { map_init_status_wall(map, X); { - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; cs_nlocal(cs, nlocal); cs_nlocal_offset(cs, noffset); if (noffset[X] == 0) { @@ -318,7 +318,7 @@ int map_special_cross(map_t * map) { const int w = 5; const int w_arm = 4; - int nlocal[3] = {}; + int nlocal[3] = {0}; int x0, x1, j0, j1; cs_t * cs = NULL; @@ -398,7 +398,7 @@ int map_special_cross(map_t * map) { int map_xwall_obstacles(map_t * map, double sigma) { cs_t * cs = NULL; - int nlocal[3] = {}; + int nlocal[3] = {0}; int obst_start[2*obstacle_number][3]; int obst_stop[2*obstacle_number][3]; @@ -536,7 +536,7 @@ int capillary_write_ascii_serial(pe_t * pe, cs_t * cs, map_t * map) { const char * filename = "capillary.dat"; - int nlocal[3] = {}; + int nlocal[3] = {0}; FILE * fp = NULL; assert(pe); diff --git a/util/extract.c b/util/extract.c index 8b956cfa9..bde00fd79 100644 --- a/util/extract.c +++ b/util/extract.c @@ -47,7 +47,7 @@ * Kevin Stratford (kevin@epcc.ed.ac.uk) * Oliver Henrich (oliver.henrich@strath.ac.uk) * - * (c) 2011-2020 The University of Edinburgh + * (c) 2011-2022 The University of Edinburgh * ****************************************************************************/ @@ -310,7 +310,7 @@ int extract_driver(const char * filename, metadata_v1_t * meta, int version) { /* Write a single file with the final section */ { - char tmp[FILENAME_MAX/2] = {}; /* Avoid potential buffer overflow */ + char tmp[FILENAME_MAX/2] = {0}; /* Avoid potential buffer overflow */ strncpy(tmp, meta->stub, FILENAME_MAX/2 - strnlen(meta->stub, FILENAME_MAX/2-1) - 1); snprintf(io_data, sizeof(io_data), "%s-%8.8d", tmp, ntime);