-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added per-process based data analysis configuration and started a mon…
…godb backend
- Loading branch information
Showing
11 changed files
with
161 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.vscode | ||
__pycache__ | ||
*.bp |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
DELTA-FUSION | ||
aDaptive rEaL Time Analysis of big fusion data | ||
|
||
This project implements a client-server model for analysis of streamed data from | ||
This project implements a client-server model for analysis of streaming data from | ||
fusion experiments or large-scale simulations. | ||
|
||
Implemented as part of "Adaptive near-real time net-worked analysis of big | ||
fusion data", (FY18). | ||
|
||
|
||
Start/Stop zookeper and kafka: https://gist.github.com/piatra/0d6f7ad1435fa7aa790a | ||
#!/bin/bash | ||
The current implementation features a data generator and a data processor. | ||
Both are MPI applications. Each generator task reads data from a single group of channels | ||
and writes them via the ADIOS2 dataman interface. | ||
Each processor task reads this data and performs a single analysis routine. | ||
The output of the analysis is stored in a database for later analysis and visualization. | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Please supply topic name" | ||
exit 1 | ||
fi | ||
|
||
nohup bin/zookeeper-server-start.sh -daemon config/zookeeper.properties > /dev/null 2>&1 & | ||
sleep 2 | ||
nohup bin/kafka-server-start.sh -daemon config/server.properties > /dev/null 2>&1 & | ||
sleep 2 | ||
To run the analysis framework run a generator and a processor simultaneously on a node: | ||
srun -n 2 -c 2 --mem=1G --gres=craynetwork:0 python generator_adios2.py | ||
srun -n 2 -c 2 --mem=1G --gres=craynetwork:0 python processor_adios2.py | ||
|
||
For example within an interactive session, using a split terminal (see the screen utility) | ||
|
||
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic $1 | ||
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic parsed |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Coding: UTF-8 -*- | ||
|
||
|
||
|
||
def power_spectrum(data, **kwargs): | ||
"""Implements an overlapped segmented averaging of modified periodograms. | ||
Currently scipy.signal.welch | ||
See | ||
* Originial implementation in kstar fluctana | ||
* Discussion in | ||
'Spectrum and spectral density estimation by the Discrete Fourier transform (DFT), | ||
including a comprehensive list of window functions and some new flat-top windows' | ||
G. Heinzel, A. Rudiger and R. Schilling (2002) | ||
Input: | ||
====== | ||
data : channel data to be analyzed | ||
**kwargs : keyword arguments to be passed into wrapped function. See documentation of wrapped function. | ||
Returns: | ||
======== | ||
f : ndarray, vector of frequency bins | ||
Pxx : ndarray, vector of power spectral densities | ||
""" | ||
|
||
from scipy.signal import welch | ||
f, Pxx = welch(data, **kwargs) | ||
|
||
return(f, Pxx) | ||
|
||
|
||
# End of file analysis.py |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#Coding: UTF-8 -*- | ||
|
||
from mpi4py import MPI | ||
from pymongo import MongoClient | ||
from bson.binary import Binary | ||
|
||
class mongodb_backend(): | ||
__init__(self, rank, channel_list): | ||
self.rank = rank | ||
self.channel_list = channel_list | ||
|
||
# Connect to mongodb | ||
client = MongoClient("mongodb07.nersc.gov") | ||
|
||
|
||
def store(analysis, result): | ||
"""Stores analysis data | ||
Input: | ||
====== | ||
channel_list: List of channels | ||
analysis: dictionary, name and parameters for called analysis routine | ||
result: Result of the analysis routine | ||
Returns: | ||
======== | ||
None | ||
""" | ||
|
||
print("Storing data") | ||
|
||
|
||
return None | ||
|
||
|
||
# End of file mongodb.py |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{"datapath": "/global/cscratch1/sd/rkube/KSTAR/kstar_streaming/018431", | ||
"shotnr": 18431, | ||
"channels": [2202, 2203], | ||
"analysis": ["foo", "bar"]} | ||
"channel_lists": [[2203, 2204], [2101, 2102]], | ||
"analysis": [{"name" : "power_spectrum", | ||
"config" : {"nperseg": 32, "fs": 1.0}}, | ||
{"name" : "an_honest_mistake", | ||
"config" : {"a": 0, "b": 22}}] | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.