diff --git a/doc/how-to-install/details.md b/doc/how-to-install/details.md index 833a27b4..6e7290d7 100644 --- a/doc/how-to-install/details.md +++ b/doc/how-to-install/details.md @@ -79,15 +79,15 @@ If our system doesn't have `readline` installed, use system package manager (ex: :::{table} :width: 100% -| Python package | pip | Required version | Notes | Option | -|--------------------------------------------------------------------------------|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------| -| [`NumPy`](https://numpy.org/) | `numpy` | <2.0 | The fundamental package for scientific computing with Python. | Always | -| [`yt`](https://yt-project.org/) | `yt` | | The core analytic tool. | Always | -| [`yt_libyt`](https://github.com/data-exp-lab/yt_libyt) | `yt-libyt` | | `yt` frontend for `libyt`. | Always | -| [`mpi4py`](https://mpi4py.readthedocs.io/en/stable/) | `mpi4py` | | Python bindings for the Message Passing Interface (MPI) standard.
{octicon}`alert;1em;sd-text-danger;` Make sure `mpi4py` used in Python and MPI used in simulation are matched. (Check how to install `mpi4py` [here](https://mpi4py.readthedocs.io/en/stable/install.html#installation).) | `-DSERIAL_MODE=OFF` | -| [`jedi`](https://jedi.readthedocs.io/en/latest/) | `jedi` | | Support auto-completion in Jupyter Notebook and JupyterLab. (We will have this if IPython is already installed.) | `-DJUPYTER_KERNEL=ON` | -| [`jupyter-client`](https://jupyter-client.readthedocs.io/en/latest/index.html) | `jupyter-client` | >=8.0.0 | Jupyter Client. | `-DJUPYTER_KERNEL=ON` | -| [`jupyter_libyt`](https://github.com/yt-project/jupyter_libyt) | `jupyter-libyt` | | Jupyter kernel provisioner for `libyt`. | `-DJUPYTER_KERNEL=ON` | +| Python package | pip | Required version | Notes | Option | +|--------------------------------------------------------------------------------|------------------|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------| +| [`NumPy`](https://numpy.org/) | `numpy` | | The fundamental package for scientific computing with Python. | Always | +| [`yt`](https://yt-project.org/) | `yt` | | The core analytic tool. | Always | +| [`yt_libyt`](https://github.com/data-exp-lab/yt_libyt) | `yt-libyt` | | `yt` frontend for `libyt`. | Always | +| [`mpi4py`](https://mpi4py.readthedocs.io/en/stable/) | `mpi4py` | | Python bindings for the Message Passing Interface (MPI) standard.
{octicon}`alert;1em;sd-text-danger;` Make sure `mpi4py` used in Python and MPI used in simulation are matched. (Check how to install `mpi4py` [here](https://mpi4py.readthedocs.io/en/stable/install.html#installation).) | `-DSERIAL_MODE=OFF` | +| [`jedi`](https://jedi.readthedocs.io/en/latest/) | `jedi` | | Support auto-completion in Jupyter Notebook and JupyterLab. (We will have this if IPython is already installed.) | `-DJUPYTER_KERNEL=ON` | +| [`jupyter-client`](https://jupyter-client.readthedocs.io/en/latest/index.html) | `jupyter-client` | >=8.0.0 | Jupyter Client. | `-DJUPYTER_KERNEL=ON` | +| [`jupyter_libyt`](https://github.com/yt-project/jupyter_libyt) | `jupyter-libyt` | | Jupyter kernel provisioner for `libyt`. | `-DJUPYTER_KERNEL=ON` | ::: ```{note} diff --git a/doc/how-to-install/how-to-install.md b/doc/how-to-install/how-to-install.md index 6814dd95..847663e9 100644 --- a/doc/how-to-install/how-to-install.md +++ b/doc/how-to-install/how-to-install.md @@ -95,15 +95,15 @@ To turn off some of the features, go to [Details](./details.md). :::{table} :width: 100% -| Python package | pip | Required version | Notes | Option | -|--------------------------------------------------------------------------------|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------| -| [`NumPy`](https://numpy.org/) | `numpy` | <2.0 | The fundamental package for scientific computing with Python. | Always | -| [`yt`](https://yt-project.org/) | `yt` | | The core analytic tool. | Always | -| [`yt_libyt`](https://github.com/data-exp-lab/yt_libyt) | `yt-libyt` | | `yt` frontend for `libyt`. | Always | -| [`mpi4py`](https://mpi4py.readthedocs.io/en/stable/) | `mpi4py` | | Python bindings for the Message Passing Interface (MPI) standard.
{octicon}`alert;1em;sd-text-danger;` Make sure `mpi4py` used in Python and MPI used in simulation are matched. (Check how to install `mpi4py` [here](https://mpi4py.readthedocs.io/en/stable/install.html#installation).) | `-DSERIAL_MODE=OFF` | -| [`jedi`](https://jedi.readthedocs.io/en/latest/) | `jedi` | | Support auto-completion in Jupyter Notebook and JupyterLab. (We will have this if IPython is already installed.) | `-DJUPYTER_KERNEL=ON` | -| [`jupyter-client`](https://jupyter-client.readthedocs.io/en/latest/index.html) | `jupyter-client` | >=8.0.0 | Jupyter Client. | `-DJUPYTER_KERNEL=ON` | -| [`jupyter_libyt`](https://github.com/yt-project/jupyter_libyt) | `jupyter-libyt` | | Jupyter kernel provisioner for `libyt`. | `-DJUPYTER_KERNEL=ON` | +| Python package | pip | Required version | Notes | Option | +|--------------------------------------------------------------------------------|------------------|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------| +| [`NumPy`](https://numpy.org/) | `numpy` | | The fundamental package for scientific computing with Python. | Always | +| [`yt`](https://yt-project.org/) | `yt` | | The core analytic tool. | Always | +| [`yt_libyt`](https://github.com/data-exp-lab/yt_libyt) | `yt-libyt` | | `yt` frontend for `libyt`. | Always | +| [`mpi4py`](https://mpi4py.readthedocs.io/en/stable/) | `mpi4py` | | Python bindings for the Message Passing Interface (MPI) standard.
{octicon}`alert;1em;sd-text-danger;` Make sure `mpi4py` used in Python and MPI used in simulation are matched. (Check how to install `mpi4py` [here](https://mpi4py.readthedocs.io/en/stable/install.html#installation).) | `-DSERIAL_MODE=OFF` | +| [`jedi`](https://jedi.readthedocs.io/en/latest/) | `jedi` | | Support auto-completion in Jupyter Notebook and JupyterLab. (We will have this if IPython is already installed.) | `-DJUPYTER_KERNEL=ON` | +| [`jupyter-client`](https://jupyter-client.readthedocs.io/en/latest/index.html) | `jupyter-client` | >=8.0.0 | Jupyter Client. | `-DJUPYTER_KERNEL=ON` | +| [`jupyter_libyt`](https://github.com/yt-project/jupyter_libyt) | `jupyter-libyt` | | Jupyter kernel provisioner for `libyt`. | `-DJUPYTER_KERNEL=ON` | ::: ```{note} diff --git a/src/data_hub_amr.cpp b/src/data_hub_amr.cpp index 760cb19d..7cef9c32 100644 --- a/src/data_hub_amr.cpp +++ b/src/data_hub_amr.cpp @@ -136,7 +136,7 @@ DataHubReturn DataHubAmrParticle::GetLocalParticleData( const DataStructureAmr& ds_amr, const std::string& ptype, const std::string& pattr, const std::vector& grid_id_list) { // Free cache before doing new query - ClearCache(); + this->ClearCache(); // Get particle type index and attribute index int ptype_index = ds_amr.GetParticleIndex(ptype.c_str()); @@ -171,12 +171,16 @@ DataHubReturn DataHubAmrParticle::GetLocalParticleData( } // Get data from get particle attribute function - DataStructureOutput status = ds_amr.GenerateLocalParticleData( - generate_gid_list, ptype.c_str(), pattr.c_str(), data_array_list_); - is_new_allocation_list_.assign(data_array_list_.size(), true); - if (status.status != DataStructureStatus::kDataStructureSuccess) { - error_str_ = std::move(status.error); - return {DataHubStatus::kDataHubFailed, data_array_list_}; + if (!generate_gid_list.empty()) { + unsigned long ori_data_len = data_array_list_.size(); + DataStructureOutput status = ds_amr.GenerateLocalParticleData( + generate_gid_list, ptype.c_str(), pattr.c_str(), data_array_list_); + is_new_allocation_list_.insert( + is_new_allocation_list_.end(), data_array_list_.size() - ori_data_len, true); + if (status.status != DataStructureStatus::kDataStructureSuccess) { + error_str_ = std::move(status.error); + return {DataHubStatus::kDataHubFailed, data_array_list_}; + } } return {DataHubStatus::kDataHubSuccess, data_array_list_}; diff --git a/src/yt_run_InteractiveMode.cpp b/src/yt_run_InteractiveMode.cpp index 7c8e6037..af9f8c79 100644 --- a/src/yt_run_InteractiveMode.cpp +++ b/src/yt_run_InteractiveMode.cpp @@ -3,8 +3,6 @@ #include "timer.h" #ifdef INTERACTIVE_MODE -#include - #include #include #include @@ -14,6 +12,7 @@ #include "libyt_process_control.h" #include "libyt_utilities.h" #include "magic_command.h" +#include "readline/readline.h" #endif /** diff --git a/src/yt_run_ReloadScript.cpp b/src/yt_run_ReloadScript.cpp index 149b2d7e..21e6a5cb 100644 --- a/src/yt_run_ReloadScript.cpp +++ b/src/yt_run_ReloadScript.cpp @@ -3,8 +3,6 @@ #include "timer.h" #ifdef INTERACTIVE_MODE -#include - #include #include #include @@ -16,6 +14,7 @@ #include "libyt_process_control.h" #include "libyt_utilities.h" #include "magic_command.h" +#include "readline/readline.h" #endif /**