|
74 | 74 | nonblocking version of the APIs. A nonblocking API means the call to the API
|
75 | 75 | will return as soon as the `put/get` request has been registered in the
|
76 | 76 | PnetCDF library. The commitment of the request may happen later, when a call
|
77 |
| - to `ncmpi_wait_all/ncmpi_wait` is made. |
| 77 | + to `ncmpi_wait_all/ncmpi_wait` is made. The nonblocking APIs are listed below. |
| 78 | + + Variable.iput_var() - posts a nonblocking request to write to a variable. |
| 79 | + + Variable.iget_var() - posts a nonblocking request to from from a variable. |
| 80 | + + Variable.bput_var() - posts a nonblocking, buffered request to write to a variable. |
| 81 | + + Variable.iput_varn() - posts a nonblocking request to write multiple subarrays to a variable. |
| 82 | + + Variable.iget_varn() - posts a nonblocking request to read multiple subarrays from a variable. |
| 83 | + + Variable.bput_varn() - posts a nonblocking, buffered request to write multiple subarrays to a variable. |
| 84 | + + File.wait_all() - waits for nonblocking requests to complete, using collective MPI-IO. |
| 85 | + + File.wait() - waits for nonblocking requests to complete, using independent MPI-IO. |
| 86 | + + File.attach_buff() - Let PnetCDF to allocate an internal buffer to cache bput write requests. |
| 87 | + + File.detach_buff() - Free the attached buffer. |
78 | 88 | * The advantage of using nonblocking APIs is when there are many small
|
79 | 89 | `put/get` requests and each of them has a small amount. PnetCDF tries to
|
80 | 90 | aggregate and coalesce multiple registered nonblocking requests into a large
|
|
91 | 101 | | ... ||
|
92 | 102 | | # exit define mode and enter data mode<br>f.enddef() | ditto |
|
93 | 103 | | ...<br># Call blocking APIs to write 3 variables to the file | <br># Call nonblocking APIs to post 3 write requests |
|
94 |
| -| psfc.put_var_al(psfc_buf, start, count)<br>prcp.put_var_al(prcp_buf, start, count)<br>snow.put_var_al(snow_buf, start, count)<br>| reqs = [0]*3<br>reqs[0] = psfc.iput_var(psfc_buf, start, count)<br>reqs[1] = prcp.iput_var(prcp_buf, start, count)<br>reqs[2] = snow.iput_var(snow_buf, start, count)| |
| 104 | +| psfc.put_var_all(psfc_buf, start, count)<br>prcp.put_var_all(prcp_buf, start, count)<br>snow.put_var_all(snow_buf, start, count)<br>| reqs = [0]*3<br>reqs[0] = psfc.iput_var(psfc_buf, start, count)<br>reqs[1] = prcp.iput_var(prcp_buf, start, count)<br>reqs[2] = snow.iput_var(snow_buf, start, count)| |
95 | 105 | | | # Wait for nonblocking APIs to complete<br>errs = [0]*3<br>f.wait_all(3, reqs, errs)|
|
96 | 106 |
|
97 | 107 |
|
0 commit comments