slurm.h 208 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044
  1. /* slurm/slurm.h. Generated from slurm.h.in by configure. */
  2. /*****************************************************************************\
  3. * slurm.h - Definitions for all of the Slurm RPCs
  4. *****************************************************************************
  5. * Copyright (C) 2002-2007 The Regents of the University of California.
  6. * Copyright (C) 2008-2010 Lawrence Livermore National Security.
  7. * Portions Copyright (C) 2010-2017 SchedMD LLC <https://www.schedmd.com>.
  8. * Portions Copyright (C) 2012-2013 Los Alamos National Security, LLC.
  9. * Portions Copyright 2013 Cray Inc. All Rights Reserved.
  10. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  11. * Written by Morris Jette <jette1@llnl.gov>, et. al.
  12. * CODE-OCEC-09-009. All rights reserved.
  13. *
  14. * This file is part of Slurm, a resource management program.
  15. * For details, see <https://slurm.schedmd.com/>.
  16. * Please also read the included file: DISCLAIMER.
  17. *
  18. * Slurm is free software; you can redistribute it and/or modify it under
  19. * the terms of the GNU General Public License as published by the Free
  20. * Software Foundation; either version 2 of the License, or (at your option)
  21. * any later version.
  22. *
  23. * In addition, as a special exception, the copyright holders give permission
  24. * to link the code of portions of this program with the OpenSSL library under
  25. * certain conditions as described in each individual source file, and
  26. * distribute linked combinations including the two. You must obey the GNU
  27. * General Public License in all respects for all of the code used other than
  28. * OpenSSL. If you modify file(s) with this exception, you may extend this
  29. * exception to your version of the file(s), but you are not obligated to do
  30. * so. If you do not wish to do so, delete this exception statement from your
  31. * version. If you delete this exception statement from all source files in
  32. * the program, then also delete it here.
  33. *
  34. * Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
  35. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  36. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  37. * details.
  38. *
  39. * You should have received a copy of the GNU General Public License along
  40. * with Slurm; if not, write to the Free Software Foundation, Inc.,
  41. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  42. \*****************************************************************************/
  43. #ifndef _SLURM_H
  44. #define _SLURM_H
  45. /* Number of dimensions the system has */
  46. #define SYSTEM_DIMENSIONS 1
  47. #define HIGHEST_DIMENSIONS 5
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. #include <slurm/slurm_errno.h>
  52. #include <inttypes.h> /* for uint16_t, uint32_t definitions */
  53. #include <netinet/in.h> /* struct sockaddr_in */
  54. #include <stdbool.h>
  55. #include <stdio.h> /* for FILE definitions */
  56. #include <sys/types.h> /* for uid_t definition */
  57. #include <time.h> /* for time_t definitions */
  58. #include <unistd.h>
  59. /* Define slurm_addr_t below to avoid including extraneous slurm headers */
  60. typedef struct sockaddr_in slurm_addr_t;
  61. #ifndef __slurmdb_cluster_rec_t_defined
  62. # define __slurmdb_cluster_rec_t_defined
  63. typedef struct slurmdb_cluster_rec slurmdb_cluster_rec_t;
  64. #endif
  65. #ifndef __slurm_cred_t_defined
  66. # define __slurm_cred_t_defined
  67. typedef struct slurm_job_credential slurm_cred_t;
  68. #endif
  69. /* Define switch_jobinfo_t below to avoid including extraneous slurm headers */
  70. #ifndef __switch_jobinfo_t_defined
  71. # define __switch_jobinfo_t_defined
  72. typedef struct switch_jobinfo switch_jobinfo_t; /* opaque data type */
  73. #endif
  74. /* Define job_resources_t below
  75. * to avoid including extraneous slurm headers */
  76. #ifndef __job_resources_t_defined
  77. # define __job_resources_t_defined /* Opaque data for select plugins */
  78. typedef struct job_resources job_resources_t;
  79. #endif
  80. /* Define select_jobinfo_t, select_nodeinfo_t below
  81. * to avoid including extraneous slurm headers */
  82. #ifndef __select_jobinfo_t_defined
  83. # define __select_jobinfo_t_defined /* Opaque data for select plugins */
  84. typedef struct select_jobinfo select_jobinfo_t; /* for BlueGene */
  85. typedef struct select_nodeinfo select_nodeinfo_t; /* for BlueGene */
  86. #endif
  87. /* Define jobacctinfo_t below to avoid including extraneous slurm headers */
  88. #ifndef __jobacctinfo_t_defined
  89. # define __jobacctinfo_t_defined
  90. typedef struct jobacctinfo jobacctinfo_t; /* opaque data type */
  91. #endif
  92. /* Define allocation_msg_thread_t below to avoid including extraneous
  93. * slurm headers */
  94. #ifndef __allocation_msg_thread_t_defined
  95. # define __allocation_msg_thread_t_defined
  96. typedef struct allocation_msg_thread allocation_msg_thread_t;
  97. #endif
  98. #ifndef __sbcast_cred_t_defined
  99. # define __sbcast_cred_t_defined
  100. typedef struct sbcast_cred sbcast_cred_t; /* opaque data type */
  101. #endif
  102. /*****************************************************************************\
  103. * DEFINITIONS FOR VERSION MANAGEMENT
  104. \*****************************************************************************/
  105. /* Define Slurm version number.
  106. * High-order byte is major version.
  107. * Middle byte is minor version.
  108. * Low-order byte is micro version (NOTE: excludes "-pre#" component
  109. # of micro version used in pre-releases).
  110. * Use SLURM_VERSION_NUM macro to compare versions, for example
  111. * #if SLURM_VERSION_NUMBER > SLURM_VERSION_NUM(2,1,0)
  112. */
  113. #define SLURM_VERSION_NUMBER 0x140204
  114. #define SLURM_VERSION_NUM(a,b,c) (((a) << 16) + ((b) << 8) + (c))
  115. #define SLURM_VERSION_MAJOR(a) (((a) >> 16) & 0xff)
  116. #define SLURM_VERSION_MINOR(a) (((a) >> 8) & 0xff)
  117. #define SLURM_VERSION_MICRO(a) ((a) & 0xff)
  118. /*****************************************************************************\
  119. * DEFINITIONS FOR INPUT VALUES
  120. \*****************************************************************************/
  121. /* INFINITE is used to identify unlimited configurations, */
  122. /* eg. the maximum count of nodes any job may use in some partition */
  123. #define INFINITE8 (0xff)
  124. #define INFINITE16 (0xffff)
  125. #define INFINITE (0xffffffff)
  126. #define INFINITE64 (0xffffffffffffffff)
  127. #define NO_VAL8 (0xfe)
  128. #define NO_VAL16 (0xfffe)
  129. #define NO_VAL (0xfffffffe)
  130. #define NO_VAL64 (0xfffffffffffffffe)
  131. #define MAX_TASKS_PER_NODE 512
  132. #define MAX_JOB_ID (0x03FFFFFF) /* bits 0-25 */
  133. #define MAX_FED_CLUSTERS 63
  134. /* Job step ID of pending step */
  135. #define SLURM_PENDING_STEP (0xfffffffd)
  136. /* Job step ID of batch scripts */
  137. #define SLURM_BATCH_SCRIPT (0xfffffffe)
  138. /* Job step ID of external process container */
  139. #define SLURM_EXTERN_CONT (0xffffffff)
  140. /* How many seconds to wait after eio_signal_shutdown() is called before
  141. * terminating the job and abandoning any I/O remaining to be processed.
  142. */
  143. #define DEFAULT_EIO_SHUTDOWN_WAIT 60
  144. /*
  145. * SLURM_ID_HASH
  146. * Description:
  147. * Creates a hash of a Slurm JOBID and STEPID
  148. * The JOB STEP ID is in the top 32 bits of the hash with the job id occupying
  149. * the lower 32 bits.
  150. *
  151. * IN _jobid -- SLURM's JOB ID (uint32_t)
  152. * IN _stepid -- SLURM's JOB STEP ID (uint32_t)
  153. * RET id_hash -- (uint64_t)
  154. */
  155. #define SLURM_ID_HASH(_jobid, _stepid) \
  156. (uint64_t)(((uint64_t)_stepid << 32) + _jobid)
  157. #define SLURM_ID_HASH_JOB_ID(hash_id) (uint32_t)(hash_id & 0x00000000FFFFFFFF)
  158. #define SLURM_ID_HASH_STEP_ID(hash_id) (uint32_t)(hash_id >> 32)
  159. /*
  160. * Convert a hash ID to its legacy (pre-17.11) equivalent
  161. * Used for backward compatibility for Cray PMI
  162. */
  163. #define SLURM_ID_HASH_LEGACY(hash_id) \
  164. ((hash_id >> 32) * 10000000000 + (hash_id & 0x00000000FFFFFFFF))
  165. /* last entry must be JOB_END, keep in sync with job_state_string and
  166. * job_state_string_compact. values may be ORed with JOB_STATE_FLAGS
  167. * below. */
  168. enum job_states {
  169. JOB_PENDING, /* queued waiting for initiation */
  170. JOB_RUNNING, /* allocated resources and executing */
  171. JOB_SUSPENDED, /* allocated resources, execution suspended */
  172. JOB_COMPLETE, /* completed execution successfully */
  173. JOB_CANCELLED, /* cancelled by user */
  174. JOB_FAILED, /* completed execution unsuccessfully */
  175. JOB_TIMEOUT, /* terminated on reaching time limit */
  176. JOB_NODE_FAIL, /* terminated on node failure */
  177. JOB_PREEMPTED, /* terminated due to preemption */
  178. JOB_BOOT_FAIL, /* terminated due to node boot failure */
  179. JOB_DEADLINE, /* terminated on deadline */
  180. JOB_OOM, /* experienced out of memory error */
  181. JOB_END /* not a real state, last entry in table */
  182. };
  183. #define JOB_STATE_BASE 0x000000ff /* Used for job_states above */
  184. #define JOB_STATE_FLAGS 0xffffff00 /* Used for state flags below */
  185. #define JOB_LAUNCH_FAILED 0x00000100
  186. #define JOB_UPDATE_DB 0x00000200 /* Send job start to database again */
  187. #define JOB_REQUEUE 0x00000400 /* Requeue job in completing state */
  188. #define JOB_REQUEUE_HOLD 0x00000800 /* Requeue any job in hold */
  189. #define JOB_SPECIAL_EXIT 0x00001000 /* Requeue an exit job in hold */
  190. #define JOB_RESIZING 0x00002000 /* Size of job about to change, flag set
  191. before calling accounting functions
  192. immediately before job changes size */
  193. #define JOB_CONFIGURING 0x00004000 /* Allocated nodes booting */
  194. #define JOB_COMPLETING 0x00008000 /* Waiting for epilog completion */
  195. #define JOB_STOPPED 0x00010000 /* Job is stopped state (holding resources,
  196. but sent SIGSTOP */
  197. #define JOB_RECONFIG_FAIL 0x00020000 /* Node configuration for job failed,
  198. not job state, just job requeue flag */
  199. #define JOB_POWER_UP_NODE 0x00040000 /* Allocated powered down nodes,
  200. * waiting for reboot */
  201. #define JOB_REVOKED 0x00080000 /* Sibling job revoked */
  202. #define JOB_REQUEUE_FED 0x00100000 /* Job is being requeued by federation */
  203. #define JOB_RESV_DEL_HOLD 0x00200000 /* Job is hold */
  204. #define JOB_SIGNALING 0x00400000 /* Outgoing signal is pending */
  205. #define JOB_STAGE_OUT 0x00800000 /* Staging out data (burst buffer) */
  206. #define READY_JOB_FATAL -2 /* fatal error */
  207. #define READY_JOB_ERROR -1 /* ordinary error */
  208. #define READY_NODE_STATE 0x01 /* node is ready */
  209. #define READY_JOB_STATE 0x02 /* job is ready to execute */
  210. #define MAIL_JOB_BEGIN 0x0001 /* Notify when job begins */
  211. #define MAIL_JOB_END 0x0002 /* Notify when job ends */
  212. #define MAIL_JOB_FAIL 0x0004 /* Notify if job fails */
  213. #define MAIL_JOB_REQUEUE 0x0008 /* Notify if job requeued */
  214. #define MAIL_JOB_TIME100 0x0010 /* Notify on reaching 100% of time limit */
  215. #define MAIL_JOB_TIME90 0x0020 /* Notify on reaching 90% of time limit */
  216. #define MAIL_JOB_TIME80 0x0040 /* Notify on reaching 80% of time limit */
  217. #define MAIL_JOB_TIME50 0x0080 /* Notify on reaching 50% of time limit */
  218. #define MAIL_JOB_STAGE_OUT 0x0100 /* Notify on completion of burst buffer
  219. * stage out */
  220. #define MAIL_ARRAY_TASKS 0x0200 /* Send emails for each array task */
  221. /*
  222. * job_array_struct_t array_flags definitions. ARRAY_TASK_REQUEUED could be
  223. * substituted in the future to tot_requeued_tasks member in the struct, which
  224. * would provide a more accurated array statistic.
  225. */
  226. #define ARRAY_TASK_REQUEUED 0x0001 /* At least one task was requeued. */
  227. #define NICE_OFFSET 0x80000000 /* offset for job's nice value */
  228. /* Reason for job to be pending rather than executing or reason for job
  229. * failure. If multiple reasons exists, only one is given for the sake of
  230. * system efficiency */
  231. enum job_state_reason {
  232. /* Reasons for job to be pending */
  233. WAIT_NO_REASON = 0, /* not set or job not pending */
  234. WAIT_PRIORITY, /* higher priority jobs exist */
  235. WAIT_DEPENDENCY, /* dependent job has not completed */
  236. WAIT_RESOURCES, /* required resources not available */
  237. WAIT_PART_NODE_LIMIT, /* request exceeds partition node limit */
  238. WAIT_PART_TIME_LIMIT, /* request exceeds partition time limit */
  239. WAIT_PART_DOWN, /* requested partition is down */
  240. WAIT_PART_INACTIVE, /* requested partition is inactive */
  241. WAIT_HELD, /* job is held by administrator */
  242. WAIT_TIME, /* job waiting for specific begin time */
  243. WAIT_LICENSES, /* job is waiting for licenses */
  244. WAIT_ASSOC_JOB_LIMIT, /* user/bank job limit reached */
  245. WAIT_ASSOC_RESOURCE_LIMIT,/* user/bank resource limit reached */
  246. WAIT_ASSOC_TIME_LIMIT, /* user/bank time limit reached */
  247. WAIT_RESERVATION, /* reservation not available */
  248. WAIT_NODE_NOT_AVAIL, /* required node is DOWN or DRAINED */
  249. WAIT_HELD_USER, /* job is held by user */
  250. WAIT_FRONT_END, /* Front end nodes are DOWN */
  251. FAIL_DEFER, /* individual submit time sched deferred */
  252. FAIL_DOWN_PARTITION, /* partition for job is DOWN */
  253. FAIL_DOWN_NODE, /* some node in the allocation failed */
  254. FAIL_BAD_CONSTRAINTS, /* constraints can not be satisfied */
  255. FAIL_SYSTEM, /* slurm system failure */
  256. FAIL_LAUNCH, /* unable to launch job */
  257. FAIL_EXIT_CODE, /* exit code was non-zero */
  258. FAIL_TIMEOUT, /* reached end of time limit */
  259. FAIL_INACTIVE_LIMIT, /* reached slurm InactiveLimit */
  260. FAIL_ACCOUNT, /* invalid account */
  261. FAIL_QOS, /* invalid QOS */
  262. WAIT_QOS_THRES, /* required QOS threshold has been breached */
  263. WAIT_QOS_JOB_LIMIT, /* QOS job limit reached */
  264. WAIT_QOS_RESOURCE_LIMIT,/* QOS resource limit reached */
  265. WAIT_QOS_TIME_LIMIT, /* QOS time limit reached */
  266. WAIT_BLOCK_MAX_ERR, /* BLUEGENE Block has too many cnodes
  267. * in error state to allow more jobs. */
  268. WAIT_BLOCK_D_ACTION, /* BLUEGENE Block is being freed,
  269. * can't allow more jobs. */
  270. WAIT_CLEANING, /* If a job is requeued and it is
  271. * still cleaning up from the last run. */
  272. WAIT_PROLOG, /* Prolog is running */
  273. WAIT_QOS, /* QOS not allowed */
  274. WAIT_ACCOUNT, /* Account not allowed */
  275. WAIT_DEP_INVALID, /* Dependency condition invalid or never
  276. * satisfied
  277. */
  278. WAIT_QOS_GRP_CPU, /* QOS GrpTRES exceeded (CPU) */
  279. WAIT_QOS_GRP_CPU_MIN, /* QOS GrpTRESMins exceeded (CPU) */
  280. WAIT_QOS_GRP_CPU_RUN_MIN, /* QOS GrpTRESRunMins exceeded (CPU) */
  281. WAIT_QOS_GRP_JOB, /* QOS GrpJobs exceeded */
  282. WAIT_QOS_GRP_MEM, /* QOS GrpTRES exceeded (Memory) */
  283. WAIT_QOS_GRP_NODE, /* QOS GrpTRES exceeded (Node) */
  284. WAIT_QOS_GRP_SUB_JOB, /* QOS GrpSubmitJobs exceeded */
  285. WAIT_QOS_GRP_WALL, /* QOS GrpWall exceeded */
  286. WAIT_QOS_MAX_CPU_PER_JOB, /* QOS MaxTRESPerJob exceeded (CPU) */
  287. WAIT_QOS_MAX_CPU_MINS_PER_JOB,/* QOS MaxTRESMinsPerJob exceeded (CPU) */
  288. WAIT_QOS_MAX_NODE_PER_JOB, /* QOS MaxTRESPerJob exceeded (Node) */
  289. WAIT_QOS_MAX_WALL_PER_JOB, /* QOS MaxWallDurationPerJob exceeded */
  290. WAIT_QOS_MAX_CPU_PER_USER, /* QOS MaxTRESPerUser exceeded (CPU) */
  291. WAIT_QOS_MAX_JOB_PER_USER, /* QOS MaxJobsPerUser exceeded */
  292. WAIT_QOS_MAX_NODE_PER_USER, /* QOS MaxTRESPerUser exceeded (Node) */
  293. WAIT_QOS_MAX_SUB_JOB, /* QOS MaxSubmitJobsPerUser exceeded */
  294. WAIT_QOS_MIN_CPU, /* QOS MinTRESPerJob not reached (CPU) */
  295. WAIT_ASSOC_GRP_CPU, /* ASSOC GrpTRES exceeded (CPU) */
  296. WAIT_ASSOC_GRP_CPU_MIN, /* ASSOC GrpTRESMins exceeded (CPU) */
  297. WAIT_ASSOC_GRP_CPU_RUN_MIN, /* ASSOC GrpTRESRunMins exceeded (CPU) */
  298. WAIT_ASSOC_GRP_JOB, /* ASSOC GrpJobs exceeded */
  299. WAIT_ASSOC_GRP_MEM, /* ASSOC GrpTRES exceeded (Memory) */
  300. WAIT_ASSOC_GRP_NODE, /* ASSOC GrpTRES exceeded (Node) */
  301. WAIT_ASSOC_GRP_SUB_JOB, /* ASSOC GrpSubmitJobs exceeded */
  302. WAIT_ASSOC_GRP_WALL, /* ASSOC GrpWall exceeded */
  303. WAIT_ASSOC_MAX_JOBS, /* ASSOC MaxJobs exceeded */
  304. WAIT_ASSOC_MAX_CPU_PER_JOB, /* ASSOC MaxTRESPerJob exceeded (CPU) */
  305. WAIT_ASSOC_MAX_CPU_MINS_PER_JOB,/* ASSOC MaxTRESMinsPerJob
  306. * exceeded (CPU) */
  307. WAIT_ASSOC_MAX_NODE_PER_JOB, /* ASSOC MaxTRESPerJob exceeded (NODE) */
  308. WAIT_ASSOC_MAX_WALL_PER_JOB, /* ASSOC MaxWallDurationPerJob
  309. * exceeded */
  310. WAIT_ASSOC_MAX_SUB_JOB, /* ASSOC MaxSubmitJobsPerUser exceeded */
  311. WAIT_MAX_REQUEUE, /* MAX_BATCH_REQUEUE reached */
  312. WAIT_ARRAY_TASK_LIMIT, /* job array running task limit */
  313. WAIT_BURST_BUFFER_RESOURCE, /* Burst buffer resources */
  314. WAIT_BURST_BUFFER_STAGING, /* Burst buffer file stage-in */
  315. FAIL_BURST_BUFFER_OP, /* Burst buffer operation failure */
  316. WAIT_POWER_NOT_AVAIL, /* not enough power available */
  317. WAIT_POWER_RESERVED, /* job is waiting for available power
  318. * because of power reservations */
  319. WAIT_ASSOC_GRP_UNK, /* ASSOC GrpTRES exceeded
  320. * (Unknown) */
  321. WAIT_ASSOC_GRP_UNK_MIN, /* ASSOC GrpTRESMins exceeded
  322. * (Unknown) */
  323. WAIT_ASSOC_GRP_UNK_RUN_MIN, /* ASSOC GrpTRESRunMins exceeded
  324. * (Unknown) */
  325. WAIT_ASSOC_MAX_UNK_PER_JOB, /* ASSOC MaxTRESPerJob exceeded
  326. * (Unknown) */
  327. WAIT_ASSOC_MAX_UNK_PER_NODE, /* ASSOC MaxTRESPerNode exceeded
  328. * (Unknown) */
  329. WAIT_ASSOC_MAX_UNK_MINS_PER_JOB,/* ASSOC MaxTRESMinsPerJob
  330. * exceeded (Unknown) */
  331. WAIT_ASSOC_MAX_CPU_PER_NODE, /* ASSOC MaxTRESPerNode exceeded (CPU) */
  332. WAIT_ASSOC_GRP_MEM_MIN, /* ASSOC GrpTRESMins exceeded
  333. * (Memory) */
  334. WAIT_ASSOC_GRP_MEM_RUN_MIN, /* ASSOC GrpTRESRunMins exceeded
  335. * (Memory) */
  336. WAIT_ASSOC_MAX_MEM_PER_JOB, /* ASSOC MaxTRESPerJob exceeded (Memory) */
  337. WAIT_ASSOC_MAX_MEM_PER_NODE, /* ASSOC MaxTRESPerNode exceeded (CPU) */
  338. WAIT_ASSOC_MAX_MEM_MINS_PER_JOB,/* ASSOC MaxTRESMinsPerJob
  339. * exceeded (Memory) */
  340. WAIT_ASSOC_GRP_NODE_MIN, /* ASSOC GrpTRESMins exceeded (Node) */
  341. WAIT_ASSOC_GRP_NODE_RUN_MIN, /* ASSOC GrpTRESRunMins exceeded (Node) */
  342. WAIT_ASSOC_MAX_NODE_MINS_PER_JOB,/* ASSOC MaxTRESMinsPerJob
  343. * exceeded (Node) */
  344. WAIT_ASSOC_GRP_ENERGY, /* ASSOC GrpTRES exceeded
  345. * (Energy) */
  346. WAIT_ASSOC_GRP_ENERGY_MIN, /* ASSOC GrpTRESMins exceeded
  347. * (Energy) */
  348. WAIT_ASSOC_GRP_ENERGY_RUN_MIN, /* ASSOC GrpTRESRunMins exceeded
  349. * (Energy) */
  350. WAIT_ASSOC_MAX_ENERGY_PER_JOB, /* ASSOC MaxTRESPerJob exceeded
  351. * (Energy) */
  352. WAIT_ASSOC_MAX_ENERGY_PER_NODE, /* ASSOC MaxTRESPerNode
  353. * exceeded (Energy) */
  354. WAIT_ASSOC_MAX_ENERGY_MINS_PER_JOB,/* ASSOC MaxTRESMinsPerJob
  355. * exceeded (Energy) */
  356. WAIT_ASSOC_GRP_GRES, /* ASSOC GrpTRES exceeded (GRES) */
  357. WAIT_ASSOC_GRP_GRES_MIN, /* ASSOC GrpTRESMins exceeded (GRES) */
  358. WAIT_ASSOC_GRP_GRES_RUN_MIN, /* ASSOC GrpTRESRunMins exceeded (GRES) */
  359. WAIT_ASSOC_MAX_GRES_PER_JOB, /* ASSOC MaxTRESPerJob exceeded (GRES) */
  360. WAIT_ASSOC_MAX_GRES_PER_NODE, /* ASSOC MaxTRESPerNode exceeded (GRES) */
  361. WAIT_ASSOC_MAX_GRES_MINS_PER_JOB,/* ASSOC MaxTRESMinsPerJob
  362. * exceeded (GRES) */
  363. WAIT_ASSOC_GRP_LIC, /* ASSOC GrpTRES exceeded
  364. * (license) */
  365. WAIT_ASSOC_GRP_LIC_MIN, /* ASSOC GrpTRESMins exceeded
  366. * (license) */
  367. WAIT_ASSOC_GRP_LIC_RUN_MIN, /* ASSOC GrpTRESRunMins exceeded
  368. * (license) */
  369. WAIT_ASSOC_MAX_LIC_PER_JOB, /* ASSOC MaxTRESPerJob exceeded
  370. * (license) */
  371. WAIT_ASSOC_MAX_LIC_MINS_PER_JOB,/* ASSOC MaxTRESMinsPerJob exceeded
  372. * (license) */
  373. WAIT_ASSOC_GRP_BB, /* ASSOC GrpTRES exceeded
  374. * (burst buffer) */
  375. WAIT_ASSOC_GRP_BB_MIN, /* ASSOC GrpTRESMins exceeded
  376. * (burst buffer) */
  377. WAIT_ASSOC_GRP_BB_RUN_MIN, /* ASSOC GrpTRESRunMins exceeded
  378. * (burst buffer) */
  379. WAIT_ASSOC_MAX_BB_PER_JOB, /* ASSOC MaxTRESPerJob exceeded
  380. * (burst buffer) */
  381. WAIT_ASSOC_MAX_BB_PER_NODE, /* ASSOC MaxTRESPerNode exceeded
  382. * (burst buffer) */
  383. WAIT_ASSOC_MAX_BB_MINS_PER_JOB,/* ASSOC MaxTRESMinsPerJob exceeded
  384. * (burst buffer) */
  385. WAIT_QOS_GRP_UNK, /* QOS GrpTRES exceeded (Unknown) */
  386. WAIT_QOS_GRP_UNK_MIN, /* QOS GrpTRESMins exceeded (Unknown) */
  387. WAIT_QOS_GRP_UNK_RUN_MIN, /* QOS GrpTRESRunMins exceeded (Unknown) */
  388. WAIT_QOS_MAX_UNK_PER_JOB, /* QOS MaxTRESPerJob exceeded (Unknown) */
  389. WAIT_QOS_MAX_UNK_PER_NODE, /* QOS MaxTRESPerNode exceeded (Unknown) */
  390. WAIT_QOS_MAX_UNK_PER_USER, /* QOS MaxTRESPerUser exceeded (Unknown) */
  391. WAIT_QOS_MAX_UNK_MINS_PER_JOB,/* QOS MaxTRESMinsPerJob
  392. * exceeded (Unknown) */
  393. WAIT_QOS_MIN_UNK, /* QOS MinTRESPerJob exceeded (Unknown) */
  394. WAIT_QOS_MAX_CPU_PER_NODE, /* QOS MaxTRESPerNode exceeded (CPU) */
  395. WAIT_QOS_GRP_MEM_MIN, /* QOS GrpTRESMins exceeded
  396. * (Memory) */
  397. WAIT_QOS_GRP_MEM_RUN_MIN, /* QOS GrpTRESRunMins exceeded
  398. * (Memory) */
  399. WAIT_QOS_MAX_MEM_MINS_PER_JOB,/* QOS MaxTRESMinsPerJob
  400. * exceeded (Memory) */
  401. WAIT_QOS_MAX_MEM_PER_JOB, /* QOS MaxTRESPerJob exceeded (CPU) */
  402. WAIT_QOS_MAX_MEM_PER_NODE, /* QOS MaxTRESPerNode exceeded (MEM) */
  403. WAIT_QOS_MAX_MEM_PER_USER, /* QOS MaxTRESPerUser exceeded (CPU) */
  404. WAIT_QOS_MIN_MEM, /* QOS MinTRESPerJob not reached (Memory) */
  405. WAIT_QOS_GRP_ENERGY, /* QOS GrpTRES exceeded (Energy) */
  406. WAIT_QOS_GRP_ENERGY_MIN, /* QOS GrpTRESMins exceeded (Energy) */
  407. WAIT_QOS_GRP_ENERGY_RUN_MIN, /* QOS GrpTRESRunMins exceeded (Energy) */
  408. WAIT_QOS_MAX_ENERGY_PER_JOB, /* QOS MaxTRESPerJob exceeded (Energy) */
  409. WAIT_QOS_MAX_ENERGY_PER_NODE,/* QOS MaxTRESPerNode exceeded (Energy) */
  410. WAIT_QOS_MAX_ENERGY_PER_USER,/* QOS MaxTRESPerUser exceeded (Energy) */
  411. WAIT_QOS_MAX_ENERGY_MINS_PER_JOB,/* QOS MaxTRESMinsPerJob
  412. * exceeded (Energy) */
  413. WAIT_QOS_MIN_ENERGY, /* QOS MinTRESPerJob not reached (Energy) */
  414. WAIT_QOS_GRP_NODE_MIN, /* QOS GrpTRESMins exceeded (Node) */
  415. WAIT_QOS_GRP_NODE_RUN_MIN, /* QOS GrpTRESRunMins exceeded (Node) */
  416. WAIT_QOS_MAX_NODE_MINS_PER_JOB, /* QOS MaxTRESMinsPerJob
  417. * exceeded (Node) */
  418. WAIT_QOS_MIN_NODE, /* QOS MinTRESPerJob not reached (Node) */
  419. WAIT_QOS_GRP_GRES, /* QOS GrpTRES exceeded (GRES) */
  420. WAIT_QOS_GRP_GRES_MIN, /* QOS GrpTRESMins exceeded (GRES) */
  421. WAIT_QOS_GRP_GRES_RUN_MIN, /* QOS GrpTRESRunMins exceeded (GRES) */
  422. WAIT_QOS_MAX_GRES_PER_JOB, /* QOS MaxTRESPerJob exceeded (GRES) */
  423. WAIT_QOS_MAX_GRES_PER_NODE, /* QOS MaxTRESPerNode exceeded (GRES) */
  424. WAIT_QOS_MAX_GRES_PER_USER, /* QOS MaxTRESPerUser exceeded
  425. * (GRES) */
  426. WAIT_QOS_MAX_GRES_MINS_PER_JOB,/* QOS MaxTRESMinsPerJob
  427. * exceeded (GRES) */
  428. WAIT_QOS_MIN_GRES, /* QOS MinTRESPerJob not reached (CPU) */
  429. WAIT_QOS_GRP_LIC, /* QOS GrpTRES exceeded (license) */
  430. WAIT_QOS_GRP_LIC_MIN, /* QOS GrpTRESMins exceeded (license) */
  431. WAIT_QOS_GRP_LIC_RUN_MIN, /* QOS GrpTRESRunMins exceeded (license) */
  432. WAIT_QOS_MAX_LIC_PER_JOB, /* QOS MaxTRESPerJob exceeded (license) */
  433. WAIT_QOS_MAX_LIC_PER_USER, /* QOS MaxTRESPerUser exceeded (license) */
  434. WAIT_QOS_MAX_LIC_MINS_PER_JOB,/* QOS MaxTRESMinsPerJob exceeded
  435. * (license) */
  436. WAIT_QOS_MIN_LIC, /* QOS MinTRESPerJob not reached
  437. * (license) */
  438. WAIT_QOS_GRP_BB, /* QOS GrpTRES exceeded
  439. * (burst buffer) */
  440. WAIT_QOS_GRP_BB_MIN, /* QOS GrpTRESMins exceeded
  441. * (burst buffer) */
  442. WAIT_QOS_GRP_BB_RUN_MIN, /* QOS GrpTRESRunMins exceeded
  443. * (burst buffer) */
  444. WAIT_QOS_MAX_BB_PER_JOB, /* QOS MaxTRESPerJob exceeded
  445. * (burst buffer) */
  446. WAIT_QOS_MAX_BB_PER_NODE, /* QOS MaxTRESPerNode exceeded
  447. * (burst buffer) */
  448. WAIT_QOS_MAX_BB_PER_USER, /* QOS MaxTRESPerUser exceeded
  449. * (burst buffer) */
  450. WAIT_QOS_MAX_BB_MINS_PER_JOB,/* QOS MaxTRESMinsPerJob exceeded
  451. * (burst buffer) */
  452. WAIT_QOS_MIN_BB, /* QOS MinTRESPerJob not reached
  453. * (burst buffer) */
  454. FAIL_DEADLINE, /* reached deadline */
  455. /* QOS MaxTRESPerAccount */
  456. WAIT_QOS_MAX_BB_PER_ACCT, /* exceeded burst buffer */
  457. WAIT_QOS_MAX_CPU_PER_ACCT, /* exceeded CPUs */
  458. WAIT_QOS_MAX_ENERGY_PER_ACCT, /* exceeded Energy */
  459. WAIT_QOS_MAX_GRES_PER_ACCT, /* exceeded GRES */
  460. WAIT_QOS_MAX_NODE_PER_ACCT, /* exceeded Nodes */
  461. WAIT_QOS_MAX_LIC_PER_ACCT, /* exceeded Licenses */
  462. WAIT_QOS_MAX_MEM_PER_ACCT, /* exceeded Memory */
  463. WAIT_QOS_MAX_UNK_PER_ACCT, /* exceeded Unknown */
  464. /********************/
  465. WAIT_QOS_MAX_JOB_PER_ACCT, /* QOS MaxJobPerAccount exceeded */
  466. WAIT_QOS_MAX_SUB_JOB_PER_ACCT,/* QOS MaxJobSubmitSPerAccount exceeded */
  467. WAIT_PART_CONFIG, /* Generic partition configuration reason */
  468. WAIT_ACCOUNT_POLICY, /* Generic accounting policy reason */
  469. WAIT_FED_JOB_LOCK, /* Can't get fed job lock */
  470. FAIL_OOM, /* Exhausted memory */
  471. WAIT_PN_MEM_LIMIT, /* MaxMemPer[CPU|Node] exceeded */
  472. /* exceeded Billing TRES limits */
  473. WAIT_ASSOC_GRP_BILLING, /* GrpTRES */
  474. WAIT_ASSOC_GRP_BILLING_MIN, /* GrpTRESMins */
  475. WAIT_ASSOC_GRP_BILLING_RUN_MIN, /* GrpTRESRunMins */
  476. WAIT_ASSOC_MAX_BILLING_PER_JOB, /* MaxTRESPerJob */
  477. WAIT_ASSOC_MAX_BILLING_PER_NODE, /* MaxTRESPerNode */
  478. WAIT_ASSOC_MAX_BILLING_MINS_PER_JOB,/* MaxTRESMinsPerJob */
  479. WAIT_QOS_GRP_BILLING, /* GrpTRES */
  480. WAIT_QOS_GRP_BILLING_MIN, /* GrpTRESMins */
  481. WAIT_QOS_GRP_BILLING_RUN_MIN, /* GrpTRESRunMins */
  482. WAIT_QOS_MAX_BILLING_PER_JOB, /* MaxTRESPerJob */
  483. WAIT_QOS_MAX_BILLING_PER_NODE, /* MaxTRESPerNode */
  484. WAIT_QOS_MAX_BILLING_PER_USER, /* MaxTRESPerUser */
  485. WAIT_QOS_MAX_BILLING_MINS_PER_JOB, /* MaxTRESMinsPerJob */
  486. WAIT_QOS_MAX_BILLING_PER_ACCT, /* MaxTRESPerAcct */
  487. WAIT_QOS_MIN_BILLING, /* MinTRESPerJob */
  488. WAIT_RESV_DELETED /* Reservation was deleted */
  489. };
  490. enum job_acct_types {
  491. JOB_START,
  492. JOB_STEP,
  493. JOB_SUSPEND,
  494. JOB_TERMINATED
  495. };
  496. /* Partition state flags */
  497. #define PARTITION_SUBMIT 0x01 /* Allow job submission to partition */
  498. #define PARTITION_SCHED 0x02 /* Allow job startup from partition */
  499. /* Actual partition states based upon state flags */
  500. #define PARTITION_DOWN (PARTITION_SUBMIT)
  501. #define PARTITION_UP (PARTITION_SUBMIT | PARTITION_SCHED)
  502. #define PARTITION_DRAIN (PARTITION_SCHED)
  503. #define PARTITION_INACTIVE 0x00
  504. /* Partition enforce flags for jobs */
  505. #define PARTITION_ENFORCE_NONE 0
  506. #define PARTITION_ENFORCE_ALL 1 /* job limit must be valid for ALL
  507. * partitions */
  508. #define PARTITION_ENFORCE_ANY 2 /* job limit must be valid for ANY
  509. * partition */
  510. /* Auth plugin (id) used for communication */
  511. enum auth_plugin_type {
  512. AUTH_PLUGIN_NONE = 100,
  513. AUTH_PLUGIN_MUNGE = 101,
  514. AUTH_PLUGIN_JWT = 102,
  515. };
  516. /* Select plugin (id) in use by cluster */
  517. enum select_plugin_type {
  518. /* 100 unused (originally for BlueGene) */
  519. SELECT_PLUGIN_CONS_RES = 101, /* Cons Res on a normal system */
  520. SELECT_PLUGIN_LINEAR = 102, /* Linear on a normal system */
  521. /* 103 unused (originally used for BGQ) */
  522. /* 104 unused (originally used for Cray/ALPS with select/linear) */
  523. /* 105 unused (originally used for Cray/ALPS with select/cons_res) */
  524. SELECT_PLUGIN_SERIAL = 106, /* Serial */
  525. SELECT_PLUGIN_CRAY_LINEAR = 107, /* Linear on a Native Cray */
  526. SELECT_PLUGIN_CRAY_CONS_RES = 108, /* Cons Res on a Native Cray */
  527. SELECT_PLUGIN_CONS_TRES = 109, /* Cons TRES on a normal system */
  528. SELECT_PLUGIN_CRAY_CONS_TRES = 110 /* Cons TRES on a Native Cray */
  529. };
  530. /* switch plugin (id) in use by cluster */
  531. enum switch_plugin_type {
  532. SWITCH_PLUGIN_NONE = 100, /* NONE */
  533. SWITCH_PLUGIN_GENERIC = 101, /* Generic */
  534. SWITCH_PLUGIN_CRAY = 102, /* Cray */
  535. /* 103 unused (originally used for NRT) */
  536. };
  537. enum select_jobdata_type {
  538. SELECT_JOBDATA_PAGG_ID = 14, /* data-> uint64_t job container ID */
  539. SELECT_JOBDATA_PTR = 15, /* data-> select_jobinfo_t *jobinfo */
  540. SELECT_JOBDATA_CLEANING = 22, /* data-> uint16_t if the job is in
  541. * cleaning state or not. */
  542. SELECT_JOBDATA_NETWORK = 23, /* data-> char * network info */
  543. SELECT_JOBDATA_RELEASED = 24, /* if job resources have been released */
  544. };
  545. enum select_nodedata_type {
  546. SELECT_NODEDATA_SUBCNT = 2, /* data-> uint16_t */
  547. SELECT_NODEDATA_PTR = 5, /* data-> select_nodeinfo_t *nodeinfo */
  548. SELECT_NODEDATA_MEM_ALLOC = 8, /* data-> uint32_t */
  549. SELECT_NODEDATA_TRES_ALLOC_FMT_STR = 9, /* data-> char *,
  550. * free with xfree */
  551. SELECT_NODEDATA_TRES_ALLOC_WEIGHTED = 10, /* data-> double */
  552. };
  553. enum select_print_mode {
  554. SELECT_PRINT_HEAD, /* Print just the header */
  555. SELECT_PRINT_DATA, /* Print just the data */
  556. SELECT_PRINT_MIXED, /* Print "field=value" */
  557. SELECT_PRINT_MIXED_SHORT,/* Print less "field=value" */
  558. SELECT_PRINT_BG_ID, /* Print just the BG_ID */
  559. SELECT_PRINT_NODES, /* Print the nodelist */
  560. SELECT_PRINT_CONNECTION,/* Print just the CONNECTION type */
  561. SELECT_PRINT_ROTATE, /* Print just the ROTATE */
  562. SELECT_PRINT_GEOMETRY, /* Print just the GEO */
  563. SELECT_PRINT_START, /* Print just the START location */
  564. SELECT_PRINT_BLRTS_IMAGE,/* Print just the BLRTS IMAGE */
  565. SELECT_PRINT_LINUX_IMAGE,/* Print just the LINUX IMAGE */
  566. SELECT_PRINT_MLOADER_IMAGE,/* Print just the MLOADER IMAGE */
  567. SELECT_PRINT_RAMDISK_IMAGE,/* Print just the RAMDISK IMAGE */
  568. SELECT_PRINT_REBOOT, /* Print just the REBOOT */
  569. SELECT_PRINT_RESV_ID, /* Print just Cray/BASIL reservation ID */
  570. SELECT_PRINT_START_LOC /* Print just the start location */
  571. };
  572. enum select_node_cnt {
  573. SELECT_GET_NODE_SCALING, /* Give scaling factor for node count */
  574. SELECT_GET_NODE_CPU_CNT, /* Give how many cpus are on a node */
  575. SELECT_GET_MP_CPU_CNT, /* Give how many cpus are on a
  576. * base partition */
  577. SELECT_APPLY_NODE_MIN_OFFSET, /* Apply min offset to variable */
  578. SELECT_APPLY_NODE_MAX_OFFSET, /* Apply max offset to variable */
  579. SELECT_SET_NODE_CNT, /* Set altered node cnt */
  580. SELECT_SET_MP_CNT /* Given a node cnt return the
  581. * base partition count */
  582. };
  583. enum acct_gather_profile_info {
  584. ACCT_GATHER_PROFILE_DIR, /* Give directory profiling is stored */
  585. ACCT_GATHER_PROFILE_DEFAULT, /* What is being collected for
  586. * profiling by default */
  587. ACCT_GATHER_PROFILE_RUNNING /* What is actually be collected
  588. * wither it be user or
  589. * default. (Only works in the slurmstepd)
  590. */
  591. };
  592. #define ACCT_GATHER_PROFILE_NOT_SET 0x00000000
  593. #define ACCT_GATHER_PROFILE_NONE 0x00000001
  594. #define ACCT_GATHER_PROFILE_ENERGY 0x00000002
  595. #define ACCT_GATHER_PROFILE_TASK 0x00000004
  596. #define ACCT_GATHER_PROFILE_LUSTRE 0x00000008
  597. #define ACCT_GATHER_PROFILE_NETWORK 0x00000010
  598. #define ACCT_GATHER_PROFILE_ALL 0xffffffff
  599. /* jobacct data types */
  600. enum jobacct_data_type {
  601. JOBACCT_DATA_TOTAL, /* data-> jobacctinfo_t * */
  602. JOBACCT_DATA_PIPE, /* data-> file descriptor */
  603. JOBACCT_DATA_RUSAGE, /* data-> rusage set user_cpu_sec,
  604. * user_cpu_usec, sys_cpu_sec, sys_cpu_usec */
  605. JOBACCT_DATA_TOT_VSIZE = 5, /* data-> uint64_t vsize */
  606. JOBACCT_DATA_TOT_RSS = 8, /* data-> uint64_t psize */
  607. };
  608. enum acct_energy_type {
  609. ENERGY_DATA_JOULES_TASK,
  610. ENERGY_DATA_STRUCT,
  611. ENERGY_DATA_RECONFIG,
  612. ENERGY_DATA_PROFILE,
  613. ENERGY_DATA_LAST_POLL,
  614. ENERGY_DATA_SENSOR_CNT,
  615. ENERGY_DATA_NODE_ENERGY,
  616. ENERGY_DATA_NODE_ENERGY_UP,
  617. ENERGY_DATA_STEP_PTR
  618. };
  619. /*
  620. * Task distribution states/methods
  621. *
  622. * Symbol format is SLURM_DIST_<node>_<socket>_<core>
  623. *
  624. * <node> = Method for distributing tasks to nodes.
  625. * This determines the order in which task ids are
  626. * distributed to the nodes selected for the job/step.
  627. * <socket> = Method for distributing allocated lllps across sockets.
  628. * This determines the order in which allocated lllps are
  629. * distributed across sockets for binding to tasks.
  630. * <core> = Method for distributing allocated lllps across cores.
  631. * This determines the order in which allocated lllps are
  632. * distributed across cores for binding to tasks.
  633. *
  634. * Note that the socket and core distributions apply only to task affinity.
  635. */
  636. typedef enum task_dist_states {
  637. /* NOTE: start SLURM_DIST_CYCLIC at 1 for HP MPI */
  638. SLURM_DIST_CYCLIC = 0x0001,
  639. SLURM_DIST_BLOCK = 0x0002,
  640. SLURM_DIST_ARBITRARY = 0x0003,
  641. SLURM_DIST_PLANE = 0x0004,
  642. SLURM_DIST_CYCLIC_CYCLIC = 0x0011,
  643. SLURM_DIST_CYCLIC_BLOCK = 0x0021,
  644. SLURM_DIST_CYCLIC_CFULL = 0x0031,
  645. SLURM_DIST_BLOCK_CYCLIC = 0x0012,
  646. SLURM_DIST_BLOCK_BLOCK = 0x0022,
  647. SLURM_DIST_BLOCK_CFULL = 0x0032,
  648. SLURM_DIST_CYCLIC_CYCLIC_CYCLIC = 0x0111,
  649. SLURM_DIST_CYCLIC_CYCLIC_BLOCK = 0x0211,
  650. SLURM_DIST_CYCLIC_CYCLIC_CFULL = 0x0311,
  651. SLURM_DIST_CYCLIC_BLOCK_CYCLIC = 0x0121,
  652. SLURM_DIST_CYCLIC_BLOCK_BLOCK = 0x0221,
  653. SLURM_DIST_CYCLIC_BLOCK_CFULL = 0x0321,
  654. SLURM_DIST_CYCLIC_CFULL_CYCLIC = 0x0131,
  655. SLURM_DIST_CYCLIC_CFULL_BLOCK = 0x0231,
  656. SLURM_DIST_CYCLIC_CFULL_CFULL = 0x0331,
  657. SLURM_DIST_BLOCK_CYCLIC_CYCLIC = 0x0112,
  658. SLURM_DIST_BLOCK_CYCLIC_BLOCK = 0x0212,
  659. SLURM_DIST_BLOCK_CYCLIC_CFULL = 0x0312,
  660. SLURM_DIST_BLOCK_BLOCK_CYCLIC = 0x0122,
  661. SLURM_DIST_BLOCK_BLOCK_BLOCK = 0x0222,
  662. SLURM_DIST_BLOCK_BLOCK_CFULL = 0x0322,
  663. SLURM_DIST_BLOCK_CFULL_CYCLIC = 0x0132,
  664. SLURM_DIST_BLOCK_CFULL_BLOCK = 0x0232,
  665. SLURM_DIST_BLOCK_CFULL_CFULL = 0x0332,
  666. SLURM_DIST_NODECYCLIC = 0x0001,
  667. SLURM_DIST_NODEBLOCK = 0x0002,
  668. SLURM_DIST_SOCKCYCLIC = 0x0010,
  669. SLURM_DIST_SOCKBLOCK = 0x0020,
  670. SLURM_DIST_SOCKCFULL = 0x0030,
  671. SLURM_DIST_CORECYCLIC = 0x0100,
  672. SLURM_DIST_COREBLOCK = 0x0200,
  673. SLURM_DIST_CORECFULL = 0x0300,
  674. SLURM_DIST_NO_LLLP = 0x1000,
  675. SLURM_DIST_UNKNOWN = 0x2000
  676. } task_dist_states_t;
  677. #define SLURM_DIST_STATE_BASE 0x00FFFF
  678. #define SLURM_DIST_STATE_FLAGS 0xFF0000
  679. #define SLURM_DIST_PACK_NODES 0x800000
  680. #define SLURM_DIST_NO_PACK_NODES 0x400000
  681. #define SLURM_DIST_NODEMASK 0xF00F
  682. #define SLURM_DIST_SOCKMASK 0xF0F0
  683. #define SLURM_DIST_COREMASK 0xFF00
  684. #define SLURM_DIST_NODESOCKMASK 0xF0FF
  685. /* Open stdout/err file mode, 0 for system default (JobFileAppend) */
  686. #define OPEN_MODE_APPEND 1
  687. #define OPEN_MODE_TRUNCATE 2
  688. typedef enum cpu_bind_type { /* cpu binding type from --cpu-bind=... */
  689. /* verbose can be set with any other flag */
  690. CPU_BIND_VERBOSE = 0x0001, /* =v, */
  691. /* the following auto-binding flags are mutually exclusive */
  692. CPU_BIND_TO_THREADS = 0x0002, /* =threads */
  693. CPU_BIND_TO_CORES = 0x0004, /* =cores */
  694. CPU_BIND_TO_SOCKETS = 0x0008, /* =sockets */
  695. CPU_BIND_TO_LDOMS = 0x0010, /* locality domains */
  696. CPU_BIND_TO_BOARDS = 0x1000, /* =boards */
  697. /* the following manual binding flags are mutually exclusive */
  698. /* CPU_BIND_NONE needs to be the lowest value among manual bindings */
  699. CPU_BIND_NONE = 0x0020, /* =no */
  700. CPU_BIND_RANK = 0x0040, /* =rank */
  701. CPU_BIND_MAP = 0x0080, /* =map_cpu:<list of CPU IDs> */
  702. CPU_BIND_MASK = 0x0100, /* =mask_cpu:<list of CPU masks> */
  703. CPU_BIND_LDRANK = 0x0200, /* =locality domain rank */
  704. CPU_BIND_LDMAP = 0x0400, /* =map_ldom:<list of locality domains> */
  705. CPU_BIND_LDMASK = 0x0800, /* =mask_ldom:<list of ldom masks> */
  706. /* the following is used primarily for the
  707. --hint=nomultithread when -mblock:block is requested. */
  708. CPU_BIND_ONE_THREAD_PER_CORE = 0x2000,/* Only bind to one
  709. * thread of a core */
  710. /* the following is used only as a flag for expressing
  711. * the contents of TaskPluginParams */
  712. CPU_BIND_CPUSETS = 0x8000,
  713. /* default binding if auto binding doesn't match. */
  714. CPU_AUTO_BIND_TO_THREADS = 0x04000,
  715. CPU_AUTO_BIND_TO_CORES = 0x10000,
  716. CPU_AUTO_BIND_TO_SOCKETS = 0x20000,
  717. /* the following is used only as a flag for expressing
  718. * the contents of TaskPluginParams */
  719. SLURMD_OFF_SPEC = 0x40000,
  720. CPU_BIND_OFF = 0x80000 /* Disable binding */
  721. } cpu_bind_type_t;
  722. /* Flag to indicate that cpu_freq is a range: low,medium,high,high-1
  723. * instead of an integer value in kilohertz */
  724. #define CPU_FREQ_RANGE_FLAG 0x80000000
  725. #define CPU_FREQ_LOW 0x80000001
  726. #define CPU_FREQ_MEDIUM 0x80000002
  727. #define CPU_FREQ_HIGH 0x80000003
  728. #define CPU_FREQ_HIGHM1 0x80000004
  729. #define CPU_FREQ_CONSERVATIVE 0x88000000
  730. #define CPU_FREQ_ONDEMAND 0x84000000
  731. #define CPU_FREQ_PERFORMANCE 0x82000000
  732. #define CPU_FREQ_POWERSAVE 0x81000000
  733. #define CPU_FREQ_USERSPACE 0x80800000
  734. #define CPU_FREQ_GOV_MASK 0x8ff00000
  735. /* Vestigial values for transition from v14.11 systems */
  736. #define CPU_FREQ_PERFORMANCE_OLD 0x80000005
  737. #define CPU_FREQ_POWERSAVE_OLD 0x80000006
  738. #define CPU_FREQ_USERSPACE_OLD 0x80000007
  739. #define CPU_FREQ_ONDEMAND_OLD 0x80000008
  740. #define CPU_FREQ_CONSERVATIVE_OLD 0x80000009
  741. typedef enum mem_bind_type { /* memory binding type from --mem-bind=... */
  742. /* verbose can be set with any other flag */
  743. MEM_BIND_VERBOSE= 0x01, /* =v, */
  744. /* the following five manual binding flags are mutually exclusive */
  745. /* MEM_BIND_NONE needs to be the first in this sub-list */
  746. MEM_BIND_NONE = 0x02, /* =no */
  747. MEM_BIND_RANK = 0x04, /* =rank */
  748. MEM_BIND_MAP = 0x08, /* =map_mem:<list of NUMA IDs> */
  749. MEM_BIND_MASK = 0x10, /* =mask_mem:<list of NUMA masks> */
  750. MEM_BIND_LOCAL = 0x20, /* =local */
  751. /* sort and prefer can be set with any other flags */
  752. MEM_BIND_SORT = 0x40, /* =sort */
  753. MEM_BIND_PREFER = 0x80 /* =prefer */
  754. } mem_bind_type_t;
  755. typedef enum accel_bind_type { /* accelerator binding from --accel_bind= */
  756. ACCEL_BIND_VERBOSE = 0x01, /* 'v' verbose */
  757. ACCEL_BIND_CLOSEST_GPU = 0x02, /* 'g' Use closest GPU to the CPU */
  758. ACCEL_BIND_CLOSEST_MIC = 0x04, /* 'm' Use closest NIC to CPU */
  759. ACCEL_BIND_CLOSEST_NIC = 0x08 /* 'n' Use closest NIC to CPU */
  760. } accel_bind_type_t;
  761. /* The last entry in node_states must be STATE_END, keep in sync with
  762. * node_state_string. values may be ORed with NODE_STATE_FLAGS below.
  763. * Node states typically alternate between NODE_STATE_IDLE and
  764. * NODE_STATE_ALLOCATED. The NODE_STATE_COMPLETING flag will be set
  765. * when jobs are in the process of terminating. */
  766. enum node_states {
  767. NODE_STATE_UNKNOWN, /* node's initial state, unknown */
  768. NODE_STATE_DOWN, /* node in non-usable state */
  769. NODE_STATE_IDLE, /* node idle and available for use */
  770. NODE_STATE_ALLOCATED, /* node has been allocated to a job */
  771. NODE_STATE_ERROR, /* UNUSED - node is in an error state */
  772. NODE_STATE_MIXED, /* node has a mixed state */
  773. NODE_STATE_FUTURE, /* node slot reserved for future use */
  774. NODE_STATE_END /* last entry in table */
  775. };
  776. #define NODE_STATE_BASE 0x0000000f
  777. #define NODE_STATE_FLAGS 0xfffffff0
  778. #define NODE_STATE_NET 0x00000010 /* If a node is using Cray's
  779. * Network Performance
  780. * Counters but isn't in a
  781. * allocation. */
  782. #define NODE_STATE_RES 0x00000020 /* If a node is in a
  783. * reservation (used primarily
  784. * to note a node isn't idle
  785. * for non-reservation jobs) */
  786. #define NODE_STATE_UNDRAIN 0x00000040 /* Clear DRAIN flag for a node */
  787. #define NODE_STATE_CLOUD 0x00000080 /* node comes from cloud */
  788. #define NODE_RESUME 0x00000100 /* Restore a DRAINED, DRAINING, DOWN
  789. * or FAILING node to service (e.g.
  790. * IDLE or ALLOCATED). Used in
  791. * slurm_update_node() request */
  792. #define NODE_STATE_DRAIN 0x00000200 /* do not allocated new work */
  793. #define NODE_STATE_COMPLETING 0x00000400 /* node is completing allocated job */
  794. #define NODE_STATE_NO_RESPOND 0x00000800 /* node is not responding */
  795. #define NODE_STATE_POWER_SAVE 0x00001000 /* node is powered down by slurm */
  796. #define NODE_STATE_FAIL 0x00002000 /* node is failing, do not allocate
  797. * new work */
  798. #define NODE_STATE_POWER_UP 0x00004000 /* restore power or otherwise
  799. * configure a node */
  800. #define NODE_STATE_MAINT 0x00008000 /* node in maintenance reservation */
  801. #define NODE_STATE_REBOOT 0x00010000 /* node reboot requested */
  802. #define NODE_STATE_CANCEL_REBOOT 0x00020000 /* cancel pending reboot */
  803. #define NODE_STATE_POWERING_DOWN 0x00040000 /* node is powering down */
  804. /* used to define the size of the credential.signature size
  805. * used to define the key size of the io_stream_header_t
  806. */
  807. #define SLURM_SSL_SIGNATURE_LENGTH 128
  808. /* Used as show_flags for slurm_get_ and slurm_load_ function calls.
  809. * Values can be ORed */
  810. #define SHOW_ALL 0x0001 /* Show info for "hidden" partitions */
  811. #define SHOW_DETAIL 0x0002 /* Show detailed resource information */
  812. /* was SHOW_DETAIL2 0x0004 Removed v19.05 */
  813. #define SHOW_MIXED 0x0008 /* Automatically set node MIXED state */
  814. #define SHOW_LOCAL 0x0010 /* Show only local information, even on
  815. * federated cluster */
  816. #define SHOW_SIBLING 0x0020 /* Show sibling jobs on a federated cluster */
  817. #define SHOW_FEDERATION 0x0040 /* Show federated state information.
  818. * Shows local info if not in federation */
  819. #define SHOW_FUTURE 0x0080 /* Show future nodes */
  820. /* Define keys for ctx_key argument of slurm_step_ctx_get() */
  821. enum ctx_keys {
  822. SLURM_STEP_CTX_STEPID, /* get the created job step id */
  823. SLURM_STEP_CTX_TASKS, /* get array of task count on each node */
  824. SLURM_STEP_CTX_TID, /* get array of task IDs for specified node */
  825. SLURM_STEP_CTX_RESP, /* get job step create response message */
  826. SLURM_STEP_CTX_CRED,
  827. SLURM_STEP_CTX_SWITCH_JOB,
  828. SLURM_STEP_CTX_NUM_HOSTS,
  829. SLURM_STEP_CTX_HOST,
  830. SLURM_STEP_CTX_JOBID,
  831. SLURM_STEP_CTX_USER_MANAGED_SOCKETS,
  832. SLURM_STEP_CTX_NODE_LIST, /* step's node list, must xfree */
  833. SLURM_STEP_CTX_TIDS, /* get array of task IDs for all nodes */
  834. SLURM_STEP_CTX_DEF_CPU_BIND_TYPE
  835. };
  836. /* CR_CPU, CR_SOCKET and CR_CORE are mutually exclusive
  837. * CR_MEMORY may be added to any of the above values or used by itself
  838. * CR_ONE_TASK_PER_CORE may also be added to any of the above values */
  839. #define CR_CPU 0x0001 /* Resources are shared down to the level of
  840. * logical processors which can be socket,
  841. * core, or thread depending on the system. */
  842. #define CR_SOCKET 0x0002 /* Resources are shared down to the socket
  843. * level. Jobs will not be co-allocated
  844. * within a socket. */
  845. #define CR_CORE 0x0004 /* Resources are shared down to the core level.
  846. * Jobs will not be co-allocated within a
  847. * core. */
  848. #define CR_BOARD 0x0008 /* Resources are shared down to the board
  849. * level. Jobs will not be co-allocated
  850. * within a board. */
  851. #define CR_MEMORY 0x0010 /* Memory as consumable resources. Memory is
  852. * not over-commited when selected as a CR. */
  853. #define CR_OTHER_CONS_RES 0x0020 /* if layering select plugins use
  854. * cons_res instead of linear (default)
  855. */
  856. /* was CR_NHC_STEP_NO 0x0040, removed v19.05 */
  857. /* was CR_NHC_NO 0x0080, removed v19.05 */
  858. /* By default, schedule only one task per core.
  859. * Without this option, tasks would be allocated threads. */
  860. #define CR_ONE_TASK_PER_CORE 0x0100
  861. /* Pack tasks tightly onto allocated nodes rather than distributing them evenly
  862. * across available nodes */
  863. #define CR_PACK_NODES 0x0200
  864. /* was CR_NHC_ABSOLUTELY_NO 0x0400, removed v19.05 */
  865. #define CR_OTHER_CONS_TRES 0x0800 /* if layering select plugins use
  866. * cons_tres instead of linear (default)
  867. */
  868. /* By default, distribute cores using a block approach inside the nodes */
  869. #define CR_CORE_DEFAULT_DIST_BLOCK 0x1000
  870. #define CR_LLN 0x4000 /* Select nodes by "least loaded." */
  871. #define MEM_PER_CPU 0x8000000000000000
  872. #define SHARED_FORCE 0x8000
  873. #define PRIVATE_DATA_JOBS 0x0001 /* job/step data is private */
  874. #define PRIVATE_DATA_NODES 0x0002 /* node data is private */
  875. #define PRIVATE_DATA_PARTITIONS 0x0004 /* partition data is private */
  876. #define PRIVATE_DATA_USAGE 0x0008 /* accounting usage data is private */
  877. #define PRIVATE_DATA_USERS 0x0010 /* accounting user data is private */
  878. #define PRIVATE_DATA_ACCOUNTS 0x0020 /* accounting account data is private*/
  879. #define PRIVATE_DATA_RESERVATIONS 0x0040 /* reservation data is private */
  880. #define PRIVATE_CLOUD_NODES 0x0080 /* hide powered down nodes in cloud */
  881. #define PRIVATE_DATA_EVENTS 0x0100 /* events are private */
  882. #define PRIORITY_RESET_NONE 0x0000 /* never clear */
  883. #define PRIORITY_RESET_NOW 0x0001 /* clear now (when slurmctld restarts) */
  884. #define PRIORITY_RESET_DAILY 0x0002 /* clear daily at midnight */
  885. #define PRIORITY_RESET_WEEKLY 0x0003 /* clear weekly at Sunday 00:00 */
  886. #define PRIORITY_RESET_MONTHLY 0x0004 /* clear monthly on first at 00:00 */
  887. #define PRIORITY_RESET_QUARTERLY 0x0005 /* clear quarterly on first at 00:00 */
  888. #define PRIORITY_RESET_YEARLY 0x0006 /* clear yearly on first at 00:00 */
  889. #define PROP_PRIO_OFF 0x0000 /* Do not propagage user nice value */
  890. #define PROP_PRIO_ON 0x0001 /* Propagate user nice value */
  891. #define PROP_PRIO_NICER 0x0002 /* Ensure that user tasks have a nice
  892. * value that is higher than slurmd */
  893. #define PRIORITY_FLAGS_ACCRUE_ALWAYS 0x00000001 /* Flag to always accrue age
  894. * priority to pending jobs
  895. * ignoring dependencies or
  896. * holds */
  897. #define PRIORITY_FLAGS_MAX_TRES 0x00000002 /* Calculate billed_tres as
  898. * the MAX of TRES on a node
  899. * rather than the sum or
  900. * TRES. */
  901. #define PRIORITY_FLAGS_SIZE_RELATIVE 0x00000004 /* Enable job size
  902. * measurement relative to
  903. * its time limit */
  904. #define PRIORITY_FLAGS_DEPTH_OBLIVIOUS 0x00000008 /* Flag to use depth
  905. * oblivious formula for
  906. * computing hierarchical
  907. * fairshare */
  908. #define PRIORITY_FLAGS_CALCULATE_RUNNING 0x00000010 /* Calculate priorities for
  909. * running jobs, not only
  910. * the pending jobs. */
  911. #define PRIORITY_FLAGS_FAIR_TREE 0x00000020 /* Prioritize by level in
  912. * account hierarchy. */
  913. #define PRIORITY_FLAGS_INCR_ONLY 0x00000040 /* Priority can only
  914. * increase, never decrease
  915. * in value */
  916. #define PRIORITY_FLAGS_NO_NORMAL_ASSOC 0x00000080
  917. #define PRIORITY_FLAGS_NO_NORMAL_PART 0x00000100
  918. #define PRIORITY_FLAGS_NO_NORMAL_QOS 0x00000200
  919. #define PRIORITY_FLAGS_NO_NORMAL_TRES 0x00000400
  920. /* These bits are set in the bitflags field of job_desc_msg_t */
  921. #define KILL_INV_DEP 0x00000001 /* Kill job on invalid dependency */
  922. #define NO_KILL_INV_DEP 0x00000002 /* Don't kill job on invalid dependency */
  923. #define HAS_STATE_DIR 0x00000004 /* Used by slurmctld to track state dir */
  924. #define BACKFILL_TEST 0x00000008 /* Backfill test in progress */
  925. #define GRES_ENFORCE_BIND 0x00000010 /* Enforce CPU/GRES binding */
  926. #define TEST_NOW_ONLY 0x00000020 /* Test for immediately start only */
  927. #define NODE_MEM_CALC 0x00000040 /* Per-node memory limit calculated */
  928. #define NODE_REBOOT 0x00000080 /* Waiting for node reboot */
  929. #define SPREAD_JOB 0x00000100 /* Spread job across max node count */
  930. #define USE_MIN_NODES 0x00000200 /* Prefer minimum node count */
  931. #define JOB_KILL_HURRY 0x00000400 /* Avoid burst buffer stage out */
  932. #define TRES_STR_CALC 0x00000800 /* Avoid calculating TRES strings at the
  933. * end of a job. */
  934. #define SIB_JOB_FLUSH 0x00001000 /* Don't send complete to origin */
  935. #define HET_JOB_FLAG 0x00002000 /* Heterogeneous job management flag */
  936. #define JOB_NTASKS_SET 0x00004000 /* --ntasks explicitly set */
  937. #define JOB_CPUS_SET 0x00008000 /* --cpus-per-tasks explicitly set */
  938. #define BF_WHOLE_NODE_TEST 0x00010000 /* Backfill test in progress */
  939. #define TOP_PRIO_TMP 0x00020000 /* Temporary flag for top priority job
  940. * operation */
  941. #define JOB_ACCRUE_OVER 0x00040000 /* We have cleared the accrual count of
  942. * a job. */
  943. #define GRES_DISABLE_BIND 0x00080000 /* Disable CPU/GRES binding */
  944. #define JOB_WAS_RUNNING 0x00100000 /* Job was running */
  945. #define RESET_ACCRUE_TIME 0x00200000 /* Reset the job's accrue time */
  946. /* 0x00400000 Unused */
  947. #define JOB_MEM_SET 0x00800000 /* Memory limit explicity set by job */
  948. #define JOB_RESIZED 0x01000000 /* Running job added/removed nodes */
  949. #define USE_DEFAULT_ACCT 0x02000000 /* Job submitted to default account */
  950. #define USE_DEFAULT_PART 0x04000000 /* Job submitted to default partition */
  951. #define USE_DEFAULT_QOS 0x08000000 /* Job submitted with default QOS */
  952. #define USE_DEFAULT_WCKEY 0x10000000 /* Job submitted with default WCKEY */
  953. #define JOB_DEPENDENT 0x20000000 /* Job dependent or invalid depend */
  954. #define JOB_PROM 0x40000000 /* Job attempting to run in a
  955. * promiscuous reservation */
  956. #define X11_FORWARD_ALL 0x0001 /* all nodes should setup forward */
  957. #define X11_FORWARD_BATCH 0x0002 /* only the batch node */
  958. #define X11_FORWARD_FIRST 0x0004 /* only the first node */
  959. #define X11_FORWARD_LAST 0x0008 /* only the last node */
  960. /*****************************************************************************\
  961. * SLURM HOSTLIST FUNCTIONS
  962. \*****************************************************************************/
  963. /* The hostlist opaque data type
  964. *
  965. * A hostlist is a list of hostnames optimized for a prefixXXXX style
  966. * naming convention, where XXXX is a decimal, numeric suffix.
  967. */
  968. #ifndef __hostlist_t_defined
  969. # define __hostlist_t_defined
  970. typedef struct hostlist * hostlist_t;
  971. #endif
  972. /*
  973. * slurm_hostlist_create():
  974. *
  975. * Create a new hostlist from a string representation.
  976. *
  977. * The string representation (str) may contain one or more hostnames or
  978. * bracketed hostlists separated by either `,' or whitespace. A bracketed
  979. * hostlist is denoted by a common prefix followed by a list of numeric
  980. * ranges contained within brackets: e.g. "tux[0-5,12,20-25]"
  981. *
  982. * To support systems with 3-D topography, a rectangular prism may
  983. * be described using two three digit numbers separated by "x": e.g.
  984. * "bgl[123x456]". This selects all nodes between 1 and 4 inclusive
  985. * in the first dimension, between 2 and 5 in the second, and between
  986. * 3 and 6 in the third dimension for a total of 4*4*4=64 nodes
  987. *
  988. * Note: if this module is compiled with WANT_RECKLESS_HOSTRANGE_EXPANSION
  989. * defined, a much more loose interpretation of host ranges is used.
  990. * Reckless hostrange expansion allows all of the following (in addition to
  991. * bracketed hostlists):
  992. *
  993. * o tux0-5,tux12,tux20-25
  994. * o tux0-tux5,tux12,tux20-tux25
  995. * o tux0-5,12,20-25
  996. *
  997. * If str is NULL, and empty hostlist is created and returned.
  998. *
  999. * If the create fails, hostlist_create() returns NULL.
  1000. *
  1001. * The returned hostlist must be freed with hostlist_destroy()
  1002. *
  1003. */
  1004. extern hostlist_t slurm_hostlist_create(const char *hostlist);
  1005. /* slurm_hostlist_count():
  1006. *
  1007. * Return the number of hosts in hostlist hl.
  1008. */
  1009. extern int slurm_hostlist_count(hostlist_t hl);
  1010. /*
  1011. * slurm_hostlist_destroy():
  1012. *
  1013. * Destroy a hostlist object. Frees all memory allocated to the hostlist.
  1014. */
  1015. extern void slurm_hostlist_destroy(hostlist_t hl);
  1016. /* slurm_hostlist_find():
  1017. *
  1018. * Searches hostlist hl for the first host matching hostname
  1019. * and returns position in list if found.
  1020. *
  1021. * Returns -1 if host is not found.
  1022. */
  1023. extern int slurm_hostlist_find(hostlist_t hl, const char *hostname);
  1024. /* slurm_hostlist_push():
  1025. *
  1026. * push a string representation of hostnames onto a hostlist.
  1027. *
  1028. * The hosts argument may take the same form as in slurm_hostlist_create()
  1029. *
  1030. * Returns the number of hostnames inserted into the list,
  1031. * or 0 on failure.
  1032. */
  1033. extern int slurm_hostlist_push(hostlist_t hl, const char *hosts);
  1034. /* slurm_hostlist_push_host():
  1035. *
  1036. * Push a single host onto the hostlist hl.
  1037. * This function is more efficient than slurm_hostlist_push() for a single
  1038. * hostname, since the argument does not need to be checked for ranges.
  1039. *
  1040. * return value is 1 for success, 0 for failure.
  1041. */
  1042. extern int slurm_hostlist_push_host(hostlist_t hl, const char *host);
  1043. /* slurm_hostlist_ranged_string():
  1044. *
  1045. * Write the string representation of the hostlist hl into buf,
  1046. * writing at most n chars. Returns the number of bytes written,
  1047. * or -1 if truncation occurred.
  1048. *
  1049. * The result will be NULL terminated.
  1050. *
  1051. * slurm_hostlist_ranged_string() will write a bracketed hostlist representation
  1052. * where possible.
  1053. */
  1054. extern ssize_t slurm_hostlist_ranged_string(hostlist_t hl, size_t n, char *buf);
  1055. /* slurm_hostlist_ranged_string_malloc():
  1056. *
  1057. * Return the string representation of the hostlist hl.
  1058. *
  1059. * The result must be released using free();
  1060. */
  1061. extern char *slurm_hostlist_ranged_string_malloc(hostlist_t hl);
  1062. /* hostlist_ranged_string_xmalloc():
  1063. *
  1064. * Wrapper of hostlist_ranged_string(), with result buffer dynamically
  1065. * allocated using xmalloc().
  1066. * The result will be NULL on failure (out of memory).
  1067. *
  1068. * Caller should free the result string using xfree().
  1069. */
  1070. extern char *slurm_hostlist_ranged_string_xmalloc(hostlist_t hl);
  1071. /*
  1072. * slurm_hostlist_shift():
  1073. *
  1074. * Returns the string representation of the first host in the hostlist
  1075. * or NULL if the hostlist is empty or there was an error allocating memory.
  1076. * The host is removed from the hostlist.
  1077. *
  1078. * Note: Caller is responsible for freeing the returned memory.
  1079. */
  1080. extern char *slurm_hostlist_shift(hostlist_t hl);
  1081. /* slurm_hostlist_uniq():
  1082. *
  1083. * Sort the hostlist hl and remove duplicate entries.
  1084. *
  1085. */
  1086. extern void slurm_hostlist_uniq(hostlist_t hl);
  1087. /*****************************************************************************\
  1088. * SLURM LIST FUNCTIONS
  1089. \*****************************************************************************/
  1090. #ifndef __list_datatypes_defined
  1091. # define __list_datatypes_defined
  1092. typedef struct xlist * List;
  1093. /*
  1094. * List opaque data type.
  1095. */
  1096. typedef struct listIterator * ListIterator;
  1097. /*
  1098. * List Iterator opaque data type.
  1099. */
  1100. typedef void (*ListDelF) (void *x);
  1101. /*
  1102. * Function prototype to deallocate data stored in a list.
  1103. * This function is responsible for freeing all memory associated
  1104. * with an item, including all subordinate items (if applicable).
  1105. */
  1106. typedef int (*ListCmpF) (void *x, void *y);
  1107. /*
  1108. * Function prototype for comparing two items in a list.
  1109. * Returns less-than-zero if (x<y), zero if (x==y), and
  1110. * greather-than-zero if (x>y).
  1111. */
  1112. typedef int (*ListFindF) (void *x, void *key);
  1113. /*
  1114. * Function prototype for matching items in a list.
  1115. * Returns non-zero if (x==key); o/w returns zero.
  1116. */
  1117. typedef int (*ListForF) (void *x, void *arg);
  1118. /*
  1119. * Function prototype for operating on each item in a list.
  1120. * Returns less-than-zero on error.
  1121. */
  1122. #endif
  1123. /* slurm_list_append():
  1124. *
  1125. * Inserts data [x] at the end of list [l].
  1126. * Returns the data's ptr.
  1127. */
  1128. extern void *slurm_list_append(List l, void *x);
  1129. /* slurm_list_count():
  1130. *
  1131. * Returns the number of items in list [l].
  1132. */
  1133. extern int slurm_list_count(List l);
  1134. /* slurm_list_create():
  1135. *
  1136. * Creates and returns a new empty list.
  1137. * The deletion function [f] is used to deallocate memory used by items
  1138. * in the list; if this is NULL, memory associated with these items
  1139. * will not be freed when the list is destroyed.
  1140. * Note: Abandoning a list without calling slurm_list_destroy() will result
  1141. * in a memory leak.
  1142. */
  1143. extern List slurm_list_create(ListDelF f);
  1144. /* slurm_list_destroy():
  1145. *
  1146. * Destroys list [l], freeing memory used for list iterators and the
  1147. * list itself; if a deletion function was specified when the list
  1148. * was created, it will be called for each item in the list.
  1149. */
  1150. extern void slurm_list_destroy(List l);
  1151. /* slurm_list_find():
  1152. *
  1153. * Traverses the list from the point of the list iterator [i]
  1154. * using [f] to match each item with [key].
  1155. * Returns a ptr to the next item for which the function [f]
  1156. * returns non-zero, or NULL once the end of the list is reached.
  1157. * Example: i=slurm_list_iterator_reset(i);
  1158. * while ((x=slurm_list_find(i,f,k))) {...}
  1159. */
  1160. extern void *slurm_list_find(ListIterator i, ListFindF f, void *key);
  1161. /* slurm_list_is_empty():
  1162. *
  1163. * Returns non-zero if list [l] is empty; o/w returns zero.
  1164. */
  1165. extern int slurm_list_is_empty(List l);
  1166. /*
  1167. * Creates and returns a list iterator for non-destructively traversing
  1168. * list [l].
  1169. */
  1170. extern ListIterator slurm_list_iterator_create(List l);
  1171. /* slurm_list_iterator_reset():
  1172. *
  1173. * Resets the list iterator [i] to start traversal at the beginning
  1174. * of the list.
  1175. */
  1176. extern void slurm_list_iterator_reset(ListIterator i);
  1177. /*
  1178. * Destroys the list iterator [i]; list iterators not explicitly destroyed
  1179. * in this manner will be destroyed when the list is deallocated via
  1180. * list_destroy().
  1181. */
  1182. extern void slurm_list_iterator_destroy(ListIterator i);
  1183. /* slurm_list_next():
  1184. *
  1185. * Returns a ptr to the next item's data,
  1186. * or NULL once the end of the list is reached.
  1187. * Example: i=slurm_list_iterator_create(i);
  1188. * while ((x=slurm_list_next(i))) {...}
  1189. */
  1190. extern void *slurm_list_next(ListIterator i);
  1191. /* slurm_list_sort():
  1192. *
  1193. * Sorts list [l] into ascending order according to the function [f].
  1194. * Note: Sorting a list resets all iterators associated with the list.
  1195. * Note: The sort algorithm is stable.
  1196. */
  1197. extern void slurm_list_sort(List l, ListCmpF f);
  1198. /* slurm_list_pop():
  1199. *
  1200. * Pops the data item at the top of the stack [l].
  1201. * Returns the data's ptr, or NULL if the stack is empty.
  1202. */
  1203. extern void *slurm_list_pop(List l);
  1204. /*****************************************************************************\
  1205. * SLURM BITSTR FUNCTIONS
  1206. \*****************************************************************************/
  1207. #ifndef __bitstr_datatypes_defined
  1208. # define __bitstr_datatypes_defined
  1209. typedef int64_t bitstr_t;
  1210. #define BITSTR_SHIFT BITSTR_SHIFT_WORD64
  1211. typedef bitstr_t bitoff_t;
  1212. #endif
  1213. #define ALLOC_SID_ADMIN_HOLD 0x00000001 /* admin job hold */
  1214. #define ALLOC_SID_USER_HOLD 0x00000002 /* user job hold */
  1215. #define JOB_SHARED_NONE 0x0000
  1216. #define JOB_SHARED_OK 0x0001
  1217. #define JOB_SHARED_USER 0x0002
  1218. #define JOB_SHARED_MCS 0x0003
  1219. #define SLURM_POWER_FLAGS_LEVEL 0x0001 /* Equal power cap on all nodes */
  1220. /*****************************************************************************\
  1221. * PROTOCOL DATA STRUCTURE DEFINITIONS
  1222. \*****************************************************************************/
  1223. typedef struct dynamic_plugin_data {
  1224. void *data;
  1225. uint32_t plugin_id;
  1226. } dynamic_plugin_data_t;
  1227. typedef struct acct_gather_energy {
  1228. uint32_t ave_watts; /* average power consump of node, in watts */
  1229. uint64_t base_consumed_energy;
  1230. uint64_t consumed_energy; /* total energy consumed by node, in joules */
  1231. uint32_t current_watts; /* current power consump of node, in watts */
  1232. uint64_t previous_consumed_energy;
  1233. time_t poll_time; /* When information was last retrieved */
  1234. } acct_gather_energy_t;
  1235. typedef struct ext_sensors_data {
  1236. uint64_t consumed_energy; /* total energy consumed, in joules */
  1237. uint32_t temperature; /* temperature, in celsius */
  1238. time_t energy_update_time; /* last update time for consumed_energy */
  1239. uint32_t current_watts; /* current power consumption, in watts */
  1240. } ext_sensors_data_t;
  1241. typedef struct power_mgmt_data {
  1242. uint32_t cap_watts; /* power consumption limit of node, in watts */
  1243. uint32_t current_watts; /* current power consumption, in watts */
  1244. uint64_t joule_counter; /* total energy consumption by node, in joules */
  1245. uint32_t new_cap_watts; /* new power consumption limit of node, in watts */
  1246. uint32_t max_watts; /* maximum power consumption by node, in watts */
  1247. uint32_t min_watts; /* minimum power consumption by node, in watts */
  1248. time_t new_job_time; /* set when a new job has been scheduled on the
  1249. * node, used to trigger higher cap */
  1250. uint16_t state; /* Power state information */
  1251. uint64_t time_usec; /* Data timestamp in microseconds since start
  1252. * of the day */
  1253. } power_mgmt_data_t;
  1254. #define CORE_SPEC_THREAD 0x8000 /* If set, this is a thread count not core count */
  1255. /*
  1256. * Update:
  1257. * _copy_job_desc_to_job_record()
  1258. * slurm_free_job_desc_msg()
  1259. */
  1260. typedef struct job_descriptor { /* For submit, allocate, and update requests */
  1261. char *account; /* charge to specified account */
  1262. char *acctg_freq; /* accounting polling intervals (seconds) */
  1263. char *admin_comment; /* administrator's arbitrary comment (update only) */
  1264. char *alloc_node; /* node making resource allocation request
  1265. * NOTE: Normally set by slurm_submit* or
  1266. * slurm_allocate* function */
  1267. uint16_t alloc_resp_port; /* port to send allocation confirmation to */
  1268. uint32_t alloc_sid; /* local sid making resource allocation request
  1269. * NOTE: Normally set by slurm_submit* or
  1270. * slurm_allocate* function
  1271. * NOTE: Also used for update flags, see
  1272. * ALLOC_SID_* flags */
  1273. uint32_t argc; /* number of arguments to the script */
  1274. char **argv; /* arguments to the script */
  1275. char *array_inx; /* job array index values */
  1276. void *array_bitmap; /* NOTE: Set by slurmctld */
  1277. char *batch_features; /* features required for batch script's node */
  1278. time_t begin_time; /* delay initiation until this time */
  1279. uint32_t bitflags; /* bitflags */
  1280. char *burst_buffer; /* burst buffer specifications */
  1281. char *clusters; /* cluster names used for multi-cluster jobs */
  1282. char *cluster_features; /* required cluster feature specification,
  1283. * default NONE */
  1284. char *comment; /* arbitrary comment */
  1285. uint16_t contiguous; /* 1 if job requires contiguous nodes,
  1286. * 0 otherwise,default=0 */
  1287. uint16_t core_spec; /* specialized core/thread count,
  1288. * see CORE_SPEC_THREAD */
  1289. char *cpu_bind; /* binding map for map/mask_cpu - This
  1290. * currently does not matter to the
  1291. * job allocation, setting this does
  1292. * not do anything for steps. */
  1293. uint16_t cpu_bind_type; /* see cpu_bind_type_t - This
  1294. * currently does not matter to the
  1295. * job allocation, setting this does
  1296. * not do anything for steps. */
  1297. uint32_t cpu_freq_min; /* Minimum cpu frequency */
  1298. uint32_t cpu_freq_max; /* Maximum cpu frequency */
  1299. uint32_t cpu_freq_gov; /* cpu frequency governor */
  1300. char *cpus_per_tres; /* semicolon delimited list of TRES=# values */
  1301. time_t deadline; /* deadline */
  1302. uint32_t delay_boot; /* delay boot for desired node state */
  1303. char *dependency; /* synchronize job execution with other jobs */
  1304. time_t end_time; /* time by which job must complete, used for
  1305. * job update only now, possible deadline
  1306. * scheduling in the future */
  1307. char **environment; /* environment variables to set for job,
  1308. * name=value pairs, one per line */
  1309. uint32_t env_size; /* element count in environment */
  1310. char *extra; /* unused */
  1311. char *exc_nodes; /* comma separated list of nodes excluded
  1312. * from job's allocation, default NONE */
  1313. char *features; /* required feature specification,
  1314. * default NONE */
  1315. uint64_t fed_siblings_active; /* Bitmap of active fed sibling ids */
  1316. uint64_t fed_siblings_viable; /* Bitmap of viable fed sibling ids */
  1317. uint32_t group_id; /* group to assume, if run as root. */
  1318. uint32_t het_job_offset; /* HetJob component offset */
  1319. uint16_t immediate; /* 1 if allocate to run or fail immediately,
  1320. * 0 if to be queued awaiting resources */
  1321. uint32_t job_id; /* job ID, default set by Slurm */
  1322. char * job_id_str; /* string representation of the jobid */
  1323. uint16_t kill_on_node_fail; /* 1 if node failure to kill job,
  1324. * 0 otherwise,default=1 */
  1325. char *licenses; /* licenses required by the job */
  1326. uint16_t mail_type; /* see MAIL_JOB_ definitions above */
  1327. char *mail_user; /* user to receive notification */
  1328. char *mcs_label; /* mcs_label if mcs plugin in use */
  1329. char *mem_bind; /* binding map for map/mask_cpu */
  1330. uint16_t mem_bind_type; /* see mem_bind_type_t */
  1331. char *mem_per_tres; /* semicolon delimited list of TRES=# values */
  1332. char *name; /* name of the job, default "" */
  1333. char *network; /* network use spec */
  1334. uint32_t nice; /* requested priority change,
  1335. * NICE_OFFSET == no change */
  1336. uint32_t num_tasks; /* number of tasks to be started,
  1337. * for batch only */
  1338. uint8_t open_mode; /* out/err open mode truncate or append,
  1339. * see OPEN_MODE_* */
  1340. char *origin_cluster; /* cluster name that initiated the job. */
  1341. uint16_t other_port; /* port to send various notification msg to */
  1342. uint8_t overcommit; /* over subscribe resources, for batch only */
  1343. char *partition; /* name of requested partition,
  1344. * default in Slurm config */
  1345. uint16_t plane_size; /* plane size when task_dist =
  1346. SLURM_DIST_PLANE */
  1347. uint8_t power_flags; /* power management flags,
  1348. * see SLURM_POWER_FLAGS_ */
  1349. uint32_t priority; /* relative priority of the job,
  1350. * explicitly set only for user root,
  1351. * 0 == held (don't initiate) */
  1352. uint32_t profile; /* Level of acct_gather_profile {all | none} */
  1353. char *qos; /* Quality of Service */
  1354. uint16_t reboot; /* force node reboot before startup */
  1355. char *resp_host; /* NOTE: Set by slurmctld */
  1356. uint16_t restart_cnt; /* count of job restarts */
  1357. char *req_nodes; /* comma separated list of required nodes
  1358. * default NONE */
  1359. uint16_t requeue; /* enable or disable job requeue option */
  1360. char *reservation; /* name of reservation to use */
  1361. char *script; /* the actual job script, default NONE */
  1362. void *script_buf; /* job script as mmap buf */
  1363. uint16_t shared; /* 2 if the job can only share nodes with other
  1364. * jobs owned by that user,
  1365. * 1 if job can share nodes with other jobs,
  1366. * 0 if job needs exclusive access to the node,
  1367. * or NO_VAL to accept the system default.
  1368. * SHARED_FORCE to eliminate user control. */
  1369. uint32_t site_factor; /* factor to consider in priority */
  1370. char **spank_job_env; /* environment variables for job prolog/epilog
  1371. * scripts as set by SPANK plugins */
  1372. uint32_t spank_job_env_size; /* element count in spank_env */
  1373. uint32_t task_dist; /* see enum task_dist_state */
  1374. uint32_t time_limit; /* maximum run time in minutes, default is
  1375. * partition limit */
  1376. uint32_t time_min; /* minimum run time in minutes, default is
  1377. * time_limit */
  1378. char *tres_bind; /* Task to TRES binding directives */
  1379. char *tres_freq; /* TRES frequency directives */
  1380. char *tres_per_job; /* semicolon delimited list of TRES=# values */
  1381. char *tres_per_node; /* semicolon delimited list of TRES=# values */
  1382. char *tres_per_socket; /* semicolon delimited list of TRES=# values */
  1383. char *tres_per_task; /* semicolon delimited list of TRES=# values */
  1384. uint32_t user_id; /* set only if different from current UID,
  1385. * can only be explicitly set by user root */
  1386. uint16_t wait_all_nodes;/* 0 to start job immediately after allocation
  1387. * 1 to start job after all nodes booted
  1388. * or NO_VAL to use system default */
  1389. uint16_t warn_flags; /* flags related to job signals
  1390. * (eg. KILL_JOB_BATCH) */
  1391. uint16_t warn_signal; /* signal to send when approaching end time */
  1392. uint16_t warn_time; /* time before end to send signal (seconds) */
  1393. char *work_dir; /* pathname of working directory */
  1394. /* job constraints: */
  1395. uint16_t cpus_per_task; /* number of processors required for
  1396. * each task */
  1397. uint32_t min_cpus; /* minimum number of processors required,
  1398. * default=0 */
  1399. uint32_t max_cpus; /* maximum number of processors required,
  1400. * default=0 */
  1401. uint32_t min_nodes; /* minimum number of nodes required by job,
  1402. * default=0 */
  1403. uint32_t max_nodes; /* maximum number of nodes usable by job,
  1404. * default=0 */
  1405. uint16_t boards_per_node; /* boards per node required by job */
  1406. uint16_t sockets_per_board;/* sockets per board required by job */
  1407. uint16_t sockets_per_node;/* sockets per node required by job */
  1408. uint16_t cores_per_socket;/* cores per socket required by job */
  1409. uint16_t threads_per_core;/* threads per core required by job */
  1410. uint16_t ntasks_per_node;/* number of tasks to invoke on each node */
  1411. uint16_t ntasks_per_socket;/* number of tasks to invoke on
  1412. * each socket */
  1413. uint16_t ntasks_per_core;/* number of tasks to invoke on each core */
  1414. uint16_t ntasks_per_board;/* number of tasks to invoke on each board */
  1415. uint16_t pn_min_cpus; /* minimum # CPUs per node, default=0 */
  1416. uint64_t pn_min_memory; /* minimum real memory per node OR
  1417. * real memory per CPU | MEM_PER_CPU,
  1418. * default=0 (no limit) */
  1419. uint32_t pn_min_tmp_disk;/* minimum tmp disk per node,
  1420. * default=0 */
  1421. uint32_t req_switch; /* Minimum number of switches */
  1422. dynamic_plugin_data_t *select_jobinfo; /* opaque data type,
  1423. * Slurm internal use only */
  1424. char *std_err; /* pathname of stderr */
  1425. char *std_in; /* pathname of stdin */
  1426. char *std_out; /* pathname of stdout */
  1427. uint64_t *tres_req_cnt; /* used internally in the slurmctld,
  1428. DON'T PACK */
  1429. uint32_t wait4switch; /* Maximum time to wait for minimum switches */
  1430. char *wckey; /* wckey for job */
  1431. uint16_t x11; /* --x11 flags */
  1432. char *x11_magic_cookie; /* automatically stolen from submit node */
  1433. char *x11_target; /* target hostname, or unix socket if port == 0 */
  1434. uint16_t x11_target_port; /* target tcp port, 6000 + the display number */
  1435. } job_desc_msg_t;
  1436. typedef struct job_info {
  1437. char *account; /* charge to specified account */
  1438. time_t accrue_time; /* time job is eligible for running */
  1439. char *admin_comment; /* administrator's arbitrary comment */
  1440. char *alloc_node; /* local node making resource alloc */
  1441. uint32_t alloc_sid; /* local sid making resource alloc */
  1442. void *array_bitmap; /* NOTE: set on unpack */
  1443. uint32_t array_job_id; /* job_id of a job array or 0 if N/A */
  1444. uint32_t array_task_id; /* task_id of a job array */
  1445. uint32_t array_max_tasks; /* Maximum number of running tasks */
  1446. char *array_task_str; /* string expression of task IDs in this record */
  1447. uint32_t assoc_id; /* association id for job */
  1448. char *batch_features; /* features required for batch script's node */
  1449. uint16_t batch_flag; /* 1 if batch: queued job with script */
  1450. char *batch_host; /* name of host running batch script */
  1451. uint32_t bitflags; /* Various job flags */
  1452. uint16_t boards_per_node; /* boards per node required by job */
  1453. char *burst_buffer; /* burst buffer specifications */
  1454. char *burst_buffer_state; /* burst buffer state info */
  1455. char *cluster; /* name of cluster that the job is on */
  1456. char *cluster_features; /* comma separated list of required cluster
  1457. * features */
  1458. char *command; /* command to be executed, built from submitted
  1459. * job's argv and NULL for salloc command */
  1460. char *comment; /* arbitrary comment */
  1461. uint16_t contiguous; /* 1 if job requires contiguous nodes */
  1462. uint16_t core_spec; /* specialized core count */
  1463. uint16_t cores_per_socket; /* cores per socket required by job */
  1464. double billable_tres; /* billable TRES cache. updated upon resize */
  1465. uint16_t cpus_per_task; /* number of processors required for
  1466. * each task */
  1467. uint32_t cpu_freq_min; /* Minimum cpu frequency */
  1468. uint32_t cpu_freq_max; /* Maximum cpu frequency */
  1469. uint32_t cpu_freq_gov; /* cpu frequency governor */
  1470. char *cpus_per_tres; /* semicolon delimited list of TRES=# values */
  1471. time_t deadline; /* deadline */
  1472. uint32_t delay_boot; /* delay boot for desired node state */
  1473. char *dependency; /* synchronize job execution with other jobs */
  1474. uint32_t derived_ec; /* highest exit code of all job steps */
  1475. time_t eligible_time; /* time job is eligible for running */
  1476. time_t end_time; /* time of termination, actual or expected */
  1477. char *exc_nodes; /* comma separated list of excluded nodes */
  1478. int32_t *exc_node_inx; /* excluded list index pairs into node_table:
  1479. * start_range_1, end_range_1,
  1480. * start_range_2, .., -1 */
  1481. uint32_t exit_code; /* exit code for job (status from wait call) */
  1482. char *features; /* comma separated list of required features */
  1483. char *fed_origin_str; /* Origin cluster's name */
  1484. uint64_t fed_siblings_active; /* bitmap of active fed sibling ids */
  1485. char *fed_siblings_active_str; /* string of active sibling names */
  1486. uint64_t fed_siblings_viable; /* bitmap of viable fed sibling ids */
  1487. char *fed_siblings_viable_str; /* string of viable sibling names */
  1488. uint32_t gres_detail_cnt; /* Count of gres_detail_str records,
  1489. * one per allocated node */
  1490. char **gres_detail_str; /* Details of GRES count/index alloc per node */
  1491. char *gres_total; /* Total count of gres used with names */
  1492. uint32_t group_id; /* group job submitted as */
  1493. uint32_t het_job_id; /* job ID of hetjob leader */
  1494. char *het_job_id_set; /* job IDs for all components */
  1495. uint32_t het_job_offset; /* HetJob component offset from leader */
  1496. uint32_t job_id; /* job ID */
  1497. job_resources_t *job_resrcs; /* opaque data type, job resources */
  1498. uint32_t job_state; /* state of the job, see enum job_states */
  1499. time_t last_sched_eval; /* last time job was evaluated for scheduling */
  1500. char *licenses; /* licenses required by the job */
  1501. uint16_t mail_type; /* see MAIL_JOB_ definitions above */
  1502. char *mail_user; /* user to receive notification */
  1503. uint32_t max_cpus; /* maximum number of cpus usable by job */
  1504. uint32_t max_nodes; /* maximum number of nodes usable by job */
  1505. char *mcs_label; /* mcs_label if mcs plugin in use */
  1506. char *mem_per_tres; /* semicolon delimited list of TRES=# values */
  1507. char *name; /* name of the job */
  1508. char *network; /* network specification */
  1509. char *nodes; /* list of nodes allocated to job */
  1510. uint32_t nice; /* requested priority change */
  1511. int32_t *node_inx; /* list index pairs into node_table for *nodes:
  1512. * start_range_1, end_range_1,
  1513. * start_range_2, .., -1 */
  1514. uint16_t ntasks_per_core;/* number of tasks to invoke on each core */
  1515. uint16_t ntasks_per_node;/* number of tasks to invoke on each node */
  1516. uint16_t ntasks_per_socket;/* number of tasks to invoke on each socket*/
  1517. uint16_t ntasks_per_board; /* number of tasks to invoke on each board */
  1518. uint32_t num_cpus; /* minimum number of cpus required by job */
  1519. uint32_t num_nodes; /* minimum number of nodes required by job */
  1520. uint32_t num_tasks; /* requested task count */
  1521. char *partition; /* name of assigned partition */
  1522. uint64_t pn_min_memory; /* minimum real memory per node, default=0 */
  1523. uint16_t pn_min_cpus; /* minimum # CPUs per node, default=0 */
  1524. uint32_t pn_min_tmp_disk; /* minimum tmp disk per node, default=0 */
  1525. uint8_t power_flags; /* power management flags,
  1526. * see SLURM_POWER_FLAGS_ */
  1527. time_t preempt_time; /* preemption signal time */
  1528. time_t preemptable_time;/* job becomes preemptable from
  1529. * PreemptExemptTime */
  1530. time_t pre_sus_time; /* time job ran prior to last suspend */
  1531. uint32_t priority; /* relative priority of the job,
  1532. * 0=held, 1=required nodes DOWN/DRAINED */
  1533. uint32_t profile; /* Level of acct_gather_profile {all | none} */
  1534. char *qos; /* Quality of Service */
  1535. uint8_t reboot; /* node reboot requested before start */
  1536. char *req_nodes; /* comma separated list of required nodes */
  1537. int32_t *req_node_inx; /* required list index pairs into node_table:
  1538. * start_range_1, end_range_1,
  1539. * start_range_2, .., -1 */
  1540. uint32_t req_switch; /* Minimum number of switches */
  1541. uint16_t requeue; /* enable or disable job requeue option */
  1542. time_t resize_time; /* time of latest size change */
  1543. uint16_t restart_cnt; /* count of job restarts */
  1544. char *resv_name; /* reservation name */
  1545. char *sched_nodes; /* list of nodes scheduled to be used for job */
  1546. dynamic_plugin_data_t *select_jobinfo; /* opaque data type,
  1547. * process using
  1548. * slurm_get_select_jobinfo()
  1549. */
  1550. uint16_t shared; /* 1 if job can share nodes with other jobs */
  1551. uint16_t show_flags; /* conveys level of details requested */
  1552. uint32_t site_factor; /* factor to consider in priority */
  1553. uint16_t sockets_per_board;/* sockets per board required by job */
  1554. uint16_t sockets_per_node; /* sockets per node required by job */
  1555. time_t start_time; /* time execution begins, actual or expected */
  1556. uint16_t start_protocol_ver; /* Slurm version step was started with
  1557. * either srun or the lowest slurmd version
  1558. * it is talking to */
  1559. char *state_desc; /* optional details for state_reason */
  1560. uint16_t state_reason; /* reason job still pending or failed, see
  1561. * slurm.h:enum job_state_reason */
  1562. char *std_err; /* pathname of job's stderr file */
  1563. char *std_in; /* pathname of job's stdin file */
  1564. char *std_out; /* pathname of job's stdout file */
  1565. time_t submit_time; /* time of job submission */
  1566. time_t suspend_time; /* time job last suspended or resumed */
  1567. char *system_comment; /* slurmctld's arbitrary comment */
  1568. uint32_t time_limit; /* maximum run time in minutes or INFINITE */
  1569. uint32_t time_min; /* minimum run time in minutes or INFINITE */
  1570. uint16_t threads_per_core; /* threads per core required by job */
  1571. char *tres_bind; /* Task to TRES binding directives */
  1572. char *tres_freq; /* TRES frequency directives */
  1573. char *tres_per_job; /* semicolon delimited list of TRES=# values */
  1574. char *tres_per_node; /* semicolon delimited list of TRES=# values */
  1575. char *tres_per_socket; /* semicolon delimited list of TRES=# values */
  1576. char *tres_per_task; /* semicolon delimited list of TRES=# values */
  1577. char *tres_req_str; /* tres reqeusted in the job */
  1578. char *tres_alloc_str; /* tres used in the job */
  1579. uint32_t user_id; /* user the job runs as */
  1580. char *user_name; /* user_name or null. not always set, but
  1581. * accurate if set (and can avoid a local
  1582. * lookup call) */
  1583. uint32_t wait4switch; /* Maximum time to wait for minimum switches */
  1584. char *wckey; /* wckey for job */
  1585. char *work_dir; /* pathname of working directory */
  1586. } slurm_job_info_t;
  1587. typedef struct priority_factors_object {
  1588. char *cluster_name; /* Cluster name ONLY set in federation */
  1589. uint32_t job_id;
  1590. char *partition;
  1591. uint32_t user_id;
  1592. double priority_age;
  1593. double priority_assoc;
  1594. double priority_fs;
  1595. double priority_js;
  1596. double priority_part;
  1597. double priority_qos;
  1598. double direct_prio; /* manually set priority */
  1599. uint32_t priority_site;
  1600. double *priority_tres;/* tres priorities with weights applied. */
  1601. uint32_t tres_cnt; /* number of configured tres' on system. */
  1602. char **tres_names; /* packed as assoc_mgr_tres_names[] */
  1603. double *tres_weights; /* PriorityWeightTRES weights as an array */
  1604. uint32_t nice;
  1605. } priority_factors_object_t;
  1606. typedef struct priority_factors_response_msg {
  1607. List priority_factors_list; /* priority_factors_object_t list */
  1608. } priority_factors_response_msg_t;
  1609. #ifndef __PERMAPI__H__
  1610. /* If on an IBM PERCS machine the libpermapi.so file we generate in
  1611. * the switch/nrt plugin will need to link to this file and the
  1612. * permapi.h file which both have a job_info_t structure defined in
  1613. * it. So to avoid conflict only define job_info_t if we haven't
  1614. * included that file first. Then when in the libpermapi environment
  1615. * we can use slurm_job_info_t to access the job_info_t data. If not
  1616. * in that environment we should never know anything changed.
  1617. */
  1618. typedef slurm_job_info_t job_info_t;
  1619. #endif
  1620. typedef struct job_info_msg {
  1621. time_t last_update; /* time of latest info */
  1622. uint32_t record_count; /* number of records */
  1623. slurm_job_info_t *job_array; /* the job records */
  1624. } job_info_msg_t;
  1625. typedef struct step_update_request_msg {
  1626. time_t end_time; /* step end time */
  1627. uint32_t exit_code; /* exit code for job (status from wait call) */
  1628. uint32_t job_id;
  1629. jobacctinfo_t *jobacct;
  1630. char *name; /* step name */
  1631. time_t start_time; /* step start time */
  1632. uint32_t step_id;
  1633. uint32_t time_limit; /* In minutes */
  1634. } step_update_request_msg_t;
  1635. typedef struct {
  1636. char *node_list; /* nodelist corresponding to task layout */
  1637. uint16_t *cpus_per_node; /* cpus per node */
  1638. uint32_t *cpu_count_reps; /* how many nodes have same cpu count */
  1639. uint32_t num_hosts; /* number of hosts we have */
  1640. uint32_t num_tasks; /* number of tasks to distribute across these cpus*/
  1641. uint16_t *cpus_per_task; /* number of cpus per task */
  1642. uint32_t *cpus_task_reps; /* how many nodes have same per task count */
  1643. uint32_t task_dist; /* type of distribution we are using */
  1644. uint16_t plane_size; /* plane size (only needed for plane distribution*/
  1645. } slurm_step_layout_req_t;
  1646. typedef struct slurm_step_layout {
  1647. char *front_end; /* If a front-end architecture, the name of
  1648. * of the node running all tasks,
  1649. * NULL otherwise */
  1650. uint32_t node_cnt; /* node count */
  1651. char *node_list; /* list of nodes in step */
  1652. uint16_t plane_size; /* plane size when task_dist =
  1653. * SLURM_DIST_PLANE */
  1654. uint16_t start_protocol_ver; /* Slurm version step was started with
  1655. * either srun or the lowest slurmd version
  1656. * it is talking to */
  1657. /* Array of length "node_cnt". Each element of the array
  1658. * is the number of tasks assigned to the corresponding node */
  1659. uint16_t *tasks;
  1660. uint32_t task_cnt; /* total number of tasks in the step */
  1661. uint32_t task_dist; /* see enum task_dist_state */
  1662. /* Array (of length "node_cnt") of task ID arrays. The length
  1663. * of each subarray is designated by the corresponding value in
  1664. * the tasks array. */
  1665. uint32_t **tids; /* host id => task id mapping */
  1666. } slurm_step_layout_t;
  1667. typedef struct slurm_step_io_fds {
  1668. struct {
  1669. int fd;
  1670. uint32_t taskid;
  1671. uint32_t nodeid;
  1672. } input, out, err;
  1673. } slurm_step_io_fds_t;
  1674. #define SLURM_STEP_IO_FDS_INITIALIZER {{0, (uint32_t)-1, (uint32_t)-1}, \
  1675. {1, (uint32_t)-1, (uint32_t)-1}, \
  1676. {2, (uint32_t)-1, (uint32_t)-1}}
  1677. typedef struct launch_tasks_response_msg {
  1678. uint32_t job_id;
  1679. uint32_t step_id;
  1680. uint32_t return_code;
  1681. char *node_name;
  1682. uint32_t srun_node_id;
  1683. uint32_t count_of_pids;
  1684. uint32_t *local_pids;
  1685. uint32_t *task_ids; /* array of length count_of_pids */
  1686. } launch_tasks_response_msg_t;
  1687. typedef struct task_ext_msg {
  1688. uint32_t num_tasks;
  1689. uint32_t *task_id_list;
  1690. uint32_t return_code;
  1691. uint32_t job_id;
  1692. uint32_t step_id;
  1693. } task_exit_msg_t;
  1694. typedef struct {
  1695. uint32_t job_id; /* slurm job_id */
  1696. uint32_t flags; /* flags */
  1697. uint16_t port; /* target TCP port */
  1698. char *target; /* target host or UNIX socket */
  1699. } net_forward_msg_t;
  1700. typedef struct srun_ping_msg {
  1701. uint32_t job_id; /* slurm job_id */
  1702. uint32_t step_id; /* step_id or NO_VAL */
  1703. } srun_ping_msg_t;
  1704. typedef struct srun_job_complete_msg {
  1705. uint32_t job_id; /* slurm job_id */
  1706. uint32_t step_id; /* step_id or NO_VAL */
  1707. } srun_job_complete_msg_t;
  1708. typedef struct srun_timeout_msg {
  1709. uint32_t job_id; /* slurm job_id */
  1710. uint32_t step_id; /* step_id or NO_VAL */
  1711. time_t timeout; /* when job scheduled to be killed */
  1712. } srun_timeout_msg_t;
  1713. typedef struct srun_user_msg {
  1714. uint32_t job_id; /* slurm job_id */
  1715. char *msg; /* message to user's srun */
  1716. } srun_user_msg_t;
  1717. typedef struct srun_node_fail_msg {
  1718. uint32_t job_id; /* slurm job_id */
  1719. char *nodelist; /* name of failed node(s) */
  1720. uint32_t step_id; /* step_id or NO_VAL */
  1721. } srun_node_fail_msg_t;
  1722. typedef struct srun_step_missing_msg {
  1723. uint32_t job_id; /* slurm job_id */
  1724. char *nodelist; /* name of node(s) lacking this step */
  1725. uint32_t step_id; /* step_id or NO_VAL */
  1726. } srun_step_missing_msg_t;
  1727. enum suspend_opts {
  1728. SUSPEND_JOB, /* Suspend a job now */
  1729. RESUME_JOB /* Resume a job now */
  1730. };
  1731. /* NOTE: Set either job_id_str (NULL by default) or job_id */
  1732. typedef struct suspend_msg {
  1733. uint16_t op; /* suspend operation, see enum suspend_opts */
  1734. uint32_t job_id; /* slurm job ID (number) */
  1735. char * job_id_str; /* slurm job ID (string) */
  1736. } suspend_msg_t;
  1737. /* NOTE: Set either job_id_str (NULL by default) or job_id */
  1738. typedef struct top_job_msg {
  1739. uint16_t op; /* suspend operation, see enum suspend_opts */
  1740. uint32_t job_id; /* slurm job ID (number) */
  1741. char * job_id_str; /* slurm job ID (string) */
  1742. } top_job_msg_t;
  1743. typedef struct {
  1744. uint32_t cpu_count; /* number of required processors */
  1745. uint32_t cpu_freq_min; /* Minimum cpu frequency */
  1746. uint32_t cpu_freq_max; /* Maximum cpu frequency */
  1747. uint32_t cpu_freq_gov; /* cpu frequency governor */
  1748. char *cpus_per_tres; /* semicolon delimited list of TRES=# values */
  1749. uint16_t exclusive; /* 1 if CPUs not shared with other steps */
  1750. char *features; /* required node features, default NONE */
  1751. uint16_t immediate; /* 1 if allocate to run or fail immediately,
  1752. * 0 if to be queued awaiting resources */
  1753. uint32_t job_id; /* job ID */
  1754. uint64_t pn_min_memory; /* minimum real memory per node OR
  1755. * real memory per CPU | MEM_PER_CPU,
  1756. * default=0 (use job limit) */
  1757. char *name; /* name of the job step */
  1758. char *network; /* network use spec */
  1759. uint32_t profile; /* Level of acct_gather_profile {all | none} */
  1760. uint8_t no_kill; /* 1 if no kill on node failure */
  1761. uint32_t min_nodes; /* minimum number of nodes required by job,
  1762. * default=0 */
  1763. uint32_t max_nodes; /* maximum number of nodes usable by job,
  1764. * default=0 */
  1765. char *mem_per_tres; /* semicolon delimited list of TRES=# values */
  1766. char *node_list; /* list of required nodes */
  1767. bool overcommit; /* "true" to allow the allocation of more tasks
  1768. * to a node than available processors,
  1769. * "false" to accept at most one task per
  1770. * processor. "false" by default. */
  1771. uint16_t plane_size; /* plane size when task_dist =
  1772. * SLURM_DIST_PLANE */
  1773. uint16_t relative; /* first node to use of job's allocation */
  1774. uint16_t resv_port_cnt; /* reserve ports if set */
  1775. uint32_t step_id; /* desired step ID or NO_VAL */
  1776. uint32_t task_count; /* number of tasks required */
  1777. uint32_t task_dist; /* see enum task_dist_state, default
  1778. * is SLURM_DIST_CYCLIC */
  1779. uint32_t time_limit; /* step time limit */
  1780. char *tres_bind; /* Task to TRES binding directives */
  1781. char *tres_freq; /* TRES frequency directives */
  1782. char *tres_per_step; /* semicolon delimited list of TRES=# values */
  1783. char *tres_per_node; /* semicolon delimited list of TRES=# values */
  1784. char *tres_per_socket; /* semicolon delimited list of TRES=# values */
  1785. char *tres_per_task; /* semicolon delimited list of TRES=# values */
  1786. uid_t uid; /* user ID */
  1787. uint16_t verbose_level; /* for extra logging decisions in step
  1788. * launch api */
  1789. } slurm_step_ctx_params_t;
  1790. typedef struct {
  1791. char *alias_list; /* node name/address/hostname aliases */
  1792. uint32_t argc;
  1793. char **argv;
  1794. uint32_t envc;
  1795. char **env;
  1796. char *cwd;
  1797. bool user_managed_io;
  1798. uint32_t msg_timeout; /* timeout set for sending message */
  1799. uint16_t ntasks_per_board;/* number of tasks to invoke on each board */
  1800. uint16_t ntasks_per_core; /* number of tasks to invoke on each core */
  1801. uint16_t ntasks_per_socket;/* number of tasks to invoke on
  1802. * each socket */
  1803. /* START - only used if user_managed_io is false */
  1804. bool buffered_stdio;
  1805. bool labelio;
  1806. char *remote_output_filename;
  1807. char *remote_error_filename;
  1808. char *remote_input_filename;
  1809. slurm_step_io_fds_t local_fds;
  1810. /* END - only used if user_managed_io is false */
  1811. uint32_t gid;
  1812. bool multi_prog;
  1813. bool no_alloc;
  1814. uint32_t slurmd_debug; /* remote slurmd debug level */
  1815. uint32_t het_job_node_offset; /* Hetjob node offset or NO_VAL */
  1816. uint32_t het_job_id; /* Hetjob ID or NO_VAL */
  1817. uint32_t het_job_nnodes;/* total task count for entire hetjob */
  1818. uint32_t het_job_ntasks;/* total task count for entire hetjob */
  1819. uint32_t het_job_step_cnt;/* total step count for entire hetjob */
  1820. uint16_t *het_job_task_cnts; /* Number of tasks on each node in hetjob */
  1821. uint32_t **het_job_tids; /* Task IDs on each node in hetjob */
  1822. uint32_t *het_job_tid_offsets;/* map of tasks (by id) to originating
  1823. * hetjob */
  1824. uint32_t het_job_offset;/* Hetjob offset or NO_VAL */
  1825. uint32_t het_job_task_offset; /* Hetjob task offset or NO_VAL */
  1826. char *het_job_node_list; /* Hetjob step node list */
  1827. bool parallel_debug;
  1828. uint32_t profile; /* Level of acct_gather_profile {all | none} */
  1829. char *task_prolog;
  1830. char *task_epilog;
  1831. uint16_t cpu_bind_type; /* use cpu_bind_type_t */
  1832. char *cpu_bind;
  1833. uint32_t cpu_freq_min; /* Minimum cpu frequency */
  1834. uint32_t cpu_freq_max; /* Maximum cpu frequency */
  1835. uint32_t cpu_freq_gov; /* cpu frequency governor */
  1836. uint16_t mem_bind_type; /* use mem_bind_type_t */
  1837. char *mem_bind;
  1838. uint16_t accel_bind_type; /* --accel-bind= */
  1839. uint16_t max_sockets;
  1840. uint16_t max_cores;
  1841. uint16_t max_threads;
  1842. uint16_t cpus_per_task;
  1843. uint32_t task_dist;
  1844. char *partition;
  1845. bool preserve_env;
  1846. char *mpi_plugin_name;
  1847. uint8_t open_mode;
  1848. char *acctg_freq;
  1849. bool pty;
  1850. char **spank_job_env; /* environment variables for job prolog/epilog
  1851. * scripts as set by SPANK plugins */
  1852. uint32_t spank_job_env_size; /* element count in spank_env */
  1853. char *tres_bind;
  1854. char *tres_freq;
  1855. } slurm_step_launch_params_t;
  1856. typedef struct {
  1857. void (*step_complete)(srun_job_complete_msg_t *);
  1858. void (*step_signal)(int);
  1859. void (*step_timeout)(srun_timeout_msg_t *);
  1860. void (*task_start)(launch_tasks_response_msg_t *);
  1861. void (*task_finish)(task_exit_msg_t *);
  1862. } slurm_step_launch_callbacks_t;
  1863. typedef struct {
  1864. void (*ping)(srun_ping_msg_t *);
  1865. void (*job_complete)(srun_job_complete_msg_t *);
  1866. void (*timeout)(srun_timeout_msg_t *);
  1867. void (*user_msg)(srun_user_msg_t *);
  1868. void (*node_fail)(srun_node_fail_msg_t *);
  1869. void (*job_suspend)(suspend_msg_t *);
  1870. } slurm_allocation_callbacks_t;
  1871. typedef struct {
  1872. void (*acct_full)();
  1873. void (*dbd_fail)();
  1874. void (*dbd_resumed)();
  1875. void (*db_fail)();
  1876. void (*db_resumed)();
  1877. } slurm_trigger_callbacks_t;
  1878. typedef struct {
  1879. uint32_t array_job_id; /* job_id of a job array or 0 if N/A */
  1880. uint32_t array_task_id; /* task_id of a job array */
  1881. char *cluster; /* cluster that the step is running on. */
  1882. uint32_t cpu_freq_min; /* Minimum cpu frequency */
  1883. uint32_t cpu_freq_max; /* Maximum cpu frequency */
  1884. uint32_t cpu_freq_gov; /* cpu frequency governor */
  1885. char *cpus_per_tres; /* comma delimited list of TRES=# values */
  1886. uint32_t job_id; /* job ID */
  1887. char *mem_per_tres; /* comma delimited list of TRES=# values */
  1888. char *name; /* name of job step */
  1889. char *network; /* network specs for job step */
  1890. char *nodes; /* list of nodes allocated to job_step */
  1891. int32_t *node_inx; /* list index pairs into node_table for *nodes:
  1892. * start_range_1, end_range_1,
  1893. * start_range_2, .., -1 */
  1894. uint32_t num_cpus; /* how many cpus are being used by step */
  1895. uint32_t num_tasks; /* number of tasks */
  1896. char *partition; /* name of assigned partition */
  1897. char *resv_ports; /* ports allocated for MPI */
  1898. time_t run_time; /* net run time (factor out time suspended) */
  1899. dynamic_plugin_data_t *select_jobinfo; /* opaque data type,
  1900. * process using
  1901. * slurm_get_select_jobinfo()
  1902. */
  1903. char *srun_host; /* host of srun command */
  1904. uint32_t srun_pid; /* PID of srun command */
  1905. time_t start_time; /* step start time */
  1906. uint16_t start_protocol_ver; /* Slurm version step was started with
  1907. * either srun or the lowest slurmd version
  1908. * it is talking to */
  1909. uint32_t state; /* state of the step, see enum job_states */
  1910. uint32_t step_id; /* step ID */
  1911. uint32_t task_dist; /* see enum task_dist_state */
  1912. uint32_t time_limit; /* step time limit */
  1913. char *tres_alloc_str; /* tres used in the job */
  1914. char *tres_bind; /* Task to TRES binding directives */
  1915. char *tres_freq; /* TRES frequency directives */
  1916. char *tres_per_step; /* comma delimited list of TRES=# values */
  1917. char *tres_per_node; /* comma delimited list of TRES=# values */
  1918. char *tres_per_socket; /* comma delimited list of TRES=# values */
  1919. char *tres_per_task; /* comma delimited list of TRES=# values */
  1920. uint32_t user_id; /* user the job runs as */
  1921. } job_step_info_t;
  1922. typedef struct job_step_info_response_msg {
  1923. time_t last_update; /* time of latest info */
  1924. uint32_t job_step_count; /* number of records */
  1925. job_step_info_t *job_steps; /* the job step records */
  1926. } job_step_info_response_msg_t;
  1927. typedef struct {
  1928. char *node_name;
  1929. uint32_t *pid;
  1930. uint32_t pid_cnt;
  1931. } job_step_pids_t;
  1932. typedef struct {
  1933. uint32_t job_id;
  1934. List pid_list; /* List of job_step_pids_t *'s */
  1935. uint32_t step_id;
  1936. } job_step_pids_response_msg_t;
  1937. typedef struct {
  1938. jobacctinfo_t *jobacct;
  1939. uint32_t num_tasks;
  1940. uint32_t return_code;
  1941. job_step_pids_t *step_pids;
  1942. } job_step_stat_t;
  1943. typedef struct {
  1944. uint32_t job_id; /* job ID */
  1945. List stats_list; /* List of job_step_stat_t *'s */
  1946. uint32_t step_id;
  1947. } job_step_stat_response_msg_t;
  1948. typedef struct node_info {
  1949. char *arch; /* computer architecture */
  1950. char *bcast_address; /* BcastAddr (optional) */
  1951. uint16_t boards; /* total number of boards per node */
  1952. time_t boot_time; /* time of node boot */
  1953. char *cluster_name; /* Cluster name ONLY set in federation */
  1954. uint16_t cores; /* number of cores per socket */
  1955. uint16_t core_spec_cnt; /* number of specialized cores on node */
  1956. uint32_t cpu_bind; /* Default task binding */
  1957. uint32_t cpu_load; /* CPU load * 100 */
  1958. uint64_t free_mem; /* free memory in MiB */
  1959. uint16_t cpus; /* configured count of cpus running on
  1960. * the node */
  1961. char *cpu_spec_list; /* node's specialized cpus */
  1962. acct_gather_energy_t *energy; /* energy data */
  1963. ext_sensors_data_t *ext_sensors; /* external sensor data */
  1964. power_mgmt_data_t *power; /* power management data */
  1965. char *features; /* list of a node's available features */
  1966. char *features_act; /* list of a node's current active features,
  1967. * Same as "features" if NULL */
  1968. char *gres; /* list of a node's generic resources */
  1969. char *gres_drain; /* list of drained GRES */
  1970. char *gres_used; /* list of GRES in current use */
  1971. char *mcs_label; /* mcs label if mcs plugin in use */
  1972. uint64_t mem_spec_limit; /* MB memory limit for specialization */
  1973. char *name; /* node name to slurm */
  1974. uint32_t next_state; /* state after reboot (enum node_states) */
  1975. char *node_addr; /* communication name (optional) */
  1976. char *node_hostname; /* node's hostname (optional) */
  1977. uint32_t node_state; /* see enum node_states */
  1978. char *os; /* operating system currently running */
  1979. uint32_t owner; /* User allowed to use this node or NO_VAL */
  1980. char *partitions; /* Comma separated list of partitions containing
  1981. * this node, NOT supplied by slurmctld, but
  1982. * populated by scontrol */
  1983. uint16_t port; /* TCP port number of the slurmd */
  1984. uint64_t real_memory; /* configured MB of real memory on the node */
  1985. char *reason; /* reason for node being DOWN or DRAINING */
  1986. time_t reason_time; /* Time stamp when reason was set, ignore if
  1987. * no reason is set. */
  1988. uint32_t reason_uid; /* User that set the reason, ignore if
  1989. * no reason is set. */
  1990. dynamic_plugin_data_t *select_nodeinfo; /* opaque data structure,
  1991. * use
  1992. * slurm_get_select_nodeinfo()
  1993. * to access contents */
  1994. time_t slurmd_start_time;/* time of slurmd startup */
  1995. uint16_t sockets; /* total number of sockets per node */
  1996. uint16_t threads; /* number of threads per core */
  1997. uint32_t tmp_disk; /* configured MB of total disk in TMP_FS */
  1998. uint32_t weight; /* arbitrary priority of node for scheduling */
  1999. char *tres_fmt_str; /* str representing configured TRES on node */
  2000. char *version; /* Slurm version number */
  2001. } node_info_t;
  2002. typedef struct node_info_msg {
  2003. time_t last_update; /* time of latest info */
  2004. uint32_t record_count; /* number of records */
  2005. node_info_t *node_array; /* the node records */
  2006. } node_info_msg_t;
  2007. typedef struct front_end_info {
  2008. char *allow_groups; /* allowed group string */
  2009. char *allow_users; /* allowed user string */
  2010. time_t boot_time; /* Time of node boot,
  2011. * computed from up_time */
  2012. char *deny_groups; /* denied group string */
  2013. char *deny_users; /* denied user string */
  2014. char *name; /* node name */
  2015. uint32_t node_state; /* see enum node_states */
  2016. char *reason; /* reason for node being DOWN or
  2017. * DRAINING */
  2018. time_t reason_time; /* Time stamp when reason was set,
  2019. * ignore if no reason is set. */
  2020. uint32_t reason_uid; /* User that set the reason,
  2021. * ignore if no reason is set. */
  2022. time_t slurmd_start_time; /* Time of slurmd startup */
  2023. char *version; /* Slurm version number */
  2024. } front_end_info_t;
  2025. typedef struct front_end_info_msg {
  2026. time_t last_update; /* time of latest info */
  2027. uint32_t record_count; /* number of records */
  2028. front_end_info_t *front_end_array; /* the front_end records */
  2029. } front_end_info_msg_t;
  2030. typedef struct topo_info {
  2031. uint16_t level; /* level in hierarchy, leaf=0 */
  2032. uint32_t link_speed; /* link speed, arbitrary units */
  2033. char *name; /* switch name */
  2034. char *nodes; /* name if direct descendent nodes */
  2035. char *switches; /* name if direct descendent switches */
  2036. } topo_info_t;
  2037. typedef struct topo_info_response_msg {
  2038. uint32_t record_count; /* number of records */
  2039. topo_info_t *topo_array; /* the switch topology records */
  2040. } topo_info_response_msg_t;
  2041. typedef struct job_alloc_info_msg {
  2042. uint32_t job_id; /* job ID */
  2043. char *req_cluster; /* requesting cluster */
  2044. } job_alloc_info_msg_t;
  2045. typedef struct layout_info_msg {
  2046. uint32_t record_count; /* number of char* */
  2047. char** records; /* layout or list of layouts */
  2048. } layout_info_msg_t;
  2049. typedef struct update_layout_msg {
  2050. char* layout;
  2051. char* arg;
  2052. } update_layout_msg_t;
  2053. typedef struct step_alloc_info_msg {
  2054. uint32_t het_job_offset; /* HetJob component index (or NO_VAL) */
  2055. uint32_t job_id; /* job ID (or hetjob ID) */
  2056. uint32_t step_id; /* step ID (or NO_VAL for whole job) */
  2057. } step_alloc_info_msg_t;
  2058. typedef struct powercap_info_msg {
  2059. uint32_t power_cap; /* power cap value in watts */
  2060. uint32_t power_floor; /* power floor value in watts */
  2061. uint32_t power_change; /* power change rate limit in watts/minute */
  2062. uint32_t min_watts; /* min consumption of the cluster in watts */
  2063. uint32_t cur_max_watts; /* current max consumption of the cluster in
  2064. * watts */
  2065. uint32_t adj_max_watts; /* adjusted (removing DownNodes) max consumption
  2066. * of the cluster in watts */
  2067. uint32_t max_watts; /* max consumption of the cluster in watts */
  2068. } powercap_info_msg_t;
  2069. typedef struct powercap_info_msg update_powercap_msg_t;
  2070. typedef struct acct_gather_node_resp_msg {
  2071. acct_gather_energy_t *energy;
  2072. char *node_name; /* node name */
  2073. uint16_t sensor_cnt;
  2074. } acct_gather_node_resp_msg_t;
  2075. typedef struct acct_gather_energy_req_msg {
  2076. uint16_t context_id;
  2077. uint16_t delta;
  2078. } acct_gather_energy_req_msg_t;
  2079. #define JOB_DEF_CPU_PER_GPU 0x0001
  2080. #define JOB_DEF_MEM_PER_GPU 0x0002
  2081. typedef struct job_defaults {
  2082. uint16_t type; /* See JOB_DEF_* above */
  2083. uint64_t value; /* Value */
  2084. } job_defaults_t;
  2085. /* Current partition state information and used to set partition options
  2086. * using slurm_update_partition(). */
  2087. #define PART_FLAG_DEFAULT 0x0001 /* Set if default partition */
  2088. #define PART_FLAG_HIDDEN 0x0002 /* Set if partition is hidden */
  2089. #define PART_FLAG_NO_ROOT 0x0004 /* Set if user root jobs disabled */
  2090. #define PART_FLAG_ROOT_ONLY 0x0008 /* Set if only root can submit jobs */
  2091. #define PART_FLAG_REQ_RESV 0x0010 /* Set if reservation is required */
  2092. #define PART_FLAG_LLN 0x0020 /* Set if least loaded node selection
  2093. * is desired */
  2094. #define PART_FLAG_EXCLUSIVE_USER 0x0040 /* Set if nodes allocated exclusively
  2095. * by user */
  2096. /* Used with slurm_update_partition() to clear flags associated with existing
  2097. * partitions. For example, if a partition is currently hidden and you want
  2098. * to make it visible then set flags to PART_FLAG_HIDDEN_CLR and call
  2099. * slurm_update_partition(). */
  2100. #define PART_FLAG_DEFAULT_CLR 0x0100 /* Clear DEFAULT partition flag */
  2101. #define PART_FLAG_HIDDEN_CLR 0x0200 /* Clear HIDDEN partition flag */
  2102. #define PART_FLAG_NO_ROOT_CLR 0x0400 /* Clear NO_ROOT partition flag */
  2103. #define PART_FLAG_ROOT_ONLY_CLR 0x0800 /* Clear ROOT_ONLY partition flag */
  2104. #define PART_FLAG_REQ_RESV_CLR 0x1000 /* Clear RES_REQ partition flag */
  2105. #define PART_FLAG_LLN_CLR 0x2000 /* Clear LLN partition flag */
  2106. #define PART_FLAG_EXC_USER_CLR 0x4000 /* Clear EXCLUSIVE_USER flag */
  2107. typedef struct partition_info {
  2108. char *allow_alloc_nodes;/* list names of allowed allocating
  2109. * nodes */
  2110. char *allow_accounts; /* comma delimited list of accounts,
  2111. * null indicates all */
  2112. char *allow_groups; /* comma delimited list of groups,
  2113. * null indicates all */
  2114. char *allow_qos; /* comma delimited list of qos,
  2115. * null indicates all */
  2116. char *alternate; /* name of alternate partition */
  2117. char *billing_weights_str;/* per TRES billing weights string */
  2118. char *cluster_name; /* Cluster name ONLY set in federation */
  2119. uint16_t cr_type; /* see CR_* values */
  2120. uint32_t cpu_bind; /* Default task binding */
  2121. uint64_t def_mem_per_cpu; /* default MB memory per allocated CPU */
  2122. uint32_t default_time; /* minutes, NO_VAL or INFINITE */
  2123. char *deny_accounts; /* comma delimited list of denied accounts */
  2124. char *deny_qos; /* comma delimited list of denied qos */
  2125. uint16_t flags; /* see PART_FLAG_* above */
  2126. uint32_t grace_time; /* preemption grace time in seconds */
  2127. List job_defaults_list; /* List of job_defaults_t elements */
  2128. char *job_defaults_str; /* String of job defaults,
  2129. * used only for partition update RPC */
  2130. uint32_t max_cpus_per_node; /* maximum allocated CPUs per node */
  2131. uint64_t max_mem_per_cpu; /* maximum MB memory per allocated CPU */
  2132. uint32_t max_nodes; /* per job or INFINITE */
  2133. uint16_t max_share; /* number of jobs to gang schedule */
  2134. uint32_t max_time; /* minutes or INFINITE */
  2135. uint32_t min_nodes; /* per job */
  2136. char *name; /* name of the partition */
  2137. int32_t *node_inx; /* list index pairs into node_table:
  2138. * start_range_1, end_range_1,
  2139. * start_range_2, .., -1 */
  2140. char *nodes; /* list names of nodes in partition */
  2141. uint16_t over_time_limit; /* job's time limit can be exceeded by this
  2142. * number of minutes before cancellation */
  2143. uint16_t preempt_mode; /* See PREEMPT_MODE_* in slurm/slurm.h */
  2144. uint16_t priority_job_factor; /* job priority weight factor */
  2145. uint16_t priority_tier; /* tier for scheduling and preemption */
  2146. char *qos_char; /* The partition QOS name */
  2147. uint16_t state_up; /* see PARTITION_ states above */
  2148. uint32_t total_cpus; /* total number of cpus in the partition */
  2149. uint32_t total_nodes; /* total number of nodes in the partition */
  2150. char *tres_fmt_str; /* str of configured TRES in partition */
  2151. } partition_info_t;
  2152. typedef struct delete_partition_msg {
  2153. char *name; /* name of partition to be delete */
  2154. } delete_part_msg_t;
  2155. typedef struct resource_allocation_response_msg {
  2156. char *account; /* allocation account */
  2157. uint32_t job_id; /* assigned job id */
  2158. char *alias_list; /* node name/address/hostname aliases */
  2159. uint32_t cpu_freq_min; /* Minimum cpu frequency */
  2160. uint32_t cpu_freq_max; /* Maximum cpu frequency */
  2161. uint32_t cpu_freq_gov; /* cpu frequency governor */
  2162. uint16_t *cpus_per_node;/* cpus per node */
  2163. uint32_t *cpu_count_reps;/* how many nodes have same cpu count */
  2164. uint32_t env_size; /* element count in environment */
  2165. char **environment; /* environment variables to set for job,
  2166. * name=value pairs, one per line */
  2167. uint32_t error_code; /* error code for warning message */
  2168. char *job_submit_user_msg;/* job_submit plugin user_msg */
  2169. slurm_addr_t *node_addr; /* network addresses */
  2170. uint32_t node_cnt; /* count of nodes */
  2171. char *node_list; /* assigned list of nodes */
  2172. uint16_t ntasks_per_board;/* number of tasks to invoke on each board */
  2173. uint16_t ntasks_per_core; /* number of tasks to invoke on each core */
  2174. uint16_t ntasks_per_socket;/* number of tasks to invoke on
  2175. * each socket */
  2176. uint32_t num_cpu_groups;/* size of cpus_per_node and cpu_count_reps */
  2177. char *partition; /* name of partition used to run job */
  2178. uint64_t pn_min_memory; /* minimum real memory per node OR
  2179. * real memory per CPU | MEM_PER_CPU,
  2180. * default=0 (no limit) */
  2181. char *qos; /* allocation qos */
  2182. char *resv_name; /* allocation reservation */
  2183. dynamic_plugin_data_t *select_jobinfo; /* opaque data structure,
  2184. * use
  2185. * slurm_get_select_jobinfo()
  2186. * to access contents */
  2187. void *working_cluster_rec; /* Cluster to direct remaining messages to.
  2188. * slurmdb_cluster_rec_t* because slurm.h
  2189. * doesn't know about slurmdb.h. */
  2190. } resource_allocation_response_msg_t;
  2191. typedef struct partition_info_msg {
  2192. time_t last_update; /* time of latest info */
  2193. uint32_t record_count; /* number of records */
  2194. partition_info_t *partition_array; /* the partition records */
  2195. } partition_info_msg_t;
  2196. typedef struct will_run_response_msg {
  2197. uint32_t job_id; /* ID of job to start */
  2198. char *job_submit_user_msg; /* job submit plugin user_msg */
  2199. char *node_list; /* nodes where job will start */
  2200. char *part_name; /* partition where job will start */
  2201. List preemptee_job_id; /* jobs preempted to start this job */
  2202. uint32_t proc_cnt; /* CPUs allocated to job at start */
  2203. time_t start_time; /* time when job will start */
  2204. double sys_usage_per; /* System usage percentage */
  2205. } will_run_response_msg_t;
  2206. /*********************************/
  2207. /*
  2208. * Resource reservation data structures.
  2209. * Create, show, modify and delete functions are required
  2210. */
  2211. #define RESERVE_FLAG_MAINT 0x0000000000000001 /* Set MAINT flag */
  2212. #define RESERVE_FLAG_NO_MAINT 0x0000000000000002 /* Clear MAINT flag */
  2213. #define RESERVE_FLAG_DAILY 0x0000000000000004 /* Set DAILY flag */
  2214. #define RESERVE_FLAG_NO_DAILY 0x0000000000000008 /* Clear DAILY flag */
  2215. #define RESERVE_FLAG_WEEKLY 0x0000000000000010 /* Set WEEKLY flag */
  2216. #define RESERVE_FLAG_NO_WEEKLY 0x0000000000000020 /* Clear WEEKLY flag */
  2217. #define RESERVE_FLAG_IGN_JOBS 0x0000000000000040 /* Ignore running jobs */
  2218. #define RESERVE_FLAG_NO_IGN_JOB 0x0000000000000080 /* Clear ignore running
  2219. * jobs flag */
  2220. #define RESERVE_FLAG_ANY_NODES 0x0000000000000100 /* Use any compute
  2221. * nodes */
  2222. #define RESERVE_FLAG_NO_ANY_NODES 0x0000000000000200 /* Clear any compute
  2223. * node flag */
  2224. #define RESERVE_FLAG_STATIC 0x0000000000000400 /* Static node allocation */
  2225. #define RESERVE_FLAG_NO_STATIC 0x0000000000000800 /* Clear static node
  2226. * allocation */
  2227. #define RESERVE_FLAG_PART_NODES 0x0000000000001000 /* Use partition nodes
  2228. * only */
  2229. #define RESERVE_FLAG_NO_PART_NODES 0x0000000000002000 /* Clear partition
  2230. * nodes only flag */
  2231. #define RESERVE_FLAG_OVERLAP 0x0000000000004000 /* Permit to overlap
  2232. * others */
  2233. #define RESERVE_FLAG_SPEC_NODES 0x0000000000008000 /* Contains specific
  2234. * nodes */
  2235. #define RESERVE_FLAG_FIRST_CORES 0x0000000000010000 /* Use only first cores
  2236. * on each node */
  2237. #define RESERVE_FLAG_TIME_FLOAT 0x0000000000020000 /* Time offset is
  2238. * relative */
  2239. #define RESERVE_FLAG_REPLACE 0x0000000000040000 /* Replace resources
  2240. * as assigned to jobs */
  2241. #define RESERVE_FLAG_ALL_NODES 0x0000000000080000 /* Use all compute
  2242. * nodes */
  2243. #define RESERVE_FLAG_PURGE_COMP 0x0000000000100000 /* Purge reservation
  2244. * after last job done */
  2245. #define RESERVE_FLAG_WEEKDAY 0x0000000000200000 /* Set WEEKDAY flag */
  2246. #define RESERVE_FLAG_NO_WEEKDAY 0x0000000000400000 /* Clear WEEKDAY flag */
  2247. #define RESERVE_FLAG_WEEKEND 0x0000000000800000 /* Set WEEKEND flag */
  2248. #define RESERVE_FLAG_NO_WEEKEND 0x0000000001000000 /* Clear WEEKEND flag */
  2249. #define RESERVE_FLAG_FLEX 0x0000000002000000 /* Set FLEX flag */
  2250. #define RESERVE_FLAG_NO_FLEX 0x0000000004000000 /* Clear FLEX flag */
  2251. #define RESERVE_FLAG_DUR_PLUS 0x0000000008000000 /* Add duration time,
  2252. * only used on
  2253. * modifying a
  2254. * reservation */
  2255. #define RESERVE_FLAG_DUR_MINUS 0x0000000010000000 /* Remove duration time,
  2256. * only used on
  2257. * modifying a
  2258. * reservation */
  2259. #define RESERVE_FLAG_NO_HOLD_JOBS 0x0000000020000000 /* No hold jobs after
  2260. * end of reservation */
  2261. #define RESERVE_FLAG_REPLACE_DOWN 0x0000000040000000 /* Replace DOWN or
  2262. * DRAINED nodes */
  2263. #define RESERVE_FLAG_NO_PURGE_COMP 0x0000000080000000 /* Clear PURGE flag */
  2264. #define RESERVE_FLAG_PROM 0x0000000100000000 /* Allow jobs to run
  2265. * without specifying
  2266. * the reservation name
  2267. * if they meet
  2268. * eligibility status */
  2269. #define RESERVE_FLAG_NO_PROM 0x0000000200000000 /* Clear PROM flag */
  2270. typedef struct resv_core_spec {
  2271. char *node_name; /* Name of reserved node */
  2272. char *core_id; /* IDs of reserved cores */
  2273. } resv_core_spec_t;
  2274. typedef struct reserve_info {
  2275. char *accounts; /* names of accounts permitted to use */
  2276. char *burst_buffer; /* burst buffer resources to be included */
  2277. uint32_t core_cnt; /* count of cores required */
  2278. uint32_t core_spec_cnt; /* count of core_spec records */
  2279. resv_core_spec_t *core_spec; /* reserved cores specification */
  2280. time_t end_time; /* end time of reservation */
  2281. char *features; /* required node features */
  2282. uint64_t flags; /* see RESERVE_FLAG_* above */
  2283. char *licenses; /* names of licenses to be reserved */
  2284. uint32_t max_start_delay;/* Maximum delay in which jobs outside of the
  2285. * reservation will be permitted to overlap
  2286. * once any jobs are queued for the
  2287. * reservation */
  2288. char *name; /* name of reservation */
  2289. uint32_t node_cnt; /* count of nodes required */
  2290. int32_t *node_inx; /* list index pairs into node_table for *nodes:
  2291. * start_range_1, end_range_1,
  2292. * start_range_2, .., -1 */
  2293. char *node_list; /* list of reserved nodes or ALL */
  2294. char *partition; /* name of partition to be used */
  2295. uint32_t purge_comp_time; /* If PURGE_COMP flag is set the amount of
  2296. * minutes this reservation will sit idle
  2297. * until it is revoked.
  2298. */
  2299. time_t start_time; /* start time of reservation */
  2300. uint32_t resv_watts; /* amount of power to reserve */
  2301. char *tres_str; /* list of TRES's used by reservation */
  2302. char *users; /* names of users permitted to use */
  2303. } reserve_info_t;
  2304. typedef struct reserve_info_msg {
  2305. time_t last_update; /* time of latest info */
  2306. uint32_t record_count; /* number of records */
  2307. reserve_info_t *reservation_array; /* the reservation records */
  2308. } reserve_info_msg_t;
  2309. typedef struct resv_desc_msg {
  2310. char *accounts; /* names of accounts permitted to use */
  2311. char *burst_buffer; /* burst buffer resources to be included */
  2312. uint32_t *core_cnt; /* Count of cores required */
  2313. uint32_t duration; /* duration of reservation in minutes */
  2314. time_t end_time; /* end time of reservation */
  2315. char *features; /* required node features */
  2316. uint64_t flags; /* see RESERVE_FLAG_* above */
  2317. char *licenses; /* names of licenses to be reserved */
  2318. uint32_t max_start_delay;/* Maximum delay in which jobs outside of the
  2319. * reservation will be permitted to overlap
  2320. * once any jobs are queued for the
  2321. * reservation */
  2322. char *name; /* name of reservation (optional on create) */
  2323. uint32_t *node_cnt; /* Count of nodes required. Specify set of job
  2324. * sizes with trailing zero to optimize layout
  2325. * for those jobs just specify their total size
  2326. * to ignore optimized topology. For example,
  2327. * {512,512,1024,0} OR {2048,0}. */
  2328. char *node_list; /* list of reserved nodes or ALL */
  2329. char *partition; /* name of partition to be used */
  2330. uint32_t purge_comp_time; /* If PURGE_COMP flag is set the amount of
  2331. * minutes this reservation will sit idle
  2332. * until it is revoked.
  2333. */
  2334. time_t start_time; /* start time of reservation */
  2335. uint32_t resv_watts; /* amount of power to reserve */
  2336. char *tres_str; /* list of TRES's used by reservation */
  2337. char *users; /* names of users permitted to use */
  2338. } resv_desc_msg_t;
  2339. typedef struct reserve_response_msg {
  2340. char *name; /* name of reservation */
  2341. } reserve_response_msg_t;
  2342. typedef struct reservation_name_msg {
  2343. char *name; /* name of reservation just created or
  2344. * to be delete */
  2345. } reservation_name_msg_t;
  2346. #define DEBUG_FLAG_SELECT_TYPE 0x0000000000000001 /* SelectType plugin */
  2347. #define DEBUG_FLAG_STEPS 0x0000000000000002 /* slurmctld steps */
  2348. #define DEBUG_FLAG_TRIGGERS 0x0000000000000004 /* slurmctld triggers */
  2349. #define DEBUG_FLAG_CPU_BIND 0x0000000000000008 /* CPU binding */
  2350. #define DEBUG_FLAG_WIKI 0x0000000000000010 /* unused, was wiki plugin */
  2351. #define DEBUG_FLAG_NO_CONF_HASH 0x0000000000000020 /* no warning about
  2352. * slurm.conf files checksum
  2353. * mismatch */
  2354. #define DEBUG_FLAG_GRES 0x0000000000000040 /* Generic Resource info */
  2355. #define DEBUG_FLAG_TRES_NODE 0x0000000000000080 /* Print debug for limits
  2356. * dealing with TRES=NODE */
  2357. #define DEBUG_FLAG_DATA 0x0000000000000100 /* data_t logging */
  2358. #define DEBUG_FLAG_WORKQ 0x0000000000000200 /* Work Queue */
  2359. #define DEBUG_FLAG_NET 0x0000000000000400 /* Network logging */
  2360. #define DEBUG_FLAG_PRIO 0x0000000000000800 /* debug for priority
  2361. * plugin */
  2362. #define DEBUG_FLAG_BACKFILL 0x0000000000001000 /* debug for
  2363. * sched/backfill */
  2364. #define DEBUG_FLAG_GANG 0x0000000000002000 /* debug gang scheduler */
  2365. #define DEBUG_FLAG_RESERVATION 0x0000000000004000 /* advanced reservations */
  2366. #define DEBUG_FLAG_FRONT_END 0x0000000000008000 /* front-end nodes */
  2367. #define DEBUG_FLAG_NO_REALTIME 0x0000000000010000 /* get debug when the
  2368. * realtime server dies
  2369. * on a bluegene system */
  2370. #define DEBUG_FLAG_SWITCH 0x0000000000020000 /* SwitchType plugin */
  2371. #define DEBUG_FLAG_ENERGY 0x0000000000040000 /* AcctGatherEnergy plugin */
  2372. #define DEBUG_FLAG_EXT_SENSORS 0x0000000000080000 /* ExtSensorsType plugin */
  2373. #define DEBUG_FLAG_LICENSE 0x0000000000100000 /* AcctGatherProfile
  2374. * plugin */
  2375. #define DEBUG_FLAG_PROFILE 0x0000000000200000 /* AcctGatherProfile
  2376. * plugin */
  2377. #define DEBUG_FLAG_INTERCONNECT 0x0000000000400000 /* AcctGatherInterconnect
  2378. * plugin */
  2379. #define DEBUG_FLAG_FILESYSTEM 0x0000000000800000 /* AcctGatherFilesystem
  2380. * plugin */
  2381. #define DEBUG_FLAG_JOB_CONT 0x0000000001000000 /* JobContainer plugin */
  2382. #define DEBUG_FLAG_TASK 0x0000000002000000 /* TaskType plugin */
  2383. #define DEBUG_FLAG_PROTOCOL 0x0000000004000000 /* Communication protocol */
  2384. #define DEBUG_FLAG_BACKFILL_MAP 0x0000000008000000 /* Backfill scheduler node
  2385. * map */
  2386. #define DEBUG_FLAG_TRACE_JOBS 0x0000000010000000 /* Trace jobs by id
  2387. * and state */
  2388. #define DEBUG_FLAG_ROUTE 0x0000000020000000 /* Route plugin */
  2389. #define DEBUG_FLAG_DB_ASSOC 0x0000000040000000 /* Association debug */
  2390. #define DEBUG_FLAG_DB_EVENT 0x0000000080000000 /* Event debug */
  2391. #define DEBUG_FLAG_DB_JOB 0x0000000100000000 /* Database job debug */
  2392. #define DEBUG_FLAG_DB_QOS 0x0000000200000000 /* QOS debug */
  2393. #define DEBUG_FLAG_DB_QUERY 0x0000000400000000 /* Database query debug */
  2394. #define DEBUG_FLAG_DB_RESV 0x0000000800000000 /* Reservation debug */
  2395. #define DEBUG_FLAG_DB_RES 0x0000001000000000 /* Resource debug */
  2396. #define DEBUG_FLAG_DB_STEP 0x0000002000000000 /* Database step debug */
  2397. #define DEBUG_FLAG_DB_USAGE 0x0000004000000000 /* Usage/Rollup debug */
  2398. #define DEBUG_FLAG_DB_WCKEY 0x0000008000000000 /* Database WCKey debug */
  2399. #define DEBUG_FLAG_BURST_BUF 0x0000010000000000 /* Burst buffer plugin */
  2400. #define DEBUG_FLAG_CPU_FREQ 0x0000020000000000 /* --cpu_freq debug */
  2401. #define DEBUG_FLAG_POWER 0x0000040000000000 /* Power plugin debug */
  2402. #define DEBUG_FLAG_TIME_CRAY 0x0000080000000000 /* Time Cray components */
  2403. #define DEBUG_FLAG_DB_ARCHIVE 0x0000100000000000 /* DBD Archiving/Purging */
  2404. #define DEBUG_FLAG_DB_TRES 0x0000200000000000 /* Database TRES debug */
  2405. #define DEBUG_FLAG_ESEARCH 0x0000400000000000 /* Elasticsearch debug */
  2406. #define DEBUG_FLAG_NODE_FEATURES 0x0000800000000000 /* Node Features debug */
  2407. #define DEBUG_FLAG_FEDR 0x0001000000000000 /* Federation debug */
  2408. #define DEBUG_FLAG_HETJOB 0x0002000000000000 /* Heterogeneous job debug */
  2409. #define DEBUG_FLAG_ACCRUE 0x0004000000000000 /* Accrue counters debug */
  2410. #define DEBUG_FLAG_POWER_SAVE 0x0008000000000000 /* Power Save debug */
  2411. #define DEBUG_FLAG_AGENT 0x0010000000000000 /* RPC Agent debug */
  2412. #define DEBUG_FLAG_DEPENDENCY 0x0020000000000000 /* Dependency debug */
  2413. #define PREEMPT_MODE_OFF 0x0000 /* disable job preemption */
  2414. #define PREEMPT_MODE_SUSPEND 0x0001 /* suspend jobs to preempt */
  2415. #define PREEMPT_MODE_REQUEUE 0x0002 /* requeue or kill jobs to preempt */
  2416. #define PREEMPT_MODE_CANCEL 0x0008 /* always cancel the job */
  2417. #define PREEMPT_MODE_GANG 0x8000 /* enable gang scheduling */
  2418. #define RECONFIG_KEEP_PART_INFO 0x0001 /* keep dynamic partition info on scontrol reconfig */
  2419. #define RECONFIG_KEEP_PART_STAT 0x0002 /* keep dynamic partition state on scontrol reconfig */
  2420. #define HEALTH_CHECK_NODE_IDLE 0x0001 /* execute on idle nodes */
  2421. #define HEALTH_CHECK_NODE_ALLOC 0x0002 /* execute on fully allocated nodes */
  2422. #define HEALTH_CHECK_NODE_MIXED 0x0004 /* execute on partially allocated nodes */
  2423. #define HEALTH_CHECK_CYCLE 0x8000 /* cycle through nodes node */
  2424. #define HEALTH_CHECK_NODE_ANY 0x000f /* execute on all node states */
  2425. #define PROLOG_FLAG_ALLOC 0x0001 /* execute prolog upon allocation */
  2426. #define PROLOG_FLAG_NOHOLD 0x0002 /* don't block salloc/srun until
  2427. * slurmctld knows the prolog has
  2428. * run on each node in the allocation */
  2429. #define PROLOG_FLAG_CONTAIN 0x0004 /* Use proctrack plugin to create a
  2430. * container upon allocation */
  2431. #define PROLOG_FLAG_SERIAL 0x0008 /* serially execute prolog/epilog */
  2432. #define PROLOG_FLAG_X11 0x0010 /* enable slurm x11 forwarding support */
  2433. #define CTL_CONF_OR 0x00000001 /*SlurmdParameters=config_overrides*/
  2434. #define CTL_CONF_SJC 0x00000002 /* AccountingStoreJobComment */
  2435. #define CTL_CONF_DRJ 0x00000004 /* DisableRootJobs */
  2436. #define CTL_CONF_ASRU 0x00000008 /* AllowSpecResourcesUsage */
  2437. #define CTL_CONF_PAM 0x00000010 /* UsePam */
  2438. #define CTL_CONF_WCKEY 0x00000020 /* TrackWCKey */
  2439. #define LOG_FMT_ISO8601_MS 0
  2440. #define LOG_FMT_ISO8601 1
  2441. #define LOG_FMT_RFC5424_MS 2
  2442. #define LOG_FMT_RFC5424 3
  2443. #define LOG_FMT_CLOCK 4
  2444. #define LOG_FMT_SHORT 5
  2445. #define LOG_FMT_THREAD_ID 6
  2446. typedef struct slurm_ctl_conf {
  2447. time_t last_update; /* last update time of the build parameters */
  2448. char *accounting_storage_tres; /* list of tres */
  2449. uint16_t accounting_storage_enforce; /* job requires valid association:
  2450. * user/account/partition/cluster */
  2451. char *accounting_storage_backup_host; /* accounting storage
  2452. * backup host */
  2453. char *accounting_storage_ext_host; /* accounting storage ext host */
  2454. char *accounting_storage_host; /* accounting storage host */
  2455. char *accounting_storage_loc; /* accounting storage (db table)
  2456. * location */
  2457. char *accounting_storage_pass; /* accounting storage
  2458. * password */
  2459. uint32_t accounting_storage_port;/* node accounting storage port */
  2460. char *accounting_storage_type; /* accounting storage type */
  2461. char *accounting_storage_user; /* accounting storage user */
  2462. void *acct_gather_conf; /* account gather config */
  2463. char *acct_gather_energy_type; /* energy accounting type */
  2464. char *acct_gather_profile_type; /* profile accounting type */
  2465. char *acct_gather_interconnect_type; /* interconnect accounting type */
  2466. char *acct_gather_filesystem_type; /* filesystem accounting type */
  2467. uint16_t acct_gather_node_freq; /* secs between node acct request */
  2468. char *authalttypes; /* alternate authentication types */
  2469. char *authinfo; /* authentication info */
  2470. char *authtype; /* authentication type */
  2471. uint16_t batch_start_timeout; /* max secs for batch job to start */
  2472. char *bb_type; /* burst buffer plugin type */
  2473. time_t boot_time; /* time slurmctld last booted */
  2474. void *cgroup_conf; /* cgroup support config file */
  2475. char *cli_filter_plugins; /* List of cli_filter plugins to use */
  2476. char *core_spec_plugin; /* core specialization plugin name */
  2477. char *cluster_name; /* general name of the entire cluster */
  2478. char *comm_params; /* Communication parameters */
  2479. uint16_t complete_wait; /* seconds to wait for job completion before
  2480. * scheduling another job */
  2481. uint32_t conf_flags; /* various CTL_CONF_* flags to determine
  2482. * settings */
  2483. char **control_addr; /* comm path of slurmctld
  2484. * primary server and backups */
  2485. uint32_t control_cnt; /* Length of control_addr & control_machine */
  2486. char **control_machine; /* name of slurmctld primary
  2487. * server and backups */
  2488. uint32_t cpu_freq_def; /* default cpu frequency / governor */
  2489. uint32_t cpu_freq_govs; /* cpu freq governors allowed */
  2490. char *cred_type; /* credential signature plugin */
  2491. uint64_t debug_flags; /* see DEBUG_FLAG_* above for values */
  2492. uint64_t def_mem_per_cpu; /* default MB memory per allocated CPU */
  2493. char *dependency_params; /* DependencyParameters */
  2494. uint16_t eio_timeout; /* timeout for the eio thread */
  2495. uint16_t enforce_part_limits; /* if set, reject job exceeding
  2496. * partition size and/or time limits */
  2497. char *epilog; /* pathname of job epilog */
  2498. uint32_t epilog_msg_time; /* usecs for slurmctld to process an
  2499. * epilog complete message */
  2500. char *epilog_slurmctld; /* pathname of job epilog run by slurmctld */
  2501. char *ext_sensors_type; /* external sensors plugin type */
  2502. uint16_t ext_sensors_freq; /* secs between ext sensors sampling */
  2503. void *ext_sensors_conf; /* external sensors config file*/
  2504. char *fed_params; /* Federation parameters */
  2505. uint32_t first_job_id; /* first slurm generated job_id to assign */
  2506. uint16_t fs_dampening_factor; /* dampening for Fairshare factor */
  2507. uint16_t get_env_timeout; /* timeout for srun --get-user-env option */
  2508. char * gres_plugins; /* list of generic resource plugins */
  2509. uint16_t group_time; /* update group time interval */
  2510. uint16_t group_force; /* update group/partition info even if no change
  2511. * detected */
  2512. char *gpu_freq_def; /* default GPU frequency / voltage */
  2513. uint32_t hash_val; /* Hash value of the slurm.conf file */
  2514. uint16_t health_check_interval; /* secs between health checks */
  2515. uint16_t health_check_node_state; /* Node states on which to execute
  2516. * health check program, see
  2517. * HEALTH_CHECK_NODE_* above */
  2518. char * health_check_program; /* pathname of health check program */
  2519. uint16_t inactive_limit;/* seconds of inactivity before a
  2520. * inactive resource allocation is released */
  2521. char *job_acct_gather_freq; /* poll frequency for job accounting
  2522. * gather plugins */
  2523. char *job_acct_gather_type; /* job accounting gather type */
  2524. char *job_acct_gather_params; /* job accounting gather parameters */
  2525. uint16_t job_acct_oom_kill; /* Enforce mem limit at runtime y|n */
  2526. char *job_comp_host; /* job completion logging host */
  2527. char *job_comp_loc; /* job completion logging location */
  2528. char *job_comp_params; /* job completion parameters for plugin */
  2529. char *job_comp_pass; /* job completion storage password */
  2530. uint32_t job_comp_port; /* job completion storage port */
  2531. char *job_comp_type; /* job completion storage type */
  2532. char *job_comp_user; /* job completion storage user */
  2533. char *job_container_plugin; /* job container plugin type */
  2534. char *job_credential_private_key; /* path to private key */
  2535. char *job_credential_public_certificate;/* path to public certificate*/
  2536. List job_defaults_list; /* List of job_defaults_t elements */
  2537. uint16_t job_file_append; /* if set, append to stdout/err file */
  2538. uint16_t job_requeue; /* If set, jobs get requeued on node failre */
  2539. char *job_submit_plugins; /* List of job_submit plugins to use */
  2540. uint16_t keep_alive_time; /* Keep alive time for srun I/O sockets */
  2541. uint16_t kill_on_bad_exit; /* If set, the job will be
  2542. * terminated immediately when one of
  2543. * the processes is aborted or crashed */
  2544. uint16_t kill_wait; /* seconds between SIGXCPU to SIGKILL
  2545. * on job termination */
  2546. char *launch_params; /* step launcher plugin options */
  2547. char *launch_type; /* type of step launcher to use */
  2548. char *layouts; /* comma separted list of layouts plugins */
  2549. char *licenses; /* licenses available on this cluster */
  2550. uint16_t log_fmt; /* Log file timestamp format */
  2551. char *mail_domain; /* default domain to append to usernames */
  2552. char *mail_prog; /* pathname of mail program */
  2553. uint32_t max_array_sz; /* Maximum job array size */
  2554. uint32_t max_dbd_msgs; /* maximum number of messages queued while DBD
  2555. * is not connected */
  2556. uint32_t max_job_cnt; /* maximum number of active jobs */
  2557. uint32_t max_job_id; /* maximum job id before using first_job_id */
  2558. uint64_t max_mem_per_cpu; /* maximum MB memory per allocated CPU */
  2559. uint32_t max_step_cnt; /* maximum number of steps per job */
  2560. uint16_t max_tasks_per_node; /* maximum tasks per node */
  2561. char *mcs_plugin; /* mcs plugin type */
  2562. char *mcs_plugin_params; /* mcs plugin parameters */
  2563. uint32_t min_job_age; /* COMPLETED jobs over this age (secs)
  2564. * purged from in memory records */
  2565. char *mpi_default; /* Default version of MPI in use */
  2566. char *mpi_params; /* MPI parameters */
  2567. char *msg_aggr_params; /* Message aggregation parameters */
  2568. uint16_t msg_timeout; /* message timeout */
  2569. uint16_t tcp_timeout; /* tcp timeout */
  2570. uint32_t next_job_id; /* next slurm generated job_id to assign */
  2571. void *node_features_conf; /* Node Features Plugin config file */
  2572. char *node_features_plugins; /* List of node_features plugins to use */
  2573. char *node_prefix; /* prefix of nodes in partition, only set in
  2574. bluegene clusters NULL otherwise */
  2575. uint16_t over_time_limit; /* job's time limit can be exceeded by this
  2576. * number of minutes before cancellation */
  2577. char *plugindir; /* pathname to plugins */
  2578. char *plugstack; /* pathname to plugin stack config file */
  2579. char *power_parameters; /* power management parameters */
  2580. char *power_plugin; /* power management plugin type */
  2581. uint32_t preempt_exempt_time; /* Time before jobs are preemptable */
  2582. uint16_t preempt_mode; /* See PREEMPT_MODE_* in slurm/slurm.h */
  2583. char *preempt_type; /* job preemption selection plugin */
  2584. char *prep_params; /* PrEp parameters */
  2585. char *prep_plugins; /* PrEp plugins */
  2586. uint32_t priority_decay_hl; /* priority decay half life in
  2587. * seconds */
  2588. uint32_t priority_calc_period; /* seconds between priority decay
  2589. * calculation */
  2590. uint16_t priority_favor_small; /* favor small jobs over large */
  2591. uint16_t priority_flags; /* set some flags for priority configuration,
  2592. * see PRIORITY_FLAGS_* above */
  2593. uint32_t priority_max_age; /* time when not to add any more
  2594. * priority to a job if reached */
  2595. char *priority_params; /* priority plugin parameters */
  2596. uint16_t priority_reset_period; /* when to clear usage,
  2597. * see PRIORITY_RESET_* */
  2598. char *priority_type; /* priority type plugin */
  2599. uint32_t priority_weight_age; /* weight for age factor */
  2600. uint32_t priority_weight_assoc; /* weight for assoc factor */
  2601. uint32_t priority_weight_fs; /* weight for Fairshare factor */
  2602. uint32_t priority_weight_js; /* weight for Job Size factor */
  2603. uint32_t priority_weight_part; /* weight for Partition factor */
  2604. uint32_t priority_weight_qos; /* weight for QOS factor */
  2605. char *priority_weight_tres; /* weights (str) for different TRES' */
  2606. uint16_t private_data; /* block viewing of information,
  2607. * see PRIVATE_DATA_* */
  2608. char *proctrack_type; /* process tracking plugin type */
  2609. char *prolog; /* pathname of job prolog run by slurmd */
  2610. uint16_t prolog_epilog_timeout; /* prolog/epilog timeout */
  2611. char *prolog_slurmctld; /* pathname of job prolog run by slurmctld */
  2612. uint16_t propagate_prio_process; /* process priority propagation,
  2613. * see PROP_PRIO_* */
  2614. uint16_t prolog_flags; /* set some flags for prolog configuration
  2615. see PROLOG_FLAG_* */
  2616. char *propagate_rlimits;/* Propagate (all/specific) resource limits */
  2617. char *propagate_rlimits_except;/* Propagate all rlimits except these */
  2618. char *reboot_program; /* program to reboot the node */
  2619. uint16_t reconfig_flags;/* see RECONFIG_* */
  2620. char *requeue_exit; /* requeue exit values */
  2621. char *requeue_exit_hold; /* requeue exit hold values */
  2622. char *resume_fail_program; /* program to handle failed resume tries */
  2623. char *resume_program; /* program to make nodes full power */
  2624. uint16_t resume_rate; /* nodes to make full power, per minute */
  2625. uint16_t resume_timeout;/* time required in order to perform a node
  2626. * resume operation */
  2627. char *resv_epilog; /* path of reservation epilog run by slurmctld */
  2628. uint16_t resv_over_run; /* how long a running job can exceed
  2629. * reservation time */
  2630. char *resv_prolog; /* path of reservation prolog run by slurmctld */
  2631. uint16_t ret2service; /* 1 return DOWN node to service at
  2632. * registration */
  2633. char *route_plugin; /* route plugin */
  2634. char *salloc_default_command; /* default salloc command */
  2635. char *sbcast_parameters; /* sbcast command options */
  2636. char *sched_logfile; /* where slurm Scheduler log gets written */
  2637. uint16_t sched_log_level; /* configured level of slurm Scheduler log */
  2638. char *sched_params; /* SchedulerParameters OR
  2639. * contents of scheduler plugin config file */
  2640. uint16_t sched_time_slice; /* gang scheduler slice time, secs */
  2641. char *schedtype; /* type of scheduler to use */
  2642. char *select_type; /* type of node selector to use */
  2643. void *select_conf_key_pairs; /* key-pair list which can be
  2644. * listed with slurm_print_key_pairs() */
  2645. uint16_t select_type_param; /* Parameters
  2646. * describing the select_type plugin */
  2647. char *site_factor_plugin; /* PrioritySiteFactorPlugin */
  2648. char *site_factor_params; /* PrioritySiteFactorParameters */
  2649. char *slurm_conf; /* pathname of slurm config file */
  2650. uint32_t slurm_user_id; /* uid of slurm_user_name */
  2651. char *slurm_user_name; /* user that slurmctld runs as */
  2652. uint32_t slurmd_user_id;/* uid of slurmd_user_name */
  2653. char *slurmd_user_name; /* user that slurmd runs as */
  2654. char *slurmctld_addr; /* Address used for communications to the
  2655. * currently active slurmctld daemon */
  2656. uint16_t slurmctld_debug; /* slurmctld logging level */
  2657. char *slurmctld_logfile;/* where slurmctld error log gets written */
  2658. char *slurmctld_pidfile;/* where to put slurmctld pidfile */
  2659. char *slurmctld_plugstack;/* generic slurmctld plugins */
  2660. void *slurmctld_plugstack_conf ;/* generic slurmctld plugins configs */
  2661. uint32_t slurmctld_port; /* default communications port to slurmctld */
  2662. uint16_t slurmctld_port_count; /* number of slurmctld comm ports */
  2663. char *slurmctld_primary_off_prog; /* Run when becomes slurmctld backup */
  2664. char *slurmctld_primary_on_prog; /* Run when becomes slurmctld primary */
  2665. uint16_t slurmctld_syslog_debug; /* slurmctld output to
  2666. * local logfile and syslog*/
  2667. uint16_t slurmctld_timeout;/* seconds that backup controller waits
  2668. * on non-responding primarly controller */
  2669. char *slurmctld_params; /* SlurmctldParameters */
  2670. uint16_t slurmd_debug; /* slurmd logging level */
  2671. char *slurmd_logfile; /* where slurmd error log gets written */
  2672. char *slurmd_params; /* SlurmdParameters */
  2673. char *slurmd_pidfile; /* where to put slurmd pidfile */
  2674. uint32_t slurmd_port; /* default communications port to slurmd */
  2675. char *slurmd_spooldir; /* where slurmd put temporary state info */
  2676. uint16_t slurmd_syslog_debug; /* slurmd output to
  2677. * local logfile and syslog*/
  2678. uint16_t slurmd_timeout;/* how long slurmctld waits for slurmd before
  2679. * considering node DOWN */
  2680. char *srun_epilog; /* srun epilog program */
  2681. uint16_t *srun_port_range; /* port range for srun */
  2682. char *srun_prolog; /* srun prolog program */
  2683. char *state_save_location;/* pathname of slurmctld state save
  2684. * directory */
  2685. char *suspend_exc_nodes;/* nodes to not make power saving */
  2686. char *suspend_exc_parts;/* partitions to not make power saving */
  2687. char *suspend_program; /* program to make nodes power saving */
  2688. uint16_t suspend_rate; /* nodes to make power saving, per minute */
  2689. uint32_t suspend_time; /* node idle for this long before power save mode */
  2690. uint16_t suspend_timeout;/* time required in order to perform a node
  2691. * suspend operation */
  2692. char *switch_type; /* switch or interconnect type */
  2693. char *task_epilog; /* pathname of task launch epilog */
  2694. char *task_plugin; /* task launch plugin */
  2695. uint32_t task_plugin_param; /* see CPU_BIND_* */
  2696. char *task_prolog; /* pathname of task launch prolog */
  2697. char *tmp_fs; /* pathname of temporary file system */
  2698. char *topology_param; /* network topology parameters */
  2699. char *topology_plugin; /* network topology plugin */
  2700. uint16_t tree_width; /* number of threads per node to span */
  2701. char *unkillable_program; /* program run by the slurmstepd when
  2702. * processes in a job step are unkillable */
  2703. uint16_t unkillable_timeout; /* time in seconds, after processes in a
  2704. * job step have been signaled, before
  2705. * they are considered "unkillable". */
  2706. char *version; /* version of slurmctld */
  2707. uint16_t vsize_factor; /* virtual memory limit size factor */
  2708. uint16_t wait_time; /* default job --wait time */
  2709. char *x11_params; /* X11Parameters */
  2710. } slurm_ctl_conf_t;
  2711. typedef struct slurmd_status_msg {
  2712. time_t booted; /* when daemon was started */
  2713. time_t last_slurmctld_msg; /* time of last slurmctld message */
  2714. uint16_t slurmd_debug; /* logging level */
  2715. uint16_t actual_cpus; /* actual logical processor count */
  2716. uint16_t actual_boards; /* actual total boards count */
  2717. uint16_t actual_sockets; /* actual total sockets count */
  2718. uint16_t actual_cores; /* actual core per socket count */
  2719. uint16_t actual_threads; /* actual thread per core count */
  2720. uint64_t actual_real_mem; /* actual real memory in MB */
  2721. uint32_t actual_tmp_disk; /* actual temp disk space in MB */
  2722. uint32_t pid; /* process ID */
  2723. char *hostname; /* local hostname */
  2724. char *slurmd_logfile; /* slurmd log file location */
  2725. char *step_list; /* list of active job steps */
  2726. char *version; /* version running */
  2727. } slurmd_status_t;
  2728. typedef struct submit_response_msg {
  2729. uint32_t job_id; /* job ID */
  2730. uint32_t step_id; /* step ID */
  2731. uint32_t error_code; /* error code for warning message */
  2732. char *job_submit_user_msg; /* job submit plugin user_msg */
  2733. } submit_response_msg_t;
  2734. /* NOTE: If setting node_addr and/or node_hostname then comma separate names
  2735. * and include an equal number of node_names */
  2736. typedef struct slurm_update_node_msg {
  2737. uint32_t cpu_bind; /* default CPU binding type */
  2738. char *features; /* new available feature for node */
  2739. char *features_act; /* new active feature for node */
  2740. char *gres; /* new generic resources for node */
  2741. char *node_addr; /* communication name (optional) */
  2742. char *node_hostname; /* node's hostname (optional) */
  2743. char *node_names; /* nodelist expression */
  2744. uint32_t node_state; /* see enum node_states */
  2745. char *reason; /* reason for node being DOWN or DRAINING */
  2746. uint32_t reason_uid; /* user ID of sending (needed if user
  2747. * root is sending message) */
  2748. uint32_t weight; /* new weight for node */
  2749. } update_node_msg_t;
  2750. typedef struct slurm_update_front_end_msg {
  2751. char *name; /* comma separated list of front end nodes */
  2752. uint32_t node_state; /* see enum node_states */
  2753. char *reason; /* reason for node being DOWN or DRAINING */
  2754. uint32_t reason_uid; /* user ID of sending (needed if user
  2755. * root is sending message) */
  2756. } update_front_end_msg_t;
  2757. typedef struct partition_info update_part_msg_t;
  2758. typedef struct job_sbcast_cred_msg {
  2759. uint32_t job_id; /* assigned job id */
  2760. slurm_addr_t *node_addr; /* network addresses */
  2761. uint32_t node_cnt; /* count of nodes */
  2762. char *node_list; /* assigned list of nodes */
  2763. sbcast_cred_t *sbcast_cred; /* opaque data structure */
  2764. } job_sbcast_cred_msg_t;
  2765. typedef struct {
  2766. uint32_t lifespan;
  2767. char *username;
  2768. } token_request_msg_t;
  2769. typedef struct {
  2770. char *token;
  2771. } token_response_msg_t;
  2772. /* Opaque data type for slurm_step_ctx_* functions */
  2773. typedef struct slurm_step_ctx_struct slurm_step_ctx_t;
  2774. #define STAT_COMMAND_RESET 0x0000
  2775. #define STAT_COMMAND_GET 0x0001
  2776. typedef struct stats_info_request_msg {
  2777. uint16_t command_id;
  2778. } stats_info_request_msg_t;
  2779. typedef struct stats_info_response_msg {
  2780. uint32_t parts_packed;
  2781. time_t req_time;
  2782. time_t req_time_start;
  2783. uint32_t server_thread_count;
  2784. uint32_t agent_queue_size;
  2785. uint32_t agent_count;
  2786. uint32_t agent_thread_count;
  2787. uint32_t dbd_agent_queue_size;
  2788. uint32_t gettimeofday_latency;
  2789. uint32_t schedule_cycle_max;
  2790. uint32_t schedule_cycle_last;
  2791. uint32_t schedule_cycle_sum;
  2792. uint32_t schedule_cycle_counter;
  2793. uint32_t schedule_cycle_depth;
  2794. uint32_t schedule_queue_len;
  2795. uint32_t jobs_submitted;
  2796. uint32_t jobs_started;
  2797. uint32_t jobs_completed;
  2798. uint32_t jobs_canceled;
  2799. uint32_t jobs_failed;
  2800. uint32_t jobs_pending;
  2801. uint32_t jobs_running;
  2802. time_t job_states_ts;
  2803. uint32_t bf_backfilled_jobs;
  2804. uint32_t bf_last_backfilled_jobs;
  2805. uint32_t bf_backfilled_het_jobs;
  2806. uint32_t bf_cycle_counter;
  2807. uint64_t bf_cycle_sum;
  2808. uint32_t bf_cycle_last;
  2809. uint32_t bf_cycle_max;
  2810. uint32_t bf_last_depth;
  2811. uint32_t bf_last_depth_try;
  2812. uint32_t bf_depth_sum;
  2813. uint32_t bf_depth_try_sum;
  2814. uint32_t bf_queue_len;
  2815. uint32_t bf_queue_len_sum;
  2816. uint32_t bf_table_size;
  2817. uint32_t bf_table_size_sum;
  2818. time_t bf_when_last_cycle;
  2819. uint32_t bf_active;
  2820. uint32_t rpc_type_size;
  2821. uint16_t *rpc_type_id;
  2822. uint32_t *rpc_type_cnt;
  2823. uint64_t *rpc_type_time;
  2824. uint32_t rpc_user_size;
  2825. uint32_t *rpc_user_id;
  2826. uint32_t *rpc_user_cnt;
  2827. uint64_t *rpc_user_time;
  2828. uint32_t rpc_queue_type_count;
  2829. uint32_t *rpc_queue_type_id;
  2830. uint32_t *rpc_queue_count;
  2831. uint32_t rpc_dump_count;
  2832. uint32_t *rpc_dump_types;
  2833. char **rpc_dump_hostlist;
  2834. } stats_info_response_msg_t;
  2835. #define TRIGGER_FLAG_PERM 0x0001
  2836. #define TRIGGER_RES_TYPE_JOB 0x0001
  2837. #define TRIGGER_RES_TYPE_NODE 0x0002
  2838. #define TRIGGER_RES_TYPE_SLURMCTLD 0x0003
  2839. #define TRIGGER_RES_TYPE_SLURMDBD 0x0004
  2840. #define TRIGGER_RES_TYPE_DATABASE 0x0005
  2841. #define TRIGGER_RES_TYPE_FRONT_END 0x0006
  2842. #define TRIGGER_RES_TYPE_OTHER 0x0007
  2843. #define TRIGGER_TYPE_UP 0x00000001
  2844. #define TRIGGER_TYPE_DOWN 0x00000002
  2845. #define TRIGGER_TYPE_FAIL 0x00000004
  2846. #define TRIGGER_TYPE_TIME 0x00000008
  2847. #define TRIGGER_TYPE_FINI 0x00000010
  2848. #define TRIGGER_TYPE_RECONFIG 0x00000020
  2849. /* was TRIGGER_TYPE_BLOCK_ERR 0x00000040, removed v18.08 */
  2850. #define TRIGGER_TYPE_IDLE 0x00000080
  2851. #define TRIGGER_TYPE_DRAINED 0x00000100
  2852. #define TRIGGER_TYPE_PRI_CTLD_FAIL 0x00000200
  2853. #define TRIGGER_TYPE_PRI_CTLD_RES_OP 0x00000400
  2854. #define TRIGGER_TYPE_PRI_CTLD_RES_CTRL 0x00000800
  2855. #define TRIGGER_TYPE_PRI_CTLD_ACCT_FULL 0x00001000
  2856. #define TRIGGER_TYPE_BU_CTLD_FAIL 0x00002000
  2857. #define TRIGGER_TYPE_BU_CTLD_RES_OP 0x00004000
  2858. #define TRIGGER_TYPE_BU_CTLD_AS_CTRL 0x00008000
  2859. #define TRIGGER_TYPE_PRI_DBD_FAIL 0x00010000
  2860. #define TRIGGER_TYPE_PRI_DBD_RES_OP 0x00020000
  2861. #define TRIGGER_TYPE_PRI_DB_FAIL 0x00040000
  2862. #define TRIGGER_TYPE_PRI_DB_RES_OP 0x00080000
  2863. #define TRIGGER_TYPE_BURST_BUFFER 0x00100000
  2864. typedef struct trigger_info {
  2865. uint16_t flags; /* TRIGGER_FLAG_* */
  2866. uint32_t trig_id; /* trigger ID */
  2867. uint16_t res_type; /* TRIGGER_RES_TYPE_* */
  2868. char * res_id; /* resource ID */
  2869. uint32_t control_inx; /* controller index */
  2870. uint32_t trig_type; /* TRIGGER_TYPE_* */
  2871. uint16_t offset; /* seconds from trigger, 0x8000 origin */
  2872. uint32_t user_id; /* user requesting trigger */
  2873. char * program; /* program to execute */
  2874. } trigger_info_t;
  2875. typedef struct trigger_info_msg {
  2876. uint32_t record_count; /* number of records */
  2877. trigger_info_t *trigger_array; /* the trigger records */
  2878. } trigger_info_msg_t;
  2879. /* Individual license information
  2880. */
  2881. typedef struct slurm_license_info {
  2882. char *name; /* license name */
  2883. uint32_t total; /* total number of available licenses */
  2884. uint32_t in_use; /* number of license in use */
  2885. uint32_t available; /* number of available license */
  2886. uint8_t remote; /* non-zero if remote license (not
  2887. * defined in slurm.conf) */
  2888. } slurm_license_info_t;
  2889. /* License information array as returned by the controller.
  2890. */
  2891. typedef struct license_info_msg {
  2892. time_t last_update;
  2893. uint32_t num_lic;
  2894. slurm_license_info_t *lic_array;
  2895. } license_info_msg_t;
  2896. typedef struct {
  2897. uint32_t job_array_count;
  2898. char **job_array_id; /* Note: The string may be truncated */
  2899. uint32_t *error_code;
  2900. } job_array_resp_msg_t;
  2901. /* Association manager state running in the slurmctld */
  2902. typedef struct {
  2903. List assoc_list; /* list of slurmdb_assoc_rec_t with usage packed */
  2904. List qos_list; /* list of slurmdb_qos_rec_t with usage packed */
  2905. uint32_t tres_cnt;
  2906. char **tres_names;
  2907. List user_list; /* list of slurmdb_user_rec_t */
  2908. } assoc_mgr_info_msg_t;
  2909. #define ASSOC_MGR_INFO_FLAG_ASSOC 0x00000001
  2910. #define ASSOC_MGR_INFO_FLAG_USERS 0x00000002
  2911. #define ASSOC_MGR_INFO_FLAG_QOS 0x00000004
  2912. typedef struct {
  2913. List acct_list; /* char * list of account names */
  2914. uint32_t flags; /* flags determining what is returned */
  2915. List qos_list; /* char * list of qos names */
  2916. List user_list; /* char * list of user names */
  2917. } assoc_mgr_info_request_msg_t;
  2918. typedef struct network_callerid_msg {
  2919. unsigned char ip_src[16];
  2920. unsigned char ip_dst[16];
  2921. uint32_t port_src;
  2922. uint32_t port_dst;
  2923. int32_t af; /* NOTE: un/packed as uint32_t */
  2924. } network_callerid_msg_t;
  2925. /*****************************************************************************\
  2926. * RESOURCE ALLOCATION FUNCTIONS
  2927. \*****************************************************************************/
  2928. /*
  2929. * slurm_init_job_desc_msg - initialize job descriptor with
  2930. * default values
  2931. * OUT job_desc_msg - user defined job descriptor
  2932. */
  2933. extern void slurm_init_job_desc_msg(job_desc_msg_t *job_desc_msg);
  2934. /*
  2935. * slurm_allocate_resources - allocate resources for a job request
  2936. * If the requested resources are not immediately available, the slurmctld
  2937. * will send the job_alloc_resp_msg to the specified node and port.
  2938. * IN job_desc_msg - description of resource allocation request
  2939. * OUT job_alloc_resp_msg - response to request. This only represents
  2940. * a job allocation if resources are immediately. Otherwise it just contains
  2941. * the job id of the enqueued job request.
  2942. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  2943. * NOTE: free the response using slurm_free_resource_allocation_response_msg()
  2944. */
  2945. extern int slurm_allocate_resources(job_desc_msg_t *job_desc_msg,
  2946. resource_allocation_response_msg_t **job_alloc_resp_msg);
  2947. /*
  2948. * slurm_allocate_resources_blocking
  2949. * allocate resources for a job request. This call will block until
  2950. * the allocation is granted, or the specified timeout limit is reached.
  2951. * IN req - description of resource allocation request
  2952. * IN timeout - amount of time, in seconds, to wait for a response before
  2953. * giving up.
  2954. * A timeout of zero will wait indefinitely.
  2955. * IN pending_callback - If the allocation cannot be granted immediately,
  2956. * the controller will put the job in the PENDING state. If
  2957. * pending callback is not NULL, it will be called with the job_id
  2958. * of the pending job as the sole parameter.
  2959. *
  2960. * RET allocation structure on success, NULL on error set errno to
  2961. * indicate the error (errno will be ETIMEDOUT if the timeout is reached
  2962. * with no allocation granted)
  2963. * NOTE: free the response using slurm_free_resource_allocation_response_msg()
  2964. */
  2965. extern resource_allocation_response_msg_t *slurm_allocate_resources_blocking(
  2966. const job_desc_msg_t *user_req,
  2967. time_t timeout,
  2968. void (*pending_callback)(uint32_t job_id));
  2969. /*
  2970. * slurm_free_resource_allocation_response_msg - free slurm resource
  2971. * allocation response message
  2972. * IN msg - pointer to allocation response message
  2973. * NOTE: buffer is loaded by slurm_allocate_resources
  2974. */
  2975. extern void slurm_free_resource_allocation_response_msg(resource_allocation_response_msg_t *msg);
  2976. /*
  2977. * slurm_allocate_het_job_blocking
  2978. * allocate resources for a list of job requests. This call will block
  2979. * until the entire allocation is granted, or the specified timeout limit
  2980. * is reached.
  2981. * IN job_req_list - List of resource allocation requests, type job_desc_msg_t
  2982. * IN timeout - amount of time, in seconds, to wait for a response before
  2983. * giving up.
  2984. * A timeout of zero will wait indefinitely.
  2985. * IN pending_callback - If the allocation cannot be granted immediately,
  2986. * the controller will put the job in the PENDING state. If
  2987. * pending callback is not NULL, it will be called with the job_id
  2988. * of the pending job as the sole parameter.
  2989. *
  2990. * RET List of allocation structures on success, NULL on error set errno to
  2991. * indicate the error (errno will be ETIMEDOUT if the timeout is reached
  2992. * with no allocation granted)
  2993. * NOTE: free the response using list_destroy()
  2994. */
  2995. List slurm_allocate_het_job_blocking(List job_req_list, time_t timeout,
  2996. void(*pending_callback)(uint32_t job_id));
  2997. /*
  2998. * slurm_allocation_lookup - retrieve info for an existing resource
  2999. * allocation
  3000. * IN job_id - job allocation identifier
  3001. * OUT resp - job allocation information
  3002. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3003. * NOTE: free the response using slurm_free_resource_allocation_response_msg()
  3004. */
  3005. extern int slurm_allocation_lookup(uint32_t job_id,
  3006. resource_allocation_response_msg_t **resp);
  3007. /*
  3008. * slurm_het_job_lookup - retrieve info for an existing heterogeneous job
  3009. * allocation without the addrs and such
  3010. * IN jobid - job allocation identifier
  3011. * OUT resp - list of job allocation information, type
  3012. * resource_allocation_response_msg_t
  3013. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3014. * NOTE: returns information an individual job as well
  3015. * NOTE: free the response using list_destroy()
  3016. */
  3017. extern int slurm_het_job_lookup(uint32_t jobid, List *resp);
  3018. /*
  3019. * slurm_read_hostfile - Read a Slurm hostfile specified by "filename".
  3020. * "filename" must contain a list of Slurm NodeNames, one per line.
  3021. * Reads up to "n" number of hostnames from the file. Returns a
  3022. * string representing a hostlist ranged string of the contents of
  3023. * the file. This is a helper function, it does not contact any
  3024. * Slurm daemons.
  3025. *
  3026. * IN filename - name of Slurm Hostlist file to be read.
  3027. * IN n - number of NodeNames required
  3028. * RET - a string representing the hostlist. Returns NULL if there are
  3029. * fewer than "n" hostnames in the file, or if an error occurs.
  3030. *
  3031. * NOTE: Returned string must be freed with free().
  3032. */
  3033. extern char *slurm_read_hostfile(const char *filename, int n);
  3034. /*
  3035. * slurm_allocation_msg_thr_create - startup a message handler talking
  3036. * with the controller dealing with messages from the controller during an
  3037. * allocation.
  3038. * IN port - port we are listening for messages on from the controller
  3039. * IN callbacks - callbacks for different types of messages
  3040. * RET allocation_msg_thread_t * or NULL on failure
  3041. */
  3042. extern allocation_msg_thread_t *slurm_allocation_msg_thr_create(uint16_t *port,
  3043. const slurm_allocation_callbacks_t *callbacks);
  3044. /*
  3045. * slurm_allocation_msg_thr_destroy - shutdown the message handler talking
  3046. * with the controller dealing with messages from the controller during an
  3047. * allocation.
  3048. * IN msg_thr - allocation_msg_thread_t pointer allocated with
  3049. * slurm_allocation_msg_thr_create
  3050. */
  3051. extern void slurm_allocation_msg_thr_destroy(allocation_msg_thread_t *msg_thr);
  3052. /*
  3053. * slurm_submit_batch_job - issue RPC to submit a job for later execution
  3054. * NOTE: free the response using slurm_free_submit_response_response_msg
  3055. * IN job_desc_msg - description of batch job request
  3056. * OUT slurm_alloc_msg - response to request
  3057. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3058. */
  3059. extern int slurm_submit_batch_job(job_desc_msg_t *job_desc_msg,
  3060. submit_response_msg_t **slurm_alloc_msg);
  3061. /*
  3062. * slurm_submit_batch_het_job - issue RPC to submit a heterogeneous job for
  3063. * later execution
  3064. * NOTE: free the response using slurm_free_submit_response_response_msg
  3065. * IN job_req_list - List of resource allocation requests, type job_desc_msg_t
  3066. * OUT slurm_alloc_msg - response to request
  3067. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3068. */
  3069. extern int slurm_submit_batch_het_job(List job_req_list,
  3070. submit_response_msg_t **slurm_alloc_msg);
  3071. /*
  3072. * slurm_free_submit_response_response_msg - free slurm
  3073. * job submit response message
  3074. * IN msg - pointer to job submit response message
  3075. * NOTE: buffer is loaded by slurm_submit_batch_job
  3076. */
  3077. extern void slurm_free_submit_response_response_msg(submit_response_msg_t *msg);
  3078. /*
  3079. * slurm_job_batch_script - retrieve the batch script for a given jobid
  3080. * returns SLURM_SUCCESS, or appropriate error code
  3081. */
  3082. extern int slurm_job_batch_script(FILE *out, uint32_t jobid);
  3083. /*
  3084. * slurm_job_will_run - determine if a job would execute immediately if
  3085. * submitted now
  3086. * IN job_desc_msg - description of resource allocation request
  3087. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3088. */
  3089. extern int slurm_job_will_run(job_desc_msg_t *job_desc_msg);
  3090. /*
  3091. * slurm_het_job_will_run - determine if a heterogeneous job would execute
  3092. * immediately if submitted now
  3093. * IN job_req_list - List of job_desc_msg_t structures describing the resource
  3094. * allocation request
  3095. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3096. */
  3097. extern int slurm_het_job_will_run(List job_req_list);
  3098. /*
  3099. * slurm_job_will_run2 - determine if a job would execute immediately if
  3100. * submitted now
  3101. * IN job_desc_msg - description of resource allocation request
  3102. * OUT will_run_resp - job run time data
  3103. * free using slurm_free_will_run_response_msg()
  3104. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3105. */
  3106. extern int slurm_job_will_run2(job_desc_msg_t *req,
  3107. will_run_response_msg_t **will_run_resp);
  3108. /*
  3109. * slurm_sbcast_lookup - retrieve info for an existing resource allocation
  3110. * including a credential needed for sbcast
  3111. * IN job_id - job allocation identifier (or hetjob ID)
  3112. * IN het_job_offset - hetjob index (or NO_VAL if not hetjob)
  3113. * IN step_id - step allocation identifier (or NO_VAL for entire job)
  3114. * OUT info - job allocation information including a credential for sbcast
  3115. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3116. * NOTE: free the "resp" using slurm_free_sbcast_cred_msg
  3117. */
  3118. extern int slurm_sbcast_lookup(uint32_t job_id, uint32_t het_job_offset,
  3119. uint32_t step_id, job_sbcast_cred_msg_t **info);
  3120. extern void slurm_free_sbcast_cred_msg(job_sbcast_cred_msg_t *msg);
  3121. /* slurm_load_licenses()
  3122. *
  3123. * Retrieve license information from the controller.
  3124. * IN feature - feature name or NULL
  3125. * OUT
  3126. *
  3127. */
  3128. extern int slurm_load_licenses(time_t, license_info_msg_t **, uint16_t);
  3129. extern void slurm_free_license_info_msg(license_info_msg_t *);
  3130. /* get the running assoc_mgr info
  3131. * IN assoc_mgr_info_request_msg_t: request filtering data returned
  3132. * OUT assoc_mgr_info_msg_t: returned structure filled in with
  3133. * assoc_mgr lists, must be freed by slurm_free_assoc_mgr_info_msg
  3134. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3135. */
  3136. extern int slurm_load_assoc_mgr_info(assoc_mgr_info_request_msg_t *,
  3137. assoc_mgr_info_msg_t **);
  3138. extern void slurm_free_assoc_mgr_info_msg(assoc_mgr_info_msg_t *);
  3139. extern void slurm_free_assoc_mgr_info_request_members(assoc_mgr_info_request_msg_t *);
  3140. extern void slurm_free_assoc_mgr_info_request_msg(assoc_mgr_info_request_msg_t *);
  3141. /*****************************************************************************\
  3142. * JOB/STEP SIGNALING FUNCTIONS
  3143. \*****************************************************************************/
  3144. typedef struct job_step_kill_msg {
  3145. uint32_t job_id;
  3146. char *sjob_id;
  3147. uint32_t job_step_id;
  3148. uint16_t signal;
  3149. uint16_t flags;
  3150. char *sibling;
  3151. } job_step_kill_msg_t;
  3152. /*
  3153. * NOTE: See _signal_batch_job() controller and _rpc_signal_tasks() in slurmd.
  3154. */
  3155. #define KILL_JOB_BATCH 0x0001 /* signal batch shell only */
  3156. #define KILL_JOB_ARRAY 0x0002 /* kill all elements of a job array */
  3157. #define KILL_STEPS_ONLY 0x0004 /* Do not signal batch script */
  3158. #define KILL_FULL_JOB 0x0008 /* Signal all steps, including batch script */
  3159. #define KILL_FED_REQUEUE 0x0010 /* Mark job as requeued when requeued */
  3160. #define KILL_HURRY 0x0020 /* Skip burst buffer stage out */
  3161. #define KILL_OOM 0x0040 /* Kill due to Out-Of-Memory */
  3162. #define KILL_NO_SIBS 0x0080 /* Don't kill other sibling jobs */
  3163. #define KILL_JOB_RESV 0x0100 /* Job is willing to run on nodes in a
  3164. * promiscuous reservation. */
  3165. /* Use top bit of uint16_t in conjuction with KILL_* flags to indicate signal
  3166. * has been sent to job previously. Does not need to be passed to slurmd. */
  3167. #define WARN_SENT 0x8000 /* warn already sent, clear this on requeue */
  3168. /*
  3169. * slurm_kill_job - send the specified signal to all steps of an existing job
  3170. * IN job_id - the job's id
  3171. * IN signal - signal number
  3172. * IN flags - see KILL_JOB_* flags above
  3173. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3174. */
  3175. extern int slurm_kill_job(uint32_t job_id, uint16_t signal, uint16_t flags);
  3176. /*
  3177. * slurm_kill_job_step - send the specified signal to an existing job step
  3178. * IN job_id - the job's id
  3179. * IN step_id - the job step's id
  3180. * IN signal - signal number
  3181. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3182. */
  3183. extern int slurm_kill_job_step(uint32_t job_id,
  3184. uint32_t step_id,
  3185. uint16_t signal);
  3186. /*
  3187. * slurm_kill_job2()
  3188. */
  3189. extern int slurm_kill_job2(const char *job_id, uint16_t signal, uint16_t flags);
  3190. /*
  3191. * slurm_kill_job_msg - send kill msg to and existing job or step.
  3192. *
  3193. * IN msg_type - msg_type to send
  3194. * IN kill_msg - job_step_kill_msg_t parameters.
  3195. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3196. */
  3197. extern int slurm_kill_job_msg(uint16_t msg_type, job_step_kill_msg_t *kill_msg);
  3198. /*
  3199. * slurm_signal_job - send the specified signal to all steps of an existing job
  3200. * IN job_id - the job's id
  3201. * IN signal - signal number
  3202. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3203. */
  3204. extern int slurm_signal_job(uint32_t job_id, uint16_t signal);
  3205. /*
  3206. * slurm_signal_job_step - send the specified signal to an existing job step
  3207. * IN job_id - the job's id
  3208. * IN step_id - the job step's id - use SLURM_BATCH_SCRIPT as the step_id
  3209. * to send a signal to a job's batch script
  3210. * IN signal - signal number
  3211. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3212. */
  3213. extern int slurm_signal_job_step(uint32_t job_id,
  3214. uint32_t step_id,
  3215. uint32_t signal);
  3216. /*****************************************************************************\
  3217. * JOB/STEP COMPLETION FUNCTIONS
  3218. \*****************************************************************************/
  3219. /*
  3220. * slurm_complete_job - note the completion of a job and all of its steps
  3221. * IN job_id - the job's id
  3222. * IN job_return_code - the highest exit code of any task of the job
  3223. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3224. */
  3225. extern int slurm_complete_job(uint32_t job_id, uint32_t job_return_code);
  3226. /*
  3227. * slurm_terminate_job_step - terminates a job step by sending a
  3228. * REQUEST_TERMINATE_TASKS rpc to all slurmd of a job step, and then
  3229. * calls slurm_complete_job_step() after verifying that all
  3230. * nodes in the job step no longer have running tasks from the job
  3231. * step. (May take over 35 seconds to return.)
  3232. * IN job_id - the job's id
  3233. * IN step_id - the job step's id - use SLURM_BATCH_SCRIPT as the step_id
  3234. * to terminate a job's batch script
  3235. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3236. */
  3237. extern int slurm_terminate_job_step(uint32_t job_id, uint32_t step_id);
  3238. /*****************************************************************************\
  3239. * SLURM TASK SPAWNING FUNCTIONS
  3240. \*****************************************************************************/
  3241. /*
  3242. * slurm_step_ctx_params_t_init - This initializes parameters
  3243. * in the structure that you will pass to slurm_step_ctx_create().
  3244. * This function will NOT allocate any new memory.
  3245. * IN ptr - pointer to a structure allocated by the user. The structure will
  3246. * be initialized.
  3247. */
  3248. extern void slurm_step_ctx_params_t_init(slurm_step_ctx_params_t *ptr);
  3249. /*
  3250. * slurm_step_ctx_create - Create a job step and its context.
  3251. * IN step_params - job step parameters
  3252. * RET the step context or NULL on failure with slurm errno set
  3253. * NOTE: Free allocated memory using slurm_step_ctx_destroy.
  3254. */
  3255. extern slurm_step_ctx_t *slurm_step_ctx_create(const slurm_step_ctx_params_t *step_params);
  3256. /*
  3257. * slurm_step_ctx_create_timeout - Create a job step and its context.
  3258. * IN step_params - job step parameters
  3259. * IN timeout - in milliseconds
  3260. * RET the step context or NULL on failure with slurm errno set
  3261. * NOTE: Free allocated memory using slurm_step_ctx_destroy.
  3262. */
  3263. extern slurm_step_ctx_t *slurm_step_ctx_create_timeout(const slurm_step_ctx_params_t *step_params,
  3264. int timeout);
  3265. /*
  3266. * Return TRUE if the job step create request should be retried later
  3267. * (i.e. the errno set by slurm_step_ctx_create_timeout() is recoverable).
  3268. */
  3269. extern bool slurm_step_retry_errno(int rc);
  3270. /*
  3271. * slurm_step_ctx_create_no_alloc - Create a job step and its context without
  3272. * getting an allocation.
  3273. * IN step_params - job step parameters
  3274. * IN step_id - since we are faking it give me the id to use
  3275. * RET the step context or NULL on failure with slurm errno set
  3276. * NOTE: Free allocated memory using slurm_step_ctx_destroy.
  3277. */
  3278. extern slurm_step_ctx_t *slurm_step_ctx_create_no_alloc(const slurm_step_ctx_params_t *step_params,
  3279. uint32_t step_id);
  3280. /*
  3281. * slurm_step_ctx_get - get parameters from a job step context.
  3282. * IN ctx - job step context generated by slurm_step_ctx_create
  3283. * RET SLURM_SUCCESS or SLURM_ERROR (with slurm_errno set)
  3284. */
  3285. extern int slurm_step_ctx_get(slurm_step_ctx_t *ctx, int ctx_key, ...);
  3286. /*
  3287. * slurm_jobinfo_ctx_get - get parameters from jobinfo context.
  3288. * IN jobinfo - job information from context, returned by slurm_step_ctx_get()
  3289. * IN data_type - type of data required, specific to the switch type
  3290. * OUT data - the requested data type
  3291. * RET SLURM_SUCCESS or SLURM_ERROR (with slurm_errno set)
  3292. */
  3293. extern int slurm_jobinfo_ctx_get(dynamic_plugin_data_t *jobinfo,
  3294. int data_type,
  3295. void *data);
  3296. /*
  3297. * slurm_step_ctx_daemon_per_node_hack - Hack the step context
  3298. * to run a single process per node, regardless of the settings
  3299. * selected at slurm_step_ctx_create time.
  3300. *
  3301. * This is primarily used when launching 1 task per node as done
  3302. * with IBM's PE where we want to launch a single pmd daemon
  3303. * on each node regardless of the number of tasks running on each
  3304. * node.
  3305. * IN ctx - job step context generated by slurm_step_ctx_create
  3306. * IN node_list - node list of nodes to run on
  3307. * IN node_cnt - number of nodes to run on
  3308. * IN/OUT curr_task_num - task_id of newest task, initialze to zero
  3309. * RET SLURM_SUCCESS or SLURM_ERROR (with slurm_errno set)
  3310. */
  3311. extern int slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx_t *ctx,
  3312. char *node_list,
  3313. uint32_t node_cnt,
  3314. uint32_t *curr_task_num);
  3315. /*
  3316. * slurm_step_ctx_destroy - free allocated memory for a job step context.
  3317. * IN ctx - job step context generated by slurm_step_ctx_create
  3318. * RET SLURM_SUCCESS or SLURM_ERROR (with slurm_errno set)
  3319. */
  3320. extern int slurm_step_ctx_destroy(slurm_step_ctx_t *ctx);
  3321. /*
  3322. * slurm_step_launch_params_t_init - initialize a user-allocated
  3323. * slurm_step_launch_params_t structure with default values.
  3324. * default values. This function will NOT allocate any new memory.
  3325. * IN ptr - pointer to a structure allocated by the use. The structure will
  3326. * be initialized.
  3327. */
  3328. extern void slurm_step_launch_params_t_init(slurm_step_launch_params_t *ptr);
  3329. /*
  3330. * slurm_step_launch - launch a parallel job step
  3331. * IN ctx - job step context generated by slurm_step_ctx_create
  3332. * IN params - job step parameters
  3333. * IN callbacks - Identify functions to be called when various events occur
  3334. * IN het_job_step_cnt - Total count of hetjob steps to be launched, -1 otherwise
  3335. * RET SLURM_SUCCESS or SLURM_ERROR (with errno set)
  3336. */
  3337. extern int slurm_step_launch(slurm_step_ctx_t *ctx,
  3338. const slurm_step_launch_params_t *params,
  3339. const slurm_step_launch_callbacks_t *callbacks);
  3340. /*
  3341. * slurm_step_launch_add - Add tasks to a step that was already started
  3342. * IN ctx - job step context generated by slurm_step_ctx_create
  3343. * IN first_ctx - job step context generated by slurm_step_ctx_create for
  3344. * first component of the job step
  3345. * IN params - job step parameters
  3346. * IN node_list - list of extra nodes to add
  3347. * IN start_nodeid - in the global scheme which node id is the first
  3348. * node in node_list.
  3349. * RET SLURM_SUCCESS or SLURM_ERROR (with errno set)
  3350. */
  3351. extern int slurm_step_launch_add(slurm_step_ctx_t *ctx,
  3352. slurm_step_ctx_t *first_ctx,
  3353. const slurm_step_launch_params_t *params,
  3354. char *node_list, int start_nodeid);
  3355. /*
  3356. * Block until all tasks have started.
  3357. */
  3358. extern int slurm_step_launch_wait_start(slurm_step_ctx_t *ctx);
  3359. /*
  3360. * Block until all tasks have finished (or failed to start altogether).
  3361. */
  3362. extern void slurm_step_launch_wait_finish(slurm_step_ctx_t *ctx);
  3363. /*
  3364. * Abort an in-progress launch, or terminate the fully launched job step.
  3365. *
  3366. * Can be called from a signal handler.
  3367. */
  3368. extern void slurm_step_launch_abort(slurm_step_ctx_t *ctx);
  3369. /*
  3370. * Forward a signal to all those nodes with running tasks
  3371. */
  3372. extern void slurm_step_launch_fwd_signal(slurm_step_ctx_t *ctx, int signo);
  3373. /*
  3374. * Wake tasks stopped for debugging on nodes with running tasks
  3375. */
  3376. extern void slurm_step_launch_fwd_wake(slurm_step_ctx_t *ctx);
  3377. /*
  3378. * Specify the plugin name to be used. This may be needed to specify the
  3379. * non-default MPI plugin when using Slurm API to launch tasks.
  3380. * IN plugin name - "none", "pmi2", etc.
  3381. * RET SLURM_SUCCESS or SLURM_ERROR (with errno set)
  3382. */
  3383. extern int slurm_mpi_plugin_init(char *plugin_name);
  3384. /*****************************************************************************\
  3385. * SLURM CONTROL CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
  3386. \*****************************************************************************/
  3387. /*
  3388. * slurm_api_version - Return a single number reflecting the Slurm API's
  3389. * version number. Use the macros SLURM_VERSION_NUM, SLURM_VERSION_MAJOR,
  3390. * SLURM_VERSION_MINOR, and SLURM_VERSION_MICRO to work with this value
  3391. * RET API's version number
  3392. */
  3393. extern long slurm_api_version(void);
  3394. /*
  3395. * slurm_load_ctl_conf - issue RPC to get slurm control configuration
  3396. * information if changed since update_time
  3397. * IN update_time - time of current configuration data
  3398. * IN slurm_ctl_conf_ptr - place to store slurm control configuration
  3399. * pointer
  3400. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3401. * NOTE: free the response using slurm_free_ctl_conf
  3402. */
  3403. extern int slurm_load_ctl_conf(time_t update_time,
  3404. slurm_ctl_conf_t **slurm_ctl_conf_ptr);
  3405. /*
  3406. * slurm_free_ctl_conf - free slurm control information response message
  3407. * IN msg - pointer to slurm control information response message
  3408. * NOTE: buffer is loaded by slurm_load_ctl_conf
  3409. */
  3410. extern void slurm_free_ctl_conf(slurm_ctl_conf_t *slurm_ctl_conf_ptr);
  3411. /*
  3412. * slurm_print_ctl_conf - output the contents of slurm control configuration
  3413. * message as loaded using slurm_load_ctl_conf
  3414. * IN out - file to write to
  3415. * IN slurm_ctl_conf_ptr - slurm control configuration pointer
  3416. */
  3417. extern void slurm_print_ctl_conf(FILE *out,
  3418. slurm_ctl_conf_t *slurm_ctl_conf_ptr);
  3419. /*
  3420. * slurm_write_ctl_conf - write the contents of slurm control configuration
  3421. * message as loaded using slurm_load_ctl_conf to a file
  3422. * IN out - file to write to
  3423. * IN slurm_ctl_conf_ptr - slurm control configuration pointer
  3424. * IN node_info_ptr - pointer to node table of information
  3425. * IN part_info_ptr - pointer to partition information
  3426. */
  3427. extern void slurm_write_ctl_conf(slurm_ctl_conf_t *slurm_ctl_conf_ptr,
  3428. node_info_msg_t *node_info_ptr,
  3429. partition_info_msg_t *part_info_ptr);
  3430. /*
  3431. * slurm_ctl_conf_2_key_pairs - put the slurm_ctl_conf_t variables into
  3432. * a List of opaque data type config_key_pair_t
  3433. * IN slurm_ctl_conf_ptr - slurm control configuration pointer
  3434. * RET List of opaque data type config_key_pair_t
  3435. */
  3436. extern void *slurm_ctl_conf_2_key_pairs(slurm_ctl_conf_t *slurm_ctl_conf_ptr);
  3437. /*
  3438. * slurm_print_key_pairs - output the contents of key_pairs
  3439. * which is a list of opaque data type config_key_pair_t
  3440. * IN out - file to write to
  3441. * IN key_pairs - List containing key pairs to be printed
  3442. * IN title - title of key pair list
  3443. */
  3444. extern void slurm_print_key_pairs(FILE *out, void *key_pairs, char *title);
  3445. /*
  3446. * slurm_load_slurmd_status - issue RPC to get the status of slurmd
  3447. * daemon on this machine
  3448. * IN slurmd_status_ptr - place to store slurmd status information
  3449. * RET 0 or -1 on error
  3450. * NOTE: free the response using slurm_free_slurmd_status()
  3451. */
  3452. extern int slurm_load_slurmd_status(slurmd_status_t **slurmd_status_ptr);
  3453. /*
  3454. * slurm_free_slurmd_status - free slurmd state information
  3455. * IN msg - pointer to slurmd state information
  3456. * NOTE: buffer is loaded by slurm_load_slurmd_status
  3457. */
  3458. extern void slurm_free_slurmd_status(slurmd_status_t* slurmd_status_ptr);
  3459. /*
  3460. * slurm_print_slurmd_status - output the contents of slurmd status
  3461. * message as loaded using slurm_load_slurmd_status
  3462. * IN out - file to write to
  3463. * IN slurmd_status_ptr - slurmd status pointer
  3464. */
  3465. void slurm_print_slurmd_status(FILE *out, slurmd_status_t *slurmd_status_ptr);
  3466. /*
  3467. * slurm_init_update_step_msg - initialize step update message with default
  3468. * values before calling slurm_update_step()
  3469. * OUT step_msg - step update messasge descriptor
  3470. */
  3471. extern void slurm_init_update_step_msg(step_update_request_msg_t *step_msg);
  3472. /* Get scheduling statistics */
  3473. extern int slurm_get_statistics(stats_info_response_msg_t **buf,
  3474. stats_info_request_msg_t *req);
  3475. /* Reset scheduling statistics */
  3476. extern int slurm_reset_statistics(stats_info_request_msg_t *req);
  3477. /*****************************************************************************\
  3478. * SLURM JOB RESOURCES READ/PRINT FUNCTIONS
  3479. \*****************************************************************************/
  3480. /*
  3481. * slurm_job_cpus_allocated_on_node_id -
  3482. * get the number of cpus allocated to a job
  3483. * on a node by node id
  3484. * IN job_resrcs_ptr - pointer to job_resources structure
  3485. * IN node_id - zero-origin node id in allocation
  3486. * RET number of CPUs allocated to job on this node or -1 on error
  3487. */
  3488. extern int slurm_job_cpus_allocated_on_node_id(job_resources_t *job_resrcs_ptr,
  3489. int node_id);
  3490. /*
  3491. * slurm_job_cpus_allocated_on_node -
  3492. * get the number of cpus allocated to a job
  3493. * on a node by node name
  3494. * IN job_resrcs_ptr - pointer to job_resources structure
  3495. * IN node_name - name of node
  3496. * RET number of CPUs allocated to job on this node or -1 on error
  3497. */
  3498. extern int slurm_job_cpus_allocated_on_node(job_resources_t *job_resrcs_ptr,
  3499. const char *node_name);
  3500. /*
  3501. * slurm_job_cpus_allocated_str_on_node_id -
  3502. * get the string representation of cpus allocated
  3503. * to a job on a node by node id
  3504. * IN cpus - str where the resulting cpu list is returned
  3505. * IN cpus_len - max size of cpus str
  3506. * IN job_resrcs_ptr - pointer to job_resources structure
  3507. * IN node_id - zero-origin node id in allocation
  3508. * RET 0 on success or -1 on error
  3509. */
  3510. extern int slurm_job_cpus_allocated_str_on_node_id(char *cpus,
  3511. size_t cpus_len,
  3512. job_resources_t *job_resrcs_ptr,
  3513. int node_id);
  3514. /*
  3515. * slurm_job_cpus_allocated_str_on_node -
  3516. * get the string representation of cpus allocated
  3517. * to a job on a node by node name
  3518. * IN cpus - str where the resulting cpu list is returned
  3519. * IN cpus_len - max size of cpus str
  3520. * IN job_resrcs_ptr - pointer to job_resources structure
  3521. * IN node_name - name of node
  3522. * RET 0 on success or -1 on error
  3523. */
  3524. extern int slurm_job_cpus_allocated_str_on_node(char *cpus,
  3525. size_t cpus_len,
  3526. job_resources_t *job_resrcs_ptr,
  3527. const char *node_name);
  3528. /*****************************************************************************\
  3529. * SLURM JOB CONTROL CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
  3530. \*****************************************************************************/
  3531. /*
  3532. * slurm_free_job_info_msg - free the job information response message
  3533. * IN msg - pointer to job information response message
  3534. * NOTE: buffer is loaded by slurm_load_jobs()
  3535. */
  3536. extern void slurm_free_job_info_msg(job_info_msg_t *job_buffer_ptr);
  3537. /*
  3538. * slurm_free_priority_factors_response_msg - free the job priority factor
  3539. * information response message
  3540. * IN msg - pointer to job priority information response message
  3541. * NOTE: buffer is loaded by slurm_load_job_prio()
  3542. */
  3543. extern void slurm_free_priority_factors_response_msg(
  3544. priority_factors_response_msg_t *factors_resp);
  3545. /*
  3546. * slurm_get_end_time - get the expected end time for a given slurm job
  3547. * IN jobid - slurm job id
  3548. * end_time_ptr - location in which to store scheduled end time for job
  3549. * RET 0 or -1 on error
  3550. */
  3551. extern int slurm_get_end_time(uint32_t jobid, time_t *end_time_ptr);
  3552. /* Given a job record pointer, return its stderr path */
  3553. extern void slurm_get_job_stderr(char *buf, int buf_size, job_info_t *job_ptr);
  3554. /* Given a job record pointer, return its stdin path */
  3555. extern void slurm_get_job_stdin(char *buf, int buf_size, job_info_t *job_ptr);
  3556. /* Given a job record pointer, return its stdout path */
  3557. extern void slurm_get_job_stdout(char *buf, int buf_size, job_info_t *job_ptr);
  3558. /*
  3559. * slurm_get_rem_time - get the expected time remaining for a given job
  3560. * IN jobid - slurm job id
  3561. * RET remaining time in seconds or -1 on error
  3562. */
  3563. extern long slurm_get_rem_time(uint32_t jobid);
  3564. /*
  3565. * slurm_job_node_ready - report if nodes are ready for job to execute now
  3566. * IN job_id - slurm job id
  3567. * RET: READY_* values defined above
  3568. */
  3569. extern int slurm_job_node_ready(uint32_t job_id);
  3570. /*
  3571. * slurm_load_job - issue RPC to get job information for one job ID
  3572. * IN job_info_msg_pptr - place to store a job configuration pointer
  3573. * IN job_id - ID of job we want information about
  3574. * IN show_flags - job filtering options
  3575. * RET 0 or -1 on error
  3576. * NOTE: free the response using slurm_free_job_info_msg
  3577. */
  3578. extern int slurm_load_job(job_info_msg_t **resp,
  3579. uint32_t job_id,
  3580. uint16_t show_flags);
  3581. /*
  3582. * slurm_load_job_prio - issue RPC to get job priority information for
  3583. * jobs which pass filter test
  3584. * OUT factors_resp - job priority factors
  3585. * IN job_id_list - list of job IDs to be reported
  3586. * IN partitions - comma delimited list of partition names to be reported
  3587. * IN uid_list - list of user IDs to be reported
  3588. * IN show_flags - job filtering option: 0 or SHOW_LOCAL
  3589. * RET 0 or -1 on error
  3590. * NOTE: free the response using slurm_free_priority_factors_response_msg()
  3591. */
  3592. extern int slurm_load_job_prio(priority_factors_response_msg_t **factors_resp,
  3593. List job_id_list, char *partitions,
  3594. List uid_list, uint16_t show_flags);
  3595. /*
  3596. * slurm_load_job_user - issue RPC to get slurm information about all jobs
  3597. * to be run as the specified user
  3598. * IN/OUT job_info_msg_pptr - place to store a job configuration pointer
  3599. * IN user_id - ID of user we want information for
  3600. * IN show_flags - job filtering options
  3601. * RET 0 or -1 on error
  3602. * NOTE: free the response using slurm_free_job_info_msg
  3603. */
  3604. extern int slurm_load_job_user(job_info_msg_t **job_info_msg_pptr,
  3605. uint32_t user_id,
  3606. uint16_t show_flags);
  3607. /*
  3608. * slurm_load_jobs - issue RPC to get slurm all job configuration
  3609. * information if changed since update_time
  3610. * IN update_time - time of current configuration data
  3611. * IN/OUT job_info_msg_pptr - place to store a job configuration pointer
  3612. * IN show_flags - job filtering options
  3613. * RET 0 or -1 on error
  3614. * NOTE: free the response using slurm_free_job_info_msg
  3615. */
  3616. extern int slurm_load_jobs(time_t update_time,
  3617. job_info_msg_t **job_info_msg_pptr,
  3618. uint16_t show_flags);
  3619. /*
  3620. * slurm_notify_job - send message to the job's stdout,
  3621. * usable only by user root
  3622. * IN job_id - slurm job_id or 0 for all jobs
  3623. * IN message - arbitrary message
  3624. * RET 0 or -1 on error
  3625. */
  3626. extern int slurm_notify_job(uint32_t job_id, char *message);
  3627. /*
  3628. * slurm_pid2jobid - issue RPC to get the slurm job_id given a process_id
  3629. * on this machine
  3630. * IN job_pid - process_id of interest on this machine
  3631. * OUT job_id_ptr - place to store a slurm job_id
  3632. * RET 0 or -1 on error
  3633. */
  3634. extern int slurm_pid2jobid(pid_t job_pid, uint32_t *job_id_ptr);
  3635. /*
  3636. * slurm_print_job_info - output information about a specific Slurm
  3637. * job based upon message as loaded using slurm_load_jobs
  3638. * IN out - file to write to
  3639. * IN job_ptr - an individual job information record pointer
  3640. * IN one_liner - print as a single line if true
  3641. */
  3642. extern void slurm_print_job_info(FILE *out,
  3643. slurm_job_info_t *job_ptr,
  3644. int one_liner);
  3645. /*
  3646. * slurm_print_job_info_msg - output information about all Slurm
  3647. * jobs based upon message as loaded using slurm_load_jobs
  3648. * IN out - file to write to
  3649. * IN job_info_msg_ptr - job information message pointer
  3650. * IN one_liner - print as a single line if true
  3651. */
  3652. extern void slurm_print_job_info_msg(FILE *out,
  3653. job_info_msg_t *job_info_msg_ptr,
  3654. int one_liner);
  3655. /*
  3656. * slurm_sprint_job_info - output information about a specific Slurm
  3657. * job based upon message as loaded using slurm_load_jobs
  3658. * IN job_ptr - an individual job information record pointer
  3659. * IN one_liner - print as a single line if true
  3660. * RET out - char * containing formatted output (must be freed after call)
  3661. * NULL is returned on failure.
  3662. */
  3663. extern char *slurm_sprint_job_info(slurm_job_info_t *job_ptr,
  3664. int one_liner);
  3665. /*
  3666. * slurm_update_job - issue RPC to a job's configuration per request,
  3667. * only usable by user root or (for some parameters) the job's owner
  3668. * IN job_msg - description of job updates
  3669. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3670. */
  3671. extern int slurm_update_job(job_desc_msg_t *job_msg);
  3672. /*
  3673. * slurm_update_job2 - issue RPC to a job's configuration per request,
  3674. * only usable by user root or (for some parameters) the job's owner
  3675. * IN job_msg - description of job updates
  3676. * OUT resp - per task response to the request,
  3677. * free using slurm_free_job_array_resp()
  3678. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3679. */
  3680. extern int slurm_update_job2(job_desc_msg_t *job_msg,
  3681. job_array_resp_msg_t **resp);
  3682. /*
  3683. * slurm_xlate_job_id - Translate a Slurm job ID string into a slurm job ID
  3684. * number. If this job ID contains an array index, map this to the
  3685. * equivalent Slurm job ID number (e.g. "123_2" to 124)
  3686. *
  3687. * IN job_id_str - String containing a single job ID number
  3688. * RET - equivalent job ID number or 0 on error
  3689. */
  3690. extern uint32_t slurm_xlate_job_id(char *job_id_str);
  3691. /*****************************************************************************\
  3692. * SLURM JOB STEP CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
  3693. \*****************************************************************************/
  3694. /*
  3695. * slurm_get_job_steps - issue RPC to get specific slurm job step
  3696. * configuration information if changed since update_time.
  3697. * a job_id value of NO_VAL implies all jobs, a step_id value of
  3698. * NO_VAL implies all steps
  3699. * IN update_time - time of current configuration data
  3700. * IN job_id - get information for specific job id, NO_VAL for all jobs
  3701. * IN step_id - get information for specific job step id, NO_VAL for all
  3702. * job steps
  3703. * IN step_response_pptr - place to store a step response pointer
  3704. * IN show_flags - job step filtering options
  3705. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3706. * NOTE: free the response using slurm_free_job_step_info_response_msg
  3707. */
  3708. extern int slurm_get_job_steps(time_t update_time,
  3709. uint32_t job_id,
  3710. uint32_t step_id,
  3711. job_step_info_response_msg_t **step_response_pptr,
  3712. uint16_t show_flags);
  3713. /*
  3714. * slurm_free_job_step_info_response_msg - free the job step
  3715. * information response message
  3716. * IN msg - pointer to job step information response message
  3717. * NOTE: buffer is loaded by slurm_get_job_steps.
  3718. */
  3719. extern void slurm_free_job_step_info_response_msg(job_step_info_response_msg_t *msg);
  3720. /*
  3721. * slurm_print_job_step_info_msg - output information about all Slurm
  3722. * job steps based upon message as loaded using slurm_get_job_steps
  3723. * IN out - file to write to
  3724. * IN job_step_info_msg_ptr - job step information message pointer
  3725. * IN one_liner - print as a single line if true
  3726. */
  3727. extern void slurm_print_job_step_info_msg(FILE *out,
  3728. job_step_info_response_msg_t *job_step_info_msg_ptr,
  3729. int one_liner);
  3730. /*
  3731. * slurm_print_job_step_info - output information about a specific Slurm
  3732. * job step based upon message as loaded using slurm_get_job_steps
  3733. * IN out - file to write to
  3734. * IN job_ptr - an individual job step information record pointer
  3735. * IN one_liner - print as a single line if true
  3736. */
  3737. extern void slurm_print_job_step_info(FILE *out,
  3738. job_step_info_t *step_ptr,
  3739. int one_liner);
  3740. /*
  3741. * slurm_job_step_layout_get - get the slurm_step_layout_t structure for
  3742. * a particular job step
  3743. *
  3744. * IN job_id
  3745. * IN step_id
  3746. * RET pointer to a slurm_step_layout_t (free with
  3747. * slurm_free_step_layout) on success, and NULL on error.
  3748. */
  3749. extern slurm_step_layout_t *slurm_job_step_layout_get(uint32_t job_id,
  3750. uint32_t step_id);
  3751. /*
  3752. * slurm_sprint_job_step_info - output information about a specific Slurm
  3753. * job step based upon message as loaded using slurm_get_job_steps
  3754. * IN job_ptr - an individual job step information record pointer
  3755. * IN one_liner - print as a single line if true
  3756. * RET out - char * containing formatted output (must be freed after call)
  3757. * NULL is returned on failure.
  3758. */
  3759. extern char *slurm_sprint_job_step_info(job_step_info_t *step_ptr,
  3760. int one_liner);
  3761. /*
  3762. * slurm_job_step_stat - status a current step
  3763. *
  3764. * IN job_id
  3765. * IN step_id
  3766. * IN node_list, optional, if NULL then all nodes in step are returned.
  3767. * OUT resp
  3768. * RET SLURM_SUCCESS on success SLURM_ERROR else
  3769. */
  3770. extern int slurm_job_step_stat(uint32_t job_id,
  3771. uint32_t step_id,
  3772. char *node_list,
  3773. uint16_t use_protocol_ver,
  3774. job_step_stat_response_msg_t **resp);
  3775. /*
  3776. * slurm_job_step_get_pids - get the complete list of pids for a given
  3777. * job step
  3778. *
  3779. * IN job_id
  3780. * IN step_id
  3781. * OUT resp
  3782. * RET SLURM_SUCCESS on success SLURM_ERROR else
  3783. */
  3784. extern int slurm_job_step_get_pids(uint32_t job_id,
  3785. uint32_t step_id,
  3786. char *node_list,
  3787. job_step_pids_response_msg_t **resp);
  3788. extern void slurm_job_step_layout_free(slurm_step_layout_t *layout);
  3789. extern void slurm_job_step_pids_free(job_step_pids_t *object);
  3790. extern void slurm_job_step_pids_response_msg_free(void *object);
  3791. extern void slurm_job_step_stat_free(job_step_stat_t *object);
  3792. extern void slurm_job_step_stat_response_msg_free(void *object);
  3793. /* Update the time limit of a job step,
  3794. * IN step_msg - step update messasge descriptor
  3795. * RET 0 or -1 on error */
  3796. extern int slurm_update_step(step_update_request_msg_t *step_msg);
  3797. /*****************************************************************************\
  3798. * SLURM NODE CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
  3799. \*****************************************************************************/
  3800. /*
  3801. * slurm_load_node - issue RPC to get slurm all node configuration information
  3802. * if changed since update_time
  3803. * IN update_time - time of current configuration data
  3804. * OUT resp - place to store a node configuration pointer
  3805. * IN show_flags - node filtering options (e.g. SHOW_FEDERATION)
  3806. * RET 0 or a slurm error code
  3807. * NOTE: free the response using slurm_free_node_info_msg
  3808. */
  3809. extern int slurm_load_node(time_t update_time, node_info_msg_t **resp,
  3810. uint16_t show_flags);
  3811. /*
  3812. * slurm_load_node2 - equivalent to slurm_load_node() with addition
  3813. * of cluster record for communications in a federation
  3814. */
  3815. extern int slurm_load_node2(time_t update_time, node_info_msg_t **resp,
  3816. uint16_t show_flags,
  3817. slurmdb_cluster_rec_t *cluster);
  3818. /*
  3819. * slurm_load_node_single - issue RPC to get slurm configuration information
  3820. * for a specific node
  3821. * OUT resp - place to store a node configuration pointer
  3822. * IN node_name - name of the node for which information is requested
  3823. * IN show_flags - node filtering options
  3824. * RET 0 or a slurm error code
  3825. * NOTE: free the response using slurm_free_node_info_msg
  3826. */
  3827. extern int slurm_load_node_single(node_info_msg_t **resp, char *node_name,
  3828. uint16_t show_flags);
  3829. /*
  3830. * slurm_load_node_single2 - equivalent to slurm_load_node_single() with
  3831. * addition of cluster record for communications in a federation
  3832. */
  3833. extern int slurm_load_node_single2(node_info_msg_t **resp, char *node_name,
  3834. uint16_t show_flags,
  3835. slurmdb_cluster_rec_t *cluster);
  3836. /* Given data structures containing information about nodes and partitions,
  3837. * populate the node's "partitions" field */
  3838. void
  3839. slurm_populate_node_partitions(node_info_msg_t *node_buffer_ptr,
  3840. partition_info_msg_t *part_buffer_ptr);
  3841. /*
  3842. * slurm_get_node_energy - issue RPC to get the energy data of all
  3843. * configured sensors on the target machine
  3844. * IN host - name of node to query, NULL if localhost
  3845. * IN delta - Use cache if data is newer than this in seconds
  3846. * OUT sensor_cnt - number of sensors
  3847. * OUT energy - array of acct_gather_energy_t structures on success or
  3848. * NULL other wise
  3849. * RET 0 on success or a slurm error code
  3850. * NOTE: free the response using xfree
  3851. */
  3852. extern int slurm_get_node_energy(char *host,
  3853. uint16_t context_id,
  3854. uint16_t delta,
  3855. uint16_t *sensors_cnt,
  3856. acct_gather_energy_t **energy);
  3857. /*
  3858. * slurm_free_node_info_msg - free the node information response message
  3859. * IN msg - pointer to node information response message
  3860. * NOTE: buffer is loaded by slurm_load_node.
  3861. */
  3862. extern void slurm_free_node_info_msg(node_info_msg_t *node_buffer_ptr);
  3863. /*
  3864. * slurm_print_node_info_msg - output information about all Slurm nodes
  3865. * based upon message as loaded using slurm_load_node
  3866. * IN out - file to write to
  3867. * IN node_info_msg_ptr - node information message pointer
  3868. * IN one_liner - print as a single line if true
  3869. */
  3870. extern void slurm_print_node_info_msg(FILE *out,
  3871. node_info_msg_t *node_info_msg_ptr,
  3872. int one_liner);
  3873. /*
  3874. * slurm_print_node_table - output information about a specific Slurm nodes
  3875. * based upon message as loaded using slurm_load_node
  3876. * IN out - file to write to
  3877. * IN node_ptr - an individual node information record pointer
  3878. * IN one_liner - print as a single line if true
  3879. */
  3880. extern void slurm_print_node_table(FILE *out,
  3881. node_info_t *node_ptr,
  3882. int one_liner);
  3883. /*
  3884. * slurm_sprint_node_table - output information about a specific Slurm nodes
  3885. * based upon message as loaded using slurm_load_node
  3886. * IN node_ptr - an individual node information record pointer
  3887. * IN one_liner - print as a single line if true
  3888. * RET out - char * containing formatted output (must be freed after call)
  3889. * NULL is returned on failure.
  3890. */
  3891. extern char *slurm_sprint_node_table(node_info_t *node_ptr,
  3892. int one_liner);
  3893. /*
  3894. * slurm_init_update_node_msg - initialize node update message
  3895. * OUT update_node_msg - user defined node descriptor
  3896. */
  3897. void slurm_init_update_node_msg(update_node_msg_t *update_node_msg);
  3898. /*
  3899. * slurm_update_node - issue RPC to a node's configuration per request,
  3900. * only usable by user root
  3901. * IN node_msg - description of node updates
  3902. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3903. */
  3904. extern int slurm_update_node(update_node_msg_t *node_msg);
  3905. /*****************************************************************************\
  3906. * SLURM FRONT_END CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
  3907. \*****************************************************************************/
  3908. /*
  3909. * slurm_load_front_end - issue RPC to get slurm all front_end configuration
  3910. * information if changed since update_time
  3911. * IN update_time - time of current configuration data
  3912. * IN front_end_info_msg_pptr - place to store a front_end configuration pointer
  3913. * RET 0 or a slurm error code
  3914. * NOTE: free the response using slurm_free_front_end_info_msg
  3915. */
  3916. extern int slurm_load_front_end(time_t update_time,
  3917. front_end_info_msg_t **resp);
  3918. /*
  3919. * slurm_free_front_end_info_msg - free the front_end information response
  3920. * message
  3921. * IN msg - pointer to front_end information response message
  3922. * NOTE: buffer is loaded by slurm_load_front_end.
  3923. */
  3924. extern void slurm_free_front_end_info_msg(front_end_info_msg_t *front_end_buffer_ptr);
  3925. /*
  3926. * slurm_print_front_end_info_msg - output information about all Slurm
  3927. * front_ends based upon message as loaded using slurm_load_front_end
  3928. * IN out - file to write to
  3929. * IN front_end_info_msg_ptr - front_end information message pointer
  3930. * IN one_liner - print as a single line if true
  3931. */
  3932. extern void slurm_print_front_end_info_msg(FILE *out,
  3933. front_end_info_msg_t *front_end_info_msg_ptr,
  3934. int one_liner);
  3935. /*
  3936. * slurm_print_front_end_table - output information about a specific Slurm
  3937. * front_ends based upon message as loaded using slurm_load_front_end
  3938. * IN out - file to write to
  3939. * IN front_end_ptr - an individual front_end information record pointer
  3940. * IN one_liner - print as a single line if true
  3941. */
  3942. extern void slurm_print_front_end_table(FILE *out,
  3943. front_end_info_t *front_end_ptr,
  3944. int one_liner);
  3945. /*
  3946. * slurm_sprint_front_end_table - output information about a specific Slurm
  3947. * front_end based upon message as loaded using slurm_load_front_end
  3948. * IN front_end_ptr - an individual front_end information record pointer
  3949. * IN one_liner - print as a single line if true
  3950. * RET out - char * containing formatted output (must be freed after call)
  3951. * NULL is returned on failure.
  3952. */
  3953. extern char *slurm_sprint_front_end_table(front_end_info_t *front_end_ptr,
  3954. int one_liner);
  3955. /*
  3956. * slurm_init_update_front_end_msg - initialize front_end node update message
  3957. * OUT update_front_end_msg - user defined node descriptor
  3958. */
  3959. void slurm_init_update_front_end_msg(update_front_end_msg_t *update_front_end_msg);
  3960. /*
  3961. * slurm_update_front_end - issue RPC to a front_end node's configuration per
  3962. * request, only usable by user root
  3963. * IN front_end_msg - description of front_end node updates
  3964. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  3965. */
  3966. extern int slurm_update_front_end(update_front_end_msg_t *front_end_msg);
  3967. /*****************************************************************************\
  3968. * SLURM SWITCH TOPOLOGY CONFIGURATION READ/PRINT FUNCTIONS
  3969. \*****************************************************************************/
  3970. /*
  3971. * slurm_load_topo - issue RPC to get slurm all switch topology configuration
  3972. * information
  3973. * IN node_info_msg_pptr - place to store a node configuration pointer
  3974. * RET 0 or a slurm error code
  3975. * NOTE: free the response using slurm_free_topo_info_msg
  3976. */
  3977. extern int slurm_load_topo(topo_info_response_msg_t **topo_info_msg_pptr);
  3978. /*
  3979. * slurm_free_topo_info_msg - free the switch topology configuration
  3980. * information response message
  3981. * IN msg - pointer to switch topology configuration response message
  3982. * NOTE: buffer is loaded by slurm_load_topo.
  3983. */
  3984. extern void slurm_free_topo_info_msg(topo_info_response_msg_t *msg);
  3985. /*
  3986. * slurm_print_topo_info_msg - output information about all switch topology
  3987. * configuration information based upon message as loaded using
  3988. * slurm_load_topo
  3989. * IN out - file to write to
  3990. * IN topo_info_msg_ptr - switch topology information message pointer
  3991. * IN one_liner - print as a single line if not zero
  3992. */
  3993. extern void slurm_print_topo_info_msg(FILE *out,
  3994. topo_info_response_msg_t *topo_info_msg_ptr,
  3995. int one_liner);
  3996. /*
  3997. * slurm_print_topo_record - output information about a specific Slurm topology
  3998. * record based upon message as loaded using slurm_load_topo
  3999. * IN out - file to write to
  4000. * IN topo_ptr - an individual switch information record pointer
  4001. * IN one_liner - print as a single line if not zero
  4002. * RET out - char * containing formatted output (must be freed after call)
  4003. * NULL is returned on failure.
  4004. */
  4005. extern void slurm_print_topo_record(FILE *out,
  4006. topo_info_t *topo_ptr,
  4007. int one_liner);
  4008. /*****************************************************************************\
  4009. * SLURM POWERCAPPING READ/PRINT/UPDATE FUNCTIONS
  4010. \*****************************************************************************/
  4011. /*
  4012. * slurm_load_powercap - issue RPC to get slurm powercapping details
  4013. * IN powercap_info_msg_pptr - place to store a pointer to the result
  4014. * RET 0 or a slurm error code
  4015. * NOTE: free the response using slurm_free_powercap_info_msg
  4016. */
  4017. extern int slurm_load_powercap(powercap_info_msg_t **powercap_info_msg_pptr);
  4018. /*
  4019. * slurm_free_powercap_info_msg - free the powercapping information
  4020. * response message
  4021. * IN msg - pointer to powercapping information response message
  4022. * NOTE: buffer is loaded by slurm_load_powercap.
  4023. */
  4024. extern void slurm_free_powercap_info_msg(powercap_info_msg_t *msg);
  4025. /*
  4026. * slurm_print_powercap_info_msg - output information about powercapping
  4027. * configuration based upon message as loaded using slurm_load_powercap
  4028. * IN out - file to write to
  4029. * IN powercap_info_msg_ptr - powercapping information message pointer
  4030. * IN one_liner - print as a single line if not zero
  4031. */
  4032. extern void slurm_print_powercap_info_msg(FILE *out,
  4033. powercap_info_msg_t *powercap_info_msg_ptr,
  4034. int one_liner);
  4035. /*
  4036. * slurm_update_powercap - issue RPC to update powercapping cap
  4037. * IN powercap_msg - description of powercapping updates
  4038. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  4039. */
  4040. extern int slurm_update_powercap(update_powercap_msg_t *powercap_msg);
  4041. /*****************************************************************************\
  4042. * SLURM SELECT READ/PRINT/UPDATE FUNCTIONS
  4043. \*****************************************************************************/
  4044. /*
  4045. * slurm_get_select_nodeinfo - get data from a select node credential
  4046. * IN nodeinfo - updated select node credential
  4047. * IN data_type - type of data to enter into node credential
  4048. * IN state - state of node query
  4049. * IN/OUT data - the data to enter into node credential
  4050. * RET 0 or -1 on error
  4051. */
  4052. extern int slurm_get_select_nodeinfo(dynamic_plugin_data_t *nodeinfo,
  4053. enum select_nodedata_type data_type,
  4054. enum node_states state,
  4055. void *data);
  4056. /*****************************************************************************\
  4057. * SLURM PARTITION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
  4058. \*****************************************************************************/
  4059. /*
  4060. * slurm_init_part_desc_msg - initialize partition descriptor with
  4061. * default values
  4062. * IN/OUT update_part_msg - user defined partition descriptor
  4063. */
  4064. extern void slurm_init_part_desc_msg(update_part_msg_t *update_part_msg);
  4065. /*
  4066. * slurm_load_partitions - issue RPC to get slurm all partition configuration
  4067. * information if changed since update_time
  4068. * IN update_time - time of current configuration data
  4069. * IN partition_info_msg_pptr - place to store a partition configuration
  4070. * pointer
  4071. * IN show_flags - partitions filtering options (e.g. SHOW_FEDERATION)
  4072. * RET 0 or a slurm error code
  4073. * NOTE: free the response using slurm_free_partition_info_msg
  4074. */
  4075. extern int slurm_load_partitions(time_t update_time,
  4076. partition_info_msg_t **part_buffer_ptr,
  4077. uint16_t show_flags);
  4078. /*
  4079. * slurm_load_partitions2 - equivalent to slurm_load_partitions() with addition
  4080. * of cluster record for communications in a federation
  4081. */
  4082. extern int slurm_load_partitions2(time_t update_time,
  4083. partition_info_msg_t **resp,
  4084. uint16_t show_flags,
  4085. slurmdb_cluster_rec_t *cluster);
  4086. /*
  4087. * slurm_free_partition_info_msg - free the partition information
  4088. * response message
  4089. * IN msg - pointer to partition information response message
  4090. * NOTE: buffer is loaded by slurm_load_partitions
  4091. */
  4092. extern void slurm_free_partition_info_msg(partition_info_msg_t *part_info_ptr);
  4093. /*
  4094. * slurm_print_partition_info_msg - output information about all Slurm
  4095. * partitions based upon message as loaded using slurm_load_partitions
  4096. * IN out - file to write to
  4097. * IN part_info_ptr - partitions information message pointer
  4098. * IN one_liner - print as a single line if true
  4099. */
  4100. extern void slurm_print_partition_info_msg(FILE *out, partition_info_msg_t *part_info_ptr, int one_liner);
  4101. /*
  4102. * slurm_print_partition_info - output information about a specific Slurm
  4103. * partition based upon message as loaded using slurm_load_partitions
  4104. * IN out - file to write to
  4105. * IN part_ptr - an individual partition information record pointer
  4106. * IN one_liner - print as a single line if true
  4107. */
  4108. extern void slurm_print_partition_info(FILE *out,
  4109. partition_info_t *part_ptr,
  4110. int one_liner);
  4111. /*
  4112. * slurm_sprint_partition_info - output information about a specific Slurm
  4113. * partition based upon message as loaded using slurm_load_partitions
  4114. * IN part_ptr - an individual partition information record pointer
  4115. * IN one_liner - print as a single line if true
  4116. * RET out - char * with formatted output (must be freed after call)
  4117. * NULL is returned on failure.
  4118. */
  4119. extern char *slurm_sprint_partition_info(partition_info_t *part_ptr,
  4120. int one_liner);
  4121. /*
  4122. * slurm_create_partition - create a new partition, only usable by user root
  4123. * IN part_msg - description of partition configuration
  4124. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  4125. */
  4126. extern int slurm_create_partition(update_part_msg_t *part_msg);
  4127. /*
  4128. * slurm_update_partition - issue RPC to update a partition's configuration
  4129. * per request, only usable by user root
  4130. * IN part_msg - description of partition updates
  4131. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  4132. */
  4133. extern int slurm_update_partition(update_part_msg_t *part_msg);
  4134. /*
  4135. * slurm_delete_partition - issue RPC to delete a partition, only usable
  4136. * by user root
  4137. * IN part_msg - description of partition to delete
  4138. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  4139. */
  4140. extern int slurm_delete_partition(delete_part_msg_t *part_msg);
  4141. /*****************************************************************************\
  4142. * SLURM LAYOUT PRINT/UPDATE FUNCTIONS
  4143. \*****************************************************************************/
  4144. extern void slurm_print_layout_info(FILE* out,
  4145. layout_info_msg_t *layout_info_ptr,
  4146. int one_liner );
  4147. extern int slurm_load_layout(char *layout_type,
  4148. char *entities,
  4149. char *type,
  4150. uint32_t no_relation,
  4151. layout_info_msg_t **resp);
  4152. extern int slurm_update_layout(update_layout_msg_t *layout_info_msg);
  4153. extern void slurm_free_layout_info_msg(layout_info_msg_t *layout_info_msg);
  4154. /*****************************************************************************\
  4155. * SLURM RESERVATION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
  4156. \*****************************************************************************/
  4157. /*
  4158. * slurm_init_resv_desc_msg - initialize reservation descriptor with
  4159. * default values
  4160. * OUT job_desc_msg - user defined partition descriptor
  4161. */
  4162. extern void slurm_init_resv_desc_msg(resv_desc_msg_t *update_resv_msg);
  4163. /*
  4164. * slurm_create_reservation - create a new reservation, only usable by user root
  4165. * IN resv_msg - description of reservation
  4166. * RET name of reservation on success (caller must free the memory),
  4167. * otherwise return NULL and set errno to indicate the error
  4168. */
  4169. extern char *slurm_create_reservation(resv_desc_msg_t *resv_msg);
  4170. /*
  4171. * slurm_update_reservation - modify an existing reservation, only usable by
  4172. * user root
  4173. * IN resv_msg - description of reservation
  4174. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  4175. */
  4176. extern int slurm_update_reservation(resv_desc_msg_t *resv_msg);
  4177. /*
  4178. * slurm_delete_reservation - issue RPC to delete a reservation, only usable
  4179. * by user root
  4180. * IN resv_msg - description of reservation to delete
  4181. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  4182. */
  4183. extern int slurm_delete_reservation(reservation_name_msg_t *resv_msg);
  4184. /*
  4185. * slurm_load_reservations - issue RPC to get all slurm reservation
  4186. * configuration information if changed since update_time
  4187. * IN update_time - time of current configuration data
  4188. * IN reserve_info_msg_pptr - place to store a reservation configuration
  4189. * pointer
  4190. * RET 0 or a slurm error code
  4191. * NOTE: free the response using slurm_free_reservation_info_msg
  4192. */
  4193. extern int slurm_load_reservations(time_t update_time,
  4194. reserve_info_msg_t **resp);
  4195. /*
  4196. * slurm_print_reservation_info_msg - output information about all Slurm
  4197. * reservations based upon message as loaded using slurm_load_reservation
  4198. * IN out - file to write to
  4199. * IN resv_info_ptr - reservation information message pointer
  4200. * IN one_liner - print as a single line if true
  4201. */
  4202. void slurm_print_reservation_info_msg(FILE* out,
  4203. reserve_info_msg_t *resv_info_ptr,
  4204. int one_liner);
  4205. /*
  4206. * slurm_print_reservation_info - output information about a specific Slurm
  4207. * reservation based upon message as loaded using slurm_load_reservation
  4208. * IN out - file to write to
  4209. * IN resv_ptr - an individual reservation information record pointer
  4210. * IN one_liner - print as a single line if true
  4211. */
  4212. void slurm_print_reservation_info(FILE* out,
  4213. reserve_info_t *resv_ptr,
  4214. int one_liner);
  4215. /*
  4216. * slurm_sprint_reservation_info - output information about a specific Slurm
  4217. * reservation based upon message as loaded using slurm_load_reservations
  4218. * IN resv_ptr - an individual reservation information record pointer
  4219. * IN one_liner - print as a single line if true
  4220. * RET out - char * containing formatted output (must be freed after call)
  4221. * NULL is returned on failure.
  4222. */
  4223. char *slurm_sprint_reservation_info(reserve_info_t *resv_ptr, int one_liner);
  4224. /*
  4225. * slurm_free_reservation_info_msg - free the reservation information
  4226. * response message
  4227. * IN msg - pointer to reservation information response message
  4228. * NOTE: buffer is loaded by slurm_load_reservation
  4229. */
  4230. extern void slurm_free_reservation_info_msg(reserve_info_msg_t *resv_info_ptr);
  4231. /*****************************************************************************\
  4232. * SLURM PING/RECONFIGURE/SHUTDOWN FUNCTIONS
  4233. \*****************************************************************************/
  4234. /*
  4235. * slurm_ping - issue RPC to have Slurm controller (slurmctld)
  4236. * IN dest - controller to contact (0=primary, 1=backup, 2=backup2, etc.)
  4237. * RET 0 or a slurm error code
  4238. */
  4239. extern int slurm_ping(int dest);
  4240. /*
  4241. * slurm_reconfigure - issue RPC to have Slurm controller (slurmctld)
  4242. * reload its configuration file
  4243. * RET 0 or a slurm error code
  4244. */
  4245. extern int slurm_reconfigure(void);
  4246. /*
  4247. * slurm_shutdown - issue RPC to have Slurm controller (slurmctld)
  4248. * cease operations, both the primary and all backup controllers
  4249. * are shutdown.
  4250. * IN options - 0: all slurm daemons are shutdown
  4251. * 1: slurmctld generates a core file
  4252. * 2: only the slurmctld is shutdown (no core file)
  4253. * RET 0 or a slurm error code
  4254. */
  4255. extern int slurm_shutdown(uint16_t options);
  4256. /*
  4257. * slurm_takeover - issue RPC to have a Slurm backup controller take over the
  4258. * primary controller. REQUEST_CONTROL is sent by the backup
  4259. * to the primary controller to take control
  4260. * backup_inx IN - Index of BackupController to assume controller (typically 1)
  4261. * RET 0 or a slurm error code
  4262. */
  4263. extern int slurm_takeover(int backup_inx);
  4264. /*
  4265. * slurm_set_debugflags - issue RPC to set slurm controller debug flags
  4266. * IN debug_flags_plus - debug flags to be added
  4267. * IN debug_flags_minus - debug flags to be removed
  4268. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  4269. */
  4270. extern int slurm_set_debugflags(uint64_t debug_flags_plus,
  4271. uint64_t debug_flags_minus);
  4272. /*
  4273. * slurm_set_debug_level - issue RPC to set slurm controller debug level
  4274. * IN debug_level - requested debug level
  4275. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  4276. */
  4277. extern int slurm_set_debug_level(uint32_t debug_level);
  4278. /*
  4279. * slurm_set_schedlog_level - issue RPC to set slurm scheduler log level
  4280. * IN schedlog_level - requested scheduler log level
  4281. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  4282. */
  4283. extern int slurm_set_schedlog_level(uint32_t schedlog_level);
  4284. /*
  4285. * slurm_set_fs_dampeningfactor - issue RPC to set slurm fs dampening factor
  4286. * IN factor - requested fs dampening factor
  4287. * RET SLURM_SUCCESS on success, otherwise return SLURM_ERROR with errno set
  4288. */
  4289. extern int slurm_set_fs_dampeningfactor(uint16_t factor);
  4290. /*****************************************************************************\
  4291. * SLURM JOB SUSPEND FUNCTIONS
  4292. \*****************************************************************************/
  4293. /*
  4294. * slurm_suspend - suspend execution of a job.
  4295. * IN job_id - job on which to perform operation
  4296. * RET 0 or a slurm error code
  4297. */
  4298. extern int slurm_suspend(uint32_t job_id);
  4299. /*
  4300. * slurm_suspend2 - suspend execution of a job.
  4301. * IN job_id in string form - job on which to perform operation, may be job
  4302. * array specification (e.g. "123_1-20,44");
  4303. * OUT resp - per task response to the request,
  4304. * free using slurm_free_job_array_resp()
  4305. * RET 0 or a slurm error code
  4306. */
  4307. extern int slurm_suspend2(char *job_id, job_array_resp_msg_t **resp);
  4308. /*
  4309. * slurm_resume - resume execution of a previously suspended job.
  4310. * IN job_id - job on which to perform operation
  4311. * RET 0 or a slurm error code
  4312. */
  4313. extern int slurm_resume(uint32_t job_id);
  4314. /*
  4315. * slurm_resume2 - resume execution of a previously suspended job.
  4316. * IN job_id in string form - job on which to perform operation, may be job
  4317. * array specification (e.g. "123_1-20,44");
  4318. * OUT resp - per task response to the request,
  4319. * free using slurm_free_job_array_resp()
  4320. * RET 0 or a slurm error code
  4321. */
  4322. extern int slurm_resume2(char *job_id, job_array_resp_msg_t **resp);
  4323. /* Free job array oriented response with individual return codes by task ID */
  4324. extern void slurm_free_job_array_resp(job_array_resp_msg_t *resp);
  4325. /*
  4326. * slurm_requeue - re-queue a batch job, if already running
  4327. * then terminate it first
  4328. * IN job_id - job on which to perform operation
  4329. * IN flags - JOB_SPECIAL_EXIT - job should be placed special exit state and
  4330. * held.
  4331. * JOB_REQUEUE_HOLD - job should be placed JOB_PENDING state and
  4332. * held.
  4333. * JOB_RECONFIG_FAIL - Node configuration for job failed
  4334. * JOB_RUNNING - Operate only on jobs in a state of
  4335. * CONFIGURING, RUNNING, STOPPED or SUSPENDED.
  4336. * RET 0 or a slurm error code
  4337. */
  4338. extern int slurm_requeue(uint32_t job_id, uint32_t flags);
  4339. /*
  4340. * slurm_requeue2 - re-queue a batch job, if already running
  4341. * then terminate it first
  4342. * IN job_id in string form - job on which to perform operation, may be job
  4343. * array specification (e.g. "123_1-20,44");
  4344. * IN flags - JOB_SPECIAL_EXIT - job should be placed special exit state and
  4345. * held.
  4346. * JOB_REQUEUE_HOLD - job should be placed JOB_PENDING state and
  4347. * held.
  4348. * JOB_RECONFIG_FAIL - Node configuration for job failed
  4349. * JOB_RUNNING - Operate only on jobs in a state of
  4350. * CONFIGURING, RUNNING, STOPPED or SUSPENDED.
  4351. * OUT resp - per task response to the request,
  4352. * free using slurm_free_job_array_resp()
  4353. * RET 0 or a slurm error code
  4354. */
  4355. extern int slurm_requeue2(char *job_id, uint32_t flags,
  4356. job_array_resp_msg_t **resp);
  4357. /*****************************************************************************\
  4358. * SLURM TRIGGER FUNCTIONS
  4359. \*****************************************************************************/
  4360. /*
  4361. * slurm_set_trigger - Set an event trigger
  4362. * RET 0 or a slurm error code
  4363. */
  4364. extern int slurm_set_trigger(trigger_info_t *trigger_set);
  4365. /*
  4366. * slurm_clear_trigger - Clear (remove) an existing event trigger
  4367. * RET 0 or a slurm error code
  4368. */
  4369. extern int slurm_clear_trigger(trigger_info_t *trigger_clear);
  4370. /*
  4371. * slurm_get_triggers - Get all event trigger information
  4372. * Use slurm_free_trigger_msg() to free the memory allocated by this function
  4373. * RET 0 or a slurm error code
  4374. */
  4375. extern int slurm_get_triggers(trigger_info_msg_t **trigger_get);
  4376. /*
  4377. * slurm_pull_trigger - Pull an event trigger
  4378. * RET 0 or a slurm error code
  4379. */
  4380. extern int slurm_pull_trigger(trigger_info_t *trigger_pull);
  4381. /*
  4382. * slurm_free_trigger_msg - Free data structure returned by
  4383. * slurm_get_triggers()
  4384. */
  4385. extern void slurm_free_trigger_msg(trigger_info_msg_t *trigger_free);
  4386. /*
  4387. * slurm_init_trigger_msg - initialize trigger clear/update message
  4388. * OUT trigger_info_msg - user defined trigger descriptor
  4389. */
  4390. void slurm_init_trigger_msg(trigger_info_t *trigger_info_msg);
  4391. /*****************************************************************************\
  4392. * SLURM BURST BUFFER FUNCTIONS
  4393. \*****************************************************************************/
  4394. #define BB_FLAG_DISABLE_PERSISTENT 0x0001 /* Disable regular user to create
  4395. * and destroy persistent burst
  4396. * buffers */
  4397. #define BB_FLAG_ENABLE_PERSISTENT 0x0002 /* Allow regular user to create
  4398. * and destroy persistent burst
  4399. * buffers */
  4400. #define BB_FLAG_EMULATE_CRAY 0x0004 /* Using dw_wlm_cli emulator */
  4401. #define BB_FLAG_PRIVATE_DATA 0x0008 /* Buffers only visible to owner */
  4402. #define BB_FLAG_TEARDOWN_FAILURE 0x0010 /* Teardown after failed staged in/out */
  4403. #define BB_FLAG_SET_EXEC_HOST 0x0020 /* Set execute host */
  4404. #define BB_SIZE_IN_NODES 0x8000000000000000
  4405. #define BB_STATE_PENDING 0x0000 /* Placeholder: no action started */
  4406. #define BB_STATE_ALLOCATING 0x0001 /* Cray: bbs_setup started */
  4407. #define BB_STATE_ALLOCATED 0x0002 /* Cray: bbs_setup started */
  4408. #define BB_STATE_DELETING 0x0005 /* Cray: bbs_setup started */
  4409. #define BB_STATE_DELETED 0x0006 /* Cray: bbs_setup started */
  4410. #define BB_STATE_STAGING_IN 0x0011 /* Cray: bbs_data_in started */
  4411. #define BB_STATE_STAGED_IN 0x0012 /* Cray: bbs_data_in complete */
  4412. #define BB_STATE_PRE_RUN 0x0018 /* Cray: bbs_pre_run started */
  4413. #define BB_STATE_ALLOC_REVOKE 0x001a /* Cray: allocation revoked */
  4414. #define BB_STATE_RUNNING 0x0021 /* Job is running */
  4415. #define BB_STATE_SUSPEND 0x0022 /* Job is suspended (future) */
  4416. #define BB_STATE_POST_RUN 0x0029 /* Cray: bbs_post_run started */
  4417. #define BB_STATE_STAGING_OUT 0x0031 /* Cray: bbs_data_out started */
  4418. #define BB_STATE_STAGED_OUT 0x0032 /* Cray: bbs_data_out complete */
  4419. #define BB_STATE_TEARDOWN 0x0041 /* Cray: bbs_teardown started */
  4420. #define BB_STATE_TEARDOWN_FAIL 0x0043 /* Cray: bbs_teardown failed, retrying */
  4421. #define BB_STATE_COMPLETE 0x0045 /* Cray: bbs_teardown complete */
  4422. /* Information about alternate pools or other burst buffer resources */
  4423. typedef struct {
  4424. uint64_t granularity; /* Granularity of resource allocation size */
  4425. char *name; /* Resource (pool) name */
  4426. uint64_t total_space; /* Total size of available resources, unused
  4427. * by burst_buffer_resv_t */
  4428. uint64_t used_space; /* Allocated space, in bytes */
  4429. uint64_t unfree_space; /* used plus drained space, units are bytes */
  4430. } burst_buffer_pool_t;
  4431. typedef struct {
  4432. char *account; /* Associated account (for limits) */
  4433. uint32_t array_job_id;
  4434. uint32_t array_task_id;
  4435. time_t create_time; /* Time of creation */
  4436. uint32_t job_id;
  4437. char *name; /* Name of persistent burst buffer */
  4438. char *partition; /* Associated partition (for limits) */
  4439. char *pool; /* Resource (pool) name */
  4440. char *qos; /* Associated QOS (for limits) */
  4441. uint64_t size; /* In bytes by default */
  4442. uint16_t state; /* See BB_STATE_* */
  4443. uint32_t user_id;
  4444. } burst_buffer_resv_t;
  4445. typedef struct {
  4446. uint32_t user_id;
  4447. uint64_t used;
  4448. } burst_buffer_use_t;
  4449. typedef struct {
  4450. char *allow_users;
  4451. char *default_pool; /* Name of default pool to use */
  4452. char *create_buffer;
  4453. char *deny_users;
  4454. char *destroy_buffer;
  4455. uint32_t flags; /* See BB_FLAG_* above */
  4456. char *get_sys_state;
  4457. char *get_sys_status;
  4458. uint64_t granularity; /* Granularity of resource allocation */
  4459. uint32_t pool_cnt; /* Count of records in pool_ptr */
  4460. burst_buffer_pool_t *pool_ptr;
  4461. char *name; /* Plugin name */
  4462. uint32_t other_timeout; /* Seconds or zero */
  4463. uint32_t stage_in_timeout; /* Seconds or zero */
  4464. uint32_t stage_out_timeout; /* Seconds or zero */
  4465. char *start_stage_in;
  4466. char *start_stage_out;
  4467. char *stop_stage_in;
  4468. char *stop_stage_out;
  4469. uint64_t total_space; /* In bytes */
  4470. uint64_t unfree_space; /* Allocated or drained, in bytes */
  4471. uint64_t used_space; /* Allocated, in bytes */
  4472. uint32_t validate_timeout; /* Seconds or zero */
  4473. uint32_t buffer_count;
  4474. burst_buffer_resv_t *burst_buffer_resv_ptr;
  4475. uint32_t use_count;
  4476. burst_buffer_use_t *burst_buffer_use_ptr;
  4477. } burst_buffer_info_t;
  4478. typedef struct {
  4479. burst_buffer_info_t *burst_buffer_array;
  4480. uint32_t record_count; /* Elements in burst_buffer_array */
  4481. } burst_buffer_info_msg_t;
  4482. /*
  4483. * slurm_burst_buffer_state_string - translate burst buffer state number to
  4484. * it string equivalent
  4485. */
  4486. extern char *slurm_burst_buffer_state_string(uint16_t state);
  4487. /*
  4488. * slurm_load_burst_buffer_stat - issue RPC to get burst buffer status
  4489. * IN argc - count of status request options
  4490. * IN argv - status request options
  4491. * OUT status_resp - status response, memory must be released using xfree()
  4492. * RET 0 or a slurm error code
  4493. */
  4494. extern int slurm_load_burst_buffer_stat(int argc, char **argv,
  4495. char **status_resp);
  4496. /*
  4497. * slurm_load_burst_buffer_info - issue RPC to get slurm all burst buffer plugin
  4498. * information
  4499. * OUT burst_buffer_info_msg_pptr - place to store a burst buffer configuration
  4500. * pointer
  4501. * RET 0 or a slurm error code
  4502. * NOTE: free the response using slurm_free_burst_buffer_info_msg
  4503. */
  4504. extern int slurm_load_burst_buffer_info(burst_buffer_info_msg_t **burst_buffer_info_msg_pptr);
  4505. /*
  4506. * slurm_free_burst_buffer_info_msg - free buffer returned by
  4507. * slurm_load_burst_buffer
  4508. * IN burst_buffer_info_msg_ptr - pointer to burst_buffer_info_msg_t
  4509. * RET 0 or a slurm error code
  4510. */
  4511. extern void slurm_free_burst_buffer_info_msg(burst_buffer_info_msg_t *burst_buffer_info_msg);
  4512. /*
  4513. * slurm_print_burst_buffer_info_msg - output information about burst buffers
  4514. * based upon message as loaded using slurm_load_burst_buffer
  4515. * IN out - file to write to
  4516. * IN info_ptr - burst_buffer information message pointer
  4517. * IN one_liner - print as a single line if true
  4518. * IN verbose - higher values to log additional details
  4519. */
  4520. extern void slurm_print_burst_buffer_info_msg(FILE *out,
  4521. burst_buffer_info_msg_t *info_ptr,
  4522. int one_liner,
  4523. int verbosity);
  4524. /*
  4525. * slurm_print_burst_buffer_record - output information about a specific Slurm
  4526. * burst_buffer record based upon message as loaded using
  4527. * slurm_load_burst_buffer_info()
  4528. * IN out - file to write to
  4529. * IN burst_buffer_ptr - an individual burst buffer record pointer
  4530. * IN one_liner - print as a single line if not zero
  4531. * IN verbose - higher values to log additional details
  4532. * RET out - char * containing formatted output (must be freed after call)
  4533. * NULL is returned on failure.
  4534. */
  4535. extern void slurm_print_burst_buffer_record(FILE *out,
  4536. burst_buffer_info_t *burst_buffer_ptr,
  4537. int one_liner,
  4538. int verbose);
  4539. /*
  4540. * slurm_network_callerid - issue RPC to get the job id of a job from a remote
  4541. * slurmd based upon network socket information.
  4542. *
  4543. * IN req - Information about network connection in question
  4544. * OUT job_id - ID of the job or NO_VAL
  4545. * OUT node_name - name of the remote slurmd
  4546. * IN node_name_size - size of the node_name buffer
  4547. * RET SLURM_SUCCESS or SLURM_ERROR on error
  4548. */
  4549. extern int slurm_network_callerid(network_callerid_msg_t req,
  4550. uint32_t *job_id,
  4551. char *node_name,
  4552. int node_name_size);
  4553. /*
  4554. * Move the specified job ID to the top of the queue for a given user ID,
  4555. * partition, account, and QOS.
  4556. * IN job_id_str - a job id
  4557. * RET 0 or -1 on error */
  4558. extern int slurm_top_job(char *job_id_str);
  4559. /*
  4560. * Fetch an auth token for a given username.
  4561. * IN username - NULL, or a specific username if run as SlurmUser/root.
  4562. * IN lifespan - lifespan the token should be valid for.
  4563. */
  4564. extern char *slurm_fetch_token(char *username, int lifespan);
  4565. /*****************************************************************************\
  4566. * SLURM FEDERATION FUNCTIONS
  4567. \*****************************************************************************/
  4568. /*
  4569. * slurm_load_federation - issue RPC to get federation status from controller
  4570. * IN/OUT fed_pptr - place to store returned federation information.
  4571. * slurmdb_federation_rec_t treated as a void pointer to since
  4572. * slurm.h doesn't have ties to slurmdb.h.
  4573. * NOTE: Use slurm_destroy_federation_rec() to release the returned memory
  4574. * RET 0 or -1 on error
  4575. */
  4576. extern int slurm_load_federation(void **fed_pptr);
  4577. /*
  4578. * slurm_print_federation - prints slurmdb_federation_rec_t (passed as void*
  4579. * since slurm.h doesn't know about slurmdb.h).
  4580. */
  4581. extern void slurm_print_federation(void *fed);
  4582. /*
  4583. * slurm_destroy_federation_rec - Release memory allocated by
  4584. * slurm_load_federation()
  4585. */
  4586. extern void slurm_destroy_federation_rec(void *fed);
  4587. #ifdef __cplusplus
  4588. }
  4589. #endif
  4590. #endif