Recursive remote files
|  | |
| Type: | Programming | 
| Rating: | 3 | 
| Description: | Cascade of recursive submodels in distributed architecture: The same model is compiled and run in a cascade of submodels on different machines/nodes. Compilation is local to the nodes, that is, nodes may use different versions of Xpress. From a given instance, data files at the parent and at the child node are accessed. This model requires write access on all machines that are used. | 
| File(s): | remotefiles.mos | 
|  | |
| remotefiles.mos | 
| (!*******************************************************
   Mosel Example Problems 
   ======================
   file remotefiles.mos
   ````````````````````
   Cascade of recursive submodels in distributed architecture
   
   The same model is compiled and run in a cascade of submodels
   on different machines/nodes. Compilation is local to the nodes, 
   that is, nodes may use different versions of Xpress. 
   From a given instance, data files at the parent and at the 
   child node are accessed.
   
   This model requires write access on all machines that are used.
   Before running this model, you need to set up the array
   NODES with machine names/addresses of your local network.
   All nodes that are used need to have Xpress installed
   and suitably licensed, and the server "xprmsrv" must have
   been started on these machines.
       
   (c) 2010 Fair Isaac Corporation
       author: S. Heipcke, May 2010
*******************************************************!)
model "Accessing remote files"
 uses "mmjobs", "mmsystem"
 
 parameters
  NUM=0
 end-parameters
 
 declarations
  MAXNUM = 3
  R = 1..MAXNUM
  NODES: array(R) of string
  NodeNum: integer
  NodeName: string
  NodeInfo: text
  moselCnct: Mosel
  rmtMod: Model 
 end-declarations 
 
!!! Set the entries of this array to local machines in your network, 
!!! using machine names, or IP addresses.
!!! Each instance needs to be on a different machine.
!!! Names may include the working directory to be used for writing, e.g.: 
!!!    remote Unix machine:     "somename|MOSEL_CWD=/tmp"
!!!    remote Windows machine:   "xsrv:somename|MOSEL_CWD=c:\\mydir\\"
 NODES::(1..MAXNUM)["a","b","c"]
! Display and write out information about the current node 
 NodeInfo:=
  " "*NUM + "Level " + text(NUM) + ". Node: " + 
  text(getparam("NODENUMBER")) + " " +
  text(getsysinfo(SYS_NODE)) + ". "
 initialisations to "nodeinfo.dat"
  evaluation of getparam("NODENUMBER") as "NodeNum"
  evaluation of getsysinfo(SYS_NODE) as "NodeName"
 end-initialisations 
 if NUM | 
 
