nomad icon indicating copy to clipboard operation
nomad copied to clipboard

nomad should unregsiter the signal handlers

Open SobhanMP opened this issue 3 years ago • 9 comments

In an attempt to fix NOMAD.jl (the threading issue), i realized that nomad never releases the signal handlers. Mark Kittisopikul and i think that might be the issue. Would it be possible to restore the original signal handlers? or even better have an option to not catch them at all in the library mode? specifically the sigev signal handler breaks julia as julia also catches the sigev signal.

ref https://github.com/bbopt/NOMAD.jl/issues/39

SobhanMP avatar Jul 16 '22 23:07 SobhanMP

Watching

mkitti avatar Jul 16 '22 23:07 mkitti

@SobhanMP what operating system are you using?

mkitti avatar Jul 16 '22 23:07 mkitti

i use linux

SobhanMP avatar Jul 17 '22 00:07 SobhanMP

When you comment the signal function calls in NOMAD::Algorithm::init() (see below), doest it fixes the threading issue ?

```

/** Step::userInterrupt() will be called if CTRL-C is pressed. * Currently, the main thread will wait for all evaluations to be complete. * \todo Propage interruption to all threads, for all parallel evaluations of blackbox. */ signal(SIGINT, userInterrupt); signal(SIGSEGV, debugSegFault);

ctribes avatar Jul 18 '22 13:07 ctribes

yep, it took a bit of effort to build it but yeah. Also i noticed that NOMAD_jll (the nomad build) is very outdated.

SobhanMP avatar Jul 18 '22 18:07 SobhanMP

@SobhanMP I will recompile a new NOMAD_jll as soon as I can.

amontoison avatar Jul 19 '22 12:07 amontoison

Would it be a simple pull request for https://github.com/JuliaPackaging/Yggdrasil/blob/b63bb8b3553d614d20a95137528de1ae506fbef8/N/NOMAD/build_tarballs.jl to the latest git hash?

mkitti avatar Jul 19 '22 13:07 mkitti

Would it be a simple pull request for https://github.com/JuliaPackaging/Yggdrasil/blob/b63bb8b3553d614d20a95137528de1ae506fbef8/N/NOMAD/build_tarballs.jl to the latest git hash?

No, because the headers are generated dynamically and I need to generate a new patch for each new release. The executable that generates the headers should be compiled with the host compiler whereas the other files should be compiled with the cross compiler.

amontoison avatar Jul 19 '22 14:07 amontoison

it also seems tha SGTE got deprecated(?) but is that patch really needed? the second part of the patch fails (and atomic_patch ignores it as far as i understand)

-set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR} CACHE PATH "..." FORCE) 
-message(STATUS "  Installation prefix set to ${CMAKE_INSTALL_PREFIX}")
+# set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR} CACHE PATH "..." FORCE)
+# message(STATUS "  Installation prefix set to ${CMAKE_INSTALL_PREFIX}")

this does nothing just removes trailing space

-find_package(OpenMP QUIET)
-if(OpenMP_FOUND)
-   message(STATUS "  Test OpenMP for parallel functionalities  -- found ")
-else()
-   message(STATUS "  OpenMP not found. Parallel functionalities NOT available")
+option(TEST_OPENMP "Option to compile Nomad with OpenMP" ON)
+if (TEST_OPENMP MATCHES ON)
+    find_package(OpenMP QUIET)
+    if(OpenMP_FOUND)
+        message(STATUS "  Test OpenMP for parallel functionalities  -- found ")
+    else()
+        message(STATUS "  OpenMP not found. Parallel functionalities NOT available")
+    endif()

option to disable openmp was added so no need

-add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/PyNomad)
+# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/PyNomad)

same for this

-add_executable(WriteAttributeDefinitionFile ${ATTRIBUTE_HEADERS_GENERATOR})
+# add_executable(WriteAttributeDefinitionFile ${ATTRIBUTE_HEADERS_GENERATOR})
 
 # Command to create the attribute headers
-add_custom_command(
-  OUTPUT ${ATTRIBUTE_HEADERS}
-  COMMAND WriteAttributeDefinitionFile
-  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Attribute
-  DEPENDS ${ATTRIBUTE_TEXT}
-)
+# add_custom_command(
+#   OUTPUT ${ATTRIBUTE_HEADERS}
+#   COMMAND WriteAttributeDefinitionFile
+#   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Attribute
+#   DEPENDS ${ATTRIBUTE_TEXT}
+# )

this fails.

the rest seems to be a bunch of custom configs that was added but i'm not sure why. a bunch of the configs are now deprecated. Maybe it's a better idea to take the python route and not put a struct for anything and let the user configure everything with the nomad original keywords instead of a struct?

SobhanMP avatar Jul 19 '22 16:07 SobhanMP