bbopt / nomad

NOMAD - A blackbox optimization software
https://nomad-4-user-guide.readthedocs.io/
GNU Lesser General Public License v3.0
114 stars 24 forks source link

nomad should unregsiter the signal handlers #79

Open SobhanMP opened 2 years ago

SobhanMP commented 2 years ago

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

mkitti commented 2 years ago

Watching

mkitti commented 2 years ago

@SobhanMP what operating system are you using?

SobhanMP commented 2 years ago

i use linux

ctribes commented 2 years ago

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.

SobhanMP commented 2 years ago

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

amontoison commented 2 years ago

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

mkitti commented 2 years ago

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?

amontoison commented 2 years ago

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.

SobhanMP commented 2 years ago

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?