File tree 3 files changed +28
-0
lines changed
3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 30
30
31
31
#include <slurm_drmaa/session.h>
32
32
#include <slurm/slurm.h>
33
+ #if SLURM_VERSION_NUMBER >= SLURM_VERSION_NUM (23 ,0 ,0 )
34
+ #include <slurm_drmaa/util.h>
35
+ #endif
33
36
34
37
static char slurmdrmaa_version [50 ] = "" ;
35
38
36
39
static fsd_drmaa_session_t *
37
40
slurmdrmaa_new_session ( fsd_drmaa_singletone_t * self , const char * contact )
38
41
{
42
+ #if SLURM_VERSION_NUMBER >= SLURM_VERSION_NUM (23 ,0 ,0 )
43
+ slurmdrmaa_init ();
44
+ #endif
39
45
return slurmdrmaa_session_new ( contact );
40
46
}
41
47
42
48
static fsd_template_t *
43
49
slurmdrmaa_new_job_template ( fsd_drmaa_singletone_t * self )
44
50
{
51
+ #if SLURM_VERSION_NUMBER >= SLURM_VERSION_NUM (23 ,0 ,0 )
52
+ slurmdrmaa_init ();
53
+ #endif
45
54
return drmaa_template_new ();
46
55
}
47
56
@@ -61,6 +70,9 @@ slurmdrmaa_get_version( fsd_drmaa_singletone_t *self,
61
70
static const char *
62
71
slurmdrmaa_get_DRM_system ( fsd_drmaa_singletone_t * self )
63
72
{
73
+ #if SLURM_VERSION_NUMBER >= SLURM_VERSION_NUM (23 ,0 ,0 )
74
+ slurmdrmaa_init ();
75
+ #endif
64
76
if (slurmdrmaa_version [0 ] == '\0' ) /*no locks as drmaa_get_drm_system is usually called only once */
65
77
{
66
78
#if SLURM_VERSION_NUMBER >= SLURM_VERSION_NUM (20 ,11 ,0 )
Original file line number Diff line number Diff line change @@ -723,3 +723,16 @@ slurmdrmaa_set_cluster(const char * value)
723
723
724
724
fsd_log_return (( "" ));
725
725
}
726
+
727
+ #if SLURM_VERSION_NUMBER >= SLURM_VERSION_NUM (23 ,0 ,0 )
728
+ static int slurmdrmaa_has_inited = 0 ;
729
+
730
+ void
731
+ slurmdrmaa_init (void )
732
+ {
733
+ if (slurmdrmaa_has_inited != 1 ) {
734
+ slurm_init (NULL );
735
+ slurmdrmaa_has_inited = 1 ;
736
+ }
737
+ }
738
+ #endif
Original file line number Diff line number Diff line change @@ -37,5 +37,8 @@ void slurmdrmaa_parse_native(job_desc_msg_t *job_desc, const char * value);
37
37
char * slurmdrmaa_set_job_id (job_id_spec_t * job_id_spec );
38
38
char * slurmdrmaa_unset_job_id (job_id_spec_t * job_id_spec );
39
39
void slurmdrmaa_set_cluster (const char * value );
40
+ #if SLURM_VERSION_NUMBER >= SLURM_VERSION_NUM (23 ,0 ,0 )
41
+ void slurmdrmaa__init (void );
42
+ #endif
40
43
41
44
#endif /* __SLURM_DRMAA__UTIL_H */
You can’t perform that action at this time.
0 commit comments