library: add comm->procgrid to extract_global
This commit is contained in:
@ -891,7 +891,7 @@ class lammps(object):
|
|||||||
# set length of vector for items that are not a scalar
|
# set length of vector for items that are not a scalar
|
||||||
vec_dict = { 'boxlo':3, 'boxhi':3, 'sublo':3, 'subhi':3,
|
vec_dict = { 'boxlo':3, 'boxhi':3, 'sublo':3, 'subhi':3,
|
||||||
'sublo_lambda':3, 'subhi_lambda':3, 'periodicity':3,
|
'sublo_lambda':3, 'subhi_lambda':3, 'periodicity':3,
|
||||||
'special_lj':4, 'special_coul':4 }
|
'special_lj':4, 'special_coul':4, 'proc_grid':3 }
|
||||||
if name in vec_dict:
|
if name in vec_dict:
|
||||||
veclen = vec_dict[name]
|
veclen = vec_dict[name]
|
||||||
elif name == 'respa_dt':
|
elif name == 'respa_dt':
|
||||||
|
|||||||
@ -796,6 +796,7 @@ class PyLammps(object):
|
|||||||
comm = {}
|
comm = {}
|
||||||
comm['nprocs'] = self.lmp.extract_setting("world_size")
|
comm['nprocs'] = self.lmp.extract_setting("world_size")
|
||||||
comm['nthreads'] = self.lmp.extract_setting("nthreads")
|
comm['nthreads'] = self.lmp.extract_setting("nthreads")
|
||||||
|
comm['proc_grid'] = self.lmp.extract_global("proc_grid")
|
||||||
|
|
||||||
for line in output:
|
for line in output:
|
||||||
if line.startswith("MPI library"):
|
if line.startswith("MPI library"):
|
||||||
@ -804,8 +805,6 @@ class PyLammps(object):
|
|||||||
parts = self._split_values(line)
|
parts = self._split_values(line)
|
||||||
comm['comm_style'] = self._get_pair(parts[0])[1]
|
comm['comm_style'] = self._get_pair(parts[0])[1]
|
||||||
comm['comm_layout'] = self._get_pair(parts[1])[1]
|
comm['comm_layout'] = self._get_pair(parts[1])[1]
|
||||||
elif line.startswith("Processor grid"):
|
|
||||||
comm['proc_grid'] = [int(x) for x in self._get_pair(line)[1].split('x')]
|
|
||||||
elif line.startswith("Communicate velocities for ghost atoms"):
|
elif line.startswith("Communicate velocities for ghost atoms"):
|
||||||
comm['ghost_velocity'] = (self._get_pair(line)[1] == "yes")
|
comm['ghost_velocity'] = (self._get_pair(line)[1] == "yes")
|
||||||
return comm
|
return comm
|
||||||
|
|||||||
@ -1386,6 +1386,7 @@ int lammps_extract_global_datatype(void * /*handle*/, const char *name)
|
|||||||
if (strcmp(name,"xy") == 0) return LAMMPS_DOUBLE;
|
if (strcmp(name,"xy") == 0) return LAMMPS_DOUBLE;
|
||||||
if (strcmp(name,"xz") == 0) return LAMMPS_DOUBLE;
|
if (strcmp(name,"xz") == 0) return LAMMPS_DOUBLE;
|
||||||
if (strcmp(name,"yz") == 0) return LAMMPS_DOUBLE;
|
if (strcmp(name,"yz") == 0) return LAMMPS_DOUBLE;
|
||||||
|
if (strcmp(name,"proc_grid") == 0) return LAMMPS_INT;
|
||||||
|
|
||||||
if (strcmp(name,"natoms") == 0) return LAMMPS_BIGINT;
|
if (strcmp(name,"natoms") == 0) return LAMMPS_BIGINT;
|
||||||
if (strcmp(name,"nbonds") == 0) return LAMMPS_BIGINT;
|
if (strcmp(name,"nbonds") == 0) return LAMMPS_BIGINT;
|
||||||
@ -1604,6 +1605,10 @@ report the "native" data type. The following tables are provided:
|
|||||||
- double
|
- double
|
||||||
- 1
|
- 1
|
||||||
- triclinic tilt factor. See :doc:`Howto_triclinic`.
|
- triclinic tilt factor. See :doc:`Howto_triclinic`.
|
||||||
|
* - proc_grid
|
||||||
|
- int
|
||||||
|
- 3
|
||||||
|
- processor count assigned to each dimension of 3d grid. See :doc:`processors`.
|
||||||
|
|
||||||
.. _extract_system_settings:
|
.. _extract_system_settings:
|
||||||
|
|
||||||
@ -1861,6 +1866,10 @@ void *lammps_extract_global(void *handle, const char *name)
|
|||||||
if (strcmp(name,"xy") == 0) return (void *) &lmp->domain->xy;
|
if (strcmp(name,"xy") == 0) return (void *) &lmp->domain->xy;
|
||||||
if (strcmp(name,"xz") == 0) return (void *) &lmp->domain->xz;
|
if (strcmp(name,"xz") == 0) return (void *) &lmp->domain->xz;
|
||||||
if (strcmp(name,"yz") == 0) return (void *) &lmp->domain->yz;
|
if (strcmp(name,"yz") == 0) return (void *) &lmp->domain->yz;
|
||||||
|
if ((lmp->comm->layout == Comm::LAYOUT_UNIFORM ||
|
||||||
|
lmp->comm->layout == Comm::LAYOUT_NONUNIFORM) &&
|
||||||
|
(strcmp(name,"proc_grid") == 0))
|
||||||
|
return (void *) &lmp->comm->procgrid;
|
||||||
|
|
||||||
if (strcmp(name,"natoms") == 0) return (void *) &lmp->atom->natoms;
|
if (strcmp(name,"natoms") == 0) return (void *) &lmp->atom->natoms;
|
||||||
if (strcmp(name,"ntypes") == 0) return (void *) &lmp->atom->ntypes;
|
if (strcmp(name,"ntypes") == 0) return (void *) &lmp->atom->ntypes;
|
||||||
|
|||||||
Reference in New Issue
Block a user