Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined variable h5f_file in src/Ions.cc #225

Closed
dreamer2368 opened this issue May 1, 2024 · 1 comment
Closed

undefined variable h5f_file in src/Ions.cc #225

dreamer2368 opened this issue May 1, 2024 · 1 comment
Labels

Comments

@dreamer2368
Copy link
Collaborator

writeData2D in src/Ions.cc uses an undefined variable h5f_file:

template <typename T>
void writeData2d(hid_t file_id, std::string datasetname, std::vector<T>& data,
    const int n, T element)
{
#ifdef MGMOL_USE_HDF5P
    if (h5f_file.useHdf5p())
    {
        // fill up data array to dimension common to all tasks
        short s = data.size();
        short ms;
        mgmol_tools::allreduce(&s, &ms, 1, MPI_MAX, h5f_file.comm_active());
        for (short i = s; i < ms; i++)
            data.push_back(element);
        size_t dims[2] = { data.size() / n, n };

        mgmol_tools::parallelWrite2d(
            file_id, datasetname, data, dims, h5f_file.comm_active());
    }
    else
#endif
    {
        size_t dims[2] = { data.size()/n, n };
        mgmol_tools::write2d(file_id, datasetname, data, dims);
    }
}

This causes a compile-time error when MGMOL_USE_HDF5P is enabled.

@dreamer2368 dreamer2368 added the bug label May 1, 2024
@dreamer2368
Copy link
Collaborator Author

Addressed by #231 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant