Patches to apply to build OpenMX with clang |
- Date: 2018/09/12 12:03
- Name: Yuri
<yuri@rawbw.com>
- References: https://www.freshports.org/science/openmx/
- Please apply the following patches.
* type conversions are needed after malloc * 'or' variables need to be renamed * return type of function needs to be added.
I had to add them to build the FreeBSD port that I just created.
Thanks, Yuri
--- Band_DFT_Col.c.orig 2018-08-29 06:24:38 UTC +++ Band_DFT_Col.c @@ -483,9 +483,9 @@ double Band_DFT_Col(int SCF_iter, /* allocation */ - stat_send = malloc(sizeof(MPI_Status)*numprocs2); - request_send = malloc(sizeof(MPI_Request)*numprocs2); - request_recv = malloc(sizeof(MPI_Request)*numprocs2); + stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*numprocs2); + request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs2); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs2); is1 = (int*)malloc(sizeof(int)*numprocs2); ie1 = (int*)malloc(sizeof(int)*numprocs2); --- Band_DFT_NonCol.c.orig 2018-08-29 06:26:10 UTC +++ Band_DFT_NonCol.c @@ -554,9 +554,9 @@ double Band_DFT_NonCol(int SCF_iter, /* allocation */ - stat_send = malloc(sizeof(MPI_Status)*numprocs1); - request_send = malloc(sizeof(MPI_Request)*numprocs1); - request_recv = malloc(sizeof(MPI_Request)*numprocs1); + stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*numprocs1); + request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs1); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs1); is1 = (int*)malloc(sizeof(int)*numprocs1); ie1 = (int*)malloc(sizeof(int)*numprocs1); --- Cluster_DFT.c.orig 2018-08-29 06:05:22 UTC +++ Cluster_DFT.c @@ -194,9 +194,9 @@ static double Cluster_collinear( Num_Comm_World1 = SpinP_switch + 1; - stat_send = malloc(sizeof(MPI_Status)*numprocs0); - request_send = malloc(sizeof(MPI_Request)*numprocs0); - request_recv = malloc(sizeof(MPI_Request)*numprocs0); + stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*numprocs0); + request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs0); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs0); /*********************************************** allocation of arrays for the first world @@ -1541,9 +1541,9 @@ static double Cluster_non_collinear( /* allocation of arrays */ - stat_send = malloc(sizeof(MPI_Status)*numprocs); - request_send = malloc(sizeof(MPI_Request)*numprocs); - request_recv = malloc(sizeof(MPI_Request)*numprocs); + stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*numprocs); + request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs); /**************************************************** calculation of the array size @@ -2649,7 +2649,7 @@ void Save_DOS_Col(int n, int MaxN, int * MPI_Comm_size(mpi_comm_level1,&numprocs); MPI_Comm_rank(mpi_comm_level1,&myid); - request_recv = malloc(sizeof(MPI_Request)*numprocs); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs); /* open file pointers */ @@ -2901,7 +2901,7 @@ void Save_DOS_NonCol(int n, int MaxN, in MPI_Comm_size(mpi_comm_level1,&numprocs); MPI_Comm_rank(mpi_comm_level1,&myid); - request_recv = malloc(sizeof(MPI_Request)*numprocs); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs); /* open file pointers */ --- Cluster_DFT_ON2.c.orig 2016-03-27 06:53:28 UTC +++ Cluster_DFT_ON2.c @@ -10,6 +10,7 @@ ***********************************************************************/ +#include <complex.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1275,9 +1276,9 @@ static void OND_Solver( MPI_Request *request_send; MPI_Request *request_recv; - stat_send = malloc(sizeof(MPI_Status)*numprocs2); - request_send = malloc(sizeof(MPI_Request)*numprocs2); - request_recv = malloc(sizeof(MPI_Request)*numprocs2); + stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*numprocs2); + request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs2); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs2); al.r = 1.0; al.i = 0.0; --- Mixing_H.c.orig 2018-08-29 05:53:55 UTC +++ Mixing_H.c @@ -74,7 +74,7 @@ void Pulay_Mixing_H_MultiSecant(int MD_i double sum,my_sum,tmp1,tmp2,alpha; double r,r10,r11,r12,r13,r20,r21,r22; double h,h10,h11,h12,h13,h20,h21,h22; - double my_sy,my_yy,sy,yy,norm,s,y,or,al,be; + double my_sy,my_yy,sy,yy,norm,s,y,orx,al,be; double **A,**IA,*coes,*coes2,*ror; char nanchar[300]; @@ -635,44 +635,44 @@ void Pulay_Mixing_H_MultiSecant(int MD_i s = HisH1[m][0][Mc_AN][h_AN][i][j] - HisH1[m+1][0][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[m][0][Mc_AN][h_AN][i][j] - ResidualH1[m+1][0][Mc_AN][h_AN][i][j]; /* y */ r = s - al*y; /* r */ - or = ResidualH1[dim+1][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += r*or; + orx = ResidualH1[dim+1][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += r*orx; s = HisH1[m][1][Mc_AN][h_AN][i][j] - HisH1[m+1][1][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[m][1][Mc_AN][h_AN][i][j] - ResidualH1[m+1][1][Mc_AN][h_AN][i][j]; /* y */ r = s - al*y; /* r */ - or = ResidualH1[dim+1][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += r*or; + orx = ResidualH1[dim+1][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += r*orx; s = HisH1[m][2][Mc_AN][h_AN][i][j] - HisH1[m+1][2][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[m][2][Mc_AN][h_AN][i][j] - ResidualH1[m+1][2][Mc_AN][h_AN][i][j]; /* y */ r = s - al*y; /* r */ - or = ResidualH1[dim+1][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += r*or; + orx = ResidualH1[dim+1][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += r*orx; s = HisH1[m][3][Mc_AN][h_AN][i][j] - HisH1[m+1][3][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[m][3][Mc_AN][h_AN][i][j] - ResidualH1[m+1][3][Mc_AN][h_AN][i][j]; /* y */ r = s - al*y; /* r */ - or = ResidualH1[dim+1][3][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += r*or; + orx = ResidualH1[dim+1][3][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += r*orx; s = HisH2[m][0][Mc_AN][h_AN][i][j] - HisH2[m+1][0][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH2[m][0][Mc_AN][h_AN][i][j] - ResidualH2[m+1][0][Mc_AN][h_AN][i][j]; /* y */ r = s - al*y; /* r */ - or = ResidualH2[dim+1][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += r*or; + orx = ResidualH2[dim+1][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += r*orx; s = HisH2[m][1][Mc_AN][h_AN][i][j] - HisH2[m+1][1][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH2[m][1][Mc_AN][h_AN][i][j] - ResidualH2[m+1][1][Mc_AN][h_AN][i][j]; /* y */ r = s - al*y; /* r */ - or = ResidualH2[dim+1][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += r*or; + orx = ResidualH2[dim+1][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += r*orx; s = HisH2[m][2][Mc_AN][h_AN][i][j] - HisH2[m+1][2][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH2[m][2][Mc_AN][h_AN][i][j] - ResidualH2[m+1][2][Mc_AN][h_AN][i][j]; /* y */ r = s - al*y; /* r */ - or = ResidualH2[dim+1][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += r*or; + orx = ResidualH2[dim+1][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += r*orx; } } @@ -696,8 +696,8 @@ void Pulay_Mixing_H_MultiSecant(int MD_i s = HisH1[m][spin][Mc_AN][h_AN][i][j] - HisH1[m+1][spin][Mc_AN][h_AN][i][j]; y = ResidualH1[m][spin][Mc_AN][h_AN][i][j] - ResidualH1[m+1][spin][Mc_AN][h_AN][i][j]; r = s - al*y; - or = ResidualH1[dim+1][spin][Mc_AN][h_AN][i][j]; - my_sum += r*or; + orx = ResidualH1[dim+1][spin][Mc_AN][h_AN][i][j]; + my_sum += r*orx; } } } @@ -986,7 +986,7 @@ void Pulay_Mixing_H_with_One_Shot_Hessia double my_sum,tmp1,tmp2,alpha; double r,r10,r11,r12,r13,r20,r21,r22; double h,h10,h11,h12,h13,h20,h21,h22; - double my_sy,my_yy,sy,yy,norm,s,y,or,al,be; + double my_sy,my_yy,sy,yy,norm,s,y,orx,al,be; double **A,**IA,*coes; char nanchar[300]; @@ -1427,38 +1427,38 @@ void Pulay_Mixing_H_with_One_Shot_Hessia s = HisH1[0][0][Mc_AN][h_AN][i][j] - HisH1[1][0][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[0][0][Mc_AN][h_AN][i][j] - ResidualH1[1][0][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH1[dim][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += (s-al*y)*or; + orx = ResidualH1[dim][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += (s-al*y)*orx; s = HisH1[0][1][Mc_AN][h_AN][i][j] - HisH1[1][1][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[0][1][Mc_AN][h_AN][i][j] - ResidualH1[1][1][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH1[dim][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += (s-al*y)*or; + orx = ResidualH1[dim][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += (s-al*y)*orx; s = HisH1[0][2][Mc_AN][h_AN][i][j] - HisH1[1][2][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[0][2][Mc_AN][h_AN][i][j] - ResidualH1[1][2][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH1[dim][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += (s-al*y)*or; + orx = ResidualH1[dim][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += (s-al*y)*orx; s = HisH1[0][3][Mc_AN][h_AN][i][j] - HisH1[1][3][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[0][3][Mc_AN][h_AN][i][j] - ResidualH1[1][3][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH1[dim][3][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += (s-al*y)*or; + orx = ResidualH1[dim][3][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += (s-al*y)*orx; s = HisH2[0][0][Mc_AN][h_AN][i][j] - HisH2[1][0][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH2[0][0][Mc_AN][h_AN][i][j] - ResidualH2[1][0][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH2[dim][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += (s-al*y)*or; + orx = ResidualH2[dim][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += (s-al*y)*orx; s = HisH2[0][1][Mc_AN][h_AN][i][j] - HisH2[1][1][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH2[0][1][Mc_AN][h_AN][i][j] - ResidualH2[1][1][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH2[dim][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += (s-al*y)*or; + orx = ResidualH2[dim][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += (s-al*y)*orx; s = HisH2[0][2][Mc_AN][h_AN][i][j] - HisH2[1][2][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH2[0][2][Mc_AN][h_AN][i][j] - ResidualH2[1][2][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH2[dim][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += (s-al*y)*or; + orx = ResidualH2[dim][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += (s-al*y)*orx; } } } @@ -1479,8 +1479,8 @@ void Pulay_Mixing_H_with_One_Shot_Hessia for (j=0; j<Spe_Total_NO[Hwan]; j++){ s = HisH1[0][spin][Mc_AN][h_AN][i][j] - HisH1[1][spin][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[0][spin][Mc_AN][h_AN][i][j] - ResidualH1[1][spin][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH1[dim][spin][Mc_AN][h_AN][i][j]; /* OptResidualH */ - my_sum += (s-al*y)*or; + orx = ResidualH1[dim][spin][Mc_AN][h_AN][i][j]; /* OptResidualH */ + my_sum += (s-al*y)*orx; } } } @@ -1541,38 +1541,38 @@ void Pulay_Mixing_H_with_One_Shot_Hessia s = HisH1[0][0][Mc_AN][h_AN][i][j] - HisH1[1][0][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[0][0][Mc_AN][h_AN][i][j] - ResidualH1[1][0][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH1[dim][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ - H[0][Mc_AN][h_AN][i][j] = h10 - alpha*(al*or + (s-al*y)*be); + orx = ResidualH1[dim][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ + H[0][Mc_AN][h_AN][i][j] = h10 - alpha*(al*orx + (s-al*y)*be); s = HisH1[0][1][Mc_AN][h_AN][i][j] - HisH1[1][1][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[0][1][Mc_AN][h_AN][i][j] - ResidualH1[1][1][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH1[dim][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ - H[1][Mc_AN][h_AN][i][j] = h11 - alpha*(al*or + (s-al*y)*be); + orx = ResidualH1[dim][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ + H[1][Mc_AN][h_AN][i][j] = h11 - alpha*(al*orx + (s-al*y)*be); s = HisH1[0][2][Mc_AN][h_AN][i][j] - HisH1[1][2][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[0][2][Mc_AN][h_AN][i][j] - ResidualH1[1][2][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH1[dim][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ - H[2][Mc_AN][h_AN][i][j] = h12 - alpha*(al*or + (s-al*y)*be); + orx = ResidualH1[dim][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ + H[2][Mc_AN][h_AN][i][j] = h12 - alpha*(al*orx + (s-al*y)*be); s = HisH1[0][3][Mc_AN][h_AN][i][j] - HisH1[1][3][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[0][3][Mc_AN][h_AN][i][j] - ResidualH1[1][3][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH1[dim][3][Mc_AN][h_AN][i][j]; /* OptResidualH */ - H[3][Mc_AN][h_AN][i][j] = h13 - alpha*(al*or + (s-al*y)*be); + orx = ResidualH1[dim][3][Mc_AN][h_AN][i][j]; /* OptResidualH */ + H[3][Mc_AN][h_AN][i][j] = h13 - alpha*(al*orx + (s-al*y)*be); s = HisH2[0][0][Mc_AN][h_AN][i][j] - HisH2[1][0][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH2[0][0][Mc_AN][h_AN][i][j] - ResidualH2[1][0][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH2[dim][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ - iHNL[0][Mc_AN][h_AN][i][j] = h20 - alpha*(al*or + (s-al*y)*be); + orx = ResidualH2[dim][0][Mc_AN][h_AN][i][j]; /* OptResidualH */ + iHNL[0][Mc_AN][h_AN][i][j] = h20 - alpha*(al*orx + (s-al*y)*be); s = HisH2[0][1][Mc_AN][h_AN][i][j] - HisH2[1][1][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH2[0][1][Mc_AN][h_AN][i][j] - ResidualH2[1][1][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH2[dim][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ - iHNL[1][Mc_AN][h_AN][i][j] = h21 - alpha*(al*or + (s-al*y)*be); + orx = ResidualH2[dim][1][Mc_AN][h_AN][i][j]; /* OptResidualH */ + iHNL[1][Mc_AN][h_AN][i][j] = h21 - alpha*(al*orx + (s-al*y)*be); s = HisH2[0][2][Mc_AN][h_AN][i][j] - HisH2[1][2][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH2[0][2][Mc_AN][h_AN][i][j] - ResidualH2[1][2][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH2[dim][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ - iHNL[2][Mc_AN][h_AN][i][j] = h22 - alpha*(al*or + (s-al*y)*be); + orx = ResidualH2[dim][2][Mc_AN][h_AN][i][j]; /* OptResidualH */ + iHNL[2][Mc_AN][h_AN][i][j] = h22 - alpha*(al*orx + (s-al*y)*be); } } } @@ -1599,8 +1599,8 @@ void Pulay_Mixing_H_with_One_Shot_Hessia s = HisH1[0][spin][Mc_AN][h_AN][i][j] - HisH1[1][spin][Mc_AN][h_AN][i][j]; /* s */ y = ResidualH1[0][spin][Mc_AN][h_AN][i][j] - ResidualH1[1][spin][Mc_AN][h_AN][i][j]; /* y */ - or = ResidualH1[dim][spin][Mc_AN][h_AN][i][j]; /* OptResidualH */ - H[spin][Mc_AN][h_AN][i][j] = h - alpha*(al*or + (s-al*y)*be); + orx = ResidualH1[dim][spin][Mc_AN][h_AN][i][j]; /* OptResidualH */ + H[spin][Mc_AN][h_AN][i][j] = h - alpha*(al*orx + (s-al*y)*be); } } --- Poisson.c.orig 2018-08-29 05:58:06 UTC +++ Poisson.c @@ -141,8 +141,8 @@ void FFT_Poisson(double *ReRhor, double allocation of arrays: ****************************************************/ - in = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); - out = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); + in = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); + out = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); /*------------------ FFT along the C-axis in the AB partition ------------------*/ @@ -182,10 +182,10 @@ void FFT_Poisson(double *ReRhor, double array0 = (double*)malloc(sizeof(double)*2*GP_B_AB2CA_S[NN_B_AB2CA_S]); array1 = (double*)malloc(sizeof(double)*2*GP_B_AB2CA_R[NN_B_AB2CA_R]); - request_send = malloc(sizeof(MPI_Request)*NN_B_AB2CA_S); - request_recv = malloc(sizeof(MPI_Request)*NN_B_AB2CA_R); - stat_send = malloc(sizeof(MPI_Status)*NN_B_AB2CA_S); - stat_recv = malloc(sizeof(MPI_Status)*NN_B_AB2CA_R); + request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*NN_B_AB2CA_S); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*NN_B_AB2CA_R); + stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*NN_B_AB2CA_S); + stat_recv = (MPI_Status *)malloc(sizeof(MPI_Status)*NN_B_AB2CA_R); NN_S = 0; NN_R = 0; @@ -307,10 +307,10 @@ void FFT_Poisson(double *ReRhor, double array0 = (double*)malloc(sizeof(double)*2*GP_B_CA2CB_S[NN_B_CA2CB_S]); array1 = (double*)malloc(sizeof(double)*2*GP_B_CA2CB_R[NN_B_CA2CB_R]); - request_send = malloc(sizeof(MPI_Request)*NN_B_CA2CB_S); - request_recv = malloc(sizeof(MPI_Request)*NN_B_CA2CB_R); - stat_send = malloc(sizeof(MPI_Status)*NN_B_CA2CB_S); - stat_recv = malloc(sizeof(MPI_Status)*NN_B_CA2CB_R); + request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*NN_B_CA2CB_S); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*NN_B_CA2CB_R); + stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*NN_B_CA2CB_S); + stat_recv = (MPI_Status *)malloc(sizeof(MPI_Status)*NN_B_CA2CB_R); NN_S = 0; NN_R = 0; @@ -503,8 +503,8 @@ void Inverse_FFT_Poisson(double *ReRhor, fftw_complex out[List_YOUSO[17]]; ****************************************************/ - in = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); - out = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); + in = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); + out = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); /*------------------ Inverse FFT along the A-axis in the CB partition ------------------*/ @@ -544,10 +544,10 @@ void Inverse_FFT_Poisson(double *ReRhor, array0 = (double*)malloc(sizeof(double)*2*GP_B_CA2CB_R[NN_B_CA2CB_R]); array1 = (double*)malloc(sizeof(double)*2*GP_B_CA2CB_S[NN_B_CA2CB_S]); - request_send = malloc(sizeof(MPI_Request)*NN_B_CA2CB_R); - request_recv = malloc(sizeof(MPI_Request)*NN_B_CA2CB_S); - stat_send = malloc(sizeof(MPI_Status)*NN_B_CA2CB_R); - stat_recv = malloc(sizeof(MPI_Status)*NN_B_CA2CB_S); + request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*NN_B_CA2CB_R); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*NN_B_CA2CB_S); + stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*NN_B_CA2CB_R); + stat_recv = (MPI_Status *)malloc(sizeof(MPI_Status)*NN_B_CA2CB_S); NN_S = 0; NN_R = 0; @@ -669,10 +669,10 @@ void Inverse_FFT_Poisson(double *ReRhor, array0 = (double*)malloc(sizeof(double)*2*GP_B_AB2CA_R[NN_B_AB2CA_R]); array1 = (double*)malloc(sizeof(double)*2*GP_B_AB2CA_S[NN_B_AB2CA_S]); - request_send = malloc(sizeof(MPI_Request)*NN_B_AB2CA_R); - request_recv = malloc(sizeof(MPI_Request)*NN_B_AB2CA_S); - stat_send = malloc(sizeof(MPI_Status)*NN_B_AB2CA_R); - stat_recv = malloc(sizeof(MPI_Status)*NN_B_AB2CA_S); + request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*NN_B_AB2CA_R); + request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*NN_B_AB2CA_S); + stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*NN_B_AB2CA_R); + stat_recv = (MPI_Status *)malloc(sizeof(MPI_Status)*NN_B_AB2CA_S); NN_S = 0; NN_R = 0; --- Poisson_ESM.c.orig 2018-08-29 06:03:16 UTC +++ Poisson_ESM.c @@ -71,8 +71,8 @@ double Poisson_ESM(int fft_charge_flag, fftw_complex out[List_YOUSO[17]]; ****************************************************/ - in0 = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); - out0 = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); + in0 = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); + out0 = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); if (myid==Host_ID) { @@ -908,8 +908,8 @@ void One_dim_FFT(FILE *fp, fftw_complex out[List_YOUSO[17]]; ****************************************************/ - in = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); - out = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); + in = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); + out = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); p = fftw_plan_dft_1d(Ngrid1, in, out, sgn2, FFTW_ESTIMATE); --- bandgnu13.c.orig 2018-09-11 19:33:10 UTC +++ bandgnu13.c @@ -75,7 +75,7 @@ void vk_rtv(double vk[4], double rtv[4][ #define MUNIT 2 -main(int argc, char **argv) +int main(int argc, char **argv) { static double Unit0[MUNIT]={27.2,1.0}; /* Hartree-> eV */ static char *Unitname0[MUNIT]={"eV","Hartree"};
| |