Re: [O] Using tramp to run R source code blocks on remote server

2016-05-09 Thread Benda Xu
Hi Vikas,

I cannot address your problem directly.  I have a workaround.

Vikas Rawal  writes:

> I am trying to run R source code blocks on a remote server (defined in
> my ~/.ssh/config as cesp).
>
> I am facing several problems.
>
> 1.  The following sample block, when used with ":results value" does
> not give any results.
>
> #+NAME: level1
> #+begin_src R :results value :exports results :colnames yes :hline yes 
> :session cesp :dir /cesp:/home/vikas/
> c(1:5)
> #+end_src
>
> I get the following message:
>
> tramp-flush-directory-property: Wrong type argument: arrayp, nil
>
> I get the expected output if I use ":results output”, but I don’t want
> that.

I have gone through similar pains as you did.

> 2. Is there a way to be able to use screen/byobu with remote
> processing? I have tried various options of using shell, term, or
> ansi-term. Each of them gives some problem or the other. Does anyone
> have experience with using any of these?

This might be possible with the future async executions.

For the moment, I have settled down with the following solution:

  1. Tangle each source blocks as a script to the remote host.

  2. Tangle a Makefile to manage the execution, e.g. how the scripts are
 executed with which arguments.

  3. Login the remote host and open a tmux session and run "make" in the
 tangled directory.

With this workflow, all the programs are managed by org-mode, and they
are executed asychronously.  At the same time, I lose the flexibility to
run the scripts in a org spawned session, which is a trade-off.

Cheers,
Benda


Re: [O] Using tramp to run R source code blocks on remote server

2016-04-22 Thread Cook, Malcolm
> On Fri, 22 Apr 2016, Nick Dokos wrote:
 > 
 > > Vikas Rawal  writes:
 > >
 > >> I am trying to run R source code blocks on a remote server 
 > >> (defined in
 > my ~/.ssh/config as
 > >> cesp).
 > >>
 > >> I am facing several problems.
 > >>
 > >> 1.  The following sample block, when used with ":results value" 
 > >> does
 > not give any results.
 > >>
 > >> #+NAME: level1
 > >> #+begin_src R :results value :exports results :colnames yes 
 > >> :hline yes
 > :session cesp :dir /cesp:
 > >> /home/vikas/
 > >> c(1:5)
 > >> #+end_src
 > >>
 > >> I get the following message:
 > >>
 > >> tramp-flush-directory-property: Wrong type argument: arrayp, nil
 > >>
 > >
 > > You might also want to ping Michael Albinus on the tramp mailing list about
 > > this.
 > >
 > 
 > 
 > And contrary to what I said earlier this *is* related to compilation. Not
 > sure if this is a tramp issue for ob-comint.el issue.

I do not trust org-reload.  If I want a fresh org environment, I quit and 
restart emacs.

Also, when I am playing with effect of (re)compiling org, I don't compile it 
with org already loaded.  I compile it in a fresh emacs.

I don't trust results gained other ways.

YMMV

 > 
 > Details:
 > 
 > If I run org-reload uncompiled, C-u C-c C-x !, code like
 > 
 > #+BEGIN_SRC R :session :dir /user@remote:/userdir
 > c(3,2,6)
 > #+END_SRC
 > 
 > runs fine and produces the expected result.
 > 
 > But reloading compiled, C-c C-x !, the code produces the
 > 
 > : tramp-flush-directory-property: Wrong type argument: arrayp, nil
 > 
 > message.
 > 
 > HTH,
 > 
 > Chuck




Re: [O] Using tramp to run R source code blocks on remote server

2016-04-22 Thread Charles C. Berry

On Fri, 22 Apr 2016, Nick Dokos wrote:


Vikas Rawal  writes:


I am trying to run R source code blocks on a remote server (defined in 
my ~/.ssh/config as
cesp).

I am facing several problems.

1.  The following sample block, when used with ":results value" does 
not give any results.

#+NAME: level1
#+begin_src R :results value :exports results :colnames yes :hline yes 
:session cesp :dir /cesp:
/home/vikas/
c(1:5)
#+end_src

I get the following message:

tramp-flush-directory-property: Wrong type argument: arrayp, nil



You might also want to ping Michael Albinus on the tramp mailing list about
this.




And contrary to what I said earlier this *is* related to compilation. Not 
sure if this is a tramp issue for ob-comint.el issue.


Details:

If I run org-reload uncompiled, C-u C-c C-x !, code like

#+BEGIN_SRC R :session :dir /user@remote:/userdir
c(3,2,6)
#+END_SRC

runs fine and produces the expected result.

But reloading compiled, C-c C-x !, the code produces the

: tramp-flush-directory-property: Wrong type argument: arrayp, nil

message.

HTH,

Chuck



Re: [O] Using tramp to run R source code blocks on remote server

2016-04-22 Thread Nick Dokos
Vikas Rawal  writes:

> I am trying to run R source code blocks on a remote server (defined 
> in my ~/.ssh/config as
> cesp).
>
> I am facing several problems.
>
> 1.  The following sample block, when used with ":results value" does 
> not give any results.
>
> #+NAME: level1
> #+begin_src R :results value :exports results :colnames yes :hline 
> yes :session cesp :dir /cesp:
> /home/vikas/
> c(1:5)
> #+end_src
>
> I get the following message:
>
> tramp-flush-directory-property: Wrong type argument: arrayp, nil
>

You might also want to ping Michael Albinus on the tramp mailing list about
this.

--
Nick

> I think this is an issue with having different version of ESS on your 
> local and remote systems.
>
> In particular, newer and older versions of `.ess.eval' have different 
> arguments. You can check this
> by running `args(.ess.eval)' in the session of your remote server and in 
> a session on your local
> system.
>
> In any case, I'd suggest asking on ess-h...@r-project.org for help in 
> fixing this.
>
> Thanks for this. I did not think that ess on the remote system would be 
> needed at all. I just want
> emacs+ess on my system to use R on the remote system.
>
> Having to maintain version compatibility between every machine, and across 
> multiple users, is an
> impossible situation.
>
> But let me see what folks at ess-help have to say.
>
> Thanks very much,
>
> Vikas




Re: [O] Using tramp to run R source code blocks on remote server

2016-04-21 Thread Vikas Rawal

> 
>> I am trying to run R source code blocks on a remote server (defined in my 
>> ~/.ssh/config as cesp).
>> 
>> I am facing several problems.
>> 
>> 1.  The following sample block, when used with ":results value" does not 
>> give any results.
>> 
>> #+NAME: level1
>> #+begin_src R :results value :exports results :colnames yes :hline yes 
>> :session cesp :dir /cesp:/home/vikas/
>> c(1:5)
>> #+end_src
>> 
>> I get the following message:
>> 
>> tramp-flush-directory-property: Wrong type argument: arrayp, nil
>> 
> 
> I think this is an issue with having different version of ESS on your local 
> and remote systems.
> 
> In particular, newer and older versions of `.ess.eval' have different 
> arguments. You can check this by running `args(.ess.eval)' in the session of 
> your remote server and in a session on your local system.
> 
> In any case, I'd suggest asking on ess-h...@r-project.org 
>  for help in fixing this.
> 


Thanks for this. I did not think that ess on the remote system would be needed 
at all. I just want emacs+ess on my system to use R on the remote system.

Having to maintain version compatibility between every machine, and across 
multiple users, is an impossible situation.

But let me see what folks at ess-help have to say.

Thanks very much,

Vikas





Re: [O] Using tramp to run R source code blocks on remote server

2016-04-21 Thread Tim Howes
On 4/21/16 3:53 AM, Vikas Rawal wrote:
> 
> 2. Is there a way to be able to use screen/byobu with remote processing?

This thread suggests using dtach:
http://grokbase.com/t/r/ess-help/1536b42tjy/ess-remote-r




Re: [O] Using tramp to run R source code blocks on remote server

2016-04-21 Thread Cook, Malcolm
I believe some of the inter-process communication magic depends upon i/o 
through a file that exists in /tmp on the remote host

If the remote server shares a file system with localhost (does it?), you could 
contrive for that temp file to live there (~/.emacs.d/ESS.IPC.HACK) instead.

I've been stung by similar in the past.

What version of ESS and org are you using? (meta-x org-version and meta-x 
ess-version) - this has been a bit of a moving target.  I've most recently had 
tramp/ess/org work FINE.  That is when I am editing a file on a remote host via 
tramp.  The R process starts up on the remote host (as does a shell for "#+SRC 
sh" blocks).   This _should_ work for you

~Malcolm

 > -Original Message-
 > From: Emacs-orgmode [mailto:emacs-orgmode-
 > bounces+mec=stowers@gnu.org] On Behalf Of Charles C. Berry
 > Sent: Thursday, April 21, 2016 5:05 PM
 > To: Vikas Rawal <vikasli...@agrarianresearch.org>
 > Cc: org-mode mailing list <emacs-orgmode@gnu.org>
 > Subject: Re: [O] Using tramp to run R source code blocks on remote server
 > 
 > On Thu, 21 Apr 2016, Charles C. Berry wrote:
 > 
 > > On Thu, 21 Apr 2016, Charles C. Berry wrote:
 > >
 > >> On Thu, 21 Apr 2016, Vikas Rawal wrote:
 > >>
 > >>> I am trying to run R source code blocks on a remote server (defined in my
 > >>> ~/.ssh/config as cesp).
 > >>>
 > >>> I am facing several problems.
 > >>>
 > >>> 1.  The following sample block, when used with ":results value" does not
 > >>> give any results.
 > >>>
 > >>> #+NAME: level1
 > >>> #+begin_src R :results value :exports results :colnames yes :hline yes
 > >>> :session cesp :dir /cesp:/home/vikas/
 > >>> c(1:5)
 > >>> #+end_src
 > >>>
 > >>> I get the following message:
 > >>>
 > >>> tramp-flush-directory-property: Wrong type argument: arrayp, nil
 > >>>
 > >>
 > >> I think this is an issue with having different version of ESS on your 
 > >> local
 > >> and remote systems.
 > >>
 > >
 > > OOPS!
 > >
 > > The `different versions' issue affected my setup. But after correcting it, 
 > > I
 > > still get the error you cited above.
 > >
 > > Not sure exactly where the fault lies.
 > >
 > 
 > 
 > Maybe in `org-babel-comint-eval-invisibly-and-wait-for-file', but I am not
 > sure what/how.
 > 
 > I tried to instrument the function (C-u C-M-x on the function source) and
 > run it. And it ran without error when I stepped thru it. Then I removed
 > instrumentation with C-M-x and reran - again no error.
 > 
 > I tried removing the *.elc and restarting emacs, but that seems to make no
 > difference - the error is still there till I instrument the code.
 > 
 > Until this is sorted out, you might try the instrument/uninstrument gambit
 > as a workaround.
 > 
 > HTH,
 > 
 > Chuck
 > 




Re: [O] Using tramp to run R source code blocks on remote server

2016-04-21 Thread Charles C. Berry

On Thu, 21 Apr 2016, Charles C. Berry wrote:


On Thu, 21 Apr 2016, Charles C. Berry wrote:


On Thu, 21 Apr 2016, Vikas Rawal wrote:

I am trying to run R source code blocks on a remote server (defined in my 
~/.ssh/config as cesp).


I am facing several problems.

1.  The following sample block, when used with ":results value" does not 
give any results.


#+NAME: level1
#+begin_src R :results value :exports results :colnames yes :hline yes 
:session cesp :dir /cesp:/home/vikas/

c(1:5)
#+end_src

I get the following message:

tramp-flush-directory-property: Wrong type argument: arrayp, nil



I think this is an issue with having different version of ESS on your local 
and remote systems.




OOPS!

The `different versions' issue affected my setup. But after correcting it, I 
still get the error you cited above.


Not sure exactly where the fault lies.




Maybe in `org-babel-comint-eval-invisibly-and-wait-for-file', but I am not 
sure what/how.


I tried to instrument the function (C-u C-M-x on the function source) and 
run it. And it ran without error when I stepped thru it. Then I removed 
instrumentation with C-M-x and reran - again no error.


I tried removing the *.elc and restarting emacs, but that seems to make no 
difference - the error is still there till I instrument the code.


Until this is sorted out, you might try the instrument/uninstrument gambit 
as a workaround.


HTH,

Chuck




Re: [O] Using tramp to run R source code blocks on remote server

2016-04-21 Thread Charles C. Berry

On Thu, 21 Apr 2016, Charles C. Berry wrote:


On Thu, 21 Apr 2016, Vikas Rawal wrote:

I am trying to run R source code blocks on a remote server (defined in my 
~/.ssh/config as cesp).


I am facing several problems.

1.  The following sample block, when used with ":results value" does not 
give any results.


#+NAME: level1
#+begin_src R :results value :exports results :colnames yes :hline yes 
:session cesp :dir /cesp:/home/vikas/

c(1:5)
#+end_src

I get the following message:

tramp-flush-directory-property: Wrong type argument: arrayp, nil



I think this is an issue with having different version of ESS on your local 
and remote systems.




OOPS!

The `different versions' issue affected my setup. But after 
correcting it, I still get the error you cited above.


Not sure exactly where the fault lies.

Chuck



Re: [O] Using tramp to run R source code blocks on remote server

2016-04-21 Thread Charles C. Berry

On Thu, 21 Apr 2016, Vikas Rawal wrote:


I am trying to run R source code blocks on a remote server (defined in my 
~/.ssh/config as cesp).

I am facing several problems.

1.  The following sample block, when used with ":results value" does not give 
any results.

#+NAME: level1
#+begin_src R :results value :exports results :colnames yes :hline yes :session 
cesp :dir /cesp:/home/vikas/
c(1:5)
#+end_src

I get the following message:

tramp-flush-directory-property: Wrong type argument: arrayp, nil



I think this is an issue with having different version of ESS on your 
local and remote systems.


In particular, newer and older versions of `.ess.eval' have different 
arguments. You can check this by running `args(.ess.eval)' in the session 
of your remote server and in a session on your local system.


In any case, I'd suggest asking on ess-h...@r-project.org for help in 
fixing this.


HTH,

Chuck



[O] Using tramp to run R source code blocks on remote server

2016-04-21 Thread Vikas Rawal
I am trying to run R source code blocks on a remote server (defined in my 
~/.ssh/config as cesp).

I am facing several problems.

1.  The following sample block, when used with ":results value" does not give 
any results.

#+NAME: level1
#+begin_src R :results value :exports results :colnames yes :hline yes :session 
cesp :dir /cesp:/home/vikas/
c(1:5)
#+end_src

I get the following message:

tramp-flush-directory-property: Wrong type argument: arrayp, nil

I get the expected output if I use ":results output”, but I don’t want that.

2. Is there a way to be able to use screen/byobu with remote processing? I have 
tried various options of using shell, term, or ansi-term. Each of them gives 
some problem or the other. Does anyone have experience with using any of these?

Would appreciate help

Vikas