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

AssertionError: assert marks.issuperset(m) #3

Open
mquinson opened this issue May 27, 2021 · 0 comments
Open

AssertionError: assert marks.issuperset(m) #3

mquinson opened this issue May 27, 2021 · 0 comments

Comments

@mquinson
Copy link
Contributor

Hello,

here is another simple MPI code that raises an exception in Aislinn:

#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>

#define buff_size 128

int main(int argc, char **argv) {
  int nprocs = -1;
  int rank = -1;

  MPI_Init(&argc, &argv);
  MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  printf("Hello from rank %d \n", rank);

  if (nprocs < 2)
    printf("MBI ERROR: This test needs at least 2 processes to produce a bug.\n");

  int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
  MPI_Request req1; MPI_Status sta1; int sum1, val1 = 1;
  int buf2[buff_size];MPI_Request req2;MPI_Status sta2;
  int root = 0;

  if (rank % 2) {
    MPI_Ireduce(&sum1, &val1, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD, &req1); MPI_Wait(&req1,&sta1); /* MBIERROR1 */
    
  } else {
     /* MBIERROR2 */
    
  }
  
  MPI_Finalize();
  printf("Rank %d finished normally\n", rank);
  return 0;
}

Note that this code is actually buggy: Odd ranks call MPI_Ireduce while even ranks do not call any collective

Here is the resulting error message:

 $ aislinn -p=2 CollCallOrder_Ireduce_none_nok
==AN== INFO: Aislinn v0.5.0
Traceback (most recent call last):
  File "/builds/quinson/mbi2/tools/aislinn-git/bin/../src/aislinn/aislinn.py", line 359, in <module>
    main()
  File "/builds/quinson/mbi2/tools/aislinn-git/bin/../src/aislinn/aislinn.py", line 315, in main
    if not generator.run():
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/generator.py", line 200, in run
    self.ndsync_check()
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/generator.py", line 212, in ndsync_check
    message = NdsyncChecker(self, self.statespace).run()
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/ndsync.py", line 72, in run
    self.process_node(node, markings)
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/ndsync.py", line 113, in process_node
    assert marks.issuperset(m)
AssertionError
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

No branches or pull requests

1 participant