Skip to content

Commit

Permalink
Change control codes in MPI protocol
Browse files Browse the repository at this point in the history
As suggested in discussion of emacs-ess#1182, adopt the following protocol for MPI
`SOH header STX payload ETX`

also use octal codes in elisp for better readability
  • Loading branch information
dankessler committed Mar 21, 2022
1 parent 6cd28e4 commit 8186c96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion etc/ESSR/R/mpi.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
else as.character(el)
})
payload <- paste(dots, collapse = "")
cat(sprintf("\034%s\036%s\035", head, payload))
cat(sprintf("\001%s\002%s\003", head, payload))
}

.ess_mpi_message <- function(msg){
Expand Down
8 changes: 4 additions & 4 deletions lisp/ess-tracebug.el
Original file line number Diff line number Diff line change
Expand Up @@ -1183,9 +1183,9 @@ Kill the *ess.dbg.[R_name]* buffer."

;; http://jkorpela.fi/chars/c0.html
;; https://en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences
(defvar ess-mpi-message-start-delimiter "")
(defvar ess-mpi-message-field-separator "")
(defvar ess-mpi-message-end-delimiter "")
(defvar ess-mpi-message-start-delimiter "\001")
(defvar ess-mpi-message-field-separator "\002")
(defvar ess-mpi-message-end-delimiter "\003")

(define-obsolete-variable-alias 'ess-mpi-alist 'ess-mpi-handlers "ESS 19.04")
(defvar ess-mpi-handlers
Expand Down Expand Up @@ -1229,7 +1229,7 @@ value from EXPR and then sent to the subprocess."

(defun ess-mpi-handle-messages (buf)
"Handle all mpi messages in BUF and delete them.
The MPI message has the form TYPEFIELD... where TYPE is the
The MPI message has the form TYPEFIELD... where TYPE is the
type of the messages on which handlers in `ess-mpi-handlers' are
dispatched. And FIELDs are strings. Return :incomplete if BUF
ends with an incomplete message."
Expand Down

0 comments on commit 8186c96

Please sign in to comment.