def run_simulation(run_name, dir_path, path_to_working_dir, num_time_steps,
                   num_outputs):
    print("Deleting any pre-existing results...")
    # Delete any pre-existing executables or results
    if os.path.exists(str(path_to_working_dir) + '/' + run_name) is True:
        shutil.rmtree(str(path_to_working_dir) + '/' + run_name)

    # Open file where output is redirected to
    if os.path.exists(str(path_to_working_dir) + "/output.txt") is True:
        os.remove(str(path_to_working_dir) + "/output.txt")
    f = open(str(path_to_working_dir) + "/output.txt", 'w+')

    for vtu_file in glob.glob(str(path_to_working_dir) + "/*.vtu"):
        os.remove(vtu_file)

    #shutil.copyfile(dir_path + "../bin", str(path_to_working_dir) + '/bin')
    print("Completed")
    # Run the simulation
    rappture_path = os.path.dirname(os.path.realpath(__file__))
    #os.chdir(dir_path)

    os.chdir(path_to_working_dir)
    print("Running the PRISMS-PF executable...")
    exitStatus, stdOutput, stdError = RapptureExec([
        "submit", "--local", "--metrics", dir_path + "../bin/main", "-i",
        str(path_to_working_dir) + "/parameters_rappture.in"
    ],
                                                   streamOutput=True)

    print("Completed with exit status:", exitStatus)

    #exitStatus,stdOutput,stdError = RapptureExec(["submit", "--local", "--metrics", dir_path + "../bin/main", "-i", str(path_to_working_dir) + "/parameters_rappture.in"], streamOutput=True)

    #fts = open("run_info.txt",'w')
    #fts.write(str(int(num_time_steps))+'\n'+str(num_outputs))
    #fts.close()
    #exitStatus,stdOutput,stdError = RapptureExec(["python", "run_prismspf_simulation.py"])

    if (exitStatus == 0):
        simulationCompleted = True

        # Group the files
        subprocess.call(["mkdir", run_name])
        for output_files in glob.glob('*vtu'):
            shutil.move(output_files, run_name)
        if os.path.exists("integratedFields.txt") is True:
            shutil.move("integratedFields.txt", run_name)

        # shutil.move(run_name, rappture_path)
    else:
        simulationCompleted = False

    os.chdir(rappture_path)

    return simulationCompleted
    '''
Beispiel #2
0
def call_lammps(simulation, np, nanohub, prefix='mpiexec'):
    """pysimm.lmps.call_lammps

    Wrapper to call LAMMPS using executable name defined in pysimm.lmps module.

    Args:
        simulation: :class:`~pysimm.lmps.Simulation` object reference
        np: number of threads to use
        nanohub: dictionary containing nanohub resource information default=None
        prefix: prefix for running LAMMPS (i.e. - mpiexec)

    Returns:
        None
    """

    log_name = simulation.log or 'log.lammps'

    if nanohub:
        with open('temp.in', 'w') as f:
            f.write(simulation.input)
        if simulation.name:
            print('%s: sending %s simulation to computer cluster at nanoHUB' %
                  (strftime('%H:%M:%S'), simulation.name))
        else:
            print('%s: sending simulation to computer cluster at nanoHUB' %
                  strftime('%H:%M:%S'))
        sys.stdout.flush()
        cmd = ('submit -n %s -w %s -i temp.lmps -i temp.in '
               'lammps-09Dec14-parallel -e both -l none -i temp.in' %
               (nanohub.get('cores'), nanohub.get('walltime')))
        cmd = shlex.split(cmd)
        exit_status, stdo, stde = RapptureExec(cmd)
    else:
        if simulation.name:
            print('%s: starting %s LAMMPS simulation' %
                  (strftime('%H:%M:%S'), simulation.name))
        else:
            print('%s: starting LAMMPS simulation' % strftime('%H:%M:%S'))
        if np:
            p = Popen([prefix, '-np',
                       str(np), LAMMPS_EXEC, '-e', 'both'],
                      stdin=PIPE,
                      stdout=PIPE,
                      stderr=PIPE)
        else:
            p = Popen([LAMMPS_EXEC, '-e', 'both'],
                      stdin=PIPE,
                      stdout=PIPE,
                      stderr=PIPE)
        simulation.write_input()
        if simulation.debug:
            print(simulation.input)
            warning_print(
                'debug setting involves streaming output from LAMMPS process and can degrade performance'
            )
            warning_print(
                'only use debug for debugging purposes, use print_to_screen to collect stdout after process finishes'
            )
            p.stdin.write(simulation.input.encode('utf-8'))
            q = Queue()
            t = Thread(target=enqueue_output, args=(p.stdout, q))
            t.daemon = True
            t.start()

            while t.is_alive() or not q.empty():
                try:
                    line = q.get_nowait()
                except Empty:
                    pass
                else:
                    if simulation.debug:
                        sys.stdout.write(line.decode('utf-8'))
                        sys.stdout.flush()
        else:
            stdo, stde = p.communicate(simulation.input.encode('utf-8'))
            if simulation.print_to_screen:
                print(stdo.decode('utf-8'))
                print(stde.decode('utf-8'))

    simulation.system.read_lammps_dump('pysimm.dump.tmp')

    try:
        os.remove('temp.lmps')
    except OSError as e:
        print(str(e))

    if os.path.isfile('pysimm.qeq.tmp'):
        os.remove('pysimm.qeq.tmp')

    try:
        os.remove('pysimm.dump.tmp')
        if simulation.name:
            print('%s: %s simulation using LAMMPS successful' %
                  (strftime('%H:%M:%S'), simulation.name))
        else:
            print('%s: simulation using LAMMPS successful' %
                  (strftime('%H:%M:%S')))
    except OSError as e:
        if simulation.name:
            raise PysimmError('%s simulation using LAMMPS UNsuccessful' %
                              simulation.name)
        else:
            raise PysimmError('simulation using LAMMPS UNsuccessful')
Beispiel #3
0
def minimize(s, template=None, **kwargs):
    """pysimm.lmps.minimize

    Convenience function for performing LAMMPS energy minimization

    *** WILL BE DEPRECATED - USE QUICK_MIN INSTEAD ***
    """
    global LAMMPS_EXEC

    if template:
        template.update(kwargs)
        kwargs = template

    name = kwargs.get('name') or False
    log = kwargs.get('log') or 'log.lammps'
    write = kwargs.get('write') or False
    print_to_screen = kwargs.get('print_to_screen') if kwargs.get(
        'print_to_screen') is not None else False
    special_bonds = kwargs.get('special_bonds') or 'amber'
    cutoff = kwargs.get('cutoff') or 12.0
    min_style = kwargs.get('min_style')
    fire_etol = kwargs.get('sd_etol') or 1.0e-3
    fire_ftol = kwargs.get('sd_ftol') or 1.0e-3
    fire_maxiter = kwargs.get('sd_maxiter') or 10000
    fire_maxeval = kwargs.get('sd_maxeval') or 100000
    sd_etol = kwargs.get('sd_etol') or 1.0e-3
    sd_ftol = kwargs.get('sd_ftol') or 1.0e-3
    sd_maxiter = kwargs.get('sd_maxiter') or 10000
    sd_maxeval = kwargs.get('sd_maxeval') or 100000
    cg_etol = kwargs.get('cg_etol') or 1.0e-6
    cg_ftol = kwargs.get('cg_ftol') or 1.0e-6
    cg_maxiter = kwargs.get('cg_maxiter') or 10000
    cg_maxeval = kwargs.get('cg_maxeval') or 100000
    thermo = kwargs.get('thermo') or 1000
    thermo_style = kwargs.get('thermo_style')
    nonbond_mixing = kwargs.get('nonbond_mixing')
    kspace_style = kwargs.get('kspace_style') or 'pppm 1e-4'

    nanohub = kwargs.get('nanohub') or {}

    pbs = kwargs.get('pbs')
    np = kwargs.get('np')

    command = write_init(s, nb_cut=cutoff, special_bonds=special_bonds,
                         nonbond_mixing=nonbond_mixing, kspace_style=kspace_style)
    if log:
        command += 'log %s append\n' % log
    elif name:
        command += 'log %s.log append\n' % '_'.join(name.split())
    else:
        command += 'log log.lammps append\n'

    if thermo:
        command += 'thermo %s\n' % int(thermo)
    if thermo_style:
        command += 'thermo_style %s\n' % thermo_style

    if not min_style or min_style == 'sd':
        command += 'min_style sd\n'
        command += ('minimize %s %s %s %s\n'
                    % (sd_etol, sd_ftol, sd_maxiter, sd_maxeval))

        command += 'min_style cg\n'
        command += ('minimize %s %s %s %s\n'
                    % (cg_etol, cg_ftol, cg_maxiter, cg_maxeval))

    elif min_style == 'fire':
        command += 'timestep 1\n'
        command += 'min_style fire\n'
        command += ('minimize %s %s %s %s\n'
                    % (fire_etol, fire_ftol, fire_maxiter, fire_maxeval))

    if write:
        command += 'write_data %s\n' % write
    else:
        command += 'write_data pysimm_min.lmps\n'

    with open('temp.in', 'w') as f:
        f.write(command)

    if name:
        print('%s: starting %s simulation using LAMMPS'
              % (strftime('%H:%M:%S'), name))
    else:
        print('%s: starting minimization using LAMMPS'
              % strftime('%H:%M:%S'))

    if nanohub:
        if name:
            print('%s: sending %s simulation to computer cluster' % (strftime('%H:%M:%S'), name))
        sys.stdout.flush()
        cmd = ('submit -n %s -w %s -i temp.lmps -i temp.in '
               'lammps-09Dec14-parallel -e both -l none -i temp.in'
               % (nanohub.get('cores'), nanohub.get('walltime')))
        cmd = shlex.split(cmd)
        exit_status, stdo, stde = RapptureExec(cmd)
    if pbs:
        call('mpiexec %s -e both -l log' % LAMMPS_EXEC, shell=True,
                 stdin=open('temp.in'), stdout=PIPE, stderr=PIPE)
    else:
        if np:
            p = Popen(['mpiexec', '-np', str(np),
                       LAMMPS_EXEC, '-e', 'both', '-l', 'none'],
                      stdin=open('temp.in'), stdout=PIPE, stderr=PIPE)
        else:
            p = Popen([LAMMPS_EXEC, '-e', 'both', '-l', 'none'],
                      stdin=open('temp.in'), stdout=PIPE, stderr=PIPE)

        while True:
            out = p.stdout.read(1)
            if out == '' and p.poll() is not None:
                break
            if out != '' and print_to_screen:
                sys.stdout.write(out)
                sys.stdout.flush()

    if write:
        n = read_lammps(write, quiet=True,
                        pair_style=s.pair_style,
                        bond_style=s.bond_style,
                        angle_style=s.angle_style,
                        dihedral_style=s.dihedral_style,
                        improper_style=s.improper_style)
    else:
        n = read_lammps('pysimm_min.lmps', quiet=True,
                        pair_style=s.pair_style,
                        bond_style=s.bond_style,
                        angle_style=s.angle_style,
                        dihedral_style=s.dihedral_style,
                        improper_style=s.improper_style)
    for p in n.particles:
        s.particles[p.tag].x = p.x
        s.particles[p.tag].y = p.y
        s.particles[p.tag].z = p.z
    os.remove('temp.in')

    try:
        os.remove('temp.lmps')
    except OSError as e:
        print e

    if not write:
        try:
            os.remove('pysimm_min.lmps')
            if name:
                print('%s: %s simulation using LAMMPS successful'
                      % (strftime('%H:%M:%S'), name))
            else:
                print('%s: minimization using LAMMPS successful'
                      % (strftime('%H:%M:%S')))
            return True
        except OSError:
            if name:
                print('%s: %s simulation using LAMMPS UNsuccessful'
                      % (strftime('%H:%M:%S'), name))
            else:
                print('%s: minimization using LAMMPS UNsuccessful'
                      % strftime('%H:%M:%S'))
            return False

    else:
        if os.path.isfile(write):
            if name:
                print('%s: %s simulation using LAMMPS successful'
                      % (strftime('%H:%M:%S'), name))
            else:
                print('%s: minimization using LAMMPS successful'
                      % (strftime('%H:%M:%S')))
            return True
        else:
            if name:
                print('%s: %s simulation using LAMMPS UNsuccessful'
                      % (strftime('%H:%M:%S'), name))
            else:
                print('%s: minimization using LAMMPS UNsuccessful'
                      % strftime('%H:%M:%S'))
            return False
Beispiel #4
0
def md(s, template=None, **kwargs):
    """pysimm.lmps.md

    Convenience function for performing LAMMPS MD

    *** WILL BE DEPRECATED - USE QUICK_MD INSTEAD ***
    """
    global LAMMPS_EXEC

    if template:
        template.update(kwargs)
        kwargs = template

    name = kwargs.get('name') or False
    log = kwargs.get('log')
    write = kwargs.get('write') or False
    print_to_screen = kwargs.get('print_to_screen') if kwargs.get(
        'print_to_screen') is not None else False
    special_bonds = kwargs.get('special_bonds') or 'amber'
    cutoff = kwargs.get('cutoff') or 12.0
    timestep = kwargs.get('timestep') or 1
    ensemble = kwargs.get('ensemble') or 'nvt'
    temp = kwargs.get('temp')
    pressure = kwargs.get('pressure') or 1.
    new_v = kwargs.get('new_v')
    seed = kwargs.get('seed') or randint(10000, 99999)
    scale_v = kwargs.get('scale_v')
    length = kwargs.get('length') or 2000
    thermo = kwargs.get('thermo') or 1000
    thermo_style = kwargs.get('thermo_style')
    nonbond_mixing = kwargs.get('nonbond_mixing')
    kspace_style = kwargs.get('kspace_style') or 'pppm 1e-4'

    nanohub = kwargs.get('nanohub') or {}

    pbs = kwargs.get('pbs')
    np = kwargs.get('np')
    kokkos = kwargs.get('kokkos')

    dump = kwargs.get('dump') or False
    dump_name = kwargs.get('dump_name')
    dump_append = kwargs.get('dump_append')

    if temp is None:
        t_start = kwargs.get('t_start')
        t_stop = kwargs.get('t_stop')
        if t_start is None:
            t_start = 1000.
        if t_stop is None:
            t_stop = t_start
    else:
        t_start = temp
        t_stop = temp

    command = write_init(s, nb_cut=cutoff, special_bonds=special_bonds,
                         nonbond_mixing=nonbond_mixing, kspace_style=kspace_style)
    if log:
        command += 'log %s append\n' % log
    elif name:
        command += 'log %s.log append\n' % '_'.join(name.split())
    else:
        command += 'log log.lammps append\n'
    if thermo:
        command += 'thermo %s\n' % int(thermo)
    if thermo_style:
        command += 'thermo_style %s\n' % thermo_style
    command += 'timestep %s\n' % timestep
    if ensemble == 'nvt':
        command += 'fix 1 all %s temp %s %s 100\n' % (ensemble, t_start, t_stop)
    elif ensemble == 'npt':
        command += ('fix 1 all %s temp %s %s 100 iso %s %s 100\n'
                    % (ensemble, t_start, t_stop, pressure, pressure))
    if new_v:
        command += 'velocity all create %s %s\n' % (t_start, seed)
    elif scale_v:
        command += 'velocity all scale %s\n' % t_start

    if dump:
        if dump_name:
            command += ('dump pysimm_dump all atom %s %s.lammpstrj\n'
                        % (dump, dump_name))
        elif name:
            command += ('dump pysimm_dump all atom %s %s.lammpstrj\n'
                        % (dump, '_'.join(name.split())))
        else:
            command += ('dump pysimm_dump all atom %s pysimm_dump.lammpstrj\n'
                        % dump)
        if dump_append:
            command += 'dump_modify pysimm_dump append yes\n'
    command += 'run %s\n' % length
    command += 'unfix 1\n'
    if write:
        command += 'write_data %s\n' % write
    else:
        command += 'write_data pysimm_md.lmps\n'

    with open('temp.in', 'w') as f:
        f.write(command)

    if name:
        print('%s: starting %s simulation using LAMMPS'
              % (strftime('%H:%M:%S'), name))
    else:
        print('%s: starting molecular dynamics using LAMMPS'
              % strftime('%H:%M:%S'))

    if nanohub:
        if name:
            print('%s: sending %s simulation to computer cluster' % (strftime('%H:%M:%S'), name))
        sys.stdout.flush()
        cmd = ('submit -n %s -w %s -i temp.lmps -i temp.in '
               'lammps-09Dec14-parallel -e both -l none -i temp.in'
               % (nanohub.get('cores'), nanohub.get('walltime')))
        cmd = shlex.split(cmd)
        exit_status, stdo, stde = RapptureExec(cmd)
    elif pbs:
        call('mpiexec %s -e both -l log' % LAMMPS_EXEC, shell=True,
             stdin=open('temp.in'), stdout=PIPE, stderr=PIPE)
    else:
        if np:
            p = Popen(['mpiexec', '-np', str(np),
                       LAMMPS_EXEC, '-e', 'both', '-l', 'none'],
                      stdin=open('temp.in'), stdout=PIPE, stderr=PIPE)
        elif kokkos:
            p = Popen([LAMMPS_EXEC, '-k', 'on', '-sf', 'kk', '-e', 'both', '-l', 'none'],
                      stdin=open('temp.in'), stdout=PIPE, stderr=PIPE)
        else:
            p = Popen([LAMMPS_EXEC, '-e', 'both', '-l', 'none'],
                      stdin=open('temp.in'), stdout=PIPE, stderr=PIPE)

        while True:
            out = p.stdout.read(1)
            if out == '' and p.poll() is not None:
                break
            if out != '' and print_to_screen:
                sys.stdout.write(out)
                sys.stdout.flush()

    if write:
        n = read_lammps(write, quiet=True,
                        pair_style=s.pair_style,
                        bond_style=s.bond_style,
                        angle_style=s.angle_style,
                        dihedral_style=s.dihedral_style,
                        improper_style=s.improper_style)
    else:
        n = read_lammps('pysimm_md.lmps', quiet=True,
                        pair_style=s.pair_style,
                        bond_style=s.bond_style,
                        angle_style=s.angle_style,
                        dihedral_style=s.dihedral_style,
                        improper_style=s.improper_style)
    for p in n.particles:
        p_ = s.particles[p.tag]
        p_.x = p.x
        p_.y = p.y
        p_.z = p.z
        p_.vx = p.vx
        p_.vy = p.vy
        p_.vz = p.vz
    s.dim = n.dim
    os.remove('temp.in')

    try:
        os.remove('temp.lmps')
    except OSError as e:
        print e

    if not write:
        try:
            os.remove('pysimm_md.lmps')
            if name:
                print('%s: %s simulation using LAMMPS successful'
                      % (strftime('%H:%M:%S'), name))
            else:
                print('%s: molecular dynamics using LAMMPS successful'
                      % (strftime('%H:%M:%S')))
            return True
        except OSError:
            if name:
                print('%s: %s simulation using LAMMPS UNsuccessful'
                      % (strftime('%H:%M:%S'), name))
            else:
                print('%s: molecular dynamics using LAMMPS UNsuccessful'
                      % strftime('%H:%M:%S'))
            return False

    else:
        if os.path.isfile(write):
            if name:
                print('%s: %s simulation using LAMMPS successful'
                      % (strftime('%H:%M:%S'), name))
            else:
                print('%s: molecular dynamics using LAMMPS successful'
                      % (strftime('%H:%M:%S')))
            return True
        else:
            if name:
                print('%s: %s simulation using LAMMPS UNsuccessful'
                      % (strftime('%H:%M:%S'), name))
            else:
                print('%s: molecular dynamics using LAMMPS UNsuccessful'
                      % strftime('%H:%M:%S'))
            return False
Beispiel #5
0
def call_lammps(simulation, np, nanohub):
    """pysimm.lmps.call_lammps

    Wrapper to call LAMMPS using executable name defined in pysimm.lmps module.

    Args:
        simulation: pysimm.lmps.Simulation object reference
        np: number of threads to use
        nanohub: dictionary containing nanohub resource information default=None

    Returns:
        None
    """
    if nanohub:
        if simulation.name:
            print('%s: sending %s simulation to computer cluster at nanoHUB' % (strftime('%H:%M:%S'), simulation.name))
        sys.stdout.flush()
        cmd = ('submit -n %s -w %s -i temp.lmps -i temp.in '
               'lammps-09Dec14-parallel -e both -l none -i temp.in'
               % (nanohub.get('cores'), nanohub.get('walltime')))
        cmd = shlex.split(cmd)
        exit_status, stdo, stde = RapptureExec(cmd)
    else:
        if simulation.name:
            print('%s: starting %s simulation using LAMMPS'
                  % (strftime('%H:%M:%S'), simulation.name))
        else:
            print('%s: starting simulation using LAMMPS'
                  % strftime('%H:%M:%S'))
        if np:
            p = Popen(['mpiexec', '-np', str(np),
                       LAMMPS_EXEC, '-e', 'both', '-l', 'none'],
                      stdin=PIPE, stdout=PIPE, stderr=PIPE)
        else:
            p = Popen(['mpiexec', LAMMPS_EXEC, '-e', 'both', '-l', 'none'],
                      stdin=PIPE, stdout=PIPE, stderr=PIPE)
        simulation.write_input()
        p.stdin.write(simulation.input)
        q = Queue()
        t = Thread(target=enqueue_output, args=(p.stdout, q))
        t.daemon = True
        t.start()

        while t.isAlive() or not q.empty():
            try:
                line = q.get_nowait()
            except Empty:
                pass
            else:
                if simulation.print_to_screen:
                    sys.stdout.write(line)
                    sys.stdout.flush()
                    
    simulation.system.read_lammps_dump('pysimm.dump.tmp')
    '''if simulation.write:
        n = read_lammps(simulation.write, quiet=True,
                        pair_style=simulation.system.pair_style,
                        bond_style=simulation.system.bond_style,
                        angle_style=simulation.system.angle_style,
                        dihedral_style=simulation.system.dihedral_style,
                        improper_style=simulation.system.improper_style)
    else:
        n = read_lammps('pysimm_md.lmps', quiet=True,
                        pair_style=simulation.system.pair_style,
                        bond_style=simulation.system.bond_style,
                        angle_style=simulation.system.angle_style,
                        dihedral_style=simulation.system.dihedral_style,
                        improper_style=simulation.system.improper_style)
    for p in n.particles:
        p_ = simulation.system.particles[p.tag]
        p_.x = p.x
        p_.y = p.y
        p_.z = p.z
        p_.vx = p.vx
        p_.vy = p.vy
        p_.vz = p.vz
    simulation.system.dim = n.dim'''

    try:
        os.remove('temp.lmps')
    except OSError as e:
        print e
        
    if os.path.isfile('pysimm.qeq.tmp'):
        os.remove('pysimm.qeq.tmp')
        
    try:
        os.remove('pysimm.dump.tmp')
        if simulation.name:
            print('%s: %s simulation using LAMMPS successful'
                  % (strftime('%H:%M:%S'), simulation.name))
        else:
            print('%s: molecular dynamics using LAMMPS successful'
                  % (strftime('%H:%M:%S')))
    except OSError as e:
        if simulation.name:
            raise PysimmError('%s simulation using LAMMPS UNsuccessful' % simulation.name)
        else:
            raise PysimmError('molecular dynamics using LAMMPS UNsuccessful')

    '''if not simulation.write:
Beispiel #6
0
def network(s, **kwargs):
    """pysimm.apps.zeopp.network

    Perform 1. Pore diameters; 2. Channel identification and dimensionality; 3. Surface area;
            4. Accessible volume; 5. Pore size distribution calculation using zeo++ v2.2

    with options to do 6. Probe-occupiable volume; 7. Stochastic ray tracing; 8. Blocking spheres;
                       9. Distance grids; 10. Structure analysis

    Args:
        s: pysimm System object or filename of file in CSSR | CUC | V1 | CIF format
        atype_name: True to use atom type as atom name (usually need radii and mass info), False to use atom element
        radii: file name that contain atom radii data (rad.rad)
        mass: file name that contain atom mass data (mass.mass)
        probe_radius: radius of a probe used in sampling of surface (1.2 A)
        chan_radius: radius of a probe used to determine accessibility of void space (1.2 A)
        num_samples: number of Monte Carlo samples per unit cell (50000)
        option to include in the simulation: set True to activate
            ha: default=True, for using high accuracy,
            res: default=True, for diameters of the largest included sphere, the largest free sphere and the largest included sphere along free sphere path
            chan: default=True, for channel systems characterized by dimensionality as well as Di, Df and Dif
            sa: default=True, for surface area accessible to a spherical probe, characterized by
                      accessible surface area (ASA) and non-accessible surface area (NASA)
            vol: default=True, for accessible volume (AV) and non-accessible volume (NAV)
            volpo: default=False, for accessible proce-occupiable volume (POAV) and non-accessible probe-occupiable volume (PONAV)
            psd: default=True, for the "deriviative distribution" (change of AV w.r.t probe size) reported in the histogram file with 1000 bins of size of 0.1 Ang
            ray_atom: default=False
            block: default=False
            extra: user provided options, such as -gridG, -gridBOV, -strinfo, -oms, etc.
            
    ZEOpp_EXEC: path to zeo++ executable (network)

    Returns:
        None
    """
    global ZEOpp_EXEC

    if ZEOpp_EXEC is None:
        print('Please specify the environment variable '
              'ZEOpp_EXEC'
              ' that points to '
              'zeo++ executable (network)')
        exit(1)

    probe_radius = kwargs.get('probe_radius', 1.2)
    chan_radius = kwargs.get('chan_radius', 1.2)
    num_samples = kwargs.get('num_samples', 50000)
    atype_name = kwargs.get('atype_name', False)

    ha = kwargs.get('ha', True)
    res = kwargs.get('res', True)
    chan = kwargs.get('chan', True)
    sa = kwargs.get('sa', True)
    vol = kwargs.get('vol', True)
    psd = kwargs.get('psd', True)
    volpo = kwargs.get('volpo', False)
    ray_atom = kwargs.get('ray_atom', False)
    block = kwargs.get('block', False)
    extra = kwargs.get('extra')

    nanohub = kwargs.get('nanohub')

    if isinstance(s, system.System):
        if atype_name:
            s.write_cssr('zeopp_data.cssr', aname=1)
        else:
            s.write_cssr('zeopp_data.cssr')
        input_file = 'zeopp_data.cssr'
    elif isinstance(s, str):
        input_file = s

    args = ZEOpp_EXEC

    if 'radii' in kwargs.keys():
        args += ' -r ' + kwargs.get('radii')
    if 'mass' in kwargs.keys():
        args += ' -mass ' + kwargs.get('mass')

    if ha:
        args += ' -ha'
    if res:
        args += ' -res'
    if chan:
        args += ' -chan ' + str(probe_radius)
    if sa:
        args += ' -sa ' + str(chan_radius) + ' ' + str(
            probe_radius) + ' ' + str(num_samples)
    if vol:
        args += ' -vol ' + str(chan_radius) + ' ' + str(
            probe_radius) + ' ' + str(num_samples)
    if psd:
        args += ' -psd ' + str(chan_radius) + ' ' + str(
            probe_radius) + ' ' + str(num_samples)
    if volpo:
        args += ' -volpo ' + str(chan_radius) + ' ' + str(
            probe_radius) + ' ' + str(num_samples)
    if ray_atom:
        args += ' -ray_atom ' + str(chan_radius) + ' ' + str(
            probe_radius) + ' ' + str(num_samples)
    if block:
        args += ' -block ' + str(probe_radius) + ' ' + str(num_samples)
    if extra:
        args += ' ' + extra

    args += ' ' + input_file

    arg_list = shlex.split(args)

    print('%s: starting simulation using zeo++' % strftime('%H:%M:%S'))

    if nanohub:
        print('%s: sending zeo++ simulation to computer cluster' %
              strftime('%H:%M:%S'))
        sys.stdout.flush()
        cmd = ('submit -n 1 -w %s ' % (24 * 60)) + ZEOpp_EXEC + args
        cmd = shlex.split(cmd)
        exit_status, stdo, stde = RapptureExec(cmd)
    else:
        p = Popen(arg_list, stdin=PIPE, stdout=PIPE, stderr=PIPE)
        while True:
            stout = p.stdout.readline()
            if stout == '' and p.poll() is not None:
                break
            if stout:
                print(stout.strip())
        # print(stout)
        sterr = p.stderr.readlines()
        print(sterr)

    print('%s: zeo++ simulation successful' % strftime('%H:%M:%S'))