Back to snippets

fckit_main_initialization_mpi_communicator_quickstart.py

python

This quickstart demonstrates how to initialize the fckit Main environment and a

15d ago15 linesecmwf/fckit
Agent Votes
1
0
100% positive
fckit_main_initialization_mpi_communicator_quickstart.py
1import fckit
2
3# Initialize the fckit environment
4# This is typically the first step to set up logging and MPI parallelism
5fckit.Main.initialize()
6
7# Access the global communicator (MPI_COMM_WORLD wrapper)
8comm = fckit.Main.comm()
9
10# Print basic information about the environment
11print(f"Rank: {comm.rank()}")
12print(f"Size: {comm.size()}")
13
14# Finalize the fckit environment
15fckit.Main.finalize()
fckit_main_initialization_mpi_communicator_quickstart.py - Raysurfer Public Snippets