Menu Close

Problem running spatially explicit models using the Linux command line utilities

Syncrosim Forums ST-Sim & State-and-Transition Simulation Models Problem running spatially explicit models using the Linux command line utilities

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #3985
    Mike GoughMike Gough
    Participant

    I’m trying to run a spatially explicit ST-Sim model using the Linux command line utilities. The models run fine from the SyncroSim 3.0 GUI, but attempting to run the same models using the command line utilities results in errors (on both Windows & Linux w/ Mono & GDAL).

    On Windows, I’ve tried issuing the following command:

    SyncroSim.Console.exe –run –lib=C:/Temp/ST-Sim-Spatial-Sample-V2-4-6/ST-Sim-Spatial-Sample-V2-4-6.ssim –sid=210

    And get the following error:

    The system cannot find the file specified

    On Linux, the same command (prefixed with sudo mono) results in the following error:

    Error when processing Raster file ‘C:\Temp\ST-Sim-Spatial-Sample-V2-4-6\ST-Sim-Spatial-Sample-V2-4-6.ssim.input\Scenario-262\STSim_InitialConditionsSpatial\stateClass_30x30.tif’.

    Has anyone had any success running a spatially explicit model using the command line utilities? If so, any suggestions or tips/tricks would be appreciated.

    Thanks!

    #3986
    leonardo-fridleonardo-frid
    Keymaster

    Hi Mike. I am able to do a spatial run with this library no problem. Here are the steps and code I used using windows Power Shell. If you are still not able to run, it may be that you have renamed, moved or not included the folders containing inputs that accompany the ssim library.

    # **********************************************************
    # Example PowerShell Script to Run a Spatial Model in ST-Sim V3.0 from the commandline
    # 1. Script was run using the library located at: http://www.apexrms.com/downloads/syncrosim/ST-Sim-Spatial-Sample-V2-4-6.zip
    # 2. Download the library and extract the contents to a single directory on your computer
    # 3. Open the library in the GUI to ensure the library is upgraded to your current version
    # 4. Run this script to do a spatial run of the current management scenario
    # **********************************************************
    # Author Leonardo Frid, ApexRMS
    # Date 2016.08.04
    # **********************************************************

    # **********************************************************
    # Declarations
    # **********************************************************

    # The path to syncroSim on your computer
    $syncroSimPath = “C:\Program Files\SyncroSim\1”

    # The path to the library you want to run
    $libPath = “C:\Users\Leonardo\Documents\My SyncroSim Files\Sample\ST-Sim-Spatial-Sample-V2-4-6\ST-Sim-Spatial-Sample-V2-4-6.ssim”

    # The scenario Id for the scenario you want to run
    [Int]$scenarioId = 210

    # **********************************************************
    # Run the model
    # **********************************************************

    cd $syncroSimPath
    .\SyncroSim.console.exe –run –lib=”$libPath” –sid=”$scenarioId”

    # **********************************************************
    # End
    # **********************************************************

    #3987
    Mike GoughMike Gough
    Participant

    Thanks Leonardo!

    Ok, so the issue was that the Linux command line utilities package I had downloaded from here didn’t have the Externals/DotSpatial directory in it. With that directory in place, we are up and running.

    Many thanks for the assistance,

    Mike

    #3988
    leonardo-fridleonardo-frid
    Keymaster

    HI Mike,

    That’s strange because the Externals/DotSpatial directory is only required for visualizing output in the GUI, not for running the model. Are you sure, you did not change anything else?

    Regards,
    Leonardo

    #3989
    Mike GoughMike Gough
    Participant

    Yes. I just downloaded a fresh copy of syncrosim-linux-1-0-24-x64.zip.

    Extracted the contents, went into the directory, and issued the following command:

    SyncroSim.Console.exe –run –lib=C:\Temp\ST-Sim-Spatial-Sample-V2-4-6\ST-Sim-Spatial-Sample-V2-4-6.ssim –sid=210

    Got the error message I was getting before (“The system cannot find the file specified”)

    Copied the Externals directory from C:\Program Files\SyncroSim\1\ to the syncrosim-linux-1-0-24-x64 directory.

    Reran the command above, and it’s currently generating output TIFFs.

    #3990
    leonardo-fridleonardo-frid
    Keymaster

    Thanks for getting back to us on this Mike. I would be curious to hear what versions of GDAL, Mono and Linux you are using. We are able to do a run without the Externals/DotSpatial directory using the following:
    GDAL 1.11.3, released 2015/09/16
    Mono JIT compiler version 4.2.1 (Debian 4.2.1.102+dfsg2-7ubuntu4)
    Ubuntu Linux VERSION=”16.04.1 LTS (Xenial Xerus)”

    Cheers,
    Leonardo

    #3991
    Taylor MutchTaylor Mutch
    Participant

    Hi Leonardo,

    We actually are still having a couple issues with running the model spatially, and it most likely has to do with an improper install of GDAL (gdalinfo --version returns GDAL 1.10.1, released 2013/08/26, so that needs to be resolved per the system reqs for SyncroSim).

    We are working with the following:
    Mono JIT compiler version 4.4.1
    Ubuntu Linux VERSION="14.04.4 LTS"

    Mike or I will report back if we still have issues after upgrading GDAL (or burning and rebuilding our dev server, whichever comes first).

    Cheers,
    Taylor

    • This reply was modified 5 years, 1 month ago by Tom RoeAdminTom RoeAdmin.
    #3993
    Mike GoughMike Gough
    Participant

    Just to clarify, adding the Externals directory allowed me to run the spatial sample models successfully from the command line on Windows 7. I’m using the Linux command line utilities just because we’re calling ST-Sim from a Django app that will eventually run on a Linux server.

    #3994
    leonardo-fridleonardo-frid
    Keymaster

    OK, that makes more sense. In Windows, you can’t use the Linux zip file installation as there are differences for some of the binaries for running on windows vs. linux. If you want to run using command line utils in windows, do a regular windows installation and then call the SyncroSim.console.exe that is located in the regular installation directory (…Program Files\SyncroSim\1).

    We are planning in the future (version 1.0.28 and later) to create a zip install for windows just like we do for Linux. The added bonus of this is that it will allow you to have different versions of SyncroSim installed and running on the same computer.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.