git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14805 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -69,11 +69,11 @@ PairLineLJ::~PairLineLJ()
|
|||||||
|
|
||||||
void PairLineLJ::compute(int eflag, int vflag)
|
void PairLineLJ::compute(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
int i,j,ii,jj,inum,jnum,itype,jtype,tmp;
|
int i,j,ii,jj,inum,jnum,itype,jtype;
|
||||||
int ni,nj,npi,npj,ifirst,jfirst;
|
int ni,nj,npi,npj,ifirst,jfirst;
|
||||||
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
|
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
|
||||||
double rsq,r2inv,r6inv,term1,term2,sig,sig3,forcelj;
|
double rsq,r2inv,r6inv,term1,term2,sig,sig3,forcelj;
|
||||||
double xi[2],xj[2],fi[2],fj[2],dxi,dxj,dyi,dyj;
|
double xi[2],xj[2],fi[2],dxi,dxj,dyi,dyj;
|
||||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||||
|
|
||||||
evdwl = 0.0;
|
evdwl = 0.0;
|
||||||
|
|||||||
@ -33,7 +33,24 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
const char version[] = "2.0";
|
const char version[] = "2.1";
|
||||||
|
|
||||||
|
/* store list of accepted extensions for object targets */
|
||||||
|
static const char *extensions[] = { ".cpp", ".c", ".cu" };
|
||||||
|
static const int numextensions = sizeof(extensions)/sizeof(const char *);
|
||||||
|
|
||||||
|
/* strdup() is not part of ANSI C. provide a replacement for portability */
|
||||||
|
static char *my_strdup(const char *src)
|
||||||
|
{
|
||||||
|
int len;
|
||||||
|
char *ptr;
|
||||||
|
|
||||||
|
if (src == NULL) return NULL;
|
||||||
|
len = strlen(src);
|
||||||
|
ptr = (char *)malloc(len+1);
|
||||||
|
if (ptr) memcpy(ptr,src,len+1);
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* utility functions
|
* utility functions
|
||||||
@ -198,7 +215,7 @@ static void llist_append(llist_t *ll, const char *key)
|
|||||||
llnode_t *tmp;
|
llnode_t *tmp;
|
||||||
if ((ll == NULL) || (key == NULL)) return;
|
if ((ll == NULL) || (key == NULL)) return;
|
||||||
|
|
||||||
ll->tail->key = strdup(key);
|
ll->tail->key = my_strdup(key);
|
||||||
ll->count ++;
|
ll->count ++;
|
||||||
tmp = (llnode_t *)malloc(sizeof(llnode_t));
|
tmp = (llnode_t *)malloc(sizeof(llnode_t));
|
||||||
tmp->key = NULL;
|
tmp->key = NULL;
|
||||||
@ -286,7 +303,7 @@ static void set_add(set_t *s, const char *key)
|
|||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
}
|
}
|
||||||
s->count ++;
|
s->count ++;
|
||||||
tmp->key = strdup(key);
|
tmp->key = my_strdup(key);
|
||||||
tmp->next = (llnode_t *)malloc(sizeof(llnode_t));
|
tmp->next = (llnode_t *)malloc(sizeof(llnode_t));
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
tmp->key = NULL;
|
tmp->key = NULL;
|
||||||
@ -375,7 +392,7 @@ static void map_add(map_t *m, const char *key, const char *val)
|
|||||||
/* add new entry to map */
|
/* add new entry to map */
|
||||||
if (tmp->next == NULL) {
|
if (tmp->next == NULL) {
|
||||||
m->count ++;
|
m->count ++;
|
||||||
tmp->key = strdup(key);
|
tmp->key = my_strdup(key);
|
||||||
tmp->val = set_init(50); /* XXX: chosen arbitrarily */
|
tmp->val = set_init(50); /* XXX: chosen arbitrarily */
|
||||||
tmp->next = (mapnode_t *)malloc(sizeof(mapnode_t));
|
tmp->next = (mapnode_t *)malloc(sizeof(mapnode_t));
|
||||||
tmp->next->key = NULL;
|
tmp->next->key = NULL;
|
||||||
@ -547,42 +564,52 @@ static void do_depend(llnode_t *head, map_t *deps)
|
|||||||
set_t *incl;
|
set_t *incl;
|
||||||
const char *source;
|
const char *source;
|
||||||
char *target, *ptr;
|
char *target, *ptr;
|
||||||
int i,num;
|
int i,num,ext;
|
||||||
|
|
||||||
tmp = head;
|
tmp = head;
|
||||||
while (tmp->next != NULL) {
|
while (tmp->next != NULL) {
|
||||||
source = tmp->key;
|
source = tmp->key;
|
||||||
target = strrchr(source,'/');
|
target = strrchr(source,'/');
|
||||||
if (target == NULL) {
|
if (target == NULL) {
|
||||||
target = strdup(source);
|
target = my_strdup(source);
|
||||||
} else {
|
} else {
|
||||||
target = strdup(target+1);
|
target = my_strdup(target+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext = 0;
|
||||||
ptr = strrchr(target,'.');
|
ptr = strrchr(target,'.');
|
||||||
if (ptr != NULL) {
|
if (ptr != NULL) {
|
||||||
ptr[1] = 'o';
|
for (i = 0; i < numextensions; ++i) {
|
||||||
ptr[2] = '\0';
|
if (strcmp(ptr,extensions[i]) == 0) ++ext;
|
||||||
}
|
}
|
||||||
fputs(target,stdout);
|
if (ext > 0) {
|
||||||
fputs(" : ",stdout);
|
ptr[1] = 'o';
|
||||||
fputs(source,stdout);
|
ptr[2] = '\0';
|
||||||
free((void *)target);
|
|
||||||
|
|
||||||
incl = set_init(50);
|
|
||||||
add_depend(source,incl,deps);
|
|
||||||
|
|
||||||
num = incl->nbuckets;
|
|
||||||
for (i = 0; i < num; ++i) {
|
|
||||||
lnk = incl->buckets + i;
|
|
||||||
while (lnk->next != NULL) {
|
|
||||||
fputc(' ',stdout);
|
|
||||||
fputs(lnk->key,stdout);
|
|
||||||
lnk = lnk->next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fputc('\n',stdout);
|
|
||||||
set_free(incl);
|
if (ext > 0) {
|
||||||
|
fputs(target,stdout);
|
||||||
|
fputs(" : ",stdout);
|
||||||
|
fputs(source,stdout);
|
||||||
|
|
||||||
|
incl = set_init(50);
|
||||||
|
add_depend(source,incl,deps);
|
||||||
|
|
||||||
|
num = incl->nbuckets;
|
||||||
|
for (i = 0; i < num; ++i) {
|
||||||
|
lnk = incl->buckets + i;
|
||||||
|
while (lnk->next != NULL) {
|
||||||
|
fputc(' ',stdout);
|
||||||
|
fputs(lnk->key,stdout);
|
||||||
|
lnk = lnk->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fputc('\n',stdout);
|
||||||
|
set_free(incl);
|
||||||
|
}
|
||||||
|
|
||||||
|
free((void *)target);
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -601,6 +628,8 @@ int main(int argc, char **argv)
|
|||||||
fprintf(stderr,"FastDep v%s for LAMMPS\n"
|
fprintf(stderr,"FastDep v%s for LAMMPS\n"
|
||||||
"Usage: %s [-I <path> ...] -- <src1> [<src2> ...]\n",
|
"Usage: %s [-I <path> ...] -- <src1> [<src2> ...]\n",
|
||||||
version,argv[0]);
|
version,argv[0]);
|
||||||
|
fprintf(stderr,"Supported extensions: %d, %s, %s\n",numextensions,
|
||||||
|
extensions[0], extensions[1]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -631,7 +660,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
} else if (strcmp(*argv,"--") == 0) {
|
} else if (strcmp(*argv,"--") == 0) {
|
||||||
break;
|
break;
|
||||||
} // ignore all unrecognized arguments before '--'.
|
} /* ignore all unrecognized arguments before '--'. */
|
||||||
}
|
}
|
||||||
|
|
||||||
src = llist_init();
|
src = llist_init();
|
||||||
|
|||||||
@ -87,7 +87,6 @@ void PairGranHertzHistory::compute(int eflag, int vflag)
|
|||||||
double **torque = atom->torque;
|
double **torque = atom->torque;
|
||||||
double *radius = atom->radius;
|
double *radius = atom->radius;
|
||||||
double *rmass = atom->rmass;
|
double *rmass = atom->rmass;
|
||||||
int *type = atom->type;
|
|
||||||
int *mask = atom->mask;
|
int *mask = atom->mask;
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
@ -367,7 +366,6 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
|
|||||||
// if I or J is frozen, meff is other particle
|
// if I or J is frozen, meff is other particle
|
||||||
|
|
||||||
double *rmass = atom->rmass;
|
double *rmass = atom->rmass;
|
||||||
int *type = atom->type;
|
|
||||||
int *mask = atom->mask;
|
int *mask = atom->mask;
|
||||||
|
|
||||||
mi = rmass[i];
|
mi = rmass[i];
|
||||||
|
|||||||
@ -81,7 +81,6 @@ void PairGranHooke::compute(int eflag, int vflag)
|
|||||||
double **torque = atom->torque;
|
double **torque = atom->torque;
|
||||||
double *radius = atom->radius;
|
double *radius = atom->radius;
|
||||||
double *rmass = atom->rmass;
|
double *rmass = atom->rmass;
|
||||||
int *type = atom->type;
|
|
||||||
int *mask = atom->mask;
|
int *mask = atom->mask;
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
int newton_pair = force->newton_pair;
|
int newton_pair = force->newton_pair;
|
||||||
@ -285,7 +284,6 @@ double PairGranHooke::single(int i, int j, int itype, int jtype, double rsq,
|
|||||||
// if I or J is frozen, meff is other particle
|
// if I or J is frozen, meff is other particle
|
||||||
|
|
||||||
double *rmass = atom->rmass;
|
double *rmass = atom->rmass;
|
||||||
int *type = atom->type;
|
|
||||||
int *mask = atom->mask;
|
int *mask = atom->mask;
|
||||||
|
|
||||||
mi = rmass[i];
|
mi = rmass[i];
|
||||||
|
|||||||
@ -129,7 +129,6 @@ void PairGranHookeHistory::compute(int eflag, int vflag)
|
|||||||
double **torque = atom->torque;
|
double **torque = atom->torque;
|
||||||
double *radius = atom->radius;
|
double *radius = atom->radius;
|
||||||
double *rmass = atom->rmass;
|
double *rmass = atom->rmass;
|
||||||
int *type = atom->type;
|
|
||||||
int *mask = atom->mask;
|
int *mask = atom->mask;
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
@ -670,7 +669,6 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
|
|||||||
// if I or J is frozen, meff is other particle
|
// if I or J is frozen, meff is other particle
|
||||||
|
|
||||||
double *rmass = atom->rmass;
|
double *rmass = atom->rmass;
|
||||||
int *type = atom->type;
|
|
||||||
int *mask = atom->mask;
|
int *mask = atom->mask;
|
||||||
|
|
||||||
mi = rmass[i];
|
mi = rmass[i];
|
||||||
|
|||||||
@ -189,6 +189,14 @@ if (test $1 = 1) then
|
|||||||
sed -i -e '5 i \include ..\/..\/lib\/kokkos\/Makefile.kokkos' ../Makefile.package.settings
|
sed -i -e '5 i \include ..\/..\/lib\/kokkos\/Makefile.kokkos' ../Makefile.package.settings
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# comb/omp triggers a persistent bug in nvcc. deleting it.
|
||||||
|
rm -f ../*_comb_omp.*
|
||||||
|
|
||||||
|
elif (test $1 = 2) then
|
||||||
|
|
||||||
|
# comb/omp triggers a persistent bug in nvcc. deleting it.
|
||||||
|
rm -f ../*_comb_omp.*
|
||||||
|
|
||||||
elif (test $1 = 0) then
|
elif (test $1 = 0) then
|
||||||
|
|
||||||
if (test -e ../Makefile.package) then
|
if (test -e ../Makefile.package) then
|
||||||
|
|||||||
@ -291,7 +291,6 @@ void FixNHKokkos<DeviceType>::final_integrate()
|
|||||||
template<class DeviceType>
|
template<class DeviceType>
|
||||||
void FixNHKokkos<DeviceType>::remap()
|
void FixNHKokkos<DeviceType>::remap()
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
double oldlo,oldhi;
|
double oldlo,oldhi;
|
||||||
double expfac;
|
double expfac;
|
||||||
|
|
||||||
|
|||||||
@ -2251,7 +2251,6 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
|
|||||||
ril[1] = rij[1]+rjl[1];
|
ril[1] = rij[1]+rjl[1];
|
||||||
ril[2] = rij[2]+rjl[2];
|
ril[2] = rij[2]+rjl[2];
|
||||||
ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
|
ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
|
||||||
rijrjl = 2.0*rijmag*rjlmag;
|
|
||||||
rjl2 = rjlmag*rjlmag;
|
rjl2 = rjlmag*rjlmag;
|
||||||
costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
|
costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
|
||||||
tspijl = Sp2(costmp,thmin,thmax,dtsijl);
|
tspijl = Sp2(costmp,thmin,thmax,dtsijl);
|
||||||
|
|||||||
@ -993,7 +993,6 @@ void PairBOP::theta()
|
|||||||
int *ilist;
|
int *ilist;
|
||||||
int *iilist;
|
int *iilist;
|
||||||
int **firstneigh;
|
int **firstneigh;
|
||||||
int maxn,maxt;
|
|
||||||
double rj2,rk2,rsq,ps;
|
double rj2,rk2,rsq,ps;
|
||||||
double rj1k1,rj2k2;
|
double rj1k1,rj2k2;
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
@ -1015,8 +1014,6 @@ void PairBOP::theta()
|
|||||||
itype = map[type[i]]+1;
|
itype = map[type[i]]+1;
|
||||||
|
|
||||||
iilist=firstneigh[i];
|
iilist=firstneigh[i];
|
||||||
maxt=0;
|
|
||||||
maxn=0;
|
|
||||||
nlisti=BOP_total[i];
|
nlisti=BOP_total[i];
|
||||||
for(jj=0;jj<nlisti;jj++) {
|
for(jj=0;jj<nlisti;jj++) {
|
||||||
temp_ij=BOP_index[i]+jj;
|
temp_ij=BOP_index[i]+jj;
|
||||||
@ -1038,10 +1035,8 @@ void PairBOP::theta()
|
|||||||
+disij[1][temp_ij]*disij[1][temp_ij]
|
+disij[1][temp_ij]*disij[1][temp_ij]
|
||||||
+disij[2][temp_ij]*disij[2][temp_ij];
|
+disij[2][temp_ij]*disij[2][temp_ij];
|
||||||
rij[temp_ij]=sqrt(rsq);
|
rij[temp_ij]=sqrt(rsq);
|
||||||
if(rij[temp_ij]<=rcut[i12]) {
|
if(rij[temp_ij]<=rcut[i12])
|
||||||
neigh_flag[temp_ij]=1;
|
neigh_flag[temp_ij]=1;
|
||||||
maxt++;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
neigh_flag[temp_ij]=0;
|
neigh_flag[temp_ij]=0;
|
||||||
if(rij[temp_ij]<=rcut3[i12])
|
if(rij[temp_ij]<=rcut3[i12])
|
||||||
@ -1067,7 +1062,6 @@ void PairBOP::theta()
|
|||||||
dRepul[temp_ij]=(pRepul6[i12][ks-1]*ps+pRepul5[i12][ks-1])*ps
|
dRepul[temp_ij]=(pRepul6[i12][ks-1]*ps+pRepul5[i12][ks-1])*ps
|
||||||
+pRepul4[i12][ks-1];
|
+pRepul4[i12][ks-1];
|
||||||
}
|
}
|
||||||
if(maxt>maxn) maxn=maxt;
|
|
||||||
}
|
}
|
||||||
for (ii = 0; ii < nall; ii++) {
|
for (ii = 0; ii < nall; ii++) {
|
||||||
n=0;
|
n=0;
|
||||||
|
|||||||
@ -921,13 +921,13 @@ int PairEIM::grabsingle(FILE *fptr, int i)
|
|||||||
pch1 = strstr(pch1,"element:");
|
pch1 = strstr(pch1,"element:");
|
||||||
if (pch1 != NULL) {
|
if (pch1 != NULL) {
|
||||||
pch2 = strtok(NULL, " \t\n\r\f");
|
pch2 = strtok(NULL, " \t\n\r\f");
|
||||||
if (pch2 != NULL) data = strtok (NULL, "?");
|
if (pch2 != NULL) {
|
||||||
if (strcmp(pch2,elements[i]) == 0) {
|
data = strtok (NULL, "?");
|
||||||
sscanf(data,"%d %lg %lg %lg %lg %lg %lg",&setfl->ielement[i],
|
if (strcmp(pch2,elements[i]) == 0) {
|
||||||
&setfl->mass[i],&setfl->negativity[i],&setfl->ra[i],
|
sscanf(data,"%d %lg %lg %lg %lg %lg %lg",&setfl->ielement[i],
|
||||||
&setfl->ri[i],&setfl->Ec[i],&setfl->q0[i]);
|
&setfl->mass[i],&setfl->negativity[i],&setfl->ra[i],
|
||||||
} else {
|
&setfl->ri[i],&setfl->Ec[i],&setfl->q0[i]);
|
||||||
pch2 = NULL;
|
} else pch2 = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -960,25 +960,27 @@ int PairEIM::grabpair(FILE *fptr, int i, int j)
|
|||||||
pch2 = strtok (NULL, " \t\n\r\f");
|
pch2 = strtok (NULL, " \t\n\r\f");
|
||||||
if (pch2 != NULL) pch3 = strtok (NULL, " \t\n\r\f");
|
if (pch2 != NULL) pch3 = strtok (NULL, " \t\n\r\f");
|
||||||
if (pch3 != NULL) data = strtok (NULL, "?");
|
if (pch3 != NULL) data = strtok (NULL, "?");
|
||||||
if ((strcmp(pch2,elements[i]) == 0 &&
|
if ((pch2 != NULL) && (pch3 != NULL)) {
|
||||||
strcmp(pch3,elements[j]) == 0) ||
|
if ((strcmp(pch2,elements[i]) == 0 &&
|
||||||
(strcmp(pch2,elements[j]) == 0 &&
|
strcmp(pch3,elements[j]) == 0) ||
|
||||||
strcmp(pch3,elements[i]) == 0)) {
|
(strcmp(pch2,elements[j]) == 0 &&
|
||||||
sscanf(data,"%lg %lg %lg %lg %lg",
|
strcmp(pch3,elements[i]) == 0)) {
|
||||||
&setfl->rcutphiA[ij],&setfl->rcutphiR[ij],
|
sscanf(data,"%lg %lg %lg %lg %lg",
|
||||||
&setfl->Eb[ij],&setfl->r0[ij],&setfl->alpha[ij]);
|
&setfl->rcutphiA[ij],&setfl->rcutphiR[ij],
|
||||||
fgets(line,MAXLINE,fptr);
|
&setfl->Eb[ij],&setfl->r0[ij],&setfl->alpha[ij]);
|
||||||
sscanf(line,"%lg %lg %lg %lg %lg",
|
fgets(line,MAXLINE,fptr);
|
||||||
&setfl->beta[ij],&setfl->rcutq[ij],&setfl->Asigma[ij],
|
sscanf(line,"%lg %lg %lg %lg %lg",
|
||||||
&setfl->rq[ij],&setfl->rcutsigma[ij]);
|
&setfl->beta[ij],&setfl->rcutq[ij],&setfl->Asigma[ij],
|
||||||
fgets(line,MAXLINE,fptr);
|
&setfl->rq[ij],&setfl->rcutsigma[ij]);
|
||||||
sscanf(line,"%lg %lg %lg %d",
|
fgets(line,MAXLINE,fptr);
|
||||||
&setfl->Ac[ij],&setfl->zeta[ij],&setfl->rs[ij],
|
sscanf(line,"%lg %lg %lg %d",
|
||||||
&setfl->tp[ij]);
|
&setfl->Ac[ij],&setfl->zeta[ij],&setfl->rs[ij],
|
||||||
} else {
|
&setfl->tp[ij]);
|
||||||
pch1 = NULL;
|
} else {
|
||||||
pch2 = NULL;
|
pch1 = NULL;
|
||||||
pch3 = NULL;
|
pch2 = NULL;
|
||||||
|
pch3 = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -631,6 +631,8 @@ void PairPolymorphic::read_file(char *file)
|
|||||||
if (ptr) maxX = atof(ptr);
|
if (ptr) maxX = atof(ptr);
|
||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
error->all(FLERR,"Potential file incompatible with this pair style version");
|
error->all(FLERR,"Potential file incompatible with this pair style version");
|
||||||
|
if ((ng == 0) || (nr == 0) || (nx == 0))
|
||||||
|
error->all(FLERR,"Error reading potential file header");
|
||||||
|
|
||||||
npair = nelements*(nelements+1)/2;
|
npair = nelements*(nelements+1)/2;
|
||||||
ntriple = nelements*nelements*nelements;
|
ntriple = nelements*nelements*nelements;
|
||||||
|
|||||||
@ -555,7 +555,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
|
|||||||
|
|
||||||
for (i = 0; i < nelements; i++)
|
for (i = 0; i < nelements; i++)
|
||||||
if (strcmp(words[0],elements[i]) == 0) break;
|
if (strcmp(words[0],elements[i]) == 0) break;
|
||||||
if (i == nelements) continue;
|
if (i >= nelements) continue;
|
||||||
|
|
||||||
// skip if element already appeared
|
// skip if element already appeared
|
||||||
|
|
||||||
|
|||||||
216
src/Make.py
216
src/Make.py
@ -15,14 +15,14 @@ import sys,os,commands,re,copy,subprocess
|
|||||||
# setargs = makefile settings
|
# setargs = makefile settings
|
||||||
# actionargs = allowed actions (also lib-dir and machine)
|
# actionargs = allowed actions (also lib-dir and machine)
|
||||||
|
|
||||||
abbrevs = "adhjmoprsv"
|
abbrevs = "adhjmoprsvz"
|
||||||
|
|
||||||
switchclasses = ("actions","dir","help","jmake","makefile",
|
switchclasses = ("actions","dir","help","jmake","makefile",
|
||||||
"output","packages","redo","settings","verbose")
|
"output","packages","redo","settings","verbose","zoutput")
|
||||||
libclasses = ("atc","awpmd","colvars","cuda","gpu","h5md",
|
libclasses = ("atc","awpmd","colvars","cuda","gpu","h5md",
|
||||||
"meam","poems","python","qmmm","reax","voronoi")
|
"meam","poems","python","qmmm","reax","voronoi")
|
||||||
buildclasses = ("intel","kokkos")
|
buildclasses = ("intel","kokkos")
|
||||||
makeclasses = ("cc","mpi","fft","jpg","png")
|
makeclasses = ("cc","flags","mpi","fft","jpg","png")
|
||||||
|
|
||||||
setargs = ("gzip","#gzip","ffmpeg","#ffmpeg","smallbig","bigbig","smallsmall")
|
setargs = ("gzip","#gzip","ffmpeg","#ffmpeg","smallbig","bigbig","smallsmall")
|
||||||
actionargs = ("lib-all","file","clean","exe")
|
actionargs = ("lib-all","file","clean","exe")
|
||||||
@ -137,27 +137,37 @@ class Actions:
|
|||||||
lib-all builds all auxiliary libs needed by installed packages
|
lib-all builds all auxiliary libs needed by installed packages
|
||||||
lib-dir builds a specific lib whether package installed or not
|
lib-dir builds a specific lib whether package installed or not
|
||||||
dir is any dir in lib directory (atc, cuda, meam, etc) except linalg
|
dir is any dir in lib directory (atc, cuda, meam, etc) except linalg
|
||||||
(2) file = create src/MAKE/MINE/Makefile.auto
|
(2) file = create a new src/MAKE/MINE/Makefile.auto
|
||||||
use -m switch for Makefile.machine to start from,
|
if file not specified, existing Makefile.auto is NOT changed
|
||||||
else use existing Makefile.auto
|
except by -m switch, which will copy Makefile.machine to Makefile.auto
|
||||||
adds settings needed for installed accelerator packages
|
note that exe action can add an -m switch, as described below
|
||||||
existing Makefile.auto is NOT changed unless "file" action is specified
|
if file is specified, new Makefile.auto is created
|
||||||
|
if "-m machine" specified (or added by exe),
|
||||||
|
start with existing Makefile.machine, else existing Makefile.auto
|
||||||
|
if "-m none" specified, start Makefile.auto from scratch
|
||||||
|
must use -cc and -mpi switches to specify compiler and MPI
|
||||||
|
settings for these switches will alter Makefile.auto
|
||||||
|
-s, -intel, -kokkos, -cc, -mpi, -fft, -jpg, -png
|
||||||
|
if these accelerator packages are installed, they induce settings
|
||||||
|
that will alter Makefile.auto: opt, user-omp, user-intel, kokkos
|
||||||
|
use -z switch to copy final Makefile.auto to new filename
|
||||||
(3) clean = invoke "make clean-auto" to insure clean build on current files
|
(3) clean = invoke "make clean-auto" to insure clean build on current files
|
||||||
useful if compiler flags have changed
|
useful if compiler flags have changed
|
||||||
(4) exe or machine = build LAMMPS
|
(4) exe or machine = build LAMMPS
|
||||||
machine can be any existing Makefile.machine suffix
|
machine can be any existing Makefile.machine suffix
|
||||||
machine is converted to "exe" action, as well as:
|
machine is converted to "exe" action, and additionally:
|
||||||
"-m machine" is added if -m switch is not specified
|
"-m machine" is added if -m switch is not specified
|
||||||
"-o machine" is added if -o switch is not specified
|
"-o machine" is added if -o switch is not specified
|
||||||
if either "-m" or "-o" are specified, they are not overridden
|
if either "-m" or "-o" are specified, they are not overridden
|
||||||
does not invoke any lib builds, since libs could be previously built
|
does not invoke any lib builds, since libs could be previously built
|
||||||
exe always builds using src/MAKE/MINE/Makefile.auto
|
exe ALWAYS builds using src/MAKE/MINE/Makefile.auto
|
||||||
if file action also specified, it creates Makefile.auto
|
if file action also specified, it creates a new Makefile.auto
|
||||||
else if -m switch specified,
|
else if -m switch specified,
|
||||||
existing Makefile.machine is copied to create Makefile.auto
|
existing Makefile.machine is copied to create Makefile.auto
|
||||||
else Makefile.auto must already exist and is not changed
|
else Makefile.auto must already exist and is not changed
|
||||||
produces src/lmp_auto, or error message if unsuccessful
|
build produces src/lmp_auto, or error message if unsuccessful
|
||||||
use -o switch to copy src/lmp_auto to new filename
|
use -o switch to copy src/lmp_auto to new filename
|
||||||
|
use -z switch to copy src/MAKE/MINE/Makefile.auto to new filename
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def check(self):
|
def check(self):
|
||||||
@ -177,7 +187,7 @@ class Actions:
|
|||||||
cleans.append(one)
|
cleans.append(one)
|
||||||
elif one == "exe":
|
elif one == "exe":
|
||||||
exes.append(one)
|
exes.append(one)
|
||||||
# one action can be unknown in case is a machine (checked in setup)
|
# one action can be unknown, must be a machine (checked in setup)
|
||||||
else:
|
else:
|
||||||
exes.append(one)
|
exes.append(one)
|
||||||
if len(set(libs)) != len(libs) or \
|
if len(set(libs)) != len(libs) or \
|
||||||
@ -236,9 +246,9 @@ class Actions:
|
|||||||
|
|
||||||
def file(self,caller):
|
def file(self,caller):
|
||||||
|
|
||||||
# if caller = "file", create from mpi or read from makefile.machine or auto
|
# if caller="file", create from mpi or read from Makefile.machine or auto
|
||||||
# if caller = "exe" and "file" action already invoked, read from auto
|
# if caller="exe" and "file" action already invoked, read from auto
|
||||||
# if caller = "exe" and no "file" action, read from makefile.machine or auto
|
# if caller="exe" and no "file" action, read from Makefile.machine or auto
|
||||||
|
|
||||||
if caller == "file":
|
if caller == "file":
|
||||||
if makefile and makefile.machine == "none":
|
if makefile and makefile.machine == "none":
|
||||||
@ -279,7 +289,7 @@ class Actions:
|
|||||||
make.addvar("CC","-cxx=%s" % wrapper)
|
make.addvar("CC","-cxx=%s" % wrapper)
|
||||||
make.addvar("LINK","-cxx=%s" % wrapper)
|
make.addvar("LINK","-cxx=%s" % wrapper)
|
||||||
elif "-lmpi" in txt:
|
elif "-lmpi" in txt:
|
||||||
make.addvar("OMPI_CXX",wrapper,"cc")
|
make.addvar("export OMPI_CXX",wrapper,"cc")
|
||||||
precompiler = "env OMPI_CXX=%s " % wrapper
|
precompiler = "env OMPI_CXX=%s " % wrapper
|
||||||
else: error("Could not add MPI wrapper compiler, " +
|
else: error("Could not add MPI wrapper compiler, " +
|
||||||
"did not recognize OpenMPI or MPICH")
|
"did not recognize OpenMPI or MPICH")
|
||||||
@ -287,8 +297,20 @@ class Actions:
|
|||||||
make.addvar("CCFLAGS","-O3")
|
make.addvar("CCFLAGS","-O3")
|
||||||
make.setvar("LINKFLAGS","-g")
|
make.setvar("LINKFLAGS","-g")
|
||||||
make.addvar("LINKFLAGS","-O")
|
make.addvar("LINKFLAGS","-O")
|
||||||
|
|
||||||
|
# add CC and LINK flags
|
||||||
|
|
||||||
# add MPI settings
|
if flags:
|
||||||
|
for flag in flags.CC:
|
||||||
|
flag = "-" + flag
|
||||||
|
if flag[:2] == "-O": make.delvar("CCFLAGS","-O*")
|
||||||
|
make.addvar("CCFLAGS",flag)
|
||||||
|
for flag in flags.LINK:
|
||||||
|
flag = "-" + flag
|
||||||
|
if flag[:2] == "-O": make.delvar("LINKFLAGS","-O*")
|
||||||
|
make.addvar("LINKFLAGS",flag)
|
||||||
|
|
||||||
|
# add MPI settings
|
||||||
|
|
||||||
if mpi:
|
if mpi:
|
||||||
make.delvar("MPI_INC","*")
|
make.delvar("MPI_INC","*")
|
||||||
@ -397,7 +419,7 @@ class Actions:
|
|||||||
make.addvar("KOKKOS_DEVICES","OpenMP","lmp")
|
make.addvar("KOKKOS_DEVICES","OpenMP","lmp")
|
||||||
make.addvar("KOKKOS_ARCH","KNC","lmp")
|
make.addvar("KOKKOS_ARCH","KNC","lmp")
|
||||||
|
|
||||||
# add LMP settings
|
# add LMP_INC ifdef settings
|
||||||
|
|
||||||
if settings:
|
if settings:
|
||||||
list = settings.inlist
|
list = settings.inlist
|
||||||
@ -465,12 +487,13 @@ class Actions:
|
|||||||
|
|
||||||
# set self.stubs if Makefile.auto uses STUBS lib in MPI settings
|
# set self.stubs if Makefile.auto uses STUBS lib in MPI settings
|
||||||
|
|
||||||
if "-lmpi_stubs" in make.getvar("MPI_LIB"): self.stubs = 1
|
if make.getvar("MPI_LIB") and "-lmpi_stubs" in make.getvar("MPI_LIB"):
|
||||||
|
self.stubs = 1
|
||||||
else: self.stubs = 0
|
else: self.stubs = 0
|
||||||
|
|
||||||
# write out Makefile.auto
|
# write out Makefile.auto
|
||||||
# unless caller = "exe" and "file" action already invoked
|
# unless caller = "exe" and "file" action already invoked
|
||||||
|
|
||||||
if caller == "file" or "file" not in self.alist:
|
if caller == "file" or "file" not in self.alist:
|
||||||
make.write("%s/MAKE/MINE/Makefile.auto" % dir.src,1)
|
make.write("%s/MAKE/MINE/Makefile.auto" % dir.src,1)
|
||||||
print "Created src/MAKE/MINE/Makefile.auto"
|
print "Created src/MAKE/MINE/Makefile.auto"
|
||||||
@ -510,13 +533,23 @@ class Actions:
|
|||||||
print txt
|
print txt
|
||||||
error('Unsuccessful "make stubs"')
|
error('Unsuccessful "make stubs"')
|
||||||
print "Created src/STUBS/libmpi_stubs.a"
|
print "Created src/STUBS/libmpi_stubs.a"
|
||||||
if jmake: str = "cd %s; make -j %d auto" % (dir.src,jmake.n)
|
|
||||||
else: str = "cd %s; make auto" % dir.src
|
# special hack for shannon GPU cluster
|
||||||
|
# must use "srun make" if on it and building w/ GPU package, else just make
|
||||||
|
# this is b/c Cuda libs are not all available on host
|
||||||
|
|
||||||
|
make = "make"
|
||||||
|
if "shannon" in os.environ.get("HOST") and packages.final["gpu"]:
|
||||||
|
make = "srun make"
|
||||||
|
|
||||||
|
if jmake: str = "cd %s; %s -j %d auto" % (dir.src,make,jmake.n)
|
||||||
|
else: str = "cd %s; %s auto" % (dir.src,make)
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(str,shell=True)
|
||||||
else:
|
else:
|
||||||
|
print str
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print e.output
|
||||||
|
|
||||||
@ -574,8 +607,8 @@ Syntax: Make.py switch args ...
|
|||||||
list one or more actions, in any order
|
list one or more actions, in any order
|
||||||
machine is a Makefile.machine suffix
|
machine is a Makefile.machine suffix
|
||||||
one-letter switches:
|
one-letter switches:
|
||||||
-d (dir), -j (jmake), -m (makefile), -o (output),
|
-d (dir), -j (jmake), -m (makefile), -o (output), -p (packages),
|
||||||
-p (packages), -r (redo), -s (settings), -v (verbose)
|
-r (redo), -s (settings), -v (verbose), -z (makefile output)
|
||||||
switches for libs:
|
switches for libs:
|
||||||
-atc, -awpmd, -colvars, -cuda, -gpu, -h5md,
|
-atc, -awpmd, -colvars, -cuda, -gpu, -h5md,
|
||||||
-meam, -poems, -python, -qmmm, -reax, -voronoi
|
-meam, -poems, -python, -qmmm, -reax, -voronoi
|
||||||
@ -898,9 +931,13 @@ class Settings:
|
|||||||
def help(self):
|
def help(self):
|
||||||
return """
|
return """
|
||||||
-s set1 set2 ...
|
-s set1 set2 ...
|
||||||
possible settings = gzip smallbig bigbig smallsmall
|
possible settings = gzip #gzip ffmpeg #ffmpeg smallbig bigbig smallsmall
|
||||||
add each setting as LAMMPS setting to created Makefile.auto
|
alter LAMMPS ifdef settings in Makefile.auto
|
||||||
if -s not specified, no settings are changed in Makefile.auto
|
only happens if new Makefile.auto is created by use of "file" action
|
||||||
|
gzip and #gzip turn on/off LAMMPS_GZIP setting
|
||||||
|
ffmpeg and #ffmpeg turn on/off LAMMPS_FFMPEG setting
|
||||||
|
smallbig, bigbig, smallsmall turn on LAMMPS_SMALLBIG, etc
|
||||||
|
and turn off other two
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def check(self):
|
def check(self):
|
||||||
@ -924,6 +961,23 @@ class Verbose:
|
|||||||
def check(self):
|
def check(self):
|
||||||
if len(self.inlist): error("-v args are invalid")
|
if len(self.inlist): error("-v args are invalid")
|
||||||
|
|
||||||
|
# zoutput switch for making copy of final Makefile.auto
|
||||||
|
|
||||||
|
class Zoutput:
|
||||||
|
def __init__(self,list):
|
||||||
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
def help(self):
|
||||||
|
return """
|
||||||
|
-z machine
|
||||||
|
copy created/used src/MAKE/MINE/Makefile.auto to Makefile.machine in same dir
|
||||||
|
this can be used to preserve the machine makefile
|
||||||
|
"""
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
if len(self.inlist) != 1: error("-z args are invalid")
|
||||||
|
self.machine = self.inlist[0]
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# lib classes, one per LAMMPS auxiliary lib
|
# lib classes, one per LAMMPS auxiliary lib
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
@ -1087,15 +1141,15 @@ class CUDA:
|
|||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.mode = "double"
|
self.mode = "double"
|
||||||
self.arch = "31"
|
self.arch = "35"
|
||||||
|
|
||||||
def help(self):
|
def help(self):
|
||||||
return """
|
return """
|
||||||
-cuda mode=double arch=31
|
-cuda mode=double arch=35
|
||||||
all args are optional and can be in any order
|
all args are optional and can be in any order
|
||||||
mode = double or mixed or single (def = double)
|
mode = double or mixed or single (def = double)
|
||||||
arch = M (def = 31)
|
arch = M (def = 35)
|
||||||
M = 31 for Kepler
|
M = 31,35,37,etc for Kepler
|
||||||
M = 20 for CC2.0 (GF100/110, e.g. C2050,GTX580,GTX470)
|
M = 20 for CC2.0 (GF100/110, e.g. C2050,GTX580,GTX470)
|
||||||
M = 21 for CC2.1 (GF104/114, e.g. GTX560, GTX460, GTX450)
|
M = 21 for CC2.1 (GF104/114, e.g. GTX560, GTX460, GTX450)
|
||||||
M = 13 for CC1.3 (GF200, e.g. C1060, GTX285)
|
M = 13 for CC1.3 (GF200, e.g. C1060, GTX285)
|
||||||
@ -1144,16 +1198,18 @@ class GPU:
|
|||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "linux.double"
|
self.make = "linux.double"
|
||||||
self.lammpsflag = self.modeflag = self.archflag = 0
|
self.lammpsflag = self.modeflag = self.archflag = self.homeflag = 0
|
||||||
|
|
||||||
def help(self):
|
def help(self):
|
||||||
return """
|
return """
|
||||||
-gpu make=suffix lammps=suffix2 mode=double arch=N
|
-gpu make=suffix lammps=suffix2 mode=double arch=N home=path
|
||||||
all args are optional and can be in any order
|
all args are optional and can be in any order
|
||||||
make = use Makefile.suffix (def = linux.double)
|
make = use Makefile.suffix (def = linux.double)
|
||||||
lammps = use Makefile.lammps.suffix2 (def = EXTRAMAKE in makefile)
|
lammps = use Makefile.lammps.suffix2 (def = EXTRAMAKE in makefile)
|
||||||
mode = double or mixed or single (def = CUDA_PREC in makefile)
|
mode = double or mixed or single (def = CUDA_PREC in makefile)
|
||||||
arch = 31 (Kepler) or 21 (Fermi) (def = CUDA_ARCH in makefile)
|
arch = 3x (x = digit for Kepler) or 2x (x = digit for Fermi)
|
||||||
|
(def = CUDA_ARCH in makefile)
|
||||||
|
home = path to Cuda, e.g. /usr/local/cuda (def = CUDA_HOME in makefile)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def check(self):
|
def check(self):
|
||||||
@ -1172,6 +1228,9 @@ class GPU:
|
|||||||
elif words[0] == "arch":
|
elif words[0] == "arch":
|
||||||
self.arch = words[1]
|
self.arch = words[1]
|
||||||
self.archflag = 1
|
self.archflag = 1
|
||||||
|
elif words[0] == "home":
|
||||||
|
self.home = words[1]
|
||||||
|
self.homeflag = 1
|
||||||
else: error("-gpu args are invalid")
|
else: error("-gpu args are invalid")
|
||||||
if self.modeflag and (self.mode != "double" and
|
if self.modeflag and (self.mode != "double" and
|
||||||
self.mode != "mixed" and
|
self.mode != "mixed" and
|
||||||
@ -1192,13 +1251,22 @@ class GPU:
|
|||||||
make.setvar("CUDA_PRECISION","-D_SINGLE_SINGLE")
|
make.setvar("CUDA_PRECISION","-D_SINGLE_SINGLE")
|
||||||
if self.archflag:
|
if self.archflag:
|
||||||
make.setvar("CUDA_ARCH","-arch=sm_%s" % self.arch)
|
make.setvar("CUDA_ARCH","-arch=sm_%s" % self.arch)
|
||||||
|
if self.homeflag:
|
||||||
|
make.setvar("CUDA_HOME",self.home)
|
||||||
if self.lammpsflag:
|
if self.lammpsflag:
|
||||||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||||
make.write("%s/Makefile.auto" % libdir)
|
make.write("%s/Makefile.auto" % libdir)
|
||||||
|
|
||||||
commands.getoutput("cd %s; make -f Makefile.auto clean" % libdir)
|
# special hack for shannon GPU cluster
|
||||||
if jmake: str = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
# must use "srun make" if on it, else just make
|
||||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
# this is b/c Cuda libs are not all available on host
|
||||||
|
|
||||||
|
make = "make"
|
||||||
|
if "shannon" in os.environ.get("HOST"): make = "srun make"
|
||||||
|
|
||||||
|
commands.getoutput("cd %s; %s -f Makefile.auto clean" % (libdir,make))
|
||||||
|
if jmake: str = "cd %s; %s -j %d -f Makefile.auto" % (libdir,make,jmake.n)
|
||||||
|
else: str = "cd %s; %s -f Makefile.auto" % (libdir,make)
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
@ -1574,14 +1642,16 @@ class Kokkos:
|
|||||||
mode is not optional, arch is optional
|
mode is not optional, arch is optional
|
||||||
mode = omp or cuda or phi (def = KOKKOS_DEVICES setting in Makefile )
|
mode = omp or cuda or phi (def = KOKKOS_DEVICES setting in Makefile )
|
||||||
build Kokkos package for omp or cuda or phi
|
build Kokkos package for omp or cuda or phi
|
||||||
set KOKKOS_DEVICES to "OpenMP" (omp, phi) or "Cuda, OpenMP" (cuda)
|
sets KOKKOS_DEVICES to "OpenMP" (omp, phi) or "Cuda, OpenMP" (cuda)
|
||||||
arch = 31 (Kepler) or 21 (Fermi) (def = -arch setting in Makefile)
|
arch = number like 35 (Kepler) or 21 (Fermi)
|
||||||
|
sets KOKKOS_ARCH to appropriate value
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def check(self):
|
def check(self):
|
||||||
|
print self.inlist
|
||||||
if self.inlist != None and len(self.inlist) == 0:
|
if self.inlist != None and len(self.inlist) == 0:
|
||||||
error("-kokkos args are invalid")
|
error("-kokkos args are invalid")
|
||||||
|
|
||||||
if self.inlist == None: return
|
if self.inlist == None: return
|
||||||
if len(self.inlist) < 1: error("-kokkos args are invalid")
|
if len(self.inlist) < 1: error("-kokkos args are invalid")
|
||||||
self.mode = self.inlist[0]
|
self.mode = self.inlist[0]
|
||||||
@ -1596,7 +1666,7 @@ class Kokkos:
|
|||||||
else: error("-kokkos args are invalid")
|
else: error("-kokkos args are invalid")
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# makefile classes for CC, MPI, JPG, PNG, FFT settings
|
# makefile classes for CC, FLAGS, MPI, JPG, PNG, FFT settings
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
|
|
||||||
# Cc class
|
# Cc class
|
||||||
@ -1610,7 +1680,8 @@ class Cc:
|
|||||||
def help(self):
|
def help(self):
|
||||||
return """
|
return """
|
||||||
-cc compiler wrap=wcompiler
|
-cc compiler wrap=wcompiler
|
||||||
change CC setting in makefile
|
alter CC setting in Makefile.auto
|
||||||
|
only happens if new Makefile.auto is created by use of "file" action
|
||||||
compiler is required, all other args are optional
|
compiler is required, all other args are optional
|
||||||
compiler = any string with g++ or icc or icpc
|
compiler = any string with g++ or icc or icpc
|
||||||
or mpi (or mpicxx, mpiCC, mpiicpc, etc)
|
or mpi (or mpicxx, mpiCC, mpiicpc, etc)
|
||||||
@ -1644,6 +1715,41 @@ class Cc:
|
|||||||
self.wrap = words[1]
|
self.wrap = words[1]
|
||||||
else: error("-cc args are invalid")
|
else: error("-cc args are invalid")
|
||||||
|
|
||||||
|
# Flags class
|
||||||
|
|
||||||
|
class Flags:
|
||||||
|
def __init__(self,list):
|
||||||
|
self.inlist = copy.copy(list)
|
||||||
|
self.CC = []
|
||||||
|
self.LINK = []
|
||||||
|
|
||||||
|
def help(self):
|
||||||
|
return """
|
||||||
|
-flags flag f1 f2 ... flag f1 f2 ...
|
||||||
|
alter CCFLAGS or LINKFLAGS settings in Makefile.auto
|
||||||
|
only happens if new Makefile.auto is created by use of "file" action
|
||||||
|
flag = CC or LINK
|
||||||
|
one or both can be specified
|
||||||
|
f1,f2,etc = flag to add or replace
|
||||||
|
"-" char will be prepended to each
|
||||||
|
for example: g, O3, xHost, "fp-model fast=2"
|
||||||
|
will become: -g, -O3, -xHost, -fp-model fast=2
|
||||||
|
for -O,-O2,-O3,etc: existing -O* will first be removed
|
||||||
|
"""
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
if len(self.inlist) < 1: error("-flags args are invalid")
|
||||||
|
self.CC = [] # necessary?
|
||||||
|
self.LINK = []
|
||||||
|
mode = ""
|
||||||
|
for one in self.inlist:
|
||||||
|
if one == "CC": mode = "CC"
|
||||||
|
elif one == "LINK": mode = "LINK"
|
||||||
|
else:
|
||||||
|
if not mode: error("-flags args are invalid")
|
||||||
|
if mode == "CC": self.CC.append(one)
|
||||||
|
elif mode == "LINK": self.LINK.append(one)
|
||||||
|
|
||||||
# Mpi class
|
# Mpi class
|
||||||
|
|
||||||
class Mpi:
|
class Mpi:
|
||||||
@ -1654,7 +1760,8 @@ class Mpi:
|
|||||||
def help(self):
|
def help(self):
|
||||||
return """
|
return """
|
||||||
-mpi style dir=path
|
-mpi style dir=path
|
||||||
change MPI settings in makefile
|
alter MPI settings in Makefile.auto
|
||||||
|
only happens if new Makefile.auto is created by use of "file" action
|
||||||
style is required, all other args are optional
|
style is required, all other args are optional
|
||||||
style = mpi or mpich or ompi or serial
|
style = mpi or mpich or ompi or serial
|
||||||
mpi = no MPI settings (assume compiler is MPI wrapper)
|
mpi = no MPI settings (assume compiler is MPI wrapper)
|
||||||
@ -1687,9 +1794,10 @@ class Fft:
|
|||||||
def help(self):
|
def help(self):
|
||||||
return """
|
return """
|
||||||
-fft mode lib=libname dir=homedir idir=incdir ldir=libdir
|
-fft mode lib=libname dir=homedir idir=incdir ldir=libdir
|
||||||
change FFT settings in makefile
|
alter FFT settings in Makefile.auto
|
||||||
|
only happens if new Makefile.auto is created by use of "file" action
|
||||||
mode is required, all other args are optional
|
mode is required, all other args are optional
|
||||||
removes all current FFT variable settings
|
first removes all current FFT variable settings
|
||||||
mode = none or fftw or fftw3 or ...
|
mode = none or fftw or fftw3 or ...
|
||||||
adds -DFFT_MODE setting
|
adds -DFFT_MODE setting
|
||||||
lib = name of FFT library to link with (def is libname = mode)
|
lib = name of FFT library to link with (def is libname = mode)
|
||||||
@ -1727,6 +1835,8 @@ class Jpg:
|
|||||||
def help(self):
|
def help(self):
|
||||||
return """
|
return """
|
||||||
-jpg flag dir=homedir idir=incdir ldir=libdir
|
-jpg flag dir=homedir idir=incdir ldir=libdir
|
||||||
|
alter JPG settings in Makefile.auto
|
||||||
|
only happens if new Makefile.auto is created by use of "file" action
|
||||||
change JPG settings in makefile
|
change JPG settings in makefile
|
||||||
all args are optional, flag must come first if specified
|
all args are optional, flag must come first if specified
|
||||||
flag = yes or no (def = yes)
|
flag = yes or no (def = yes)
|
||||||
@ -1764,7 +1874,8 @@ class Png:
|
|||||||
def help(self):
|
def help(self):
|
||||||
return """
|
return """
|
||||||
-png flag dir=homedir idir=incdir ldir=libdir
|
-png flag dir=homedir idir=incdir ldir=libdir
|
||||||
change PNG settings in makefile
|
alter PNG settings in Makefile.auto
|
||||||
|
only happens if new Makefile.auto is created by use of "file" action
|
||||||
all args are optional, flag must come first if specified
|
all args are optional, flag must come first if specified
|
||||||
flag = yes or no (def = yes)
|
flag = yes or no (def = yes)
|
||||||
include or exclude PNG support
|
include or exclude PNG support
|
||||||
@ -2143,13 +2254,22 @@ while 1:
|
|||||||
|
|
||||||
packages.uninstall()
|
packages.uninstall()
|
||||||
|
|
||||||
# create output file if requested and exe action performed
|
# create copy of executable if requested, and exe action performed
|
||||||
|
|
||||||
if output and actions and "exe" in actions.alist:
|
if output and actions and "exe" in actions.alist:
|
||||||
txt = "cp %s/lmp_auto %s/lmp_%s" % (dir.src,dir.cwd,output.machine)
|
txt = "cp %s/lmp_auto %s/lmp_%s" % (dir.src,dir.cwd,output.machine)
|
||||||
commands.getoutput(txt)
|
commands.getoutput(txt)
|
||||||
print "Created lmp_%s in %s" % (output.machine,dir.cwd)
|
print "Created lmp_%s in %s" % (output.machine,dir.cwd)
|
||||||
|
|
||||||
|
# create copy of Makefile.auto if requested, and file or exe action performed
|
||||||
|
|
||||||
|
if zoutput and actions and \
|
||||||
|
("file" in actions.alist or "exe" in actions.alist):
|
||||||
|
txt = "cp %s/MAKE/MINE/Makefile.auto %s/MAKE/MINE/Makefile.%s" % \
|
||||||
|
(dir.src,dir.src,zoutput.machine)
|
||||||
|
commands.getoutput(txt)
|
||||||
|
print "Created Makefile.%s in %s/MAKE/MINE" % (zoutput.machine,dir.src)
|
||||||
|
|
||||||
# write current Make.py command to src/Make.py.last
|
# write current Make.py command to src/Make.py.last
|
||||||
|
|
||||||
fp = open("%s/Make.py.last" % dir.src,'w')
|
fp = open("%s/Make.py.last" % dir.src,'w')
|
||||||
|
|||||||
@ -205,8 +205,8 @@ install-python:
|
|||||||
tar:
|
tar:
|
||||||
@cd STUBS; $(MAKE) clean
|
@cd STUBS; $(MAKE) clean
|
||||||
@cd ..; tar cvzf src/$(ROOT)_src.tar.gz \
|
@cd ..; tar cvzf src/$(ROOT)_src.tar.gz \
|
||||||
src/Make* src/Package.sh src/Depend.sh \
|
src/Make* src/Package.sh src/Depend.sh src/Install.sh \
|
||||||
src/MAKE src/*.cpp src/*.h src/STUBS \
|
src/MAKE src/DEPEND src/*.cpp src/*.h src/STUBS \
|
||||||
$(patsubst %,src/%,$(PACKAGEUC)) $(patsubst %,src/%,$(PACKUSERUC)) \
|
$(patsubst %,src/%,$(PACKAGEUC)) $(patsubst %,src/%,$(PACKUSERUC)) \
|
||||||
--exclude=*/.svn
|
--exclude=*/.svn
|
||||||
@cd STUBS; $(MAKE)
|
@cd STUBS; $(MAKE)
|
||||||
|
|||||||
@ -107,17 +107,16 @@ void FixQEqFire::init()
|
|||||||
void FixQEqFire::pre_force(int vflag)
|
void FixQEqFire::pre_force(int vflag)
|
||||||
{
|
{
|
||||||
int inum, *ilist;
|
int inum, *ilist;
|
||||||
int i,ii,iloop,loopmax;
|
int i,ii,iloop;
|
||||||
int *mask = atom->mask;
|
|
||||||
|
|
||||||
double *q = atom->q;
|
double *q = atom->q;
|
||||||
double vmax,vdotf,vdotfall,vdotv,vdotvall,fdotf,fdotfall;
|
double vmax,vdotf,vdotfall,vdotv,vdotvall,fdotf,fdotfall;
|
||||||
double scale1,scale2;
|
double scale1,scale2;
|
||||||
double dtvone,dtv;
|
double dtvone,dtv;
|
||||||
double enegtot,enegchk,enegmax;
|
double enegtot,enegchk;
|
||||||
double alpha = qdamp;
|
double alpha = qdamp;
|
||||||
double dt, dtmax;
|
double dt, dtmax;
|
||||||
double enegchkall,enegmaxall;
|
double enegchkall;
|
||||||
bigint ntimestep = update->ntimestep;
|
bigint ntimestep = update->ntimestep;
|
||||||
bigint last_negative = 0;
|
bigint last_negative = 0;
|
||||||
|
|
||||||
@ -225,7 +224,7 @@ void FixQEqFire::pre_force(int vflag)
|
|||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
if (iloop == maxiter) {
|
if (iloop == maxiter) {
|
||||||
char str[128];
|
char str[128];
|
||||||
sprintf(str,"Charges did not converge at step "BIGINT_FORMAT
|
sprintf(str,"Charges did not converge at step " BIGINT_FORMAT
|
||||||
": %lg",update->ntimestep,enegchk);
|
": %lg",update->ntimestep,enegchk);
|
||||||
error->warning(FLERR,str);
|
error->warning(FLERR,str);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,13 +93,38 @@ void Temper::command(int narg, char **arg)
|
|||||||
if (nswaps*nevery != nsteps)
|
if (nswaps*nevery != nsteps)
|
||||||
error->universe_all(FLERR,"Non integer # of swaps in temper command");
|
error->universe_all(FLERR,"Non integer # of swaps in temper command");
|
||||||
|
|
||||||
// fix style must be appropriate for temperature control
|
// fix style must be appropriate for temperature control, i.e. it needs
|
||||||
|
// to provide a working Fix::reset_target() and must not change the volume.
|
||||||
|
|
||||||
if ((strcmp(modify->fix[whichfix]->style,"nvt") != 0) &&
|
if ((strcmp(modify->fix[whichfix]->style,"nvt") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/asphere") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/asphere/omp") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/body") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/eff") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/intel") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/kk") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/kk/host") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/kk/device") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/omp") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/sphere") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"nvt/sphere/omp") != 0) &&
|
||||||
(strcmp(modify->fix[whichfix]->style,"langevin") != 0) &&
|
(strcmp(modify->fix[whichfix]->style,"langevin") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"langevin/drude") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"langevin/eff") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"gld") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"gle") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"rigid/nvt") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"rigid/nvt/small") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"rigid/nvt/omp") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"rigid/nvt/small/omp") != 0) &&
|
||||||
(strcmp(modify->fix[whichfix]->style,"temp/berendsen") != 0) &&
|
(strcmp(modify->fix[whichfix]->style,"temp/berendsen") != 0) &&
|
||||||
(strcmp(modify->fix[whichfix]->style,"temp/rescale") != 0))
|
(strcmp(modify->fix[whichfix]->style,"temp/berendsen/cuda") != 0) &&
|
||||||
error->universe_all(FLERR,"Tempering temperature fix is not valid");
|
(strcmp(modify->fix[whichfix]->style,"temp/csvr") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"temp/csld") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"temp/rescale") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"temp/rescale/cuda") != 0) &&
|
||||||
|
(strcmp(modify->fix[whichfix]->style,"temp/rescale/eff") != 0))
|
||||||
|
error->universe_all(FLERR,"Tempering temperature fix is not supported");
|
||||||
|
|
||||||
// setup for long tempering run
|
// setup for long tempering run
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ OBJ = $(SRC:%.c=%_mingw32.o)
|
|||||||
# System-specific settings
|
# System-specific settings
|
||||||
|
|
||||||
CC = i686-w64-mingw32-gcc
|
CC = i686-w64-mingw32-gcc
|
||||||
CCFLAGS = -O2 -Wall -march=i686 -mtune=generic -mfpmath=387 -mpc64
|
CCFLAGS = -O2 -Wall -march=i686 -mtune=generic -mfpmath=387 -mpc64 -I.
|
||||||
ARCHIVE = i686-w64-mingw32-ar
|
ARCHIVE = i686-w64-mingw32-ar
|
||||||
ARCHFLAG = rs
|
ARCHFLAG = rs
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ OBJ = $(SRC:%.c=%_mingw64.o)
|
|||||||
# System-specific settings
|
# System-specific settings
|
||||||
|
|
||||||
CC = x86_64-w64-mingw32-gcc
|
CC = x86_64-w64-mingw32-gcc
|
||||||
CCFLAGS = -O2 -Wall -march=core2 -mtune=core2 -msse2 -mpc64
|
CCFLAGS = -O2 -Wall -march=core2 -mtune=core2 -msse2 -mpc64 -I.
|
||||||
ARCHIVE = x86_64-w64-mingw32-ar
|
ARCHIVE = x86_64-w64-mingw32-ar
|
||||||
ARCHFLAG = rs
|
ARCHFLAG = rs
|
||||||
|
|
||||||
|
|||||||
@ -1097,7 +1097,6 @@ double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag
|
|||||||
ril[1] = rij[1]+rjl[1];
|
ril[1] = rij[1]+rjl[1];
|
||||||
ril[2] = rij[2]+rjl[2];
|
ril[2] = rij[2]+rjl[2];
|
||||||
ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
|
ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
|
||||||
rijrjl = 2.0*rijmag*rjlmag;
|
|
||||||
rjl2 = rjlmag*rjlmag;
|
rjl2 = rjlmag*rjlmag;
|
||||||
costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
|
costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
|
||||||
tspijl = Sp2(costmp,thmin,thmax,dtsijl);
|
tspijl = Sp2(costmp,thmin,thmax,dtsijl);
|
||||||
|
|||||||
@ -398,7 +398,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
double scale;
|
double scale;
|
||||||
if (which == BIN1D || which == BIN2D || which == BIN3D ||
|
if (which == BIN1D || which == BIN2D || which == BIN3D ||
|
||||||
which == BINCYLINDER) {
|
which == BINCYLINDER) {
|
||||||
if (which == BIN1D || BINCYLINDER) ndim = 1;
|
if (which == BIN1D || which == BINCYLINDER) ndim = 1;
|
||||||
if (which == BIN2D) ndim = 2;
|
if (which == BIN2D) ndim = 2;
|
||||||
if (which == BIN3D) ndim = 3;
|
if (which == BIN3D) ndim = 3;
|
||||||
for (int idim = 0; idim < ndim; idim++) {
|
for (int idim = 0; idim < ndim; idim++) {
|
||||||
|
|||||||
@ -503,13 +503,12 @@ void Domain::pbc()
|
|||||||
|
|
||||||
double *coord;
|
double *coord;
|
||||||
int n3 = 3*nlocal;
|
int n3 = 3*nlocal;
|
||||||
if (x) {
|
coord = &x[0][0]; // note: x is always initialzed to at least one element.
|
||||||
coord = &x[0][0];
|
int flag = 0;
|
||||||
int flag = 0;
|
for (i = 0; i < n3; i++)
|
||||||
for (i = 0; i < n3; i++)
|
if (!ISFINITE(*coord++)) flag = 1;
|
||||||
if (!ISFINITE(*coord++)) flag = 1;
|
if (flag) error->one(FLERR,"Non-numeric atom coords - simulation unstable");
|
||||||
if (flag) error->one(FLERR,"Non-numeric atom coords - simulation unstable");
|
|
||||||
}
|
|
||||||
// setup for PBC checks
|
// setup for PBC checks
|
||||||
|
|
||||||
if (triclinic == 0) {
|
if (triclinic == 0) {
|
||||||
|
|||||||
@ -850,7 +850,6 @@ void DumpImage::create_image()
|
|||||||
|
|
||||||
if (bodyflag) {
|
if (bodyflag) {
|
||||||
Body *bptr = avec_body->bptr;
|
Body *bptr = avec_body->bptr;
|
||||||
double **x = atom->x;
|
|
||||||
int *body = atom->body;
|
int *body = atom->body;
|
||||||
|
|
||||||
m = 0;
|
m = 0;
|
||||||
|
|||||||
@ -23,7 +23,6 @@
|
|||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
#include "compute.h"
|
#include "compute.h"
|
||||||
#include "group.h"
|
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
@ -55,6 +54,8 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
global_freq = nfreq;
|
global_freq = nfreq;
|
||||||
|
|
||||||
|
dynamic_group_allow = 1;
|
||||||
|
|
||||||
// scan values to count them
|
// scan values to count them
|
||||||
// then read options so know mode = SCALAR/VECTOR before re-reading values
|
// then read options so know mode = SCALAR/VECTOR before re-reading values
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,7 @@ namespace MathConst {
|
|||||||
static const double MY_PI2 = 1.57079632679489661923; // pi/2
|
static const double MY_PI2 = 1.57079632679489661923; // pi/2
|
||||||
static const double MY_PI4 = 0.78539816339744830962; // pi/4
|
static const double MY_PI4 = 0.78539816339744830962; // pi/4
|
||||||
static const double MY_PIS = 1.77245385090551602729; // sqrt(pi)
|
static const double MY_PIS = 1.77245385090551602729; // sqrt(pi)
|
||||||
|
static const double MY_ISPI4 = 1.12837916709551257389; // 1/sqrt(pi/4)
|
||||||
static const double MY_SQRT2 = 1.41421356237309504880; // sqrt(2)
|
static const double MY_SQRT2 = 1.41421356237309504880; // sqrt(2)
|
||||||
static const double MY_CBRT2 = 1.25992104989487316476; // 2*(1/3)
|
static const double MY_CBRT2 = 1.25992104989487316476; // 2*(1/3)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1468,7 +1468,7 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type)
|
|||||||
|
|
||||||
void ReadData::bodies(int firstpass)
|
void ReadData::bodies(int firstpass)
|
||||||
{
|
{
|
||||||
int i,m,nchunk,nline,nmax,ninteger,ndouble,nword,ncount,onebody,tmp;
|
int m,nchunk,nline,nmax,ninteger,ndouble,nword,ncount,onebody,tmp;
|
||||||
char *eof;
|
char *eof;
|
||||||
|
|
||||||
int mapflag = 0;
|
int mapflag = 0;
|
||||||
|
|||||||
@ -917,7 +917,6 @@ void Set::setrandom(int keyword)
|
|||||||
|
|
||||||
} else if (keyword == THETA_RANDOM) {
|
} else if (keyword == THETA_RANDOM) {
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
double theta;
|
|
||||||
for (i = 0; i < nlocal; i++) {
|
for (i = 0; i < nlocal; i++) {
|
||||||
if (select[i]) {
|
if (select[i]) {
|
||||||
if (atom->line[i] < 0)
|
if (atom->line[i] < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user