Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nomad should unregsiter the signal handlers #79

Open
SobhanMP opened this issue Jul 16, 2022 · 9 comments
Open

nomad should unregsiter the signal handlers #79

SobhanMP opened this issue Jul 16, 2022 · 9 comments

Comments

@SobhanMP
Copy link

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 bbopt/NOMAD.jl#39

@mkitti
Copy link

mkitti commented Jul 16, 2022

Watching

@mkitti
Copy link

mkitti commented Jul 16, 2022

@SobhanMP what operating system are you using?

@SobhanMP
Copy link
Author

i use linux

@ctribes
Copy link
Contributor

ctribes commented Jul 18, 2022

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);

@SobhanMP
Copy link
Author

SobhanMP commented Jul 18, 2022

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
Copy link
Contributor

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

@mkitti
Copy link

mkitti commented Jul 19, 2022

@amontoison
Copy link
Contributor

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
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants