Skip to content

Instantly share code, notes, and snippets.

View pietromarchesi's full-sized avatar

Pietro Marchesi pietromarchesi

  • University of Amsterdam
View GitHub Profile
@pietromarchesi
pietromarchesi / sciluigi_slurm.md
Last active April 17, 2023 09:24
Running SciLuigi on a Slurm cluster (draft)

In this example we show how to adapt the example workflow so that we can run it on a cluster using the Slurm Workload Manager (Slurm).

We will write a workflow composed of two tasks, one which creates a file called foo.txt and writes foo in it, and one which reads foo.txt and swaps every occurrence of foo with the name of the cluster node on which the workflow is running.

To do this, we have to slightly change the workflow definition. In particular, we set up a runmode parameter which will allow us to specify from the command line whether we want the workflow to be run locally or on the cluster.

When we define the tasks, we have to pass an additional SlurmInfo object, which contains the specification of the resources we want to allocate to our tasks and other Slurm parameters.

@pietromarchesi
pietromarchesi / neoconversion.md
Last active March 12, 2018 15:11
neoconversion

Packaging data following the Neo model

General considerations

  • A block corresponds to a recording session. Consequently, a full dataset will be composed of several blocks. A block should have annotations regarding the animal and all the dummy codes used in the different fields (e.g. if different trial types have specific numeric labels)
  • Segments are used for trials. They should contain annotations regarding trial-specific variables, and event/epoch objects.
  • Since this is a multi-area recording, channel indices correspond to a single area/bundle, and tetrode and channel information are ralegated to the annotations.
@pietromarchesi
pietromarchesi / parallelslurmflow.py
Created February 5, 2018 13:43
Example Slurm workflow - parallel workflows
import luigi
import sciluigi
import os
class MyMetaWorkflow(sciluigi.WorkflowTask):
runmode = luigi.Parameter()
n_tasks = luigi.IntParameter()
def workflow(self):
import os
import neo
import numpy as np
from quantities import s
import matplotlib.pyplot as plt
import p_utils
### EXTRACTING AND PREPARING THE DATA ###
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.