Unverified Commit 40cf106b authored by Richard Berger's avatar Richard Berger
Browse files

Fix segfault when running with MPI

parent 7a9590f0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -455,7 +455,8 @@ void PairEAMAlloyGPU::read_file(char *filename)

  // broadcast file->elements string array
  for (int i = 0; i < file->nelements; i++) {
    int n = strlen(file->elements[i]) + 1;
    int n;
    if (comm->me == 0) n = strlen(file->elements[i]) + 1;
    MPI_Bcast(&n, 1, MPI_INT, 0, world);
    if (comm->me != 0) file->elements[i] = new char[n];
    MPI_Bcast(file->elements[i], n, MPI_CHAR, 0, world);
+2 −1
Original line number Diff line number Diff line
@@ -458,7 +458,8 @@ void PairEAMFSGPU::read_file(char *filename)

  // broadcast file->elements string array
  for (int i = 0; i < file->nelements; i++) {
    int n = strlen(file->elements[i]) + 1;
    int n;
    if (comm->me == 0) n = strlen(file->elements[i]) + 1;
    MPI_Bcast(&n, 1, MPI_INT, 0, world);
    if (comm->me != 0) file->elements[i] = new char[n];
    MPI_Bcast(file->elements[i], n, MPI_CHAR, 0, world);
+2 −1
Original line number Diff line number Diff line
@@ -1069,7 +1069,8 @@ void PairEAMAlloyKokkos<DeviceType>::read_file(char *filename)

  // broadcast file->elements string array
  for (int i = 0; i < file->nelements; i++) {
    int n = strlen(file->elements[i]) + 1;
    int n;
    if (comm->me == 0) n = strlen(file->elements[i]) + 1;
    MPI_Bcast(&n, 1, MPI_INT, 0, world);
    if (comm->me != 0) file->elements[i] = new char[n];
    MPI_Bcast(file->elements[i], n, MPI_CHAR, 0, world);
+2 −1
Original line number Diff line number Diff line
@@ -1072,7 +1072,8 @@ void PairEAMFSKokkos<DeviceType>::read_file(char *filename)

  // broadcast file->elements string array
  for (int i = 0; i < file->nelements; i++) {
    int n = strlen(file->elements[i]) + 1;
    int n;
    if (comm->me == 0) n = strlen(file->elements[i]) + 1;
    MPI_Bcast(&n, 1, MPI_INT, 0, world);
    if (comm->me != 0) file->elements[i] = new char[n];
    MPI_Bcast(file->elements[i], n, MPI_CHAR, 0, world);
+2 −1
Original line number Diff line number Diff line
@@ -643,7 +643,8 @@ void PairADP::read_file(char *filename)

  // broadcast file->elements string array
  for (int i = 0; i < file->nelements; i++) {
    int n = strlen(file->elements[i]) + 1;
    int n;
    if (comm->me == 0) n = strlen(file->elements[i]) + 1;
    MPI_Bcast(&n, 1, MPI_INT, 0, world);
    if (comm->me != 0) file->elements[i] = new char[n];
    MPI_Bcast(file->elements[i], n, MPI_CHAR, 0, world);
Loading