-
Notifications
You must be signed in to change notification settings - Fork 2
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
program ssend_example | ||
use mpi | ||
implicit none | ||
|
||
integer, parameter :: ARRAY_SIZE = 10 | ||
integer :: rank, size, ierr, i | ||
real(8) :: buffer(10) | ||
integer :: tag = 100 | ||
|
||
! allocate(buffer(10)) | ||
! Initialize MPI environment | ||
call MPI_Init(ierr) | ||
|
||
! Get rank (process ID) and size (total number of processes) | ||
call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr) | ||
call MPI_Comm_size(MPI_COMM_WORLD, size, ierr) | ||
|
||
if (size < 2) then | ||
if (rank == 0) then | ||
print *, "This example requires at least 2 MPI processes" | ||
end if | ||
call MPI_Finalize(ierr) | ||
stop | ||
end if | ||
|
||
! Process 0 sends data to process 1 | ||
if (rank == 0) then | ||
! Initialize the buffer with some values | ||
do i = 1, 10 | ||
buffer(i) = i * 10 | ||
end do | ||
|
||
print *, "Process 0: Sending data using MPI_Ssend..." | ||
|
||
! Using MPI_Ssend (synchronous send) | ||
! This will block until process 1 starts receiving | ||
call MPI_Ssend(buffer, 10, MPI_REAL8, 1, tag, MPI_COMM_WORLD, ierr) | ||
|
||
print *, "Process 0: Send completed successfully" | ||
|
||
! Process 1 receives data from process 0 | ||
else if (rank == 1) then | ||
|
||
print *, "Process 1: Receiving data..." | ||
|
||
! Clear the buffer | ||
buffer = 0 | ||
|
||
! Receive the message | ||
call MPI_Recv(buffer, 10, MPI_REAL8, 0, tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr) | ||
|
||
print *, "Process 1: Received data:" | ||
! write(*, '(10I5)') buffer | ||
print *, buffer | ||
end if | ||
|
||
! Finalize MPI environment | ||
call MPI_Finalize(ierr) | ||
end program ssend_example |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do you think if you can also figure out a test case that fails if we don't use this?
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 definitely are lacking on tests it seems.
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.
This fails in the compilation step itself!!
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'm adding it's test
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.
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 runningFC='gfortran' ./run_tests.sh
?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.
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.
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.
Yes i will do that
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.
Here #65
Uh oh!
There was an error while loading. Please reload this page.
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.
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
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.
Do you use
git clean -dfx
?