Initializing help system before first use

Running a single model remotely


Type: Programming
Rating: 2 (easy-medium)
Description: Run a single model on a remote machine, passing runtime parameters to the submodel.
File(s): runrtdistr.mos, rtparams.mos (submodel)


runrtdistr.mos
(!*******************************************************
   Mosel Example Problems 
   ======================

   file runrtdistr.mos
   ```````````````````
   Running a model on a remote machine,
   passing runtime parameters to the submodel.

   Before running this model, you need to set up the 
   NODENAME with a machine name/address of your local network.
   The node that is used needs to have the same version of
   Xpress installed and suitably licensed, and the server 
   "xprmsrv" must have been started on this machine.
       
   (c) 2010 Fair Isaac Corporation
       author: S. Heipcke, May 2010
*******************************************************!)

model "Run model rtparams remotely"
 uses "mmjobs"

 declarations
  modPar: Model
  mosInst: Mosel
 end-declarations
                                   ! Compile the model file
 if compile("rtparams.mos")<>0 then exit(1); end-if

       !!! Use the name or IP address of a machine in
       !!! your local network, or "" for current node
 NODENAME:= ""
                                   ! Open connection to a remote node:
 if connect(mosInst, NODENAME)<>0 then exit(2); end-if
                                   ! Load the bim file into the remote instance
 load(mosInst, modPar, "rmt:rtparams.bim") 
                                   ! Start model execution
 run(modPar, "PARAM1=" + 2 + ",PARAM2=" + 3.4 + 
             ",PARAM3='a string'" + ",PARAM4=" + true)
 wait                              ! Wait for model termination
 dropnextevent                     ! Ignore termination event message

end-model 

rtparams.mos
(!*******************************************************
   Mosel Example Problems 
   ======================

   file rtparams.mos
   `````````````````
   Model with different runtime parameter types;
   can be run as submodel from models 'runrtpar*.mos'.
       
   (c) 2008 Fair Isaac Corporation
       author: S. Heipcke, May 2006
*******************************************************!)

model "Runtime parameters"
 uses "mmjobs"
 parameters
  PARAM1 = 0
  PARAM2 = 0.5
  PARAM3 = ''
  PARAM4 = false
 end-parameters

 wait(round(5*random))
 writeln(PARAM1, "  ", PARAM2, "  ", PARAM3, "  ", PARAM4)
end-model 

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.