Skip to content
Snippets Groups Projects
Select Git revision
  • signal-handler-dump
  • master default protected
  • optimise-space-split-tpool
  • split-space-split
  • better-space-split-tpool
  • melion/BalsaraKim
  • darwin/gear_preSN_fbk_merge
  • reyz/gear_preSN_feedback
  • mark_bug
  • FS_VP_m2_allGrad
  • nickishch/MHD_canvas/OWAR_fully_symmetric_ShearAndRotation
  • fstasys/VEP_Fm2
  • beyond-mesh-pair-removal
  • darwin/gear_chemistry_fluxes
  • MHD_canvas protected
  • sidm_merge protected
  • fewer_gpart_comms
  • zoom_merge protected
  • MAGMA2_matthieu
  • darwin/sink_mpi_physics
  • darwin/gear_mechanical_feedback
  • v2025.10 protected
  • v2025.04 protected
  • v2025.01 protected
  • v1.0.0 protected
  • v0.9.0 protected
  • v0.8.5 protected
  • v0.8.4 protected
  • v0.8.3 protected
  • v0.8.2 protected
  • v0.8.1 protected
  • v0.8.0 protected
  • v0.7.0 protected
  • v0.6.0 protected
  • v0.5.0 protected
  • v0.4.0 protected
  • v0.3.0 protected
  • v0.2.0 protected
  • v0.1.0-pre protected
  • v0.1 protected
  • v0.0 protected
41 results

ax_check_compile_flag.m4

Blame
  • scheduler.h NaN GiB
    /*******************************************************************************
     * This file is part of SWIFT.
     * Coypright (c) 2013 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU Lesser General Public License as published
     * by the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU Lesser General Public License
     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     *
     ******************************************************************************/
    #ifndef SWIFT_SCHEDULER_H
    #define SWIFT_SCHEDULER_H
    
    /* Some standard headers. */
    #include <pthread.h>
    
    /* Includes. */
    #include "cell.h"
    #include "lock.h"
    #include "queue.h"
    #include "space.h"
    #include "task.h"
    
    /* Some constants. */
    #define scheduler_maxwait 3
    #define scheduler_maxunlock 40
    #define scheduler_dosub 1
    #define scheduler_maxsteal 10
    #define scheduler_maxtries 2
    #define scheduler_doforcesplit            \
      0 /* Beware: switching this on can/will \
           break engine_addlink as it assumes \
           a maximum number of tasks per cell. */
    
    /* Flags . */
    #define scheduler_flag_none 0
    #define scheduler_flag_steal 1
    
    /* Data of a scheduler. */
    struct scheduler {
    
      /* Scheduler flags. */
      unsigned int flags;
    
      /* Number of queues in this scheduler. */
      int nr_queues;
    
      /* Array of queues. */
      struct queue *queues;
    
      /* Total number of tasks. */
      int nr_tasks, size, tasks_next;
    
      /* Total number of waiting tasks. */
      int waiting;
    
      /* The task array. */
      struct task *tasks;
    
      /* The task indices. */
      int *tasks_ind;
    
      /* Lock for this scheduler. */
      lock_type lock;
    
      /* Waiting queue. */
      pthread_mutex_t sleep_mutex;
      pthread_cond_t sleep_cond;
    
      /* The space associated with this scheduler. */
      struct space *space;
    
      /* The node we are working on. */
      int nodeID;
    };
    
    /* Function prototypes. */
    void scheduler_init(struct scheduler *s, struct space *space, int nr_queues,
                        unsigned int flags, int nodeID);
    struct task *scheduler_gettask(struct scheduler *s, int qid,
                                   struct cell *super);
    void scheduler_enqueue(struct scheduler *s, struct task *t);
    void scheduler_start(struct scheduler *s, unsigned int mask);
    void scheduler_reset(struct scheduler *s, int nr_tasks);
    void scheduler_ranktasks(struct scheduler *s);
    void scheduler_reweight(struct scheduler *s);
    struct task *scheduler_addtask(struct scheduler *s, int type, int subtype,
                                   int flags, int wait, struct cell *ci,
                                   struct cell *cj, int tight);
    void scheduler_splittasks(struct scheduler *s);
    struct task *scheduler_done(struct scheduler *s, struct task *t);
    struct task *scheduler_unlock(struct scheduler *s, struct task *t);
    void scheduler_addunlock(struct scheduler *s, struct task *ta, struct task *tb);
    
    #endif /* SWIFT_SCHEDULER_H */