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
Fix MATLAB bindings for MacOS #3950
Fix MATLAB bindings for MacOS #3950
Conversation
…ed preprocessor macro to check MPI usage and call the correct version of adios2_init() accordingly, fixed spelling error in bindings/C/adios2/c/adios2_c_adios.h
@@ -46,7 +46,7 @@ adios2_adios *adios2_init_config_mpi(const char *config_file, MPI_Comm comm); | |||
|
|||
#else | |||
#define adios2_init() adios2_init_serial() | |||
#define adios2_init_config(config_file) adios2_init_config_seria(config_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch. We may need to push this into the release branch too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like no one uses the non-MPI version 🤣
bindings/Matlab/adiosopenc.c
Outdated
@@ -140,7 +140,11 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) | |||
|
|||
/********************************************************/ | |||
/* Open ADIOS file now and get variables and attributes */ | |||
#if ADIOS2_USE_MPI | |||
adiosobj = adios2_init(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this call be passing the MPI communicator into ADIOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I don't think so, but this is where my knowledge of ADIOS breaks down a bit....
The previous version of this line in adiosopenc.c passed false, so I imagine that it's ok. Even in the event the library uses MPI, passing an MPI communicator would require creating one (which would then require finalizing / destroying after use), which is I assume why the original author just passed false. But the makefile links against the non-MPI version of ADIOS (which is what I used to do my testing), so I'm not sure how this would behave if linked against the MPI version.
Do:
adios2_inquire_all_variables(&adios_vars, &nvars, group);
adios2_inquire_all_attributes(&adios_attrs, &nattrs, group);
or any of the other adios2 functions in adiosreadc.c or adiosclosec.c use MPI for anything? If so, maybe the best bet is to have a preprocessor assert that ADIOS2_USE_MPI
is not defined (or just undefine it). It doesn't make sense in the context of MATLAB to use MPI anyway...I know this can be done, but probably isn't common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never used MPI in Matlab, and apparently false
has been a value compilers could live with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess explicitly calling adios2_adios *adios2_init_serial(void);
would be the clean solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess explicitly calling
adios2_adios *adios2_init_serial(void);
would be the clean solution
Probably so. There's some other stuff in the bindings that could use to be cleaned up (unreferenced mpi_comm_dummy variable, etc.). I was going to try to get Matlab installed for myself so I could at least try things before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess explicitly calling adios2_adios *adios2_init_serial(void); would be the clean solution
Done.
I'm going to go ahead and merge these fixes and I'll do another PR if there's a need to cleanup. @vicentebolea , this probably needs to be in release 2.9 as well. Want a different PR there or can you cherrypick master? |
PR is good :) |
* Fix MATLAB bindings for MacOS - updated bindings/Matlab/Makefile, added preprocessor macro to check MPI usage and call the correct version of adios2_init() accordingly, fixed spelling error in bindings/C/adios2/c/adios2_c_adios.h * Update adiosopenc.c to use adios2_init_serial regardless of MPI use.
* Fix MATLAB bindings for MacOS - updated bindings/Matlab/Makefile, added preprocessor macro to check MPI usage and call the correct version of adios2_init() accordingly, fixed spelling error in bindings/C/adios2/c/adios2_c_adios.h * Update adiosopenc.c to use adios2_init_serial regardless of MPI use. Co-authored-by: Tom Gade <gadex007@umn.edu>
* master: Update readme for heat transfer example with new location and build instructions Ignore tests with defects for now Adapt libfabric dataplane of SST to Cray CXI provider (ornladios#3672) ci: fix path to lsan suppressions, fix broken gh status post Use adios2_mode_readRandomAccess in matlab open to make it work for BP5 (ornladios#3956) Add Global Array Capabilities and Limitations Add Section for Anatomy of an ADIOS Program Enable Shell-Check for gh-actions scripts Enable Shell-Check for circle CI scripts Enable Shell-Check for tau contract scripts Enable Shell-Check for scorpio contract scripts Enable Shell-Check for lammps contract scripts Delete VTK code in examples Fix MATLAB bindings for MacOS (ornladios#3950) Set the compiler for the Kokkos DataMan example to what is used to build Kokkos Fix the HIP architecture CMAKE variable (ornladios#3931) perfstubs 2023-11-27 (845d0702) (ornladios#3944) Revert "Only rank 0 should print the initialization message in perfstub"
* master: Update readme for heat transfer example with new location and build instructions Ignore tests with defects for now Adapt libfabric dataplane of SST to Cray CXI provider (ornladios#3672) ci: fix path to lsan suppressions, fix broken gh status post Use adios2_mode_readRandomAccess in matlab open to make it work for BP5 (ornladios#3956) Add Global Array Capabilities and Limitations Add Section for Anatomy of an ADIOS Program Enable Shell-Check for gh-actions scripts Enable Shell-Check for circle CI scripts Enable Shell-Check for tau contract scripts Enable Shell-Check for scorpio contract scripts Enable Shell-Check for lammps contract scripts Delete VTK code in examples Fix MATLAB bindings for MacOS (ornladios#3950) Set the compiler for the Kokkos DataMan example to what is used to build Kokkos Fix the HIP architecture CMAKE variable (ornladios#3931) perfstubs 2023-11-27 (845d0702) (ornladios#3944) Revert "Only rank 0 should print the initialization message in perfstub" CI Contract: Build examples with external ADIOS Example using DataMan with Kokkos buffers Propagating the GPU logic inside the DataMan engine ci: Use mpich built with ch3:sock:tp for faster tests ReadMe.md: Mention 2.9.2 release Cleanup server output a bit (ornladios#3914) ci: set openmpi and openmp params Example using Kokkos buffers with SST Changes to MallocV to take into consideration the memory space of a variable Change install directory of Gray scott files again ci,crusher: increase supported num branches ci: add shellcheck coverage to source and testing Change install directory of Gray scott files Only rank 0 should print the initialization message in perfstub Defining and computing derived variables (ornladios#3816) Add Remote "-status" command to see if a server is running and where (ornladios#3911) examples,hip: use find_package(hip) once in proj Add Steps Tutorial Add Operators Tutorial Add Attributes Tutorial Add Variables Tutorial Add Hello World Tutorial Add Tutorials' Download and Build section Add Tutorials' Overview section Improve bpStepsWriteRead* examples Rename bpSZ to bpOperatorSZWriter Convert bpAttributeWriter to bpAttributeWriteRead Improve bpWriter/bpReader examples Close file after reading for hello-world.py Fix names of functions in engine Fix formatting warnings Add dataspaces.rst in the list of engines Add query.rst cmake: find threads package first docs: update new_release.md Bump version to v2.9.2 ci: update number of task for mpich build clang-format: Correct format to old style Merge pull request ornladios#3878 from anagainaru/test-null-blocks Merge pull request ornladios#3588 from vicentebolea/fix-mpi-dp bp5: make RecMap an static anon namespaced var Replace LookupWriterRec's linear search on RecList with an unordered_map. For 250k variables, time goes from 21sec to ~1sec in WSL. The order of entries in RecList was not necessary for the serializer to work correctly. (ornladios#3877) Fix data length calculation for hash (ornladios#3875) Merge pull request ornladios#3823 from eisenhauer/SstMemSel gha,ci: update checkout to v4 Blosc2 USE ON: Fix Module Fallback cmake: correct prefer_shared_blosc behavior cmake: correct info.h installation path ci: disable MGARD static build operators: fix module library ci: add downloads readthedocs cmake: Add Blosc2 2.10.1 compatibility. Fix destdir install test (ornladios#3850) cmake: update minimum cmake to 3.12 (ornladios#3849) MPI: add timeout for conf test for MPI_DP (ornladios#3848) MPI_DP: do not call MPI_Init (ornladios#3847) install: export adios2 device variables (ornladios#3819) Merge pull request ornladios#3799 from vicentebolea/support-new-yaml-cpp Merge pull request ornladios#3737 from vicentebolea/fix-evpath-plugins-path Partial FFS Upstream, only changes to type_id bpls -l with scalar string variable: print the value (since min/max is empty). This changes the code for all types using Engine.Get() to get the value now. Set AWS version requirement to 1.10.15 and also turn it OFF by default as it is not a stable feature of ADIOS just yet. Fix local values block reading docs,ci: backport fixes for readthedocs
* master: Have HDF5 write raise error if operator(s) requested (ornladios#3951) fix for ASAN issue related to JoinedDimArray handling in BP5 deserializer (ornladios#3963) New operator MDR, for refactoring floating point arrays using MGARD's new MDR extension. (ornladios#3826) restricted http transport from windows builds. XMLConfigTest: Add RemoveIO test adios2::core::ADIOS: Initialize new IO objects with config file removed unsused variable Update readme for heat transfer example with new location and build instructions Ignore tests with defects for now Adapt libfabric dataplane of SST to Cray CXI provider (ornladios#3672) ci: fix path to lsan suppressions, fix broken gh status post Use adios2_mode_readRandomAccess in matlab open to make it work for BP5 (ornladios#3956) Add Global Array Capabilities and Limitations Add Section for Anatomy of an ADIOS Program Enable Shell-Check for gh-actions scripts Enable Shell-Check for circle CI scripts Enable Shell-Check for tau contract scripts Enable Shell-Check for scorpio contract scripts Enable Shell-Check for lammps contract scripts Delete VTK code in examples Fix MATLAB bindings for MacOS (ornladios#3950) Set the compiler for the Kokkos DataMan example to what is used to build Kokkos Fix the HIP architecture CMAKE variable (ornladios#3931) perfstubs 2023-11-27 (845d0702) (ornladios#3944) Revert "Only rank 0 should print the initialization message in perfstub" Formatting Formatting Revision Added buffered data receive in the client side. A socket version of HTTP connector. Proxy server host is hardwired to "localhost" and port to 9999 Remote bpls: bpls -E bp4 -T "Library=HTTP" /remote_path/myVector_cpp.bp -d bpInts
Updated bindings/Matlab/Makefile to include a working MacOS (Sonoma) example, added preprocessor macro to check MPI usage and call the correct version of adios2_init() accordingly in bindings/Matlab/adiosopenc.c, fixed spelling error in bindings/C/adios2/c/adios2_c_adios.h
Related to issue: #3947