Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Attempting to create a container with a duplicate name will return the existing container's id instead of returning 0 #64

Open
gerzytet opened this issue Jun 28, 2022 · 2 comments
Assignees
Labels
type: enhancement New feature or request
Milestone

Comments

@gerzytet
Copy link

code to reproduce:


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pdc.h"

int
main(int argc, char **argv)
{
    pdcid_t pdc_id, cont_id, cont_prop, cont_id2;
    int     rank = 0, size = 1;
    int     ret_value = 0;

    // create a pdc
#ifdef ENABLE_MPI
    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    MPI_Comm_size(MPI_COMM_WORLD, &size);
#endif

    pdc_id = PDCinit("pdc");
    cont_prop = PDCprop_create(PDC_CONT_CREATE, pdc_id);
    if (cont_prop <= 0)
        printf("Fail to create container property @ line  %d!\n", __LINE__);

    // create a container
    cont_id = PDCcont_create("VPIC_cont", cont_prop);
    if (cont_id <= 0)
        printf("Fail to create container @ line  %d!\n", __LINE__);
    
    cont_id2 = PDCcont_create("VPIC_cont", cont_prop);
    if (cont_id2 <= 0)
        printf("Fail to create container @ line  %d!\n", __LINE__);
    
    PDCclose(pdc_id);
    
#ifdef ENABLE_MPI
    MPI_Finalize();
#endif
    return ret_value;
}
@gerzytet gerzytet changed the title Attempting to create a container with a duplicate name will return the existing container's id instead returning FAIL Attempting to create a container with a duplicate name will return the existing container's id instead of returning 0 Jun 28, 2022
@jeanbez jeanbez added this to the v.0.4 milestone Mar 28, 2023
@houjun houjun self-assigned this Jul 13, 2023
@jeanbez jeanbez added the type: bug Something isn't working label Jul 14, 2023
@houjun
Copy link
Member

houjun commented Jul 18, 2023

This is sort of an (unintended) feature, for all the PDC parallel tests, all ranks call PDCcont_create() at the beginning, assuming one rank sends the create request to the server, which creates a container, the rest of the ranks would just "open" the container without getting a failure.
To make PDCcont_create() fail when there exists a container with the same name we will need to change the test codes to use a collective version of the PDCcont_create().

@houjun houjun added decision: invalid This doesn't seem right and removed type: bug Something isn't working labels Jul 25, 2023
@jeanbez jeanbez added type: enhancement New feature or request and removed decision: invalid This doesn't seem right labels Oct 10, 2023
@jeanbez jeanbez modified the milestones: v.0.4, v.0.5 Mar 5, 2024
@jeanbez
Copy link
Member

jeanbez commented Mar 5, 2024

decision: make it fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants