Code Monkey home page Code Monkey logo

Comments (6)

basnijholt avatar basnijholt commented on May 27, 2024

@jbweston implemented this 7 months ago. I have never used it myself. From looking at the source-code I have no clue as to why this is happening for you.

from adaptive-scheduler.

basnijholt avatar basnijholt commented on May 27, 2024

@aeantipov, I tried this:

scheduler_kwargs = dict(
        num_threads = 4,
        extra_scheduler=[
            "--exclusive", 
            "--partition=partition"
        ],
        extra_script="umask 0000", # or ["umask 0000"]
        executor_type="process-pool",
    )
import adaptive_scheduler
sch = adaptive_scheduler.scheduler.SLURM(cores=1, **scheduler_kwargs)
print(sch.job_script())

which prints:

#!/bin/bash
#SBATCH --ntasks 1
#SBATCH --no-requeue
#SBATCH --exclusive
#SBATCH --partition=partition

export MKL_NUM_THREADS=4
export OPENBLAS_NUM_THREADS=4
export OMP_NUM_THREADS=4
export NUMEXPR_NUM_THREADS=4


umask 0000

/Users/basnijholt/miniconda3/bin/python run_learner.py --n 1 --log-fname ${NAME}-${SLURM_JOB_ID}.log --job-id ${SLURM_JOB_ID} --name ${NAME}

So I think you might be using an old version.

from adaptive-scheduler.

aeantipov avatar aeantipov commented on May 27, 2024

It seems, it's a further dependency that's causing the issue.

from adaptive-scheduler.

basnijholt avatar basnijholt commented on May 27, 2024

I have noticed that this actually still doesn't work.

import concurrent.futures
ex = concurrent.futures.ProcessPoolExecutor()
# Ignores extra_script
run_manager.ioloop.run_in_executor(ex, scheduler.write_job_script, "test")
# Correctly uses extra_script
scheduler.write_job_script("test2")

It probably has to do with the serialization of the scheduler.

from adaptive-scheduler.

basnijholt avatar basnijholt commented on May 27, 2024

Right:

import pickle
print(scheduler.extra_script)  # prints correctly
print(pickle.loads(pickle.dumps(scheduler)).extra_script)  # prints empty string

from adaptive-scheduler.

basnijholt avatar basnijholt commented on May 27, 2024

Fixed by e7eb7df and I released v0.9.16.

from adaptive-scheduler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.