Use cProfile.runctx
in a function specific for profiling.
import yt
import cProfile
from mpi4py import MPI
# Must include this line, if you are running in parallel.
# Run with: | |
# >>> python 2d-gradient.py <num_sample in one direction> <padding zero> | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import cm | |
import sys | |
# Plot Settings | |
fig = plt.figure(figsize=plt.figaspect(0.5)) |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <mpi.h> | |
/** | |
* @brief OpenMPI RMA operation. | |
* @details Create two window with MPI_Win_create_dynamic, and attach two arrays | |
* with different data type to one window. Attach another array that has data overlapped | |
* with other array to different window or the same window will still work. | |
* Then use MPI_Get to perform RMA operation to get data from target rank. |