Skip to content

Commit

Permalink
Merge pull request #165 from ludwig-cf/feature-lb-halo
Browse files Browse the repository at this point in the history
Add field halo switch for lc droplet
  • Loading branch information
kevinstratford authored Apr 15, 2022
2 parents 747329c + b1000fb commit 038deaa
Show file tree
Hide file tree
Showing 267 changed files with 951 additions and 2,500 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions mpi_s/mpi_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions mpi_s/mpi_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/blue_phase_beris_edwards.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([email protected])
Expand Down Expand Up @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions src/blue_phase_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([email protected])
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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];
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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];
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/blue_phase_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([email protected])
Expand Down Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions src/cahn_hilliard_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([email protected])
Expand Down Expand Up @@ -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);
Expand All @@ -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,
Expand Down Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/colloid_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([email protected])
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions src/colloids_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([email protected])
Expand Down Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions src/coords.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
Loading

0 comments on commit 038deaa

Please sign in to comment.