frag_pele/Growing/simulations_linker.py
def simulation_runner(path_to_pele, control_in, cpus=4, srun=True):
    """
    Runs a PELE simulation with the parameters described in the input control file.

    Input:

    path_to_pele --> Complete path to PELE folder

    control_in --> Name of the control file with the parameters to run PELE
    """
    if cpus:
        cpus = int(cpus)
        if cpus < 2:
            logger.critical("Sorry, to run PELE with paralel processors you need at least 2 cores!")
        else:
            if srun:
                logger.info("Starting PELE simulation. You will run srun with {} cores.".format(cpus))
                cmd = "srun -n {} {} {}".format(cpus, path_to_pele, control_in)
                logger.info("Running {}".format(cmd))
                subprocess.call(cmd.split())
            else:
                logger.info("Starting PELE simulation. You will run mpirun with {} cores.".format(cpus))
                cmd = "mpirun -n {} {} {}".format(cpus, path_to_pele, control_in)
                logger.info("Running {}".format(cmd))
                subprocess.call(cmd.split())
    else:
        logger.info("Starting PELE simulation. You will run serial PELE.")
        cmd = "{} {}".format(path_to_pele, control_in)
        logger.info("Running {}".format(cmd))
        subprocess.call(cmd.split())

    Runs a PELE simulation with the parameters described in the input control file.

    Input:

    path_to_pele --> Complete path to PELE folder

    control_in --> Name of the control file with the parameters to run PELE
    
Runs a PELE simulation with the parameters described in the input control file.
Input.

-> Complete path to PELE folder

-> Name of the control file with the parameters to run PELE
Runs a PELE simulation with the parameters described in the input control file . Input . - > Complete path to PELE folder - > Name of the control file with the parameters to run PELE
def simulation_runner(path_to_pele, control_in, cpus=4, srun=True):
    if cpus:
        cpus = int(cpus)
        if cpus < 2:
            logger.critical("Sorry, to run PELE with paralel processors you need at least 2 cores!")
        else:
            if srun:
                logger.info("Starting PELE simulation. You will run srun with {} cores.".format(cpus))
                cmd = "srun -n {} {} {}".format(cpus, path_to_pele, control_in)
                logger.info("Running {}".format(cmd))
                subprocess.call(cmd.split())
            else:
                logger.info("Starting PELE simulation. You will run mpirun with {} cores.".format(cpus))
                cmd = "mpirun -n {} {} {}".format(cpus, path_to_pele, control_in)
                logger.info("Running {}".format(cmd))
                subprocess.call(cmd.split())
    else:
        logger.info("Starting PELE simulation. You will run serial PELE.")
        cmd = "{} {}".format(path_to_pele, control_in)
        logger.info("Running {}".format(cmd))
        subprocess.call(cmd.split())
def simulation_runner ( path_to_pele , control_in , cpus = 4 , srun = True ) : if cpus : cpus = int ( cpus ) if cpus < 2 : logger . critical ( "Sorry, to run PELE with paralel processors you need at least 2 cores!" ) else : if srun : logger . info ( "Starting PELE simulation. You will run srun with {} cores." . format ( cpus ) ) cmd = "srun -n {} {} {}" . format ( cpus , path_to_pele , control_in ) logger . info ( "Running {}" . format ( cmd ) ) subprocess . call ( cmd . split ( ) ) else : logger . info ( "Starting PELE simulation. You will run mpirun with {} cores." . format ( cpus ) ) cmd = "mpirun -n {} {} {}" . format ( cpus , path_to_pele , control_in ) logger . info ( "Running {}" . format ( cmd ) ) subprocess . call ( cmd . split ( ) ) else : logger . info ( "Starting PELE simulation. You will run serial PELE." ) cmd = "{} {}" . format ( path_to_pele , control_in ) logger . info ( "Running {}" . format ( cmd ) ) subprocess . call ( cmd . split ( ) )
Runs a PELE simulation with the parameters described in the input control file.
Runs a PELE simulation with the parameters described in the input control file .
"""
    Runs a PELE simulation with the parameters described in the input control file.

    Input:

    path_to_pele --> Complete path to PELE folder

    control_in --> Name of the control file with the parameters to run PELE
    """
path_to_pele
control_in
cpus
srun