Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.

Commit e2cbb46

Browse files
authored
Update documentation with pointers to run_job_pool (#102)
* Update documentation with pointers to run_job_pool * Update faq.md
1 parent f867831 commit e2cbb46

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

docs/main-doc/faq.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ For example, assuming created run object (in a launch script) is called run, you
1616
run.run()
1717
```
1818

19+
**Is there a more user-friendly way to launch gem5 jobs?**
20+
21+
You can use python multiprocessing library based function calls (provided by gem5art) to launch multiple gem5 jobs in parallel.
22+
Specifically, you can call the following function in your gem5art launch script:
23+
24+
```python
25+
run_job_pool([a list containing all run objects you want to execute], num_parallel_jobs = [Number of parralel jobs you want to run])
26+
```
27+
1928
**How to access/search the files/artifacts in the database?**
2029

2130
You can use the pymongo API functions to access the files in the database.

docs/main-doc/tasks.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,21 @@ Authors:
66
# Tasks
77

88
## Introduction
9-
The actual gem5 experiment is executed with the help of [Celery](http://www.celeryproject.org/).
10-
Celery server can run many gem5 tasks asynchronously. Once a user creates a gem5Run object (discussed previously) while using gem5art, this object needs to be passed to a method run_gem5_instance() registered with Celery app, which is responsible for starting a Celery task to run gem5. The other argument needed by the run_gem5_instance() is the current working directory. Fundamentally, celery is not required to run gem5 jobs with gem5art and a job can be directly launched by calling run() function of gem5Run object. However, celery can do a better job of managing multiple runs.
9+
The actual gem5 experiment can be executed with the help of [Python multiprocessing support](https://docs.python.org/3/library/multiprocessing.html), [Celery](http://www.celeryproject.org/) or even without using any job manager (a job can be directly launched by calling run() function of gem5Run object).
10+
11+
## Use of Python Multiprocessing
12+
13+
This is a simple way to run gem5 jobs using Ptyhon multiprocessing library.
14+
You can use the following function in your job launch script to execute gem5art run objects:
15+
16+
```python
17+
run_job_pool([a list containing all run objects you want to execute], num_parallel_jobs = [Number of parralel jobs you want to run])
18+
```
19+
The implementation of `run_job_pool` can be found [here](https://github.com/darchr/gem5art/blob/master/tasks/gem5art/tasks/tasks.py#L50).
20+
21+
## Use of Celery
22+
23+
Celery server can run many gem5 tasks asynchronously. Once a user creates a gem5Run object (discussed previously) while using gem5art, this object needs to be passed to a method run_gem5_instance() registered with Celery app, which is responsible for starting a Celery task to run gem5. The other argument needed by the run_gem5_instance() is the current working directory.
1124

1225
Celery server can be started with the following command:
1326

0 commit comments

Comments
 (0)