Skip to content

Commit

Permalink
Merge branch 'develop' into publish-gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Apr 19, 2024
2 parents f31c6d3 + 82d5f4d commit 55bf113
Show file tree
Hide file tree
Showing 43 changed files with 626 additions and 1,071 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -19,7 +19,7 @@ repos:
- "--ignore=E203,W503"

- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.4.0
hooks:
- id: black
args:
Expand Down
2 changes: 1 addition & 1 deletion c/_phono3py.c
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ static PyObject *py_get_triplets_integration_weights(PyObject *self,
ph3py_get_integration_weight(
iw, iw_zero, frequency_points, num_band0, relative_grid_address, D_diag,
triplets, num_triplets, bz_grid_addresses, bz_map, bz_grid_type,
frequencies1, num_band1, frequencies2, num_band2, tp_type, 1, 0);
frequencies1, num_band1, frequencies2, num_band2, tp_type, 1);

Py_RETURN_NONE;
}
Expand Down
10 changes: 5 additions & 5 deletions c/gridsys.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ long gridsys_get_integration_weight(
const long (*bz_grid_addresses)[3], const long *bz_map,
const long bz_grid_type, const double *frequencies1, const long num_band1,
const double *frequencies2, const long num_band2, const long tp_type,
const long openmp_per_triplets, const long openmp_per_bands) {
const long openmp_per_triplets) {
ConstBZGrid *bzgrid;
long i;

Expand All @@ -282,10 +282,10 @@ long gridsys_get_integration_weight(
bzgrid->D_diag[i] = D_diag[i];
}

tpl_get_integration_weight(
iw, iw_zero, frequency_points, num_band0, relative_grid_address,
triplets, num_triplets, bzgrid, frequencies1, num_band1, frequencies2,
num_band2, tp_type, openmp_per_triplets, openmp_per_bands);
tpl_get_integration_weight(iw, iw_zero, frequency_points, num_band0,
relative_grid_address, triplets, num_triplets,
bzgrid, frequencies1, num_band1, frequencies2,
num_band2, tp_type, openmp_per_triplets);
free(bzgrid);
bzgrid = NULL;

Expand Down
2 changes: 1 addition & 1 deletion c/gridsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ long gridsys_get_integration_weight(
const long (*bz_grid_addresses)[3], const long *bz_map,
const long bz_grid_type, const double *frequencies1, const long num_band1,
const double *frequencies2, const long num_band2, const long tp_type,
const long openmp_per_triplets, const long openmp_per_bands);
const long openmp_per_triplets);
void gridsys_get_integration_weight_with_sigma(
double *iw, char *iw_zero, const double sigma, const double sigma_cutoff,
const double *frequency_points, const long num_band0,
Expand Down
4 changes: 2 additions & 2 deletions c/imag_self_energy_with_g.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void ise_imag_self_energy_at_triplet(
const long triplet[3], const long triplet_weight, const double *g1,
const double *g2_3, const long (*g_pos)[4], const long num_g_pos,
const double *temperatures, const long num_temps,
const double cutoff_frequency, const long openmp_possible,
const double cutoff_frequency, const long openmp_per_triplets,
const long at_a_frequency_point) {
long i, j;
double *n1, *n2, *ise_at_g_pos;
Expand All @@ -238,7 +238,7 @@ void ise_imag_self_energy_at_triplet(
}

#ifdef _OPENMP
#pragma omp parallel for private(j, g_pos_3) if (openmp_possible)
#pragma omp parallel for private(j, g_pos_3) if (!openmp_per_triplets)
#endif
for (i = 0; i < num_g_pos; i++) {
if (at_a_frequency_point) {
Expand Down
24 changes: 12 additions & 12 deletions c/interaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void real_to_normal(double *fc3_normal_squared, const long (*g_pos)[4],
const double *masses, const long *band_indices,
const long num_band, const double cutoff_frequency,
const long triplet_index, const long num_triplets,
const long openmp_at_bands);
const long openmp_per_triplets);
static void real_to_normal_sym_q(
double *fc3_normal_squared, const long (*g_pos)[4], const long num_g_pos,
double *const freqs[3], lapack_complex_double *const eigvecs[3],
Expand All @@ -67,7 +67,7 @@ static void real_to_normal_sym_q(
const AtomTriplets *atom_triplets, const double *masses,
const long *band_indices, const long num_band0, const long num_band,
const double cutoff_frequency, const long triplet_index,
const long num_triplets, const long openmp_at_bands);
const long num_triplets, const long openmp_per_triplets);

/* fc3_normal_squared[num_triplets, num_band0, num_band, num_band] */
void itr_get_interaction(
Expand Down Expand Up @@ -101,7 +101,7 @@ void itr_get_interaction(
g_pos, num_g_pos, frequencies->data, eigenvectors, triplets[i],
bzgrid, fc3, is_compact_fc3, atom_triplets, masses, band_indices,
symmetrize_fc3_q, cutoff_frequency, i, num_triplets,
1 - openmp_per_triplets);
openmp_per_triplets);

free(g_pos);
g_pos = NULL;
Expand All @@ -118,7 +118,7 @@ void itr_get_interaction_at_triplet(
const double cutoff_frequency,
const long triplet_index, /* only for print */
const long num_triplets, /* only for print */
const long openmp_at_bands) {
const long openmp_per_triplets) {
long j, k;
double *freqs[3];
lapack_complex_double *eigvecs[3];
Expand Down Expand Up @@ -149,7 +149,7 @@ void itr_get_interaction_at_triplet(
fc3_normal_squared, g_pos, num_g_pos, freqs, eigvecs, fc3,
is_compact_fc3, q_vecs, /* q0, q1, q2 */
atom_triplets, masses, band_indices, num_band0, num_band,
cutoff_frequency, triplet_index, num_triplets, openmp_at_bands);
cutoff_frequency, triplet_index, num_triplets, openmp_per_triplets);
for (j = 0; j < 3; j++) {
free(freqs[j]);
freqs[j] = NULL;
Expand All @@ -167,7 +167,7 @@ void itr_get_interaction_at_triplet(
is_compact_fc3, q_vecs, /* q0, q1, q2 */
atom_triplets, masses, band_indices, num_band,
cutoff_frequency, triplet_index, num_triplets,
openmp_at_bands);
openmp_per_triplets);
}
}

Expand All @@ -183,7 +183,7 @@ static void real_to_normal(double *fc3_normal_squared, const long (*g_pos)[4],
const double *masses, const long *band_indices,
const long num_band, const double cutoff_frequency,
const long triplet_index, const long num_triplets,
const long openmp_at_bands) {
const long openmp_per_triplets) {
lapack_complex_double *fc3_reciprocal;
lapack_complex_double comp_zero;
long i;
Expand All @@ -195,18 +195,18 @@ static void real_to_normal(double *fc3_normal_squared, const long (*g_pos)[4],
fc3_reciprocal[i] = comp_zero;
}
r2r_real_to_reciprocal(fc3_reciprocal, q_vecs, fc3, is_compact_fc3,
atom_triplets, openmp_at_bands);
atom_triplets, openmp_per_triplets);

#ifdef MEASURE_R2N
if (openmp_at_bands && num_triplets > 0) {
if ((!openmp_per_triplets) && num_triplets > 0) {
printf("At triplet %d/%d (# of bands=%d):\n", triplet_index,
num_triplets, num_band0);
}
#endif
reciprocal_to_normal_squared(
fc3_normal_squared, g_pos, num_g_pos, fc3_reciprocal, freqs0, freqs1,
freqs2, eigvecs0, eigvecs1, eigvecs2, masses, band_indices, num_band,
cutoff_frequency, openmp_at_bands);
cutoff_frequency, openmp_per_triplets);

free(fc3_reciprocal);
fc3_reciprocal = NULL;
Expand All @@ -220,7 +220,7 @@ static void real_to_normal_sym_q(
const AtomTriplets *atom_triplets, const double *masses,
const long *band_indices, const long num_band0, const long num_band,
const double cutoff_frequency, const long triplet_index,
const long num_triplets, const long openmp_at_bands) {
const long num_triplets, const long openmp_per_triplets) {
long i, j, k, l;
long band_ex[3];
double q_vecs_ex[3][3];
Expand All @@ -246,7 +246,7 @@ static void real_to_normal_sym_q(
eigvecs[index_exchange[i][1]], eigvecs[index_exchange[i][2]], fc3,
is_compact_fc3, q_vecs_ex, /* q0, q1, q2 */
atom_triplets, masses, band_indices, num_band, cutoff_frequency,
triplet_index, num_triplets, openmp_at_bands);
triplet_index, num_triplets, openmp_per_triplets);
for (j = 0; j < num_band0; j++) {
for (k = 0; k < num_band; k++) {
for (l = 0; l < num_band; l++) {
Expand Down
2 changes: 1 addition & 1 deletion c/interaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ void itr_get_interaction_at_triplet(
const double cutoff_frequency,
const long triplet_index, /* only for print */
const long num_triplets, /* only for print */
const long openmp_at_bands);
const long openmp_per_triplets);

#endif
10 changes: 5 additions & 5 deletions c/phono3py.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ long ph3py_get_integration_weight(
const long (*bz_grid_addresses)[3], const long *bz_map,
const long bz_grid_type, const double *frequencies1, const long num_band1,
const double *frequencies2, const long num_band2, const long tp_type,
const long openmp_per_triplets, const long openmp_per_bands) {
const long openmp_per_triplets) {
ConstBZGrid *bzgrid;
long i;

Expand All @@ -451,10 +451,10 @@ long ph3py_get_integration_weight(
bzgrid->D_diag[i] = D_diag[i];
}

tpl_get_integration_weight(
iw, iw_zero, frequency_points, num_band0, relative_grid_address,
triplets, num_triplets, bzgrid, frequencies1, num_band1, frequencies2,
num_band2, tp_type, openmp_per_triplets, openmp_per_bands);
tpl_get_integration_weight(iw, iw_zero, frequency_points, num_band0,
relative_grid_address, triplets, num_triplets,
bzgrid, frequencies1, num_band1, frequencies2,
num_band2, tp_type, openmp_per_triplets);
free(bzgrid);
bzgrid = NULL;

Expand Down
2 changes: 1 addition & 1 deletion c/phono3py.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ long ph3py_get_integration_weight(
const long (*bz_grid_addresses)[3], const long *bz_map,
const long bz_grid_type, const double *frequencies1, const long num_band1,
const double *frequencies2, const long num_band2, const long tp_type,
const long openmp_per_triplets, const long openmp_per_bands);
const long openmp_per_triplets);
void ph3py_get_integration_weight_with_sigma(
double *iw, char *iw_zero, const double sigma, const double sigma_cutoff,
const double *frequency_points, const long num_band0,
Expand Down
9 changes: 4 additions & 5 deletions c/pp_collision.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ void ppc_get_pp_collision(

tpl_set_relative_grid_address(tp_relative_grid_address,
relative_grid_address, 2);

#ifdef _OPENMP
#pragma omp parallel for schedule(guided) private( \
g, g_zero) if (openmp_per_triplets)
Expand All @@ -109,7 +108,7 @@ void ppc_get_pp_collision(
triplets[i], 1, bzgrid,
frequencies, /* used as f1 */
num_band, frequencies, /* used as f2 */
num_band, 2, 1 - openmp_per_triplets);
num_band, 2, openmp_per_triplets);

get_collision(ise + i * num_temps * num_band0, num_band0, num_band,
num_temps, temperatures->data, g, g_zero, frequencies,
Expand Down Expand Up @@ -179,7 +178,7 @@ void ppc_get_pp_collision_with_sigma(
g_zero = (char *)malloc(sizeof(char) * num_band_prod);
tpi_get_integration_weight_with_sigma(
g, g_zero, sigma, cutoff, freqs_at_gp, num_band0, triplets[i],
const_adrs_shift, frequencies, num_band, 2, 0);
const_adrs_shift, frequencies, num_band, 2, 1);

get_collision(ise + i * num_temps * num_band0, num_band0, num_band,
num_temps, temperatures->data, g, g_zero, frequencies,
Expand Down Expand Up @@ -234,12 +233,12 @@ static void get_collision(
fc3_normal_squared, num_band0, num_band, g_pos, num_g_pos, frequencies,
eigenvectors, triplet, bzgrid, fc3, is_compact_fc3, atom_triplets,
masses, band_indices, symmetrize_fc3_q, cutoff_frequency, 0, 0,
1 - openmp_per_triplets);
openmp_per_triplets);

ise_imag_self_energy_at_triplet(
ise, num_band0, num_band, fc3_normal_squared, frequencies, triplet,
triplet_weight, g, g + num_band_prod, g_pos, num_g_pos, temperatures,
num_temps, cutoff_frequency, 1 - openmp_per_triplets, 0);
num_temps, cutoff_frequency, openmp_per_triplets, 0);

free(fc3_normal_squared);
fc3_normal_squared = NULL;
Expand Down
Loading

0 comments on commit 55bf113

Please sign in to comment.