Skip to content

simplify MPI datatype evaluation #56

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

Merged
merged 3 commits into from
Mar 31, 2025
Merged

simplify MPI datatype evaluation #56

merged 3 commits into from
Mar 31, 2025

Conversation

gxyd
Copy link
Collaborator

@gxyd gxyd commented Mar 31, 2025

No description provided.

@gxyd gxyd marked this pull request as ready for review March 31, 2025 05:49
@gxyd
Copy link
Collaborator Author

gxyd commented Mar 31, 2025

I'll merge this PR once the tests pass.

@gxyd gxyd merged commit d1476d2 into main Mar 31, 2025
16 checks passed
@gxyd gxyd deleted the mpi_datatype_simplification branch March 31, 2025 06:05
Copy link
Collaborator

@adit4443ya adit4443ya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from it The PR looks fine

*ierror = -1;
return;
}
MPI_Datatype datatype = get_c_comm_from_fortran(*datatype_f);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- MPI_Datatype datatype = get_c_comm_from_fortran(*datatype_f);
+ MPI_Datatype datatype = get_c_datatype_from_fortran(*datatype_f);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im getting error

 aditya-trivedi   pot3d    main ≡    FC='gfortran -O3' ./build_and_run_gfortran.sh 
+++ uname
++ [[ Linux == \L\i\n\u\x ]]
++ CC=gcc
++ cd src
++ gcc -I/home/aditya-trivedi/conda_root/envs/mpi/include -c ../../../src/mpi_wrapper.c
../../../src/mpi_wrapper.c: In function 'mpi_ssend_wrapper':
../../../src/mpi_wrapper.c:203:29: error: initialization of 'MPI_Datatype' {aka 'struct ompi_datatype_t *'} from incompatible pointer type 'MPI_Comm' {aka 'struct ompi_communicator_t *'} [-Wincompatible-pointer-types]
  203 |     MPI_Datatype datatype = get_c_comm_from_fortran(*datatype_f);
      |                             ^~~~~~~~~~~~~~~~~~~~~~~
 aditya-trivedi   pot3d    main ≡   

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious how CI passed here with this small glitch

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you getting this error with OpenMPI or MPICH or both?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. That's a warning not an error:

../../../src/mpi_wrapper.c:203:18: warning: incompatible pointer types initializing 'MPI_Datatype' (aka 'struct ompi_datatype_t *') with an expression of type 'MPI_Comm' (aka 'struct ompi_communicator_t *') [-Wincompatible-pointer-types]
  203 |     MPI_Datatype datatype = get_c_comm_from_fortran(*datatype_f);
      |         

I got it with OpenMPI, I checked it now.

We should've more tests then definitely.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in #60

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch @adit4443ya , thanks, I'll fix it in the next PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you get error on your local machine?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you get error on your local machine?

No, only a warning.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's surprising that we only get a warning and no error at all.

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

Successfully merging this pull request may close these issues.

2 participants