Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • multishell module can't find my stata.exe

    Hello Statalist Forum,

    I am using Stata 15 on Windows 10.

    Currently I try to rebuild the example in the help to understand how to use the multishell module in my daily work to optimize larger tasks.
    The ability to use some computional power of my colleagues for larger loops is promising but I can not manage to get the example to work.

    Sadly this is not working as expected.

    The error message I get is:
    . multishell run, threads(2) sleep(2000)
    No Stata exe found. Please set a path using multishell exepath.
    something required
    The code I executed is:
    multishell path "N:\marcus.palmann\Stata test\multishell\test\output", clear
    multishell add "N:\marcus.palmann\Stata test\skripte\Benchmark_2.do"
    multishell exepath "C:\Program Files (x86)\Stata15\StataMP-64.exe"
    multishell status
    multishell run, threads(2) sleep(2000)
    The Benchmark_2.do file is the MonteCarlo Test copied from the help file.
    multishell itselfs seems to work just fine as the status returns the following:
    Overview
    ----------------------------------------------------------------------------------------------------
    # do-file State Time Machine
    ----------------------------------------------------------------------------------------------------
    Benchmark_2.do queued
    1 n = 10 queued 21 May 2019 - 10:33:00
    2 n = 20 queued 21 May 2019 - 10:33:00
    3 n = 30 queued 21 May 2019 - 10:33:01
    4 n = 40 queued 21 May 2019 - 10:33:01
    5 n = 50 queued 21 May 2019 - 10:33:01
    6 n = 60 queued 21 May 2019 - 10:33:02
    7 n = 70 queued 21 May 2019 - 10:33:02
    8 n = 80 queued 21 May 2019 - 10:33:02
    9 n = 90 queued 21 May 2019 - 10:33:02
    10 n = 100 queued 21 May 2019 - 10:33:03
    11 n = 110 queued 21 May 2019 - 10:33:03
    12 n = 120 queued 21 May 2019 - 10:33:03
    13 n = 130 queued 21 May 2019 - 10:33:03
    ----------------------------------------------------------------------------------------------------
    Machine Queued Assigned Running Finished Stopped Total
    This Computer 13 0 0 0 0 0
    ----------------------------------------------------------------------------------------------------
    Computername: DE-XXX-038
    No seed set. Random numbers in all tasks will be the same. Please see multishell seed and/or use option seedstream in Stata 1
    > 5.

    Clientlist
    no clients found.

    Set paths
    ----------------------------------------------------------------------------------------------------
    Type Path
    ----------------------------------------------------------------------------------------------------
    Main path "N:\marcus.palmann\Stata test\multishell\test\output"
    Path to Stata Exe "C:\Program Files (x86)\Stata15\StataMP-64.exe"
    ----------------------------------------------------------------------------------------------------
    I tried several changes in the code but I always get this error.
    Is anybody familiar with the problem and could help me find my mistake?

    I have great hopes for JanDitzen to help me to use this powerful command.

    many thanks and best regards
    Marcus

  • #2
    Hi Marcus,
    first of all thanks for your interest in multishell. Multishell is a complex program so hopefully I will be able to help.

    There are several things you can check and which might be helpful. Firs tof all, have you tried to run multishell without the "multishell exepath" command line. Since version 2.0 multishell is able to detect the Stata Exe itself, if the path is in a standard folder, as in your case it is. To check this, what happens if you type "display "`c(sysdir_stata)'Stata`type'-`c(bit)'.exe""? Does this path matches your Stata Exe folder?

    Please let me know if that helps!

    Comment


    • #3
      Hi Jan,

      I'm having exactly the same problem when trying to reproduce your example.I tried running it with and without the "multishell exepath" line, and I get the same mistake.

      When typing display "`c(sysdir_stata)'Stata`type'-`c(bit)'.exe"", the path that comes out matches exactly the one I have in "multishell exepath".

      I appreciate any guidance with this!


      Code:
      clear all
      adopath ++ "C:\Users\pjordon2\ado\plus\m\"
      multishell path "C:\Users\pjordon2\Desktop\multi_example\results\" , clear
      multishell exepath "C:\Program Files\Stata16\Stata-64.exe"
      multishell adopath "C:\Users\pjordon2\ado\plus\m\"
      multishell add "C:\Users\pjordon2\Desktop\multi_example\MonteCarl oSimulation.do"
      multishell run, threads(2) sleep(2000)

      Thanks,
      Pablo

      Comment


      • #4
        Hi Jan,

        I ran into the same problem today. The reason for this seems to be this code on line 371 to 388.
        Code:
                else {
                    if `c(SE)' == 1 & `c(MP)' == 0 {
                        local type "SE"
                    }
                    else if `c(SE)' == 0 & `c(MP)' == 1 {
                        local type "MP"
                    }
                    else {
                        local type "IC"
                    }
                    local exepath "`c(sysdir_stata)'Stata`type'-`c(bit)'.exe"
                    local exename "Stata`type'-`c(bit)'.exe"
                    
                    if fileexists("`exepath'") == 0 {
                        display as smcl "No Stata exe found. Please set a path using {help multishell##settingup:multishell exepath}."
                        exit
                    }
                }
        On my system both c(SE) and c(MP) are equal to 1 making multishell go for IC which cannot be found. A solution is to replace the if condition with the following conditions:
        Code:
                else {
                    local type "IC"
                    if `c(MP)' == 1 {
                        local type "MP"
                    }
                    else if `c(SE)' == 1 {
                        local type "SE"
                    }
                    ...
                }
        I hope that helps,
        Marian

        Comment


        • #5
          That seems a reasonable fix, as c(SE) is documented to return 1 for Stata SE or MP, and c(MP) only returns 1 when it is Stata/MP and 0 otherwise. In other words, from the docs, c(SE) is 1 for "SE or better" and 0 otherwise. (See -help creturn-).

          Comment


          • #6
            That is a great suggestion, thank you very much. The version is en route to SSC and updated on my GitHub (https://github.com/JanDitzen/multishell).

            Comment


            • #7
              Thanks to Kit Baum an update is now available on SSC.

              Comment

              Working...
              X