If your FireWorker is a large, shared resource (such as a computing cluster or supercomputing center), you probably won’t be able to launch Rockets directly. Instead, you’ll submit Rockets through an existing queueing system that allocates computer time.
To get warmed up, let’s set things up so we can launch a single Rocket through a queueing system. The QueueLauncher helps launch Rockets through a queue.
The QueueLauncher needs to know how to communicate with your queue system and the executable to submit to the queue (in our case, a Rocket). These parameters are defined through the QueueParams file.
Move to the installation_pt3 tutorial directory on your FireWorker:
cd <INSTALL_DIR>/fw_tutorials/installation_pt3
Locate an appropriate QueueParams file. The files are usually named queueparams_<QUEUE>.yaml where <QUEUE> is the supported queue system.
Note
If you cannot find a working QueueParams file for your specific queuing system, please contact us for help! (see Contributing and Contact) We would like to support more queueing systems in FireWorks.
Copy your chosen QueueParams file to a new name:
cp queueparams_<QUEUE>.yaml my_qp.yaml
Open my_qp.yaml and modify it as follows:
Note
Be sure to indicate the full, absolute path name; do not use BASH shortcuts like ‘.’, ‘..’, or ‘~’, and do not indicate a relative path.
Let’s reset our database and add a new FireWork, all from our FireWorker:
launchpad_run.py -l <PATH_TO_LAUNCHPAD> initialize <TODAY'S DATE>
launchpad_run.py -l <PATH_TO_LAUNCHPAD> insert_single_fw fw_test.yaml
where <PATH_TO_LAUNCHPAD> is the location of your my_launchpad.yaml file.
Try submitting a job using the command:
queue_launcher_run.py singleshot my_qp.yaml
This should have submitted a job to the queue in the current directory. You can read the log files in the logging directory, and/or check the status of your queue to ensure your job appeared.
After your queue manager runs your job, you should see the file howdy.txt in the current directory.
If everything ran successfully, congratulations! You just executed a complicated sequence of instructions:
- The QueueLauncher submitted a Rocket to your queue manager
- Your queue manager executed the Rocket when resources were ready
- The Rocket fetched a FireWork from the FireServer and ran the specification inside
While launching a single job to a queue is nice, a more powerful use case is to submit a large number of jobs at once, or to maintain a certain number of jobs in the queue. The QueueLauncher can be run in a “rapid-fire” mode that provides these features.
Let’s reset our database and add three new FireWorks, all from our FireWorker:
launchpad_run.py -l <PATH_TO_LAUNCHPAD> initialize <TODAY'S DATE>
launchpad_run.py -l <PATH_TO_LAUNCHPAD> insert_single_fw fw_test.yaml
launchpad_run.py -l <PATH_TO_LAUNCHPAD> insert_single_fw fw_test.yaml
launchpad_run.py -l <PATH_TO_LAUNCHPAD> insert_single_fw fw_test.yaml
where <PATH_TO_LAUNCHPAD> is the location of your my_launchpad.yaml file.
Navigate to a clean testing directory on the FireWorker:
mkdir ~/rapidfire_tests
cd ~/rapidfire_tests
Copy your QueueParams file to this testing directory:
cp <PATH_TO_MY_QUEUE_PARAMS> .
where <PATH_TO_MY_QUEUE_PARAMS> is the path to my_qp.yaml file that you created in the previous section.
Looking inside my_qp.yaml, confirm that the path to my_fworker.yaml and my_launchpad.yaml are still valid. (They should be, unless you moved or deleted these files)
Submit several jobs with a single command:
queue_launcher_run.py rapidfire -q 3 my_qp.yaml
Important
The QueueLauncher sleeps between each job submission to give time for the queue manager to ‘breathe’. It might take a few minutes to submit all the jobs.
Important
The command above submits jobs until you have at most 3 jobs in the queue. If you had some jobs existing in the queue before running this command, you might need to increase the -q parameter.
The rapid-fire command should have created a directory beginning with the tag block_. Navigate inside this directory, and confirm that three directories starting with the tag launch were created. The launch directories contain your individual jobs.
You’ve now launched multiple Rockets with a single command!
Note
For more tips on the QueueLauncher, such as how to maintain a certain number of jobs in the queue, read its built-in help: queue_launcher_run.py rapidfire -h
If you’ve completed this tutorial, your FireServer and a single FireWorker are ready for business! If you’d like, you can now configure more FireWorkers. However, you’re most likely interested in running more complex jobs and creating multi-step workflows. We’ll continue the tutorial with defining jobs using FireTasks.