Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Testing numpy memmap with multiprocessing
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing
import numpy as np
def print_matrix(matrix):
print matrix
def main():
matrix = np.memmap('test.dat', dtype='int16', mode='w+', shape=(100, 100))
p = multiprocessing.Process(target=print_matrix, args=(matrix,))
p.start()
p.join()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment