[Difx-users] Multi-thread 4-bit VDIF fails with 'vdifmux() failed with return code -2014' {External} {External} {External} {External}
Hugh Garsden
hugh.garsden at manchester.ac.uk
Fri May 30 10:53:07 EDT 2025
Hi Walter,
The fix is simple but I had to figure out how to get the inputChannelsPerThread, which setvdifmuxinputchannels() needs. I decided to get it from the VEX file not the VDIF file because (I think) we want to check the VDIF file against what is specified in the VEX.
The file mpifxcorr/src/vdifnetwork.cpp is where the vmux is configured for VDIF using configurevdifmux(). I added the call to setvdifmuxinputchannels() immediately after that. Here is the diff:
===================================================================
--- mpifxcorr/src/vdifnetwork.cpp (revision 11112)
+++ mpifxcorr/src/vdifnetwork.cpp (working copy)
@@ -344,7 +344,11 @@
cfatal << startl << "configurevmux failed with return code " << rv << endl;
MPI_Abort(MPI_COMM_WORLD, 1);
}
+ if ( setvdifmuxinputchannels(&vm, config->getFreqTableLength()) != 0 ) {
+ cfatal << startl << "setvdifmuxinputchannels failed" << endl;
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
fanout = config->genMk5FormatName(format, nrecordedbands, bw, nbits, sampling, vm.outputFrameSize, config->getDDecimationFactor(configindex, streamnum), config->getDAlignmentSeconds(configindex, streamnum), config->getDNumMuxThreads(configindex, streamnum), formatname);
if(fanout != 1)
{
Note I am using DiFX-2.8.1 downloaded via SVN not git.
Hugh
________________________________
From: Difx-users <difx-users-bounces at listmgr.nrao.edu> on behalf of Walter Brisken via Difx-users <difx-users at listmgr.nrao.edu>
Sent: 21 May 2025 16:11
To: difx-users at listmgr.nrao.edu <difx-users at listmgr.nrao.edu>
Subject: Re: [Difx-users] Multi-thread 4-bit VDIF fails with 'vdifmux() failed with return code -2014' {External} {External} {External}
Hi Hugh,
It may have been oversight that led to the current code and lack of support for your mode. Can you create a branch with the implementation of your fix, or just sent a diff to the list, and I can take a look?
I am pretty sure no one has actually ever used DiFX with VDIF streams that are both multi-channel per thread and multi-thread, so this may be new ground you are covering. In theory it should be supported.
Thanks,
Walter
On 5/21/25 08:57, Hugh Garsden via Difx-users wrote:
Hi all,
Regarding Jake's message below, difx is using multiplexing to combine multiple threads into a single thread. However it can only deal with 1 channel per input thread because that is hardwired in the code. Here: https://github.com/difx/difx/blob/c2ac995454fa96de38c651f6eea484b4a5db73ca/libraries/vdifio/src/vdifmux.c#L150 [github.com]<https://urldefense.com/v3/__https://github.com/difx/difx/blob/c2ac995454fa96de38c651f6eea484b4a5db73ca/libraries/vdifio/src/vdifmux.c*L150__;Iw!!PDiH4ENfjr2_Jw!GKpKkvu39hHk0v0fSLpyefSUwep7WvZzidPuv9nndJiLPv2q5yJE6hIh9yBgvCN-tErCoIU8vbAh3zs19yNSkb6EJWWsrDXxwg5o$>. The way to change that is mentioned in comment, which is to call setvdifmuxinputchannels(). That's what the vmux program does, and it works ok. I'm wondering why difx doesn't do that, and maybe there should be a warning about it not doing that. Anyway, that line of code is in configurevdifmux() so I've added a call to setvdifmuxinputchannels() after configurevdifmux() is called in difx, and now the multiplexing is working with more than 1 channel.
Hugh
________________________________
From: Difx-users <difx-users-bounces at listmgr.nrao.edu><mailto:difx-users-bounces at listmgr.nrao.edu> on behalf of Jacob Brooks via Difx-users <difx-users at listmgr.nrao.edu><mailto:difx-users at listmgr.nrao.edu>
Sent: 20 February 2025 12:12
To: difx-users at listmgr.nrao.edu<mailto:difx-users at listmgr.nrao.edu> <difx-users at listmgr.nrao.edu><mailto:difx-users at listmgr.nrao.edu>
Subject: [Difx-users] Multi-thread 4-bit VDIF fails with 'vdifmux() failed with return code -2014' {External}
Hi all,
We're currently trying to get DiFX working with the following setup: 4-bit, 2 channel (L + R pols), 2 threads (2 subbands), delivered in real time via UDP. It has been working fine up until the point where we tried adding a second thread - single-thread VDIF has been working for us.
When running in multi-threaded mode, the datastream processes crash with the following message:
'vdifmux() failed with return code -2014, likely input buffer is too small!'
I have managed to trace the problem to a check in 'getLowestFrameNumber' in vdifio/src/vdifmux.c. The inequality check in that function:
'getVDIFNumChannels(vh) != vm->inputChannelsPerThread'
succeeds as the function returns a value of 2 while 'inputChannelsPerThread' has a value of 1. This happens for every iteration so vdifmux() fails and returns a -2014 error code.
I'm not sure where to go from here and was hoping someone more familiar with DiFX could help out. Hopefully I'm not missing something obvious! If you need any more information I haven't provided please do ask.
Cheers,
Jake
_______________________________________________
Difx-users mailing list
Difx-users at listmgr.nrao.edu<mailto:Difx-users at listmgr.nrao.edu>
https://listmgr.nrao.edu/mailman/listinfo/difx-users [listmgr.nrao.edu]<https://urldefense.com/v3/__https://listmgr.nrao.edu/mailman/listinfo/difx-users__;!!PDiH4ENfjr2_Jw!GKpKkvu39hHk0v0fSLpyefSUwep7WvZzidPuv9nndJiLPv2q5yJE6hIh9yBgvCN-tErCoIU8vbAh3zs19yNSkb6EJWWsrHokJHvn$>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listmgr.nrao.edu/pipermail/difx-users/attachments/20250530/12d9cbf1/attachment-0001.html>
More information about the Difx-users
mailing list