├── .gitignore ├── CHANGELOG.md ├── COPYING ├── Makefile.am ├── README.md ├── api ├── nanos6.h └── nanos6 │ ├── alpi.h │ ├── api-check.h │ ├── blocking.h │ ├── bootstrap.h │ ├── cluster.h │ ├── config.h │ ├── constants.h │ ├── cuda_device.h │ ├── debug.h │ ├── devices.h │ ├── directory.h │ ├── events.h │ ├── final.h │ ├── library-mode.h │ ├── lint.h │ ├── loop.h │ ├── major.h │ ├── monitoring.h │ ├── numa.h │ ├── openacc_device.h │ ├── polling.h │ ├── reductions.h │ ├── runtime-info.h │ ├── task-info-registration.h │ ├── task-instantiation.h │ ├── taskwait.h │ ├── user-mutex.h │ └── version.h ├── autogen.sh ├── commands ├── Makefile.am ├── libprv │ ├── hwc.h │ ├── pcf.c │ ├── pcf.h │ ├── prv.c │ ├── prv.h │ └── uthash.h ├── nanos6-ctf2prv-fast.c ├── nanos6-info.cpp └── nanos6-mergeprv.c ├── configure.ac ├── deps ├── hwloc-2.9.1.tar.gz └── jemalloc-5.3.0.tar.gz ├── docs ├── Doxyfile.in ├── ctf │ ├── CTF.md │ └── Developer.md └── devices │ ├── CUDA.md │ ├── Devices.md │ └── OpenACC.md ├── loader ├── api-versions.c ├── api-versions.h ├── config-parser.c ├── config-parser.h ├── device_strings.c ├── disabled_variant.c ├── error.h ├── generate_regions_api.sh ├── indirect-symbols │ ├── alpi.c │ ├── api-check.c │ ├── blocking.c │ ├── bootstrap.c │ ├── cluster.c │ ├── config.c │ ├── cpu-control.c │ ├── cuda-device-api.c │ ├── debugging.c │ ├── dependencies.c │ ├── directory.c │ ├── events.c │ ├── final.c │ ├── lint.c │ ├── loop.c │ ├── monitoring.c │ ├── numa.c │ ├── polling.c │ ├── resolve.h │ ├── runtime-info.c │ ├── task-info-registration.c │ ├── task-instantiation.c │ ├── taskwait.c │ ├── user-mutex.c │ ├── version.c │ └── weak-dependencies.c ├── intercept-main-android.c ├── intercept-main-common.c ├── intercept-main-common.h ├── intercept-main-glibc-powerpc.c ├── intercept-main-glibc.c ├── library-mode-init.c ├── loader.c ├── loader.h ├── main-wrapper.c ├── main-wrapper.h ├── scripts │ ├── common.sh │ ├── generate_multidim_functions_for_linear_regions.sh │ ├── generate_regions_indirect_symbol_resolvers.sh │ ├── generate_regions_prototypes.sh │ ├── generate_regions_symbol_resolvers.sh │ ├── generate_release_indirect_symbol_resolvers.sh │ ├── generate_release_prototypes.sh │ ├── generate_release_symbol_resolvers.sh │ └── lint │ │ ├── common.sh │ │ ├── generate_multidim_functions_for_linear_regions.sh │ │ ├── generate_regions_indirect_symbol_resolvers.sh │ │ ├── generate_regions_prototypes.sh │ │ └── generate_regions_symbol_resolvers.sh ├── support │ └── toml │ │ ├── toml.c │ │ └── toml.h └── symbol-resolver │ ├── alpi.c │ ├── api-check.c │ ├── blocking.c │ ├── bootstrap.c │ ├── cluster.c │ ├── config.c │ ├── cpu-control.c │ ├── cuda-device-api.c │ ├── debugging.c │ ├── dependencies.c │ ├── directory.c │ ├── events.c │ ├── final.c │ ├── lint.c │ ├── loop.c │ ├── monitoring.c │ ├── numa.c │ ├── polling.c │ ├── resolve.h │ ├── runtime-info.c │ ├── task-info-registration.c │ ├── task-instantiation.c │ ├── taskwait.c │ ├── user-mutex.c │ ├── version.c │ └── weak-dependencies.c ├── m4 ├── .gitignore ├── arch.m4 ├── ax_boost_base.m4 ├── ax_check_extrae.m4 ├── ax_compare_version.m4 ├── ax_compiler_vendor.m4 ├── ax_cxx_compile_stdcxx.m4 ├── ax_cxx_compile_stdcxx_17.m4 ├── ax_prog_doxygen.m4 ├── ax_pthread.m4 ├── ax_subdirs_configure.m4 ├── babeltrace2.m4 ├── cache.m4 ├── clang.m4 ├── cuda.m4 ├── dlb.m4 ├── dlopen.m4 ├── flags.m4 ├── hwloc.m4 ├── instrumentations.m4 ├── jemalloc.m4 ├── libnuma.m4 ├── linker.m4 ├── loader.m4 ├── mercurium.m4 ├── openacc.m4 ├── ovni.m4 ├── papi.m4 ├── pqos.m4 ├── pthread.m4 ├── sane_awk.m4 ├── sanity.m4 ├── syscalls.m4 └── versions.m4 ├── paraver-cfg └── nanos6 │ ├── 00_overview.cfg │ ├── 01_overview_histograms.cfg │ ├── 02_overview_hardware_counters.cfg │ ├── 03_overview_hardware_counter_histograms.cfg │ ├── advanced │ ├── 2d_general.cfg │ ├── 2dh_effective_paralelism.cfg │ ├── 3dh_cycles_per_us_by_runtime_state.cfg │ ├── 3dh_cycles_per_us_by_task.cfg │ ├── 3dh_instructions_vs_cycles.cfg │ ├── 3dh_runtime_state_duration.cfg │ ├── 3dh_task_duration.cfg │ ├── 3dh_task_frequency.cfg │ ├── 3dh_task_instructions.cfg │ ├── 3dh_task_ipc.cfg │ ├── 3dh_task_l2d_miss_ratio.cfg │ ├── cpu.cfg │ ├── effective_paralelism.cfg │ ├── instantiating_function_name_and_code_line.cfg │ ├── nesting_level.cfg │ ├── numa_node.cfg │ ├── reference_clock.cfg │ ├── running_function_name_and_code_line.cfg │ ├── runtime_state.cfg │ ├── thread.cfg │ ├── thread_creation.cfg │ ├── thread_creation_and_runtime_state.cfg │ └── thread_creation_latency.cfg │ ├── ctf2prv │ ├── ctf_buffers_flush_to_disk.cfg │ ├── hardware_counters.cfg │ ├── kernel │ │ ├── kernel_preemptions.cfg │ │ ├── kernel_syscalls.cfg │ │ └── kernel_thread_id.cfg │ ├── number_of_blocked_tasks.cfg │ ├── number_of_blocked_workers.cfg │ ├── number_of_created_tasks.cfg │ ├── number_of_created_workers.cfg │ ├── number_of_running_tasks.cfg │ ├── number_of_running_workers.cfg │ ├── runtime_status_simple.cfg │ ├── runtime_subsystems.cfg │ ├── task_ids.cfg │ ├── task_source.cfg │ ├── tasks.cfg │ ├── tasks_and_runtime.cfg │ └── thread_id.cfg │ ├── graph_and_scheduling │ ├── creating_submitting_task.cfg │ ├── nb_ready_tasks.cfg │ ├── nb_tasks_in_graph.cfg │ └── task_being_created.cfg │ └── tasks │ ├── 3dh_duration_task.cfg │ ├── 3dh_instr_task.cfg │ ├── 3dh_ipc_task.cfg │ ├── task_and_deps.cfg │ ├── task_number.cfg │ └── task_priority.cfg ├── scripts ├── ctf │ ├── ctf2prv │ ├── ctfkerneldefs │ ├── ctfstats │ ├── plugins │ │ ├── bt_plugin_nanos6.py │ │ ├── executionmodel.py │ │ ├── hwcdefs.py │ │ ├── kernelmodel.py │ │ ├── paravertrace.py │ │ ├── paraverviews.py │ │ └── runtimemodel.py │ └── wrappers │ │ ├── ctf2prv_cte-amd.sh │ │ ├── ctf2prv_cte-power.sh │ │ ├── ctf2prv_marenostrum4.sh │ │ └── ctf2prv_nord3.sh ├── generate_config.sh └── nanos6_defconfig.toml ├── src ├── dependencies │ ├── DataAccessBase.hpp │ ├── DataAccessType.hpp │ ├── DataTrackingSupport.cpp │ ├── DataTrackingSupport.hpp │ ├── MultidimensionalAPITraversal.hpp │ ├── SymbolTranslation.hpp │ ├── discrete │ │ ├── BottomMapEntry.hpp │ │ ├── CPUDependencyData.cpp │ │ ├── CPUDependencyData.hpp │ │ ├── CommutativeSemaphore.cpp │ │ ├── CommutativeSemaphore.hpp │ │ ├── DataAccess.cpp │ │ ├── DataAccess.hpp │ │ ├── DataAccessFlags.hpp │ │ ├── DataAccessRegistration.cpp │ │ ├── DataAccessRegistration.hpp │ │ ├── DataAccessRegistrationImplementation.hpp │ │ ├── Dependencies.hpp │ │ ├── DependencyDomain.hpp │ │ ├── DependencySystem.hpp │ │ ├── DeviceReductionStorage.hpp │ │ ├── MultidimensionalAPI.hpp │ │ ├── ReductionInfo.cpp │ │ ├── ReductionInfo.hpp │ │ ├── ReductionSpecific.hpp │ │ ├── RegisterDependencies.cpp │ │ ├── ReleaseDirective.cpp │ │ ├── TaskDataAccesses.cpp │ │ ├── TaskDataAccesses.hpp │ │ ├── TaskDataAccessesInfo.hpp │ │ └── devices │ │ │ ├── CUDAReductionStorage.cpp │ │ │ ├── CUDAReductionStorage.hpp │ │ │ ├── HostReductionStorage.cpp │ │ │ └── HostReductionStorage.hpp │ ├── linear-regions-fragmented │ │ ├── BottomMapEntry.hpp │ │ ├── CPUDependencyData.hpp │ │ ├── CommutativeScoreboard.cpp │ │ ├── CommutativeScoreboard.hpp │ │ ├── DataAccess.hpp │ │ ├── DataAccessLink.hpp │ │ ├── DataAccessObjectType.hpp │ │ ├── DataAccessRegistration.cpp │ │ ├── DataAccessRegistration.hpp │ │ ├── DataAccessRegistrationImplementation.hpp │ │ ├── DependencyDomain.hpp │ │ ├── DependencySystem.hpp │ │ ├── MultidimensionalAPI.hpp │ │ ├── ReductionInfo.cpp │ │ ├── ReductionInfo.hpp │ │ ├── ReductionSpecific.hpp │ │ ├── RegisterDependencies.cpp │ │ ├── ReleaseDirective.cpp │ │ ├── TaskDataAccessHooks.hpp │ │ ├── TaskDataAccessLinkingArtifacts.hpp │ │ ├── TaskDataAccessLinkingArtifactsImplementation.hpp │ │ ├── TaskDataAccesses.cpp │ │ ├── TaskDataAccesses.hpp │ │ └── TaskDataAccessesInfo.hpp │ └── linear-regions │ │ ├── DataAccessRegion.hpp │ │ ├── DataAccessRegionIndexer.hpp │ │ ├── Dependencies.hpp │ │ ├── IntrusiveLinearRegionMap.hpp │ │ ├── IntrusiveLinearRegionMapImplementation.hpp │ │ ├── LinearRegionMap.hpp │ │ └── LinearRegionMapImplementation.hpp ├── executors │ └── threads │ │ ├── CPU.cpp │ │ ├── CPU.hpp │ │ ├── CPUManager.cpp │ │ ├── CPUManager.hpp │ │ ├── CPUManagerInterface.cpp │ │ ├── CPUManagerInterface.hpp │ │ ├── CPUManagerPolicyInterface.hpp │ │ ├── TaskFinalization.hpp │ │ ├── TaskFinalizationImplementation.hpp │ │ ├── ThreadManager.cpp │ │ ├── ThreadManager.hpp │ │ ├── ThreadManagerPolicy.hpp │ │ ├── WorkerThread.cpp │ │ ├── WorkerThread.hpp │ │ ├── WorkerThreadImplementation.hpp │ │ ├── cpu-managers │ │ ├── default │ │ │ ├── DefaultCPUActivation.hpp │ │ │ ├── DefaultCPUManager.cpp │ │ │ ├── DefaultCPUManager.hpp │ │ │ └── policies │ │ │ │ ├── BusyPolicy.hpp │ │ │ │ ├── HybridPolicy.hpp │ │ │ │ ├── IdlePolicy.cpp │ │ │ │ └── IdlePolicy.hpp │ │ └── dlb │ │ │ ├── DLBCPUActivation.cpp │ │ │ ├── DLBCPUActivation.hpp │ │ │ ├── DLBCPUManager.cpp │ │ │ ├── DLBCPUManager.hpp │ │ │ └── policies │ │ │ ├── GreedyPolicy.cpp │ │ │ ├── GreedyPolicy.hpp │ │ │ ├── LeWIPolicy.cpp │ │ │ └── LeWIPolicy.hpp │ │ └── kernel-level │ │ ├── CPUThreadingModelData.cpp │ │ ├── CPUThreadingModelData.hpp │ │ └── WorkerThreadBase.hpp ├── hardware-counters │ ├── CPUHardwareCounters.hpp │ ├── CPUHardwareCountersInterface.hpp │ ├── HardwareCounters.cpp │ ├── HardwareCounters.hpp │ ├── HardwareCountersInterface.hpp │ ├── SupportedHardwareCounters.hpp │ ├── TaskHardwareCounters.hpp │ ├── TaskHardwareCountersInterface.hpp │ ├── ThreadHardwareCounters.cpp │ ├── ThreadHardwareCounters.hpp │ ├── ThreadHardwareCountersInterface.hpp │ ├── papi │ │ ├── PAPICPUHardwareCounters.hpp │ │ ├── PAPIHardwareCounters.cpp │ │ ├── PAPIHardwareCounters.hpp │ │ ├── PAPITaskHardwareCounters.hpp │ │ └── PAPIThreadHardwareCounters.hpp │ ├── pqos │ │ ├── PQoSCPUHardwareCounters.hpp │ │ ├── PQoSHardwareCounters.cpp │ │ ├── PQoSHardwareCounters.hpp │ │ ├── PQoSTaskHardwareCounters.hpp │ │ └── PQoSThreadHardwareCounters.hpp │ └── rapl │ │ ├── RAPLHardwareCounters.cpp │ │ └── RAPLHardwareCounters.hpp ├── hardware │ ├── HardwareInfo.cpp │ ├── HardwareInfo.hpp │ ├── device │ │ ├── Accelerator.cpp │ │ ├── Accelerator.hpp │ │ ├── DeviceEnvironment.hpp │ │ ├── cuda │ │ │ ├── CUDAAccelerator.cpp │ │ │ ├── CUDAAccelerator.hpp │ │ │ ├── CUDADeviceInfo.hpp │ │ │ ├── CUDADirectoryAgent.cpp │ │ │ ├── CUDADirectoryAgent.hpp │ │ │ ├── CUDAFunctions.hpp │ │ │ ├── CUDARuntimeLoader.cpp │ │ │ ├── CUDARuntimeLoader.hpp │ │ │ └── CUDAStreamPool.hpp │ │ ├── directory │ │ │ ├── Directory.cpp │ │ │ ├── Directory.hpp │ │ │ ├── DirectoryAgent.hpp │ │ │ ├── DirectoryEntry.hpp │ │ │ ├── DirectoryPage.hpp │ │ │ └── HostDirectoryAgent.hpp │ │ └── openacc │ │ │ ├── OpenAccAccelerator.cpp │ │ │ ├── OpenAccAccelerator.hpp │ │ │ ├── OpenAccDeviceInfo.hpp │ │ │ ├── OpenAccFunctions.hpp │ │ │ └── OpenAccQueuePool.hpp │ ├── hwinfo │ │ ├── DeviceInfo.hpp │ │ ├── HostInfo.cpp │ │ └── HostInfo.hpp │ └── places │ │ ├── CPUPlace.hpp │ │ ├── ComputePlace.cpp │ │ ├── ComputePlace.hpp │ │ ├── HardwareCache.hpp │ │ ├── L2Cache.hpp │ │ ├── L3Cache.hpp │ │ ├── MemoryPlace.hpp │ │ ├── NUMAPlace.cpp │ │ └── NUMAPlace.hpp ├── instrument │ ├── api │ │ ├── InstrumentAddTask.hpp │ │ ├── InstrumentBlockingAPI.hpp │ │ ├── InstrumentComputePlaceManagement.hpp │ │ ├── InstrumentDataAccessTypes.hpp │ │ ├── InstrumentDebug.hpp │ │ ├── InstrumentDependenciesByAccess.hpp │ │ ├── InstrumentDependenciesByAccessLinks.hpp │ │ ├── InstrumentDependenciesByGroup.hpp │ │ ├── InstrumentDependencySubsystemEntryPoints.hpp │ │ ├── InstrumentInitAndShutdown.hpp │ │ ├── InstrumentLeaderThread.hpp │ │ ├── InstrumentLogMessage.hpp │ │ ├── InstrumentMainThread.hpp │ │ ├── InstrumentMemory.hpp │ │ ├── InstrumentPthread.hpp │ │ ├── InstrumentReductions.hpp │ │ ├── InstrumentScheduler.hpp │ │ ├── InstrumentTaskExecution.hpp │ │ ├── InstrumentTaskStatus.hpp │ │ ├── InstrumentTaskWait.hpp │ │ ├── InstrumentThreadManagement.hpp │ │ ├── InstrumentTracingPoints.hpp │ │ ├── InstrumentUserMutex.hpp │ │ └── InstrumentWorkerThread.hpp │ ├── ctf │ │ ├── CTFTracepoints.cpp │ │ ├── CTFTracepoints.hpp │ │ ├── InstrumentAddTask.hpp │ │ ├── InstrumentBlockingAPI.hpp │ │ ├── InstrumentCPULocalData.cpp │ │ ├── InstrumentCPULocalData.hpp │ │ ├── InstrumentComputePlaceId.hpp │ │ ├── InstrumentComputePlaceManagement.hpp │ │ ├── InstrumentDataAccessId.hpp │ │ ├── InstrumentDebug.hpp │ │ ├── InstrumentDependenciesByAccess.hpp │ │ ├── InstrumentDependenciesByAccessLinks.hpp │ │ ├── InstrumentDependenciesByGroup.hpp │ │ ├── InstrumentDependencySubsystemEntryPoints.hpp │ │ ├── InstrumentExternalThreadId.hpp │ │ ├── InstrumentExternalThreadLocalData.cpp │ │ ├── InstrumentExternalThreadLocalData.hpp │ │ ├── InstrumentInitAndShutdown.cpp │ │ ├── InstrumentInitAndShutdown.hpp │ │ ├── InstrumentInstrumentationContext.hpp │ │ ├── InstrumentLeaderThread.hpp │ │ ├── InstrumentLogMessage.hpp │ │ ├── InstrumentMainThread.hpp │ │ ├── InstrumentMemory.hpp │ │ ├── InstrumentPthread.hpp │ │ ├── InstrumentReductions.hpp │ │ ├── InstrumentScheduler.hpp │ │ ├── InstrumentTaskExecution.hpp │ │ ├── InstrumentTaskId.cpp │ │ ├── InstrumentTaskId.hpp │ │ ├── InstrumentTaskStatus.hpp │ │ ├── InstrumentTaskWait.hpp │ │ ├── InstrumentTasktypeData.cpp │ │ ├── InstrumentTasktypeData.hpp │ │ ├── InstrumentThreadId.hpp │ │ ├── InstrumentThreadInstrumentationContext.hpp │ │ ├── InstrumentThreadLocalData.hpp │ │ ├── InstrumentThreadManagement.cpp │ │ ├── InstrumentThreadManagement.hpp │ │ ├── InstrumentTracingPointTypes.hpp │ │ ├── InstrumentTracingPoints.hpp │ │ ├── InstrumentUserMutex.hpp │ │ ├── InstrumentWorkerThread.hpp │ │ └── ctfapi │ │ │ ├── CTFAPI.cpp │ │ │ ├── CTFAPI.hpp │ │ │ ├── CTFClock.hpp │ │ │ ├── CTFEvent.cpp │ │ │ ├── CTFEvent.hpp │ │ │ ├── CTFKernelMetadata.cpp │ │ │ ├── CTFKernelMetadata.hpp │ │ │ ├── CTFMetadata.cpp │ │ │ ├── CTFMetadata.hpp │ │ │ ├── CTFTrace.cpp │ │ │ ├── CTFTrace.hpp │ │ │ ├── CTFTypes.hpp │ │ │ ├── CTFUserMetadata.cpp │ │ │ ├── CTFUserMetadata.hpp │ │ │ ├── context │ │ │ ├── CTFContext.hpp │ │ │ ├── CTFContextCPUHardwareCounters.cpp │ │ │ ├── CTFContextCPUHardwareCounters.hpp │ │ │ ├── CTFContextTaskHardwareCounters.cpp │ │ │ ├── CTFContextTaskHardwareCounters.hpp │ │ │ ├── CTFEventContext.hpp │ │ │ └── CTFStreamContextUnbounded.hpp │ │ │ └── stream │ │ │ ├── CTFKernelEventsProvider.cpp │ │ │ ├── CTFKernelEventsProvider.hpp │ │ │ ├── CTFKernelEventsProviderDebug.cpp │ │ │ ├── CTFKernelStream.cpp │ │ │ ├── CTFKernelStream.hpp │ │ │ ├── CTFStream.cpp │ │ │ ├── CTFStream.hpp │ │ │ ├── CTFStreamUnboundedPrivate.hpp │ │ │ ├── CTFStreamUnboundedShared.hpp │ │ │ ├── CircularBuffer.cpp │ │ │ └── CircularBuffer.hpp │ ├── extrae │ │ ├── ExtraeSymbolLiterals.cpp │ │ ├── ExtraeSymbolLiterals.hpp │ │ ├── ExtraeSymbolResolver.cpp │ │ ├── ExtraeSymbolResolver.hpp │ │ ├── InstrumentAddTask.hpp │ │ ├── InstrumentBlockingAPI.hpp │ │ ├── InstrumentCPULocalData.hpp │ │ ├── InstrumentCommon.hpp │ │ ├── InstrumentComputePlaceId.hpp │ │ ├── InstrumentComputePlaceManagement.hpp │ │ ├── InstrumentDataAccessId.hpp │ │ ├── InstrumentDebug.hpp │ │ ├── InstrumentDependenciesByAccess.hpp │ │ ├── InstrumentDependenciesByAccessLinks.hpp │ │ ├── InstrumentDependenciesByGroup.hpp │ │ ├── InstrumentDependencySubsystemEntryPoints.hpp │ │ ├── InstrumentExternalThreadId.hpp │ │ ├── InstrumentExternalThreadLocalData.hpp │ │ ├── InstrumentExtrae.cpp │ │ ├── InstrumentExtrae.hpp │ │ ├── InstrumentInitAndShutdown.cpp │ │ ├── InstrumentInitAndShutdown.hpp │ │ ├── InstrumentLeaderThread.hpp │ │ ├── InstrumentLogMessage.hpp │ │ ├── InstrumentMainThread.hpp │ │ ├── InstrumentMemory.hpp │ │ ├── InstrumentPthread.hpp │ │ ├── InstrumentReductions.cpp │ │ ├── InstrumentReductions.hpp │ │ ├── InstrumentScheduler.hpp │ │ ├── InstrumentTaskExecution.hpp │ │ ├── InstrumentTaskId.hpp │ │ ├── InstrumentTaskStatus.hpp │ │ ├── InstrumentTaskWait.hpp │ │ ├── InstrumentTasktypeData.hpp │ │ ├── InstrumentThreadId.hpp │ │ ├── InstrumentThreadLocalData.hpp │ │ ├── InstrumentThreadManagement.hpp │ │ ├── InstrumentTracingPointTypes.hpp │ │ ├── InstrumentTracingPoints.hpp │ │ ├── InstrumentUserMutex.hpp │ │ ├── InstrumentWorkerThread.hpp │ │ └── PreloadedExtraeBouncer.hpp │ ├── generic_ids │ │ ├── GenericIds.cpp │ │ ├── GenericIds.hpp │ │ ├── InstrumentComputePlaceId.hpp │ │ ├── InstrumentExternalThreadId.hpp │ │ └── InstrumentThreadId.hpp │ ├── lint │ │ ├── Callbacks.cpp │ │ ├── Callbacks.hpp │ │ ├── InstrumentAddTask.hpp │ │ ├── InstrumentBlockingAPI.hpp │ │ ├── InstrumentCPULocalData.hpp │ │ ├── InstrumentComputePlaceId.hpp │ │ ├── InstrumentComputePlaceManagement.hpp │ │ ├── InstrumentDataAccessId.hpp │ │ ├── InstrumentDebug.hpp │ │ ├── InstrumentDependenciesByAccess.hpp │ │ ├── InstrumentDependenciesByAccessLinks.hpp │ │ ├── InstrumentDependenciesByGroup.hpp │ │ ├── InstrumentDependencySubsystemEntryPoints.hpp │ │ ├── InstrumentExternalThreadId.hpp │ │ ├── InstrumentExternalThreadLocalData.hpp │ │ ├── InstrumentInitAndShutdown.hpp │ │ ├── InstrumentInstrumentationContext.hpp │ │ ├── InstrumentLeaderThread.hpp │ │ ├── InstrumentLogMessage.hpp │ │ ├── InstrumentMainThread.hpp │ │ ├── InstrumentMemory.hpp │ │ ├── InstrumentPthread.hpp │ │ ├── InstrumentReductions.hpp │ │ ├── InstrumentScheduler.hpp │ │ ├── InstrumentTaskExecution.hpp │ │ ├── InstrumentTaskId.hpp │ │ ├── InstrumentTaskStatus.hpp │ │ ├── InstrumentTaskWait.hpp │ │ ├── InstrumentTasktypeData.hpp │ │ ├── InstrumentThreadId.hpp │ │ ├── InstrumentThreadInstrumentationContext.hpp │ │ ├── InstrumentThreadLocalData.hpp │ │ ├── InstrumentThreadManagement.hpp │ │ ├── InstrumentTracingPointTypes.hpp │ │ ├── InstrumentTracingPoints.hpp │ │ ├── InstrumentUserMutex.hpp │ │ └── InstrumentWorkerThread.hpp │ ├── null │ │ ├── InstrumentAddTask.hpp │ │ ├── InstrumentBlockingAPI.hpp │ │ ├── InstrumentCPULocalData.hpp │ │ ├── InstrumentComputePlaceId.hpp │ │ ├── InstrumentComputePlaceManagement.hpp │ │ ├── InstrumentDataAccessId.hpp │ │ ├── InstrumentDebug.hpp │ │ ├── InstrumentDependenciesByAccess.hpp │ │ ├── InstrumentDependenciesByAccessLinks.hpp │ │ ├── InstrumentDependenciesByGroup.hpp │ │ ├── InstrumentDependencySubsystemEntryPoints.hpp │ │ ├── InstrumentExternalThreadId.hpp │ │ ├── InstrumentExternalThreadLocalData.hpp │ │ ├── InstrumentInitAndShutdown.hpp │ │ ├── InstrumentInstrumentationContext.hpp │ │ ├── InstrumentLeaderThread.hpp │ │ ├── InstrumentLogMessage.hpp │ │ ├── InstrumentMainThread.hpp │ │ ├── InstrumentMemory.hpp │ │ ├── InstrumentPthread.hpp │ │ ├── InstrumentReductions.hpp │ │ ├── InstrumentScheduler.hpp │ │ ├── InstrumentTaskExecution.hpp │ │ ├── InstrumentTaskId.hpp │ │ ├── InstrumentTaskStatus.hpp │ │ ├── InstrumentTaskWait.hpp │ │ ├── InstrumentTasktypeData.hpp │ │ ├── InstrumentThreadId.hpp │ │ ├── InstrumentThreadInstrumentationContext.hpp │ │ ├── InstrumentThreadLocalData.hpp │ │ ├── InstrumentThreadManagement.hpp │ │ ├── InstrumentTracingPointTypes.hpp │ │ ├── InstrumentTracingPoints.hpp │ │ ├── InstrumentUserMutex.hpp │ │ └── InstrumentWorkerThread.hpp │ ├── ovni │ │ ├── InstrumentAddTask.hpp │ │ ├── InstrumentBlockingAPI.hpp │ │ ├── InstrumentCPULocalData.hpp │ │ ├── InstrumentComputePlaceId.hpp │ │ ├── InstrumentComputePlaceManagement.hpp │ │ ├── InstrumentDataAccessId.hpp │ │ ├── InstrumentDebug.hpp │ │ ├── InstrumentDependenciesByAccess.hpp │ │ ├── InstrumentDependenciesByAccessLinks.hpp │ │ ├── InstrumentDependenciesByGroup.hpp │ │ ├── InstrumentDependencySubsystemEntryPoints.hpp │ │ ├── InstrumentExternalThreadId.hpp │ │ ├── InstrumentExternalThreadLocalData.cpp │ │ ├── InstrumentExternalThreadLocalData.hpp │ │ ├── InstrumentInitAndShutdown.cpp │ │ ├── InstrumentInitAndShutdown.hpp │ │ ├── InstrumentInstrumentationContext.hpp │ │ ├── InstrumentLeaderThread.hpp │ │ ├── InstrumentLogMessage.hpp │ │ ├── InstrumentMainThread.hpp │ │ ├── InstrumentMemory.hpp │ │ ├── InstrumentPthread.hpp │ │ ├── InstrumentReductions.hpp │ │ ├── InstrumentScheduler.hpp │ │ ├── InstrumentTaskExecution.hpp │ │ ├── InstrumentTaskId.cpp │ │ ├── InstrumentTaskId.hpp │ │ ├── InstrumentTaskStatus.hpp │ │ ├── InstrumentTaskWait.hpp │ │ ├── InstrumentTasktypeData.cpp │ │ ├── InstrumentTasktypeData.hpp │ │ ├── InstrumentThreadId.hpp │ │ ├── InstrumentThreadInstrumentationContext.hpp │ │ ├── InstrumentThreadLocalData.hpp │ │ ├── InstrumentThreadManagement.cpp │ │ ├── InstrumentThreadManagement.hpp │ │ ├── InstrumentTracingPointTypes.hpp │ │ ├── InstrumentTracingPoints.hpp │ │ ├── InstrumentUserMutex.hpp │ │ ├── InstrumentWorkerThread.hpp │ │ └── OvniTrace.hpp │ ├── support │ │ ├── InstrumentCPULocalDataSupport.cpp │ │ ├── InstrumentCPULocalDataSupport.hpp │ │ ├── InstrumentHardwarePlaceManagement.hpp │ │ ├── InstrumentInstrumentationContext.hpp │ │ ├── InstrumentStandardExternalThreadLocalData.hpp │ │ ├── InstrumentThreadInstrumentationContext.cpp │ │ ├── InstrumentThreadInstrumentationContext.hpp │ │ ├── InstrumentThreadLocalDataSupport.cpp │ │ └── InstrumentThreadLocalDataSupport.hpp │ └── verbose │ │ ├── InstrumentAddTask.cpp │ │ ├── InstrumentAddTask.hpp │ │ ├── InstrumentBlockingAPI.cpp │ │ ├── InstrumentBlockingAPI.hpp │ │ ├── InstrumentCPULocalData.hpp │ │ ├── InstrumentComputePlaceId.hpp │ │ ├── InstrumentComputePlaceManagement.cpp │ │ ├── InstrumentComputePlaceManagement.hpp │ │ ├── InstrumentDataAccessId.hpp │ │ ├── InstrumentDebug.hpp │ │ ├── InstrumentDependenciesByAccess.cpp │ │ ├── InstrumentDependenciesByAccess.hpp │ │ ├── InstrumentDependenciesByAccessLinks.cpp │ │ ├── InstrumentDependenciesByAccessLinks.hpp │ │ ├── InstrumentDependenciesByGroup.cpp │ │ ├── InstrumentDependenciesByGroup.hpp │ │ ├── InstrumentDependencySubsystemEntryPoints.hpp │ │ ├── InstrumentExternalThreadId.hpp │ │ ├── InstrumentExternalThreadLocalData.hpp │ │ ├── InstrumentInitAndShutdown.cpp │ │ ├── InstrumentInitAndShutdown.hpp │ │ ├── InstrumentLeaderThread.cpp │ │ ├── InstrumentLeaderThread.hpp │ │ ├── InstrumentLogMessage.hpp │ │ ├── InstrumentMainThread.hpp │ │ ├── InstrumentMemory.hpp │ │ ├── InstrumentPthread.hpp │ │ ├── InstrumentReductions.cpp │ │ ├── InstrumentReductions.hpp │ │ ├── InstrumentScheduler.hpp │ │ ├── InstrumentTaskExecution.cpp │ │ ├── InstrumentTaskExecution.hpp │ │ ├── InstrumentTaskId.hpp │ │ ├── InstrumentTaskStatus.cpp │ │ ├── InstrumentTaskStatus.hpp │ │ ├── InstrumentTaskWait.cpp │ │ ├── InstrumentTaskWait.hpp │ │ ├── InstrumentTasktypeData.hpp │ │ ├── InstrumentThreadId.hpp │ │ ├── InstrumentThreadLocalData.hpp │ │ ├── InstrumentThreadManagement.cpp │ │ ├── InstrumentThreadManagement.hpp │ │ ├── InstrumentTracingPointTypes.hpp │ │ ├── InstrumentTracingPoints.hpp │ │ ├── InstrumentUserMutex.cpp │ │ ├── InstrumentUserMutex.hpp │ │ ├── InstrumentVerbose.cpp │ │ ├── InstrumentVerbose.hpp │ │ └── InstrumentWorkerThread.hpp ├── lowlevel │ ├── BoostAssertionFailureHandler.cpp │ ├── CompatSyscalls.hpp │ ├── ConditionVariable.hpp │ ├── DelegationLock.hpp │ ├── EnvironmentVariable.hpp │ ├── FatalErrorHandler.cpp │ ├── FatalErrorHandler.hpp │ ├── MultiConditionVariable.hpp │ ├── PaddedSpinLock.hpp │ ├── PaddedTicketSpinLock.hpp │ ├── Padding.hpp │ ├── RWSpinLock.hpp │ ├── SpinLock.hpp │ ├── SpinWait.hpp │ ├── TicketArraySpinLock.hpp │ ├── TicketSpinLock.hpp │ ├── TokenizedEnvironmentVariable.hpp │ ├── TurboSettings.hpp │ ├── cuda │ │ └── CUDAErrorHandler.hpp │ └── threads │ │ ├── ExternalThread.cpp │ │ ├── ExternalThread.hpp │ │ ├── ExternalThreadGroup.cpp │ │ ├── ExternalThreadGroup.hpp │ │ ├── HelperThread.hpp │ │ ├── KernelLevelThread.cpp │ │ ├── KernelLevelThread.hpp │ │ └── posix │ │ └── KernelLevelThread.hpp ├── memory │ ├── AddressSpace.hpp │ ├── allocator │ │ ├── jemalloc │ │ │ ├── MemoryAllocator.hpp │ │ │ └── ObjectAllocator.hpp │ │ └── malloc │ │ │ ├── MemoryAllocator.hpp │ │ │ └── ObjectAllocator.hpp │ ├── directory │ │ ├── Directory.cpp │ │ ├── Directory.hpp │ │ ├── HomeMapEntry.hpp │ │ ├── HomeNodeMap.cpp │ │ └── HomeNodeMap.hpp │ └── numa │ │ ├── NUMAManager.cpp │ │ └── NUMAManager.hpp ├── monitoring │ ├── CPUMonitor.hpp │ ├── CPUStatistics.hpp │ ├── Monitoring.cpp │ ├── Monitoring.hpp │ ├── MonitoringSupport.hpp │ ├── TaskMonitor.cpp │ ├── TaskMonitor.hpp │ ├── TaskStatistics.hpp │ ├── Tasktype.cpp │ ├── Tasktype.hpp │ ├── TasktypeStatistics.cpp │ └── TasktypeStatistics.hpp ├── scheduling │ ├── LocalScheduler.hpp │ ├── ReadyQueue.hpp │ ├── Scheduler.cpp │ ├── Scheduler.hpp │ ├── SchedulerGenerator.cpp │ ├── SchedulerGenerator.hpp │ ├── SchedulerInterface.cpp │ ├── SchedulerInterface.hpp │ ├── SchedulerSupport.hpp │ ├── ready-queues │ │ ├── DeadlineQueue.hpp │ │ ├── ReadyQueueDeque.hpp │ │ └── ReadyQueueMap.hpp │ └── schedulers │ │ ├── HostScheduler.hpp │ │ ├── HostUnsyncScheduler.cpp │ │ ├── HostUnsyncScheduler.hpp │ │ ├── SyncScheduler.cpp │ │ ├── SyncScheduler.hpp │ │ ├── UnsyncScheduler.cpp │ │ ├── UnsyncScheduler.hpp │ │ └── device │ │ ├── DeviceScheduler.hpp │ │ ├── DeviceUnsyncScheduler.cpp │ │ └── DeviceUnsyncScheduler.hpp ├── support │ ├── BitManipulation.hpp │ ├── Chrono.hpp │ ├── ConcurrentUnorderedList.hpp │ ├── Containers.hpp │ ├── GenericFactory.hpp │ ├── GlobalLock.cpp │ ├── GlobalLock.hpp │ ├── InstrumentedThread.hpp │ ├── JsonFile.hpp │ ├── JsonNode.hpp │ ├── MathSupport.hpp │ ├── Objectified.hpp │ ├── StringLiteral.hpp │ ├── StringSupport.hpp │ ├── bitset │ │ └── AtomicBitset.hpp │ └── config │ │ ├── ConfigCentral.cpp │ │ ├── ConfigCentral.hpp │ │ ├── ConfigChecker.cpp │ │ ├── ConfigChecker.hpp │ │ ├── ConfigParser.cpp │ │ ├── ConfigParser.hpp │ │ ├── ConfigSupport.hpp │ │ ├── ConfigVariable.cpp │ │ ├── ConfigVariable.hpp │ │ ├── toml.hpp │ │ └── toml │ │ ├── color.hpp │ │ ├── combinator.hpp │ │ ├── comments.hpp │ │ ├── datetime.hpp │ │ ├── exception.hpp │ │ ├── from.hpp │ │ ├── get.hpp │ │ ├── into.hpp │ │ ├── lexer.hpp │ │ ├── literal.hpp │ │ ├── parser.hpp │ │ ├── region.hpp │ │ ├── result.hpp │ │ ├── serializer.hpp │ │ ├── source_location.hpp │ │ ├── storage.hpp │ │ ├── string.hpp │ │ ├── traits.hpp │ │ ├── types.hpp │ │ ├── utility.hpp │ │ └── value.hpp ├── system │ ├── ALPI.cpp │ ├── APICheck.cpp │ ├── APICheck.hpp │ ├── AddTask.cpp │ ├── AddTask.hpp │ ├── BlockingAPI.cpp │ ├── BlockingAPI.hpp │ ├── Bootstrap.cpp │ ├── CUDADeviceAPI.cpp │ ├── ClusterAPI.cpp │ ├── ConfigAPI.cpp │ ├── EventsAPI.cpp │ ├── EventsAPI.hpp │ ├── If0Task.hpp │ ├── LeaderThread.cpp │ ├── LeaderThread.hpp │ ├── LintAPI.cpp │ ├── Loop.cpp │ ├── MonitoringAPI.cpp │ ├── NumaAPI.cpp │ ├── PollingAPI.cpp │ ├── Query.cpp │ ├── RuntimeInfo.cpp │ ├── RuntimeInfo.hpp │ ├── RuntimeInfoAPI.cpp │ ├── RuntimeInfoEssentials.cpp │ ├── RuntimeInfoEssentials.hpp │ ├── SpawnFunction.cpp │ ├── SpawnFunction.hpp │ ├── TaskBlocking.hpp │ ├── TaskInfoAPI.cpp │ ├── TaskWait.cpp │ ├── TaskWait.hpp │ ├── Throttle.cpp │ ├── Throttle.hpp │ ├── TrackingPoints.cpp │ ├── TrackingPoints.hpp │ ├── UserMutex.cpp │ ├── UserMutex.hpp │ ├── debug │ │ ├── DebugAPI.cpp │ │ └── RuntimeVersionAPI.cpp │ └── emit-rlimit-code.sh ├── tasks │ ├── LoopGenerator.hpp │ ├── StreamExecutor.hpp │ ├── StreamManager.cpp │ ├── StreamManager.hpp │ ├── Task.cpp │ ├── Task.hpp │ ├── TaskDebuggingInterface.hpp │ ├── TaskImplementation.hpp │ ├── TaskInfoManager.cpp │ ├── TaskInfoManager.hpp │ ├── Taskloop.cpp │ └── Taskloop.hpp └── version │ ├── VersionAPI.cpp │ └── VersionInfo.hpp └── tests ├── Atomic.hpp ├── Functors.hpp ├── TestAnyProtocolProducer.hpp ├── Timer.hpp ├── Utils.hpp ├── UtilsCUDA.hpp ├── directive_based ├── .gitignore ├── alpi │ └── alpi.cpp ├── blocking │ └── blocking.cpp ├── clang │ └── Makefile.am ├── commutative │ ├── commutative-stencil.cpp │ └── simple-commutative.cpp ├── cpu-activation │ ├── ConditionVariable.hpp │ └── cpu-activation.cpp ├── critical │ └── critical.cpp ├── cuda │ ├── cuda-kernargs-kernel.cu │ ├── cuda-kernargs.cpp │ ├── cuda-kernargs.hpp │ ├── cuda-ndrange-directory.cpp │ ├── cuda-ndrange-kernel.cu │ ├── cuda-ndrange.cpp │ ├── cuda-ndrange.hpp │ ├── cuda-saxpy-directory.cpp │ ├── cuda-saxpy-kernel.cu │ ├── cuda-saxpy.cpp │ ├── cuda-saxpy.hpp │ ├── cuda-shmem-kernel.cu │ ├── cuda-shmem.cpp │ └── cuda-shmem.hpp ├── dependencies │ ├── dep-early-release.cpp │ ├── dep-er-and-weak.cpp │ ├── dep-nonest.cpp │ ├── dep-wait.cpp │ └── if0.cpp ├── discrete │ ├── discrete-deps-early-release.cpp │ ├── discrete-deps-er-and-weak.cpp │ ├── discrete-deps-nonest.cpp │ ├── discrete-deps-wait.cpp │ ├── discrete-deps.cpp │ ├── discrete-release.cpp │ └── discrete-simple-commutative.cpp ├── dlb │ ├── dlb-cpu-management.cpp │ ├── dlb-cpu-sharing-active-process.cpp │ ├── dlb-cpu-sharing-passive-process.cpp │ └── dlb-cpu-sharing.cpp ├── events │ ├── events-dep.cpp │ └── events.cpp ├── fibonacci │ └── fibonacci.cpp ├── linear-regions │ ├── lr-early-release.cpp │ ├── lr-er-and-weak.cpp │ ├── lr-nonest-upgrades.cpp │ ├── lr-nonest.cpp │ └── lr-release.cpp ├── mercurium │ └── Makefile.am ├── numa │ ├── numa-allocations.cpp │ ├── numa-auto.cpp │ ├── numa-bitmask-manip.cpp │ ├── numa-irregular-allocations.cpp │ ├── numa-off.cpp │ ├── numa-on.cpp │ └── numa-wildcards.cpp ├── onready │ ├── onready-events.cpp │ └── onready.cpp ├── reductions │ ├── red-firstprivate.cpp │ ├── red-nest-other.cpp │ ├── red-nest.cpp │ ├── red-nonest.cpp │ ├── red-nqueens.cpp │ └── red-stress.cpp ├── scheduling │ └── scheduling-wait-for.cpp └── taskloop │ ├── discrete-taskloop-nested-dep-multiaxpy.cpp │ ├── taskloop-dep-multiaxpy.cpp │ ├── taskloop-multiaxpy.cpp │ ├── taskloop-nested-dep-multiaxpy.cpp │ ├── taskloop-nonpod.cpp │ ├── taskloop-nqueens.cpp │ └── taskloop-wait.cpp ├── select-version.sh ├── tap-driver.pl └── tap-driver.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.Plo 2 | *.kate-swp 3 | *.kdev4 4 | *.la 5 | *.lo 6 | *.log 7 | *.o 8 | *.orig 9 | *.rej 10 | *.test 11 | *.trs 12 | *.was 13 | *.was-* 14 | *~ 15 | .deps 16 | .dirstamp 17 | .libs 18 | INSTALL 19 | Makefile 20 | Makefile.in 21 | aclocal.m4 22 | autom4te.cache 23 | config-aux 24 | /config.h 25 | config.h.in 26 | config.status 27 | configure 28 | configure.scan 29 | libtool 30 | stamp-h1 31 | *.swp 32 | **cscope.out 33 | deps/** -------------------------------------------------------------------------------- /api/nanos6/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_CONFIG_H 8 | #define NANOS6_CONFIG_H 9 | 10 | #include "major.h" 11 | 12 | 13 | #pragma GCC visibility push(default) 14 | 15 | 16 | // NOTE: The full version depends also on nanos6_major_api 17 | // That is: nanos6_major_api . nanos6_config_api 18 | enum nanos6_config_api_t { nanos6_config_api = 1 }; 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | void nanos6_config_assert(const char *config_condition); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #pragma GCC visibility pop 32 | 33 | 34 | #endif // NANOS6_CONFIG_H 35 | -------------------------------------------------------------------------------- /api/nanos6/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_CONSTANTS_H 8 | #define NANOS6_CONSTANTS_H 9 | 10 | 11 | #include "major.h" 12 | 13 | 14 | #pragma GCC visibility push(default) 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | 21 | typedef enum { 22 | __nanos6_max_dimensions = 8 23 | } __nanos6_api_constants_t; 24 | 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | 31 | #pragma GCC visibility pop 32 | 33 | #endif /* NANOS6_CONSTANTS_H */ 34 | -------------------------------------------------------------------------------- /api/nanos6/cuda_device.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_CUDA_DEVICE_H 8 | #define NANOS6_CUDA_DEVICE_H 9 | 10 | #include "major.h" 11 | 12 | 13 | #pragma GCC visibility push(default) 14 | 15 | 16 | // NOTE: The full version depends also on nanos6_major_api 17 | // That is: nanos6_major_api . nanos6_cuda_device_api 18 | enum nanos6_cuda_device_api_t { nanos6_cuda_device_api = 2 }; 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | 28 | typedef struct { 29 | cudaStream_t stream; 30 | cudaEvent_t event; 31 | } nanos6_cuda_device_environment_t; 32 | 33 | cudaStream_t nanos6_get_current_cuda_stream(void); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #pragma GCC visibility pop 40 | 41 | #endif /* NANOS6_CUDA_DEVICE_H */ 42 | 43 | -------------------------------------------------------------------------------- /api/nanos6/devices.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_DEVICES_H 8 | #define NANOS6_DEVICES_H 9 | 10 | #include "major.h" 11 | 12 | #if NANOS6_CUDA 13 | #include "cuda_device.h" 14 | #endif 15 | 16 | #if NANOS6_OPENACC 17 | #include "openacc_device.h" 18 | #endif 19 | 20 | #if NANOS6_OPENCL 21 | #include "opencl_device.h" 22 | #endif 23 | 24 | #endif /* NANOS6_DEVICES_H */ 25 | 26 | -------------------------------------------------------------------------------- /api/nanos6/final.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_FINAL_H 8 | #define NANOS6_FINAL_H 9 | 10 | #include "major.h" 11 | 12 | 13 | #pragma GCC visibility push(default) 14 | 15 | 16 | // NOTE: The full version depends also on nanos6_major_api 17 | // That is: nanos6_major_api . nanos6_final_api 18 | enum nanos6_final_api_t { nanos6_final_api = 1 }; 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | //! \brief Check if running in a final context 27 | signed int nanos6_in_final(void); 28 | 29 | //! \brief Check if running in a serial context 30 | signed int nanos6_in_serial_context(void); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #pragma GCC visibility pop 37 | 38 | 39 | #endif /* NANOS6_FINAL_H */ 40 | -------------------------------------------------------------------------------- /api/nanos6/lint.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_LINT_H 8 | #define NANOS6_LINT_H 9 | 10 | #include "major.h" 11 | 12 | 13 | #pragma GCC visibility push(default) 14 | 15 | 16 | // NOTE: The full version depends also on nanos6_major_api 17 | // That is: nanos6_major_api . nanos6_lint_api 18 | enum nanos6_lint_api_t { nanos6_lint_api = 1 }; 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | 25 | 26 | void nanos6_lint_ignore_region_begin(void); 27 | 28 | void nanos6_lint_ignore_region_end(void); 29 | 30 | void nanos6_lint_register_alloc( 31 | void *base_address, 32 | unsigned long size 33 | ); 34 | 35 | void nanos6_lint_register_free( 36 | void *base_address 37 | ); 38 | 39 | 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #pragma GCC visibility pop 46 | 47 | #endif /* NANOS6_LINT_H */ 48 | -------------------------------------------------------------------------------- /api/nanos6/major.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_MAJOR_H 8 | #define NANOS6_MAJOR_H 9 | 10 | 11 | //! NOTE: Every change in the major version resets every other version to 1 except api_check 12 | enum nanos6_major_api_t { nanos6_major_api = 3 }; 13 | 14 | 15 | #endif /* NANOS6_MAJOR_H */ 16 | -------------------------------------------------------------------------------- /api/nanos6/monitoring.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_MONITORING_H 8 | #define NANOS6_MONITORING_H 9 | 10 | #include "major.h" 11 | 12 | #pragma GCC visibility push(default) 13 | 14 | 15 | // NOTE: The full version depends also on nanos6_major_api 16 | // That is: nanos6_major_api . nanos6_monitoring_api 17 | enum nanos6_monitoring_api_t { nanos6_monitoring_api = 1 }; 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | //! \brief Get a prediction of the elapsed execution time 24 | //! \return The predicted elapsed execution time (microseconds) or 0 25 | //! if not available 26 | double nanos6_get_predicted_elapsed_time(void); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #pragma GCC visibility pop 33 | 34 | 35 | #endif /* NANOS6_MONITORING_H */ 36 | -------------------------------------------------------------------------------- /api/nanos6/openacc_device.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_OPENACC_DEVICE_H 8 | #define NANOS6_OPENACC_DEVICE_H 9 | 10 | #include "major.h" 11 | 12 | #pragma GCC visibility push(default) 13 | 14 | // NOTE: The full version depends also on nanos6_major_api 15 | // That is: nanos6_major_api . nanos6_openacc_device_api 16 | enum nanos6_openacc_device_api_t { nanos6_openacc_device_api = 1 }; 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | typedef struct { 23 | int asyncId; 24 | } nanos6_openacc_device_environment_t; 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #pragma GCC visibility pop 31 | 32 | #endif /* NANOS6_OPENACC_DEVICE_H */ 33 | 34 | -------------------------------------------------------------------------------- /api/nanos6/task-info-registration.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_TASK_INFO_REGISTRATION_H 8 | #define NANOS6_TASK_INFO_REGISTRATION_H 9 | 10 | #include "major.h" 11 | #include "task-instantiation.h" 12 | 13 | 14 | #pragma GCC visibility push(default) 15 | 16 | 17 | // NOTE: The full version depends also on nanos6_major_api 18 | // That is: nanos6_major_api . nanos6_task_info_registration_api 19 | enum nanos6_task_info_registration_api_t { nanos6_task_info_registration_api = 2 }; 20 | 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | 27 | //! \brief Register a type of task 28 | //! 29 | //! \param[in] task_info a pointer to the nanos6_task_info_t structure 30 | void nanos6_register_task_info(nanos6_task_info_t *task_info); 31 | 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #pragma GCC visibility pop 38 | 39 | 40 | #endif /* NANOS6_TASK_INFO_REGISTRATION_H */ 41 | -------------------------------------------------------------------------------- /commands/libprv/prv.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2021 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef LIBPRV_PRV_H 8 | #define LIBPRV_PRV_H 9 | 10 | #include 11 | #include "uthash.h" 12 | 13 | #define MAX_LABEL 256 14 | #define MAX_SRCLINE 256 15 | 16 | struct task_type { 17 | uint64_t type; 18 | char label[MAX_LABEL]; 19 | char srcline[MAX_SRCLINE]; 20 | UT_hash_handle hh; 21 | }; 22 | 23 | #endif // LIBPRV_PRV_H 24 | -------------------------------------------------------------------------------- /deps/hwloc-2.9.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsc-pm/nanos6/9f54c988e0a8b9c011d9d526acdb8d76f18fcae4/deps/hwloc-2.9.1.tar.gz -------------------------------------------------------------------------------- /deps/jemalloc-5.3.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsc-pm/nanos6/9f54c988e0a8b9c011d9d526acdb8d76f18fcae4/deps/jemalloc-5.3.0.tar.gz -------------------------------------------------------------------------------- /loader/api-versions.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018-2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_API_VERSIONS_H 8 | #define NANOS6_API_VERSIONS_H 9 | 10 | 11 | #include 12 | 13 | 14 | extern nanos6_api_versions_t const __user_code_expected_nanos6_api_versions; 15 | 16 | 17 | #endif /* NANOS6_API_VERSIONS_H */ 18 | -------------------------------------------------------------------------------- /loader/config-parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_LOADER_CONFIG_PARSER_H 8 | #define NANOS6_LOADER_CONFIG_PARSER_H 9 | 10 | #ifndef _GNU_SOURCE 11 | #define _GNU_SOURCE 12 | #endif 13 | 14 | #include 15 | 16 | #define MAX_CONFIG_PATH PATH_MAX 17 | 18 | __attribute__((visibility("hidden"))) int _nanos6_loader_parse_config(void); 19 | __attribute__((visibility("hidden"))) void _nanos6_loader_free_config(void); 20 | 21 | typedef struct { 22 | char *dependencies; 23 | char *instrument; 24 | char *library_path; 25 | char *report_prefix; 26 | int debug; 27 | int verbose; 28 | int warn_envars; 29 | } _nanos6_loader_config_t; 30 | 31 | extern _nanos6_loader_config_t _config; 32 | extern char _nanos6_config_path[MAX_CONFIG_PATH]; 33 | extern char _nanos6_default_config_path[MAX_CONFIG_PATH]; 34 | 35 | 36 | #endif // NANOS6_LOADER_CONFIG_PARSER_H 37 | -------------------------------------------------------------------------------- /loader/device_strings.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018-2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | #include "api/nanos6/task-instantiation.h" 9 | 10 | #pragma GCC visibility push(default) 11 | 12 | char const * const nanos6_hostcpu_device_name = "HOST"; 13 | char const * const nanos6_cuda_device_name = "CUDA"; 14 | char const * const nanos6_opencl_device_name = "OPENCL"; 15 | char const * const nanos6_cluster_device_name = "CLUSTER"; 16 | char const * const nanos6_fpga_device_name = "FPGA"; 17 | 18 | #pragma GCC visibility pop 19 | 20 | -------------------------------------------------------------------------------- /loader/disabled_variant.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | 8 | __attribute__((visibility("default"))) int nanos6_disabled_variant = 1; 9 | -------------------------------------------------------------------------------- /loader/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_LOADER_ERROR_H 8 | #define NANOS6_LOADER_ERROR_H 9 | 10 | #ifndef _GNU_SOURCE 11 | #define _GNU_SOURCE 12 | #endif 13 | 14 | #include 15 | 16 | #include "loader.h" 17 | 18 | // Cannot go back from this 19 | #define handle_error() \ 20 | do { \ 21 | exit(EXIT_FAILURE); \ 22 | } while (0) 23 | 24 | 25 | #endif /* NANOS6_LOADER_ERROR_H */ 26 | 27 | -------------------------------------------------------------------------------- /loader/generate_regions_api.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | if [ $# -lt 2 ] ; then 5 | echo Usage: $0 '' ' [type2 [type3 [...]]]' 1>&2 6 | exit 1 7 | fi 8 | 9 | 10 | maxdimensions=$1 11 | shift 12 | 13 | 14 | . scripts/generate_regions_prototype.sh 15 | 16 | 17 | for type in $* ; do 18 | for dimensions in $(seq 1 ${maxdimensions}) ; do 19 | generate_regions_prototype ${dimensions} ${type} 20 | echo ';' 21 | echo 22 | done 23 | echo 24 | done 25 | -------------------------------------------------------------------------------- /loader/indirect-symbols/api-check.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | #include 9 | 10 | 11 | #pragma GCC visibility push(default) 12 | 13 | int nanos6_check_api_versions(nanos6_api_versions_t const *api_versions) 14 | { 15 | typedef int nanos6_check_api_versions_t(nanos6_api_versions_t const *api_versions); 16 | 17 | static nanos6_check_api_versions_t *symbol = NULL; 18 | if (__builtin_expect(symbol == NULL, 0)) { 19 | symbol = (nanos6_check_api_versions_t *) _nanos6_resolve_symbol("nanos6_check_api_versions", "API versioning", NULL); 20 | if (symbol == NULL) { 21 | return 0; 22 | } 23 | } 24 | 25 | return (*symbol)(api_versions); 26 | } 27 | 28 | #pragma GCC visibility pop 29 | -------------------------------------------------------------------------------- /loader/indirect-symbols/config.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | #pragma GCC visibility push(default) 11 | 12 | void nanos6_config_assert(const char *config_conditions) 13 | { 14 | typedef void nanos6_config_assert_t(const char *config_conditions); 15 | 16 | static nanos6_config_assert_t *symbol = NULL; 17 | if (__builtin_expect(symbol == NULL, 0)) { 18 | symbol = (nanos6_config_assert_t *) _nanos6_resolve_symbol("nanos6_config_assert", "essential", NULL); 19 | } 20 | 21 | (*symbol)(config_conditions); 22 | } 23 | 24 | #pragma GCC visibility pop 25 | 26 | -------------------------------------------------------------------------------- /loader/indirect-symbols/cuda-device-api.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #include "resolve.h" 11 | 12 | #pragma GCC visibility push(default) 13 | 14 | cudaStream_t nanos6_get_current_cuda_stream(void) 15 | { 16 | typedef cudaStream_t nanos6_get_current_cuda_stream_t(void); 17 | 18 | static nanos6_get_current_cuda_stream_t *symbol = NULL; 19 | if (__builtin_expect(symbol == NULL, 0)) { 20 | symbol = (nanos6_get_current_cuda_stream *) 21 | _nanos6_resolve_symbol("nanos6_get_current_cuda_stream", "cuda", NULL); 22 | } 23 | 24 | return (*symbol)(); 25 | } 26 | 27 | #pragma GCC visibility pop 28 | -------------------------------------------------------------------------------- /loader/indirect-symbols/monitoring.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | #include "api/nanos6/monitoring.h" 9 | 10 | 11 | #pragma GCC visibility push(default) 12 | 13 | double nanos6_get_predicted_elapsed_time(void) 14 | { 15 | typedef double nanos6_get_predicted_elapsed_time_t(void); 16 | 17 | static nanos6_get_predicted_elapsed_time_t *symbol = NULL; 18 | if (__builtin_expect(symbol == NULL, 0)) { 19 | symbol = (nanos6_get_predicted_elapsed_time_t *) _nanos6_resolve_symbol("nanos6_get_predicted_elapsed_time", "monitoring", NULL); 20 | } 21 | 22 | return (*symbol)(); 23 | } 24 | 25 | #pragma GCC visibility pop 26 | -------------------------------------------------------------------------------- /loader/indirect-symbols/task-info-registration.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | #pragma GCC visibility push(default) 11 | 12 | void nanos6_register_task_info(nanos6_task_info_t *task_info) 13 | { 14 | typedef void nanos6_register_task_info_t(nanos6_task_info_t *task_info); 15 | 16 | static nanos6_register_task_info_t *symbol = NULL; 17 | if (__builtin_expect(symbol == NULL, 0)) { 18 | symbol = (nanos6_register_task_info_t *) _nanos6_resolve_symbol("nanos6_register_task_info", "essential", NULL); 19 | } 20 | 21 | (*symbol)(task_info); 22 | } 23 | 24 | #pragma GCC visibility pop 25 | 26 | -------------------------------------------------------------------------------- /loader/indirect-symbols/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | #pragma GCC visibility push(default) 11 | 12 | void nanos6_check_version(uint64_t size, nanos6_version_t *versions, const char *source) 13 | { 14 | typedef void nanos6_check_version_t( 15 | uint64_t size, 16 | nanos6_version_t *versions, 17 | const char *source 18 | ); 19 | 20 | static nanos6_check_version_t *symbol = NULL; 21 | if (__builtin_expect(symbol == NULL, 0)) { 22 | symbol = (nanos6_check_version_t *) _nanos6_resolve_symbol("nanos6_check_version", "essential", NULL); 23 | } 24 | 25 | (*symbol)(size, versions, source); 26 | } 27 | 28 | #pragma GCC visibility pop 29 | -------------------------------------------------------------------------------- /loader/intercept-main-common.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef _GNU_SOURCE 8 | #define _GNU_SOURCE 9 | #endif 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | 16 | extern void *_nanos6_loader_next_libc_start_main; 17 | 18 | 19 | __attribute__ ((visibility ("hidden"))) void _nanos6_resolve_next_start_main(char const *name) 20 | { 21 | // Retrieve the next __libc_start_main which problably will be the one in libc 22 | _nanos6_loader_next_libc_start_main = dlsym(RTLD_NEXT, name); 23 | assert(_nanos6_loader_next_libc_start_main != NULL); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /loader/intercept-main-common.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INTERCEPT_MAIN_COMMON_H 8 | #define INTERCEPT_MAIN_COMMON_H 9 | 10 | void _nanos6_resolve_next_start_main(char const *name); 11 | 12 | #endif // INTERCEPT_MAIN_COMMON_H 13 | -------------------------------------------------------------------------------- /loader/loader.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_LOADER_LOADER_H 8 | #define NANOS6_LOADER_LOADER_H 9 | 10 | 11 | #define ERROR_TEXT_SIZE 8192 12 | 13 | __attribute__ ((visibility ("hidden"))) void _nanos6_loader(void); 14 | 15 | __attribute__ ((visibility ("hidden"))) extern void *_nanos6_lib_handle; 16 | 17 | extern int _nanos6_exit_with_error; 18 | extern char _nanos6_error_text[ERROR_TEXT_SIZE]; 19 | 20 | 21 | #endif // NANOS6_LOADER_LOADER_H 22 | -------------------------------------------------------------------------------- /loader/main-wrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef NANOS6_LOADER_MAIN_WRAPPER_H 8 | #define NANOS6_LOADER_MAIN_WRAPPER_H 9 | 10 | 11 | typedef int main_function_t(int argc, char **argv, char **envp); 12 | 13 | extern main_function_t *_nanos6_loader_wrapped_main; 14 | main_function_t _nanos6_loader_main; 15 | 16 | 17 | #endif /* NANOS6_LOADER_MAIN_WRAPPER_H */ 18 | -------------------------------------------------------------------------------- /loader/scripts/generate_regions_symbol_resolvers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 4 | # 5 | # Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 6 | 7 | 8 | if [ $# -lt 2 ] ; then 9 | echo Usage: $0 '' ' [type2 [type3 [...]]]' 1>&2 10 | exit 1 11 | fi 12 | 13 | 14 | maxdimensions=$1 15 | shift 16 | 17 | 18 | . $(dirname $0)/common.sh 19 | 20 | 21 | echo '#include "symbol-resolver/resolve.h"' 22 | #echo '#include "nanos6/multidimensional-dependencies.h"' 23 | 24 | echo 25 | echo 26 | for type in $* ; do 27 | for dimensions in $(seq 1 ${maxdimensions}) ; do 28 | if [ "${type}" = "commutative" ] ; then 29 | fallback_name=nanos6_register_region_readwrite_depinfo${dimensions} 30 | else 31 | fallback_name=NULL 32 | fi 33 | 34 | echo "RESOLVE_API_FUNCTION_WITH_LOCAL_FALLBACK(nanos6_register_region_${type}_depinfo${dimensions}, \"multidimensional dependency\", NULL);" 35 | done 36 | echo 37 | done 38 | -------------------------------------------------------------------------------- /loader/scripts/generate_release_symbol_resolvers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 4 | # 5 | # Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 6 | 7 | 8 | if [ $# -lt 2 ] ; then 9 | echo Usage: $0 '' ' [type2 [type3 [...]]]' 1>&2 10 | exit 1 11 | fi 12 | 13 | 14 | maxdimensions=$1 15 | shift 16 | 17 | 18 | . $(dirname $0)/common.sh 19 | 20 | 21 | echo '#include "symbol-resolver/resolve.h"' 22 | # echo '#include "nanos6/multidimensional-dependencies.h"' 23 | echo 24 | echo 25 | echo '#pragma GCC visibility push(default)' 26 | echo 27 | echo 28 | for type in $* ; do 29 | if [ "${type}" = "reduction" ] || [ "${type}" = "weak_reduction" ] ; then 30 | continue 31 | fi 32 | 33 | for dimensions in $(seq 1 ${maxdimensions}) ; do 34 | echo "RESOLVE_API_FUNCTION_WITH_LOCAL_FALLBACK(nanos6_release_${type}_${dimensions}, \"multidimensional release\", NULL);" 35 | done 36 | echo 37 | done 38 | echo 39 | echo 40 | echo '#pragma GCC visibility pop' 41 | -------------------------------------------------------------------------------- /loader/scripts/lint/generate_regions_symbol_resolvers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 4 | # 5 | # Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 6 | 7 | 8 | if [ $# -lt 2 ] ; then 9 | echo Usage: $0 '' ' [type2 [type3 [...]]]' 1>&2 10 | exit 1 11 | fi 12 | 13 | 14 | maxdimensions=$1 15 | shift 16 | 17 | 18 | . $(dirname $0)/common.sh 19 | 20 | 21 | echo '#include "symbol-resolver/resolve.h"' 22 | 23 | echo 24 | echo 25 | for type in $* ; do 26 | for dimensions in $(seq 1 ${maxdimensions}) ; do 27 | echo "RESOLVE_API_FUNCTION_WITH_LOCAL_FALLBACK(nanos6_lint_register_region_${type}_${dimensions}, \"lint multidimensional access\", NULL);" 28 | done 29 | echo 30 | done 31 | -------------------------------------------------------------------------------- /loader/symbol-resolver/api-check.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_check_api_versions, "API versioning", NULL); 11 | 12 | -------------------------------------------------------------------------------- /loader/symbol-resolver/blocking.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_get_current_blocking_context, "task blocking", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_block_current_task, "task blocking", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_unblock_task, "task blocking", NULL); 13 | 14 | RESOLVE_API_FUNCTION(nanos6_wait_for, "task blocking", NULL); 15 | 16 | -------------------------------------------------------------------------------- /loader/symbol-resolver/bootstrap.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_preinit, "essential", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_can_run_main, "essential", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_register_completion_callback, "essential", NULL); 13 | RESOLVE_API_FUNCTION(nanos6_init, "essential", NULL); 14 | RESOLVE_API_FUNCTION(nanos6_shutdown, "essential", NULL); 15 | 16 | -------------------------------------------------------------------------------- /loader/symbol-resolver/cluster.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | RESOLVE_API_FUNCTION(nanos6_in_cluster_mode, "cluster", NULL); 10 | RESOLVE_API_FUNCTION(nanos6_is_master_node, "cluster", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_get_cluster_node_id, "cluster", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_get_num_cluster_nodes, "cluster", NULL); 13 | RESOLVE_API_FUNCTION(nanos6_dmalloc, "cluster", NULL); 14 | RESOLVE_API_FUNCTION(nanos6_dfree, "cluster", NULL); 15 | RESOLVE_API_FUNCTION(nanos6_lmalloc, "cluster", NULL); 16 | RESOLVE_API_FUNCTION(nanos6_lfree, "cluster", NULL); 17 | -------------------------------------------------------------------------------- /loader/symbol-resolver/config.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_config_assert, "essential", NULL); 11 | -------------------------------------------------------------------------------- /loader/symbol-resolver/cpu-control.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_get_current_system_cpu, "cpu control", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_get_current_virtual_cpu, "cpu control", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_enable_cpu, "cpu control", NULL); 13 | RESOLVE_API_FUNCTION(nanos6_disable_cpu, "cpu control", NULL); 14 | RESOLVE_API_FUNCTION(nanos6_get_cpu_status, "cpu control", NULL); 15 | RESOLVE_API_FUNCTION(nanos6_cpus_begin, "cpu control", NULL); 16 | RESOLVE_API_FUNCTION(nanos6_cpus_end, "cpu control", NULL); 17 | RESOLVE_API_FUNCTION(nanos6_cpus_advance, "cpu control", NULL); 18 | RESOLVE_API_FUNCTION(nanos6_cpus_get, "cpu control", NULL); 19 | RESOLVE_API_FUNCTION(nanos6_cpus_get_virtual, "cpu control", NULL); 20 | RESOLVE_API_FUNCTION(nanos6_cpus_get_numa, "cpu control", NULL); 21 | 22 | -------------------------------------------------------------------------------- /loader/symbol-resolver/cuda-device-api.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | RESOLVE_API_FUNCTION(nanos6_get_current_cuda_stream, "cuda", NULL); 10 | -------------------------------------------------------------------------------- /loader/symbol-resolver/dependencies.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_register_read_depinfo, "dependency", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_register_write_depinfo, "dependency", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_register_readwrite_depinfo, "dependency", NULL); 13 | 14 | RESOLVE_API_FUNCTION(nanos6_register_commutative_depinfo, "commutative dependency", nanos6_register_readwrite_depinfo); 15 | RESOLVE_API_FUNCTION(nanos6_register_concurrent_depinfo, "concurrent dependency", nanos6_register_readwrite_depinfo); 16 | 17 | -------------------------------------------------------------------------------- /loader/symbol-resolver/directory.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | RESOLVE_API_FUNCTION(oss_device_alloc, "directory", NULL); 10 | RESOLVE_API_FUNCTION(oss_device_free, "directory", NULL); 11 | -------------------------------------------------------------------------------- /loader/symbol-resolver/events.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_get_current_event_counter, "essential", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_increase_current_task_event_counter, "essential", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_decrease_task_event_counter, "essential", NULL); 13 | -------------------------------------------------------------------------------- /loader/symbol-resolver/final.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | static signed int signed_int_always_false(void) { return 0; } 11 | RESOLVE_API_FUNCTION_WITH_LOCAL_FALLBACK(nanos6_in_final, "final tasks", signed_int_always_false); 12 | RESOLVE_API_FUNCTION_WITH_LOCAL_FALLBACK(nanos6_in_serial_context, "final tasks", signed_int_always_false); 13 | 14 | -------------------------------------------------------------------------------- /loader/symbol-resolver/lint.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_lint_ignore_region_begin, "lint", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_lint_ignore_region_end, "lint", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_lint_register_alloc, "lint", NULL); 13 | RESOLVE_API_FUNCTION(nanos6_lint_register_free, "lint", NULL); 14 | -------------------------------------------------------------------------------- /loader/symbol-resolver/loop.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_create_loop, "essential", NULL); 11 | -------------------------------------------------------------------------------- /loader/symbol-resolver/monitoring.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_get_predicted_elapsed_time, "monitoring", NULL); 11 | 12 | -------------------------------------------------------------------------------- /loader/symbol-resolver/numa.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_numa_alloc_block_interleave, "numa", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_numa_alloc_sentinels, "numa", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_numa_free, "numa", NULL); 13 | RESOLVE_API_FUNCTION(nanos6_bitmask_clearall, "numa", NULL); 14 | RESOLVE_API_FUNCTION(nanos6_bitmask_clearbit, "numa", NULL); 15 | RESOLVE_API_FUNCTION(nanos6_bitmask_setall, "numa", NULL); 16 | RESOLVE_API_FUNCTION(nanos6_bitmask_setbit, "numa", NULL); 17 | RESOLVE_API_FUNCTION(nanos6_bitmask_set_wildcard, "numa", NULL); 18 | RESOLVE_API_FUNCTION(nanos6_bitmask_isbitset, "numa", NULL); 19 | RESOLVE_API_FUNCTION(nanos6_count_setbits, "numa", NULL); 20 | -------------------------------------------------------------------------------- /loader/symbol-resolver/polling.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_register_polling_service, "polling services", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_unregister_polling_service, "polling services", NULL); 12 | 13 | -------------------------------------------------------------------------------- /loader/symbol-resolver/runtime-info.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_runtime_info_begin, "runtime info", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_runtime_info_end, "runtime info", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_runtime_info_advance, "runtime info", NULL); 13 | RESOLVE_API_FUNCTION(nanos6_runtime_info_get, "runtime info", NULL); 14 | RESOLVE_API_FUNCTION(nanos6_snprint_runtime_info_entry_value, "runtime info", NULL); 15 | -------------------------------------------------------------------------------- /loader/symbol-resolver/task-info-registration.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_register_task_info, "essential", NULL); 11 | -------------------------------------------------------------------------------- /loader/symbol-resolver/task-instantiation.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_create_task, "essential", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_submit_task, "essential", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_spawn_function, "essential", NULL); 13 | RESOLVE_API_FUNCTION(nanos6_stream_spawn_function, "essential", NULL); 14 | 15 | -------------------------------------------------------------------------------- /loader/symbol-resolver/taskwait.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_taskwait, "essential", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_stream_synchronize, "essential", NULL); 12 | RESOLVE_API_FUNCTION(nanos6_stream_synchronize_all, "essential", NULL); 13 | -------------------------------------------------------------------------------- /loader/symbol-resolver/user-mutex.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_user_lock, "user-side mutex", NULL); 11 | RESOLVE_API_FUNCTION(nanos6_user_unlock, "user-side mutex", NULL); 12 | 13 | -------------------------------------------------------------------------------- /loader/symbol-resolver/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | RESOLVE_API_FUNCTION(nanos6_check_version, "essential", NULL); 10 | -------------------------------------------------------------------------------- /loader/symbol-resolver/weak-dependencies.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "resolve.h" 8 | 9 | 10 | RESOLVE_API_FUNCTION(nanos6_register_weak_read_depinfo, "weak dependency", nanos6_register_read_depinfo); 11 | RESOLVE_API_FUNCTION(nanos6_register_weak_write_depinfo, "weak dependency", nanos6_register_write_depinfo); 12 | RESOLVE_API_FUNCTION(nanos6_register_weak_readwrite_depinfo, "weak dependency", nanos6_register_readwrite_depinfo); 13 | 14 | -------------------------------------------------------------------------------- /m4/.gitignore: -------------------------------------------------------------------------------- 1 | libtool.m4 2 | ltoptions.m4 3 | ltsugar.m4 4 | ltversion.m4 5 | lt~obsolete.m4 6 | -------------------------------------------------------------------------------- /m4/dlopen.m4: -------------------------------------------------------------------------------- 1 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 2 | # 3 | # Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 4 | 5 | AC_DEFUN([AC_CHECK_DLOPEN], 6 | [ 7 | ac_saved_LIBS="${LIBS}" 8 | LIBS="" 9 | AC_SEARCH_LIBS( 10 | [dlopen], [dl dld], 11 | [ 12 | DLOPEN_LIBS="${LIBS}" 13 | ], 14 | [ 15 | AC_MSG_ERROR([unable to find the dlopen function]) 16 | ], 17 | [ ${ac_saved_LIBS} ] 18 | ) 19 | AC_CHECK_FUNCS([dlinfo]) 20 | LIBS="${ac_saved_LIBS}" 21 | 22 | AC_SUBST([DLOPEN_LIBS]) 23 | ] 24 | ) 25 | 26 | -------------------------------------------------------------------------------- /m4/pthread.m4: -------------------------------------------------------------------------------- 1 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 2 | # 3 | # Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 4 | 5 | AC_DEFUN([CHECK_PTHREAD], 6 | [ 7 | AC_REQUIRE([AC_CANONICAL_HOST]) 8 | AC_REQUIRE([AX_PTHREAD]) 9 | 10 | # AX_PTHREAD does not seem to interact well with libtool on "regular" linux 11 | case $host_os in 12 | *linux*android*) 13 | ;; 14 | *linux*) 15 | PTHREAD_LIBS="${PTHREAD_LIBS} -lpthread" 16 | ;; 17 | esac 18 | ] 19 | ) 20 | 21 | -------------------------------------------------------------------------------- /m4/sane_awk.m4: -------------------------------------------------------------------------------- 1 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 2 | # 3 | # Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 4 | 5 | AC_DEFUN([CHECK_SANE_AWK], 6 | [ 7 | AC_REQUIRE([AC_PROG_AWK]) 8 | AC_MSG_CHECKING([if awk supports more than 32767 fields]) 9 | if echo $(seq 1 32768) | ${AWK} '{ print $NF; }' &> /dev/null ; then 10 | ac_sane_awk=yes 11 | else 12 | ac_sane_awk=no 13 | fi 14 | AC_MSG_RESULT([$ac_sane_awk]) 15 | AM_CONDITIONAL(AWK_IS_SANE, test x"$ac_sane_awk" = x"yes") 16 | ] 17 | ) 18 | 19 | -------------------------------------------------------------------------------- /m4/sanity.m4: -------------------------------------------------------------------------------- 1 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 2 | # 3 | # Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 4 | 5 | AC_DEFUN([SSS_CHECK_SANE_CHRONO], 6 | [ 7 | AC_MSG_CHECKING([if the C++ implementation of chrono is usable]) 8 | AC_LANG_PUSH(C++) 9 | AC_TRY_COMPILE( 10 | [ #include ], 11 | [ 12 | std::chrono::system_clock::time_point __s_entry = std::chrono::system_clock::now(); 13 | std::chrono::nanoseconds __delta; 14 | std::chrono::system_clock::time_point __s_atime = __s_entry + __delta; 15 | ], 16 | [ AC_MSG_RESULT([yes]) ], 17 | [ 18 | AC_MSG_RESULT([no]) 19 | AC_MSG_ERROR([$CXX uses an implementation of C++11 chrono that has serious bugs, probably the GCC 4.7 implementation]) 20 | ] 21 | ) 22 | AC_LANG_POP(C++) 23 | ] 24 | ) 25 | 26 | 27 | -------------------------------------------------------------------------------- /m4/syscalls.m4: -------------------------------------------------------------------------------- 1 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 2 | # 3 | # Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 4 | 5 | AC_DEFUN([AC_CHECK_MADV_FREE], 6 | [ 7 | AC_LANG_PUSH(C) 8 | 9 | AC_MSG_CHECKING([if madvise supports the MADV_FREE flag]) 10 | AC_COMPILE_IFELSE( 11 | [ AC_LANG_PROGRAM( 12 | [[ 13 | #include 14 | ]], [[ 15 | int rc = madvise(0, 0, MADV_FREE); 16 | 17 | return 0; 18 | ]] 19 | ) ], 20 | [ ac_have_madv_free=yes; AC_DEFINE([HAVE_MADV_FREE], 1, [madvise supports the MADV_FREE flag]) ], 21 | [ ac_have_madv_free=no ] 22 | ) 23 | AC_MSG_RESULT([${ac_have_madv_free}]) 24 | 25 | AC_LANG_POP(C) 26 | ] 27 | ) 28 | 29 | 30 | -------------------------------------------------------------------------------- /scripts/ctf/plugins/executionmodel.py: -------------------------------------------------------------------------------- 1 | class ExecutionModel(): 2 | """ This class caches common data to avoid repetitive event data fields 3 | lockups """ 4 | 5 | _ts = None 6 | _cpuid = None 7 | 8 | @classmethod 9 | def setCurrentEventData(cls, ts, cpuId): 10 | cls._ts = ts 11 | cls._cpuId = cpuId 12 | 13 | @classmethod 14 | def getCurrentCPUId(cls): 15 | return cls._cpuId 16 | 17 | @classmethod 18 | def getCurrentTimestamp(cls): 19 | return cls._ts 20 | -------------------------------------------------------------------------------- /scripts/ctf/wrappers/ctf2prv_cte-amd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 4 | # 5 | # Copyright (C) 2021 Barcelona Supercomputing Center (BSC) 6 | # 7 | 8 | if [[ "$CTF2PRV_VERBOSE" == "1" ]]; then 9 | exec 3>&2 10 | else 11 | exec 3>/dev/null 12 | fi 13 | 14 | if [ $# -eq 0 ]; then 15 | >&2 echo "$0: bad usage" 16 | >&2 echo "usage: $0 command [args]" 17 | exit 1 18 | fi 19 | 20 | comm="$1" 21 | shift 22 | 23 | commpath=$(type -P "$comm") 24 | notfound=$? 25 | 26 | if [[ "$notfound" == "1" ]]; then 27 | >&2 echo "Cannot find $comm in the system path" 28 | exit 1 29 | fi 30 | 31 | 1>&3 echo "Loading CTE-AMD modules for ctf2prv" 32 | 1>&3 2>&3 module purge 33 | 1>&3 2>&3 module load gcc/10.2.0 python/3.9.1 glib/2.66.6 babeltrace2/2.0.3 34 | 1>&3 echo "Loading modules done" 35 | 36 | "$commpath" "$@" 37 | -------------------------------------------------------------------------------- /scripts/ctf/wrappers/ctf2prv_cte-power.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 4 | # 5 | # Copyright (C) 2020-2021 Barcelona Supercomputing Center (BSC) 6 | # 7 | 8 | if [[ "$CTF2PRV_VERBOSE" == "1" ]]; then 9 | exec 3>&2 10 | else 11 | exec 3>/dev/null 12 | fi 13 | 14 | if [ $# -eq 0 ]; then 15 | >&2 echo "$0: bad usage" 16 | >&2 echo "usage: $0 command [args]" 17 | exit 1 18 | fi 19 | 20 | comm="$1" 21 | shift 22 | 23 | commpath=$(type -P "$comm") 24 | notfound=$? 25 | 26 | if [[ "$notfound" == "1" ]]; then 27 | >&2 echo "Cannot find $comm in the system path" 28 | exit 1 29 | fi 30 | 31 | 1>&3 echo "Loading CTE-POWER9 modules for ctf2prv" 32 | 1>&3 2>&3 module purge 33 | 1>&3 2>&3 module load gcc/6.4.0 swig python/3.6.5 babeltrace2 34 | 1>&3 echo "Loading modules done" 35 | 36 | "$commpath" "$@" 37 | -------------------------------------------------------------------------------- /scripts/ctf/wrappers/ctf2prv_marenostrum4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 4 | # 5 | # Copyright (C) 2020-2021 Barcelona Supercomputing Center (BSC) 6 | # 7 | 8 | if [[ "$CTF2PRV_VERBOSE" == "1" ]]; then 9 | exec 3>&2 10 | else 11 | exec 3>/dev/null 12 | fi 13 | 14 | if [ $# -eq 0 ]; then 15 | >&2 echo "$0: bad usage" 16 | >&2 echo "usage: $0 command [args]" 17 | exit 1 18 | fi 19 | 20 | comm="$1" 21 | shift 22 | 23 | commpath=$(type -P "$comm") 24 | notfound=$? 25 | 26 | if [[ "$notfound" == "1" ]]; then 27 | >&2 echo "Cannot find $comm in the system path" 28 | exit 1 29 | fi 30 | 31 | 1>&3 echo "Loading Marenostrum modules for ctf2prv" 32 | 1>&3 2>&3 module purge 33 | 1>&3 2>&3 module load mkl gcc/7.2.0 python/3.7.4 swig/3.0.12 babeltrace2/2.0.3-py3.7.4 34 | 1>&3 echo "Loading modules done" 35 | 36 | "$commpath" "$@" 37 | -------------------------------------------------------------------------------- /scripts/ctf/wrappers/ctf2prv_nord3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 4 | # 5 | # Copyright (C) 2020-2021 Barcelona Supercomputing Center (BSC) 6 | # 7 | 8 | if [[ "$CTF2PRV_VERBOSE" == "1" ]]; then 9 | exec 3>&2 10 | else 11 | exec 3>/dev/null 12 | fi 13 | 14 | if [ $# -eq 0 ]; then 15 | >&2 echo "$0: bad usage" 16 | >&2 echo "usage: $0 command [args]" 17 | exit 1 18 | fi 19 | 20 | comm="$1" 21 | shift 22 | 23 | commpath=$(type -P "$comm") 24 | notfound=$? 25 | 26 | if [[ "$notfound" == "1" ]]; then 27 | >&2 echo "Cannot find $comm in the system path" 28 | exit 1 29 | fi 30 | 31 | 1>&3 echo "Loading Nord3 modules for ctf2prv" 32 | 1>&3 2>&3 module purge 33 | 1>&3 2>&3 module load gcc/7.2.0 mkl python/3.7.4 swig/3.0.12 babeltrace2/2.0.3 34 | 1>&3 echo "Loading modules done" 35 | 36 | "$commpath" "$@" 37 | -------------------------------------------------------------------------------- /scripts/generate_config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 4 | # 5 | # Copyright (C) 2021 Barcelona Supercomputing Center (BSC) 6 | # 7 | # Generate config depending on enabled flags 8 | 9 | # Retreive the template file 10 | if [ -z "$1" ]; then 11 | >&2 echo "Error: When reading Nanos6 Template Config File" 12 | >&2 echo "Usage: generate_config.sh file [sections_to_remove]" 13 | exit 1 14 | fi 15 | 16 | template="$1" 17 | shift 18 | 19 | sectionFilter=$(echo "$@" | sed 's/ /|/g') 20 | 21 | # Remove stated sections 22 | sed -E '/^__require_('"$sectionFilter"')$/,/^__!require_.*$/d' "$template" | \ 23 | # Remove leftover "require" lines 24 | sed '/^__!\?require_.*$/d' | \ 25 | # Merge multiple newlines into one 26 | sed 'N;/^\n$/D;P;D;' 27 | -------------------------------------------------------------------------------- /src/dependencies/DataAccessType.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef DATA_ACCESS_TYPE_HPP 8 | #define DATA_ACCESS_TYPE_HPP 9 | 10 | // Packed ensures this enum is as short as possible 11 | typedef enum __attribute__((__packed__)) { 12 | NO_ACCESS_TYPE = 0, 13 | READ_ACCESS_TYPE, 14 | WRITE_ACCESS_TYPE, 15 | READWRITE_ACCESS_TYPE, 16 | CONCURRENT_ACCESS_TYPE, 17 | COMMUTATIVE_ACCESS_TYPE, 18 | REDUCTION_ACCESS_TYPE 19 | } DataAccessType; 20 | 21 | 22 | #endif // DATA_ACCESS_TYPE_HPP 23 | -------------------------------------------------------------------------------- /src/dependencies/DataTrackingSupport.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "DataTrackingSupport.hpp" 8 | #include "tasks/Task.hpp" 9 | 10 | ConfigVariable DataTrackingSupport::_NUMASchedulingEnabled("numa.scheduling"); 11 | const double DataTrackingSupport::_rwBonusFactor = 2.0; 12 | const uint64_t DataTrackingSupport::_distanceThreshold = 15; 13 | const uint64_t DataTrackingSupport::_loadThreshold = 20; 14 | uint64_t DataTrackingSupport::_shouldEnableIS; 15 | 16 | bool DataTrackingSupport::shouldEnableIS(Task *task) 17 | { 18 | return (task->getDataAccesses().getTotalDataSize() <= _shouldEnableIS); 19 | } 20 | -------------------------------------------------------------------------------- /src/dependencies/discrete/BottomMapEntry.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef BOTTOM_MAP_ENTRY_HPP 8 | #define BOTTOM_MAP_ENTRY_HPP 9 | 10 | #include 11 | 12 | #include "DataAccess.hpp" 13 | #include "ReductionInfo.hpp" 14 | 15 | struct BottomMapEntry { 16 | DataAccess * _access; 17 | ReductionInfo *_reductionInfo; 18 | 19 | BottomMapEntry(DataAccess *access) : 20 | _access(access), 21 | _reductionInfo(nullptr) 22 | { 23 | } 24 | 25 | BottomMapEntry() : 26 | _access(nullptr), 27 | _reductionInfo(nullptr) 28 | { 29 | } 30 | }; 31 | 32 | 33 | #endif // BOTTOM_MAP_ENTRY_HPP 34 | -------------------------------------------------------------------------------- /src/dependencies/discrete/CPUDependencyData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "CPUDependencyData.hpp" 8 | 9 | size_t TaskList::_actualChunkSize = 0; 10 | -------------------------------------------------------------------------------- /src/dependencies/discrete/DataAccessRegistrationImplementation.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef DATA_ACCESS_REGISTRATION_IMPLEMENTATION_HPP 8 | #define DATA_ACCESS_REGISTRATION_IMPLEMENTATION_HPP 9 | 10 | 11 | #include 12 | 13 | #include "DataAccessRegistration.hpp" 14 | #include "TaskDataAccesses.hpp" 15 | #include "tasks/Task.hpp" 16 | 17 | 18 | namespace DataAccessRegistration { 19 | 20 | template 21 | inline bool processAllDataAccesses(Task *task, ProcessorType processor) 22 | { 23 | assert(task != nullptr); 24 | TaskDataAccesses &accessStruct = task->getDataAccesses(); 25 | assert(!accessStruct.hasBeenDeleted()); 26 | 27 | return accessStruct.forAll( 28 | [&](void *, DataAccess *access) -> bool { 29 | return processor(access); 30 | } 31 | ); 32 | } 33 | } 34 | 35 | 36 | #endif // DATA_ACCESS_REGISTRATION_IMPLEMENTATION_HPP 37 | -------------------------------------------------------------------------------- /src/dependencies/discrete/DependencyDomain.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef DEPENDENCY_DOMAIN_HPP 8 | #define DEPENDENCY_DOMAIN_HPP 9 | 10 | 11 | struct DependencyDomain { 12 | }; 13 | 14 | 15 | #endif // DEPENDENCY_DOMAIN_HPP 16 | -------------------------------------------------------------------------------- /src/dependencies/discrete/DependencySystem.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef DEPENDENCY_SYSTEM_HPP 8 | #define DEPENDENCY_SYSTEM_HPP 9 | 10 | #include "CPUDependencyData.hpp" 11 | #include "scheduling/SchedulerSupport.hpp" 12 | #include "system/RuntimeInfo.hpp" 13 | 14 | class DependencySystem { 15 | public: 16 | static void initialize() 17 | { 18 | RuntimeInfo::addEntry("dependency_implementation", "Dependency Implementation", "discrete"); 19 | 20 | size_t pow2CPUs = SchedulerSupport::roundToNextPowOf2(CPUManager::getTotalCPUs()); 21 | TaskList::_actualChunkSize = std::min(TaskList::getMaxChunkSize(), pow2CPUs * 2); 22 | assert(SchedulerSupport::isPowOf2(TaskList::_actualChunkSize)); 23 | } 24 | }; 25 | 26 | #endif // DEPENDENCY_SYSTEM_HPP 27 | -------------------------------------------------------------------------------- /src/dependencies/discrete/ReductionSpecific.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef REDUCTION_SPECIFIC_HPP 8 | #define REDUCTION_SPECIFIC_HPP 9 | 10 | #include 11 | 12 | typedef int reduction_type_and_operator_index_t; 13 | typedef int reduction_index_t; 14 | 15 | enum specialReductionTypeAndOperatorIndexes_t { 16 | no_reduction_type_and_operator = INT_MAX 17 | }; 18 | 19 | enum specialReductionIndexes_t { 20 | no_reduction_index = INT_MAX 21 | }; 22 | #endif // REDUCTION_SPECIFIC_HPP 23 | -------------------------------------------------------------------------------- /src/dependencies/linear-regions-fragmented/DataAccessLink.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef DATA_ACCESS_LINK_HPP 8 | #define DATA_ACCESS_LINK_HPP 9 | 10 | 11 | #include "DataAccessObjectType.hpp" 12 | 13 | 14 | class Task; 15 | 16 | 17 | struct DataAccessLink { 18 | Task *_task; 19 | DataAccessObjectType _objectType; 20 | 21 | DataAccessLink() 22 | : _task(nullptr) 23 | { 24 | } 25 | 26 | DataAccessLink(Task *task, DataAccessObjectType objectType) 27 | : _task(task), _objectType(objectType) 28 | { 29 | } 30 | }; 31 | 32 | 33 | #endif // DATA_ACCESS_LINK_HPP 34 | -------------------------------------------------------------------------------- /src/dependencies/linear-regions-fragmented/DataAccessObjectType.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef DATA_ACCESS_OBJECT_TYPE_HPP 8 | #define DATA_ACCESS_OBJECT_TYPE_HPP 9 | 10 | 11 | enum DataAccessObjectType { 12 | access_type, 13 | fragment_type, 14 | taskwait_type, 15 | top_level_sink_type 16 | }; 17 | 18 | 19 | #endif // DATA_ACCESS_OBJECT_TYPE_HPP 20 | -------------------------------------------------------------------------------- /src/dependencies/linear-regions-fragmented/DependencyDomain.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef DEPENDENCY_DOMAIN_HPP 8 | #define DEPENDENCY_DOMAIN_HPP 9 | 10 | 11 | struct DependencyDomain { 12 | }; 13 | 14 | 15 | #endif // DEPENDENCY_DOMAIN_HPP 16 | -------------------------------------------------------------------------------- /src/dependencies/linear-regions-fragmented/DependencySystem.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef DEPENDENCY_SYSTEM_HPP 8 | #define DEPENDENCY_SYSTEM_HPP 9 | 10 | #include "system/RuntimeInfo.hpp" 11 | 12 | 13 | class DependencySystem { 14 | public: 15 | static void initialize() 16 | { 17 | RuntimeInfo::addEntry("dependency_implementation", "Dependency Implementation", "regions (linear-regions-fragmented)"); 18 | } 19 | }; 20 | 21 | #endif // DEPENDENCY_SYSTEM_HPP 22 | 23 | -------------------------------------------------------------------------------- /src/dependencies/linear-regions-fragmented/ReductionSpecific.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef REDUCTION_SPECIFIC_HPP 8 | #define REDUCTION_SPECIFIC_HPP 9 | 10 | 11 | #include 12 | 13 | 14 | typedef int reduction_type_and_operator_index_t; 15 | typedef int reduction_index_t; 16 | 17 | 18 | enum specialReductionTypeAndOperatorIndexes_t { 19 | no_reduction_type_and_operator = INT_MAX 20 | }; 21 | 22 | enum specialReductionIndexes_t { 23 | no_reduction_index = INT_MAX 24 | }; 25 | 26 | 27 | #endif // REDUCTION_SPECIFIC_HPP 28 | -------------------------------------------------------------------------------- /src/dependencies/linear-regions-fragmented/TaskDataAccessHooks.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef TASK_DATA_ACCESS_HOOKS_HPP 8 | #define TASK_DATA_ACCESS_HOOKS_HPP 9 | 10 | #include "TaskDataAccessLinkingArtifacts.hpp" 11 | 12 | 13 | struct TaskDataAccessHooks { 14 | typedef typename TaskDataAccessLinkingArtifacts::hook_type TaskDataAccessesHook; 15 | 16 | TaskDataAccessesHook _accessesHook; 17 | }; 18 | 19 | 20 | #endif // TASK_DATA_ACCESS_HOOKS_HPP 21 | -------------------------------------------------------------------------------- /src/dependencies/linear-regions-fragmented/TaskDataAccessesInfo.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef TASK_DATA_ACCESSES_INFO_HPP 8 | #define TASK_DATA_ACCESSES_INFO_HPP 9 | 10 | #include 11 | 12 | class TaskDataAccessesInfo { 13 | public: 14 | TaskDataAccessesInfo(__attribute__((unused)) size_t numDeps) 15 | { 16 | } 17 | 18 | inline size_t getAllocationSize() 19 | { 20 | return 0; 21 | } 22 | 23 | inline void setAllocationAddress(__attribute__((unused)) void *allocationAddress) 24 | { 25 | } 26 | }; 27 | 28 | #endif // TASK_DATA_ACCESSES_INFO_HPP -------------------------------------------------------------------------------- /src/dependencies/linear-regions/DataAccessRegionIndexer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef DATA_ACCESS_REGION_INDEXER_HPP 8 | #define DATA_ACCESS_REGION_INDEXER_HPP 9 | 10 | 11 | #include "LinearRegionMap.hpp" 12 | #include "LinearRegionMapImplementation.hpp" 13 | 14 | 15 | template 16 | using DataAccessRegionIndexer = LinearRegionMap; 17 | 18 | 19 | #endif // DATA_ACCESS_REGION_INDEXER_HPP 20 | -------------------------------------------------------------------------------- /src/executors/threads/CPUManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "CPUManager.hpp" 8 | 9 | 10 | CPUManagerInterface *CPUManager::_cpuManager; 11 | ConfigVariable CPUManager::_dlbEnabled("dlb.enabled"); 12 | bool CPUManager::_preinitialized(false); 13 | -------------------------------------------------------------------------------- /src/executors/threads/TaskFinalization.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef TASK_FINALIZATION_HPP 8 | #define TASK_FINALIZATION_HPP 9 | 10 | class ComputePlace; 11 | class Task; 12 | 13 | class TaskFinalization { 14 | public: 15 | static void taskFinished(Task *task, ComputePlace *computePlace, bool fromBusyThread = false); 16 | static void disposeTask(Task *task); 17 | }; 18 | 19 | 20 | #endif // TASK_FINALIZATION_HPP 21 | -------------------------------------------------------------------------------- /src/executors/threads/cpu-managers/default/policies/IdlePolicy.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef IDLE_POLICY_HPP 8 | #define IDLE_POLICY_HPP 9 | 10 | #include "executors/threads/CPUManagerPolicyInterface.hpp" 11 | #include "executors/threads/cpu-managers/default/DefaultCPUManager.hpp" 12 | #include "hardware/places/ComputePlace.hpp" 13 | 14 | 15 | class IdlePolicy : public CPUManagerPolicyInterface { 16 | protected: 17 | //! Reference to the default CPU manager 18 | DefaultCPUManager &_cpuManager; 19 | 20 | //! The maximum amount of CPUs in the system 21 | size_t _numCPUs; 22 | 23 | public: 24 | inline IdlePolicy(DefaultCPUManager &cpuManager, size_t numCPUs) : 25 | _cpuManager(cpuManager), 26 | _numCPUs(numCPUs) 27 | { 28 | } 29 | 30 | void execute( 31 | ComputePlace *cpu, 32 | CPUManagerPolicyHint hint, 33 | size_t numRequested = 0 34 | ) override; 35 | }; 36 | 37 | #endif // IDLE_POLICY_HPP 38 | -------------------------------------------------------------------------------- /src/executors/threads/cpu-managers/dlb/DLBCPUActivation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "DLBCPUActivation.hpp" 8 | 9 | 10 | // 0.1 ms 11 | timespec DLBCPUActivation::_delayCPUEnabling({0, 100000}); 12 | std::atomic DLBCPUActivation::_numActiveOwnedCPUs(0); 13 | -------------------------------------------------------------------------------- /src/executors/threads/cpu-managers/dlb/policies/GreedyPolicy.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef GREEDY_POLICY_HPP 8 | #define GREEDY_POLICY_HPP 9 | 10 | #include "executors/threads/CPUManagerPolicyInterface.hpp" 11 | #include "hardware/places/ComputePlace.hpp" 12 | 13 | 14 | class GreedyPolicy : public CPUManagerPolicyInterface { 15 | 16 | private: 17 | 18 | //! The maximum amount of CPUs in the system 19 | size_t _numCPUs; 20 | 21 | public: 22 | 23 | inline GreedyPolicy(size_t numCPUs) 24 | : _numCPUs(numCPUs) 25 | { 26 | } 27 | 28 | void execute(ComputePlace *cpu, CPUManagerPolicyHint hint, size_t numRequested = 0) override; 29 | 30 | }; 31 | 32 | #endif // GREEDY_POLICY_HPP 33 | -------------------------------------------------------------------------------- /src/executors/threads/cpu-managers/dlb/policies/LeWIPolicy.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef LEWI_POLICY_HPP 8 | #define LEWI_POLICY_HPP 9 | 10 | #include "executors/threads/CPUManagerPolicyInterface.hpp" 11 | #include "hardware/places/ComputePlace.hpp" 12 | 13 | 14 | class LeWIPolicy : public CPUManagerPolicyInterface { 15 | 16 | private: 17 | 18 | //! The maximum amount of CPUs in the system 19 | size_t _numCPUs; 20 | 21 | public: 22 | 23 | inline LeWIPolicy(size_t numCPUs) 24 | : _numCPUs(numCPUs) 25 | { 26 | } 27 | 28 | void execute(ComputePlace *cpu, CPUManagerPolicyHint hint, size_t numRequested = 0) override; 29 | 30 | }; 31 | 32 | #endif // LEWI_POLICY_HPP 33 | -------------------------------------------------------------------------------- /src/executors/threads/kernel-level/CPUThreadingModelData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | #include "CPUThreadingModelData.hpp" 10 | #include "executors/threads/ThreadManager.hpp" 11 | #include "executors/threads/WorkerThread.hpp" 12 | #include "system/RuntimeInfo.hpp" 13 | 14 | 15 | ConfigVariable CPUThreadingModelData::_defaultThreadStackSize("misc.stack_size"); 16 | 17 | 18 | void CPUThreadingModelData::initialize(__attribute__((unused)) CPU *cpu) 19 | { 20 | static std::atomic firstTime(true); 21 | bool expect = true; 22 | bool worked = firstTime.compare_exchange_strong(expect, false); 23 | if (worked) { 24 | RuntimeInfo::addEntry("threading_model", "Threading Model", "pthreads"); 25 | RuntimeInfo::addEntry("stack_size", "Stack Size", getDefaultStackSize()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/executors/threads/kernel-level/CPUThreadingModelData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CPU_THREADING_MODEL_DATA_HPP 8 | #define CPU_THREADING_MODEL_DATA_HPP 9 | 10 | 11 | #include 12 | #include 13 | 14 | #include "support/config/ConfigVariable.hpp" 15 | 16 | 17 | class CPU; 18 | class WorkerThread; 19 | 20 | 21 | struct CPUThreadingModelData { 22 | private: 23 | static ConfigVariable _defaultThreadStackSize; 24 | 25 | friend class WorkerThreadBase; 26 | 27 | public: 28 | CPUThreadingModelData() 29 | { 30 | } 31 | 32 | void initialize(CPU *cpu); 33 | 34 | static size_t getDefaultStackSize() 35 | { 36 | return (size_t) _defaultThreadStackSize.getValue(); 37 | } 38 | }; 39 | 40 | 41 | #endif // CPU_THREADING_MODEL_DATA_HPP 42 | -------------------------------------------------------------------------------- /src/hardware-counters/CPUHardwareCountersInterface.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CPU_HARDWARE_COUNTERS_INTERFACE_HPP 8 | #define CPU_HARDWARE_COUNTERS_INTERFACE_HPP 9 | 10 | #include "SupportedHardwareCounters.hpp" 11 | 12 | 13 | class CPUHardwareCountersInterface { 14 | 15 | public: 16 | 17 | virtual inline ~CPUHardwareCountersInterface() 18 | { 19 | } 20 | 21 | //! \brief Get the delta value of a HW counter 22 | //! 23 | //! \param[in] counterType The type of counter to get the delta from 24 | virtual uint64_t getDelta(HWCounters::counters_t counterType) const = 0; 25 | 26 | }; 27 | 28 | #endif // CPU_HARDWARE_COUNTERS_INTERFACE_HPP 29 | -------------------------------------------------------------------------------- /src/hardware-counters/ThreadHardwareCountersInterface.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef THREAD_HARDWARE_COUNTERS_INTERFACE_HPP 8 | #define THREAD_HARDWARE_COUNTERS_INTERFACE_HPP 9 | 10 | 11 | class ThreadHardwareCountersInterface { 12 | 13 | public: 14 | 15 | virtual inline ~ThreadHardwareCountersInterface() 16 | { 17 | } 18 | 19 | }; 20 | 21 | #endif // THREAD_HARDWARE_COUNTERS_INTERFACE_HPP 22 | -------------------------------------------------------------------------------- /src/hardware-counters/papi/PAPIThreadHardwareCounters.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef PAPI_THREAD_HARDWARE_COUNTERS_HPP 8 | #define PAPI_THREAD_HARDWARE_COUNTERS_HPP 9 | 10 | #include 11 | 12 | #include "hardware-counters/ThreadHardwareCountersInterface.hpp" 13 | 14 | 15 | class PAPIThreadHardwareCounters : public ThreadHardwareCountersInterface { 16 | 17 | private: 18 | 19 | //! The PAPI event set that must be read 20 | int _eventSet; 21 | 22 | public: 23 | 24 | inline PAPIThreadHardwareCounters() 25 | { 26 | _eventSet = PAPI_NULL; 27 | } 28 | 29 | inline ~PAPIThreadHardwareCounters() 30 | { 31 | } 32 | 33 | inline int getEventSet() const 34 | { 35 | return _eventSet; 36 | } 37 | 38 | inline void setEventSet(int eventSet) 39 | { 40 | _eventSet = eventSet; 41 | } 42 | 43 | }; 44 | 45 | #endif // PAPI_THREAD_HARDWARE_COUNTERS_HPP 46 | -------------------------------------------------------------------------------- /src/hardware-counters/pqos/PQoSThreadHardwareCounters.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef PQOS_THREAD_HARDWARE_COUNTERS_HPP 8 | #define PQOS_THREAD_HARDWARE_COUNTERS_HPP 9 | 10 | #include 11 | 12 | #include "hardware-counters/ThreadHardwareCountersInterface.hpp" 13 | 14 | 15 | class PQoSThreadHardwareCounters : public ThreadHardwareCountersInterface { 16 | 17 | private: 18 | 19 | //! Thread id 20 | pid_t _tid; 21 | 22 | //! PQoS structures that hold counter values 23 | pqos_mon_data *_data; 24 | 25 | public: 26 | 27 | inline void setTid(pid_t tid) 28 | { 29 | _tid = tid; 30 | } 31 | 32 | inline pid_t getTid() const 33 | { 34 | return _tid; 35 | } 36 | 37 | inline void setData(pqos_mon_data *threadData) 38 | { 39 | _data = threadData; 40 | } 41 | 42 | inline pqos_mon_data *getData() const 43 | { 44 | return _data; 45 | } 46 | 47 | }; 48 | 49 | #endif // PQOS_THREAD_HARDWARE_COUNTERS_HPP 50 | -------------------------------------------------------------------------------- /src/hardware/device/DeviceEnvironment.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef DEVICE_ENVIRONMENT_HPP 8 | #define DEVICE_ENVIRONMENT_HPP 9 | 10 | // Use this header to define the device environment -used by Mercurium- for various devices 11 | // implementations. 12 | 13 | #include 14 | 15 | #if USE_CUDA 16 | #include 17 | #endif 18 | 19 | #if USE_OPENACC 20 | #include 21 | #endif 22 | 23 | //! Contains the device environment based on configured device types to determine max size 24 | union DeviceEnvironment { 25 | #if USE_CUDA 26 | nanos6_cuda_device_environment_t cuda; 27 | #endif 28 | #if USE_OPENACC 29 | nanos6_openacc_device_environment_t openacc; 30 | #endif 31 | }; 32 | 33 | #endif // DEVICE_ENVIRONMENT_HPP 34 | 35 | -------------------------------------------------------------------------------- /src/hardware/places/L2Cache.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2021 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef L2_CACHE_HPP 8 | #define L2_CACHE_HPP 9 | 10 | #include "HardwareCache.hpp" 11 | 12 | class L3Cache; 13 | 14 | class L2Cache : public HardwareCache { 15 | private: 16 | L3Cache *_associatedL3Cache; 17 | 18 | public: 19 | L2Cache (int id, L3Cache *l3Cache, size_t cacheSize, size_t cacheLineSize) : 20 | HardwareCache(id, cacheSize, cacheLineSize, HardwareCache::L2_LEVEL), 21 | _associatedL3Cache(l3Cache) 22 | { 23 | } 24 | 25 | ~L2Cache() 26 | { 27 | } 28 | 29 | inline void setAssociatedL3Cache(L3Cache *l3Cache) 30 | { 31 | _associatedL3Cache = l3Cache; 32 | } 33 | 34 | inline L3Cache *getAssociatedL3Cache() const 35 | { 36 | return _associatedL3Cache; 37 | } 38 | }; 39 | 40 | #endif // L2_CACHE_HPP 41 | -------------------------------------------------------------------------------- /src/hardware/places/L3Cache.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2021 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef L3_CACHE_HPP 8 | #define L3_CACHE_HPP 9 | 10 | #include "HardwareCache.hpp" 11 | 12 | #ifndef L3_DEFAULT_CACHE_SIZE 13 | #define L3_DEFAULT_CACHE_SIZE 32*1024*1024 14 | #endif // L3_DEFAULT_CACHE_SIZE 15 | 16 | class L3Cache : public HardwareCache { 17 | private: 18 | bool _inclusive; 19 | 20 | public: 21 | L3Cache (int id, size_t cacheSize, size_t cacheLineSize, bool inclusive) : 22 | HardwareCache(id, cacheSize, cacheLineSize, HardwareCache::L3_LEVEL), 23 | _inclusive(inclusive) 24 | { 25 | } 26 | 27 | ~L3Cache() 28 | { 29 | } 30 | 31 | inline bool isInclusive() const 32 | { 33 | return _inclusive; 34 | } 35 | }; 36 | 37 | #endif // L3_CACHE_HPP 38 | -------------------------------------------------------------------------------- /src/hardware/places/MemoryPlace.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef MEMORY_PLACE_HPP 8 | #define MEMORY_PLACE_HPP 9 | 10 | #include 11 | #include 12 | #include "memory/AddressSpace.hpp" 13 | 14 | #include 15 | 16 | class ComputePlace; 17 | 18 | class MemoryPlace { 19 | protected: 20 | AddressSpace *_addressSpace; 21 | int _index; 22 | nanos6_device_t _type; 23 | 24 | public: 25 | MemoryPlace(int index, nanos6_device_t type, AddressSpace *addressSpace = nullptr) 26 | : _addressSpace(addressSpace), _index(index), _type(type) 27 | {} 28 | 29 | virtual ~MemoryPlace() 30 | {} 31 | 32 | inline int getIndex() const 33 | { 34 | return _index; 35 | } 36 | 37 | inline nanos6_device_t getType() const 38 | { 39 | return _type; 40 | } 41 | 42 | inline AddressSpace *getAddressSpace() const 43 | { 44 | return _addressSpace; 45 | } 46 | }; 47 | 48 | #endif //MEMORY_PLACE_HPP 49 | -------------------------------------------------------------------------------- /src/instrument/api/InstrumentDataAccessTypes.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_DATA_ACCESS_TYPES_HPP 8 | #define INSTRUMENT_DATA_ACCESS_TYPES_HPP 9 | 10 | 11 | #include 12 | 13 | 14 | namespace Instrument { 15 | enum access_object_type_t { 16 | regular_access_type, 17 | entry_fragment_type, 18 | taskwait_type, 19 | top_level_sink_type 20 | }; 21 | 22 | 23 | } 24 | 25 | 26 | #endif // INSTRUMENT_DATA_ACCESS_TYPES_HPP 27 | -------------------------------------------------------------------------------- /src/instrument/api/InstrumentDebug.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2021 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_DEBUG_HPP 8 | #define INSTRUMENT_DEBUG_HPP 9 | 10 | #include 11 | 12 | namespace Instrument { 13 | 14 | void debugRegister(const char *name, uint8_t id); 15 | 16 | void debugEnter(uint8_t id); 17 | void debugTransition(uint8_t id); 18 | void debugExit(); 19 | 20 | } 21 | 22 | #endif // INSTRUMENT_DEBUG_HPP 23 | -------------------------------------------------------------------------------- /src/instrument/api/InstrumentDependencySubsystemEntryPoints.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 8 | #define INSTRUMENT_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 9 | 10 | 11 | namespace Instrument { 12 | 13 | //! \brief Enters task registration 14 | void enterRegisterTaskDataAcesses(); 15 | 16 | //! \brief Exists task registration 17 | void exitRegisterTaskDataAcesses(); 18 | 19 | //! \brief Enter task unregistration 20 | void enterUnregisterTaskDataAcesses(); 21 | 22 | //! \brief Exit task unregistration 23 | void exitUnregisterTaskDataAcesses(); 24 | 25 | } 26 | 27 | #endif //INSTRUMENT_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 28 | -------------------------------------------------------------------------------- /src/instrument/api/InstrumentInitAndShutdown.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_INIT_AND_SHUTDOWN_HPP 8 | #define INSTRUMENT_INIT_AND_SHUTDOWN_HPP 9 | 10 | #include 11 | 12 | 13 | namespace Instrument { 14 | void initialize(); 15 | void shutdown(); 16 | void preinitFinished(); 17 | void addCPUs(); 18 | } 19 | 20 | 21 | #endif // INSTRUMENT_INIT_AND_SHUTDOWN_HPP 22 | -------------------------------------------------------------------------------- /src/instrument/api/InstrumentLeaderThread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_LEADER_THREAD_HPP 8 | #define INSTRUMENT_LEADER_THREAD_HPP 9 | 10 | 11 | namespace Instrument { 12 | void leaderThreadSpin(); 13 | 14 | //! Called when the leader thread starts the body 15 | void leaderThreadBegin(); 16 | 17 | //! Called when the leader thread ends the body 18 | void leaderThreadEnd(); 19 | } 20 | 21 | 22 | #endif // INSTRUMENT_LEADER_THREAD_HPP 23 | -------------------------------------------------------------------------------- /src/instrument/api/InstrumentLogMessage.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_LOG_MESSAGE_HPP 8 | #define INSTRUMENT_LOG_MESSAGE_HPP 9 | 10 | 11 | #include 12 | #include 13 | 14 | 15 | namespace Instrument { 16 | template 17 | void logMessage(InstrumentationContext const &context /* = ThreadInstrumentationContext::getCurrent() */, TS... components); 18 | } 19 | 20 | 21 | #endif // INSTRUMENT_LOG_MESSAGE_HPP 22 | -------------------------------------------------------------------------------- /src/instrument/api/InstrumentMainThread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_MAINTHREAD_HPP 8 | #define INSTRUMENT_MAINTHREAD_HPP 9 | 10 | namespace Instrument { 11 | 12 | //! Called when the main thread begins 13 | void mainThreadBegin(); 14 | 15 | //! Called when the main thread ends 16 | void mainThreadEnd(); 17 | } 18 | 19 | #endif // INSTRUMENT_MAINTHREAD_HPP 20 | -------------------------------------------------------------------------------- /src/instrument/api/InstrumentMemory.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_MEMORY_HPP 8 | #define INSTRUMENT_MEMORY_HPP 9 | 10 | namespace Instrument { 11 | 12 | // These are used to track when a new memory block is allocated or 13 | // deallocated. 14 | 15 | void memoryAllocEnter(); 16 | void memoryAllocExit(); 17 | void memoryFreeEnter(); 18 | void memoryFreeExit(); 19 | } 20 | 21 | #endif // INSTRUMENT_MEMORY_HPP 22 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentCPULocalData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "InstrumentCPULocalData.hpp" 8 | #include 9 | 10 | static Instrument::CPULocalData *_virtualCPULocalData = nullptr; 11 | 12 | Instrument::CPULocalData *Instrument::getCTFCPULocalData() 13 | { 14 | assert(_virtualCPULocalData != nullptr); 15 | CPULocalData *cpuLocalData = getCPULocalData(); 16 | return (cpuLocalData == nullptr) ? _virtualCPULocalData : cpuLocalData; 17 | } 18 | 19 | Instrument::CPULocalData *Instrument::getCTFVirtualCPULocalData() 20 | { 21 | return _virtualCPULocalData; 22 | } 23 | 24 | void Instrument::setCTFVirtualCPULocalData(Instrument::CPULocalData *virtualCPULocalData) 25 | { 26 | assert(virtualCPULocalData != nullptr); 27 | assert(_virtualCPULocalData == nullptr); 28 | _virtualCPULocalData = virtualCPULocalData; 29 | } 30 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentCPULocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CTF_CPU_LOCAL_DATA_HPP 8 | #define INSTRUMENT_CTF_CPU_LOCAL_DATA_HPP 9 | 10 | #include "ctfapi/stream/CTFKernelStream.hpp" 11 | #include "ctfapi/stream/CTFStream.hpp" 12 | 13 | namespace Instrument { 14 | struct CPULocalData { 15 | CTFAPI::CTFStream *userStream; 16 | CTFAPI::CTFKernelStream *kernelStream; 17 | 18 | CPULocalData() 19 | : userStream(nullptr), kernelStream(nullptr) 20 | { 21 | } 22 | }; 23 | 24 | CPULocalData *getCTFCPULocalData(); 25 | CPULocalData *getCTFVirtualCPULocalData(); 26 | void setCTFVirtualCPULocalData(CPULocalData *virtualCPULocalData); 27 | } 28 | 29 | #endif //INSTRUMENT_CTF_CPU_LOCAL_DATA_HPP 30 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentComputePlaceId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CTF_COMPUTE_PLACE_ID_HPP 8 | #define INSTRUMENT_CTF_COMPUTE_PLACE_ID_HPP 9 | 10 | #include 11 | 12 | namespace Instrument { 13 | class compute_place_id_t { 14 | public: 15 | uint16_t _id; 16 | 17 | compute_place_id_t() 18 | : _id(~0) 19 | { 20 | } 21 | 22 | compute_place_id_t(uint16_t id) 23 | : _id(id) 24 | { 25 | } 26 | 27 | bool operator==(compute_place_id_t const &other) const 28 | { 29 | return (_id == other._id); 30 | } 31 | }; 32 | } 33 | 34 | 35 | #endif // INSTRUMENT_CTF_COMPUTE_PLACE_ID_HPP 36 | 37 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentComputePlaceManagement.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentComputePlaceManagement.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentDataAccessId.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDataAccessId.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentDebug.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CTF_DEBUG_HPP 8 | #define INSTRUMENT_CTF_DEBUG_HPP 9 | 10 | #include 11 | 12 | #include "CTFTracepoints.hpp" 13 | #include "instrument/api/InstrumentDebug.hpp" 14 | 15 | 16 | namespace Instrument { 17 | 18 | inline void debugEnter(uint8_t id) 19 | { 20 | tp_debug_enter(id); 21 | } 22 | 23 | inline void debugTransition(uint8_t id) 24 | { 25 | tp_debug_transition(id); 26 | } 27 | 28 | inline void debugExit() 29 | { 30 | tp_debug_exit(); 31 | } 32 | 33 | inline void debugRegister(const char *name, uint8_t id) 34 | { 35 | tp_debug_register(name, id); 36 | } 37 | 38 | } 39 | 40 | #endif //INSTRUMENT_CTF_DEBUG_HPP 41 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentDependenciesByAccess.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByAccess.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentDependenciesByAccessLinks.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByAccessLinks.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentDependenciesByGroup.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByGroup.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentDependencySubsystemEntryPoints.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CTF_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 8 | #define INSTRUMENT_CTF_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 9 | 10 | #include "CTFTracepoints.hpp" 11 | #include "instrument/api/InstrumentDependencySubsystemEntryPoints.hpp" 12 | 13 | 14 | namespace Instrument { 15 | 16 | inline void enterRegisterTaskDataAcesses() 17 | { 18 | tp_dependency_register_enter(); 19 | } 20 | 21 | inline void exitRegisterTaskDataAcesses() 22 | { 23 | tp_dependency_register_exit(); 24 | } 25 | 26 | inline void enterUnregisterTaskDataAcesses() 27 | { 28 | tp_dependency_unregister_enter(); 29 | } 30 | 31 | inline void exitUnregisterTaskDataAcesses() 32 | { 33 | tp_dependency_unregister_exit(); 34 | } 35 | 36 | } 37 | 38 | #endif //INSTRUMENT_CTF_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 39 | 40 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentExternalThreadId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CTF_EXTERNAL_THREAD_ID_HPP 8 | #define INSTRUMENT_CTF_EXTERNAL_THREAD_ID_HPP 9 | 10 | #include "ctfapi/CTFTypes.hpp" 11 | 12 | namespace Instrument { 13 | //! This is the default non-worker thread identifier for the instrumentation. 14 | //! It should be redefined in an identically named file within each instrumentation implementation. 15 | struct external_thread_id_t { 16 | ctf_thread_id_t tid; 17 | 18 | external_thread_id_t() : tid(0) {} 19 | external_thread_id_t(ctf_thread_id_t threadId) : tid(threadId) {} 20 | 21 | bool operator==(external_thread_id_t const &other) const 22 | { 23 | return tid == other.tid; 24 | } 25 | }; 26 | } 27 | 28 | 29 | #endif // INSTRUMENT_CTF_EXTERNAL_THREAD_ID_HPP 30 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentExternalThreadLocalData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "InstrumentExternalThreadLocalData.hpp" 8 | 9 | 10 | std::atomic Instrument::ExternalThreadLocalData::externalThreadCount(0); 11 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentInitAndShutdown.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CTF_INIT_AND_SHUTDOWN_HPP 8 | #define INSTRUMENT_CTF_INIT_AND_SHUTDOWN_HPP 9 | 10 | #include "instrument/api/InstrumentInitAndShutdown.hpp" 11 | 12 | 13 | namespace Instrument { 14 | void initialize(); 15 | void shutdown(); 16 | void preinitFinished(); 17 | void addCPUs(); 18 | } 19 | 20 | 21 | #endif // INSTRUMENT_CTF_INIT_AND_SHUTDOWN_HPP 22 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentInstrumentationContext.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentInstrumentationContext.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentLeaderThread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CTF_LEADER_THREAD_HPP 8 | #define INSTRUMENT_CTF_LEADER_THREAD_HPP 9 | 10 | #include 11 | 12 | #include "instrument/api/InstrumentLeaderThread.hpp" 13 | #include "instrument/ctf/InstrumentThreadLocalData.hpp" 14 | #include "ctfapi/CTFAPI.hpp" 15 | 16 | namespace Instrument { 17 | 18 | inline void leaderThreadSpin() 19 | { 20 | CPULocalData *cpuLocalData = getCTFCPULocalData(); 21 | CTFAPI::CTFStream *userStream = cpuLocalData->userStream; 22 | assert(userStream != nullptr); 23 | 24 | CTFAPI::flushCurrentVirtualCPUBufferIfNeeded(userStream, userStream); 25 | } 26 | 27 | inline void leaderThreadBegin() 28 | { 29 | } 30 | 31 | inline void leaderThreadEnd() 32 | { 33 | } 34 | 35 | } 36 | 37 | 38 | #endif // INSTRUMENT_CTF_LEADER_THREAD_HPP 39 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentLogMessage.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentLogMessage.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentMainThread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentMainThread.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentMemory.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentMemory.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentPthread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentPthread.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentReductions.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentReductions.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentTaskId.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "ctfapi/CTFTypes.hpp" 8 | #include "InstrumentTaskId.hpp" 9 | 10 | // Reserved ctf2prv task and task type Ids: 11 | // 0 : Idle 12 | // 1 : Runtime 13 | // 2 : Busy Wait 14 | // 3 : Task 15 | 16 | std::atomic Instrument::task_id_t::_nextTaskId(4); 17 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentTaskId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CTF_TASK_ID_HPP 8 | #define INSTRUMENT_CTF_TASK_ID_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "ctfapi/CTFTypes.hpp" 15 | 16 | namespace Instrument { 17 | 18 | struct task_id_t { 19 | private: 20 | static std::atomic _nextTaskId; 21 | public: 22 | ctf_task_id_t _taskId; // TODO use the ctf typedef for task id 23 | task_id_t() {} 24 | 25 | // task_id_t are created in other parts of the runtime apart 26 | // from when adding tasks. We want the numeric task ID to be 27 | // assigned only to tasks, and to do so we use the dummy bool 28 | // arguemnt to distinguish when a numeric task id must be 29 | // generated. 30 | task_id_t(bool) 31 | { 32 | _taskId = _nextTaskId++; 33 | } 34 | }; 35 | } 36 | 37 | #endif // INSTRUMENT_CTF_TASK_ID_HPP 38 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentTasktypeData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "ctfapi/CTFTypes.hpp" 8 | #include "InstrumentTasktypeData.hpp" 9 | 10 | // Reserved ctf2prv task and task type Ids: 11 | // 0 : Idle 12 | // 1 : Runtime 13 | // 2 : Busy Wait 14 | // 3 : Task 15 | 16 | std::atomic Instrument::TasktypeInstrument::_nextTaskTypeId(4); 17 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentTasktypeData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CTF_TASKTYPE_DATA_HPP 8 | #define INSTRUMENT_CTF_TASKTYPE_DATA_HPP 9 | 10 | #include 11 | 12 | #include "ctfapi/CTFTypes.hpp" 13 | 14 | namespace Instrument { 15 | 16 | struct TasktypeInstrument { 17 | private: 18 | static std::atomic _nextTaskTypeId; 19 | public: 20 | ctf_tasktype_id_t id; 21 | 22 | TasktypeInstrument() 23 | { 24 | id = 0; 25 | } 26 | 27 | ctf_tasktype_id_t autoAssignId() 28 | { 29 | id = _nextTaskTypeId++; 30 | return id; 31 | } 32 | 33 | bool operator==(TasktypeInstrument const &other) const 34 | { 35 | return id == other.id; 36 | } 37 | }; 38 | } 39 | 40 | 41 | #endif // INSTRUMENT_CTF_TASKTYPE_DATA_HPP 42 | 43 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentThreadId.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentThreadId.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentThreadInstrumentationContext.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentThreadInstrumentationContext.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CTF_THREAD_LOCAL_DATA_HPP 8 | #define INSTRUMENT_CTF_THREAD_LOCAL_DATA_HPP 9 | 10 | 11 | #include "ctfapi/CTFTypes.hpp" 12 | 13 | #include 14 | 15 | namespace Instrument { 16 | // TODO can I remove this context? 17 | struct InstrumentationContext; 18 | 19 | struct ThreadLocalData { 20 | InstrumentationContext _context; 21 | bool isBusyWaiting; 22 | ctf_timestamp_t schedulerLockTimestamp; 23 | }; 24 | } 25 | 26 | 27 | #endif // INSTRUMENT_CTF_THREAD_LOCAL_DATA_HPP 28 | -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentTracingPointTypes.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTracingPointTypes.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/InstrumentTracingPoints.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTracingPoints.hpp -------------------------------------------------------------------------------- /src/instrument/ctf/ctfapi/CTFClock.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CTF_CLOCK_HPP 8 | #define CTF_CLOCK_HPP 9 | 10 | #include 11 | 12 | // Always use the CLOCK_MONOTONIC clock as it is drift-corrected by NTP, 13 | // and is not affected by time jumps. 14 | #define CTF_CLOCK CLOCK_MONOTONIC 15 | 16 | #endif // CTF_CLOCK_HPP 17 | -------------------------------------------------------------------------------- /src/instrument/ctf/ctfapi/CTFEvent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "CTFEvent.hpp" 8 | 9 | // Based on empirical observations, identifiers start at 1 to provide some 10 | // protection against trace corruption. When a trace is corrupted, it is likely 11 | // that zeros will be written when they should not, including the id field of an 12 | // event. If identifiers start at 0, babeltrace will decode the corrupted area 13 | // as the event with id 0 and will output misleading error messages. Instead, if 14 | // starting at 1, babeltrace decoding will fail at this point. 15 | 16 | // TODO use the ctf typedef here 17 | uint8_t CTFAPI::CTFEvent::idCounter = 1; 18 | -------------------------------------------------------------------------------- /src/instrument/ctf/ctfapi/CTFMetadata.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CTF_METADATA_HPP 8 | #define CTF_METADATA_HPP 9 | 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace CTFAPI { 16 | class CTFMetadata { 17 | public: 18 | static void collectCommonInformationAtInit(); 19 | static void collectCommonInformationAtShutdown(); 20 | protected: 21 | static const char *_meta_commonEnv; 22 | 23 | static std::string _cpuList; 24 | static uint32_t _externalThreadsCount; 25 | 26 | static void printCommonMetaEnv(FILE *f); 27 | }; 28 | } 29 | 30 | #endif // CTF_METADTATA_HPP 31 | -------------------------------------------------------------------------------- /src/instrument/ctf/ctfapi/CTFTypes.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CTFTYPES_HPP 8 | #define CTFTYPES_HPP 9 | 10 | #include 11 | 12 | typedef uint32_t ctf_stream_id_t; 13 | typedef uint8_t ctf_event_id_t; 14 | typedef uint16_t ctf_tasktype_id_t; 15 | typedef uint32_t ctf_task_id_t; 16 | typedef uint16_t ctf_cpu_id_t; 17 | typedef uint16_t ctf_thread_id_t; 18 | typedef uint8_t ctf_debug_id_t; 19 | typedef uint16_t ctf_kernel_event_id_t; 20 | typedef uint16_t ctf_kernel_event_size_t; 21 | typedef uint64_t ctf_timestamp_t; 22 | 23 | #endif //CTFTYPES_HPP 24 | -------------------------------------------------------------------------------- /src/instrument/ctf/ctfapi/context/CTFContext.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CTFCONTEXT_HPP 8 | #define CTFCONTEXT_HPP 9 | 10 | #include 11 | 12 | #include "instrument/ctf/ctfapi/CTFTypes.hpp" 13 | 14 | namespace CTFAPI { 15 | 16 | class CTFContext { 17 | protected: 18 | size_t size; 19 | std::string dataStructuresMetadata; 20 | 21 | CTFContext() : size(0) {} 22 | public: 23 | virtual ~CTFContext() {} 24 | 25 | inline const char *getDataStructuresMetadata() const 26 | { 27 | return dataStructuresMetadata.c_str(); 28 | } 29 | }; 30 | } 31 | 32 | #endif // CTFCONTEXT_HPP 33 | -------------------------------------------------------------------------------- /src/instrument/ctf/ctfapi/context/CTFContextCPUHardwareCounters.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CTFCONTEXTCPUHARDWARECOUNTERS_HPP 8 | #define CTFCONTEXTCPUHARDWARECOUNTERS_HPP 9 | 10 | #include "CTFEventContext.hpp" 11 | 12 | namespace CTFAPI { 13 | 14 | class CTFContextCPUHardwareCounters : public CTFEventContext { 15 | public: 16 | CTFContextCPUHardwareCounters(ctf_stream_id_t streamMask); 17 | ~CTFContextCPUHardwareCounters() {} 18 | 19 | void writeContext(void **buf, ctf_stream_id_t streamId) override; 20 | }; 21 | } 22 | 23 | #endif //CTFCONTEXTCPUHARDWARECOUNTERS_HPP 24 | -------------------------------------------------------------------------------- /src/instrument/ctf/ctfapi/context/CTFContextTaskHardwareCounters.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CTFCONTEXTTASKHARDWARECOUNTERS_HPP 8 | #define CTFCONTEXTTASKHARDWARECOUNTERS_HPP 9 | 10 | #include "CTFEventContext.hpp" 11 | 12 | namespace CTFAPI { 13 | 14 | class CTFContextTaskHardwareCounters : public CTFEventContext { 15 | public: 16 | CTFContextTaskHardwareCounters(ctf_stream_id_t streamMask); 17 | ~CTFContextTaskHardwareCounters() {} 18 | 19 | void writeContext(void **buf, ctf_stream_id_t streamId) override; 20 | }; 21 | } 22 | 23 | #endif //CTFCONTEXTTASKHARDWARECOUNTERS_HPP 24 | -------------------------------------------------------------------------------- /src/instrument/ctf/ctfapi/stream/CTFStreamUnboundedShared.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CPUSTREAMUNBOUNDEDSHARED_HPP 8 | #define CPUSTREAMUNBOUNDEDSHARED_HPP 9 | 10 | #include "lowlevel/SpinLock.hpp" 11 | #include "CTFStreamUnboundedPrivate.hpp" 12 | #include "CTFStreamUnboundedPrivate.hpp" 13 | 14 | namespace CTFAPI { 15 | class CTFStreamUnboundedShared : public CTFStreamUnboundedPrivate { 16 | private: 17 | SpinLock spinlock; 18 | 19 | public: 20 | CTFStreamUnboundedShared(size_t size, 21 | ctf_cpu_id_t cpu, 22 | int node, 23 | std::string path) 24 | : CTFStreamUnboundedPrivate(size, cpu, node, path) 25 | {} 26 | 27 | ~CTFStreamUnboundedShared() {} 28 | 29 | void lock() 30 | { 31 | spinlock.lock(); 32 | } 33 | 34 | void unlock() 35 | { 36 | spinlock.unlock(); 37 | } 38 | }; 39 | } 40 | 41 | #endif // CPUSTREAMUNBOUNDEDSHARED_HPP 42 | -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentCPULocalData.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentCPULocalData.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentComputePlaceId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_EXTRAE_COMPUTE_PLACE_ID_HPP 8 | #define INSTRUMENT_EXTRAE_COMPUTE_PLACE_ID_HPP 9 | 10 | 11 | namespace Instrument { 12 | class compute_place_id_t { 13 | public: 14 | unsigned int _id; 15 | unsigned int _NUMANode; 16 | 17 | compute_place_id_t() 18 | : _id(~0), _NUMANode(~0) 19 | { 20 | } 21 | 22 | compute_place_id_t(unsigned int id, unsigned int NUMANode) 23 | : _id(id), _NUMANode(NUMANode) 24 | { 25 | } 26 | 27 | bool operator==(__attribute__((unused)) compute_place_id_t const &other) const 28 | { 29 | return (_id == other._id) && (_NUMANode == other._NUMANode); 30 | } 31 | 32 | }; 33 | } 34 | 35 | 36 | #endif // INSTRUMENT_EXTRAE_COMPUTE_PLACE_ID_HPP 37 | 38 | -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentDebug.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDebug.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentDependenciesByAccess.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByAccess.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentDependenciesByGroup.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByGroup.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentDependencySubsystemEntryPoints.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependencySubsystemEntryPoints.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentExternalThreadId.hpp: -------------------------------------------------------------------------------- 1 | ../generic_ids/InstrumentExternalThreadId.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentExternalThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_EXTRAE_EXTERNAL_THREAD_LOCAL_DATA_HPP 8 | #define INSTRUMENT_EXTRAE_EXTERNAL_THREAD_LOCAL_DATA_HPP 9 | 10 | 11 | #include "../support/InstrumentStandardExternalThreadLocalData.hpp" 12 | 13 | 14 | namespace Instrument { 15 | using ExternalThreadLocalData = StandardExternalThreadLocalData; 16 | } 17 | 18 | 19 | #endif // INSTRUMENT_EXTRAE_EXTERNAL_THREAD_LOCAL_DATA_HPP 20 | -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentInitAndShutdown.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_EXTRAE_INIT_AND_SHUTDOWN_HPP 8 | #define INSTRUMENT_EXTRAE_INIT_AND_SHUTDOWN_HPP 9 | 10 | #include "instrument/api/InstrumentInitAndShutdown.hpp" 11 | 12 | 13 | namespace Instrument { 14 | void initialize(); 15 | void shutdown(); 16 | 17 | inline void preinitFinished() 18 | { 19 | } 20 | 21 | inline void addCPUs() 22 | { 23 | } 24 | } 25 | 26 | 27 | #endif // INSTRUMENT_EXTRAE_INIT_AND_SHUTDOWN_HPP 28 | -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentLogMessage.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentLogMessage.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentMainThread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentMainThread.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentMemory.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentMemory.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentPthread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentPthread.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentReductions.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_EXTRAE_REDUCTIONS_HPP 8 | #define INSTRUMENT_EXTRAE_REDUCTIONS_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentReductions.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_EXTRAE_REDUCTIONS_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentScheduler.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentScheduler.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentTasktypeData.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTasktypeData.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentThreadId.hpp: -------------------------------------------------------------------------------- 1 | ../generic_ids/InstrumentThreadId.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_EXTRAE_THREAD_LOCAL_DATA_HPP 8 | #define INSTRUMENT_EXTRAE_THREAD_LOCAL_DATA_HPP 9 | 10 | 11 | #include 12 | 13 | #include "InstrumentThreadId.hpp" 14 | 15 | #include 16 | #include 17 | 18 | 19 | namespace Instrument { 20 | struct ThreadLocalData { 21 | enum { 22 | max_backlog = 4096 23 | }; 24 | 25 | thread_id_t _currentThreadId; 26 | std::vector _nestingLevels; 27 | 28 | InstrumentationContext _context; 29 | 30 | ThreadLocalData() 31 | : _currentThreadId(), _nestingLevels() 32 | { 33 | } 34 | }; 35 | } 36 | 37 | 38 | #endif // INSTRUMENT_EXTRAE_THREAD_LOCAL_DATA_HPP 39 | -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentTracingPointTypes.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_EXTRAE_TRACING_POINT_TYPES_HPP 8 | #define INSTRUMENT_EXTRAE_TRACING_POINT_TYPES_HPP 9 | 10 | #include "extrae_types.h" 11 | 12 | 13 | namespace Instrument { 14 | struct tracing_point_type_t { 15 | extrae_type_t _type; 16 | 17 | tracing_point_type_t() 18 | : _type(~ ((extrae_type_t) 0) ) 19 | { 20 | } 21 | 22 | bool operator<(tracing_point_type_t const &other) const 23 | { 24 | return (_type < other._type); 25 | } 26 | }; 27 | } 28 | 29 | 30 | #endif // INSTRUMENT_EXTRAE_TRACING_POINT_TYPES_HPP 31 | -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentUserMutex.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentUserMutex.hpp -------------------------------------------------------------------------------- /src/instrument/extrae/InstrumentWorkerThread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentWorkerThread.hpp -------------------------------------------------------------------------------- /src/instrument/generic_ids/GenericIds.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "GenericIds.hpp" 8 | 9 | 10 | namespace Instrument { 11 | namespace GenericIds { 12 | std::atomic _nextThreadId(0); 13 | std::atomic _nextExternalThreadId(0); 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/instrument/generic_ids/InstrumentThreadId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_GENERIC_IDS_THREAD_ID_HPP 8 | #define INSTRUMENT_GENERIC_IDS_THREAD_ID_HPP 9 | 10 | 11 | namespace Instrument { 12 | class thread_id_t { 13 | public: 14 | typedef unsigned int inner_type_t; 15 | 16 | private: 17 | inner_type_t _id; 18 | 19 | public: 20 | thread_id_t() 21 | : _id(~0) 22 | { 23 | } 24 | 25 | thread_id_t(inner_type_t id) 26 | : _id(id) 27 | { 28 | } 29 | 30 | operator inner_type_t() const 31 | { 32 | return _id; 33 | } 34 | 35 | bool operator==(inner_type_t other) const 36 | { 37 | return (_id == other); 38 | } 39 | 40 | bool operator!=(inner_type_t other) const 41 | { 42 | return (_id != other); 43 | } 44 | 45 | bool operator<(thread_id_t other) 46 | { 47 | return (_id < other._id); 48 | } 49 | 50 | }; 51 | } 52 | 53 | 54 | #endif // INSTRUMENT_GENERIC_IDS_THREAD_ID_HPP 55 | -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentBlockingAPI.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentBlockingAPI.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentCPULocalData.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentCPULocalData.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentComputePlaceId.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentComputePlaceId.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentComputePlaceManagement.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentComputePlaceManagement.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentDataAccessId.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDataAccessId.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentDebug.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDebug.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentDependenciesByAccess.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByAccess.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentDependenciesByAccessLinks.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByAccessLinks.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentDependenciesByGroup.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByGroup.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentDependencySubsystemEntryPoints.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependencySubsystemEntryPoints.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentExternalThreadId.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentExternalThreadId.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentExternalThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentExternalThreadLocalData.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentInitAndShutdown.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentInitAndShutdown.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentInstrumentationContext.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentInstrumentationContext.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentLeaderThread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentLeaderThread.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentLogMessage.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentLogMessage.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentMainThread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentMainThread.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentMemory.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentMemory.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentPthread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentPthread.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentReductions.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentReductions.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentScheduler.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentScheduler.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentTaskId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_LINT_TASK_ID_HPP 8 | #define INSTRUMENT_LINT_TASK_ID_HPP 9 | 10 | 11 | namespace Instrument { 12 | class task_id_t { 13 | public: 14 | typedef long int inner_type_t; 15 | 16 | private: 17 | inner_type_t _id; 18 | 19 | public: 20 | task_id_t(inner_type_t id) 21 | : _id(id) 22 | { 23 | } 24 | 25 | task_id_t() 26 | : _id(-1) 27 | { 28 | } 29 | 30 | operator inner_type_t() const 31 | { 32 | return _id; 33 | } 34 | }; 35 | } 36 | 37 | #endif // INSTRUMENT_LINT_TASK_ID_HPP 38 | -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentTaskStatus.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTaskStatus.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentTasktypeData.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTasktypeData.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentThreadId.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentThreadId.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentThreadInstrumentationContext.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentThreadInstrumentationContext.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentThreadLocalData.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentThreadManagement.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentThreadManagement.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentTracingPointTypes.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTracingPointTypes.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentTracingPoints.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTracingPoints.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentUserMutex.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentUserMutex.hpp -------------------------------------------------------------------------------- /src/instrument/lint/InstrumentWorkerThread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentWorkerThread.hpp -------------------------------------------------------------------------------- /src/instrument/null/InstrumentCPULocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CPU_LOCAL_DATA_HPP 8 | #define INSTRUMENT_CPU_LOCAL_DATA_HPP 9 | 10 | namespace Instrument { 11 | // TODO CPUlocalData or CPULocalData_t ? 12 | struct CPULocalData { 13 | CPULocalData() {} 14 | }; 15 | } 16 | 17 | #endif //INSTRUMENT_CPU_LOCAL_DATA_HPP 18 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentComputePlaceId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_COMPUTE_PLACE_ID_HPP 8 | #define INSTRUMENT_NULL_COMPUTE_PLACE_ID_HPP 9 | 10 | 11 | namespace Instrument { 12 | class compute_place_id_t { 13 | public: 14 | compute_place_id_t() 15 | { 16 | } 17 | 18 | template 19 | compute_place_id_t(__attribute__((unused)) T id) 20 | { 21 | } 22 | 23 | bool operator==(__attribute__((unused)) compute_place_id_t const &other) const 24 | { 25 | return true; 26 | } 27 | 28 | }; 29 | } 30 | 31 | 32 | #endif // INSTRUMENT_NULL_COMPUTE_PLACE_ID_HPP 33 | 34 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentDataAccessId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_DATA_ACCESS_ID_HPP 8 | #define INSTRUMENT_NULL_DATA_ACCESS_ID_HPP 9 | 10 | 11 | namespace Instrument { 12 | //! This is the default data access identifier for the instrumentation. 13 | //! It should be redefined in an identically named file within each instrumentation implementation. 14 | struct data_access_id_t { 15 | bool operator==(__attribute__((unused)) data_access_id_t const &other) const 16 | { 17 | return true; 18 | } 19 | bool operator!=(__attribute__((unused)) data_access_id_t const &other) const 20 | { 21 | return false; 22 | } 23 | }; 24 | } 25 | 26 | #endif // INSTRUMENT_NULL_DATA_ACCESS_ID_HPP 27 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentDebug.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_DEBUG_HPP 8 | #define INSTRUMENT_NULL_DEBUG_HPP 9 | 10 | #include 11 | 12 | #include "instrument/api/InstrumentDebug.hpp" 13 | 14 | namespace Instrument { 15 | 16 | inline void debugEnter( 17 | __attribute__((unused)) uint8_t id 18 | ) { 19 | } 20 | 21 | inline void debugTransition( 22 | __attribute__((unused)) uint8_t id 23 | ) { 24 | } 25 | 26 | inline void debugExit() {} 27 | 28 | inline void debugRegister( 29 | __attribute__((unused)) const char *name, 30 | __attribute__((unused)) uint8_t id 31 | ) { 32 | } 33 | 34 | } 35 | 36 | #endif //INSTRUMENT_NULL_DEBUG_HPP 37 | 38 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentDependenciesByAccess.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_DEPENDENCIES_BY_ACCESS_HPP 8 | #define INSTRUMENT_NULL_DEPENDENCIES_BY_ACCESS_HPP 9 | 10 | 11 | 12 | #include "instrument/api/InstrumentDependenciesByAccess.hpp" 13 | #include "dependencies/DataAccessType.hpp" 14 | 15 | 16 | namespace Instrument { 17 | inline void registerTaskAccess( 18 | __attribute__((unused)) task_id_t taskId, 19 | __attribute__((unused)) DataAccessType accessType, 20 | __attribute__((unused)) bool weak, 21 | __attribute__((unused)) void *start, 22 | __attribute__((unused)) size_t length, 23 | __attribute__((unused)) InstrumentationContext const &context 24 | ) { 25 | } 26 | } 27 | 28 | 29 | #endif // INSTRUMENT_NULL_DEPENDENCIES_BY_ACCESS_HPP 30 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentDependencySubsystemEntryPoints.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 8 | #define INSTRUMENT_NULL_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 9 | 10 | #include "instrument/api/InstrumentDependencySubsystemEntryPoints.hpp" 11 | 12 | 13 | namespace Instrument { 14 | 15 | inline void enterRegisterTaskDataAcesses() {} 16 | 17 | inline void exitRegisterTaskDataAcesses() {} 18 | 19 | inline void enterUnregisterTaskDataAcesses() {} 20 | 21 | inline void exitUnregisterTaskDataAcesses() {} 22 | 23 | } 24 | 25 | #endif //INSTRUMENT_NULL_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 26 | 27 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentExternalThreadId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_EXTERNAL_THREAD_ID_HPP 8 | #define INSTRUMENT_NULL_EXTERNAL_THREAD_ID_HPP 9 | 10 | 11 | namespace Instrument { 12 | //! This is the default non-worker thread identifier for the instrumentation. 13 | //! It should be redefined in an identically named file within each instrumentation implementation. 14 | struct external_thread_id_t { 15 | bool operator==(__attribute__((unused)) external_thread_id_t const &other) const 16 | { 17 | return true; 18 | } 19 | }; 20 | } 21 | 22 | 23 | #endif // INSTRUMENT_NULL_EXTERNAL_THREAD_ID_HPP 24 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentExternalThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_EXTERNAL_THREAD_LOCAL_DATA_HPP 8 | #define INSTRUMENT_NULL_EXTERNAL_THREAD_LOCAL_DATA_HPP 9 | 10 | 11 | #include 12 | 13 | 14 | namespace Instrument { 15 | struct ExternalThreadLocalData { 16 | ExternalThreadLocalData(__attribute__((unused)) std::string const &externalThreadName) 17 | { 18 | } 19 | }; 20 | } 21 | 22 | 23 | #endif // INSTRUMENT_NULL_EXTERNAL_THREAD_LOCAL_DATA_HPP 24 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentInitAndShutdown.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_INIT_AND_SHUTDOWN_HPP 8 | #define INSTRUMENT_NULL_INIT_AND_SHUTDOWN_HPP 9 | 10 | #include "instrument/api/InstrumentInitAndShutdown.hpp" 11 | 12 | 13 | namespace Instrument { 14 | inline void initialize() 15 | { 16 | } 17 | 18 | inline void shutdown() 19 | { 20 | } 21 | 22 | inline void preinitFinished() 23 | { 24 | } 25 | 26 | inline void addCPUs() 27 | { 28 | } 29 | } 30 | 31 | 32 | #endif // INSTRUMENT_NULL_INIT_AND_SHUTDOWN_HPP 33 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentLeaderThread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_LEADER_THREAD_HPP 8 | #define INSTRUMENT_NULL_LEADER_THREAD_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentLeaderThread.hpp" 12 | 13 | 14 | namespace Instrument { 15 | inline void leaderThreadSpin() 16 | { 17 | } 18 | 19 | inline void leaderThreadBegin() 20 | { 21 | } 22 | 23 | inline void leaderThreadEnd() 24 | { 25 | } 26 | 27 | } 28 | 29 | 30 | #endif // INSTRUMENT_NULL_LEADER_THREAD_HPP 31 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentLogMessage.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_LOG_MESSAGE_HPP 8 | #define INSTRUMENT_NULL_LOG_MESSAGE_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentLogMessage.hpp" 12 | 13 | 14 | namespace Instrument { 15 | template 16 | inline void logMessage( 17 | __attribute__((unused)) InstrumentationContext const &context, 18 | __attribute__((unused)) TS... components 19 | ) { 20 | } 21 | } 22 | 23 | 24 | #endif // INSTRUMENT_NULL_LOG_MESSAGE_HPP 25 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentMainThread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_MAINTHREAD_HPP 8 | #define INSTRUMENT_NULL_MAINTHREAD_HPP 9 | 10 | #include "instrument/api/InstrumentMainThread.hpp" 11 | 12 | namespace Instrument { 13 | 14 | inline void mainThreadBegin() {} 15 | inline void mainThreadEnd() {} 16 | } 17 | 18 | #endif // INSTRUMENT_NULL_MAINTHREAD_HPP 19 | 20 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentMemory.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_MEMORY_HPP 8 | #define INSTRUMENT_NULL_MEMORY_HPP 9 | 10 | #include "instrument/api/InstrumentMemory.hpp" 11 | 12 | namespace Instrument { 13 | 14 | inline void memoryAllocEnter() { } 15 | inline void memoryAllocExit() { } 16 | inline void memoryFreeEnter() { } 17 | inline void memoryFreeExit() { } 18 | } 19 | 20 | #endif // INSTRUMENT_NULL_MEMORY_HPP 21 | 22 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentPthread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_PTHREAD_HPP 8 | #define INSTRUMENT_NULL_PTHREAD_HPP 9 | 10 | #include "instrument/api/InstrumentPthread.hpp" 11 | 12 | namespace Instrument { 13 | 14 | inline void pthreadBegin( 15 | __attribute__((unused)) pid_t creatorTid, 16 | __attribute__((unused)) int cpu, 17 | __attribute__((unused)) void *arg) {} 18 | inline void pthreadEnd() {} 19 | inline void pthreadCreate( 20 | __attribute__((unused)) int cpu, 21 | __attribute__((unused)) void *arg) {} 22 | inline void pthreadBind( 23 | __attribute__((unused)) pid_t tid, 24 | __attribute__((unused)) int cpu) {} 25 | inline void pthreadPause() {} 26 | inline void pthreadResume() {} 27 | inline void pthreadCool() {} 28 | inline void pthreadSignal(__attribute__((unused)) pid_t tid) {} 29 | } 30 | 31 | #endif // INSTRUMENT_NULL_PTHREAD_HPP 32 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentTaskExecution.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_TASK_EXECUTION_HPP 8 | #define INSTRUMENT_NULL_TASK_EXECUTION_HPP 9 | 10 | 11 | #include 12 | 13 | #include "instrument/api/InstrumentTaskExecution.hpp" 14 | 15 | 16 | namespace Instrument { 17 | inline void startTask(__attribute__((unused)) task_id_t taskId, __attribute__((unused)) InstrumentationContext const &context) 18 | { 19 | } 20 | 21 | inline void endTask(__attribute__((unused)) task_id_t taskId, __attribute__((unused)) InstrumentationContext const &context) 22 | { 23 | } 24 | 25 | inline void destroyTask(__attribute__((unused)) task_id_t taskId, __attribute__((unused)) InstrumentationContext const &context) 26 | { 27 | } 28 | } 29 | 30 | 31 | #endif // INSTRUMENT_NULL_TASK_EXECUTION_HPP 32 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentTaskId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_TASK_ID_HPP 8 | #define INSTRUMENT_NULL_TASK_ID_HPP 9 | 10 | 11 | namespace Instrument { 12 | //! This is the default task identifier for the instrumentation. 13 | //! It should be redefined in an identically named file within each instrumentation implementation. 14 | struct task_id_t { 15 | bool operator==(__attribute__((unused)) task_id_t const &other) const 16 | { 17 | return true; 18 | } 19 | 20 | operator long() const 21 | { 22 | return -1; 23 | } 24 | }; 25 | } 26 | 27 | #endif // INSTRUMENT_NULL_TASK_ID_HPP 28 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentTaskWait.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_TASK_WAIT_HPP 8 | #define INSTRUMENT_NULL_TASK_WAIT_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentTaskWait.hpp" 12 | 13 | 14 | 15 | namespace Instrument { 16 | inline void enterTaskWait( 17 | __attribute__((unused)) task_id_t taskId, 18 | __attribute__((unused)) char const *invocationSource, 19 | __attribute__((unused)) task_id_t if0TaskId, 20 | __attribute__((unused)) bool taskRuntimeTransition, 21 | __attribute__((unused)) InstrumentationContext const &context 22 | ) { 23 | } 24 | 25 | inline void exitTaskWait( 26 | __attribute__((unused)) task_id_t taskId, 27 | __attribute__((unused)) bool taskRuntimeTransition, 28 | __attribute__((unused)) InstrumentationContext const &context 29 | ) { 30 | } 31 | } 32 | 33 | 34 | #endif // INSTRUMENT_NULL_TASK_WAIT_HPP 35 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentTasktypeData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_TASKTYPE_DATA_HPP 8 | #define INSTRUMENT_NULL_TASKTYPE_DATA_HPP 9 | 10 | 11 | namespace Instrument { 12 | //! This is the default Task Type id identifier for the instrumentation. 13 | //! It should be redefined in an identically named file within each instrumentation implementation. 14 | struct TasktypeInstrument { 15 | bool operator==(__attribute__((unused)) TasktypeInstrument const &other) const 16 | { 17 | return true; 18 | } 19 | }; 20 | } 21 | 22 | 23 | #endif // INSTRUMENT_NULL_TASKTYPE_DATA_HPP 24 | 25 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentThreadId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_THREAD_ID_HPP 8 | #define INSTRUMENT_NULL_THREAD_ID_HPP 9 | 10 | 11 | namespace Instrument { 12 | //! This is the default thread identifier for the instrumentation. 13 | //! It should be redefined in an identically named file within each instrumentation implementation. 14 | struct thread_id_t { 15 | bool operator==(__attribute__((unused)) thread_id_t const &other) const 16 | { 17 | return true; 18 | } 19 | }; 20 | } 21 | 22 | 23 | #endif // INSTRUMENT_NULL_THREAD_ID_HPP 24 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_THREAD_LOCAL_DATA_HPP 8 | #define INSTRUMENT_NULL_THREAD_LOCAL_DATA_HPP 9 | 10 | 11 | #include 12 | 13 | namespace Instrument { 14 | struct InstrumentationContext; 15 | 16 | struct ThreadLocalData { 17 | InstrumentationContext _context; 18 | }; 19 | } 20 | 21 | 22 | #endif // INSTRUMENT_NULL_THREAD_LOCAL_DATA_HPP 23 | -------------------------------------------------------------------------------- /src/instrument/null/InstrumentTracingPointTypes.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_NULL_TRACING_POINT_TYPES_HPP 8 | #define INSTRUMENT_NULL_TRACING_POINT_TYPES_HPP 9 | 10 | 11 | namespace Instrument { 12 | struct tracing_point_type_t { 13 | tracing_point_type_t() 14 | { 15 | } 16 | 17 | template 18 | tracing_point_type_t(__attribute__((unused)) T const &anything) 19 | { 20 | } 21 | }; 22 | } 23 | 24 | 25 | #endif // INSTRUMENT_NULL_TRACING_POINT_TYPES_HPP 26 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentCPULocalData.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentCPULocalData.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentComputePlaceId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_OVNI_COMPUTE_PLACE_ID_HPP 8 | #define INSTRUMENT_OVNI_COMPUTE_PLACE_ID_HPP 9 | 10 | #include 11 | 12 | namespace Instrument { 13 | class compute_place_id_t { 14 | public: 15 | int32_t _id; 16 | 17 | compute_place_id_t() : 18 | _id(~0) 19 | { 20 | } 21 | 22 | compute_place_id_t(int32_t id) : 23 | _id(id) 24 | { 25 | } 26 | 27 | bool operator==(compute_place_id_t const &other) const 28 | { 29 | return (_id == other._id); 30 | } 31 | }; 32 | } 33 | 34 | 35 | #endif // INSTRUMENT_OVNI_COMPUTE_PLACE_ID_HPP 36 | 37 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentComputePlaceManagement.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentComputePlaceManagement.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentDataAccessId.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDataAccessId.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentDebug.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDebug.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentDependenciesByAccess.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByAccess.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentDependenciesByAccessLinks.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByAccessLinks.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentDependenciesByGroup.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependenciesByGroup.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentDependencySubsystemEntryPoints.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_OVNI_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 8 | #define INSTRUMENT_OVNI_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 9 | 10 | #include "instrument/api/InstrumentDependencySubsystemEntryPoints.hpp" 11 | #include "OvniTrace.hpp" 12 | 13 | namespace Instrument { 14 | 15 | inline void enterRegisterTaskDataAcesses() 16 | { 17 | Ovni::registerAccessesEnter(); 18 | } 19 | 20 | inline void exitRegisterTaskDataAcesses() 21 | { 22 | Ovni::registerAccessesExit(); 23 | } 24 | 25 | inline void enterUnregisterTaskDataAcesses() 26 | { 27 | Ovni::unregisterAccessesEnter(); 28 | } 29 | 30 | inline void exitUnregisterTaskDataAcesses() 31 | { 32 | Ovni::unregisterAccessesExit(); 33 | } 34 | } 35 | 36 | #endif //INSTRUMENT_OVNI_DEPENDENCY_SUBSYTEM_ENTRY_POINTS_HPP 37 | 38 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentExternalThreadId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_OVNI_EXTERNAL_THREAD_ID_HPP 8 | #define INSTRUMENT_OVNI_EXTERNAL_THREAD_ID_HPP 9 | 10 | #include 11 | 12 | namespace Instrument { 13 | //! This is the default non-worker thread identifier for the instrumentation. 14 | //! It should be redefined in an identically named file within each instrumentation implementation. 15 | struct external_thread_id_t { 16 | uint32_t tid; 17 | 18 | external_thread_id_t() : tid(0) {} 19 | external_thread_id_t(uint32_t threadId) : tid(threadId) {} 20 | 21 | bool operator==(external_thread_id_t const &other) const 22 | { 23 | return tid == other.tid; 24 | } 25 | }; 26 | } 27 | 28 | 29 | #endif // INSTRUMENT_OVNI_EXTERNAL_THREAD_ID_HPP 30 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentExternalThreadLocalData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "InstrumentExternalThreadLocalData.hpp" 8 | 9 | 10 | std::atomic Instrument::ExternalThreadLocalData::externalThreadCount(0); 11 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentExternalThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_OVNI_EXTERNAL_THREAD_LOCAL_DATA_HPP 8 | #define INSTRUMENT_OVNI_EXTERNAL_THREAD_LOCAL_DATA_HPP 9 | 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | 16 | namespace Instrument { 17 | struct ExternalThreadLocalData { 18 | static std::atomic externalThreadCount; 19 | 20 | ExternalThreadLocalData(__attribute__((unused)) std::string const &externalThreadName) 21 | { 22 | externalThreadCount.fetch_add(1, std::memory_order_relaxed); 23 | } 24 | 25 | static uint32_t getExternalThreadCount() { 26 | return externalThreadCount.load(std::memory_order_relaxed); 27 | } 28 | }; 29 | } 30 | 31 | 32 | #endif // INSTRUMENT_OVNI_EXTERNAL_THREAD_LOCAL_DATA_HPP 33 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentInitAndShutdown.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_OVNI_INIT_AND_SHUTDOWN_HPP 8 | #define INSTRUMENT_OVNI_INIT_AND_SHUTDOWN_HPP 9 | 10 | #include "instrument/api/InstrumentInitAndShutdown.hpp" 11 | 12 | 13 | namespace Instrument { 14 | void initialize(); 15 | void shutdown(); 16 | void preinitFinished(); 17 | void addCPUs(); 18 | } 19 | 20 | 21 | #endif // INSTRUMENT_OVNI_INIT_AND_SHUTDOWN_HPP 22 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentInstrumentationContext.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentInstrumentationContext.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentLeaderThread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_OVNI_LEADER_THREAD_HPP 8 | #define INSTRUMENT_OVNI_LEADER_THREAD_HPP 9 | 10 | #include "instrument/api/InstrumentLeaderThread.hpp" 11 | #include "OvniTrace.hpp" 12 | 13 | namespace Instrument { 14 | inline void leaderThreadSpin() 15 | { 16 | } 17 | 18 | inline void leaderThreadBegin() 19 | { 20 | Ovni::threadTypeBegin('L'); 21 | } 22 | 23 | inline void leaderThreadEnd() 24 | { 25 | Ovni::threadTypeEnd('L'); 26 | } 27 | 28 | } 29 | 30 | #endif // INSTRUMENT_OVNI_LEADER_THREAD_HPP 31 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentLogMessage.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentLogMessage.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentMemory.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_OVNI_MEMORY_HPP 8 | #define INSTRUMENT_OVNI_MEMORY_HPP 9 | 10 | #include "instrument/api/InstrumentMemory.hpp" 11 | #include "OvniTrace.hpp" 12 | 13 | namespace Instrument { 14 | 15 | inline void memoryAllocEnter() { Ovni::memoryAllocEnter(); } 16 | inline void memoryAllocExit() { Ovni::memoryAllocExit(); } 17 | inline void memoryFreeEnter() { Ovni::memoryFreeEnter(); } 18 | inline void memoryFreeExit() { Ovni::memoryFreeExit(); } 19 | } 20 | 21 | #endif // INSTRUMENT_OVNI_MEMORY_HPP 22 | 23 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentReductions.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentReductions.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentTaskId.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "InstrumentTaskId.hpp" 8 | 9 | std::atomic Instrument::task_id_t::_nextTaskId(1); 10 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentTaskId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_OVNI_TASK_ID_HPP 8 | #define INSTRUMENT_OVNI_TASK_ID_HPP 9 | 10 | #include 11 | #include 12 | 13 | namespace Instrument { 14 | 15 | struct task_id_t { 16 | private: 17 | static std::atomic _nextTaskId; 18 | public: 19 | uint32_t _taskId; 20 | task_id_t() 21 | { 22 | } 23 | 24 | uint32_t assignNewId() 25 | { 26 | _taskId = _nextTaskId.fetch_add(1, std::memory_order_relaxed); 27 | return _taskId; 28 | } 29 | }; 30 | } 31 | 32 | #endif // INSTRUMENT_OVNI_TASK_ID_HPP 33 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentTaskStatus.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTaskStatus.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentTasktypeData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "InstrumentTasktypeData.hpp" 8 | 9 | std::atomic Instrument::TasktypeInstrument::_nextTaskTypeId(1); 10 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentTasktypeData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_OVNI_TASKTYPE_DATA_HPP 8 | #define INSTRUMENT_OVNI_TASKTYPE_DATA_HPP 9 | 10 | #include 11 | 12 | namespace Instrument { 13 | 14 | struct TasktypeInstrument { 15 | private: 16 | static std::atomic _nextTaskTypeId; 17 | public: 18 | uint32_t _taskTypeId; 19 | 20 | TasktypeInstrument() : 21 | _taskTypeId(0) 22 | { 23 | } 24 | 25 | uint32_t assignNewId() 26 | { 27 | _taskTypeId = _nextTaskTypeId.fetch_add(1, std::memory_order_relaxed); 28 | return _taskTypeId; 29 | } 30 | 31 | bool operator==(TasktypeInstrument const &other) const 32 | { 33 | return _taskTypeId == other._taskTypeId; 34 | } 35 | }; 36 | } 37 | 38 | 39 | #endif // INSTRUMENT_OVNI_TASKTYPE_DATA_HPP 40 | 41 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentThreadId.hpp: -------------------------------------------------------------------------------- 1 | ../generic_ids/InstrumentThreadId.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentThreadInstrumentationContext.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentThreadInstrumentationContext.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_OVNI_THREAD_LOCAL_DATA_HPP 8 | #define INSTRUMENT_OVNI_THREAD_LOCAL_DATA_HPP 9 | 10 | #include 11 | 12 | namespace Instrument { 13 | enum worker_status_t { 14 | progressing, 15 | resting, 16 | absorbing 17 | }; 18 | 19 | struct ThreadLocalData { 20 | InstrumentationContext _context; 21 | worker_status_t _workerStatus; 22 | 23 | ThreadLocalData() : 24 | _context(), 25 | _workerStatus(progressing) 26 | { 27 | } 28 | }; 29 | } 30 | 31 | 32 | #endif // INSTRUMENT_OVNI_THREAD_LOCAL_DATA_HPP 33 | -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentTracingPointTypes.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTracingPointTypes.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentTracingPoints.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTracingPoints.hpp -------------------------------------------------------------------------------- /src/instrument/ovni/InstrumentUserMutex.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentUserMutex.hpp -------------------------------------------------------------------------------- /src/instrument/support/InstrumentCPULocalDataSupport.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_CPU_LOCAL_DATA_SUPPORT_HPP 8 | #define INSTRUMENT_CPU_LOCAL_DATA_SUPPORT_HPP 9 | 10 | #include 11 | 12 | namespace Instrument { 13 | CPULocalData *getCPULocalData(); 14 | } 15 | 16 | #endif //INSTRUMENT_CPU_LOCAL_DATA_SUPPORT_HPP 17 | -------------------------------------------------------------------------------- /src/instrument/support/InstrumentStandardExternalThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_STANDARD_EXTERNAL_THREAD_LOCAL_DATA_HPP 8 | #define INSTRUMENT_STANDARD_EXTERNAL_THREAD_LOCAL_DATA_HPP 9 | 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | 17 | namespace Instrument { 18 | struct StandardExternalThreadLocalData { 19 | external_thread_id_t _currentThreadId; 20 | std::string _name; 21 | 22 | InstrumentationContext _context; 23 | 24 | StandardExternalThreadLocalData(std::string const &externalThreadName) 25 | : _currentThreadId(), _name(externalThreadName), _context(&_name) 26 | { 27 | } 28 | }; 29 | } 30 | 31 | 32 | #endif // INSTRUMENT_STANDARD_EXTERNAL_THREAD_LOCAL_DATA_HPP 33 | -------------------------------------------------------------------------------- /src/instrument/support/InstrumentThreadLocalDataSupport.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_THREAD_LOCAL_DATA_SUPPORT_HPP 8 | #define INSTRUMENT_THREAD_LOCAL_DATA_SUPPORT_HPP 9 | 10 | 11 | #include 12 | #include 13 | 14 | 15 | namespace Instrument { 16 | ExternalThreadLocalData &getExternalThreadLocalData(); 17 | ThreadLocalData &getThreadLocalData(); 18 | 19 | inline ThreadLocalData &getSentinelNonWorkerThreadLocalData() 20 | { 21 | static thread_local ThreadLocalData nonWorkerThreadLocalData; 22 | return nonWorkerThreadLocalData; 23 | } 24 | } 25 | 26 | 27 | #endif // INSTRUMENT_THREAD_LOCAL_DATA_SUPPORT_HPP 28 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentAddTask.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_ADD_TASK_HPP 8 | #define INSTRUMENT_VERBOSE_ADD_TASK_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentAddTask.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_ADD_TASK_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentBlockingAPI.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_BLOCKING_API_HPP 8 | #define INSTRUMENT_VERBOSE_BLOCKING_API_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentBlockingAPI.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_BLOCKING_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentCPULocalData.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentCPULocalData.hpp -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentComputePlaceManagement.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_COMPUTE_PLACE_MANAGEMENT_HPP 8 | #define INSTRUMENT_VERBOSE_COMPUTE_PLACE_MANAGEMENT_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentComputePlaceManagement.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_COMPUTE_PLACE_MANAGEMENT_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentDataAccessId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_DATA_ACCESS_ID_HPP 8 | #define INSTRUMENT_VERBOSE_DATA_ACCESS_ID_HPP 9 | 10 | 11 | namespace Instrument { 12 | class data_access_id_t { 13 | public: 14 | typedef long int inner_type_t; 15 | 16 | private: 17 | inner_type_t _id; 18 | 19 | public: 20 | data_access_id_t(inner_type_t id) 21 | : _id(id) 22 | { 23 | } 24 | 25 | data_access_id_t() 26 | : _id(-1) 27 | { 28 | } 29 | 30 | operator inner_type_t() const 31 | { 32 | return _id; 33 | } 34 | }; 35 | } 36 | 37 | #endif // INSTRUMENT_VERBOSE_DATA_ACCESS_ID_HPP 38 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentDebug.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDebug.hpp -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentDependenciesByAccess.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_DEPENDENCIES_BY_ACCESS_HPP 8 | #define INSTRUMENT_VERBOSE_DEPENDENCIES_BY_ACCESS_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentDependenciesByAccess.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_DEPENDENCIES_BY_ACCESS_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentDependenciesByAccessLinks.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_DEPENDENCIES_BY_ACCESS_LINK_HPP 8 | #define INSTRUMENT_VERBOSE_DEPENDENCIES_BY_ACCESS_LINK_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentDependenciesByAccessLinks.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_DEPENDENCIES_BY_ACCESS_LINK_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentDependenciesByGroup.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_DEPENDENCIES_BY_GROUP_HPP 8 | #define INSTRUMENT_VERBOSE_DEPENDENCIES_BY_GROUP_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentDependenciesByGroup.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_DEPENDENCIES_BY_GROUP_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentDependencySubsystemEntryPoints.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentDependencySubsystemEntryPoints.hpp -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentExternalThreadId.hpp: -------------------------------------------------------------------------------- 1 | ../generic_ids/InstrumentExternalThreadId.hpp -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentExternalThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_EXTERNAL_THREAD_LOCAL_DATA_HPP 8 | #define INSTRUMENT_VERBOSE_EXTERNAL_THREAD_LOCAL_DATA_HPP 9 | 10 | 11 | #include "../support/InstrumentStandardExternalThreadLocalData.hpp" 12 | 13 | 14 | namespace Instrument { 15 | using ExternalThreadLocalData = StandardExternalThreadLocalData; 16 | } 17 | 18 | 19 | #endif // INSTRUMENT_VERBOSE_EXTERNAL_THREAD_LOCAL_DATA_HPP 20 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentInitAndShutdown.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_INIT_AND_SHUTDOWN_HPP 8 | #define INSTRUMENT_VERBOSE_INIT_AND_SHUTDOWN_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentInitAndShutdown.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_INIT_AND_SHUTDOWN_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentLeaderThread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_LEADER_THREAD_HPP 8 | #define INSTRUMENT_VERBOSE_LEADER_THREAD_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentLeaderThread.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_LEADER_THREAD_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentMainThread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentMainThread.hpp -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentMemory.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentMemory.hpp -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentPthread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentPthread.hpp -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentReductions.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_REDUCTIONS_HPP 8 | #define INSTRUMENT_VERBOSE_REDUCTIONS_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentReductions.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_REDUCTIONS_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentScheduler.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentScheduler.hpp -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentTaskExecution.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_TASK_EXECUTION_HPP 8 | #define INSTRUMENT_VERBOSE_TASK_EXECUTION_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentTaskExecution.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_TASK_EXECUTION_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentTaskId.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_TASK_ID_HPP 8 | #define INSTRUMENT_VERBOSE_TASK_ID_HPP 9 | 10 | 11 | namespace Instrument { 12 | class task_id_t { 13 | public: 14 | typedef long int inner_type_t; 15 | 16 | private: 17 | inner_type_t _id; 18 | 19 | public: 20 | task_id_t(inner_type_t id) 21 | : _id(id) 22 | { 23 | } 24 | 25 | task_id_t() 26 | : _id(-1) 27 | { 28 | } 29 | 30 | operator inner_type_t() const 31 | { 32 | return _id; 33 | } 34 | }; 35 | } 36 | 37 | #endif // INSTRUMENT_TASK_ID_HPP 38 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentTaskStatus.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_TASK_STATUS_HPP 8 | #define INSTRUMENT_VERBOSE_TASK_STATUS_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentTaskStatus.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_TASK_STATUS_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentTaskWait.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_TASK_WAIT_HPP 8 | #define INSTRUMENT_VERBOSE_TASK_WAIT_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentTaskWait.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_TASK_WAIT_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentTasktypeData.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentTasktypeData.hpp -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentThreadId.hpp: -------------------------------------------------------------------------------- 1 | ../generic_ids/InstrumentThreadId.hpp -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentThreadLocalData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "../null/InstrumentThreadLocalData.hpp" 8 | 9 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentThreadManagement.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_THREAD_MANAGEMENT_HPP 8 | #define INSTRUMENT_VERBOSE_THREAD_MANAGEMENT_HPP 9 | 10 | 11 | #include "InstrumentComputePlaceId.hpp" 12 | #include "instrument/api/InstrumentThreadManagement.hpp" 13 | #include "instrument/generic_ids/GenericIds.hpp" 14 | #include "support/StringSupport.hpp" 15 | 16 | 17 | namespace Instrument { 18 | void createdExternalThread_private(/* OUT */ external_thread_id_t &threadId, std::string const &name); 19 | 20 | template 21 | void createdExternalThread(/* OUT */ external_thread_id_t &threadId, TS... nameComponents) 22 | { 23 | createdExternalThread_private(threadId, StringSupport::compose(nameComponents...)); 24 | } 25 | } 26 | 27 | 28 | #endif // INSTRUMENT_VERBOSE_THREAD_MANAGEMENT_HPP 29 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentTracingPointTypes.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_STATS_TRACING_POINT_TYPES_HPP 8 | #define INSTRUMENT_STATS_TRACING_POINT_TYPES_HPP 9 | 10 | 11 | #include 12 | #include 13 | 14 | 15 | namespace Instrument { 16 | struct tracing_point_type_t { 17 | std::string _description; 18 | std::vector _valueDescriptions; 19 | }; 20 | } 21 | 22 | 23 | #endif // INSTRUMENT_STATS_TRACING_POINT_TYPES_HPP 24 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentUserMutex.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENT_VERBOSE_USER_MUTEX_HPP 8 | #define INSTRUMENT_VERBOSE_USER_MUTEX_HPP 9 | 10 | 11 | #include "instrument/api/InstrumentUserMutex.hpp" 12 | 13 | 14 | #endif // INSTRUMENT_VERBOSE_USER_MUTEX_HPP 15 | -------------------------------------------------------------------------------- /src/instrument/verbose/InstrumentWorkerThread.hpp: -------------------------------------------------------------------------------- 1 | ../null/InstrumentWorkerThread.hpp -------------------------------------------------------------------------------- /src/lowlevel/BoostAssertionFailureHandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | #include "FatalErrorHandler.hpp" 10 | 11 | 12 | #if !defined(NDEBUG) 13 | namespace boost { 14 | void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line) 15 | { 16 | FatalErrorHandler::failIf<>(1, file, ":", line, " ", function, " Boost assertion failure: ", msg, " when evaluating ", expr); 17 | } 18 | 19 | void assertion_failed(char const * expr, char const * function, char const * file, long line) 20 | { 21 | FatalErrorHandler::failIf<>(1, file, ":", line, " ", function, " Boost assertion failure when evaluating ", expr); 22 | } 23 | 24 | } 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /src/lowlevel/CompatSyscalls.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef COMPAT_SYSCALLS_HPP 8 | #define COMPAT_SYSCALLS_HPP 9 | 10 | #include 11 | #include 12 | 13 | // Define gettid for older glibc versions (below 2.30) 14 | #if !__GLIBC_PREREQ(2, 30) 15 | static inline pid_t gettid(void) 16 | { 17 | return (pid_t)syscall(SYS_gettid); 18 | } 19 | #endif // !__GLIBC_PREREQ(2, 30) 20 | 21 | #endif // COMPAT_SYSCALLS_HPP 22 | -------------------------------------------------------------------------------- /src/lowlevel/FatalErrorHandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "FatalErrorHandler.hpp" 8 | 9 | 10 | SpinLock FatalErrorHandler::_errorLock; 11 | SpinLock FatalErrorHandler::_infoLock; 12 | 13 | -------------------------------------------------------------------------------- /src/lowlevel/Padding.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef PADDING_HPP 8 | #define PADDING_HPP 9 | 10 | #include 11 | #include 12 | 13 | // CACHELINE_SIZE is defined by the Nanos6 configure step 14 | #ifndef CACHELINE_SIZE 15 | #warning "Cacheline size is not specified... falling back to safe default (128)" 16 | #define CACHELINE_SIZE 128 17 | #endif 18 | 19 | template 20 | class Padded : public T { 21 | using T::T; 22 | 23 | constexpr static size_t roundup(size_t const x, size_t const y) 24 | { 25 | return (((x + (y - 1)) / y) * y); 26 | } 27 | 28 | uint8_t padding[roundup(sizeof(T), Size)-sizeof(T)]; 29 | 30 | public: 31 | inline T *ptr_to_basetype() 32 | { 33 | return (T *) this; 34 | } 35 | }; 36 | 37 | #endif // PADDING_HPP 38 | -------------------------------------------------------------------------------- /src/lowlevel/threads/ExternalThread.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | 8 | #include "ExternalThread.hpp" 9 | 10 | 11 | __thread ExternalThread *ExternalThread::_currentExternalThread = nullptr; 12 | 13 | -------------------------------------------------------------------------------- /src/lowlevel/threads/ExternalThreadGroup.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | 8 | #include "ExternalThreadGroup.hpp" 9 | 10 | 11 | ExternalThreadGroup *ExternalThreadGroup::_externalThreadGroup = nullptr; 12 | 13 | -------------------------------------------------------------------------------- /src/lowlevel/threads/HelperThread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | 8 | #ifndef HELPER_THREAD_HPP 9 | #define HELPER_THREAD_HPP 10 | 11 | #include "ExternalThread.hpp" 12 | #include "KernelLevelThread.hpp" 13 | 14 | 15 | class HelperThread : public ExternalThread, public KernelLevelThread { 16 | protected: 17 | inline void initializeHelperThread() 18 | { 19 | initializeExternalThread(); 20 | } 21 | 22 | public: 23 | template 24 | HelperThread(TS... nameComponents) 25 | : ExternalThread(nameComponents...), KernelLevelThread() 26 | { 27 | } 28 | 29 | }; 30 | 31 | 32 | #endif // HELPER_THREAD_HPP 33 | 34 | -------------------------------------------------------------------------------- /src/lowlevel/threads/KernelLevelThread.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "KernelLevelThread.hpp" 8 | 9 | 10 | __thread KernelLevelThread *KernelLevelThread::_currentKernelLevelThread(nullptr); 11 | -------------------------------------------------------------------------------- /src/lowlevel/threads/KernelLevelThread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef KERNEL_LEVEL_THREAD_HPP 8 | #define KERNEL_LEVEL_THREAD_HPP 9 | 10 | #include "posix/KernelLevelThread.hpp" 11 | 12 | #endif // KERNEL_LEVEL_THREAD_HPP 13 | -------------------------------------------------------------------------------- /src/memory/AddressSpace.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2021 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef ADDRESS_SPACE_HPP 8 | #define ADDRESS_SPACE_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | class MemoryPlace; 15 | 16 | class AddressSpace { 17 | private: 18 | typedef std::map memory_places_t; 19 | memory_places_t _memoryPlaces; // MemoryPlaces within this AddressSpace 20 | 21 | public: 22 | AddressSpace() 23 | {} 24 | 25 | virtual ~AddressSpace() 26 | {} 27 | 28 | size_t getMemoryPlacesCount() const 29 | { 30 | return _memoryPlaces.size(); 31 | } 32 | 33 | MemoryPlace *getMemoryPlace(unsigned int index) 34 | { 35 | return _memoryPlaces[index]; 36 | } 37 | 38 | void addMemoryPlace(MemoryPlace *memoryPlace); 39 | 40 | std::vector getMemoryPlacesIndexes() const; 41 | 42 | std::vector getMemoryPlaces() const; 43 | }; 44 | 45 | #endif //ADDRESS_SPACE_HPP 46 | -------------------------------------------------------------------------------- /src/memory/allocator/jemalloc/ObjectAllocator.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef OBJECT_ALLOCATOR_HPP 8 | #define OBJECT_ALLOCATOR_HPP 9 | 10 | #include 11 | 12 | template 13 | class ObjectAllocator { 14 | public: 15 | template 16 | static inline T *newObject(ARGS &&... args) 17 | { 18 | return MemoryAllocator::newObject(std::forward(args)...); 19 | } 20 | 21 | static inline void deleteObject(T *ptr) 22 | { 23 | MemoryAllocator::deleteObject(ptr); 24 | } 25 | }; 26 | 27 | #endif // OBJECT_ALLOCATOR_HPP 28 | -------------------------------------------------------------------------------- /src/memory/allocator/malloc/ObjectAllocator.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef OBJECT_ALLOCATOR_HPP 8 | #define OBJECT_ALLOCATOR_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | template 16 | class ObjectAllocator { 17 | public: 18 | template 19 | static inline T *newObject(ARGS &&... args) 20 | { 21 | return MemoryAllocator::newObject(std::forward(args)...); 22 | } 23 | 24 | static inline void deleteObject(T *ptr) 25 | { 26 | MemoryAllocator::deleteObject(ptr); 27 | } 28 | }; 29 | 30 | #endif // OBJECT_ALLOCATOR_HPP 31 | -------------------------------------------------------------------------------- /src/memory/directory/Directory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "Directory.hpp" 8 | 9 | HomeNodeMap Directory::_homeNodes; 10 | MemoryPlace Directory::_directoryMemoryPlace(-42, nanos6_host_device); 11 | -------------------------------------------------------------------------------- /src/monitoring/MonitoringSupport.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef MONITORING_SUPPORT_HPP 8 | #define MONITORING_SUPPORT_HPP 9 | 10 | 11 | #define DEFAULT_COST 1 12 | 13 | #define PREDICTION_UNAVAILABLE -1.0 14 | 15 | 16 | enum monitoring_task_status_t { 17 | // The task is ready to be executed 18 | ready_status = 0, 19 | // The task is being executed 20 | executing_status, 21 | // An aggregation of runtime + pending + blocked 22 | paused_status, 23 | num_status, 24 | null_status = -1 25 | }; 26 | 27 | 28 | #endif // MONITORING_SUPPORT_HPP 29 | -------------------------------------------------------------------------------- /src/scheduling/LocalScheduler.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef LOCAL_SCHEDULER_HPP 8 | #define LOCAL_SCHEDULER_HPP 9 | 10 | #include "SchedulerInterface.hpp" 11 | 12 | class LocalScheduler : public SchedulerInterface { 13 | public: 14 | ~LocalScheduler() 15 | {} 16 | 17 | inline std::string getName() const 18 | { 19 | return "LocalScheduler"; 20 | } 21 | }; 22 | 23 | #endif // LOCAL_SCHEDULER_HPP 24 | -------------------------------------------------------------------------------- /src/scheduling/Scheduler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2021 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "LocalScheduler.hpp" 8 | #include "Scheduler.hpp" 9 | #include "system/RuntimeInfo.hpp" 10 | 11 | SchedulerInterface *Scheduler::_instance; 12 | 13 | void Scheduler::initialize() 14 | { 15 | _instance = new LocalScheduler(); 16 | 17 | assert(_instance != nullptr); 18 | RuntimeInfo::addEntry("scheduler", "Scheduler", _instance->getName()); 19 | } 20 | 21 | void Scheduler::shutdown() 22 | { 23 | delete _instance; 24 | } 25 | -------------------------------------------------------------------------------- /src/scheduling/SchedulerGenerator.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef SCHEDULER_GENERATOR_HPP 8 | #define SCHEDULER_GENERATOR_HPP 9 | 10 | #include 11 | 12 | #include "scheduling/ReadyQueue.hpp" 13 | 14 | class DeviceScheduler; 15 | class HostScheduler; 16 | 17 | class SchedulerGenerator { 18 | public: 19 | static HostScheduler *createHostScheduler( 20 | size_t totalComputePlaces, 21 | SchedulingPolicy policy, 22 | bool enablePriority); 23 | 24 | static DeviceScheduler *createDeviceScheduler( 25 | size_t totalComputePlaces, 26 | SchedulingPolicy policy, 27 | bool enablePriority, 28 | nanos6_device_t deviceType); 29 | }; 30 | 31 | 32 | #endif // SCHEDULER_GENERATOR_HPP 33 | -------------------------------------------------------------------------------- /src/scheduling/SchedulerSupport.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef SCHEDULER_SUPPORT_HPP 8 | #define SCHEDULER_SUPPORT_HPP 9 | 10 | #include 11 | 12 | class Task; 13 | 14 | namespace SchedulerSupport { 15 | 16 | constexpr uint64_t roundup(const uint64_t x, const uint64_t y) 17 | { 18 | return (((x + (y - 1ULL)) / y) * y); 19 | } 20 | 21 | inline uint64_t roundToNextPowOf2(const uint64_t x) 22 | { 23 | return roundup(x, 1ULL << (63 - __builtin_clzll(x))); 24 | } 25 | 26 | inline bool isPowOf2(const uint64_t x) 27 | { 28 | return (__builtin_popcountll(x) == 1); 29 | } 30 | } 31 | 32 | #endif // SCHEDULER_SUPPORT_HPP 33 | -------------------------------------------------------------------------------- /src/scheduling/schedulers/HostUnsyncScheduler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "HostUnsyncScheduler.hpp" 8 | #include "scheduling/ready-queues/DeadlineQueue.hpp" 9 | #include "scheduling/ready-queues/ReadyQueueDeque.hpp" 10 | #include "scheduling/ready-queues/ReadyQueueMap.hpp" 11 | #include "tasks/LoopGenerator.hpp" 12 | #include "tasks/Task.hpp" 13 | 14 | Task *HostUnsyncScheduler::getReadyTask(ComputePlace *computePlace) 15 | { 16 | assert(computePlace != nullptr); 17 | assert(_deadlineTasks != nullptr); 18 | 19 | // Try to get a task with a satisfied deadline 20 | Task *result = _deadlineTasks->getReadyTask(computePlace); 21 | if (result != nullptr) { 22 | return result; 23 | } 24 | 25 | // Check if there is work remaining in the ready queue 26 | return regularGetReadyTask(computePlace); 27 | } 28 | -------------------------------------------------------------------------------- /src/scheduling/schedulers/device/DeviceUnsyncScheduler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "DeviceUnsyncScheduler.hpp" 8 | 9 | Task *DeviceUnsyncScheduler::getReadyTask(ComputePlace *computePlace) 10 | { 11 | return regularGetReadyTask(computePlace); 12 | } 13 | -------------------------------------------------------------------------------- /src/support/GlobalLock.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "GlobalLock.hpp" 8 | 9 | 10 | SpinLock GlobalLock::_lock; 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/support/GlobalLock.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef GLOBAL_LOCK_HPP 8 | #define GLOBAL_LOCK_HPP 9 | 10 | 11 | #include "lowlevel/SpinLock.hpp" 12 | 13 | 14 | class GlobalLock { 15 | private: 16 | static SpinLock _lock; 17 | 18 | public: 19 | static void lock() 20 | { 21 | _lock.lock(); 22 | } 23 | 24 | static void unlock() 25 | { 26 | _lock.unlock(); 27 | } 28 | }; 29 | 30 | 31 | #endif // GLOBAL_LOCK_HPP 32 | -------------------------------------------------------------------------------- /src/support/InstrumentedThread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef INSTRUMENTED_THREAD_HPP 8 | #define INSTRUMENTED_THREAD_HPP 9 | 10 | 11 | #include 12 | 13 | 14 | class InstrumentedThread { 15 | protected: 16 | Instrument::thread_id_t _instrumentationId; 17 | 18 | 19 | public: 20 | Instrument::thread_id_t getInstrumentationId() const 21 | { 22 | return _instrumentationId; 23 | } 24 | 25 | void setInstrumentationId(Instrument::thread_id_t const &instrumentationId) 26 | { 27 | _instrumentationId = instrumentationId; 28 | } 29 | }; 30 | 31 | 32 | #endif // INSTRUMENTED_THREAD_HPP 33 | -------------------------------------------------------------------------------- /src/support/MathSupport.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | 8 | #ifndef MATH_SUPPORT_HPP 9 | #define MATH_SUPPORT_HPP 10 | 11 | class MathSupport { 12 | public: 13 | template 14 | static inline T ceil(T x, T y) 15 | { 16 | return (x + (y - (T) 1)) / y; 17 | } 18 | 19 | template 20 | static inline T closestMultiple(T n, T multipleOf) 21 | { 22 | return ((n + multipleOf - (T) 1) / multipleOf) * multipleOf; 23 | } 24 | }; 25 | 26 | 27 | #endif // MATH_SUPPORT_HPP 28 | 29 | -------------------------------------------------------------------------------- /src/support/Objectified.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | 8 | #ifndef OBJECTIFIED_HPP 9 | #define OBJECTIFIED_HPP 10 | 11 | 12 | template 13 | class Objectified { 14 | T _value; 15 | 16 | public: 17 | Objectified() 18 | : _value(DEFAULT_VALUE) 19 | { 20 | } 21 | 22 | Objectified(T value) 23 | : _value(value) 24 | { 25 | } 26 | 27 | operator T() const 28 | { 29 | return _value; 30 | } 31 | 32 | Objectified &operator++() 33 | { 34 | ++_value; 35 | return *this; 36 | } 37 | 38 | Objectified operator++(int) 39 | { 40 | T result = _value; 41 | _value++; 42 | return Objectified(result); 43 | } 44 | 45 | Objectified &operator--() 46 | { 47 | --_value; 48 | return *this; 49 | } 50 | 51 | Objectified operator--(int) 52 | { 53 | T result = _value; 54 | _value--; 55 | return Objectified(result); 56 | } 57 | }; 58 | 59 | 60 | #endif // OBJECTIFIED_HPP 61 | -------------------------------------------------------------------------------- /src/support/StringLiteral.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef STRING_LITERAL_HPP 8 | #define STRING_LITERAL_HPP 9 | 10 | 11 | class StringLiteral { 12 | private: 13 | char const *_value; 14 | 15 | public: 16 | StringLiteral(char const *value) 17 | : _value(value) 18 | { 19 | } 20 | 21 | operator char const * () const 22 | { 23 | return _value; 24 | } 25 | }; 26 | 27 | 28 | #endif // STRING_LITERAL_HPP 29 | -------------------------------------------------------------------------------- /src/support/config/ConfigChecker.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "support/config/ConfigChecker.hpp" 8 | 9 | 10 | std::string ConfigChecker::_initConditions; 11 | bool ConfigChecker::_initChecked = false; 12 | SpinLock ConfigChecker::_lock; 13 | -------------------------------------------------------------------------------- /src/support/config/toml/from.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2019. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_FROM_HPP 4 | #define TOML11_FROM_HPP 5 | #include "traits.hpp" 6 | 7 | namespace toml 8 | { 9 | 10 | template 11 | struct from; 12 | // { 13 | // static T from_toml(const toml::value& v) 14 | // { 15 | // // User-defined conversions ... 16 | // } 17 | // }; 18 | 19 | } // toml 20 | #endif // TOML11_FROM_HPP 21 | -------------------------------------------------------------------------------- /src/support/config/toml/into.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2019. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_INTO_HPP 4 | #define TOML11_INTO_HPP 5 | #include "traits.hpp" 6 | 7 | namespace toml 8 | { 9 | 10 | template 11 | struct into; 12 | // { 13 | // static toml::value into_toml(const T& user_defined_type) 14 | // { 15 | // // User-defined conversions ... 16 | // } 17 | // }; 18 | 19 | } // toml 20 | #endif // TOML11_INTO_HPP 21 | -------------------------------------------------------------------------------- /src/system/APICheck.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef API_CHECK_HPP 8 | #define API_CHECK_HPP 9 | 10 | 11 | bool nanos6_api_has_been_checked_successfully(); 12 | 13 | 14 | #endif // API_CHECK_HPP 15 | -------------------------------------------------------------------------------- /src/system/CUDADeviceAPI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "hardware/device/cuda/CUDAAccelerator.hpp" 8 | #include "tasks/Task.hpp" 9 | 10 | #include 11 | 12 | // If called from the context of a CUDA device outlined task function, 13 | // returns the CUDA stream handle the runtime has allocated to the task. 14 | // This is useful to be able to encapsulate e.g. a cuBLAS library call 15 | // inside an OmpSs CUDA task. 16 | extern "C" 17 | cudaStream_t nanos6_get_current_cuda_stream(void) 18 | { 19 | Task *currentTask = CUDAAccelerator::getCurrentTask(); 20 | nanos6_cuda_device_environment_t &env = currentTask->getDeviceEnvironment().cuda; 21 | return env.stream; 22 | } 23 | -------------------------------------------------------------------------------- /src/system/ClusterAPI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2018-2021 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | 10 | extern "C" int nanos6_in_cluster_mode(void) 11 | { 12 | return false; 13 | } 14 | 15 | extern "C" int nanos6_is_master_node(void) 16 | { 17 | return true; 18 | } 19 | 20 | extern "C" int nanos6_get_cluster_node_id(void) 21 | { 22 | return 0; 23 | } 24 | 25 | extern "C" int nanos6_get_num_cluster_nodes(void) 26 | { 27 | return 1; 28 | } 29 | 30 | extern "C" void *nanos6_dmalloc(size_t, nanos6_data_distribution_t, size_t, size_t *) 31 | { 32 | return nullptr; 33 | } 34 | 35 | extern "C" void nanos6_dfree(void *, size_t) 36 | { 37 | } 38 | 39 | extern "C" void *nanos6_lmalloc(size_t) 40 | { 41 | return nullptr; 42 | } 43 | 44 | extern "C" void nanos6_lfree(void *, size_t) 45 | { 46 | } 47 | -------------------------------------------------------------------------------- /src/system/ConfigAPI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include "support/config/ConfigChecker.hpp" 13 | 14 | 15 | extern "C" void nanos6_config_assert(const char *config_conditions) 16 | { 17 | assert(config_conditions != nullptr); 18 | 19 | std::string conditions(config_conditions); 20 | if (conditions.empty()) 21 | return; 22 | 23 | ConfigChecker::addAssertConditions(conditions); 24 | } 25 | -------------------------------------------------------------------------------- /src/system/EventsAPI.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef EVENTS_API_HPP 8 | #define EVENTS_API_HPP 9 | 10 | #include "tasks/Task.hpp" 11 | 12 | namespace EventsAPI { 13 | 14 | //! \brief Increase the current task's events to prevent the release of dependencies 15 | //! 16 | //! \param increment The value to be incremented (must be positive or zero) 17 | void increaseCurrentTaskEvents(unsigned int increment); 18 | 19 | //! \brief Decrease the task's events and release the dependencies if required 20 | //! 21 | //! \param task The task to decrease the events 22 | //! \param decrement The value to be decremented (must be positive or zero) 23 | void decreaseTaskEvents(Task *task, unsigned int decrement); 24 | } 25 | 26 | #endif // EVENTS_API_HPP 27 | -------------------------------------------------------------------------------- /src/system/LintAPI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | 10 | 11 | extern "C" void nanos6_lint_ignore_region_begin(void) 12 | { 13 | return; 14 | } 15 | 16 | 17 | extern "C" void nanos6_lint_ignore_region_end(void) 18 | { 19 | return; 20 | } 21 | 22 | 23 | extern "C" void nanos6_lint_register_alloc( 24 | __attribute__((unused)) void *base_address, 25 | __attribute__((unused)) unsigned long size 26 | ) 27 | { 28 | return; 29 | } 30 | 31 | 32 | extern "C" void nanos6_lint_register_free( 33 | __attribute__((unused)) void *base_address 34 | ) 35 | { 36 | return; 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/system/MonitoringAPI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | #include "monitoring/Monitoring.hpp" 10 | 11 | 12 | extern "C" double nanos6_get_predicted_elapsed_time(void) 13 | { 14 | return Monitoring::getPredictedElapsedTime(); 15 | } 16 | -------------------------------------------------------------------------------- /src/system/PollingAPI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2021 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | #include "lowlevel/FatalErrorHandler.hpp" 10 | 11 | 12 | extern "C" void nanos6_register_polling_service(char const *, nanos6_polling_service_t, void *) 13 | { 14 | FatalErrorHandler::fail("Polling services API is no longer supported"); 15 | } 16 | 17 | extern "C" void nanos6_unregister_polling_service(char const *, nanos6_polling_service_t, void *) 18 | { 19 | FatalErrorHandler::fail("Polling services API is no longer supported"); 20 | } 21 | -------------------------------------------------------------------------------- /src/system/RuntimeInfo.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "RuntimeInfo.hpp" 8 | 9 | 10 | 11 | SpinLock RuntimeInfo::_lock; 12 | std::vector RuntimeInfo::_contents; 13 | 14 | -------------------------------------------------------------------------------- /src/system/RuntimeInfoEssentials.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef RUNTIME_INFO_ESSENTIALS_HPP 8 | #define RUNTIME_INFO_ESSENTIALS_HPP 9 | 10 | 11 | class RuntimeInfoEssentials { 12 | public: 13 | static void initialize(); 14 | static void shutdown(); 15 | }; 16 | 17 | 18 | #endif // RUNTIME_INFO_ESSENTIALS_HPP 19 | -------------------------------------------------------------------------------- /src/system/TaskInfoAPI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | #include "monitoring/Monitoring.hpp" 10 | #include "tasks/TaskInfoManager.hpp" 11 | 12 | 13 | extern "C" void nanos6_register_task_info(nanos6_task_info_t *task_info) 14 | { 15 | TaskInfoManager::registerTaskInfo(task_info); 16 | 17 | Monitoring::registerTasktype(task_info); 18 | } 19 | -------------------------------------------------------------------------------- /src/system/TaskWait.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef TASK_WAIT_HPP 8 | #define TASK_WAIT_HPP 9 | 10 | namespace TaskWait { 11 | 12 | //! \brief Block current task and wait for its childs to complete 13 | //! 14 | //! \param[in] invocationSource A representative string indicating the calling location 15 | //! \param[in] fromUserCode Indicates whether this function is called from user or runtime code 16 | void taskWait(char const *invocationSource, bool fromUserCode = false); 17 | 18 | } 19 | 20 | #endif // TASK_WAIT_HPP 21 | -------------------------------------------------------------------------------- /src/system/debug/RuntimeVersionAPI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | #include "version/VersionInfo.hpp" 9 | 10 | 11 | char const *nanos6_get_runtime_version(void) 12 | { 13 | return nanos6_version; 14 | } 15 | 16 | char const *nanos6_get_runtime_copyright(void) 17 | { 18 | return nanos6_copyright; 19 | } 20 | 21 | char const *nanos6_get_runtime_license(void) 22 | { 23 | return nanos6_license; 24 | } 25 | 26 | char const *nanos6_get_runtime_full_license(void) 27 | { 28 | return nanos6_full_license; 29 | } 30 | 31 | char const *nanos6_get_runtime_branch(void) 32 | { 33 | return nanos6_branch; 34 | } 35 | 36 | char const *nanos6_get_runtime_patches(void) 37 | { 38 | return nanos6_patches; 39 | } 40 | 41 | char const *nanos6_get_runtime_compiler_version(void) 42 | { 43 | return nanos6_compiler_version; 44 | } 45 | 46 | char const *nanos6_get_runtime_compiler_flags(void) 47 | { 48 | return nanos6_compiler_flags; 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/tasks/Task.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2021-2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "nanos6.h" 8 | 9 | #include "Task.hpp" 10 | #include "executors/threads/WorkerThread.hpp" 11 | #include "lowlevel/FatalErrorHandler.hpp" 12 | 13 | 14 | void Task::runOnready(WorkerThread *currentThread) 15 | { 16 | assert(currentThread != nullptr); 17 | assert(_taskInfo != nullptr); 18 | assert(_taskInfo->onready_action != nullptr); 19 | 20 | Task *currentTask = currentThread->unassignTask(); 21 | currentThread->setTask(this); 22 | 23 | // Execute the onready action function 24 | _taskInfo->onready_action(_argsBlock); 25 | 26 | currentThread->unassignTask(); 27 | currentThread->setTask(currentTask); 28 | } 29 | -------------------------------------------------------------------------------- /src/tasks/TaskDebuggingInterface.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef TASK_DEBUGGING_INTERFACE_HPP 8 | #define TASK_DEBUGGING_INTERFACE_HPP 9 | 10 | #include "Task.hpp" 11 | 12 | 13 | class TaskDebuggingInterface { 14 | public: 15 | static Task *getRuntimeTask(void *taskHandle) 16 | { 17 | return (Task *) taskHandle; 18 | } 19 | }; 20 | 21 | 22 | #endif // TASK_DEBUGGING_INTERFACE_HPP 23 | -------------------------------------------------------------------------------- /src/tasks/TaskInfoManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "TaskInfoManager.hpp" 8 | 9 | #ifdef USE_CUDA 10 | #include "hardware/device/cuda/CUDAFunctions.hpp" 11 | #endif 12 | 13 | TaskInfoManager::task_info_map_t TaskInfoManager::_taskInfos; 14 | SpinLock TaskInfoManager::_lock; 15 | 16 | void TaskInfoManager::checkDeviceTaskInfo(__attribute__((unused)) const nanos6_task_info_t *taskInfo) 17 | { 18 | // TODO: This should be hidden inside the CUDA module 19 | #ifdef USE_CUDA 20 | // Check whether is a CUDA task 21 | if (taskInfo->implementations[0].device_type_id != nanos6_cuda_device) 22 | return; 23 | 24 | // There are CUDA tasks, initialize the CUDA module 25 | if (!CUDAFunctions::initialize()) 26 | return; 27 | #endif 28 | } 29 | -------------------------------------------------------------------------------- /src/tasks/Taskloop.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "Taskloop.hpp" 8 | #include "tasks/LoopGenerator.hpp" 9 | 10 | void Taskloop::body(nanos6_address_translation_entry_t *translationTable) 11 | { 12 | if (!isTaskloopSource()) { 13 | getTaskInfo()->implementations[0].run(getArgsBlock(), &getBounds(), translationTable); 14 | } else { 15 | while (getIterationCount() > 0) { 16 | LoopGenerator::createTaskloopExecutor(this, _bounds); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/version/VersionInfo.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2017 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef VERSION_INFO_HPP 8 | #define VERSION_INFO_HPP 9 | 10 | 11 | extern const char * nanos6_compiler_version; 12 | extern const char * nanos6_compiler_flags; 13 | extern const char * nanos6_version; 14 | extern const char * nanos6_copyright; 15 | extern const char * nanos6_license; 16 | extern const char * nanos6_full_license; 17 | extern const char * nanos6_branch; 18 | extern const char * nanos6_patches; 19 | 20 | 21 | #endif // VERSION_INFO_HPP 22 | -------------------------------------------------------------------------------- /tests/UtilsCUDA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CUDA_UTILS_HPP 8 | #define CUDA_UTILS_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #define CUDA_CHECK(f...) \ 15 | { \ 16 | const cudaError_t __err = f; \ 17 | if (__err != cudaSuccess) { \ 18 | printf("Error: '%s' [%s:%i]: %i\n",#f,__FILE__,__LINE__,__err); \ 19 | exit(EXIT_FAILURE); \ 20 | } \ 21 | } 22 | 23 | #endif // CUDA_UTILS_HPP 24 | -------------------------------------------------------------------------------- /tests/directive_based/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | -------------------------------------------------------------------------------- /tests/directive_based/cuda/cuda-kernargs-kernel.cu: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "cuda-kernargs.hpp" 8 | 9 | __global__ void kernargsKernel(int n, int bs, const int *ptr, 10 | int param1, float param2, int32_t param3, double param4, 11 | uint64_t param5, int8_t param6, size_t param7, void *param8, 12 | int *sentinel, int *gError 13 | ) { 14 | // Check if there is any mismatch 15 | int error = (param1 != paramVal1 || param2 != paramVal2 16 | || param3 != paramVal3 || param4 != paramVal4 17 | || param5 != paramVal5 || param6 != paramVal6 18 | || param7 != paramVal7 || param8 != (void *) ptr); 19 | 20 | // Add the error boolean to the global error counter 21 | atomicAdd(gError, error); 22 | } 23 | -------------------------------------------------------------------------------- /tests/directive_based/cuda/cuda-ndrange-kernel.cu: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "cuda-ndrange.hpp" 8 | 9 | __global__ void ndrangeKernel( 10 | int n1, int n2, int n3, 11 | int t1, int t2, int t3, 12 | int *gridSizes, int *blockSizes 13 | ) { 14 | if (blockIdx.x == 0 && threadIdx.x == 0) { 15 | gridSizes[0] = gridDim.x; 16 | gridSizes[1] = gridDim.y; 17 | gridSizes[2] = gridDim.z; 18 | blockSizes[0] = blockDim.x; 19 | blockSizes[1] = blockDim.y; 20 | blockSizes[2] = blockDim.z; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/directive_based/cuda/cuda-ndrange.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CUDA_NDRANGE_HPP 8 | #define CUDA_NDRANGE_HPP 9 | 10 | #ifdef __cplusplus 11 | extern "C" 12 | { 13 | #endif 14 | 15 | #pragma oss task device(cuda) ndrange(3, n1, n2, n3, t1, t2, t3) out([3]gridSizes) out([3]blockSizes) 16 | __global__ void ndrangeKernel( 17 | int n1, int n2, int n3, 18 | int t1, int t2, int t3, 19 | int *gridSizes, int *blockSizes); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif // CUDA_NDRANGE_HPP 26 | -------------------------------------------------------------------------------- /tests/directive_based/cuda/cuda-saxpy-kernel.cu: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | #include "cuda-saxpy.hpp" 10 | 11 | 12 | __global__ void saxpyCUDAKernel(long int n, double a, const double* x, double* y, bool if0) 13 | { 14 | long int i = blockIdx.x * blockDim.x + threadIdx.x; 15 | if (i < n) y[i] = a * x[i] + y[i]; 16 | } 17 | -------------------------------------------------------------------------------- /tests/directive_based/cuda/cuda-saxpy.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2019-2020 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CUDA_SAXPY_HPP 8 | #define CUDA_SAXPY_HPP 9 | 10 | #ifdef __cplusplus 11 | extern "C" 12 | { 13 | #endif 14 | 15 | #pragma oss task in([n]x) inout([n]y) if(!if0) device(cuda) ndrange(1, n, 128) 16 | __global__ void saxpyCUDAKernel(long int n, double a, const double* x, double* y, bool if0); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif // CUDA_SAXPY_HPP 23 | -------------------------------------------------------------------------------- /tests/directive_based/cuda/cuda-shmem-kernel.cu: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "cuda-shmem.hpp" 8 | 9 | __global__ void shmemKernel(int n, int bs) 10 | { 11 | extern __shared__ int shmem[]; 12 | 13 | int *arrayA = (int *) &shmem[0]; 14 | double *arrayB = (double *) &arrayA[bs]; 15 | 16 | int index = threadIdx.x; 17 | arrayA[index] = index; 18 | arrayB[index] = index; 19 | } 20 | -------------------------------------------------------------------------------- /tests/directive_based/cuda/cuda-shmem.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include "cuda-shmem.hpp" 12 | 13 | #include "TestAnyProtocolProducer.hpp" 14 | 15 | 16 | TestAnyProtocolProducer tap; 17 | 18 | int main() { 19 | tap.registerNewTests(1); 20 | tap.begin(); 21 | 22 | const int n = 1*1024*1024; 23 | const int bs = 128; 24 | 25 | // Launch a single kernel with the specific shared memory 26 | shmemKernel(n, bs); 27 | #pragma oss taskwait 28 | 29 | tap.success("The shared memory clause is respected"); 30 | tap.end(); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /tests/directive_based/cuda/cuda-shmem.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #ifndef CUDA_SHMEM_HPP 8 | #define CUDA_SHMEM_HPP 9 | 10 | #include 11 | #include 12 | 13 | #pragma oss task device(cuda) ndrange(1, n, bs) shmem(bs*(sizeof(int)+sizeof(double))) 14 | __global__ void shmemKernel(int n, int bs); 15 | 16 | #endif // CUDA_SHMEM_HPP 17 | -------------------------------------------------------------------------------- /tests/directive_based/numa/numa-off.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2024 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | #include "TestAnyProtocolProducer.hpp" 10 | 11 | TestAnyProtocolProducer tap; 12 | 13 | 14 | int main() 15 | { 16 | nanos6_wait_for_full_initialization(); 17 | 18 | tap.registerNewTests(1); 19 | tap.begin(); 20 | 21 | int enabled = nanos6_is_numa_tracking_enabled(); 22 | tap.evaluate( 23 | !enabled, 24 | "Check that NUMA tracking is disabled" 25 | ); 26 | 27 | tap.end(); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /tests/directive_based/numa/numa-on.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2024 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | 9 | #include "TestAnyProtocolProducer.hpp" 10 | 11 | TestAnyProtocolProducer tap; 12 | 13 | 14 | int main() 15 | { 16 | nanos6_wait_for_full_initialization(); 17 | 18 | nanos6_bitmask_t bitmask; 19 | nanos6_bitmask_set_wildcard(&bitmask, NUMA_ANY_ACTIVE); 20 | 21 | if (nanos6_count_setbits(&bitmask) == 1) { 22 | tap.registerNewTests(1); 23 | tap.begin(); 24 | tap.skip("This test does not work with just 1 active NUMA node"); 25 | tap.end(); 26 | return 0; 27 | } 28 | 29 | tap.registerNewTests(1); 30 | tap.begin(); 31 | 32 | nanos6_bitmask_set_wildcard(&bitmask, NUMA_ALL); 33 | 34 | int enabled = nanos6_is_numa_tracking_enabled(); 35 | tap.evaluate( 36 | enabled, 37 | "Check that NUMA tracking is enabled" 38 | ); 39 | 40 | tap.end(); 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /tests/directive_based/reductions/red-firstprivate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2015-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #include "TestAnyProtocolProducer.hpp" 11 | 12 | 13 | #define N 1000 14 | 15 | TestAnyProtocolProducer tap; 16 | 17 | int main() 18 | { 19 | int n = N; 20 | 21 | assert(n > 0); 22 | 23 | tap.registerNewTests(1); 24 | tap.begin(); 25 | 26 | int x = 0; 27 | #pragma oss task firstprivate(x) 28 | { 29 | for (int i = 0; i < n; ++i) 30 | { 31 | #pragma oss task reduction(+: x) 32 | { 33 | x++; 34 | } 35 | } 36 | 37 | #pragma oss task in(x) 38 | { 39 | std::ostringstream oss; 40 | oss << "Expected reduction result: x (" << x << ") == " << n; 41 | tap.evaluate(x == n, oss.str()); 42 | } 43 | } 44 | #pragma oss taskwait 45 | 46 | tap.end(); 47 | 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /tests/directive_based/taskloop/taskloop-nonpod.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2020-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include "TestAnyProtocolProducer.hpp" 12 | 13 | #define N 100 14 | 15 | TestAnyProtocolProducer tap; 16 | 17 | int main() 18 | { 19 | std::vector v(N, N); 20 | int i; 21 | 22 | tap.registerNewTests(1); 23 | tap.begin(); 24 | 25 | #pragma oss taskloop firstprivate(v) 26 | for (i = 0; i < N; ++i) { 27 | v[i]++; 28 | } 29 | #pragma oss taskwait 30 | 31 | bool correct = true; 32 | for (i = 0; i < N; ++i) { 33 | if (v[i] != N) 34 | correct = false; 35 | } 36 | 37 | tap.evaluate(correct, "Program finished correctly"); 38 | tap.end(); 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /tests/directive_based/taskloop/taskloop-wait.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Nanos6 and is licensed under the terms contained in the COPYING file. 3 | 4 | Copyright (C) 2022-2023 Barcelona Supercomputing Center (BSC) 5 | */ 6 | 7 | #include "Atomic.hpp" 8 | #include "TestAnyProtocolProducer.hpp" 9 | 10 | #define N 1000 11 | 12 | TestAnyProtocolProducer tap; 13 | 14 | int main() 15 | { 16 | Atomic var(0); 17 | 18 | tap.registerNewTests(1); 19 | tap.begin(); 20 | 21 | #pragma oss taskloop grainsize(1) concurrent(var) wait 22 | for (int i = 0; i < N; ++i) { 23 | #pragma oss taskloop grainsize(1) shared(var) 24 | for (int j = 0; j < N; ++j) { 25 | ++var; 26 | } 27 | } 28 | 29 | #pragma oss task in(var) 30 | { 31 | tap.evaluate(var.load() == N*N, "Program finished correctly"); 32 | } 33 | 34 | #pragma oss taskwait 35 | 36 | tap.end(); 37 | return 0; 38 | } 39 | --------------------------------------------------------------------------------