What are the available precision of system clock for Java 8 and 11 in each platform (windows, macOS, Linux)? - java-time

I'm aware that Java 8 (Oracle) system Clock implementation is limited to milliseconds at most, and that Java 9+ fixed that so in principle could get up to nanoseconds from the underlying clock. But then the underlying clock resolution may be ticking in steps of 1000ns or 100ns or 10ms, etc.
I know that in macOS Mojave the Java 8 clock give me resolution of 1ms and with Java 11 the resolution is 1ns
System.out.println(Instant.now()); // macOS Mojave Java 8 : 2019-11-15T09:04:32.714Z
System.out.println(Instant.now()); // macOS Mojave Java 11: 2019-11-15T09:01:30.867915Z
Is there a list of the actual precision / accuracy / resolutions per Java platform and OS?

Java 8
Up to milliseconds
Windows 10:
Linux 2.4: 10 ms (if I interpret right time(7))
Linux 2.6:
macOS Mojave: 1ms resolution
Java 11
Windows 10:
Linux 2.4:
Linux 2.6:
macOS Mojave: 1ns resolution

Related

Which version of arm gnu toolchain should I use to run on Rpi 4B?

I want to use Raspberry Pi 4B to compile code for stm32. Therefore I download the "AArch64 Linux hosted cross toolchains" version of arm-none-eabi from this website. Then I scp to Rpi and unzip it.
But I cannot execute it. The shell told me that cannot execute binary file: Exec format error. Did I download the worng version?
The architecture of Rpi is "armv7l" and the OS I'm using is Pi OS(buster). I thought it belongs to "AArch64 Linux hosted".
Thank you ~
That is ARM v7 architecture.
IIRC, the raspi hardware is armv8 capable machines, but RPI OS runs in aarch32 mode, which is compatibility mode for armv7.
You can also check cpuinfo to be sure about it.
On an ARMv7 kernel/OS(aarch32), armv8 applications cannot be run, but on armv8(aarch64) kernel/OS armv7 applications can be run in aarch32 mode.
Refer ARM's Learn the architecture: Aarch64 Exception Model for more details.
pi#raspberrypi:~ $ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 1
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
the stm is either armv6-m, arv7-m or one of the armv8-ms. The pi itself is armv8. You either need to run the pi in 32 bit aarch32 mode and use a native compiler or use a cross compiler. aarch64 is armv8-a (arm 64 bit, the armv7-a is the aarch32 compatibility mode).
So you will want to get arm-none-eabi, which you claim but you also claimed aarch64 if it were aarch64 then it would be aarch64-none-eabi or some such name.
Like any other computer you can just get or build for (not hard to build gnu toolchain from sources) arm (32 bit) and get the one that can build for stm32.
gcc version 3.x.x to the present, technically, can build code that will run on an stm32.
If you plan to use a C library then even though you can use the native toolchain on an armv7 based linux on the pi, it is arm-whatever-linux-gnueabi not arm-whatever-eabi and may not work for you.
Just get arm-none-eabi based toolchain, use the proper command line options, and be done with it.

Selecting OpenCL CPU platform in Compute.scala

I installed 3 different OpenCL runtimes on my laptop:
NVIDIA CUDA OpenCL on GPU
Intel OpenCL SDK on CPU
POCL (also on CPU)
As a result, here is a part of the result of clinfo:
$ clinfo
Number of platforms 3
Platform Name Portable Computing Language
Platform Vendor The pocl project
Platform Version OpenCL 1.2 pocl 1.1 None+Asserts, LLVM 6.0.0, SPIR, SLEEF, DISTRO, POCL_DEBUG
...
Platform Name Intel(R) OpenCL
Platform Vendor Intel(R) Corporation
Platform Version OpenCL 1.2 LINUX
...
Platform Name NVIDIA CUDA
Platform Vendor NVIDIA Corporation
Platform Version OpenCL 1.2 CUDA 9.0.282
Now I want to use the Compute.scala Scala library to perform NDArray computations on GPU and CPU (based on the LWJGL library.
The device type is selected using the following import line at the beginning of the program:
import com.thoughtworks.compute.gpu._ // for GPU
// OR
import com.thoughtworks.compute.cpu._ // for CPU
After a quick test, my code runs fine with both device types. However, how am I supposed to know WHICH platform is running when choosing CPU? Is it the Intel OpenCL platform, or POCL?
By looking at the code of the library, I suspect it just picks the first CPU platform in the platform list.
line with OpenCL.UseAllCpuDevices (https://github.com/ThoughtWorksInc/Compute.scala/blob/742d595e5eb56f4051edfc310f64e0f9dbab5ac1/cpu/src/main/scala/com/thoughtworks/compute/cpu.scala#L109)
line platformIds.collectFirst { ... (https://github.com/ThoughtWorksInc/Compute.scala/blob/742d595e5eb56f4051edfc310f64e0f9dbab5ac1/OpenCL/src/main/scala/com/thoughtworks/compute/OpenCL.scala#L363)
So my questions are:
How do I know which CPU platform is being used?
How can I select the platform I want to use in Compute.scala?
Maybe it is necessary to "disable" one of the platforms. If it's the case, how can I do that?
Thank you.
I found a quick-and-dirty way to switch between platforms: I simply rename the ICD file in /etc/OpenCL/vendors/ to "disable" it, so that only the platform I want is detected (can be checked with clinfo).
For example $ sudo mv /etc/OpenCL/vendors/pocl.icd /etc/OpenCL/vendors/pocl.icd_ to use intel64 (the other available CPU platform) instead of pocl, and vice-versa for using pocl instead of intel64.
If someone has a more clean and programmatic way to solve this, their are welcome!

Where can I find a list of 'os' and 'dist' options for Travis-CI / Multi OS Build Matrix

Per the Travis-CI documentation you can run tests on different operating systems and distributions amongst them.
A the time of writing, a Google search doesn't turn up a list of all the possible os and dist options. All one has to go from is the following example which provides the following under the build matrix sub heading:
There are many options available and using the matrix.include key is
essential to include any specific entries. For example, this matrix
would route builds to the Trusty beta build environment and to an OS X
image using Xcode 7.2:
matrix:
include:
- os: linux
dist: trusty
sudo: required
- os: osx
osx_image: xcode7.2
Yet there's no guidance on what options are available for the os, dist, or osx_image keys. Does anyone know where to find these values?
If you take a look at The Build Environment, the "Virtualization environments" section contains a table listing the different operating systems Travis CI currently supports. Currently (2016-08-15) that includes:
Ubuntu 12.04 LTS Server Edition 64 bit (without sudo)
Ubuntu 12.04 LTS Server Edition 64 bit (with sudo)
OS X Mavericks
Ubuntu 14.04 LTS Server Edition 64 bit (with sudo)
As it also states, the Ubuntu 12.04 LTS Server image is the default, so you can only switch to one other Linux distribution, namely trusty. Given that the dist property only have one possible value, I guess the need to "list all possible values" is limited.
However, for OS X, the above is not the end of the story. The documentation about the OS X environment lets us know that the osx_image property can have a range of different values that will change both the version of Xcode as well as the version of OS X:
OS X 10.11
osx_image: xcode8 (Xcode 8 beta 4)
osx_image: xcode7.3 (Xcode 7.3.1)
osx_image: xcode7.2 (Xcode 7.2.1)
OS X 10.10
osx_image: xcode7.1 (Xcode 7.1.1 GM)
osx_image: xcode7 (Xcode 7)
osx_image: xcode6.4 (Xcode 6.4)
osx_image: beta-xcode6.3 (Xcode 6.3)
OS X 10.9
osx_image: beta-xcode6.2 (Xcode 6.2)
osx_image: beta-xcode6.1 (Default, Xcode 6.1)
What's interesting about this is that beta-xcode6.1 is listed as the default image for OS X, which has an ancient version of Xcode and OS X and additionally seems to be in beta (whatever that means). It might thus be a good idea to explicitly configure one or more osx_image versions in the matrix if you're going to build for OS X.
Update: As of October 2017, the default is OS X 10.11 with Xcode 7.3.1, and the latest available is OS X 10.12 with Xcode 9.

CUDA driver too old for Matlab GPU?

Ok,this is something am having problems with. I recently installed Matlab R2013a on a x86_64 Linux system running RHEL 5, attached to a Tesla S2050. I have never used the GPU functionality in Matlab itself (but have tried some of it using Jacket that lets one
program GPUs in Matlab).
The Tesla is working fine with all the drivers ,CUDA installed (Jacket v1.8.2 is running fine without complaints).
** Driver Version: 270.41.34 (the last version from 2011, supporting S2050) **
CUDA: v5.0.35
nvcc -V : Cuda compilation tools, release 5.0, V0.2.1221
But the Matlab r2013a complains:
gpuDevice errors:
Caused by:
The CUDA driver was found, but it is too old. The CUDA driver on your system supports CUDA version 4. The required CUDA version is 5 or greater.
Now, I understand the error that Matlab has problems with the Driver version. But, I have installed the latest CUDA toolkit and the latest driver that nVidia has to offer for the Tesla S2050 that I have.
Is there a later driver version available for this Tesla (i downloaded the latest driver & when trying to install, it simply complains that I don't have the compatible nVidia hardware).
How do I tell Matlab to consider the relevant CUDA ? (where to set PATH, CUDA_PATH etc., if any ? )
Are there any other checks i need to perform the evaluate the working of the attached Tesla ?
Thanks in advance for help.
You cannot use CUDA 5.0 with driver 270.41.34. CUDA 5 requires 304.54 or newer. This is not a MATLAB issue.
Newer drivers that support CUDA 5 will also support Tesla S2050.
For example this recent 319.17 driver lists Tesla S2050 on the supported products tab. Or use the 304.54 that comes with cuda 5.0.

blakcberry os 7 simulator loading forever

I've installed simulator os 7 and its loading forever. (its good with simulator os <= 6)
My problem is just like :
blakcberry os 7 simulator not loading on my system
and the problem looks like not solved yet.
My System:
Processor: Intel core 2 duo #2GHz
Ram: 4 GB
Windows 7 ultimate 32 bit service pack 1, with UAC off
Java sdk 1.6 update 31
IDE: eclipse galileo 3.5
Blackberry plugin 1.1.2
is there any suggestion, step, or something configuration how to solve this
Your versions of Eclipse and the BlackBerry plugin are pretty old, might be worth updating them to see if that makes a difference. Current versions are
Eclipse: Indigo 3.7
BB Plugin: 1.5.2
As another commenter has said, your hardware is pretty old as well and the simulator is very resource intensive. To give you an idea of simulator performance here's my spec:
CPU: Intel i7 2700K (overclocked to 3.4GHz)
RAM: 16GB
HDD: 128GB Samsung 830 SSD
OS: Windows 7 Professional 64 bit
Eclipse: Indigo 3.7.2 (in eclipse.ini I have the following flag: -Xmx768m)
BB Plugin: 1.5.2
BB Simulator: Bold 9930
Running (not debugging) the simulator takes 17 seconds to load.