T2345: Replace instances of NULL with nullptr
The following changes have been applied to src and lib folders: regex replace: ([^"_])NULL ⇒ \1nullptr (8968 chgs in src, 1153 in lib) Manually find/change: (void \*) nullptr ⇒ nullptr (1 case) regex find: ".*?nullptr.*?" Manually ~14 cases back to "NULL" in src, ~2 in lib regex finds a few false positive where nullptr appears between two strings in a function call
This commit is contained in:
@ -49,7 +49,7 @@ void ProcMap::onelevel_grid(int nprocs, int *user_procgrid, int *procgrid,
|
||||
|
||||
// factors = list of all possible 3 factors of processor count
|
||||
|
||||
int npossible = factor(nprocs,NULL);
|
||||
int npossible = factor(nprocs,nullptr);
|
||||
memory->create(factors,npossible,3,"procmap:factors");
|
||||
npossible = factor(nprocs,factors);
|
||||
|
||||
@ -93,7 +93,7 @@ void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid,
|
||||
// nfactors = list of all possible 3 factors of node count
|
||||
// constrain by 2d
|
||||
|
||||
int nnpossible = factor(nprocs/ncores,NULL);
|
||||
int nnpossible = factor(nprocs/ncores,nullptr);
|
||||
memory->create(nfactors,nnpossible,3,"procmap:nfactors");
|
||||
nnpossible = factor(nprocs/ncores,nfactors);
|
||||
|
||||
@ -102,7 +102,7 @@ void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid,
|
||||
// cfactors = list of all possible 3 factors of core count
|
||||
// constrain by 2d
|
||||
|
||||
int ncpossible = factor(ncores,NULL);
|
||||
int ncpossible = factor(ncores,nullptr);
|
||||
memory->create(cfactors,ncpossible,3,"procmap:cfactors");
|
||||
ncpossible = factor(ncores,cfactors);
|
||||
|
||||
@ -205,7 +205,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
|
||||
// initial factorization within NUMA node
|
||||
|
||||
int **numafactors;
|
||||
int numapossible = factor(procs_per_numa,NULL);
|
||||
int numapossible = factor(procs_per_numa,nullptr);
|
||||
memory->create(numafactors,numapossible,3,"procmap:numafactors");
|
||||
numapossible = factor(procs_per_numa,numafactors);
|
||||
|
||||
@ -230,7 +230,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
|
||||
int node_count = nprocs / procs_per_numa;
|
||||
|
||||
int **nodefactors;
|
||||
int nodepossible = factor(node_count,NULL);
|
||||
int nodepossible = factor(node_count,nullptr);
|
||||
memory->create(nodefactors,nodepossible,3,"procmap:nodefactors");
|
||||
nodepossible = factor(node_count,nodefactors);
|
||||
|
||||
@ -281,11 +281,11 @@ void ProcMap::custom_grid(char *cfile, int nprocs,
|
||||
MPI_Comm_rank(world,&me);
|
||||
|
||||
char line[MAXLINE];
|
||||
FILE *fp = NULL;
|
||||
FILE *fp = nullptr;
|
||||
|
||||
if (me == 0) {
|
||||
fp = fopen(cfile,"r");
|
||||
if (fp == NULL) error->one(FLERR,"Cannot open custom file");
|
||||
if (fp == nullptr) error->one(FLERR,"Cannot open custom file");
|
||||
|
||||
// skip header = blank and comment lines
|
||||
|
||||
@ -662,7 +662,7 @@ void ProcMap::output(char *file, int *procgrid, int ***grid2proc)
|
||||
FILE *fp;
|
||||
if (me == 0) {
|
||||
fp = fopen(file,"w");
|
||||
if (fp == NULL) error->one(FLERR,"Cannot open processors output file");
|
||||
if (fp == nullptr) error->one(FLERR,"Cannot open processors output file");
|
||||
fprintf(fp,"LAMMPS mapping of processors to 3d grid\n");
|
||||
fprintf(fp,"partition = %d\n",universe->iworld+1);
|
||||
fprintf(fp,"Px Py Pz = %d %d %d\n",procgrid[0],procgrid[1],procgrid[2]);
|
||||
@ -722,7 +722,7 @@ void ProcMap::output(char *file, int *procgrid, int ***grid2proc)
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
generate all possible 3-integer factorizations of N
|
||||
store them in factors if non-NULL
|
||||
store them in factors if non-nullptr
|
||||
return # of factorizations
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user