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: self.datatype == datatype #4

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

AssertionError: self.datatype == datatype #4

mquinson opened this issue May 27, 2021 · 0 comments

Comments

@mquinson
Copy link
Contributor

Hello again,

here is another buggy code raising an exception in Aislinn. The code is wrong because not all the ranks use the same operation in the Reduce.

#include <mpi.h>
#include <stdio.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");

  MPI_Op op = MPI_SUM;
  if (rank % 2)
    op = MPI_MAX;

  int sum1, val1 = 1;
  MPI_Reduce(&sum1, &val1, 1, MPI_INT, op, 0, MPI_COMM_WORLD); /* MBIERROR */
	

  MPI_Finalize();
  printf("Rank %d finished normally\n", rank);
  return 0;
}

Here is the produced output:

$ aislinn-cc -g /builds/quinson/mbi2/gencodes/CollOpMatching_Reduce_nok.c -o CollOpMatching_Reduce_nok
$ aislinn -p=2 CollOpMatching_Reduce_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 195, in run
    self.main_cycle()
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/generator.py", line 184, in main_cycle
    context.process_run_result(c.finish_async())
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/context.py", line 150, in process_run_result
    if self.handle_call(result[1], result[2:]):
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/context.py", line 123, in handle_call
    return call.run(self, args)
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/mpicalls.py", line 921, in run
    for i in xrange(len(args))])
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/mpicalls.py", line 423, in MPI_Reduce
    args)
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/mpicalls.py", line 790, in call_collective_operation
    context, comm, op_class, blocking, args)
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/globalstate.py", line 116, in call_collective_operation
    op.enter(context, comm, args)
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/collectives.py", line 66, in enter
    self.enter_main(context, comm, args)
  File "/builds/quinson/mbi2/tools/aislinn-git/src/aislinn/mpi/collectives.py", line 653, in enter_main
    self.datatype == datatype)
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