| 1 | = jb_finalize = |
| 2 | |
| 3 | == Name == |
| 4 | |
| 5 | //jb_finalize// - terminates the JBRT environment. |
| 6 | |
| 7 | == Synopsis == |
| 8 | |
| 9 | {{{ |
| 10 | #include "jbcnl.h"; |
| 11 | |
| 12 | void jb_finalize( void); |
| 13 | }}} |
| 14 | |
| 15 | Include with //-I/bgsys/local/bgas/jbrt/jbcn/include//, link with //-L/bgsys/local/bgas/jbrt/jbcn/lib -ljbcn//. |
| 16 | |
| 17 | == Description == |
| 18 | |
| 19 | //jb_finalize()// deallocates the shared memory buffers used by the JBCNL and triggers termination of the JBRT's IO node infrastructure and reaping of any remaining IO node user processes. //jb_finalize()// shall be called at the end of the compute node application to ensure proper IO node cleanup. |
| 20 | |
| 21 | No JBCNL functions must be called after //jb_finalize()//; doing so results in undefined behaviour. |
| 22 | |
| 23 | //jb_finalize()// uses a global MPI barrier for synchronization before performing any cleanup operations; therefore, it is a globally blocking call and must furthermore be called before //MPI_Finalize()//. This is to ensure that the JBSD shutdown is not triggered while other MPI tasks are still communicating with the IO node. |
| 24 | |
| 25 | As for //MPI_Finalize()//, //jb_finalize()// is not thread-safe and must be called by one thread only (though this thread does not necessarily have to be the one which called //jb_init()//). |
| 26 | |
| 27 | == Return value == |
| 28 | |
| 29 | //jb_finalize()// does not return a value and does not set "errno". |