Created
April 19, 2011 18:26
-
-
Save tfmoraes/929168 to your computer and use it in GitHub Desktop.
Testing numpy memmap with multiprocessing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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