入力タブで区切られたテキスト ファイルがあります。
0 .4
1 .9
2 .2
3 .12
4 .55
5 .98
プレーンなPythonで次のように分析します。
lines = open("songs.tsv").readlines()
def extract_hotness(line):
return float(line.split()[1])
songs_hotness =map(extract_hotness, lines)
max_hotness = max(songs_hotness)
を使用して同じ操作を並行して実行するにはどうすればよいmpi4py
ですか? でこれを実装し始めましたが、リスト要素をノード数と同じ長さにする必要がscatter
あるため、すぐには機能しません。scatter