Changes between Version 4 and Version 5 of Command-line execution
- Timestamp:
- 09/24/12 11:16:58 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Command-line execution
v4 v5 1 = = Command-line execution ==1 = Command-line execution = 2 2 3 3 Before MUSCLE can be run from the command-line, it needs a few environment variables to be set. To do this, run … … 7 7 The [path/to/muscle] should point to where MUSCLE is installed on your machine. 8 8 9 == = Local execution ===9 == Local execution == 10 10 11 11 Depending on the complexity of the code and the runtime requirements MUSCLE has different execution modes. In the simplest case, all the code can be run on a single machine, and no debugger or MPI is used. Use, for example, the {{{SimpleExample.cxa.rb}}} provided with MUSCLE. This will write data from submodel w to submodel r. … … 21 21 For execution on a local computer this command should be sufficient. 22 22 23 == = Execution on multiple machines ===23 == Execution on multiple machines == 24 24 25 25 If multiple machines are needed to run the code, they need some way of locating each other. This is where the {{{--main}}} flag is used, it indicates that the simulation manager will be run on the current location. Suppose we are running {{{SimpleExample.cxa.rb}}} which is provided with MUSCLE, which has the submodels "w" and "r". Then if the machines all have access to one of the other machines, you can run … … 29 29 which will run w on the current machine. On the command-line, it will show the following lines: 30 30 {{{ 31 == = Running MUSCLE2 Simulation Manager ===31 == Running MUSCLE2 Simulation Manager == 32 32 [10:04:37 muscle] Started the connection handler, listening on 192.168.2.1:9000 33 33 }}} … … 38 38 This will start the simulation, contacting the simulation manager at {{{192.168.2.1:9000}}}. For testing purposes, both commands can also be run on the same machine. 39 39 40 == = Running MPI ===40 == Running MPI == 41 41 42 42 There are three ways of running a native submodel with MPI. 43 43 44 === = Starting MPI with MUSCLE ====44 === Starting MPI with MUSCLE === 45 45 46 46 If the MPI executable can be run by the user, first the variables "submodelName:mpiexec_command" and "submodelName:mpiexec_args" should be given in the CxA file. The most straightforward is running with the {{{--native}}} flag. Simply run … … 50 50 Of course, replace path/to/cxa.rb with your CxA file, and replace {{{--main}}} with {{{--manager ip:port}}} if another execution is already main. Running this way requires that only one submodel is run at a time. 51 51 52 === = Starting MPI directly ====52 === Starting MPI directly === 53 53 54 54 The second way, more direct, does not require the variable "submodelName:mpiexec_command" to be set. Then, the executable that was compiled with the MUSCLE C++ API can be called as follows: … … 58 58 Since you run mpiexec yourself, this does not require the mpiexec_command to be set. The command first specifies the native executable, and any arguments that the executable needs, and then it has two dashes "--" and then the same arguments as in the previous command. 59 59 60 === = Starting Java separately ====60 === Starting Java separately === 61 61 62 62 Since the MUSCLE C++ API needs to communicate with Java code, in the previous examples a fork was performed to execute the Java core of MUSCLE. Some implementations of MPI do not allow this behavior, so there a different approach is needed.