One of the new features in FlexSim 2018 Update 2 is the ability to use distributed CPUs for the Experimenter or Optimizer. Those cores can exist on any machine that meets the following requirements:
This article describes how to use Amazon Web Services to create remote machines that meet the above requirements. Using AWS, you can launch and connect to as many servers as you want, and pay only for the time used on those instances.
Using distributed CPUs can significantly reduce the required time to run an experiment if:
If the time per replication is short, then the increased communication overhead may outweigh the benefit of using distributed CPUs. The communication overhead increases because all CPUs still report results to a single FlexSim process, and that communication occurs over the internet, rather than on a single machine. If an Experiment or Optimization completes in an acceptable amount of time, you may not need to use distributed CPUs.
Amazon charges for its services. Costs for running instances (and transferring data out of them) are found here :
https://aws.amazon.com/ec2/pricing/on-demand/
Costs for storing data (including AMIs) are found here:
https://aws.amazon.com/ebs/pricing/
These instructions include steps to create an AMI, which will likely cost around $1 per month at current rates. It also includes steps for launching high-performance instances, which have an hourly cost. Suitable instances can be as cheap as $0.50 per hour. Note that there are also charges for transferring data from an instance to another computer.
If you are not already familiar with EC2 instances, you should complete the following tutorial:
https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2_GetStarted.html
You will need to create a security group with the following rules:
Name the Security Group something that shows that this group is related to running FlexSim instances, and add a description if you want. Here is an example Security Group that works, but allows all TCP traffic, and so should only be used for testing purposes:
You will need to create a custom AMI. A custom AMI allows you to launch an instance that has the software you need already installed. To create one, follow these steps:
Before running an Experiment or Optimization, you need to be sure that all remote instances you will use are current running. To launch and initialize these instances, follow these steps:
Once all instances are running the Webserver, you are ready to run an Experiment or Optimization.
Author's Note: There is probably a way to make it so that when instances start up, they automatically run the Webserver, so that you don't have to manually connect to each one. I welcome any suggestions or steps for how to make that happen.
Once you have a list of running instances available, you just need to input their IP Addresses into FlexSim, on the Advanced tab of the Experimenter:
Once you have input this information, you just need to click the Experiment or Optimize button. FlexSim will then use the remote CPUs for running replications.
Amazon offers two pricing models: On Demand and Spot Pricing. FlexSim recommends On Demand instances. Spot instances can be significantly cheaper, but they can also be shut down by Amazon and given to an On Demand user at any time, if On Demand requests exceed the number of available machines. FlexSim does not try to recover from this kind of error, and it may lead to unexpected behavior.
When you pick an instance type, be sure to understand how much ram you will need. If a model requires 4 GB of RAM while running, and you use an instance with 128 cores, be sure that the instance has at least 512 GB of RAM, or don't use all 128 cores.
Disk space is usually not an issue. However, if you are using the Store Data on Hard Drive option in the Statistics Collector, you will need to be sure that there is enough disk space to run the model to completion on the hard drive, multiplied by the number of cores. The amount of disk space on each instance also affects the total cost of using this service.
@jordan.johnson - thank you for adding this capability! Just to confirm your first paragraph, can this also be used to send Experimenter and OptQuest runs to another PC on the local network that has more CPU cores, without sending anything to the cloud? We could benefit from offloading replication-intensive experiments to other PCs in the office with more CPU cores available.
Yes. You can run FlexSim experiments on any remote machine that meets the requirements in the first paragraph. Another PC on the local network should be fine; it doesn't need to be a VM on a cloud service.
Here is an article with similar info, but generalized for any cloud provider:
https://answers.flexsim.com/articles/66639/distributed-experiments-or-optimizations.html
It includes other links and explanations if you are new to the experimenter or optimizer.