text:
package test.integration.unit;

import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import com.github.sormuras.beethoven.Annotation;
import com.github.sormuras.beethoven.Compilation;
import com.github.sormuras.beethoven.unit.Block;
import com.github.sormuras.beethoven.unit.ClassDeclaration;
import com.github.sormuras.beethoven.unit.CompilationUnit;
import com.github.sormuras.beethoven.unit.EnumDeclaration;
import com.github.sormuras.beethoven.unit.FieldDeclaration;
import com.github.sormuras.beethoven.unit.MethodDeclaration;
import com.github.sormuras.beethoven.unit.MethodParameter;
import com.github.sormuras.beethoven.unit.NormalClassDeclaration;
import com.github.sormuras.beethoven.unit.TypeDeclaration;
import com.github.sormuras.beethoven.unit.TypeParameter;
import javax.annotation.processing.Generated;
import org.junit.jupiter.api.Disabled;
import test.integration.Counter;
import com.github.sormuras.beethoven.Listable;
import com.github.sormuras.beethoven.Name;
import test.integration.Tests;
import com.github.sormuras.beethoven.composer.ImportsComposer;
import com.github.sormuras.beethoven.type.ClassType;
import com.github.sormuras.beethoven.type.Type;
import com.github.sormuras.beethoven.type.TypeVariable;
import com.github.sormuras.beethoven.type.WildcardType;
import java.io.IOException;
import java.io.Serializable;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.function.Supplier;
import javax.lang.model.element.Modifier;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class CompilationUnitTests {

  @Test
  void empty() {
    assertTrue(new CompilationUnit().isEmpty());
    assertFalse(CompilationUnit.of("a").isEmpty());
    CompilationUnit unit = new CompilationUnit();
    unit.getImportDeclarations().addSingleTypeImport(Objects.class);
    assertFalse(unit.isEmpty());
    unit = new CompilationUnit();
    unit.declareClass("C");
    assertFalse(unit.isEmpty());
    // Tests.assertSerializable(unit);
  }

  @Test
  void enterprise() {
    CompilationUnit unit = CompilationUnit.of("uss");
    NormalClassDeclaration enterprise = unit.declareClass("Enterprise");
    enterprise.addModifier(Modifier.PUBLIC);
    enterprise.addInterface(ClassType.parameterized(Supplier.class, String.class));
    enterprise.declareField(String.class, "text").addModifier("private", "final");
    enterprise.declareField(Number.class, "number").addModifier("private", "final");
    MethodDeclaration constructor = enterprise.declareConstructor();
    constructor.addModifier(Modifier.PUBLIC);
    constructor.declareParameter(String.class, "text");
    constructor.declareParameter(Number.class, "number");
    constructor.addStatement("this.text = text");
    constructor.addStatement("this.number = number");
    MethodDeclaration getter = enterprise.declareMethod(String.class, "get");
    getter.addAnnotation(Override.class);
    getter.addModifier(Modifier.PUBLIC);
    getter.addStatement("return text + '-' + number");
    assertEquals("uss.Enterprise", enterprise.toType().list());

    Supplier<?> spaceship = unit.compile(Supplier.class, "NCC", (short) 1701);

    assertEquals("Enterprise", spaceship.getClass().getSimpleName());
    assertEquals("NCC-1701", spaceship.get());
    Tests.assertEquals(getClass(), "enterprise", unit);
  }

  @Test
  void packageName() {
    assertEquals("", new CompilationUnit().getPackageName());
    assertEquals("a.b.c", CompilationUnit.of("a.b.c").getPackageName());
  }

  @Test
  void eponymousDeclaration() {
    // empty unit
    assertFalse(new CompilationUnit().getEponymousDeclaration().isPresent());
    // single type in unit
    CompilationUnit singleTypeUnit = new CompilationUnit();
    singleTypeUnit.declareClass("NonPublic");
    assertTrue(singleTypeUnit.getEponymousDeclaration().isPresent());
    assertEquals("NonPublic", singleTypeUnit.getEponymousDeclaration().get().getName());
    // multiple top level classes
    assertEquals("Gamma", Units.simple().getEponymousDeclaration().orElseThrow().getName());
  }

  @Test
  void top() {
    assertEquals(3, Units.simple().getDeclarations().size());
    CompilationUnit unit = CompilationUnit.of("top");
    unit.declareAnnotation("A").declareAnnotation("X");
    unit.declareEnum("E").declareEnum("X");
    unit.declareClass("C").declareClass("X").declareClass("Z");
    TypeDeclaration x = unit.declareInterface("I").declareInterface("X");
    assertEquals(4, unit.getDeclarations().size());
    assertFalse(unit.getDeclarations().get(0).isEmpty()); // A
    assertTrue(unit.getDeclarations().get(0).getDeclarations().get(0).isEmpty()); // A.X
    assertEquals(Tests.load(CompilationUnitTests.class, "top"), unit.list());
    assertEquals("top.I.X", x.toType().list());
  }

  @Test
  void simple() {
    assertEquals(Tests.load(Units.class, "simple"), Units.simple().list());
  }

  @Test
  @Disabled("package test.integration.Counter does not exist")
  void processed() throws Exception {
    CompilationUnit unit = CompilationUnit.of("test");
    ClassDeclaration enterprise = unit.declareClass("Class");
    enterprise.addModifier(Modifier.PUBLIC);
    enterprise.declareField(Object.class, "field1").addAnnotation(Counter.Mark.class);
    enterprise
        .declareField(
            ClassType.type(Comparable.class)
                .parameterized(i -> singletonList(WildcardType.wildcard())),
            "field2")
        .addAnnotation(Counter.Mark.class);
    enterprise
        .declareField(
            ClassType.type(Map.Entry.class)
                .parameterized(
                    i ->
                        i == 0
                            ? emptyList()
                            : asList(
                                WildcardType.supertype(String.class),
                                WildcardType.extend(Runnable.class))),
            "field3")
        .addAnnotation(Counter.Mark.class);
    enterprise.declareField(int[].class, "field4").addAnnotation(Counter.Mark.class);
    enterprise.declareField(int[][][].class, "field5").addAnnotation(Counter.Mark.class);
    enterprise.declareField(String[][].class, "field6").addAnnotation(Counter.Mark.class);
    Tests.assertEquals(getClass(), "processed", unit);
    Counter counter = new Counter();
    Compilation.compile(
        null, emptyList(), singletonList(counter), singletonList(unit.toJavaFileObject()));
    assertEquals(6, counter.marked.size());
    Assertions.assertEquals(
        "java.util.Map.Entry<? super String, ? extends Runnable>",
        counter.types.get("field3").list());
    Assertions.assertEquals("int[]", counter.types.get("field4").list());
    Assertions.assertEquals("int[][][]", counter.types.get("field5").list());
    Assertions.assertEquals("String[][]", counter.types.get("field6").list());
  }

  @Test
  @Disabled("package test.integration.Counter does not exist")
  void abc() throws Exception {
    CompilationUnit unit = Units.abc();
    Tests.assertEquals(getClass(), "abc", unit);

    Counter counter = new Counter();
    Compilation.compile(
        null, emptyList(), singletonList(counter), singletonList(unit.toJavaFileObject()));
    assertEquals(2, counter.marked.size());
    Assertions.assertEquals("A.B.C", counter.types.get("raw").list());
    Assertions.assertEquals("A<I>.B<I, I>.C<I, I, I>", counter.types.get("parametered").list());
  }

  @Test
  void unnamed() throws Exception {
    CompilationUnit unnamed = new CompilationUnit();
    unnamed.declareClass("Unnamed").addModifier(Modifier.PUBLIC);
    assertEquals("Unnamed", unnamed.compile(Object.class).getClass().getTypeName());
    assertThrows(Error.class, () -> unnamed.compile(Object.class, "unused", "arguments"));
    // with types supplier...
    Supplier<java.lang.Class<?>[]> types0 = () -> new java.lang.Class<?>[0];
    assertEquals("Unnamed", unnamed.compile(Object.class, types0).getClass().getTypeName());
    Supplier<java.lang.Class<?>[]> types1 = () -> new java.lang.Class<?>[1];
    assertThrows(Error.class, () -> unnamed.compile(Object.class, types1));
  }

  @Test
  void crazy() throws Exception {
    Annotation tag = Annotation.annotation(Name.name("Tag"));
    ClassType taggedRunnable = ClassType.type(Runnable.class).annotated(i -> singletonList(tag));
    ClassType taggedString = ClassType.type(String.class).annotated(i -> singletonList(tag));
    ClassType taggedThread = ClassType.type(Thread.class).annotated(i -> singletonList(tag));
    ClassType listOfStrings = ClassType.parameterized(List.class, String.class);

    CompilationUnit unit = CompilationUnit.of("abc.xyz");
    unit.getPackageDeclaration()
        .addAnnotation(Generated.class, "https://", "github.com/sormuras/listing");
    unit.getImportDeclarations()
        .addSingleTypeImport(Assertions.class)
        .addTypeImportOnDemand(Name.name("abc"))
        .addSingleStaticImport(Name.name(Collections.class.getMethod("shuffle", List.class)))
        .addStaticImportOnDemand(Name.name(Objects.class));
    unit.declareAnnotation("TestAnno");
    EnumDeclaration e1 = unit.declareEnum("TestEnum");
    e1.addAnnotation(Generated.class, "An enum for testing");
    e1.addModifier(Modifier.PROTECTED);
    e1.addInterface(Type.type(Serializable.class));
    e1.declareConstant("A");
    e1.declareConstant("B");
    e1.declareConstant("C");
    unit.declareInterface("TestIntf");
    NormalClassDeclaration simple = unit.declareClass("SimpleClass");
    simple.addModifier("public", "final");
    simple.addTypeParameter(TypeParameter.of("S", taggedRunnable));
    simple.addTypeParameter(TypeParameter.of("T", "S"));
    simple.setSuperClass(taggedThread);
    simple.addInterface(Type.type(Cloneable.class));
    simple.addInterface(Type.type(Runnable.class));
    FieldDeclaration i = simple.declareField(int.class, "i");
    i.addModifier("private", "volatile");
    i.setInitializer(l -> l.add("4711"));
    simple
        .declareField(taggedString, "s")
        .setInitializer(l -> l.add(Listable.escape("The Story about \"Ping\"")));
    simple
        .declareField(listOfStrings, "l")
        .setInitializer(l -> l.add("java.util.Collections.emptyList()"));
    MethodDeclaration run = simple.declareMethod(void.class, "run");
    run.addAnnotation(Override.class);
    run.addModifiers(Modifier.PUBLIC, Modifier.FINAL);
    run.addStatement("System.out.println({{S}})", "Hallo Welt!");
    MethodDeclaration calc = simple.declareMethod(TypeVariable.variable("N"), "calc");
    calc.addModifier(Modifier.STATIC);
    calc.addTypeParameter(TypeParameter.of("N", Type.type(Number.class)));
    calc.declareParameter(int.class, "i");
    calc.addThrows(Exception.class);
    calc.addStatement("return null");

    assertSame(simple, i.getEnclosingDeclaration());
    Tests.assertEquals(getClass(), "crazy", unit);
    // Tests.assertSerializable(unit);
  }

  @Test
  void imports() throws Exception {
    CompilationUnit unit = CompilationUnit.of("abc.xyz");
    unit.getImportDeclarations().addSingleTypeImport(Callable.class);
    unit.getImportDeclarations().addSingleStaticImport(Name.name(Math.class, "E"));
    NormalClassDeclaration imports = unit.declareClass("Imports");
    imports.addInterface(ClassType.parameterized(Callable.class, Number.class));
    MethodDeclaration call = imports.declareMethod(Number.class, "call");
    call.addModifier("public");
    Block body = new Block();
    body.add(
        l ->
            l.add("return ")
                .add(Name.name(Math.class, "E"))
                .add(" * ")
                .add(Name.name(Math.class, "PI"))
                .add(';')
                .newline());
    call.setBody(body);
    unit.compile();
    Tests.assertEquals(getClass(), "imports", unit.list());
  }

  @Test
  void launch() throws IOException {
    Name out = Name.name(System.class, "out");

    Path tempFilePath = Files.createTempFile("beethoven-launch-", ".java");

    CompilationUnit unit = CompilationUnit.of("unit");
    unit.getImportDeclarations().addSingleStaticImport(out);

    ClassDeclaration symphony = unit.declareClass("Launch", Modifier.PUBLIC);
    MethodDeclaration main =
        symphony.declareMethod(void.class, "main", Modifier.PUBLIC, Modifier.STATIC);
    main.addThrows(IOException.class);
    MethodParameter args = main.declareParameter(String[].class, "args");
    main.addStatement(
        listing ->
            listing
                .add(Name.name(Files.class))
                .add(".write(")
                .add(Name.name(Paths.class))
                .add(".get(")
                .add(args.getName())
                .add("[0])")
                .add(", ")
                .add(Name.name(String.class))
                .add(".join(")
                .add(Listable.escape("\n"))
                .add(", ")
                .add(args.getName())
                .add(").getBytes()")
                .add(")"));

    new ImportsComposer().apply(unit);
    String listed = unit.list(System.lineSeparator());
    Tests.assertEquals(getClass(), "launch", listed);

    unit.launch(tempFilePath.toString(), "Second,", "Third line.");
    List<String> lines = Files.readAllLines(tempFilePath);
    assertEquals(tempFilePath.toString(), lines.get(0));
    assertEquals("Second,", lines.get(1));
    assertEquals("Third line.", lines.get(2));
  }

  @Test
  @Disabled("package test.integration.Counter does not exist")
  void launchWithoutMainMethodFails() throws IOException {
    Exception exception = assertThrows(Exception.class, () -> Units.abc().launch());
    assertEquals(NoSuchMethodException.class, exception.getCause().getClass());
  }

  @Test
  void toURI() {
    // empty unit has no URI
    assertThrows(IllegalStateException.class, () -> new CompilationUnit().toURI());
    // single type in unit
    CompilationUnit singleTypeUnit = new CompilationUnit();
    singleTypeUnit.setPackageName("some.where");
    singleTypeUnit.declareClass("Over");
    assertTrue(singleTypeUnit.getEponymousDeclaration().isPresent());
    assertEquals("some/where/Over.java", singleTypeUnit.toURI().toString());
    // multiple top level classes
    assertEquals("Gamma.java", Units.simple().toURI().toString());
  }
}

redpajama_set_name: RedPajamaGithub


In this paper, we investigate the role of social interaction in technology adoption by conducting a field experiment in neighborhoods of Bamako.
We invited women to attend a training/marketing session, where information on a more efficient cooking stove was provided and the chance to purchase the product at market price was offered. We randomly provided an information nudge on a peer's willingness to buy an improved cookstove.
We find that women purchase and use the product more when they receive information on a peer who purchased (or previously owned) the product, particularly if she is viewed as respected. In general, we find positive direct and spillover effects of attending the session.
We also investigate whether social interaction plays a role in technology diffusion. We find that women who participated in the session, but did not buy during the intervention, are more likely to adopt the product when more women living around them own it. We investigate the mechanisms and provide evidence supporting imitation effects, rather than social learning or constraint interaction.


text:
Q: How to update a key of a property in firebase relatime database using angular 7 I am trying to edit the key of a property in my firebase database which i failed. Is this possible?

A: Updating and Deleting Todos
To update or delete a todo, things are a bit different because you'll need a reference to the todo item that is to be updated or deleted.
This can be done with AngularFireDatabase.object. Objects inside a Firebase have a unique key available as $key:
Updating Todos
Here's how you would toggle the completed state of a todo:
toggleDone(todo: any): void {
  this.af.object('/todos/' + todo.$key)
    .update({ content: todo.content, done: !todo.done });
}

Or update its content:
updateTodo2(todo: any, newValue: string): void {
  this.af.object('/todos/' + todo.$key)
    .update({ content: newValue, done: todo.done });
}

for more details goto
https://alligator.io/angular/firebase-crud-operations/

redpajama_set_name: RedPajamaStackExchange


text:
Globalization News Archive
July 25, 2018: Professor Puente Urruzmendi from Tecnun-University of Navarra (Spain), met with Professor Raghu Raghavendra to to explore opportunities of cooperation with Viterbi School of Engineering.
July 23, 2018: Professor Vincent Cheng, Associate Vice President of the Chinese University of Hong Kong, met with Professor Raghu Raghavendra to discuss collaborations in education with the University of Southern California.
June 12, 2018: The Directors of USC International Offices met to discuss the activities of USC Viterbi School of Engineering.
March 9-22, 2018: Prof. Raghu Raghavendra, Vice Dean for Global Academic Initiatives Visited several universities in India to discuss academic and research collaborations. He also held several meetings to discuss Grand Challenge Scholars Program (GCSP) and followed up on the talks he had last time around in December.
March 1, 2018: Boonsieng Benjauthrit (USC alumnus), and Mr. Charoonkiat Phattharamontrisin, CEO of Nano Bio Thailand visited USC. They held talks to collaborate with USC to use nano-organisms to protect red wood trees from bark beetles. Initially there will be a lab test and later on it will be implemented on field.
May 29, 2018: A Memorandum of Understanding was signed between USC Viterbi School of Engineering/Annenberg School of Communications and Journalism and Tsinghua University when Dean Yannis Yortsos visited the University in China, to establish a dual degree program.
July 2018: Students from China and Korea will be coming to USC Viterbi for 5 weeks to attend Summer research program.
May 2018: A Memorandum of Understanding has been signed between USC Viterbi and National Chiao Tung University, Taiwan to establish a partnership to pursue collaborative research, faculty and student exchange, and engagement in educational collaboration.
April 17, 2018: A 3 member delegation from The Chinese University of HongKong (CUHK), Shenzhen visited USC Viterbi. The delegation included Professor Jesús Seade (Associate Vice President for Global Affairs), Professor Changwen Chen (Dean, School of Science and Engineering) and Mr. Paul Ke (Director of Academic Links).
March 6, 2018: A delegation of Peisen Huang (Dean and Prof. Mechanical Engineering), Gang Zheng (Associate Dean for Undergraduate Education), Horst Hohberger (Faculty Advisor to International Programs) from SJTU-UM Visited USC Viterbi.
March 5, 2018: Dean Yortsos met with 6 member delegate from Taipei Medical University. Delegate consisted of: Prof. Chien-Huang Lin (President), Prof. Chien-Hsi Wu (Vice President, International Affairs), Prof. Chaur-Jong Hu (Vice Superintendent for Research Affairs Shuang Ho Hospital), Prof. Hsing-Jien Kung( Chair Professor, PhD Program for Cancer Biology and Drug Discovery), Prof. Pei-Shan Tsai (Dean, Office of Global Engagement), Ms. Andrea Liu, (Staff, Office of Global Engagement)
June 27, 2017: Students from China and aerospace students from Korea came to USC Viterbi for Summer Research Program
May 15-17, 2017: The 11th USC-THU Faculty Research Symposium was held in Beijing on May 15-17 with the theme of The 4th Industrial Revolution: Enabling Tools and Methods. The symposium had talks and discussion sessions.
June 13, 2018: Delegates from Amrita University met with Prof. Raghu Raghavendra, Vice Dean for Global Academic Initiatives, and faculty to discuss about education and research collaboration.
April 10, 2018: Indo US Collaboration in Engineering Education (IUCEE) delegation visited USC Viterbi and met with Prof. Raghavendra. They also attended Innovation and Entrepreneurship Programs at USC Viterbi and visited several labs during their visit.
February 20, 2018: Vice-Chancellor Prof. Anu Singh Lather and Prof. Pravir Kumar (Dean, Alumni affairs) of Delhi Technological University (DTU) Visited USC Viterbi.
January 16, 2018: Association of Indian Students at USC organised an orientation for incoming graduate students from India. Prof. Raghu Raghavendra attended the event and welcomed the new batch of students to USC.
May 17, 2018: Students from India will be coming to USC Viterbi for 8 weeks to attend Viterbi-IUSSTF Program. Read more>>
December 15, 2017: Viterbi-Axilor entrepreneurship lecture series was held in Bengaluru. The series had several lectures by alumnis and successful entrepreneurs. Prof. Krishna Nayak from Ming Hsieh EE Dept., was one of the speakers at this event. Read more>>
November 8, 2017: Prof. Pankaj Jalote, Director of IIIT Delhi, visited USC Viterbi on Nov. 8th. He gave a presentation about IIIT Delhi and met with soon to be graduating PhD students.
October 15, 2017: Students from India celebrated festival of Diwali at Bovard auditorium. It included performances from students and a message from Viterbi Dean.Read more>>
December 11-15, 2017: India Advisory Board meeting which was held in Bangalore on Friday, Dec. 15 attended by Dean Yannis Yortsos. Dinner event was organised in Delhi, Mumbai and Bangalore for alumni/parents where the invited attendees got to see all the advances of VSoE. Read more >>
December 6-8, 2017: Advisory board meeting was held in Beijing and Hong Kong. Dean Yannis Yortsos attended the meeting and met with industry leaders. Dinner event was organised for alumnis and parents at Grand Hyatt, Hongkong.
October 16-17, 2017: Workshop on AI for Social Good will take place at IISC (Indian School of Sciences Bangalore) campus. It is being organized by Microsoft Research. Four faculty members and two students from USC will be presenting. Read more >>
October 4, 2017: iPodia Fall 2017 classroom is the largest global classroom to date. It is bringing in 11 universities from different countries together on one platform. Read more
September 21-23, 2017: USC Global Conference took place in Tokyo, Japan. It featured a number of prominent speakers from the US and Japan. Read more >>
September 11, 2017: Sunil Kant Munjal, Chancellor of BML Munjal University, Gurgaon visited USC Viterbi and met with Dean and Vice Dean to discuss collaboration.
August 23, 2017: Association of Indian Students (AIS) at USC organised a welcome reception for incoming grad students from India.
August 8, 2017: Delegation of 10 people from Thailand governmental organization and Chulalongkorn University visited USC Viterbi to explore collaboration.
July 25, 2017: Mohamed Shwehdi, Director of International affairs for Joint Collaboration, King Faisal University in Saudi Arabia visited USC Viterbi to explore research and education collaboration
May 18 - July 18, 2017: More than 20 students from India came to USC Viterbi for Summer Viterbi India Program. Read more>>
July 10, 2017: Dr. Mau-Chung Frank Chang, President, National Chiao Tung University (NCTU) visited USC Viterbi to explore further research and collaboration between the two universities.
June 28, 2017: Prof. S. S. Gokhale, Director, LNMIIT Jaipur visited USC Viterbi School of Engineering.
June 23, 2017: S C Choi, President of Inha Univ. , K W Lee, President of KAU, I J Jin, President of Inha college in South Korea visited USC Viterbi to discuss about collaborations and tour of DEN facilities.
May 15-17, 2017: The 11th USC-THU Faculty Research Symposium was held in Beijing on May 15-17 with the theme of The 4th Industrial Revolution: Enabling Tools and Methods. The symposium had talks and discussion sessions. Read more >>
May 15, 2017: Mr R Varadarajan, Head (F&A), IUSSTF visited USC Viterbi School of Engineering.
May 8, 2017: Prof. R. Nagarajan, Dean for International Affairs for IIT Madras visited USC Viterbi School of Engineering. He met with Prof Raghu Raghavendra, Prof. Jerry Loeb and Prof Paul Ronney and Prof Mahta Moghaddam.
April 17-18, 2017: Prof. Milind Tambe will co-chair 2-day workshop on Artificial Intelligence for social good at Indian Institute of Science Bangalore campus.
April 13, 2017: The next session of the USC Viterbi-Axilor Lecture Series will take place on April 13. Lineup of speakers include Dr. K. Ananth Krishnan, Dr. Ashok Chandak, Dr. Ramesh Hariharan, Nitin Sharma. Read more here about the last Viterbi-Axilor Lecture Series.
March 13, 2017 Prof. Ravi Kumar, Associate Provost (Special Projects) in President's Office of Nanyang Technical University (NTU) revisited USC. He met with various administrators, dean of VSoE and some faculty members. His visit was to explore further research collaboration between NTU and USC in games area.
February 21, 2017 A high-level delegation led by USC President C. L. Max Nikias visited Taiwanese capital of Taipei on Feb. 21. The delegation's purpose was to strengthen existing links with Taiwanese institutions and explore new opportunities for partnerships in Taiwan. Read more>>
February 3, 2017 Delegation led by minister from Bauhaus University, Weimar in Germany visited USC. MOU was signed between the two universities to promote research collaboration. Read more>>
January 24, 2017: Ananth Krishnan, CTO of TCS visited USC to discuss research and innovation collaborations.
Dec 5-6, 2016: Prof. Raghu Raghavendra, Vice Dean for Global Academic Initiatives, visited National Taiwan University and National Tsing Hua University. The purpose of visit was to strengthen existing links and explore new opportunities for partnerships in research.
June 7, 2016: A partnership between the USC Viterbi School of Engineering and the Bay Environmental Technology Corp (Bayeco) has been selected by the US Department of State and the Chinese government for membership in the US-China EcoPartnership program. Read more>>
Dec 7-10, 2016: Dean Yortsos, Vice Dean Raghavendra, and others visited India. They met alumni and friends in Mumbai and Bangalore. Also, The India advisory Board meeting was held in Bangalore on Friday, Dec. 9th. They visited IISc campus and met with Director and Deans. Read more>>
October 18, 2016: Deputy Director and Dean of faculty affairs from Indian Institute of Technology Bombay (IITB) visited VSoE. They met with Dean, Vice Dean, Dept. chairs and several faculty members to discuss education and research collaborations. They also made a presentation to graduate students for possible faculty appointments at IITB.
June 20, 2016: IUSSTF sponsors the Viterbi-India Program. Dr Rajiv Tayal, Executive Director of IUSSTF visited laboratories and met with faculty and Viterbi-India students.
May 4, 2016: USC Viterbi to strengthen ties with India and is set to launch new programs to attract Indian Ph.D. candidates. Read more>>
May 10-11, 2016: The 10th USC-THU Faculty Research Symposium was held at the USC campus on May 10-11 with the theme of Energy Informatics and Big Data. The symposium had talks, discussion sessions, and student poster session were held at RTH 526. Read more>>
USC Viterbi - Axilor Lexture Series
April 26, 2016: A program on entrepreneurship lecture series took place in Bangalore at Axilor. Sudha Kumar, Director of USC Viterbi Office in Bangalore organized this event. Many alums attended this event. Read more>>
Kiran Mazumdar-Shaw won the award
April 22, 2016: Kiran Mazumdar-Shaw won the Global Leadership in Engineering award. She is serving as the chair and Managaing Director of Biocon Limited. Read more>>
Dean Yannis Yortsos in India
Dec 8-12, 2015: Dean Yannis Yortsos led a delegation from USC Viterbi to India during Dec. 8-12. During this visit the delegation met with Government officials, industry leaders, and alumnis. In three different cities, Delhi, Mumbai, and Bangalore, meetings with alumni entrepreneurs and parents were held as well. Read more>>
October 29-31, 2015 The 2015 USC Global Conference took place in the city of Shanghai, China, at the Grand Hyatt Shanghai located in the world famous Jin Mao Tower on October 29 – 31, 2015. Read more>>
Sept 14, 2015 USC Viterbi startup awarded silver medal in Beijing. USC Viterbi's Stasis Labs won the silver medal in the student business plan competition at the Global Grand Challenges Summit (GGCS) in Beijing on September 14, 2015.Read more>>
IUSSTF Student Symposium
Aug 22, 2015: The IUSSTF organized a student symposium on August 22 for all summer research students from India who were part of the Viterbi-India, S N Bose Scholar, and Khorana Scholar programs. Prof. Raghu Raghavendra was invited to address these students in the symposium and view the posters presented by students. Read more>>
Vice Dean Raghu Raghavendra in China
Aug 14, 2015: Vice Dean Raghu Raghavendra visited Taipei Medical Univ. during August 14-15 and met with Deans, and other officials for further dicsussions on collaborative PhD program. Read more>>
USC-THU Research Symposium
May 21-22, 2015: The 9th USC-THU Faculty Research Symposium was held at the Tsinghua University campus on May 21-22 with the theme of Energy Informatics and Big Data. Dean Yortsos and several VSoE faculty traveled to Beijing for this symposium. The event was also attended by Feng Deng who is the sponsor of the collaboration between USC and THU.
Indian Official and IUSSTF visit
May 18, 2015 Officials from the Government of India and Indo US Science and Technology Forum (IUSSTF) visited USC on May 18th to establish a PhD fellowship program. Dr. T. K. Chandrashekar, secretary of Science and Engineering Research Board (SERB) led the delegation and signed an MOU with USC that will support 5 SERB-USC PhD fellowships each year.
Annual Viterbi-India program
May 18-July 20, 2015 In the annual Viterbi-India program, this year 19 students from institutions across India are at USC campus this summer conducting research with VSoE faculty. In addition, there are 8 other undergraduate students from India are participating in this summer research program.
Dean Yortsos, Prem Natarajan and Raghu Raghavendra visit India
December 15, 2014 Dean Yortsos, Prem Natarajan and Raghu Raghavendra visit India for the yearly India Advisory Board meeting.
Dean Yortsos in China
October 31, 2014 Dean Yortsos meets with the China and East Asia Advisory Boards, helps establish Entrepreneur Executive Club
USC researchers meet
October 15, 2014 USC researchers meet at the Global Conversation in New York to discuss our high-tech future.
USC Viterbi and Azerbaijan meet
October 13, 2014 USC Viterbi and Azerbaijan meet to explore research collaboration.
Tata Consultancy Services visits Viterbi Startup Garage.
August 1, 2014 In the Summer of 2014, Tata Consultancy Services (TCS) paid a visit to Viterbi Startup Garage, our early-stage technology accelerator launched by the Viterbi School of Engineering.
2015 Global summit on engineering grand challenges
July 16, 2014 Yannis C. Yortsos @ Chinese Academy of Engineering in Beijing- preparing for the 2015 global summit on engineering grand challenges
Dean Yortsos Inducted Into the Academy of Athens.
June 10, 2014 Yannis C. Yortsos, dean of the USC Viterbi School of Engineering, was formally inducted as Associate Member of the Academy of Athens in Greece on Tuesday for his "exceptional leadership and accomplishments in the field of engineering".
Internship Program at the United Nations headquarters
November 5, 2013 The United Nations provides opportunities for students enrolled in a graduate programme to undertake an internship at its Headquarters in New York, Geneva, Vienna, Nairobi, Addis Ababa, Bangkok, Beirut, Santiago, Arusha and The Hague.
The Global Innovation Initiative grant competition opens this week
October 28, 2013 GII will award grants to university consortia focusing on interdisciplinary science, technology, engineering, and mathematics (STEM)-related issues of global significance.
Google serves users from 700 p.c. more locations: Study by researchers from USC Viterbi
October 27, 2013 The Hindu - Over the past 10 months, Google search has dramatically increased the number of sites around the world from which it serves client queries according to researchers from University of Southern California.
USC launches International Academy
October 24, 2013 The USC International academy will expand recruitment efforts to attract the brightest international undergraduate and graduate students to USC's various academic programs.
USC, Brazilian agency agree on fellowship for PhD students
September 6, 2013 USC and the Brazilian Federal Agency for Support and Evaluation of Graduate Education under the Ministry of Education have agreed to jointly fund outstanding PhD students from Brazil who attend USC.
Airbus establishes Institute for Engineering Research at USC
May 30, 2013 The Airbus Institute for Engineering Research (AIER) will foster a partnership between the aerospace company, the USC Viterbi School of Engineering and two Korean Universities.
Global Conference opens in South Korea
May 23, 2013 USC alumni and leaders gathered at the Grand Hyatt in Seoul, South Korea, on May 23 for the official welcome reception and dinner of the 2013 USC Global Conference.
Three National Academies of Engineering Launch First Global Summit on the Grand Challenges
April 08, 2013 The three-day event explored how innovative engineering can tackle global issues such as cyber-terrorism, urban pollution and the development of clean, renewable energy.
USC and Korean Engineering Students Kick-Off a Semester of Global Interaction
February 21, 2013 USC students and their classmates from the Korea Advanced Institute of Science and Technology (KAIST) participate in iPodia, a unique program that ushers in a truly global classroom.
December 19, 2012A USC Viterbi School delegation, led by Dean Yannis C. Yortsos, recently visited India to connect with alumni, explore partnerships and affirm the school's growing international presence.
Viterbi Increases Footprint In Dynamic SubcontinentDecember 18, 2012The Viterbi India Board recently held its inaugural meeting, a reflection of the school's strong and deepening relationship with its Indian constituencies.
USC delegation visits South AmericaDecember 15, 2012A USC delegation visited academic, government and business leaders in Rio de Janeiro and São Paulo, Brazil earlier this month to build ties with top universities, corporations and policymakers, as well as to reconnect with USC alumni across the country.
Trojan Family members gather in India to network, party and danceDecember 11, 2012Enthusiastic Trojans in USC T-shirts flashed the "Fight On" sign as they sipped cocktails. The sounds of the USC marching band washed over the crowd, fueling excited conversations among alumni newly reunited.
The Great Unveiling: USC Viterbi Debuts New Mitsubishi Partnership November 30, 2012Mitsubishi to provide 12 electric cars for the USC Smart Grid Living Laboratory.
Association of Indian Students(AIS) celebrates Diwali.November 12, 2012Association of Indian Students(AIS) celebrates Diwali in grand style with more than 800 students and guests attending the event. Below is a Diwali greeting video by Dean Yannis C. Yortsos followed by some of the pictures captured at the function which was held at Boavard Auditorium, USC.
The Viterbi-India program jointly supported by Indo US Science and Technology Forum and VSoE.November 1, 2012This program will provide opportunities to Indian students to undertake a research internship at the Viterbi School of Engineering in summer 2013 for a period of 8 weeks.
USC Viterbi's First Ever Asia Board Kicks-Off Inaugural Meeting October 22, 2012New body tasked with threefold mission: advise, advocate and support Viterbi efforts in China and East Asia.
Viterbi school summer program for Indian undergrads wraps up successful second year.August 14, 2012Thirteen top students from universities in India came to the Viterbi School this summer for intensive research work with eminent Viterbi School faculty and a preview of what graduate school might offer.
USC Viterbi Launches Alliance to Bring the World to Students.July 09, 2012The USC Viterbi School of Engineering today unveiled an international partnership that allows students from multiple countries across the globe to take the same class – at the same time.
Class of 2012 graduate degree recipients gather in Galen Hall and hear a rousing speech by alumnus Feng Deng.May 12, 2012Dean Yannis C. Yortsos addressed a Galen Center in which the area often occupied by a basketball court was instead completely filled with students wearing caps and gowns. Behind the court, a spectator section held still more.
USC Viterbi research on transient plasma ignites interest at the China Maritime trade show in Hong Kong.May 4, 2012Dr. Fokion Egolfopoulos and Dr. Martin Gundersen along with Viterbi postdoctoral researcher Dr. Dan Singleton recently made a presentation about potentially game-changing research that could provide a big assist to the shipping industry in terms of cutting fuel costs and meeting tough new environmental regulations.
USC and Chilean ministry of education partner on PhD fellowshipsMarch 19, 2012USC and the Chilean Ministry of Education announced the creation of a partnership that will provide Ph.D. students from Chile with full tuition and living stipends as they pursue advanced degrees at USC, which enrolls more international students than any other university in the United States.
Dean Yortsos, USC Viterbi engineers reconnect at annual India alumni dinnerFebruary 29, 2012Over 60 eager attendants were present at the USC Viterbi India Alumni Dinner held February 25, 2012, at the ITC Royal Gardenia in Bangalore, India. Among opportunities to network and reconnect, alumni in attendance, many now running companies or in senior technical or academic positions, were given an overview on current Viterbi happenings by Dean Yannis C. Yortsos.
USC delegation returns from visit to IsraelFebruary 27, 2012USC recently concluded an educational visit to Israel that explored the country's advanced science and technology sector, strengthened ties to the research and teaching community, and produced high-level discussions with leaders in government, industry and cultural organizations.
Viterbi students celebrate the 2012 Chinese New Year.January 31, 2012During a celebratory dinner last Monday at the Doheny Library, many Viterbi Chinese undergraduate students, senior faculty and staff were joined by Dean Yortsos to usher in the 2012 Chinese New Year — the year of the dragon.
Dean Yortsos visits over a thousand alumni, friends in Hong Kong, Taipei, Shenzhen, Shanghai and Beijing.November 09, 2011 Viterbi Dean Yannis C. Yortsos traveled to Hong Kong, Shenzhen, Taipei, Shanghai and Beijing last month to renew friendships and to share news of progress and plans with alumni, parents and friends of the USC Viterbi School of Engineering.
New Partners in Asia: USC Viterbi and China University of Petroleum (CUP) November 01, 2011 USC Viterbi School Dean Yannis C. Yortsos and four USC petroleum engineering professors recently presented a workshop in Beijing in collaboration with faculty from the China University of Petroleum (CUP), the premier university in China for the study of petroleum engineering.
USC Signs MOU in TaiwanOctober 19, 2011 USC Viterbi School of Engineering dean Yannis C. Yortsos signed a Memorandum of Understanding (MOU) with National Tsing Hua University in Taiwan on Oct. 17.
IIT Bombay Sends High Level Delegation to the Viterbi School.October 14, 2011 One of India's most prestigious technical institutions recently sent a scouting party to the USC Viterbi School of Engineering looking for talent. Besides Viterbi alumni teaching at the Indian Institute for Technology (IIT) Bombay, another outcome may be the expansion of the Viterbi iPodia teaching network to the subcontinent.
China Meets Taiwan in Viterbi's "No Distance" ClassroomAugust 08, 2011 Imagine the best students with the best faculty — all connected around the world under the banner of USC Viterbi's iPodia. Stephen Lu already has.Professor Stephen Lu calls it "No Distance Learning."
USC Viterbi School and Tsinghua University Hold Fifth Faculty SummitJuly 29, 2011 The ongoing collaboration between the USC Viterbi School of Engineering and China's elite Tsinghua University in Beijing recorded its fifth successful year, with a joint faculty summit on "Green and Smart for a Sustainable Future" held on the THU campus.
USC Forges Bonds With IndiaMarch 1, 2011A USC leadership delegation led by president C. L. Max Nikias, first lady Niki Nikias, Board of Trustees chairman Edward P. Roski, Jr. and Gayle Garner Roski traveled across India Feb. 20-27.
2010 Summer Interns Present their ResearchSeptember 1, 2010 Students from across the globe spent 5 to 8 weeks at USC working on research projects with VSoE faculty. There were 13 students from IIT Kharagpur, 18 from Tsinghua University, 7 from Unam University and 5 from Korea Aerospace University.
USC Viterbi Rises in Rankings
The USC Viterbi School of Engineering is now ranked 10th in the world in engineering, technology and computer science programs in the 2010 Shanghai Jiao Tong University rankings.
I-Podium Class Completed
The first joint VSoE and PKU I-Podium class completed this summer. VSoE students went to eijing to work with PKU students on their projects.
Seminar in Washington DC
In a three-day seminar in Washington, D.C. USC Chinese graduate students discussed American foreign policy and towards China in particular.
USC and Tsinghua University Engineering Faculty GatherMarch 30, 2010 Faculty from the USC Viterbi School of Engineering and China's leading technical institution gathered at the USC campus April 1-3, 2010 for their fourth annual workshop. The workshop series brought together experts from Viterbi and Tsinghua University's School of Information Science and Technology (SIST) for the three-day meeting.
i-Podium Classes Begin
Viterbi students and their Chinese counterparts discuss global innovation from i-Podium classrooms 6,000 miles apart.
USC and Tshingua Faculty Gather
USC and Tshingua Faculty gather together on April 1st to talk about improving alternative energy use and making information technology more energy-efficient.
USC Opened an Office in Shanghai
USC opened an office in Shanghai in the Chong Hing Financial Center, with the ceremony at the JW Marriott in late October. Read More>>
USC Leads in Enrollment of International Students
USC enrolled more international students than any other American institution of higher education.
International Student Satellite Project in Japan
A new National Science Foundation (NSF) sponsored "International Student Satellite Project" under ASTE Prof. Joseph Wang will send 18 USC students to Japan to participate in the design, building, and operation of micro-satellites over the next three years. Read more>>
VOA Reports on USC Engineering Interns from India
The University of Southern California invites a few students from IIT Kharagpur under the umbrella of a sumer program to work on research projects with professors at the USC Viterbi School of Engineering. VOA reports on USC engineering interns from India.
IIT Kharagpur Summer Research Internships, Year Four
For the fourth year in a row, ten outstanding undergraduates from the Indian Institute of Technology, Kharagpur this summer conducted intensive individual research with top USC faculty.
Viterbi School and Tsinghua U. Deepen Relationship after Three Years of Workshops and Student Exchanges
Great opportunities in the aftermath of the 3rd Tsinghua-USC Annual Workshop which took place May 21 - 24 in Beijing, China. NEW research center to study "green and smart" IT energy applications will be founded as part of the joint partnership between Viterbi School and Tsinghua University.
Undergrad Summer Interns Present Their Research
Thirty-eight students from the U.S., India and China wind up their Viterbi School projects - and some will retun to USC as grad students.

redpajama_set_name: RedPajamaCommonCrawl


text:
Home > Ghost Sounds: Luigi's Mansion
Ghost Sounds: Luigi's Mansion
Play sounds from all of the Ghosts on Luigi's Mansion.
1, 10, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, Boo, Ghost Sounds: Luigi's Mansion Sound, Google, Ghost Sounds: Luigi's Mansion Sound, No, 11, Oh, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, No, Ghost Sounds: Luigi's Mansion Sound, Wow, Hello, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, 12, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, Hello, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, Call mom, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, 13, Ghost Sounds: Luigi's Mansion Sound, Blah blah blah, Baby, At work, Who, Ghost Sounds: Luigi's Mansion Sound, Ghost Sounds: Luigi's Mansion Sound, Yeah, Not, Right, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 4, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 5, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 6, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 7, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 8, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 9, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, and more. Please enable JavaScript.
Mr. Mackey Sounds
Bobby Hill Sounds: King Of The Hill - Season 1
Enjoli Advert Music
Forever Queensland Football Club Songs
Nescafe Advert Music
Keanu Reeves Sounds
Zelda And Sheik Sounds: Super Smash Bros. Melee
Tony Hatch Football Club Songs
Paul Phoenix Sounds: Tekken
Hostess Twinkies Advert Music
Hardbass Soundboard
Paco Rabanne Advert Music
HBO Go Advert Music
Cadillac Advert Music
Olympia Beer Advert Music
Andrew Dice Clay Sounds
Yoshi Sounds: Super Smash Bros. Melee
Avery Bullock Sounds: American Dad - Seasons 1, 2, And 3
Stewie Griffin Soundboard
Anne Ramsey Sounds: Throw Momma From The Train
Yeo Valley Advert Music
Mario Kart 64 Sounds
WTF Boom Sounds
Homestar Talker Sounds


About : Xiang Yun is a popular Singaporean actress and television host. She was born on 27 October 1961 in Singapore. Xiang Yun is known as a senior actress in Mediacorp because she is working in the entertainment industry for more than 30 years. Currently, she is working on some upcoming projects named as New Little Nyonya which may be released soon in next year. She is married to former Mediacorp Actor Edmund Chen.


text:
\section*{Acknowledgments}
\input{sections/acknowledgments.tex}

\section*{Code and Data Availability Statement}
The code and datasets for this study can be found at: \href{https://gitlab.cern.ch/kalos/clue/tree/V_01_20}{gitlab.cern.ch/kalos/clue}.

\input{sections/appendix.tex}

\end{document}

\section{Conclusion}
\label{sec:conclusion}

The clustering algorithm is an important part in the shower reconstruction of
high granularity calorimeters to identify hot regions of energy deposits. It is
required to be computationally linear with data scale $n$, independent from
prior knowledge of the number of clusters $k$ and conveniently parallelizable
when $n > k \gg m \equiv \frac{n}{k}$ in 2D. However, most of the well-known
algorithms do not simultaneously support linear scalability and easy
parallelization. CLUE is proposed to efficiently perform clustering tasks in
low-dimension space with $n > k \gg m$, including (and beyond) the applications
in high granularity calorimeters. The clustering time scales linearly with the
number of input hits in the range of multiplicity that is relevant for, e.g.,
the high granularity calorimeter of the CMS experiment at CERN. We evaluated the
performance of CLUE on synthetic data and demonstrated its capability of
non-spherical cluster shape with adjustable noise rejection. Furthermore, the
studies suggest that CLUE on GPU outperforms single thread CPU by more than an
order of magnitude within the data scale ranging from $n=10^5$ to $10^6$.

\section{Introduction}
\label{sec:introduction}

Calorimeters with high lateral and longitudinal readout granularity, capable of
providing a fine grained image of electromagnetic and hadronic showers, have
been suggested for future high energy physics experiments
\cite{calice2012calorimetry}. The  silicon sensor readout cells of the CMS
endcap calorimeter (HGCAL) \cite{Collaboration:2293646} for HL-LHC
\cite{Apollinari:2284929} have an area of about $1~\mathrm{cm}^2$.  When a
particle showers, the deposited energy is collected by the sensors on the layers
which the shower traverses.  The purpose of the clustering algorithm when
applied to shower reconstruction is to group together individual energy deposits
(hits) originating from a particle shower. Due to the high lateral granularity,
the number of hits per layer is large, and it is computationally advantageous to
collect together hits in 2D clusters layer-by-layer \cite{Chen:2017btc} and then
associate these 2D clusters, representing energy blobs, in different layers
\cite{Collaboration:2293646}.

However, a computational challenge emerges as a consequence of the large data
scale and limited time budget.
event is tightly constrained by a millisecond-level execution time.  This
constraint requires the clustering algorithm to be highly efficient while
maintaining a low computational complexity. Furthermore, a linear scalability is
strongly desired in order to avoid bottlenecking the performance of the entire
event reconstruction.  Finally, it is highly preferable to have a
fully-parallelizable clustering algorithm to take advantage of the trend of
heterogeneous computing with hardware accelerators, such as graphics processing
units (GPUs), achieving a higher event throughput and a better energy
efficiency.

The input to the clustering algorithm is a set of $n$ hits, whose number varies
from a few thousands to a few millions, depending on the longitudinal and
transverse granularity of the calorimeter as well as on the number of particles
entering the detector. The output is a set of $k$ clusters whose number is
usually one or two order of magnitudes smaller than $n$ and in principle depends
on both the number of incoming particles and the number of layers. Assuming that
the lateral granularity of sensors is constant and finite, the average number of
hits in clusters ($m=n/k$) is also constant and finite. For example, in the CMS
HGCAL, $m$ is in the order of 10. This leads to the relation among the number of
hits $n$, the number of clusters $k$, and the average number of hits in clusters
$m$ as $n > k \gg m$.

Most well-known algorithms do not simultaneously satisfy the requirements on
linear scalability and easy parallelization for applications like clustering
hits in high granularity calorimeters, which is characterized by low dimension
and $n > k \gg m$. It is therefore important to investigate new, fast and
parallelizable clustering algorithms, as well as their optimized accompanying
spatial index that can be conveniently constructed and queried in parallel.

In this paper, we describe CLUE (CLUstering of Energy), a novel and parallel
density-based clustering. Its development was inspired by the work described in
ref.~\cite{rodriguez2014clustering}. In Section~\ref{sec:algorithm}, we describe
the CLUE algorithm and its accompanying spatial index. Then in
Section~\ref{sec:implementation}, some details of GPU implementations are
discussed. Finally, in Section~\ref{sec:performance} we present CLUE's ability
on non-spherical cluster shapes and noise rejection, followed by its
computational performance when executed on CPU and GPU with synthetic data,
mimicking hits in high granularity calorimeters.

\section{Clustering Algorithm}
\label{sec:algorithm}

Clustering data is one of the most challenging tasks in several scientific domains. The definition of cluster is itself not trivial, as it strongly depends on the context. Many clustering methods have been developed based on a variety of induction principles \cite{maimon2005data}. Currently popular clustering algorithms include (but are not limited to) partitioning, hierarchical and density-based approaches \cite{maimon2005data,han2011data}. Partitioning approaches, such as k-mean \cite{lloyd1982least}, compose clusters by optimizing a dissimilarity function based on distance. However, in the application to high granularity calorimeters, partitioning approaches are prohibitive because the number of clusters $k$ is not known a priori. Hierarchical methods make clusters by constructing a dendrogram with a recursion of splitting or merging. However, hierarchical methods do not scale well because each decision to merge or split needs to scan over many objects or clusters \cite{han2011data}. Therefore, they are not suitable for our application. Density-based methods, such as DBSCAN \cite{Ester:1996:DAD:3001460.3001507}, OPTICS \cite{Ankerst:1999:OOP:304182.304187} and Clustering by Fast Search and Find Density Peak (CFSFDP) \cite{rodriguez2014clustering}, group points by detecting continuous high-density regions. They are capable of discovering clusters of arbitrary shapes and are efficient for large spatial database. If a spatial index is used, their computational complexity is $O(n\log n)$ \cite{han2011data}. However, one of the potential weaknesses of the currently well-known density-based algorithms is that they intrinsically include serial processes which are hard to parallelize: DBSCAN has to iteratively visit all points within an enclosure of density-connectedness before working on the next cluster \cite{Ester:1996:DAD:3001460.3001507}; OPTICS needs to sequentially add points in an ordered list to obtain a dendrogram of reachability distance \cite{Ankerst:1999:OOP:304182.304187}; CFSFDP needs to sequentially assign points to clusters in order of decreasing density \cite{rodriguez2014clustering}. In the application to high granularity calorimeters, as discussed in Section~\ref{sec:introduction}, linear scalability and fully parallelization are essential to handle a huge dataset efficiently by means of heterogeneous computing.

In order to satisfy these requirements, we propose a fast and fully-parallelizable density-based algorithm (CLUE) inspired by CFSFDP. For the purpose of the algorithm, each sensor cell on a layer with its energy deposit is taken as a 2D point with an associated weight equalling to its energy value. As in CFSFDP, two key variables are calculated for each point: the local density $\rho$ and the separation $\delta$ defined in Equation~\ref{eqn:algorithm:defineRho} and \ref{eqn:algorithm:defineDelta}, where $\delta$ is the distance to the nearest point with higher density (``nearest-higher'') which is slightly adapted from that in CFSFDP in order to take advantage of the spatial index. Then cluster seeds and outliers are identified based on thresholds on $\rho$ and $\delta$. Differing from cluster assignment in CFSFDP, which sorts density and adds points to clusters in order of decreasing density, CLUE first builds a list of followers for each point by registering each point as a follower to its nearest-higher. Then it expands clusters by passing cluster indices from the seeds to their followers iteratively. Since such expansion of clusters is fully independent from each others, it not only avoids the costly density sorting in CFSFDP, but also enables a $k$-way parallelization. Unlike the noise identification in CFSFDP, CLUE rejects noise by identifying outliers and their iteratively descendant followers, as discussed in Section~\ref{sec:performance:clusteringResults}.

\subsection{Spatial index with fixed-grid}
Query of neighbourhood, which retrieves nearby points within a distance, is one of the most frequent operations in density-based clustering algorithms. CLUE uses a spatial index to access and query spatial data points efficiently. Given that the physical layout of sensor cells is a multi-layer tessellation, it is intuitive to index its data with a fixed-grid, which divides the space into fixed rectangular bins \cite{bentley1979data,levinthal1966molecular}. Comparing with the data-driven structures such as KD-Tree \cite{Bentley:1975:MBS:361002.361007} and R-Tree \cite{Guttman:1984:RDI:971697.602266}, space partition in fixed-grid is independent of any particular distribution of data points \cite{rigaux2001spatial}, thus can be explicitly predefined before loading data points. In addition, both construction and query with a fixed-grid are computationally simple and can be easily parallelized. Therefore, CLUE uses a fixed-grid as spatial index for efficient neighbourhood queries.

\begin{figure}[ht]
    \centering
    \includegraphics[width=0.4\textwidth]{figures/Figure1.png}
    \caption{2D points are indexed with a grid for fast neighbourhood query in CLUE. Construction of this spatial index only involves registering the indices of points into the bins of the grid according to points' 2D spatial positions. To query d-neighbourhood $N_d(i)$ defined in Equation~\ref{eqn:algorithm:defineNeighborhood}, taking the red (blue) point for example, we first locate its $\Omega_d(i)$ defined in Equation~\ref{eqn:algorithm:defineSearchBox}, a set of all points in the bins touched by a square window $[x_i\pm d,y_i\pm d]$. The $[x_i\pm d,y_i\pm d]$ window is shown as the orange (green) square while $\Omega_d(i)$ is shown as orange (green) points. Then we examine points in $\Omega_d(i)$ to identify those within a distance $d$ from point $i$, shown as the ones contained in the red (blue) circle.}
    \label{fig:algorithm:searchBox}
\end{figure}

For each layer of the calorimeter, a fixed-grid spatial index is constructed by registering the indices of 2D points into the square bins in the grid according to the 2D coordinates of the points. When querying $N_d(i)$, the d-neighbourhood of point $i$, CLUE only needs to loop over points in the bins touched by the square window $(x_i\pm d,y_i\pm d)$ as shown in Fig.~\ref{fig:algorithm:searchBox}. We denote those points as $\Omega_d(i)$, defined as:
\begin{equation} \label{eqn:algorithm:defineSearchBox}
    \Omega_d(i) = \{j : j \in \text{tiles touched by the square window } [x_i\pm d,y_i\pm d] \}.
\end{equation}
\noindent where $\Omega_d(i)$ is guaranteed to include all neighbours within a distance $d$ from the point $i$. Namely,
\begin{equation} \label{eqn:algorithm:defineNeighborhood}
    N_d(i)=\{j: d_{ij}<d, j \in \Omega_d(i) \} \subseteq \Omega_d(i).
\end{equation}
\noindent Without any spatial index, the query of $N_d(i)$ requires a sequential scan over all points. In contrast, with the grid spatial index, CLUE only needs to loop over the points in $\Omega_d(i)$ to acquire $N_d(i)$. Given that $d$ is small and the maximum granularity of points is constant, the complexity of querying $N_d(i)$ with a fixed-grid is $O(1)$.

\subsection{Clustering procedure of CLUE}

CLUE requires the following four parameters: $d_c$ is the cut-off distance in the calculation of local density; $\rho_c$ is the minimum density to promote a point as a seed or the maximum density to demote a point as an outlier; $\delta_c$ and $\delta_o$ are the minimum separation requirements for seeds and outliers, respectively. The choice of these four parameters can be based on physics: for example, $d_c$ can be chosen based on the shower size and the lateral granularity of detectors; $\rho_c$ can be chosen to exclude noise; $\delta_c$ and $\delta_o$ can be chosen based on the shower sizes and separations. These four parameters allow more degrees of freedom to tune CLUE for the desired goals of physics.

\begin{figure}[ht]
    \centering
    \includegraphics[trim=5cm 0cm 4cm 0cm, clip,width=0.99\textwidth]{figures/Figure2.pdf}
    \caption{Demonstration of CLUE algorithm. Points are distributed inside a $6\times6$ 2D area and CLUE parameters are set to $d_c=0.5,\rho_c=3.9,\delta_c=\delta_o=1$. Before the clustering procedure starts, a fixed-grid spatial index is constructed. In the first step, shown as Fig.~\ref{fig:algorithm:procedure} (a), CLUE calculates the local density $\rho$ for each point, which is defined in Equation~\ref{eqn:algorithm:defineRho}. The color and size of points represent their local densities. In the second step, shown as Fig.~\ref{fig:algorithm:procedure} (b), CLUE calculates the nearest-higher $nh$ and the separation $\delta$ for each point, which are defined in Equation~\ref{eqn:algorithm:defineDelta}. The black arrows represent the relation from the nearest-higher of a point to the point itself. If the nearest-higher of a point is -1, there is no arrow pointing to it. In the third step, shown as Fig.~\ref{fig:algorithm:procedure} (c), CLUE promotes a point as a seed if $\rho,\delta$ are both large, or demote it to an outlier if $\rho$ is small and $\delta$ is large. Promoted seeds and demoted outliers are shown as stars and grey squares, respectively. In the fourth step, shown as Fig.~\ref{fig:algorithm:procedure} (d), CLUE propagates the cluster indices from seeds through their chains of followers defined in Equation~\ref{eqn:algorithm:defineFollowers}. Noise points, which are outliers and their descendant followers, are guaranteed not to receive any cluster ids from any seeds. The color of points represents the cluster ids. A grey square means its cluster id is undefined and the point should be considered as noise.
    }
    \label{fig:algorithm:procedure}
\end{figure}

Figure~\ref{fig:algorithm:procedure} illustrates the main steps of CLUE algorithm. The local density $\rho$ in CLUE is defined as:
\begin{equation} \label{eqn:algorithm:defineRho}
    \rho_i = \sum_{j: j \in N_{d_c}(i)} \chi(d_{ij}) w_j,
\end{equation}
\noindent where $w_j$ is the weight of point $j$, $\chi(d_{ij})$ is a convolution kernel, which can be optimized according to specific applications. Obvious possible kernel options include flat, Gaussian and exponential functions.

The nearest-higher and the distance to it $\delta$ (separation) in CLUE are defined as:
\begin{equation} \label{eqn:algorithm:defineDelta}
    nh_i =
    \begin{cases}
        \arg\min_{j \in N'_{d_m}(i) } d_{ij},   & \text{if } |N'_{d_m}(i)| \neq 0  \\
        -1,                                     & \text{otherwise}
    \end{cases},
    \quad
    \delta_i =
    \begin{cases}
        d_{i,nh_i}, & \text{if }  |N'_{d_m}(i)| \neq 0 \\
        +\infty,    & \text{otherwise}
    \end{cases},
\end{equation}
\noindent where $d_m= \max (\delta_o, \delta_c)$ and $N'_{d_m}(i) = \{ j : \rho_j > \rho_i, j \in N_{d_m}(i) \}$ is a subset of $N_{d_m}(i)$, where points have higher local densities than $\rho_i$.

After $\rho$ and $\delta$ are calculated, points with density $\rho>\rho_c$ and large separation $\delta>\delta_c$ are promoted as cluster seeds, while points with density $\rho<\rho_c$ and large separation $\delta>\delta_o$ are demoted to outliers. For each point, there is a list of followers defined as:
\begin{equation} \label{eqn:algorithm:defineFollowers}
    F_i = \{j : nh_j=i \}.
\end{equation}
\noindent The lists of followers are built by registering the points which are neither seeds nor outliers to the follower lists of their nearest-highers. The cluster indices, associating a follower with a particular seed, are passed down from seeds through their chains of followers iteratively. Outliers and their descendant followers are guaranteed not to receive any cluster indices from seeds, which grants a noise rejection as shown in Fig.~\ref{fig:performance:outlierCuts}. The calculation of $\rho, \delta$ and the decision of seeds and outliers both support $n$-way parallelization, while the expansion of clusters can be done with $k$-way parallelization.
Pseudocode of CLUE is included in Appendix~\ref{app:pseudocode}.

\section{GPU Implementation}
\label{sec:implementation}

To parallelize CLUE on GPU, one GPU thread is assigned to each point, for a
total of $n$ threads, to construct spatial index, calculate $\rho$ and $\delta$,
promote (demote) seeds (outliers) and register points to the corresponding lists
of followers of their nearest-highers. Next, one thread is assigned to each
seed, for a total of $k$ threads, to expand clusters iteratively along chains of
followers. The block size of all kernels, which in practice does not have a
remarkable impact on the speed performance, is set to 1024. In the test in
Table~\ref{tbl:performance:breakdown}, changing the block size from 1024 to 256
on GPU leads to only about $0.14$~ms decrease in the sum of kernel execution
times. The details of parallelism for each kernel are listed in
Table~\ref{tbl:implementation:parallelism}. Since the results of a CLUE step are
required in the following steps, it is necessary to guarantee that all the
threads are synchronized before moving to the next stage. Therefore, each CLUE
step can be implemented as a separate kernel. To optimize the performance of
accessing the GPU global memory with coalescing, the points on all layers are
stored as a single structure-of-array (SoA), including information of their
layer numbers and 2D coordinates and weights. Thus points on all layers are
input into kernels in one shot.

\begin{table}[t]
    \renewcommand{\arraystretch}{1.25}

    \centering
    \begin{tabular}{l|l|c|c}
        \hline
        Kernels                                  & parallelism    & total threads & block size \\
        \hline
        build fixed-grid spatial index           & 1 point/thread & n             & 1024 \\
        calculate local density                  & 1 point/thread & n             & 1024 \\
        calculate nearest-higher and separation  & 1 point/thread & n             & 1024 \\
        decide seeds/outliers, register followers& 1 point/thread & n             & 1024 \\
        expand clusters                          & 1 seed/thread  & k             & 1024 \\
        \hline
    \end{tabular}
    \caption{Kernels and Parallelism}
    \label{tbl:implementation:parallelism}
\end{table}

When parallelizing CLUE on GPU, thread conflicts to access and modify the same
memory address in global memory could happen in the following three cases:

\begin{enumerate}[i)]
    \item ~multiple points need to register to the same bin simultaneously;
    \item ~multiple points need to register to the list of seeds simultaneously;
    \item ~multiple points need to register as followers to the same point simultaneously.
\end{enumerate}

\noindent Therefore, atomic operations are necessary to avoid the race
conditions among threads in the global memory. During an atomic operation, a
thread is granted with an exclusive access to read from and write to a memory
location which is inaccessible to other concurrent threads until the atomic
operation finishes.

This inevitably leads to some microscopic serialization among threads in race.
The serialization in cases (i) and (iii) is negligible because bins are usually
small as well as the number of followers of a given point. In contrast,
serialization in case (ii) can be costly because the number of seeds $k$ is
large. This can cause delays in the execution of kernel responsible for seed
promotion. Since the atomic pushing back to the list of seeds is relatively fast
in GPU memory comparing to the data transportation between host and device, the
total execution time of CLUE still does not suffer significantly from the
serialization in case (ii). The speed performance is further discussed in
Section~\ref{sec:performance}.

\section{Performance Evaluation}
\label{sec:performance}

\subsection{Clustering results}
\label{sec:performance:clusteringResults}

\begin{figure}[ht]
    \centering
    \includegraphics[clip, width=0.7\textwidth]{figures/Figure3_cut_boh.pdf}
    \caption{
    Examples of CLUE clustering on synthetic datasets. Each sample includes 1000
    2D points with the same weight generated from certain distributions,
    including uniform noise points. The color of points represent their cluster
    ids. Black points represent outliers detached from any clusters. The links
    between pairs of points illustrate the relationship between nearest-higher
    and follower. The red stars highlight the cluster seeds.  }
    \label{fig:performance:example}
\end{figure}

We demonstrate the clustering results of CLUE with a set of synthetic datasets,
shown in Fig.~\ref{fig:performance:example}. Each example has 1000 2D points and
includes spatially uniform noise points. The datasets in
Fig.~\ref{fig:performance:example} (a) and (c)  are from the scikit-learn
package~\cite{scikit-learn}. The dataset in Fig.~\ref{fig:performance:example}
(b) is taken from~\cite{rodriguez2014clustering}.
Fig~\ref{fig:performance:example} (a) and (b) include elliptical clusters and
Fig~\ref{fig:performance:example} (c) contains two parabolic arcs. CLUE
successfully detects density peaks in Figs.~\ref{fig:performance:example} (a),
(b), and (c).

\begin{figure}[ht]
    \centering
    \includegraphics[trim=3.5cm 0cm 3.5cm 0cm, clip,width=0.99\textwidth]{figures/Figure4.pdf}
    \caption{Noise rejection using different values of $\delta_o$. Noise is
    either an outlier or a descendant follower of an outlier. In this
    dataset~\cite{rodriguez2014clustering}, 4000 Points are distributed in
    $500\times500$ 2D square area. Figure~\ref{fig:performance:outlierCuts} (a)
    represents the decision plot on the $\rho-\delta$ plane, where fixed
    $\rho_c=80$ and $\delta_c=40$ values are shown as vertical and horizontal
    blue lines, respectively. Three different values of $\delta_o$ (10,20,60)
    are shown as orange dash lines. Figures~\ref{fig:performance:outlierCuts}
    (b), (c) and (d) show the results with $\delta_o=10,20,60$, respectively,
    illustrating how increasing $\delta_o$ loosens the continuity requirement
    and helps to demote outliers. The level of denoise should be chosen
    according to the user's needs.} \label{fig:performance:outlierCuts}
\end{figure}

In the induction principle of density-based clustering, the confidence of
assigning a low density point to a cluster is established by maintaining the
continuity of the cluster. Low density points with large separation should be
deprived of association to any clusters. CFSFDP uses a rather costly technique,
which calculates a boarder region of each cluster and defines core-halo points
in each cluster, to detach unreliable assignments from
clusters~\cite{rodriguez2014clustering}. In contrast, CLUE achieves this using
cuts on $\delta_o$ and $\rho_c$ while expanding a cluster, as described in
Section~\ref{sec:algorithm}. The example in
Fig.~\ref{fig:performance:outlierCuts} shows how cutting at different separation
values helps to demote outliers. Figure~\ref{fig:performance:outlierCuts} (a)
represents the decision plot on the $\rho-\delta$ plane. Points with density
below $\rho_c=80$, shown on the left side of the vertical blue line, could be
demoted as outliers if their $\delta$ are larger than a threshold. Once an
outlier is demoted, all its descendant followers are disallowed from attaching
to any clusters. While keeping $\rho_c=80$ fixed, the effect of using three
different values of $\delta_o$ (10, 20, 60), shown as orange dash lines in
Fig.~\ref{fig:performance:outlierCuts} (a), has been investigated. The
corresponding results are shown in Fig.~\ref{fig:performance:outlierCuts} (b),
(c) and (d), respectively.

\subsection{Execution time and scaling}
\label{sec:performance:executionTime}

\begin{figure}[ht!]
    \centering
    \includegraphics[width=0.9\textwidth]{figures/Figure5_patatrack02_1.pdf}
    \caption{(\emph{Upper}) Execution time of CLUE on the single-threaded CPU,
    multi-threaded CPU with TBB and GPU scale linearly with number of input
    points, ranging from $10^5$ to $10^6$ in total. Execution time on
    single-threaded CPU is shown as blue circle dots and on 10 multi-threaded
    CPU with TBB is shown as blue square dots, while the time on GPU is shown as
    green circle dots. The stacked bars represent the decomposition of execution
    time. The green and blue narrower bars are latency for data traffic between
    host memory and device memory; wider bars represent time of essential CLUE
    steps; light grey narrower bars labelled as ``other'' are the difference
    between the total execution time and the sum of major CLUE steps (and major
    CUDA API calls if GPU). (\emph{Lower}) Comparing with the single-threaded
    CPU, the speed-up factors of the GPU range from 48 to 112,  while the
    speed-up factors of the multi-threaded CPU with TBB range from 1.2 to 2.0,
    which is less than the number of concurrent threads on CPU because of atomic
    pushing to the data containers discussed in
    Section~\ref{sec:implementation}. Table~\ref{tbl:performance:breakdown}
    shows the details of the decomposition of the execution time in the case of
    $10^4$ points per layer. }
    \label{fig:performance:executationTime}
\end{figure}

\begin{table}[ht!]
    \renewcommand{\arraystretch}{1.25}
    \tiny
    \centering

    \begin{tabular}{l|r@{}l|r@{}l|r@{}l}
    \hline
    CLUE Step                                 & \multicolumn{2}{c}{CPU [1T] (baseline)}         & \multicolumn{2}{c}{CPU TBB [10T]}                    & \multicolumn{2}{c}{GPU}  \\ \hline
    build fixed-grid spatial index            &  59.3 $\pm$&  ~1.6 ms       & 117.7 $\pm$&  ~6.4 ms ( 0.50x)        &   0.28 ms& ~(208.63x)       \\
    calculate local density                   & 218.4 $\pm$&  ~2.5 ms       &  33.7 $\pm$&  ~2.6 ms ( 6.48x)        &   0.51 ms& ~(430.57x)       \\
    calculate nearest-higher and separation   & 326.9 $\pm$&  ~2.9 ms       &  45.5 $\pm$&  ~2.5 ms ( 7.19x)        &   0.89 ms& ~(368.54x)       \\
    decide seeds/outliers, register followers &  54.4 $\pm$&  ~2.5 ms       & 109.4 $\pm$&  ~7.7 ms ( 0.50x)        &   0.34 ms& ~(162.38x)       \\
    expand clusters                           &  17.4 $\pm$&  ~1.5 ms       &   6.1 $\pm$&  ~1.3 ms ( 2.86x)        &   0.35 ms& ~( 49.74x)       \\ \hline
    cuda memcpy                               & --&                         & --&                                  &   2.87 ms&                   \\
    cuda memset                               & --&                         & --&                                  &   0.10 ms&                   \\
    other                                     &  29.1 $\pm$&  ~1.7 ms       &  44.9 $\pm$& ~15.7 ms                 &   1.30 ms&                  \\ \hline
    \textbf{TOTAL} (10000 points per layer)   & \textbf{705.49 $\pm$}&  ~\textbf{7.93 ms} & \textbf{357.24 $\pm$}& ~\textbf{19.68 ms ( 1.97x)} & \textbf{  6.63 $\pm$ 0.63 ms}& ~\textbf{(106.42x)}  \\
    \hline
    \end{tabular}

    \caption{Decomposition of CLUE execution time in the case of $10^4$ points
    per layer with 100 layers. The time of sub-processes on GPU is measured with
    NVIDIA profiler, while on CPU is measured with \texttt{std::chrono} timers
    in the C++ code. The uncertainties are the standard deviations of 200 trial
    runs of the same event (10000 trial runs if GPU). The uncertainties of
    sub-processes on GPU are negligible given that the maximum and minimum kernel execution time measured by NVIDIA Profiler are very close. With respect to the single-threaded CPU, the speed-up factors of the multi-threaded CPU with TBB and the GPU are given in the bracket. ``other" represents the difference between total execution time and the sum of the execution time of CLUE steps (and major CUDA API calls if GPU).}
    \label{tbl:performance:breakdown}
\end{table}

We tested the computational performance of CLUE using a synthetic dataset that
resembles high occupancy events in high granularity calorimeters operated at
HL-LHC. The dataset represents a calorimeter with 100 sensor layers. A fixed
number of points on each layer are assigned a unit weight in such a way that the
density represents circular clusters of energy whose magnitude decreases
radially from the centre of the cluster according to a Gaussian distribution
with the standard deviation, $\sigma$, set to $3$~cm.  $5$\% of the points
represent noise distributed uniformly over the layers. When clustering with
CLUE, the bin size is set to $5$~cm comparable with the width of the clusters
and the algorithm parameters are set to $d_c=3 \text{ cm},\delta_o=\delta_c=5
\text{ cm},\rho_c=8$. To test CLUE's linear scaling, the number of points on
each layer is incremented from 1000 to 10000 in 10 equalling steps. A total of
100 layers are input to CLUE simultaneously which simulates the proposed CMS
HGCAL design~\cite{Collaboration:2293646}. Therefore the total number of points
in the test ranges from $10^5$ to $10^6$.
The linear scaling of execution time are validated in
Fig.~\ref{fig:performance:executationTime}.

The single-threaded version of the CLUE algorithm on CPU has been implemented in
C++, while the one on GPU has been implemented in C with
CUDA~\cite{nvidia2011nvidia}. The multi-threaded version of CLUE on CPU uses the
Thread Building Block (TBB) library~\cite{reinders2007intel} and has been
implemented using the Abstraction Library for Parallel Kernel Acceleration
(Alpaka)~\cite{zenker2016alpaka}. The test of the execution time is performed on
an Intel Xeon Silver 4114 CPU and NVIDIA Tesla V100 GPU connected by PCIe Gen-3
link. The time of each GPU kernel and CUDA API call is measured using the NVIDIA
profiler. The total execution time is averaged over 200 identical events (10000
identical events if GPU). Since CLUE is performed event by event and it is not
necessary to repeat memory allocation and release for each event when running on
GPU, we perform a one-time allocation of enough GPU memory before processing
events and a one-time GPU memory deallocation after finishing all events.
Therefore, the one-time \emph{cudaMalloc} and \emph{cudaFree} are not included
in the average execution time. Such exclusion is legit because the number of
events is extremely massive in high energy physics experiments and the execution
time of the one-time \emph{cudaMalloc} and \emph{cudaFree} reused by each
individual event is negligible.

In Fig.~\ref{fig:performance:executationTime} (\emph{upper}), the scaling of
CLUE is linear, consistent with the expectation. The execution time on the
single-threaded CPU, multi-threaded CPU with TBB and GPU increases linearly with
the total number of points. The stacked bars represent the decomposition of
execution time. In the decomposition, unique to the GPU implementation is the
latency of data transfer between host and device, which is shown as blue and
green narrower bars, while common to all the three implementations are the five
CLUE steps. Comparing with the single-threaded CPU, when building spatial index
and deciding seeds, shown as red and pink bars, the multi-threaded CPU using TBB
does not give a notable speed-up due to the implementation of atomic operations
in Alpaka~\cite{zenker2016alpaka} as discussed in
Section~\ref{sec:implementation}, while the GPU has a prominent outperformance
thanks to its larger parallelization scale. For the GPU case, the kernel of
seed-promotion in which serialization exists due to atomic appending of points
in the list of seeds, does not affect the total execution time significantly if
compared with other sub-processes. In the two most computing-intense steps,
calculating density and separation, there are no thread conflicts or inevitable
atomic operations. Therefore, both the multi-threaded CPU using TBB and the GPU
provide a significant speed-up. The details of the decomposition of execution
time in the case of $10^4$ points per layer are listed in
Table~\ref{tbl:performance:breakdown}.

Figure~\ref{fig:performance:executationTime} (\emph{lower}) shows the speed-up
factors. Compared to the single-threaded CPU, the CUDA implementation on GPU is
48-112 times faster, while the multi-threaded version using TBB via Alpaka with
10 threads on CPU is about 1.2-2.0 times faster. The speed-up factors are
constrained to be smaller than the number of concurrent threads because of the
atomic operations that introduce serialization. In
Table~\ref{tbl:performance:breakdown}, the speed-up factors of multi-threaded
CPU using TBB reduce to less than $1$ in the sub-process steps of building
spatial index and promoting seeds and registering followers, where atomic
operations happen and bottleneck the overall speed-up factor.

\section{Pseudocode}
\label{app:pseudocode}

Pseudocode of CLUE in serialized implementation. Parallelization is discussed in Section~\ref{sec:implementation}.

\begin{algorithm}[H]
    \For{$i \in$ points}{
        $\rho_{[i]} = 0$ \\
        \For{$j \in \Omega_{d_c}(i)$ }{
            \If{$ dist(i,j) < d_c$}{
                $\rho_{[i]}$ += $w_{[j]}$
            }
        }
    }
\caption{calculate $\rho$}
\end{algorithm}

\begin{algorithm}[H]
    \For{$i \in$ points}{
        $\delta_{[i]} = +\infty$ \\
        $nh_{[i]} = -1$ \\
        \For{$j \in \Omega_{d_m}(i)$ }{
            \If{ $dist(i,j) < d_m$ \textbf{and} $\rho_{[j]} > \rho_{[i]}$}{
                \If {$dist(i,j) < \delta_{[i]} $}{
                    $nh_{[i]} = j$  \\
                    $\delta_{[i]} = d_{ij}$ \\
                }
            }
        }
    }
\caption{calculate $\delta$}
\end{algorithm}

\begin{algorithm}[H]
    k = 0\;
    stack = [] \;
    \For{i $\in$ points}{
        $isSeed = \rho_{[i]} > \rho_c \textbf{ and } \delta_{[i]} > \delta_c$ \\
        $isOutlier = \rho_{[i]} < \rho_c \textbf{ and } \delta_{[i]} > \delta_o$ \\
        \eIf {$isSeed$}{
            $clusterId_{[i]}$ = k \\
            k++ \\
            stack.pushback(i) \\
        } { \If{not $isOutlier$ }{
            $followers_{[nh_{[i]}]}.pushback(i)$
            }
        }
    }

    \While{stack.size $>$ 0}{
        i = stack.back \\
        stack.popback \\
        \For{$j \in followers_{[i]}$}{
            $clusterId_{[j]} = clusterId_{[i]}$ \\
            stack.pushback(j) \\
        }
    }

\caption{find seeds and outliers, assign clusters}
\label{algo:algorithm:assignClusters}
\end{algorithm}

redpajama_set_name: RedPajamaArXiv


text:
Q: Migrating live wordpress site to local, get weird error on sub page So I'm trying to work on an existing Wordpress site locally with the end goal of building a custom plugin. I've copied the database and files, updated the wp-config file and updated any links in posts. I can access homepage just fine on localhost but for any other pages I just get
Error thrown
Using $this when not in object context

With no line for this error and there's nothing in the logs I can find either, so I'm at a loss for where to start looking for how to fix this. Even pointing me a direction would be very helpful