Skip to content

Fix: use correct helper function #60

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 2 commits into from
Mar 31, 2025

Conversation

adit4443ya
Copy link
Collaborator

Address #56 (review)

@@ -200,7 +200,7 @@ void mpi_waitall_wrapper(int *count, int *array_of_requests_f,

void mpi_ssend_wrapper(double *buf, int *count, int *datatype_f, int *dest,
int *tag, int *comm_f, int *ierror) {
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.

Do you think if you can also figure out a test case that fails if we don't use this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We definitely are lacking on tests it seems.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This fails in the compilation step itself!!

 aditya-trivedi   tests    main ≡  ?10    FC='gfortran' ./run_tests.sh 
../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);
      |                             ^~~~~~~~~~~~~~~~~~~~~~~
      ```
      
      

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We definitely are lacking on tests it seems.

I'm adding it's test

Copy link
Collaborator

Choose a reason for hiding this comment

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

This fails in the compilation step itself!!

Are you sure that for you locally it's a failure and not a warning?

Can you please confirm this with value of echo $? that you get after running FC='gfortran' ./run_tests.sh?

Copy link
Collaborator

Choose a reason for hiding this comment

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

and if you think about the correctness then too the return type of the get_c_comm_from_fortran is of MPI_comm and we are assigning it to the MPI_datatype

That makes sense, what I'm trying to understand is so that what to fix in the CI so that we catch this error at the CI and don't have to rely on local machine for this error reproducibility.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes i will do that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here #65

Copy link
Collaborator Author

@adit4443ya adit4443ya Mar 31, 2025

Choose a reason for hiding this comment

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

Sometimes in my laptop this happens
even if i run compilation commands or runtests scripts then it uses the previously compiled version of files and i dont catch error , restarting machine helps a lot in this case

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sometimes in my laptop this happens
even if i run compilation commands or runtests scripts then it uses the previously compiled version of files and i dont catch error , restarting machine helps a lot in this case

Do you use git clean -dfx?

@adit4443ya adit4443ya force-pushed the fix_helper_func_call branch from 00fcb4f to 3d1d7bb Compare March 31, 2025 09:11
@adit4443ya adit4443ya requested a review from gxyd March 31, 2025 09:13
@gxyd
Copy link
Collaborator

gxyd commented Mar 31, 2025

I'll be off for sometime now (~2 hours), once I'm back, I'll take a look at this.

Copy link
Collaborator

@gxyd gxyd left a comment

Choose a reason for hiding this comment

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

This is perfect, thanks for fixing it @adit4443ya .

@gxyd gxyd merged commit 114f081 into lfortran:main Mar 31, 2025
16 checks passed
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