{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# useful to autoreload the module without restarting the kernel\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from mppi import InputFiles as I, Calculators as C" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "omp = 1\n", "mpi = 4" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Tutorial for the QeCalculator class" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This tutorial describes the usage of the QeCalculator class, that manages the run of a calculation with the QuantumESPRESSO package." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "run_dir = 'QeCalculator_test'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Perform a scf computations for silicon" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We init the PwInput object using an exsisting input file. Then we define an input with the associated name\n", "using the energy_cutoff as a parameter" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "energy_cutoffs = 50\n", "outdir_scf = 'outdir_scf'\n", "name_scf = 'scf.in'" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'control': {'calculation': \"'scf'\",\n", " 'verbosity': \"'high'\",\n", " 'prefix': \"'ecut_50'\",\n", " 'outdir': \"'outdir_scf'\",\n", " 'pseudo_dir': \"'../pseudos'\"},\n", " 'system': {'force_symmorphic': '.true.',\n", " 'occupations': \"'fixed'\",\n", " 'ibrav': '2',\n", " 'celldm(1)': '10.3',\n", " 'ntyp': '1',\n", " 'nat': '2',\n", " 'ecutwfc': 50},\n", " 'electrons': {'diago_full_acc': '.false.', 'conv_thr': '1e-08'},\n", " 'ions': {},\n", " 'cell': {},\n", " 'atomic_species': {'Si': ['28.086', 'Si.pbe-mt_fhi.UPF']},\n", " 'atomic_positions': {'type': 'crystal',\n", " 'values': [['Si', [0.125, 0.125, 0.125]], ['Si', [-0.125, -0.125, -0.125]]]},\n", " 'kpoints': {'type': 'automatic', 'values': ([6, 6, 6], [0.0, 0.0, 0.0])},\n", " 'cell_parameters': {},\n", " 'file': 'IO_files/si_scf.in'}" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "inp = I.PwInput(file='IO_files/si_scf.in')\n", "prefix = 'ecut_%s'%energy_cutoffs\n", "inp.set_kpoints(points = [6,6,6])\n", "inp.set_pseudo_dir(pseudo_dir='../pseudos')\n", "inp.set_prefix(prefix)\n", "inp.set_outdir(outdir_scf)\n", "inp.set_energy_cutoff(energy_cutoffs)\n", "name = name_scf\n", "inp" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we define an intance of the QeCalculator. For this example we use a direct scheduler\n", "\n", "The first step is to create an istance of the RunRules class that contains the options of the calculator" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'scheduler': 'direct', 'mpi': 4, 'omp_num_threads': 1}" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rr = C.RunRules(mpi=mpi,omp_num_threads=omp)\n", "rr" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\u001b[0;31mInit signature:\u001b[0m\n", "\u001b[0mC\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mQeCalculator\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mrunRules\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mexecutable\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'pw.x'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mskip\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mclean_restart\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mdry_run\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mwait_end_run\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mactivate_BeeOND\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mverbose\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mDocstring:\u001b[0m \n", "Perform a QuantumESPRESSO calculation. The parameters used to define the parellelization\n", "strategy are provided in the `runRules` object.\n", "\n", "Parameters:\n", " runRulues (:class:`RunRules`) : instance of the :class:`RunRules` class\n", " executable (:py:class:`string`) : set the executable (pw.x, ph.x, ..) of the QuantumESPRESSO package\n", " skip (:py:class:`bool`) : if True evaluate if the computation can be skipped. This is done by checking if the log\n", " file of the run contains the string `job_done`, defined as a data member of this class\n", " clean_restart (:py:class:`bool`) : if True delete the folder $prefix.save before running the computation\n", " dry_run (:py:class:`bool`) : with this option enabled the calculator setup the calculations and write the script\n", " for submitting the job, but the computations are not run\n", " wait_end_run (:py:class:`bool`) : with this option disabled the run method does not wait the end of the run.\n", " This option may be useful for interacting with the code in particular in _asincronous_ computation managed\n", " by the slurm scheduler\n", " activate_BeeOND (:py:class:`bool`) : if True set I/O of the run in the BeeOND_dir created by the slurm scheduler.\n", " With this options enabled the ``out_dir`` of the run is set in the ``BeenOND_dir`` folder and the input wavefunction\n", " of the source folder (if needed) are copied in the ``BeeOND_dir``. At the end of the run the ``out_dir`` is moved\n", " in its original path. The value of the ``BeeOND_dir`` is written as a data member of the class and can be modified\n", " if needed\n", " verbose (:py:class:`bool`) : set the amount of information provided on terminal\n", " kwargs : other parameters that are stored in the _global_options dictionary\n", "\n", "Computations are performed in the folder specified by the ``run_dir`` parameter. The input and\n", "the log files are written in the run_dir. Instead, the $prefix.xml file and the $prefix.save\n", "folders are written in the ``out_dir`` path. The values of the prefix and out_dir variables\n", "are read from the input file. If the ``out_dir`` path is a relative path its root is located\n", "in the ``run_dir`` folder.\n", "\n", "Example:\n", " >>> rr = RunRules(scheduler='slurm',ntasks_per_node=4,memory='124GB')\n", " >>> code = calculator(rr,skip=True,clean_restart=True,verbose=True)\n", " >>> code.run(input = ..., run_dir = ...,name = ..., source_dir = ..., **kwargs)\n", "\n", " When the run method is called the class runs the command:\n", " cd run_dir ; `mpirun command` executable_name -inp name.in > name.log\n", "\n", " where the arguments of the run method are:\n", "\n", "Args:\n", " run_dir (:py:class:`string`) : the folder in which the simulation is performed\n", " input (:py:class:`string`) : instance of the :class:`PwInput` class\n", " that define the input object\n", " name (:py:class:`string`) : string with the name associated to the input file.\n", " Usually it is convenient to set the name equal to the prefix of the input object so\n", " the name of the input file and the prefix folder built by QuantumESPRESSO are the same\n", " source_dir (:py:class:`string`) : useful for the nscf computations. The source folder contains\n", " the wave-functions created by a scf calculation. If present the class copies this folder in the\n", " ``out_dir`` with the name $prefix.save\n", " kwargs : other parameters that are stored in the run_options dictionary\n", "\u001b[0;31mFile:\u001b[0m ~/Applications/MPPI/mppi/Calculators/QeCalculator.py\n", "\u001b[0;31mType:\u001b[0m type\n", "\u001b[0;31mSubclasses:\u001b[0m \n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "C.QeCalculator?" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Initialize a QuantumESPRESSO calculator with scheduler direct\n" ] }, { "data": { "text/plain": [ "{'scheduler': 'direct',\n", " 'mpi': 4,\n", " 'omp_num_threads': 1,\n", " 'executable': 'pw.x',\n", " 'skip': True,\n", " 'clean_restart': True,\n", " 'dry_run': False,\n", " 'wait_end_run': True,\n", " 'activate_BeeOND': False,\n", " 'verbose': True}" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "code = C.QeCalculator(rr)\n", "code.global_options()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We run the computation passing the the input object and the associated name to the run method of the \n", "calculator.\n", "\n", "First of all we perform a simple call to the run method" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "create the run_dir folder : 'QeCalculator_test'\n", "run command: mpirun -np 4 pw.x -inp scf.in.in > scf.in.log\n", "computation scf.in is running...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n", "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n", "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n", "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "computation scf.in ended\n" ] }, { "data": { "text/plain": [ "'/home/marco/Applications/MPPI/sphinx_source/tutorials/QeCalculator_test/outdir_scf/ecut_50.save/data-file-schema.xml'" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result = code.run(run_dir=run_dir,input=inp,name=name,other_variable = 1)\n", "result" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The structure of the folder built by the calculator can be analyzed by browsing the run_dir. In general the `name.log` file is written\n", "in the `run_dir` while the the `prefix.xml` file and the `prefix.save` folder are written in the `out_dir` folder defined by the outdir \n", "key of the input file.\n", "It this parameter is expressed as a relative path the folder is located in the path `run_dir/out_dir`, however an absolute path (also outer from the run_dir) can be used. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We observe that the output of the run method is a string with the the data-file-schema.xml" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "After the run all the parameters passed to the calculator are written in the run_options attribute" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'scheduler': 'direct',\n", " 'mpi': 4,\n", " 'omp_num_threads': 1,\n", " 'executable': 'pw.x',\n", " 'skip': True,\n", " 'clean_restart': True,\n", " 'dry_run': False,\n", " 'wait_end_run': True,\n", " 'activate_BeeOND': False,\n", " 'verbose': True,\n", " 'run_dir': 'QeCalculator_test',\n", " 'input': {'control': {'calculation': \"'scf'\",\n", " 'verbosity': \"'high'\",\n", " 'prefix': \"'ecut_50'\",\n", " 'outdir': \"'outdir_scf'\",\n", " 'pseudo_dir': \"'../pseudos'\"},\n", " 'system': {'force_symmorphic': '.true.',\n", " 'occupations': \"'fixed'\",\n", " 'ibrav': '2',\n", " 'celldm(1)': '10.3',\n", " 'ntyp': '1',\n", " 'nat': '2',\n", " 'ecutwfc': 50},\n", " 'electrons': {'diago_full_acc': '.false.', 'conv_thr': '1e-08'},\n", " 'ions': {},\n", " 'cell': {},\n", " 'atomic_species': {'Si': ['28.086', 'Si.pbe-mt_fhi.UPF']},\n", " 'atomic_positions': {'type': 'crystal',\n", " 'values': [['Si', [0.125, 0.125, 0.125]],\n", " ['Si', [-0.125, -0.125, -0.125]]]},\n", " 'kpoints': {'type': 'automatic', 'values': ([6, 6, 6], [0.0, 0.0, 0.0])},\n", " 'cell_parameters': {},\n", " 'file': 'IO_files/si_scf.in'},\n", " 'name': 'scf.in',\n", " 'other_variable': 1,\n", " 'is_to_run': True}" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "code.run_options" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Instead, let see what happens if the simulation fails. For instance if we provide an empty input to code" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "inp2 = I.PwInput()" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'control': {'calculation': \"'scf'\",\n", " 'verbosity': \"'high'\",\n", " 'prefix': \"'si_scf_test2'\",\n", " 'outdir': \"'./'\"},\n", " 'system': {'force_symmorphic': '.false.'},\n", " 'electrons': {'diago_full_acc': '.false.'},\n", " 'ions': {},\n", " 'cell': {},\n", " 'atomic_species': {},\n", " 'atomic_positions': {},\n", " 'kpoints': {},\n", " 'cell_parameters': {}}" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pref2 = 'si_scf_test2'\n", "inp2.set_prefix(pref2)\n", "inp2" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "run command: mpirun -np 4 pw.x -inp si_scf_test2.in > si_scf_test2.log\n", "computation si_scf_test2 is running...\n", "computation si_scf_test2 ended\n", "Expected file /home/marco/Applications/MPPI/sphinx_source/tutorials/QeCalculator_test/si_scf_test2.save/data-file-schema.xml not found\n", "\n", " Check if wait_end_run is False or the dry_run option is active.\n", " Otherwise a possible error has occured during the computation\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "--------------------------------------------------------------------------\n", "MPI_ABORT was invoked on rank 3 in communicator MPI_COMM_WORLD\n", "with errorcode 1.\n", "\n", "NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.\n", "You may or may not see output from other processes, depending on\n", "exactly when Open MPI kills them.\n", "--------------------------------------------------------------------------\n", "[dal-xps:515106] 3 more processes have sent help message help-mpi-api.txt / mpi-abort\n", "[dal-xps:515106] Set MCA parameter \"orte_base_help_aggregate\" to 0 to see all help / error messages\n" ] }, { "data": { "text/plain": [ "'/home/marco/Applications/MPPI/sphinx_source/tutorials/QeCalculator_test/si_scf_test2.save/data-file-schema.xml'" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result2 = code.run(input = inp2, run_dir = run_dir,name=pref2) \n", "result2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this case the calculator provide a warning since the data-file-schema has not been found after the computation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Usage of the skip parameter" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we repeat a calculation that has been already performed and skip = True the class skip its computation, for instance" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Skip the run of scf.in\n" ] } ], "source": [ "result = code.run(run_dir=run_dir,input=inp,name=name, skip = True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Instead if we set skip=False the computation is executed in any case " ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "delete log file: QeCalculator_test/scf.in.log\n", "delete xml file: /home/marco/Applications/MPPI/sphinx_source/tutorials/QeCalculator_test/outdir_scf/ecut_50.xml\n", "delete folder: /home/marco/Applications/MPPI/sphinx_source/tutorials/QeCalculator_test/outdir_scf/ecut_50.save\n", "delete the out_dir: /home/marco/Applications/MPPI/sphinx_source/tutorials/QeCalculator_test/outdir_scf\n", "run command: mpirun -np 4 pw.x -inp scf.in.in > scf.in.log\n", "computation scf.in is running...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n", "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n", "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n", "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "computation scf.in ended\n" ] } ], "source": [ "result = code.run(run_dir=run_dir,input=inp,name=name,skip=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The option of the calculator `clean_restart` allows to use to decide if the pre existing results have to be erased or\n", "not before running the computation." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Test of the slurm scheduler" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If the `slurm` scheduler is chosen the calculator prepare the slurm script and submit it. " ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'scheduler': 'slurm',\n", " 'nodes': 1,\n", " 'ntasks_per_node': 4,\n", " 'cpus_per_task': 1,\n", " 'omp_num_threads': 2,\n", " 'gpus_per_node': None,\n", " 'memory': None,\n", " 'time': None,\n", " 'partition': None,\n", " 'account': None,\n", " 'qos': None,\n", " 'map_by': None,\n", " 'pe': 1,\n", " 'rank_by': None}" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rr = C.RunRules(scheduler='slurm',ntasks_per_node=4,omp_num_threads=2)\n", "rr" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Initialize a QuantumESPRESSO calculator with scheduler slurm\n" ] }, { "data": { "text/plain": [ "{'scheduler': 'slurm',\n", " 'nodes': 1,\n", " 'ntasks_per_node': 4,\n", " 'cpus_per_task': 1,\n", " 'omp_num_threads': 2,\n", " 'gpus_per_node': None,\n", " 'memory': None,\n", " 'time': None,\n", " 'partition': None,\n", " 'account': None,\n", " 'qos': None,\n", " 'map_by': None,\n", " 'pe': 1,\n", " 'rank_by': None,\n", " 'executable': 'pw.x',\n", " 'skip': True,\n", " 'clean_restart': True,\n", " 'dry_run': False,\n", " 'wait_end_run': True,\n", " 'activate_BeeOND': False,\n", " 'verbose': True}" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "code = C.QeCalculator(rr)\n", "code.global_options()" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "run performed starting from existing results\n", "run command: mpirun -np 4 pw.x -inp scf.in.in > scf.in.log\n", "Dry_run option active. Script not submitted\n", "The wait_end_run is False or the dry_run option is active. The calculator proceedes to the postprocessing\n" ] } ], "source": [ "result = code.run(run_dir=run_dir,input=inp,name=name,skip=False,dry_run=True,clean_restart=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The slurm script is written in the run_dir. The execution of the run requires that the slurm scheduler is installed. However with the\n", "`dry_run` option we can write the script on disk.\n", "\n", "Note that we have disabled the option `clean_restart`, in this way the .log, .xml files and the .save floders are not removed before\n", "running the computation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Perform a nscf computation for silicon. Usage of the source_dir option" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We show how to perform a pw nscf calculation using the results of the first scf run as an input.\n", "\n", "Before running this computation ensure that the scf one has been computed and that the save folder is written in the `run_dir`." ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Initialize a QuantumESPRESSO calculator with scheduler direct\n" ] } ], "source": [ "rr = C.RunRules(mpi=mpi,omp_num_threads=omp)\n", "code = C.QeCalculator(rr)" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "num_bands = 8" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'control': {'calculation': \"'nscf'\",\n", " 'verbosity': \"'high'\",\n", " 'prefix': \"'bands_8'\",\n", " 'outdir': \"'outdir_nscf'\",\n", " 'pseudo_dir': \"'../pseudos'\"},\n", " 'system': {'force_symmorphic': '.true.',\n", " 'occupations': \"'fixed'\",\n", " 'ibrav': '2',\n", " 'celldm(1)': '10.3',\n", " 'ntyp': '1',\n", " 'nat': '2',\n", " 'ecutwfc': 50,\n", " 'nbnd': 8},\n", " 'electrons': {'diago_full_acc': '.false.', 'conv_thr': 1e-08},\n", " 'ions': {},\n", " 'cell': {},\n", " 'atomic_species': {'Si': ['28.086', 'Si.pbe-mt_fhi.UPF']},\n", " 'atomic_positions': {'type': 'crystal',\n", " 'values': [['Si', [0.125, 0.125, 0.125]], ['Si', [-0.125, -0.125, -0.125]]]},\n", " 'kpoints': {'type': 'automatic', 'values': ([6, 6, 6], [0.0, 0.0, 0.0])},\n", " 'cell_parameters': {},\n", " 'file': 'IO_files/si_scf.in'}" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "inp.set_nscf(num_bands,force_symmorphic=True)\n", "prefix = 'bands_%s'%num_bands\n", "outdir_nscf = 'outdir_nscf'\n", "inp.set_prefix(prefix)\n", "inp.set_outdir(outdir_nscf)\n", "inp.set_energy_cutoff(50)\n", "name_nscf = 'nscf.in'\n", "inp" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "copy source_dir QeCalculator_test/outdir_scf/ecut_50.save in the /home/marco/Applications/MPPI/sphinx_source/tutorials/QeCalculator_test/outdir_nscf/bands_8.save\n", "run command: mpirun -np 4 pw.x -inp nscf.in.in > nscf.in.log\n", "computation nscf.in is running...\n", "computation nscf.in ended\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n", "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n", "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n", "Note: The following floating-point exceptions are signalling: IEEE_DENORMAL\n" ] }, { "data": { "text/plain": [ "'/home/marco/Applications/MPPI/sphinx_source/tutorials/QeCalculator_test/outdir_nscf/bands_8.save/data-file-schema.xml'" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result = code.run(input=inp,run_dir=run_dir,name=name_nscf,source_dir='QeCalculator_test/outdir_scf/ecut_50.save')\n", "result" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.6" } }, "nbformat": 4, "nbformat_minor": 4 }