natefoo / slurm-drmaa

DRMAA for Slurm: Implementation of the DRMAA C bindings for Slurm
GNU General Public License v3.0
48 stars 22 forks source link

Issues with Slurm 20.11.0 #42

Closed xk42 closed 3 years ago

xk42 commented 3 years ago
make[2]: Entering directory `/root/slurm-drmaa-1.1.1/slurm_drmaa'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I/root/rpmbuild/BUILD/slurm-20.11.0 -I../drmaa_utils/ -Wno-long-long  -D_REENTRANT -D_THREAD_SAFE -DNDEBUG  -D_GNU_SOURCE -DCONFDIR=/etc  -Wall -W -Wno-unused-parameter -Wno-format-zero-length -pedantic -std=c99 -g -O2 -pthread -MT libdrmaa_la-drmaa.lo -MD -MP -MF .deps/libdrmaa_la-drmaa.Tpo -c -o libdrmaa_la-drmaa.lo `test -f 'drmaa.c' || echo './'`drmaa.c
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/root/rpmbuild/BUILD/slurm-20.11.0 -I../drmaa_utils/ -Wno-long-long -D_REENTRANT -D_THREAD_SAFE -DNDEBUG -D_GNU_SOURCE -DCONFDIR=/etc -Wall -W -Wno-unused-parameter -Wno-format-zero-length -pedantic -std=c99 -g -O2 -pthread -MT libdrmaa_la-drmaa.lo -MD -MP -MF .deps/libdrmaa_la-drmaa.Tpo -c drmaa.c  -fPIC -DPIC -o .libs/libdrmaa_la-drmaa.o
drmaa.c: In function ‘slurmdrmaa_get_DRM_system’:
drmaa.c:65:3: error: unknown type name ‘slurm_ctl_conf_t’
   slurm_ctl_conf_t * conf_info_msg_ptr = NULL; 
   ^
drmaa.c:66:3: warning: passing argument 2 of ‘slurm_load_ctl_conf’ from incompatible pointer type [enabled by default]
   if ( slurm_load_ctl_conf ((time_t) NULL, &conf_info_msg_ptr ) == -1 ) 
   ^
In file included from drmaa.c:31:0:
/root/rpmbuild/BUILD/slurm-20.11.0/slurm/slurm.h:3714:12: note: expected ‘struct slurm_conf_t **’ but argument is of type ‘int **’
 extern int slurm_load_ctl_conf(time_t update_time,
            ^
drmaa.c:73:101: error: request for member ‘version’ in something not a structure or union
    fsd_snprintf(NULL, slurmdrmaa_version, sizeof(slurmdrmaa_version)-1,"SLURM %s", conf_info_msg_ptr->version);
                                                                                                     ^
drmaa.c:74:4: warning: passing argument 1 of ‘slurm_free_ctl_conf’ from incompatible pointer type [enabled by default]
    slurm_free_ctl_conf (conf_info_msg_ptr);
    ^
In file included from drmaa.c:31:0:
/root/rpmbuild/BUILD/slurm-20.11.0/slurm/slurm.h:3722:13: note: expected ‘struct slurm_conf_t *’ but argument is of type ‘int *’
 extern void slurm_free_ctl_conf(slurm_conf_t *slurm_ctl_conf_ptr);
             ^
make[2]: *** [libdrmaa_la-drmaa.lo] Error 1
make[2]: Leaving directory `/root/slurm-drmaa-1.1.1/slurm_drmaa'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/slurm-drmaa-1.1.1'
make: *** [all] Error 2
holtgrewe commented 3 years ago

It looks like this is an easy fix

/opt/slurm/20.11.0-1/share/doc/slurm-20.11.0/html/news.html: -- slurm_ctl_conf_t has been renamed to slurm_conf_t.

The following patch should help

diff --git a/drmaa_utils b/drmaa_utils
--- a/drmaa_utils
+++ b/drmaa_utils
@@ -1 +1 @@
-Subproject commit 588f69d387322a4f53ce072a6c9acf7ad19b5002
+Subproject commit 588f69d387322a4f53ce072a6c9acf7ad19b5002-dirty
diff --git a/slurm_drmaa/drmaa.c b/slurm_drmaa/drmaa.c
index e84d00b..3d0db66 100644
--- a/slurm_drmaa/drmaa.c
+++ b/slurm_drmaa/drmaa.c
@@ -62,7 +62,7 @@ slurmdrmaa_get_DRM_system( fsd_drmaa_singletone_t *self )
 {
    if(slurmdrmaa_version[0] == '\0') /*no locks as drmaa_get_drm_system is usually called only once */
    {
-       slurm_ctl_conf_t * conf_info_msg_ptr = NULL; 
+       slurm_conf_t * conf_info_msg_ptr = NULL; 
        if ( slurm_load_ctl_conf ((time_t) NULL, &conf_info_msg_ptr ) == -1 ) 
        { 
            fsd_log_error(("slurm_load_ctl_conf error: %s",slurm_strerror(slurm_get_errno())));
diff --git a/test/slurm_ping.c b/test/slurm_ping.c
index 92a32c1..9a0c720 100644
--- a/test/slurm_ping.c
+++ b/test/slurm_ping.c
@@ -3,13 +3,13 @@
 /* Slurm doesn't provide a public method to just use the local config, which we need in order to set a timeout without
  * having to contact slurmctld first... */
 extern int slurm_conf_destroy(void);
-extern slurm_ctl_conf_t *slurm_conf_lock(void);
+extern slurm_conf_t *slurm_conf_lock(void);
 extern void slurm_conf_unlock(void);

 int main(int argc, char **argv) {
    int status = 1;

-   slurm_ctl_conf_t *slurm_ctl_conf_ptr = slurm_conf_lock();
+   slurm_conf_t *slurm_ctl_conf_ptr = slurm_conf_lock();
    slurm_ctl_conf_ptr->msg_timeout = 3;
    slurm_conf_unlock();
holtgrewe commented 3 years ago

FWIW included in #39

natefoo commented 3 years ago

Fixed in #47, will be released in 1.1.2, thanks!