Appearance
Upgrading
What changes for a program, release by release, newest first. New optional arguments are always appended: existing calls compile unchanged. The full list of commits is in the changelog.
Unreleased
- Copies run on the device where the buffer lives (#8).
dev_memcpy_to_device/dev_memcpy_from_devicelook the device argument up in the allocation registry (the whole buffer or a contiguous section) and copy on its device: before, OpenMP always usedmydevand OpenACC the current device, wrong for a buffer on another device. Memory not allocated by FUNDAL, and every copy under policyoff, is copied as before. - New optional
ierr(last argument) on the copies, also the transposed ones. New codesFUNDAL_ERR_NOT_CONTIGUOUS(105: strided device argument) andFUNDAL_ERR_MEMCPY_FAILED(106: the OpenMP runtime reported a failure, which was silently ignored before). A device range beyond the end of its allocation returns 103. Behaviour change: withoutierr, a strided device argument or a range beyond its allocation now writes aFUNDAL warning(policywarn) or stops (policyerror); a failed OpenMP copy stops (except under policyoff). - Strided host arguments are copied correctly: the host argument is declared
contiguous, so the compiler passes a strided host section through a temporary. Before, the bytes after its first element were copied. dev_set_device_numupdatesmydevin every backend, so aftercall dev_set_device_num(1)OpenMP allocates and copies on device 1, as OpenACC already did (before, OpenMP kept using the oldmydev). The usualmydev = dev_get_device_num()after the call is now redundant and harmless. On OpenMP the routine is no longer a rename ofomp_set_default_device:dev_set_device_num(dev_num=1)now compiles, the OpenMP keyworddevice_num=does not.
2.1.4 and 2.1.5
- CMake and fpm builds.
CMakeLists.txtbuilds the library and the tests (-DFUNDAL_BACKEND=none|oac|omp,-DFUNDAL_GPU,-DFUNDAL_MPI=ON) and installs a package:find_package(FUNDAL)and linkFUNDAL::fundal, which carries the backend macros and offload flags.fpm.tomlbuilds the library in the compile-time CPU mode (a backend through--flag), without the MPI handler. See Installation. Nothing changes for FoBiS and make builds. - 2.1.5 shortens test source lines over 132 columns, which gfortran 13 rejects (the CMake build compiles the tests).
2.1.3
- make builds FUNDAL again. The makefile was a stale export that could not build the current sources. It now mirrors the fobos templates:
make COMPILER=gnu|nvf|ifx|amd BACKEND=none|oac|omp [GPU=...] [MPI=1], output inbuild/<COMPILER>-<BACKEND>/(libfundal.a,mod/), never in FoBiS'sexe/. See Installation. FUNDAL_DEVICE_HOSTandFUNDAL_DEVICE_GPUare exported, and defined in every build: compare the result ofdev_get_device_typeon OpenMP with them instead of 0 and 1.mpih_object%initialize(..., require_device): the new optional argument is passed todev_init, so an MPI code can forbid the host fallback on every rank.dev_error_message(ierr)(new) returns the description of an error code. The codes 101-104 are now defined in one place (fundal_env) and re-exported under the same names: existingusestatements are unaffected.dev_assign_to_devicewithoutierrreports the actual error. Under policyerror, adstnot allocated by FUNDAL (code 103: nothing is freed or allocated) stopped with "failed to allocate device memory"; it now printsFUNDAL error: dev_assign_to_device: <description>and stops withFUNDAL: dev_assign_to_device failed.- Tests exit non-zero on failure. Several tests ended a failed check with a plain
stop(exit status 0), so the test runner and CI counted them as passed; they now useerror stop 1. - fobos: the AMD and Intel laplace rules are now
build-laplace-omp-amdandbuild-laplace-omp-ifx, the[modes]list matches the defined modes, and every rule uses the double-dashfobisCLI.
2.1.2
The allocation registry: every structured allocation is recorded (address, size, device, label).
dev_freefrees a buffer on the device where it was allocated. Before, OpenACC freed on the current device, which was undefined behaviour when another device was current; OpenMP freed ondev_id.dev_freedetects misuse: a pointer that is not a live FUNDAL allocation (double free through an alias, section, foreign pointer) and adev_idthat contradicts the recorded device. Behaviour change: under the default policy (warn) a misuse now writes aFUNDAL warningon standard error, then behaves as before.FUNDAL_REGISTRY=offrestores the old behaviour and output exactly;FUNDAL_REGISTRY=errormakes misuse fatal.dev_free(fptr, dev_id, ierr): new optionalierrreturnsFUNDAL_ERR_NOT_REGISTEREDorFUNDAL_ERR_DEV_ID_MISMATCHand frees nothing in that case.dev_alloc/dev_alloc_replace: new optionallabel. On OpenACC adev_iddifferent from the current device is reported by a warning (it was silently ignored).dev_alloc_replaceno longer requires the new buffer on the device of the old one:dev_idis the device of the new buffer. Under the policyerror, freeing an unknown pointer returnsFUNDAL_ERR_NOT_REGISTEREDinierr.- New:
dev_alloc_report,dev_set_registry_policy,dev_get_alloc_stats(..., dev_id), the constantsFUNDAL_REGISTRY_*,FUNDAL_ERR_NOT_REGISTERED,FUNDAL_ERR_DEV_ID_MISMATCH.
2.1.1
The host fallback is explicit.
dev_init(local_rank, require_device, ierr): new optionalrequire_deviceandierr.- Behaviour change: a device build that finds no device writes a warning on standard error (once), and
dev_is_host_fallback()(new) returns.true.. Withrequire_device=.true., a non-hostACC_DEVICE_TYPEorOMP_TARGET_OFFLOAD=MANDATORY,dev_initnow fails instead of running on the host:FUNDAL_ERR_NO_DEVICEinierr,error stopwithout it. Jobs that set these variables on GPU-less nodes stop atdev_init. ACC_DEVICE_TYPE=hostandOMP_TARGET_OFFLOAD=DISABLEDrequest the host explicitly: no warning.dev_initcan be called twice under gfortran (OpenACC is initialized once); on OpenMP,dev_init(local_rank=...)with no device no longer divides by zero. The CPU-modedev_inittakes the same arguments.
See Host fallback.
2.1.0
dev_alloc_replace(new): frees an associated pointer, then allocates.dev_allockeeps pointer-allocatesemantics: calling it on an associated pointer leaks its buffer.dev_get_alloc_stats(new): live structured allocations and bytes, on every backend.dev_assign_to_device(dst, src, ierr): new optionalierr; it now reallocates throughdev_alloc_replace, and an allocation failure is anerror stopwithoutierr(it used to write through a null pointer).dev_freeon a disassociated pointer is a no-op.dev_memory_total(new global): total device memory.dev_memory_availis, and was, the free memory atdev_init; size problems from the total.- OpenMP:
dev_initnow selects the device (it did nothing) and takeslocal_rank;dev_get_device_typereturns the host/GPU distinction; withDEV_HIP(AMD) the device memory and properties come from the HIP runtime. - Transposed copies:
dev_memcpy_from_devicewith bounds (bb,tb) and a host buffer; the argument order of the transposition inside the transposed copies was fixed. bytes_sizeno longer overflows for arrays of more than 2³¹-1 elements.