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

Don't error with zero length elem in add_to_last #19

Closed
wants to merge 1 commit into from

Conversation

gaborcsardi
Copy link
Owner

@gaborcsardi gaborcsardi commented Aug 30, 2023

Cf. MangoTheCat#17

The following expression from Rmpi raises an error due to breaks_tail seeing a zero length breaks.

 function (dellog = TRUE, comm = 1) {
  if (mpi.comm.size(comm) < 2) {
    err <- paste("It seems no slaves running on comm", comm)
    stop(err)
  }
  mpi.bcast.cmd(cmd = break, rank = 0, comm = comm)
  if (.Platform$OS != "windows") {
    if (dellog && mpi.comm.size(0) < mpi.comm.size(comm)) {
      tmp <- paste(Sys.getpid(), "+", comm, sep = "")
      logfile <- paste("*.", tmp, ".*.log", sep = "")
      if (length(system(paste("ls", logfile), TRUE, ignore.stderr = TRUE)) >= 
          1)
        system(paste("rm", logfile))
    }
  }
  if (comm > 0) {
    if (is.loaded("mpi_comm_disconnect")) 
      mpi.comm.disconnect(comm)
    else mpi.comm.free(comm)
  }
}

The following expression from **Rmpi** raises an error due to `breaks_tail` seeing a zero length breaks.
```{r}
 function (dellog = TRUE, comm = 1) {
  if (mpi.comm.size(comm) < 2) {
    err <- paste("It seems no slaves running on comm", comm)
    stop(err)
  }
  mpi.bcast.cmd(cmd = break, rank = 0, comm = comm)
  if (.Platform$OS != "windows") {
    if (dellog && mpi.comm.size(0) < mpi.comm.size(comm)) {
      tmp <- paste(Sys.getpid(), "+", comm, sep = "")
      logfile <- paste("*.", tmp, ".*.log", sep = "")
      if (length(system(paste("ls", logfile), TRUE, ignore.stderr = TRUE)) >= 
          1)
        system(paste("rm", logfile))
    }
  }
  if (comm > 0) {
    if (is.loaded("mpi_comm_disconnect")) 
      mpi.comm.disconnect(comm)
    else mpi.comm.free(comm)
  }
}
```
@gaborcsardi gaborcsardi changed the title mangothecat -> gaborcsardi Don't error with zero length elem in add_to_last Aug 30, 2023
@gaborcsardi
Copy link
Owner Author

Hmmm, if this happens because of a bug in cyclocomp, then we could fix the bug, I guess. FWIW there is no error on Rmpi currently, so I am going to close this now.

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.

None yet

1 participant