Giter Club home page Giter Club logo

psiflow's Introduction

https://travis-ci.org/molmod/molmod.svg?branch=master

MolMod is a collection of molecular modelling tools for python. It is used by other software developed at the CMM, including Yaff, TAMkin and Zeobuilder.

More information about MolMod can be found on the CMM Code website: http://molmod.ugent.be/software

MolMod is distributed as open source software under the conditions of the GPL license version 3. Read the file COPYING for more details, or visit http://www.gnu.org/licenses/

Installation

MolMod can be installed with pip (system wide or in a virtual environment):

pip install Cython numpy
pip install molmod

Alternatively, you can install MolMod in your home directory:

pip install Cython numpy --user
pip install molmod --user

Lastly, you can also install MolMod with conda. (See https://www.continuum.io/downloads)

# Using the builds from Travis-CI ...
conda install -c molmod molmod
# ... or using the packages on conda-force
conda install -c conda-forge molmod

Testing

The tests can be executed as follows:

pytest molmod

psiflow's People

Contributors

andrew-s-rosen avatar svandenhaute avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

psiflow's Issues

Change configuration file to YAML format for better readability

The execution configuration is entirely declarative; it does not involve any computations. As such, formatting it as a Python script is rather misleading, and might make it look more complicated than it actually is.
It should be fairly trivial to convert this into yaml using Pydantic.

type error on cp2k_input

Hi! I was trying to simply run mof_phase_transition.py example, however I get an error:

Traceback (most recent call last):
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/dataflow/dflow.py", line 884, in _unwrap_futures
    new_inputs.extend([dep.result()])
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/dataflow/dflow.py", line 301, in handle_exec_update
    res = self._unwrap_remote_exception_wrapper(future)
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/dataflow/dflow.py", line 573, in _unwrap_remote_exception_wrapper
    result.reraise()
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/app/errors.py", line 122, in reraise
    reraise(t, v, v.__traceback__)
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/six.py", line 719, in reraise
    raise value
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/app/errors.py", line 145, in wrapper
    return func(*args, **kwargs)
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/app/bash.py", line 47, in remote_side_bash_executor
    raise e
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/app/bash.py", line 33, in remote_side_bash_executor
    executable = func(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/psiflow/reference/_cp2k.py", line 201, in cp2k_singlepoint_pre
  File "/opt/conda/lib/python3.10/site-packages/typeguard/__init__.py", line 1032, in wrapper
  File "/opt/conda/lib/python3.10/site-packages/typeguard/__init__.py", line 875, in check_argument_types
TypeError: type of argument "cp2k_input" must be str; got dict instead

I've tried to get to where the source of this problem is, but despite the beautiful documentation, I've failed... ☹️
Is the fault on the psiflow side or is it a cp2k issue? Any idea how to fix it?

Are there any development instructions?

Just wanted to inquire if there are any specifics with regards to development. For instance, does the project use a given formatter/linter (doesn't seem like black or isort, for instance)? And is there a preferred way to run the test suite? It doesn't look like it runs on GitHub Actions since CI isn't set up, so I assume pytest locally is sufficient?

Apptainer installation instructions could be clarified

In the installation guide, the apptainer instructions state:

sudo apt install apptainer

However, that did not work for me. I needed to do

sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:apptainer/ppa
sudo apt update
sudo apt install -y apptainer

as described in the official apptainer instructions. It might be good to add this or to hyperlink to the Apptainer installation instructions for more details. That said, it's a pretty trivial find.

Parsl version pin: is it needed?

Hello, psiflow team! Thank you so much for the beautiful documentation on this package. I very much look forward to using this code in the future.

As for my question, I noticed that parsl is pinned to 2023.08.28 in pyproject.toml. Is this version pin necessary, or is it possible to relax this constraint?

CP2K jobs slower with higher number of cores per worker

Discussed in #26

Originally posted by b-mazur May 17, 2024
I'm trying to reproduce mof_phase_transition.py example and I'm facing issue where with increasing number of cores per worker my calculations gets prohibitively slow. In all cases max_walltime: 20 results in AssertionError: atomic energy calculation of O failed because none of the CP2K tasks for oxygen are completed in 20 minutes.

I played a bit with different number of cores per worker and here are values of SCF steps reached in 20 minutes for oxygen task with multiplicity 5:

cores per worker SCF steps
1 33
2 31
4 20
16 3

Finally I was able to finish this part by increasing max_walltime to 180 minutes and using only 1 core per worker but this will create another issue when ReferenceEvaluation is used for whole MOF in next steps.

I've never used CP2K but I feel that 180 minutes is far too long for single point of single atom. What else I observe is the surprisingly low CPU performance of slurm tasks, at levels of <10%. I checked timings in CP2K output but MPI timing doesn't seem to be such large (however, as I said, I have no experience so maybe I don't understand something). Here is an example:

 -------------------------------------------------------------------------------
 -                                                                             -
 -                                T I M I N G                                  -
 -                                                                             -
 -------------------------------------------------------------------------------
 SUBROUTINE                       CALLS  ASD         SELF TIME        TOTAL TIME
                                MAXIMUM       AVERAGE  MAXIMUM  AVERAGE  MAXIMUM
 CP2K                                 1  1.0    12.43    12.51 11438.24 11438.32
 qs_forces                            1  2.0     0.00     0.00 11307.17 11307.28
 qs_energies                          1  3.0     0.00     0.00 11272.36 11272.43
 scf_env_do_scf                       1  4.0     0.00     0.00 11209.10 11209.25
 scf_env_do_scf_inner_loop          125  5.0     0.00     0.01 10924.29 10924.59
 qs_scf_new_mos                     125  6.0     0.00     0.00  7315.99  7321.60
 qs_scf_loop_do_ot                  125  7.0     0.00     0.00  7315.99  7321.60
 ot_scf_mini                        125  8.0     0.00     0.00  6917.97  6923.00
 dbcsr_multiply_generic            3738 10.8     0.14     0.15  5700.36  5708.79
 ot_mini                            125  9.0     0.00     0.00  3021.17  3021.32
 mp_sum_l                         18209 11.7  2898.88  2915.89  2898.88  2915.89
 qs_ot_get_p                        256  9.0     0.00     0.00  2869.85  2871.50
 qs_ot_get_derivative               126 10.0     0.00     0.00  2737.75  2738.66
 rs_pw_transfer                    1905 10.0     0.02     0.02  2014.01  2029.50
 qs_ks_update_qs_env                128  6.0     0.00     0.00  1921.34  1922.16
 qs_ot_p2m_diag                     145 10.0     0.00     0.00  1907.22  1918.97
 rebuild_ks_matrix                  126  7.0     0.00     0.00  1867.10  1869.47
 qs_ks_build_kohn_sham_matrix       126  8.0     0.01     0.01  1867.10  1869.47
 qs_rho_update_rho_low              126  6.0     0.00     0.00  1717.53  1723.18
 calculate_rho_elec                 252  7.0     2.66    19.36  1717.53  1723.18
 density_rs2pw                      252  8.0     0.01     0.01  1667.59  1684.20
 cp_dbcsr_syevd                     145 11.0     0.01     0.01  1442.29  1459.78
 pw_transfer                       3737 10.9     0.13     0.17  1190.61  1208.75
 fft_wrap_pw1pw2                   3485 11.9     0.02     0.02  1190.36  1208.51
 fft3d_ps                          3485 13.9    69.25    75.81  1183.31  1202.91
 cp_fm_syevd                        145 12.0     0.00     0.00  1164.55  1177.19
 mp_alltoall_z22v                  3485 15.9  1095.45  1118.30  1095.45  1118.30
 qs_ot_get_derivative_diag           69 11.0     0.00     0.00  1104.83  1105.37
 mp_sum_b                          6644 12.1  1081.35  1095.09  1081.35  1095.09
 mp_waitall_1                    154259 15.1  1026.71  1085.45  1026.71  1085.45
 multiply_cannon                   3738 11.8     0.18     0.21  1069.89  1079.22
 fft_wrap_pw1pw2_500               1965 13.7     1.43     2.06  1032.01  1051.67
 qs_ot_get_derivative_taylor         57 11.0     0.00     0.00   978.10   978.50
 mp_waitany                        4620 12.0   869.01   955.24   869.01   955.24
 qs_vxc_create                      126  9.0     0.00     0.00   879.87   886.00
 qs_ot_get_orbitals                 250  9.0     0.00     0.00   799.42   800.84
 sum_up_and_integrate                64  9.0     0.08     0.08   790.31   799.75
 integrate_v_rspace                 128 10.0     0.00     0.00   790.23   799.67
 potential_pw2rs                    128 11.0     0.01     0.01   787.91   789.91
 make_m2s                          7476 11.8     0.07     0.07   704.01   711.12
 make_images                       7476 12.8     0.12     0.13   703.73   710.85
 make_images_sizes                 7476 13.8     0.01     0.01   703.28   710.42
 mp_alltoall_i44                   7476 14.8   703.27   710.41   703.27   710.41
 rs_pw_transfer_RS2PW_500           254 10.0     0.57     0.64   676.24   691.60
 xc_pw_derive                      1140 12.0     0.01     0.01   654.68   664.73
 mp_sendrecv_dv                    7056 11.0   659.52   660.69   659.52   660.69
 xc_rho_set_and_dset_create         126 11.0     2.11    10.54   491.93   604.77
 cp_fm_redistribute_start           145 13.0   443.54   480.41   587.12   600.87
 x_to_yz                           1712 15.9     1.63     1.75   590.30   599.08
 cp_fm_redistribute_end             145 13.0   417.14   571.08   430.35   590.60
 xc_vxc_pw_create                    64 10.0     1.70     8.42   581.92   584.35
 mp_sum_d                          3471 10.2   485.51   568.31   485.51   568.31
 multiply_cannon_loop              3738 12.8     0.07     0.08   543.02   555.38
 yz_to_x                           1773 14.1    16.93    19.20   523.71   539.79
 mp_allgather_i34                  3738 12.8   526.54   538.30   526.54   538.30
 multiply_cannon_metrocomm3       14952 13.8     0.03     0.04   487.40   508.68
 rs_pw_transfer_RS2PW_170           252 10.0     0.27     0.31   424.39   428.13
 calculate_dm_sparse                252  8.0     0.00     0.00   401.52   402.48
 rs_pw_transfer_PW2RS_500           131 12.9     0.27     0.29   336.32   337.31
 qs_ot_p2m_taylor                   111  9.9     0.00     0.00   320.88   328.70
 xc_pw_divergence                   128 11.0     0.00     0.00   315.44   324.80
 dbcsr_complete_redistribute        394 12.1     0.01     0.02   299.29   314.94
 copy_dbcsr_to_fm                   198 11.1     0.00     0.00   294.59   303.78
 xc_exc_calc                         62 10.0     0.26     0.77   297.95   301.64
 cp_fm_syevd_base                   145 13.0   147.08   300.70   147.08   300.70
 init_scf_loop                        3  5.0     0.00     0.00   281.84   282.02
 ot_new_cg_direction                 63 10.0     0.00     0.00   264.48   265.62
 mp_sum_dv                         2372 13.6   164.02   262.33   164.02   262.33
 arnoldi_normal_ev                  262 10.9     0.00     0.00   244.27   260.42
 arnoldi_extremal                   256 10.0     0.00     0.00   236.76   252.71
 -------------------------------------------------------------------------------

I'm using psiflow 3.0.4 and container oras://ghcr.io/molmod/psiflow:3.0.4_python3.10_cuda.

Any idea what I could check to find where the problem is? Also, wouldn't it be better to tabulate energy for all atoms in psiflow source files? Thanks in advance for any help!

Use of mutable kwargs throughout psiflow

def evaluate_dataset(
device: str,
ncores: int,
load_calculator: Callable,
inputs: List[File] = [],
outputs: List[File] = [],
) -> None:

There are many instances in Psiflow where the default arguments are mutable objects. Is this intentional? I would imagine that this would be particularly undesirable and that one should do inputs: List[file] | None = None followed by something like inputs = {} if inputs is None else inputs in the function definition. Are these kwargs intentionally mutable, out of curiosity?

Torch multiprocessing interference

The current NequIP interface does not like Parsl and its use of Python and Torch's multiprocessing, and ends up deadlocking in many cases, even when NEQUIP_NUM_TASKS is set to 1. I've tried a variety of ad hoc fixes but none of them work consistently. The weird part is that it never does it in the testing environment, i.e. when called via pytest.

The issue is most likely circumvented by reimplementing the interface with a bash_app, and that's what I'll do sometime in the next two days. For the moment, use MACE, as that interface does not seem to suffer from the same problem.

VASP reference

Provide support for VASP 6 as a reference level of theory.

temperature ramp during sequential learning

The temperature ramp which is applied during sequential learning does not result in correct temperature increases -- the corresponding test in test_learning.py is also incomplete.

Undefined variables in `psiflow.utils`

psiflow/psiflow/utils.py

Lines 393 to 409 in e011c2b

if state == NullState:
return NullState
nrows = int(len(state) * (len(state) - 1) / 2)
deltas = np.zeros((nrows, 3))
count = 0
for i in range(len(state) - 1):
for j in range(i + 1, len(state)):
deltas[count] = state.positions[i] - state.positions[j]
count += 1
assert count == nrows
if state.pbc.all():
deltas, _ = find_mic(deltas, state.cell)
check = np.all(np.linalg.norm(deltas, axis=1) > threshold)
if check:
return state
else:
return NullState

In the _check_distances() function, it looks like NullState is not imported and therefore not defined. Similarly, FlowAtoms in compute_error() is not defined.

Could you provide some insight on where they are being imported, assuming it's not an error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.